diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a5039769..b9fd46415 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable user-facing changes to MTPLX. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow [Semantic Versioning](https://semver.org/). +## [Unreleased] + +### Fixed + +- **A cancelled request keeps its cache outcome in the request log.** A streamed turn the client closed during decode was written with `session_cache_hit: false` and no `cached_tokens`, `cache_source` or `ttft_s`, so the dashboard showed it as a "MISS" and counted it against the hit rate, even when its prompt had been restored from the cache. The receipt now carries the cache outcome of the completed prefill (`session_cache_hit`, `cached_tokens`, `new_prefill_tokens`, `cache_source`, `cache_miss_reason`, the SSD fields) and `ttft_s`; when the request was cancelled before its prefill finished, these are `null` (unknown). The dashboard gives a cancelled row its own badge, such as "cancelled · client · 3m 0s", with the cache outcome beside it, and leaves cancelled requests out of the hit rate. + ## [2.12.2] - 2026-10-03 ### Fixed diff --git a/dashboard/src/components/CacheTiles.tsx b/dashboard/src/components/CacheTiles.tsx index abed0cb50..14a18abe9 100644 --- a/dashboard/src/components/CacheTiles.tsx +++ b/dashboard/src/components/CacheTiles.tsx @@ -1,6 +1,7 @@ import { BigNumber, Card } from "./Card"; import { fmtNumber } from "../lib/utils"; import { useDashboardStore } from "../state/store"; +import { countsTowardHitRate } from "../lib/requestCancel"; export function CumulativeCachedTokensTile() { const lifetime = useDashboardStore((s) => s.lifetime); @@ -21,7 +22,8 @@ export function CumulativeCachedTokensTile() { export function HitRateGauge() { const recent = useDashboardStore((s) => s.recent); - const window = recent.slice(-32); + // A cancelled request says nothing about the cache's hit rate. + const window = recent.filter(countsTowardHitRate).slice(-32); const hits = window.filter((r) => r.session_cache_hit).length; const ratio = window.length > 0 ? (hits / window.length) * 100 : 0; const tone = ratio >= 70 ? "accent" : ratio >= 40 ? "warm" : "hot"; diff --git a/dashboard/src/components/RequestLogTable.tsx b/dashboard/src/components/RequestLogTable.tsx index 67b27aa06..4c04ab61e 100644 --- a/dashboard/src/components/RequestLogTable.tsx +++ b/dashboard/src/components/RequestLogTable.tsx @@ -4,6 +4,7 @@ import { Card } from "./Card"; import { useRecentRequests } from "../hooks/usePolling"; import { fmtNumber, fmtSeconds, fmtTokS, relativeTime, truncateMiddle } from "../lib/utils"; import { useDashboardStore, useFilteredRecent } from "../state/store"; +import { cancellationOf } from "../lib/requestCancel"; import type { MetricsLatest } from "../lib/types"; export function RequestLogTable() { @@ -122,7 +123,7 @@ function Td({ ); } -function Row({ +export function Row({ row, isOpen, onToggle, @@ -132,11 +133,23 @@ function Row({ onToggle: () => void; }) { const sessionId = row.session_id ?? "—"; - const cacheBadge = row.session_cache_hit - ? { label: "HIT", color: "text-[var(--accent)] bg-[var(--accent)]/10" } + const cancellation = cancellationOf(row); + const cacheBadge = cancellation + ? { + label: cancellation.label, + color: "text-[var(--text-muted)] bg-[var(--text-muted)]/10", + tooltip: cancellation.tooltip as string | undefined, + } + : row.session_cache_hit + ? { + label: "HIT", + color: "text-[var(--accent)] bg-[var(--accent)]/10", + tooltip: undefined, + } : { label: (row.cache_miss_reason ?? "MISS").toUpperCase(), color: "text-[var(--accent-warm)] bg-[var(--accent-warm)]/10", + tooltip: undefined, }; return ( <> @@ -164,10 +177,16 @@ function Row({ {fmtNumber(row.verify_calls)} {cacheBadge.label} + {cancellation?.cacheHint ? ( + + {cancellation.cacheHint} + + ) : null} diff --git a/dashboard/src/lib/requestCancel.ts b/dashboard/src/lib/requestCancel.ts new file mode 100644 index 000000000..17bd085b5 --- /dev/null +++ b/dashboard/src/lib/requestCancel.ts @@ -0,0 +1,89 @@ +import type { MetricsLatest } from "./types"; +import { fmtNumber, fmtSeconds } from "./utils"; + +export type Cancellation = { + /** Badge text, e.g. "cancelled · client · 3m 0s". */ + label: string; + /** Why and after how long, in a sentence, plus the cache outcome. */ + tooltip: string; + /** The cache outcome the request still had, e.g. "hit 92,636"; null when unknown. */ + cacheHint: string | null; +}; + +// Short names for the badge; the tooltip carries the raw reason. The keys are +// the server's cancellation reasons (the cancel origins in openai.py). +const REASON_LABELS: Record = { + client_disconnected: "client", + client_disconnect: "client", + stream_cancelled: "stream", + stream_teardown: "stream", + stream_stall: "stall", + stop_sequence: "stop", + early_tool_finish: "tool call", + hidden_tool_guard: "tool guard", + post_endpoint: "cancel call", +}; + +const REASON_SENTENCES: Record = { + client_disconnected: "the client closed the connection", + client_disconnect: "the client closed the connection", + stream_stall: "the stream stalled", + stop_sequence: "a stop sequence ended the answer", + early_tool_finish: "the server finished the tool call early", + hidden_tool_guard: "the hidden-tool stream guard stopped it", + post_endpoint: "POST /v1/mtplx/cancel stopped it", +}; + +function humanize(value: string): string { + return value.replace(/_/g, " "); +} + +/** + * The cache outcome a cancelled row still reports; null when the server did + * not know it yet. Older servers wrote `session_cache_hit: false` and no + * `cached_tokens` on every cancelled row, so without a token count the + * outcome is unknown as well. + */ +export function cancelledCacheHint(row: MetricsLatest): string | null { + if (row.cached_tokens === null || row.cached_tokens === undefined) return null; + if (row.session_cache_hit === true) { + const source = row.cache_source && row.cache_source !== "ram" ? ` ${row.cache_source}` : ""; + return `hit${source} ${fmtNumber(row.cached_tokens)}`; + } + if (row.session_cache_hit === false) { + return row.cache_miss_reason ? `miss: ${humanize(row.cache_miss_reason)}` : "miss"; + } + return null; +} + +/** + * Describe a request that was cancelled before it finished, or null for one + * that ran to the end. Its row would otherwise fall back to the MISS badge, + * whatever the cache did. + */ +export function cancellationOf(row: MetricsLatest): Cancellation | null { + if (!row.request_cancelled) return null; + const reason = row.cancellation_reason ?? ""; + const elapsed = row.cancellation_elapsed_s ?? row.request_elapsed_s; + const parts = ["cancelled"]; + if (reason) parts.push(REASON_LABELS[reason] ?? humanize(reason)); + if (typeof elapsed === "number" && Number.isFinite(elapsed)) parts.push(fmtSeconds(elapsed)); + const why = reason ? (REASON_SENTENCES[reason] ?? humanize(reason)) : "unknown reason"; + const after = + typeof elapsed === "number" && Number.isFinite(elapsed) ? ` after ${fmtSeconds(elapsed)}` : ""; + const cacheHint = cancelledCacheHint(row); + const cacheLine = + cacheHint === null + ? "Cache outcome unknown: the request ended before its prompt was read." + : `Cache: ${cacheHint}.`; + return { + label: parts.join(" · "), + tooltip: `Cancelled${after}: ${why}${reason ? ` (${reason})` : ""}.\n${cacheLine}\nNot counted in the hit rate.`, + cacheHint, + }; +} + +/** Rows that count toward a cache hit rate: requests that ran to the end. */ +export function countsTowardHitRate(row: MetricsLatest): boolean { + return !row.request_cancelled; +} diff --git a/dashboard/src/lib/types.ts b/dashboard/src/lib/types.ts index 21c8c9627..d9d1c7bc9 100644 --- a/dashboard/src/lib/types.ts +++ b/dashboard/src/lib/types.ts @@ -57,9 +57,16 @@ export type MetricsLatest = { repair_time_by_reject_depth_s?: Record | null; // ---- when the request finished (wall clock, seconds) ---- completed_at_s?: number | null; + // ---- cancellation (a request that did not run to the end) ---- + request_cancelled?: boolean | null; + cancellation_reason?: string | null; + cancellation_elapsed_s?: number | null; + stream_cancelled_by_client?: boolean | null; // ---- cache ---- + // null on a cancelled request whose prefill had not finished: unknown. session_cache_hit?: boolean | null; cache_miss_reason?: string | null; + cache_source?: string | null; session_restore_mode?: string | null; session_id?: string | null; context_len?: number | null; diff --git a/dashboard/tests/requestCancel.test.tsx b/dashboard/tests/requestCancel.test.tsx new file mode 100644 index 000000000..7f34a8d5f --- /dev/null +++ b/dashboard/tests/requestCancel.test.tsx @@ -0,0 +1,105 @@ +import { describe, expect, test } from "bun:test"; +import { renderToStaticMarkup } from "react-dom/server"; +import { Row } from "../src/components/RequestLogTable"; +import { cancellationOf, countsTowardHitRate } from "../src/lib/requestCancel"; +import type { MetricsLatest } from "../src/lib/types"; + +// The receipt of a streamed turn the client closed after 180 s, after its +// prompt was restored from RAM. +const cancelledHit: MetricsLatest = { + session_id: "c3ad535e-27bb-42b1-98d5-9e95ceaa8b6b", + prompt_tokens: 92819, + cached_tokens: 92636, + completion_tokens: 11968, + decode_tok_s: 67.9, + ttft_s: 2.1, + request_cancelled: true, + cancellation_reason: "client_disconnected", + cancellation_elapsed_s: 180.0005, + stream_cancelled_by_client: true, + session_cache_hit: true, + cache_source: "ram", + cache_miss_reason: null, +}; + +const html = (row: MetricsLatest) => + renderToStaticMarkup( + + + {}} /> + +
, + ); + +describe("cancellationOf", () => { + test("names the reason and the duration, and keeps the cache outcome", () => { + const c = cancellationOf(cancelledHit); + expect(c?.label).toBe("cancelled · client · 3m 0s"); + expect(c?.tooltip).toContain("client_disconnected"); + expect(c?.tooltip).toContain("the client closed the connection"); + expect(c?.cacheHint).toBe(`hit ${(92636).toLocaleString()}`); + }); + + test("a miss keeps its reason as the hint", () => { + const c = cancellationOf({ + ...cancelledHit, + session_cache_hit: false, + cache_source: "none", + cache_miss_reason: "evicted", + }); + expect(c?.cacheHint).toBe("miss: evicted"); + }); + + test("a cancel before the prompt was read has no cache outcome", () => { + const c = cancellationOf({ + ...cancelledHit, + session_cache_hit: null, + cached_tokens: null, + cache_source: null, + }); + expect(c?.cacheHint).toBeNull(); + expect(c?.tooltip).toContain("Cache outcome unknown"); + }); + + test("an unknown reason is shown as sent", () => { + expect( + cancellationOf({ request_cancelled: true, cancellation_reason: "some_new_origin" })?.label, + ).toBe("cancelled · some new origin"); + }); + + test("a request that ran to the end is not a cancellation", () => { + expect(cancellationOf({ session_cache_hit: false })).toBeNull(); + expect(cancellationOf({ request_cancelled: false })).toBeNull(); + }); +}); + +describe("request log row", () => { + test("a cancelled row shows CANCELLED with the cache hint, not HIT or MISS", () => { + const out = html(cancelledHit); + expect(out).toContain("cancelled · client · 3m 0s"); + expect(out).toContain("title="); + expect(out).toContain(`hit ${(92636).toLocaleString()}`); + expect(out).not.toContain(">HIT<"); + expect(out).not.toContain("MISS"); + }); + + test("an older receipt (session_cache_hit false, no cached_tokens) is CANCELLED, not a miss", () => { + const old = { ...cancelledHit, session_cache_hit: false, cached_tokens: undefined }; + expect(cancellationOf(old)?.cacheHint).toBeNull(); + const out = html(old); + expect(out).toContain("cancelled · client"); + expect(out).not.toContain("MISS"); + expect(out).not.toContain("miss"); + }); + + test("an ordinary miss keeps its MISS badge", () => { + expect(html({ session_cache_hit: false })).toContain("MISS"); + }); +}); + +describe("hit rate", () => { + test("cancelled requests do not count", () => { + expect(countsTowardHitRate(cancelledHit)).toBe(false); + expect(countsTowardHitRate({ session_cache_hit: true })).toBe(true); + }); +}); diff --git a/mtplx/dashboard/_static/assets/index-BTDFdIWu.css b/mtplx/dashboard/_static/assets/index-BTDFdIWu.css deleted file mode 100644 index 82eac0033..000000000 --- a/mtplx/dashboard/_static/assets/index-BTDFdIWu.css +++ /dev/null @@ -1 +0,0 @@ -.uplot,.uplot *,.uplot *:before,.uplot *:after{box-sizing:border-box}.uplot{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5;width:min-content}.u-title{text-align:center;font-size:18px;font-weight:700}.u-wrap{position:relative;-webkit-user-select:none;user-select:none}.u-over,.u-under{position:absolute}.u-under{overflow:hidden}.uplot canvas{display:block;position:relative;width:100%;height:100%}.u-axis{position:absolute}.u-legend{font-size:14px;margin:auto;text-align:center}.u-inline{display:block}.u-inline *{display:inline-block}.u-inline tr{margin-right:16px}.u-legend th{font-weight:600}.u-legend th>*{vertical-align:middle;display:inline-block}.u-legend .u-marker{width:1em;height:1em;margin-right:4px;background-clip:padding-box!important}.u-inline.u-live th:after{content:":";vertical-align:middle}.u-inline:not(.u-live) .u-value{display:none}.u-series>*{padding:4px}.u-series th{cursor:pointer}.u-legend .u-off>*{opacity:.3}.u-select{background:#00000012;position:absolute;pointer-events:none}.u-cursor-x,.u-cursor-y{position:absolute;left:0;top:0;pointer-events:none;will-change:transform}.u-hz .u-cursor-x,.u-vt .u-cursor-y{height:100%;border-right:1px dashed #607D8B}.u-hz .u-cursor-y,.u-vt .u-cursor-x{width:100%;border-bottom:1px dashed #607D8B}.u-cursor-pt{position:absolute;top:0;left:0;border-radius:50%;border:0 solid;pointer-events:none;will-change:transform;background-clip:padding-box!important}.u-axis.u-off,.u-select.u-off,.u-cursor-x.u-off,.u-cursor-y.u-off,.u-cursor-pt.u-off{display:none}/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-400:oklch(76.5% .177 163.223);--color-rose-500:oklch(64.5% .246 16.439);--color-slate-500:oklch(55.4% .046 257.417);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}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;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.top-0\.5{top:calc(var(--spacing) * .5)}.top-2{top:calc(var(--spacing) * 2)}.top-16{top:calc(var(--spacing) * 16)}.right-0{right:calc(var(--spacing) * 0)}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.bottom-0{bottom:calc(var(--spacing) * 0)}.bottom-16{bottom:calc(var(--spacing) * 16)}.left-0{left:calc(var(--spacing) * 0)}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.col-span-6{grid-column:span 6/span 6}.col-span-12{grid-column:span 12/span 12}.-mx-2{margin-inline:calc(var(--spacing) * -2)}.-mx-3{margin-inline:calc(var(--spacing) * -3)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.-mt-1{margin-top:calc(var(--spacing) * -1)}.-mt-2{margin-top:calc(var(--spacing) * -2)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.aspect-square{aspect-ratio:1}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-14{height:calc(var(--spacing) * 14)}.h-\[200px\]{height:200px}.h-\[220px\]{height:220px}.h-\[260px\]{height:260px}.h-\[280px\]{height:280px}.h-full{height:100%}.max-h-\[260px\]{max-height:260px}.min-h-\[220px\]{min-height:220px}.min-h-dvh{min-height:100dvh}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-4{width:calc(var(--spacing) * 4)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-14{width:calc(var(--spacing) * 14)}.w-56{width:calc(var(--spacing) * 56)}.w-full{width:100%}.max-w-\[280px\]{max-width:280px}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.translate-x-0\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-4{--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.resize{resize:both}.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-12{grid-template-columns:repeat(12,minmax(0,1fr))}.grid-cols-\[1fr_auto\]{grid-template-columns:1fr auto}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[var\(--border-soft\)\]>:not(:last-child)){border-color:var(--border-soft)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\[var\(--accent\)\],.border-\[var\(--accent\)\]\/30{border-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--accent\)\]\/30{border-color:color-mix(in oklab,var(--accent) 30%,transparent)}}.border-\[var\(--accent\)\]\/40{border-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--accent\)\]\/40{border-color:color-mix(in oklab,var(--accent) 40%,transparent)}}.border-\[var\(--accent-hot\)\]\/40{border-color:var(--accent-hot)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--accent-hot\)\]\/40{border-color:color-mix(in oklab,var(--accent-hot) 40%,transparent)}}.border-\[var\(--accent-warm\)\]{border-color:var(--accent-warm)}.border-\[var\(--border-soft\)\]{border-color:var(--border-soft)}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500) 30%,transparent)}}.bg-\[var\(--accent\)\],.bg-\[var\(--accent\)\]\/10{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--accent\)\]\/10{background-color:color-mix(in oklab,var(--accent) 10%,transparent)}}.bg-\[var\(--accent\)\]\/15{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--accent\)\]\/15{background-color:color-mix(in oklab,var(--accent) 15%,transparent)}}.bg-\[var\(--accent-hot\)\],.bg-\[var\(--accent-hot\)\]\/5{background-color:var(--accent-hot)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--accent-hot\)\]\/5{background-color:color-mix(in oklab,var(--accent-hot) 5%,transparent)}}.bg-\[var\(--accent-warm\)\]\/10{background-color:var(--accent-warm)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--accent-warm\)\]\/10{background-color:color-mix(in oklab,var(--accent-warm) 10%,transparent)}}.bg-\[var\(--bg-canvas\)\]{background-color:var(--bg-canvas)}.bg-\[var\(--bg-card\)\]{background-color:var(--bg-card)}.bg-\[var\(--bg-elevated\)\],.bg-\[var\(--bg-elevated\)\]\/40{background-color:var(--bg-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--bg-elevated\)\]\/40{background-color:color-mix(in oklab,var(--bg-elevated) 40%,transparent)}}.bg-\[var\(--bg-elevated\)\]\/90{background-color:var(--bg-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--bg-elevated\)\]\/90{background-color:color-mix(in oklab,var(--bg-elevated) 90%,transparent)}}.bg-\[var\(--border-soft\)\]{background-color:var(--border-soft)}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/15{background-color:#f99c0026}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/15{background-color:color-mix(in oklab,var(--color-amber-500) 15%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-rose-500{background-color:var(--color-rose-500)}.bg-slate-500{background-color:var(--color-slate-500)}.bg-white{background-color:var(--color-white)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-6{padding-block:calc(var(--spacing) * 6)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pb-24{padding-bottom:calc(var(--spacing) * 24)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[20px\]{font-size:20px}.text-\[44px\]{font-size:44px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.whitespace-nowrap{white-space:nowrap}.text-\[var\(--accent\)\]{color:var(--accent)}.text-\[var\(--accent-cool\)\]{color:var(--accent-cool)}.text-\[var\(--accent-hot\)\]{color:var(--accent-hot)}.text-\[var\(--accent-warm\)\]{color:var(--accent-warm)}.text-\[var\(--text-muted\)\]{color:var(--text-muted)}.text-\[var\(--text-primary\)\]{color:var(--text-primary)}.text-amber-300{color:var(--color-amber-300)}.text-black{color:var(--color-black)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.accent-\[var\(--accent\)\]{accent-color:var(--accent)}.opacity-0{opacity:0}.mix-blend-difference{mix-blend-mode:difference}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_1px_var\(--accent\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,var(--accent));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgb\(74\,222\,128\,0\.6\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#4ade8099);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_12px_40px_rgba\(0\,214\,143\,0\.25\)\]{--tw-shadow:0 12px 40px var(--tw-shadow-color,#00d68f40);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_1px_0_0_rgba\(255\,255\,255\,0\.02\)\]{--tw-shadow:inset 0 1px 0 0 var(--tw-shadow-color,#ffffff05);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.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{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-500{--tw-duration:.5s;transition-duration:.5s}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}.hover\:border-\[var\(--accent\)\]:hover{border-color:var(--accent)}.hover\:border-\[var\(--text-muted\)\]:hover{border-color:var(--text-muted)}.hover\:bg-\[var\(--accent-hot\)\]\/10:hover{background-color:var(--accent-hot)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--accent-hot\)\]\/10:hover{background-color:color-mix(in oklab,var(--accent-hot) 10%,transparent)}}.hover\:bg-\[var\(--bg-card\)\]\/60:hover{background-color:var(--bg-card)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--bg-card\)\]\/60:hover{background-color:color-mix(in oklab,var(--bg-card) 60%,transparent)}}.hover\:bg-\[var\(--bg-elevated\)\]\/60:hover{background-color:var(--bg-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--bg-elevated\)\]\/60:hover{background-color:color-mix(in oklab,var(--bg-elevated) 60%,transparent)}}.hover\:text-\[var\(--accent\)\]:hover{color:var(--accent)}.hover\:text-\[var\(--accent-hot\)\]:hover{color:var(--accent-hot)}.hover\:text-\[var\(--text-primary\)\]:hover{color:var(--text-primary)}}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-\[var\(--accent\)\]:focus{--tw-ring-color:var(--accent)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:col-span-6{grid-column:span 6/span 6}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(min-width:48rem){.md\:flex{display:flex}}@media(min-width:64rem){.lg\:col-span-4{grid-column:span 4/span 4}.lg\:col-span-5{grid-column:span 5/span 5}.lg\:col-span-6{grid-column:span 6/span 6}.lg\:col-span-7{grid-column:span 7/span 7}.lg\:inline{display:inline}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:px-6{padding-inline:calc(var(--spacing) * 6)}.lg\:px-8{padding-inline:calc(var(--spacing) * 8)}.lg\:py-8{padding-block:calc(var(--spacing) * 8)}}}:root,[data-theme=hippo]{--bg-canvas:#050505;--bg-elevated:#0d0f12;--bg-card:#14181d;--border-soft:#1d242c;--text-primary:#e8eef3;--text-muted:#8d97a3;--accent:#00d68f;--accent-warm:#f0b429;--accent-hot:#f0586a;--accent-cool:#4fb6f3}[data-theme=river]{--bg-canvas:#06121b;--bg-elevated:#0a1d2c;--bg-card:#102a3d;--border-soft:#1b3650;--text-primary:#e8f3ff;--text-muted:#87a8c2;--accent:#4fb6f3;--accent-warm:#f0b429;--accent-hot:#f0586a;--accent-cool:#88e0ff}[data-theme=light]{--bg-canvas:#f5f7fb;--bg-elevated:#fff;--bg-card:#fff;--border-soft:#e1e6ee;--text-primary:#16202c;--text-muted:#56697f;--accent:#00a06d;--accent-warm:#c97e0c;--accent-hot:#d63a4d;--accent-cool:#2f7ad6}[data-theme=mono]{--bg-canvas:#0a0a0a;--bg-elevated:#131313;--bg-card:#181818;--border-soft:#2a2a2a;--text-primary:#f5f5f5;--text-muted:#989898;--accent:#f5f5f5;--accent-warm:#d4d4d4;--accent-hot:#fafafa;--accent-cool:silver}html,body,#root{background:var(--bg-canvas);color:var(--text-primary);min-height:100dvh}body{font-feature-settings:"ss01","cv11","tnum";-webkit-font-smoothing:antialiased;font-family:ui-sans-serif,-apple-system,SF Pro Text,Inter,system-ui,sans-serif}@media(max-width:768px){.grid-cols-12>[class*=col-span-]{grid-column:span 12!important}}body[data-stream-paused=true] [data-live=true]{opacity:.7}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}} diff --git a/mtplx/dashboard/_static/assets/index-C94IkU2d.css b/mtplx/dashboard/_static/assets/index-C94IkU2d.css new file mode 100644 index 000000000..20daf8689 --- /dev/null +++ b/mtplx/dashboard/_static/assets/index-C94IkU2d.css @@ -0,0 +1 @@ +.uplot,.uplot *,.uplot *:before,.uplot *:after{box-sizing:border-box}.uplot{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5;width:min-content}.u-title{text-align:center;font-size:18px;font-weight:700}.u-wrap{position:relative;-webkit-user-select:none;user-select:none}.u-over,.u-under{position:absolute}.u-under{overflow:hidden}.uplot canvas{display:block;position:relative;width:100%;height:100%}.u-axis{position:absolute}.u-legend{font-size:14px;margin:auto;text-align:center}.u-inline{display:block}.u-inline *{display:inline-block}.u-inline tr{margin-right:16px}.u-legend th{font-weight:600}.u-legend th>*{vertical-align:middle;display:inline-block}.u-legend .u-marker{width:1em;height:1em;margin-right:4px;background-clip:padding-box!important}.u-inline.u-live th:after{content:":";vertical-align:middle}.u-inline:not(.u-live) .u-value{display:none}.u-series>*{padding:4px}.u-series th{cursor:pointer}.u-legend .u-off>*{opacity:.3}.u-select{background:#00000012;position:absolute;pointer-events:none}.u-cursor-x,.u-cursor-y{position:absolute;left:0;top:0;pointer-events:none;will-change:transform}.u-hz .u-cursor-x,.u-vt .u-cursor-y{height:100%;border-right:1px dashed #607D8B}.u-hz .u-cursor-y,.u-vt .u-cursor-x{width:100%;border-bottom:1px dashed #607D8B}.u-cursor-pt{position:absolute;top:0;left:0;border-radius:50%;border:0 solid;pointer-events:none;will-change:transform;background-clip:padding-box!important}.u-axis.u-off,.u-select.u-off,.u-cursor-x.u-off,.u-cursor-y.u-off,.u-cursor-pt.u-off{display:none}/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-400:oklch(76.5% .177 163.223);--color-rose-500:oklch(64.5% .246 16.439);--color-slate-500:oklch(55.4% .046 257.417);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}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;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.top-0\.5{top:calc(var(--spacing) * .5)}.top-2{top:calc(var(--spacing) * 2)}.top-16{top:calc(var(--spacing) * 16)}.right-0{right:calc(var(--spacing) * 0)}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.bottom-0{bottom:calc(var(--spacing) * 0)}.bottom-16{bottom:calc(var(--spacing) * 16)}.left-0{left:calc(var(--spacing) * 0)}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.col-span-6{grid-column:span 6/span 6}.col-span-12{grid-column:span 12/span 12}.-mx-2{margin-inline:calc(var(--spacing) * -2)}.-mx-3{margin-inline:calc(var(--spacing) * -3)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.-mt-1{margin-top:calc(var(--spacing) * -1)}.-mt-2{margin-top:calc(var(--spacing) * -2)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.aspect-square{aspect-ratio:1}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-14{height:calc(var(--spacing) * 14)}.h-\[200px\]{height:200px}.h-\[220px\]{height:220px}.h-\[260px\]{height:260px}.h-\[280px\]{height:280px}.h-full{height:100%}.max-h-\[260px\]{max-height:260px}.min-h-\[220px\]{min-height:220px}.min-h-dvh{min-height:100dvh}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-4{width:calc(var(--spacing) * 4)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-14{width:calc(var(--spacing) * 14)}.w-56{width:calc(var(--spacing) * 56)}.w-full{width:100%}.max-w-\[280px\]{max-width:280px}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.translate-x-0\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-4{--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.resize{resize:both}.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-12{grid-template-columns:repeat(12,minmax(0,1fr))}.grid-cols-\[1fr_auto\]{grid-template-columns:1fr auto}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[var\(--border-soft\)\]>:not(:last-child)){border-color:var(--border-soft)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\[var\(--accent\)\],.border-\[var\(--accent\)\]\/30{border-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--accent\)\]\/30{border-color:color-mix(in oklab,var(--accent) 30%,transparent)}}.border-\[var\(--accent\)\]\/40{border-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--accent\)\]\/40{border-color:color-mix(in oklab,var(--accent) 40%,transparent)}}.border-\[var\(--accent-hot\)\]\/40{border-color:var(--accent-hot)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--accent-hot\)\]\/40{border-color:color-mix(in oklab,var(--accent-hot) 40%,transparent)}}.border-\[var\(--accent-warm\)\]{border-color:var(--accent-warm)}.border-\[var\(--border-soft\)\]{border-color:var(--border-soft)}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500) 30%,transparent)}}.bg-\[var\(--accent\)\],.bg-\[var\(--accent\)\]\/10{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--accent\)\]\/10{background-color:color-mix(in oklab,var(--accent) 10%,transparent)}}.bg-\[var\(--accent\)\]\/15{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--accent\)\]\/15{background-color:color-mix(in oklab,var(--accent) 15%,transparent)}}.bg-\[var\(--accent-hot\)\],.bg-\[var\(--accent-hot\)\]\/5{background-color:var(--accent-hot)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--accent-hot\)\]\/5{background-color:color-mix(in oklab,var(--accent-hot) 5%,transparent)}}.bg-\[var\(--accent-warm\)\]\/10{background-color:var(--accent-warm)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--accent-warm\)\]\/10{background-color:color-mix(in oklab,var(--accent-warm) 10%,transparent)}}.bg-\[var\(--bg-canvas\)\]{background-color:var(--bg-canvas)}.bg-\[var\(--bg-card\)\]{background-color:var(--bg-card)}.bg-\[var\(--bg-elevated\)\],.bg-\[var\(--bg-elevated\)\]\/40{background-color:var(--bg-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--bg-elevated\)\]\/40{background-color:color-mix(in oklab,var(--bg-elevated) 40%,transparent)}}.bg-\[var\(--bg-elevated\)\]\/90{background-color:var(--bg-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--bg-elevated\)\]\/90{background-color:color-mix(in oklab,var(--bg-elevated) 90%,transparent)}}.bg-\[var\(--border-soft\)\]{background-color:var(--border-soft)}.bg-\[var\(--text-muted\)\]\/10{background-color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--text-muted\)\]\/10{background-color:color-mix(in oklab,var(--text-muted) 10%,transparent)}}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/15{background-color:#f99c0026}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/15{background-color:color-mix(in oklab,var(--color-amber-500) 15%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-rose-500{background-color:var(--color-rose-500)}.bg-slate-500{background-color:var(--color-slate-500)}.bg-white{background-color:var(--color-white)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-6{padding-block:calc(var(--spacing) * 6)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pb-24{padding-bottom:calc(var(--spacing) * 24)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[20px\]{font-size:20px}.text-\[44px\]{font-size:44px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.whitespace-nowrap{white-space:nowrap}.text-\[var\(--accent\)\]{color:var(--accent)}.text-\[var\(--accent-cool\)\]{color:var(--accent-cool)}.text-\[var\(--accent-hot\)\]{color:var(--accent-hot)}.text-\[var\(--accent-warm\)\]{color:var(--accent-warm)}.text-\[var\(--text-muted\)\]{color:var(--text-muted)}.text-\[var\(--text-primary\)\]{color:var(--text-primary)}.text-amber-300{color:var(--color-amber-300)}.text-black{color:var(--color-black)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.accent-\[var\(--accent\)\]{accent-color:var(--accent)}.opacity-0{opacity:0}.mix-blend-difference{mix-blend-mode:difference}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_1px_var\(--accent\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,var(--accent));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgb\(74\,222\,128\,0\.6\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#4ade8099);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_12px_40px_rgba\(0\,214\,143\,0\.25\)\]{--tw-shadow:0 12px 40px var(--tw-shadow-color,#00d68f40);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_1px_0_0_rgba\(255\,255\,255\,0\.02\)\]{--tw-shadow:inset 0 1px 0 0 var(--tw-shadow-color,#ffffff05);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.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{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-500{--tw-duration:.5s;transition-duration:.5s}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}.hover\:border-\[var\(--accent\)\]:hover{border-color:var(--accent)}.hover\:border-\[var\(--text-muted\)\]:hover{border-color:var(--text-muted)}.hover\:bg-\[var\(--accent-hot\)\]\/10:hover{background-color:var(--accent-hot)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--accent-hot\)\]\/10:hover{background-color:color-mix(in oklab,var(--accent-hot) 10%,transparent)}}.hover\:bg-\[var\(--bg-card\)\]\/60:hover{background-color:var(--bg-card)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--bg-card\)\]\/60:hover{background-color:color-mix(in oklab,var(--bg-card) 60%,transparent)}}.hover\:bg-\[var\(--bg-elevated\)\]\/60:hover{background-color:var(--bg-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--bg-elevated\)\]\/60:hover{background-color:color-mix(in oklab,var(--bg-elevated) 60%,transparent)}}.hover\:text-\[var\(--accent\)\]:hover{color:var(--accent)}.hover\:text-\[var\(--accent-hot\)\]:hover{color:var(--accent-hot)}.hover\:text-\[var\(--text-primary\)\]:hover{color:var(--text-primary)}}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-\[var\(--accent\)\]:focus{--tw-ring-color:var(--accent)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:col-span-6{grid-column:span 6/span 6}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(min-width:48rem){.md\:flex{display:flex}}@media(min-width:64rem){.lg\:col-span-4{grid-column:span 4/span 4}.lg\:col-span-5{grid-column:span 5/span 5}.lg\:col-span-6{grid-column:span 6/span 6}.lg\:col-span-7{grid-column:span 7/span 7}.lg\:inline{display:inline}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:px-6{padding-inline:calc(var(--spacing) * 6)}.lg\:px-8{padding-inline:calc(var(--spacing) * 8)}.lg\:py-8{padding-block:calc(var(--spacing) * 8)}}}:root,[data-theme=hippo]{--bg-canvas:#050505;--bg-elevated:#0d0f12;--bg-card:#14181d;--border-soft:#1d242c;--text-primary:#e8eef3;--text-muted:#8d97a3;--accent:#00d68f;--accent-warm:#f0b429;--accent-hot:#f0586a;--accent-cool:#4fb6f3}[data-theme=river]{--bg-canvas:#06121b;--bg-elevated:#0a1d2c;--bg-card:#102a3d;--border-soft:#1b3650;--text-primary:#e8f3ff;--text-muted:#87a8c2;--accent:#4fb6f3;--accent-warm:#f0b429;--accent-hot:#f0586a;--accent-cool:#88e0ff}[data-theme=light]{--bg-canvas:#f5f7fb;--bg-elevated:#fff;--bg-card:#fff;--border-soft:#e1e6ee;--text-primary:#16202c;--text-muted:#56697f;--accent:#00a06d;--accent-warm:#c97e0c;--accent-hot:#d63a4d;--accent-cool:#2f7ad6}[data-theme=mono]{--bg-canvas:#0a0a0a;--bg-elevated:#131313;--bg-card:#181818;--border-soft:#2a2a2a;--text-primary:#f5f5f5;--text-muted:#989898;--accent:#f5f5f5;--accent-warm:#d4d4d4;--accent-hot:#fafafa;--accent-cool:silver}html,body,#root{background:var(--bg-canvas);color:var(--text-primary);min-height:100dvh}body{font-feature-settings:"ss01","cv11","tnum";-webkit-font-smoothing:antialiased;font-family:ui-sans-serif,-apple-system,SF Pro Text,Inter,system-ui,sans-serif}@media(max-width:768px){.grid-cols-12>[class*=col-span-]{grid-column:span 12!important}}body[data-stream-paused=true] [data-live=true]{opacity:.7}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}} diff --git a/mtplx/dashboard/_static/assets/index-DIdoATFR.js b/mtplx/dashboard/_static/assets/index-DFIgp68m.js similarity index 63% rename from mtplx/dashboard/_static/assets/index-DIdoATFR.js rename to mtplx/dashboard/_static/assets/index-DFIgp68m.js index 0f6d35829..2c0b45e8b 100644 --- a/mtplx/dashboard/_static/assets/index-DIdoATFR.js +++ b/mtplx/dashboard/_static/assets/index-DFIgp68m.js @@ -1,4 +1,4 @@ -var sU=Object.defineProperty;var nP=e=>{throw TypeError(e)};var lU=(e,t,n)=>t in e?sU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var rP=(e,t,n)=>lU(e,typeof t!="symbol"?t+"":t,n),tx=(e,t,n)=>t.has(e)||nP("Cannot "+n);var W=(e,t,n)=>(tx(e,t,"read from private field"),n?n.call(e):t.get(e)),qe=(e,t,n)=>t.has(e)?nP("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ce=(e,t,n,r)=>(tx(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),at=(e,t,n)=>(tx(e,t,"access private method"),n);var mv=(e,t,n,r)=>({set _(i){Ce(e,t,i,n)},get _(){return W(e,t,r)}});(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 s of i)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var vv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ft(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var nx={exports:{}},th={};/** +var lU=Object.defineProperty;var rC=e=>{throw TypeError(e)};var uU=(e,t,n)=>t in e?lU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var iC=(e,t,n)=>uU(e,typeof t!="symbol"?t+"":t,n),tx=(e,t,n)=>t.has(e)||rC("Cannot "+n);var W=(e,t,n)=>(tx(e,t,"read from private field"),n?n.call(e):t.get(e)),qe=(e,t,n)=>t.has(e)?rC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Pe=(e,t,n,r)=>(tx(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),at=(e,t,n)=>(tx(e,t,"access private method"),n);var mv=(e,t,n,r)=>({set _(i){Pe(e,t,i,n)},get _(){return W(e,t,r)}});(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 s of i)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var vv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ft(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var nx={exports:{}},th={};/** * @license React * react-jsx-runtime.production.js * @@ -6,7 +6,7 @@ var sU=Object.defineProperty;var nP=e=>{throw TypeError(e)};var lU=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var iP;function uU(){if(iP)return th;iP=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,s){var l=null;if(s!==void 0&&(l=""+s),i.key!==void 0&&(l=""+i.key),"key"in i){s={};for(var c in i)c!=="key"&&(s[c]=i[c])}else s=i;return i=s.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:s}}return th.Fragment=t,th.jsx=n,th.jsxs=n,th}var aP;function cU(){return aP||(aP=1,nx.exports=uU()),nx.exports}var T=cU(),rx={exports:{}},Ze={};/** + */var aC;function cU(){if(aC)return th;aC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,s){var l=null;if(s!==void 0&&(l=""+s),i.key!==void 0&&(l=""+i.key),"key"in i){s={};for(var c in i)c!=="key"&&(s[c]=i[c])}else s=i;return i=s.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:s}}return th.Fragment=t,th.jsx=n,th.jsxs=n,th}var oC;function fU(){return oC||(oC=1,nx.exports=cU()),nx.exports}var T=fU(),rx={exports:{}},Ze={};/** * @license React * react.production.js * @@ -14,7 +14,7 @@ var sU=Object.defineProperty;var nP=e=>{throw TypeError(e)};var lU=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var oP;function fU(){if(oP)return Ze;oP=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),v=Symbol.iterator;function b(D){return D===null||typeof D!="object"?null:(D=v&&D[v]||D["@@iterator"],typeof D=="function"?D:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,x={};function A(D,V,X){this.props=D,this.context=V,this.refs=x,this.updater=X||w}A.prototype.isReactComponent={},A.prototype.setState=function(D,V){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,V,"setState")},A.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function _(){}_.prototype=A.prototype;function M(D,V,X){this.props=D,this.context=V,this.refs=x,this.updater=X||w}var E=M.prototype=new _;E.constructor=M,S(E,A.prototype),E.isPureReactComponent=!0;var O=Array.isArray;function j(){}var R={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function z(D,V,X){var ue=X.ref;return{$$typeof:e,type:D,key:V,ref:ue!==void 0?ue:null,props:X}}function G(D,V){return z(D.type,V,D.props)}function $(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function B(D){var V={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(X){return V[X]})}var Z=/\/+/g;function ee(D,V){return typeof D=="object"&&D!==null&&D.key!=null?B(""+D.key):V.toString(36)}function J(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(j,j):(D.status="pending",D.then(function(V){D.status==="pending"&&(D.status="fulfilled",D.value=V)},function(V){D.status==="pending"&&(D.status="rejected",D.reason=V)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function q(D,V,X,ue,be){var Se=typeof D;(Se==="undefined"||Se==="boolean")&&(D=null);var ye=!1;if(D===null)ye=!0;else switch(Se){case"bigint":case"string":case"number":ye=!0;break;case"object":switch(D.$$typeof){case e:case t:ye=!0;break;case m:return ye=D._init,q(ye(D._payload),V,X,ue,be)}}if(ye)return be=be(D),ye=ue===""?"."+ee(D,0):ue,O(be)?(X="",ye!=null&&(X=ye.replace(Z,"$&/")+"/"),q(be,V,X,"",function(_e){return _e})):be!=null&&($(be)&&(be=G(be,X+(be.key==null||D&&D.key===be.key?"":(""+be.key).replace(Z,"$&/")+"/")+ye)),V.push(be)),1;ye=0;var Me=ue===""?".":ue+":";if(O(D))for(var de=0;de{throw TypeError(e)};var lU=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var lP;function dU(){return lP||(lP=1,(function(e){function t(q,F){var ie=q.length;q.push(F);e:for(;0>>1,U=q[ce];if(0>>1;cei(X,ie))uei(be,X)?(q[ce]=be,q[ue]=ie,ce=ue):(q[ce]=X,q[V]=ie,ce=V);else if(uei(be,ie))q[ce]=be,q[ue]=ie,ce=ue;else break e}}return F}function i(q,F){var ie=q.sortIndex-F.sortIndex;return ie!==0?ie:q.id-F.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],d=[],m=1,p=null,v=3,b=!1,w=!1,S=!1,x=!1,A=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function E(q){for(var F=n(d);F!==null;){if(F.callback===null)r(d);else if(F.startTime<=q)r(d),F.sortIndex=F.expirationTime,t(f,F);else break;F=n(d)}}function O(q){if(S=!1,E(q),!w)if(n(f)!==null)w=!0,j||(j=!0,B());else{var F=n(d);F!==null&&J(O,F.startTime-q)}}var j=!1,R=-1,k=5,z=-1;function G(){return x?!0:!(e.unstable_now()-zq&&G());){var ce=p.callback;if(typeof ce=="function"){p.callback=null,v=p.priorityLevel;var U=ce(p.expirationTime<=q);if(q=e.unstable_now(),typeof U=="function"){p.callback=U,E(q),F=!0;break t}p===n(f)&&r(f),E(q)}else r(f);p=n(f)}if(p!==null)F=!0;else{var D=n(d);D!==null&&J(O,D.startTime-q),F=!1}}break e}finally{p=null,v=ie,b=!1}F=void 0}}finally{F?B():j=!1}}}var B;if(typeof M=="function")B=function(){M($)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,ee=Z.port2;Z.port1.onmessage=$,B=function(){ee.postMessage(null)}}else B=function(){A($,0)};function J(q,F){R=A(function(){q(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125ce?(q.sortIndex=ie,t(d,q),n(f)===null&&q===n(d)&&(S?(_(R),R=-1):S=!0,J(O,ie-ce))):(q.sortIndex=U,t(f,q),w||b||(w=!0,j||(j=!0,B()))),q},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(q){var F=v;return function(){var ie=v;v=F;try{return q.apply(this,arguments)}finally{v=ie}}}})(ox)),ox}var uP;function hU(){return uP||(uP=1,ax.exports=dU()),ax.exports}var sx={exports:{}},Rr={};/** + */var uC;function hU(){return uC||(uC=1,(function(e){function t(q,F){var ie=q.length;q.push(F);e:for(;0>>1,U=q[ce];if(0>>1;cei(X,ie))uei(be,X)?(q[ce]=be,q[ue]=ie,ce=ue):(q[ce]=X,q[V]=ie,ce=V);else if(uei(be,ie))q[ce]=be,q[ue]=ie,ce=ue;else break e}}return F}function i(q,F){var ie=q.sortIndex-F.sortIndex;return ie!==0?ie:q.id-F.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],d=[],m=1,p=null,v=3,b=!1,w=!1,S=!1,x=!1,A=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function E(q){for(var F=n(d);F!==null;){if(F.callback===null)r(d);else if(F.startTime<=q)r(d),F.sortIndex=F.expirationTime,t(f,F);else break;F=n(d)}}function O(q){if(S=!1,E(q),!w)if(n(f)!==null)w=!0,j||(j=!0,B());else{var F=n(d);F!==null&&J(O,F.startTime-q)}}var j=!1,R=-1,k=5,z=-1;function G(){return x?!0:!(e.unstable_now()-zq&&G());){var ce=p.callback;if(typeof ce=="function"){p.callback=null,v=p.priorityLevel;var U=ce(p.expirationTime<=q);if(q=e.unstable_now(),typeof U=="function"){p.callback=U,E(q),F=!0;break t}p===n(f)&&r(f),E(q)}else r(f);p=n(f)}if(p!==null)F=!0;else{var D=n(d);D!==null&&J(O,D.startTime-q),F=!1}}break e}finally{p=null,v=ie,b=!1}F=void 0}}finally{F?B():j=!1}}}var B;if(typeof M=="function")B=function(){M($)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,ee=Z.port2;Z.port1.onmessage=$,B=function(){ee.postMessage(null)}}else B=function(){A($,0)};function J(q,F){R=A(function(){q(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125ce?(q.sortIndex=ie,t(d,q),n(f)===null&&q===n(d)&&(S?(_(R),R=-1):S=!0,J(O,ie-ce))):(q.sortIndex=U,t(f,q),w||b||(w=!0,j||(j=!0,B()))),q},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(q){var F=v;return function(){var ie=v;v=F;try{return q.apply(this,arguments)}finally{v=ie}}}})(ox)),ox}var cC;function pU(){return cC||(cC=1,ax.exports=hU()),ax.exports}var sx={exports:{}},Rr={};/** * @license React * react-dom.production.js * @@ -30,7 +30,7 @@ var sU=Object.defineProperty;var nP=e=>{throw TypeError(e)};var lU=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var cP;function pU(){if(cP)return Rr;cP=1;var e=FO();function t(f){var d="https://react.dev/errors/"+f;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),sx.exports=pU(),sx.exports}/** + */var fC;function mU(){if(fC)return Rr;fC=1;var e=GO();function t(f){var d="https://react.dev/errors/"+f;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),sx.exports=mU(),sx.exports}/** * @license React * react-dom-client.production.js * @@ -38,15 +38,17 @@ var sU=Object.defineProperty;var nP=e=>{throw TypeError(e)};var lU=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var dP;function vU(){if(dP)return nh;dP=1;var e=hU(),t=FO(),n=mU();function r(a){var o="https://react.dev/errors/"+a;if(1U||(a.current=ce[U],ce[U]=null,U--)}function X(a,o){U++,ce[U]=a.current,a.current=o}var ue=D(null),be=D(null),Se=D(null),ye=D(null);function Me(a,o){switch(X(Se,o),X(be,a),X(ue,null),o.nodeType){case 9:case 11:a=(a=o.documentElement)&&(a=a.namespaceURI)?Oj(a):0;break;default:if(a=o.tagName,o=o.namespaceURI)o=Oj(o),a=Tj(o,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}V(ue),X(ue,a)}function de(){V(ue),V(be),V(Se)}function _e(a){a.memoizedState!==null&&X(ye,a);var o=ue.current,u=Tj(o,a.type);o!==u&&(X(be,a),X(ue,u))}function Ee(a){be.current===a&&(V(ue),V(be)),ye.current===a&&(V(ye),Qd._currentValue=ie)}var he,Ie;function Te(a){if(he===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);he=o&&o[1]||"",Ie=-1U||(a.current=ce[U],ce[U]=null,U--)}function X(a,o){U++,ce[U]=a.current,a.current=o}var ue=D(null),be=D(null),Se=D(null),ye=D(null);function Me(a,o){switch(X(Se,o),X(be,a),X(ue,null),o.nodeType){case 9:case 11:a=(a=o.documentElement)&&(a=a.namespaceURI)?Tj(a):0;break;default:if(a=o.tagName,o=o.namespaceURI)o=Tj(o),a=Ej(o,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}V(ue),X(ue,a)}function de(){V(ue),V(be),V(Se)}function _e(a){a.memoizedState!==null&&X(ye,a);var o=ue.current,u=Ej(o,a.type);o!==u&&(X(be,a),X(ue,u))}function Ee(a){be.current===a&&(V(ue),V(be)),ye.current===a&&(V(ye),Qd._currentValue=ie)}var he,Ie;function Te(a){if(he===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);he=o&&o[1]||"",Ie=-1)":-1y||Y[h]!==se[y]){var pe=` -`+Y[h].replace(" at new "," at ");return a.displayName&&pe.includes("")&&(pe=pe.replace("",a.displayName)),pe}while(1<=h&&0<=y);break}}}finally{Xe=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?Te(u):""}function yt(a,o){switch(a.tag){case 26:case 27:case 5:return Te(a.type);case 16:return Te("Lazy");case 13:return a.child!==o&&o!==null?Te("Suspense Fallback"):Te("Suspense");case 19:return Te("SuspenseList");case 0:case 15:return nt(a.type,!1);case 11:return nt(a.type.render,!1);case 1:return nt(a.type,!0);case 31:return Te("Activity");default:return""}}function Qt(a){try{var o="",u=null;do o+=yt(a,u),u=a,a=a.return;while(a);return o}catch(h){return` +`+Y[h].replace(" at new "," at ");return a.displayName&&pe.includes("")&&(pe=pe.replace("",a.displayName)),pe}while(1<=h&&0<=y);break}}}finally{We=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?Te(u):""}function yt(a,o){switch(a.tag){case 26:case 27:case 5:return Te(a.type);case 16:return Te("Lazy");case 13:return a.child!==o&&o!==null?Te("Suspense Fallback"):Te("Suspense");case 19:return Te("SuspenseList");case 0:case 15:return nt(a.type,!1);case 11:return nt(a.type.render,!1);case 1:return nt(a.type,!0);case 31:return Te("Activity");default:return""}}function Qt(a){try{var o="",u=null;do o+=yt(a,u),u=a,a=a.return;while(a);return o}catch(h){return` Error generating stack: `+h.message+` -`+h.stack}}var Zt=Object.prototype.hasOwnProperty,pt=e.unstable_scheduleCallback,Nn=e.unstable_cancelCallback,Tn=e.unstable_shouldYield,Br=e.unstable_requestPaint,ze=e.unstable_now,je=e.unstable_getCurrentPriorityLevel,bt=e.unstable_ImmediatePriority,cn=e.unstable_UserBlockingPriority,di=e.unstable_NormalPriority,ki=e.unstable_LowPriority,Tr=e.unstable_IdlePriority,hi=e.log,pr=e.unstable_setDisableYieldValue,kn=null,Bt=null;function Ln(a){if(typeof hi=="function"&&pr(a),Bt&&typeof Bt.setStrictMode=="function")try{Bt.setStrictMode(kn,a)}catch{}}var mr=Math.clz32?Math.clz32:no,ku=Math.log,ns=Math.LN2;function no(a){return a>>>=0,a===0?32:31-(ku(a)/ns|0)|0}var ro=256,vr=262144,rs=4194304;function Ma(a){var o=a&42;if(o!==0)return o;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Lu(a,o,u){var h=a.pendingLanes;if(h===0)return 0;var y=0,g=a.suspendedLanes,P=a.pingedLanes;a=a.warmLanes;var L=h&134217727;return L!==0?(h=L&~g,h!==0?y=Ma(h):(P&=L,P!==0?y=Ma(P):u||(u=L&~a,u!==0&&(y=Ma(u))))):(L=h&~g,L!==0?y=Ma(L):P!==0?y=Ma(P):u||(u=h&~a,u!==0&&(y=Ma(u)))),y===0?0:o!==0&&o!==y&&(o&g)===0&&(g=y&-y,u=o&-o,g>=u||g===32&&(u&4194048)!==0)?o:y}function vl(a,o){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&o)===0}function o0(a,o){switch(a){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xp(){var a=rs;return rs<<=1,(rs&62914560)===0&&(rs=4194304),a}function rd(a){for(var o=[],u=0;31>u;u++)o.push(a);return o}function pi(a,o){a.pendingLanes|=o,o!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function ir(a,o,u,h,y,g){var P=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var L=a.entanglements,Y=a.expirationTimes,se=a.hiddenUpdates;for(u=P&~u;0"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var s0=/[\n"\\]/g;function Ir(a){return a.replace(s0,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Uu(a,o,u,h,y,g,P,L){a.name="",P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?a.type=P:a.removeAttribute("type"),o!=null?P==="number"?(o===0&&a.value===""||a.value!=o)&&(a.value=""+qr(o)):a.value!==""+qr(o)&&(a.value=""+qr(o)):P!=="submit"&&P!=="reset"||a.removeAttribute("value"),o!=null?Vu(a,P,qr(o)):u!=null?Vu(a,P,qr(u)):h!=null&&a.removeAttribute("value"),y==null&&g!=null&&(a.defaultChecked=!!g),y!=null&&(a.checked=y&&typeof y!="function"&&typeof y!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?a.name=""+qr(L):a.removeAttribute("name")}function Zp(a,o,u,h,y,g,P,L){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(a.type=g),o!=null||u!=null){if(!(g!=="submit"&&g!=="reset"||o!=null)){qu(a);return}u=u!=null?""+qr(u):"",o=o!=null?""+qr(o):u,L||o===a.value||(a.value=o),a.defaultValue=o}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,a.checked=L?a.checked:!!h,a.defaultChecked=!!h,P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"&&(a.name=P),qu(a)}function Vu(a,o,u){o==="number"&&Iu(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function Ca(a,o,u,h){if(a=a.options,o){o={};for(var y=0;y"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ku=!1;if(jr)try{var cs={};Object.defineProperty(cs,"passive",{get:function(){Ku=!0}}),window.addEventListener("test",cs,cs),window.removeEventListener("test",cs,cs)}catch{Ku=!1}var Vr=null,Ra=null,wl=null;function hd(){if(wl)return wl;var a,o=Ra,u=o.length,h,y="value"in Vr?Vr.value:Vr.textContent,g=y.length;for(a=0;a=ps),Sd=" ",co=!1;function Tl(a,o){switch(a){case"keyup":return um.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mn(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var fo=!1;function gn(a,o){switch(a){case"compositionend":return Mn(o);case"keypress":return o.which!==32?null:(co=!0,Sd);case"textInput":return a=o.data,a===Sd&&co?null:a;default:return null}}function cm(a,o){if(fo)return a==="compositionend"||!Yu&&Tl(a,o)?(a=hd(),wl=Ra=Vr=null,fo=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1=o)return{node:u,offset:o-a};a=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Ve(u)}}function qt(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?qt(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function nn(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=Iu(a.document);o instanceof a.HTMLIFrameElement;){try{var u=typeof o.contentWindow.location.href=="string"}catch{u=!1}if(u)a=o.contentWindow;else break;o=Iu(a.document)}return o}function bn(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o&&(o==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||o==="textarea"||a.contentEditable==="true")}var Pt=jr&&"documentMode"in document&&11>=document.documentMode,Lt=null,gr=null,jn=null,Pr=!1;function Jr(a,o,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Pr||Lt==null||Lt!==Iu(h)||(h=Lt,"selectionStart"in h&&bn(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),jn&&et(jn,h)||(jn=h,h=ev(gr,"onSelect"),0>=P,y-=P,La=1<<32-mr(o)+y|u<it?(dt=$e,$e=null):dt=$e.sibling;var wt=le(re,$e,oe[it],ge);if(wt===null){$e===null&&($e=dt);break}a&&$e&&wt.alternate===null&&o(re,$e),ne=g(wt,ne,it),St===null?Ue=wt:St.sibling=wt,St=wt,$e=dt}if(it===oe.length)return u(re,$e),mt&&mo(re,it),Ue;if($e===null){for(;itit?(dt=$e,$e=null):dt=$e.sibling;var zs=le(re,$e,wt.value,ge);if(zs===null){$e===null&&($e=dt);break}a&&$e&&zs.alternate===null&&o(re,$e),ne=g(zs,ne,it),St===null?Ue=zs:St.sibling=zs,St=zs,$e=dt}if(wt.done)return u(re,$e),mt&&mo(re,it),Ue;if($e===null){for(;!wt.done;it++,wt=oe.next())wt=xe(re,wt.value,ge),wt!==null&&(ne=g(wt,ne,it),St===null?Ue=wt:St.sibling=wt,St=wt);return mt&&mo(re,it),Ue}for($e=h($e);!wt.done;it++,wt=oe.next())wt=fe($e,re,it,wt.value,ge),wt!==null&&(a&&wt.alternate!==null&&$e.delete(wt.key===null?it:wt.key),ne=g(wt,ne,it),St===null?Ue=wt:St.sibling=wt,St=wt);return a&&$e.forEach(function(oU){return o(re,oU)}),mt&&mo(re,it),Ue}function Vt(re,ne,oe,ge){if(typeof oe=="object"&&oe!==null&&oe.type===S&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case b:e:{for(var Ue=oe.key;ne!==null;){if(ne.key===Ue){if(Ue=oe.type,Ue===S){if(ne.tag===7){u(re,ne.sibling),ge=y(ne,oe.props.children),ge.return=re,re=ge;break e}}else if(ne.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===k&&Nl(Ue)===ne.type){u(re,ne.sibling),ge=y(ne,oe.props),Md(ge,oe),ge.return=re,re=ge;break e}u(re,ne);break}else o(re,ne);ne=ne.sibling}oe.type===S?(ge=jl(oe.props.children,re.mode,ge,oe.key),ge.return=re,re=ge):(ge=ym(oe.type,oe.key,oe.props,null,re.mode,ge),Md(ge,oe),ge.return=re,re=ge)}return P(re);case w:e:{for(Ue=oe.key;ne!==null;){if(ne.key===Ue)if(ne.tag===4&&ne.stateNode.containerInfo===oe.containerInfo&&ne.stateNode.implementation===oe.implementation){u(re,ne.sibling),ge=y(ne,oe.children||[]),ge.return=re,re=ge;break e}else{u(re,ne);break}else o(re,ne);ne=ne.sibling}ge=b0(oe,re.mode,ge),ge.return=re,re=ge}return P(re);case k:return oe=Nl(oe),Vt(re,ne,oe,ge)}if(J(oe))return Le(re,ne,oe,ge);if(B(oe)){if(Ue=B(oe),typeof Ue!="function")throw Error(r(150));return oe=Ue.call(oe),He(re,ne,oe,ge)}if(typeof oe.then=="function")return Vt(re,ne,Am(oe),ge);if(oe.$$typeof===M)return Vt(re,ne,xm(re,oe),ge);Om(re,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,ne!==null&&ne.tag===6?(u(re,ne.sibling),ge=y(ne,oe),ge.return=re,re=ge):(u(re,ne),ge=g0(oe,re.mode,ge),ge.return=re,re=ge),P(re)):u(re,ne)}return function(re,ne,oe,ge){try{Ed=0;var Ue=Vt(re,ne,oe,ge);return ic=null,Ue}catch($e){if($e===rc||$e===wm)throw $e;var St=yi(29,$e,null,re.mode);return St.lanes=ge,St.return=re,St}finally{}}}var Ll=vE(!0),yE=vE(!1),xs=!1;function C0(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function D0(a,o){a=a.updateQueue,o.updateQueue===a&&(o.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Ss(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function ws(a,o,u){var h=a.updateQueue;if(h===null)return null;if(h=h.shared,(Tt&2)!==0){var y=h.pending;return y===null?o.next=o:(o.next=y.next,y.next=o),h.pending=o,o=vm(a),eE(a,null,u),o}return mm(a,h,o,u),vm(a)}function jd(a,o,u){if(o=o.updateQueue,o!==null&&(o=o.shared,(u&4194048)!==0)){var h=o.lanes;h&=a.pendingLanes,u|=h,o.lanes=u,io(a,u)}}function R0(a,o){var u=a.updateQueue,h=a.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var y=null,g=null;if(u=u.firstBaseUpdate,u!==null){do{var P={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};g===null?y=g=P:g=g.next=P,u=u.next}while(u!==null);g===null?y=g=o:g=g.next=o}else y=g=o;u={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:g,shared:h.shared,callbacks:h.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=o:a.next=o,u.lastBaseUpdate=o}var N0=!1;function Pd(){if(N0){var a=nc;if(a!==null)throw a}}function Cd(a,o,u,h){N0=!1;var y=a.updateQueue;xs=!1;var g=y.firstBaseUpdate,P=y.lastBaseUpdate,L=y.shared.pending;if(L!==null){y.shared.pending=null;var Y=L,se=Y.next;Y.next=null,P===null?g=se:P.next=se,P=Y;var pe=a.alternate;pe!==null&&(pe=pe.updateQueue,L=pe.lastBaseUpdate,L!==P&&(L===null?pe.firstBaseUpdate=se:L.next=se,pe.lastBaseUpdate=Y))}if(g!==null){var xe=y.baseState;P=0,pe=se=Y=null,L=g;do{var le=L.lane&-536870913,fe=le!==L.lane;if(fe?(ft&le)===le:(h&le)===le){le!==0&&le===tc&&(N0=!0),pe!==null&&(pe=pe.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Le=a,He=L;le=o;var Vt=u;switch(He.tag){case 1:if(Le=He.payload,typeof Le=="function"){xe=Le.call(Vt,xe,le);break e}xe=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=He.payload,le=typeof Le=="function"?Le.call(Vt,xe,le):Le,le==null)break e;xe=p({},xe,le);break e;case 2:xs=!0}}le=L.callback,le!==null&&(a.flags|=64,fe&&(a.flags|=8192),fe=y.callbacks,fe===null?y.callbacks=[le]:fe.push(le))}else fe={lane:le,tag:L.tag,payload:L.payload,callback:L.callback,next:null},pe===null?(se=pe=fe,Y=xe):pe=pe.next=fe,P|=le;if(L=L.next,L===null){if(L=y.shared.pending,L===null)break;fe=L,L=fe.next,fe.next=null,y.lastBaseUpdate=fe,y.shared.pending=null}}while(!0);pe===null&&(Y=xe),y.baseState=Y,y.firstBaseUpdate=se,y.lastBaseUpdate=pe,g===null&&(y.shared.lanes=0),Es|=P,a.lanes=P,a.memoizedState=xe}}function gE(a,o){if(typeof a!="function")throw Error(r(191,a));a.call(o)}function bE(a,o){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;ag?g:8;var P=q.T,L={};q.T=L,J0(a,!1,o,u);try{var Y=y(),se=q.S;if(se!==null&&se(L,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var pe=XI(Y,h);Nd(a,o,pe,wi(a))}else Nd(a,o,h,wi(a))}catch(xe){Nd(a,o,{then:function(){},status:"rejected",reason:xe},wi())}finally{F.p=g,P!==null&&L.types!==null&&(P.types=L.types),q.T=P}}function t8(){}function Q0(a,o,u,h){if(a.tag!==5)throw Error(r(476));var y=QE(a).queue;WE(a,y,o,ie,u===null?t8:function(){return ZE(a),u(h)})}function QE(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bo,lastRenderedState:ie},next:null};var u={};return o.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bo,lastRenderedState:u},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function ZE(a){var o=QE(a);o.next===null&&(o=a.alternate.memoizedState),Nd(a,o.next.queue,{},wi())}function Z0(){return Sr(Qd)}function JE(){return Cn().memoizedState}function eM(){return Cn().memoizedState}function n8(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var u=wi();a=Ss(u);var h=ws(o,a,u);h!==null&&(ai(h,o,u),jd(h,o,u)),o={cache:E0()},a.payload=o;return}o=o.return}}function r8(a,o,u){var h=wi();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},km(a)?nM(o,u):(u=v0(a,o,u,h),u!==null&&(ai(u,a,h),rM(u,o,h)))}function tM(a,o,u){var h=wi();Nd(a,o,u,h)}function Nd(a,o,u,h){var y={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(km(a))nM(o,y);else{var g=a.alternate;if(a.lanes===0&&(g===null||g.lanes===0)&&(g=o.lastRenderedReducer,g!==null))try{var P=o.lastRenderedState,L=g(P,u);if(y.hasEagerState=!0,y.eagerState=L,Ye(L,P))return mm(a,o,y,0),Gt===null&&pm(),!1}catch{}finally{}if(u=v0(a,o,y,h),u!==null)return ai(u,a,h),rM(u,o,h),!0}return!1}function J0(a,o,u,h){if(h={lane:2,revertLane:Cb(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},km(a)){if(o)throw Error(r(479))}else o=v0(a,u,h,2),o!==null&&ai(o,a,2)}function km(a){var o=a.alternate;return a===rt||o!==null&&o===rt}function nM(a,o){oc=Mm=!0;var u=a.pending;u===null?o.next=o:(o.next=u.next,u.next=o),a.pending=o}function rM(a,o,u){if((u&4194048)!==0){var h=o.lanes;h&=a.pendingLanes,u|=h,o.lanes=u,io(a,u)}}var kd={readContext:Sr,use:Cm,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useLayoutEffect:xn,useInsertionEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useSyncExternalStore:xn,useId:xn,useHostTransitionStatus:xn,useFormState:xn,useActionState:xn,useOptimistic:xn,useMemoCache:xn,useCacheRefresh:xn};kd.useEffectEvent=xn;var iM={readContext:Sr,use:Cm,useCallback:function(a,o){return Fr().memoizedState=[a,o===void 0?null:o],a},useContext:Sr,useEffect:IE,useImperativeHandle:function(a,o,u){u=u!=null?u.concat([a]):null,Rm(4194308,4,FE.bind(null,o,a),u)},useLayoutEffect:function(a,o){return Rm(4194308,4,a,o)},useInsertionEffect:function(a,o){Rm(4,2,a,o)},useMemo:function(a,o){var u=Fr();o=o===void 0?null:o;var h=a();if(zl){Ln(!0);try{a()}finally{Ln(!1)}}return u.memoizedState=[h,o],h},useReducer:function(a,o,u){var h=Fr();if(u!==void 0){var y=u(o);if(zl){Ln(!0);try{u(o)}finally{Ln(!1)}}}else y=o;return h.memoizedState=h.baseState=y,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:y},h.queue=a,a=a.dispatch=r8.bind(null,rt,a),[h.memoizedState,a]},useRef:function(a){var o=Fr();return a={current:a},o.memoizedState=a},useState:function(a){a=G0(a);var o=a.queue,u=tM.bind(null,rt,o);return o.dispatch=u,[a.memoizedState,u]},useDebugValue:X0,useDeferredValue:function(a,o){var u=Fr();return W0(u,a,o)},useTransition:function(){var a=G0(!1);return a=WE.bind(null,rt,a.queue,!0,!1),Fr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,u){var h=rt,y=Fr();if(mt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=o(),Gt===null)throw Error(r(349));(ft&127)!==0||OE(h,o,u)}y.memoizedState=u;var g={value:u,getSnapshot:o};return y.queue=g,IE(EE.bind(null,h,g,a),[a]),h.flags|=2048,lc(9,{destroy:void 0},TE.bind(null,h,g,u,o),null),u},useId:function(){var a=Fr(),o=Gt.identifierPrefix;if(mt){var u=za,h=La;u=(h&~(1<<32-mr(h)-1)).toString(32)+u,o="_"+o+"R_"+u,u=jm++,0<\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof h.is=="string"?P.createElement("select",{is:h.is}):P.createElement("select"),h.multiple?g.multiple=!0:h.size&&(g.size=h.size);break;default:g=typeof h.is=="string"?P.createElement(y,{is:h.is}):P.createElement(y)}}g[Fn]=o,g[Mr]=h;e:for(P=o.child;P!==null;){if(P.tag===5||P.tag===6)g.appendChild(P.stateNode);else if(P.tag!==4&&P.tag!==27&&P.child!==null){P.child.return=P,P=P.child;continue}if(P===o)break e;for(;P.sibling===null;){if(P.return===null||P.return===o)break e;P=P.return}P.sibling.return=P.return,P=P.sibling}o.stateNode=g;e:switch(_r(g,y,h),y){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&So(o)}}return an(o),hb(o,o.type,a===null?null:a.memoizedProps,o.pendingProps,u),null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==h&&So(o);else{if(typeof h!="string"&&o.stateNode===null)throw Error(r(166));if(a=Se.current,Ju(o)){if(a=o.stateNode,u=o.memoizedProps,h=null,y=xr,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}a[Fn]=o,a=!!(a.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||_j(a.nodeValue,u)),a||gs(o,!0)}else a=tv(a).createTextNode(h),a[Fn]=o,o.stateNode=a}return an(o),null;case 31:if(u=o.memoizedState,a===null||a.memoizedState!==null){if(h=Ju(o),u!==null){if(a===null){if(!h)throw Error(r(318));if(a=o.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[Fn]=o}else Pl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;an(o),a=!1}else u=_0(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return o.flags&256?(bi(o),o):(bi(o),null);if((o.flags&128)!==0)throw Error(r(558))}return an(o),null;case 13:if(h=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(y=Ju(o),h!==null&&h.dehydrated!==null){if(a===null){if(!y)throw Error(r(318));if(y=o.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[Fn]=o}else Pl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;an(o),y=!1}else y=_0(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=y),y=!0;if(!y)return o.flags&256?(bi(o),o):(bi(o),null)}return bi(o),(o.flags&128)!==0?(o.lanes=u,o):(u=h!==null,a=a!==null&&a.memoizedState!==null,u&&(h=o.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool),g=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(g=h.memoizedState.cachePool.pool),g!==y&&(h.flags|=2048)),u!==a&&u&&(o.child.flags|=8192),qm(o,o.updateQueue),an(o),null);case 4:return de(),a===null&&kb(o.stateNode.containerInfo),an(o),null;case 10:return yo(o.type),an(o),null;case 19:if(V(Pn),h=o.memoizedState,h===null)return an(o),null;if(y=(o.flags&128)!==0,g=h.rendering,g===null)if(y)zd(h,!1);else{if(Sn!==0||a!==null&&(a.flags&128)!==0)for(a=o.child;a!==null;){if(g=Em(a),g!==null){for(o.flags|=128,zd(h,!1),a=g.updateQueue,o.updateQueue=a,qm(o,a),o.subtreeFlags=0,a=u,u=o.child;u!==null;)tE(u,a),u=u.sibling;return X(Pn,Pn.current&1|2),mt&&mo(o,h.treeForkCount),o.child}a=a.sibling}h.tail!==null&&ze()>Fm&&(o.flags|=128,y=!0,zd(h,!1),o.lanes=4194304)}else{if(!y)if(a=Em(g),a!==null){if(o.flags|=128,y=!0,a=a.updateQueue,o.updateQueue=a,qm(o,a),zd(h,!0),h.tail===null&&h.tailMode==="hidden"&&!g.alternate&&!mt)return an(o),null}else 2*ze()-h.renderingStartTime>Fm&&u!==536870912&&(o.flags|=128,y=!0,zd(h,!1),o.lanes=4194304);h.isBackwards?(g.sibling=o.child,o.child=g):(a=h.last,a!==null?a.sibling=g:o.child=g,h.last=g)}return h.tail!==null?(a=h.tail,h.rendering=a,h.tail=a.sibling,h.renderingStartTime=ze(),a.sibling=null,u=Pn.current,X(Pn,y?u&1|2:u&1),mt&&mo(o,h.treeForkCount),a):(an(o),null);case 22:case 23:return bi(o),L0(),h=o.memoizedState!==null,a!==null?a.memoizedState!==null!==h&&(o.flags|=8192):h&&(o.flags|=8192),h?(u&536870912)!==0&&(o.flags&128)===0&&(an(o),o.subtreeFlags&6&&(o.flags|=8192)):an(o),u=o.updateQueue,u!==null&&qm(o,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==u&&(o.flags|=2048),a!==null&&V(Rl),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),yo($n),an(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function l8(a,o){switch(S0(o),o.tag){case 1:return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return yo($n),de(),a=o.flags,(a&65536)!==0&&(a&128)===0?(o.flags=a&-65537|128,o):null;case 26:case 27:case 5:return Ee(o),null;case 31:if(o.memoizedState!==null){if(bi(o),o.alternate===null)throw Error(r(340));Pl()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 13:if(bi(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Pl()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return V(Pn),null;case 4:return de(),null;case 10:return yo(o.type),null;case 22:case 23:return bi(o),L0(),a!==null&&V(Rl),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return yo($n),null;case 25:return null;default:return null}}function MM(a,o){switch(S0(o),o.tag){case 3:yo($n),de();break;case 26:case 27:case 5:Ee(o);break;case 4:de();break;case 31:o.memoizedState!==null&&bi(o);break;case 13:bi(o);break;case 19:V(Pn);break;case 10:yo(o.type);break;case 22:case 23:bi(o),L0(),a!==null&&V(Rl);break;case 24:yo($n)}}function $d(a,o){try{var u=o.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var y=h.next;u=y;do{if((u.tag&a)===a){h=void 0;var g=u.create,P=u.inst;h=g(),P.destroy=h}u=u.next}while(u!==y)}}catch(L){$t(o,o.return,L)}}function Os(a,o,u){try{var h=o.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var g=y.next;h=g;do{if((h.tag&a)===a){var P=h.inst,L=P.destroy;if(L!==void 0){P.destroy=void 0,y=o;var Y=u,se=L;try{se()}catch(pe){$t(y,Y,pe)}}}h=h.next}while(h!==g)}}catch(pe){$t(o,o.return,pe)}}function jM(a){var o=a.updateQueue;if(o!==null){var u=a.stateNode;try{bE(o,u)}catch(h){$t(a,a.return,h)}}}function PM(a,o,u){u.props=$l(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(h){$t(a,o,h)}}function Bd(a,o){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var h=a.stateNode;break;case 30:h=a.stateNode;break;default:h=a.stateNode}typeof u=="function"?a.refCleanup=u(h):u.current=h}}catch(y){$t(a,o,y)}}function $a(a,o){var u=a.ref,h=a.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(y){$t(a,o,y)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){$t(a,o,y)}else u.current=null}function CM(a){var o=a.type,u=a.memoizedProps,h=a.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(y){$t(a,a.return,y)}}function pb(a,o,u){try{var h=a.stateNode;P8(h,a.type,u,o),h[Mr]=o}catch(y){$t(a,a.return,y)}}function DM(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Ds(a.type)||a.tag===4}function mb(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||DM(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Ds(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function vb(a,o,u){var h=a.tag;if(h===5||h===6)a=a.stateNode,o?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(a,o):(o=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,o.appendChild(a),u=u._reactRootContainer,u!=null||o.onclick!==null||(o.onclick=Ur));else if(h!==4&&(h===27&&Ds(a.type)&&(u=a.stateNode,o=null),a=a.child,a!==null))for(vb(a,o,u),a=a.sibling;a!==null;)vb(a,o,u),a=a.sibling}function Im(a,o,u){var h=a.tag;if(h===5||h===6)a=a.stateNode,o?u.insertBefore(a,o):u.appendChild(a);else if(h!==4&&(h===27&&Ds(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(Im(a,o,u),a=a.sibling;a!==null;)Im(a,o,u),a=a.sibling}function RM(a){var o=a.stateNode,u=a.memoizedProps;try{for(var h=a.type,y=o.attributes;y.length;)o.removeAttributeNode(y[0]);_r(o,h,u),o[Fn]=a,o[Mr]=u}catch(g){$t(a,a.return,g)}}var wo=!1,In=!1,yb=!1,NM=typeof WeakSet=="function"?WeakSet:Set,lr=null;function u8(a,o){if(a=a.containerInfo,$b=lv,a=nn(a),bn(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var y=h.anchorOffset,g=h.focusNode;h=h.focusOffset;try{u.nodeType,g.nodeType}catch{u=null;break e}var P=0,L=-1,Y=-1,se=0,pe=0,xe=a,le=null;t:for(;;){for(var fe;xe!==u||y!==0&&xe.nodeType!==3||(L=P+y),xe!==g||h!==0&&xe.nodeType!==3||(Y=P+h),xe.nodeType===3&&(P+=xe.nodeValue.length),(fe=xe.firstChild)!==null;)le=xe,xe=fe;for(;;){if(xe===a)break t;if(le===u&&++se===y&&(L=P),le===g&&++pe===h&&(Y=P),(fe=xe.nextSibling)!==null)break;xe=le,le=xe.parentNode}xe=fe}u=L===-1||Y===-1?null:{start:L,end:Y}}else u=null}u=u||{start:0,end:0}}else u=null;for(Bb={focusedElem:a,selectionRange:u},lv=!1,lr=o;lr!==null;)if(o=lr,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,lr=a;else for(;lr!==null;){switch(o=lr,g=o.alternate,a=o.flags,o.tag){case 0:if((a&4)!==0&&(a=o.updateQueue,a=a!==null?a.events:null,a!==null))for(u=0;u title"))),_r(g,h,u),g[Fn]=a,En(g),h=g;break e;case"link":var P=qj("link","href",y).get(h+(u.href||""));if(P){for(var L=0;LVt&&(P=Vt,Vt=He,He=P);var re=Be(L,He),ne=Be(L,Vt);if(re&&ne&&(fe.rangeCount!==1||fe.anchorNode!==re.node||fe.anchorOffset!==re.offset||fe.focusNode!==ne.node||fe.focusOffset!==ne.offset)){var oe=xe.createRange();oe.setStart(re.node,re.offset),fe.removeAllRanges(),He>Vt?(fe.addRange(oe),fe.extend(ne.node,ne.offset)):(oe.setEnd(ne.node,ne.offset),fe.addRange(oe))}}}}for(xe=[],fe=L;fe=fe.parentNode;)fe.nodeType===1&&xe.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;Lu?32:u,q.T=null,u=Ab,Ab=null;var g=js,P=Eo;if(Gn=0,hc=js=null,Eo=0,(Tt&6)!==0)throw Error(r(331));var L=Tt;if(Tt|=4,FM(g.current),UM(g,g.current,P,u),Tt=L,Fd(0,!1),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot(kn,g)}catch{}return!0}finally{F.p=y,q.T=h,uj(a,o)}}function fj(a,o,u){o=qi(u,o),o=rb(a.stateNode,o,2),a=ws(a,o,2),a!==null&&(pi(a,2),Ba(a))}function $t(a,o,u){if(a.tag===3)fj(a,a,u);else for(;o!==null;){if(o.tag===3){fj(o,a,u);break}else if(o.tag===1){var h=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ms===null||!Ms.has(h))){a=qi(u,a),u=dM(2),h=ws(o,u,2),h!==null&&(hM(u,h,o,a),pi(h,2),Ba(h));break}}o=o.return}}function Mb(a,o,u){var h=a.pingCache;if(h===null){h=a.pingCache=new d8;var y=new Set;h.set(o,y)}else y=h.get(o),y===void 0&&(y=new Set,h.set(o,y));y.has(u)||(xb=!0,y.add(u),a=y8.bind(null,a,o,u),o.then(a,a))}function y8(a,o,u){var h=a.pingCache;h!==null&&h.delete(o),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,Gt===a&&(ft&u)===u&&(Sn===4||Sn===3&&(ft&62914560)===ft&&300>ze()-Hm?(Tt&2)===0&&pc(a,0):Sb|=u,dc===ft&&(dc=0)),Ba(a)}function dj(a,o){o===0&&(o=Xp()),a=Ml(a,o),a!==null&&(pi(a,o),Ba(a))}function g8(a){var o=a.memoizedState,u=0;o!==null&&(u=o.retryLane),dj(a,u)}function b8(a,o){var u=0;switch(a.tag){case 31:case 13:var h=a.stateNode,y=a.memoizedState;y!==null&&(u=y.retryLane);break;case 19:h=a.stateNode;break;case 22:h=a.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(o),dj(a,u)}function x8(a,o){return pt(a,o)}var Qm=null,vc=null,jb=!1,Zm=!1,Pb=!1,Cs=0;function Ba(a){a!==vc&&a.next===null&&(vc===null?Qm=vc=a:vc=vc.next=a),Zm=!0,jb||(jb=!0,w8())}function Fd(a,o){if(!Pb&&Zm){Pb=!0;do for(var u=!1,h=Qm;h!==null;){if(a!==0){var y=h.pendingLanes;if(y===0)var g=0;else{var P=h.suspendedLanes,L=h.pingedLanes;g=(1<<31-mr(42|a)+1)-1,g&=y&~(P&~L),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(u=!0,vj(h,g))}else g=ft,g=Lu(h,h===Gt?g:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(g&3)===0||vl(h,g)||(u=!0,vj(h,g));h=h.next}while(u);Pb=!1}}function S8(){hj()}function hj(){Zm=jb=!1;var a=0;Cs!==0&&D8()&&(a=Cs);for(var o=ze(),u=null,h=Qm;h!==null;){var y=h.next,g=pj(h,o);g===0?(h.next=null,u===null?Qm=y:u.next=y,y===null&&(vc=u)):(u=h,(a!==0||(g&3)!==0)&&(Zm=!0)),h=y}Gn!==0&&Gn!==5||Fd(a),Cs!==0&&(Cs=0)}function pj(a,o){for(var u=a.suspendedLanes,h=a.pingedLanes,y=a.expirationTimes,g=a.pendingLanes&-62914561;0L)break;var pe=Y.transferSize,xe=Y.initiatorType;pe&&Aj(xe)&&(Y=Y.responseEnd,P+=pe*(Y"u"?null:document;function Lj(a,o,u){var h=yc;if(h&&typeof o=="string"&&o){var y=Ir(o);y='link[rel="'+a+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),kj.has(y)||(kj.add(y),a={rel:a,crossOrigin:u,href:o},h.querySelector(y)===null&&(o=h.createElement("link"),_r(o,"link",a),En(o),h.head.appendChild(o)))}}function I8(a){Mo.D(a),Lj("dns-prefetch",a,null)}function U8(a,o){Mo.C(a,o),Lj("preconnect",a,o)}function V8(a,o,u){Mo.L(a,o,u);var h=yc;if(h&&a&&o){var y='link[rel="preload"][as="'+Ir(o)+'"]';o==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Ir(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Ir(u.imageSizes)+'"]')):y+='[href="'+Ir(a)+'"]';var g=y;switch(o){case"style":g=gc(a);break;case"script":g=bc(a)}Gi.has(g)||(a=p({rel:"preload",href:o==="image"&&u&&u.imageSrcSet?void 0:a,as:o},u),Gi.set(g,a),h.querySelector(y)!==null||o==="style"&&h.querySelector(Xd(g))||o==="script"&&h.querySelector(Wd(g))||(o=h.createElement("link"),_r(o,"link",a),En(o),h.head.appendChild(o)))}}function H8(a,o){Mo.m(a,o);var u=yc;if(u&&a){var h=o&&typeof o.as=="string"?o.as:"script",y='link[rel="modulepreload"][as="'+Ir(h)+'"][href="'+Ir(a)+'"]',g=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=bc(a)}if(!Gi.has(g)&&(a=p({rel:"modulepreload",href:a},o),Gi.set(g,a),u.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Wd(g)))return}h=u.createElement("link"),_r(h,"link",a),En(h),u.head.appendChild(h)}}}function F8(a,o,u){Mo.S(a,o,u);var h=yc;if(h&&a){var y=Li(h).hoistableStyles,g=gc(a);o=o||"default";var P=y.get(g);if(!P){var L={loading:0,preload:null};if(P=h.querySelector(Xd(g)))L.loading=5;else{a=p({rel:"stylesheet",href:a,"data-precedence":o},u),(u=Gi.get(g))&&Gb(a,u);var Y=P=h.createElement("link");En(Y),_r(Y,"link",a),Y._p=new Promise(function(se,pe){Y.onload=se,Y.onerror=pe}),Y.addEventListener("load",function(){L.loading|=1}),Y.addEventListener("error",function(){L.loading|=2}),L.loading|=4,rv(P,o,h)}P={type:"stylesheet",instance:P,count:1,state:L},y.set(g,P)}}}function G8(a,o){Mo.X(a,o);var u=yc;if(u&&a){var h=Li(u).hoistableScripts,y=bc(a),g=h.get(y);g||(g=u.querySelector(Wd(y)),g||(a=p({src:a,async:!0},o),(o=Gi.get(y))&&Kb(a,o),g=u.createElement("script"),En(g),_r(g,"link",a),u.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},h.set(y,g))}}function K8(a,o){Mo.M(a,o);var u=yc;if(u&&a){var h=Li(u).hoistableScripts,y=bc(a),g=h.get(y);g||(g=u.querySelector(Wd(y)),g||(a=p({src:a,async:!0,type:"module"},o),(o=Gi.get(y))&&Kb(a,o),g=u.createElement("script"),En(g),_r(g,"link",a),u.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},h.set(y,g))}}function zj(a,o,u,h){var y=(y=Se.current)?nv(y):null;if(!y)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(o=gc(u.href),u=Li(y).hoistableStyles,h=u.get(o),h||(h={type:"style",instance:null,count:0,state:null},u.set(o,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=gc(u.href);var g=Li(y).hoistableStyles,P=g.get(a);if(P||(y=y.ownerDocument||y,P={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(a,P),(g=y.querySelector(Xd(a)))&&!g._p&&(P.instance=g,P.state.loading=5),Gi.has(a)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Gi.set(a,u),g||Y8(y,a,u,P.state))),o&&h===null)throw Error(r(528,""));return P}if(o&&h!==null)throw Error(r(529,""));return null;case"script":return o=u.async,u=u.src,typeof u=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=bc(u),u=Li(y).hoistableScripts,h=u.get(o),h||(h={type:"script",instance:null,count:0,state:null},u.set(o,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function gc(a){return'href="'+Ir(a)+'"'}function Xd(a){return'link[rel="stylesheet"]['+a+"]"}function $j(a){return p({},a,{"data-precedence":a.precedence,precedence:null})}function Y8(a,o,u,h){a.querySelector('link[rel="preload"][as="style"]['+o+"]")?h.loading=1:(o=a.createElement("link"),h.preload=o,o.addEventListener("load",function(){return h.loading|=1}),o.addEventListener("error",function(){return h.loading|=2}),_r(o,"link",u),En(o),a.head.appendChild(o))}function bc(a){return'[src="'+Ir(a)+'"]'}function Wd(a){return"script[async]"+a}function Bj(a,o,u){if(o.count++,o.instance===null)switch(o.type){case"style":var h=a.querySelector('style[data-href~="'+Ir(u.href)+'"]');if(h)return o.instance=h,En(h),h;var y=p({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(a.ownerDocument||a).createElement("style"),En(h),_r(h,"style",y),rv(h,u.precedence,a),o.instance=h;case"stylesheet":y=gc(u.href);var g=a.querySelector(Xd(y));if(g)return o.state.loading|=4,o.instance=g,En(g),g;h=$j(u),(y=Gi.get(y))&&Gb(h,y),g=(a.ownerDocument||a).createElement("link"),En(g);var P=g;return P._p=new Promise(function(L,Y){P.onload=L,P.onerror=Y}),_r(g,"link",h),o.state.loading|=4,rv(g,u.precedence,a),o.instance=g;case"script":return g=bc(u.src),(y=a.querySelector(Wd(g)))?(o.instance=y,En(y),y):(h=u,(y=Gi.get(g))&&(h=p({},u),Kb(h,y)),a=a.ownerDocument||a,y=a.createElement("script"),En(y),_r(y,"link",h),a.head.appendChild(y),o.instance=y);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(h=o.instance,o.state.loading|=4,rv(h,u.precedence,a));return o.instance}function rv(a,o,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,g=y,P=0;P title"):null)}function X8(a,o,u){if(u===1||o.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return a=o.disabled,typeof o.precedence=="string"&&a==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function Uj(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function W8(a,o,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=gc(h.href),g=o.querySelector(Xd(y));if(g){o=g._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(a.count++,a=av.bind(a),o.then(a,a)),u.state.loading|=4,u.instance=g,En(g);return}g=o.ownerDocument||o,h=$j(h),(y=Gi.get(y))&&Gb(h,y),g=g.createElement("link"),En(g);var P=g;P._p=new Promise(function(L,Y){P.onload=L,P.onerror=Y}),_r(g,"link",h),u.instance=g}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(u,o),(o=u.state.preload)&&(u.state.loading&3)===0&&(a.count++,u=av.bind(a),o.addEventListener("load",u),o.addEventListener("error",u))}}var Yb=0;function Q8(a,o){return a.stylesheets&&a.count===0&&sv(a,a.stylesheets),0Yb?50:800)+o);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(h),clearTimeout(y)}}:null}function av(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)sv(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var ov=null;function sv(a,o){a.stylesheets=null,a.unsuspend!==null&&(a.count++,ov=new Map,o.forEach(Z8,a),ov=null,av.call(a))}function Z8(a,o){if(!(o.state.loading&4)){var u=ov.get(a);if(u)var h=u.get(null);else{u=new Map,ov.set(a,u);for(var y=a.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ix.exports=vU(),ix.exports}var gU=yU();const bU=Ft(gU);var Bf=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(){}},iu,Gs,Vc,Tz,xU=(Tz=class extends Bf{constructor(){super();qe(this,iu);qe(this,Gs);qe(this,Vc);Ce(this,Vc,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,Gs)||this.setEventListener(W(this,Vc))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Gs))==null||t.call(this),Ce(this,Gs,void 0))}setEventListener(t){var n;Ce(this,Vc,t),(n=W(this,Gs))==null||n.call(this),Ce(this,Gs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){W(this,iu)!==t&&(Ce(this,iu,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof W(this,iu)=="boolean"?W(this,iu):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},iu=new WeakMap,Gs=new WeakMap,Vc=new WeakMap,Tz),GO=new xU,SU={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ks,HO,Ez,wU=(Ez=class{constructor(){qe(this,Ks,SU);qe(this,HO,!1)}setTimeoutProvider(e){Ce(this,Ks,e)}setTimeout(e,t){return W(this,Ks).setTimeout(e,t)}clearTimeout(e){W(this,Ks).clearTimeout(e)}setInterval(e,t){return W(this,Ks).setInterval(e,t)}clearInterval(e){W(this,Ks).clearInterval(e)}},Ks=new WeakMap,HO=new WeakMap,Ez),Ql=new wU;function _U(e){setTimeout(e,0)}var AU=typeof window>"u"||"Deno"in globalThis;function Kr(){}function OU(e,t){return typeof e=="function"?e(t):e}function N_(e){return typeof e=="number"&&e>=0&&e!==1/0}function zz(e,t){return Math.max(e+(t||0)-Date.now(),0)}function il(e,t){return typeof e=="function"?e(t):e}function Mi(e,t){return typeof e=="function"?e(t):e}function pP(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==KO(l,t.options))return!1}else if(!Ih(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||i&&i!==t.state.fetchStatus||s&&!s(t))}function mP(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(gu(t.options.mutationKey)!==gu(s))return!1}else if(!Ih(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function KO(e,t){return((t==null?void 0:t.queryKeyHashFn)||gu)(e)}function gu(e){return JSON.stringify(e,(t,n)=>k_(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ih(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ih(e[n],t[n])):!1}var TU=Object.prototype.hasOwnProperty;function $z(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=vP(e)&&vP(t);if(!r&&!(k_(e)&&k_(t)))return t;const s=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),c=l.length,f=r?new Array(c):{};let d=0;for(let m=0;m{Ql.setTimeout(t,e)})}function L_(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?$z(e,t):t}function MU(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function jU(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var YO=Symbol();function Bz(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===YO?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function XO(e,t){return typeof e=="function"?e(...t):!!e}function PU(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 Uh=(()=>{let e=()=>AU;return{isServer(){return e()},setIsServer(t){e=t}}})();function z_(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});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 CU=_U;function DU(){let e=[],t=0,n=c=>{c()},r=c=>{c()},i=CU;const s=c=>{t?e.push(c):i(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&i(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:c=>{let f;t++;try{f=c()}finally{t--,t||l()}return f},batchCalls:c=>(...f)=>{s(()=>{c(...f)})},schedule:s,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var Qn=DU(),Hc,Ys,Fc,Mz,RU=(Mz=class extends Bf{constructor(){super();qe(this,Hc,!0);qe(this,Ys);qe(this,Fc);Ce(this,Fc,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(){W(this,Ys)||this.setEventListener(W(this,Fc))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Ys))==null||t.call(this),Ce(this,Ys,void 0))}setEventListener(t){var n;Ce(this,Fc,t),(n=W(this,Ys))==null||n.call(this),Ce(this,Ys,t(this.setOnline.bind(this)))}setOnline(t){W(this,Hc)!==t&&(Ce(this,Hc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return W(this,Hc)}},Hc=new WeakMap,Ys=new WeakMap,Fc=new WeakMap,Mz),Wv=new RU;function NU(e){return Math.min(1e3*2**e,3e4)}function qz(e){return(e??"online")==="online"?Wv.isOnline():!0}var $_=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Iz(e){let t=!1,n=0,r;const i=z_(),s=()=>i.status!=="pending",l=S=>{var x;if(!s()){const A=new $_(S);v(A),(x=e.onCancel)==null||x.call(e,A)}},c=()=>{t=!0},f=()=>{t=!1},d=()=>GO.isFocused()&&(e.networkMode==="always"||Wv.isOnline())&&e.canRun(),m=()=>qz(e.networkMode)&&e.canRun(),p=S=>{s()||(r==null||r(),i.resolve(S))},v=S=>{s()||(r==null||r(),i.reject(S))},b=()=>new Promise(S=>{var x;r=A=>{(s()||d())&&S(A)},(x=e.onPause)==null||x.call(e)}).then(()=>{var S;r=void 0,s()||(S=e.onContinue)==null||S.call(e)}),w=()=>{if(s())return;let S;const x=n===0?e.initialPromise:void 0;try{S=x??e.fn()}catch(A){S=Promise.reject(A)}Promise.resolve(S).then(p).catch(A=>{var j;if(s())return;const _=e.retry??(Uh.isServer()?0:3),M=e.retryDelay??NU,E=typeof M=="function"?M(n,A):M,O=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,A);if(t||!O){v(A);return}n++,(j=e.onFail)==null||j.call(e,n,A),EU(E).then(()=>d()?void 0:b()).then(()=>{t?v(A):w()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r==null||r(),i),cancelRetry:c,continueRetry:f,canStart:m,start:()=>(m()?w():b().then(w),i)}}var au,jz,Uz=(jz=class{constructor(){qe(this,au)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),N_(this.gcTime)&&Ce(this,au,Ql.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Uh.isServer()?1/0:300*1e3))}clearGcTimeout(){W(this,au)!==void 0&&(Ql.clearTimeout(W(this,au)),Ce(this,au,void 0))}},au=new WeakMap,jz);function kU(e){return{onFetch:(t,n)=>{var m,p,v,b,w;const r=t.options,i=(v=(p=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:p.fetchMore)==null?void 0:v.direction,s=((b=t.state.data)==null?void 0:b.pages)||[],l=((w=t.state.data)==null?void 0:w.pageParams)||[];let c={pages:[],pageParams:[]},f=0;const d=async()=>{let S=!1;const x=M=>{PU(M,()=>t.signal,()=>S=!0)},A=Bz(t.options,t.fetchOptions),_=async(M,E,O)=>{if(S)return Promise.reject(t.signal.reason);if(E==null&&M.pages.length)return Promise.resolve(M);const R=(()=>{const $={client:t.client,queryKey:t.queryKey,pageParam:E,direction:O?"backward":"forward",meta:t.options.meta};return x($),$})(),k=await A(R),{maxPages:z}=t.options,G=O?jU:MU;return{pages:G(M.pages,k,z),pageParams:G(M.pageParams,E,z)}};if(i&&s.length){const M=i==="backward",E=M?LU:gP,O={pages:s,pageParams:l},j=E(r,O);c=await _(O,j,M)}else{const M=e??s.length;do{const E=f===0?l[0]??r.initialPageParam:gP(r,c);if(f>0&&E==null)break;c=await _(c,E),f++}while(f{var S,x;return(x=(S=t.options).persister)==null?void 0:x.call(S,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function gP(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 LU(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 Gc,ou,Kc,ta,su,ur,Pp,lu,Ei,Vz,Co,Pz,zU=(Pz=class extends Uz{constructor(t){super();qe(this,Ei);qe(this,Gc);qe(this,ou);qe(this,Kc);qe(this,ta);qe(this,su);qe(this,ur);qe(this,Pp);qe(this,lu);Ce(this,lu,!1),Ce(this,Pp,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ce(this,su,t.client),Ce(this,ta,W(this,su).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ce(this,ou,xP(this.options)),this.state=t.state??W(this,ou),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return W(this,Gc)}get promise(){var t;return(t=W(this,ur))==null?void 0:t.promise}setOptions(t){if(this.options={...W(this,Pp),...t},t!=null&&t._type&&Ce(this,Gc,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=xP(this.options);n.data!==void 0&&(this.setState(bP(n.data,n.dataUpdatedAt)),Ce(this,ou,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,ta).remove(this)}setData(t,n){const r=L_(this.state.data,t,this.options);return at(this,Ei,Co).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){at(this,Ei,Co).call(this,{type:"setState",state:t})}cancel(t){var r,i;const n=(r=W(this,ur))==null?void 0:r.promise;return(i=W(this,ur))==null||i.cancel(t),n?n.then(Kr).catch(Kr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return W(this,ou)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Mi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===YO||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>il(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:!zz(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,ur))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,ur))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),W(this,ta).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(W(this,ur)&&(W(this,lu)||at(this,Ei,Vz).call(this)?W(this,ur).cancel({revert:!0}):W(this,ur).cancelRetry()),this.scheduleGc()),W(this,ta).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||at(this,Ei,Co).call(this,{type:"invalidate"})}async fetch(t,n){var d,m,p,v,b,w,S,x,A,_,M;if(this.state.fetchStatus!=="idle"&&((d=W(this,ur))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,ur))return W(this,ur).continueRetry(),W(this,ur).promise}if(t&&this.setOptions(t),!this.options.queryFn){const E=this.observers.find(O=>O.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,i=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(Ce(this,lu,!0),r.signal)})},s=()=>{const E=Bz(this.options,n),j=(()=>{const R={client:W(this,su),queryKey:this.queryKey,meta:this.meta};return i(R),R})();return Ce(this,lu,!1),this.options.persister?this.options.persister(E,j,this):E(j)},c=(()=>{const E={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,su),state:this.state,fetchFn:s};return i(E),E})(),f=W(this,Gc)==="infinite"?kU(this.options.pages):this.options.behavior;f==null||f.onFetch(c,this),Ce(this,Kc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=c.fetchOptions)==null?void 0:m.meta))&&at(this,Ei,Co).call(this,{type:"fetch",meta:(p=c.fetchOptions)==null?void 0:p.meta}),Ce(this,ur,Iz({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:E=>{E instanceof $_&&E.revert&&this.setState({...W(this,Kc),fetchStatus:"idle"}),r.abort()},onFail:(E,O)=>{at(this,Ei,Co).call(this,{type:"failed",failureCount:E,error:O})},onPause:()=>{at(this,Ei,Co).call(this,{type:"pause"})},onContinue:()=>{at(this,Ei,Co).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const E=await W(this,ur).start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(b=(v=W(this,ta).config).onSuccess)==null||b.call(v,E,this),(S=(w=W(this,ta).config).onSettled)==null||S.call(w,E,this.state.error,this),E}catch(E){if(E instanceof $_){if(E.silent)return W(this,ur).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw at(this,Ei,Co).call(this,{type:"error",error:E}),(A=(x=W(this,ta).config).onError)==null||A.call(x,E,this),(M=(_=W(this,ta).config).onSettled)==null||M.call(_,this.state.data,E,this),E}finally{this.scheduleGc()}}},Gc=new WeakMap,ou=new WeakMap,Kc=new WeakMap,ta=new WeakMap,su=new WeakMap,ur=new WeakMap,Pp=new WeakMap,lu=new WeakMap,Ei=new WeakSet,Vz=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Co=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,...Hz(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...bP(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ce(this,Kc,t.manual?i:void 0),i;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Qn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,ta).notify({query:this,type:"updated",action:t})})},Pz);function Hz(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:qz(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function bP(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function xP(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 oi,vt,Cp,Gr,uu,Yc,Do,Xs,Dp,Xc,Wc,cu,fu,Ws,Qc,Nt,yh,B_,q_,I_,U_,V_,H_,F_,Fz,Cz,$U=(Cz=class extends Bf{constructor(t,n){super();qe(this,Nt);qe(this,oi);qe(this,vt);qe(this,Cp);qe(this,Gr);qe(this,uu);qe(this,Yc);qe(this,Do);qe(this,Xs);qe(this,Dp);qe(this,Xc);qe(this,Wc);qe(this,cu);qe(this,fu);qe(this,Ws);qe(this,Qc,new Set);this.options=n,Ce(this,oi,t),Ce(this,Xs,null),Ce(this,Do,z_()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,vt).addObserver(this),SP(W(this,vt),this.options)?at(this,Nt,yh).call(this):this.updateResult(),at(this,Nt,U_).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return G_(W(this,vt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return G_(W(this,vt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,at(this,Nt,V_).call(this),at(this,Nt,H_).call(this),W(this,vt).removeObserver(this)}setOptions(t){const n=this.options,r=W(this,vt);if(this.options=W(this,oi).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Mi(this.options.enabled,W(this,vt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");at(this,Nt,F_).call(this),W(this,vt).setOptions(this.options),n._defaulted&&!Xv(this.options,n)&&W(this,oi).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,vt),observer:this});const i=this.hasListeners();i&&wP(W(this,vt),r,this.options,n)&&at(this,Nt,yh).call(this),this.updateResult(),i&&(W(this,vt)!==r||Mi(this.options.enabled,W(this,vt))!==Mi(n.enabled,W(this,vt))||il(this.options.staleTime,W(this,vt))!==il(n.staleTime,W(this,vt)))&&at(this,Nt,B_).call(this);const s=at(this,Nt,q_).call(this);i&&(W(this,vt)!==r||Mi(this.options.enabled,W(this,vt))!==Mi(n.enabled,W(this,vt))||s!==W(this,Ws))&&at(this,Nt,I_).call(this,s)}getOptimisticResult(t){const n=W(this,oi).getQueryCache().build(W(this,oi),t),r=this.createResult(n,t);return qU(this,r)&&(Ce(this,Gr,r),Ce(this,Yc,this.options),Ce(this,uu,W(this,vt).state)),r}getCurrentResult(){return W(this,Gr)}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&&W(this,Do).status==="pending"&&W(this,Do).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){W(this,Qc).add(t)}getCurrentQuery(){return W(this,vt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=W(this,oi).defaultQueryOptions(t),r=W(this,oi).getQueryCache().build(W(this,oi),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return at(this,Nt,yh).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,Gr)))}createResult(t,n){var z;const r=W(this,vt),i=this.options,s=W(this,Gr),l=W(this,uu),c=W(this,Yc),d=t!==r?t.state:W(this,Cp),{state:m}=t;let p={...m},v=!1,b;if(n._optimisticResults){const G=this.hasListeners(),$=!G&&SP(t,n),B=G&&wP(t,r,n,i);($||B)&&(p={...p,...Hz(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:w,errorUpdatedAt:S,status:x}=p;b=p.data;let A=!1;if(n.placeholderData!==void 0&&b===void 0&&x==="pending"){let G;s!=null&&s.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(G=s.data,A=!0):G=typeof n.placeholderData=="function"?n.placeholderData((z=W(this,Wc))==null?void 0:z.state.data,W(this,Wc)):n.placeholderData,G!==void 0&&(x="success",b=L_(s==null?void 0:s.data,G,n),v=!0)}if(n.select&&b!==void 0&&!A)if(s&&b===(l==null?void 0:l.data)&&n.select===W(this,Dp))b=W(this,Xc);else try{Ce(this,Dp,n.select),b=n.select(b),b=L_(s==null?void 0:s.data,b,n),Ce(this,Xc,b),Ce(this,Xs,null)}catch(G){Ce(this,Xs,G)}W(this,Xs)&&(w=W(this,Xs),b=W(this,Xc),S=Date.now(),x="error");const _=p.fetchStatus==="fetching",M=x==="pending",E=x==="error",O=M&&_,j=b!==void 0,k={status:x,fetchStatus:p.fetchStatus,isPending:M,isSuccess:x==="success",isError:E,isInitialLoading:O,isLoading:O,data:b,dataUpdatedAt:p.dataUpdatedAt,error:w,errorUpdatedAt:S,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:_,isRefetching:_&&!M,isLoadingError:E&&!j,isPaused:p.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:E&&j,isStale:WO(t,n),refetch:this.refetch,promise:W(this,Do),isEnabled:Mi(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const G=k.data!==void 0,$=k.status==="error"&&!G,B=J=>{$?J.reject(k.error):G&&J.resolve(k.data)},Z=()=>{const J=Ce(this,Do,k.promise=z_());B(J)},ee=W(this,Do);switch(ee.status){case"pending":t.queryHash===r.queryHash&&B(ee);break;case"fulfilled":($||k.data!==ee.value)&&Z();break;case"rejected":(!$||k.error!==ee.reason)&&Z();break}}return k}updateResult(){const t=W(this,Gr),n=this.createResult(W(this,vt),this.options);if(Ce(this,uu,W(this,vt).state),Ce(this,Yc,this.options),W(this,uu).data!==void 0&&Ce(this,Wc,W(this,vt)),Xv(n,t))return;Ce(this,Gr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!W(this,Qc).size)return!0;const l=new Set(s??W(this,Qc));return this.options.throwOnError&&l.add("error"),Object.keys(W(this,Gr)).some(c=>{const f=c;return W(this,Gr)[f]!==t[f]&&l.has(f)})};at(this,Nt,Fz).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&at(this,Nt,U_).call(this)}},oi=new WeakMap,vt=new WeakMap,Cp=new WeakMap,Gr=new WeakMap,uu=new WeakMap,Yc=new WeakMap,Do=new WeakMap,Xs=new WeakMap,Dp=new WeakMap,Xc=new WeakMap,Wc=new WeakMap,cu=new WeakMap,fu=new WeakMap,Ws=new WeakMap,Qc=new WeakMap,Nt=new WeakSet,yh=function(t){at(this,Nt,F_).call(this);let n=W(this,vt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Kr)),n},B_=function(){at(this,Nt,V_).call(this);const t=il(this.options.staleTime,W(this,vt));if(Uh.isServer()||W(this,Gr).isStale||!N_(t))return;const r=zz(W(this,Gr).dataUpdatedAt,t)+1;Ce(this,cu,Ql.setTimeout(()=>{W(this,Gr).isStale||this.updateResult()},r))},q_=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,vt)):this.options.refetchInterval)??!1},I_=function(t){at(this,Nt,H_).call(this),Ce(this,Ws,t),!(Uh.isServer()||Mi(this.options.enabled,W(this,vt))===!1||!N_(W(this,Ws))||W(this,Ws)===0)&&Ce(this,fu,Ql.setInterval(()=>{(this.options.refetchIntervalInBackground||GO.isFocused())&&at(this,Nt,yh).call(this)},W(this,Ws)))},U_=function(){at(this,Nt,B_).call(this),at(this,Nt,I_).call(this,at(this,Nt,q_).call(this))},V_=function(){W(this,cu)!==void 0&&(Ql.clearTimeout(W(this,cu)),Ce(this,cu,void 0))},H_=function(){W(this,fu)!==void 0&&(Ql.clearInterval(W(this,fu)),Ce(this,fu,void 0))},F_=function(){const t=W(this,oi).getQueryCache().build(W(this,oi),this.options);if(t===W(this,vt))return;const n=W(this,vt);Ce(this,vt,t),Ce(this,Cp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Fz=function(t){Qn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(W(this,Gr))}),W(this,oi).getQueryCache().notify({query:W(this,vt),type:"observerResultsUpdated"})})},Cz);function BU(e,t){return Mi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Mi(t.retryOnMount,e)===!1)}function SP(e,t){return BU(e,t)||e.state.data!==void 0&&G_(e,t,t.refetchOnMount)}function G_(e,t,n){if(Mi(t.enabled,e)!==!1&&il(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&WO(e,t)}return!1}function wP(e,t,n,r){return(e!==t||Mi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&WO(e,n)}function WO(e,t){return Mi(t.enabled,e)!==!1&&e.isStaleByTime(il(t.staleTime,e))}function qU(e,t){return!Xv(e.getCurrentResult(),t)}var Rp,Va,Nr,du,Ha,qs,Dz,IU=(Dz=class extends Uz{constructor(t){super();qe(this,Ha);qe(this,Rp);qe(this,Va);qe(this,Nr);qe(this,du);Ce(this,Rp,t.client),this.mutationId=t.mutationId,Ce(this,Nr,t.mutationCache),Ce(this,Va,[]),this.state=t.state||Gz(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){W(this,Va).includes(t)||(W(this,Va).push(t),this.clearGcTimeout(),W(this,Nr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ce(this,Va,W(this,Va).filter(n=>n!==t)),this.scheduleGc(),W(this,Nr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){W(this,Va).length||(this.state.status==="pending"?this.scheduleGc():W(this,Nr).remove(this))}continue(){var t;return((t=W(this,du))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,c,f,d,m,p,v,b,w,S,x,A,_,M,E,O,j,R;const n=()=>{at(this,Ha,qs).call(this,{type:"continue"})},r={client:W(this,Rp),meta:this.options.meta,mutationKey:this.options.mutationKey};Ce(this,du,Iz({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(k,z)=>{at(this,Ha,qs).call(this,{type:"failed",failureCount:k,error:z})},onPause:()=>{at(this,Ha,qs).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,Nr).canRun(this)}));const i=this.state.status==="pending",s=!W(this,du).canStart();try{if(i)n();else{at(this,Ha,qs).call(this,{type:"pending",variables:t,isPaused:s}),W(this,Nr).config.onMutate&&await W(this,Nr).config.onMutate(t,this,r);const z=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,r));z!==this.state.context&&at(this,Ha,qs).call(this,{type:"pending",context:z,variables:t,isPaused:s})}const k=await W(this,du).start();return await((d=(f=W(this,Nr).config).onSuccess)==null?void 0:d.call(f,k,t,this.state.context,this,r)),await((p=(m=this.options).onSuccess)==null?void 0:p.call(m,k,t,this.state.context,r)),await((b=(v=W(this,Nr).config).onSettled)==null?void 0:b.call(v,k,null,this.state.variables,this.state.context,this,r)),await((S=(w=this.options).onSettled)==null?void 0:S.call(w,k,null,t,this.state.context,r)),at(this,Ha,qs).call(this,{type:"success",data:k}),k}catch(k){try{await((A=(x=W(this,Nr).config).onError)==null?void 0:A.call(x,k,t,this.state.context,this,r))}catch(z){Promise.reject(z)}try{await((M=(_=this.options).onError)==null?void 0:M.call(_,k,t,this.state.context,r))}catch(z){Promise.reject(z)}try{await((O=(E=W(this,Nr).config).onSettled)==null?void 0:O.call(E,void 0,k,this.state.variables,this.state.context,this,r))}catch(z){Promise.reject(z)}try{await((R=(j=this.options).onSettled)==null?void 0:R.call(j,void 0,k,t,this.state.context,r))}catch(z){Promise.reject(z)}throw at(this,Ha,qs).call(this,{type:"error",error:k}),k}finally{W(this,Nr).runNext(this)}}},Rp=new WeakMap,Va=new WeakMap,Nr=new WeakMap,du=new WeakMap,Ha=new WeakSet,qs=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),Qn.batch(()=>{W(this,Va).forEach(r=>{r.onMutationUpdate(t)}),W(this,Nr).notify({mutation:this,type:"updated",action:t})})},Dz);function Gz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ro,ba,Np,Rz,UU=(Rz=class extends Bf{constructor(t={}){super();qe(this,Ro);qe(this,ba);qe(this,Np);this.config=t,Ce(this,Ro,new Set),Ce(this,ba,new Map),Ce(this,Np,0)}build(t,n,r){const i=new IU({client:t,mutationCache:this,mutationId:++mv(this,Np)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){W(this,Ro).add(t);const n=yv(t);if(typeof n=="string"){const r=W(this,ba).get(n);r?r.push(t):W(this,ba).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(W(this,Ro).delete(t)){const n=yv(t);if(typeof n=="string"){const r=W(this,ba).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&W(this,ba).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=yv(t);if(typeof n=="string"){const r=W(this,ba).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=yv(t);if(typeof n=="string"){const i=(r=W(this,ba).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Qn.batch(()=>{W(this,Ro).forEach(t=>{this.notify({type:"removed",mutation:t})}),W(this,Ro).clear(),W(this,ba).clear()})}getAll(){return Array.from(W(this,Ro))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>mP(n,r))}findAll(t={}){return this.getAll().filter(n=>mP(t,n))}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Qn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Kr))))}},Ro=new WeakMap,ba=new WeakMap,Np=new WeakMap,Rz);function yv(e){var t;return(t=e.options.scope)==null?void 0:t.id}var No,Qs,si,ko,Go,Hv,K_,Nz,VU=(Nz=class extends Bf{constructor(n,r){super();qe(this,Go);qe(this,No);qe(this,Qs);qe(this,si);qe(this,ko);Ce(this,No,n),this.setOptions(r),this.bindMethods(),at(this,Go,Hv).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=W(this,No).defaultMutationOptions(n),Xv(this.options,r)||W(this,No).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,si),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&gu(r.mutationKey)!==gu(this.options.mutationKey)?this.reset():((i=W(this,si))==null?void 0:i.state.status)==="pending"&&W(this,si).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,si))==null||n.removeObserver(this)}onMutationUpdate(n){at(this,Go,Hv).call(this),at(this,Go,K_).call(this,n)}getCurrentResult(){return W(this,Qs)}reset(){var n;(n=W(this,si))==null||n.removeObserver(this),Ce(this,si,void 0),at(this,Go,Hv).call(this),at(this,Go,K_).call(this)}mutate(n,r){var i;return Ce(this,ko,r),(i=W(this,si))==null||i.removeObserver(this),Ce(this,si,W(this,No).getMutationCache().build(W(this,No),this.options)),W(this,si).addObserver(this),W(this,si).execute(n)}},No=new WeakMap,Qs=new WeakMap,si=new WeakMap,ko=new WeakMap,Go=new WeakSet,Hv=function(){var r;const n=((r=W(this,si))==null?void 0:r.state)??Gz();Ce(this,Qs,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},K_=function(n){Qn.batch(()=>{var r,i,s,l,c,f,d,m;if(W(this,ko)&&this.hasListeners()){const p=W(this,Qs).variables,v=W(this,Qs).context,b={client:W(this,No),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(r=W(this,ko)).onSuccess)==null||i.call(r,n.data,p,v,b)}catch(w){Promise.reject(w)}try{(l=(s=W(this,ko)).onSettled)==null||l.call(s,n.data,null,p,v,b)}catch(w){Promise.reject(w)}}else if((n==null?void 0:n.type)==="error"){try{(f=(c=W(this,ko)).onError)==null||f.call(c,n.error,p,v,b)}catch(w){Promise.reject(w)}try{(m=(d=W(this,ko)).onSettled)==null||m.call(d,void 0,n.error,p,v,b)}catch(w){Promise.reject(w)}}}this.listeners.forEach(p=>{p(W(this,Qs))})})},Nz),Fa,kz,HU=(kz=class extends Bf{constructor(t={}){super();qe(this,Fa);this.config=t,Ce(this,Fa,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??KO(i,n);let l=this.get(s);return l||(l=new zU({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(l)),l}add(t){W(this,Fa).has(t.queryHash)||(W(this,Fa).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=W(this,Fa).get(t.queryHash);n&&(t.destroy(),n===t&&W(this,Fa).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Qn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return W(this,Fa).get(t)}getAll(){return[...W(this,Fa).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>pP(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>pP(t,r)):n}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Fa=new WeakMap,kz),wn,Zs,Js,Zc,Jc,el,ef,tf,Lz,FU=(Lz=class{constructor(e={}){qe(this,wn);qe(this,Zs);qe(this,Js);qe(this,Zc);qe(this,Jc);qe(this,el);qe(this,ef);qe(this,tf);Ce(this,wn,e.queryCache||new HU),Ce(this,Zs,e.mutationCache||new UU),Ce(this,Js,e.defaultOptions||{}),Ce(this,Zc,new Map),Ce(this,Jc,new Map),Ce(this,el,0)}mount(){mv(this,el)._++,W(this,el)===1&&(Ce(this,ef,GO.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,wn).onFocus())})),Ce(this,tf,Wv.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,wn).onOnline())})))}unmount(){var e,t;mv(this,el)._--,W(this,el)===0&&((e=W(this,ef))==null||e.call(this),Ce(this,ef,void 0),(t=W(this,tf))==null||t.call(this),Ce(this,tf,void 0))}isFetching(e){return W(this,wn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,Zs).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,wn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=W(this,wn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(il(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return W(this,wn).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=W(this,wn).get(r.queryHash),s=i==null?void 0:i.state.data,l=OU(t,s);if(l!==void 0)return W(this,wn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Qn.batch(()=>W(this,wn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,wn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=W(this,wn);Qn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=W(this,wn);return Qn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Qn.batch(()=>W(this,wn).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Kr).catch(Kr)}invalidateQueries(e,t={}){return Qn.batch(()=>(W(this,wn).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=Qn.batch(()=>W(this,wn).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Kr)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Kr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=W(this,wn).build(this,t);return n.isStaleByTime(il(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Kr).catch(Kr)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Kr).catch(Kr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Wv.isOnline()?W(this,Zs).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,wn)}getMutationCache(){return W(this,Zs)}getDefaultOptions(){return W(this,Js)}setDefaultOptions(e){Ce(this,Js,e)}setQueryDefaults(e,t){W(this,Zc).set(gu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,Zc).values()],n={};return t.forEach(r=>{Ih(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){W(this,Jc).set(gu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,Jc).values()],n={};return t.forEach(r=>{Ih(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...W(this,Js).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=KO(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===YO&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...W(this,Js).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,wn).clear(),W(this,Zs).clear()}},wn=new WeakMap,Zs=new WeakMap,Js=new WeakMap,Zc=new WeakMap,Jc=new WeakMap,el=new WeakMap,ef=new WeakMap,tf=new WeakMap,Lz),Kz=K.createContext(void 0),qf=e=>{const t=K.useContext(Kz);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},GU=({client:e,children:t})=>(K.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),T.jsx(Kz.Provider,{value:e,children:t})),Yz=K.createContext(!1),KU=()=>K.useContext(Yz);Yz.Provider;function YU(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var XU=K.createContext(YU()),WU=()=>K.useContext(XU),QU=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?XO(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},ZU=e=>{K.useEffect(()=>{e.clearReset()},[e])},JU=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||XO(n,[e.error,r])),eV=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))}},tV=(e,t)=>e.isLoading&&e.isFetching&&!t,nV=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,_P=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function rV(e,t,n){var v,b,w,S;const r=KU(),i=WU(),s=qf(),l=s.defaultQueryOptions(e);(b=(v=s.getDefaultOptions().queries)==null?void 0:v._experimental_beforeQuery)==null||b.call(v,l);const c=s.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",eV(l),QU(l,i,c),ZU(i);const f=!s.getQueryCache().get(l.queryHash),[d]=K.useState(()=>new t(s,l)),m=d.getOptimisticResult(l),p=!r&&e.subscribed!==!1;if(K.useSyncExternalStore(K.useCallback(x=>{const A=p?d.subscribe(Qn.batchCalls(x)):Kr;return d.updateResult(),A},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),K.useEffect(()=>{d.setOptions(l)},[l,d]),nV(l,m))throw _P(l,d,i);if(JU({result:m,errorResetBoundary:i,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw m.error;if((S=(w=s.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||S.call(w,l,m),l.experimental_prefetchInRender&&!Uh.isServer()&&tV(m,r)){const x=f?_P(l,d,i):c==null?void 0:c.promise;x==null||x.catch(Kr).finally(()=>{d.updateResult()})}return l.notifyOnChangeProps?m:d.trackResult(m)}function Xz(e,t){return rV(e,$U)}function sg(e,t){const n=qf(),[r]=K.useState(()=>new VU(n,e));K.useEffect(()=>{r.setOptions(e)},[r,e]);const i=K.useSyncExternalStore(K.useCallback(l=>r.subscribe(Qn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=K.useCallback((l,c)=>{r.mutate(l,c).catch(Kr)},[r]);if(i.error&&XO(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}function Wz(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const t=oV(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const c=l.split(QO);return c[0]===""&&c.length!==1&&c.shift(),Qz(c,t)||aV(l)},getConflictingClassGroupIds:(l,c)=>{const f=n[l]||[];return c&&r[l]?[...f,...r[l]]:f}}},Qz=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Qz(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(QO);return(l=t.validators.find(({validator:c})=>c(s)))==null?void 0:l.classGroupId},AP=/^\[(.+)\]$/,aV=e=>{if(AP.test(e)){const t=AP.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},oV=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return lV(Object.entries(e.classGroups),n).forEach(([s,l])=>{Y_(l,r,s,t)}),r},Y_=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:OP(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(sV(i)){Y_(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,l])=>{Y_(l,OP(t,s),n,r)})})},OP=(e,t)=>{let n=e;return t.split(QO).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},sV=e=>e.isThemeGetter,lV=(e,t)=>t?e.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([l,c])=>[t+l,c])):s);return[n,i]}):e,uV=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,l)=>{n.set(s,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let l=n.get(s);if(l!==void 0)return l;if((l=r.get(s))!==void 0)return i(s,l),l},set(s,l){n.has(s)?n.set(s,l):i(s,l)}}},Zz="!",cV=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,l=c=>{const f=[];let d=0,m=0,p;for(let x=0;xm?p-m:void 0;return{modifiers:f,hasImportantModifier:b,baseClassName:w,maybePostfixModifierPosition:S}};return n?c=>n({className:c,parseClassName:l}):l},fV=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},dV=e=>({cache:uV(e.cacheSize),parseClassName:cV(e),...iV(e)}),hV=/\s+/,pV=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],l=e.trim().split(hV);let c="";for(let f=l.length-1;f>=0;f-=1){const d=l[f],{modifiers:m,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:b}=n(d);let w=!!b,S=r(w?v.substring(0,b):v);if(!S){if(!w){c=d+(c.length>0?" "+c:c);continue}if(S=r(v),!S){c=d+(c.length>0?" "+c:c);continue}w=!1}const x=fV(m).join(":"),A=p?x+Zz:x,_=A+S;if(s.includes(_))continue;s.push(_);const M=i(S,w);for(let E=0;E0?" "+c:c)}return c};function mV(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rp(m),e());return n=dV(d),r=n.cache.get,i=n.cache.set,s=c,c(f)}function c(f){const d=r(f);if(d)return d;const m=pV(f,n);return i(f,m),m}return function(){return s(mV.apply(null,arguments))}}const on=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},e$=/^\[(?:([a-z-]+):)?(.+)\]$/i,yV=/^\d+\/\d+$/,gV=new Set(["px","full","screen"]),bV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xV=/\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$/,SV=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wV=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_V=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jo=e=>zc(e)||gV.has(e)||yV.test(e),$s=e=>If(e,"length",CV),zc=e=>!!e&&!Number.isNaN(Number(e)),lx=e=>If(e,"number",zc),rh=e=>!!e&&Number.isInteger(Number(e)),AV=e=>e.endsWith("%")&&zc(e.slice(0,-1)),ot=e=>e$.test(e),Bs=e=>bV.test(e),OV=new Set(["length","size","percentage"]),TV=e=>If(e,OV,t$),EV=e=>If(e,"position",t$),MV=new Set(["image","url"]),jV=e=>If(e,MV,RV),PV=e=>If(e,"",DV),ih=()=>!0,If=(e,t,n)=>{const r=e$.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},CV=e=>xV.test(e)&&!SV.test(e),t$=()=>!1,DV=e=>wV.test(e),RV=e=>_V.test(e),NV=()=>{const e=on("colors"),t=on("spacing"),n=on("blur"),r=on("brightness"),i=on("borderColor"),s=on("borderRadius"),l=on("borderSpacing"),c=on("borderWidth"),f=on("contrast"),d=on("grayscale"),m=on("hueRotate"),p=on("invert"),v=on("gap"),b=on("gradientColorStops"),w=on("gradientColorStopPositions"),S=on("inset"),x=on("margin"),A=on("opacity"),_=on("padding"),M=on("saturate"),E=on("scale"),O=on("sepia"),j=on("skew"),R=on("space"),k=on("translate"),z=()=>["auto","contain","none"],G=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",ot,t],B=()=>[ot,t],Z=()=>["",jo,$s],ee=()=>["auto",zc,ot],J=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],q=()=>["solid","dashed","dotted","double","none"],F=()=>["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"],ce=()=>["","0",ot],U=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[zc,ot];return{cacheSize:500,separator:":",theme:{colors:[ih],spacing:[jo,$s],blur:["none","",Bs,ot],brightness:D(),borderColor:[e],borderRadius:["none","","full",Bs,ot],borderSpacing:B(),borderWidth:Z(),contrast:D(),grayscale:ce(),hueRotate:D(),invert:ce(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[AV,$s],inset:$(),margin:$(),opacity:D(),padding:B(),saturate:D(),scale:D(),sepia:ce(),skew:D(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",ot]}],container:["container"],columns:[{columns:[Bs]}],"break-after":[{"break-after":U()}],"break-before":[{"break-before":U()}],"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:[...J(),ot]}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",rh,ot]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ot]}],grow:[{grow:ce()}],shrink:[{shrink:ce()}],order:[{order:["first","last","none",rh,ot]}],"grid-cols":[{"grid-cols":[ih]}],"col-start-end":[{col:["auto",{span:["full",rh,ot]},ot]}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":[ih]}],"row-start-end":[{row:["auto",{span:[rh,ot]},ot]}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ot]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ot]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"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:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ot,t]}],"min-w":[{"min-w":[ot,t,"min","max","fit"]}],"max-w":[{"max-w":[ot,t,"none","full","min","max","fit","prose",{screen:[Bs]},Bs]}],h:[{h:[ot,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ot,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ot,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ot,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Bs,$s]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",lx]}],"font-family":[{font:[ih]}],"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",ot]}],"line-clamp":[{"line-clamp":["none",zc,lx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",jo,ot]}],"list-image":[{"list-image":["none",ot]}],"list-style-type":[{list:["none","disc","decimal",ot]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[A]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[A]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",jo,$s]}],"underline-offset":[{"underline-offset":["auto",jo,ot]}],"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:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ot]}],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",ot]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[A]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...J(),EV]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",TV]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},jV]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[A]}],"border-style":[{border:[...q(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[A]}],"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":[jo,ot]}],"outline-w":[{outline:[jo,$s]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[A]}],"ring-offset-w":[{"ring-offset":[jo,$s]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Bs,PV]}],"shadow-color":[{shadow:[ih]}],opacity:[{opacity:[A]}],"mix-blend":[{"mix-blend":[...F(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":F()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",Bs,ot]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[p]}],saturate:[{saturate:[M]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[A]}],"backdrop-saturate":[{"backdrop-saturate":[M]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"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",ot]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",ot]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",ot]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[rh,ot]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"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",ot]}],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",ot]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"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",ot]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[jo,$s,lx]}],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"]}}},kV=vV(NV);function nf(...e){return kV(ut(e))}function li(e){if(e==null||Number.isNaN(e))return"—";const t=["B","KB","MB","GB","TB"];let n=Number(e),r=0;for(;n>=1024&&rn+r,0)}const TP=e=>{let t;const n=new Set,r=(d,m)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const v=t;t=m??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(b=>b(t,v))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>f,subscribe:d=>(n.add(d),()=>n.delete(d))},f=t=e(r,i,c);return c},LV=(e=>e?TP(e):TP),zV=e=>e;function $V(e,t=zV){const n=Q.useSyncExternalStore(e.subscribe,Q.useCallback(()=>t(e.getState()),[e,t]),Q.useCallback(()=>t(e.getInitialState()),[e,t]));return Q.useDebugValue(n),n}const EP=e=>{const t=LV(e),n=r=>$V(t,r);return Object.assign(n,t),n},BV=(e=>e?EP(e):EP),MP=e=>Symbol.iterator in e,jP=e=>"entries"in e,PP=(e,t)=>{const n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(const[i,s]of n)if(!r.has(i)||!Object.is(s,r.get(i)))return!1;return!0},qV=(e,t)=>{const n=e[Symbol.iterator](),r=t[Symbol.iterator]();let i=n.next(),s=r.next();for(;!i.done&&!s.done;){if(!Object.is(i.value,s.value))return!1;i=n.next(),s=r.next()}return!!i.done&&!!s.done};function IV(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:MP(e)&&MP(t)?jP(e)&&jP(t)?PP(e,t):qV(e,t):PP({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function lg(e){const t=Q.useRef(void 0);return n=>{const r=e(n);return IV(t.current,r)?t.current:t.current=r}}const n$="mtplx.dashboard.theme";function r$(){if(typeof window>"u")return"hippo";const e=window.localStorage.getItem(n$);return e==="hippo"||e==="river"||e==="light"||e==="mono"?e:"hippo"}function CP(e){if(!(typeof window>"u"))try{window.localStorage.setItem(n$,e),window.document.documentElement.setAttribute("data-theme",e)}catch{}}const ux=["hippo","river","light","mono"],De=BV((e,t)=>({snapshot:null,latest:null,recent:[],rolling:null,lifetime:null,inFlight:[],sessionBank:null,sessions:null,mem:null,thermal:null,thermalWhenS:0,settings:null,modelId:null,profileName:null,contextWindow:null,machine:null,uptimeS:0,liveTokS:null,liveProgressByRequest:{},activePrefillByRequest:{},lastCompletedPrefill:null,newMaxTPSEvent:null,connection:"idle",reconnectAttempts:0,lastSnapshotAtMs:null,authRequired:!1,sessionFilter:null,theme:r$(),pauseStream:!1,soundEnabled:!1,applySnapshot:n=>{if(t().pauseStream)return;const r={};(n.in_flight??[]).forEach(s=>{s.prefill_state&&(r[s.request_id]={...s.prefill_state,request_id:s.request_id,session_id:s.session_id})});const i=n.in_flight??[];e(s=>{var l;return{snapshot:n,latest:n.latest,recent:n.recent??[],rolling:n.rolling,lifetime:n.lifetime,inFlight:i,sessionBank:n.session_bank??null,sessions:n.sessions??null,mem:n.mem,thermal:n.thermal,thermalWhenS:n.thermal_when_s,settings:n.settings,modelId:n.model_id,profileName:((l=n.profile)==null?void 0:l.name)??null,contextWindow:n.context_window,machine:n.machine,uptimeS:n.uptime_s,activePrefillByRequest:r,liveTokS:i.length>0?s.liveTokS:null,lastSnapshotAtMs:Date.now()}})},applyEvent:n=>{var r;if(!t().pauseStream)switch(n.kind){case"progress":{const i=(r=n.progress)==null?void 0:r.decode_tok_s;e(s=>({liveTokS:typeof i=="number"&&i>0?i:s.liveTokS,liveProgressByRequest:{...s.liveProgressByRequest,[n.request_id]:n}}));break}case"completed":{e(i=>({latest:n.envelope??i.latest,liveTokS:null}));break}case"new_max_tps":{e({newMaxTPSEvent:{tok_s:n.tok_s,when_s:n.when_s,session_id:n.session_id}});break}case"thermal":{e({thermal:n.thermal,thermalWhenS:n.when_s});break}case"prefill":{const i=n.request_id,s={phase:n.phase,tokens_done:n.tokens_done,tokens_total:n.tokens_total,cached_tokens:n.cached_tokens,new_prefill_tokens:n.new_prefill_tokens,elapsed_s:n.elapsed_s,prefill_tok_s:n.prefill_tok_s,chunk_size:n.chunk_size,cache_hit:n.cache_hit,started_s:n.started_s,request_id:i,session_id:n.session_id};n.phase==="completed"?e(l=>{const c={...l.activePrefillByRequest};return delete c[i],{activePrefillByRequest:c,lastCompletedPrefill:{...s,when_s:n.when_s}}}):e(l=>({activePrefillByRequest:{...l.activePrefillByRequest,[i]:s}}));break}case"snapshot":{t().applySnapshot(n);break}}},mergeSettings:n=>e(r=>r.settings?{settings:{...r.settings,...n}}:{}),setConnection:n=>{e(r=>({connection:n,reconnectAttempts:n==="reconnecting"?r.reconnectAttempts+1:0}))},setAuthRequired:n=>e({authRequired:n}),setSessionFilter:n=>e({sessionFilter:n}),setTheme:n=>{CP(n),e({theme:n})},cycleTheme:()=>{const n=t().theme,r=ux[(ux.indexOf(n)+1)%ux.length];CP(r),e({theme:r})},togglePauseStream:()=>e(n=>({pauseStream:!n.pauseStream})),toggleSound:()=>e(n=>({soundEnabled:!n.soundEnabled})),consumeNewMaxTPS:()=>e({newMaxTPSEvent:null})}));typeof window<"u"&&window.document.documentElement.setAttribute("data-theme",r$());function UV(){return De(lg(e=>{var n;const t=new Set;return(n=e.rolling)==null||n.history.forEach(r=>{r.session_id&&t.add(r.session_id)}),e.inFlight.forEach(r=>{r.session_id&&t.add(r.session_id)}),Array.from(t).sort()}))}function VV(){return De(lg(e=>{if(!e.rolling)return[];const t=e.sessionFilter;return t?e.rolling.history.filter(n=>n.session_id===t):e.rolling.history}))}function HV(){return De(lg(e=>e.sessionFilter?e.recent.filter(t=>t.session_id===e.sessionFilter):e.recent))}function i$(){return De(lg(e=>{const t=Object.values(e.activePrefillByRequest);if(t.length===0)return{active:!1};const n=t.reduce((m,p)=>(p.elapsed_s??0)>(m.elapsed_s??0)?p:m),r=Number(n.tokens_total??0),i=Number(n.tokens_done??0),s=Number(n.elapsed_s??0),l=r>0?Math.min(100,i/r*100):0,c=typeof n.prefill_tok_s=="number"&&n.prefill_tok_s>0?n.prefill_tok_s:i>0&&s>0?i/s:null,f=Math.max(0,r-i),d=c&&c>0&&f>0?f/c:null;return{active:!0,request_id:n.request_id,session_id:n.session_id,tokens_done:i,tokens_total:r,cached_tokens:Number(n.cached_tokens??0),elapsed_s:s,prefill_tok_s:c,pct:l,eta_s:d}}))}function FV(){const e=De(p=>p.latest),t=De(p=>p.lifetime),n=De(p=>p.liveTokS),r=(e==null?void 0:e.completion_tokens)??null,i=(e==null?void 0:e.ttft_s)??null,s=typeof n=="number",l=s?n:(e==null?void 0:e.decode_tok_s)??null,c=(e==null?void 0:e.request_tok_s)??null,f=(e==null?void 0:e.prompt_eval_time_s)??null,d=(e==null?void 0:e.decode_elapsed_s)??null,m=(t==null?void 0:t.requests_total)??0;return T.jsxs("div",{className:"px-4 lg:px-6 py-2 flex items-center justify-between gap-4 text-xs",children:[T.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-[var(--text-muted)] min-w-0",children:[T.jsx(Il,{label:"tok",value:We(r)}),T.jsx(Il,{label:"ttft",value:Zn(i)}),T.jsx(Il,{label:"prompt eval",value:Zn(f)}),T.jsx(Il,{label:"decode",value:Zn(d)}),T.jsx(Il,{label:s?"tok/s live":"tok/s",value:On(l),highlight:s}),T.jsx(Il,{label:"req tok/s",value:On(c)}),T.jsx(Il,{label:"lifetime req",value:We(m)})]}),T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)] hidden sm:block",children:"MTPLX live"})]})}function Il({label:e,value:t,highlight:n=!1}){return T.jsxs("span",{className:"flex items-baseline gap-1.5 whitespace-nowrap",children:[T.jsx("span",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:e}),T.jsx("span",{className:"tabular-nums font-medium "+(n?"text-[var(--accent)]":"text-[var(--text-primary)]"),children:t})]})}function ct({title:e,subtitle:t,action:n,className:r,bodyClassName:i,children:s}){return T.jsxs("section",{className:nf("rounded-2xl border border-[var(--border-soft)] bg-[var(--bg-card)] shadow-[inset_0_1px_0_0_rgba(255,255,255,0.02)] overflow-hidden",r),children:[(e||n)&&T.jsxs("header",{className:"px-5 pt-4 pb-2 flex items-start justify-between gap-4",children:[T.jsxs("div",{className:"min-w-0",children:[e?T.jsx("h3",{className:"text-sm font-semibold text-[var(--text-primary)] tracking-tight",children:e}):null,t?T.jsx("p",{className:"text-xs text-[var(--text-muted)] mt-0.5",children:t}):null]}),n?T.jsx("div",{className:"shrink-0",children:n}):null]}),T.jsx("div",{className:nf("px-5 pb-5 pt-2",i),children:s})]})}function Ya({value:e,unit:t,caption:n,tone:r="default"}){const i=r==="accent"?"text-[var(--accent)]":r==="warm"?"text-[var(--accent-warm)]":r==="hot"?"text-[var(--accent-hot)]":r==="cool"?"text-[var(--accent-cool)]":"text-[var(--text-primary)]";return T.jsxs("div",{children:[T.jsxs("div",{className:nf("flex items-baseline gap-2",i),children:[T.jsx("span",{className:"text-4xl font-semibold tabular-nums leading-none",children:e}),t?T.jsx("span",{className:"text-sm text-[var(--text-muted)]",children:t}):null]}),n?T.jsx("div",{className:"text-xs text-[var(--text-muted)] mt-2",children:n}):null]})}function GV(){const e=De(i=>i.lifetime),t=(e==null?void 0:e.cached_tokens_total)??0,n=(e==null?void 0:e.prompt_tokens_total)??0,r=n>0?t/n*100:0;return T.jsx(ct,{title:"Cached tokens · lifetime",subtitle:"cached / prompt across all requests",children:T.jsx(Ya,{value:We(t),unit:"tokens",tone:"accent",caption:`${r.toFixed(1)}% of ${We(n)} prompt tokens`})})}function KV(){const t=De(s=>s.recent).slice(-32),n=t.filter(s=>s.session_cache_hit).length,r=t.length>0?n/t.length*100:0,i=r>=70?"accent":r>=40?"warm":"hot";return T.jsx(ct,{title:"Session cache hit rate",subtitle:`last ${t.length} requests`,children:T.jsx(Ya,{value:`${r.toFixed(0)}%`,unit:"hit",tone:i,caption:`${n} hits / ${t.length} requests`})})}function YV(){const e=De(l=>l.latest),t=De(l=>l.contextWindow),n=(e==null?void 0:e.context_len)??0,r=t?Math.min(100,n/t*100):0,i=r>=95?"hot":r>=75?"warm":r>=50?"cool":"accent",s=i==="hot"?"var(--accent-hot)":i==="warm"?"var(--accent-warm)":i==="cool"?"var(--accent-cool)":"var(--accent)";return T.jsxs(ct,{title:"Context window utilization",subtitle:`${We(n)} / ${We(t??0)} tokens`,children:[T.jsx("div",{className:"h-4 w-full rounded-full bg-[var(--bg-elevated)] overflow-hidden border border-[var(--border-soft)]",children:T.jsx("div",{className:"h-full transition-[width] duration-500",style:{width:`${r}%`,background:s}})}),T.jsxs("div",{className:"flex justify-between mt-2 text-xs text-[var(--text-muted)] tabular-nums",children:[T.jsx("span",{children:"0"}),T.jsxs("span",{className:"text-[var(--text-primary)] font-semibold",children:[r.toFixed(0),"%"]}),T.jsx("span",{children:We(t??0)})]})]})}var cx,DP;function fi(){if(DP)return cx;DP=1;var e=Array.isArray;return cx=e,cx}var fx,RP;function a$(){if(RP)return fx;RP=1;var e=typeof vv=="object"&&vv&&vv.Object===Object&&vv;return fx=e,fx}var dx,NP;function to(){if(NP)return dx;NP=1;var e=a$(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return dx=n,dx}var hx,kP;function kp(){if(kP)return hx;kP=1;var e=to(),t=e.Symbol;return hx=t,hx}var px,LP;function XV(){if(LP)return px;LP=1;var e=kp(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function s(l){var c=n.call(l,i),f=l[i];try{l[i]=void 0;var d=!0}catch{}var m=r.call(l);return d&&(c?l[i]=f:delete l[i]),m}return px=s,px}var mx,zP;function WV(){if(zP)return mx;zP=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return mx=n,mx}var vx,$P;function Jo(){if($P)return vx;$P=1;var e=kp(),t=XV(),n=WV(),r="[object Null]",i="[object Undefined]",s=e?e.toStringTag:void 0;function l(c){return c==null?c===void 0?i:r:s&&s in Object(c)?t(c):n(c)}return vx=l,vx}var yx,BP;function es(){if(BP)return yx;BP=1;function e(t){return t!=null&&typeof t=="object"}return yx=e,yx}var gx,qP;function Uf(){if(qP)return gx;qP=1;var e=Jo(),t=es(),n="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&e(i)==n}return gx=r,gx}var bx,IP;function JO(){if(IP)return bx;IP=1;var e=fi(),t=Uf(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(s,l){if(e(s))return!1;var c=typeof s;return c=="number"||c=="symbol"||c=="boolean"||s==null||t(s)?!0:r.test(s)||!n.test(s)||l!=null&&s in Object(l)}return bx=i,bx}var xx,UP;function ll(){if(UP)return xx;UP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return xx=e,xx}var Sx,VP;function eT(){if(VP)return Sx;VP=1;var e=Jo(),t=ll(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",s="[object Proxy]";function l(c){if(!t(c))return!1;var f=e(c);return f==r||f==i||f==n||f==s}return Sx=l,Sx}var wx,HP;function QV(){if(HP)return wx;HP=1;var e=to(),t=e["__core-js_shared__"];return wx=t,wx}var _x,FP;function ZV(){if(FP)return _x;FP=1;var e=QV(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return _x=n,_x}var Ax,GP;function o$(){if(GP)return Ax;GP=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return Ax=n,Ax}var Ox,KP;function JV(){if(KP)return Ox;KP=1;var e=eT(),t=ZV(),n=ll(),r=o$(),i=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,f=l.toString,d=c.hasOwnProperty,m=RegExp("^"+f.call(d).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(v){if(!n(v)||t(v))return!1;var b=e(v)?m:s;return b.test(r(v))}return Ox=p,Ox}var Tx,YP;function eH(){if(YP)return Tx;YP=1;function e(t,n){return t==null?void 0:t[n]}return Tx=e,Tx}var Ex,XP;function Eu(){if(XP)return Ex;XP=1;var e=JV(),t=eH();function n(r,i){var s=t(r,i);return e(s)?s:void 0}return Ex=n,Ex}var Mx,WP;function ug(){if(WP)return Mx;WP=1;var e=Eu(),t=e(Object,"create");return Mx=t,Mx}var jx,QP;function tH(){if(QP)return jx;QP=1;var e=ug();function t(){this.__data__=e?e(null):{},this.size=0}return jx=t,jx}var Px,ZP;function nH(){if(ZP)return Px;ZP=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Px=e,Px}var Cx,JP;function rH(){if(JP)return Cx;JP=1;var e=ug(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(s){var l=this.__data__;if(e){var c=l[s];return c===t?void 0:c}return r.call(l,s)?l[s]:void 0}return Cx=i,Cx}var Dx,eC;function iH(){if(eC)return Dx;eC=1;var e=ug(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var s=this.__data__;return e?s[i]!==void 0:n.call(s,i)}return Dx=r,Dx}var Rx,tC;function aH(){if(tC)return Rx;tC=1;var e=ug(),t="__lodash_hash_undefined__";function n(r,i){var s=this.__data__;return this.size+=this.has(r)?0:1,s[r]=e&&i===void 0?t:i,this}return Rx=n,Rx}var Nx,nC;function oH(){if(nC)return Nx;nC=1;var e=tH(),t=nH(),n=rH(),r=iH(),i=aH();function s(l){var c=-1,f=l==null?0:l.length;for(this.clear();++c-1}return qx=t,qx}var Ix,uC;function fH(){if(uC)return Ix;uC=1;var e=cg();function t(n,r){var i=this.__data__,s=e(i,n);return s<0?(++this.size,i.push([n,r])):i[s][1]=r,this}return Ix=t,Ix}var Ux,cC;function fg(){if(cC)return Ux;cC=1;var e=sH(),t=lH(),n=uH(),r=cH(),i=fH();function s(l){var c=-1,f=l==null?0:l.length;for(this.clear();++c>>=0,a===0?32:31-(ku(a)/ns|0)|0}var ro=256,vr=262144,rs=4194304;function Ma(a){var o=a&42;if(o!==0)return o;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Lu(a,o,u){var h=a.pendingLanes;if(h===0)return 0;var y=0,g=a.suspendedLanes,C=a.pingedLanes;a=a.warmLanes;var L=h&134217727;return L!==0?(h=L&~g,h!==0?y=Ma(h):(C&=L,C!==0?y=Ma(C):u||(u=L&~a,u!==0&&(y=Ma(u))))):(L=h&~g,L!==0?y=Ma(L):C!==0?y=Ma(C):u||(u=h&~a,u!==0&&(y=Ma(u)))),y===0?0:o!==0&&o!==y&&(o&g)===0&&(g=y&-y,u=o&-o,g>=u||g===32&&(u&4194048)!==0)?o:y}function vl(a,o){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&o)===0}function o0(a,o){switch(a){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xp(){var a=rs;return rs<<=1,(rs&62914560)===0&&(rs=4194304),a}function rd(a){for(var o=[],u=0;31>u;u++)o.push(a);return o}function pi(a,o){a.pendingLanes|=o,o!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function ir(a,o,u,h,y,g){var C=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var L=a.entanglements,Y=a.expirationTimes,se=a.hiddenUpdates;for(u=C&~u;0"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var s0=/[\n"\\]/g;function Ir(a){return a.replace(s0,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Uu(a,o,u,h,y,g,C,L){a.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?a.type=C:a.removeAttribute("type"),o!=null?C==="number"?(o===0&&a.value===""||a.value!=o)&&(a.value=""+qr(o)):a.value!==""+qr(o)&&(a.value=""+qr(o)):C!=="submit"&&C!=="reset"||a.removeAttribute("value"),o!=null?Vu(a,C,qr(o)):u!=null?Vu(a,C,qr(u)):h!=null&&a.removeAttribute("value"),y==null&&g!=null&&(a.defaultChecked=!!g),y!=null&&(a.checked=y&&typeof y!="function"&&typeof y!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?a.name=""+qr(L):a.removeAttribute("name")}function Zp(a,o,u,h,y,g,C,L){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(a.type=g),o!=null||u!=null){if(!(g!=="submit"&&g!=="reset"||o!=null)){qu(a);return}u=u!=null?""+qr(u):"",o=o!=null?""+qr(o):u,L||o===a.value||(a.value=o),a.defaultValue=o}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,a.checked=L?a.checked:!!h,a.defaultChecked=!!h,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(a.name=C),qu(a)}function Vu(a,o,u){o==="number"&&Iu(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function Pa(a,o,u,h){if(a=a.options,o){o={};for(var y=0;y"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ku=!1;if(jr)try{var cs={};Object.defineProperty(cs,"passive",{get:function(){Ku=!0}}),window.addEventListener("test",cs,cs),window.removeEventListener("test",cs,cs)}catch{Ku=!1}var Vr=null,Ra=null,wl=null;function hd(){if(wl)return wl;var a,o=Ra,u=o.length,h,y="value"in Vr?Vr.value:Vr.textContent,g=y.length;for(a=0;a=ps),Sd=" ",co=!1;function Tl(a,o){switch(a){case"keyup":return um.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mn(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var fo=!1;function gn(a,o){switch(a){case"compositionend":return Mn(o);case"keypress":return o.which!==32?null:(co=!0,Sd);case"textInput":return a=o.data,a===Sd&&co?null:a;default:return null}}function cm(a,o){if(fo)return a==="compositionend"||!Yu&&Tl(a,o)?(a=hd(),wl=Ra=Vr=null,fo=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1=o)return{node:u,offset:o-a};a=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Ve(u)}}function qt(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?qt(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function nn(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=Iu(a.document);o instanceof a.HTMLIFrameElement;){try{var u=typeof o.contentWindow.location.href=="string"}catch{u=!1}if(u)a=o.contentWindow;else break;o=Iu(a.document)}return o}function bn(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o&&(o==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||o==="textarea"||a.contentEditable==="true")}var Ct=jr&&"documentMode"in document&&11>=document.documentMode,Lt=null,gr=null,jn=null,Cr=!1;function Jr(a,o,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Cr||Lt==null||Lt!==Iu(h)||(h=Lt,"selectionStart"in h&&bn(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),jn&&et(jn,h)||(jn=h,h=ev(gr,"onSelect"),0>=C,y-=C,La=1<<32-mr(o)+y|u<it?(dt=$e,$e=null):dt=$e.sibling;var wt=le(re,$e,oe[it],ge);if(wt===null){$e===null&&($e=dt);break}a&&$e&&wt.alternate===null&&o(re,$e),ne=g(wt,ne,it),St===null?Ue=wt:St.sibling=wt,St=wt,$e=dt}if(it===oe.length)return u(re,$e),mt&&mo(re,it),Ue;if($e===null){for(;itit?(dt=$e,$e=null):dt=$e.sibling;var zs=le(re,$e,wt.value,ge);if(zs===null){$e===null&&($e=dt);break}a&&$e&&zs.alternate===null&&o(re,$e),ne=g(zs,ne,it),St===null?Ue=zs:St.sibling=zs,St=zs,$e=dt}if(wt.done)return u(re,$e),mt&&mo(re,it),Ue;if($e===null){for(;!wt.done;it++,wt=oe.next())wt=xe(re,wt.value,ge),wt!==null&&(ne=g(wt,ne,it),St===null?Ue=wt:St.sibling=wt,St=wt);return mt&&mo(re,it),Ue}for($e=h($e);!wt.done;it++,wt=oe.next())wt=fe($e,re,it,wt.value,ge),wt!==null&&(a&&wt.alternate!==null&&$e.delete(wt.key===null?it:wt.key),ne=g(wt,ne,it),St===null?Ue=wt:St.sibling=wt,St=wt);return a&&$e.forEach(function(sU){return o(re,sU)}),mt&&mo(re,it),Ue}function Vt(re,ne,oe,ge){if(typeof oe=="object"&&oe!==null&&oe.type===S&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case b:e:{for(var Ue=oe.key;ne!==null;){if(ne.key===Ue){if(Ue=oe.type,Ue===S){if(ne.tag===7){u(re,ne.sibling),ge=y(ne,oe.props.children),ge.return=re,re=ge;break e}}else if(ne.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===k&&Nl(Ue)===ne.type){u(re,ne.sibling),ge=y(ne,oe.props),Md(ge,oe),ge.return=re,re=ge;break e}u(re,ne);break}else o(re,ne);ne=ne.sibling}oe.type===S?(ge=jl(oe.props.children,re.mode,ge,oe.key),ge.return=re,re=ge):(ge=ym(oe.type,oe.key,oe.props,null,re.mode,ge),Md(ge,oe),ge.return=re,re=ge)}return C(re);case w:e:{for(Ue=oe.key;ne!==null;){if(ne.key===Ue)if(ne.tag===4&&ne.stateNode.containerInfo===oe.containerInfo&&ne.stateNode.implementation===oe.implementation){u(re,ne.sibling),ge=y(ne,oe.children||[]),ge.return=re,re=ge;break e}else{u(re,ne);break}else o(re,ne);ne=ne.sibling}ge=b0(oe,re.mode,ge),ge.return=re,re=ge}return C(re);case k:return oe=Nl(oe),Vt(re,ne,oe,ge)}if(J(oe))return Le(re,ne,oe,ge);if(B(oe)){if(Ue=B(oe),typeof Ue!="function")throw Error(r(150));return oe=Ue.call(oe),He(re,ne,oe,ge)}if(typeof oe.then=="function")return Vt(re,ne,Am(oe),ge);if(oe.$$typeof===M)return Vt(re,ne,xm(re,oe),ge);Om(re,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,ne!==null&&ne.tag===6?(u(re,ne.sibling),ge=y(ne,oe),ge.return=re,re=ge):(u(re,ne),ge=g0(oe,re.mode,ge),ge.return=re,re=ge),C(re)):u(re,ne)}return function(re,ne,oe,ge){try{Ed=0;var Ue=Vt(re,ne,oe,ge);return ic=null,Ue}catch($e){if($e===rc||$e===wm)throw $e;var St=yi(29,$e,null,re.mode);return St.lanes=ge,St.return=re,St}finally{}}}var Ll=yE(!0),gE=yE(!1),xs=!1;function P0(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function D0(a,o){a=a.updateQueue,o.updateQueue===a&&(o.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Ss(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function ws(a,o,u){var h=a.updateQueue;if(h===null)return null;if(h=h.shared,(Tt&2)!==0){var y=h.pending;return y===null?o.next=o:(o.next=y.next,y.next=o),h.pending=o,o=vm(a),tE(a,null,u),o}return mm(a,h,o,u),vm(a)}function jd(a,o,u){if(o=o.updateQueue,o!==null&&(o=o.shared,(u&4194048)!==0)){var h=o.lanes;h&=a.pendingLanes,u|=h,o.lanes=u,io(a,u)}}function R0(a,o){var u=a.updateQueue,h=a.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var y=null,g=null;if(u=u.firstBaseUpdate,u!==null){do{var C={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};g===null?y=g=C:g=g.next=C,u=u.next}while(u!==null);g===null?y=g=o:g=g.next=o}else y=g=o;u={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:g,shared:h.shared,callbacks:h.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=o:a.next=o,u.lastBaseUpdate=o}var N0=!1;function Cd(){if(N0){var a=nc;if(a!==null)throw a}}function Pd(a,o,u,h){N0=!1;var y=a.updateQueue;xs=!1;var g=y.firstBaseUpdate,C=y.lastBaseUpdate,L=y.shared.pending;if(L!==null){y.shared.pending=null;var Y=L,se=Y.next;Y.next=null,C===null?g=se:C.next=se,C=Y;var pe=a.alternate;pe!==null&&(pe=pe.updateQueue,L=pe.lastBaseUpdate,L!==C&&(L===null?pe.firstBaseUpdate=se:L.next=se,pe.lastBaseUpdate=Y))}if(g!==null){var xe=y.baseState;C=0,pe=se=Y=null,L=g;do{var le=L.lane&-536870913,fe=le!==L.lane;if(fe?(ft&le)===le:(h&le)===le){le!==0&&le===tc&&(N0=!0),pe!==null&&(pe=pe.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Le=a,He=L;le=o;var Vt=u;switch(He.tag){case 1:if(Le=He.payload,typeof Le=="function"){xe=Le.call(Vt,xe,le);break e}xe=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=He.payload,le=typeof Le=="function"?Le.call(Vt,xe,le):Le,le==null)break e;xe=p({},xe,le);break e;case 2:xs=!0}}le=L.callback,le!==null&&(a.flags|=64,fe&&(a.flags|=8192),fe=y.callbacks,fe===null?y.callbacks=[le]:fe.push(le))}else fe={lane:le,tag:L.tag,payload:L.payload,callback:L.callback,next:null},pe===null?(se=pe=fe,Y=xe):pe=pe.next=fe,C|=le;if(L=L.next,L===null){if(L=y.shared.pending,L===null)break;fe=L,L=fe.next,fe.next=null,y.lastBaseUpdate=fe,y.shared.pending=null}}while(!0);pe===null&&(Y=xe),y.baseState=Y,y.firstBaseUpdate=se,y.lastBaseUpdate=pe,g===null&&(y.shared.lanes=0),Es|=C,a.lanes=C,a.memoizedState=xe}}function bE(a,o){if(typeof a!="function")throw Error(r(191,a));a.call(o)}function xE(a,o){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;ag?g:8;var C=q.T,L={};q.T=L,J0(a,!1,o,u);try{var Y=y(),se=q.S;if(se!==null&&se(L,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var pe=WI(Y,h);Nd(a,o,pe,wi(a))}else Nd(a,o,h,wi(a))}catch(xe){Nd(a,o,{then:function(){},status:"rejected",reason:xe},wi())}finally{F.p=g,C!==null&&L.types!==null&&(C.types=L.types),q.T=C}}function n8(){}function Q0(a,o,u,h){if(a.tag!==5)throw Error(r(476));var y=ZE(a).queue;QE(a,y,o,ie,u===null?n8:function(){return JE(a),u(h)})}function ZE(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bo,lastRenderedState:ie},next:null};var u={};return o.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bo,lastRenderedState:u},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function JE(a){var o=ZE(a);o.next===null&&(o=a.alternate.memoizedState),Nd(a,o.next.queue,{},wi())}function Z0(){return Sr(Qd)}function eM(){return Pn().memoizedState}function tM(){return Pn().memoizedState}function r8(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var u=wi();a=Ss(u);var h=ws(o,a,u);h!==null&&(ai(h,o,u),jd(h,o,u)),o={cache:E0()},a.payload=o;return}o=o.return}}function i8(a,o,u){var h=wi();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},km(a)?rM(o,u):(u=v0(a,o,u,h),u!==null&&(ai(u,a,h),iM(u,o,h)))}function nM(a,o,u){var h=wi();Nd(a,o,u,h)}function Nd(a,o,u,h){var y={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(km(a))rM(o,y);else{var g=a.alternate;if(a.lanes===0&&(g===null||g.lanes===0)&&(g=o.lastRenderedReducer,g!==null))try{var C=o.lastRenderedState,L=g(C,u);if(y.hasEagerState=!0,y.eagerState=L,Ye(L,C))return mm(a,o,y,0),Gt===null&&pm(),!1}catch{}finally{}if(u=v0(a,o,y,h),u!==null)return ai(u,a,h),iM(u,o,h),!0}return!1}function J0(a,o,u,h){if(h={lane:2,revertLane:Pb(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},km(a)){if(o)throw Error(r(479))}else o=v0(a,u,h,2),o!==null&&ai(o,a,2)}function km(a){var o=a.alternate;return a===rt||o!==null&&o===rt}function rM(a,o){oc=Mm=!0;var u=a.pending;u===null?o.next=o:(o.next=u.next,u.next=o),a.pending=o}function iM(a,o,u){if((u&4194048)!==0){var h=o.lanes;h&=a.pendingLanes,u|=h,o.lanes=u,io(a,u)}}var kd={readContext:Sr,use:Pm,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useLayoutEffect:xn,useInsertionEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useSyncExternalStore:xn,useId:xn,useHostTransitionStatus:xn,useFormState:xn,useActionState:xn,useOptimistic:xn,useMemoCache:xn,useCacheRefresh:xn};kd.useEffectEvent=xn;var aM={readContext:Sr,use:Pm,useCallback:function(a,o){return Fr().memoizedState=[a,o===void 0?null:o],a},useContext:Sr,useEffect:UE,useImperativeHandle:function(a,o,u){u=u!=null?u.concat([a]):null,Rm(4194308,4,GE.bind(null,o,a),u)},useLayoutEffect:function(a,o){return Rm(4194308,4,a,o)},useInsertionEffect:function(a,o){Rm(4,2,a,o)},useMemo:function(a,o){var u=Fr();o=o===void 0?null:o;var h=a();if(zl){zn(!0);try{a()}finally{zn(!1)}}return u.memoizedState=[h,o],h},useReducer:function(a,o,u){var h=Fr();if(u!==void 0){var y=u(o);if(zl){zn(!0);try{u(o)}finally{zn(!1)}}}else y=o;return h.memoizedState=h.baseState=y,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:y},h.queue=a,a=a.dispatch=i8.bind(null,rt,a),[h.memoizedState,a]},useRef:function(a){var o=Fr();return a={current:a},o.memoizedState=a},useState:function(a){a=G0(a);var o=a.queue,u=nM.bind(null,rt,o);return o.dispatch=u,[a.memoizedState,u]},useDebugValue:X0,useDeferredValue:function(a,o){var u=Fr();return W0(u,a,o)},useTransition:function(){var a=G0(!1);return a=QE.bind(null,rt,a.queue,!0,!1),Fr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,u){var h=rt,y=Fr();if(mt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=o(),Gt===null)throw Error(r(349));(ft&127)!==0||TE(h,o,u)}y.memoizedState=u;var g={value:u,getSnapshot:o};return y.queue=g,UE(ME.bind(null,h,g,a),[a]),h.flags|=2048,lc(9,{destroy:void 0},EE.bind(null,h,g,u,o),null),u},useId:function(){var a=Fr(),o=Gt.identifierPrefix;if(mt){var u=za,h=La;u=(h&~(1<<32-mr(h)-1)).toString(32)+u,o="_"+o+"R_"+u,u=jm++,0<\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof h.is=="string"?C.createElement("select",{is:h.is}):C.createElement("select"),h.multiple?g.multiple=!0:h.size&&(g.size=h.size);break;default:g=typeof h.is=="string"?C.createElement(y,{is:h.is}):C.createElement(y)}}g[Gn]=o,g[Mr]=h;e:for(C=o.child;C!==null;){if(C.tag===5||C.tag===6)g.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===o)break e;for(;C.sibling===null;){if(C.return===null||C.return===o)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}o.stateNode=g;e:switch(_r(g,y,h),y){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&So(o)}}return an(o),hb(o,o.type,a===null?null:a.memoizedProps,o.pendingProps,u),null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==h&&So(o);else{if(typeof h!="string"&&o.stateNode===null)throw Error(r(166));if(a=Se.current,Ju(o)){if(a=o.stateNode,u=o.memoizedProps,h=null,y=xr,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}a[Gn]=o,a=!!(a.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||Aj(a.nodeValue,u)),a||gs(o,!0)}else a=tv(a).createTextNode(h),a[Gn]=o,o.stateNode=a}return an(o),null;case 31:if(u=o.memoizedState,a===null||a.memoizedState!==null){if(h=Ju(o),u!==null){if(a===null){if(!h)throw Error(r(318));if(a=o.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[Gn]=o}else Cl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;an(o),a=!1}else u=_0(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return o.flags&256?(bi(o),o):(bi(o),null);if((o.flags&128)!==0)throw Error(r(558))}return an(o),null;case 13:if(h=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(y=Ju(o),h!==null&&h.dehydrated!==null){if(a===null){if(!y)throw Error(r(318));if(y=o.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[Gn]=o}else Cl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;an(o),y=!1}else y=_0(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=y),y=!0;if(!y)return o.flags&256?(bi(o),o):(bi(o),null)}return bi(o),(o.flags&128)!==0?(o.lanes=u,o):(u=h!==null,a=a!==null&&a.memoizedState!==null,u&&(h=o.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool),g=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(g=h.memoizedState.cachePool.pool),g!==y&&(h.flags|=2048)),u!==a&&u&&(o.child.flags|=8192),qm(o,o.updateQueue),an(o),null);case 4:return de(),a===null&&kb(o.stateNode.containerInfo),an(o),null;case 10:return yo(o.type),an(o),null;case 19:if(V(Cn),h=o.memoizedState,h===null)return an(o),null;if(y=(o.flags&128)!==0,g=h.rendering,g===null)if(y)zd(h,!1);else{if(Sn!==0||a!==null&&(a.flags&128)!==0)for(a=o.child;a!==null;){if(g=Em(a),g!==null){for(o.flags|=128,zd(h,!1),a=g.updateQueue,o.updateQueue=a,qm(o,a),o.subtreeFlags=0,a=u,u=o.child;u!==null;)nE(u,a),u=u.sibling;return X(Cn,Cn.current&1|2),mt&&mo(o,h.treeForkCount),o.child}a=a.sibling}h.tail!==null&&ze()>Fm&&(o.flags|=128,y=!0,zd(h,!1),o.lanes=4194304)}else{if(!y)if(a=Em(g),a!==null){if(o.flags|=128,y=!0,a=a.updateQueue,o.updateQueue=a,qm(o,a),zd(h,!0),h.tail===null&&h.tailMode==="hidden"&&!g.alternate&&!mt)return an(o),null}else 2*ze()-h.renderingStartTime>Fm&&u!==536870912&&(o.flags|=128,y=!0,zd(h,!1),o.lanes=4194304);h.isBackwards?(g.sibling=o.child,o.child=g):(a=h.last,a!==null?a.sibling=g:o.child=g,h.last=g)}return h.tail!==null?(a=h.tail,h.rendering=a,h.tail=a.sibling,h.renderingStartTime=ze(),a.sibling=null,u=Cn.current,X(Cn,y?u&1|2:u&1),mt&&mo(o,h.treeForkCount),a):(an(o),null);case 22:case 23:return bi(o),L0(),h=o.memoizedState!==null,a!==null?a.memoizedState!==null!==h&&(o.flags|=8192):h&&(o.flags|=8192),h?(u&536870912)!==0&&(o.flags&128)===0&&(an(o),o.subtreeFlags&6&&(o.flags|=8192)):an(o),u=o.updateQueue,u!==null&&qm(o,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==u&&(o.flags|=2048),a!==null&&V(Rl),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),yo(Bn),an(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function u8(a,o){switch(S0(o),o.tag){case 1:return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return yo(Bn),de(),a=o.flags,(a&65536)!==0&&(a&128)===0?(o.flags=a&-65537|128,o):null;case 26:case 27:case 5:return Ee(o),null;case 31:if(o.memoizedState!==null){if(bi(o),o.alternate===null)throw Error(r(340));Cl()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 13:if(bi(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Cl()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return V(Cn),null;case 4:return de(),null;case 10:return yo(o.type),null;case 22:case 23:return bi(o),L0(),a!==null&&V(Rl),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return yo(Bn),null;case 25:return null;default:return null}}function jM(a,o){switch(S0(o),o.tag){case 3:yo(Bn),de();break;case 26:case 27:case 5:Ee(o);break;case 4:de();break;case 31:o.memoizedState!==null&&bi(o);break;case 13:bi(o);break;case 19:V(Cn);break;case 10:yo(o.type);break;case 22:case 23:bi(o),L0(),a!==null&&V(Rl);break;case 24:yo(Bn)}}function $d(a,o){try{var u=o.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var y=h.next;u=y;do{if((u.tag&a)===a){h=void 0;var g=u.create,C=u.inst;h=g(),C.destroy=h}u=u.next}while(u!==y)}}catch(L){$t(o,o.return,L)}}function Os(a,o,u){try{var h=o.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var g=y.next;h=g;do{if((h.tag&a)===a){var C=h.inst,L=C.destroy;if(L!==void 0){C.destroy=void 0,y=o;var Y=u,se=L;try{se()}catch(pe){$t(y,Y,pe)}}}h=h.next}while(h!==g)}}catch(pe){$t(o,o.return,pe)}}function CM(a){var o=a.updateQueue;if(o!==null){var u=a.stateNode;try{xE(o,u)}catch(h){$t(a,a.return,h)}}}function PM(a,o,u){u.props=$l(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(h){$t(a,o,h)}}function Bd(a,o){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var h=a.stateNode;break;case 30:h=a.stateNode;break;default:h=a.stateNode}typeof u=="function"?a.refCleanup=u(h):u.current=h}}catch(y){$t(a,o,y)}}function $a(a,o){var u=a.ref,h=a.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(y){$t(a,o,y)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){$t(a,o,y)}else u.current=null}function DM(a){var o=a.type,u=a.memoizedProps,h=a.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(y){$t(a,a.return,y)}}function pb(a,o,u){try{var h=a.stateNode;P8(h,a.type,u,o),h[Mr]=o}catch(y){$t(a,a.return,y)}}function RM(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Ds(a.type)||a.tag===4}function mb(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||RM(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Ds(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function vb(a,o,u){var h=a.tag;if(h===5||h===6)a=a.stateNode,o?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(a,o):(o=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,o.appendChild(a),u=u._reactRootContainer,u!=null||o.onclick!==null||(o.onclick=Ur));else if(h!==4&&(h===27&&Ds(a.type)&&(u=a.stateNode,o=null),a=a.child,a!==null))for(vb(a,o,u),a=a.sibling;a!==null;)vb(a,o,u),a=a.sibling}function Im(a,o,u){var h=a.tag;if(h===5||h===6)a=a.stateNode,o?u.insertBefore(a,o):u.appendChild(a);else if(h!==4&&(h===27&&Ds(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(Im(a,o,u),a=a.sibling;a!==null;)Im(a,o,u),a=a.sibling}function NM(a){var o=a.stateNode,u=a.memoizedProps;try{for(var h=a.type,y=o.attributes;y.length;)o.removeAttributeNode(y[0]);_r(o,h,u),o[Gn]=a,o[Mr]=u}catch(g){$t(a,a.return,g)}}var wo=!1,Un=!1,yb=!1,kM=typeof WeakSet=="function"?WeakSet:Set,lr=null;function c8(a,o){if(a=a.containerInfo,$b=lv,a=nn(a),bn(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var y=h.anchorOffset,g=h.focusNode;h=h.focusOffset;try{u.nodeType,g.nodeType}catch{u=null;break e}var C=0,L=-1,Y=-1,se=0,pe=0,xe=a,le=null;t:for(;;){for(var fe;xe!==u||y!==0&&xe.nodeType!==3||(L=C+y),xe!==g||h!==0&&xe.nodeType!==3||(Y=C+h),xe.nodeType===3&&(C+=xe.nodeValue.length),(fe=xe.firstChild)!==null;)le=xe,xe=fe;for(;;){if(xe===a)break t;if(le===u&&++se===y&&(L=C),le===g&&++pe===h&&(Y=C),(fe=xe.nextSibling)!==null)break;xe=le,le=xe.parentNode}xe=fe}u=L===-1||Y===-1?null:{start:L,end:Y}}else u=null}u=u||{start:0,end:0}}else u=null;for(Bb={focusedElem:a,selectionRange:u},lv=!1,lr=o;lr!==null;)if(o=lr,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,lr=a;else for(;lr!==null;){switch(o=lr,g=o.alternate,a=o.flags,o.tag){case 0:if((a&4)!==0&&(a=o.updateQueue,a=a!==null?a.events:null,a!==null))for(u=0;u title"))),_r(g,h,u),g[Gn]=a,En(g),h=g;break e;case"link":var C=Ij("link","href",y).get(h+(u.href||""));if(C){for(var L=0;LVt&&(C=Vt,Vt=He,He=C);var re=Be(L,He),ne=Be(L,Vt);if(re&&ne&&(fe.rangeCount!==1||fe.anchorNode!==re.node||fe.anchorOffset!==re.offset||fe.focusNode!==ne.node||fe.focusOffset!==ne.offset)){var oe=xe.createRange();oe.setStart(re.node,re.offset),fe.removeAllRanges(),He>Vt?(fe.addRange(oe),fe.extend(ne.node,ne.offset)):(oe.setEnd(ne.node,ne.offset),fe.addRange(oe))}}}}for(xe=[],fe=L;fe=fe.parentNode;)fe.nodeType===1&&xe.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;Lu?32:u,q.T=null,u=Ab,Ab=null;var g=js,C=Eo;if(Kn=0,hc=js=null,Eo=0,(Tt&6)!==0)throw Error(r(331));var L=Tt;if(Tt|=4,GM(g.current),VM(g,g.current,C,u),Tt=L,Fd(0,!1),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot(Ln,g)}catch{}return!0}finally{F.p=y,q.T=h,cj(a,o)}}function dj(a,o,u){o=qi(u,o),o=rb(a.stateNode,o,2),a=ws(a,o,2),a!==null&&(pi(a,2),Ba(a))}function $t(a,o,u){if(a.tag===3)dj(a,a,u);else for(;o!==null;){if(o.tag===3){dj(o,a,u);break}else if(o.tag===1){var h=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ms===null||!Ms.has(h))){a=qi(u,a),u=hM(2),h=ws(o,u,2),h!==null&&(pM(u,h,o,a),pi(h,2),Ba(h));break}}o=o.return}}function Mb(a,o,u){var h=a.pingCache;if(h===null){h=a.pingCache=new h8;var y=new Set;h.set(o,y)}else y=h.get(o),y===void 0&&(y=new Set,h.set(o,y));y.has(u)||(xb=!0,y.add(u),a=g8.bind(null,a,o,u),o.then(a,a))}function g8(a,o,u){var h=a.pingCache;h!==null&&h.delete(o),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,Gt===a&&(ft&u)===u&&(Sn===4||Sn===3&&(ft&62914560)===ft&&300>ze()-Hm?(Tt&2)===0&&pc(a,0):Sb|=u,dc===ft&&(dc=0)),Ba(a)}function hj(a,o){o===0&&(o=Xp()),a=Ml(a,o),a!==null&&(pi(a,o),Ba(a))}function b8(a){var o=a.memoizedState,u=0;o!==null&&(u=o.retryLane),hj(a,u)}function x8(a,o){var u=0;switch(a.tag){case 31:case 13:var h=a.stateNode,y=a.memoizedState;y!==null&&(u=y.retryLane);break;case 19:h=a.stateNode;break;case 22:h=a.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(o),hj(a,u)}function S8(a,o){return pt(a,o)}var Qm=null,vc=null,jb=!1,Zm=!1,Cb=!1,Ps=0;function Ba(a){a!==vc&&a.next===null&&(vc===null?Qm=vc=a:vc=vc.next=a),Zm=!0,jb||(jb=!0,_8())}function Fd(a,o){if(!Cb&&Zm){Cb=!0;do for(var u=!1,h=Qm;h!==null;){if(a!==0){var y=h.pendingLanes;if(y===0)var g=0;else{var C=h.suspendedLanes,L=h.pingedLanes;g=(1<<31-mr(42|a)+1)-1,g&=y&~(C&~L),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(u=!0,yj(h,g))}else g=ft,g=Lu(h,h===Gt?g:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(g&3)===0||vl(h,g)||(u=!0,yj(h,g));h=h.next}while(u);Cb=!1}}function w8(){pj()}function pj(){Zm=jb=!1;var a=0;Ps!==0&&R8()&&(a=Ps);for(var o=ze(),u=null,h=Qm;h!==null;){var y=h.next,g=mj(h,o);g===0?(h.next=null,u===null?Qm=y:u.next=y,y===null&&(vc=u)):(u=h,(a!==0||(g&3)!==0)&&(Zm=!0)),h=y}Kn!==0&&Kn!==5||Fd(a),Ps!==0&&(Ps=0)}function mj(a,o){for(var u=a.suspendedLanes,h=a.pingedLanes,y=a.expirationTimes,g=a.pendingLanes&-62914561;0L)break;var pe=Y.transferSize,xe=Y.initiatorType;pe&&Oj(xe)&&(Y=Y.responseEnd,C+=pe*(Y"u"?null:document;function zj(a,o,u){var h=yc;if(h&&typeof o=="string"&&o){var y=Ir(o);y='link[rel="'+a+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),Lj.has(y)||(Lj.add(y),a={rel:a,crossOrigin:u,href:o},h.querySelector(y)===null&&(o=h.createElement("link"),_r(o,"link",a),En(o),h.head.appendChild(o)))}}function U8(a){Mo.D(a),zj("dns-prefetch",a,null)}function V8(a,o){Mo.C(a,o),zj("preconnect",a,o)}function H8(a,o,u){Mo.L(a,o,u);var h=yc;if(h&&a&&o){var y='link[rel="preload"][as="'+Ir(o)+'"]';o==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Ir(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Ir(u.imageSizes)+'"]')):y+='[href="'+Ir(a)+'"]';var g=y;switch(o){case"style":g=gc(a);break;case"script":g=bc(a)}Gi.has(g)||(a=p({rel:"preload",href:o==="image"&&u&&u.imageSrcSet?void 0:a,as:o},u),Gi.set(g,a),h.querySelector(y)!==null||o==="style"&&h.querySelector(Xd(g))||o==="script"&&h.querySelector(Wd(g))||(o=h.createElement("link"),_r(o,"link",a),En(o),h.head.appendChild(o)))}}function F8(a,o){Mo.m(a,o);var u=yc;if(u&&a){var h=o&&typeof o.as=="string"?o.as:"script",y='link[rel="modulepreload"][as="'+Ir(h)+'"][href="'+Ir(a)+'"]',g=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=bc(a)}if(!Gi.has(g)&&(a=p({rel:"modulepreload",href:a},o),Gi.set(g,a),u.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Wd(g)))return}h=u.createElement("link"),_r(h,"link",a),En(h),u.head.appendChild(h)}}}function G8(a,o,u){Mo.S(a,o,u);var h=yc;if(h&&a){var y=Li(h).hoistableStyles,g=gc(a);o=o||"default";var C=y.get(g);if(!C){var L={loading:0,preload:null};if(C=h.querySelector(Xd(g)))L.loading=5;else{a=p({rel:"stylesheet",href:a,"data-precedence":o},u),(u=Gi.get(g))&&Gb(a,u);var Y=C=h.createElement("link");En(Y),_r(Y,"link",a),Y._p=new Promise(function(se,pe){Y.onload=se,Y.onerror=pe}),Y.addEventListener("load",function(){L.loading|=1}),Y.addEventListener("error",function(){L.loading|=2}),L.loading|=4,rv(C,o,h)}C={type:"stylesheet",instance:C,count:1,state:L},y.set(g,C)}}}function K8(a,o){Mo.X(a,o);var u=yc;if(u&&a){var h=Li(u).hoistableScripts,y=bc(a),g=h.get(y);g||(g=u.querySelector(Wd(y)),g||(a=p({src:a,async:!0},o),(o=Gi.get(y))&&Kb(a,o),g=u.createElement("script"),En(g),_r(g,"link",a),u.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},h.set(y,g))}}function Y8(a,o){Mo.M(a,o);var u=yc;if(u&&a){var h=Li(u).hoistableScripts,y=bc(a),g=h.get(y);g||(g=u.querySelector(Wd(y)),g||(a=p({src:a,async:!0,type:"module"},o),(o=Gi.get(y))&&Kb(a,o),g=u.createElement("script"),En(g),_r(g,"link",a),u.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},h.set(y,g))}}function $j(a,o,u,h){var y=(y=Se.current)?nv(y):null;if(!y)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(o=gc(u.href),u=Li(y).hoistableStyles,h=u.get(o),h||(h={type:"style",instance:null,count:0,state:null},u.set(o,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=gc(u.href);var g=Li(y).hoistableStyles,C=g.get(a);if(C||(y=y.ownerDocument||y,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(a,C),(g=y.querySelector(Xd(a)))&&!g._p&&(C.instance=g,C.state.loading=5),Gi.has(a)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Gi.set(a,u),g||X8(y,a,u,C.state))),o&&h===null)throw Error(r(528,""));return C}if(o&&h!==null)throw Error(r(529,""));return null;case"script":return o=u.async,u=u.src,typeof u=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=bc(u),u=Li(y).hoistableScripts,h=u.get(o),h||(h={type:"script",instance:null,count:0,state:null},u.set(o,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function gc(a){return'href="'+Ir(a)+'"'}function Xd(a){return'link[rel="stylesheet"]['+a+"]"}function Bj(a){return p({},a,{"data-precedence":a.precedence,precedence:null})}function X8(a,o,u,h){a.querySelector('link[rel="preload"][as="style"]['+o+"]")?h.loading=1:(o=a.createElement("link"),h.preload=o,o.addEventListener("load",function(){return h.loading|=1}),o.addEventListener("error",function(){return h.loading|=2}),_r(o,"link",u),En(o),a.head.appendChild(o))}function bc(a){return'[src="'+Ir(a)+'"]'}function Wd(a){return"script[async]"+a}function qj(a,o,u){if(o.count++,o.instance===null)switch(o.type){case"style":var h=a.querySelector('style[data-href~="'+Ir(u.href)+'"]');if(h)return o.instance=h,En(h),h;var y=p({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(a.ownerDocument||a).createElement("style"),En(h),_r(h,"style",y),rv(h,u.precedence,a),o.instance=h;case"stylesheet":y=gc(u.href);var g=a.querySelector(Xd(y));if(g)return o.state.loading|=4,o.instance=g,En(g),g;h=Bj(u),(y=Gi.get(y))&&Gb(h,y),g=(a.ownerDocument||a).createElement("link"),En(g);var C=g;return C._p=new Promise(function(L,Y){C.onload=L,C.onerror=Y}),_r(g,"link",h),o.state.loading|=4,rv(g,u.precedence,a),o.instance=g;case"script":return g=bc(u.src),(y=a.querySelector(Wd(g)))?(o.instance=y,En(y),y):(h=u,(y=Gi.get(g))&&(h=p({},u),Kb(h,y)),a=a.ownerDocument||a,y=a.createElement("script"),En(y),_r(y,"link",h),a.head.appendChild(y),o.instance=y);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(h=o.instance,o.state.loading|=4,rv(h,u.precedence,a));return o.instance}function rv(a,o,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,g=y,C=0;C title"):null)}function W8(a,o,u){if(u===1||o.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return a=o.disabled,typeof o.precedence=="string"&&a==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function Vj(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function Q8(a,o,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=gc(h.href),g=o.querySelector(Xd(y));if(g){o=g._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(a.count++,a=av.bind(a),o.then(a,a)),u.state.loading|=4,u.instance=g,En(g);return}g=o.ownerDocument||o,h=Bj(h),(y=Gi.get(y))&&Gb(h,y),g=g.createElement("link"),En(g);var C=g;C._p=new Promise(function(L,Y){C.onload=L,C.onerror=Y}),_r(g,"link",h),u.instance=g}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(u,o),(o=u.state.preload)&&(u.state.loading&3)===0&&(a.count++,u=av.bind(a),o.addEventListener("load",u),o.addEventListener("error",u))}}var Yb=0;function Z8(a,o){return a.stylesheets&&a.count===0&&sv(a,a.stylesheets),0Yb?50:800)+o);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(h),clearTimeout(y)}}:null}function av(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)sv(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var ov=null;function sv(a,o){a.stylesheets=null,a.unsuspend!==null&&(a.count++,ov=new Map,o.forEach(J8,a),ov=null,av.call(a))}function J8(a,o){if(!(o.state.loading&4)){var u=ov.get(a);if(u)var h=u.get(null);else{u=new Map,ov.set(a,u);for(var y=a.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ix.exports=yU(),ix.exports}var bU=gU();const xU=Ft(bU);var Bf=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(){}},iu,Gs,Vc,Ez,SU=(Ez=class extends Bf{constructor(){super();qe(this,iu);qe(this,Gs);qe(this,Vc);Pe(this,Vc,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,Gs)||this.setEventListener(W(this,Vc))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Gs))==null||t.call(this),Pe(this,Gs,void 0))}setEventListener(t){var n;Pe(this,Vc,t),(n=W(this,Gs))==null||n.call(this),Pe(this,Gs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){W(this,iu)!==t&&(Pe(this,iu,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof W(this,iu)=="boolean"?W(this,iu):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},iu=new WeakMap,Gs=new WeakMap,Vc=new WeakMap,Ez),KO=new SU,wU={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ks,FO,Mz,_U=(Mz=class{constructor(){qe(this,Ks,wU);qe(this,FO,!1)}setTimeoutProvider(e){Pe(this,Ks,e)}setTimeout(e,t){return W(this,Ks).setTimeout(e,t)}clearTimeout(e){W(this,Ks).clearTimeout(e)}setInterval(e,t){return W(this,Ks).setInterval(e,t)}clearInterval(e){W(this,Ks).clearInterval(e)}},Ks=new WeakMap,FO=new WeakMap,Mz),Ql=new _U;function AU(e){setTimeout(e,0)}var OU=typeof window>"u"||"Deno"in globalThis;function Kr(){}function TU(e,t){return typeof e=="function"?e(t):e}function N_(e){return typeof e=="number"&&e>=0&&e!==1/0}function $z(e,t){return Math.max(e+(t||0)-Date.now(),0)}function il(e,t){return typeof e=="function"?e(t):e}function Mi(e,t){return typeof e=="function"?e(t):e}function mC(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==YO(l,t.options))return!1}else if(!Ih(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||i&&i!==t.state.fetchStatus||s&&!s(t))}function vC(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(gu(t.options.mutationKey)!==gu(s))return!1}else if(!Ih(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function YO(e,t){return((t==null?void 0:t.queryKeyHashFn)||gu)(e)}function gu(e){return JSON.stringify(e,(t,n)=>k_(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ih(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ih(e[n],t[n])):!1}var EU=Object.prototype.hasOwnProperty;function Bz(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=yC(e)&&yC(t);if(!r&&!(k_(e)&&k_(t)))return t;const s=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),c=l.length,f=r?new Array(c):{};let d=0;for(let m=0;m{Ql.setTimeout(t,e)})}function L_(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Bz(e,t):t}function jU(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function CU(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var XO=Symbol();function qz(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===XO?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function WO(e,t){return typeof e=="function"?e(...t):!!e}function PU(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 Uh=(()=>{let e=()=>OU;return{isServer(){return e()},setIsServer(t){e=t}}})();function z_(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});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 DU=AU;function RU(){let e=[],t=0,n=c=>{c()},r=c=>{c()},i=DU;const s=c=>{t?e.push(c):i(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&i(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:c=>{let f;t++;try{f=c()}finally{t--,t||l()}return f},batchCalls:c=>(...f)=>{s(()=>{c(...f)})},schedule:s,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var Zn=RU(),Hc,Ys,Fc,jz,NU=(jz=class extends Bf{constructor(){super();qe(this,Hc,!0);qe(this,Ys);qe(this,Fc);Pe(this,Fc,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(){W(this,Ys)||this.setEventListener(W(this,Fc))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Ys))==null||t.call(this),Pe(this,Ys,void 0))}setEventListener(t){var n;Pe(this,Fc,t),(n=W(this,Ys))==null||n.call(this),Pe(this,Ys,t(this.setOnline.bind(this)))}setOnline(t){W(this,Hc)!==t&&(Pe(this,Hc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return W(this,Hc)}},Hc=new WeakMap,Ys=new WeakMap,Fc=new WeakMap,jz),Wv=new NU;function kU(e){return Math.min(1e3*2**e,3e4)}function Iz(e){return(e??"online")==="online"?Wv.isOnline():!0}var $_=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Uz(e){let t=!1,n=0,r;const i=z_(),s=()=>i.status!=="pending",l=S=>{var x;if(!s()){const A=new $_(S);v(A),(x=e.onCancel)==null||x.call(e,A)}},c=()=>{t=!0},f=()=>{t=!1},d=()=>KO.isFocused()&&(e.networkMode==="always"||Wv.isOnline())&&e.canRun(),m=()=>Iz(e.networkMode)&&e.canRun(),p=S=>{s()||(r==null||r(),i.resolve(S))},v=S=>{s()||(r==null||r(),i.reject(S))},b=()=>new Promise(S=>{var x;r=A=>{(s()||d())&&S(A)},(x=e.onPause)==null||x.call(e)}).then(()=>{var S;r=void 0,s()||(S=e.onContinue)==null||S.call(e)}),w=()=>{if(s())return;let S;const x=n===0?e.initialPromise:void 0;try{S=x??e.fn()}catch(A){S=Promise.reject(A)}Promise.resolve(S).then(p).catch(A=>{var j;if(s())return;const _=e.retry??(Uh.isServer()?0:3),M=e.retryDelay??kU,E=typeof M=="function"?M(n,A):M,O=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,A);if(t||!O){v(A);return}n++,(j=e.onFail)==null||j.call(e,n,A),MU(E).then(()=>d()?void 0:b()).then(()=>{t?v(A):w()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r==null||r(),i),cancelRetry:c,continueRetry:f,canStart:m,start:()=>(m()?w():b().then(w),i)}}var au,Cz,Vz=(Cz=class{constructor(){qe(this,au)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),N_(this.gcTime)&&Pe(this,au,Ql.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Uh.isServer()?1/0:300*1e3))}clearGcTimeout(){W(this,au)!==void 0&&(Ql.clearTimeout(W(this,au)),Pe(this,au,void 0))}},au=new WeakMap,Cz);function LU(e){return{onFetch:(t,n)=>{var m,p,v,b,w;const r=t.options,i=(v=(p=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:p.fetchMore)==null?void 0:v.direction,s=((b=t.state.data)==null?void 0:b.pages)||[],l=((w=t.state.data)==null?void 0:w.pageParams)||[];let c={pages:[],pageParams:[]},f=0;const d=async()=>{let S=!1;const x=M=>{PU(M,()=>t.signal,()=>S=!0)},A=qz(t.options,t.fetchOptions),_=async(M,E,O)=>{if(S)return Promise.reject(t.signal.reason);if(E==null&&M.pages.length)return Promise.resolve(M);const R=(()=>{const $={client:t.client,queryKey:t.queryKey,pageParam:E,direction:O?"backward":"forward",meta:t.options.meta};return x($),$})(),k=await A(R),{maxPages:z}=t.options,G=O?CU:jU;return{pages:G(M.pages,k,z),pageParams:G(M.pageParams,E,z)}};if(i&&s.length){const M=i==="backward",E=M?zU:bC,O={pages:s,pageParams:l},j=E(r,O);c=await _(O,j,M)}else{const M=e??s.length;do{const E=f===0?l[0]??r.initialPageParam:bC(r,c);if(f>0&&E==null)break;c=await _(c,E),f++}while(f{var S,x;return(x=(S=t.options).persister)==null?void 0:x.call(S,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function bC(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 zU(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 Gc,ou,Kc,ta,su,ur,Cp,lu,Ei,Hz,Po,Pz,$U=(Pz=class extends Vz{constructor(t){super();qe(this,Ei);qe(this,Gc);qe(this,ou);qe(this,Kc);qe(this,ta);qe(this,su);qe(this,ur);qe(this,Cp);qe(this,lu);Pe(this,lu,!1),Pe(this,Cp,t.defaultOptions),this.setOptions(t.options),this.observers=[],Pe(this,su,t.client),Pe(this,ta,W(this,su).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Pe(this,ou,SC(this.options)),this.state=t.state??W(this,ou),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return W(this,Gc)}get promise(){var t;return(t=W(this,ur))==null?void 0:t.promise}setOptions(t){if(this.options={...W(this,Cp),...t},t!=null&&t._type&&Pe(this,Gc,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=SC(this.options);n.data!==void 0&&(this.setState(xC(n.data,n.dataUpdatedAt)),Pe(this,ou,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,ta).remove(this)}setData(t,n){const r=L_(this.state.data,t,this.options);return at(this,Ei,Po).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){at(this,Ei,Po).call(this,{type:"setState",state:t})}cancel(t){var r,i;const n=(r=W(this,ur))==null?void 0:r.promise;return(i=W(this,ur))==null||i.cancel(t),n?n.then(Kr).catch(Kr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return W(this,ou)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Mi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===XO||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>il(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:!$z(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,ur))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,ur))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),W(this,ta).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(W(this,ur)&&(W(this,lu)||at(this,Ei,Hz).call(this)?W(this,ur).cancel({revert:!0}):W(this,ur).cancelRetry()),this.scheduleGc()),W(this,ta).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||at(this,Ei,Po).call(this,{type:"invalidate"})}async fetch(t,n){var d,m,p,v,b,w,S,x,A,_,M;if(this.state.fetchStatus!=="idle"&&((d=W(this,ur))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,ur))return W(this,ur).continueRetry(),W(this,ur).promise}if(t&&this.setOptions(t),!this.options.queryFn){const E=this.observers.find(O=>O.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,i=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(Pe(this,lu,!0),r.signal)})},s=()=>{const E=qz(this.options,n),j=(()=>{const R={client:W(this,su),queryKey:this.queryKey,meta:this.meta};return i(R),R})();return Pe(this,lu,!1),this.options.persister?this.options.persister(E,j,this):E(j)},c=(()=>{const E={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,su),state:this.state,fetchFn:s};return i(E),E})(),f=W(this,Gc)==="infinite"?LU(this.options.pages):this.options.behavior;f==null||f.onFetch(c,this),Pe(this,Kc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=c.fetchOptions)==null?void 0:m.meta))&&at(this,Ei,Po).call(this,{type:"fetch",meta:(p=c.fetchOptions)==null?void 0:p.meta}),Pe(this,ur,Uz({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:E=>{E instanceof $_&&E.revert&&this.setState({...W(this,Kc),fetchStatus:"idle"}),r.abort()},onFail:(E,O)=>{at(this,Ei,Po).call(this,{type:"failed",failureCount:E,error:O})},onPause:()=>{at(this,Ei,Po).call(this,{type:"pause"})},onContinue:()=>{at(this,Ei,Po).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const E=await W(this,ur).start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(b=(v=W(this,ta).config).onSuccess)==null||b.call(v,E,this),(S=(w=W(this,ta).config).onSettled)==null||S.call(w,E,this.state.error,this),E}catch(E){if(E instanceof $_){if(E.silent)return W(this,ur).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw at(this,Ei,Po).call(this,{type:"error",error:E}),(A=(x=W(this,ta).config).onError)==null||A.call(x,E,this),(M=(_=W(this,ta).config).onSettled)==null||M.call(_,this.state.data,E,this),E}finally{this.scheduleGc()}}},Gc=new WeakMap,ou=new WeakMap,Kc=new WeakMap,ta=new WeakMap,su=new WeakMap,ur=new WeakMap,Cp=new WeakMap,lu=new WeakMap,Ei=new WeakSet,Hz=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Po=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,...Fz(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...xC(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Pe(this,Kc,t.manual?i:void 0),i;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Zn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,ta).notify({query:this,type:"updated",action:t})})},Pz);function Fz(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Iz(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function xC(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function SC(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 oi,vt,Pp,Gr,uu,Yc,Do,Xs,Dp,Xc,Wc,cu,fu,Ws,Qc,Nt,yh,B_,q_,I_,U_,V_,H_,F_,Gz,Dz,BU=(Dz=class extends Bf{constructor(t,n){super();qe(this,Nt);qe(this,oi);qe(this,vt);qe(this,Pp);qe(this,Gr);qe(this,uu);qe(this,Yc);qe(this,Do);qe(this,Xs);qe(this,Dp);qe(this,Xc);qe(this,Wc);qe(this,cu);qe(this,fu);qe(this,Ws);qe(this,Qc,new Set);this.options=n,Pe(this,oi,t),Pe(this,Xs,null),Pe(this,Do,z_()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,vt).addObserver(this),wC(W(this,vt),this.options)?at(this,Nt,yh).call(this):this.updateResult(),at(this,Nt,U_).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return G_(W(this,vt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return G_(W(this,vt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,at(this,Nt,V_).call(this),at(this,Nt,H_).call(this),W(this,vt).removeObserver(this)}setOptions(t){const n=this.options,r=W(this,vt);if(this.options=W(this,oi).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Mi(this.options.enabled,W(this,vt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");at(this,Nt,F_).call(this),W(this,vt).setOptions(this.options),n._defaulted&&!Xv(this.options,n)&&W(this,oi).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,vt),observer:this});const i=this.hasListeners();i&&_C(W(this,vt),r,this.options,n)&&at(this,Nt,yh).call(this),this.updateResult(),i&&(W(this,vt)!==r||Mi(this.options.enabled,W(this,vt))!==Mi(n.enabled,W(this,vt))||il(this.options.staleTime,W(this,vt))!==il(n.staleTime,W(this,vt)))&&at(this,Nt,B_).call(this);const s=at(this,Nt,q_).call(this);i&&(W(this,vt)!==r||Mi(this.options.enabled,W(this,vt))!==Mi(n.enabled,W(this,vt))||s!==W(this,Ws))&&at(this,Nt,I_).call(this,s)}getOptimisticResult(t){const n=W(this,oi).getQueryCache().build(W(this,oi),t),r=this.createResult(n,t);return IU(this,r)&&(Pe(this,Gr,r),Pe(this,Yc,this.options),Pe(this,uu,W(this,vt).state)),r}getCurrentResult(){return W(this,Gr)}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&&W(this,Do).status==="pending"&&W(this,Do).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){W(this,Qc).add(t)}getCurrentQuery(){return W(this,vt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=W(this,oi).defaultQueryOptions(t),r=W(this,oi).getQueryCache().build(W(this,oi),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return at(this,Nt,yh).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,Gr)))}createResult(t,n){var z;const r=W(this,vt),i=this.options,s=W(this,Gr),l=W(this,uu),c=W(this,Yc),d=t!==r?t.state:W(this,Pp),{state:m}=t;let p={...m},v=!1,b;if(n._optimisticResults){const G=this.hasListeners(),$=!G&&wC(t,n),B=G&&_C(t,r,n,i);($||B)&&(p={...p,...Fz(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:w,errorUpdatedAt:S,status:x}=p;b=p.data;let A=!1;if(n.placeholderData!==void 0&&b===void 0&&x==="pending"){let G;s!=null&&s.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(G=s.data,A=!0):G=typeof n.placeholderData=="function"?n.placeholderData((z=W(this,Wc))==null?void 0:z.state.data,W(this,Wc)):n.placeholderData,G!==void 0&&(x="success",b=L_(s==null?void 0:s.data,G,n),v=!0)}if(n.select&&b!==void 0&&!A)if(s&&b===(l==null?void 0:l.data)&&n.select===W(this,Dp))b=W(this,Xc);else try{Pe(this,Dp,n.select),b=n.select(b),b=L_(s==null?void 0:s.data,b,n),Pe(this,Xc,b),Pe(this,Xs,null)}catch(G){Pe(this,Xs,G)}W(this,Xs)&&(w=W(this,Xs),b=W(this,Xc),S=Date.now(),x="error");const _=p.fetchStatus==="fetching",M=x==="pending",E=x==="error",O=M&&_,j=b!==void 0,k={status:x,fetchStatus:p.fetchStatus,isPending:M,isSuccess:x==="success",isError:E,isInitialLoading:O,isLoading:O,data:b,dataUpdatedAt:p.dataUpdatedAt,error:w,errorUpdatedAt:S,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:_,isRefetching:_&&!M,isLoadingError:E&&!j,isPaused:p.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:E&&j,isStale:QO(t,n),refetch:this.refetch,promise:W(this,Do),isEnabled:Mi(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const G=k.data!==void 0,$=k.status==="error"&&!G,B=J=>{$?J.reject(k.error):G&&J.resolve(k.data)},Z=()=>{const J=Pe(this,Do,k.promise=z_());B(J)},ee=W(this,Do);switch(ee.status){case"pending":t.queryHash===r.queryHash&&B(ee);break;case"fulfilled":($||k.data!==ee.value)&&Z();break;case"rejected":(!$||k.error!==ee.reason)&&Z();break}}return k}updateResult(){const t=W(this,Gr),n=this.createResult(W(this,vt),this.options);if(Pe(this,uu,W(this,vt).state),Pe(this,Yc,this.options),W(this,uu).data!==void 0&&Pe(this,Wc,W(this,vt)),Xv(n,t))return;Pe(this,Gr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!W(this,Qc).size)return!0;const l=new Set(s??W(this,Qc));return this.options.throwOnError&&l.add("error"),Object.keys(W(this,Gr)).some(c=>{const f=c;return W(this,Gr)[f]!==t[f]&&l.has(f)})};at(this,Nt,Gz).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&at(this,Nt,U_).call(this)}},oi=new WeakMap,vt=new WeakMap,Pp=new WeakMap,Gr=new WeakMap,uu=new WeakMap,Yc=new WeakMap,Do=new WeakMap,Xs=new WeakMap,Dp=new WeakMap,Xc=new WeakMap,Wc=new WeakMap,cu=new WeakMap,fu=new WeakMap,Ws=new WeakMap,Qc=new WeakMap,Nt=new WeakSet,yh=function(t){at(this,Nt,F_).call(this);let n=W(this,vt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Kr)),n},B_=function(){at(this,Nt,V_).call(this);const t=il(this.options.staleTime,W(this,vt));if(Uh.isServer()||W(this,Gr).isStale||!N_(t))return;const r=$z(W(this,Gr).dataUpdatedAt,t)+1;Pe(this,cu,Ql.setTimeout(()=>{W(this,Gr).isStale||this.updateResult()},r))},q_=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,vt)):this.options.refetchInterval)??!1},I_=function(t){at(this,Nt,H_).call(this),Pe(this,Ws,t),!(Uh.isServer()||Mi(this.options.enabled,W(this,vt))===!1||!N_(W(this,Ws))||W(this,Ws)===0)&&Pe(this,fu,Ql.setInterval(()=>{(this.options.refetchIntervalInBackground||KO.isFocused())&&at(this,Nt,yh).call(this)},W(this,Ws)))},U_=function(){at(this,Nt,B_).call(this),at(this,Nt,I_).call(this,at(this,Nt,q_).call(this))},V_=function(){W(this,cu)!==void 0&&(Ql.clearTimeout(W(this,cu)),Pe(this,cu,void 0))},H_=function(){W(this,fu)!==void 0&&(Ql.clearInterval(W(this,fu)),Pe(this,fu,void 0))},F_=function(){const t=W(this,oi).getQueryCache().build(W(this,oi),this.options);if(t===W(this,vt))return;const n=W(this,vt);Pe(this,vt,t),Pe(this,Pp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Gz=function(t){Zn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(W(this,Gr))}),W(this,oi).getQueryCache().notify({query:W(this,vt),type:"observerResultsUpdated"})})},Dz);function qU(e,t){return Mi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Mi(t.retryOnMount,e)===!1)}function wC(e,t){return qU(e,t)||e.state.data!==void 0&&G_(e,t,t.refetchOnMount)}function G_(e,t,n){if(Mi(t.enabled,e)!==!1&&il(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&QO(e,t)}return!1}function _C(e,t,n,r){return(e!==t||Mi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&QO(e,n)}function QO(e,t){return Mi(t.enabled,e)!==!1&&e.isStaleByTime(il(t.staleTime,e))}function IU(e,t){return!Xv(e.getCurrentResult(),t)}var Rp,Va,Nr,du,Ha,qs,Rz,UU=(Rz=class extends Vz{constructor(t){super();qe(this,Ha);qe(this,Rp);qe(this,Va);qe(this,Nr);qe(this,du);Pe(this,Rp,t.client),this.mutationId=t.mutationId,Pe(this,Nr,t.mutationCache),Pe(this,Va,[]),this.state=t.state||Kz(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){W(this,Va).includes(t)||(W(this,Va).push(t),this.clearGcTimeout(),W(this,Nr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Pe(this,Va,W(this,Va).filter(n=>n!==t)),this.scheduleGc(),W(this,Nr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){W(this,Va).length||(this.state.status==="pending"?this.scheduleGc():W(this,Nr).remove(this))}continue(){var t;return((t=W(this,du))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,c,f,d,m,p,v,b,w,S,x,A,_,M,E,O,j,R;const n=()=>{at(this,Ha,qs).call(this,{type:"continue"})},r={client:W(this,Rp),meta:this.options.meta,mutationKey:this.options.mutationKey};Pe(this,du,Uz({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(k,z)=>{at(this,Ha,qs).call(this,{type:"failed",failureCount:k,error:z})},onPause:()=>{at(this,Ha,qs).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,Nr).canRun(this)}));const i=this.state.status==="pending",s=!W(this,du).canStart();try{if(i)n();else{at(this,Ha,qs).call(this,{type:"pending",variables:t,isPaused:s}),W(this,Nr).config.onMutate&&await W(this,Nr).config.onMutate(t,this,r);const z=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,r));z!==this.state.context&&at(this,Ha,qs).call(this,{type:"pending",context:z,variables:t,isPaused:s})}const k=await W(this,du).start();return await((d=(f=W(this,Nr).config).onSuccess)==null?void 0:d.call(f,k,t,this.state.context,this,r)),await((p=(m=this.options).onSuccess)==null?void 0:p.call(m,k,t,this.state.context,r)),await((b=(v=W(this,Nr).config).onSettled)==null?void 0:b.call(v,k,null,this.state.variables,this.state.context,this,r)),await((S=(w=this.options).onSettled)==null?void 0:S.call(w,k,null,t,this.state.context,r)),at(this,Ha,qs).call(this,{type:"success",data:k}),k}catch(k){try{await((A=(x=W(this,Nr).config).onError)==null?void 0:A.call(x,k,t,this.state.context,this,r))}catch(z){Promise.reject(z)}try{await((M=(_=this.options).onError)==null?void 0:M.call(_,k,t,this.state.context,r))}catch(z){Promise.reject(z)}try{await((O=(E=W(this,Nr).config).onSettled)==null?void 0:O.call(E,void 0,k,this.state.variables,this.state.context,this,r))}catch(z){Promise.reject(z)}try{await((R=(j=this.options).onSettled)==null?void 0:R.call(j,void 0,k,t,this.state.context,r))}catch(z){Promise.reject(z)}throw at(this,Ha,qs).call(this,{type:"error",error:k}),k}finally{W(this,Nr).runNext(this)}}},Rp=new WeakMap,Va=new WeakMap,Nr=new WeakMap,du=new WeakMap,Ha=new WeakSet,qs=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),Zn.batch(()=>{W(this,Va).forEach(r=>{r.onMutationUpdate(t)}),W(this,Nr).notify({mutation:this,type:"updated",action:t})})},Rz);function Kz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ro,ba,Np,Nz,VU=(Nz=class extends Bf{constructor(t={}){super();qe(this,Ro);qe(this,ba);qe(this,Np);this.config=t,Pe(this,Ro,new Set),Pe(this,ba,new Map),Pe(this,Np,0)}build(t,n,r){const i=new UU({client:t,mutationCache:this,mutationId:++mv(this,Np)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){W(this,Ro).add(t);const n=yv(t);if(typeof n=="string"){const r=W(this,ba).get(n);r?r.push(t):W(this,ba).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(W(this,Ro).delete(t)){const n=yv(t);if(typeof n=="string"){const r=W(this,ba).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&W(this,ba).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=yv(t);if(typeof n=="string"){const r=W(this,ba).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=yv(t);if(typeof n=="string"){const i=(r=W(this,ba).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Zn.batch(()=>{W(this,Ro).forEach(t=>{this.notify({type:"removed",mutation:t})}),W(this,Ro).clear(),W(this,ba).clear()})}getAll(){return Array.from(W(this,Ro))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>vC(n,r))}findAll(t={}){return this.getAll().filter(n=>vC(t,n))}notify(t){Zn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Zn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Kr))))}},Ro=new WeakMap,ba=new WeakMap,Np=new WeakMap,Nz);function yv(e){var t;return(t=e.options.scope)==null?void 0:t.id}var No,Qs,si,ko,Go,Hv,K_,kz,HU=(kz=class extends Bf{constructor(n,r){super();qe(this,Go);qe(this,No);qe(this,Qs);qe(this,si);qe(this,ko);Pe(this,No,n),this.setOptions(r),this.bindMethods(),at(this,Go,Hv).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=W(this,No).defaultMutationOptions(n),Xv(this.options,r)||W(this,No).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,si),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&gu(r.mutationKey)!==gu(this.options.mutationKey)?this.reset():((i=W(this,si))==null?void 0:i.state.status)==="pending"&&W(this,si).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,si))==null||n.removeObserver(this)}onMutationUpdate(n){at(this,Go,Hv).call(this),at(this,Go,K_).call(this,n)}getCurrentResult(){return W(this,Qs)}reset(){var n;(n=W(this,si))==null||n.removeObserver(this),Pe(this,si,void 0),at(this,Go,Hv).call(this),at(this,Go,K_).call(this)}mutate(n,r){var i;return Pe(this,ko,r),(i=W(this,si))==null||i.removeObserver(this),Pe(this,si,W(this,No).getMutationCache().build(W(this,No),this.options)),W(this,si).addObserver(this),W(this,si).execute(n)}},No=new WeakMap,Qs=new WeakMap,si=new WeakMap,ko=new WeakMap,Go=new WeakSet,Hv=function(){var r;const n=((r=W(this,si))==null?void 0:r.state)??Kz();Pe(this,Qs,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},K_=function(n){Zn.batch(()=>{var r,i,s,l,c,f,d,m;if(W(this,ko)&&this.hasListeners()){const p=W(this,Qs).variables,v=W(this,Qs).context,b={client:W(this,No),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(r=W(this,ko)).onSuccess)==null||i.call(r,n.data,p,v,b)}catch(w){Promise.reject(w)}try{(l=(s=W(this,ko)).onSettled)==null||l.call(s,n.data,null,p,v,b)}catch(w){Promise.reject(w)}}else if((n==null?void 0:n.type)==="error"){try{(f=(c=W(this,ko)).onError)==null||f.call(c,n.error,p,v,b)}catch(w){Promise.reject(w)}try{(m=(d=W(this,ko)).onSettled)==null||m.call(d,void 0,n.error,p,v,b)}catch(w){Promise.reject(w)}}}this.listeners.forEach(p=>{p(W(this,Qs))})})},kz),Fa,Lz,FU=(Lz=class extends Bf{constructor(t={}){super();qe(this,Fa);this.config=t,Pe(this,Fa,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??YO(i,n);let l=this.get(s);return l||(l=new $U({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(l)),l}add(t){W(this,Fa).has(t.queryHash)||(W(this,Fa).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=W(this,Fa).get(t.queryHash);n&&(t.destroy(),n===t&&W(this,Fa).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Zn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return W(this,Fa).get(t)}getAll(){return[...W(this,Fa).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>mC(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>mC(t,r)):n}notify(t){Zn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Zn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Zn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Fa=new WeakMap,Lz),wn,Zs,Js,Zc,Jc,el,ef,tf,zz,GU=(zz=class{constructor(e={}){qe(this,wn);qe(this,Zs);qe(this,Js);qe(this,Zc);qe(this,Jc);qe(this,el);qe(this,ef);qe(this,tf);Pe(this,wn,e.queryCache||new FU),Pe(this,Zs,e.mutationCache||new VU),Pe(this,Js,e.defaultOptions||{}),Pe(this,Zc,new Map),Pe(this,Jc,new Map),Pe(this,el,0)}mount(){mv(this,el)._++,W(this,el)===1&&(Pe(this,ef,KO.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,wn).onFocus())})),Pe(this,tf,Wv.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,wn).onOnline())})))}unmount(){var e,t;mv(this,el)._--,W(this,el)===0&&((e=W(this,ef))==null||e.call(this),Pe(this,ef,void 0),(t=W(this,tf))==null||t.call(this),Pe(this,tf,void 0))}isFetching(e){return W(this,wn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,Zs).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,wn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=W(this,wn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(il(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return W(this,wn).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=W(this,wn).get(r.queryHash),s=i==null?void 0:i.state.data,l=TU(t,s);if(l!==void 0)return W(this,wn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Zn.batch(()=>W(this,wn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,wn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=W(this,wn);Zn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=W(this,wn);return Zn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Zn.batch(()=>W(this,wn).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Kr).catch(Kr)}invalidateQueries(e,t={}){return Zn.batch(()=>(W(this,wn).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=Zn.batch(()=>W(this,wn).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Kr)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Kr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=W(this,wn).build(this,t);return n.isStaleByTime(il(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Kr).catch(Kr)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Kr).catch(Kr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Wv.isOnline()?W(this,Zs).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,wn)}getMutationCache(){return W(this,Zs)}getDefaultOptions(){return W(this,Js)}setDefaultOptions(e){Pe(this,Js,e)}setQueryDefaults(e,t){W(this,Zc).set(gu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,Zc).values()],n={};return t.forEach(r=>{Ih(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){W(this,Jc).set(gu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,Jc).values()],n={};return t.forEach(r=>{Ih(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...W(this,Js).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=YO(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===XO&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...W(this,Js).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,wn).clear(),W(this,Zs).clear()}},wn=new WeakMap,Zs=new WeakMap,Js=new WeakMap,Zc=new WeakMap,Jc=new WeakMap,el=new WeakMap,ef=new WeakMap,tf=new WeakMap,zz),Yz=K.createContext(void 0),qf=e=>{const t=K.useContext(Yz);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},KU=({client:e,children:t})=>(K.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),T.jsx(Yz.Provider,{value:e,children:t})),Xz=K.createContext(!1),YU=()=>K.useContext(Xz);Xz.Provider;function XU(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var WU=K.createContext(XU()),QU=()=>K.useContext(WU),ZU=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?WO(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},JU=e=>{K.useEffect(()=>{e.clearReset()},[e])},eV=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||WO(n,[e.error,r])),tV=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))}},nV=(e,t)=>e.isLoading&&e.isFetching&&!t,rV=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,AC=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function iV(e,t,n){var v,b,w,S;const r=YU(),i=QU(),s=qf(),l=s.defaultQueryOptions(e);(b=(v=s.getDefaultOptions().queries)==null?void 0:v._experimental_beforeQuery)==null||b.call(v,l);const c=s.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",tV(l),ZU(l,i,c),JU(i);const f=!s.getQueryCache().get(l.queryHash),[d]=K.useState(()=>new t(s,l)),m=d.getOptimisticResult(l),p=!r&&e.subscribed!==!1;if(K.useSyncExternalStore(K.useCallback(x=>{const A=p?d.subscribe(Zn.batchCalls(x)):Kr;return d.updateResult(),A},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),K.useEffect(()=>{d.setOptions(l)},[l,d]),rV(l,m))throw AC(l,d,i);if(eV({result:m,errorResetBoundary:i,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw m.error;if((S=(w=s.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||S.call(w,l,m),l.experimental_prefetchInRender&&!Uh.isServer()&&nV(m,r)){const x=f?AC(l,d,i):c==null?void 0:c.promise;x==null||x.catch(Kr).finally(()=>{d.updateResult()})}return l.notifyOnChangeProps?m:d.trackResult(m)}function Wz(e,t){return iV(e,BU)}function sg(e,t){const n=qf(),[r]=K.useState(()=>new HU(n,e));K.useEffect(()=>{r.setOptions(e)},[r,e]);const i=K.useSyncExternalStore(K.useCallback(l=>r.subscribe(Zn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=K.useCallback((l,c)=>{r.mutate(l,c).catch(Kr)},[r]);if(i.error&&WO(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}function Qz(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const t=sV(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const c=l.split(ZO);return c[0]===""&&c.length!==1&&c.shift(),Zz(c,t)||oV(l)},getConflictingClassGroupIds:(l,c)=>{const f=n[l]||[];return c&&r[l]?[...f,...r[l]]:f}}},Zz=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Zz(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(ZO);return(l=t.validators.find(({validator:c})=>c(s)))==null?void 0:l.classGroupId},OC=/^\[(.+)\]$/,oV=e=>{if(OC.test(e)){const t=OC.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},sV=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return uV(Object.entries(e.classGroups),n).forEach(([s,l])=>{Y_(l,r,s,t)}),r},Y_=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:TC(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(lV(i)){Y_(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,l])=>{Y_(l,TC(t,s),n,r)})})},TC=(e,t)=>{let n=e;return t.split(ZO).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},lV=e=>e.isThemeGetter,uV=(e,t)=>t?e.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([l,c])=>[t+l,c])):s);return[n,i]}):e,cV=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,l)=>{n.set(s,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let l=n.get(s);if(l!==void 0)return l;if((l=r.get(s))!==void 0)return i(s,l),l},set(s,l){n.has(s)?n.set(s,l):i(s,l)}}},Jz="!",fV=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,l=c=>{const f=[];let d=0,m=0,p;for(let x=0;xm?p-m:void 0;return{modifiers:f,hasImportantModifier:b,baseClassName:w,maybePostfixModifierPosition:S}};return n?c=>n({className:c,parseClassName:l}):l},dV=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},hV=e=>({cache:cV(e.cacheSize),parseClassName:fV(e),...aV(e)}),pV=/\s+/,mV=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],l=e.trim().split(pV);let c="";for(let f=l.length-1;f>=0;f-=1){const d=l[f],{modifiers:m,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:b}=n(d);let w=!!b,S=r(w?v.substring(0,b):v);if(!S){if(!w){c=d+(c.length>0?" "+c:c);continue}if(S=r(v),!S){c=d+(c.length>0?" "+c:c);continue}w=!1}const x=dV(m).join(":"),A=p?x+Jz:x,_=A+S;if(s.includes(_))continue;s.push(_);const M=i(S,w);for(let E=0;E0?" "+c:c)}return c};function vV(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rp(m),e());return n=hV(d),r=n.cache.get,i=n.cache.set,s=c,c(f)}function c(f){const d=r(f);if(d)return d;const m=mV(f,n);return i(f,m),m}return function(){return s(vV.apply(null,arguments))}}const on=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},t$=/^\[(?:([a-z-]+):)?(.+)\]$/i,gV=/^\d+\/\d+$/,bV=new Set(["px","full","screen"]),xV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,SV=/\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$/,wV=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,_V=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,AV=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jo=e=>zc(e)||bV.has(e)||gV.test(e),$s=e=>If(e,"length",DV),zc=e=>!!e&&!Number.isNaN(Number(e)),lx=e=>If(e,"number",zc),rh=e=>!!e&&Number.isInteger(Number(e)),OV=e=>e.endsWith("%")&&zc(e.slice(0,-1)),ot=e=>t$.test(e),Bs=e=>xV.test(e),TV=new Set(["length","size","percentage"]),EV=e=>If(e,TV,n$),MV=e=>If(e,"position",n$),jV=new Set(["image","url"]),CV=e=>If(e,jV,NV),PV=e=>If(e,"",RV),ih=()=>!0,If=(e,t,n)=>{const r=t$.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},DV=e=>SV.test(e)&&!wV.test(e),n$=()=>!1,RV=e=>_V.test(e),NV=e=>AV.test(e),kV=()=>{const e=on("colors"),t=on("spacing"),n=on("blur"),r=on("brightness"),i=on("borderColor"),s=on("borderRadius"),l=on("borderSpacing"),c=on("borderWidth"),f=on("contrast"),d=on("grayscale"),m=on("hueRotate"),p=on("invert"),v=on("gap"),b=on("gradientColorStops"),w=on("gradientColorStopPositions"),S=on("inset"),x=on("margin"),A=on("opacity"),_=on("padding"),M=on("saturate"),E=on("scale"),O=on("sepia"),j=on("skew"),R=on("space"),k=on("translate"),z=()=>["auto","contain","none"],G=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",ot,t],B=()=>[ot,t],Z=()=>["",jo,$s],ee=()=>["auto",zc,ot],J=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],q=()=>["solid","dashed","dotted","double","none"],F=()=>["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"],ce=()=>["","0",ot],U=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[zc,ot];return{cacheSize:500,separator:":",theme:{colors:[ih],spacing:[jo,$s],blur:["none","",Bs,ot],brightness:D(),borderColor:[e],borderRadius:["none","","full",Bs,ot],borderSpacing:B(),borderWidth:Z(),contrast:D(),grayscale:ce(),hueRotate:D(),invert:ce(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[OV,$s],inset:$(),margin:$(),opacity:D(),padding:B(),saturate:D(),scale:D(),sepia:ce(),skew:D(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",ot]}],container:["container"],columns:[{columns:[Bs]}],"break-after":[{"break-after":U()}],"break-before":[{"break-before":U()}],"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:[...J(),ot]}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",rh,ot]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ot]}],grow:[{grow:ce()}],shrink:[{shrink:ce()}],order:[{order:["first","last","none",rh,ot]}],"grid-cols":[{"grid-cols":[ih]}],"col-start-end":[{col:["auto",{span:["full",rh,ot]},ot]}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":[ih]}],"row-start-end":[{row:["auto",{span:[rh,ot]},ot]}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ot]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ot]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"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:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ot,t]}],"min-w":[{"min-w":[ot,t,"min","max","fit"]}],"max-w":[{"max-w":[ot,t,"none","full","min","max","fit","prose",{screen:[Bs]},Bs]}],h:[{h:[ot,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ot,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ot,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ot,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Bs,$s]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",lx]}],"font-family":[{font:[ih]}],"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",ot]}],"line-clamp":[{"line-clamp":["none",zc,lx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",jo,ot]}],"list-image":[{"list-image":["none",ot]}],"list-style-type":[{list:["none","disc","decimal",ot]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[A]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[A]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",jo,$s]}],"underline-offset":[{"underline-offset":["auto",jo,ot]}],"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:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ot]}],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",ot]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[A]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...J(),MV]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",EV]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},CV]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[A]}],"border-style":[{border:[...q(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[A]}],"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":[jo,ot]}],"outline-w":[{outline:[jo,$s]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[A]}],"ring-offset-w":[{"ring-offset":[jo,$s]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Bs,PV]}],"shadow-color":[{shadow:[ih]}],opacity:[{opacity:[A]}],"mix-blend":[{"mix-blend":[...F(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":F()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",Bs,ot]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[p]}],saturate:[{saturate:[M]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[A]}],"backdrop-saturate":[{"backdrop-saturate":[M]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"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",ot]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",ot]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",ot]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[rh,ot]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"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",ot]}],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",ot]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"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",ot]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[jo,$s,lx]}],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"]}}},LV=yV(kV);function nf(...e){return LV(ut(e))}function li(e){if(e==null||Number.isNaN(e))return"—";const t=["B","KB","MB","GB","TB"];let n=Number(e),r=0;for(;n>=1024&&rn+r,0)}const EC=e=>{let t;const n=new Set,r=(d,m)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const v=t;t=m??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(b=>b(t,v))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>f,subscribe:d=>(n.add(d),()=>n.delete(d))},f=t=e(r,i,c);return c},zV=(e=>e?EC(e):EC),$V=e=>e;function BV(e,t=$V){const n=Q.useSyncExternalStore(e.subscribe,Q.useCallback(()=>t(e.getState()),[e,t]),Q.useCallback(()=>t(e.getInitialState()),[e,t]));return Q.useDebugValue(n),n}const MC=e=>{const t=zV(e),n=r=>BV(t,r);return Object.assign(n,t),n},qV=(e=>e?MC(e):MC),jC=e=>Symbol.iterator in e,CC=e=>"entries"in e,PC=(e,t)=>{const n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(const[i,s]of n)if(!r.has(i)||!Object.is(s,r.get(i)))return!1;return!0},IV=(e,t)=>{const n=e[Symbol.iterator](),r=t[Symbol.iterator]();let i=n.next(),s=r.next();for(;!i.done&&!s.done;){if(!Object.is(i.value,s.value))return!1;i=n.next(),s=r.next()}return!!i.done&&!!s.done};function UV(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:jC(e)&&jC(t)?CC(e)&&CC(t)?PC(e,t):IV(e,t):PC({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function lg(e){const t=Q.useRef(void 0);return n=>{const r=e(n);return UV(t.current,r)?t.current:t.current=r}}const r$="mtplx.dashboard.theme";function i$(){if(typeof window>"u")return"hippo";const e=window.localStorage.getItem(r$);return e==="hippo"||e==="river"||e==="light"||e==="mono"?e:"hippo"}function DC(e){if(!(typeof window>"u"))try{window.localStorage.setItem(r$,e),window.document.documentElement.setAttribute("data-theme",e)}catch{}}const ux=["hippo","river","light","mono"],De=qV((e,t)=>({snapshot:null,latest:null,recent:[],rolling:null,lifetime:null,inFlight:[],sessionBank:null,sessions:null,mem:null,thermal:null,thermalWhenS:0,settings:null,modelId:null,profileName:null,contextWindow:null,machine:null,uptimeS:0,liveTokS:null,liveProgressByRequest:{},activePrefillByRequest:{},lastCompletedPrefill:null,newMaxTPSEvent:null,connection:"idle",reconnectAttempts:0,lastSnapshotAtMs:null,authRequired:!1,sessionFilter:null,theme:i$(),pauseStream:!1,soundEnabled:!1,applySnapshot:n=>{if(t().pauseStream)return;const r={};(n.in_flight??[]).forEach(s=>{s.prefill_state&&(r[s.request_id]={...s.prefill_state,request_id:s.request_id,session_id:s.session_id})});const i=n.in_flight??[];e(s=>{var l;return{snapshot:n,latest:n.latest,recent:n.recent??[],rolling:n.rolling,lifetime:n.lifetime,inFlight:i,sessionBank:n.session_bank??null,sessions:n.sessions??null,mem:n.mem,thermal:n.thermal,thermalWhenS:n.thermal_when_s,settings:n.settings,modelId:n.model_id,profileName:((l=n.profile)==null?void 0:l.name)??null,contextWindow:n.context_window,machine:n.machine,uptimeS:n.uptime_s,activePrefillByRequest:r,liveTokS:i.length>0?s.liveTokS:null,lastSnapshotAtMs:Date.now()}})},applyEvent:n=>{var r;if(!t().pauseStream)switch(n.kind){case"progress":{const i=(r=n.progress)==null?void 0:r.decode_tok_s;e(s=>({liveTokS:typeof i=="number"&&i>0?i:s.liveTokS,liveProgressByRequest:{...s.liveProgressByRequest,[n.request_id]:n}}));break}case"completed":{e(i=>({latest:n.envelope??i.latest,liveTokS:null}));break}case"new_max_tps":{e({newMaxTPSEvent:{tok_s:n.tok_s,when_s:n.when_s,session_id:n.session_id}});break}case"thermal":{e({thermal:n.thermal,thermalWhenS:n.when_s});break}case"prefill":{const i=n.request_id,s={phase:n.phase,tokens_done:n.tokens_done,tokens_total:n.tokens_total,cached_tokens:n.cached_tokens,new_prefill_tokens:n.new_prefill_tokens,elapsed_s:n.elapsed_s,prefill_tok_s:n.prefill_tok_s,chunk_size:n.chunk_size,cache_hit:n.cache_hit,started_s:n.started_s,request_id:i,session_id:n.session_id};n.phase==="completed"?e(l=>{const c={...l.activePrefillByRequest};return delete c[i],{activePrefillByRequest:c,lastCompletedPrefill:{...s,when_s:n.when_s}}}):e(l=>({activePrefillByRequest:{...l.activePrefillByRequest,[i]:s}}));break}case"snapshot":{t().applySnapshot(n);break}}},mergeSettings:n=>e(r=>r.settings?{settings:{...r.settings,...n}}:{}),setConnection:n=>{e(r=>({connection:n,reconnectAttempts:n==="reconnecting"?r.reconnectAttempts+1:0}))},setAuthRequired:n=>e({authRequired:n}),setSessionFilter:n=>e({sessionFilter:n}),setTheme:n=>{DC(n),e({theme:n})},cycleTheme:()=>{const n=t().theme,r=ux[(ux.indexOf(n)+1)%ux.length];DC(r),e({theme:r})},togglePauseStream:()=>e(n=>({pauseStream:!n.pauseStream})),toggleSound:()=>e(n=>({soundEnabled:!n.soundEnabled})),consumeNewMaxTPS:()=>e({newMaxTPSEvent:null})}));typeof window<"u"&&window.document.documentElement.setAttribute("data-theme",i$());function VV(){return De(lg(e=>{var n;const t=new Set;return(n=e.rolling)==null||n.history.forEach(r=>{r.session_id&&t.add(r.session_id)}),e.inFlight.forEach(r=>{r.session_id&&t.add(r.session_id)}),Array.from(t).sort()}))}function HV(){return De(lg(e=>{if(!e.rolling)return[];const t=e.sessionFilter;return t?e.rolling.history.filter(n=>n.session_id===t):e.rolling.history}))}function FV(){return De(lg(e=>e.sessionFilter?e.recent.filter(t=>t.session_id===e.sessionFilter):e.recent))}function a$(){return De(lg(e=>{const t=Object.values(e.activePrefillByRequest);if(t.length===0)return{active:!1};const n=t.reduce((m,p)=>(p.elapsed_s??0)>(m.elapsed_s??0)?p:m),r=Number(n.tokens_total??0),i=Number(n.tokens_done??0),s=Number(n.elapsed_s??0),l=r>0?Math.min(100,i/r*100):0,c=typeof n.prefill_tok_s=="number"&&n.prefill_tok_s>0?n.prefill_tok_s:i>0&&s>0?i/s:null,f=Math.max(0,r-i),d=c&&c>0&&f>0?f/c:null;return{active:!0,request_id:n.request_id,session_id:n.session_id,tokens_done:i,tokens_total:r,cached_tokens:Number(n.cached_tokens??0),elapsed_s:s,prefill_tok_s:c,pct:l,eta_s:d}}))}function GV(){const e=De(p=>p.latest),t=De(p=>p.lifetime),n=De(p=>p.liveTokS),r=(e==null?void 0:e.completion_tokens)??null,i=(e==null?void 0:e.ttft_s)??null,s=typeof n=="number",l=s?n:(e==null?void 0:e.decode_tok_s)??null,c=(e==null?void 0:e.request_tok_s)??null,f=(e==null?void 0:e.prompt_eval_time_s)??null,d=(e==null?void 0:e.decode_elapsed_s)??null,m=(t==null?void 0:t.requests_total)??0;return T.jsxs("div",{className:"px-4 lg:px-6 py-2 flex items-center justify-between gap-4 text-xs",children:[T.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-[var(--text-muted)] min-w-0",children:[T.jsx(Il,{label:"tok",value:Xe(r)}),T.jsx(Il,{label:"ttft",value:Nn(i)}),T.jsx(Il,{label:"prompt eval",value:Nn(f)}),T.jsx(Il,{label:"decode",value:Nn(d)}),T.jsx(Il,{label:s?"tok/s live":"tok/s",value:On(l),highlight:s}),T.jsx(Il,{label:"req tok/s",value:On(c)}),T.jsx(Il,{label:"lifetime req",value:Xe(m)})]}),T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)] hidden sm:block",children:"MTPLX live"})]})}function Il({label:e,value:t,highlight:n=!1}){return T.jsxs("span",{className:"flex items-baseline gap-1.5 whitespace-nowrap",children:[T.jsx("span",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:e}),T.jsx("span",{className:"tabular-nums font-medium "+(n?"text-[var(--accent)]":"text-[var(--text-primary)]"),children:t})]})}function ct({title:e,subtitle:t,action:n,className:r,bodyClassName:i,children:s}){return T.jsxs("section",{className:nf("rounded-2xl border border-[var(--border-soft)] bg-[var(--bg-card)] shadow-[inset_0_1px_0_0_rgba(255,255,255,0.02)] overflow-hidden",r),children:[(e||n)&&T.jsxs("header",{className:"px-5 pt-4 pb-2 flex items-start justify-between gap-4",children:[T.jsxs("div",{className:"min-w-0",children:[e?T.jsx("h3",{className:"text-sm font-semibold text-[var(--text-primary)] tracking-tight",children:e}):null,t?T.jsx("p",{className:"text-xs text-[var(--text-muted)] mt-0.5",children:t}):null]}),n?T.jsx("div",{className:"shrink-0",children:n}):null]}),T.jsx("div",{className:nf("px-5 pb-5 pt-2",i),children:s})]})}function Ya({value:e,unit:t,caption:n,tone:r="default"}){const i=r==="accent"?"text-[var(--accent)]":r==="warm"?"text-[var(--accent-warm)]":r==="hot"?"text-[var(--accent-hot)]":r==="cool"?"text-[var(--accent-cool)]":"text-[var(--text-primary)]";return T.jsxs("div",{children:[T.jsxs("div",{className:nf("flex items-baseline gap-2",i),children:[T.jsx("span",{className:"text-4xl font-semibold tabular-nums leading-none",children:e}),t?T.jsx("span",{className:"text-sm text-[var(--text-muted)]",children:t}):null]}),n?T.jsx("div",{className:"text-xs text-[var(--text-muted)] mt-2",children:n}):null]})}const KV={client_disconnected:"client",client_disconnect:"client",stream_cancelled:"stream",stream_teardown:"stream",stream_stall:"stall",stop_sequence:"stop",early_tool_finish:"tool call",hidden_tool_guard:"tool guard",post_endpoint:"cancel call"},YV={client_disconnected:"the client closed the connection",client_disconnect:"the client closed the connection",stream_stall:"the stream stalled",stop_sequence:"a stop sequence ended the answer",early_tool_finish:"the server finished the tool call early",hidden_tool_guard:"the hidden-tool stream guard stopped it",post_endpoint:"POST /v1/mtplx/cancel stopped it"};function W_(e){return e.replace(/_/g," ")}function XV(e){return e.cached_tokens===null||e.cached_tokens===void 0?null:e.session_cache_hit===!0?`hit${e.cache_source&&e.cache_source!=="ram"?` ${e.cache_source}`:""} ${Xe(e.cached_tokens)}`:e.session_cache_hit===!1?e.cache_miss_reason?`miss: ${W_(e.cache_miss_reason)}`:"miss":null}function WV(e){if(!e.request_cancelled)return null;const t=e.cancellation_reason??"",n=e.cancellation_elapsed_s??e.request_elapsed_s,r=["cancelled"];t&&r.push(KV[t]??W_(t)),typeof n=="number"&&Number.isFinite(n)&&r.push(Nn(n));const i=t?YV[t]??W_(t):"unknown reason",s=typeof n=="number"&&Number.isFinite(n)?` after ${Nn(n)}`:"",l=XV(e),c=l===null?"Cache outcome unknown: the request ended before its prompt was read.":`Cache: ${l}.`;return{label:r.join(" · "),tooltip:`Cancelled${s}: ${i}${t?` (${t})`:""}. +${c} +Not counted in the hit rate.`,cacheHint:l}}function QV(e){return!e.request_cancelled}function ZV(){const e=De(i=>i.lifetime),t=(e==null?void 0:e.cached_tokens_total)??0,n=(e==null?void 0:e.prompt_tokens_total)??0,r=n>0?t/n*100:0;return T.jsx(ct,{title:"Cached tokens · lifetime",subtitle:"cached / prompt across all requests",children:T.jsx(Ya,{value:Xe(t),unit:"tokens",tone:"accent",caption:`${r.toFixed(1)}% of ${Xe(n)} prompt tokens`})})}function JV(){const t=De(s=>s.recent).filter(QV).slice(-32),n=t.filter(s=>s.session_cache_hit).length,r=t.length>0?n/t.length*100:0,i=r>=70?"accent":r>=40?"warm":"hot";return T.jsx(ct,{title:"Session cache hit rate",subtitle:`last ${t.length} requests`,children:T.jsx(Ya,{value:`${r.toFixed(0)}%`,unit:"hit",tone:i,caption:`${n} hits / ${t.length} requests`})})}function eH(){const e=De(l=>l.latest),t=De(l=>l.contextWindow),n=(e==null?void 0:e.context_len)??0,r=t?Math.min(100,n/t*100):0,i=r>=95?"hot":r>=75?"warm":r>=50?"cool":"accent",s=i==="hot"?"var(--accent-hot)":i==="warm"?"var(--accent-warm)":i==="cool"?"var(--accent-cool)":"var(--accent)";return T.jsxs(ct,{title:"Context window utilization",subtitle:`${Xe(n)} / ${Xe(t??0)} tokens`,children:[T.jsx("div",{className:"h-4 w-full rounded-full bg-[var(--bg-elevated)] overflow-hidden border border-[var(--border-soft)]",children:T.jsx("div",{className:"h-full transition-[width] duration-500",style:{width:`${r}%`,background:s}})}),T.jsxs("div",{className:"flex justify-between mt-2 text-xs text-[var(--text-muted)] tabular-nums",children:[T.jsx("span",{children:"0"}),T.jsxs("span",{className:"text-[var(--text-primary)] font-semibold",children:[r.toFixed(0),"%"]}),T.jsx("span",{children:Xe(t??0)})]})]})}var cx,RC;function fi(){if(RC)return cx;RC=1;var e=Array.isArray;return cx=e,cx}var fx,NC;function o$(){if(NC)return fx;NC=1;var e=typeof vv=="object"&&vv&&vv.Object===Object&&vv;return fx=e,fx}var dx,kC;function to(){if(kC)return dx;kC=1;var e=o$(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return dx=n,dx}var hx,LC;function kp(){if(LC)return hx;LC=1;var e=to(),t=e.Symbol;return hx=t,hx}var px,zC;function tH(){if(zC)return px;zC=1;var e=kp(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function s(l){var c=n.call(l,i),f=l[i];try{l[i]=void 0;var d=!0}catch{}var m=r.call(l);return d&&(c?l[i]=f:delete l[i]),m}return px=s,px}var mx,$C;function nH(){if($C)return mx;$C=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return mx=n,mx}var vx,BC;function Jo(){if(BC)return vx;BC=1;var e=kp(),t=tH(),n=nH(),r="[object Null]",i="[object Undefined]",s=e?e.toStringTag:void 0;function l(c){return c==null?c===void 0?i:r:s&&s in Object(c)?t(c):n(c)}return vx=l,vx}var yx,qC;function es(){if(qC)return yx;qC=1;function e(t){return t!=null&&typeof t=="object"}return yx=e,yx}var gx,IC;function Uf(){if(IC)return gx;IC=1;var e=Jo(),t=es(),n="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&e(i)==n}return gx=r,gx}var bx,UC;function eT(){if(UC)return bx;UC=1;var e=fi(),t=Uf(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(s,l){if(e(s))return!1;var c=typeof s;return c=="number"||c=="symbol"||c=="boolean"||s==null||t(s)?!0:r.test(s)||!n.test(s)||l!=null&&s in Object(l)}return bx=i,bx}var xx,VC;function ll(){if(VC)return xx;VC=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return xx=e,xx}var Sx,HC;function tT(){if(HC)return Sx;HC=1;var e=Jo(),t=ll(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",s="[object Proxy]";function l(c){if(!t(c))return!1;var f=e(c);return f==r||f==i||f==n||f==s}return Sx=l,Sx}var wx,FC;function rH(){if(FC)return wx;FC=1;var e=to(),t=e["__core-js_shared__"];return wx=t,wx}var _x,GC;function iH(){if(GC)return _x;GC=1;var e=rH(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return _x=n,_x}var Ax,KC;function s$(){if(KC)return Ax;KC=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return Ax=n,Ax}var Ox,YC;function aH(){if(YC)return Ox;YC=1;var e=tT(),t=iH(),n=ll(),r=s$(),i=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,f=l.toString,d=c.hasOwnProperty,m=RegExp("^"+f.call(d).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(v){if(!n(v)||t(v))return!1;var b=e(v)?m:s;return b.test(r(v))}return Ox=p,Ox}var Tx,XC;function oH(){if(XC)return Tx;XC=1;function e(t,n){return t==null?void 0:t[n]}return Tx=e,Tx}var Ex,WC;function Eu(){if(WC)return Ex;WC=1;var e=aH(),t=oH();function n(r,i){var s=t(r,i);return e(s)?s:void 0}return Ex=n,Ex}var Mx,QC;function ug(){if(QC)return Mx;QC=1;var e=Eu(),t=e(Object,"create");return Mx=t,Mx}var jx,ZC;function sH(){if(ZC)return jx;ZC=1;var e=ug();function t(){this.__data__=e?e(null):{},this.size=0}return jx=t,jx}var Cx,JC;function lH(){if(JC)return Cx;JC=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Cx=e,Cx}var Px,eP;function uH(){if(eP)return Px;eP=1;var e=ug(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(s){var l=this.__data__;if(e){var c=l[s];return c===t?void 0:c}return r.call(l,s)?l[s]:void 0}return Px=i,Px}var Dx,tP;function cH(){if(tP)return Dx;tP=1;var e=ug(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var s=this.__data__;return e?s[i]!==void 0:n.call(s,i)}return Dx=r,Dx}var Rx,nP;function fH(){if(nP)return Rx;nP=1;var e=ug(),t="__lodash_hash_undefined__";function n(r,i){var s=this.__data__;return this.size+=this.has(r)?0:1,s[r]=e&&i===void 0?t:i,this}return Rx=n,Rx}var Nx,rP;function dH(){if(rP)return Nx;rP=1;var e=sH(),t=lH(),n=uH(),r=cH(),i=fH();function s(l){var c=-1,f=l==null?0:l.length;for(this.clear();++c-1}return qx=t,qx}var Ix,cP;function yH(){if(cP)return Ix;cP=1;var e=cg();function t(n,r){var i=this.__data__,s=e(i,n);return s<0?(++this.size,i.push([n,r])):i[s][1]=r,this}return Ix=t,Ix}var Ux,fP;function fg(){if(fP)return Ux;fP=1;var e=hH(),t=pH(),n=mH(),r=vH(),i=yH();function s(l){var c=-1,f=l==null?0:l.length;for(this.clear();++c0?1:-1},Zl=function(t){return xu(t)&&t.indexOf("%")===t.length-1},Oe=function(t){return NH(t)&&!Hf(t)},kH=function(t){return Qe(t)},Jn=function(t){return Oe(t)||xu(t)},LH=0,Mu=function(t){var n=++LH;return"".concat(t||"").concat(n)},Su=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Oe(t)&&!xu(t))return r;var s;if(Zl(t)){var l=t.indexOf("%");s=n*parseFloat(t.slice(0,l))/100}else s=+t;return Hf(s)&&(s=r),i&&s>n&&(s=n),s},Fs=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},zH=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function FH(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Q_(e){"@babel/helpers - typeof";return Q_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q_(e)}var $C={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Bo=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},BC=null,p1=null,sT=function e(t){if(t===BC&&Array.isArray(p1))return p1;var n=[];return K.Children.forEach(t,function(r){Qe(r)||(PH.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),p1=n,BC=t,n};function ci(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return Bo(i)}):r=[Bo(t)],sT(e).forEach(function(i){var s=ia(i,"type.displayName")||ia(i,"type.name");r.indexOf(s)!==-1&&n.push(i)}),n}function Ti(e,t){var n=ci(e,t);return n&&n[0]}var qC=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!Oe(r)||r<=0||!Oe(i)||i<=0)},GH=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],KH=function(t){return t&&t.type&&xu(t.type)&&GH.indexOf(t.type)>=0},d$=function(t){return t&&Q_(t)==="object"&&"clipDot"in t},YH=function(t,n,r,i){var s,l=(s=h1==null?void 0:h1[i])!==null&&s!==void 0?s:[];return n.startsWith("data-")||!tt(t)&&(i&&l.includes(n)||IH.includes(n))||r&&oT.includes(n)},Je=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(K.isValidElement(t)&&(i=t.props),!Vf(i))return null;var s={};return Object.keys(i).forEach(function(l){var c;YH((c=i)===null||c===void 0?void 0:c[l],l,n,r)&&(s[l]=i[l])}),s},Z_=function e(t,n){if(t===n)return!0;var r=K.Children.count(t);if(r!==K.Children.count(n))return!1;if(r===0)return!0;if(r===1)return IC(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function JH(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function eA(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,s=e.className,l=e.style,c=e.title,f=e.desc,d=ZH(e,QH),m=i||{width:n,height:r,x:0,y:0},p=ut("recharts-surface",s);return Q.createElement("svg",J_({},Je(d,!0,"svg"),{className:p,width:n,height:r,style:l,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height)}),Q.createElement("title",null,c),Q.createElement("desc",null,f),t)}var eF=["children","className"];function tA(){return tA=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function nF(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Mt=Q.forwardRef(function(e,t){var n=e.children,r=e.className,i=tF(e,eF),s=ut("recharts-layer",r);return Q.createElement("g",tA({className:s},Je(i,!0),{ref:t}),n)}),qo=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;ss?0:s+n),r=r>s?s:r,r<0&&(r+=s),s=n>r?0:r-n>>>0,n>>>=0;for(var l=Array(s);++i=s?n:e(n,r,i)}return v1=t,v1}var y1,FC;function h$(){if(FC)return y1;FC=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,s="\\ufe0e\\ufe0f",l="\\u200d",c=RegExp("["+l+e+i+s+"]");function f(d){return c.test(d)}return y1=f,y1}var g1,GC;function aF(){if(GC)return g1;GC=1;function e(t){return t.split("")}return g1=e,g1}var b1,KC;function oF(){if(KC)return b1;KC=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,s="\\ufe0e\\ufe0f",l="["+e+"]",c="["+i+"]",f="\\ud83c[\\udffb-\\udfff]",d="(?:"+c+"|"+f+")",m="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",v="[\\ud800-\\udbff][\\udc00-\\udfff]",b="\\u200d",w=d+"?",S="["+s+"]?",x="(?:"+b+"(?:"+[m,p,v].join("|")+")"+S+w+")*",A=S+w+x,_="(?:"+[m+c+"?",c,p,v,l].join("|")+")",M=RegExp(f+"(?="+f+")|"+_+A,"g");function E(O){return O.match(M)||[]}return b1=E,b1}var x1,YC;function sF(){if(YC)return x1;YC=1;var e=aF(),t=h$(),n=oF();function r(i){return t(i)?n(i):e(i)}return x1=r,x1}var S1,XC;function lF(){if(XC)return S1;XC=1;var e=iF(),t=h$(),n=sF(),r=l$();function i(s){return function(l){l=r(l);var c=t(l)?n(l):void 0,f=c?c[0]:l.charAt(0),d=c?e(c,1).join(""):l.slice(1);return f[s]()+d}}return S1=i,S1}var w1,WC;function uF(){if(WC)return w1;WC=1;var e=lF(),t=e("toUpperCase");return w1=t,w1}var cF=uF();const pg=Ft(cF);function en(e){return function(){return e}}const p$=Math.cos,Jv=Math.sin,Ea=Math.sqrt,ey=Math.PI,mg=2*ey,nA=Math.PI,rA=2*nA,Hl=1e-6,fF=rA-Hl;function m$(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return m$;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;iHl)if(!(Math.abs(p*f-d*m)>Hl)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let b=r-l,w=i-c,S=f*f+d*d,x=b*b+w*w,A=Math.sqrt(S),_=Math.sqrt(v),M=s*Math.tan((nA-Math.acos((S+v-x)/(2*A*_)))/2),E=M/_,O=M/A;Math.abs(E-1)>Hl&&this._append`L${t+E*m},${n+E*p}`,this._append`A${s},${s},0,0,${+(p*b>m*w)},${this._x1=t+O*f},${this._y1=n+O*d}`}}arc(t,n,r,i,s,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(i),f=r*Math.sin(i),d=t+c,m=n+f,p=1^l,v=l?i-s:s-i;this._x1===null?this._append`M${d},${m}`:(Math.abs(this._x1-d)>Hl||Math.abs(this._y1-m)>Hl)&&this._append`L${d},${m}`,r&&(v<0&&(v=v%rA+rA),v>fF?this._append`A${r},${r},0,1,${p},${t-c},${n-f}A${r},${r},0,1,${p},${this._x1=d},${this._y1=m}`:v>Hl&&this._append`A${r},${r},0,${+(v>=nA)},${p},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function lT(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new hF(t)}function uT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function v$(e){this._context=e}v$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function vg(e){return new v$(e)}function y$(e){return e[0]}function g$(e){return e[1]}function b$(e,t){var n=en(!0),r=null,i=vg,s=null,l=lT(c);e=typeof e=="function"?e:e===void 0?y$:en(e),t=typeof t=="function"?t:t===void 0?g$:en(t);function c(f){var d,m=(f=uT(f)).length,p,v=!1,b;for(r==null&&(s=i(b=l())),d=0;d<=m;++d)!(d=b;--w)c.point(M[w],E[w]);c.lineEnd(),c.areaEnd()}A&&(M[v]=+e(x,v,p),E[v]=+t(x,v,p),c.point(r?+r(x,v,p):M[v],n?+n(x,v,p):E[v]))}if(_)return c=null,_+""||null}function m(){return b$().defined(i).curve(l).context(s)}return d.x=function(p){return arguments.length?(e=typeof p=="function"?p:en(+p),r=null,d):e},d.x0=function(p){return arguments.length?(e=typeof p=="function"?p:en(+p),d):e},d.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:en(+p),d):r},d.y=function(p){return arguments.length?(t=typeof p=="function"?p:en(+p),n=null,d):t},d.y0=function(p){return arguments.length?(t=typeof p=="function"?p:en(+p),d):t},d.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:en(+p),d):n},d.lineX0=d.lineY0=function(){return m().x(e).y(t)},d.lineY1=function(){return m().x(e).y(n)},d.lineX1=function(){return m().x(r).y(t)},d.defined=function(p){return arguments.length?(i=typeof p=="function"?p:en(!!p),d):i},d.curve=function(p){return arguments.length?(l=p,s!=null&&(c=l(s)),d):l},d.context=function(p){return arguments.length?(p==null?s=c=null:c=l(s=p),d):s},d}class x${constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function pF(e){return new x$(e,!0)}function mF(e){return new x$(e,!1)}const cT={draw(e,t){const n=Ea(t/ey);e.moveTo(n,0),e.arc(0,0,n,0,mg)}},vF={draw(e,t){const n=Ea(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},S$=Ea(1/3),yF=S$*2,gF={draw(e,t){const n=Ea(t/yF),r=n*S$;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},bF={draw(e,t){const n=Ea(t),r=-n/2;e.rect(r,r,n,n)}},xF=.8908130915292852,w$=Jv(ey/10)/Jv(7*ey/10),SF=Jv(mg/10)*w$,wF=-p$(mg/10)*w$,_F={draw(e,t){const n=Ea(t*xF),r=SF*n,i=wF*n;e.moveTo(0,-n),e.lineTo(r,i);for(let s=1;s<5;++s){const l=mg*s/5,c=p$(l),f=Jv(l);e.lineTo(f*n,-c*n),e.lineTo(c*r-f*i,f*r+c*i)}e.closePath()}},_1=Ea(3),AF={draw(e,t){const n=-Ea(t/(_1*3));e.moveTo(0,n*2),e.lineTo(-_1*n,-n),e.lineTo(_1*n,-n),e.closePath()}},Ki=-.5,Yi=Ea(3)/2,iA=1/Ea(12),OF=(iA/2+1)*3,TF={draw(e,t){const n=Ea(t/OF),r=n/2,i=n*iA,s=r,l=n*iA+n,c=-s,f=l;e.moveTo(r,i),e.lineTo(s,l),e.lineTo(c,f),e.lineTo(Ki*r-Yi*i,Yi*r+Ki*i),e.lineTo(Ki*s-Yi*l,Yi*s+Ki*l),e.lineTo(Ki*c-Yi*f,Yi*c+Ki*f),e.lineTo(Ki*r+Yi*i,Ki*i-Yi*r),e.lineTo(Ki*s+Yi*l,Ki*l-Yi*s),e.lineTo(Ki*c+Yi*f,Ki*f-Yi*c),e.closePath()}};function EF(e,t){let n=null,r=lT(i);e=typeof e=="function"?e:en(e||cT),t=typeof t=="function"?t:en(t===void 0?64:+t);function i(){let s;if(n||(n=s=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return i.type=function(s){return arguments.length?(e=typeof s=="function"?s:en(s),i):e},i.size=function(s){return arguments.length?(t=typeof s=="function"?s:en(+s),i):t},i.context=function(s){return arguments.length?(n=s??null,i):n},i}function ty(){}function ny(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function _$(e){this._context=e}_$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ny(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ny(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function MF(e){return new _$(e)}function A$(e){this._context=e}A$.prototype={areaStart:ty,areaEnd:ty,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ny(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function jF(e){return new A$(e)}function O$(e){this._context=e}O$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ny(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function PF(e){return new O$(e)}function T$(e){this._context=e}T$.prototype={areaStart:ty,areaEnd:ty,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function CF(e){return new T$(e)}function QC(e){return e<0?-1:1}function ZC(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),c=(s*i+l*r)/(r+i);return(QC(s)+QC(l))*Math.min(Math.abs(s),Math.abs(l),.5*Math.abs(c))||0}function JC(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function A1(e,t,n){var r=e._x0,i=e._y0,s=e._x1,l=e._y1,c=(s-r)/3;e._context.bezierCurveTo(r+c,i+c*t,s-c,l-c*n,s,l)}function ry(e){this._context=e}ry.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:A1(this,this._t0,JC(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,A1(this,JC(this,n=ZC(this,e,t)),n);break;default:A1(this,this._t0,n=ZC(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function E$(e){this._context=new M$(e)}(E$.prototype=Object.create(ry.prototype)).point=function(e,t){ry.prototype.point.call(this,t,e)};function M$(e){this._context=e}M$.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function DF(e){return new ry(e)}function RF(e){return new E$(e)}function j$(e){this._context=e}j$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=eD(e),i=eD(t),s=0,l=1;l=0;--t)i[t]=(l[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function kF(e){return new yg(e,.5)}function LF(e){return new yg(e,0)}function zF(e){return new yg(e,1)}function rf(e,t){if((l=e.length)>1)for(var n=1,r,i,s=e[t[0]],l,c=s.length;n=0;)n[t]=t;return n}function $F(e,t){return e[t]}function BF(e){const t=[];return t.key=e,t}function qF(){var e=en([]),t=aA,n=rf,r=$F;function i(s){var l=Array.from(e.apply(this,arguments),BF),c,f=l.length,d=-1,m;for(const p of s)for(c=0,++d;c0){for(var n,r,i=0,s=e[0].length,l;i0){for(var n=0,r=e[t[0]],i,s=r.length;n0)||!((s=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,s,l;r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function XF(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var P$={symbolCircle:cT,symbolCross:vF,symbolDiamond:gF,symbolSquare:bF,symbolStar:_F,symbolTriangle:AF,symbolWye:TF},WF=Math.PI/180,QF=function(t){var n="symbol".concat(pg(t));return P$[n]||cT},ZF=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*WF;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},JF=function(t,n){P$["symbol".concat(pg(t))]=n},gg=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,s=i===void 0?64:i,l=t.sizeType,c=l===void 0?"area":l,f=YF(t,HF),d=nD(nD({},f),{},{type:r,size:s,sizeType:c}),m=function(){var x=QF(r),A=EF().type(x).size(ZF(s,c,r));return A()},p=d.className,v=d.cx,b=d.cy,w=Je(d,!0);return v===+v&&b===+b&&s===+s?Q.createElement("path",oA({},w,{className:ut("recharts-symbols",p),transform:"translate(".concat(v,", ").concat(b,")"),d:m()})):null};gg.registerSymbol=JF;function af(e){"@babel/helpers - typeof";return af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},af(e)}function sA(){return sA=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?1:-1},Zl=function(t){return xu(t)&&t.indexOf("%")===t.length-1},Oe=function(t){return qH(t)&&!Hf(t)},IH=function(t){return Qe(t)},Jn=function(t){return Oe(t)||xu(t)},UH=0,Mu=function(t){var n=++UH;return"".concat(t||"").concat(n)},Su=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Oe(t)&&!xu(t))return r;var s;if(Zl(t)){var l=t.indexOf("%");s=n*parseFloat(t.slice(0,l))/100}else s=+t;return Hf(s)&&(s=r),i&&s>n&&(s=n),s},Fs=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},VH=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function QH(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Z_(e){"@babel/helpers - typeof";return Z_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z_(e)}var BP={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Bo=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},qP=null,p1=null,lT=function e(t){if(t===qP&&Array.isArray(p1))return p1;var n=[];return K.Children.forEach(t,function(r){Qe(r)||(LH.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),p1=n,qP=t,n};function ci(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return Bo(i)}):r=[Bo(t)],lT(e).forEach(function(i){var s=ia(i,"type.displayName")||ia(i,"type.name");r.indexOf(s)!==-1&&n.push(i)}),n}function Ti(e,t){var n=ci(e,t);return n&&n[0]}var IP=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!Oe(r)||r<=0||!Oe(i)||i<=0)},ZH=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],JH=function(t){return t&&t.type&&xu(t.type)&&ZH.indexOf(t.type)>=0},h$=function(t){return t&&Z_(t)==="object"&&"clipDot"in t},eF=function(t,n,r,i){var s,l=(s=h1==null?void 0:h1[i])!==null&&s!==void 0?s:[];return n.startsWith("data-")||!tt(t)&&(i&&l.includes(n)||KH.includes(n))||r&&sT.includes(n)},Je=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(K.isValidElement(t)&&(i=t.props),!Vf(i))return null;var s={};return Object.keys(i).forEach(function(l){var c;eF((c=i)===null||c===void 0?void 0:c[l],l,n,r)&&(s[l]=i[l])}),s},J_=function e(t,n){if(t===n)return!0;var r=K.Children.count(t);if(r!==K.Children.count(n))return!1;if(r===0)return!0;if(r===1)return UP(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function aF(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function tA(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,s=e.className,l=e.style,c=e.title,f=e.desc,d=iF(e,rF),m=i||{width:n,height:r,x:0,y:0},p=ut("recharts-surface",s);return Q.createElement("svg",eA({},Je(d,!0,"svg"),{className:p,width:n,height:r,style:l,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height)}),Q.createElement("title",null,c),Q.createElement("desc",null,f),t)}var oF=["children","className"];function nA(){return nA=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function lF(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Mt=Q.forwardRef(function(e,t){var n=e.children,r=e.className,i=sF(e,oF),s=ut("recharts-layer",r);return Q.createElement("g",nA({className:s},Je(i,!0),{ref:t}),n)}),qo=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;ss?0:s+n),r=r>s?s:r,r<0&&(r+=s),s=n>r?0:r-n>>>0,n>>>=0;for(var l=Array(s);++i=s?n:e(n,r,i)}return v1=t,v1}var y1,GP;function p$(){if(GP)return y1;GP=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,s="\\ufe0e\\ufe0f",l="\\u200d",c=RegExp("["+l+e+i+s+"]");function f(d){return c.test(d)}return y1=f,y1}var g1,KP;function fF(){if(KP)return g1;KP=1;function e(t){return t.split("")}return g1=e,g1}var b1,YP;function dF(){if(YP)return b1;YP=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,s="\\ufe0e\\ufe0f",l="["+e+"]",c="["+i+"]",f="\\ud83c[\\udffb-\\udfff]",d="(?:"+c+"|"+f+")",m="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",v="[\\ud800-\\udbff][\\udc00-\\udfff]",b="\\u200d",w=d+"?",S="["+s+"]?",x="(?:"+b+"(?:"+[m,p,v].join("|")+")"+S+w+")*",A=S+w+x,_="(?:"+[m+c+"?",c,p,v,l].join("|")+")",M=RegExp(f+"(?="+f+")|"+_+A,"g");function E(O){return O.match(M)||[]}return b1=E,b1}var x1,XP;function hF(){if(XP)return x1;XP=1;var e=fF(),t=p$(),n=dF();function r(i){return t(i)?n(i):e(i)}return x1=r,x1}var S1,WP;function pF(){if(WP)return S1;WP=1;var e=cF(),t=p$(),n=hF(),r=u$();function i(s){return function(l){l=r(l);var c=t(l)?n(l):void 0,f=c?c[0]:l.charAt(0),d=c?e(c,1).join(""):l.slice(1);return f[s]()+d}}return S1=i,S1}var w1,QP;function mF(){if(QP)return w1;QP=1;var e=pF(),t=e("toUpperCase");return w1=t,w1}var vF=mF();const pg=Ft(vF);function en(e){return function(){return e}}const m$=Math.cos,Jv=Math.sin,Ea=Math.sqrt,ey=Math.PI,mg=2*ey,rA=Math.PI,iA=2*rA,Hl=1e-6,yF=iA-Hl;function v$(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return v$;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;iHl)if(!(Math.abs(p*f-d*m)>Hl)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let b=r-l,w=i-c,S=f*f+d*d,x=b*b+w*w,A=Math.sqrt(S),_=Math.sqrt(v),M=s*Math.tan((rA-Math.acos((S+v-x)/(2*A*_)))/2),E=M/_,O=M/A;Math.abs(E-1)>Hl&&this._append`L${t+E*m},${n+E*p}`,this._append`A${s},${s},0,0,${+(p*b>m*w)},${this._x1=t+O*f},${this._y1=n+O*d}`}}arc(t,n,r,i,s,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(i),f=r*Math.sin(i),d=t+c,m=n+f,p=1^l,v=l?i-s:s-i;this._x1===null?this._append`M${d},${m}`:(Math.abs(this._x1-d)>Hl||Math.abs(this._y1-m)>Hl)&&this._append`L${d},${m}`,r&&(v<0&&(v=v%iA+iA),v>yF?this._append`A${r},${r},0,1,${p},${t-c},${n-f}A${r},${r},0,1,${p},${this._x1=d},${this._y1=m}`:v>Hl&&this._append`A${r},${r},0,${+(v>=rA)},${p},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function uT(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new bF(t)}function cT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function y$(e){this._context=e}y$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function vg(e){return new y$(e)}function g$(e){return e[0]}function b$(e){return e[1]}function x$(e,t){var n=en(!0),r=null,i=vg,s=null,l=uT(c);e=typeof e=="function"?e:e===void 0?g$:en(e),t=typeof t=="function"?t:t===void 0?b$:en(t);function c(f){var d,m=(f=cT(f)).length,p,v=!1,b;for(r==null&&(s=i(b=l())),d=0;d<=m;++d)!(d=b;--w)c.point(M[w],E[w]);c.lineEnd(),c.areaEnd()}A&&(M[v]=+e(x,v,p),E[v]=+t(x,v,p),c.point(r?+r(x,v,p):M[v],n?+n(x,v,p):E[v]))}if(_)return c=null,_+""||null}function m(){return x$().defined(i).curve(l).context(s)}return d.x=function(p){return arguments.length?(e=typeof p=="function"?p:en(+p),r=null,d):e},d.x0=function(p){return arguments.length?(e=typeof p=="function"?p:en(+p),d):e},d.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:en(+p),d):r},d.y=function(p){return arguments.length?(t=typeof p=="function"?p:en(+p),n=null,d):t},d.y0=function(p){return arguments.length?(t=typeof p=="function"?p:en(+p),d):t},d.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:en(+p),d):n},d.lineX0=d.lineY0=function(){return m().x(e).y(t)},d.lineY1=function(){return m().x(e).y(n)},d.lineX1=function(){return m().x(r).y(t)},d.defined=function(p){return arguments.length?(i=typeof p=="function"?p:en(!!p),d):i},d.curve=function(p){return arguments.length?(l=p,s!=null&&(c=l(s)),d):l},d.context=function(p){return arguments.length?(p==null?s=c=null:c=l(s=p),d):s},d}class S${constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function xF(e){return new S$(e,!0)}function SF(e){return new S$(e,!1)}const fT={draw(e,t){const n=Ea(t/ey);e.moveTo(n,0),e.arc(0,0,n,0,mg)}},wF={draw(e,t){const n=Ea(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},w$=Ea(1/3),_F=w$*2,AF={draw(e,t){const n=Ea(t/_F),r=n*w$;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},OF={draw(e,t){const n=Ea(t),r=-n/2;e.rect(r,r,n,n)}},TF=.8908130915292852,_$=Jv(ey/10)/Jv(7*ey/10),EF=Jv(mg/10)*_$,MF=-m$(mg/10)*_$,jF={draw(e,t){const n=Ea(t*TF),r=EF*n,i=MF*n;e.moveTo(0,-n),e.lineTo(r,i);for(let s=1;s<5;++s){const l=mg*s/5,c=m$(l),f=Jv(l);e.lineTo(f*n,-c*n),e.lineTo(c*r-f*i,f*r+c*i)}e.closePath()}},_1=Ea(3),CF={draw(e,t){const n=-Ea(t/(_1*3));e.moveTo(0,n*2),e.lineTo(-_1*n,-n),e.lineTo(_1*n,-n),e.closePath()}},Ki=-.5,Yi=Ea(3)/2,aA=1/Ea(12),PF=(aA/2+1)*3,DF={draw(e,t){const n=Ea(t/PF),r=n/2,i=n*aA,s=r,l=n*aA+n,c=-s,f=l;e.moveTo(r,i),e.lineTo(s,l),e.lineTo(c,f),e.lineTo(Ki*r-Yi*i,Yi*r+Ki*i),e.lineTo(Ki*s-Yi*l,Yi*s+Ki*l),e.lineTo(Ki*c-Yi*f,Yi*c+Ki*f),e.lineTo(Ki*r+Yi*i,Ki*i-Yi*r),e.lineTo(Ki*s+Yi*l,Ki*l-Yi*s),e.lineTo(Ki*c+Yi*f,Ki*f-Yi*c),e.closePath()}};function RF(e,t){let n=null,r=uT(i);e=typeof e=="function"?e:en(e||fT),t=typeof t=="function"?t:en(t===void 0?64:+t);function i(){let s;if(n||(n=s=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return i.type=function(s){return arguments.length?(e=typeof s=="function"?s:en(s),i):e},i.size=function(s){return arguments.length?(t=typeof s=="function"?s:en(+s),i):t},i.context=function(s){return arguments.length?(n=s??null,i):n},i}function ty(){}function ny(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function A$(e){this._context=e}A$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ny(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ny(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function NF(e){return new A$(e)}function O$(e){this._context=e}O$.prototype={areaStart:ty,areaEnd:ty,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ny(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function kF(e){return new O$(e)}function T$(e){this._context=e}T$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ny(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function LF(e){return new T$(e)}function E$(e){this._context=e}E$.prototype={areaStart:ty,areaEnd:ty,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function zF(e){return new E$(e)}function ZP(e){return e<0?-1:1}function JP(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),c=(s*i+l*r)/(r+i);return(ZP(s)+ZP(l))*Math.min(Math.abs(s),Math.abs(l),.5*Math.abs(c))||0}function eD(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function A1(e,t,n){var r=e._x0,i=e._y0,s=e._x1,l=e._y1,c=(s-r)/3;e._context.bezierCurveTo(r+c,i+c*t,s-c,l-c*n,s,l)}function ry(e){this._context=e}ry.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:A1(this,this._t0,eD(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,A1(this,eD(this,n=JP(this,e,t)),n);break;default:A1(this,this._t0,n=JP(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function M$(e){this._context=new j$(e)}(M$.prototype=Object.create(ry.prototype)).point=function(e,t){ry.prototype.point.call(this,t,e)};function j$(e){this._context=e}j$.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function $F(e){return new ry(e)}function BF(e){return new M$(e)}function C$(e){this._context=e}C$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=tD(e),i=tD(t),s=0,l=1;l=0;--t)i[t]=(l[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function IF(e){return new yg(e,.5)}function UF(e){return new yg(e,0)}function VF(e){return new yg(e,1)}function rf(e,t){if((l=e.length)>1)for(var n=1,r,i,s=e[t[0]],l,c=s.length;n=0;)n[t]=t;return n}function HF(e,t){return e[t]}function FF(e){const t=[];return t.key=e,t}function GF(){var e=en([]),t=oA,n=rf,r=HF;function i(s){var l=Array.from(e.apply(this,arguments),FF),c,f=l.length,d=-1,m;for(const p of s)for(c=0,++d;c0){for(var n,r,i=0,s=e[0].length,l;i0){for(var n=0,r=e[t[0]],i,s=r.length;n0)||!((s=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,s,l;r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function t9(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var P$={symbolCircle:fT,symbolCross:wF,symbolDiamond:AF,symbolSquare:OF,symbolStar:jF,symbolTriangle:CF,symbolWye:DF},n9=Math.PI/180,r9=function(t){var n="symbol".concat(pg(t));return P$[n]||fT},i9=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*n9;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},a9=function(t,n){P$["symbol".concat(pg(t))]=n},gg=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,s=i===void 0?64:i,l=t.sizeType,c=l===void 0?"area":l,f=e9(t,WF),d=rD(rD({},f),{},{type:r,size:s,sizeType:c}),m=function(){var x=r9(r),A=RF().type(x).size(i9(s,c,r));return A()},p=d.className,v=d.cx,b=d.cy,w=Je(d,!0);return v===+v&&b===+b&&s===+s?Q.createElement("path",sA({},w,{className:ut("recharts-symbols",p),transform:"translate(".concat(v,", ").concat(b,")"),d:m()})):null};gg.registerSymbol=a9;function af(e){"@babel/helpers - typeof";return af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},af(e)}function lA(){return lA=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var _=b.inactive?d:b.color;return Q.createElement("li",sA({className:x,style:p,key:"legend-item-".concat(w)},Vh(r.props,b,w)),Q.createElement(eA,{width:l,height:l,viewBox:m,style:v},r.renderIcon(b)),Q.createElement("span",{className:"recharts-legend-item-text",style:{color:_}},S?S(A,b,w):A))})}},{key:"render",value:function(){var r=this.props,i=r.payload,s=r.layout,l=r.align;if(!i||!i.length)return null;var c={padding:0,margin:0,textAlign:s==="horizontal"?l:"left"};return Q.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(K.PureComponent);Fh(fT,"displayName","Legend");Fh(fT,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var O1,iD;function u9(){if(iD)return O1;iD=1;var e=fg();function t(){this.__data__=new e,this.size=0}return O1=t,O1}var T1,aD;function c9(){if(aD)return T1;aD=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return T1=e,T1}var E1,oD;function f9(){if(oD)return E1;oD=1;function e(t){return this.__data__.get(t)}return E1=e,E1}var M1,sD;function d9(){if(sD)return M1;sD=1;function e(t){return this.__data__.has(t)}return M1=e,M1}var j1,lD;function h9(){if(lD)return j1;lD=1;var e=fg(),t=nT(),n=rT(),r=200;function i(s,l){var c=this.__data__;if(c instanceof e){var f=c.__data__;if(!t||f.lengthb))return!1;var S=p.get(l),x=p.get(c);if(S&&x)return S==c&&x==l;var A=-1,_=!0,M=f&i?new e:void 0;for(p.set(l,c),p.set(c,l);++A-1&&r%1==0&&r-1&&n%1==0&&n<=e}return Q1=t,Q1}var Z1,DD;function T9(){if(DD)return Z1;DD=1;var e=Jo(),t=mT(),n=es(),r="[object Arguments]",i="[object Array]",s="[object Boolean]",l="[object Date]",c="[object Error]",f="[object Function]",d="[object Map]",m="[object Number]",p="[object Object]",v="[object RegExp]",b="[object Set]",w="[object String]",S="[object WeakMap]",x="[object ArrayBuffer]",A="[object DataView]",_="[object Float32Array]",M="[object Float64Array]",E="[object Int8Array]",O="[object Int16Array]",j="[object Int32Array]",R="[object Uint8Array]",k="[object Uint8ClampedArray]",z="[object Uint16Array]",G="[object Uint32Array]",$={};$[_]=$[M]=$[E]=$[O]=$[j]=$[R]=$[k]=$[z]=$[G]=!0,$[r]=$[i]=$[x]=$[s]=$[A]=$[l]=$[c]=$[f]=$[d]=$[m]=$[p]=$[v]=$[b]=$[w]=$[S]=!1;function B(Z){return n(Z)&&t(Z.length)&&!!$[e(Z)]}return Z1=B,Z1}var J1,RD;function q$(){if(RD)return J1;RD=1;function e(t){return function(n){return t(n)}}return J1=e,J1}var bh={exports:{}};bh.exports;var ND;function E9(){return ND||(ND=1,(function(e,t){var n=a$(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===r,l=s&&n.process,c=(function(){try{var f=i&&i.require&&i.require("util").types;return f||l&&l.binding&&l.binding("util")}catch{}})();e.exports=c})(bh,bh.exports)),bh.exports}var eS,kD;function I$(){if(kD)return eS;kD=1;var e=T9(),t=q$(),n=E9(),r=n&&n.isTypedArray,i=r?t(r):e;return eS=i,eS}var tS,LD;function M9(){if(LD)return tS;LD=1;var e=_9(),t=hT(),n=fi(),r=B$(),i=pT(),s=I$(),l=Object.prototype,c=l.hasOwnProperty;function f(d,m){var p=n(d),v=!p&&t(d),b=!p&&!v&&r(d),w=!p&&!v&&!b&&s(d),S=p||v||b||w,x=S?e(d.length,String):[],A=x.length;for(var _ in d)(m||c.call(d,_))&&!(S&&(_=="length"||b&&(_=="offset"||_=="parent")||w&&(_=="buffer"||_=="byteLength"||_=="byteOffset")||i(_,A)))&&x.push(_);return x}return tS=f,tS}var nS,zD;function j9(){if(zD)return nS;zD=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||e;return n===i}return nS=t,nS}var rS,$D;function U$(){if($D)return rS;$D=1;function e(t,n){return function(r){return t(n(r))}}return rS=e,rS}var iS,BD;function P9(){if(BD)return iS;BD=1;var e=U$(),t=e(Object.keys,Object);return iS=t,iS}var aS,qD;function C9(){if(qD)return aS;qD=1;var e=j9(),t=P9(),n=Object.prototype,r=n.hasOwnProperty;function i(s){if(!e(s))return t(s);var l=[];for(var c in Object(s))r.call(s,c)&&c!="constructor"&&l.push(c);return l}return aS=i,aS}var oS,ID;function Lp(){if(ID)return oS;ID=1;var e=eT(),t=mT();function n(r){return r!=null&&t(r.length)&&!e(r)}return oS=n,oS}var sS,UD;function bg(){if(UD)return sS;UD=1;var e=M9(),t=C9(),n=Lp();function r(i){return n(i)?e(i):t(i)}return sS=r,sS}var lS,VD;function D9(){if(VD)return lS;VD=1;var e=b9(),t=w9(),n=bg();function r(i){return e(i,n,t)}return lS=r,lS}var uS,HD;function R9(){if(HD)return uS;HD=1;var e=D9(),t=1,n=Object.prototype,r=n.hasOwnProperty;function i(s,l,c,f,d,m){var p=c&t,v=e(s),b=v.length,w=e(l),S=w.length;if(b!=S&&!p)return!1;for(var x=b;x--;){var A=v[x];if(!(p?A in l:r.call(l,A)))return!1}var _=m.get(s),M=m.get(l);if(_&&M)return _==l&&M==s;var E=!0;m.set(s,l),m.set(l,s);for(var O=p;++x-1}return kS=t,kS}var LS,yR;function J9(){if(yR)return LS;yR=1;function e(t,n,r){for(var i=-1,s=t==null?0:t.length;++i=l){var A=d?null:i(f);if(A)return s(A);w=!1,v=r,x=new e}else x=d?[]:S;e:for(;++p=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function p7(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function m7(e){return e.value}function v7(e,t){if(Q.isValidElement(e))return Q.cloneElement(e,t);if(typeof e=="function")return Q.createElement(e,t);t.ref;var n=h7(t,a7);return Q.createElement(fT,n)}var OR=1,Bc=(function(e){function t(){var n;o7(this,t);for(var r=arguments.length,i=new Array(r),s=0;sOR||Math.abs(i.height-this.lastBoundingBox.height)>OR)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Po({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,s=i.layout,l=i.align,c=i.verticalAlign,f=i.margin,d=i.chartWidth,m=i.chartHeight,p,v;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(l==="center"&&s==="vertical"){var b=this.getBBoxSnapshot();p={left:((d||0)-b.width)/2}}else p=l==="right"?{right:f&&f.right||0}:{left:f&&f.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(c==="middle"){var w=this.getBBoxSnapshot();v={top:((m||0)-w.height)/2}}else v=c==="bottom"?{bottom:f&&f.bottom||0}:{top:f&&f.top||0};return Po(Po({},p),v)}},{key:"render",value:function(){var r=this,i=this.props,s=i.content,l=i.width,c=i.height,f=i.wrapperStyle,d=i.payloadUniqBy,m=i.payload,p=Po(Po({position:"absolute",width:l||"auto",height:c||"auto"},this.getDefaultPosition(f)),f);return Q.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(b){r.wrapperNode=b}},v7(s,Po(Po({},this.props),{},{payload:K$(m,d,m7)})))}}],[{key:"getWithHeight",value:function(r,i){var s=Po(Po({},this.defaultProps),r.props),l=s.layout;return l==="vertical"&&Oe(r.props.height)?{height:r.props.height}:l==="horizontal"?{width:r.props.width||i}:null}}])})(K.PureComponent);xg(Bc,"displayName","Legend");xg(Bc,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var IS,TR;function y7(){if(TR)return IS;TR=1;var e=kp(),t=hT(),n=fi(),r=e?e.isConcatSpreadable:void 0;function i(s){return n(s)||t(s)||!!(r&&s&&s[r])}return IS=i,IS}var US,ER;function W$(){if(ER)return US;ER=1;var e=$$(),t=y7();function n(r,i,s,l,c){var f=-1,d=r.length;for(s||(s=t),c||(c=[]);++f0&&s(m)?i>1?n(m,i-1,s,l,c):e(c,m):l||(c[c.length]=m)}return c}return US=n,US}var VS,MR;function g7(){if(MR)return VS;MR=1;function e(t){return function(n,r,i){for(var s=-1,l=Object(n),c=i(n),f=c.length;f--;){var d=c[t?f:++s];if(r(l[d],d,l)===!1)break}return n}}return VS=e,VS}var HS,jR;function b7(){if(jR)return HS;jR=1;var e=g7(),t=e();return HS=t,HS}var FS,PR;function Q$(){if(PR)return FS;PR=1;var e=b7(),t=bg();function n(r,i){return r&&e(r,i,t)}return FS=n,FS}var GS,CR;function x7(){if(CR)return GS;CR=1;var e=Lp();function t(n,r){return function(i,s){if(i==null)return i;if(!e(i))return n(i,s);for(var l=i.length,c=r?l:-1,f=Object(i);(r?c--:++cr||c&&f&&m&&!d&&!p||s&&f&&m||!i&&m||!l)return 1;if(!s&&!c&&!p&&n=d)return m;var p=i[s];return m*(p=="desc"?-1:1)}}return n.index-r.index}return QS=t,QS}var ZS,zR;function A7(){if(zR)return ZS;zR=1;var e=iT(),t=aT(),n=ul(),r=Z$(),i=S7(),s=q$(),l=_7(),c=Ff(),f=fi();function d(m,p,v){p.length?p=e(p,function(S){return f(S)?function(x){return t(x,S.length===1?S[0]:S)}:S}):p=[c];var b=-1;p=e(p,s(n));var w=r(m,function(S,x,A){var _=e(p,function(M){return M(S)});return{criteria:_,index:++b,value:S}});return i(w,function(S,x){return l(S,x,v)})}return ZS=d,ZS}var JS,$R;function O7(){if($R)return JS;$R=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return JS=e,JS}var ew,BR;function T7(){if(BR)return ew;BR=1;var e=O7(),t=Math.max;function n(r,i,s){return i=t(i===void 0?r.length-1:i,0),function(){for(var l=arguments,c=-1,f=t(l.length-i,0),d=Array(f);++c0){if(++s>=e)return arguments[0]}else s=0;return i.apply(void 0,arguments)}}return iw=r,iw}var aw,HR;function P7(){if(HR)return aw;HR=1;var e=M7(),t=j7(),n=t(e);return aw=n,aw}var ow,FR;function C7(){if(FR)return ow;FR=1;var e=Ff(),t=T7(),n=P7();function r(i,s){return n(t(i,s,e),i+"")}return ow=r,ow}var sw,GR;function Sg(){if(GR)return sw;GR=1;var e=tT(),t=Lp(),n=pT(),r=ll();function i(s,l,c){if(!r(c))return!1;var f=typeof l;return(f=="number"?t(c)&&n(l,c.length):f=="string"&&l in c)?e(c[l],s):!1}return sw=i,sw}var lw,KR;function D7(){if(KR)return lw;KR=1;var e=W$(),t=A7(),n=C7(),r=Sg(),i=n(function(s,l){if(s==null)return[];var c=l.length;return c>1&&r(s,l[0],l[1])?l=[]:c>2&&r(l[0],l[1],l[2])&&(l=[l[0]]),t(s,e(l,1),[])});return lw=i,lw}var R7=D7();const gT=Ft(R7);function Gh(e){"@babel/helpers - typeof";return Gh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gh(e)}function cA(){return cA=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.x),"".concat(ah,"-left"),Oe(n)&&t&&Oe(t.x)&&n=t.y),"".concat(ah,"-top"),Oe(r)&&t&&Oe(t.y)&&rS?Math.max(m,f[r]):Math.max(p,f[r])}function Y7(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function X7(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,s=e.reverseDirection,l=e.tooltipBox,c=e.useTranslate3d,f=e.viewBox,d,m,p;return l.height>0&&l.width>0&&n?(m=WR({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:s,tooltipDimension:l.width,viewBox:f,viewBoxDimension:f.width}),p=WR({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:s,tooltipDimension:l.height,viewBox:f,viewBoxDimension:f.height}),d=Y7({translateX:m,translateY:p,useTranslate3d:c})):d=G7,{cssProperties:d,cssClasses:K7({translateX:m,translateY:p,coordinate:n})}}function sf(e){"@babel/helpers - typeof";return sf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sf(e)}function QR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ZR(e){for(var t=1;tJR||Math.abs(r.height-this.state.lastBoundingBox.height)>JR)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,s=i.active,l=i.allowEscapeViewBox,c=i.animationDuration,f=i.animationEasing,d=i.children,m=i.coordinate,p=i.hasPayload,v=i.isAnimationActive,b=i.offset,w=i.position,S=i.reverseDirection,x=i.useTranslate3d,A=i.viewBox,_=i.wrapperStyle,M=X7({allowEscapeViewBox:l,coordinate:m,offsetTopLeft:b,position:w,reverseDirection:S,tooltipBox:this.state.lastBoundingBox,useTranslate3d:x,viewBox:A}),E=M.cssClasses,O=M.cssProperties,j=ZR(ZR({transition:v&&s?"transform ".concat(c,"ms ").concat(f):void 0},O),{},{pointerEvents:"none",visibility:!this.state.dismissed&&s&&p?"visible":"hidden",position:"absolute",top:0,left:0},_);return Q.createElement("div",{tabIndex:-1,className:E,style:j,ref:function(k){r.wrapperNode=k}},d)}}])})(K.PureComponent),aG=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},cl={isSsr:aG()};function lf(e){"@babel/helpers - typeof";return lf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lf(e)}function eN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tN(e){for(var t=1;t0;return Q.createElement(iG,{allowEscapeViewBox:l,animationDuration:c,animationEasing:f,isAnimationActive:v,active:s,coordinate:m,hasPayload:j,offset:b,position:x,reverseDirection:A,useTranslate3d:_,viewBox:M,wrapperStyle:E},mG(d,tN(tN({},this.props),{},{payload:O})))}}])})(K.PureComponent);bT(ji,"displayName","Tooltip");bT(ji,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!cl.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var cw,nN;function vG(){if(nN)return cw;nN=1;var e=to(),t=function(){return e.Date.now()};return cw=t,cw}var fw,rN;function yG(){if(rN)return fw;rN=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return fw=t,fw}var dw,iN;function gG(){if(iN)return dw;iN=1;var e=yG(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return dw=n,dw}var hw,aN;function iB(){if(aN)return hw;aN=1;var e=gG(),t=ll(),n=Uf(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;function f(d){if(typeof d=="number")return d;if(n(d))return r;if(t(d)){var m=typeof d.valueOf=="function"?d.valueOf():d;d=t(m)?m+"":m}if(typeof d!="string")return d===0?d:+d;d=e(d);var p=s.test(d);return p||l.test(d)?c(d.slice(2),p?2:8):i.test(d)?r:+d}return hw=f,hw}var pw,oN;function bG(){if(oN)return pw;oN=1;var e=ll(),t=vG(),n=iB(),r="Expected a function",i=Math.max,s=Math.min;function l(c,f,d){var m,p,v,b,w,S,x=0,A=!1,_=!1,M=!0;if(typeof c!="function")throw new TypeError(r);f=n(f)||0,e(d)&&(A=!!d.leading,_="maxWait"in d,v=_?i(n(d.maxWait)||0,f):v,M="trailing"in d?!!d.trailing:M);function E(Z){var ee=m,J=p;return m=p=void 0,x=Z,b=c.apply(J,ee),b}function O(Z){return x=Z,w=setTimeout(k,f),A?E(Z):b}function j(Z){var ee=Z-S,J=Z-x,q=f-ee;return _?s(q,v-J):q}function R(Z){var ee=Z-S,J=Z-x;return S===void 0||ee>=f||ee<0||_&&J>=v}function k(){var Z=t();if(R(Z))return z(Z);w=setTimeout(k,j(Z))}function z(Z){return w=void 0,M&&m?E(Z):(m=p=void 0,b)}function G(){w!==void 0&&clearTimeout(w),x=0,m=S=p=w=void 0}function $(){return w===void 0?b:z(t())}function B(){var Z=t(),ee=R(Z);if(m=arguments,p=this,S=Z,ee){if(w===void 0)return O(S);if(_)return clearTimeout(w),w=setTimeout(k,f),E(S)}return w===void 0&&(w=setTimeout(k,f)),b}return B.cancel=G,B.flush=$,B}return pw=l,pw}var mw,sN;function xG(){if(sN)return mw;sN=1;var e=bG(),t=ll(),n="Expected a function";function r(i,s,l){var c=!0,f=!0;if(typeof i!="function")throw new TypeError(n);return t(l)&&(c="leading"in l?!!l.leading:c,f="trailing"in l?!!l.trailing:f),e(i,s,{leading:c,maxWait:s,trailing:f})}return mw=r,mw}var SG=xG();const aB=Ft(SG);function Yh(e){"@babel/helpers - typeof";return Yh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yh(e)}function lN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xv(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(Z=aB(Z,S,{trailing:!0,leading:!1}));var ee=new ResizeObserver(Z),J=O.current.getBoundingClientRect(),q=J.width,F=J.height;return $(q,F),ee.observe(O.current),function(){ee.disconnect()}},[$,S]);var B=K.useMemo(function(){var Z=z.containerWidth,ee=z.containerHeight;if(Z<0||ee<0)return null;qo(Zl(l)||Zl(f),`The width(%s) and height(%s) are both fixed numbers, + A`).concat(l,",").concat(l,",0,1,1,").concat(c,",").concat(s),className:"recharts-legend-icon"});if(r.type==="rect")return Q.createElement("path",{stroke:"none",fill:f,d:"M0,".concat(Xi/8,"h").concat(Xi,"v").concat(Xi*3/4,"h").concat(-Xi,"z"),className:"recharts-legend-icon"});if(Q.isValidElement(r.legendIcon)){var d=o9({},r);return delete d.legendIcon,Q.cloneElement(r.legendIcon,d)}return Q.createElement(gg,{fill:f,cx:s,cy:s,size:Xi,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,s=i.payload,l=i.iconSize,c=i.layout,f=i.formatter,d=i.inactiveColor,m={x:0,y:0,width:Xi,height:Xi},p={display:c==="horizontal"?"inline-block":"block",marginRight:10},v={display:"inline-block",verticalAlign:"middle",marginRight:4};return s.map(function(b,w){var S=b.formatter||f,x=ut(Fh(Fh({"recharts-legend-item":!0},"legend-item-".concat(w),!0),"inactive",b.inactive));if(b.type==="none")return null;var A=tt(b.value)?null:b.value;qo(!tt(b.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: `);var _=b.inactive?d:b.color;return Q.createElement("li",lA({className:x,style:p,key:"legend-item-".concat(w)},Vh(r.props,b,w)),Q.createElement(tA,{width:l,height:l,viewBox:m,style:v},r.renderIcon(b)),Q.createElement("span",{className:"recharts-legend-item-text",style:{color:_}},S?S(A,b,w):A))})}},{key:"render",value:function(){var r=this.props,i=r.payload,s=r.layout,l=r.align;if(!i||!i.length)return null;var c={padding:0,margin:0,textAlign:s==="horizontal"?l:"left"};return Q.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(K.PureComponent);Fh(dT,"displayName","Legend");Fh(dT,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var O1,aD;function m9(){if(aD)return O1;aD=1;var e=fg();function t(){this.__data__=new e,this.size=0}return O1=t,O1}var T1,oD;function v9(){if(oD)return T1;oD=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return T1=e,T1}var E1,sD;function y9(){if(sD)return E1;sD=1;function e(t){return this.__data__.get(t)}return E1=e,E1}var M1,lD;function g9(){if(lD)return M1;lD=1;function e(t){return this.__data__.has(t)}return M1=e,M1}var j1,uD;function b9(){if(uD)return j1;uD=1;var e=fg(),t=rT(),n=iT(),r=200;function i(s,l){var c=this.__data__;if(c instanceof e){var f=c.__data__;if(!t||f.lengthb))return!1;var S=p.get(l),x=p.get(c);if(S&&x)return S==c&&x==l;var A=-1,_=!0,M=f&i?new e:void 0;for(p.set(l,c),p.set(c,l);++A-1&&r%1==0&&r-1&&n%1==0&&n<=e}return Q1=t,Q1}var Z1,RD;function D9(){if(RD)return Z1;RD=1;var e=Jo(),t=vT(),n=es(),r="[object Arguments]",i="[object Array]",s="[object Boolean]",l="[object Date]",c="[object Error]",f="[object Function]",d="[object Map]",m="[object Number]",p="[object Object]",v="[object RegExp]",b="[object Set]",w="[object String]",S="[object WeakMap]",x="[object ArrayBuffer]",A="[object DataView]",_="[object Float32Array]",M="[object Float64Array]",E="[object Int8Array]",O="[object Int16Array]",j="[object Int32Array]",R="[object Uint8Array]",k="[object Uint8ClampedArray]",z="[object Uint16Array]",G="[object Uint32Array]",$={};$[_]=$[M]=$[E]=$[O]=$[j]=$[R]=$[k]=$[z]=$[G]=!0,$[r]=$[i]=$[x]=$[s]=$[A]=$[l]=$[c]=$[f]=$[d]=$[m]=$[p]=$[v]=$[b]=$[w]=$[S]=!1;function B(Z){return n(Z)&&t(Z.length)&&!!$[e(Z)]}return Z1=B,Z1}var J1,ND;function I$(){if(ND)return J1;ND=1;function e(t){return function(n){return t(n)}}return J1=e,J1}var bh={exports:{}};bh.exports;var kD;function R9(){return kD||(kD=1,(function(e,t){var n=o$(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===r,l=s&&n.process,c=(function(){try{var f=i&&i.require&&i.require("util").types;return f||l&&l.binding&&l.binding("util")}catch{}})();e.exports=c})(bh,bh.exports)),bh.exports}var eS,LD;function U$(){if(LD)return eS;LD=1;var e=D9(),t=I$(),n=R9(),r=n&&n.isTypedArray,i=r?t(r):e;return eS=i,eS}var tS,zD;function N9(){if(zD)return tS;zD=1;var e=j9(),t=pT(),n=fi(),r=q$(),i=mT(),s=U$(),l=Object.prototype,c=l.hasOwnProperty;function f(d,m){var p=n(d),v=!p&&t(d),b=!p&&!v&&r(d),w=!p&&!v&&!b&&s(d),S=p||v||b||w,x=S?e(d.length,String):[],A=x.length;for(var _ in d)(m||c.call(d,_))&&!(S&&(_=="length"||b&&(_=="offset"||_=="parent")||w&&(_=="buffer"||_=="byteLength"||_=="byteOffset")||i(_,A)))&&x.push(_);return x}return tS=f,tS}var nS,$D;function k9(){if($D)return nS;$D=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||e;return n===i}return nS=t,nS}var rS,BD;function V$(){if(BD)return rS;BD=1;function e(t,n){return function(r){return t(n(r))}}return rS=e,rS}var iS,qD;function L9(){if(qD)return iS;qD=1;var e=V$(),t=e(Object.keys,Object);return iS=t,iS}var aS,ID;function z9(){if(ID)return aS;ID=1;var e=k9(),t=L9(),n=Object.prototype,r=n.hasOwnProperty;function i(s){if(!e(s))return t(s);var l=[];for(var c in Object(s))r.call(s,c)&&c!="constructor"&&l.push(c);return l}return aS=i,aS}var oS,UD;function Lp(){if(UD)return oS;UD=1;var e=tT(),t=vT();function n(r){return r!=null&&t(r.length)&&!e(r)}return oS=n,oS}var sS,VD;function bg(){if(VD)return sS;VD=1;var e=N9(),t=z9(),n=Lp();function r(i){return n(i)?e(i):t(i)}return sS=r,sS}var lS,HD;function $9(){if(HD)return lS;HD=1;var e=O9(),t=M9(),n=bg();function r(i){return e(i,n,t)}return lS=r,lS}var uS,FD;function B9(){if(FD)return uS;FD=1;var e=$9(),t=1,n=Object.prototype,r=n.hasOwnProperty;function i(s,l,c,f,d,m){var p=c&t,v=e(s),b=v.length,w=e(l),S=w.length;if(b!=S&&!p)return!1;for(var x=b;x--;){var A=v[x];if(!(p?A in l:r.call(l,A)))return!1}var _=m.get(s),M=m.get(l);if(_&&M)return _==l&&M==s;var E=!0;m.set(s,l),m.set(l,s);for(var O=p;++x-1}return kS=t,kS}var LS,gR;function a7(){if(gR)return LS;gR=1;function e(t,n,r){for(var i=-1,s=t==null?0:t.length;++i=l){var A=d?null:i(f);if(A)return s(A);w=!1,v=r,x=new e}else x=d?[]:S;e:for(;++p=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function x7(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function S7(e){return e.value}function w7(e,t){if(Q.isValidElement(e))return Q.cloneElement(e,t);if(typeof e=="function")return Q.createElement(e,t);t.ref;var n=b7(t,f7);return Q.createElement(dT,n)}var TR=1,Bc=(function(e){function t(){var n;d7(this,t);for(var r=arguments.length,i=new Array(r),s=0;sTR||Math.abs(i.height-this.lastBoundingBox.height)>TR)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Co({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,s=i.layout,l=i.align,c=i.verticalAlign,f=i.margin,d=i.chartWidth,m=i.chartHeight,p,v;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(l==="center"&&s==="vertical"){var b=this.getBBoxSnapshot();p={left:((d||0)-b.width)/2}}else p=l==="right"?{right:f&&f.right||0}:{left:f&&f.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(c==="middle"){var w=this.getBBoxSnapshot();v={top:((m||0)-w.height)/2}}else v=c==="bottom"?{bottom:f&&f.bottom||0}:{top:f&&f.top||0};return Co(Co({},p),v)}},{key:"render",value:function(){var r=this,i=this.props,s=i.content,l=i.width,c=i.height,f=i.wrapperStyle,d=i.payloadUniqBy,m=i.payload,p=Co(Co({position:"absolute",width:l||"auto",height:c||"auto"},this.getDefaultPosition(f)),f);return Q.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(b){r.wrapperNode=b}},w7(s,Co(Co({},this.props),{},{payload:Y$(m,d,S7)})))}}],[{key:"getWithHeight",value:function(r,i){var s=Co(Co({},this.defaultProps),r.props),l=s.layout;return l==="vertical"&&Oe(r.props.height)?{height:r.props.height}:l==="horizontal"?{width:r.props.width||i}:null}}])})(K.PureComponent);xg(Bc,"displayName","Legend");xg(Bc,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var IS,ER;function _7(){if(ER)return IS;ER=1;var e=kp(),t=pT(),n=fi(),r=e?e.isConcatSpreadable:void 0;function i(s){return n(s)||t(s)||!!(r&&s&&s[r])}return IS=i,IS}var US,MR;function Q$(){if(MR)return US;MR=1;var e=B$(),t=_7();function n(r,i,s,l,c){var f=-1,d=r.length;for(s||(s=t),c||(c=[]);++f0&&s(m)?i>1?n(m,i-1,s,l,c):e(c,m):l||(c[c.length]=m)}return c}return US=n,US}var VS,jR;function A7(){if(jR)return VS;jR=1;function e(t){return function(n,r,i){for(var s=-1,l=Object(n),c=i(n),f=c.length;f--;){var d=c[t?f:++s];if(r(l[d],d,l)===!1)break}return n}}return VS=e,VS}var HS,CR;function O7(){if(CR)return HS;CR=1;var e=A7(),t=e();return HS=t,HS}var FS,PR;function Z$(){if(PR)return FS;PR=1;var e=O7(),t=bg();function n(r,i){return r&&e(r,i,t)}return FS=n,FS}var GS,DR;function T7(){if(DR)return GS;DR=1;var e=Lp();function t(n,r){return function(i,s){if(i==null)return i;if(!e(i))return n(i,s);for(var l=i.length,c=r?l:-1,f=Object(i);(r?c--:++cr||c&&f&&m&&!d&&!p||s&&f&&m||!i&&m||!l)return 1;if(!s&&!c&&!p&&n=d)return m;var p=i[s];return m*(p=="desc"?-1:1)}}return n.index-r.index}return QS=t,QS}var ZS,$R;function C7(){if($R)return ZS;$R=1;var e=aT(),t=oT(),n=ul(),r=J$(),i=E7(),s=I$(),l=j7(),c=Ff(),f=fi();function d(m,p,v){p.length?p=e(p,function(S){return f(S)?function(x){return t(x,S.length===1?S[0]:S)}:S}):p=[c];var b=-1;p=e(p,s(n));var w=r(m,function(S,x,A){var _=e(p,function(M){return M(S)});return{criteria:_,index:++b,value:S}});return i(w,function(S,x){return l(S,x,v)})}return ZS=d,ZS}var JS,BR;function P7(){if(BR)return JS;BR=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return JS=e,JS}var ew,qR;function D7(){if(qR)return ew;qR=1;var e=P7(),t=Math.max;function n(r,i,s){return i=t(i===void 0?r.length-1:i,0),function(){for(var l=arguments,c=-1,f=t(l.length-i,0),d=Array(f);++c0){if(++s>=e)return arguments[0]}else s=0;return i.apply(void 0,arguments)}}return iw=r,iw}var aw,FR;function L7(){if(FR)return aw;FR=1;var e=N7(),t=k7(),n=t(e);return aw=n,aw}var ow,GR;function z7(){if(GR)return ow;GR=1;var e=Ff(),t=D7(),n=L7();function r(i,s){return n(t(i,s,e),i+"")}return ow=r,ow}var sw,KR;function Sg(){if(KR)return sw;KR=1;var e=nT(),t=Lp(),n=mT(),r=ll();function i(s,l,c){if(!r(c))return!1;var f=typeof l;return(f=="number"?t(c)&&n(l,c.length):f=="string"&&l in c)?e(c[l],s):!1}return sw=i,sw}var lw,YR;function $7(){if(YR)return lw;YR=1;var e=Q$(),t=C7(),n=z7(),r=Sg(),i=n(function(s,l){if(s==null)return[];var c=l.length;return c>1&&r(s,l[0],l[1])?l=[]:c>2&&r(l[0],l[1],l[2])&&(l=[l[0]]),t(s,e(l,1),[])});return lw=i,lw}var B7=$7();const bT=Ft(B7);function Gh(e){"@babel/helpers - typeof";return Gh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gh(e)}function fA(){return fA=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.x),"".concat(ah,"-left"),Oe(n)&&t&&Oe(t.x)&&n=t.y),"".concat(ah,"-top"),Oe(r)&&t&&Oe(t.y)&&rS?Math.max(m,f[r]):Math.max(p,f[r])}function eG(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function tG(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,s=e.reverseDirection,l=e.tooltipBox,c=e.useTranslate3d,f=e.viewBox,d,m,p;return l.height>0&&l.width>0&&n?(m=QR({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:s,tooltipDimension:l.width,viewBox:f,viewBoxDimension:f.width}),p=QR({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:s,tooltipDimension:l.height,viewBox:f,viewBoxDimension:f.height}),d=eG({translateX:m,translateY:p,useTranslate3d:c})):d=Z7,{cssProperties:d,cssClasses:J7({translateX:m,translateY:p,coordinate:n})}}function sf(e){"@babel/helpers - typeof";return sf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sf(e)}function ZR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function JR(e){for(var t=1;teN||Math.abs(r.height-this.state.lastBoundingBox.height)>eN)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,s=i.active,l=i.allowEscapeViewBox,c=i.animationDuration,f=i.animationEasing,d=i.children,m=i.coordinate,p=i.hasPayload,v=i.isAnimationActive,b=i.offset,w=i.position,S=i.reverseDirection,x=i.useTranslate3d,A=i.viewBox,_=i.wrapperStyle,M=tG({allowEscapeViewBox:l,coordinate:m,offsetTopLeft:b,position:w,reverseDirection:S,tooltipBox:this.state.lastBoundingBox,useTranslate3d:x,viewBox:A}),E=M.cssClasses,O=M.cssProperties,j=JR(JR({transition:v&&s?"transform ".concat(c,"ms ").concat(f):void 0},O),{},{pointerEvents:"none",visibility:!this.state.dismissed&&s&&p?"visible":"hidden",position:"absolute",top:0,left:0},_);return Q.createElement("div",{tabIndex:-1,className:E,style:j,ref:function(k){r.wrapperNode=k}},d)}}])})(K.PureComponent),fG=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},cl={isSsr:fG()};function lf(e){"@babel/helpers - typeof";return lf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lf(e)}function tN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nN(e){for(var t=1;t0;return Q.createElement(cG,{allowEscapeViewBox:l,animationDuration:c,animationEasing:f,isAnimationActive:v,active:s,coordinate:m,hasPayload:j,offset:b,position:x,reverseDirection:A,useTranslate3d:_,viewBox:M,wrapperStyle:E},SG(d,nN(nN({},this.props),{},{payload:O})))}}])})(K.PureComponent);xT(ji,"displayName","Tooltip");xT(ji,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!cl.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var cw,rN;function wG(){if(rN)return cw;rN=1;var e=to(),t=function(){return e.Date.now()};return cw=t,cw}var fw,iN;function _G(){if(iN)return fw;iN=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return fw=t,fw}var dw,aN;function AG(){if(aN)return dw;aN=1;var e=_G(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return dw=n,dw}var hw,oN;function aB(){if(oN)return hw;oN=1;var e=AG(),t=ll(),n=Uf(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;function f(d){if(typeof d=="number")return d;if(n(d))return r;if(t(d)){var m=typeof d.valueOf=="function"?d.valueOf():d;d=t(m)?m+"":m}if(typeof d!="string")return d===0?d:+d;d=e(d);var p=s.test(d);return p||l.test(d)?c(d.slice(2),p?2:8):i.test(d)?r:+d}return hw=f,hw}var pw,sN;function OG(){if(sN)return pw;sN=1;var e=ll(),t=wG(),n=aB(),r="Expected a function",i=Math.max,s=Math.min;function l(c,f,d){var m,p,v,b,w,S,x=0,A=!1,_=!1,M=!0;if(typeof c!="function")throw new TypeError(r);f=n(f)||0,e(d)&&(A=!!d.leading,_="maxWait"in d,v=_?i(n(d.maxWait)||0,f):v,M="trailing"in d?!!d.trailing:M);function E(Z){var ee=m,J=p;return m=p=void 0,x=Z,b=c.apply(J,ee),b}function O(Z){return x=Z,w=setTimeout(k,f),A?E(Z):b}function j(Z){var ee=Z-S,J=Z-x,q=f-ee;return _?s(q,v-J):q}function R(Z){var ee=Z-S,J=Z-x;return S===void 0||ee>=f||ee<0||_&&J>=v}function k(){var Z=t();if(R(Z))return z(Z);w=setTimeout(k,j(Z))}function z(Z){return w=void 0,M&&m?E(Z):(m=p=void 0,b)}function G(){w!==void 0&&clearTimeout(w),x=0,m=S=p=w=void 0}function $(){return w===void 0?b:z(t())}function B(){var Z=t(),ee=R(Z);if(m=arguments,p=this,S=Z,ee){if(w===void 0)return O(S);if(_)return clearTimeout(w),w=setTimeout(k,f),E(S)}return w===void 0&&(w=setTimeout(k,f)),b}return B.cancel=G,B.flush=$,B}return pw=l,pw}var mw,lN;function TG(){if(lN)return mw;lN=1;var e=OG(),t=ll(),n="Expected a function";function r(i,s,l){var c=!0,f=!0;if(typeof i!="function")throw new TypeError(n);return t(l)&&(c="leading"in l?!!l.leading:c,f="trailing"in l?!!l.trailing:f),e(i,s,{leading:c,maxWait:s,trailing:f})}return mw=r,mw}var EG=TG();const oB=Ft(EG);function Yh(e){"@babel/helpers - typeof";return Yh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yh(e)}function uN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xv(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(Z=oB(Z,S,{trailing:!0,leading:!1}));var ee=new ResizeObserver(Z),J=O.current.getBoundingClientRect(),q=J.width,F=J.height;return $(q,F),ee.observe(O.current),function(){ee.disconnect()}},[$,S]);var B=K.useMemo(function(){var Z=z.containerWidth,ee=z.containerHeight;if(Z<0||ee<0)return null;qo(Zl(l)||Zl(f),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,l,f),qo(!n||n>0,"The aspect(%s) must be greater than zero.",n);var J=Zl(l)?Z:l,q=Zl(f)?ee:f;n&&n>0&&(J?q=J/n:q&&(J=q*n),v&&q>v&&(q=v)),qo(J>0||q>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,J,q,l,f,m,p,n);var F=!Array.isArray(b)&&Bo(b.type).endsWith("Chart");return Q.Children.map(b,function(ie){return Q.isValidElement(ie)?K.cloneElement(ie,xv({width:J,height:q},F?{style:xv({height:"100%",width:"100%",maxHeight:q,maxWidth:J},ie.props.style)}:{})):ie})},[n,b,f,v,p,m,z,l]);return Q.createElement("div",{id:x?"".concat(x):void 0,className:ut("recharts-responsive-container",A),style:xv(xv({},E),{},{width:l,height:f,minWidth:m,minHeight:p,maxHeight:v}),ref:O},B)}),xT=function(t){return null};xT.displayName="Cell";function Xh(e){"@babel/helpers - typeof";return Xh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xh(e)}function cN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pA(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||cl.isSsr)return{width:0,height:0};var r=kG(n),i=JSON.stringify({text:t,copyStyle:r});if(Sc.widthCache[i])return Sc.widthCache[i];try{var s=document.getElementById(fN);s||(s=document.createElement("span"),s.setAttribute("id",fN),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var l=pA(pA({},NG),r);Object.assign(s.style,l),s.textContent="".concat(t);var c=s.getBoundingClientRect(),f={width:c.width,height:c.height};return Sc.widthCache[i]=f,++Sc.cacheCount>RG&&(Sc.cacheCount=0,Sc.widthCache={}),f}catch{return{width:0,height:0}}},LG=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Wh(e){"@babel/helpers - typeof";return Wh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wh(e)}function ly(e,t){return qG(e)||BG(e,t)||$G(e,t)||zG()}function zG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $G(e,t){if(e){if(typeof e=="string")return dN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dN(e,t)}}function dN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function eK(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function gN(e,t){return iK(e)||rK(e,t)||nK(e,t)||tK()}function tK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nK(e,t){if(e){if(typeof e=="string")return bN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bN(e,t)}}function bN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[];return J.reduce(function(q,F){var ie=F.word,ce=F.width,U=q[q.length-1];if(U&&(i==null||s||U.width+ce+rF.width?q:F})};if(!m)return b;for(var S="…",x=function(J){var q=p.slice(0,J),F=uB({breakAll:d,style:f,children:q+S}).wordsWithComputedWidth,ie=v(F),ce=ie.length>l||w(ie).width>Number(i);return[ce,ie]},A=0,_=p.length-1,M=0,E;A<=_&&M<=p.length-1;){var O=Math.floor((A+_)/2),j=O-1,R=x(j),k=gN(R,2),z=k[0],G=k[1],$=x(O),B=gN($,1),Z=B[0];if(!z&&!Z&&(A=O+1),z&&Z&&(_=O-1),!z&&Z){E=G;break}M++}return E||b},xN=function(t){var n=Qe(t)?[]:t.toString().split(lB);return[{words:n}]},oK=function(t){var n=t.width,r=t.scaleToFit,i=t.children,s=t.style,l=t.breakAll,c=t.maxLines;if((n||r)&&!cl.isSsr){var f,d,m=uB({breakAll:l,children:i,style:s});if(m){var p=m.wordsWithComputedWidth,v=m.spaceWidth;f=p,d=v}else return xN(i);return aK({breakAll:l,children:i,maxLines:c,style:s},f,d,n,r)}return xN(i)},SN="#808080",uy=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,s=i===void 0?0:i,l=t.lineHeight,c=l===void 0?"1em":l,f=t.capHeight,d=f===void 0?"0.71em":f,m=t.scaleToFit,p=m===void 0?!1:m,v=t.textAnchor,b=v===void 0?"start":v,w=t.verticalAnchor,S=w===void 0?"end":w,x=t.fill,A=x===void 0?SN:x,_=yN(t,ZG),M=K.useMemo(function(){return oK({breakAll:_.breakAll,children:_.children,maxLines:_.maxLines,scaleToFit:p,style:_.style,width:_.width})},[_.breakAll,_.children,_.maxLines,p,_.style,_.width]),E=_.dx,O=_.dy,j=_.angle,R=_.className,k=_.breakAll,z=yN(_,JG);if(!Jn(r)||!Jn(s))return null;var G=r+(Oe(E)?E:0),$=s+(Oe(O)?O:0),B;switch(S){case"start":B=vw("calc(".concat(d,")"));break;case"middle":B=vw("calc(".concat((M.length-1)/2," * -").concat(c," + (").concat(d," / 2))"));break;default:B=vw("calc(".concat(M.length-1," * -").concat(c,")"));break}var Z=[];if(p){var ee=M[0].width,J=_.width;Z.push("scale(".concat((Oe(J)?J/ee:1)/ee,")"))}return j&&Z.push("rotate(".concat(j,", ").concat(G,", ").concat($,")")),Z.length&&(z.transform=Z.join(" ")),Q.createElement("text",mA({},Je(z,!0),{x:G,y:$,className:ut("recharts-text",R),textAnchor:b,fill:A.includes("url")?SN:A}),M.map(function(q,F){var ie=q.words.join(k?"":" ");return Q.createElement("tspan",{x:G,dy:F===0?B:c,key:"".concat(ie,"-").concat(F)},ie)}))};function al(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function sK(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function ST(e){let t,n,r;e.length!==2?(t=al,n=(c,f)=>al(e(c),f),r=(c,f)=>e(c)-f):(t=e===al||e===sK?e:lK,n=e,r=e);function i(c,f,d=0,m=c.length){if(d>>1;n(c[p],f)<0?d=p+1:m=p}while(d>>1;n(c[p],f)<=0?d=p+1:m=p}while(dd&&r(c[p-1],f)>-r(c[p],f)?p-1:p}return{left:i,center:l,right:s}}function lK(){return 0}function cB(e){return e===null?NaN:+e}function*uK(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const cK=ST(al),zp=cK.right;ST(cB).center;class wN extends Map{constructor(t,n=hK){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(_N(this,t))}has(t){return super.has(_N(this,t))}set(t,n){return super.set(fK(this,t),n)}delete(t){return super.delete(dK(this,t))}}function _N({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function fK({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function dK({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function hK(e){return e!==null&&typeof e=="object"?e.valueOf():e}function pK(e=al){if(e===al)return fB;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function fB(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const mK=Math.sqrt(50),vK=Math.sqrt(10),yK=Math.sqrt(2);function cy(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),l=s>=mK?10:s>=vK?5:s>=yK?2:1;let c,f,d;return i<0?(d=Math.pow(10,-i)/l,c=Math.round(e*d),f=Math.round(t*d),c/dt&&--f,d=-d):(d=Math.pow(10,i)*l,c=Math.round(e/d),f=Math.round(t/d),c*dt&&--f),f0))return[];if(e===t)return[e];const r=t=i))return[];const c=s-i+1,f=new Array(c);if(r)if(l<0)for(let d=0;d=r)&&(n=r);return n}function ON(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function dB(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?fB:pK(i);r>n;){if(r-n>600){const f=r-n+1,d=t-n+1,m=Math.log(f),p=.5*Math.exp(2*m/3),v=.5*Math.sqrt(m*p*(f-p)/f)*(d-f/2<0?-1:1),b=Math.max(n,Math.floor(t-d*p/f+v)),w=Math.min(r,Math.floor(t+(f-d)*p/f+v));dB(e,t,b,w,i)}const s=e[t];let l=n,c=r;for(oh(e,n,t),i(e[r],s)>0&&oh(e,n,r);l0;)--c}i(e[n],s)===0?oh(e,n,c):(++c,oh(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function oh(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function gK(e,t,n){if(e=Float64Array.from(uK(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return ON(e);if(t>=1)return AN(e);var r,i=(r-1)*t,s=Math.floor(i),l=AN(dB(e,s).subarray(0,s+1)),c=ON(e.subarray(s+1));return l+(c-l)*(i-s)}}function bK(e,t,n=cB){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,s=Math.floor(i),l=+n(e[s],s,e),c=+n(e[s+1],s+1,e);return l+(c-l)*(i-s)}}function xK(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?wv(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?wv(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=wK.exec(e))?new ui(t[1],t[2],t[3],1):(t=_K.exec(e))?new ui(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=AK.exec(e))?wv(t[1],t[2],t[3],t[4]):(t=OK.exec(e))?wv(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=TK.exec(e))?DN(t[1],t[2]/100,t[3]/100,1):(t=EK.exec(e))?DN(t[1],t[2]/100,t[3]/100,t[4]):TN.hasOwnProperty(e)?jN(TN[e]):e==="transparent"?new ui(NaN,NaN,NaN,0):null}function jN(e){return new ui(e>>16&255,e>>8&255,e&255,1)}function wv(e,t,n,r){return r<=0&&(e=t=n=NaN),new ui(e,t,n,r)}function PK(e){return e instanceof $p||(e=ep(e)),e?(e=e.rgb(),new ui(e.r,e.g,e.b,e.opacity)):new ui}function xA(e,t,n,r){return arguments.length===1?PK(e):new ui(e,t,n,r??1)}function ui(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}_T(ui,xA,pB($p,{brighter(e){return e=e==null?fy:Math.pow(fy,e),new ui(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Zh:Math.pow(Zh,e),new ui(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ui(hu(this.r),hu(this.g),hu(this.b),dy(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:PN,formatHex:PN,formatHex8:CK,formatRgb:CN,toString:CN}));function PN(){return`#${Jl(this.r)}${Jl(this.g)}${Jl(this.b)}`}function CK(){return`#${Jl(this.r)}${Jl(this.g)}${Jl(this.b)}${Jl((isNaN(this.opacity)?1:this.opacity)*255)}`}function CN(){const e=dy(this.opacity);return`${e===1?"rgb(":"rgba("}${hu(this.r)}, ${hu(this.g)}, ${hu(this.b)}${e===1?")":`, ${e})`}`}function dy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function hu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Jl(e){return e=hu(e),(e<16?"0":"")+e.toString(16)}function DN(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new _a(e,t,n,r)}function mB(e){if(e instanceof _a)return new _a(e.h,e.s,e.l,e.opacity);if(e instanceof $p||(e=ep(e)),!e)return new _a;if(e instanceof _a)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),l=NaN,c=s-i,f=(s+i)/2;return c?(t===s?l=(n-r)/c+(n0&&f<1?0:l,new _a(l,c,f,e.opacity)}function DK(e,t,n,r){return arguments.length===1?mB(e):new _a(e,t,n,r??1)}function _a(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}_T(_a,DK,pB($p,{brighter(e){return e=e==null?fy:Math.pow(fy,e),new _a(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Zh:Math.pow(Zh,e),new _a(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ui(yw(e>=240?e-240:e+120,i,r),yw(e,i,r),yw(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new _a(RN(this.h),_v(this.s),_v(this.l),dy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=dy(this.opacity);return`${e===1?"hsl(":"hsla("}${RN(this.h)}, ${_v(this.s)*100}%, ${_v(this.l)*100}%${e===1?")":`, ${e})`}`}}));function RN(e){return e=(e||0)%360,e<0?e+360:e}function _v(e){return Math.max(0,Math.min(1,e||0))}function yw(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const AT=e=>()=>e;function RK(e,t){return function(n){return e+n*t}}function NK(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function kK(e){return(e=+e)==1?vB:function(t,n){return n-t?NK(t,n,e):AT(isNaN(t)?n:t)}}function vB(e,t){var n=t-e;return n?RK(e,n):AT(isNaN(e)?t:e)}const NN=(function e(t){var n=kK(t);function r(i,s){var l=n((i=xA(i)).r,(s=xA(s)).r),c=n(i.g,s.g),f=n(i.b,s.b),d=vB(i.opacity,s.opacity);return function(m){return i.r=l(m),i.g=c(m),i.b=f(m),i.opacity=d(m),i+""}}return r.gamma=e,r})(1);function LK(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;in&&(s=t.slice(n,s),c[l]?c[l]+=s:c[++l]=s),(r=r[0])===(i=i[0])?c[l]?c[l]+=i:c[++l]=i:(c[++l]=null,f.push({i:l,x:hy(r,i)})),n=gw.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function KK(e,t,n){var r=e[0],i=e[1],s=t[0],l=t[1];return i2?YK:KK,f=d=null,p}function p(v){return v==null||isNaN(v=+v)?s:(f||(f=c(e.map(r),t,n)))(r(l(v)))}return p.invert=function(v){return l(i((d||(d=c(t,e.map(r),hy)))(v)))},p.domain=function(v){return arguments.length?(e=Array.from(v,py),m()):e.slice()},p.range=function(v){return arguments.length?(t=Array.from(v),m()):t.slice()},p.rangeRound=function(v){return t=Array.from(v),n=OT,m()},p.clamp=function(v){return arguments.length?(l=v?!0:Yr,m()):l!==Yr},p.interpolate=function(v){return arguments.length?(n=v,m()):n},p.unknown=function(v){return arguments.length?(s=v,p):s},function(v,b){return r=v,i=b,m()}}function TT(){return _g()(Yr,Yr)}function XK(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function my(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function uf(e){return e=my(Math.abs(e)),e?e[1]:NaN}function WK(e,t){return function(n,r){for(var i=n.length,s=[],l=0,c=e[0],f=0;i>0&&c>0&&(f+c+1>r&&(c=Math.max(1,r-f)),s.push(n.substring(i-=c,i+c)),!((f+=c+1)>r));)c=e[l=(l+1)%e.length];return s.reverse().join(t)}}function QK(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var ZK=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function tp(e){if(!(t=ZK.exec(e)))throw new Error("invalid format: "+e);var t;return new ET({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}tp.prototype=ET.prototype;function ET(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}ET.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function JK(e){e:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var vy;function eY(e,t){var n=my(e,t);if(!n)return vy=void 0,e.toPrecision(t);var r=n[0],i=n[1],s=i-(vy=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return s===l?r:s>l?r+new Array(s-l+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+my(e,Math.max(0,t+s-1))[0]}function LN(e,t){var n=my(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const zN={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:XK,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>LN(e*100,t),r:LN,s:eY,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function $N(e){return e}var BN=Array.prototype.map,qN=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function tY(e){var t=e.grouping===void 0||e.thousands===void 0?$N:WK(BN.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?$N:QK(BN.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function d(p,v){p=tp(p);var b=p.fill,w=p.align,S=p.sign,x=p.symbol,A=p.zero,_=p.width,M=p.comma,E=p.precision,O=p.trim,j=p.type;j==="n"?(M=!0,j="g"):zN[j]||(E===void 0&&(E=12),O=!0,j="g"),(A||b==="0"&&w==="=")&&(A=!0,b="0",w="=");var R=(v&&v.prefix!==void 0?v.prefix:"")+(x==="$"?n:x==="#"&&/[boxX]/.test(j)?"0"+j.toLowerCase():""),k=(x==="$"?r:/[%p]/.test(j)?l:"")+(v&&v.suffix!==void 0?v.suffix:""),z=zN[j],G=/[defgprs%]/.test(j);E=E===void 0?6:/[gprs]/.test(j)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function $(B){var Z=R,ee=k,J,q,F;if(j==="c")ee=z(B)+ee,B="";else{B=+B;var ie=B<0||1/B<0;if(B=isNaN(B)?f:z(Math.abs(B),E),O&&(B=JK(B)),ie&&+B==0&&S!=="+"&&(ie=!1),Z=(ie?S==="("?S:c:S==="-"||S==="("?"":S)+Z,ee=(j==="s"&&!isNaN(B)&&vy!==void 0?qN[8+vy/3]:"")+ee+(ie&&S==="("?")":""),G){for(J=-1,q=B.length;++JF||F>57){ee=(F===46?i+B.slice(J+1):B.slice(J))+ee,B=B.slice(0,J);break}}}M&&!A&&(B=t(B,1/0));var ce=Z.length+B.length+ee.length,U=ce<_?new Array(_-ce+1).join(b):"";switch(M&&A&&(B=t(U+B,U.length?_-ee.length:1/0),U=""),w){case"<":B=Z+B+ee+U;break;case"=":B=Z+U+B+ee;break;case"^":B=U.slice(0,ce=U.length>>1)+Z+B+ee+U.slice(ce);break;default:B=U+Z+B+ee;break}return s(B)}return $.toString=function(){return p+""},$}function m(p,v){var b=Math.max(-8,Math.min(8,Math.floor(uf(v)/3)))*3,w=Math.pow(10,-b),S=d((p=tp(p),p.type="f",p),{suffix:qN[8+b/3]});return function(x){return S(w*x)}}return{format:d,formatPrefix:m}}var Av,MT,yB;nY({thousands:",",grouping:[3],currency:["$",""]});function nY(e){return Av=tY(e),MT=Av.format,yB=Av.formatPrefix,Av}function rY(e){return Math.max(0,-uf(Math.abs(e)))}function iY(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(uf(t)/3)))*3-uf(Math.abs(e)))}function aY(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,uf(t)-uf(e))+1}function gB(e,t,n,r){var i=gA(e,t,n),s;switch(r=tp(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=iY(i,l))&&(r.precision=s),yB(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=aY(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=rY(i))&&(r.precision=s-(r.type==="%")*2);break}}return MT(r)}function fl(e){var t=e.domain;return e.ticks=function(n){var r=t();return vA(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return gB(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,l=r[i],c=r[s],f,d,m=10;for(c0;){if(d=yA(l,c,n),d===f)return r[i]=l,r[s]=c,t(r);if(d>0)l=Math.floor(l/d)*d,c=Math.ceil(c/d)*d;else if(d<0)l=Math.ceil(l*d)/d,c=Math.floor(c*d)/d;else break;f=d}return e},e}function yy(){var e=TT();return e.copy=function(){return Bp(e,yy())},sa.apply(e,arguments),fl(e)}function bB(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,py),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return bB(e).unknown(t)},e=arguments.length?Array.from(e,py):[0,1],fl(n)}function xB(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],l;return sMath.pow(e,t)}function cY(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function VN(e){return(t,n)=>-e(-t,n)}function jT(e){const t=e(IN,UN),n=t.domain;let r=10,i,s;function l(){return i=cY(r),s=uY(r),n()[0]<0?(i=VN(i),s=VN(s),e(oY,sY)):e(IN,UN),t}return t.base=function(c){return arguments.length?(r=+c,l()):r},t.domain=function(c){return arguments.length?(n(c),l()):n()},t.ticks=c=>{const f=n();let d=f[0],m=f[f.length-1];const p=m0){for(;v<=b;++v)for(w=1;wm)break;A.push(S)}}else for(;v<=b;++v)for(w=r-1;w>=1;--w)if(S=v>0?w/s(-v):w*s(v),!(Sm)break;A.push(S)}A.length*2{if(c==null&&(c=10),f==null&&(f=r===10?"s":","),typeof f!="function"&&(!(r%1)&&(f=tp(f)).precision==null&&(f.trim=!0),f=MT(f)),c===1/0)return f;const d=Math.max(1,r*c/t.ticks().length);return m=>{let p=m/s(Math.round(i(m)));return p*rn(xB(n(),{floor:c=>s(Math.floor(i(c))),ceil:c=>s(Math.ceil(i(c)))})),t}function SB(){const e=jT(_g()).domain([1,10]);return e.copy=()=>Bp(e,SB()).base(e.base()),sa.apply(e,arguments),e}function HN(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function FN(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function PT(e){var t=1,n=e(HN(t),FN(t));return n.constant=function(r){return arguments.length?e(HN(t=+r),FN(t)):t},fl(n)}function wB(){var e=PT(_g());return e.copy=function(){return Bp(e,wB()).constant(e.constant())},sa.apply(e,arguments)}function GN(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function fY(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function dY(e){return e<0?-e*e:e*e}function CT(e){var t=e(Yr,Yr),n=1;function r(){return n===1?e(Yr,Yr):n===.5?e(fY,dY):e(GN(n),GN(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},fl(t)}function DT(){var e=CT(_g());return e.copy=function(){return Bp(e,DT()).exponent(e.exponent())},sa.apply(e,arguments),e}function hY(){return DT.apply(null,arguments).exponent(.5)}function KN(e){return Math.sign(e)*e*e}function pY(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function _B(){var e=TT(),t=[0,1],n=!1,r;function i(s){var l=pY(e(s));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(s){return e.invert(KN(s))},i.domain=function(s){return arguments.length?(e.domain(s),i):e.domain()},i.range=function(s){return arguments.length?(e.range((t=Array.from(s,py)).map(KN)),i):t.slice()},i.rangeRound=function(s){return i.range(s).round(!0)},i.round=function(s){return arguments.length?(n=!!s,i):n},i.clamp=function(s){return arguments.length?(e.clamp(s),i):e.clamp()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return _B(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},sa.apply(i,arguments),fl(i)}function AB(){var e=[],t=[],n=[],r;function i(){var l=0,c=Math.max(1,t.length);for(n=new Array(c-1);++l0?n[c-1]:e[0],c=n?[r[n-1],t]:[r[d-1],r[d]]},l.unknown=function(f){return arguments.length&&(s=f),l},l.thresholds=function(){return r.slice()},l.copy=function(){return OB().domain([e,t]).range(i).unknown(s)},sa.apply(fl(l),arguments)}function TB(){var e=[.5],t=[0,1],n,r=1;function i(s){return s!=null&&s<=s?t[zp(e,s,0,r)]:n}return i.domain=function(s){return arguments.length?(e=Array.from(s),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(s){return arguments.length?(t=Array.from(s),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(s){var l=t.indexOf(s);return[e[l-1],e[l]]},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return TB().domain(e).range(t).unknown(n)},sa.apply(i,arguments)}const bw=new Date,xw=new Date;function nr(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const l=i(s),c=i.ceil(s);return s-l(t(s=new Date(+s),l==null?1:Math.floor(l)),s),i.range=(s,l,c)=>{const f=[];if(s=i.ceil(s),c=c==null?1:Math.floor(c),!(s0))return f;let d;do f.push(d=new Date(+s)),t(s,c),e(s);while(dnr(l=>{if(l>=l)for(;e(l),!s(l);)l.setTime(l-1)},(l,c)=>{if(l>=l)if(c<0)for(;++c<=0;)for(;t(l,-1),!s(l););else for(;--c>=0;)for(;t(l,1),!s(l););}),n&&(i.count=(s,l)=>(bw.setTime(+s),xw.setTime(+l),e(bw),e(xw),Math.floor(n(bw,xw))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?l=>r(l)%s===0:l=>i.count(0,l)%s===0):i)),i}const gy=nr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);gy.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?nr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):gy);gy.range;const Lo=1e3,ra=Lo*60,zo=ra*60,Ko=zo*24,RT=Ko*7,YN=Ko*30,Sw=Ko*365,eu=nr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Lo)},(e,t)=>(t-e)/Lo,e=>e.getUTCSeconds());eu.range;const NT=nr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Lo)},(e,t)=>{e.setTime(+e+t*ra)},(e,t)=>(t-e)/ra,e=>e.getMinutes());NT.range;const kT=nr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ra)},(e,t)=>(t-e)/ra,e=>e.getUTCMinutes());kT.range;const LT=nr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Lo-e.getMinutes()*ra)},(e,t)=>{e.setTime(+e+t*zo)},(e,t)=>(t-e)/zo,e=>e.getHours());LT.range;const zT=nr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*zo)},(e,t)=>(t-e)/zo,e=>e.getUTCHours());zT.range;const qp=nr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ra)/Ko,e=>e.getDate()-1);qp.range;const Ag=nr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ko,e=>e.getUTCDate()-1);Ag.range;const EB=nr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ko,e=>Math.floor(e/Ko));EB.range;function ju(e){return nr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*ra)/RT)}const Og=ju(0),by=ju(1),mY=ju(2),vY=ju(3),cf=ju(4),yY=ju(5),gY=ju(6);Og.range;by.range;mY.range;vY.range;cf.range;yY.range;gY.range;function Pu(e){return nr(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/RT)}const Tg=Pu(0),xy=Pu(1),bY=Pu(2),xY=Pu(3),ff=Pu(4),SY=Pu(5),wY=Pu(6);Tg.range;xy.range;bY.range;xY.range;ff.range;SY.range;wY.range;const $T=nr(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());$T.range;const BT=nr(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());BT.range;const Yo=nr(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Yo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:nr(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Yo.range;const Xo=nr(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Xo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:nr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Xo.range;function MB(e,t,n,r,i,s){const l=[[eu,1,Lo],[eu,5,5*Lo],[eu,15,15*Lo],[eu,30,30*Lo],[s,1,ra],[s,5,5*ra],[s,15,15*ra],[s,30,30*ra],[i,1,zo],[i,3,3*zo],[i,6,6*zo],[i,12,12*zo],[r,1,Ko],[r,2,2*Ko],[n,1,RT],[t,1,YN],[t,3,3*YN],[e,1,Sw]];function c(d,m,p){const v=mx).right(l,v);if(b===l.length)return e.every(gA(d/Sw,m/Sw,p));if(b===0)return gy.every(Math.max(gA(d,m,p),1));const[w,S]=l[v/l[b-1][2]53)return null;"w"in he||(he.w=1),"Z"in he?(Te=_w(sh(he.y,0,1)),Xe=Te.getUTCDay(),Te=Xe>4||Xe===0?xy.ceil(Te):xy(Te),Te=Ag.offset(Te,(he.V-1)*7),he.y=Te.getUTCFullYear(),he.m=Te.getUTCMonth(),he.d=Te.getUTCDate()+(he.w+6)%7):(Te=ww(sh(he.y,0,1)),Xe=Te.getDay(),Te=Xe>4||Xe===0?by.ceil(Te):by(Te),Te=qp.offset(Te,(he.V-1)*7),he.y=Te.getFullYear(),he.m=Te.getMonth(),he.d=Te.getDate()+(he.w+6)%7)}else("W"in he||"U"in he)&&("w"in he||(he.w="u"in he?he.u%7:"W"in he?1:0),Xe="Z"in he?_w(sh(he.y,0,1)).getUTCDay():ww(sh(he.y,0,1)).getDay(),he.m=0,he.d="W"in he?(he.w+6)%7+he.W*7-(Xe+5)%7:he.w+he.U*7-(Xe+6)%7);return"Z"in he?(he.H+=he.Z/100|0,he.M+=he.Z%100,_w(he)):ww(he)}}function k(de,_e,Ee,he){for(var Ie=0,Te=_e.length,Xe=Ee.length,nt,yt;Ie=Xe)return-1;if(nt=_e.charCodeAt(Ie++),nt===37){if(nt=_e.charAt(Ie++),yt=O[nt in XN?_e.charAt(Ie++):nt],!yt||(he=yt(de,Ee,he))<0)return-1}else if(nt!=Ee.charCodeAt(he++))return-1}return he}function z(de,_e,Ee){var he=d.exec(_e.slice(Ee));return he?(de.p=m.get(he[0].toLowerCase()),Ee+he[0].length):-1}function G(de,_e,Ee){var he=b.exec(_e.slice(Ee));return he?(de.w=w.get(he[0].toLowerCase()),Ee+he[0].length):-1}function $(de,_e,Ee){var he=p.exec(_e.slice(Ee));return he?(de.w=v.get(he[0].toLowerCase()),Ee+he[0].length):-1}function B(de,_e,Ee){var he=A.exec(_e.slice(Ee));return he?(de.m=_.get(he[0].toLowerCase()),Ee+he[0].length):-1}function Z(de,_e,Ee){var he=S.exec(_e.slice(Ee));return he?(de.m=x.get(he[0].toLowerCase()),Ee+he[0].length):-1}function ee(de,_e,Ee){return k(de,t,_e,Ee)}function J(de,_e,Ee){return k(de,n,_e,Ee)}function q(de,_e,Ee){return k(de,r,_e,Ee)}function F(de){return l[de.getDay()]}function ie(de){return s[de.getDay()]}function ce(de){return f[de.getMonth()]}function U(de){return c[de.getMonth()]}function D(de){return i[+(de.getHours()>=12)]}function V(de){return 1+~~(de.getMonth()/3)}function X(de){return l[de.getUTCDay()]}function ue(de){return s[de.getUTCDay()]}function be(de){return f[de.getUTCMonth()]}function Se(de){return c[de.getUTCMonth()]}function ye(de){return i[+(de.getUTCHours()>=12)]}function Me(de){return 1+~~(de.getUTCMonth()/3)}return{format:function(de){var _e=j(de+="",M);return _e.toString=function(){return de},_e},parse:function(de){var _e=R(de+="",!1);return _e.toString=function(){return de},_e},utcFormat:function(de){var _e=j(de+="",E);return _e.toString=function(){return de},_e},utcParse:function(de){var _e=R(de+="",!0);return _e.toString=function(){return de},_e}}}var XN={"-":"",_:" ",0:"0"},hr=/^\s*\d+/,MY=/^%/,jY=/[\\^$*+?|[\]().{}]/g;function At(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s[t.toLowerCase(),n]))}function CY(e,t,n){var r=hr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function DY(e,t,n){var r=hr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function RY(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function NY(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function kY(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function WN(e,t,n){var r=hr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function QN(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function LY(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function zY(e,t,n){var r=hr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function $Y(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function ZN(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function BY(e,t,n){var r=hr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function JN(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function qY(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function IY(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function UY(e,t,n){var r=hr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function VY(e,t,n){var r=hr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function HY(e,t,n){var r=MY.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function FY(e,t,n){var r=hr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function GY(e,t,n){var r=hr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function ek(e,t){return At(e.getDate(),t,2)}function KY(e,t){return At(e.getHours(),t,2)}function YY(e,t){return At(e.getHours()%12||12,t,2)}function XY(e,t){return At(1+qp.count(Yo(e),e),t,3)}function jB(e,t){return At(e.getMilliseconds(),t,3)}function WY(e,t){return jB(e,t)+"000"}function QY(e,t){return At(e.getMonth()+1,t,2)}function ZY(e,t){return At(e.getMinutes(),t,2)}function JY(e,t){return At(e.getSeconds(),t,2)}function eX(e){var t=e.getDay();return t===0?7:t}function tX(e,t){return At(Og.count(Yo(e)-1,e),t,2)}function PB(e){var t=e.getDay();return t>=4||t===0?cf(e):cf.ceil(e)}function nX(e,t){return e=PB(e),At(cf.count(Yo(e),e)+(Yo(e).getDay()===4),t,2)}function rX(e){return e.getDay()}function iX(e,t){return At(by.count(Yo(e)-1,e),t,2)}function aX(e,t){return At(e.getFullYear()%100,t,2)}function oX(e,t){return e=PB(e),At(e.getFullYear()%100,t,2)}function sX(e,t){return At(e.getFullYear()%1e4,t,4)}function lX(e,t){var n=e.getDay();return e=n>=4||n===0?cf(e):cf.ceil(e),At(e.getFullYear()%1e4,t,4)}function uX(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+At(t/60|0,"0",2)+At(t%60,"0",2)}function tk(e,t){return At(e.getUTCDate(),t,2)}function cX(e,t){return At(e.getUTCHours(),t,2)}function fX(e,t){return At(e.getUTCHours()%12||12,t,2)}function dX(e,t){return At(1+Ag.count(Xo(e),e),t,3)}function CB(e,t){return At(e.getUTCMilliseconds(),t,3)}function hX(e,t){return CB(e,t)+"000"}function pX(e,t){return At(e.getUTCMonth()+1,t,2)}function mX(e,t){return At(e.getUTCMinutes(),t,2)}function vX(e,t){return At(e.getUTCSeconds(),t,2)}function yX(e){var t=e.getUTCDay();return t===0?7:t}function gX(e,t){return At(Tg.count(Xo(e)-1,e),t,2)}function DB(e){var t=e.getUTCDay();return t>=4||t===0?ff(e):ff.ceil(e)}function bX(e,t){return e=DB(e),At(ff.count(Xo(e),e)+(Xo(e).getUTCDay()===4),t,2)}function xX(e){return e.getUTCDay()}function SX(e,t){return At(xy.count(Xo(e)-1,e),t,2)}function wX(e,t){return At(e.getUTCFullYear()%100,t,2)}function _X(e,t){return e=DB(e),At(e.getUTCFullYear()%100,t,2)}function AX(e,t){return At(e.getUTCFullYear()%1e4,t,4)}function OX(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ff(e):ff.ceil(e),At(e.getUTCFullYear()%1e4,t,4)}function TX(){return"+0000"}function nk(){return"%"}function rk(e){return+e}function ik(e){return Math.floor(+e/1e3)}var wc,RB,NB;EX({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function EX(e){return wc=EY(e),RB=wc.format,wc.parse,NB=wc.utcFormat,wc.utcParse,wc}function MX(e){return new Date(e)}function jX(e){return e instanceof Date?+e:+new Date(+e)}function qT(e,t,n,r,i,s,l,c,f,d){var m=TT(),p=m.invert,v=m.domain,b=d(".%L"),w=d(":%S"),S=d("%I:%M"),x=d("%I %p"),A=d("%a %d"),_=d("%b %d"),M=d("%B"),E=d("%Y");function O(j){return(f(j)t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,s)=>gK(e,s/r))},n.copy=function(){return $B(t).domain(e)},ts.apply(n,arguments)}function Mg(){var e=0,t=.5,n=1,r=1,i,s,l,c,f,d=Yr,m,p=!1,v;function b(S){return isNaN(S=+S)?v:(S=.5+((S=+m(S))-s)*(r*Sn}return Ow=e,Ow}var Tw,lk;function kX(){if(lk)return Tw;lk=1;var e=UB(),t=NX(),n=Ff();function r(i){return i&&i.length?e(i,n,t):void 0}return Tw=r,Tw}var LX=kX();const tl=Ft(LX);var Ew,uk;function zX(){if(uk)return Ew;uk=1;function e(t,n){return te.e^s.s<0?1:-1;for(r=s.d.length,i=e.d.length,t=0,n=re.d[t]^s.s<0?1:-1;return r===i?0:r>i^s.s<0?1:-1};ke.decimalPlaces=ke.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*ln;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};ke.dividedBy=ke.div=function(e){return Io(this,new this.constructor(e))};ke.dividedToIntegerBy=ke.idiv=function(e){var t=this,n=t.constructor;return Xt(Io(t,new n(e),0,1),n.precision)};ke.equals=ke.eq=function(e){return!this.cmp(e)};ke.exponent=function(){return Hn(this)};ke.greaterThan=ke.gt=function(e){return this.cmp(e)>0};ke.greaterThanOrEqualTo=ke.gte=function(e){return this.cmp(e)>=0};ke.isInteger=ke.isint=function(){return this.e>this.d.length-2};ke.isNegative=ke.isneg=function(){return this.s<0};ke.isPositive=ke.ispos=function(){return this.s>0};ke.isZero=function(){return this.s===0};ke.lessThan=ke.lt=function(e){return this.cmp(e)<0};ke.lessThanOrEqualTo=ke.lte=function(e){return this.cmp(e)<1};ke.logarithm=ke.log=function(e){var t,n=this,r=n.constructor,i=r.precision,s=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Pi))throw Error(aa+"NaN");if(n.s<1)throw Error(aa+(n.s?"NaN":"-Infinity"));return n.eq(Pi)?new r(0):(hn=!1,t=Io(np(n,s),np(e,s),s),hn=!0,Xt(t,i))};ke.minus=ke.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?GB(t,e):HB(t,(e.s=-e.s,e))};ke.modulo=ke.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(aa+"NaN");return n.s?(hn=!1,t=Io(n,e,0,1).times(e),hn=!0,n.minus(t)):Xt(new r(n),i)};ke.naturalExponential=ke.exp=function(){return FB(this)};ke.naturalLogarithm=ke.ln=function(){return np(this)};ke.negated=ke.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ke.plus=ke.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?HB(t,e):GB(t,(e.s=-e.s,e))};ke.precision=ke.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(pu+e);if(t=Hn(i)+1,r=i.d.length-1,n=r*ln+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};ke.squareRoot=ke.sqrt=function(){var e,t,n,r,i,s,l,c=this,f=c.constructor;if(c.s<1){if(!c.s)return new f(0);throw Error(aa+"NaN")}for(e=Hn(c),hn=!1,i=Math.sqrt(+c),i==0||i==1/0?(t=Ga(c.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Yf((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new f(t)):r=new f(i.toString()),n=f.precision,i=l=n+3;;)if(s=r,r=s.plus(Io(c,s,l+2)).times(.5),Ga(s.d).slice(0,l)===(t=Ga(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(Xt(s,n+1,0),s.times(s).eq(c)){r=s;break}}else if(t!="9999")break;l+=4}return hn=!0,Xt(r,n)};ke.times=ke.mul=function(e){var t,n,r,i,s,l,c,f,d,m=this,p=m.constructor,v=m.d,b=(e=new p(e)).d;if(!m.s||!e.s)return new p(0);for(e.s*=m.s,n=m.e+e.e,f=v.length,d=b.length,f=0;){for(t=0,i=f+r;i>r;)c=s[i]+b[r]*v[i-r-1]+t,s[i--]=c%fr|0,t=c/fr|0;s[i]=(s[i]+t)%fr|0}for(;!s[--l];)s.pop();return t?++n:s.shift(),e.d=s,e.e=n,hn?Xt(e,p.precision):e};ke.toDecimalPlaces=ke.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(eo(e,0,Kf),t===void 0?t=r.rounding:eo(t,0,8),Xt(n,e+Hn(n)+1,t))};ke.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=_u(r,!0):(eo(e,0,Kf),t===void 0?t=i.rounding:eo(t,0,8),r=Xt(new i(r),e+1,t),n=_u(r,!0,e+1)),n};ke.toFixed=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?_u(i):(eo(e,0,Kf),t===void 0?t=s.rounding:eo(t,0,8),r=Xt(new s(i),e+Hn(i)+1,t),n=_u(r.abs(),!1,e+Hn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};ke.toInteger=ke.toint=function(){var e=this,t=e.constructor;return Xt(new t(e),Hn(e)+1,t.rounding)};ke.toNumber=function(){return+this};ke.toPower=ke.pow=function(e){var t,n,r,i,s,l,c=this,f=c.constructor,d=12,m=+(e=new f(e));if(!e.s)return new f(Pi);if(c=new f(c),!c.s){if(e.s<1)throw Error(aa+"Infinity");return c}if(c.eq(Pi))return c;if(r=f.precision,e.eq(Pi))return Xt(c,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=c.s,l){if((n=m<0?-m:m)<=VB){for(i=new f(Pi),t=Math.ceil(r/ln+4),hn=!1;n%2&&(i=i.times(c),mk(i.d,t)),n=Yf(n/2),n!==0;)c=c.times(c),mk(c.d,t);return hn=!0,e.s<0?new f(Pi).div(i):Xt(i,r)}}else if(s<0)throw Error(aa+"NaN");return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,hn=!1,i=e.times(np(c,r+d)),hn=!0,i=FB(i),i.s=s,i};ke.toPrecision=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?(n=Hn(i),r=_u(i,n<=s.toExpNeg||n>=s.toExpPos)):(eo(e,1,Kf),t===void 0?t=s.rounding:eo(t,0,8),i=Xt(new s(i),e,t),n=Hn(i),r=_u(i,e<=n||n<=s.toExpNeg,e)),r};ke.toSignificantDigits=ke.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(eo(e,1,Kf),t===void 0?t=r.rounding:eo(t,0,8)),Xt(new r(n),e,t)};ke.toString=ke.valueOf=ke.val=ke.toJSON=ke[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Hn(e),n=e.constructor;return _u(e,t<=n.toExpNeg||t>=n.toExpPos)};function HB(e,t){var n,r,i,s,l,c,f,d,m=e.constructor,p=m.precision;if(!e.s||!t.s)return t.s||(t=new m(e)),hn?Xt(t,p):t;if(f=e.d,d=t.d,l=e.e,i=t.e,f=f.slice(),s=l-i,s){for(s<0?(r=f,s=-s,c=d.length):(r=d,i=l,c=f.length),l=Math.ceil(p/ln),c=l>c?l+1:c+1,s>c&&(s=c,r.length=1),r.reverse();s--;)r.push(0);r.reverse()}for(c=f.length,s=d.length,c-s<0&&(s=c,r=d,d=f,f=r),n=0;s;)n=(f[--s]=f[s]+d[s]+n)/fr|0,f[s]%=fr;for(n&&(f.unshift(n),++i),c=f.length;f[--c]==0;)f.pop();return t.d=f,t.e=i,hn?Xt(t,p):t}function eo(e,t,n){if(e!==~~e||en)throw Error(pu+e)}function Ga(e){var t,n,r,i=e.length-1,s="",l=e[0];if(i>0){for(s+=l,t=1;tl?1:-1;else for(c=f=0;ci[c]?1:-1;break}return f}function n(r,i,s){for(var l=0;s--;)r[s]-=l,l=r[s]1;)r.shift()}return function(r,i,s,l){var c,f,d,m,p,v,b,w,S,x,A,_,M,E,O,j,R,k,z=r.constructor,G=r.s==i.s?1:-1,$=r.d,B=i.d;if(!r.s)return new z(r);if(!i.s)throw Error(aa+"Division by zero");for(f=r.e-i.e,R=B.length,O=$.length,b=new z(G),w=b.d=[],d=0;B[d]==($[d]||0);)++d;if(B[d]>($[d]||0)&&--f,s==null?_=s=z.precision:l?_=s+(Hn(r)-Hn(i))+1:_=s,_<0)return new z(0);if(_=_/ln+2|0,d=0,R==1)for(m=0,B=B[0],_++;(d1&&(B=e(B,m),$=e($,m),R=B.length,O=$.length),E=R,S=$.slice(0,R),x=S.length;x=fr/2&&++j;do m=0,c=t(B,S,R,x),c<0?(A=S[0],R!=x&&(A=A*fr+(S[1]||0)),m=A/j|0,m>1?(m>=fr&&(m=fr-1),p=e(B,m),v=p.length,x=S.length,c=t(p,S,v,x),c==1&&(m--,n(p,R16)throw Error(VT+Hn(e));if(!e.s)return new m(Pi);for(hn=!1,c=p,l=new m(.03125);e.abs().gte(.1);)e=e.times(l),d+=5;for(r=Math.log(Fl(2,d))/Math.LN10*2+5|0,c+=r,n=i=s=new m(Pi),m.precision=c;;){if(i=Xt(i.times(e),c),n=n.times(++f),l=s.plus(Io(i,n,c)),Ga(l.d).slice(0,c)===Ga(s.d).slice(0,c)){for(;d--;)s=Xt(s.times(s),c);return m.precision=p,t==null?(hn=!0,Xt(s,p)):s}s=l}}function Hn(e){for(var t=e.e*ln,n=e.d[0];n>=10;n/=10)t++;return t}function Dw(e,t,n){if(t>e.LN10.sd())throw hn=!0,n&&(e.precision=n),Error(aa+"LN10 precision limit exceeded");return Xt(new e(e.LN10),t)}function Vs(e){for(var t="";e--;)t+="0";return t}function np(e,t){var n,r,i,s,l,c,f,d,m,p=1,v=10,b=e,w=b.d,S=b.constructor,x=S.precision;if(b.s<1)throw Error(aa+(b.s?"NaN":"-Infinity"));if(b.eq(Pi))return new S(0);if(t==null?(hn=!1,d=x):d=t,b.eq(10))return t==null&&(hn=!0),Dw(S,d);if(d+=v,S.precision=d,n=Ga(w),r=n.charAt(0),s=Hn(b),Math.abs(s)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)b=b.times(e),n=Ga(b.d),r=n.charAt(0),p++;s=Hn(b),r>1?(b=new S("0."+n),s++):b=new S(r+"."+n.slice(1))}else return f=Dw(S,d+2,x).times(s+""),b=np(new S(r+"."+n.slice(1)),d-v).plus(f),S.precision=x,t==null?(hn=!0,Xt(b,x)):b;for(c=l=b=Io(b.minus(Pi),b.plus(Pi),d),m=Xt(b.times(b),d),i=3;;){if(l=Xt(l.times(m),d),f=c.plus(Io(l,new S(i),d)),Ga(f.d).slice(0,d)===Ga(c.d).slice(0,d))return c=c.times(2),s!==0&&(c=c.plus(Dw(S,d+2,x).times(s+""))),c=Io(c,new S(p),d),S.precision=x,t==null?(hn=!0,Xt(c,x)):c;c=f,i+=2}}function pk(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=Yf(n/ln),e.d=[],r=(n+1)%ln,n<0&&(r+=ln),rSy||e.e<-Sy))throw Error(VT+n)}else e.s=0,e.e=0,e.d=[0];return e}function Xt(e,t,n){var r,i,s,l,c,f,d,m,p=e.d;for(l=1,s=p[0];s>=10;s/=10)l++;if(r=t-l,r<0)r+=ln,i=t,d=p[m=0];else{if(m=Math.ceil((r+1)/ln),s=p.length,m>=s)return e;for(d=s=p[m],l=1;s>=10;s/=10)l++;r%=ln,i=r-ln+l}if(n!==void 0&&(s=Fl(10,l-i-1),c=d/s%10|0,f=t<0||p[m+1]!==void 0||d%s,f=n<4?(c||f)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||f||n==6&&(r>0?i>0?d/Fl(10,l-i):0:p[m-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return f?(s=Hn(e),p.length=1,t=t-s-1,p[0]=Fl(10,(ln-t%ln)%ln),e.e=Yf(-t/ln)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(r==0?(p.length=m,s=1,m--):(p.length=m+1,s=Fl(10,ln-r),p[m]=i>0?(d/Fl(10,l-i)%Fl(10,i)|0)*s:0),f)for(;;)if(m==0){(p[0]+=s)==fr&&(p[0]=1,++e.e);break}else{if(p[m]+=s,p[m]!=fr)break;p[m--]=0,s=1}for(r=p.length;p[--r]===0;)p.pop();if(hn&&(e.e>Sy||e.e<-Sy))throw Error(VT+Hn(e));return e}function GB(e,t){var n,r,i,s,l,c,f,d,m,p,v=e.constructor,b=v.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new v(e),hn?Xt(t,b):t;if(f=e.d,p=t.d,r=t.e,d=e.e,f=f.slice(),l=d-r,l){for(m=l<0,m?(n=f,l=-l,c=p.length):(n=p,r=d,c=f.length),i=Math.max(Math.ceil(b/ln),c)+2,l>i&&(l=i,n.length=1),n.reverse(),i=l;i--;)n.push(0);n.reverse()}else{for(i=f.length,c=p.length,m=i0;--i)f[c++]=0;for(i=p.length;i>l;){if(f[--i]0?s=s.charAt(0)+"."+s.slice(1)+Vs(r):l>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+Vs(-i-1)+s,n&&(r=n-l)>0&&(s+=Vs(r))):i>=l?(s+=Vs(i+1-l),n&&(r=n-i-1)>0&&(s=s+"."+Vs(r))):((r=i+1)0&&(i+1===l&&(s+="."),s+=Vs(r))),e.s<0?"-"+s:s}function mk(e,t){if(e.length>t)return e.length=t,!0}function KB(e){var t,n,r;function i(s){var l=this;if(!(l instanceof i))return new i(s);if(l.constructor=i,s instanceof i){l.s=s.s,l.e=s.e,l.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(pu+s);if(s>0)l.s=1;else if(s<0)s=-s,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(s===~~s&&s<1e7){l.e=0,l.d=[s];return}return pk(l,s.toString())}else if(typeof s!="string")throw Error(pu+s);if(s.charCodeAt(0)===45?(s=s.slice(1),l.s=-1):l.s=1,KX.test(s))pk(l,s);else throw Error(pu+s)}if(i.prototype=ke,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=KB,i.config=i.set=YX,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(pu+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(pu+n+": "+r);return this}var HT=KB(GX);Pi=new HT(1);const Ht=HT;function XX(e){return JX(e)||ZX(e)||QX(e)||WX()}function WX(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QX(e,t){if(e){if(typeof e=="string")return _A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _A(e,t)}}function ZX(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function JX(e){if(Array.isArray(e))return _A(e)}function _A(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t?n.apply(void 0,i):e(t-l,vk(function(){for(var c=arguments.length,f=new Array(c),d=0;de.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,s=void 0;try{for(var l=e[Symbol.iterator](),c;!(r=(c=l.next()).done)&&(n.push(c.value),!(t&&n.length===t));r=!0);}catch(f){i=!0,s=f}finally{try{!r&&l.return!=null&&l.return()}finally{if(i)throw s}}return n}}function pW(e){if(Array.isArray(e))return e}function ZB(e){var t=rp(e,2),n=t[0],r=t[1],i=n,s=r;return n>r&&(i=r,s=n),[i,s]}function JB(e,t,n){if(e.lte(0))return new Ht(0);var r=Cg.getDigitCount(e.toNumber()),i=new Ht(10).pow(r),s=e.div(i),l=r!==1?.05:.1,c=new Ht(Math.ceil(s.div(l).toNumber())).add(n).mul(l),f=c.mul(i);return t?f:new Ht(Math.ceil(f))}function mW(e,t,n){var r=1,i=new Ht(e);if(!i.isint()&&n){var s=Math.abs(e);s<1?(r=new Ht(10).pow(Cg.getDigitCount(e)-1),i=new Ht(Math.floor(i.div(r).toNumber())).mul(r)):s>1&&(i=new Ht(Math.floor(e)))}else e===0?i=new Ht(Math.floor((t-1)/2)):n||(i=new Ht(Math.floor(e)));var l=Math.floor((t-1)/2),c=rW(nW(function(f){return i.add(new Ht(f-l).mul(r)).toNumber()}),AA);return c(0,t)}function eq(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Ht(0),tickMin:new Ht(0),tickMax:new Ht(0)};var s=JB(new Ht(t).sub(e).div(n-1),r,i),l;e<=0&&t>=0?l=new Ht(0):(l=new Ht(e).add(t).div(2),l=l.sub(new Ht(l).mod(s)));var c=Math.ceil(l.sub(e).div(s).toNumber()),f=Math.ceil(new Ht(t).sub(l).div(s).toNumber()),d=c+f+1;return d>n?eq(e,t,n,r,i+1):(d0?f+(n-d):f,c=t>0?c:c+(n-d)),{step:s,tickMin:l.sub(new Ht(c).mul(s)),tickMax:l.add(new Ht(f).mul(s))})}function vW(e){var t=rp(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=Math.max(i,2),c=ZB([n,r]),f=rp(c,2),d=f[0],m=f[1];if(d===-1/0||m===1/0){var p=m===1/0?[d].concat(TA(AA(0,i-1).map(function(){return 1/0}))):[].concat(TA(AA(0,i-1).map(function(){return-1/0})),[m]);return n>r?OA(p):p}if(d===m)return mW(d,i,s);var v=eq(d,m,l,s),b=v.step,w=v.tickMin,S=v.tickMax,x=Cg.rangeStep(w,S.add(new Ht(.1).mul(b)),b);return n>r?OA(x):x}function yW(e,t){var n=rp(e,2),r=n[0],i=n[1],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=ZB([r,i]),c=rp(l,2),f=c[0],d=c[1];if(f===-1/0||d===1/0)return[r,i];if(f===d)return[f];var m=Math.max(t,2),p=JB(new Ht(d).sub(f).div(m-1),s,0),v=[].concat(TA(Cg.rangeStep(new Ht(f),new Ht(d).sub(new Ht(.99).mul(p)),p)),[d]);return r>i?OA(v):v}var gW=WB(vW),bW=WB(yW),xW="Invariant failed";function Au(e,t){throw new Error(xW)}var SW=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function df(e){"@babel/helpers - typeof";return df=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},df(e)}function wy(){return wy=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function MW(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function jW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PW(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,l=-1,c=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(c<=1)return 0;if(s&&s.axisType==="angleAxis"&&Math.abs(Math.abs(s.range[1]-s.range[0])-360)<=1e-6)for(var f=s.range,d=0;d0?i[d-1].coordinate:i[c-1].coordinate,p=i[d].coordinate,v=d>=c-1?i[0].coordinate:i[d+1].coordinate,b=void 0;if(Oa(p-m)!==Oa(v-p)){var w=[];if(Oa(v-p)===Oa(f[1]-f[0])){b=v;var S=p+f[1]-f[0];w[0]=Math.min(S,(S+m)/2),w[1]=Math.max(S,(S+m)/2)}else{b=m;var x=v+f[1]-f[0];w[0]=Math.min(p,(x+p)/2),w[1]=Math.max(p,(x+p)/2)}var A=[Math.min(p,(b+p)/2),Math.max(p,(b+p)/2)];if(t>A[0]&&t<=A[1]||t>=w[0]&&t<=w[1]){l=i[d].index;break}}else{var _=Math.min(m,v),M=Math.max(m,v);if(t>(_+p)/2&&t<=(M+p)/2){l=i[d].index;break}}}else for(var E=0;E0&&E(r[E].coordinate+r[E-1].coordinate)/2&&t<=(r[E].coordinate+r[E+1].coordinate)/2||E===c-1&&t>(r[E].coordinate+r[E-1].coordinate)/2){l=r[E].index;break}return l},FT=function(t){var n,r=t,i=r.type.displayName,s=(n=t.type)!==null&&n!==void 0&&n.defaultProps?An(An({},t.type.defaultProps),t.props):t.props,l=s.stroke,c=s.fill,f;switch(i){case"Line":f=l;break;case"Area":case"Radar":f=l&&l!=="none"?l:c;break;default:f=c;break}return f},KW=function(t){var n=t.barSize,r=t.totalSize,i=t.stackGroups,s=i===void 0?{}:i;if(!s)return{};for(var l={},c=Object.keys(s),f=0,d=c.length;f=0});if(A&&A.length){var _=A[0].type.defaultProps,M=_!==void 0?An(An({},_),A[0].props):A[0].props,E=M.barSize,O=M[x];l[O]||(l[O]=[]);var j=Qe(E)?n:E;l[O].push({item:A[0],stackList:A.slice(1),barSize:Qe(j)?void 0:Su(j,r,0)})}}return l},YW=function(t){var n=t.barGap,r=t.barCategoryGap,i=t.bandSize,s=t.sizeList,l=s===void 0?[]:s,c=t.maxBarSize,f=l.length;if(f<1)return null;var d=Su(n,i,0,!0),m,p=[];if(l[0].barSize===+l[0].barSize){var v=!1,b=i/f,w=l.reduce(function(E,O){return E+O.barSize||0},0);w+=(f-1)*d,w>=i&&(w-=(f-1)*d,d=0),w>=i&&b>0&&(v=!0,b*=.9,w=f*b);var S=(i-w)/2>>0,x={offset:S-d,size:0};m=l.reduce(function(E,O){var j={item:O.item,position:{offset:x.offset+x.size+d,size:v?b:O.barSize}},R=[].concat(bk(E),[j]);return x=R[R.length-1].position,O.stackList&&O.stackList.length&&O.stackList.forEach(function(k){R.push({item:k,position:x})}),R},p)}else{var A=Su(r,i,0,!0);i-2*A-(f-1)*d<=0&&(d=0);var _=(i-2*A-(f-1)*d)/f;_>1&&(_>>=0);var M=c===+c?Math.min(_,c):_;m=l.reduce(function(E,O,j){var R=[].concat(bk(E),[{item:O.item,position:{offset:A+(_+d)*j+(_-M)/2,size:M}}]);return O.stackList&&O.stackList.length&&O.stackList.forEach(function(k){R.push({item:k,position:R[R.length-1].position})}),R},p)}return m},XW=function(t,n,r,i){var s=r.children,l=r.width,c=r.margin,f=l-(c.left||0)-(c.right||0),d=iq({children:s,legendWidth:f});if(d){var m=i||{},p=m.width,v=m.height,b=d.align,w=d.verticalAlign,S=d.layout;if((S==="vertical"||S==="horizontal"&&w==="middle")&&b!=="center"&&Oe(t[b]))return An(An({},t),{},Ic({},b,t[b]+(p||0)));if((S==="horizontal"||S==="vertical"&&b==="center")&&w!=="middle"&&Oe(t[w]))return An(An({},t),{},Ic({},w,t[w]+(v||0)))}return t},WW=function(t,n,r){return Qe(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},aq=function(t,n,r,i,s){var l=n.props.children,c=ci(l,Xf).filter(function(d){return WW(i,s,d.props.direction)});if(c&&c.length){var f=c.map(function(d){return d.props.dataKey});return t.reduce(function(d,m){var p=er(m,r);if(Qe(p))return d;var v=Array.isArray(p)?[jg(p),tl(p)]:[p,p],b=f.reduce(function(w,S){var x=er(m,S,0),A=v[0]-Math.abs(Array.isArray(x)?x[0]:x),_=v[1]+Math.abs(Array.isArray(x)?x[1]:x);return[Math.min(A,w[0]),Math.max(_,w[1])]},[1/0,-1/0]);return[Math.min(b[0],d[0]),Math.max(b[1],d[1])]},[1/0,-1/0])}return null},QW=function(t,n,r,i,s){var l=n.map(function(c){return aq(t,c,r,s,i)}).filter(function(c){return!Qe(c)});return l&&l.length?l.reduce(function(c,f){return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]):null},oq=function(t,n,r,i,s){var l=n.map(function(f){var d=f.props.dataKey;return r==="number"&&d&&aq(t,f,d,i)||jh(t,d,r,s)});if(r==="number")return l.reduce(function(f,d){return[Math.min(f[0],d[0]),Math.max(f[1],d[1])]},[1/0,-1/0]);var c={};return l.reduce(function(f,d){for(var m=0,p=d.length;m=2?Oa(c[0]-c[1])*2*d:d,n&&(t.ticks||t.niceTicks)){var m=(t.ticks||t.niceTicks).map(function(p){var v=s?s.indexOf(p):p;return{coordinate:i(v)+d,value:p,offset:d}});return m.filter(function(p){return!Hf(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,v){return{coordinate:i(p)+d,value:p,index:v,offset:d}}):i.ticks&&!r?i.ticks(t.tickCount).map(function(p){return{coordinate:i(p)+d,value:p,offset:d}}):i.domain().map(function(p,v){return{coordinate:i(p)+d,value:s?s[p]:p,index:v,offset:d}})},Rw=new WeakMap,Ov=function(t,n){if(typeof n!="function")return t;Rw.has(t)||Rw.set(t,new WeakMap);var r=Rw.get(t);if(r.has(n))return r.get(n);var i=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},ZW=function(t,n,r){var i=t.scale,s=t.type,l=t.layout,c=t.axisType;if(i==="auto")return l==="radial"&&c==="radiusAxis"?{scale:Qh(),realScaleType:"band"}:l==="radial"&&c==="angleAxis"?{scale:yy(),realScaleType:"linear"}:s==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Mh(),realScaleType:"point"}:s==="category"?{scale:Qh(),realScaleType:"band"}:{scale:yy(),realScaleType:"linear"};if(xu(i)){var f="scale".concat(pg(i));return{scale:(ak[f]||Mh)(),realScaleType:ak[f]?f:"point"}}return tt(i)?{scale:i}:{scale:Mh(),realScaleType:"point"}},Sk=1e-4,JW=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,i=t.range(),s=Math.min(i[0],i[1])-Sk,l=Math.max(i[0],i[1])+Sk,c=t(n[0]),f=t(n[r-1]);(cl||fl)&&t.domain([n[0],n[r-1]])}},eQ=function(t,n){if(!t)return null;for(var r=0,i=t.length;ri)&&(s[1]=i),s[0]>i&&(s[0]=i),s[1]=0?(t[c][r][0]=s,t[c][r][1]=s+f,s=t[c][r][1]):(t[c][r][0]=l,t[c][r][1]=l+f,l=t[c][r][1])}},rQ=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r=0?(t[l][r][0]=s,t[l][r][1]=s+c,s=t[l][r][1]):(t[l][r][0]=0,t[l][r][1]=0)}},iQ={sign:nQ,expand:IF,none:rf,silhouette:UF,wiggle:VF,positive:rQ},aQ=function(t,n,r){var i=n.map(function(c){return c.props.dataKey}),s=iQ[r],l=qF().keys(i).value(function(c,f){return+er(c,f,0)}).order(aA).offset(s);return l(t)},oQ=function(t,n,r,i,s,l){if(!t)return null;var c=l?n.reverse():n,f={},d=c.reduce(function(p,v){var b,w=(b=v.type)!==null&&b!==void 0&&b.defaultProps?An(An({},v.type.defaultProps),v.props):v.props,S=w.stackId,x=w.hide;if(x)return p;var A=w[r],_=p[A]||{hasStack:!1,stackGroups:{}};if(Jn(S)){var M=_.stackGroups[S]||{numericAxisId:r,cateAxisId:i,items:[]};M.items.push(v),_.hasStack=!0,_.stackGroups[S]=M}else _.stackGroups[Mu("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[v]};return An(An({},p),{},Ic({},A,_))},f),m={};return Object.keys(d).reduce(function(p,v){var b=d[v];if(b.hasStack){var w={};b.stackGroups=Object.keys(b.stackGroups).reduce(function(S,x){var A=b.stackGroups[x];return An(An({},S),{},Ic({},x,{numericAxisId:r,cateAxisId:i,items:A.items,stackedData:aQ(t,A.items,s)}))},w)}return An(An({},p),{},Ic({},v,b))},m)},sQ=function(t,n){var r=n.realScaleType,i=n.type,s=n.tickCount,l=n.originalDomain,c=n.allowDecimals,f=r||n.scale;if(f!=="auto"&&f!=="linear")return null;if(s&&i==="number"&&l&&(l[0]==="auto"||l[1]==="auto")){var d=t.domain();if(!d.length)return null;var m=gW(d,s,c);return t.domain([jg(m),tl(m)]),{niceTicks:m}}if(s&&i==="number"){var p=t.domain(),v=bW(p,s,c);return{niceTicks:v}}return null};function hf(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,s=e.index,l=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Qe(i[t.dataKey])){var c=Qv(n,"value",i[t.dataKey]);if(c)return c.coordinate+r/2}return n[s]?n[s].coordinate+r/2:null}var f=er(i,Qe(l)?t.dataKey:l);return Qe(f)?null:t.scale(f)}var wk=function(t){var n=t.axis,r=t.ticks,i=t.offset,s=t.bandSize,l=t.entry,c=t.index;if(n.type==="category")return r[c]?r[c].coordinate+i:null;var f=er(l,n.dataKey,n.domain[c]);return Qe(f)?null:n.scale(f)-s/2+i},lQ=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),s=Math.max(r[0],r[1]);return i<=0&&s>=0?0:s<0?s:i}return r[0]},uQ=function(t,n){var r,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?An(An({},t.type.defaultProps),t.props):t.props,s=i.stackId;if(Jn(s)){var l=n[s];if(l){var c=l.items.indexOf(t);return c>=0?l.stackedData[c]:null}}return null},cQ=function(t){return t.reduce(function(n,r){return[jg(r.concat([n[0]]).filter(Oe)),tl(r.concat([n[1]]).filter(Oe))]},[1/0,-1/0])},uq=function(t,n,r){return Object.keys(t).reduce(function(i,s){var l=t[s],c=l.stackedData,f=c.reduce(function(d,m){var p=cQ(m.slice(n,r+1));return[Math.min(d[0],p[0]),Math.max(d[1],p[1])]},[1/0,-1/0]);return[Math.min(f[0],i[0]),Math.max(f[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},_k=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ak=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,PA=function(t,n,r){if(tt(t))return t(n,r);if(!Array.isArray(t))return n;var i=[];if(Oe(t[0]))i[0]=r?t[0]:Math.min(t[0],n[0]);else if(_k.test(t[0])){var s=+_k.exec(t[0])[1];i[0]=n[0]-s}else tt(t[0])?i[0]=t[0](n[0]):i[0]=n[0];if(Oe(t[1]))i[1]=r?t[1]:Math.max(t[1],n[1]);else if(Ak.test(t[1])){var l=+Ak.exec(t[1])[1];i[1]=n[1]+l}else tt(t[1])?i[1]=t[1](n[1]):i[1]=n[1];return i},Ay=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!r||i>0)return i}if(t&&n&&n.length>=2){for(var s=gT(n,function(p){return p.coordinate}),l=1/0,c=1,f=s.length;cl&&(d=2*Math.PI-d),{radius:c,angle:pQ(d),angleInRadian:d}},yQ=function(t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),s=Math.floor(r/360),l=Math.min(i,s);return{startAngle:n-l*360,endAngle:r-l*360}},gQ=function(t,n){var r=n.startAngle,i=n.endAngle,s=Math.floor(r/360),l=Math.floor(i/360),c=Math.min(s,l);return t+c*360},Mk=function(t,n){var r=t.x,i=t.y,s=vQ({x:r,y:i},n),l=s.radius,c=s.angle,f=n.innerRadius,d=n.outerRadius;if(ld)return!1;if(l===0)return!0;var m=yQ(n),p=m.startAngle,v=m.endAngle,b=c,w;if(p<=v){for(;b>v;)b-=360;for(;b=p&&b<=v}else{for(;b>p;)b-=360;for(;b=v&&b<=p}return w?Ek(Ek({},n),{},{radius:l,angle:gQ(b,n)}):null};function sp(e){"@babel/helpers - typeof";return sp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sp(e)}var bQ=["offset"];function xQ(e){return AQ(e)||_Q(e)||wQ(e)||SQ()}function SQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wQ(e,t){if(e){if(typeof e=="string")return CA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return CA(e,t)}}function _Q(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function AQ(e){if(Array.isArray(e))return CA(e)}function CA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function TQ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function jk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Yn(e){for(var t=1;t=0?1:-1,M,E;i==="insideStart"?(M=b+_*l,E=S):i==="insideEnd"?(M=w-_*l,E=!S):i==="end"&&(M=w+_*l,E=S),E=A<=0?E:!E;var O=Or(d,m,x,M),j=Or(d,m,x,M+(E?1:-1)*359),R="M".concat(O.x,",").concat(O.y,` + height and width.`,J,q,l,f,m,p,n);var F=!Array.isArray(b)&&Bo(b.type).endsWith("Chart");return Q.Children.map(b,function(ie){return Q.isValidElement(ie)?K.cloneElement(ie,xv({width:J,height:q},F?{style:xv({height:"100%",width:"100%",maxHeight:q,maxWidth:J},ie.props.style)}:{})):ie})},[n,b,f,v,p,m,z,l]);return Q.createElement("div",{id:x?"".concat(x):void 0,className:ut("recharts-responsive-container",A),style:xv(xv({},E),{},{width:l,height:f,minWidth:m,minHeight:p,maxHeight:v}),ref:O},B)}),ST=function(t){return null};ST.displayName="Cell";function Xh(e){"@babel/helpers - typeof";return Xh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xh(e)}function fN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mA(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||cl.isSsr)return{width:0,height:0};var r=IG(n),i=JSON.stringify({text:t,copyStyle:r});if(Sc.widthCache[i])return Sc.widthCache[i];try{var s=document.getElementById(dN);s||(s=document.createElement("span"),s.setAttribute("id",dN),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var l=mA(mA({},qG),r);Object.assign(s.style,l),s.textContent="".concat(t);var c=s.getBoundingClientRect(),f={width:c.width,height:c.height};return Sc.widthCache[i]=f,++Sc.cacheCount>BG&&(Sc.cacheCount=0,Sc.widthCache={}),f}catch{return{width:0,height:0}}},UG=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Wh(e){"@babel/helpers - typeof";return Wh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wh(e)}function ly(e,t){return GG(e)||FG(e,t)||HG(e,t)||VG()}function VG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HG(e,t){if(e){if(typeof e=="string")return hN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hN(e,t)}}function hN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function oK(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function bN(e,t){return cK(e)||uK(e,t)||lK(e,t)||sK()}function sK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lK(e,t){if(e){if(typeof e=="string")return xN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xN(e,t)}}function xN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[];return J.reduce(function(q,F){var ie=F.word,ce=F.width,U=q[q.length-1];if(U&&(i==null||s||U.width+ce+rF.width?q:F})};if(!m)return b;for(var S="…",x=function(J){var q=p.slice(0,J),F=cB({breakAll:d,style:f,children:q+S}).wordsWithComputedWidth,ie=v(F),ce=ie.length>l||w(ie).width>Number(i);return[ce,ie]},A=0,_=p.length-1,M=0,E;A<=_&&M<=p.length-1;){var O=Math.floor((A+_)/2),j=O-1,R=x(j),k=bN(R,2),z=k[0],G=k[1],$=x(O),B=bN($,1),Z=B[0];if(!z&&!Z&&(A=O+1),z&&Z&&(_=O-1),!z&&Z){E=G;break}M++}return E||b},SN=function(t){var n=Qe(t)?[]:t.toString().split(uB);return[{words:n}]},dK=function(t){var n=t.width,r=t.scaleToFit,i=t.children,s=t.style,l=t.breakAll,c=t.maxLines;if((n||r)&&!cl.isSsr){var f,d,m=cB({breakAll:l,children:i,style:s});if(m){var p=m.wordsWithComputedWidth,v=m.spaceWidth;f=p,d=v}else return SN(i);return fK({breakAll:l,children:i,maxLines:c,style:s},f,d,n,r)}return SN(i)},wN="#808080",uy=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,s=i===void 0?0:i,l=t.lineHeight,c=l===void 0?"1em":l,f=t.capHeight,d=f===void 0?"0.71em":f,m=t.scaleToFit,p=m===void 0?!1:m,v=t.textAnchor,b=v===void 0?"start":v,w=t.verticalAnchor,S=w===void 0?"end":w,x=t.fill,A=x===void 0?wN:x,_=gN(t,iK),M=K.useMemo(function(){return dK({breakAll:_.breakAll,children:_.children,maxLines:_.maxLines,scaleToFit:p,style:_.style,width:_.width})},[_.breakAll,_.children,_.maxLines,p,_.style,_.width]),E=_.dx,O=_.dy,j=_.angle,R=_.className,k=_.breakAll,z=gN(_,aK);if(!Jn(r)||!Jn(s))return null;var G=r+(Oe(E)?E:0),$=s+(Oe(O)?O:0),B;switch(S){case"start":B=vw("calc(".concat(d,")"));break;case"middle":B=vw("calc(".concat((M.length-1)/2," * -").concat(c," + (").concat(d," / 2))"));break;default:B=vw("calc(".concat(M.length-1," * -").concat(c,")"));break}var Z=[];if(p){var ee=M[0].width,J=_.width;Z.push("scale(".concat((Oe(J)?J/ee:1)/ee,")"))}return j&&Z.push("rotate(".concat(j,", ").concat(G,", ").concat($,")")),Z.length&&(z.transform=Z.join(" ")),Q.createElement("text",vA({},Je(z,!0),{x:G,y:$,className:ut("recharts-text",R),textAnchor:b,fill:A.includes("url")?wN:A}),M.map(function(q,F){var ie=q.words.join(k?"":" ");return Q.createElement("tspan",{x:G,dy:F===0?B:c,key:"".concat(ie,"-").concat(F)},ie)}))};function al(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function hK(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function wT(e){let t,n,r;e.length!==2?(t=al,n=(c,f)=>al(e(c),f),r=(c,f)=>e(c)-f):(t=e===al||e===hK?e:pK,n=e,r=e);function i(c,f,d=0,m=c.length){if(d>>1;n(c[p],f)<0?d=p+1:m=p}while(d>>1;n(c[p],f)<=0?d=p+1:m=p}while(dd&&r(c[p-1],f)>-r(c[p],f)?p-1:p}return{left:i,center:l,right:s}}function pK(){return 0}function fB(e){return e===null?NaN:+e}function*mK(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const vK=wT(al),zp=vK.right;wT(fB).center;class _N extends Map{constructor(t,n=bK){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(AN(this,t))}has(t){return super.has(AN(this,t))}set(t,n){return super.set(yK(this,t),n)}delete(t){return super.delete(gK(this,t))}}function AN({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function yK({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function gK({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function bK(e){return e!==null&&typeof e=="object"?e.valueOf():e}function xK(e=al){if(e===al)return dB;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function dB(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const SK=Math.sqrt(50),wK=Math.sqrt(10),_K=Math.sqrt(2);function cy(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),l=s>=SK?10:s>=wK?5:s>=_K?2:1;let c,f,d;return i<0?(d=Math.pow(10,-i)/l,c=Math.round(e*d),f=Math.round(t*d),c/dt&&--f,d=-d):(d=Math.pow(10,i)*l,c=Math.round(e/d),f=Math.round(t/d),c*dt&&--f),f0))return[];if(e===t)return[e];const r=t=i))return[];const c=s-i+1,f=new Array(c);if(r)if(l<0)for(let d=0;d=r)&&(n=r);return n}function TN(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function hB(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?dB:xK(i);r>n;){if(r-n>600){const f=r-n+1,d=t-n+1,m=Math.log(f),p=.5*Math.exp(2*m/3),v=.5*Math.sqrt(m*p*(f-p)/f)*(d-f/2<0?-1:1),b=Math.max(n,Math.floor(t-d*p/f+v)),w=Math.min(r,Math.floor(t+(f-d)*p/f+v));hB(e,t,b,w,i)}const s=e[t];let l=n,c=r;for(oh(e,n,t),i(e[r],s)>0&&oh(e,n,r);l0;)--c}i(e[n],s)===0?oh(e,n,c):(++c,oh(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function oh(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function AK(e,t,n){if(e=Float64Array.from(mK(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return TN(e);if(t>=1)return ON(e);var r,i=(r-1)*t,s=Math.floor(i),l=ON(hB(e,s).subarray(0,s+1)),c=TN(e.subarray(s+1));return l+(c-l)*(i-s)}}function OK(e,t,n=fB){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,s=Math.floor(i),l=+n(e[s],s,e),c=+n(e[s+1],s+1,e);return l+(c-l)*(i-s)}}function TK(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?wv(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?wv(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=MK.exec(e))?new ui(t[1],t[2],t[3],1):(t=jK.exec(e))?new ui(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=CK.exec(e))?wv(t[1],t[2],t[3],t[4]):(t=PK.exec(e))?wv(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=DK.exec(e))?RN(t[1],t[2]/100,t[3]/100,1):(t=RK.exec(e))?RN(t[1],t[2]/100,t[3]/100,t[4]):EN.hasOwnProperty(e)?CN(EN[e]):e==="transparent"?new ui(NaN,NaN,NaN,0):null}function CN(e){return new ui(e>>16&255,e>>8&255,e&255,1)}function wv(e,t,n,r){return r<=0&&(e=t=n=NaN),new ui(e,t,n,r)}function LK(e){return e instanceof $p||(e=ep(e)),e?(e=e.rgb(),new ui(e.r,e.g,e.b,e.opacity)):new ui}function SA(e,t,n,r){return arguments.length===1?LK(e):new ui(e,t,n,r??1)}function ui(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}AT(ui,SA,mB($p,{brighter(e){return e=e==null?fy:Math.pow(fy,e),new ui(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Zh:Math.pow(Zh,e),new ui(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ui(hu(this.r),hu(this.g),hu(this.b),dy(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:PN,formatHex:PN,formatHex8:zK,formatRgb:DN,toString:DN}));function PN(){return`#${Jl(this.r)}${Jl(this.g)}${Jl(this.b)}`}function zK(){return`#${Jl(this.r)}${Jl(this.g)}${Jl(this.b)}${Jl((isNaN(this.opacity)?1:this.opacity)*255)}`}function DN(){const e=dy(this.opacity);return`${e===1?"rgb(":"rgba("}${hu(this.r)}, ${hu(this.g)}, ${hu(this.b)}${e===1?")":`, ${e})`}`}function dy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function hu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Jl(e){return e=hu(e),(e<16?"0":"")+e.toString(16)}function RN(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new _a(e,t,n,r)}function vB(e){if(e instanceof _a)return new _a(e.h,e.s,e.l,e.opacity);if(e instanceof $p||(e=ep(e)),!e)return new _a;if(e instanceof _a)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),l=NaN,c=s-i,f=(s+i)/2;return c?(t===s?l=(n-r)/c+(n0&&f<1?0:l,new _a(l,c,f,e.opacity)}function $K(e,t,n,r){return arguments.length===1?vB(e):new _a(e,t,n,r??1)}function _a(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}AT(_a,$K,mB($p,{brighter(e){return e=e==null?fy:Math.pow(fy,e),new _a(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Zh:Math.pow(Zh,e),new _a(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ui(yw(e>=240?e-240:e+120,i,r),yw(e,i,r),yw(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new _a(NN(this.h),_v(this.s),_v(this.l),dy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=dy(this.opacity);return`${e===1?"hsl(":"hsla("}${NN(this.h)}, ${_v(this.s)*100}%, ${_v(this.l)*100}%${e===1?")":`, ${e})`}`}}));function NN(e){return e=(e||0)%360,e<0?e+360:e}function _v(e){return Math.max(0,Math.min(1,e||0))}function yw(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const OT=e=>()=>e;function BK(e,t){return function(n){return e+n*t}}function qK(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function IK(e){return(e=+e)==1?yB:function(t,n){return n-t?qK(t,n,e):OT(isNaN(t)?n:t)}}function yB(e,t){var n=t-e;return n?BK(e,n):OT(isNaN(e)?t:e)}const kN=(function e(t){var n=IK(t);function r(i,s){var l=n((i=SA(i)).r,(s=SA(s)).r),c=n(i.g,s.g),f=n(i.b,s.b),d=yB(i.opacity,s.opacity);return function(m){return i.r=l(m),i.g=c(m),i.b=f(m),i.opacity=d(m),i+""}}return r.gamma=e,r})(1);function UK(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;in&&(s=t.slice(n,s),c[l]?c[l]+=s:c[++l]=s),(r=r[0])===(i=i[0])?c[l]?c[l]+=i:c[++l]=i:(c[++l]=null,f.push({i:l,x:hy(r,i)})),n=gw.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function JK(e,t,n){var r=e[0],i=e[1],s=t[0],l=t[1];return i2?eY:JK,f=d=null,p}function p(v){return v==null||isNaN(v=+v)?s:(f||(f=c(e.map(r),t,n)))(r(l(v)))}return p.invert=function(v){return l(i((d||(d=c(t,e.map(r),hy)))(v)))},p.domain=function(v){return arguments.length?(e=Array.from(v,py),m()):e.slice()},p.range=function(v){return arguments.length?(t=Array.from(v),m()):t.slice()},p.rangeRound=function(v){return t=Array.from(v),n=TT,m()},p.clamp=function(v){return arguments.length?(l=v?!0:Yr,m()):l!==Yr},p.interpolate=function(v){return arguments.length?(n=v,m()):n},p.unknown=function(v){return arguments.length?(s=v,p):s},function(v,b){return r=v,i=b,m()}}function ET(){return _g()(Yr,Yr)}function tY(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function my(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function uf(e){return e=my(Math.abs(e)),e?e[1]:NaN}function nY(e,t){return function(n,r){for(var i=n.length,s=[],l=0,c=e[0],f=0;i>0&&c>0&&(f+c+1>r&&(c=Math.max(1,r-f)),s.push(n.substring(i-=c,i+c)),!((f+=c+1)>r));)c=e[l=(l+1)%e.length];return s.reverse().join(t)}}function rY(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var iY=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function tp(e){if(!(t=iY.exec(e)))throw new Error("invalid format: "+e);var t;return new MT({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}tp.prototype=MT.prototype;function MT(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}MT.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function aY(e){e:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var vy;function oY(e,t){var n=my(e,t);if(!n)return vy=void 0,e.toPrecision(t);var r=n[0],i=n[1],s=i-(vy=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return s===l?r:s>l?r+new Array(s-l+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+my(e,Math.max(0,t+s-1))[0]}function zN(e,t){var n=my(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const $N={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:tY,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>zN(e*100,t),r:zN,s:oY,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function BN(e){return e}var qN=Array.prototype.map,IN=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function sY(e){var t=e.grouping===void 0||e.thousands===void 0?BN:nY(qN.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?BN:rY(qN.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function d(p,v){p=tp(p);var b=p.fill,w=p.align,S=p.sign,x=p.symbol,A=p.zero,_=p.width,M=p.comma,E=p.precision,O=p.trim,j=p.type;j==="n"?(M=!0,j="g"):$N[j]||(E===void 0&&(E=12),O=!0,j="g"),(A||b==="0"&&w==="=")&&(A=!0,b="0",w="=");var R=(v&&v.prefix!==void 0?v.prefix:"")+(x==="$"?n:x==="#"&&/[boxX]/.test(j)?"0"+j.toLowerCase():""),k=(x==="$"?r:/[%p]/.test(j)?l:"")+(v&&v.suffix!==void 0?v.suffix:""),z=$N[j],G=/[defgprs%]/.test(j);E=E===void 0?6:/[gprs]/.test(j)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function $(B){var Z=R,ee=k,J,q,F;if(j==="c")ee=z(B)+ee,B="";else{B=+B;var ie=B<0||1/B<0;if(B=isNaN(B)?f:z(Math.abs(B),E),O&&(B=aY(B)),ie&&+B==0&&S!=="+"&&(ie=!1),Z=(ie?S==="("?S:c:S==="-"||S==="("?"":S)+Z,ee=(j==="s"&&!isNaN(B)&&vy!==void 0?IN[8+vy/3]:"")+ee+(ie&&S==="("?")":""),G){for(J=-1,q=B.length;++JF||F>57){ee=(F===46?i+B.slice(J+1):B.slice(J))+ee,B=B.slice(0,J);break}}}M&&!A&&(B=t(B,1/0));var ce=Z.length+B.length+ee.length,U=ce<_?new Array(_-ce+1).join(b):"";switch(M&&A&&(B=t(U+B,U.length?_-ee.length:1/0),U=""),w){case"<":B=Z+B+ee+U;break;case"=":B=Z+U+B+ee;break;case"^":B=U.slice(0,ce=U.length>>1)+Z+B+ee+U.slice(ce);break;default:B=U+Z+B+ee;break}return s(B)}return $.toString=function(){return p+""},$}function m(p,v){var b=Math.max(-8,Math.min(8,Math.floor(uf(v)/3)))*3,w=Math.pow(10,-b),S=d((p=tp(p),p.type="f",p),{suffix:IN[8+b/3]});return function(x){return S(w*x)}}return{format:d,formatPrefix:m}}var Av,jT,gB;lY({thousands:",",grouping:[3],currency:["$",""]});function lY(e){return Av=sY(e),jT=Av.format,gB=Av.formatPrefix,Av}function uY(e){return Math.max(0,-uf(Math.abs(e)))}function cY(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(uf(t)/3)))*3-uf(Math.abs(e)))}function fY(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,uf(t)-uf(e))+1}function bB(e,t,n,r){var i=bA(e,t,n),s;switch(r=tp(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=cY(i,l))&&(r.precision=s),gB(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=fY(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=uY(i))&&(r.precision=s-(r.type==="%")*2);break}}return jT(r)}function fl(e){var t=e.domain;return e.ticks=function(n){var r=t();return yA(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return bB(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,l=r[i],c=r[s],f,d,m=10;for(c0;){if(d=gA(l,c,n),d===f)return r[i]=l,r[s]=c,t(r);if(d>0)l=Math.floor(l/d)*d,c=Math.ceil(c/d)*d;else if(d<0)l=Math.ceil(l*d)/d,c=Math.floor(c*d)/d;else break;f=d}return e},e}function yy(){var e=ET();return e.copy=function(){return Bp(e,yy())},sa.apply(e,arguments),fl(e)}function xB(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,py),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return xB(e).unknown(t)},e=arguments.length?Array.from(e,py):[0,1],fl(n)}function SB(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],l;return sMath.pow(e,t)}function vY(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function HN(e){return(t,n)=>-e(-t,n)}function CT(e){const t=e(UN,VN),n=t.domain;let r=10,i,s;function l(){return i=vY(r),s=mY(r),n()[0]<0?(i=HN(i),s=HN(s),e(dY,hY)):e(UN,VN),t}return t.base=function(c){return arguments.length?(r=+c,l()):r},t.domain=function(c){return arguments.length?(n(c),l()):n()},t.ticks=c=>{const f=n();let d=f[0],m=f[f.length-1];const p=m0){for(;v<=b;++v)for(w=1;wm)break;A.push(S)}}else for(;v<=b;++v)for(w=r-1;w>=1;--w)if(S=v>0?w/s(-v):w*s(v),!(Sm)break;A.push(S)}A.length*2{if(c==null&&(c=10),f==null&&(f=r===10?"s":","),typeof f!="function"&&(!(r%1)&&(f=tp(f)).precision==null&&(f.trim=!0),f=jT(f)),c===1/0)return f;const d=Math.max(1,r*c/t.ticks().length);return m=>{let p=m/s(Math.round(i(m)));return p*rn(SB(n(),{floor:c=>s(Math.floor(i(c))),ceil:c=>s(Math.ceil(i(c)))})),t}function wB(){const e=CT(_g()).domain([1,10]);return e.copy=()=>Bp(e,wB()).base(e.base()),sa.apply(e,arguments),e}function FN(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function GN(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function PT(e){var t=1,n=e(FN(t),GN(t));return n.constant=function(r){return arguments.length?e(FN(t=+r),GN(t)):t},fl(n)}function _B(){var e=PT(_g());return e.copy=function(){return Bp(e,_B()).constant(e.constant())},sa.apply(e,arguments)}function KN(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function yY(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function gY(e){return e<0?-e*e:e*e}function DT(e){var t=e(Yr,Yr),n=1;function r(){return n===1?e(Yr,Yr):n===.5?e(yY,gY):e(KN(n),KN(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},fl(t)}function RT(){var e=DT(_g());return e.copy=function(){return Bp(e,RT()).exponent(e.exponent())},sa.apply(e,arguments),e}function bY(){return RT.apply(null,arguments).exponent(.5)}function YN(e){return Math.sign(e)*e*e}function xY(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function AB(){var e=ET(),t=[0,1],n=!1,r;function i(s){var l=xY(e(s));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(s){return e.invert(YN(s))},i.domain=function(s){return arguments.length?(e.domain(s),i):e.domain()},i.range=function(s){return arguments.length?(e.range((t=Array.from(s,py)).map(YN)),i):t.slice()},i.rangeRound=function(s){return i.range(s).round(!0)},i.round=function(s){return arguments.length?(n=!!s,i):n},i.clamp=function(s){return arguments.length?(e.clamp(s),i):e.clamp()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return AB(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},sa.apply(i,arguments),fl(i)}function OB(){var e=[],t=[],n=[],r;function i(){var l=0,c=Math.max(1,t.length);for(n=new Array(c-1);++l0?n[c-1]:e[0],c=n?[r[n-1],t]:[r[d-1],r[d]]},l.unknown=function(f){return arguments.length&&(s=f),l},l.thresholds=function(){return r.slice()},l.copy=function(){return TB().domain([e,t]).range(i).unknown(s)},sa.apply(fl(l),arguments)}function EB(){var e=[.5],t=[0,1],n,r=1;function i(s){return s!=null&&s<=s?t[zp(e,s,0,r)]:n}return i.domain=function(s){return arguments.length?(e=Array.from(s),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(s){return arguments.length?(t=Array.from(s),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(s){var l=t.indexOf(s);return[e[l-1],e[l]]},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return EB().domain(e).range(t).unknown(n)},sa.apply(i,arguments)}const bw=new Date,xw=new Date;function nr(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const l=i(s),c=i.ceil(s);return s-l(t(s=new Date(+s),l==null?1:Math.floor(l)),s),i.range=(s,l,c)=>{const f=[];if(s=i.ceil(s),c=c==null?1:Math.floor(c),!(s0))return f;let d;do f.push(d=new Date(+s)),t(s,c),e(s);while(dnr(l=>{if(l>=l)for(;e(l),!s(l);)l.setTime(l-1)},(l,c)=>{if(l>=l)if(c<0)for(;++c<=0;)for(;t(l,-1),!s(l););else for(;--c>=0;)for(;t(l,1),!s(l););}),n&&(i.count=(s,l)=>(bw.setTime(+s),xw.setTime(+l),e(bw),e(xw),Math.floor(n(bw,xw))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?l=>r(l)%s===0:l=>i.count(0,l)%s===0):i)),i}const gy=nr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);gy.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?nr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):gy);gy.range;const Lo=1e3,ra=Lo*60,zo=ra*60,Ko=zo*24,NT=Ko*7,XN=Ko*30,Sw=Ko*365,eu=nr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Lo)},(e,t)=>(t-e)/Lo,e=>e.getUTCSeconds());eu.range;const kT=nr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Lo)},(e,t)=>{e.setTime(+e+t*ra)},(e,t)=>(t-e)/ra,e=>e.getMinutes());kT.range;const LT=nr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ra)},(e,t)=>(t-e)/ra,e=>e.getUTCMinutes());LT.range;const zT=nr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Lo-e.getMinutes()*ra)},(e,t)=>{e.setTime(+e+t*zo)},(e,t)=>(t-e)/zo,e=>e.getHours());zT.range;const $T=nr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*zo)},(e,t)=>(t-e)/zo,e=>e.getUTCHours());$T.range;const qp=nr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ra)/Ko,e=>e.getDate()-1);qp.range;const Ag=nr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ko,e=>e.getUTCDate()-1);Ag.range;const MB=nr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ko,e=>Math.floor(e/Ko));MB.range;function ju(e){return nr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*ra)/NT)}const Og=ju(0),by=ju(1),SY=ju(2),wY=ju(3),cf=ju(4),_Y=ju(5),AY=ju(6);Og.range;by.range;SY.range;wY.range;cf.range;_Y.range;AY.range;function Cu(e){return nr(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/NT)}const Tg=Cu(0),xy=Cu(1),OY=Cu(2),TY=Cu(3),ff=Cu(4),EY=Cu(5),MY=Cu(6);Tg.range;xy.range;OY.range;TY.range;ff.range;EY.range;MY.range;const BT=nr(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());BT.range;const qT=nr(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());qT.range;const Yo=nr(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Yo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:nr(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Yo.range;const Xo=nr(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Xo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:nr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Xo.range;function jB(e,t,n,r,i,s){const l=[[eu,1,Lo],[eu,5,5*Lo],[eu,15,15*Lo],[eu,30,30*Lo],[s,1,ra],[s,5,5*ra],[s,15,15*ra],[s,30,30*ra],[i,1,zo],[i,3,3*zo],[i,6,6*zo],[i,12,12*zo],[r,1,Ko],[r,2,2*Ko],[n,1,NT],[t,1,XN],[t,3,3*XN],[e,1,Sw]];function c(d,m,p){const v=mx).right(l,v);if(b===l.length)return e.every(bA(d/Sw,m/Sw,p));if(b===0)return gy.every(Math.max(bA(d,m,p),1));const[w,S]=l[v/l[b-1][2]53)return null;"w"in he||(he.w=1),"Z"in he?(Te=_w(sh(he.y,0,1)),We=Te.getUTCDay(),Te=We>4||We===0?xy.ceil(Te):xy(Te),Te=Ag.offset(Te,(he.V-1)*7),he.y=Te.getUTCFullYear(),he.m=Te.getUTCMonth(),he.d=Te.getUTCDate()+(he.w+6)%7):(Te=ww(sh(he.y,0,1)),We=Te.getDay(),Te=We>4||We===0?by.ceil(Te):by(Te),Te=qp.offset(Te,(he.V-1)*7),he.y=Te.getFullYear(),he.m=Te.getMonth(),he.d=Te.getDate()+(he.w+6)%7)}else("W"in he||"U"in he)&&("w"in he||(he.w="u"in he?he.u%7:"W"in he?1:0),We="Z"in he?_w(sh(he.y,0,1)).getUTCDay():ww(sh(he.y,0,1)).getDay(),he.m=0,he.d="W"in he?(he.w+6)%7+he.W*7-(We+5)%7:he.w+he.U*7-(We+6)%7);return"Z"in he?(he.H+=he.Z/100|0,he.M+=he.Z%100,_w(he)):ww(he)}}function k(de,_e,Ee,he){for(var Ie=0,Te=_e.length,We=Ee.length,nt,yt;Ie=We)return-1;if(nt=_e.charCodeAt(Ie++),nt===37){if(nt=_e.charAt(Ie++),yt=O[nt in WN?_e.charAt(Ie++):nt],!yt||(he=yt(de,Ee,he))<0)return-1}else if(nt!=Ee.charCodeAt(he++))return-1}return he}function z(de,_e,Ee){var he=d.exec(_e.slice(Ee));return he?(de.p=m.get(he[0].toLowerCase()),Ee+he[0].length):-1}function G(de,_e,Ee){var he=b.exec(_e.slice(Ee));return he?(de.w=w.get(he[0].toLowerCase()),Ee+he[0].length):-1}function $(de,_e,Ee){var he=p.exec(_e.slice(Ee));return he?(de.w=v.get(he[0].toLowerCase()),Ee+he[0].length):-1}function B(de,_e,Ee){var he=A.exec(_e.slice(Ee));return he?(de.m=_.get(he[0].toLowerCase()),Ee+he[0].length):-1}function Z(de,_e,Ee){var he=S.exec(_e.slice(Ee));return he?(de.m=x.get(he[0].toLowerCase()),Ee+he[0].length):-1}function ee(de,_e,Ee){return k(de,t,_e,Ee)}function J(de,_e,Ee){return k(de,n,_e,Ee)}function q(de,_e,Ee){return k(de,r,_e,Ee)}function F(de){return l[de.getDay()]}function ie(de){return s[de.getDay()]}function ce(de){return f[de.getMonth()]}function U(de){return c[de.getMonth()]}function D(de){return i[+(de.getHours()>=12)]}function V(de){return 1+~~(de.getMonth()/3)}function X(de){return l[de.getUTCDay()]}function ue(de){return s[de.getUTCDay()]}function be(de){return f[de.getUTCMonth()]}function Se(de){return c[de.getUTCMonth()]}function ye(de){return i[+(de.getUTCHours()>=12)]}function Me(de){return 1+~~(de.getUTCMonth()/3)}return{format:function(de){var _e=j(de+="",M);return _e.toString=function(){return de},_e},parse:function(de){var _e=R(de+="",!1);return _e.toString=function(){return de},_e},utcFormat:function(de){var _e=j(de+="",E);return _e.toString=function(){return de},_e},utcParse:function(de){var _e=R(de+="",!0);return _e.toString=function(){return de},_e}}}var WN={"-":"",_:" ",0:"0"},hr=/^\s*\d+/,NY=/^%/,kY=/[\\^$*+?|[\]().{}]/g;function At(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s[t.toLowerCase(),n]))}function zY(e,t,n){var r=hr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function $Y(e,t,n){var r=hr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function BY(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function qY(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function IY(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function QN(e,t,n){var r=hr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function ZN(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function UY(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function VY(e,t,n){var r=hr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function HY(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function JN(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function FY(e,t,n){var r=hr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function ek(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function GY(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function KY(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function YY(e,t,n){var r=hr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function XY(e,t,n){var r=hr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function WY(e,t,n){var r=NY.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function QY(e,t,n){var r=hr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function ZY(e,t,n){var r=hr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function tk(e,t){return At(e.getDate(),t,2)}function JY(e,t){return At(e.getHours(),t,2)}function eX(e,t){return At(e.getHours()%12||12,t,2)}function tX(e,t){return At(1+qp.count(Yo(e),e),t,3)}function CB(e,t){return At(e.getMilliseconds(),t,3)}function nX(e,t){return CB(e,t)+"000"}function rX(e,t){return At(e.getMonth()+1,t,2)}function iX(e,t){return At(e.getMinutes(),t,2)}function aX(e,t){return At(e.getSeconds(),t,2)}function oX(e){var t=e.getDay();return t===0?7:t}function sX(e,t){return At(Og.count(Yo(e)-1,e),t,2)}function PB(e){var t=e.getDay();return t>=4||t===0?cf(e):cf.ceil(e)}function lX(e,t){return e=PB(e),At(cf.count(Yo(e),e)+(Yo(e).getDay()===4),t,2)}function uX(e){return e.getDay()}function cX(e,t){return At(by.count(Yo(e)-1,e),t,2)}function fX(e,t){return At(e.getFullYear()%100,t,2)}function dX(e,t){return e=PB(e),At(e.getFullYear()%100,t,2)}function hX(e,t){return At(e.getFullYear()%1e4,t,4)}function pX(e,t){var n=e.getDay();return e=n>=4||n===0?cf(e):cf.ceil(e),At(e.getFullYear()%1e4,t,4)}function mX(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+At(t/60|0,"0",2)+At(t%60,"0",2)}function nk(e,t){return At(e.getUTCDate(),t,2)}function vX(e,t){return At(e.getUTCHours(),t,2)}function yX(e,t){return At(e.getUTCHours()%12||12,t,2)}function gX(e,t){return At(1+Ag.count(Xo(e),e),t,3)}function DB(e,t){return At(e.getUTCMilliseconds(),t,3)}function bX(e,t){return DB(e,t)+"000"}function xX(e,t){return At(e.getUTCMonth()+1,t,2)}function SX(e,t){return At(e.getUTCMinutes(),t,2)}function wX(e,t){return At(e.getUTCSeconds(),t,2)}function _X(e){var t=e.getUTCDay();return t===0?7:t}function AX(e,t){return At(Tg.count(Xo(e)-1,e),t,2)}function RB(e){var t=e.getUTCDay();return t>=4||t===0?ff(e):ff.ceil(e)}function OX(e,t){return e=RB(e),At(ff.count(Xo(e),e)+(Xo(e).getUTCDay()===4),t,2)}function TX(e){return e.getUTCDay()}function EX(e,t){return At(xy.count(Xo(e)-1,e),t,2)}function MX(e,t){return At(e.getUTCFullYear()%100,t,2)}function jX(e,t){return e=RB(e),At(e.getUTCFullYear()%100,t,2)}function CX(e,t){return At(e.getUTCFullYear()%1e4,t,4)}function PX(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ff(e):ff.ceil(e),At(e.getUTCFullYear()%1e4,t,4)}function DX(){return"+0000"}function rk(){return"%"}function ik(e){return+e}function ak(e){return Math.floor(+e/1e3)}var wc,NB,kB;RX({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function RX(e){return wc=RY(e),NB=wc.format,wc.parse,kB=wc.utcFormat,wc.utcParse,wc}function NX(e){return new Date(e)}function kX(e){return e instanceof Date?+e:+new Date(+e)}function IT(e,t,n,r,i,s,l,c,f,d){var m=ET(),p=m.invert,v=m.domain,b=d(".%L"),w=d(":%S"),S=d("%I:%M"),x=d("%I %p"),A=d("%a %d"),_=d("%b %d"),M=d("%B"),E=d("%Y");function O(j){return(f(j)t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,s)=>AK(e,s/r))},n.copy=function(){return BB(t).domain(e)},ts.apply(n,arguments)}function Mg(){var e=0,t=.5,n=1,r=1,i,s,l,c,f,d=Yr,m,p=!1,v;function b(S){return isNaN(S=+S)?v:(S=.5+((S=+m(S))-s)*(r*Sn}return Ow=e,Ow}var Tw,uk;function IX(){if(uk)return Tw;uk=1;var e=VB(),t=qX(),n=Ff();function r(i){return i&&i.length?e(i,n,t):void 0}return Tw=r,Tw}var UX=IX();const tl=Ft(UX);var Ew,ck;function VX(){if(ck)return Ew;ck=1;function e(t,n){return te.e^s.s<0?1:-1;for(r=s.d.length,i=e.d.length,t=0,n=re.d[t]^s.s<0?1:-1;return r===i?0:r>i^s.s<0?1:-1};ke.decimalPlaces=ke.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*ln;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};ke.dividedBy=ke.div=function(e){return Io(this,new this.constructor(e))};ke.dividedToIntegerBy=ke.idiv=function(e){var t=this,n=t.constructor;return Xt(Io(t,new n(e),0,1),n.precision)};ke.equals=ke.eq=function(e){return!this.cmp(e)};ke.exponent=function(){return Fn(this)};ke.greaterThan=ke.gt=function(e){return this.cmp(e)>0};ke.greaterThanOrEqualTo=ke.gte=function(e){return this.cmp(e)>=0};ke.isInteger=ke.isint=function(){return this.e>this.d.length-2};ke.isNegative=ke.isneg=function(){return this.s<0};ke.isPositive=ke.ispos=function(){return this.s>0};ke.isZero=function(){return this.s===0};ke.lessThan=ke.lt=function(e){return this.cmp(e)<0};ke.lessThanOrEqualTo=ke.lte=function(e){return this.cmp(e)<1};ke.logarithm=ke.log=function(e){var t,n=this,r=n.constructor,i=r.precision,s=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Ci))throw Error(aa+"NaN");if(n.s<1)throw Error(aa+(n.s?"NaN":"-Infinity"));return n.eq(Ci)?new r(0):(hn=!1,t=Io(np(n,s),np(e,s),s),hn=!0,Xt(t,i))};ke.minus=ke.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?KB(t,e):FB(t,(e.s=-e.s,e))};ke.modulo=ke.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(aa+"NaN");return n.s?(hn=!1,t=Io(n,e,0,1).times(e),hn=!0,n.minus(t)):Xt(new r(n),i)};ke.naturalExponential=ke.exp=function(){return GB(this)};ke.naturalLogarithm=ke.ln=function(){return np(this)};ke.negated=ke.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ke.plus=ke.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?FB(t,e):KB(t,(e.s=-e.s,e))};ke.precision=ke.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(pu+e);if(t=Fn(i)+1,r=i.d.length-1,n=r*ln+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};ke.squareRoot=ke.sqrt=function(){var e,t,n,r,i,s,l,c=this,f=c.constructor;if(c.s<1){if(!c.s)return new f(0);throw Error(aa+"NaN")}for(e=Fn(c),hn=!1,i=Math.sqrt(+c),i==0||i==1/0?(t=Ga(c.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Yf((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new f(t)):r=new f(i.toString()),n=f.precision,i=l=n+3;;)if(s=r,r=s.plus(Io(c,s,l+2)).times(.5),Ga(s.d).slice(0,l)===(t=Ga(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(Xt(s,n+1,0),s.times(s).eq(c)){r=s;break}}else if(t!="9999")break;l+=4}return hn=!0,Xt(r,n)};ke.times=ke.mul=function(e){var t,n,r,i,s,l,c,f,d,m=this,p=m.constructor,v=m.d,b=(e=new p(e)).d;if(!m.s||!e.s)return new p(0);for(e.s*=m.s,n=m.e+e.e,f=v.length,d=b.length,f=0;){for(t=0,i=f+r;i>r;)c=s[i]+b[r]*v[i-r-1]+t,s[i--]=c%fr|0,t=c/fr|0;s[i]=(s[i]+t)%fr|0}for(;!s[--l];)s.pop();return t?++n:s.shift(),e.d=s,e.e=n,hn?Xt(e,p.precision):e};ke.toDecimalPlaces=ke.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(eo(e,0,Kf),t===void 0?t=r.rounding:eo(t,0,8),Xt(n,e+Fn(n)+1,t))};ke.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=_u(r,!0):(eo(e,0,Kf),t===void 0?t=i.rounding:eo(t,0,8),r=Xt(new i(r),e+1,t),n=_u(r,!0,e+1)),n};ke.toFixed=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?_u(i):(eo(e,0,Kf),t===void 0?t=s.rounding:eo(t,0,8),r=Xt(new s(i),e+Fn(i)+1,t),n=_u(r.abs(),!1,e+Fn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};ke.toInteger=ke.toint=function(){var e=this,t=e.constructor;return Xt(new t(e),Fn(e)+1,t.rounding)};ke.toNumber=function(){return+this};ke.toPower=ke.pow=function(e){var t,n,r,i,s,l,c=this,f=c.constructor,d=12,m=+(e=new f(e));if(!e.s)return new f(Ci);if(c=new f(c),!c.s){if(e.s<1)throw Error(aa+"Infinity");return c}if(c.eq(Ci))return c;if(r=f.precision,e.eq(Ci))return Xt(c,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=c.s,l){if((n=m<0?-m:m)<=HB){for(i=new f(Ci),t=Math.ceil(r/ln+4),hn=!1;n%2&&(i=i.times(c),vk(i.d,t)),n=Yf(n/2),n!==0;)c=c.times(c),vk(c.d,t);return hn=!0,e.s<0?new f(Ci).div(i):Xt(i,r)}}else if(s<0)throw Error(aa+"NaN");return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,hn=!1,i=e.times(np(c,r+d)),hn=!0,i=GB(i),i.s=s,i};ke.toPrecision=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?(n=Fn(i),r=_u(i,n<=s.toExpNeg||n>=s.toExpPos)):(eo(e,1,Kf),t===void 0?t=s.rounding:eo(t,0,8),i=Xt(new s(i),e,t),n=Fn(i),r=_u(i,e<=n||n<=s.toExpNeg,e)),r};ke.toSignificantDigits=ke.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(eo(e,1,Kf),t===void 0?t=r.rounding:eo(t,0,8)),Xt(new r(n),e,t)};ke.toString=ke.valueOf=ke.val=ke.toJSON=ke[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Fn(e),n=e.constructor;return _u(e,t<=n.toExpNeg||t>=n.toExpPos)};function FB(e,t){var n,r,i,s,l,c,f,d,m=e.constructor,p=m.precision;if(!e.s||!t.s)return t.s||(t=new m(e)),hn?Xt(t,p):t;if(f=e.d,d=t.d,l=e.e,i=t.e,f=f.slice(),s=l-i,s){for(s<0?(r=f,s=-s,c=d.length):(r=d,i=l,c=f.length),l=Math.ceil(p/ln),c=l>c?l+1:c+1,s>c&&(s=c,r.length=1),r.reverse();s--;)r.push(0);r.reverse()}for(c=f.length,s=d.length,c-s<0&&(s=c,r=d,d=f,f=r),n=0;s;)n=(f[--s]=f[s]+d[s]+n)/fr|0,f[s]%=fr;for(n&&(f.unshift(n),++i),c=f.length;f[--c]==0;)f.pop();return t.d=f,t.e=i,hn?Xt(t,p):t}function eo(e,t,n){if(e!==~~e||en)throw Error(pu+e)}function Ga(e){var t,n,r,i=e.length-1,s="",l=e[0];if(i>0){for(s+=l,t=1;tl?1:-1;else for(c=f=0;ci[c]?1:-1;break}return f}function n(r,i,s){for(var l=0;s--;)r[s]-=l,l=r[s]1;)r.shift()}return function(r,i,s,l){var c,f,d,m,p,v,b,w,S,x,A,_,M,E,O,j,R,k,z=r.constructor,G=r.s==i.s?1:-1,$=r.d,B=i.d;if(!r.s)return new z(r);if(!i.s)throw Error(aa+"Division by zero");for(f=r.e-i.e,R=B.length,O=$.length,b=new z(G),w=b.d=[],d=0;B[d]==($[d]||0);)++d;if(B[d]>($[d]||0)&&--f,s==null?_=s=z.precision:l?_=s+(Fn(r)-Fn(i))+1:_=s,_<0)return new z(0);if(_=_/ln+2|0,d=0,R==1)for(m=0,B=B[0],_++;(d1&&(B=e(B,m),$=e($,m),R=B.length,O=$.length),E=R,S=$.slice(0,R),x=S.length;x=fr/2&&++j;do m=0,c=t(B,S,R,x),c<0?(A=S[0],R!=x&&(A=A*fr+(S[1]||0)),m=A/j|0,m>1?(m>=fr&&(m=fr-1),p=e(B,m),v=p.length,x=S.length,c=t(p,S,v,x),c==1&&(m--,n(p,R16)throw Error(HT+Fn(e));if(!e.s)return new m(Ci);for(hn=!1,c=p,l=new m(.03125);e.abs().gte(.1);)e=e.times(l),d+=5;for(r=Math.log(Fl(2,d))/Math.LN10*2+5|0,c+=r,n=i=s=new m(Ci),m.precision=c;;){if(i=Xt(i.times(e),c),n=n.times(++f),l=s.plus(Io(i,n,c)),Ga(l.d).slice(0,c)===Ga(s.d).slice(0,c)){for(;d--;)s=Xt(s.times(s),c);return m.precision=p,t==null?(hn=!0,Xt(s,p)):s}s=l}}function Fn(e){for(var t=e.e*ln,n=e.d[0];n>=10;n/=10)t++;return t}function Dw(e,t,n){if(t>e.LN10.sd())throw hn=!0,n&&(e.precision=n),Error(aa+"LN10 precision limit exceeded");return Xt(new e(e.LN10),t)}function Vs(e){for(var t="";e--;)t+="0";return t}function np(e,t){var n,r,i,s,l,c,f,d,m,p=1,v=10,b=e,w=b.d,S=b.constructor,x=S.precision;if(b.s<1)throw Error(aa+(b.s?"NaN":"-Infinity"));if(b.eq(Ci))return new S(0);if(t==null?(hn=!1,d=x):d=t,b.eq(10))return t==null&&(hn=!0),Dw(S,d);if(d+=v,S.precision=d,n=Ga(w),r=n.charAt(0),s=Fn(b),Math.abs(s)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)b=b.times(e),n=Ga(b.d),r=n.charAt(0),p++;s=Fn(b),r>1?(b=new S("0."+n),s++):b=new S(r+"."+n.slice(1))}else return f=Dw(S,d+2,x).times(s+""),b=np(new S(r+"."+n.slice(1)),d-v).plus(f),S.precision=x,t==null?(hn=!0,Xt(b,x)):b;for(c=l=b=Io(b.minus(Ci),b.plus(Ci),d),m=Xt(b.times(b),d),i=3;;){if(l=Xt(l.times(m),d),f=c.plus(Io(l,new S(i),d)),Ga(f.d).slice(0,d)===Ga(c.d).slice(0,d))return c=c.times(2),s!==0&&(c=c.plus(Dw(S,d+2,x).times(s+""))),c=Io(c,new S(p),d),S.precision=x,t==null?(hn=!0,Xt(c,x)):c;c=f,i+=2}}function mk(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=Yf(n/ln),e.d=[],r=(n+1)%ln,n<0&&(r+=ln),rSy||e.e<-Sy))throw Error(HT+n)}else e.s=0,e.e=0,e.d=[0];return e}function Xt(e,t,n){var r,i,s,l,c,f,d,m,p=e.d;for(l=1,s=p[0];s>=10;s/=10)l++;if(r=t-l,r<0)r+=ln,i=t,d=p[m=0];else{if(m=Math.ceil((r+1)/ln),s=p.length,m>=s)return e;for(d=s=p[m],l=1;s>=10;s/=10)l++;r%=ln,i=r-ln+l}if(n!==void 0&&(s=Fl(10,l-i-1),c=d/s%10|0,f=t<0||p[m+1]!==void 0||d%s,f=n<4?(c||f)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||f||n==6&&(r>0?i>0?d/Fl(10,l-i):0:p[m-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return f?(s=Fn(e),p.length=1,t=t-s-1,p[0]=Fl(10,(ln-t%ln)%ln),e.e=Yf(-t/ln)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(r==0?(p.length=m,s=1,m--):(p.length=m+1,s=Fl(10,ln-r),p[m]=i>0?(d/Fl(10,l-i)%Fl(10,i)|0)*s:0),f)for(;;)if(m==0){(p[0]+=s)==fr&&(p[0]=1,++e.e);break}else{if(p[m]+=s,p[m]!=fr)break;p[m--]=0,s=1}for(r=p.length;p[--r]===0;)p.pop();if(hn&&(e.e>Sy||e.e<-Sy))throw Error(HT+Fn(e));return e}function KB(e,t){var n,r,i,s,l,c,f,d,m,p,v=e.constructor,b=v.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new v(e),hn?Xt(t,b):t;if(f=e.d,p=t.d,r=t.e,d=e.e,f=f.slice(),l=d-r,l){for(m=l<0,m?(n=f,l=-l,c=p.length):(n=p,r=d,c=f.length),i=Math.max(Math.ceil(b/ln),c)+2,l>i&&(l=i,n.length=1),n.reverse(),i=l;i--;)n.push(0);n.reverse()}else{for(i=f.length,c=p.length,m=i0;--i)f[c++]=0;for(i=p.length;i>l;){if(f[--i]0?s=s.charAt(0)+"."+s.slice(1)+Vs(r):l>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+Vs(-i-1)+s,n&&(r=n-l)>0&&(s+=Vs(r))):i>=l?(s+=Vs(i+1-l),n&&(r=n-i-1)>0&&(s=s+"."+Vs(r))):((r=i+1)0&&(i+1===l&&(s+="."),s+=Vs(r))),e.s<0?"-"+s:s}function vk(e,t){if(e.length>t)return e.length=t,!0}function YB(e){var t,n,r;function i(s){var l=this;if(!(l instanceof i))return new i(s);if(l.constructor=i,s instanceof i){l.s=s.s,l.e=s.e,l.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(pu+s);if(s>0)l.s=1;else if(s<0)s=-s,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(s===~~s&&s<1e7){l.e=0,l.d=[s];return}return mk(l,s.toString())}else if(typeof s!="string")throw Error(pu+s);if(s.charCodeAt(0)===45?(s=s.slice(1),l.s=-1):l.s=1,JX.test(s))mk(l,s);else throw Error(pu+s)}if(i.prototype=ke,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=YB,i.config=i.set=eW,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(pu+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(pu+n+": "+r);return this}var FT=YB(ZX);Ci=new FT(1);const Ht=FT;function tW(e){return aW(e)||iW(e)||rW(e)||nW()}function nW(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rW(e,t){if(e){if(typeof e=="string")return AA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return AA(e,t)}}function iW(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function aW(e){if(Array.isArray(e))return AA(e)}function AA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t?n.apply(void 0,i):e(t-l,yk(function(){for(var c=arguments.length,f=new Array(c),d=0;de.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,s=void 0;try{for(var l=e[Symbol.iterator](),c;!(r=(c=l.next()).done)&&(n.push(c.value),!(t&&n.length===t));r=!0);}catch(f){i=!0,s=f}finally{try{!r&&l.return!=null&&l.return()}finally{if(i)throw s}}return n}}function xW(e){if(Array.isArray(e))return e}function JB(e){var t=rp(e,2),n=t[0],r=t[1],i=n,s=r;return n>r&&(i=r,s=n),[i,s]}function eq(e,t,n){if(e.lte(0))return new Ht(0);var r=Pg.getDigitCount(e.toNumber()),i=new Ht(10).pow(r),s=e.div(i),l=r!==1?.05:.1,c=new Ht(Math.ceil(s.div(l).toNumber())).add(n).mul(l),f=c.mul(i);return t?f:new Ht(Math.ceil(f))}function SW(e,t,n){var r=1,i=new Ht(e);if(!i.isint()&&n){var s=Math.abs(e);s<1?(r=new Ht(10).pow(Pg.getDigitCount(e)-1),i=new Ht(Math.floor(i.div(r).toNumber())).mul(r)):s>1&&(i=new Ht(Math.floor(e)))}else e===0?i=new Ht(Math.floor((t-1)/2)):n||(i=new Ht(Math.floor(e)));var l=Math.floor((t-1)/2),c=uW(lW(function(f){return i.add(new Ht(f-l).mul(r)).toNumber()}),OA);return c(0,t)}function tq(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Ht(0),tickMin:new Ht(0),tickMax:new Ht(0)};var s=eq(new Ht(t).sub(e).div(n-1),r,i),l;e<=0&&t>=0?l=new Ht(0):(l=new Ht(e).add(t).div(2),l=l.sub(new Ht(l).mod(s)));var c=Math.ceil(l.sub(e).div(s).toNumber()),f=Math.ceil(new Ht(t).sub(l).div(s).toNumber()),d=c+f+1;return d>n?tq(e,t,n,r,i+1):(d0?f+(n-d):f,c=t>0?c:c+(n-d)),{step:s,tickMin:l.sub(new Ht(c).mul(s)),tickMax:l.add(new Ht(f).mul(s))})}function wW(e){var t=rp(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=Math.max(i,2),c=JB([n,r]),f=rp(c,2),d=f[0],m=f[1];if(d===-1/0||m===1/0){var p=m===1/0?[d].concat(EA(OA(0,i-1).map(function(){return 1/0}))):[].concat(EA(OA(0,i-1).map(function(){return-1/0})),[m]);return n>r?TA(p):p}if(d===m)return SW(d,i,s);var v=tq(d,m,l,s),b=v.step,w=v.tickMin,S=v.tickMax,x=Pg.rangeStep(w,S.add(new Ht(.1).mul(b)),b);return n>r?TA(x):x}function _W(e,t){var n=rp(e,2),r=n[0],i=n[1],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=JB([r,i]),c=rp(l,2),f=c[0],d=c[1];if(f===-1/0||d===1/0)return[r,i];if(f===d)return[f];var m=Math.max(t,2),p=eq(new Ht(d).sub(f).div(m-1),s,0),v=[].concat(EA(Pg.rangeStep(new Ht(f),new Ht(d).sub(new Ht(.99).mul(p)),p)),[d]);return r>i?TA(v):v}var AW=QB(wW),OW=QB(_W),TW="Invariant failed";function Au(e,t){throw new Error(TW)}var EW=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function df(e){"@babel/helpers - typeof";return df=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},df(e)}function wy(){return wy=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function NW(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function kW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LW(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,l=-1,c=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(c<=1)return 0;if(s&&s.axisType==="angleAxis"&&Math.abs(Math.abs(s.range[1]-s.range[0])-360)<=1e-6)for(var f=s.range,d=0;d0?i[d-1].coordinate:i[c-1].coordinate,p=i[d].coordinate,v=d>=c-1?i[0].coordinate:i[d+1].coordinate,b=void 0;if(Oa(p-m)!==Oa(v-p)){var w=[];if(Oa(v-p)===Oa(f[1]-f[0])){b=v;var S=p+f[1]-f[0];w[0]=Math.min(S,(S+m)/2),w[1]=Math.max(S,(S+m)/2)}else{b=m;var x=v+f[1]-f[0];w[0]=Math.min(p,(x+p)/2),w[1]=Math.max(p,(x+p)/2)}var A=[Math.min(p,(b+p)/2),Math.max(p,(b+p)/2)];if(t>A[0]&&t<=A[1]||t>=w[0]&&t<=w[1]){l=i[d].index;break}}else{var _=Math.min(m,v),M=Math.max(m,v);if(t>(_+p)/2&&t<=(M+p)/2){l=i[d].index;break}}}else for(var E=0;E0&&E(r[E].coordinate+r[E-1].coordinate)/2&&t<=(r[E].coordinate+r[E+1].coordinate)/2||E===c-1&&t>(r[E].coordinate+r[E-1].coordinate)/2){l=r[E].index;break}return l},GT=function(t){var n,r=t,i=r.type.displayName,s=(n=t.type)!==null&&n!==void 0&&n.defaultProps?An(An({},t.type.defaultProps),t.props):t.props,l=s.stroke,c=s.fill,f;switch(i){case"Line":f=l;break;case"Area":case"Radar":f=l&&l!=="none"?l:c;break;default:f=c;break}return f},JW=function(t){var n=t.barSize,r=t.totalSize,i=t.stackGroups,s=i===void 0?{}:i;if(!s)return{};for(var l={},c=Object.keys(s),f=0,d=c.length;f=0});if(A&&A.length){var _=A[0].type.defaultProps,M=_!==void 0?An(An({},_),A[0].props):A[0].props,E=M.barSize,O=M[x];l[O]||(l[O]=[]);var j=Qe(E)?n:E;l[O].push({item:A[0],stackList:A.slice(1),barSize:Qe(j)?void 0:Su(j,r,0)})}}return l},eQ=function(t){var n=t.barGap,r=t.barCategoryGap,i=t.bandSize,s=t.sizeList,l=s===void 0?[]:s,c=t.maxBarSize,f=l.length;if(f<1)return null;var d=Su(n,i,0,!0),m,p=[];if(l[0].barSize===+l[0].barSize){var v=!1,b=i/f,w=l.reduce(function(E,O){return E+O.barSize||0},0);w+=(f-1)*d,w>=i&&(w-=(f-1)*d,d=0),w>=i&&b>0&&(v=!0,b*=.9,w=f*b);var S=(i-w)/2>>0,x={offset:S-d,size:0};m=l.reduce(function(E,O){var j={item:O.item,position:{offset:x.offset+x.size+d,size:v?b:O.barSize}},R=[].concat(xk(E),[j]);return x=R[R.length-1].position,O.stackList&&O.stackList.length&&O.stackList.forEach(function(k){R.push({item:k,position:x})}),R},p)}else{var A=Su(r,i,0,!0);i-2*A-(f-1)*d<=0&&(d=0);var _=(i-2*A-(f-1)*d)/f;_>1&&(_>>=0);var M=c===+c?Math.min(_,c):_;m=l.reduce(function(E,O,j){var R=[].concat(xk(E),[{item:O.item,position:{offset:A+(_+d)*j+(_-M)/2,size:M}}]);return O.stackList&&O.stackList.length&&O.stackList.forEach(function(k){R.push({item:k,position:R[R.length-1].position})}),R},p)}return m},tQ=function(t,n,r,i){var s=r.children,l=r.width,c=r.margin,f=l-(c.left||0)-(c.right||0),d=aq({children:s,legendWidth:f});if(d){var m=i||{},p=m.width,v=m.height,b=d.align,w=d.verticalAlign,S=d.layout;if((S==="vertical"||S==="horizontal"&&w==="middle")&&b!=="center"&&Oe(t[b]))return An(An({},t),{},Ic({},b,t[b]+(p||0)));if((S==="horizontal"||S==="vertical"&&b==="center")&&w!=="middle"&&Oe(t[w]))return An(An({},t),{},Ic({},w,t[w]+(v||0)))}return t},nQ=function(t,n,r){return Qe(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},oq=function(t,n,r,i,s){var l=n.props.children,c=ci(l,Xf).filter(function(d){return nQ(i,s,d.props.direction)});if(c&&c.length){var f=c.map(function(d){return d.props.dataKey});return t.reduce(function(d,m){var p=er(m,r);if(Qe(p))return d;var v=Array.isArray(p)?[jg(p),tl(p)]:[p,p],b=f.reduce(function(w,S){var x=er(m,S,0),A=v[0]-Math.abs(Array.isArray(x)?x[0]:x),_=v[1]+Math.abs(Array.isArray(x)?x[1]:x);return[Math.min(A,w[0]),Math.max(_,w[1])]},[1/0,-1/0]);return[Math.min(b[0],d[0]),Math.max(b[1],d[1])]},[1/0,-1/0])}return null},rQ=function(t,n,r,i,s){var l=n.map(function(c){return oq(t,c,r,s,i)}).filter(function(c){return!Qe(c)});return l&&l.length?l.reduce(function(c,f){return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]):null},sq=function(t,n,r,i,s){var l=n.map(function(f){var d=f.props.dataKey;return r==="number"&&d&&oq(t,f,d,i)||jh(t,d,r,s)});if(r==="number")return l.reduce(function(f,d){return[Math.min(f[0],d[0]),Math.max(f[1],d[1])]},[1/0,-1/0]);var c={};return l.reduce(function(f,d){for(var m=0,p=d.length;m=2?Oa(c[0]-c[1])*2*d:d,n&&(t.ticks||t.niceTicks)){var m=(t.ticks||t.niceTicks).map(function(p){var v=s?s.indexOf(p):p;return{coordinate:i(v)+d,value:p,offset:d}});return m.filter(function(p){return!Hf(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,v){return{coordinate:i(p)+d,value:p,index:v,offset:d}}):i.ticks&&!r?i.ticks(t.tickCount).map(function(p){return{coordinate:i(p)+d,value:p,offset:d}}):i.domain().map(function(p,v){return{coordinate:i(p)+d,value:s?s[p]:p,index:v,offset:d}})},Rw=new WeakMap,Ov=function(t,n){if(typeof n!="function")return t;Rw.has(t)||Rw.set(t,new WeakMap);var r=Rw.get(t);if(r.has(n))return r.get(n);var i=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},iQ=function(t,n,r){var i=t.scale,s=t.type,l=t.layout,c=t.axisType;if(i==="auto")return l==="radial"&&c==="radiusAxis"?{scale:Qh(),realScaleType:"band"}:l==="radial"&&c==="angleAxis"?{scale:yy(),realScaleType:"linear"}:s==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Mh(),realScaleType:"point"}:s==="category"?{scale:Qh(),realScaleType:"band"}:{scale:yy(),realScaleType:"linear"};if(xu(i)){var f="scale".concat(pg(i));return{scale:(ok[f]||Mh)(),realScaleType:ok[f]?f:"point"}}return tt(i)?{scale:i}:{scale:Mh(),realScaleType:"point"}},wk=1e-4,aQ=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,i=t.range(),s=Math.min(i[0],i[1])-wk,l=Math.max(i[0],i[1])+wk,c=t(n[0]),f=t(n[r-1]);(cl||fl)&&t.domain([n[0],n[r-1]])}},oQ=function(t,n){if(!t)return null;for(var r=0,i=t.length;ri)&&(s[1]=i),s[0]>i&&(s[0]=i),s[1]=0?(t[c][r][0]=s,t[c][r][1]=s+f,s=t[c][r][1]):(t[c][r][0]=l,t[c][r][1]=l+f,l=t[c][r][1])}},uQ=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r=0?(t[l][r][0]=s,t[l][r][1]=s+c,s=t[l][r][1]):(t[l][r][0]=0,t[l][r][1]=0)}},cQ={sign:lQ,expand:KF,none:rf,silhouette:YF,wiggle:XF,positive:uQ},fQ=function(t,n,r){var i=n.map(function(c){return c.props.dataKey}),s=cQ[r],l=GF().keys(i).value(function(c,f){return+er(c,f,0)}).order(oA).offset(s);return l(t)},dQ=function(t,n,r,i,s,l){if(!t)return null;var c=l?n.reverse():n,f={},d=c.reduce(function(p,v){var b,w=(b=v.type)!==null&&b!==void 0&&b.defaultProps?An(An({},v.type.defaultProps),v.props):v.props,S=w.stackId,x=w.hide;if(x)return p;var A=w[r],_=p[A]||{hasStack:!1,stackGroups:{}};if(Jn(S)){var M=_.stackGroups[S]||{numericAxisId:r,cateAxisId:i,items:[]};M.items.push(v),_.hasStack=!0,_.stackGroups[S]=M}else _.stackGroups[Mu("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[v]};return An(An({},p),{},Ic({},A,_))},f),m={};return Object.keys(d).reduce(function(p,v){var b=d[v];if(b.hasStack){var w={};b.stackGroups=Object.keys(b.stackGroups).reduce(function(S,x){var A=b.stackGroups[x];return An(An({},S),{},Ic({},x,{numericAxisId:r,cateAxisId:i,items:A.items,stackedData:fQ(t,A.items,s)}))},w)}return An(An({},p),{},Ic({},v,b))},m)},hQ=function(t,n){var r=n.realScaleType,i=n.type,s=n.tickCount,l=n.originalDomain,c=n.allowDecimals,f=r||n.scale;if(f!=="auto"&&f!=="linear")return null;if(s&&i==="number"&&l&&(l[0]==="auto"||l[1]==="auto")){var d=t.domain();if(!d.length)return null;var m=AW(d,s,c);return t.domain([jg(m),tl(m)]),{niceTicks:m}}if(s&&i==="number"){var p=t.domain(),v=OW(p,s,c);return{niceTicks:v}}return null};function hf(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,s=e.index,l=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Qe(i[t.dataKey])){var c=Qv(n,"value",i[t.dataKey]);if(c)return c.coordinate+r/2}return n[s]?n[s].coordinate+r/2:null}var f=er(i,Qe(l)?t.dataKey:l);return Qe(f)?null:t.scale(f)}var _k=function(t){var n=t.axis,r=t.ticks,i=t.offset,s=t.bandSize,l=t.entry,c=t.index;if(n.type==="category")return r[c]?r[c].coordinate+i:null;var f=er(l,n.dataKey,n.domain[c]);return Qe(f)?null:n.scale(f)-s/2+i},pQ=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),s=Math.max(r[0],r[1]);return i<=0&&s>=0?0:s<0?s:i}return r[0]},mQ=function(t,n){var r,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?An(An({},t.type.defaultProps),t.props):t.props,s=i.stackId;if(Jn(s)){var l=n[s];if(l){var c=l.items.indexOf(t);return c>=0?l.stackedData[c]:null}}return null},vQ=function(t){return t.reduce(function(n,r){return[jg(r.concat([n[0]]).filter(Oe)),tl(r.concat([n[1]]).filter(Oe))]},[1/0,-1/0])},cq=function(t,n,r){return Object.keys(t).reduce(function(i,s){var l=t[s],c=l.stackedData,f=c.reduce(function(d,m){var p=vQ(m.slice(n,r+1));return[Math.min(d[0],p[0]),Math.max(d[1],p[1])]},[1/0,-1/0]);return[Math.min(f[0],i[0]),Math.max(f[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},Ak=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ok=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,PA=function(t,n,r){if(tt(t))return t(n,r);if(!Array.isArray(t))return n;var i=[];if(Oe(t[0]))i[0]=r?t[0]:Math.min(t[0],n[0]);else if(Ak.test(t[0])){var s=+Ak.exec(t[0])[1];i[0]=n[0]-s}else tt(t[0])?i[0]=t[0](n[0]):i[0]=n[0];if(Oe(t[1]))i[1]=r?t[1]:Math.max(t[1],n[1]);else if(Ok.test(t[1])){var l=+Ok.exec(t[1])[1];i[1]=n[1]+l}else tt(t[1])?i[1]=t[1](n[1]):i[1]=n[1];return i},Ay=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!r||i>0)return i}if(t&&n&&n.length>=2){for(var s=bT(n,function(p){return p.coordinate}),l=1/0,c=1,f=s.length;cl&&(d=2*Math.PI-d),{radius:c,angle:xQ(d),angleInRadian:d}},_Q=function(t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),s=Math.floor(r/360),l=Math.min(i,s);return{startAngle:n-l*360,endAngle:r-l*360}},AQ=function(t,n){var r=n.startAngle,i=n.endAngle,s=Math.floor(r/360),l=Math.floor(i/360),c=Math.min(s,l);return t+c*360},jk=function(t,n){var r=t.x,i=t.y,s=wQ({x:r,y:i},n),l=s.radius,c=s.angle,f=n.innerRadius,d=n.outerRadius;if(ld)return!1;if(l===0)return!0;var m=_Q(n),p=m.startAngle,v=m.endAngle,b=c,w;if(p<=v){for(;b>v;)b-=360;for(;b=p&&b<=v}else{for(;b>p;)b-=360;for(;b=v&&b<=p}return w?Mk(Mk({},n),{},{radius:l,angle:AQ(b,n)}):null};function sp(e){"@babel/helpers - typeof";return sp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sp(e)}var OQ=["offset"];function TQ(e){return CQ(e)||jQ(e)||MQ(e)||EQ()}function EQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MQ(e,t){if(e){if(typeof e=="string")return DA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return DA(e,t)}}function jQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function CQ(e){if(Array.isArray(e))return DA(e)}function DA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DQ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ck(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Xn(e){for(var t=1;t=0?1:-1,M,E;i==="insideStart"?(M=b+_*l,E=S):i==="insideEnd"?(M=w-_*l,E=!S):i==="end"&&(M=w+_*l,E=S),E=A<=0?E:!E;var O=Or(d,m,x,M),j=Or(d,m,x,M+(E?1:-1)*359),R="M".concat(O.x,",").concat(O.y,` A`).concat(x,",").concat(x,",0,1,").concat(E?0:1,`, - `).concat(j.x,",").concat(j.y),k=Qe(t.id)?Mu("recharts-radial-line-"):t.id;return Q.createElement("text",lp({},r,{dominantBaseline:"central",className:ut("recharts-radial-bar-label",c)}),Q.createElement("defs",null,Q.createElement("path",{id:k,d:R})),Q.createElement("textPath",{xlinkHref:"#".concat(k)},n))},RQ=function(t){var n=t.viewBox,r=t.offset,i=t.position,s=n,l=s.cx,c=s.cy,f=s.innerRadius,d=s.outerRadius,m=s.startAngle,p=s.endAngle,v=(m+p)/2;if(i==="outside"){var b=Or(l,c,d+r,v),w=b.x,S=b.y;return{x:w,y:S,textAnchor:w>=l?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:l,y:c,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:l,y:c,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:l,y:c,textAnchor:"middle",verticalAnchor:"end"};var x=(f+d)/2,A=Or(l,c,x,v),_=A.x,M=A.y;return{x:_,y:M,textAnchor:"middle",verticalAnchor:"middle"}},NQ=function(t){var n=t.viewBox,r=t.parentViewBox,i=t.offset,s=t.position,l=n,c=l.x,f=l.y,d=l.width,m=l.height,p=m>=0?1:-1,v=p*i,b=p>0?"end":"start",w=p>0?"start":"end",S=d>=0?1:-1,x=S*i,A=S>0?"end":"start",_=S>0?"start":"end";if(s==="top"){var M={x:c+d/2,y:f-p*i,textAnchor:"middle",verticalAnchor:b};return Yn(Yn({},M),r?{height:Math.max(f-r.y,0),width:d}:{})}if(s==="bottom"){var E={x:c+d/2,y:f+m+v,textAnchor:"middle",verticalAnchor:w};return Yn(Yn({},E),r?{height:Math.max(r.y+r.height-(f+m),0),width:d}:{})}if(s==="left"){var O={x:c-x,y:f+m/2,textAnchor:A,verticalAnchor:"middle"};return Yn(Yn({},O),r?{width:Math.max(O.x-r.x,0),height:m}:{})}if(s==="right"){var j={x:c+d+x,y:f+m/2,textAnchor:_,verticalAnchor:"middle"};return Yn(Yn({},j),r?{width:Math.max(r.x+r.width-j.x,0),height:m}:{})}var R=r?{width:d,height:m}:{};return s==="insideLeft"?Yn({x:c+x,y:f+m/2,textAnchor:_,verticalAnchor:"middle"},R):s==="insideRight"?Yn({x:c+d-x,y:f+m/2,textAnchor:A,verticalAnchor:"middle"},R):s==="insideTop"?Yn({x:c+d/2,y:f+v,textAnchor:"middle",verticalAnchor:w},R):s==="insideBottom"?Yn({x:c+d/2,y:f+m-v,textAnchor:"middle",verticalAnchor:b},R):s==="insideTopLeft"?Yn({x:c+x,y:f+v,textAnchor:_,verticalAnchor:w},R):s==="insideTopRight"?Yn({x:c+d-x,y:f+v,textAnchor:A,verticalAnchor:w},R):s==="insideBottomLeft"?Yn({x:c+x,y:f+m-v,textAnchor:_,verticalAnchor:b},R):s==="insideBottomRight"?Yn({x:c+d-x,y:f+m-v,textAnchor:A,verticalAnchor:b},R):Vf(s)&&(Oe(s.x)||Zl(s.x))&&(Oe(s.y)||Zl(s.y))?Yn({x:c+Su(s.x,d),y:f+Su(s.y,m),textAnchor:"end",verticalAnchor:"end"},R):Yn({x:c+d/2,y:f+m/2,textAnchor:"middle",verticalAnchor:"middle"},R)},kQ=function(t){return"cx"in t&&Oe(t.cx)};function zr(e){var t=e.offset,n=t===void 0?5:t,r=OQ(e,bQ),i=Yn({offset:n},r),s=i.viewBox,l=i.position,c=i.value,f=i.children,d=i.content,m=i.className,p=m===void 0?"":m,v=i.textBreakAll;if(!s||Qe(c)&&Qe(f)&&!K.isValidElement(d)&&!tt(d))return null;if(K.isValidElement(d))return K.cloneElement(d,i);var b;if(tt(d)){if(b=K.createElement(d,i),K.isValidElement(b))return b}else b=PQ(i);var w=kQ(s),S=Je(i,!0);if(w&&(l==="insideStart"||l==="insideEnd"||l==="end"))return DQ(i,b,S);var x=w?RQ(i):NQ(i);return Q.createElement(uy,lp({className:ut("recharts-label",p)},S,x,{breakAll:v}),b)}zr.displayName="Label";var fq=function(t){var n=t.cx,r=t.cy,i=t.angle,s=t.startAngle,l=t.endAngle,c=t.r,f=t.radius,d=t.innerRadius,m=t.outerRadius,p=t.x,v=t.y,b=t.top,w=t.left,S=t.width,x=t.height,A=t.clockWise,_=t.labelViewBox;if(_)return _;if(Oe(S)&&Oe(x)){if(Oe(p)&&Oe(v))return{x:p,y:v,width:S,height:x};if(Oe(b)&&Oe(w))return{x:b,y:w,width:S,height:x}}return Oe(p)&&Oe(v)?{x:p,y:v,width:0,height:0}:Oe(n)&&Oe(r)?{cx:n,cy:r,startAngle:s||i||0,endAngle:l||i||0,innerRadius:d||0,outerRadius:m||f||c||0,clockWise:A}:t.viewBox?t.viewBox:{}},LQ=function(t,n){return t?t===!0?Q.createElement(zr,{key:"label-implicit",viewBox:n}):Jn(t)?Q.createElement(zr,{key:"label-implicit",viewBox:n,value:t}):K.isValidElement(t)?t.type===zr?K.cloneElement(t,{key:"label-implicit",viewBox:n}):Q.createElement(zr,{key:"label-implicit",content:t,viewBox:n}):tt(t)?Q.createElement(zr,{key:"label-implicit",content:t,viewBox:n}):Vf(t)?Q.createElement(zr,lp({viewBox:n},t,{key:"label-implicit"})):null:null},zQ=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var i=t.children,s=fq(t),l=ci(i,zr).map(function(f,d){return K.cloneElement(f,{viewBox:n||s,key:"label-".concat(d)})});if(!r)return l;var c=LQ(t.label,n||s);return[c].concat(xQ(l))};zr.parseViewBox=fq;zr.renderCallByParent=zQ;var Nw,Pk;function $Q(){if(Pk)return Nw;Pk=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return Nw=e,Nw}var BQ=$Q();const qQ=Ft(BQ);function up(e){"@babel/helpers - typeof";return up=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},up(e)}var IQ=["valueAccessor"],UQ=["data","dataKey","clockWise","id","textBreakAll"];function VQ(e){return KQ(e)||GQ(e)||FQ(e)||HQ()}function HQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FQ(e,t){if(e){if(typeof e=="string")return DA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return DA(e,t)}}function GQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function KQ(e){if(Array.isArray(e))return DA(e)}function DA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function QQ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var ZQ=function(t){return Array.isArray(t.value)?qQ(t.value):t.value};function Wa(e){var t=e.valueAccessor,n=t===void 0?ZQ:t,r=Rk(e,IQ),i=r.data,s=r.dataKey,l=r.clockWise,c=r.id,f=r.textBreakAll,d=Rk(r,UQ);return!i||!i.length?null:Q.createElement(Mt,{className:"recharts-label-list"},i.map(function(m,p){var v=Qe(s)?n(m,p):er(m&&m.payload,s),b=Qe(c)?{}:{id:"".concat(c,"-").concat(p)};return Q.createElement(zr,Ty({},Je(m,!0),d,b,{parentViewBox:m.parentViewBox,value:v,textBreakAll:f,viewBox:zr.parseViewBox(Qe(l)?m:Dk(Dk({},m),{},{clockWise:l})),key:"label-".concat(p),index:p}))}))}Wa.displayName="LabelList";function JQ(e,t){return e?e===!0?Q.createElement(Wa,{key:"labelList-implicit",data:t}):Q.isValidElement(e)||tt(e)?Q.createElement(Wa,{key:"labelList-implicit",data:t,content:e}):Vf(e)?Q.createElement(Wa,Ty({data:t},e,{key:"labelList-implicit"})):null:null}function eZ(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,i=ci(r,Wa).map(function(l,c){return K.cloneElement(l,{data:t,key:"labelList-".concat(c)})});if(!n)return i;var s=JQ(e.label,t);return[s].concat(VQ(i))}Wa.renderCallByParent=eZ;function cp(e){"@babel/helpers - typeof";return cp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cp(e)}function RA(){return RA=Object.assign?Object.assign.bind():function(e){for(var t=1;t=l?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:l,y:c,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:l,y:c,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:l,y:c,textAnchor:"middle",verticalAnchor:"end"};var x=(f+d)/2,A=Or(l,c,x,v),_=A.x,M=A.y;return{x:_,y:M,textAnchor:"middle",verticalAnchor:"middle"}},qQ=function(t){var n=t.viewBox,r=t.parentViewBox,i=t.offset,s=t.position,l=n,c=l.x,f=l.y,d=l.width,m=l.height,p=m>=0?1:-1,v=p*i,b=p>0?"end":"start",w=p>0?"start":"end",S=d>=0?1:-1,x=S*i,A=S>0?"end":"start",_=S>0?"start":"end";if(s==="top"){var M={x:c+d/2,y:f-p*i,textAnchor:"middle",verticalAnchor:b};return Xn(Xn({},M),r?{height:Math.max(f-r.y,0),width:d}:{})}if(s==="bottom"){var E={x:c+d/2,y:f+m+v,textAnchor:"middle",verticalAnchor:w};return Xn(Xn({},E),r?{height:Math.max(r.y+r.height-(f+m),0),width:d}:{})}if(s==="left"){var O={x:c-x,y:f+m/2,textAnchor:A,verticalAnchor:"middle"};return Xn(Xn({},O),r?{width:Math.max(O.x-r.x,0),height:m}:{})}if(s==="right"){var j={x:c+d+x,y:f+m/2,textAnchor:_,verticalAnchor:"middle"};return Xn(Xn({},j),r?{width:Math.max(r.x+r.width-j.x,0),height:m}:{})}var R=r?{width:d,height:m}:{};return s==="insideLeft"?Xn({x:c+x,y:f+m/2,textAnchor:_,verticalAnchor:"middle"},R):s==="insideRight"?Xn({x:c+d-x,y:f+m/2,textAnchor:A,verticalAnchor:"middle"},R):s==="insideTop"?Xn({x:c+d/2,y:f+v,textAnchor:"middle",verticalAnchor:w},R):s==="insideBottom"?Xn({x:c+d/2,y:f+m-v,textAnchor:"middle",verticalAnchor:b},R):s==="insideTopLeft"?Xn({x:c+x,y:f+v,textAnchor:_,verticalAnchor:w},R):s==="insideTopRight"?Xn({x:c+d-x,y:f+v,textAnchor:A,verticalAnchor:w},R):s==="insideBottomLeft"?Xn({x:c+x,y:f+m-v,textAnchor:_,verticalAnchor:b},R):s==="insideBottomRight"?Xn({x:c+d-x,y:f+m-v,textAnchor:A,verticalAnchor:b},R):Vf(s)&&(Oe(s.x)||Zl(s.x))&&(Oe(s.y)||Zl(s.y))?Xn({x:c+Su(s.x,d),y:f+Su(s.y,m),textAnchor:"end",verticalAnchor:"end"},R):Xn({x:c+d/2,y:f+m/2,textAnchor:"middle",verticalAnchor:"middle"},R)},IQ=function(t){return"cx"in t&&Oe(t.cx)};function zr(e){var t=e.offset,n=t===void 0?5:t,r=PQ(e,OQ),i=Xn({offset:n},r),s=i.viewBox,l=i.position,c=i.value,f=i.children,d=i.content,m=i.className,p=m===void 0?"":m,v=i.textBreakAll;if(!s||Qe(c)&&Qe(f)&&!K.isValidElement(d)&&!tt(d))return null;if(K.isValidElement(d))return K.cloneElement(d,i);var b;if(tt(d)){if(b=K.createElement(d,i),K.isValidElement(b))return b}else b=LQ(i);var w=IQ(s),S=Je(i,!0);if(w&&(l==="insideStart"||l==="insideEnd"||l==="end"))return $Q(i,b,S);var x=w?BQ(i):qQ(i);return Q.createElement(uy,lp({className:ut("recharts-label",p)},S,x,{breakAll:v}),b)}zr.displayName="Label";var dq=function(t){var n=t.cx,r=t.cy,i=t.angle,s=t.startAngle,l=t.endAngle,c=t.r,f=t.radius,d=t.innerRadius,m=t.outerRadius,p=t.x,v=t.y,b=t.top,w=t.left,S=t.width,x=t.height,A=t.clockWise,_=t.labelViewBox;if(_)return _;if(Oe(S)&&Oe(x)){if(Oe(p)&&Oe(v))return{x:p,y:v,width:S,height:x};if(Oe(b)&&Oe(w))return{x:b,y:w,width:S,height:x}}return Oe(p)&&Oe(v)?{x:p,y:v,width:0,height:0}:Oe(n)&&Oe(r)?{cx:n,cy:r,startAngle:s||i||0,endAngle:l||i||0,innerRadius:d||0,outerRadius:m||f||c||0,clockWise:A}:t.viewBox?t.viewBox:{}},UQ=function(t,n){return t?t===!0?Q.createElement(zr,{key:"label-implicit",viewBox:n}):Jn(t)?Q.createElement(zr,{key:"label-implicit",viewBox:n,value:t}):K.isValidElement(t)?t.type===zr?K.cloneElement(t,{key:"label-implicit",viewBox:n}):Q.createElement(zr,{key:"label-implicit",content:t,viewBox:n}):tt(t)?Q.createElement(zr,{key:"label-implicit",content:t,viewBox:n}):Vf(t)?Q.createElement(zr,lp({viewBox:n},t,{key:"label-implicit"})):null:null},VQ=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var i=t.children,s=dq(t),l=ci(i,zr).map(function(f,d){return K.cloneElement(f,{viewBox:n||s,key:"label-".concat(d)})});if(!r)return l;var c=UQ(t.label,n||s);return[c].concat(TQ(l))};zr.parseViewBox=dq;zr.renderCallByParent=VQ;var Nw,Pk;function HQ(){if(Pk)return Nw;Pk=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return Nw=e,Nw}var FQ=HQ();const GQ=Ft(FQ);function up(e){"@babel/helpers - typeof";return up=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},up(e)}var KQ=["valueAccessor"],YQ=["data","dataKey","clockWise","id","textBreakAll"];function XQ(e){return JQ(e)||ZQ(e)||QQ(e)||WQ()}function WQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QQ(e,t){if(e){if(typeof e=="string")return RA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return RA(e,t)}}function ZQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function JQ(e){if(Array.isArray(e))return RA(e)}function RA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function rZ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var iZ=function(t){return Array.isArray(t.value)?GQ(t.value):t.value};function Wa(e){var t=e.valueAccessor,n=t===void 0?iZ:t,r=Nk(e,KQ),i=r.data,s=r.dataKey,l=r.clockWise,c=r.id,f=r.textBreakAll,d=Nk(r,YQ);return!i||!i.length?null:Q.createElement(Mt,{className:"recharts-label-list"},i.map(function(m,p){var v=Qe(s)?n(m,p):er(m&&m.payload,s),b=Qe(c)?{}:{id:"".concat(c,"-").concat(p)};return Q.createElement(zr,Ty({},Je(m,!0),d,b,{parentViewBox:m.parentViewBox,value:v,textBreakAll:f,viewBox:zr.parseViewBox(Qe(l)?m:Rk(Rk({},m),{},{clockWise:l})),key:"label-".concat(p),index:p}))}))}Wa.displayName="LabelList";function aZ(e,t){return e?e===!0?Q.createElement(Wa,{key:"labelList-implicit",data:t}):Q.isValidElement(e)||tt(e)?Q.createElement(Wa,{key:"labelList-implicit",data:t,content:e}):Vf(e)?Q.createElement(Wa,Ty({data:t},e,{key:"labelList-implicit"})):null:null}function oZ(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,i=ci(r,Wa).map(function(l,c){return K.cloneElement(l,{data:t,key:"labelList-".concat(c)})});if(!n)return i;var s=aZ(e.label,t);return[s].concat(XQ(i))}Wa.renderCallByParent=oZ;function cp(e){"@babel/helpers - typeof";return cp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cp(e)}function NA(){return NA=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(l>d),`, `).concat(p.x,",").concat(p.y,` `);if(i>0){var b=Or(n,r,i,l),w=Or(n,r,i,d);v+="L ".concat(w.x,",").concat(w.y,` A `).concat(i,",").concat(i,`,0, `).concat(+(Math.abs(f)>180),",").concat(+(l<=d),`, - `).concat(b.x,",").concat(b.y," Z")}else v+="L ".concat(n,",").concat(r," Z");return v},aZ=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,s=t.outerRadius,l=t.cornerRadius,c=t.forceCornerRadius,f=t.cornerIsExternal,d=t.startAngle,m=t.endAngle,p=Oa(m-d),v=Tv({cx:n,cy:r,radius:s,angle:d,sign:p,cornerRadius:l,cornerIsExternal:f}),b=v.circleTangency,w=v.lineTangency,S=v.theta,x=Tv({cx:n,cy:r,radius:s,angle:m,sign:-p,cornerRadius:l,cornerIsExternal:f}),A=x.circleTangency,_=x.lineTangency,M=x.theta,E=f?Math.abs(d-m):Math.abs(d-m)-S-M;if(E<0)return c?"M ".concat(w.x,",").concat(w.y,` + `).concat(b.x,",").concat(b.y," Z")}else v+="L ".concat(n,",").concat(r," Z");return v},fZ=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,s=t.outerRadius,l=t.cornerRadius,c=t.forceCornerRadius,f=t.cornerIsExternal,d=t.startAngle,m=t.endAngle,p=Oa(m-d),v=Tv({cx:n,cy:r,radius:s,angle:d,sign:p,cornerRadius:l,cornerIsExternal:f}),b=v.circleTangency,w=v.lineTangency,S=v.theta,x=Tv({cx:n,cy:r,radius:s,angle:m,sign:-p,cornerRadius:l,cornerIsExternal:f}),A=x.circleTangency,_=x.lineTangency,M=x.theta,E=f?Math.abs(d-m):Math.abs(d-m)-S-M;if(E<0)return c?"M ".concat(w.x,",").concat(w.y,` a`).concat(l,",").concat(l,",0,0,1,").concat(l*2,`,0 a`).concat(l,",").concat(l,",0,0,1,").concat(-l*2,`,0 - `):dq({cx:n,cy:r,innerRadius:i,outerRadius:s,startAngle:d,endAngle:m});var O="M ".concat(w.x,",").concat(w.y,` + `):hq({cx:n,cy:r,innerRadius:i,outerRadius:s,startAngle:d,endAngle:m});var O="M ".concat(w.x,",").concat(w.y,` A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(b.x,",").concat(b.y,` A`).concat(s,",").concat(s,",0,").concat(+(E>180),",").concat(+(p<0),",").concat(A.x,",").concat(A.y,` A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(_.x,",").concat(_.y,` `);if(i>0){var j=Tv({cx:n,cy:r,radius:i,angle:d,sign:p,isExternal:!0,cornerRadius:l,cornerIsExternal:f}),R=j.circleTangency,k=j.lineTangency,z=j.theta,G=Tv({cx:n,cy:r,radius:i,angle:m,sign:-p,isExternal:!0,cornerRadius:l,cornerIsExternal:f}),$=G.circleTangency,B=G.lineTangency,Z=G.theta,ee=f?Math.abs(d-m):Math.abs(d-m)-z-Z;if(ee<0&&l===0)return"".concat(O,"L").concat(n,",").concat(r,"Z");O+="L".concat(B.x,",").concat(B.y,` A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat($.x,",").concat($.y,` A`).concat(i,",").concat(i,",0,").concat(+(ee>180),",").concat(+(p>0),",").concat(R.x,",").concat(R.y,` - A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(k.x,",").concat(k.y,"Z")}else O+="L".concat(n,",").concat(r,"Z");return O},oZ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},hq=function(t){var n=kk(kk({},oZ),t),r=n.cx,i=n.cy,s=n.innerRadius,l=n.outerRadius,c=n.cornerRadius,f=n.forceCornerRadius,d=n.cornerIsExternal,m=n.startAngle,p=n.endAngle,v=n.className;if(l0&&Math.abs(m-p)<360?x=aZ({cx:r,cy:i,innerRadius:s,outerRadius:l,cornerRadius:Math.min(S,w/2),forceCornerRadius:f,cornerIsExternal:d,startAngle:m,endAngle:p}):x=dq({cx:r,cy:i,innerRadius:s,outerRadius:l,startAngle:m,endAngle:p}),Q.createElement("path",RA({},Je(n,!0),{className:b,d:x,role:"img"}))};function fp(e){"@babel/helpers - typeof";return fp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fp(e)}function NA(){return NA=Object.assign?Object.assign.bind():function(e){for(var t=1;tgZ.call(e,t));function Cu(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const SZ="__v",wZ="__o",_Z="_owner",{getOwnPropertyDescriptor:Vk,keys:Hk}=Object;function AZ(e,t){return e.byteLength===t.byteLength&&Ey(new Uint8Array(e),new Uint8Array(t))}function OZ(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function TZ(e,t){return e.byteLength===t.byteLength&&Ey(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function EZ(e,t){return Cu(e.getTime(),t.getTime())}function MZ(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function jZ(e,t){return e===t}function Fk(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),s=e.entries();let l,c,f=0;for(;(l=s.next())&&!l.done;){const d=t.entries();let m=!1,p=0;for(;(c=d.next())&&!c.done;){if(i[p]){p++;continue}const v=l.value,b=c.value;if(n.equals(v[0],b[0],f,p,e,t,n)&&n.equals(v[1],b[1],v[0],b[0],e,t,n)){m=i[p]=!0;break}p++}if(!m)return!1;f++}return!0}const PZ=Cu;function CZ(e,t,n){const r=Hk(e);let i=r.length;if(Hk(t).length!==i)return!1;for(;i-- >0;)if(!pq(e,t,n,r[i]))return!1;return!0}function dh(e,t,n){const r=Uk(e);let i=r.length;if(Uk(t).length!==i)return!1;let s,l,c;for(;i-- >0;)if(s=r[i],!pq(e,t,n,s)||(l=Vk(e,s),c=Vk(t,s),(l||c)&&(!l||!c||l.configurable!==c.configurable||l.enumerable!==c.enumerable||l.writable!==c.writable)))return!1;return!0}function DZ(e,t){return Cu(e.valueOf(),t.valueOf())}function RZ(e,t){return e.source===t.source&&e.flags===t.flags}function Gk(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),s=e.values();let l,c;for(;(l=s.next())&&!l.done;){const f=t.values();let d=!1,m=0;for(;(c=f.next())&&!c.done;){if(!i[m]&&n.equals(l.value,c.value,l.value,c.value,e,t,n)){d=i[m]=!0;break}m++}if(!d)return!1}return!0}function Ey(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function NZ(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function pq(e,t,n,r){return(r===_Z||r===wZ||r===SZ)&&(e.$$typeof||t.$$typeof)?!0:xZ(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const kZ="[object ArrayBuffer]",LZ="[object Arguments]",zZ="[object Boolean]",$Z="[object DataView]",BZ="[object Date]",qZ="[object Error]",IZ="[object Map]",UZ="[object Number]",VZ="[object Object]",HZ="[object RegExp]",FZ="[object Set]",GZ="[object String]",KZ={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},YZ="[object URL]",XZ=Object.prototype.toString;function WZ({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:l,areNumbersEqual:c,areObjectsEqual:f,arePrimitiveWrappersEqual:d,areRegExpsEqual:m,areSetsEqual:p,areTypedArraysEqual:v,areUrlsEqual:b,unknownTagComparators:w}){return function(x,A,_){if(x===A)return!0;if(x==null||A==null)return!1;const M=typeof x;if(M!==typeof A)return!1;if(M!=="object")return M==="number"?c(x,A,_):M==="function"?s(x,A,_):!1;const E=x.constructor;if(E!==A.constructor)return!1;if(E===Object)return f(x,A,_);if(Array.isArray(x))return t(x,A,_);if(E===Date)return r(x,A,_);if(E===RegExp)return m(x,A,_);if(E===Map)return l(x,A,_);if(E===Set)return p(x,A,_);const O=XZ.call(x);if(O===BZ)return r(x,A,_);if(O===HZ)return m(x,A,_);if(O===IZ)return l(x,A,_);if(O===FZ)return p(x,A,_);if(O===VZ)return typeof x.then!="function"&&typeof A.then!="function"&&f(x,A,_);if(O===YZ)return b(x,A,_);if(O===qZ)return i(x,A,_);if(O===LZ)return f(x,A,_);if(KZ[O])return v(x,A,_);if(O===kZ)return e(x,A,_);if(O===$Z)return n(x,A,_);if(O===zZ||O===UZ||O===GZ)return d(x,A,_);if(w){let j=w[O];if(!j){const R=bZ(x);R&&(j=w[R])}if(j)return j(x,A,_)}return!1}}function QZ({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:AZ,areArraysEqual:n?dh:OZ,areDataViewsEqual:TZ,areDatesEqual:EZ,areErrorsEqual:MZ,areFunctionsEqual:jZ,areMapsEqual:n?$w(Fk,dh):Fk,areNumbersEqual:PZ,areObjectsEqual:n?dh:CZ,arePrimitiveWrappersEqual:DZ,areRegExpsEqual:RZ,areSetsEqual:n?$w(Gk,dh):Gk,areTypedArraysEqual:n?$w(Ey,dh):Ey,areUrlsEqual:NZ,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=Mv(r.areArraysEqual),s=Mv(r.areMapsEqual),l=Mv(r.areObjectsEqual),c=Mv(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:s,areObjectsEqual:l,areSetsEqual:c})}return r}function ZZ(e){return function(t,n,r,i,s,l,c){return e(t,n,c)}}function JZ({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(c,f){const{cache:d=e?new WeakMap:void 0,meta:m}=n();return t(c,f,{cache:d,equals:r,meta:m,strict:i})};if(e)return function(c,f){return t(c,f,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const s={cache:void 0,equals:r,meta:void 0,strict:i};return function(c,f){return t(c,f,s)}}const eJ=hl();hl({strict:!0});hl({circular:!0});hl({circular:!0,strict:!0});hl({createInternalComparator:()=>Cu});hl({strict:!0,createInternalComparator:()=>Cu});hl({circular:!0,createInternalComparator:()=>Cu});hl({circular:!0,createInternalComparator:()=>Cu,strict:!0});function hl(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,s=QZ(e),l=WZ(s),c=n?n(l):ZZ(l);return JZ({circular:t,comparator:l,createState:r,equals:c,strict:i})}function tJ(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Kk(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(s){n<0&&(n=s),s-n>t?(e(s),n=-1):tJ(i)};requestAnimationFrame(r)}function kA(e){"@babel/helpers - typeof";return kA=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kA(e)}function nJ(e){return oJ(e)||aJ(e)||iJ(e)||rJ()}function rJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iJ(e,t){if(e){if(typeof e=="string")return Yk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yk(e,t)}}function Yk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?1:A<0?0:A},S=function(A){for(var _=A>1?1:A,M=_,E=0;E<8;++E){var O=p(M)-_,j=b(M);if(Math.abs(O-_)0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,i=t.damping,s=i===void 0?8:i,l=t.dt,c=l===void 0?17:l,f=function(m,p,v){var b=-(m-p)*r,w=v*s,S=v+(b-w)*c/1e3,x=v*c/1e3+m;return Math.abs(x-p)e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function zJ(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s=0)&&(n[i]=e[i]);return n}function Bw(e){return IJ(e)||qJ(e)||BJ(e)||$J()}function $J(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BJ(e,t){if(e){if(typeof e=="string")return qA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qA(e,t)}}function qJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function IJ(e){if(Array.isArray(e))return qA(e)}function qA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Py(e){return Py=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Py(e)}var Ta=(function(e){GJ(n,e);var t=KJ(n);function n(r,i){var s;UJ(this,n),s=t.call(this,r,i);var l=s.props,c=l.isActive,f=l.attributeName,d=l.from,m=l.to,p=l.steps,v=l.children,b=l.duration;if(s.handleStyleChange=s.handleStyleChange.bind(VA(s)),s.changeStyle=s.changeStyle.bind(VA(s)),!c||b<=0)return s.state={style:{}},typeof v=="function"&&(s.state={style:m}),UA(s);if(p&&p.length)s.state={style:p[0].style};else if(d){if(typeof v=="function")return s.state={style:d},UA(s);s.state={style:f?xh({},f,d):d}}else s.state={style:{}};return s}return HJ(n,[{key:"componentDidMount",value:function(){var i=this.props,s=i.isActive,l=i.canBegin;this.mounted=!0,!(!s||!l)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var s=this.props,l=s.isActive,c=s.canBegin,f=s.attributeName,d=s.shouldReAnimate,m=s.to,p=s.from,v=this.state.style;if(c){if(!l){var b={style:f?xh({},f,m):m};this.state&&v&&(f&&v[f]!==m||!f&&v!==m)&&this.setState(b);return}if(!(eJ(i.to,m)&&i.canBegin&&i.isActive)){var w=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var S=w||d?p:i.to;if(this.state&&v){var x={style:f?xh({},f,S):S};(f&&v[f]!==S||!f&&v!==S)&&this.setState(x)}this.runAnimation(va(va({},this.props),{},{from:S,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var s=this,l=i.from,c=i.to,f=i.duration,d=i.easing,m=i.begin,p=i.onAnimationEnd,v=i.onAnimationStart,b=NJ(l,c,_J(d),f,this.changeStyle),w=function(){s.stopJSAnimation=b()};this.manager.start([v,m,w,f,p])}},{key:"runStepAnimation",value:function(i){var s=this,l=i.steps,c=i.begin,f=i.onAnimationStart,d=l[0],m=d.style,p=d.duration,v=p===void 0?0:p,b=function(S,x,A){if(A===0)return S;var _=x.duration,M=x.easing,E=M===void 0?"ease":M,O=x.style,j=x.properties,R=x.onAnimationEnd,k=A>0?l[A-1]:x,z=j||Object.keys(O);if(typeof E=="function"||E==="spring")return[].concat(Bw(S),[s.runJSAnimation.bind(s,{from:k.style,to:O,duration:_,easing:E}),_]);var G=Qk(z,_,E),$=va(va(va({},k.style),O),{},{transition:G});return[].concat(Bw(S),[$,_,R]).filter(fJ)};return this.manager.start([f].concat(Bw(l.reduce(b,[m,Math.max(v,c)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=sJ());var s=i.begin,l=i.duration,c=i.attributeName,f=i.to,d=i.easing,m=i.onAnimationStart,p=i.onAnimationEnd,v=i.steps,b=i.children,w=this.manager;if(this.unSubscribe=w.subscribe(this.handleStyleChange),typeof d=="function"||typeof b=="function"||d==="spring"){this.runJSAnimation(i);return}if(v.length>1){this.runStepAnimation(i);return}var S=c?xh({},c,f):f,x=Qk(Object.keys(S),l,d);w.start([m,s,va(va({},S),{},{transition:x}),l,p])}},{key:"render",value:function(){var i=this.props,s=i.children;i.begin;var l=i.duration;i.attributeName,i.easing;var c=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var f=LJ(i,kJ),d=K.Children.count(s),m=this.state.style;if(typeof s=="function")return s(m);if(!c||d===0||l<=0)return s;var p=function(b){var w=b.props,S=w.style,x=S===void 0?{}:S,A=w.className,_=K.cloneElement(b,va(va({},f),{},{style:va(va({},x),m),className:A}));return _};return d===1?p(K.Children.only(s)):Q.createElement("div",null,K.Children.map(s,function(v){return p(v)}))}}]),n})(K.PureComponent);Ta.displayName="Animate";Ta.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Ta.propTypes={from:Dt.oneOfType([Dt.object,Dt.string]),to:Dt.oneOfType([Dt.object,Dt.string]),attributeName:Dt.string,duration:Dt.number,begin:Dt.number,easing:Dt.oneOfType([Dt.string,Dt.func]),steps:Dt.arrayOf(Dt.shape({duration:Dt.number.isRequired,style:Dt.object.isRequired,easing:Dt.oneOfType([Dt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Dt.func]),properties:Dt.arrayOf("string"),onAnimationEnd:Dt.func})),children:Dt.oneOfType([Dt.node,Dt.func]),isActive:Dt.bool,canBegin:Dt.bool,onAnimationEnd:Dt.func,shouldReAnimate:Dt.bool,onAnimationStart:Dt.func,onAnimationReStart:Dt.func};function pp(e){"@babel/helpers - typeof";return pp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pp(e)}function Cy(){return Cy=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0?1:-1,f=r>=0?1:-1,d=i>=0&&r>=0||i<0&&r<0?1:0,m;if(l>0&&s instanceof Array){for(var p=[0,0,0,0],v=0,b=4;vl?l:s[v];m="M".concat(t,",").concat(n+c*p[0]),p[0]>0&&(m+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(d,",").concat(t+f*p[0],",").concat(n)),m+="L ".concat(t+r-f*p[1],",").concat(n),p[1]>0&&(m+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(d,`, + A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(k.x,",").concat(k.y,"Z")}else O+="L".concat(n,",").concat(r,"Z");return O},dZ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},pq=function(t){var n=Lk(Lk({},dZ),t),r=n.cx,i=n.cy,s=n.innerRadius,l=n.outerRadius,c=n.cornerRadius,f=n.forceCornerRadius,d=n.cornerIsExternal,m=n.startAngle,p=n.endAngle,v=n.className;if(l0&&Math.abs(m-p)<360?x=fZ({cx:r,cy:i,innerRadius:s,outerRadius:l,cornerRadius:Math.min(S,w/2),forceCornerRadius:f,cornerIsExternal:d,startAngle:m,endAngle:p}):x=hq({cx:r,cy:i,innerRadius:s,outerRadius:l,startAngle:m,endAngle:p}),Q.createElement("path",NA({},Je(n,!0),{className:b,d:x,role:"img"}))};function fp(e){"@babel/helpers - typeof";return fp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fp(e)}function kA(){return kA=Object.assign?Object.assign.bind():function(e){for(var t=1;tAZ.call(e,t));function Pu(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const EZ="__v",MZ="__o",jZ="_owner",{getOwnPropertyDescriptor:Hk,keys:Fk}=Object;function CZ(e,t){return e.byteLength===t.byteLength&&Ey(new Uint8Array(e),new Uint8Array(t))}function PZ(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function DZ(e,t){return e.byteLength===t.byteLength&&Ey(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function RZ(e,t){return Pu(e.getTime(),t.getTime())}function NZ(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function kZ(e,t){return e===t}function Gk(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),s=e.entries();let l,c,f=0;for(;(l=s.next())&&!l.done;){const d=t.entries();let m=!1,p=0;for(;(c=d.next())&&!c.done;){if(i[p]){p++;continue}const v=l.value,b=c.value;if(n.equals(v[0],b[0],f,p,e,t,n)&&n.equals(v[1],b[1],v[0],b[0],e,t,n)){m=i[p]=!0;break}p++}if(!m)return!1;f++}return!0}const LZ=Pu;function zZ(e,t,n){const r=Fk(e);let i=r.length;if(Fk(t).length!==i)return!1;for(;i-- >0;)if(!mq(e,t,n,r[i]))return!1;return!0}function dh(e,t,n){const r=Vk(e);let i=r.length;if(Vk(t).length!==i)return!1;let s,l,c;for(;i-- >0;)if(s=r[i],!mq(e,t,n,s)||(l=Hk(e,s),c=Hk(t,s),(l||c)&&(!l||!c||l.configurable!==c.configurable||l.enumerable!==c.enumerable||l.writable!==c.writable)))return!1;return!0}function $Z(e,t){return Pu(e.valueOf(),t.valueOf())}function BZ(e,t){return e.source===t.source&&e.flags===t.flags}function Kk(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),s=e.values();let l,c;for(;(l=s.next())&&!l.done;){const f=t.values();let d=!1,m=0;for(;(c=f.next())&&!c.done;){if(!i[m]&&n.equals(l.value,c.value,l.value,c.value,e,t,n)){d=i[m]=!0;break}m++}if(!d)return!1}return!0}function Ey(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function qZ(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function mq(e,t,n,r){return(r===jZ||r===MZ||r===EZ)&&(e.$$typeof||t.$$typeof)?!0:TZ(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const IZ="[object ArrayBuffer]",UZ="[object Arguments]",VZ="[object Boolean]",HZ="[object DataView]",FZ="[object Date]",GZ="[object Error]",KZ="[object Map]",YZ="[object Number]",XZ="[object Object]",WZ="[object RegExp]",QZ="[object Set]",ZZ="[object String]",JZ={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},eJ="[object URL]",tJ=Object.prototype.toString;function nJ({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:l,areNumbersEqual:c,areObjectsEqual:f,arePrimitiveWrappersEqual:d,areRegExpsEqual:m,areSetsEqual:p,areTypedArraysEqual:v,areUrlsEqual:b,unknownTagComparators:w}){return function(x,A,_){if(x===A)return!0;if(x==null||A==null)return!1;const M=typeof x;if(M!==typeof A)return!1;if(M!=="object")return M==="number"?c(x,A,_):M==="function"?s(x,A,_):!1;const E=x.constructor;if(E!==A.constructor)return!1;if(E===Object)return f(x,A,_);if(Array.isArray(x))return t(x,A,_);if(E===Date)return r(x,A,_);if(E===RegExp)return m(x,A,_);if(E===Map)return l(x,A,_);if(E===Set)return p(x,A,_);const O=tJ.call(x);if(O===FZ)return r(x,A,_);if(O===WZ)return m(x,A,_);if(O===KZ)return l(x,A,_);if(O===QZ)return p(x,A,_);if(O===XZ)return typeof x.then!="function"&&typeof A.then!="function"&&f(x,A,_);if(O===eJ)return b(x,A,_);if(O===GZ)return i(x,A,_);if(O===UZ)return f(x,A,_);if(JZ[O])return v(x,A,_);if(O===IZ)return e(x,A,_);if(O===HZ)return n(x,A,_);if(O===VZ||O===YZ||O===ZZ)return d(x,A,_);if(w){let j=w[O];if(!j){const R=OZ(x);R&&(j=w[R])}if(j)return j(x,A,_)}return!1}}function rJ({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:CZ,areArraysEqual:n?dh:PZ,areDataViewsEqual:DZ,areDatesEqual:RZ,areErrorsEqual:NZ,areFunctionsEqual:kZ,areMapsEqual:n?$w(Gk,dh):Gk,areNumbersEqual:LZ,areObjectsEqual:n?dh:zZ,arePrimitiveWrappersEqual:$Z,areRegExpsEqual:BZ,areSetsEqual:n?$w(Kk,dh):Kk,areTypedArraysEqual:n?$w(Ey,dh):Ey,areUrlsEqual:qZ,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=Mv(r.areArraysEqual),s=Mv(r.areMapsEqual),l=Mv(r.areObjectsEqual),c=Mv(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:s,areObjectsEqual:l,areSetsEqual:c})}return r}function iJ(e){return function(t,n,r,i,s,l,c){return e(t,n,c)}}function aJ({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(c,f){const{cache:d=e?new WeakMap:void 0,meta:m}=n();return t(c,f,{cache:d,equals:r,meta:m,strict:i})};if(e)return function(c,f){return t(c,f,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const s={cache:void 0,equals:r,meta:void 0,strict:i};return function(c,f){return t(c,f,s)}}const oJ=hl();hl({strict:!0});hl({circular:!0});hl({circular:!0,strict:!0});hl({createInternalComparator:()=>Pu});hl({strict:!0,createInternalComparator:()=>Pu});hl({circular:!0,createInternalComparator:()=>Pu});hl({circular:!0,createInternalComparator:()=>Pu,strict:!0});function hl(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,s=rJ(e),l=nJ(s),c=n?n(l):iJ(l);return aJ({circular:t,comparator:l,createState:r,equals:c,strict:i})}function sJ(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Yk(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(s){n<0&&(n=s),s-n>t?(e(s),n=-1):sJ(i)};requestAnimationFrame(r)}function LA(e){"@babel/helpers - typeof";return LA=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},LA(e)}function lJ(e){return dJ(e)||fJ(e)||cJ(e)||uJ()}function uJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cJ(e,t){if(e){if(typeof e=="string")return Xk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xk(e,t)}}function Xk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?1:A<0?0:A},S=function(A){for(var _=A>1?1:A,M=_,E=0;E<8;++E){var O=p(M)-_,j=b(M);if(Math.abs(O-_)0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,i=t.damping,s=i===void 0?8:i,l=t.dt,c=l===void 0?17:l,f=function(m,p,v){var b=-(m-p)*r,w=v*s,S=v+(b-w)*c/1e3,x=v*c/1e3+m;return Math.abs(x-p)e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function VJ(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s=0)&&(n[i]=e[i]);return n}function Bw(e){return KJ(e)||GJ(e)||FJ(e)||HJ()}function HJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FJ(e,t){if(e){if(typeof e=="string")return IA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return IA(e,t)}}function GJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function KJ(e){if(Array.isArray(e))return IA(e)}function IA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Cy(e){return Cy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Cy(e)}var Ta=(function(e){ZJ(n,e);var t=JJ(n);function n(r,i){var s;YJ(this,n),s=t.call(this,r,i);var l=s.props,c=l.isActive,f=l.attributeName,d=l.from,m=l.to,p=l.steps,v=l.children,b=l.duration;if(s.handleStyleChange=s.handleStyleChange.bind(HA(s)),s.changeStyle=s.changeStyle.bind(HA(s)),!c||b<=0)return s.state={style:{}},typeof v=="function"&&(s.state={style:m}),VA(s);if(p&&p.length)s.state={style:p[0].style};else if(d){if(typeof v=="function")return s.state={style:d},VA(s);s.state={style:f?xh({},f,d):d}}else s.state={style:{}};return s}return WJ(n,[{key:"componentDidMount",value:function(){var i=this.props,s=i.isActive,l=i.canBegin;this.mounted=!0,!(!s||!l)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var s=this.props,l=s.isActive,c=s.canBegin,f=s.attributeName,d=s.shouldReAnimate,m=s.to,p=s.from,v=this.state.style;if(c){if(!l){var b={style:f?xh({},f,m):m};this.state&&v&&(f&&v[f]!==m||!f&&v!==m)&&this.setState(b);return}if(!(oJ(i.to,m)&&i.canBegin&&i.isActive)){var w=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var S=w||d?p:i.to;if(this.state&&v){var x={style:f?xh({},f,S):S};(f&&v[f]!==S||!f&&v!==S)&&this.setState(x)}this.runAnimation(va(va({},this.props),{},{from:S,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var s=this,l=i.from,c=i.to,f=i.duration,d=i.easing,m=i.begin,p=i.onAnimationEnd,v=i.onAnimationStart,b=qJ(l,c,jJ(d),f,this.changeStyle),w=function(){s.stopJSAnimation=b()};this.manager.start([v,m,w,f,p])}},{key:"runStepAnimation",value:function(i){var s=this,l=i.steps,c=i.begin,f=i.onAnimationStart,d=l[0],m=d.style,p=d.duration,v=p===void 0?0:p,b=function(S,x,A){if(A===0)return S;var _=x.duration,M=x.easing,E=M===void 0?"ease":M,O=x.style,j=x.properties,R=x.onAnimationEnd,k=A>0?l[A-1]:x,z=j||Object.keys(O);if(typeof E=="function"||E==="spring")return[].concat(Bw(S),[s.runJSAnimation.bind(s,{from:k.style,to:O,duration:_,easing:E}),_]);var G=Zk(z,_,E),$=va(va(va({},k.style),O),{},{transition:G});return[].concat(Bw(S),[$,_,R]).filter(yJ)};return this.manager.start([f].concat(Bw(l.reduce(b,[m,Math.max(v,c)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=hJ());var s=i.begin,l=i.duration,c=i.attributeName,f=i.to,d=i.easing,m=i.onAnimationStart,p=i.onAnimationEnd,v=i.steps,b=i.children,w=this.manager;if(this.unSubscribe=w.subscribe(this.handleStyleChange),typeof d=="function"||typeof b=="function"||d==="spring"){this.runJSAnimation(i);return}if(v.length>1){this.runStepAnimation(i);return}var S=c?xh({},c,f):f,x=Zk(Object.keys(S),l,d);w.start([m,s,va(va({},S),{},{transition:x}),l,p])}},{key:"render",value:function(){var i=this.props,s=i.children;i.begin;var l=i.duration;i.attributeName,i.easing;var c=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var f=UJ(i,IJ),d=K.Children.count(s),m=this.state.style;if(typeof s=="function")return s(m);if(!c||d===0||l<=0)return s;var p=function(b){var w=b.props,S=w.style,x=S===void 0?{}:S,A=w.className,_=K.cloneElement(b,va(va({},f),{},{style:va(va({},x),m),className:A}));return _};return d===1?p(K.Children.only(s)):Q.createElement("div",null,K.Children.map(s,function(v){return p(v)}))}}]),n})(K.PureComponent);Ta.displayName="Animate";Ta.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Ta.propTypes={from:Dt.oneOfType([Dt.object,Dt.string]),to:Dt.oneOfType([Dt.object,Dt.string]),attributeName:Dt.string,duration:Dt.number,begin:Dt.number,easing:Dt.oneOfType([Dt.string,Dt.func]),steps:Dt.arrayOf(Dt.shape({duration:Dt.number.isRequired,style:Dt.object.isRequired,easing:Dt.oneOfType([Dt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Dt.func]),properties:Dt.arrayOf("string"),onAnimationEnd:Dt.func})),children:Dt.oneOfType([Dt.node,Dt.func]),isActive:Dt.bool,canBegin:Dt.bool,onAnimationEnd:Dt.func,shouldReAnimate:Dt.bool,onAnimationStart:Dt.func,onAnimationReStart:Dt.func};function pp(e){"@babel/helpers - typeof";return pp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pp(e)}function Py(){return Py=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0?1:-1,f=r>=0?1:-1,d=i>=0&&r>=0||i<0&&r<0?1:0,m;if(l>0&&s instanceof Array){for(var p=[0,0,0,0],v=0,b=4;vl?l:s[v];m="M".concat(t,",").concat(n+c*p[0]),p[0]>0&&(m+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(d,",").concat(t+f*p[0],",").concat(n)),m+="L ".concat(t+r-f*p[1],",").concat(n),p[1]>0&&(m+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(d,`, `).concat(t+r,",").concat(n+c*p[1])),m+="L ".concat(t+r,",").concat(n+i-c*p[2]),p[2]>0&&(m+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(d,`, `).concat(t+r-f*p[2],",").concat(n+i)),m+="L ".concat(t+f*p[3],",").concat(n+i),p[3]>0&&(m+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(d,`, `).concat(t,",").concat(n+i-c*p[3])),m+="Z"}else if(l>0&&s===+s&&s>0){var w=Math.min(l,s);m="M ".concat(t,",").concat(n+c*w,` @@ -108,160 +110,160 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho L `).concat(t+r,",").concat(n+i-c*w,` A `).concat(w,",").concat(w,",0,0,").concat(d,",").concat(t+r-f*w,",").concat(n+i,` L `).concat(t+f*w,",").concat(n+i,` - A `).concat(w,",").concat(w,",0,0,").concat(d,",").concat(t,",").concat(n+i-c*w," Z")}else m="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return m},ree=function(t,n){if(!t||!n)return!1;var r=t.x,i=t.y,s=n.x,l=n.y,c=n.width,f=n.height;if(Math.abs(c)>0&&Math.abs(f)>0){var d=Math.min(s,s+c),m=Math.max(s,s+c),p=Math.min(l,l+f),v=Math.max(l,l+f);return r>=d&&r<=m&&i>=p&&i<=v}return!1},iee={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},GT=function(t){var n=a3(a3({},iee),t),r=K.useRef(),i=K.useState(-1),s=XJ(i,2),l=s[0],c=s[1];K.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var E=r.current.getTotalLength();E&&c(E)}catch{}},[]);var f=n.x,d=n.y,m=n.width,p=n.height,v=n.radius,b=n.className,w=n.animationEasing,S=n.animationDuration,x=n.animationBegin,A=n.isAnimationActive,_=n.isUpdateAnimationActive;if(f!==+f||d!==+d||m!==+m||p!==+p||m===0||p===0)return null;var M=ut("recharts-rectangle",b);return _?Q.createElement(Ta,{canBegin:l>0,from:{width:m,height:p,x:f,y:d},to:{width:m,height:p,x:f,y:d},duration:S,animationEasing:w,isActive:_},function(E){var O=E.width,j=E.height,R=E.x,k=E.y;return Q.createElement(Ta,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:S,isActive:A,easing:w},Q.createElement("path",Cy({},Je(n,!0),{className:M,d:o3(R,k,O,j,v),ref:r})))}):Q.createElement("path",Cy({},Je(n,!0),{className:M,d:o3(f,d,m,p,v)}))};function HA(){return HA=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fee(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var dee=function(t,n,r,i,s,l){return"M".concat(t,",").concat(s,"v").concat(i,"M").concat(l,",").concat(n,"h").concat(r)},hee=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,s=i===void 0?0:i,l=t.top,c=l===void 0?0:l,f=t.left,d=f===void 0?0:f,m=t.width,p=m===void 0?0:m,v=t.height,b=v===void 0?0:v,w=t.className,S=cee(t,aee),x=oee({x:r,y:s,top:c,left:d,width:p,height:b},S);return!Oe(r)||!Oe(s)||!Oe(p)||!Oe(b)||!Oe(c)||!Oe(d)?null:Q.createElement("path",FA({},Je(x,!0),{className:ut("recharts-cross",w),d:dee(r,s,p,b,c,d)}))},qw,l3;function pee(){if(l3)return qw;l3=1;var e=U$(),t=e(Object.getPrototypeOf,Object);return qw=t,qw}var Iw,u3;function mee(){if(u3)return Iw;u3=1;var e=Jo(),t=pee(),n=es(),r="[object Object]",i=Function.prototype,s=Object.prototype,l=i.toString,c=s.hasOwnProperty,f=l.call(Object);function d(m){if(!n(m)||e(m)!=r)return!1;var p=t(m);if(p===null)return!0;var v=c.call(p,"constructor")&&p.constructor;return typeof v=="function"&&v instanceof v&&l.call(v)==f}return Iw=d,Iw}var vee=mee();const yee=Ft(vee);var Uw,c3;function gee(){if(c3)return Uw;c3=1;var e=Jo(),t=es(),n="[object Boolean]";function r(i){return i===!0||i===!1||t(i)&&e(i)==n}return Uw=r,Uw}var bee=gee();const xee=Ft(bee);function vp(e){"@babel/helpers - typeof";return vp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vp(e)}function Dy(){return Dy=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,from:{upperWidth:0,lowerWidth:0,height:v,x:f,y:d},to:{upperWidth:m,lowerWidth:p,height:v,x:f,y:d},duration:S,animationEasing:w,isActive:A},function(M){var E=M.upperWidth,O=M.lowerWidth,j=M.height,R=M.x,k=M.y;return Q.createElement(Ta,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:S,easing:w},Q.createElement("path",Dy({},Je(n,!0),{className:_,d:p3(R,k,E,O,j),ref:r})))}):Q.createElement("g",null,Q.createElement("path",Dy({},Je(n,!0),{className:_,d:p3(f,d,m,p,v)})))},Cee=["option","shapeType","propTransformer","activeClassName","isActive"];function yp(e){"@babel/helpers - typeof";return yp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yp(e)}function Dee(e,t){if(e==null)return{};var n=Ree(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ree(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function m3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ry(e){for(var t=1;t0&&r.handleDrag(i.changedTouches[0])}),Oi(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,s=i.endIndex,l=i.onDragEnd,c=i.startIndex;l==null||l({endIndex:s,startIndex:c})}),r.detachDragEndListener()}),Oi(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Oi(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Oi(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Oi(r,"handleSlideDragStart",function(i){var s=O3(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:s.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return ote(t,e),nte(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,s=r.endX,l=this.state.scaleValues,c=this.props,f=c.gap,d=c.data,m=d.length-1,p=Math.min(i,s),v=Math.max(i,s),b=t.getIndexInRange(l,p),w=t.getIndexInRange(l,v);return{startIndex:b-b%f,endIndex:w===m?m:w-w%f}}},{key:"getTextOfTick",value:function(r){var i=this.props,s=i.data,l=i.tickFormatter,c=i.dataKey,f=er(s[r],c,r);return tt(l)?l(f,r):f}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,s=i.slideMoveStartX,l=i.startX,c=i.endX,f=this.props,d=f.x,m=f.width,p=f.travellerWidth,v=f.startIndex,b=f.endIndex,w=f.onChange,S=r.pageX-s;S>0?S=Math.min(S,d+m-p-c,d+m-p-l):S<0&&(S=Math.max(S,d-l,d-c));var x=this.getIndex({startX:l+S,endX:c+S});(x.startIndex!==v||x.endIndex!==b)&&w&&w(x),this.setState({startX:l+S,endX:c+S,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var s=O3(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:s.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,s=i.brushMoveStartX,l=i.movingTravellerId,c=i.endX,f=i.startX,d=this.state[l],m=this.props,p=m.x,v=m.width,b=m.travellerWidth,w=m.onChange,S=m.gap,x=m.data,A={startX:this.state.startX,endX:this.state.endX},_=r.pageX-s;_>0?_=Math.min(_,p+v-b-d):_<0&&(_=Math.max(_,p-d)),A[l]=d+_;var M=this.getIndex(A),E=M.startIndex,O=M.endIndex,j=function(){var k=x.length-1;return l==="startX"&&(c>f?E%S===0:O%S===0)||cf?O%S===0:E%S===0)||c>f&&O===k};this.setState(Oi(Oi({},l,d+_),"brushMoveStartX",r.pageX),function(){w&&j()&&w(M)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var s=this,l=this.state,c=l.scaleValues,f=l.startX,d=l.endX,m=this.state[i],p=c.indexOf(m);if(p!==-1){var v=p+r;if(!(v===-1||v>=c.length)){var b=c[v];i==="startX"&&b>=d||i==="endX"&&b<=f||this.setState(Oi({},i,b),function(){s.props.onChange(s.getIndex({startX:s.state.startX,endX:s.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,s=r.y,l=r.width,c=r.height,f=r.fill,d=r.stroke;return Q.createElement("rect",{stroke:d,fill:f,x:i,y:s,width:l,height:c})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,s=r.y,l=r.width,c=r.height,f=r.data,d=r.children,m=r.padding,p=K.Children.only(d);return p?Q.cloneElement(p,{x:i,y:s,width:l,height:c,margin:m,compact:!0,data:f}):null}},{key:"renderTravellerLayer",value:function(r,i){var s,l,c=this,f=this.props,d=f.y,m=f.travellerWidth,p=f.height,v=f.traveller,b=f.ariaLabel,w=f.data,S=f.startIndex,x=f.endIndex,A=Math.max(r,this.props.x),_=Kw(Kw({},Je(this.props,!1)),{},{x:A,y:d,width:m,height:p}),M=b||"Min value: ".concat((s=w[S])===null||s===void 0?void 0:s.name,", Max value: ").concat((l=w[x])===null||l===void 0?void 0:l.name);return Q.createElement(Mt,{tabIndex:0,role:"slider","aria-label":M,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(O){["ArrowLeft","ArrowRight"].includes(O.key)&&(O.preventDefault(),O.stopPropagation(),c.handleTravellerMoveKeyboard(O.key==="ArrowRight"?1:-1,i))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(v,_))}},{key:"renderSlide",value:function(r,i){var s=this.props,l=s.y,c=s.height,f=s.stroke,d=s.travellerWidth,m=Math.min(r,i)+d,p=Math.max(Math.abs(i-r)-d,0);return Q.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:f,fillOpacity:.2,x:m,y:l,width:p,height:c})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,s=r.endIndex,l=r.y,c=r.height,f=r.travellerWidth,d=r.stroke,m=this.state,p=m.startX,v=m.endX,b=5,w={pointerEvents:"none",fill:d};return Q.createElement(Mt,{className:"recharts-brush-texts"},Q.createElement(uy,ky({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,v)-b,y:l+c/2},w),this.getTextOfTick(i)),Q.createElement(uy,ky({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,v)+f+b,y:l+c/2},w),this.getTextOfTick(s)))}},{key:"render",value:function(){var r=this.props,i=r.data,s=r.className,l=r.children,c=r.x,f=r.y,d=r.width,m=r.height,p=r.alwaysShowText,v=this.state,b=v.startX,w=v.endX,S=v.isTextActive,x=v.isSlideMoving,A=v.isTravellerMoving,_=v.isTravellerFocused;if(!i||!i.length||!Oe(c)||!Oe(f)||!Oe(d)||!Oe(m)||d<=0||m<=0)return null;var M=ut("recharts-brush",s),E=Q.Children.count(l)===1,O=ete("userSelect","none");return Q.createElement(Mt,{className:M,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:O},this.renderBackground(),E&&this.renderPanorama(),this.renderSlide(b,w),this.renderTravellerLayer(b,"startX"),this.renderTravellerLayer(w,"endX"),(S||x||A||_||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,s=r.y,l=r.width,c=r.height,f=r.stroke,d=Math.floor(s+c/2)-1;return Q.createElement(Q.Fragment,null,Q.createElement("rect",{x:i,y:s,width:l,height:c,fill:f,stroke:"none"}),Q.createElement("line",{x1:i+1,y1:d,x2:i+l-1,y2:d,fill:"none",stroke:"#fff"}),Q.createElement("line",{x1:i+1,y1:d+2,x2:i+l-1,y2:d+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var s;return Q.isValidElement(r)?s=Q.cloneElement(r,i):tt(r)?s=r(i):s=t.renderDefaultTraveller(i),s}},{key:"getDerivedStateFromProps",value:function(r,i){var s=r.data,l=r.width,c=r.x,f=r.travellerWidth,d=r.updateId,m=r.startIndex,p=r.endIndex;if(s!==i.prevData||d!==i.prevUpdateId)return Kw({prevData:s,prevTravellerWidth:f,prevUpdateId:d,prevX:c,prevWidth:l},s&&s.length?lte({data:s,width:l,x:c,travellerWidth:f,startIndex:m,endIndex:p}):{scale:null,scaleValues:null});if(i.scale&&(l!==i.prevWidth||c!==i.prevX||f!==i.prevTravellerWidth)){i.scale.range([c,c+l-f]);var v=i.scale.domain().map(function(b){return i.scale(b)});return{prevData:s,prevTravellerWidth:f,prevUpdateId:d,prevX:c,prevWidth:l,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:v}}return null}},{key:"getIndexInRange",value:function(r,i){for(var s=r.length,l=0,c=s-1;c-l>1;){var f=Math.floor((l+c)/2);r[f]>i?c=f:l=f}return i>=r[c]?c:l}}])})(K.PureComponent);Oi(vf,"displayName","Brush");Oi(vf,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Yw,T3;function ute(){if(T3)return Yw;T3=1;var e=yT();function t(n,r){var i;return e(n,function(s,l,c){return i=r(s,l,c),!i}),!!i}return Yw=t,Yw}var Xw,E3;function cte(){if(E3)return Xw;E3=1;var e=k$(),t=ul(),n=ute(),r=fi(),i=Sg();function s(l,c,f){var d=r(l)?e:n;return f&&i(l,c,f)&&(c=void 0),d(l,t(c,3))}return Xw=s,Xw}var fte=cte();const dte=Ft(fte);var Qa=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},Ww,M3;function hte(){if(M3)return Ww;M3=1;var e=J$();function t(n,r,i){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[r]=i}return Ww=t,Ww}var Qw,j3;function pte(){if(j3)return Qw;j3=1;var e=hte(),t=Q$(),n=ul();function r(i,s){var l={};return s=n(s,3),t(i,function(c,f,d){e(l,f,s(c,f,d))}),l}return Qw=r,Qw}var mte=pte();const vte=Ft(mte);var Zw,P3;function yte(){if(P3)return Zw;P3=1;function e(t,n){for(var r=-1,i=t==null?0:t.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Tte(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ete(e,t){var n=e.x,r=e.y,i=Ote(e,Ste),s="".concat(n),l=parseInt(s,10),c="".concat(r),f=parseInt(c,10),d="".concat(t.height||i.height),m=parseInt(d,10),p="".concat(t.width||i.width),v=parseInt(p,10);return hh(hh(hh(hh(hh({},t),i),l?{x:l}:{}),f?{y:f}:{}),{},{height:m,width:v,name:t.name,radius:t.radius})}function N3(e){return Q.createElement(GA,YA({shapeType:"rectangle",propTransformer:Ete,activeClassName:"recharts-active-bar"},e))}var Mte=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof t=="number")return t;var s=Oe(r)||kH(r);return s?t(r,i):(s||Au(),n)}},jte=["value","background"],Tq;function yf(e){"@babel/helpers - typeof";return yf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yf(e)}function Pte(e,t){if(e==null)return{};var n=Cte(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Cte(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function zy(){return zy=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(J)0&&Math.abs(ee)0&&(Z=Math.min((ue||0)-(ee[be-1]||0),Z))}),Number.isFinite(Z)){var J=Z/B,q=S.layout==="vertical"?r.height:r.width;if(S.padding==="gap"&&(R=J*q/2),S.padding==="no-gap"){var F=Su(t.barCategoryGap,J*q),ie=J*q/2;R=ie-F-(ie-F)/q*F}}}i==="xAxis"?k=[r.left+(M.left||0)+(R||0),r.left+r.width-(M.right||0)-(R||0)]:i==="yAxis"?k=f==="horizontal"?[r.top+r.height-(M.bottom||0),r.top+(M.top||0)]:[r.top+(M.top||0)+(R||0),r.top+r.height-(M.bottom||0)-(R||0)]:k=S.range,O&&(k=[k[1],k[0]]);var ce=ZW(S,s,v),U=ce.scale,D=ce.realScaleType;U.domain(A).range(k),JW(U);var V=sQ(U,xa(xa({},S),{},{realScaleType:D}));i==="xAxis"?($=x==="top"&&!E||x==="bottom"&&E,z=r.left,G=p[j]-$*S.height):i==="yAxis"&&($=x==="left"&&!E||x==="right"&&E,z=p[j]-$*S.width,G=r.top);var X=xa(xa(xa({},S),V),{},{realScaleType:D,x:z,y:G,scale:U,width:i==="xAxis"?r.width:S.width,height:i==="yAxis"?r.height:S.height});return X.bandSize=Ay(X,V),!S.hide&&i==="xAxis"?p[j]+=($?-1:1)*X.height:S.hide||(p[j]+=($?-1:1)*X.width),xa(xa({},b),{},kg({},w,X))},{})},Cq=function(t,n){var r=t.x,i=t.y,s=n.x,l=n.y;return{x:Math.min(r,s),y:Math.min(i,l),width:Math.abs(s-r),height:Math.abs(l-i)}},Ute=function(t){var n=t.x1,r=t.y1,i=t.x2,s=t.y2;return Cq({x:n,y:r},{x:i,y:s})},Dq=(function(){function e(t){Bte(this,e),this.scale=t}return qte(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,s=r.position;if(n!==void 0){if(s)switch(s){case"start":return this.scale(n);case"middle":{var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}case"end":{var c=this.bandwidth?this.bandwidth():0;return this.scale(n)+c}default:return this.scale(n)}if(i){var f=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+f}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],s=r[r.length-1];return i<=s?n>=i&&n<=s:n>=s&&n<=i}}],[{key:"create",value:function(n){return new e(n)}}])})();kg(Dq,"EPS",1e-4);var KT=function(t){var n=Object.keys(t).reduce(function(r,i){return xa(xa({},r),{},kg({},i,Dq.create(t[i])))},{});return xa(xa({},n),{},{apply:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=s.bandAware,c=s.position;return vte(i,function(f,d){return n[d].apply(f,{bandAware:l,position:c})})},isInRange:function(i){return Oq(i,function(s,l){return n[l].isInRange(s)})}})};function Vte(e){return(e%180+180)%180}var Hte=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=Vte(i),l=s*Math.PI/180,c=Math.atan(r/n),f=l>c&&l-1?f[d?s[m]:m]:void 0}}return t_=r,t_}var n_,q3;function Gte(){if(q3)return n_;q3=1;var e=Sq();function t(n){var r=e(n),i=r%1;return r===r?i?r-i:r:0}return n_=t,n_}var r_,I3;function Kte(){if(I3)return r_;I3=1;var e=G$(),t=ul(),n=Gte(),r=Math.max;function i(s,l,c){var f=s==null?0:s.length;if(!f)return-1;var d=c==null?0:n(c);return d<0&&(d=r(f+d,0)),e(s,t(l,3),d)}return r_=i,r_}var i_,U3;function Yte(){if(U3)return i_;U3=1;var e=Fte(),t=Kte(),n=e(t);return i_=n,i_}var Xte=Yte();const Wte=Ft(Xte);var Qte=s$();const Zte=Ft(Qte);var Jte=Zte(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),YT=K.createContext(void 0),XT=K.createContext(void 0),Rq=K.createContext(void 0),Nq=K.createContext({}),kq=K.createContext(void 0),Lq=K.createContext(0),zq=K.createContext(0),V3=function(t){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,s=n.offset,l=t.clipPathId,c=t.children,f=t.width,d=t.height,m=Jte(s);return Q.createElement(YT.Provider,{value:r},Q.createElement(XT.Provider,{value:i},Q.createElement(Nq.Provider,{value:s},Q.createElement(Rq.Provider,{value:m},Q.createElement(kq.Provider,{value:l},Q.createElement(Lq.Provider,{value:d},Q.createElement(zq.Provider,{value:f},c)))))))},ene=function(){return K.useContext(kq)},$q=function(t){var n=K.useContext(YT);n==null&&Au();var r=n[t];return r==null&&Au(),r},tne=function(){var t=K.useContext(YT);return Fs(t)},nne=function(){var t=K.useContext(XT),n=Wte(t,function(r){return Oq(r.domain,Number.isFinite)});return n||Fs(t)},Bq=function(t){var n=K.useContext(XT);n==null&&Au();var r=n[t];return r==null&&Au(),r},rne=function(){var t=K.useContext(Rq);return t},ine=function(){return K.useContext(Nq)},WT=function(){return K.useContext(zq)},QT=function(){return K.useContext(Lq)};function gf(e){"@babel/helpers - typeof";return gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gf(e)}function ane(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function one(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne*i)return!1;var s=n();return e*(t-e*s/2-r)>=0&&e*(t+e*s/2-i)<=0}function Ine(e,t){return Gq(e,t+1)}function Une(e,t,n,r,i){for(var s=(r||[]).slice(),l=t.start,c=t.end,f=0,d=1,m=l,p=function(){var w=r==null?void 0:r[f];if(w===void 0)return{v:Gq(r,d)};var S=f,x,A=function(){return x===void 0&&(x=n(w,S)),x},_=w.coordinate,M=f===0||Uy(e,_,A,m,c);M||(f=0,m=l,d+=1),M&&(m=_+e*(A()/2+i),f+=d)},v;d<=s.length;)if(v=p(),v)return v.v;return[]}function wp(e){"@babel/helpers - typeof";return wp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wp(e)}function Q3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kr(e){for(var t=1;t0?b.coordinate-x*e:b.coordinate})}else s[v]=b=kr(kr({},b),{},{tickCoord:b.coordinate});var A=Uy(e,b.tickCoord,S,c,f);A&&(f=b.tickCoord-e*(S()/2+i),s[v]=kr(kr({},b),{},{isShow:!0}))},m=l-1;m>=0;m--)d(m);return s}function Kne(e,t,n,r,i,s){var l=(r||[]).slice(),c=l.length,f=t.start,d=t.end;if(s){var m=r[c-1],p=n(m,c-1),v=e*(m.coordinate+e*p/2-d);l[c-1]=m=kr(kr({},m),{},{tickCoord:v>0?m.coordinate-v*e:m.coordinate});var b=Uy(e,m.tickCoord,function(){return p},f,d);b&&(d=m.tickCoord-e*(p/2+i),l[c-1]=kr(kr({},m),{},{isShow:!0}))}for(var w=s?c-1:c,S=function(_){var M=l[_],E,O=function(){return E===void 0&&(E=n(M,_)),E};if(_===0){var j=e*(M.coordinate-e*O()/2-f);l[_]=M=kr(kr({},M),{},{tickCoord:j<0?M.coordinate-j*e:M.coordinate})}else l[_]=M=kr(kr({},M),{},{tickCoord:M.coordinate});var R=Uy(e,M.tickCoord,O,f,d);R&&(f=M.tickCoord+e*(O()/2+i),l[_]=kr(kr({},M),{},{isShow:!0}))},x=0;x=2?Oa(i[1].coordinate-i[0].coordinate):1,A=qne(s,x,b);return f==="equidistantPreserveStart"?Une(x,A,S,i,l):(f==="preserveStart"||f==="preserveStartEnd"?v=Kne(x,A,S,i,l,f==="preserveStartEnd"):v=Gne(x,A,S,i,l),v.filter(function(_){return _.isShow}))}var Yne=["viewBox"],Xne=["viewBox"],Wne=["ticks"];function Sf(e){"@babel/helpers - typeof";return Sf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sf(e)}function Pc(){return Pc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Qne(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Zne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J3(e,t){for(var n=0;n0?f(this.props):f(b)),l<=0||c<=0||!w||!w.length?null:Q.createElement(Mt,{className:ut("recharts-cartesian-axis",d),ref:function(x){r.layerReference=x}},s&&this.renderAxisLine(),this.renderTicks(w,this.state.fontSize,this.state.letterSpacing),zr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,s){var l,c=ut(i.className,"recharts-cartesian-axis-tick-value");return Q.isValidElement(r)?l=Q.cloneElement(r,Kn(Kn({},i),{},{className:c})):tt(r)?l=r(Kn(Kn({},i),{},{className:c})):l=Q.createElement(uy,Pc({},i,{className:"recharts-cartesian-axis-tick-value"}),s),l}}])})(K.Component);t2(Wf,"displayName","CartesianAxis");t2(Wf,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var are=["x1","y1","x2","y2","key"],ore=["offset"];function Ou(e){"@babel/helpers - typeof";return Ou=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ou(e)}function e5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $r(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cre(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var fre=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,i=t.x,s=t.y,l=t.width,c=t.height,f=t.ry;return Q.createElement("rect",{x:i,y:s,ry:f,width:l,height:c,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Xq(e,t){var n;if(Q.isValidElement(e))n=Q.cloneElement(e,t);else if(tt(e))n=e(t);else{var r=t.x1,i=t.y1,s=t.x2,l=t.y2,c=t.key,f=t5(t,are),d=Je(f,!1);d.offset;var m=t5(d,ore);n=Q.createElement("line",tu({},m,{x1:r,y1:i,x2:s,y2:l,fill:"none",key:c}))}return n}function dre(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,s=e.horizontalPoints;if(!i||!s||!s.length)return null;var l=s.map(function(c,f){var d=$r($r({},e),{},{x1:t,y1:c,x2:t+n,y2:c,key:"line-".concat(f),index:f});return Xq(i,d)});return Q.createElement("g",{className:"recharts-cartesian-grid-horizontal"},l)}function hre(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,s=e.verticalPoints;if(!i||!s||!s.length)return null;var l=s.map(function(c,f){var d=$r($r({},e),{},{x1:c,y1:t,x2:c,y2:t+n,key:"line-".concat(f),index:f});return Xq(i,d)});return Q.createElement("g",{className:"recharts-cartesian-grid-vertical"},l)}function pre(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,s=e.width,l=e.height,c=e.horizontalPoints,f=e.horizontal,d=f===void 0?!0:f;if(!d||!t||!t.length)return null;var m=c.map(function(v){return Math.round(v+i-i)}).sort(function(v,b){return v-b});i!==m[0]&&m.unshift(0);var p=m.map(function(v,b){var w=!m[b+1],S=w?i+l-v:m[b+1]-v;if(S<=0)return null;var x=b%t.length;return Q.createElement("rect",{key:"react-".concat(b),y:v,x:r,height:S,width:s,stroke:"none",fill:t[x],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return Q.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function mre(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,s=e.x,l=e.y,c=e.width,f=e.height,d=e.verticalPoints;if(!n||!r||!r.length)return null;var m=d.map(function(v){return Math.round(v+s-s)}).sort(function(v,b){return v-b});s!==m[0]&&m.unshift(0);var p=m.map(function(v,b){var w=!m[b+1],S=w?s+c-v:m[b+1]-v;if(S<=0)return null;var x=b%r.length;return Q.createElement("rect",{key:"react-".concat(b),x:v,y:l,width:S,height:f,stroke:"none",fill:r[x],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return Q.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var vre=function(t,n){var r=t.xAxis,i=t.width,s=t.height,l=t.offset;return lq(e2($r($r($r({},Wf.defaultProps),r),{},{ticks:$o(r,!0),viewBox:{x:0,y:0,width:i,height:s}})),l.left,l.left+l.width,n)},yre=function(t,n){var r=t.yAxis,i=t.width,s=t.height,l=t.offset;return lq(e2($r($r($r({},Wf.defaultProps),r),{},{ticks:$o(r,!0),viewBox:{x:0,y:0,width:i,height:s}})),l.top,l.top+l.height,n)},_c={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Ip(e){var t,n,r,i,s,l,c=WT(),f=QT(),d=ine(),m=$r($r({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:_c.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:_c.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:_c.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:_c.horizontalFill,vertical:(s=e.vertical)!==null&&s!==void 0?s:_c.vertical,verticalFill:(l=e.verticalFill)!==null&&l!==void 0?l:_c.verticalFill,x:Oe(e.x)?e.x:d.left,y:Oe(e.y)?e.y:d.top,width:Oe(e.width)?e.width:d.width,height:Oe(e.height)?e.height:d.height}),p=m.x,v=m.y,b=m.width,w=m.height,S=m.syncWithTicks,x=m.horizontalValues,A=m.verticalValues,_=tne(),M=nne();if(!Oe(b)||b<=0||!Oe(w)||w<=0||!Oe(p)||p!==+p||!Oe(v)||v!==+v)return null;var E=m.verticalCoordinatesGenerator||vre,O=m.horizontalCoordinatesGenerator||yre,j=m.horizontalPoints,R=m.verticalPoints;if((!j||!j.length)&&tt(O)){var k=x&&x.length,z=O({yAxis:M?$r($r({},M),{},{ticks:k?x:M.ticks}):void 0,width:c,height:f,offset:d},k?!0:S);qo(Array.isArray(z),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Ou(z),"]")),Array.isArray(z)&&(j=z)}if((!R||!R.length)&&tt(E)){var G=A&&A.length,$=E({xAxis:_?$r($r({},_),{},{ticks:G?A:_.ticks}):void 0,width:c,height:f,offset:d},G?!0:S);qo(Array.isArray($),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Ou($),"]")),Array.isArray($)&&(R=$)}return Q.createElement("g",{className:"recharts-cartesian-grid"},Q.createElement(fre,{fill:m.fill,fillOpacity:m.fillOpacity,x:m.x,y:m.y,width:m.width,height:m.height,ry:m.ry}),Q.createElement(dre,tu({},m,{offset:d,horizontalPoints:j,xAxis:_,yAxis:M})),Q.createElement(hre,tu({},m,{offset:d,verticalPoints:R,xAxis:_,yAxis:M})),Q.createElement(pre,tu({},m,{horizontalPoints:j})),Q.createElement(mre,tu({},m,{verticalPoints:R})))}Ip.displayName="CartesianGrid";var gre=["type","layout","connectNulls","ref"],bre=["key"];function wf(e){"@babel/helpers - typeof";return wf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wf(e)}function n5(e,t){if(e==null)return{};var n=xre(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xre(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ch(){return Ch=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);np){b=[].concat(Ac(f.slice(0,w)),[p-S]);break}var x=b.length%2===0?[0,v]:[v];return[].concat(Ac(t.repeat(f,m)),Ac(b),x).map(function(A){return"".concat(A,"px")}).join(", ")}),Sa(n,"id",Mu("recharts-line-")),Sa(n,"pathRef",function(l){n.mainCurve=l}),Sa(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Sa(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return Pre(t,e),Tre(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.points,c=s.xAxis,f=s.yAxis,d=s.layout,m=s.children,p=ci(m,Xf);if(!p)return null;var v=function(S,x){return{x:S.x,y:S.y,value:S.value,errorVal:er(S.payload,x)}},b={clipPath:r?"url(#clipPath-".concat(i,")"):null};return Q.createElement(Mt,b,p.map(function(w){return Q.cloneElement(w,{key:"bar-".concat(w.props.dataKey),data:l,xAxis:c,yAxis:f,layout:d,dataPointFormatter:v})}))}},{key:"renderDots",value:function(r,i,s){var l=this.props.isAnimationActive;if(l&&!this.state.isAnimationFinished)return null;var c=this.props,f=c.dot,d=c.points,m=c.dataKey,p=Je(this.props,!1),v=Je(f,!0),b=d.map(function(S,x){var A=_i(_i(_i({key:"dot-".concat(x),r:3},p),v),{},{index:x,cx:S.x,cy:S.y,value:S.value,dataKey:m,payload:S.payload,points:d});return t.renderDotItem(f,A)}),w={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(s,")"):null};return Q.createElement(Mt,Ch({className:"recharts-line-dots",key:"dots"},w),b)}},{key:"renderCurveStatically",value:function(r,i,s,l){var c=this.props,f=c.type,d=c.layout,m=c.connectNulls;c.ref;var p=n5(c,gre),v=_i(_i(_i({},Je(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(s,")"):null,points:r},l),{},{type:f,layout:d,connectNulls:m});return Q.createElement(mu,Ch({},v,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var s=this,l=this.props,c=l.points,f=l.strokeDasharray,d=l.isAnimationActive,m=l.animationBegin,p=l.animationDuration,v=l.animationEasing,b=l.animationId,w=l.animateNewValues,S=l.width,x=l.height,A=this.state,_=A.prevPoints,M=A.totalLength;return Q.createElement(Ta,{begin:m,duration:p,isActive:d,easing:v,from:{t:0},to:{t:1},key:"line-".concat(b),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(E){var O=E.t;if(_){var j=_.length/c.length,R=c.map(function(B,Z){var ee=Math.floor(Z*j);if(_[ee]){var J=_[ee],q=Rn(J.x,B.x),F=Rn(J.y,B.y);return _i(_i({},B),{},{x:q(O),y:F(O)})}if(w){var ie=Rn(S*2,B.x),ce=Rn(x/2,B.y);return _i(_i({},B),{},{x:ie(O),y:ce(O)})}return _i(_i({},B),{},{x:B.x,y:B.y})});return s.renderCurveStatically(R,r,i)}var k=Rn(0,M),z=k(O),G;if(f){var $="".concat(f).split(/[,\s]+/gim).map(function(B){return parseFloat(B)});G=s.getStrokeDasharray(z,M,$)}else G=s.generateSimpleStrokeDasharray(M,z);return s.renderCurveStatically(c,r,i,{strokeDasharray:G})})}},{key:"renderCurve",value:function(r,i){var s=this.props,l=s.points,c=s.isAnimationActive,f=this.state,d=f.prevPoints,m=f.totalLength;return c&&l&&l.length&&(!d&&m>0||!wu(d,l))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(l,r,i)}},{key:"render",value:function(){var r,i=this.props,s=i.hide,l=i.dot,c=i.points,f=i.className,d=i.xAxis,m=i.yAxis,p=i.top,v=i.left,b=i.width,w=i.height,S=i.isAnimationActive,x=i.id;if(s||!c||!c.length)return null;var A=this.state.isAnimationFinished,_=c.length===1,M=ut("recharts-line",f),E=d&&d.allowDataOverflow,O=m&&m.allowDataOverflow,j=E||O,R=Qe(x)?this.id:x,k=(r=Je(l,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},z=k.r,G=z===void 0?3:z,$=k.strokeWidth,B=$===void 0?2:$,Z=d$(l)?l:{},ee=Z.clipDot,J=ee===void 0?!0:ee,q=G*2+B;return Q.createElement(Mt,{className:M},E||O?Q.createElement("defs",null,Q.createElement("clipPath",{id:"clipPath-".concat(R)},Q.createElement("rect",{x:E?v:v-b/2,y:O?p:p-w/2,width:E?b:b*2,height:O?w:w*2})),!J&&Q.createElement("clipPath",{id:"clipPath-dots-".concat(R)},Q.createElement("rect",{x:v-q/2,y:p-q/2,width:b+q,height:w+q}))):null,!_&&this.renderCurve(j,R),this.renderErrorBar(j,R),(_||l)&&this.renderDots(j,J,R),(!S||A)&&Wa.renderCallByParent(this.props,c))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var s=r.length%2!==0?[].concat(Ac(r),[0]):r,l=[],c=0;c=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Nre(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function nu(){return nu=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!wu(m,l)||!wu(p,c))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(l,c,r,i)}},{key:"render",value:function(){var r,i=this.props,s=i.hide,l=i.dot,c=i.points,f=i.className,d=i.top,m=i.left,p=i.xAxis,v=i.yAxis,b=i.width,w=i.height,S=i.isAnimationActive,x=i.id;if(s||!c||!c.length)return null;var A=this.state.isAnimationFinished,_=c.length===1,M=ut("recharts-area",f),E=p&&p.allowDataOverflow,O=v&&v.allowDataOverflow,j=E||O,R=Qe(x)?this.id:x,k=(r=Je(l,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},z=k.r,G=z===void 0?3:z,$=k.strokeWidth,B=$===void 0?2:$,Z=d$(l)?l:{},ee=Z.clipDot,J=ee===void 0?!0:ee,q=G*2+B;return Q.createElement(Mt,{className:M},E||O?Q.createElement("defs",null,Q.createElement("clipPath",{id:"clipPath-".concat(R)},Q.createElement("rect",{x:E?m:m-b/2,y:O?d:d-w/2,width:E?b:b*2,height:O?w:w*2})),!J&&Q.createElement("clipPath",{id:"clipPath-dots-".concat(R)},Q.createElement("rect",{x:m-q/2,y:d-q/2,width:b+q,height:w+q}))):null,_?null:this.renderArea(j,R),(l||_)&&this.renderDots(j,J,R),(!S||A)&&Wa.renderCallByParent(this.props,c))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:r.points!==i.curPoints||r.baseLine!==i.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])})(K.PureComponent);Zq=Du;Ka(Du,"displayName","Area");Ka(Du,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!cl.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Ka(Du,"getBaseValue",function(e,t,n,r){var i=e.layout,s=e.baseValue,l=t.props.baseValue,c=l??s;if(Oe(c)&&typeof c=="number")return c;var f=i==="horizontal"?r:n,d=f.scale.domain();if(f.type==="number"){var m=Math.max(d[0],d[1]),p=Math.min(d[0],d[1]);return c==="dataMin"?p:c==="dataMax"||m<0?m:Math.max(Math.min(d[0],d[1]),0)}return c==="dataMin"?d[0]:c==="dataMax"?d[1]:d[0]});Ka(Du,"getComposedData",function(e){var t=e.props,n=e.item,r=e.xAxis,i=e.yAxis,s=e.xAxisTicks,l=e.yAxisTicks,c=e.bandSize,f=e.dataKey,d=e.stackedData,m=e.dataStartIndex,p=e.displayedData,v=e.offset,b=t.layout,w=d&&d.length,S=Zq.getBaseValue(t,n,r,i),x=b==="horizontal",A=!1,_=p.map(function(E,O){var j;w?j=d[m+O]:(j=er(E,f),Array.isArray(j)?A=!0:j=[S,j]);var R=j[1]==null||w&&er(E,f)==null;return x?{x:hf({axis:r,ticks:s,bandSize:c,entry:E,index:O}),y:R?null:i.scale(j[1]),value:j,payload:E}:{x:R?null:r.scale(j[1]),y:hf({axis:i,ticks:l,bandSize:c,entry:E,index:O}),value:j,payload:E}}),M;return w||A?M=_.map(function(E){var O=Array.isArray(E.value)?E.value[0]:null;return x?{x:E.x,y:O!=null&&E.y!=null?i.scale(O):null}:{x:O!=null?r.scale(O):null,y:E.y}}):M=x?i.scale(S):r.scale(S),Is({points:_,baseLine:M,layout:b,isRange:A},v)});Ka(Du,"renderDotItem",function(e,t){var n;if(Q.isValidElement(e))n=Q.cloneElement(e,t);else if(tt(e))n=e(t);else{var r=ut("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,s=Jq(t,Rre);n=Q.createElement(Dg,nu({},s,{key:i,className:r}))}return n});function Af(e){"@babel/helpers - typeof";return Af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Af(e)}function Ure(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vre(e,t){for(var n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Zre(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Jre(e){var t=e.option,n=e.isActive,r=Qre(e,Wre);return typeof t=="string"?K.createElement(GA,Dh({option:K.createElement(gg,Dh({type:t},r)),isActive:n,shapeType:"symbols"},r)):K.createElement(GA,Dh({option:t,isActive:n,shapeType:"symbols"},r))}function Of(e){"@babel/helpers - typeof";return Of=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Of(e)}function Rh(){return Rh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Xie(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Wie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qie(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?l:t&&t.length&&Oe(i)&&Oe(s)?t.slice(i,s+1):[]};function b4(e){return e==="number"?[0,"auto"]:void 0}var vO=function(t,n,r,i){var s=t.graphicalItems,l=t.tooltipAxis,c=Ug(n,t);return r<0||!s||!s.length||r>=c.length?null:s.reduce(function(f,d){var m,p=(m=d.props.data)!==null&&m!==void 0?m:n;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var v;if(l.dataKey&&!l.allowDuplicatedCategory){var b=p===void 0?c:p;v=Qv(b,l.dataKey,i)}else v=p&&p[r]||c[r];return v?[].concat(jf(f),[cq(d,v)]):f},[])},m5=function(t,n,r,i){var s=i||{x:t.chartX,y:t.chartY},l=uae(s,r),c=t.orderedTooltipTicks,f=t.tooltipAxis,d=t.tooltipTicks,m=GW(l,c,d,f);if(m>=0&&d){var p=d[m]&&d[m].value,v=vO(t,n,m,p),b=cae(r,c,m,s);return{activeTooltipIndex:m,activeLabel:p,activePayload:v,activeCoordinate:b}}return null},fae=function(t,n){var r=n.axes,i=n.graphicalItems,s=n.axisType,l=n.axisIdKey,c=n.stackGroups,f=n.dataStartIndex,d=n.dataEndIndex,m=t.layout,p=t.children,v=t.stackOffset,b=sq(m,s);return r.reduce(function(w,S){var x,A=S.type.defaultProps!==void 0?me(me({},S.type.defaultProps),S.props):S.props,_=A.type,M=A.dataKey,E=A.allowDataOverflow,O=A.allowDuplicatedCategory,j=A.scale,R=A.ticks,k=A.includeHidden,z=A[l];if(w[z])return w;var G=Ug(t.data,{graphicalItems:i.filter(function(V){var X,ue=l in V.props?V.props[l]:(X=V.type.defaultProps)===null||X===void 0?void 0:X[l];return ue===z}),dataStartIndex:f,dataEndIndex:d}),$=G.length,B,Z,ee;zie(A.domain,E,_)&&(B=PA(A.domain,null,E),b&&(_==="number"||j!=="auto")&&(ee=jh(G,M,"category")));var J=b4(_);if(!B||B.length===0){var q,F=(q=A.domain)!==null&&q!==void 0?q:J;if(M){if(B=jh(G,M,_),_==="category"&&b){var ie=zH(B);O&&ie?(Z=B,B=Ny(0,$)):O||(B=Ok(F,B,S).reduce(function(V,X){return V.indexOf(X)>=0?V:[].concat(jf(V),[X])},[]))}else if(_==="category")O?B=B.filter(function(V){return V!==""&&!Qe(V)}):B=Ok(F,B,S).reduce(function(V,X){return V.indexOf(X)>=0||X===""||Qe(X)?V:[].concat(jf(V),[X])},[]);else if(_==="number"){var ce=QW(G,i.filter(function(V){var X,ue,be=l in V.props?V.props[l]:(X=V.type.defaultProps)===null||X===void 0?void 0:X[l],Se="hide"in V.props?V.props.hide:(ue=V.type.defaultProps)===null||ue===void 0?void 0:ue.hide;return be===z&&(k||!Se)}),M,s,m);ce&&(B=ce)}b&&(_==="number"||j!=="auto")&&(ee=jh(G,M,"category"))}else b?B=Ny(0,$):c&&c[z]&&c[z].hasStack&&_==="number"?B=v==="expand"?[0,1]:uq(c[z].stackGroups,f,d):B=oq(G,i.filter(function(V){var X=l in V.props?V.props[l]:V.type.defaultProps[l],ue="hide"in V.props?V.props.hide:V.type.defaultProps.hide;return X===z&&(k||!ue)}),_,m,!0);if(_==="number")B=hO(p,B,z,s,R),F&&(B=PA(F,B,E));else if(_==="category"&&F){var U=F,D=B.every(function(V){return U.indexOf(V)>=0});D&&(B=U)}}return me(me({},w),{},Fe({},z,me(me({},A),{},{axisType:s,domain:B,categoricalDomain:ee,duplicateDomain:Z,originalDomain:(x=A.domain)!==null&&x!==void 0?x:J,isCategorical:b,layout:m})))},{})},dae=function(t,n){var r=n.graphicalItems,i=n.Axis,s=n.axisType,l=n.axisIdKey,c=n.stackGroups,f=n.dataStartIndex,d=n.dataEndIndex,m=t.layout,p=t.children,v=Ug(t.data,{graphicalItems:r,dataStartIndex:f,dataEndIndex:d}),b=v.length,w=sq(m,s),S=-1;return r.reduce(function(x,A){var _=A.type.defaultProps!==void 0?me(me({},A.type.defaultProps),A.props):A.props,M=_[l],E=b4("number");if(!x[M]){S++;var O;return w?O=Ny(0,b):c&&c[M]&&c[M].hasStack?(O=uq(c[M].stackGroups,f,d),O=hO(p,O,M,s)):(O=PA(E,oq(v,r.filter(function(j){var R,k,z=l in j.props?j.props[l]:(R=j.type.defaultProps)===null||R===void 0?void 0:R[l],G="hide"in j.props?j.props.hide:(k=j.type.defaultProps)===null||k===void 0?void 0:k.hide;return z===M&&!G}),"number",m),i.defaultProps.allowDataOverflow),O=hO(p,O,M,s)),me(me({},x),{},Fe({},M,me(me({axisType:s},i.defaultProps),{},{hide:!0,orientation:ia(sae,"".concat(s,".").concat(S%2),null),domain:O,originalDomain:E,isCategorical:w,layout:m})))}return x},{})},hae=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,s=n.AxisComp,l=n.graphicalItems,c=n.stackGroups,f=n.dataStartIndex,d=n.dataEndIndex,m=t.children,p="".concat(i,"Id"),v=ci(m,s),b={};return v&&v.length?b=fae(t,{axes:v,graphicalItems:l,axisType:i,axisIdKey:p,stackGroups:c,dataStartIndex:f,dataEndIndex:d}):l&&l.length&&(b=dae(t,{Axis:s,graphicalItems:l,axisType:i,axisIdKey:p,stackGroups:c,dataStartIndex:f,dataEndIndex:d})),b},pae=function(t){var n=Fs(t),r=$o(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:gT(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Ay(n,r)}},v5=function(t){var n=t.children,r=t.defaultShowTooltip,i=Ti(n,vf),s=0,l=0;return t.data&&t.data.length!==0&&(l=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(s=i.props.startIndex),i.props.endIndex>=0&&(l=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:s,dataEndIndex:l,activeTooltipIndex:-1,isTooltipActive:!!r}},mae=function(t){return!t||!t.length?!1:t.some(function(n){var r=Bo(n&&n.type);return r&&r.indexOf("Bar")>=0})},y5=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},vae=function(t,n){var r=t.props,i=t.graphicalItems,s=t.xAxisMap,l=s===void 0?{}:s,c=t.yAxisMap,f=c===void 0?{}:c,d=r.width,m=r.height,p=r.children,v=r.margin||{},b=Ti(p,vf),w=Ti(p,Bc),S=Object.keys(f).reduce(function(O,j){var R=f[j],k=R.orientation;return!R.mirror&&!R.hide?me(me({},O),{},Fe({},k,O[k]+R.width)):O},{left:v.left||0,right:v.right||0}),x=Object.keys(l).reduce(function(O,j){var R=l[j],k=R.orientation;return!R.mirror&&!R.hide?me(me({},O),{},Fe({},k,ia(O,"".concat(k))+R.height)):O},{top:v.top||0,bottom:v.bottom||0}),A=me(me({},x),S),_=A.bottom;b&&(A.bottom+=b.props.height||vf.defaultProps.height),w&&n&&(A=XW(A,i,r,n));var M=d-A.left-A.right,E=m-A.top-A.bottom;return me(me({brushBottom:_},A),{},{width:Math.max(M,0),height:Math.max(E,0)})},yae=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},x4=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,s=i===void 0?"axis":i,l=t.validateTooltipEventTypes,c=l===void 0?["axis"]:l,f=t.axisComponents,d=t.legendContent,m=t.formatAxisMap,p=t.defaultProps,v=function(A,_){var M=_.graphicalItems,E=_.stackGroups,O=_.offset,j=_.updateId,R=_.dataStartIndex,k=_.dataEndIndex,z=A.barSize,G=A.layout,$=A.barGap,B=A.barCategoryGap,Z=A.maxBarSize,ee=y5(G),J=ee.numericAxisName,q=ee.cateAxisName,F=mae(M),ie=[];return M.forEach(function(ce,U){var D=Ug(A.data,{graphicalItems:[ce],dataStartIndex:R,dataEndIndex:k}),V=ce.type.defaultProps!==void 0?me(me({},ce.type.defaultProps),ce.props):ce.props,X=V.dataKey,ue=V.maxBarSize,be=V["".concat(J,"Id")],Se=V["".concat(q,"Id")],ye={},Me=f.reduce(function(Nn,Tn){var Br=_["".concat(Tn.axisType,"Map")],ze=V["".concat(Tn.axisType,"Id")];Br&&Br[ze]||Tn.axisType==="zAxis"||Au();var je=Br[ze];return me(me({},Nn),{},Fe(Fe({},Tn.axisType,je),"".concat(Tn.axisType,"Ticks"),$o(je)))},ye),de=Me[q],_e=Me["".concat(q,"Ticks")],Ee=E&&E[be]&&E[be].hasStack&&uQ(ce,E[be].stackGroups),he=Bo(ce.type).indexOf("Bar")>=0,Ie=Ay(de,_e),Te=[],Xe=F&&KW({barSize:z,stackGroups:E,totalSize:yae(Me,q)});if(he){var nt,yt,Qt=Qe(ue)?Z:ue,Zt=(nt=(yt=Ay(de,_e,!0))!==null&&yt!==void 0?yt:Qt)!==null&&nt!==void 0?nt:0;Te=YW({barGap:$,barCategoryGap:B,bandSize:Zt!==Ie?Zt:Ie,sizeList:Xe[Se],maxBarSize:Qt}),Zt!==Ie&&(Te=Te.map(function(Nn){return me(me({},Nn),{},{position:me(me({},Nn.position),{},{offset:Nn.position.offset-Zt/2})})}))}var pt=ce&&ce.type&&ce.type.getComposedData;pt&&ie.push({props:me(me({},pt(me(me({},Me),{},{displayedData:D,props:A,dataKey:X,item:ce,bandSize:Ie,barPosition:Te,offset:O,stackedData:Ee,layout:G,dataStartIndex:R,dataEndIndex:k}))),{},Fe(Fe(Fe({key:ce.key||"item-".concat(U)},J,Me[J]),q,Me[q]),"animationId",j)),childIndex:WH(ce,A.children),item:ce})}),ie},b=function(A,_){var M=A.props,E=A.dataStartIndex,O=A.dataEndIndex,j=A.updateId;if(!qC({props:M}))return null;var R=M.children,k=M.layout,z=M.stackOffset,G=M.data,$=M.reverseStackOrder,B=y5(k),Z=B.numericAxisName,ee=B.cateAxisName,J=ci(R,r),q=oQ(G,J,"".concat(Z,"Id"),"".concat(ee,"Id"),z,$),F=f.reduce(function(V,X){var ue="".concat(X.axisType,"Map");return me(me({},V),{},Fe({},ue,hae(M,me(me({},X),{},{graphicalItems:J,stackGroups:X.axisType===Z&&q,dataStartIndex:E,dataEndIndex:O}))))},{}),ie=vae(me(me({},F),{},{props:M,graphicalItems:J}),_==null?void 0:_.legendBBox);Object.keys(F).forEach(function(V){F[V]=m(M,F[V],ie,V.replace("Map",""),n)});var ce=F["".concat(ee,"Map")],U=pae(ce),D=v(M,me(me({},F),{},{dataStartIndex:E,dataEndIndex:O,updateId:j,graphicalItems:J,stackGroups:q,offset:ie}));return me(me({formattedGraphicalItems:D,graphicalItems:J,offset:ie,stackGroups:q},U),F)},w=(function(x){function A(_){var M,E,O;return Wie(this,A),O=Jie(this,A,[_]),Fe(O,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Fe(O,"accessibilityManager",new Lie),Fe(O,"handleLegendBBoxUpdate",function(j){if(j){var R=O.state,k=R.dataStartIndex,z=R.dataEndIndex,G=R.updateId;O.setState(me({legendBBox:j},b({props:O.props,dataStartIndex:k,dataEndIndex:z,updateId:G},me(me({},O.state),{},{legendBBox:j}))))}}),Fe(O,"handleReceiveSyncEvent",function(j,R,k){if(O.props.syncId===j){if(k===O.eventEmitterSymbol&&typeof O.props.syncMethod!="function")return;O.applySyncEvent(R)}}),Fe(O,"handleBrushChange",function(j){var R=j.startIndex,k=j.endIndex;if(R!==O.state.dataStartIndex||k!==O.state.dataEndIndex){var z=O.state.updateId;O.setState(function(){return me({dataStartIndex:R,dataEndIndex:k},b({props:O.props,dataStartIndex:R,dataEndIndex:k,updateId:z},O.state))}),O.triggerSyncEvent({dataStartIndex:R,dataEndIndex:k})}}),Fe(O,"handleMouseEnter",function(j){var R=O.getMouseInfo(j);if(R){var k=me(me({},R),{},{isTooltipActive:!0});O.setState(k),O.triggerSyncEvent(k);var z=O.props.onMouseEnter;tt(z)&&z(k,j)}}),Fe(O,"triggeredAfterMouseMove",function(j){var R=O.getMouseInfo(j),k=R?me(me({},R),{},{isTooltipActive:!0}):{isTooltipActive:!1};O.setState(k),O.triggerSyncEvent(k);var z=O.props.onMouseMove;tt(z)&&z(k,j)}),Fe(O,"handleItemMouseEnter",function(j){O.setState(function(){return{isTooltipActive:!0,activeItem:j,activePayload:j.tooltipPayload,activeCoordinate:j.tooltipPosition||{x:j.cx,y:j.cy}}})}),Fe(O,"handleItemMouseLeave",function(){O.setState(function(){return{isTooltipActive:!1}})}),Fe(O,"handleMouseMove",function(j){j.persist(),O.throttleTriggeredAfterMouseMove(j)}),Fe(O,"handleMouseLeave",function(j){O.throttleTriggeredAfterMouseMove.cancel();var R={isTooltipActive:!1};O.setState(R),O.triggerSyncEvent(R);var k=O.props.onMouseLeave;tt(k)&&k(R,j)}),Fe(O,"handleOuterEvent",function(j){var R=XH(j),k=ia(O.props,"".concat(R));if(R&&tt(k)){var z,G;/.*touch.*/i.test(R)?G=O.getMouseInfo(j.changedTouches[0]):G=O.getMouseInfo(j),k((z=G)!==null&&z!==void 0?z:{},j)}}),Fe(O,"handleClick",function(j){var R=O.getMouseInfo(j);if(R){var k=me(me({},R),{},{isTooltipActive:!0});O.setState(k),O.triggerSyncEvent(k);var z=O.props.onClick;tt(z)&&z(k,j)}}),Fe(O,"handleMouseDown",function(j){var R=O.props.onMouseDown;if(tt(R)){var k=O.getMouseInfo(j);R(k,j)}}),Fe(O,"handleMouseUp",function(j){var R=O.props.onMouseUp;if(tt(R)){var k=O.getMouseInfo(j);R(k,j)}}),Fe(O,"handleTouchMove",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&O.throttleTriggeredAfterMouseMove(j.changedTouches[0])}),Fe(O,"handleTouchStart",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&O.handleMouseDown(j.changedTouches[0])}),Fe(O,"handleTouchEnd",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&O.handleMouseUp(j.changedTouches[0])}),Fe(O,"handleDoubleClick",function(j){var R=O.props.onDoubleClick;if(tt(R)){var k=O.getMouseInfo(j);R(k,j)}}),Fe(O,"handleContextMenu",function(j){var R=O.props.onContextMenu;if(tt(R)){var k=O.getMouseInfo(j);R(k,j)}}),Fe(O,"triggerSyncEvent",function(j){O.props.syncId!==void 0&&s_.emit(l_,O.props.syncId,j,O.eventEmitterSymbol)}),Fe(O,"applySyncEvent",function(j){var R=O.props,k=R.layout,z=R.syncMethod,G=O.state.updateId,$=j.dataStartIndex,B=j.dataEndIndex;if(j.dataStartIndex!==void 0||j.dataEndIndex!==void 0)O.setState(me({dataStartIndex:$,dataEndIndex:B},b({props:O.props,dataStartIndex:$,dataEndIndex:B,updateId:G},O.state)));else if(j.activeTooltipIndex!==void 0){var Z=j.chartX,ee=j.chartY,J=j.activeTooltipIndex,q=O.state,F=q.offset,ie=q.tooltipTicks;if(!F)return;if(typeof z=="function")J=z(ie,j);else if(z==="value"){J=-1;for(var ce=0;ce=0){var Ee,he;if(Z.dataKey&&!Z.allowDuplicatedCategory){var Ie=typeof Z.dataKey=="function"?_e:"payload.".concat(Z.dataKey.toString());Ee=Qv(ce,Ie,J),he=U&&D&&Qv(D,Ie,J)}else Ee=ce==null?void 0:ce[ee],he=U&&D&&D[ee];if(Se||be){var Te=j.props.activeIndex!==void 0?j.props.activeIndex:ee;return[K.cloneElement(j,me(me(me({},z.props),Me),{},{activeIndex:Te})),null,null]}if(!Qe(Ee))return[de].concat(jf(O.renderActivePoints({item:z,activePoint:Ee,basePoint:he,childIndex:ee,isRange:U})))}else{var Xe,nt=(Xe=O.getItemByXY(O.state.activeCoordinate))!==null&&Xe!==void 0?Xe:{graphicalItem:de},yt=nt.graphicalItem,Qt=yt.item,Zt=Qt===void 0?j:Qt,pt=yt.childIndex,Nn=me(me(me({},z.props),Me),{},{activeIndex:pt});return[K.cloneElement(Zt,Nn),null,null]}return U?[de,null,null]:[de,null]}),Fe(O,"renderCustomized",function(j,R,k){return K.cloneElement(j,me(me({key:"recharts-customized-".concat(k)},O.props),O.state))}),Fe(O,"renderMap",{CartesianGrid:{handler:Pv,once:!0},ReferenceArea:{handler:O.renderReferenceElement},ReferenceLine:{handler:Pv},ReferenceDot:{handler:O.renderReferenceElement},XAxis:{handler:Pv},YAxis:{handler:Pv},Brush:{handler:O.renderBrush,once:!0},Bar:{handler:O.renderGraphicChild},Line:{handler:O.renderGraphicChild},Area:{handler:O.renderGraphicChild},Radar:{handler:O.renderGraphicChild},RadialBar:{handler:O.renderGraphicChild},Scatter:{handler:O.renderGraphicChild},Pie:{handler:O.renderGraphicChild},Funnel:{handler:O.renderGraphicChild},Tooltip:{handler:O.renderCursor,once:!0},PolarGrid:{handler:O.renderPolarGrid,once:!0},PolarAngleAxis:{handler:O.renderPolarAxis},PolarRadiusAxis:{handler:O.renderPolarAxis},Customized:{handler:O.renderCustomized}}),O.clipPathId="".concat((M=_.id)!==null&&M!==void 0?M:Mu("recharts"),"-clip"),O.throttleTriggeredAfterMouseMove=aB(O.triggeredAfterMouseMove,(E=_.throttleDelay)!==null&&E!==void 0?E:1e3/60),O.state={},O}return nae(A,x),Zie(A,[{key:"componentDidMount",value:function(){var M,E;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(M=this.props.margin.left)!==null&&M!==void 0?M:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var M=this.props,E=M.children,O=M.data,j=M.height,R=M.layout,k=Ti(E,ji);if(k){var z=k.props.defaultIndex;if(!(typeof z!="number"||z<0||z>this.state.tooltipTicks.length-1)){var G=this.state.tooltipTicks[z]&&this.state.tooltipTicks[z].value,$=vO(this.state,O,z,G),B=this.state.tooltipTicks[z].coordinate,Z=(this.state.offset.top+j)/2,ee=R==="horizontal",J=ee?{x:B,y:Z}:{y:B,x:Z},q=this.state.formattedGraphicalItems.find(function(ie){var ce=ie.item;return ce.type.name==="Scatter"});q&&(J=me(me({},J),q.props.points[z].tooltipPosition),$=q.props.points[z].tooltipPayload);var F={activeTooltipIndex:z,isTooltipActive:!0,activeLabel:G,activePayload:$,activeCoordinate:J};this.setState(F),this.renderCursor(k),this.accessibilityManager.setIndex(z)}}}},{key:"getSnapshotBeforeUpdate",value:function(M,E){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==E.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==M.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==M.margin){var O,j;this.accessibilityManager.setDetails({offset:{left:(O=this.props.margin.left)!==null&&O!==void 0?O:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0}})}return null}},{key:"componentDidUpdate",value:function(M){Z_([Ti(M.children,ji)],[Ti(this.props.children,ji)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var M=Ti(this.props.children,ji);if(M&&typeof M.props.shared=="boolean"){var E=M.props.shared?"axis":"item";return c.indexOf(E)>=0?E:s}return s}},{key:"getMouseInfo",value:function(M){if(!this.container)return null;var E=this.container,O=E.getBoundingClientRect(),j=LG(O),R={chartX:Math.round(M.pageX-j.left),chartY:Math.round(M.pageY-j.top)},k=O.width/E.offsetWidth||1,z=this.inRange(R.chartX,R.chartY,k);if(!z)return null;var G=this.state,$=G.xAxisMap,B=G.yAxisMap,Z=this.getTooltipEventType(),ee=m5(this.state,this.props.data,this.props.layout,z);if(Z!=="axis"&&$&&B){var J=Fs($).scale,q=Fs(B).scale,F=J&&J.invert?J.invert(R.chartX):null,ie=q&&q.invert?q.invert(R.chartY):null;return me(me({},R),{},{xValue:F,yValue:ie},ee)}return ee?me(me({},R),ee):null}},{key:"inRange",value:function(M,E){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=this.props.layout,R=M/O,k=E/O;if(j==="horizontal"||j==="vertical"){var z=this.state.offset,G=R>=z.left&&R<=z.left+z.width&&k>=z.top&&k<=z.top+z.height;return G?{x:R,y:k}:null}var $=this.state,B=$.angleAxisMap,Z=$.radiusAxisMap;if(B&&Z){var ee=Fs(B);return Mk({x:R,y:k},ee)}return null}},{key:"parseEventsOfWrapper",value:function(){var M=this.props.children,E=this.getTooltipEventType(),O=Ti(M,ji),j={};O&&E==="axis"&&(O.props.trigger==="click"?j={onClick:this.handleClick}:j={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var R=Zv(this.props,this.handleOuterEvent);return me(me({},R),j)}},{key:"addListener",value:function(){s_.on(l_,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){s_.removeListener(l_,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(M,E,O){for(var j=this.state.formattedGraphicalItems,R=0,k=j.length;Ri.sessionBank),t=(e==null?void 0:e.eviction_log)??[],n={};for(const i of t)n[i.reason]=(n[i.reason]??0)+1;const r=Object.entries(n).map(([i,s])=>({reason:i,count:s})).sort((i,s)=>s.count-i.count);return T.jsx(ct,{title:"Eviction reasons · last 16",subtitle:e!=null&&e.last_miss_reason?`most recent: ${e.last_miss_reason}`:"no evictions yet",children:T.jsx("div",{className:"h-[220px]",children:r.length===0?T.jsx("div",{className:"h-full grid place-items-center text-[var(--text-muted)] text-sm",children:"SessionBank stable · no evictions"}):T.jsx(wg,{width:"100%",height:"100%",children:T.jsxs(n2,{data:r,margin:{top:4,right:20,left:0,bottom:0},children:[T.jsx(Ip,{stroke:"rgba(255,255,255,0.05)"}),T.jsx(pl,{dataKey:"reason",stroke:"rgba(200,210,220,0.6)",tick:{fontSize:10},interval:0}),T.jsx(Wo,{stroke:"rgba(200,210,220,0.6)",allowDecimals:!1}),T.jsx(ji,{contentStyle:{background:"var(--bg-elevated)",border:"1px solid var(--border-soft)",borderRadius:8,fontSize:12,maxWidth:320},labelFormatter:i=>T.jsx("span",{className:"text-[var(--text-primary)] font-semibold",children:String(i)}),formatter:((i,s,l)=>{var d;const c=String(((d=l==null?void 0:l.payload)==null?void 0:d.reason)??""),f=bae[c]??"Cache eviction reason.";return[`${i} · ${f}`,"count"]})}),T.jsx(oa,{dataKey:"count",fill:"rgba(240,180,41,0.85)",radius:[6,6,0,0]})]})})})})}const Sae=!0,rr="u-",wae="uplot",_ae=rr+"hz",Aae=rr+"vt",Oae=rr+"title",Tae=rr+"wrap",Eae=rr+"under",Mae=rr+"over",jae=rr+"axis",Wl=rr+"off",Pae=rr+"select",Cae=rr+"cursor-x",Dae=rr+"cursor-y",Rae=rr+"cursor-pt",Nae=rr+"legend",kae=rr+"live",Lae=rr+"inline",zae=rr+"series",$ae=rr+"marker",g5=rr+"label",Bae=rr+"value",Sh="width",wh="height",ph="top",b5="bottom",Oc="left",c_="right",r2="#000",x5=r2+"0",f_="mousemove",S5="mousedown",d_="mouseup",w5="mouseenter",_5="mouseleave",A5="dblclick",qae="resize",Iae="scroll",O5="change",Qy="dppxchange",i2="--",Qf=typeof window<"u",yO=Qf?document:null,Uc=Qf?window:null,Uae=Qf?navigator:null;let Et,Cv;function gO(){let e=devicePixelRatio;Et!=e&&(Et=e,Cv&&xO(O5,Cv,gO),Cv=matchMedia(`(min-resolution: ${Et-.001}dppx) and (max-resolution: ${Et+.001}dppx)`),vu(O5,Cv,gO),Uc.dispatchEvent(new CustomEvent(Qy)))}function Ai(e,t){if(t!=null){let n=e.classList;!n.contains(t)&&n.add(t)}}function bO(e,t){let n=e.classList;n.contains(t)&&n.remove(t)}function sn(e,t,n){e.style[t]=n+"px"}function ya(e,t,n,r){let i=yO.createElement(e);return t!=null&&Ai(i,t),n!=null&&n.insertBefore(i,r),i}function Zi(e,t){return ya("div",e,t)}const T5=new WeakMap;function qa(e,t,n,r,i){let s="translate("+t+"px,"+n+"px)",l=T5.get(e);s!=l&&(e.style.transform=s,T5.set(e,s),t<0||n<0||t>r||n>i?Ai(e,Wl):bO(e,Wl))}const E5=new WeakMap;function M5(e,t,n){let r=t+n,i=E5.get(e);r!=i&&(E5.set(e,r),e.style.background=t,e.style.borderColor=n)}const j5=new WeakMap;function P5(e,t,n,r){let i=t+""+n,s=j5.get(e);i!=s&&(j5.set(e,i),e.style.height=n+"px",e.style.width=t+"px",e.style.marginLeft=r?-t/2+"px":0,e.style.marginTop=r?-n/2+"px":0)}const a2={passive:!0},Vae={...a2,capture:!0};function vu(e,t,n,r){t.addEventListener(e,n,r?Vae:a2)}function xO(e,t,n,r){t.removeEventListener(e,n,a2)}Qf&&gO();function wa(e,t,n,r){let i;n=n||0,r=r||t.length-1;let s=r<=2147483647;for(;r-n>1;)i=s?n+r>>1:Ci((n+r)/2),t[i]{let s=-1,l=-1;for(let c=r;c<=i;c++)if(e(n[c])){s=c;break}for(let c=i;c>=r;c--)if(e(n[c])){l=c;break}return[s,l]}}const w4=e=>e!=null,_4=e=>e!=null&&e>0,Vg=S4(w4),Hae=S4(_4);function Fae(e,t,n,r=0,i=!1){let s=i?Hae:Vg,l=i?_4:w4;[t,n]=s(e,t,n);let c=e[t],f=e[t];if(t>-1)if(r==1)c=e[t],f=e[n];else if(r==-1)c=e[n],f=e[t];else for(let d=t;d<=n;d++){let m=e[d];l(m)&&(mf&&(f=m))}return[c??Kt,f??-Kt]}function Hg(e,t,n,r){let i=R5(e),s=R5(t);e==t&&(i==-1?(e*=n,t/=n):(e/=n,t*=n));let l=n==10?Uo:A4,c=i==1?Ci:na,f=s==1?na:Ci,d=c(l(Wn(e))),m=f(l(Wn(t))),p=Pf(n,d),v=Pf(n,m);return n==10&&(d<0&&(p=Yt(p,-d)),m<0&&(v=Yt(v,-m))),r||n==2?(e=p*i,t=v*s):(e=M4(e,p),t=Fg(t,v)),[e,t]}function o2(e,t,n,r){let i=Hg(e,t,n,r);return e==0&&(i[0]=0),t==0&&(i[1]=0),i}const s2=.1,C5={mode:3,pad:s2},Nh={pad:0,soft:null,mode:0},Gae={min:Nh,max:Nh};function Zy(e,t,n,r){return Gg(n)?D5(e,t,n):(Nh.pad=n,Nh.soft=r?0:null,Nh.mode=r?3:0,D5(e,t,Gae))}function _t(e,t){return e??t}function Kae(e,t,n){for(t=_t(t,0),n=_t(n,e.length-1);t<=n;){if(e[t]!=null)return!0;t++}return!1}function D5(e,t,n){let r=n.min,i=n.max,s=_t(r.pad,0),l=_t(i.pad,0),c=_t(r.hard,-Kt),f=_t(i.hard,Kt),d=_t(r.soft,Kt),m=_t(i.soft,-Kt),p=_t(r.mode,0),v=_t(i.mode,0),b=t-e,w=Uo(b),S=Xr(Wn(e),Wn(t)),x=Uo(S),A=Wn(x-w);(b<1e-24||A>10)&&(b=0,(e==0||t==0)&&(b=1e-24,p==2&&d!=Kt&&(s=0),v==2&&m!=-Kt&&(l=0)));let _=b||S||1e3,M=Uo(_),E=Pf(10,Ci(M)),O=_*(b==0?e==0?.1:1:s),j=Yt(M4(e-O,E/10),24),R=e>=d&&(p==1||p==3&&j<=d||p==2&&j>=d)?d:Kt,k=Xr(c,j=R?R:Aa(R,j)),z=_*(b==0?t==0?.1:1:l),G=Yt(Fg(t+z,E/10),24),$=t<=m&&(v==1||v==3&&G>=m||v==2&&G<=m)?m:-Kt,B=Aa(f,G>$&&t<=$?$:Xr($,G));return k==B&&k==0&&(B=100),[k,B]}const Yae=new Intl.NumberFormat(Qf?Uae.language:"en-US"),l2=e=>Yae.format(e),Ni=Math,Fv=Ni.PI,Wn=Ni.abs,Ci=Ni.floor,Xn=Ni.round,na=Ni.ceil,Aa=Ni.min,Xr=Ni.max,Pf=Ni.pow,R5=Ni.sign,Uo=Ni.log10,A4=Ni.log2,Xae=(e,t=1)=>Ni.sinh(e)*t,h_=(e,t=1)=>Ni.asinh(e/t),Kt=1/0;function N5(e){return(Uo((e^e>>31)-(e>>31))|0)+1}function SO(e,t,n){return Aa(Xr(e,t),n)}function O4(e){return typeof e=="function"}function ht(e){return O4(e)?e:()=>e}const Wae=()=>{},T4=e=>e,E4=(e,t)=>t,Qae=e=>null,k5=e=>!0,L5=(e,t)=>e==t,Zae=/\.\d*?(?=9{6,}|0{6,})/gm,Tu=e=>{if(P4(e)||ol.has(e))return e;const t=`${e}`,n=t.match(Zae);if(n==null)return e;let r=n[0].length-1;if(t.indexOf("e-")!=-1){let[i,s]=t.split("e");return+`${Tu(i)}e${s}`}return Yt(e,r)};function Gl(e,t){return Tu(Yt(Tu(e/t))*t)}function Fg(e,t){return Tu(na(Tu(e/t))*t)}function M4(e,t){return Tu(Ci(Tu(e/t))*t)}function Yt(e,t=0){if(P4(e))return e;let n=10**t,r=e*n*(1+Number.EPSILON);return Xn(r)/n}const ol=new Map;function j4(e){return((""+e).split(".")[1]||"").length}function Op(e,t,n,r){let i=[],s=r.map(j4);for(let l=t;l=0?0:c)+(l>=s[d]?0:s[d]),v=e==10?m:Yt(m,p);i.push(v),ol.set(v,p)}}return i}const kh={},u2=[],Cf=[null,null],Hs=Array.isArray,P4=Number.isInteger,Jae=e=>e===void 0;function z5(e){return typeof e=="string"}function Gg(e){let t=!1;if(e!=null){let n=e.constructor;t=n==null||n==Object}return t}function eoe(e){return e!=null&&typeof e=="object"}const toe=Object.getPrototypeOf(Uint8Array),C4="__proto__";function Df(e,t=Gg){let n;if(Hs(e)){let r=e.find(i=>i!=null);if(Hs(r)||t(r)){n=Array(e.length);for(let i=0;is){for(i=l-1;i>=0&&e[i]==null;)e[i--]=null;for(i=l+1;il-c)],i=r[0].length,s=new Map;for(let l=0;l"u"?e=>Promise.resolve().then(e):queueMicrotask;function loe(e){let t=e[0],n=t.length,r=Array(n);for(let s=0;st[s]-t[l]);let i=[];for(let s=0;s=r&&e[i]==null;)i--;if(i<=r)return!0;const s=Xr(1,Ci((i-r+1)/t));for(let l=e[r],c=r+s;c<=i;c+=s){const f=e[c];if(f!=null){if(f<=l)return!1;l=f}}return!0}const D4=["January","February","March","April","May","June","July","August","September","October","November","December"],R4=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function N4(e){return e.slice(0,3)}const foe=R4.map(N4),doe=D4.map(N4),hoe={MMMM:D4,MMM:doe,WWWW:R4,WWW:foe};function mh(e){return(e<10?"0":"")+e}function poe(e){return(e<10?"00":e<100?"0":"")+e}const moe={YYYY:e=>e.getFullYear(),YY:e=>(e.getFullYear()+"").slice(2),MMMM:(e,t)=>t.MMMM[e.getMonth()],MMM:(e,t)=>t.MMM[e.getMonth()],MM:e=>mh(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>mh(e.getDate()),D:e=>e.getDate(),WWWW:(e,t)=>t.WWWW[e.getDay()],WWW:(e,t)=>t.WWW[e.getDay()],HH:e=>mh(e.getHours()),H:e=>e.getHours(),h:e=>{let t=e.getHours();return t==0?12:t>12?t-12:t},AA:e=>e.getHours()>=12?"PM":"AM",aa:e=>e.getHours()>=12?"pm":"am",a:e=>e.getHours()>=12?"p":"a",mm:e=>mh(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>mh(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>poe(e.getMilliseconds())};function c2(e,t){t=t||hoe;let n=[],r=/\{([a-z]+)\}|[^{]+/gi,i;for(;i=r.exec(e);)n.push(i[0][0]=="{"?moe[i[1]]:i[0]);return s=>{let l="";for(let c=0;ce%1==0,Jy=[1,2,2.5,5],goe=Op(10,-32,0,Jy),L4=Op(10,0,32,Jy),boe=L4.filter(k4),Kl=goe.concat(L4),f2=` -`,z4="{YYYY}",$5=f2+z4,$4="{M}/{D}",_h=f2+$4,Dv=_h+"/{YY}",B4="{aa}",xoe="{h}:{mm}",Ec=xoe+B4,B5=f2+Ec,q5=":{ss}",Rt=null;function q4(e){let t=e*1e3,n=t*60,r=n*60,i=r*24,s=i*30,l=i*365,f=(e==1?Op(10,0,3,Jy).filter(k4):Op(10,-3,0,Jy)).concat([t,t*5,t*10,t*15,t*30,n,n*5,n*10,n*15,n*30,r,r*2,r*3,r*4,r*6,r*8,r*12,i,i*2,i*3,i*4,i*5,i*6,i*7,i*8,i*9,i*10,i*15,s,s*2,s*3,s*4,s*6,l,l*2,l*5,l*10,l*25,l*50,l*100]);const d=[[l,z4,Rt,Rt,Rt,Rt,Rt,Rt,1],[i*28,"{MMM}",$5,Rt,Rt,Rt,Rt,Rt,1],[i,$4,$5,Rt,Rt,Rt,Rt,Rt,1],[r,"{h}"+B4,Dv,Rt,_h,Rt,Rt,Rt,1],[n,Ec,Dv,Rt,_h,Rt,Rt,Rt,1],[t,q5,Dv+" "+Ec,Rt,_h+" "+Ec,Rt,B5,Rt,1],[e,q5+".{fff}",Dv+" "+Ec,Rt,_h+" "+Ec,Rt,B5,Rt,1]];function m(p){return(v,b,w,S,x,A)=>{let _=[],M=x>=l,E=x>=s&&x=i?i:x,G=Ci(w)-Ci(j),$=k+G+Fg(j-k,z);_.push($);let B=p($),Z=B.getHours()+B.getMinutes()/n+B.getSeconds()/r,ee=x/r,J=v.axes[b]._space,q=A/J;for(;$=Yt($+x,e==1?0:3),!($>S);)if(ee>1){let F=Ci(Yt(Z+ee,6))%24,U=p($).getHours()-F;U>1&&(U=-1),$-=U*r,Z=(Z+ee)%24;let D=_[_.length-1];Yt(($-D)/x,3)*q>=.7&&_.push($)}else _.push($)}return _}}return[f,d,m]}const[Soe,woe,_oe]=q4(1),[Aoe,Ooe,Toe]=q4(.001);Op(2,-53,53,[1]);function I5(e,t){return e.map(n=>n.map((r,i)=>i==0||i==8||r==null?r:t(i==1||n[8]==0?r:n[1]+r)))}function U5(e,t){return(n,r,i,s,l)=>{let c=t.find(w=>l>=w[0])||t[t.length-1],f,d,m,p,v,b;return r.map(w=>{let S=e(w),x=S.getFullYear(),A=S.getMonth(),_=S.getDate(),M=S.getHours(),E=S.getMinutes(),O=S.getSeconds(),j=x!=f&&c[2]||A!=d&&c[3]||_!=m&&c[4]||M!=p&&c[5]||E!=v&&c[6]||O!=b&&c[7]||c[1];return f=x,d=A,m=_,p=M,v=E,b=O,j(S)})}}function Eoe(e,t){let n=c2(t);return(r,i,s,l,c)=>i.map(f=>n(e(f)))}function p_(e,t,n){return new Date(e,t,n)}function V5(e,t){return t(e)}const Moe="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function H5(e,t){return(n,r,i,s)=>s==null?i2:t(e(r))}function joe(e,t){let n=e.series[t];return n.width?n.stroke(e,t):n.points.width?n.points.stroke(e,t):null}function Poe(e,t){return e.series[t].fill(e,t)}const Coe={show:!0,live:!0,isolate:!1,mount:Wae,markers:{show:!0,width:2,stroke:joe,fill:Poe,dash:"solid"},idx:null,idxs:null,values:[]};function Doe(e,t){let n=e.cursor.points,r=Zi(),i=n.size(e,t);sn(r,Sh,i),sn(r,wh,i);let s=i/-2;sn(r,"marginLeft",s),sn(r,"marginTop",s);let l=n.width(e,t,i);return l&&sn(r,"borderWidth",l),r}function Roe(e,t){let n=e.series[t].points;return n._fill||n._stroke}function Noe(e,t){let n=e.series[t].points;return n._stroke||n._fill}function koe(e,t){return e.series[t].points.size}const m_=[0,0];function Loe(e,t,n){return m_[0]=t,m_[1]=n,m_}function Rv(e,t,n,r=!0){return i=>{i.button==0&&(!r||i.target==t)&&n(i)}}function v_(e,t,n,r=!0){return i=>{(!r||i.target==t)&&n(i)}}const zoe={show:!0,x:!0,y:!0,lock:!1,move:Loe,points:{one:!1,show:Doe,size:koe,width:0,stroke:Noe,fill:Roe},bind:{mousedown:Rv,mouseup:Rv,click:Rv,dblclick:Rv,mousemove:v_,mouseleave:v_,mouseenter:v_},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(e,t)=>{t.stopPropagation(),t.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(e,t,n,r,i)=>r-i,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},I4={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},d2=Vn({},I4,{filter:E4}),U4=Vn({},d2,{size:10}),V4=Vn({},I4,{show:!1}),h2='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',H4="bold "+h2,F4=1.5,F5={show:!0,scale:"x",stroke:r2,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:H4,side:2,grid:d2,ticks:U4,border:V4,font:h2,lineGap:F4,rotate:0},$oe="Value",Boe="Time",G5={show:!0,scale:"x",auto:!1,sorted:1,min:Kt,max:-Kt,idxs:[]};function qoe(e,t,n,r,i){return t.map(s=>s==null?"":l2(s))}function Ioe(e,t,n,r,i,s,l){let c=[],f=ol.get(i)||0;n=l?n:Yt(Fg(n,i),f);for(let d=n;d<=r;d=Yt(d+i,f))c.push(Object.is(d,-0)?0:d);return c}function wO(e,t,n,r,i,s,l){const c=[],f=e.scales[e.axes[t].scale].log,d=f==10?Uo:A4,m=Ci(d(n));i=Pf(f,m),f==10&&(i=Kl[wa(i,Kl)]);let p=n,v=i*f;f==10&&(v=Kl[wa(v,Kl)]);do c.push(p),p=p+i,f==10&&!ol.has(p)&&(p=Yt(p,ol.get(i))),p>=v&&(i=p,v=i*f,f==10&&(v=Kl[wa(v,Kl)]));while(p<=r);return c}function Uoe(e,t,n,r,i,s,l){let f=e.scales[e.axes[t].scale].asinh,d=r>f?wO(e,t,Xr(f,n),r,i):[f],m=r>=0&&n<=0?[0]:[];return(n<-f?wO(e,t,Xr(f,-r),-n,i):[f]).reverse().map(v=>-v).concat(m,d)}const G4=/./,Voe=/[12357]/,Hoe=/[125]/,K5=/1/,_O=(e,t,n,r)=>e.map((i,s)=>t==4&&i==0||s%r==0&&n.test(i.toExponential()[i<0?1:0])?i:null);function Foe(e,t,n,r,i){let s=e.axes[n],l=s.scale,c=e.scales[l],f=e.valToPos,d=s._space,m=f(10,l),p=f(9,l)-m>=d?G4:f(7,l)-m>=d?Voe:f(5,l)-m>=d?Hoe:K5;if(p==K5){let v=Wn(f(1,l)-m);if(vi,W5={show:!0,auto:!0,sorted:0,gaps:K4,alpha:1,facets:[Vn({},X5,{scale:"x"}),Vn({},X5,{scale:"y"})]},Q5={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:K4,alpha:1,points:{show:Xoe,filter:null},values:null,min:Kt,max:-Kt,idxs:[],path:null,clip:null};function Woe(e,t,n,r,i){return n/10}const Y4={time:Sae,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},Qoe=Vn({},Y4,{time:!1,ori:1}),Z5={};function X4(e,t){let n=Z5[e];return n||(n={key:e,plots:[],sub(r){n.plots.push(r)},unsub(r){n.plots=n.plots.filter(i=>i!=r)},pub(r,i,s,l,c,f,d){for(let m=0;m{let A=l.pxRound;const _=d.dir*(d.ori==0?1:-1),M=d.ori==0?Zf:Jf;let E,O;_==1?(E=n,O=r):(E=r,O=n);let j=A(p(c[E],d,S,b)),R=A(v(f[E],m,x,w)),k=A(p(c[O],d,S,b)),z=A(v(s==1?m.max:m.min,m,x,w)),G=new Path2D(i);return M(G,k,z),M(G,j,z),M(G,j,R),G})}function Kg(e,t,n,r,i,s){let l=null;if(e.length>0){l=new Path2D;const c=t==0?Wg:v2;let f=n;for(let p=0;pv[0]){let b=v[0]-f;b>0&&c(l,f,r,b,r+s),f=v[1]}}let d=n+i-f,m=10;d>0&&c(l,f,r-m/2,d,r+s+m)}return l}function Joe(e,t,n){let r=e[e.length-1];r&&r[0]==t?r[1]=n:e.push([t,n])}function m2(e,t,n,r,i,s,l){let c=[],f=e.length;for(let d=i==1?n:r;d>=n&&d<=r;d+=i)if(t[d]===null){let p=d,v=d;if(i==1)for(;++d<=r&&t[d]===null;)v=d;else for(;--d>=n&&t[d]===null;)v=d;let b=s(e[p]),w=v==p?b:s(e[v]),S=p-i;b=l<=0&&S>=0&&S=0&&A>=0&&A=b&&c.push([b,w])}return c}function J5(e){return e==0?T4:e==1?Xn:t=>Gl(t,e)}function W4(e){let t=e==0?Yg:Xg,n=e==0?(i,s,l,c,f,d)=>{i.arcTo(s,l,c,f,d)}:(i,s,l,c,f,d)=>{i.arcTo(l,s,f,c,d)},r=e==0?(i,s,l,c,f)=>{i.rect(s,l,c,f)}:(i,s,l,c,f)=>{i.rect(l,s,f,c)};return(i,s,l,c,f,d=0,m=0)=>{d==0&&m==0?r(i,s,l,c,f):(d=Aa(d,c/2,f/2),m=Aa(m,c/2,f/2),t(i,s+d,l),n(i,s+c,l,s+c,l+f,d),n(i,s+c,l+f,s,l+f,m),n(i,s,l+f,s,l,m),n(i,s,l,s+c,l,d),i.closePath())}}const Yg=(e,t,n)=>{e.moveTo(t,n)},Xg=(e,t,n)=>{e.moveTo(n,t)},Zf=(e,t,n)=>{e.lineTo(t,n)},Jf=(e,t,n)=>{e.lineTo(n,t)},Wg=W4(0),v2=W4(1),Q4=(e,t,n,r,i,s)=>{e.arc(t,n,r,i,s)},Z4=(e,t,n,r,i,s)=>{e.arc(n,t,r,i,s)},J4=(e,t,n,r,i,s,l)=>{e.bezierCurveTo(t,n,r,i,s,l)},e6=(e,t,n,r,i,s,l)=>{e.bezierCurveTo(n,t,i,r,l,s)};function t6(e){return(t,n,r,i,s)=>Ru(t,n,(l,c,f,d,m,p,v,b,w,S,x)=>{let{pxRound:A,points:_}=l,M,E;d.ori==0?(M=Yg,E=Q4):(M=Xg,E=Z4);const O=Yt(_.width*Et,3);let j=(_.size-_.width)/2*Et,R=Yt(j*2,3),k=new Path2D,z=new Path2D,{left:G,top:$,width:B,height:Z}=t.bbox;Wg(z,G-R,$-R,B+R*2,Z+R*2);const ee=J=>{if(f[J]!=null){let q=A(p(c[J],d,S,b)),F=A(v(f[J],m,x,w));M(k,q+j,F),E(k,q,F,j,0,Fv*2)}};if(s)s.forEach(ee);else for(let J=r;J<=i;J++)ee(J);return{stroke:O>0?k:null,fill:k,clip:z,flags:Rf|AO}})}function n6(e){return(t,n,r,i,s,l)=>{r!=i&&(s!=r&&l!=r&&e(t,n,r),s!=i&&l!=i&&e(t,n,i),e(t,n,l))}}const ese=n6(Zf),tse=n6(Jf);function r6(e){const t=_t(e==null?void 0:e.alignGaps,0);return(n,r,i,s)=>Ru(n,r,(l,c,f,d,m,p,v,b,w,S,x)=>{[i,s]=Vg(f,i,s);let A=l.pxRound,_=Z=>A(p(Z,d,S,b)),M=Z=>A(v(Z,m,x,w)),E,O;d.ori==0?(E=Zf,O=ese):(E=Jf,O=tse);const j=d.dir*(d.ori==0?1:-1),R={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:Rf},k=R.stroke;let z=!1;if(s-i>=S*4){let Z=X=>n.posToVal(X,d.key,!0),ee=null,J=null,q,F,ie,ce=_(c[j==1?i:s]),U=_(c[i]),D=_(c[s]),V=Z(j==1?U+1:D-1);for(let X=j==1?i:s;X>=i&&X<=s;X+=j){let ue=c[X],Se=(j==1?ueV)?ce:_(ue),ye=f[X];Se==ce?ye!=null?(F=ye,ee==null?(E(k,Se,M(F)),q=ee=J=F):FJ&&(J=F)):ye===null&&(z=!0):(ee!=null&&O(k,ce,M(ee),M(J),M(q),M(F)),ye!=null?(F=ye,E(k,Se,M(F)),ee=J=q=F):(ee=J=null,ye===null&&(z=!0)),ce=Se,V=Z(ce+j))}ee!=null&&ee!=J&&ie!=ce&&O(k,ce,M(ee),M(J),M(q),M(F))}else for(let Z=j==1?i:s;Z>=i&&Z<=s;Z+=j){let ee=f[Z];ee===null?z=!0:ee!=null&&E(k,_(c[Z]),M(ee))}let[$,B]=p2(n,r);if(l.fill!=null||$!=0){let Z=R.fill=new Path2D(k),ee=l.fillTo(n,r,l.min,l.max,$),J=M(ee),q=_(c[i]),F=_(c[s]);j==-1&&([F,q]=[q,F]),E(Z,F,J),E(Z,q,J)}if(!l.spanGaps){let Z=[];z&&Z.push(...m2(c,f,i,s,j,_,t)),R.gaps=Z=l.gaps(n,r,i,s,Z),R.clip=Kg(Z,d.ori,b,w,S,x)}return B!=0&&(R.band=B==2?[Vo(n,r,i,s,k,-1),Vo(n,r,i,s,k,1)]:Vo(n,r,i,s,k,B)),R})}function nse(e){const t=_t(e.align,1),n=_t(e.ascDesc,!1),r=_t(e.alignGaps,0),i=_t(e.extend,!1);return(s,l,c,f)=>Ru(s,l,(d,m,p,v,b,w,S,x,A,_,M)=>{[c,f]=Vg(p,c,f);let E=d.pxRound,{left:O,width:j}=s.bbox,R=U=>E(w(U,v,_,x)),k=U=>E(S(U,b,M,A)),z=v.ori==0?Zf:Jf;const G={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:Rf},$=G.stroke,B=v.dir*(v.ori==0?1:-1);let Z=k(p[B==1?c:f]),ee=R(m[B==1?c:f]),J=ee,q=ee;i&&t==-1&&(q=O,z($,q,Z)),z($,ee,Z);for(let U=B==1?c:f;U>=c&&U<=f;U+=B){let D=p[U];if(D==null)continue;let V=R(m[U]),X=k(D);t==1?z($,V,Z):z($,J,X),z($,V,X),Z=X,J=V}let F=J;i&&t==1&&(F=O+j,z($,F,Z));let[ie,ce]=p2(s,l);if(d.fill!=null||ie!=0){let U=G.fill=new Path2D($),D=d.fillTo(s,l,d.min,d.max,ie),V=k(D);z(U,F,V),z(U,q,V)}if(!d.spanGaps){let U=[];U.push(...m2(m,p,c,f,B,R,r));let D=d.width*Et/2,V=n||t==1?D:-D,X=n||t==-1?-D:D;U.forEach(ue=>{ue[0]+=V,ue[1]+=X}),G.gaps=U=d.gaps(s,l,c,f,U),G.clip=Kg(U,v.ori,x,A,_,M)}return ce!=0&&(G.band=ce==2?[Vo(s,l,c,f,$,-1),Vo(s,l,c,f,$,1)]:Vo(s,l,c,f,$,ce)),G})}function eL(e,t,n,r,i,s,l=Kt){if(e.length>1){let c=null;for(let f=0,d=1/0;f{}),{fill:p,stroke:v}=d;return(b,w,S,x)=>Ru(b,w,(A,_,M,E,O,j,R,k,z,G,$)=>{let B=A.pxRound,Z=n,ee=r*Et,J=c*Et,q=f*Et,F,ie;E.ori==0?[F,ie]=s(b,w):[ie,F]=s(b,w);const ce=E.dir*(E.ori==0?1:-1);let U=E.ori==0?Wg:v2,D=E.ori==0?m:(je,bt,cn,di,ki,Tr,hi)=>{m(je,bt,cn,ki,di,hi,Tr)},V=_t(b.bands,u2).find(je=>je.series[0]==w),X=V!=null?V.dir:0,ue=A.fillTo(b,w,A.min,A.max,X),be=B(R(ue,O,$,z)),Se,ye,Me,de=G,_e=B(A.width*Et),Ee=!1,he=null,Ie=null,Te=null,Xe=null;p!=null&&(_e==0||v!=null)&&(Ee=!0,he=p.values(b,w,S,x),Ie=new Map,new Set(he).forEach(je=>{je!=null&&Ie.set(je,new Path2D)}),_e>0&&(Te=v.values(b,w,S,x),Xe=new Map,new Set(Te).forEach(je=>{je!=null&&Xe.set(je,new Path2D)})));let{x0:nt,size:yt}=d;if(nt!=null&&yt!=null){Z=1,_=nt.values(b,w,S,x),nt.unit==2&&(_=_.map(cn=>b.posToVal(k+cn*G,E.key,!0)));let je=yt.values(b,w,S,x);yt.unit==2?ye=je[0]*G:ye=j(je[0],E,G,k)-j(0,E,G,k),de=eL(_,M,j,E,G,k,de),Me=de-ye+ee}else de=eL(_,M,j,E,G,k,de),Me=de*l+ee,ye=de-Me;Me<1&&(Me=0),_e>=ye/2&&(_e=0),Me<5&&(B=T4);let Qt=Me>0,Zt=de-Me-(Qt?_e:0);ye=B(SO(Zt,q,J)),Se=(Z==0?ye/2:Z==ce?0:ye)-Z*ce*((Z==0?ee/2:0)+(Qt?_e/2:0));const pt={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},Nn=Ee?null:new Path2D;let Tn=null;if(V!=null)Tn=b.data[V.series[1]];else{let{y0:je,y1:bt}=d;je!=null&&bt!=null&&(M=bt.values(b,w,S,x),Tn=je.values(b,w,S,x))}let Br=F*ye,ze=ie*ye;for(let je=ce==1?S:x;je>=S&&je<=x;je+=ce){let bt=M[je];if(bt==null)continue;if(Tn!=null){let Bt=Tn[je]??0;if(bt-Bt==0)continue;be=R(Bt,O,$,z)}let cn=E.distr!=2||d!=null?_[je]:je,di=j(cn,E,G,k),ki=R(_t(bt,ue),O,$,z),Tr=B(di-Se),hi=B(Xr(ki,be)),pr=B(Aa(ki,be)),kn=hi-pr;if(bt!=null){let Bt=bt<0?ze:Br,Ln=bt<0?Br:ze;Ee?(_e>0&&Te[je]!=null&&U(Xe.get(Te[je]),Tr,pr+Ci(_e/2),ye,Xr(0,kn-_e),Bt,Ln),he[je]!=null&&U(Ie.get(he[je]),Tr,pr+Ci(_e/2),ye,Xr(0,kn-_e),Bt,Ln)):U(Nn,Tr,pr+Ci(_e/2),ye,Xr(0,kn-_e),Bt,Ln),D(b,w,je,Tr-_e/2,pr,ye+_e,kn)}}return _e>0?pt.stroke=Ee?Xe:Nn:Ee||(pt._fill=A.width==0?A._fill:A._stroke??A._fill,pt.width=0),pt.fill=Ee?Ie:Nn,pt})}function ise(e,t){const n=_t(t==null?void 0:t.alignGaps,0);return(r,i,s,l)=>Ru(r,i,(c,f,d,m,p,v,b,w,S,x,A)=>{[s,l]=Vg(d,s,l);let _=c.pxRound,M=F=>_(v(F,m,x,w)),E=F=>_(b(F,p,A,S)),O,j,R;m.ori==0?(O=Yg,R=Zf,j=J4):(O=Xg,R=Jf,j=e6);const k=m.dir*(m.ori==0?1:-1);let z=M(f[k==1?s:l]),G=z,$=[],B=[];for(let F=k==1?s:l;F>=s&&F<=l;F+=k)if(d[F]!=null){let ce=f[F],U=M(ce);$.push(G=U),B.push(E(d[F]))}const Z={stroke:e($,B,O,R,j,_),fill:null,clip:null,band:null,gaps:null,flags:Rf},ee=Z.stroke;let[J,q]=p2(r,i);if(c.fill!=null||J!=0){let F=Z.fill=new Path2D(ee),ie=c.fillTo(r,i,c.min,c.max,J),ce=E(ie);R(F,G,ce),R(F,z,ce)}if(!c.spanGaps){let F=[];F.push(...m2(f,d,s,l,k,M,n)),Z.gaps=F=c.gaps(r,i,s,l,F),Z.clip=Kg(F,m.ori,w,S,x,A)}return q!=0&&(Z.band=q==2?[Vo(r,i,s,l,ee,-1),Vo(r,i,s,l,ee,1)]:Vo(r,i,s,l,ee,q)),Z})}function ase(e){return ise(ose,e)}function ose(e,t,n,r,i,s){const l=e.length;if(l<2)return null;const c=new Path2D;if(n(c,e[0],t[0]),l==2)r(c,e[1],t[1]);else{let f=Array(l),d=Array(l-1),m=Array(l-1),p=Array(l-1);for(let v=0;v0!=d[v]>0?f[v]=0:(f[v]=3*(p[v-1]+p[v])/((2*p[v]+p[v-1])/d[v-1]+(p[v]+2*p[v-1])/d[v]),isFinite(f[v])||(f[v]=0));f[l-1]=d[l-2];for(let v=0;v{tr.pxRatio=Et}));const sse=r6(),lse=t6();function nL(e,t,n,r){return(r?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map((s,l)=>TO(s,l,t,n))}function use(e,t){return e.map((n,r)=>r==0?{}:Vn({},t,n))}function TO(e,t,n,r){return Vn({},t==0?n:r,e)}function i6(e,t,n){return t==null?Cf:[t,n]}const cse=i6;function fse(e,t,n){return t==null?Cf:Zy(t,n,s2,!0)}function a6(e,t,n,r){return t==null?Cf:Hg(t,n,e.scales[r].log,!1)}const dse=a6;function o6(e,t,n,r){return t==null?Cf:o2(t,n,e.scales[r].log,!1)}const hse=o6;function pse(e,t,n,r,i){let s=Xr(N5(e),N5(t)),l=t-e,c=wa(i/r*l,n);do{let f=n[c],d=r*f/l;if(d>=i&&s+(f<5?ol.get(f):0)<=17)return[f,d]}while(++c(t=Xn((n=+i)*Et))+"px"),[e,t,n]}function mse(e){e.show&&[e.font,e.labelFont].forEach(t=>{let n=Yt(t[2]*Et,1);t[0]=t[0].replace(/[0-9.]+px/,n+"px"),t[1]=n})}function tr(e,t,n){const r={mode:_t(e.mode,1)},i=r.mode;function s(C,N,I,H){let te=N.valToPct(C);return H+I*(N.dir==-1?1-te:te)}function l(C,N,I,H){let te=N.valToPct(C);return H+I*(N.dir==-1?te:1-te)}function c(C,N,I,H){return N.ori==0?s(C,N,I,H):l(C,N,I,H)}r.valToPosH=s,r.valToPosV=l;let f=!1;r.status=0;const d=r.root=Zi(wae);if(e.id!=null&&(d.id=e.id),Ai(d,e.class),e.title){let C=Zi(Oae,d);C.textContent=e.title}const m=ya("canvas"),p=r.ctx=m.getContext("2d"),v=Zi(Tae,d);vu("click",v,C=>{C.target===w&&(jt!=Vr||kt!=Ra)&&xt.click(r,C)},!0);const b=r.under=Zi(Eae,v);v.appendChild(m);const w=r.over=Zi(Mae,v);e=Df(e);const S=+_t(e.pxAlign,1),x=J5(S);(e.plugins||[]).forEach(C=>{C.opts&&(e=C.opts(r,e)||e)});const A=e.ms||.001,_=r.series=i==1?nL(e.series||[],G5,Q5,!1):use(e.series||[null],W5),M=r.axes=nL(e.axes||[],F5,Y5,!0),E=r.scales={},O=r.bands=e.bands||[];O.forEach(C=>{C.fill=ht(C.fill||null),C.dir=_t(C.dir,-1)});const j=i==2?_[1].facets[0].scale:_[0].scale,R={axes:fd,series:s0},k=(e.drawOrder||["axes","series"]).map(C=>R[C]);function z(C){const N=C.distr==3?I=>Uo(I>0?I:C.clamp(r,I,C.min,C.max,C.key)):C.distr==4?I=>h_(I,C.asinh):C.distr==100?I=>C.fwd(I):I=>I;return I=>{let H=N(I),{_min:te,_max:ae}=C,ve=ae-te;return(H-te)/ve}}function G(C){let N=E[C];if(N==null){let I=(e.scales||kh)[C]||kh;if(I.from!=null){G(I.from);let H=Vn({},E[I.from],I,{key:C});H.valToPct=z(H),E[C]=H}else{N=E[C]=Vn({},C==j?Y4:Qoe,I),N.key=C;let H=N.time,te=N.range,ae=Hs(te);if((C!=j||i==2&&!H)&&(ae&&(te[0]==null||te[1]==null)&&(te={min:te[0]==null?C5:{mode:1,hard:te[0],soft:te[0]},max:te[1]==null?C5:{mode:1,hard:te[1],soft:te[1]}},ae=!1),!ae&&Gg(te))){let ve=te;te=(we,Ae,Pe)=>Ae==null?Cf:Zy(Ae,Pe,ve)}N.range=ht(te||(H?cse:C==j?N.distr==3?dse:N.distr==4?hse:i6:N.distr==3?a6:N.distr==4?o6:fse)),N.auto=ht(ae?!1:N.auto),N.clamp=ht(N.clamp||Woe),N._min=N._max=null,N.valToPct=z(N)}}}G("x"),G("y"),i==1&&_.forEach(C=>{G(C.scale)}),M.forEach(C=>{G(C.scale)});for(let C in e.scales)G(C);const $=E[j],B=$.distr;let Z,ee;$.ori==0?(Ai(d,_ae),Z=s,ee=l):(Ai(d,Aae),Z=l,ee=s);const J={};for(let C in E){let N=E[C];(N.min!=null||N.max!=null)&&(J[C]={min:N.min,max:N.max},N.min=N.max=null)}const q=e.tzDate||(C=>new Date(Xn(C/A))),F=e.fmtDate||c2,ie=A==1?_oe(q):Toe(q),ce=U5(q,I5(A==1?woe:Ooe,F)),U=H5(q,V5(Moe,F)),D=[],V=r.legend=Vn({},Coe,e.legend),X=r.cursor=Vn({},zoe,{drag:{y:i==2}},e.cursor),ue=V.show,be=X.show,Se=V.markers;V.idxs=D,Se.width=ht(Se.width),Se.dash=ht(Se.dash),Se.stroke=ht(Se.stroke),Se.fill=ht(Se.fill);let ye,Me,de,_e=[],Ee=[],he,Ie=!1,Te={};if(V.live){const C=_[1]?_[1].values:null;Ie=C!=null,he=Ie?C(r,1,0):{_:0};for(let N in he)Te[N]=i2}if(ue)if(ye=ya("table",Nae,d),de=ya("tbody",null,ye),V.mount(r,ye),Ie){Me=ya("thead",null,ye,de);let C=ya("tr",null,Me);ya("th",null,C);for(var Xe in he)ya("th",g5,C).textContent=Xe}else Ai(ye,Lae),V.live&&Ai(ye,kae);const nt={show:!0},yt={show:!1};function Qt(C,N){if(N==0&&(Ie||!V.live||i==2))return Cf;let I=[],H=ya("tr",zae,de,de.childNodes[N]);Ai(H,C.class),C.show||Ai(H,Wl);let te=ya("th",null,H);if(Se.show){let we=Zi($ae,te);if(N>0){let Ae=Se.width(r,N);Ae&&(we.style.border=Ae+"px "+Se.dash(r,N)+" "+Se.stroke(r,N)),we.style.background=Se.fill(r,N)}}let ae=Zi(g5,te);C.label instanceof HTMLElement?ae.appendChild(C.label):ae.textContent=C.label,N>0&&(Se.show||(ae.style.color=C.width>0?Se.stroke(r,N):Se.fill(r,N)),pt("click",te,we=>{if(X._lock)return;pi(we);let Ae=_.indexOf(C);if((we.ctrlKey||we.metaKey)!=V.isolate){let Pe=_.some((Re,Ne)=>Ne>0&&Ne!=Ae&&Re.show);_.forEach((Re,Ne)=>{Ne>0&&Hr(Ne,Pe?Ne==Ae?nt:yt:nt,!0,gn.setSeries)})}else Hr(Ae,{show:!C.show},!0,gn.setSeries)},!1),io&&pt(w5,te,we=>{X._lock||(pi(we),Hr(_.indexOf(C),hs,!0,gn.setSeries))},!1));for(var ve in he){let we=ya("td",Bae,H);we.textContent="--",I.push(we)}return[H,I]}const Zt=new Map;function pt(C,N,I,H=!0){const te=Zt.get(N)||{},ae=X.bind[C](r,N,I,H);ae&&(vu(C,N,te[C]=ae),Zt.set(N,te))}function Nn(C,N,I){const H=Zt.get(N)||{};for(let te in H)(C==null||te==C)&&(xO(te,N,H[te]),delete H[te]);C==null&&Zt.delete(N)}let Tn=0,Br=0,ze=0,je=0,bt=0,cn=0,di=bt,ki=cn,Tr=ze,hi=je,pr=0,kn=0,Bt=0,Ln=0;r.bbox={};let mr=!1,ku=!1,ns=!1,no=!1,ro=!1,vr=!1;function rs(C,N,I){(I||C!=r.width||N!=r.height)&&Ma(C,N),ss(!1),ns=!0,ku=!0,Da()}function Ma(C,N){r.width=Tn=ze=C,r.height=Br=je=N,bt=cn=0,Xp(),rd();let I=r.bbox;pr=I.left=Gl(bt*Et,.5),kn=I.top=Gl(cn*Et,.5),Bt=I.width=Gl(ze*Et,.5),Ln=I.height=Gl(je*Et,.5)}const Lu=3;function vl(){let C=!1,N=0;for(;!C;){N++;let I=Jp(N),H=em(N);C=N==Lu||I&&H,C||(Ma(r.width,r.height),ku=!0)}}function o0({width:C,height:N}){rs(C,N)}r.setSize=o0;function Xp(){let C=!1,N=!1,I=!1,H=!1;M.forEach((te,ae)=>{if(te.show&&te._show){let{side:ve,_size:we}=te,Ae=ve%2,Pe=te.label!=null?te.labelSize:0,Re=we+Pe;Re>0&&(Ae?(ze-=Re,ve==3?(bt+=Re,H=!0):I=!0):(je-=Re,ve==0?(cn+=Re,C=!0):N=!0))}}),Wr[0]=C,Wr[1]=I,Wr[2]=N,Wr[3]=H,ze-=ua[1]+ua[3],bt+=ua[3],je-=ua[2]+ua[0],cn+=ua[0]}function rd(){let C=bt+ze,N=cn+je,I=bt,H=cn;function te(ae,ve){switch(ae){case 1:return C+=ve,C-ve;case 2:return N+=ve,N-ve;case 3:return I-=ve,I+ve;case 0:return H-=ve,H+ve}}M.forEach((ae,ve)=>{if(ae.show&&ae._show){let we=ae.side;ae._pos=te(we,ae._size),ae.label!=null&&(ae._lpos=te(we,ae.labelSize))}})}if(X.dataIdx==null){let C=X.hover,N=C.skip=new Set(C.skip??[]);N.add(void 0);let I=C.prox=ht(C.prox),H=C.bias??(C.bias=0);X.dataIdx=(te,ae,ve,we)=>{if(ae==0)return ve;let Ae=ve,Pe=I(te,ae,ve,we)??Kt,Re=Pe>=0&&Pe0;)N.has(Ye[Be])||(et=Be);if(H==0||H==1)for(Be=ve;Ve==null&&Be++Pe&&(Ae=null);return Ae}}const pi=C=>{X.event=C};X.idxs=D,X._lock=!1;let ir=X.points;ir.show=ht(ir.show),ir.size=ht(ir.size),ir.stroke=ht(ir.stroke),ir.width=ht(ir.width),ir.fill=ht(ir.fill);const mi=r.focus=Vn({},e.focus||{alpha:.3},X.focus),io=mi.prox>=0,ao=io&&ir.one;let Er=[],ja=[],oo=[];function id(C,N){let I=ir.show(r,N);if(I instanceof HTMLElement)return Ai(I,Rae),Ai(I,C.class),qa(I,-10,-10,ze,je),w.insertBefore(I,Er[N]),I}function la(C,N){if(i==1||N>0){let I=i==1&&E[C.scale].time,H=C.value;C.value=I?z5(H)?H5(q,V5(H,F)):H||U:H||Koe,C.label=C.label||(I?Boe:$oe)}if(ao||N>0){C.width=C.width==null?1:C.width,C.paths=C.paths||sse||Qae,C.fillTo=ht(C.fillTo||Zoe),C.pxAlign=+_t(C.pxAlign,S),C.pxRound=J5(C.pxAlign),C.stroke=ht(C.stroke||null),C.fill=ht(C.fill||null),C._stroke=C._fill=C._paths=C._focus=null;let I=Yoe(Xr(1,C.width),1),H=C.points=Vn({},{size:I,width:Xr(1,I*.2),stroke:C.stroke,space:I*2,paths:lse,_stroke:null,_fill:null},C.points);H.show=ht(H.show),H.filter=ht(H.filter),H.fill=ht(H.fill),H.stroke=ht(H.stroke),H.paths=ht(H.paths),H.pxAlign=C.pxAlign}if(ue){let I=Qt(C,N);_e.splice(N,0,I[0]),Ee.splice(N,0,I[1]),V.values.push(null)}if(be){D.splice(N,0,null);let I=null;ao?N==0&&(I=id(C,N)):N>0&&(I=id(C,N)),Er.splice(N,0,I),ja.splice(N,0,0),oo.splice(N,0,0)}Mn("addSeries",N)}function Fn(C,N){N=N??_.length,C=i==1?TO(C,N,G5,Q5):TO(C,N,{},W5),_.splice(N,0,C),la(_[N],N)}r.addSeries=Fn;function Mr(C){if(_.splice(C,1),ue){V.values.splice(C,1),Ee.splice(C,1);let N=_e.splice(C,1)[0];Nn(null,N.firstChild),N.remove()}be&&(D.splice(C,1),Er.splice(C,1)[0].remove(),ja.splice(C,1),oo.splice(C,1)),Mn("delSeries",C)}r.delSeries=Mr;const Wr=[!1,!1,!1,!1];function ad(C,N){if(C._show=C.show,C.show){let I=C.side%2,H=E[C.scale];H==null&&(C.scale=I?_[1].scale:j,H=E[C.scale]);let te=H.time;C.size=ht(C.size),C.space=ht(C.space),C.rotate=ht(C.rotate),Hs(C.incrs)&&C.incrs.forEach(ve=>{!ol.has(ve)&&ol.set(ve,j4(ve))}),C.incrs=ht(C.incrs||(H.distr==2?boe:te?A==1?Soe:Aoe:Kl)),C.splits=ht(C.splits||(te&&H.distr==1?ie:H.distr==3?wO:H.distr==4?Uoe:Ioe)),C.stroke=ht(C.stroke),C.grid.stroke=ht(C.grid.stroke),C.ticks.stroke=ht(C.ticks.stroke),C.border.stroke=ht(C.border.stroke);let ae=C.values;C.values=Hs(ae)&&!Hs(ae[0])?ht(ae):te?Hs(ae)?U5(q,I5(ae,F)):z5(ae)?Eoe(q,ae):ae||ce:ae||qoe,C.filter=ht(C.filter||(H.distr>=3&&H.log==10?Foe:H.distr==3&&H.log==2?Goe:E4)),C.font=rL(C.font),C.labelFont=rL(C.labelFont),C._size=C.size(r,null,N,0),C._space=C._rotate=C._incrs=C._found=C._splits=C._values=null,C._size>0&&(Wr[N]=!0,C._el=Zi(jae,v))}}function yl(C,N,I,H){let[te,ae,ve,we]=I,Ae=N%2,Pe=0;return Ae==0&&(we||ae)&&(Pe=N==0&&!te||N==2&&!ve?Xn(F5.size/3):0),Ae==1&&(te||ve)&&(Pe=N==1&&!ae||N==3&&!we?Xn(Y5.size/2):0),Pe}const Wp=r.padding=(e.padding||[yl,yl,yl,yl]).map(C=>ht(_t(C,yl))),ua=r._padding=Wp.map((C,N)=>C(r,N,Wr,0));let pn,yn=null,tn=null;const ca=i==1?_[0].idxs:null;let yr=null,Li=!1;function En(C,N){if(t=C??[],r.data=r._data=t,i==2){pn=0;for(let I=1;I<_.length;I++)pn+=t[I][0].length}else{t.length==0&&(r.data=r._data=t=[[]]),yr=t[0],pn=yr.length;let I=t;if(B==2){I=t.slice();let H=I[0]=Array(pn);for(let te=0;te=0,vr=!0,Da()}}r.setData=En;function zu(){Li=!0;let C,N;i==1&&(pn>0?(yn=ca[0]=0,tn=ca[1]=pn-1,C=t[0][yn],N=t[0][tn],B==2?(C=yn,N=tn):C==N&&(B==3?[C,N]=Hg(C,C,$.log,!1):B==4?[C,N]=o2(C,C,$.log,!1):$.time?N=C+Xn(86400/A):[C,N]=Zy(C,N,s2,!0))):(yn=ca[0]=C=null,tn=ca[1]=N=null)),Zr(j,C,N)}let gl,Qr,Pa,od,$u,Bu,sd,is,as,fn;function qr(C,N,I,H,te,ae){C??(C=x5),I??(I=u2),H??(H="butt"),te??(te=x5),ae??(ae="round"),C!=gl&&(p.strokeStyle=gl=C),te!=Qr&&(p.fillStyle=Qr=te),N!=Pa&&(p.lineWidth=Pa=N),ae!=$u&&(p.lineJoin=$u=ae),H!=Bu&&(p.lineCap=Bu=H),I!=od&&p.setLineDash(od=I)}function ld(C,N,I,H){N!=Qr&&(p.fillStyle=Qr=N),C!=sd&&(p.font=sd=C),I!=is&&(p.textAlign=is=I),H!=as&&(p.textBaseline=as=H)}function ud(C,N,I,H,te=0){if(H.length>0&&C.auto(r,Li)&&(N==null||N.min==null)){let ae=_t(yn,0),ve=_t(tn,H.length-1),we=I.min==null?Fae(H,ae,ve,te,C.distr==3):[I.min,I.max];C.min=Aa(C.min,I.min=we[0]),C.max=Xr(C.max,I.max=we[1])}}const qu={min:null,max:null};function Qp(){for(let H in E){let te=E[H];J[H]==null&&(te.min==null||J[j]!=null&&te.auto(r,Li))&&(J[H]=qu)}for(let H in E){let te=E[H];J[H]==null&&te.from!=null&&J[te.from]!=null&&(J[H]=qu)}J[j]!=null&&ss(!0);let C={};for(let H in J){let te=J[H];if(te!=null){let ae=C[H]=Df(E[H],eoe);if(te.min!=null)Vn(ae,te);else if(H!=j||i==2)if(pn==0&&ae.from==null){let ve=ae.range(r,null,null,H);ae.min=ve[0],ae.max=ve[1]}else ae.min=Kt,ae.max=-Kt}}if(pn>0){_.forEach((H,te)=>{if(i==1){let ae=H.scale,ve=J[ae];if(ve==null)return;let we=C[ae];if(te==0){let Ae=we.range(r,we.min,we.max,ae);we.min=Ae[0],we.max=Ae[1],yn=wa(we.min,t[0]),tn=wa(we.max,t[0]),tn-yn>1&&(t[0][yn]we.max&&tn--),H.min=yr[yn],H.max=yr[tn]}else H.show&&H.auto&&ud(we,ve,H,t[te],H.sorted);H.idxs[0]=yn,H.idxs[1]=tn}else if(te>0&&H.show&&H.auto){let[ae,ve]=H.facets,we=ae.scale,Ae=ve.scale,[Pe,Re]=t[te],Ne=C[we],Ke=C[Ae];Ne!=null&&ud(Ne,J[we],ae,Pe,ae.sorted),Ke!=null&&ud(Ke,J[Ae],ve,Re,ve.sorted),H.min=ve.min,H.max=ve.max}});for(let H in C){let te=C[H],ae=J[H];if(te.from==null&&(ae==null||ae.min==null)){let ve=te.range(r,te.min==Kt?null:te.min,te.max==-Kt?null:te.max,H);te.min=ve[0],te.max=ve[1]}}}for(let H in C){let te=C[H];if(te.from!=null){let ae=C[te.from];if(ae.min==null)te.min=te.max=null;else{let ve=te.range(r,ae.min,ae.max,H);te.min=ve[0],te.max=ve[1]}}}let N={},I=!1;for(let H in C){let te=C[H],ae=E[H];if(ae.min!=te.min||ae.max!=te.max){ae.min=te.min,ae.max=te.max;let ve=ae.distr;ae._min=ve==3?Uo(ae.min):ve==4?h_(ae.min,ae.asinh):ve==100?ae.fwd(ae.min):ae.min,ae._max=ve==3?Uo(ae.max):ve==4?h_(ae.max,ae.asinh):ve==100?ae.fwd(ae.max):ae.max,N[H]=I=!0}}if(I){_.forEach((H,te)=>{i==2?te>0&&N.y&&(H._paths=null):N[H.scale]&&(H._paths=null)});for(let H in N)ns=!0,Mn("setScale",H);be&&X.left>=0&&(no=vr=!0)}for(let H in J)J[H]=null}function Iu(C){let N=SO(yn-1,0,pn-1),I=SO(tn+1,0,pn-1);for(;C[N]==null&&N>0;)N--;for(;C[I]==null&&I0){let C=_.some(N=>N._focus)&&fn!=mi.alpha;C&&(p.globalAlpha=fn=mi.alpha),_.forEach((N,I)=>{if(I>0&&N.show&&(Ir(I,!1),Ir(I,!0),N._paths==null)){let H=fn;fn!=N.alpha&&(p.globalAlpha=fn=N.alpha);let te=i==2?[0,t[I][0].length-1]:Iu(t[I]);N._paths=N.paths(r,I,te[0],te[1]),fn!=H&&(p.globalAlpha=fn=H)}}),_.forEach((N,I)=>{if(I>0&&N.show){let H=fn;fn!=N.alpha&&(p.globalAlpha=fn=N.alpha),N._paths!=null&&Uu(I,!1);{let te=N._paths!=null?N._paths.gaps:null,ae=N.points.show(r,I,yn,tn,te),ve=N.points.filter(r,I,ae,te);(ae||ve)&&(N.points._paths=N.points.paths(r,I,yn,tn,ve),Uu(I,!0))}fn!=H&&(p.globalAlpha=fn=H),Mn("drawSeries",I)}}),C&&(p.globalAlpha=fn=1)}}function Ir(C,N){let I=N?_[C].points:_[C];I._stroke=I.stroke(r,C),I._fill=I.fill(r,C)}function Uu(C,N){let I=N?_[C].points:_[C],{stroke:H,fill:te,clip:ae,flags:ve,_stroke:we=I._stroke,_fill:Ae=I._fill,_width:Pe=I.width}=I._paths;Pe=Yt(Pe*Et,3);let Re=null,Ne=Pe%2/2;N&&Ae==null&&(Ae=Pe>0?"#fff":we);let Ke=I.pxAlign==1&&Ne>0;if(Ke&&p.translate(Ne,Ne),!N){let gt=pr-Pe/2,Ye=kn-Pe/2,et=Bt+Pe,Ve=Ln+Pe;Re=new Path2D,Re.rect(gt,Ye,et,Ve)}N?Ca(we,Pe,I.dash,I.cap,Ae,H,te,ve,ae):Zp(C,we,Pe,I.dash,I.cap,Ae,H,te,ve,Re,ae),Ke&&p.translate(-Ne,-Ne)}function Zp(C,N,I,H,te,ae,ve,we,Ae,Pe,Re){let Ne=!1;Ae!=0&&O.forEach((Ke,gt)=>{if(Ke.series[0]==C){let Ye=_[Ke.series[1]],et=t[Ke.series[1]],Ve=(Ye._paths||kh).band;Hs(Ve)&&(Ve=Ke.dir==1?Ve[0]:Ve[1]);let Be,qt=null;Ye.show&&Ve&&Kae(et,yn,tn)?(qt=Ke.fill(r,gt)||ae,Be=Ye._paths.clip):Ve=null,Ca(N,I,H,te,qt,ve,we,Ae,Pe,Re,Be,Ve),Ne=!0}}),Ne||Ca(N,I,H,te,ae,ve,we,Ae,Pe,Re)}const Vu=Rf|AO;function Ca(C,N,I,H,te,ae,ve,we,Ae,Pe,Re,Ne){qr(C,N,I,H,te),(Ae||Pe||Ne)&&(p.save(),Ae&&p.clip(Ae),Pe&&p.clip(Pe)),Ne?(we&Vu)==Vu?(p.clip(Ne),Re&&p.clip(Re),xl(te,ve),bl(C,ae,N)):we&AO?(xl(te,ve),p.clip(Ne),bl(C,ae,N)):we&Rf&&(p.save(),p.clip(Ne),Re&&p.clip(Re),xl(te,ve),p.restore(),bl(C,ae,N)):(xl(te,ve),bl(C,ae,N)),(Ae||Pe||Ne)&&p.restore()}function bl(C,N,I){I>0&&(N instanceof Map?N.forEach((H,te)=>{p.strokeStyle=gl=te,p.stroke(H)}):N!=null&&C&&p.stroke(N))}function xl(C,N){N instanceof Map?N.forEach((I,H)=>{p.fillStyle=Qr=H,p.fill(I)}):N!=null&&C&&p.fill(N)}function os(C,N,I,H){let te=M[C],ae;if(H<=0)ae=[0,0];else{let ve=te._space=te.space(r,C,N,I,H),we=te._incrs=te.incrs(r,C,N,I,H,ve);ae=pse(N,I,we,H,ve)}return te._found=ae}function cd(C,N,I,H,te,ae,ve,we,Ae,Pe){let Re=ve%2/2;S==1&&p.translate(Re,Re),qr(we,ve,Ae,Pe,we),p.beginPath();let Ne,Ke,gt,Ye,et=te+(H==0||H==3?-ae:ae);I==0?(Ke=te,Ye=et):(Ne=te,gt=et);for(let Ve=0;Ve{if(!I.show)return;let te=E[I.scale];if(te.min==null){I._show&&(N=!1,I._show=!1,ss(!1));return}else I._show||(N=!1,I._show=!0,ss(!1));let ae=I.side,ve=ae%2,{min:we,max:Ae}=te,[Pe,Re]=os(H,we,Ae,ve==0?ze:je);if(Re==0)return;let Ne=te.distr==2,Ke=I._splits=I.splits(r,H,we,Ae,Pe,Re,Ne),gt=te.distr==2?Ke.map(Be=>yr[Be]):Ke,Ye=te.distr==2?yr[Ke[1]]-yr[Ke[0]]:Pe,et=I._values=I.values(r,I.filter(r,gt,H,Re,Ye),H,Re,Ye);I._rotate=ae==2?I.rotate(r,et,H,Re):0;let Ve=I._size;I._size=na(I.size(r,et,H,C)),Ve!=null&&I._size!=Ve&&(N=!1)}),N}function em(C){let N=!0;return Wp.forEach((I,H)=>{let te=I(r,H,Wr,C);te!=ua[H]&&(N=!1),ua[H]=te}),N}function fd(){for(let C=0;Cyr[sr]):gt,et=Re.distr==2?yr[gt[1]]-yr[gt[0]]:Ae,Ve=N.ticks,Be=N.border,qt=Ve.show?Ve.size:0,nn=Xn(qt*Et),bn=Xn((N.alignTo==2?N._size-qt-N.gap:N.gap)*Et),Pt=N._rotate*-Fv/180,Lt=x(N._pos*Et),gr=(nn+bn)*we,jn=Lt+gr;ae=H==0?jn:0,te=H==1?jn:0;let Pr=N.font[0],Jr=N.align==1?Oc:N.align==2?c_:Pt>0?Oc:Pt<0?c_:H==0?"center":I==3?c_:Oc,ar=Pt||H==1?"middle":I==2?ph:b5;ld(Pr,ve,Jr,ar);let zn=N.font[1]*N.lineGap,Cr=gt.map(sr=>x(c(sr,Re,Ne,Ke))),ei=N._values;for(let sr=0;sr{I>0&&(N._paths=null,C&&(i==1?(N.min=null,N.max=null):N.facets.forEach(H=>{H.min=null,H.max=null})))})}let Hu=!1,ls=!1,Ur=[];function dd(){ls=!1;for(let C=0;C0&&queueMicrotask(dd)}r.batch=us;function so(){if(mr&&(Qp(),mr=!1),ns&&(vl(),ns=!1),ku){if(sn(b,Oc,bt),sn(b,ph,cn),sn(b,Sh,ze),sn(b,wh,je),sn(w,Oc,bt),sn(w,ph,cn),sn(w,Sh,ze),sn(w,wh,je),sn(v,Sh,Tn),sn(v,wh,Br),m.width=Xn(Tn*Et),m.height=Xn(Br*Et),M.forEach(({_el:C,_show:N,_size:I,_pos:H,side:te})=>{if(C!=null)if(N){let ae=te===3||te===0?I:0,ve=te%2==1;sn(C,ve?"left":"top",H-ae),sn(C,ve?"width":"height",I),sn(C,ve?"top":"left",ve?cn:bt),sn(C,ve?"height":"width",ve?je:ze),bO(C,Wl)}else Ai(C,Wl)}),gl=Qr=Pa=$u=Bu=sd=is=as=od=null,fn=1,Ol(!0),bt!=di||cn!=ki||ze!=Tr||je!=hi){ss(!1);let C=ze/Tr,N=je/hi;if(be&&!no&&X.left>=0){X.left*=C,X.top*=N,zi&&qa(zi,Xn(X.left),0,ze,je),jr&&qa(jr,0,Xn(X.top),ze,je);for(let I=0;I=0&&Ot.width>0){Ot.left*=C,Ot.width*=C,Ot.top*=N,Ot.height*=N;for(let I in gd)sn(fs,I,Ot[I])}di=bt,ki=cn,Tr=ze,hi=je}Mn("setSize"),ku=!1}Tn>0&&Br>0&&(p.clearRect(0,0,m.width,m.height),Mn("drawClear"),k.forEach(C=>C()),Mn("draw")),Ot.show&&ro&&(ds(Ot),ro=!1),be&&no&&(uo(null,!0,!1),no=!1),V.show&&V.live&&vr&&(vd(),vr=!1),f||(f=!0,r.status=1,Mn("ready")),Li=!1,Hu=!1}r.redraw=(C,N)=>{ns=N||!1,C!==!1?Zr(j,$.min,$.max):Da()};function Fu(C,N){let I=E[C];if(I.from==null){if(pn==0){let H=I.range(r,N.min,N.max,C);N.min=H[0],N.max=H[1]}if(N.min>N.max){let H=N.min;N.min=N.max,N.max=H}if(pn>1&&N.min!=null&&N.max!=null&&N.max-N.min<1e-16)return;C==j&&I.distr==2&&pn>0&&(N.min=wa(N.min,t[0]),N.max=wa(N.max,t[0]),N.min==N.max&&N.max++),J[C]=N,mr=!0,Da()}}r.setScale=Fu;let Sl,Gu,zi,jr,Ku,cs,Vr,Ra,wl,hd,jt,kt,fa=!1;const xt=X.drag;let Jt=xt.x,mn=xt.y;be&&(X.x&&(Sl=Zi(Cae,w)),X.y&&(Gu=Zi(Dae,w)),$.ori==0?(zi=Sl,jr=Gu):(zi=Gu,jr=Sl),jt=X.left,kt=X.top);const Ot=r.select=Vn({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),fs=Ot.show?Zi(Pae,Ot.over?w:b):null;function ds(C,N){if(Ot.show){for(let I in C)Ot[I]=C[I],I in gd&&sn(fs,I,C[I]);N!==!1&&Mn("setSelect")}}r.setSelect=ds;function pd(C){if(_[C].show)ue&&bO(_e[C],Wl);else if(ue&&Ai(_e[C],Wl),be){let I=ao?Er[0]:Er[C];I!=null&&qa(I,-10,-10,ze,je)}}function Zr(C,N,I){Fu(C,{min:N,max:I})}function Hr(C,N,I,H){N.focus!=null&&f0(C),N.show!=null&&_.forEach((te,ae)=>{ae>0&&(C==ae||C==null)&&(te.show=N.show,pd(ae),i==2?(Zr(te.facets[0].scale,null,null),Zr(te.facets[1].scale,null,null)):Zr(te.scale,null,null),Da())}),I!==!1&&Mn("setSeries",C,N),H&&ms("setSeries",r,C,N)}r.setSeries=Hr;function tm(C,N){Vn(O[C],N)}function l0(C,N){C.fill=ht(C.fill||null),C.dir=_t(C.dir,-1),N=N??O.length,O.splice(N,0,C)}function u0(C){C==null?O.length=0:O.splice(C,1)}r.addBand=l0,r.setBand=tm,r.delBand=u0;function c0(C,N){_[C].alpha=N,be&&Er[C]!=null&&(Er[C].style.opacity=N),ue&&_e[C]&&(_e[C].style.opacity=N)}let vi,Na,lo;const hs={focus:!0};function f0(C){if(C!=lo){let N=C==null,I=mi.alpha!=1;_.forEach((H,te)=>{if(i==1||te>0){let ae=N||te==0||te==C;H._focus=N?null:ae,I&&c0(te,ae?1:mi.alpha)}}),lo=C,I&&Da()}}ue&&io&&pt(_5,ye,C=>{X._lock||(pi(C),lo!=null&&Hr(null,hs,!0,gn.setSeries))});function $i(C,N,I){let H=E[N];I&&(C=C/Et-(H.ori==1?cn:bt));let te=ze;H.ori==1&&(te=je,C=te-C),H.dir==-1&&(C=te-C);let ae=H._min,ve=H._max,we=C/te,Ae=ae+(ve-ae)*we,Pe=H.distr;return Pe==3?Pf(10,Ae):Pe==4?Xae(Ae,H.asinh):Pe==100?H.bwd(Ae):Ae}function nm(C,N){let I=$i(C,j,N);return wa(I,t[0],yn,tn)}r.valToIdx=C=>wa(C,t[0]),r.posToIdx=nm,r.posToVal=$i,r.valToPos=(C,N,I)=>E[N].ori==0?s(C,E[N],I?Bt:ze,I?pr:0):l(C,E[N],I?Ln:je,I?kn:0),r.setCursor=(C,N,I)=>{jt=C.left,kt=C.top,uo(null,N,I)};function rm(C,N){sn(fs,Oc,Ot.left=C),sn(fs,Sh,Ot.width=N)}function im(C,N){sn(fs,ph,Ot.top=C),sn(fs,wh,Ot.height=N)}let _l=$.ori==0?rm:im,Al=$.ori==1?rm:im;function md(){if(ue&&V.live)for(let C=i==2?1:0;C<_.length;C++){if(C==0&&Ie)continue;let N=V.values[C],I=0;for(let H in N)Ee[C][I++].firstChild.nodeValue=N[H]}}function vd(C,N){if(C!=null&&(C.idxs?C.idxs.forEach((I,H)=>{D[H]=I}):Jae(C.idx)||D.fill(C.idx),V.idx=D[0]),ue&&V.live){for(let I=0;I<_.length;I++)(I>0||i==1&&!Ie)&&d0(I,D[I]);md()}vr=!1,N!==!1&&Mn("setLegend")}r.setLegend=vd;function d0(C,N){let I=_[C],H=C==0&&B==2?yr:t[C],te;Ie?te=I.values(r,C,N)??Te:(te=I.value(r,N==null?null:H[N],C,N),te=te==null?Te:{_:te}),V.values[C]=te}function uo(C,N,I){wl=jt,hd=kt,[jt,kt]=X.move(r,jt,kt),X.left=jt,X.top=kt,be&&(zi&&qa(zi,Xn(jt),0,ze,je),jr&&qa(jr,0,Xn(kt),ze,je));let H,te=yn>tn;vi=Kt,Na=null;let ae=$.ori==0?ze:je,ve=$.ori==1?ze:je;if(jt<0||pn==0||te){H=X.idx=null;for(let we=0;we<_.length;we++){let Ae=Er[we];Ae!=null&&qa(Ae,-10,-10,ze,je)}io&&Hr(null,hs,!0,C==null&&gn.setSeries),V.live&&(D.fill(H),vr=!0)}else{let we,Ae,Pe;i==1&&(we=$.ori==0?jt:kt,Ae=$i(we,j),H=X.idx=wa(Ae,t[0],yn,tn),Pe=Z(t[0][H],$,ae,0));let Re=-10,Ne=-10,Ke=0,gt=0,Ye=!0,et="",Ve="";for(let Be=i==2?1:0;Be<_.length;Be++){let qt=_[Be],nn=D[Be],bn=nn==null?null:i==1?t[Be][nn]:t[Be][1][nn],Pt=X.dataIdx(r,Be,H,Ae),Lt=Pt==null?null:i==1?t[Be][Pt]:t[Be][1][Pt];if(vr=vr||Lt!=bn||Pt!=nn,D[Be]=Pt,Be>0&&qt.show){let gr=Pt==null?-10:Pt==H?Pe:Z(i==1?t[0][Pt]:t[Be][0][Pt],$,ae,0),jn=Lt==null?-10:ee(Lt,i==1?E[qt.scale]:E[qt.facets[1].scale],ve,0);if(io&&Lt!=null){let Pr=$.ori==1?jt:kt,Jr=Wn(mi.dist(r,Be,Pt,jn,Pr));if(Jr=0?1:-1,ei=zn>=0?1:-1;ei==Cr&&(ei==1?ar==1?Lt>=zn:Lt<=zn:ar==1?Lt<=zn:Lt>=zn)&&(vi=Jr,Na=Be)}else vi=Jr,Na=Be}}if(vr||ao){let Pr,Jr;$.ori==0?(Pr=gr,Jr=jn):(Pr=jn,Jr=gr);let ar,zn,Cr,ei,or,sr,Dr=!0,ka=ir.bbox;if(ka!=null){Dr=!1;let br=ka(r,Be);Cr=br.left,ei=br.top,ar=br.width,zn=br.height}else Cr=Pr,ei=Jr,ar=zn=ir.size(r,Be);if(sr=ir.fill(r,Be),or=ir.stroke(r,Be),ao)Be==Na&&vi<=mi.prox&&(Re=Cr,Ne=ei,Ke=ar,gt=zn,Ye=Dr,et=sr,Ve=or);else{let br=Er[Be];br!=null&&(ja[Be]=Cr,oo[Be]=ei,P5(br,ar,zn,Dr),M5(br,sr,or),qa(br,na(Cr),na(ei),ze,je))}}}}if(ao){let Be=mi.prox,qt=lo==null?vi<=Be:vi>Be||Na!=lo;if(vr||qt){let nn=Er[0];nn!=null&&(ja[0]=Re,oo[0]=Ne,P5(nn,Ke,gt,Ye),M5(nn,et,Ve),qa(nn,na(Re),na(Ne),ze,je))}}}if(Ot.show&&fa)if(C!=null){let[we,Ae]=gn.scales,[Pe,Re]=gn.match,[Ne,Ke]=C.cursor.sync.scales,gt=C.cursor.drag;if(Jt=gt._x,mn=gt._y,Jt||mn){let{left:Ye,top:et,width:Ve,height:Be}=C.select,qt=C.scales[Ne].ori,nn=C.posToVal,bn,Pt,Lt,gr,jn,Pr=we!=null&&Pe(we,Ne),Jr=Ae!=null&&Re(Ae,Ke);Pr&&Jt?(qt==0?(bn=Ye,Pt=Ve):(bn=et,Pt=Be),Lt=E[we],gr=Z(nn(bn,Ne),Lt,ae,0),jn=Z(nn(bn+Pt,Ne),Lt,ae,0),_l(Aa(gr,jn),Wn(jn-gr))):_l(0,ae),Jr&&mn?(qt==1?(bn=Ye,Pt=Ve):(bn=et,Pt=Be),Lt=E[Ae],gr=ee(nn(bn,Ke),Lt,ve,0),jn=ee(nn(bn+Pt,Ke),Lt,ve,0),Al(Aa(gr,jn),Wn(jn-gr))):Al(0,ve)}else bd()}else{let we=Wn(wl-Ku),Ae=Wn(hd-cs);if($.ori==1){let Ke=we;we=Ae,Ae=Ke}Jt=xt.x&&we>=xt.dist,mn=xt.y&&Ae>=xt.dist;let Pe=xt.uni;Pe!=null?Jt&&mn&&(Jt=we>=Pe,mn=Ae>=Pe,!Jt&&!mn&&(Ae>we?mn=!0:Jt=!0)):xt.x&&xt.y&&(Jt||mn)&&(Jt=mn=!0);let Re,Ne;Jt&&($.ori==0?(Re=Vr,Ne=jt):(Re=Ra,Ne=kt),_l(Aa(Re,Ne),Wn(Ne-Re)),mn||Al(0,ve)),mn&&($.ori==1?(Re=Vr,Ne=jt):(Re=Ra,Ne=kt),Al(Aa(Re,Ne),Wn(Ne-Re)),Jt||_l(0,ae)),!Jt&&!mn&&(_l(0,0),Al(0,0))}if(xt._x=Jt,xt._y=mn,C==null){if(I){if(cm!=null){let[we,Ae]=gn.scales;gn.values[0]=we!=null?$i($.ori==0?jt:kt,we):null,gn.values[1]=Ae!=null?$i($.ori==1?jt:kt,Ae):null}ms(f_,r,jt,kt,ze,je,H)}if(io){let we=I&&gn.setSeries,Ae=mi.prox;lo==null?vi<=Ae&&Hr(Na,hs,!0,we):vi>Ae?Hr(null,hs,!0,we):Na!=lo&&Hr(Na,hs,!0,we)}}vr&&(V.idx=H,vd()),N!==!1&&Mn("setCursor")}let da=null;Object.defineProperty(r,"rect",{get(){return da==null&&Ol(!1),da}});function Ol(C=!1){C?da=null:(da=w.getBoundingClientRect(),Mn("syncRect",da))}function am(C,N,I,H,te,ae,ve){X._lock||fa&&C!=null&&C.movementX==0&&C.movementY==0||(yd(C,N,I,H,te,ae,ve,!1,C!=null),C!=null?uo(null,!0,!0):uo(N,!0,!1))}function yd(C,N,I,H,te,ae,ve,we,Ae){if(da==null&&Ol(!1),pi(C),C!=null)I=C.clientX-da.left,H=C.clientY-da.top;else{if(I<0||H<0){jt=-10,kt=-10;return}let[Pe,Re]=gn.scales,Ne=N.cursor.sync,[Ke,gt]=Ne.values,[Ye,et]=Ne.scales,[Ve,Be]=gn.match,qt=N.axes[0].side%2==1,nn=$.ori==0?ze:je,bn=$.ori==1?ze:je,Pt=qt?ae:te,Lt=qt?te:ae,gr=qt?H:I,jn=qt?I:H;if(Ye!=null?I=Ve(Pe,Ye)?c(Ke,E[Pe],nn,0):-10:I=nn*(gr/Pt),et!=null?H=Be(Re,et)?c(gt,E[Re],bn,0):-10:H=bn*(jn/Lt),$.ori==1){let Pr=I;I=H,H=Pr}}Ae&&(N==null||N.cursor.event.type==f_)&&((I<=1||I>=ze-1)&&(I=Gl(I,ze)),(H<=1||H>=je-1)&&(H=Gl(H,je))),we?(Ku=I,cs=H,[Vr,Ra]=X.move(r,I,H)):(jt=I,kt=H)}const gd={width:0,height:0,left:0,top:0};function bd(){ds(gd,!1)}let om,sm,lm,um;function Yu(C,N,I,H,te,ae,ve){fa=!0,Jt=mn=xt._x=xt._y=!1,yd(C,N,I,H,te,ae,ve,!0,!1),C!=null&&(pt(d_,yO,ps,!1),ms(S5,r,Vr,Ra,ze,je,null));let{left:we,top:Ae,width:Pe,height:Re}=Ot;om=we,sm=Ae,lm=Pe,um=Re}function ps(C,N,I,H,te,ae,ve){fa=xt._x=xt._y=!1,yd(C,N,I,H,te,ae,ve,!1,!0);let{left:we,top:Ae,width:Pe,height:Re}=Ot,Ne=Pe>0||Re>0,Ke=om!=we||sm!=Ae||lm!=Pe||um!=Re;if(Ne&&Ke&&ds(Ot),xt.setScale&&Ne&&Ke){let gt=we,Ye=Pe,et=Ae,Ve=Re;if($.ori==1&&(gt=Ae,Ye=Re,et=we,Ve=Pe),Jt&&Zr(j,$i(gt,j),$i(gt+Ye,j)),mn)for(let Be in E){let qt=E[Be];Be!=j&&qt.from==null&&qt.min!=Kt&&Zr(Be,$i(et+Ve,Be),$i(et,Be))}bd()}else X.lock&&(X._lock=!X._lock,uo(N,!0,C!=null));C!=null&&(Nn(d_,yO),ms(d_,r,jt,kt,ze,je,null))}function h0(C,N,I,H,te,ae,ve){if(X._lock)return;pi(C);let we=fa;if(fa){let Ae=!0,Pe=!0,Re=10,Ne,Ke;$.ori==0?(Ne=Jt,Ke=mn):(Ne=mn,Ke=Jt),Ne&&Ke&&(Ae=jt<=Re||jt>=ze-Re,Pe=kt<=Re||kt>=je-Re),Ne&&Ae&&(jt=jt{let te=gn.match[2];I=te(r,N,I),I!=-1&&Hr(I,H,!0,!1)},be&&(pt(S5,w,Yu),pt(f_,w,am),pt(w5,w,C=>{pi(C),Ol(!1)}),pt(_5,w,h0),pt(A5,w,xd),OO.add(r),r.syncRect=Ol);const Tl=r.hooks=e.hooks||{};function Mn(C,N,I){ls?Ur.push([C,N,I]):C in Tl&&Tl[C].forEach(H=>{H.call(null,r,N,I)})}(e.plugins||[]).forEach(C=>{for(let N in C.hooks)Tl[N]=(Tl[N]||[]).concat(C.hooks[N])});const fo=(C,N,I)=>I,gn=Vn({key:null,setSeries:!1,filters:{pub:k5,sub:k5},scales:[j,_[1]?_[1].scale:null],match:[L5,L5,fo],values:[null,null]},X.sync);gn.match.length==2&&gn.match.push(fo),X.sync=gn;const cm=gn.key,wd=X4(cm);function ms(C,N,I,H,te,ae,ve){gn.filters.pub(C,N,I,H,te,ae,ve)&&wd.pub(C,N,I,H,te,ae,ve)}wd.sub(r);function fm(C,N,I,H,te,ae,ve){gn.filters.sub(C,N,I,H,te,ae,ve)&&co[C](null,N,I,H,te,ae,ve)}r.pub=fm;function El(){wd.unsub(r),OO.delete(r),Zt.clear(),xO(Qy,Uc,Sd),d.remove(),ye==null||ye.remove(),Mn("destroy")}r.destroy=El;function ho(){Mn("init",e,t),En(t||e.data,!1),J[j]?Fu(j,J[j]):zu(),ro=Ot.show&&(Ot.width>0||Ot.height>0),no=vr=!0,rs(e.width,e.height)}return _.forEach(la),M.forEach(ad),n?n instanceof HTMLElement?(n.appendChild(d),ho()):n(r,ho):ho(),r}tr.assign=Vn;tr.fmtNum=l2;tr.rangeNum=Zy;tr.rangeLog=Hg;tr.rangeAsinh=o2;tr.orient=Ru;tr.pxRatio=Et;tr.join=ooe;tr.fmtDate=c2,tr.tzDate=yoe;tr.sync=X4;{tr.addGap=Joe,tr.clipGaps=Kg;let e=tr.paths={points:t6};e.linear=r6,e.stepped=nse,e.bars=rse,e.spline=ase}const y2="";class Qg extends Error{constructor(n){super(`401 Unauthorized: ${n}`);rP(this,"status",401);this.name="UnauthorizedError"}}async function Mc(e,t){const n=await fetch(`${y2}${e}`,{...t,headers:{Accept:"application/json",...(t==null?void 0:t.headers)??{}}});if(n.status===401)throw De.getState().setAuthRequired(!0),new Qg(e);if(!n.ok){const r=await n.text().catch(()=>"");throw new Error(`${n.status} ${n.statusText}: ${r||e}`)}return n.json()}async function vse(){try{return(await fetch(`${y2}/health`,{headers:{Accept:"application/json"},cache:"no-store"})).status===401?"unauthorized":"ok"}catch{return"unreachable"}}async function yse(e){const t=await fetch(`${y2}/mtplx/browser-auth`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({api_key:e,next:"/dashboard/"})});if(t.status===401)throw new Qg("/mtplx/browser-auth");if(!t.ok){const n=await t.text().catch(()=>"");throw new Error(`${t.status} ${t.statusText}: ${n||"sign-in failed"}`)}}async function Nv(e,t){return Mc(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t??{})})}const ed={getHealth:()=>Mc("/health"),getMetrics:()=>Mc("/metrics"),getSessions:()=>Mc("/admin/sessions"),getPrefillHistory:()=>Mc("/v1/mtplx/prefill_history"),getSnapshot:()=>Mc("/v1/mtplx/snapshot"),postSettings:e=>Nv("/v1/mtplx/settings",e),postCancel:e=>Nv(`/v1/mtplx/cancel/${encodeURIComponent(e)}`,{}),postClearSession:e=>Nv(`/admin/sessions/${encodeURIComponent(e)}/clear`,{}),postClearCache:()=>Nv("/admin/cache/clear",{})};function gse(){return Xz({queryKey:["metrics"],queryFn:ed.getMetrics,refetchInterval:1e3,refetchOnWindowFocus:!1})}function g2(){return Xz({queryKey:["prefillHistory"],queryFn:ed.getPrefillHistory,refetchInterval:5e3,refetchOnWindowFocus:!1})}function s6(e,t,n,r){var d;const i=e.axes[n];if(r>1)return i._size??50;let s=(((d=i.ticks)==null?void 0:d.size)??10)+(i.gap??5);const l=e.ctx.font,c=Array.isArray(i.font)?i.font[0]:i.font;c&&(e.ctx.font=c);let f=0;for(const m of t??[])f=Math.max(f,e.ctx.measureText(m).width);return e.ctx.font=l,s+=f/devicePixelRatio,Math.ceil(s)}function bse(){const{data:e}=g2(),t=K.useRef(null),n=K.useRef(null),{aligned:r,mean:i}=K.useMemo(()=>{const s=[],l=[],c=(e==null?void 0:e.history)??[];let f=0,d=0;return c.forEach(m=>{typeof m.prefill_tok_s=="number"&&(s.push(m.t),l.push(m.prefill_tok_s),f+=m.prefill_tok_s,d+=1)}),{aligned:[s,l],mean:d>0?f/d:null}},[e]);return K.useEffect(()=>{var d,m;const s=t.current;if(!s)return;const l={width:s.clientWidth,height:140,padding:[4,8,4,0],cursor:{drag:{x:!1,y:!1,setScale:!1}},scales:{x:{time:!0},y:{range:(p,v,b)=>[Math.max(0,v*.85),b*1.1]}},axes:[{stroke:"rgba(200,210,220,0.4)",show:!0,gap:4,size:22},{stroke:"rgba(200,210,220,0.4)",values:(p,v)=>v.map(b=>`${b.toFixed(0)}`),size:s6}],legend:{show:!1},series:[{},{stroke:"rgba(79,182,243,0.95)",width:1.6,fill:"rgba(79,182,243,0.15)",points:{show:!1},paths:(m=(d=tr.paths).spline)==null?void 0:m.call(d)}]},c=new tr(l,r,s);n.current=c;const f=()=>c.setSize({width:s.clientWidth,height:140});return window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f),c.destroy(),n.current=null}},[]),K.useEffect(()=>{var s;(s=n.current)==null||s.setData(r)},[r]),T.jsx(ct,{title:"Prefill tok/s · last 100",subtitle:i!==null?`mean ${On(i)} tok/s`:"no prefill samples yet",children:T.jsx("div",{ref:t,className:"w-full"})})}/** + A `).concat(w,",").concat(w,",0,0,").concat(d,",").concat(t,",").concat(n+i-c*w," Z")}else m="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return m},uee=function(t,n){if(!t||!n)return!1;var r=t.x,i=t.y,s=n.x,l=n.y,c=n.width,f=n.height;if(Math.abs(c)>0&&Math.abs(f)>0){var d=Math.min(s,s+c),m=Math.max(s,s+c),p=Math.min(l,l+f),v=Math.max(l,l+f);return r>=d&&r<=m&&i>=p&&i<=v}return!1},cee={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},KT=function(t){var n=o3(o3({},cee),t),r=K.useRef(),i=K.useState(-1),s=tee(i,2),l=s[0],c=s[1];K.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var E=r.current.getTotalLength();E&&c(E)}catch{}},[]);var f=n.x,d=n.y,m=n.width,p=n.height,v=n.radius,b=n.className,w=n.animationEasing,S=n.animationDuration,x=n.animationBegin,A=n.isAnimationActive,_=n.isUpdateAnimationActive;if(f!==+f||d!==+d||m!==+m||p!==+p||m===0||p===0)return null;var M=ut("recharts-rectangle",b);return _?Q.createElement(Ta,{canBegin:l>0,from:{width:m,height:p,x:f,y:d},to:{width:m,height:p,x:f,y:d},duration:S,animationEasing:w,isActive:_},function(E){var O=E.width,j=E.height,R=E.x,k=E.y;return Q.createElement(Ta,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:S,isActive:A,easing:w},Q.createElement("path",Py({},Je(n,!0),{className:M,d:s3(R,k,O,j,v),ref:r})))}):Q.createElement("path",Py({},Je(n,!0),{className:M,d:s3(f,d,m,p,v)}))};function FA(){return FA=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function yee(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var gee=function(t,n,r,i,s,l){return"M".concat(t,",").concat(s,"v").concat(i,"M").concat(l,",").concat(n,"h").concat(r)},bee=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,s=i===void 0?0:i,l=t.top,c=l===void 0?0:l,f=t.left,d=f===void 0?0:f,m=t.width,p=m===void 0?0:m,v=t.height,b=v===void 0?0:v,w=t.className,S=vee(t,fee),x=dee({x:r,y:s,top:c,left:d,width:p,height:b},S);return!Oe(r)||!Oe(s)||!Oe(p)||!Oe(b)||!Oe(c)||!Oe(d)?null:Q.createElement("path",GA({},Je(x,!0),{className:ut("recharts-cross",w),d:gee(r,s,p,b,c,d)}))},qw,u3;function xee(){if(u3)return qw;u3=1;var e=V$(),t=e(Object.getPrototypeOf,Object);return qw=t,qw}var Iw,c3;function See(){if(c3)return Iw;c3=1;var e=Jo(),t=xee(),n=es(),r="[object Object]",i=Function.prototype,s=Object.prototype,l=i.toString,c=s.hasOwnProperty,f=l.call(Object);function d(m){if(!n(m)||e(m)!=r)return!1;var p=t(m);if(p===null)return!0;var v=c.call(p,"constructor")&&p.constructor;return typeof v=="function"&&v instanceof v&&l.call(v)==f}return Iw=d,Iw}var wee=See();const _ee=Ft(wee);var Uw,f3;function Aee(){if(f3)return Uw;f3=1;var e=Jo(),t=es(),n="[object Boolean]";function r(i){return i===!0||i===!1||t(i)&&e(i)==n}return Uw=r,Uw}var Oee=Aee();const Tee=Ft(Oee);function vp(e){"@babel/helpers - typeof";return vp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vp(e)}function Dy(){return Dy=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,from:{upperWidth:0,lowerWidth:0,height:v,x:f,y:d},to:{upperWidth:m,lowerWidth:p,height:v,x:f,y:d},duration:S,animationEasing:w,isActive:A},function(M){var E=M.upperWidth,O=M.lowerWidth,j=M.height,R=M.x,k=M.y;return Q.createElement(Ta,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:S,easing:w},Q.createElement("path",Dy({},Je(n,!0),{className:_,d:m3(R,k,E,O,j),ref:r})))}):Q.createElement("g",null,Q.createElement("path",Dy({},Je(n,!0),{className:_,d:m3(f,d,m,p,v)})))},zee=["option","shapeType","propTransformer","activeClassName","isActive"];function yp(e){"@babel/helpers - typeof";return yp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yp(e)}function $ee(e,t){if(e==null)return{};var n=Bee(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Bee(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function v3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ry(e){for(var t=1;t0&&r.handleDrag(i.changedTouches[0])}),Oi(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,s=i.endIndex,l=i.onDragEnd,c=i.startIndex;l==null||l({endIndex:s,startIndex:c})}),r.detachDragEndListener()}),Oi(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Oi(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Oi(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Oi(r,"handleSlideDragStart",function(i){var s=T3(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:s.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return dte(t,e),lte(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,s=r.endX,l=this.state.scaleValues,c=this.props,f=c.gap,d=c.data,m=d.length-1,p=Math.min(i,s),v=Math.max(i,s),b=t.getIndexInRange(l,p),w=t.getIndexInRange(l,v);return{startIndex:b-b%f,endIndex:w===m?m:w-w%f}}},{key:"getTextOfTick",value:function(r){var i=this.props,s=i.data,l=i.tickFormatter,c=i.dataKey,f=er(s[r],c,r);return tt(l)?l(f,r):f}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,s=i.slideMoveStartX,l=i.startX,c=i.endX,f=this.props,d=f.x,m=f.width,p=f.travellerWidth,v=f.startIndex,b=f.endIndex,w=f.onChange,S=r.pageX-s;S>0?S=Math.min(S,d+m-p-c,d+m-p-l):S<0&&(S=Math.max(S,d-l,d-c));var x=this.getIndex({startX:l+S,endX:c+S});(x.startIndex!==v||x.endIndex!==b)&&w&&w(x),this.setState({startX:l+S,endX:c+S,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var s=T3(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:s.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,s=i.brushMoveStartX,l=i.movingTravellerId,c=i.endX,f=i.startX,d=this.state[l],m=this.props,p=m.x,v=m.width,b=m.travellerWidth,w=m.onChange,S=m.gap,x=m.data,A={startX:this.state.startX,endX:this.state.endX},_=r.pageX-s;_>0?_=Math.min(_,p+v-b-d):_<0&&(_=Math.max(_,p-d)),A[l]=d+_;var M=this.getIndex(A),E=M.startIndex,O=M.endIndex,j=function(){var k=x.length-1;return l==="startX"&&(c>f?E%S===0:O%S===0)||cf?O%S===0:E%S===0)||c>f&&O===k};this.setState(Oi(Oi({},l,d+_),"brushMoveStartX",r.pageX),function(){w&&j()&&w(M)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var s=this,l=this.state,c=l.scaleValues,f=l.startX,d=l.endX,m=this.state[i],p=c.indexOf(m);if(p!==-1){var v=p+r;if(!(v===-1||v>=c.length)){var b=c[v];i==="startX"&&b>=d||i==="endX"&&b<=f||this.setState(Oi({},i,b),function(){s.props.onChange(s.getIndex({startX:s.state.startX,endX:s.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,s=r.y,l=r.width,c=r.height,f=r.fill,d=r.stroke;return Q.createElement("rect",{stroke:d,fill:f,x:i,y:s,width:l,height:c})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,s=r.y,l=r.width,c=r.height,f=r.data,d=r.children,m=r.padding,p=K.Children.only(d);return p?Q.cloneElement(p,{x:i,y:s,width:l,height:c,margin:m,compact:!0,data:f}):null}},{key:"renderTravellerLayer",value:function(r,i){var s,l,c=this,f=this.props,d=f.y,m=f.travellerWidth,p=f.height,v=f.traveller,b=f.ariaLabel,w=f.data,S=f.startIndex,x=f.endIndex,A=Math.max(r,this.props.x),_=Kw(Kw({},Je(this.props,!1)),{},{x:A,y:d,width:m,height:p}),M=b||"Min value: ".concat((s=w[S])===null||s===void 0?void 0:s.name,", Max value: ").concat((l=w[x])===null||l===void 0?void 0:l.name);return Q.createElement(Mt,{tabIndex:0,role:"slider","aria-label":M,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(O){["ArrowLeft","ArrowRight"].includes(O.key)&&(O.preventDefault(),O.stopPropagation(),c.handleTravellerMoveKeyboard(O.key==="ArrowRight"?1:-1,i))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(v,_))}},{key:"renderSlide",value:function(r,i){var s=this.props,l=s.y,c=s.height,f=s.stroke,d=s.travellerWidth,m=Math.min(r,i)+d,p=Math.max(Math.abs(i-r)-d,0);return Q.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:f,fillOpacity:.2,x:m,y:l,width:p,height:c})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,s=r.endIndex,l=r.y,c=r.height,f=r.travellerWidth,d=r.stroke,m=this.state,p=m.startX,v=m.endX,b=5,w={pointerEvents:"none",fill:d};return Q.createElement(Mt,{className:"recharts-brush-texts"},Q.createElement(uy,ky({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,v)-b,y:l+c/2},w),this.getTextOfTick(i)),Q.createElement(uy,ky({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,v)+f+b,y:l+c/2},w),this.getTextOfTick(s)))}},{key:"render",value:function(){var r=this.props,i=r.data,s=r.className,l=r.children,c=r.x,f=r.y,d=r.width,m=r.height,p=r.alwaysShowText,v=this.state,b=v.startX,w=v.endX,S=v.isTextActive,x=v.isSlideMoving,A=v.isTravellerMoving,_=v.isTravellerFocused;if(!i||!i.length||!Oe(c)||!Oe(f)||!Oe(d)||!Oe(m)||d<=0||m<=0)return null;var M=ut("recharts-brush",s),E=Q.Children.count(l)===1,O=ote("userSelect","none");return Q.createElement(Mt,{className:M,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:O},this.renderBackground(),E&&this.renderPanorama(),this.renderSlide(b,w),this.renderTravellerLayer(b,"startX"),this.renderTravellerLayer(w,"endX"),(S||x||A||_||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,s=r.y,l=r.width,c=r.height,f=r.stroke,d=Math.floor(s+c/2)-1;return Q.createElement(Q.Fragment,null,Q.createElement("rect",{x:i,y:s,width:l,height:c,fill:f,stroke:"none"}),Q.createElement("line",{x1:i+1,y1:d,x2:i+l-1,y2:d,fill:"none",stroke:"#fff"}),Q.createElement("line",{x1:i+1,y1:d+2,x2:i+l-1,y2:d+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var s;return Q.isValidElement(r)?s=Q.cloneElement(r,i):tt(r)?s=r(i):s=t.renderDefaultTraveller(i),s}},{key:"getDerivedStateFromProps",value:function(r,i){var s=r.data,l=r.width,c=r.x,f=r.travellerWidth,d=r.updateId,m=r.startIndex,p=r.endIndex;if(s!==i.prevData||d!==i.prevUpdateId)return Kw({prevData:s,prevTravellerWidth:f,prevUpdateId:d,prevX:c,prevWidth:l},s&&s.length?pte({data:s,width:l,x:c,travellerWidth:f,startIndex:m,endIndex:p}):{scale:null,scaleValues:null});if(i.scale&&(l!==i.prevWidth||c!==i.prevX||f!==i.prevTravellerWidth)){i.scale.range([c,c+l-f]);var v=i.scale.domain().map(function(b){return i.scale(b)});return{prevData:s,prevTravellerWidth:f,prevUpdateId:d,prevX:c,prevWidth:l,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:v}}return null}},{key:"getIndexInRange",value:function(r,i){for(var s=r.length,l=0,c=s-1;c-l>1;){var f=Math.floor((l+c)/2);r[f]>i?c=f:l=f}return i>=r[c]?c:l}}])})(K.PureComponent);Oi(vf,"displayName","Brush");Oi(vf,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Yw,E3;function mte(){if(E3)return Yw;E3=1;var e=gT();function t(n,r){var i;return e(n,function(s,l,c){return i=r(s,l,c),!i}),!!i}return Yw=t,Yw}var Xw,M3;function vte(){if(M3)return Xw;M3=1;var e=L$(),t=ul(),n=mte(),r=fi(),i=Sg();function s(l,c,f){var d=r(l)?e:n;return f&&i(l,c,f)&&(c=void 0),d(l,t(c,3))}return Xw=s,Xw}var yte=vte();const gte=Ft(yte);var Qa=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},Ww,j3;function bte(){if(j3)return Ww;j3=1;var e=eB();function t(n,r,i){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[r]=i}return Ww=t,Ww}var Qw,C3;function xte(){if(C3)return Qw;C3=1;var e=bte(),t=Z$(),n=ul();function r(i,s){var l={};return s=n(s,3),t(i,function(c,f,d){e(l,f,s(c,f,d))}),l}return Qw=r,Qw}var Ste=xte();const wte=Ft(Ste);var Zw,P3;function _te(){if(P3)return Zw;P3=1;function e(t,n){for(var r=-1,i=t==null?0:t.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Dte(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Rte(e,t){var n=e.x,r=e.y,i=Pte(e,Ete),s="".concat(n),l=parseInt(s,10),c="".concat(r),f=parseInt(c,10),d="".concat(t.height||i.height),m=parseInt(d,10),p="".concat(t.width||i.width),v=parseInt(p,10);return hh(hh(hh(hh(hh({},t),i),l?{x:l}:{}),f?{y:f}:{}),{},{height:m,width:v,name:t.name,radius:t.radius})}function k3(e){return Q.createElement(KA,XA({shapeType:"rectangle",propTransformer:Rte,activeClassName:"recharts-active-bar"},e))}var Nte=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof t=="number")return t;var s=Oe(r)||IH(r);return s?t(r,i):(s||Au(),n)}},kte=["value","background"],Eq;function yf(e){"@babel/helpers - typeof";return yf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yf(e)}function Lte(e,t){if(e==null)return{};var n=zte(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function zte(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function zy(){return zy=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(J)0&&Math.abs(ee)0&&(Z=Math.min((ue||0)-(ee[be-1]||0),Z))}),Number.isFinite(Z)){var J=Z/B,q=S.layout==="vertical"?r.height:r.width;if(S.padding==="gap"&&(R=J*q/2),S.padding==="no-gap"){var F=Su(t.barCategoryGap,J*q),ie=J*q/2;R=ie-F-(ie-F)/q*F}}}i==="xAxis"?k=[r.left+(M.left||0)+(R||0),r.left+r.width-(M.right||0)-(R||0)]:i==="yAxis"?k=f==="horizontal"?[r.top+r.height-(M.bottom||0),r.top+(M.top||0)]:[r.top+(M.top||0)+(R||0),r.top+r.height-(M.bottom||0)-(R||0)]:k=S.range,O&&(k=[k[1],k[0]]);var ce=iQ(S,s,v),U=ce.scale,D=ce.realScaleType;U.domain(A).range(k),aQ(U);var V=hQ(U,xa(xa({},S),{},{realScaleType:D}));i==="xAxis"?($=x==="top"&&!E||x==="bottom"&&E,z=r.left,G=p[j]-$*S.height):i==="yAxis"&&($=x==="left"&&!E||x==="right"&&E,z=p[j]-$*S.width,G=r.top);var X=xa(xa(xa({},S),V),{},{realScaleType:D,x:z,y:G,scale:U,width:i==="xAxis"?r.width:S.width,height:i==="yAxis"?r.height:S.height});return X.bandSize=Ay(X,V),!S.hide&&i==="xAxis"?p[j]+=($?-1:1)*X.height:S.hide||(p[j]+=($?-1:1)*X.width),xa(xa({},b),{},kg({},w,X))},{})},Dq=function(t,n){var r=t.x,i=t.y,s=n.x,l=n.y;return{x:Math.min(r,s),y:Math.min(i,l),width:Math.abs(s-r),height:Math.abs(l-i)}},Yte=function(t){var n=t.x1,r=t.y1,i=t.x2,s=t.y2;return Dq({x:n,y:r},{x:i,y:s})},Rq=(function(){function e(t){Fte(this,e),this.scale=t}return Gte(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,s=r.position;if(n!==void 0){if(s)switch(s){case"start":return this.scale(n);case"middle":{var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}case"end":{var c=this.bandwidth?this.bandwidth():0;return this.scale(n)+c}default:return this.scale(n)}if(i){var f=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+f}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],s=r[r.length-1];return i<=s?n>=i&&n<=s:n>=s&&n<=i}}],[{key:"create",value:function(n){return new e(n)}}])})();kg(Rq,"EPS",1e-4);var YT=function(t){var n=Object.keys(t).reduce(function(r,i){return xa(xa({},r),{},kg({},i,Rq.create(t[i])))},{});return xa(xa({},n),{},{apply:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=s.bandAware,c=s.position;return wte(i,function(f,d){return n[d].apply(f,{bandAware:l,position:c})})},isInRange:function(i){return Tq(i,function(s,l){return n[l].isInRange(s)})}})};function Xte(e){return(e%180+180)%180}var Wte=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=Xte(i),l=s*Math.PI/180,c=Math.atan(r/n),f=l>c&&l-1?f[d?s[m]:m]:void 0}}return t_=r,t_}var n_,I3;function Zte(){if(I3)return n_;I3=1;var e=wq();function t(n){var r=e(n),i=r%1;return r===r?i?r-i:r:0}return n_=t,n_}var r_,U3;function Jte(){if(U3)return r_;U3=1;var e=K$(),t=ul(),n=Zte(),r=Math.max;function i(s,l,c){var f=s==null?0:s.length;if(!f)return-1;var d=c==null?0:n(c);return d<0&&(d=r(f+d,0)),e(s,t(l,3),d)}return r_=i,r_}var i_,V3;function ene(){if(V3)return i_;V3=1;var e=Qte(),t=Jte(),n=e(t);return i_=n,i_}var tne=ene();const nne=Ft(tne);var rne=l$();const ine=Ft(rne);var ane=ine(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),XT=K.createContext(void 0),WT=K.createContext(void 0),Nq=K.createContext(void 0),kq=K.createContext({}),Lq=K.createContext(void 0),zq=K.createContext(0),$q=K.createContext(0),H3=function(t){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,s=n.offset,l=t.clipPathId,c=t.children,f=t.width,d=t.height,m=ane(s);return Q.createElement(XT.Provider,{value:r},Q.createElement(WT.Provider,{value:i},Q.createElement(kq.Provider,{value:s},Q.createElement(Nq.Provider,{value:m},Q.createElement(Lq.Provider,{value:l},Q.createElement(zq.Provider,{value:d},Q.createElement($q.Provider,{value:f},c)))))))},one=function(){return K.useContext(Lq)},Bq=function(t){var n=K.useContext(XT);n==null&&Au();var r=n[t];return r==null&&Au(),r},sne=function(){var t=K.useContext(XT);return Fs(t)},lne=function(){var t=K.useContext(WT),n=nne(t,function(r){return Tq(r.domain,Number.isFinite)});return n||Fs(t)},qq=function(t){var n=K.useContext(WT);n==null&&Au();var r=n[t];return r==null&&Au(),r},une=function(){var t=K.useContext(Nq);return t},cne=function(){return K.useContext(kq)},QT=function(){return K.useContext($q)},ZT=function(){return K.useContext(zq)};function gf(e){"@babel/helpers - typeof";return gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gf(e)}function fne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dne(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne*i)return!1;var s=n();return e*(t-e*s/2-r)>=0&&e*(t+e*s/2-i)<=0}function Kne(e,t){return Kq(e,t+1)}function Yne(e,t,n,r,i){for(var s=(r||[]).slice(),l=t.start,c=t.end,f=0,d=1,m=l,p=function(){var w=r==null?void 0:r[f];if(w===void 0)return{v:Kq(r,d)};var S=f,x,A=function(){return x===void 0&&(x=n(w,S)),x},_=w.coordinate,M=f===0||Uy(e,_,A,m,c);M||(f=0,m=l,d+=1),M&&(m=_+e*(A()/2+i),f+=d)},v;d<=s.length;)if(v=p(),v)return v.v;return[]}function wp(e){"@babel/helpers - typeof";return wp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wp(e)}function Z3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kr(e){for(var t=1;t0?b.coordinate-x*e:b.coordinate})}else s[v]=b=kr(kr({},b),{},{tickCoord:b.coordinate});var A=Uy(e,b.tickCoord,S,c,f);A&&(f=b.tickCoord-e*(S()/2+i),s[v]=kr(kr({},b),{},{isShow:!0}))},m=l-1;m>=0;m--)d(m);return s}function Jne(e,t,n,r,i,s){var l=(r||[]).slice(),c=l.length,f=t.start,d=t.end;if(s){var m=r[c-1],p=n(m,c-1),v=e*(m.coordinate+e*p/2-d);l[c-1]=m=kr(kr({},m),{},{tickCoord:v>0?m.coordinate-v*e:m.coordinate});var b=Uy(e,m.tickCoord,function(){return p},f,d);b&&(d=m.tickCoord-e*(p/2+i),l[c-1]=kr(kr({},m),{},{isShow:!0}))}for(var w=s?c-1:c,S=function(_){var M=l[_],E,O=function(){return E===void 0&&(E=n(M,_)),E};if(_===0){var j=e*(M.coordinate-e*O()/2-f);l[_]=M=kr(kr({},M),{},{tickCoord:j<0?M.coordinate-j*e:M.coordinate})}else l[_]=M=kr(kr({},M),{},{tickCoord:M.coordinate});var R=Uy(e,M.tickCoord,O,f,d);R&&(f=M.tickCoord+e*(O()/2+i),l[_]=kr(kr({},M),{},{isShow:!0}))},x=0;x=2?Oa(i[1].coordinate-i[0].coordinate):1,A=Gne(s,x,b);return f==="equidistantPreserveStart"?Yne(x,A,S,i,l):(f==="preserveStart"||f==="preserveStartEnd"?v=Jne(x,A,S,i,l,f==="preserveStartEnd"):v=Zne(x,A,S,i,l),v.filter(function(_){return _.isShow}))}var ere=["viewBox"],tre=["viewBox"],nre=["ticks"];function Sf(e){"@babel/helpers - typeof";return Sf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sf(e)}function Cc(){return Cc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function rre(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ire(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function e5(e,t){for(var n=0;n0?f(this.props):f(b)),l<=0||c<=0||!w||!w.length?null:Q.createElement(Mt,{className:ut("recharts-cartesian-axis",d),ref:function(x){r.layerReference=x}},s&&this.renderAxisLine(),this.renderTicks(w,this.state.fontSize,this.state.letterSpacing),zr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,s){var l,c=ut(i.className,"recharts-cartesian-axis-tick-value");return Q.isValidElement(r)?l=Q.cloneElement(r,Yn(Yn({},i),{},{className:c})):tt(r)?l=r(Yn(Yn({},i),{},{className:c})):l=Q.createElement(uy,Cc({},i,{className:"recharts-cartesian-axis-tick-value"}),s),l}}])})(K.Component);n2(Wf,"displayName","CartesianAxis");n2(Wf,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var fre=["x1","y1","x2","y2","key"],dre=["offset"];function Ou(e){"@babel/helpers - typeof";return Ou=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ou(e)}function t5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $r(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function vre(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var yre=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,i=t.x,s=t.y,l=t.width,c=t.height,f=t.ry;return Q.createElement("rect",{x:i,y:s,ry:f,width:l,height:c,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Wq(e,t){var n;if(Q.isValidElement(e))n=Q.cloneElement(e,t);else if(tt(e))n=e(t);else{var r=t.x1,i=t.y1,s=t.x2,l=t.y2,c=t.key,f=n5(t,fre),d=Je(f,!1);d.offset;var m=n5(d,dre);n=Q.createElement("line",tu({},m,{x1:r,y1:i,x2:s,y2:l,fill:"none",key:c}))}return n}function gre(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,s=e.horizontalPoints;if(!i||!s||!s.length)return null;var l=s.map(function(c,f){var d=$r($r({},e),{},{x1:t,y1:c,x2:t+n,y2:c,key:"line-".concat(f),index:f});return Wq(i,d)});return Q.createElement("g",{className:"recharts-cartesian-grid-horizontal"},l)}function bre(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,s=e.verticalPoints;if(!i||!s||!s.length)return null;var l=s.map(function(c,f){var d=$r($r({},e),{},{x1:c,y1:t,x2:c,y2:t+n,key:"line-".concat(f),index:f});return Wq(i,d)});return Q.createElement("g",{className:"recharts-cartesian-grid-vertical"},l)}function xre(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,s=e.width,l=e.height,c=e.horizontalPoints,f=e.horizontal,d=f===void 0?!0:f;if(!d||!t||!t.length)return null;var m=c.map(function(v){return Math.round(v+i-i)}).sort(function(v,b){return v-b});i!==m[0]&&m.unshift(0);var p=m.map(function(v,b){var w=!m[b+1],S=w?i+l-v:m[b+1]-v;if(S<=0)return null;var x=b%t.length;return Q.createElement("rect",{key:"react-".concat(b),y:v,x:r,height:S,width:s,stroke:"none",fill:t[x],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return Q.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function Sre(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,s=e.x,l=e.y,c=e.width,f=e.height,d=e.verticalPoints;if(!n||!r||!r.length)return null;var m=d.map(function(v){return Math.round(v+s-s)}).sort(function(v,b){return v-b});s!==m[0]&&m.unshift(0);var p=m.map(function(v,b){var w=!m[b+1],S=w?s+c-v:m[b+1]-v;if(S<=0)return null;var x=b%r.length;return Q.createElement("rect",{key:"react-".concat(b),x:v,y:l,width:S,height:f,stroke:"none",fill:r[x],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return Q.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var wre=function(t,n){var r=t.xAxis,i=t.width,s=t.height,l=t.offset;return uq(t2($r($r($r({},Wf.defaultProps),r),{},{ticks:$o(r,!0),viewBox:{x:0,y:0,width:i,height:s}})),l.left,l.left+l.width,n)},_re=function(t,n){var r=t.yAxis,i=t.width,s=t.height,l=t.offset;return uq(t2($r($r($r({},Wf.defaultProps),r),{},{ticks:$o(r,!0),viewBox:{x:0,y:0,width:i,height:s}})),l.top,l.top+l.height,n)},_c={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Ip(e){var t,n,r,i,s,l,c=QT(),f=ZT(),d=cne(),m=$r($r({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:_c.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:_c.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:_c.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:_c.horizontalFill,vertical:(s=e.vertical)!==null&&s!==void 0?s:_c.vertical,verticalFill:(l=e.verticalFill)!==null&&l!==void 0?l:_c.verticalFill,x:Oe(e.x)?e.x:d.left,y:Oe(e.y)?e.y:d.top,width:Oe(e.width)?e.width:d.width,height:Oe(e.height)?e.height:d.height}),p=m.x,v=m.y,b=m.width,w=m.height,S=m.syncWithTicks,x=m.horizontalValues,A=m.verticalValues,_=sne(),M=lne();if(!Oe(b)||b<=0||!Oe(w)||w<=0||!Oe(p)||p!==+p||!Oe(v)||v!==+v)return null;var E=m.verticalCoordinatesGenerator||wre,O=m.horizontalCoordinatesGenerator||_re,j=m.horizontalPoints,R=m.verticalPoints;if((!j||!j.length)&&tt(O)){var k=x&&x.length,z=O({yAxis:M?$r($r({},M),{},{ticks:k?x:M.ticks}):void 0,width:c,height:f,offset:d},k?!0:S);qo(Array.isArray(z),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Ou(z),"]")),Array.isArray(z)&&(j=z)}if((!R||!R.length)&&tt(E)){var G=A&&A.length,$=E({xAxis:_?$r($r({},_),{},{ticks:G?A:_.ticks}):void 0,width:c,height:f,offset:d},G?!0:S);qo(Array.isArray($),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Ou($),"]")),Array.isArray($)&&(R=$)}return Q.createElement("g",{className:"recharts-cartesian-grid"},Q.createElement(yre,{fill:m.fill,fillOpacity:m.fillOpacity,x:m.x,y:m.y,width:m.width,height:m.height,ry:m.ry}),Q.createElement(gre,tu({},m,{offset:d,horizontalPoints:j,xAxis:_,yAxis:M})),Q.createElement(bre,tu({},m,{offset:d,verticalPoints:R,xAxis:_,yAxis:M})),Q.createElement(xre,tu({},m,{horizontalPoints:j})),Q.createElement(Sre,tu({},m,{verticalPoints:R})))}Ip.displayName="CartesianGrid";var Are=["type","layout","connectNulls","ref"],Ore=["key"];function wf(e){"@babel/helpers - typeof";return wf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wf(e)}function r5(e,t){if(e==null)return{};var n=Tre(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Tre(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ph(){return Ph=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);np){b=[].concat(Ac(f.slice(0,w)),[p-S]);break}var x=b.length%2===0?[0,v]:[v];return[].concat(Ac(t.repeat(f,m)),Ac(b),x).map(function(A){return"".concat(A,"px")}).join(", ")}),Sa(n,"id",Mu("recharts-line-")),Sa(n,"pathRef",function(l){n.mainCurve=l}),Sa(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Sa(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return Lre(t,e),Dre(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.points,c=s.xAxis,f=s.yAxis,d=s.layout,m=s.children,p=ci(m,Xf);if(!p)return null;var v=function(S,x){return{x:S.x,y:S.y,value:S.value,errorVal:er(S.payload,x)}},b={clipPath:r?"url(#clipPath-".concat(i,")"):null};return Q.createElement(Mt,b,p.map(function(w){return Q.cloneElement(w,{key:"bar-".concat(w.props.dataKey),data:l,xAxis:c,yAxis:f,layout:d,dataPointFormatter:v})}))}},{key:"renderDots",value:function(r,i,s){var l=this.props.isAnimationActive;if(l&&!this.state.isAnimationFinished)return null;var c=this.props,f=c.dot,d=c.points,m=c.dataKey,p=Je(this.props,!1),v=Je(f,!0),b=d.map(function(S,x){var A=_i(_i(_i({key:"dot-".concat(x),r:3},p),v),{},{index:x,cx:S.x,cy:S.y,value:S.value,dataKey:m,payload:S.payload,points:d});return t.renderDotItem(f,A)}),w={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(s,")"):null};return Q.createElement(Mt,Ph({className:"recharts-line-dots",key:"dots"},w),b)}},{key:"renderCurveStatically",value:function(r,i,s,l){var c=this.props,f=c.type,d=c.layout,m=c.connectNulls;c.ref;var p=r5(c,Are),v=_i(_i(_i({},Je(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(s,")"):null,points:r},l),{},{type:f,layout:d,connectNulls:m});return Q.createElement(mu,Ph({},v,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var s=this,l=this.props,c=l.points,f=l.strokeDasharray,d=l.isAnimationActive,m=l.animationBegin,p=l.animationDuration,v=l.animationEasing,b=l.animationId,w=l.animateNewValues,S=l.width,x=l.height,A=this.state,_=A.prevPoints,M=A.totalLength;return Q.createElement(Ta,{begin:m,duration:p,isActive:d,easing:v,from:{t:0},to:{t:1},key:"line-".concat(b),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(E){var O=E.t;if(_){var j=_.length/c.length,R=c.map(function(B,Z){var ee=Math.floor(Z*j);if(_[ee]){var J=_[ee],q=Rn(J.x,B.x),F=Rn(J.y,B.y);return _i(_i({},B),{},{x:q(O),y:F(O)})}if(w){var ie=Rn(S*2,B.x),ce=Rn(x/2,B.y);return _i(_i({},B),{},{x:ie(O),y:ce(O)})}return _i(_i({},B),{},{x:B.x,y:B.y})});return s.renderCurveStatically(R,r,i)}var k=Rn(0,M),z=k(O),G;if(f){var $="".concat(f).split(/[,\s]+/gim).map(function(B){return parseFloat(B)});G=s.getStrokeDasharray(z,M,$)}else G=s.generateSimpleStrokeDasharray(M,z);return s.renderCurveStatically(c,r,i,{strokeDasharray:G})})}},{key:"renderCurve",value:function(r,i){var s=this.props,l=s.points,c=s.isAnimationActive,f=this.state,d=f.prevPoints,m=f.totalLength;return c&&l&&l.length&&(!d&&m>0||!wu(d,l))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(l,r,i)}},{key:"render",value:function(){var r,i=this.props,s=i.hide,l=i.dot,c=i.points,f=i.className,d=i.xAxis,m=i.yAxis,p=i.top,v=i.left,b=i.width,w=i.height,S=i.isAnimationActive,x=i.id;if(s||!c||!c.length)return null;var A=this.state.isAnimationFinished,_=c.length===1,M=ut("recharts-line",f),E=d&&d.allowDataOverflow,O=m&&m.allowDataOverflow,j=E||O,R=Qe(x)?this.id:x,k=(r=Je(l,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},z=k.r,G=z===void 0?3:z,$=k.strokeWidth,B=$===void 0?2:$,Z=h$(l)?l:{},ee=Z.clipDot,J=ee===void 0?!0:ee,q=G*2+B;return Q.createElement(Mt,{className:M},E||O?Q.createElement("defs",null,Q.createElement("clipPath",{id:"clipPath-".concat(R)},Q.createElement("rect",{x:E?v:v-b/2,y:O?p:p-w/2,width:E?b:b*2,height:O?w:w*2})),!J&&Q.createElement("clipPath",{id:"clipPath-dots-".concat(R)},Q.createElement("rect",{x:v-q/2,y:p-q/2,width:b+q,height:w+q}))):null,!_&&this.renderCurve(j,R),this.renderErrorBar(j,R),(_||l)&&this.renderDots(j,J,R),(!S||A)&&Wa.renderCallByParent(this.props,c))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var s=r.length%2!==0?[].concat(Ac(r),[0]):r,l=[],c=0;c=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qre(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function nu(){return nu=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!wu(m,l)||!wu(p,c))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(l,c,r,i)}},{key:"render",value:function(){var r,i=this.props,s=i.hide,l=i.dot,c=i.points,f=i.className,d=i.top,m=i.left,p=i.xAxis,v=i.yAxis,b=i.width,w=i.height,S=i.isAnimationActive,x=i.id;if(s||!c||!c.length)return null;var A=this.state.isAnimationFinished,_=c.length===1,M=ut("recharts-area",f),E=p&&p.allowDataOverflow,O=v&&v.allowDataOverflow,j=E||O,R=Qe(x)?this.id:x,k=(r=Je(l,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},z=k.r,G=z===void 0?3:z,$=k.strokeWidth,B=$===void 0?2:$,Z=h$(l)?l:{},ee=Z.clipDot,J=ee===void 0?!0:ee,q=G*2+B;return Q.createElement(Mt,{className:M},E||O?Q.createElement("defs",null,Q.createElement("clipPath",{id:"clipPath-".concat(R)},Q.createElement("rect",{x:E?m:m-b/2,y:O?d:d-w/2,width:E?b:b*2,height:O?w:w*2})),!J&&Q.createElement("clipPath",{id:"clipPath-dots-".concat(R)},Q.createElement("rect",{x:m-q/2,y:d-q/2,width:b+q,height:w+q}))):null,_?null:this.renderArea(j,R),(l||_)&&this.renderDots(j,J,R),(!S||A)&&Wa.renderCallByParent(this.props,c))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:r.points!==i.curPoints||r.baseLine!==i.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])})(K.PureComponent);Jq=Du;Ka(Du,"displayName","Area");Ka(Du,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!cl.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Ka(Du,"getBaseValue",function(e,t,n,r){var i=e.layout,s=e.baseValue,l=t.props.baseValue,c=l??s;if(Oe(c)&&typeof c=="number")return c;var f=i==="horizontal"?r:n,d=f.scale.domain();if(f.type==="number"){var m=Math.max(d[0],d[1]),p=Math.min(d[0],d[1]);return c==="dataMin"?p:c==="dataMax"||m<0?m:Math.max(Math.min(d[0],d[1]),0)}return c==="dataMin"?d[0]:c==="dataMax"?d[1]:d[0]});Ka(Du,"getComposedData",function(e){var t=e.props,n=e.item,r=e.xAxis,i=e.yAxis,s=e.xAxisTicks,l=e.yAxisTicks,c=e.bandSize,f=e.dataKey,d=e.stackedData,m=e.dataStartIndex,p=e.displayedData,v=e.offset,b=t.layout,w=d&&d.length,S=Jq.getBaseValue(t,n,r,i),x=b==="horizontal",A=!1,_=p.map(function(E,O){var j;w?j=d[m+O]:(j=er(E,f),Array.isArray(j)?A=!0:j=[S,j]);var R=j[1]==null||w&&er(E,f)==null;return x?{x:hf({axis:r,ticks:s,bandSize:c,entry:E,index:O}),y:R?null:i.scale(j[1]),value:j,payload:E}:{x:R?null:r.scale(j[1]),y:hf({axis:i,ticks:l,bandSize:c,entry:E,index:O}),value:j,payload:E}}),M;return w||A?M=_.map(function(E){var O=Array.isArray(E.value)?E.value[0]:null;return x?{x:E.x,y:O!=null&&E.y!=null?i.scale(O):null}:{x:O!=null?r.scale(O):null,y:E.y}}):M=x?i.scale(S):r.scale(S),Is({points:_,baseLine:M,layout:b,isRange:A},v)});Ka(Du,"renderDotItem",function(e,t){var n;if(Q.isValidElement(e))n=Q.cloneElement(e,t);else if(tt(e))n=e(t);else{var r=ut("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,s=e4(t,Bre);n=Q.createElement(Dg,nu({},s,{key:i,className:r}))}return n});function Af(e){"@babel/helpers - typeof";return Af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Af(e)}function Yre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xre(e,t){for(var n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function iie(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function aie(e){var t=e.option,n=e.isActive,r=rie(e,nie);return typeof t=="string"?K.createElement(KA,Dh({option:K.createElement(gg,Dh({type:t},r)),isActive:n,shapeType:"symbols"},r)):K.createElement(KA,Dh({option:t,isActive:n,shapeType:"symbols"},r))}function Of(e){"@babel/helpers - typeof";return Of=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Of(e)}function Rh(){return Rh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function nae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rae(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?l:t&&t.length&&Oe(i)&&Oe(s)?t.slice(i,s+1):[]};function x4(e){return e==="number"?[0,"auto"]:void 0}var yO=function(t,n,r,i){var s=t.graphicalItems,l=t.tooltipAxis,c=Ug(n,t);return r<0||!s||!s.length||r>=c.length?null:s.reduce(function(f,d){var m,p=(m=d.props.data)!==null&&m!==void 0?m:n;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var v;if(l.dataKey&&!l.allowDuplicatedCategory){var b=p===void 0?c:p;v=Qv(b,l.dataKey,i)}else v=p&&p[r]||c[r];return v?[].concat(jf(f),[fq(d,v)]):f},[])},v5=function(t,n,r,i){var s=i||{x:t.chartX,y:t.chartY},l=mae(s,r),c=t.orderedTooltipTicks,f=t.tooltipAxis,d=t.tooltipTicks,m=ZW(l,c,d,f);if(m>=0&&d){var p=d[m]&&d[m].value,v=yO(t,n,m,p),b=vae(r,c,m,s);return{activeTooltipIndex:m,activeLabel:p,activePayload:v,activeCoordinate:b}}return null},yae=function(t,n){var r=n.axes,i=n.graphicalItems,s=n.axisType,l=n.axisIdKey,c=n.stackGroups,f=n.dataStartIndex,d=n.dataEndIndex,m=t.layout,p=t.children,v=t.stackOffset,b=lq(m,s);return r.reduce(function(w,S){var x,A=S.type.defaultProps!==void 0?me(me({},S.type.defaultProps),S.props):S.props,_=A.type,M=A.dataKey,E=A.allowDataOverflow,O=A.allowDuplicatedCategory,j=A.scale,R=A.ticks,k=A.includeHidden,z=A[l];if(w[z])return w;var G=Ug(t.data,{graphicalItems:i.filter(function(V){var X,ue=l in V.props?V.props[l]:(X=V.type.defaultProps)===null||X===void 0?void 0:X[l];return ue===z}),dataStartIndex:f,dataEndIndex:d}),$=G.length,B,Z,ee;Vie(A.domain,E,_)&&(B=PA(A.domain,null,E),b&&(_==="number"||j!=="auto")&&(ee=jh(G,M,"category")));var J=x4(_);if(!B||B.length===0){var q,F=(q=A.domain)!==null&&q!==void 0?q:J;if(M){if(B=jh(G,M,_),_==="category"&&b){var ie=VH(B);O&&ie?(Z=B,B=Ny(0,$)):O||(B=Tk(F,B,S).reduce(function(V,X){return V.indexOf(X)>=0?V:[].concat(jf(V),[X])},[]))}else if(_==="category")O?B=B.filter(function(V){return V!==""&&!Qe(V)}):B=Tk(F,B,S).reduce(function(V,X){return V.indexOf(X)>=0||X===""||Qe(X)?V:[].concat(jf(V),[X])},[]);else if(_==="number"){var ce=rQ(G,i.filter(function(V){var X,ue,be=l in V.props?V.props[l]:(X=V.type.defaultProps)===null||X===void 0?void 0:X[l],Se="hide"in V.props?V.props.hide:(ue=V.type.defaultProps)===null||ue===void 0?void 0:ue.hide;return be===z&&(k||!Se)}),M,s,m);ce&&(B=ce)}b&&(_==="number"||j!=="auto")&&(ee=jh(G,M,"category"))}else b?B=Ny(0,$):c&&c[z]&&c[z].hasStack&&_==="number"?B=v==="expand"?[0,1]:cq(c[z].stackGroups,f,d):B=sq(G,i.filter(function(V){var X=l in V.props?V.props[l]:V.type.defaultProps[l],ue="hide"in V.props?V.props.hide:V.type.defaultProps.hide;return X===z&&(k||!ue)}),_,m,!0);if(_==="number")B=pO(p,B,z,s,R),F&&(B=PA(F,B,E));else if(_==="category"&&F){var U=F,D=B.every(function(V){return U.indexOf(V)>=0});D&&(B=U)}}return me(me({},w),{},Fe({},z,me(me({},A),{},{axisType:s,domain:B,categoricalDomain:ee,duplicateDomain:Z,originalDomain:(x=A.domain)!==null&&x!==void 0?x:J,isCategorical:b,layout:m})))},{})},gae=function(t,n){var r=n.graphicalItems,i=n.Axis,s=n.axisType,l=n.axisIdKey,c=n.stackGroups,f=n.dataStartIndex,d=n.dataEndIndex,m=t.layout,p=t.children,v=Ug(t.data,{graphicalItems:r,dataStartIndex:f,dataEndIndex:d}),b=v.length,w=lq(m,s),S=-1;return r.reduce(function(x,A){var _=A.type.defaultProps!==void 0?me(me({},A.type.defaultProps),A.props):A.props,M=_[l],E=x4("number");if(!x[M]){S++;var O;return w?O=Ny(0,b):c&&c[M]&&c[M].hasStack?(O=cq(c[M].stackGroups,f,d),O=pO(p,O,M,s)):(O=PA(E,sq(v,r.filter(function(j){var R,k,z=l in j.props?j.props[l]:(R=j.type.defaultProps)===null||R===void 0?void 0:R[l],G="hide"in j.props?j.props.hide:(k=j.type.defaultProps)===null||k===void 0?void 0:k.hide;return z===M&&!G}),"number",m),i.defaultProps.allowDataOverflow),O=pO(p,O,M,s)),me(me({},x),{},Fe({},M,me(me({axisType:s},i.defaultProps),{},{hide:!0,orientation:ia(hae,"".concat(s,".").concat(S%2),null),domain:O,originalDomain:E,isCategorical:w,layout:m})))}return x},{})},bae=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,s=n.AxisComp,l=n.graphicalItems,c=n.stackGroups,f=n.dataStartIndex,d=n.dataEndIndex,m=t.children,p="".concat(i,"Id"),v=ci(m,s),b={};return v&&v.length?b=yae(t,{axes:v,graphicalItems:l,axisType:i,axisIdKey:p,stackGroups:c,dataStartIndex:f,dataEndIndex:d}):l&&l.length&&(b=gae(t,{Axis:s,graphicalItems:l,axisType:i,axisIdKey:p,stackGroups:c,dataStartIndex:f,dataEndIndex:d})),b},xae=function(t){var n=Fs(t),r=$o(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:bT(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Ay(n,r)}},y5=function(t){var n=t.children,r=t.defaultShowTooltip,i=Ti(n,vf),s=0,l=0;return t.data&&t.data.length!==0&&(l=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(s=i.props.startIndex),i.props.endIndex>=0&&(l=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:s,dataEndIndex:l,activeTooltipIndex:-1,isTooltipActive:!!r}},Sae=function(t){return!t||!t.length?!1:t.some(function(n){var r=Bo(n&&n.type);return r&&r.indexOf("Bar")>=0})},g5=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},wae=function(t,n){var r=t.props,i=t.graphicalItems,s=t.xAxisMap,l=s===void 0?{}:s,c=t.yAxisMap,f=c===void 0?{}:c,d=r.width,m=r.height,p=r.children,v=r.margin||{},b=Ti(p,vf),w=Ti(p,Bc),S=Object.keys(f).reduce(function(O,j){var R=f[j],k=R.orientation;return!R.mirror&&!R.hide?me(me({},O),{},Fe({},k,O[k]+R.width)):O},{left:v.left||0,right:v.right||0}),x=Object.keys(l).reduce(function(O,j){var R=l[j],k=R.orientation;return!R.mirror&&!R.hide?me(me({},O),{},Fe({},k,ia(O,"".concat(k))+R.height)):O},{top:v.top||0,bottom:v.bottom||0}),A=me(me({},x),S),_=A.bottom;b&&(A.bottom+=b.props.height||vf.defaultProps.height),w&&n&&(A=tQ(A,i,r,n));var M=d-A.left-A.right,E=m-A.top-A.bottom;return me(me({brushBottom:_},A),{},{width:Math.max(M,0),height:Math.max(E,0)})},_ae=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},S4=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,s=i===void 0?"axis":i,l=t.validateTooltipEventTypes,c=l===void 0?["axis"]:l,f=t.axisComponents,d=t.legendContent,m=t.formatAxisMap,p=t.defaultProps,v=function(A,_){var M=_.graphicalItems,E=_.stackGroups,O=_.offset,j=_.updateId,R=_.dataStartIndex,k=_.dataEndIndex,z=A.barSize,G=A.layout,$=A.barGap,B=A.barCategoryGap,Z=A.maxBarSize,ee=g5(G),J=ee.numericAxisName,q=ee.cateAxisName,F=Sae(M),ie=[];return M.forEach(function(ce,U){var D=Ug(A.data,{graphicalItems:[ce],dataStartIndex:R,dataEndIndex:k}),V=ce.type.defaultProps!==void 0?me(me({},ce.type.defaultProps),ce.props):ce.props,X=V.dataKey,ue=V.maxBarSize,be=V["".concat(J,"Id")],Se=V["".concat(q,"Id")],ye={},Me=f.reduce(function(kn,Tn){var Br=_["".concat(Tn.axisType,"Map")],ze=V["".concat(Tn.axisType,"Id")];Br&&Br[ze]||Tn.axisType==="zAxis"||Au();var je=Br[ze];return me(me({},kn),{},Fe(Fe({},Tn.axisType,je),"".concat(Tn.axisType,"Ticks"),$o(je)))},ye),de=Me[q],_e=Me["".concat(q,"Ticks")],Ee=E&&E[be]&&E[be].hasStack&&mQ(ce,E[be].stackGroups),he=Bo(ce.type).indexOf("Bar")>=0,Ie=Ay(de,_e),Te=[],We=F&&JW({barSize:z,stackGroups:E,totalSize:_ae(Me,q)});if(he){var nt,yt,Qt=Qe(ue)?Z:ue,Zt=(nt=(yt=Ay(de,_e,!0))!==null&&yt!==void 0?yt:Qt)!==null&&nt!==void 0?nt:0;Te=eQ({barGap:$,barCategoryGap:B,bandSize:Zt!==Ie?Zt:Ie,sizeList:We[Se],maxBarSize:Qt}),Zt!==Ie&&(Te=Te.map(function(kn){return me(me({},kn),{},{position:me(me({},kn.position),{},{offset:kn.position.offset-Zt/2})})}))}var pt=ce&&ce.type&&ce.type.getComposedData;pt&&ie.push({props:me(me({},pt(me(me({},Me),{},{displayedData:D,props:A,dataKey:X,item:ce,bandSize:Ie,barPosition:Te,offset:O,stackedData:Ee,layout:G,dataStartIndex:R,dataEndIndex:k}))),{},Fe(Fe(Fe({key:ce.key||"item-".concat(U)},J,Me[J]),q,Me[q]),"animationId",j)),childIndex:nF(ce,A.children),item:ce})}),ie},b=function(A,_){var M=A.props,E=A.dataStartIndex,O=A.dataEndIndex,j=A.updateId;if(!IP({props:M}))return null;var R=M.children,k=M.layout,z=M.stackOffset,G=M.data,$=M.reverseStackOrder,B=g5(k),Z=B.numericAxisName,ee=B.cateAxisName,J=ci(R,r),q=dQ(G,J,"".concat(Z,"Id"),"".concat(ee,"Id"),z,$),F=f.reduce(function(V,X){var ue="".concat(X.axisType,"Map");return me(me({},V),{},Fe({},ue,bae(M,me(me({},X),{},{graphicalItems:J,stackGroups:X.axisType===Z&&q,dataStartIndex:E,dataEndIndex:O}))))},{}),ie=wae(me(me({},F),{},{props:M,graphicalItems:J}),_==null?void 0:_.legendBBox);Object.keys(F).forEach(function(V){F[V]=m(M,F[V],ie,V.replace("Map",""),n)});var ce=F["".concat(ee,"Map")],U=xae(ce),D=v(M,me(me({},F),{},{dataStartIndex:E,dataEndIndex:O,updateId:j,graphicalItems:J,stackGroups:q,offset:ie}));return me(me({formattedGraphicalItems:D,graphicalItems:J,offset:ie,stackGroups:q},U),F)},w=(function(x){function A(_){var M,E,O;return nae(this,A),O=aae(this,A,[_]),Fe(O,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Fe(O,"accessibilityManager",new Uie),Fe(O,"handleLegendBBoxUpdate",function(j){if(j){var R=O.state,k=R.dataStartIndex,z=R.dataEndIndex,G=R.updateId;O.setState(me({legendBBox:j},b({props:O.props,dataStartIndex:k,dataEndIndex:z,updateId:G},me(me({},O.state),{},{legendBBox:j}))))}}),Fe(O,"handleReceiveSyncEvent",function(j,R,k){if(O.props.syncId===j){if(k===O.eventEmitterSymbol&&typeof O.props.syncMethod!="function")return;O.applySyncEvent(R)}}),Fe(O,"handleBrushChange",function(j){var R=j.startIndex,k=j.endIndex;if(R!==O.state.dataStartIndex||k!==O.state.dataEndIndex){var z=O.state.updateId;O.setState(function(){return me({dataStartIndex:R,dataEndIndex:k},b({props:O.props,dataStartIndex:R,dataEndIndex:k,updateId:z},O.state))}),O.triggerSyncEvent({dataStartIndex:R,dataEndIndex:k})}}),Fe(O,"handleMouseEnter",function(j){var R=O.getMouseInfo(j);if(R){var k=me(me({},R),{},{isTooltipActive:!0});O.setState(k),O.triggerSyncEvent(k);var z=O.props.onMouseEnter;tt(z)&&z(k,j)}}),Fe(O,"triggeredAfterMouseMove",function(j){var R=O.getMouseInfo(j),k=R?me(me({},R),{},{isTooltipActive:!0}):{isTooltipActive:!1};O.setState(k),O.triggerSyncEvent(k);var z=O.props.onMouseMove;tt(z)&&z(k,j)}),Fe(O,"handleItemMouseEnter",function(j){O.setState(function(){return{isTooltipActive:!0,activeItem:j,activePayload:j.tooltipPayload,activeCoordinate:j.tooltipPosition||{x:j.cx,y:j.cy}}})}),Fe(O,"handleItemMouseLeave",function(){O.setState(function(){return{isTooltipActive:!1}})}),Fe(O,"handleMouseMove",function(j){j.persist(),O.throttleTriggeredAfterMouseMove(j)}),Fe(O,"handleMouseLeave",function(j){O.throttleTriggeredAfterMouseMove.cancel();var R={isTooltipActive:!1};O.setState(R),O.triggerSyncEvent(R);var k=O.props.onMouseLeave;tt(k)&&k(R,j)}),Fe(O,"handleOuterEvent",function(j){var R=tF(j),k=ia(O.props,"".concat(R));if(R&&tt(k)){var z,G;/.*touch.*/i.test(R)?G=O.getMouseInfo(j.changedTouches[0]):G=O.getMouseInfo(j),k((z=G)!==null&&z!==void 0?z:{},j)}}),Fe(O,"handleClick",function(j){var R=O.getMouseInfo(j);if(R){var k=me(me({},R),{},{isTooltipActive:!0});O.setState(k),O.triggerSyncEvent(k);var z=O.props.onClick;tt(z)&&z(k,j)}}),Fe(O,"handleMouseDown",function(j){var R=O.props.onMouseDown;if(tt(R)){var k=O.getMouseInfo(j);R(k,j)}}),Fe(O,"handleMouseUp",function(j){var R=O.props.onMouseUp;if(tt(R)){var k=O.getMouseInfo(j);R(k,j)}}),Fe(O,"handleTouchMove",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&O.throttleTriggeredAfterMouseMove(j.changedTouches[0])}),Fe(O,"handleTouchStart",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&O.handleMouseDown(j.changedTouches[0])}),Fe(O,"handleTouchEnd",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&O.handleMouseUp(j.changedTouches[0])}),Fe(O,"handleDoubleClick",function(j){var R=O.props.onDoubleClick;if(tt(R)){var k=O.getMouseInfo(j);R(k,j)}}),Fe(O,"handleContextMenu",function(j){var R=O.props.onContextMenu;if(tt(R)){var k=O.getMouseInfo(j);R(k,j)}}),Fe(O,"triggerSyncEvent",function(j){O.props.syncId!==void 0&&s_.emit(l_,O.props.syncId,j,O.eventEmitterSymbol)}),Fe(O,"applySyncEvent",function(j){var R=O.props,k=R.layout,z=R.syncMethod,G=O.state.updateId,$=j.dataStartIndex,B=j.dataEndIndex;if(j.dataStartIndex!==void 0||j.dataEndIndex!==void 0)O.setState(me({dataStartIndex:$,dataEndIndex:B},b({props:O.props,dataStartIndex:$,dataEndIndex:B,updateId:G},O.state)));else if(j.activeTooltipIndex!==void 0){var Z=j.chartX,ee=j.chartY,J=j.activeTooltipIndex,q=O.state,F=q.offset,ie=q.tooltipTicks;if(!F)return;if(typeof z=="function")J=z(ie,j);else if(z==="value"){J=-1;for(var ce=0;ce=0){var Ee,he;if(Z.dataKey&&!Z.allowDuplicatedCategory){var Ie=typeof Z.dataKey=="function"?_e:"payload.".concat(Z.dataKey.toString());Ee=Qv(ce,Ie,J),he=U&&D&&Qv(D,Ie,J)}else Ee=ce==null?void 0:ce[ee],he=U&&D&&D[ee];if(Se||be){var Te=j.props.activeIndex!==void 0?j.props.activeIndex:ee;return[K.cloneElement(j,me(me(me({},z.props),Me),{},{activeIndex:Te})),null,null]}if(!Qe(Ee))return[de].concat(jf(O.renderActivePoints({item:z,activePoint:Ee,basePoint:he,childIndex:ee,isRange:U})))}else{var We,nt=(We=O.getItemByXY(O.state.activeCoordinate))!==null&&We!==void 0?We:{graphicalItem:de},yt=nt.graphicalItem,Qt=yt.item,Zt=Qt===void 0?j:Qt,pt=yt.childIndex,kn=me(me(me({},z.props),Me),{},{activeIndex:pt});return[K.cloneElement(Zt,kn),null,null]}return U?[de,null,null]:[de,null]}),Fe(O,"renderCustomized",function(j,R,k){return K.cloneElement(j,me(me({key:"recharts-customized-".concat(k)},O.props),O.state))}),Fe(O,"renderMap",{CartesianGrid:{handler:Cv,once:!0},ReferenceArea:{handler:O.renderReferenceElement},ReferenceLine:{handler:Cv},ReferenceDot:{handler:O.renderReferenceElement},XAxis:{handler:Cv},YAxis:{handler:Cv},Brush:{handler:O.renderBrush,once:!0},Bar:{handler:O.renderGraphicChild},Line:{handler:O.renderGraphicChild},Area:{handler:O.renderGraphicChild},Radar:{handler:O.renderGraphicChild},RadialBar:{handler:O.renderGraphicChild},Scatter:{handler:O.renderGraphicChild},Pie:{handler:O.renderGraphicChild},Funnel:{handler:O.renderGraphicChild},Tooltip:{handler:O.renderCursor,once:!0},PolarGrid:{handler:O.renderPolarGrid,once:!0},PolarAngleAxis:{handler:O.renderPolarAxis},PolarRadiusAxis:{handler:O.renderPolarAxis},Customized:{handler:O.renderCustomized}}),O.clipPathId="".concat((M=_.id)!==null&&M!==void 0?M:Mu("recharts"),"-clip"),O.throttleTriggeredAfterMouseMove=oB(O.triggeredAfterMouseMove,(E=_.throttleDelay)!==null&&E!==void 0?E:1e3/60),O.state={},O}return lae(A,x),iae(A,[{key:"componentDidMount",value:function(){var M,E;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(M=this.props.margin.left)!==null&&M!==void 0?M:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var M=this.props,E=M.children,O=M.data,j=M.height,R=M.layout,k=Ti(E,ji);if(k){var z=k.props.defaultIndex;if(!(typeof z!="number"||z<0||z>this.state.tooltipTicks.length-1)){var G=this.state.tooltipTicks[z]&&this.state.tooltipTicks[z].value,$=yO(this.state,O,z,G),B=this.state.tooltipTicks[z].coordinate,Z=(this.state.offset.top+j)/2,ee=R==="horizontal",J=ee?{x:B,y:Z}:{y:B,x:Z},q=this.state.formattedGraphicalItems.find(function(ie){var ce=ie.item;return ce.type.name==="Scatter"});q&&(J=me(me({},J),q.props.points[z].tooltipPosition),$=q.props.points[z].tooltipPayload);var F={activeTooltipIndex:z,isTooltipActive:!0,activeLabel:G,activePayload:$,activeCoordinate:J};this.setState(F),this.renderCursor(k),this.accessibilityManager.setIndex(z)}}}},{key:"getSnapshotBeforeUpdate",value:function(M,E){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==E.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==M.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==M.margin){var O,j;this.accessibilityManager.setDetails({offset:{left:(O=this.props.margin.left)!==null&&O!==void 0?O:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0}})}return null}},{key:"componentDidUpdate",value:function(M){J_([Ti(M.children,ji)],[Ti(this.props.children,ji)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var M=Ti(this.props.children,ji);if(M&&typeof M.props.shared=="boolean"){var E=M.props.shared?"axis":"item";return c.indexOf(E)>=0?E:s}return s}},{key:"getMouseInfo",value:function(M){if(!this.container)return null;var E=this.container,O=E.getBoundingClientRect(),j=UG(O),R={chartX:Math.round(M.pageX-j.left),chartY:Math.round(M.pageY-j.top)},k=O.width/E.offsetWidth||1,z=this.inRange(R.chartX,R.chartY,k);if(!z)return null;var G=this.state,$=G.xAxisMap,B=G.yAxisMap,Z=this.getTooltipEventType(),ee=v5(this.state,this.props.data,this.props.layout,z);if(Z!=="axis"&&$&&B){var J=Fs($).scale,q=Fs(B).scale,F=J&&J.invert?J.invert(R.chartX):null,ie=q&&q.invert?q.invert(R.chartY):null;return me(me({},R),{},{xValue:F,yValue:ie},ee)}return ee?me(me({},R),ee):null}},{key:"inRange",value:function(M,E){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=this.props.layout,R=M/O,k=E/O;if(j==="horizontal"||j==="vertical"){var z=this.state.offset,G=R>=z.left&&R<=z.left+z.width&&k>=z.top&&k<=z.top+z.height;return G?{x:R,y:k}:null}var $=this.state,B=$.angleAxisMap,Z=$.radiusAxisMap;if(B&&Z){var ee=Fs(B);return jk({x:R,y:k},ee)}return null}},{key:"parseEventsOfWrapper",value:function(){var M=this.props.children,E=this.getTooltipEventType(),O=Ti(M,ji),j={};O&&E==="axis"&&(O.props.trigger==="click"?j={onClick:this.handleClick}:j={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var R=Zv(this.props,this.handleOuterEvent);return me(me({},R),j)}},{key:"addListener",value:function(){s_.on(l_,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){s_.removeListener(l_,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(M,E,O){for(var j=this.state.formattedGraphicalItems,R=0,k=j.length;Ri.sessionBank),t=(e==null?void 0:e.eviction_log)??[],n={};for(const i of t)n[i.reason]=(n[i.reason]??0)+1;const r=Object.entries(n).map(([i,s])=>({reason:i,count:s})).sort((i,s)=>s.count-i.count);return T.jsx(ct,{title:"Eviction reasons · last 16",subtitle:e!=null&&e.last_miss_reason?`most recent: ${e.last_miss_reason}`:"no evictions yet",children:T.jsx("div",{className:"h-[220px]",children:r.length===0?T.jsx("div",{className:"h-full grid place-items-center text-[var(--text-muted)] text-sm",children:"SessionBank stable · no evictions"}):T.jsx(wg,{width:"100%",height:"100%",children:T.jsxs(r2,{data:r,margin:{top:4,right:20,left:0,bottom:0},children:[T.jsx(Ip,{stroke:"rgba(255,255,255,0.05)"}),T.jsx(pl,{dataKey:"reason",stroke:"rgba(200,210,220,0.6)",tick:{fontSize:10},interval:0}),T.jsx(Wo,{stroke:"rgba(200,210,220,0.6)",allowDecimals:!1}),T.jsx(ji,{contentStyle:{background:"var(--bg-elevated)",border:"1px solid var(--border-soft)",borderRadius:8,fontSize:12,maxWidth:320},labelFormatter:i=>T.jsx("span",{className:"text-[var(--text-primary)] font-semibold",children:String(i)}),formatter:((i,s,l)=>{var d;const c=String(((d=l==null?void 0:l.payload)==null?void 0:d.reason)??""),f=Oae[c]??"Cache eviction reason.";return[`${i} · ${f}`,"count"]})}),T.jsx(oa,{dataKey:"count",fill:"rgba(240,180,41,0.85)",radius:[6,6,0,0]})]})})})})}const Eae=!0,rr="u-",Mae="uplot",jae=rr+"hz",Cae=rr+"vt",Pae=rr+"title",Dae=rr+"wrap",Rae=rr+"under",Nae=rr+"over",kae=rr+"axis",Wl=rr+"off",Lae=rr+"select",zae=rr+"cursor-x",$ae=rr+"cursor-y",Bae=rr+"cursor-pt",qae=rr+"legend",Iae=rr+"live",Uae=rr+"inline",Vae=rr+"series",Hae=rr+"marker",b5=rr+"label",Fae=rr+"value",Sh="width",wh="height",ph="top",x5="bottom",Oc="left",c_="right",i2="#000",S5=i2+"0",f_="mousemove",w5="mousedown",d_="mouseup",_5="mouseenter",A5="mouseleave",O5="dblclick",Gae="resize",Kae="scroll",T5="change",Qy="dppxchange",a2="--",Qf=typeof window<"u",gO=Qf?document:null,Uc=Qf?window:null,Yae=Qf?navigator:null;let Et,Pv;function bO(){let e=devicePixelRatio;Et!=e&&(Et=e,Pv&&SO(T5,Pv,bO),Pv=matchMedia(`(min-resolution: ${Et-.001}dppx) and (max-resolution: ${Et+.001}dppx)`),vu(T5,Pv,bO),Uc.dispatchEvent(new CustomEvent(Qy)))}function Ai(e,t){if(t!=null){let n=e.classList;!n.contains(t)&&n.add(t)}}function xO(e,t){let n=e.classList;n.contains(t)&&n.remove(t)}function sn(e,t,n){e.style[t]=n+"px"}function ya(e,t,n,r){let i=gO.createElement(e);return t!=null&&Ai(i,t),n!=null&&n.insertBefore(i,r),i}function Zi(e,t){return ya("div",e,t)}const E5=new WeakMap;function qa(e,t,n,r,i){let s="translate("+t+"px,"+n+"px)",l=E5.get(e);s!=l&&(e.style.transform=s,E5.set(e,s),t<0||n<0||t>r||n>i?Ai(e,Wl):xO(e,Wl))}const M5=new WeakMap;function j5(e,t,n){let r=t+n,i=M5.get(e);r!=i&&(M5.set(e,r),e.style.background=t,e.style.borderColor=n)}const C5=new WeakMap;function P5(e,t,n,r){let i=t+""+n,s=C5.get(e);i!=s&&(C5.set(e,i),e.style.height=n+"px",e.style.width=t+"px",e.style.marginLeft=r?-t/2+"px":0,e.style.marginTop=r?-n/2+"px":0)}const o2={passive:!0},Xae={...o2,capture:!0};function vu(e,t,n,r){t.addEventListener(e,n,r?Xae:o2)}function SO(e,t,n,r){t.removeEventListener(e,n,o2)}Qf&&bO();function wa(e,t,n,r){let i;n=n||0,r=r||t.length-1;let s=r<=2147483647;for(;r-n>1;)i=s?n+r>>1:Pi((n+r)/2),t[i]{let s=-1,l=-1;for(let c=r;c<=i;c++)if(e(n[c])){s=c;break}for(let c=i;c>=r;c--)if(e(n[c])){l=c;break}return[s,l]}}const _4=e=>e!=null,A4=e=>e!=null&&e>0,Vg=w4(_4),Wae=w4(A4);function Qae(e,t,n,r=0,i=!1){let s=i?Wae:Vg,l=i?A4:_4;[t,n]=s(e,t,n);let c=e[t],f=e[t];if(t>-1)if(r==1)c=e[t],f=e[n];else if(r==-1)c=e[n],f=e[t];else for(let d=t;d<=n;d++){let m=e[d];l(m)&&(mf&&(f=m))}return[c??Kt,f??-Kt]}function Hg(e,t,n,r){let i=N5(e),s=N5(t);e==t&&(i==-1?(e*=n,t/=n):(e/=n,t*=n));let l=n==10?Uo:O4,c=i==1?Pi:na,f=s==1?na:Pi,d=c(l(Qn(e))),m=f(l(Qn(t))),p=Cf(n,d),v=Cf(n,m);return n==10&&(d<0&&(p=Yt(p,-d)),m<0&&(v=Yt(v,-m))),r||n==2?(e=p*i,t=v*s):(e=j4(e,p),t=Fg(t,v)),[e,t]}function s2(e,t,n,r){let i=Hg(e,t,n,r);return e==0&&(i[0]=0),t==0&&(i[1]=0),i}const l2=.1,D5={mode:3,pad:l2},Nh={pad:0,soft:null,mode:0},Zae={min:Nh,max:Nh};function Zy(e,t,n,r){return Gg(n)?R5(e,t,n):(Nh.pad=n,Nh.soft=r?0:null,Nh.mode=r?3:0,R5(e,t,Zae))}function _t(e,t){return e??t}function Jae(e,t,n){for(t=_t(t,0),n=_t(n,e.length-1);t<=n;){if(e[t]!=null)return!0;t++}return!1}function R5(e,t,n){let r=n.min,i=n.max,s=_t(r.pad,0),l=_t(i.pad,0),c=_t(r.hard,-Kt),f=_t(i.hard,Kt),d=_t(r.soft,Kt),m=_t(i.soft,-Kt),p=_t(r.mode,0),v=_t(i.mode,0),b=t-e,w=Uo(b),S=Xr(Qn(e),Qn(t)),x=Uo(S),A=Qn(x-w);(b<1e-24||A>10)&&(b=0,(e==0||t==0)&&(b=1e-24,p==2&&d!=Kt&&(s=0),v==2&&m!=-Kt&&(l=0)));let _=b||S||1e3,M=Uo(_),E=Cf(10,Pi(M)),O=_*(b==0?e==0?.1:1:s),j=Yt(j4(e-O,E/10),24),R=e>=d&&(p==1||p==3&&j<=d||p==2&&j>=d)?d:Kt,k=Xr(c,j=R?R:Aa(R,j)),z=_*(b==0?t==0?.1:1:l),G=Yt(Fg(t+z,E/10),24),$=t<=m&&(v==1||v==3&&G>=m||v==2&&G<=m)?m:-Kt,B=Aa(f,G>$&&t<=$?$:Xr($,G));return k==B&&k==0&&(B=100),[k,B]}const eoe=new Intl.NumberFormat(Qf?Yae.language:"en-US"),u2=e=>eoe.format(e),Ni=Math,Fv=Ni.PI,Qn=Ni.abs,Pi=Ni.floor,Wn=Ni.round,na=Ni.ceil,Aa=Ni.min,Xr=Ni.max,Cf=Ni.pow,N5=Ni.sign,Uo=Ni.log10,O4=Ni.log2,toe=(e,t=1)=>Ni.sinh(e)*t,h_=(e,t=1)=>Ni.asinh(e/t),Kt=1/0;function k5(e){return(Uo((e^e>>31)-(e>>31))|0)+1}function wO(e,t,n){return Aa(Xr(e,t),n)}function T4(e){return typeof e=="function"}function ht(e){return T4(e)?e:()=>e}const noe=()=>{},E4=e=>e,M4=(e,t)=>t,roe=e=>null,L5=e=>!0,z5=(e,t)=>e==t,ioe=/\.\d*?(?=9{6,}|0{6,})/gm,Tu=e=>{if(P4(e)||ol.has(e))return e;const t=`${e}`,n=t.match(ioe);if(n==null)return e;let r=n[0].length-1;if(t.indexOf("e-")!=-1){let[i,s]=t.split("e");return+`${Tu(i)}e${s}`}return Yt(e,r)};function Gl(e,t){return Tu(Yt(Tu(e/t))*t)}function Fg(e,t){return Tu(na(Tu(e/t))*t)}function j4(e,t){return Tu(Pi(Tu(e/t))*t)}function Yt(e,t=0){if(P4(e))return e;let n=10**t,r=e*n*(1+Number.EPSILON);return Wn(r)/n}const ol=new Map;function C4(e){return((""+e).split(".")[1]||"").length}function Op(e,t,n,r){let i=[],s=r.map(C4);for(let l=t;l=0?0:c)+(l>=s[d]?0:s[d]),v=e==10?m:Yt(m,p);i.push(v),ol.set(v,p)}}return i}const kh={},c2=[],Pf=[null,null],Hs=Array.isArray,P4=Number.isInteger,aoe=e=>e===void 0;function $5(e){return typeof e=="string"}function Gg(e){let t=!1;if(e!=null){let n=e.constructor;t=n==null||n==Object}return t}function ooe(e){return e!=null&&typeof e=="object"}const soe=Object.getPrototypeOf(Uint8Array),D4="__proto__";function Df(e,t=Gg){let n;if(Hs(e)){let r=e.find(i=>i!=null);if(Hs(r)||t(r)){n=Array(e.length);for(let i=0;is){for(i=l-1;i>=0&&e[i]==null;)e[i--]=null;for(i=l+1;il-c)],i=r[0].length,s=new Map;for(let l=0;l"u"?e=>Promise.resolve().then(e):queueMicrotask;function poe(e){let t=e[0],n=t.length,r=Array(n);for(let s=0;st[s]-t[l]);let i=[];for(let s=0;s=r&&e[i]==null;)i--;if(i<=r)return!0;const s=Xr(1,Pi((i-r+1)/t));for(let l=e[r],c=r+s;c<=i;c+=s){const f=e[c];if(f!=null){if(f<=l)return!1;l=f}}return!0}const R4=["January","February","March","April","May","June","July","August","September","October","November","December"],N4=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function k4(e){return e.slice(0,3)}const yoe=N4.map(k4),goe=R4.map(k4),boe={MMMM:R4,MMM:goe,WWWW:N4,WWW:yoe};function mh(e){return(e<10?"0":"")+e}function xoe(e){return(e<10?"00":e<100?"0":"")+e}const Soe={YYYY:e=>e.getFullYear(),YY:e=>(e.getFullYear()+"").slice(2),MMMM:(e,t)=>t.MMMM[e.getMonth()],MMM:(e,t)=>t.MMM[e.getMonth()],MM:e=>mh(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>mh(e.getDate()),D:e=>e.getDate(),WWWW:(e,t)=>t.WWWW[e.getDay()],WWW:(e,t)=>t.WWW[e.getDay()],HH:e=>mh(e.getHours()),H:e=>e.getHours(),h:e=>{let t=e.getHours();return t==0?12:t>12?t-12:t},AA:e=>e.getHours()>=12?"PM":"AM",aa:e=>e.getHours()>=12?"pm":"am",a:e=>e.getHours()>=12?"p":"a",mm:e=>mh(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>mh(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>xoe(e.getMilliseconds())};function f2(e,t){t=t||boe;let n=[],r=/\{([a-z]+)\}|[^{]+/gi,i;for(;i=r.exec(e);)n.push(i[0][0]=="{"?Soe[i[1]]:i[0]);return s=>{let l="";for(let c=0;ce%1==0,Jy=[1,2,2.5,5],Aoe=Op(10,-32,0,Jy),z4=Op(10,0,32,Jy),Ooe=z4.filter(L4),Kl=Aoe.concat(z4),d2=` +`,$4="{YYYY}",B5=d2+$4,B4="{M}/{D}",_h=d2+B4,Dv=_h+"/{YY}",q4="{aa}",Toe="{h}:{mm}",Ec=Toe+q4,q5=d2+Ec,I5=":{ss}",Rt=null;function I4(e){let t=e*1e3,n=t*60,r=n*60,i=r*24,s=i*30,l=i*365,f=(e==1?Op(10,0,3,Jy).filter(L4):Op(10,-3,0,Jy)).concat([t,t*5,t*10,t*15,t*30,n,n*5,n*10,n*15,n*30,r,r*2,r*3,r*4,r*6,r*8,r*12,i,i*2,i*3,i*4,i*5,i*6,i*7,i*8,i*9,i*10,i*15,s,s*2,s*3,s*4,s*6,l,l*2,l*5,l*10,l*25,l*50,l*100]);const d=[[l,$4,Rt,Rt,Rt,Rt,Rt,Rt,1],[i*28,"{MMM}",B5,Rt,Rt,Rt,Rt,Rt,1],[i,B4,B5,Rt,Rt,Rt,Rt,Rt,1],[r,"{h}"+q4,Dv,Rt,_h,Rt,Rt,Rt,1],[n,Ec,Dv,Rt,_h,Rt,Rt,Rt,1],[t,I5,Dv+" "+Ec,Rt,_h+" "+Ec,Rt,q5,Rt,1],[e,I5+".{fff}",Dv+" "+Ec,Rt,_h+" "+Ec,Rt,q5,Rt,1]];function m(p){return(v,b,w,S,x,A)=>{let _=[],M=x>=l,E=x>=s&&x=i?i:x,G=Pi(w)-Pi(j),$=k+G+Fg(j-k,z);_.push($);let B=p($),Z=B.getHours()+B.getMinutes()/n+B.getSeconds()/r,ee=x/r,J=v.axes[b]._space,q=A/J;for(;$=Yt($+x,e==1?0:3),!($>S);)if(ee>1){let F=Pi(Yt(Z+ee,6))%24,U=p($).getHours()-F;U>1&&(U=-1),$-=U*r,Z=(Z+ee)%24;let D=_[_.length-1];Yt(($-D)/x,3)*q>=.7&&_.push($)}else _.push($)}return _}}return[f,d,m]}const[Eoe,Moe,joe]=I4(1),[Coe,Poe,Doe]=I4(.001);Op(2,-53,53,[1]);function U5(e,t){return e.map(n=>n.map((r,i)=>i==0||i==8||r==null?r:t(i==1||n[8]==0?r:n[1]+r)))}function V5(e,t){return(n,r,i,s,l)=>{let c=t.find(w=>l>=w[0])||t[t.length-1],f,d,m,p,v,b;return r.map(w=>{let S=e(w),x=S.getFullYear(),A=S.getMonth(),_=S.getDate(),M=S.getHours(),E=S.getMinutes(),O=S.getSeconds(),j=x!=f&&c[2]||A!=d&&c[3]||_!=m&&c[4]||M!=p&&c[5]||E!=v&&c[6]||O!=b&&c[7]||c[1];return f=x,d=A,m=_,p=M,v=E,b=O,j(S)})}}function Roe(e,t){let n=f2(t);return(r,i,s,l,c)=>i.map(f=>n(e(f)))}function p_(e,t,n){return new Date(e,t,n)}function H5(e,t){return t(e)}const Noe="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function F5(e,t){return(n,r,i,s)=>s==null?a2:t(e(r))}function koe(e,t){let n=e.series[t];return n.width?n.stroke(e,t):n.points.width?n.points.stroke(e,t):null}function Loe(e,t){return e.series[t].fill(e,t)}const zoe={show:!0,live:!0,isolate:!1,mount:noe,markers:{show:!0,width:2,stroke:koe,fill:Loe,dash:"solid"},idx:null,idxs:null,values:[]};function $oe(e,t){let n=e.cursor.points,r=Zi(),i=n.size(e,t);sn(r,Sh,i),sn(r,wh,i);let s=i/-2;sn(r,"marginLeft",s),sn(r,"marginTop",s);let l=n.width(e,t,i);return l&&sn(r,"borderWidth",l),r}function Boe(e,t){let n=e.series[t].points;return n._fill||n._stroke}function qoe(e,t){let n=e.series[t].points;return n._stroke||n._fill}function Ioe(e,t){return e.series[t].points.size}const m_=[0,0];function Uoe(e,t,n){return m_[0]=t,m_[1]=n,m_}function Rv(e,t,n,r=!0){return i=>{i.button==0&&(!r||i.target==t)&&n(i)}}function v_(e,t,n,r=!0){return i=>{(!r||i.target==t)&&n(i)}}const Voe={show:!0,x:!0,y:!0,lock:!1,move:Uoe,points:{one:!1,show:$oe,size:Ioe,width:0,stroke:qoe,fill:Boe},bind:{mousedown:Rv,mouseup:Rv,click:Rv,dblclick:Rv,mousemove:v_,mouseleave:v_,mouseenter:v_},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(e,t)=>{t.stopPropagation(),t.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(e,t,n,r,i)=>r-i,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},U4={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},h2=Hn({},U4,{filter:M4}),V4=Hn({},h2,{size:10}),H4=Hn({},U4,{show:!1}),p2='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',F4="bold "+p2,G4=1.5,G5={show:!0,scale:"x",stroke:i2,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:F4,side:2,grid:h2,ticks:V4,border:H4,font:p2,lineGap:G4,rotate:0},Hoe="Value",Foe="Time",K5={show:!0,scale:"x",auto:!1,sorted:1,min:Kt,max:-Kt,idxs:[]};function Goe(e,t,n,r,i){return t.map(s=>s==null?"":u2(s))}function Koe(e,t,n,r,i,s,l){let c=[],f=ol.get(i)||0;n=l?n:Yt(Fg(n,i),f);for(let d=n;d<=r;d=Yt(d+i,f))c.push(Object.is(d,-0)?0:d);return c}function _O(e,t,n,r,i,s,l){const c=[],f=e.scales[e.axes[t].scale].log,d=f==10?Uo:O4,m=Pi(d(n));i=Cf(f,m),f==10&&(i=Kl[wa(i,Kl)]);let p=n,v=i*f;f==10&&(v=Kl[wa(v,Kl)]);do c.push(p),p=p+i,f==10&&!ol.has(p)&&(p=Yt(p,ol.get(i))),p>=v&&(i=p,v=i*f,f==10&&(v=Kl[wa(v,Kl)]));while(p<=r);return c}function Yoe(e,t,n,r,i,s,l){let f=e.scales[e.axes[t].scale].asinh,d=r>f?_O(e,t,Xr(f,n),r,i):[f],m=r>=0&&n<=0?[0]:[];return(n<-f?_O(e,t,Xr(f,-r),-n,i):[f]).reverse().map(v=>-v).concat(m,d)}const K4=/./,Xoe=/[12357]/,Woe=/[125]/,Y5=/1/,AO=(e,t,n,r)=>e.map((i,s)=>t==4&&i==0||s%r==0&&n.test(i.toExponential()[i<0?1:0])?i:null);function Qoe(e,t,n,r,i){let s=e.axes[n],l=s.scale,c=e.scales[l],f=e.valToPos,d=s._space,m=f(10,l),p=f(9,l)-m>=d?K4:f(7,l)-m>=d?Xoe:f(5,l)-m>=d?Woe:Y5;if(p==Y5){let v=Qn(f(1,l)-m);if(vi,Q5={show:!0,auto:!0,sorted:0,gaps:Y4,alpha:1,facets:[Hn({},W5,{scale:"x"}),Hn({},W5,{scale:"y"})]},Z5={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:Y4,alpha:1,points:{show:tse,filter:null},values:null,min:Kt,max:-Kt,idxs:[],path:null,clip:null};function nse(e,t,n,r,i){return n/10}const X4={time:Eae,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},rse=Hn({},X4,{time:!1,ori:1}),J5={};function W4(e,t){let n=J5[e];return n||(n={key:e,plots:[],sub(r){n.plots.push(r)},unsub(r){n.plots=n.plots.filter(i=>i!=r)},pub(r,i,s,l,c,f,d){for(let m=0;m{let A=l.pxRound;const _=d.dir*(d.ori==0?1:-1),M=d.ori==0?Zf:Jf;let E,O;_==1?(E=n,O=r):(E=r,O=n);let j=A(p(c[E],d,S,b)),R=A(v(f[E],m,x,w)),k=A(p(c[O],d,S,b)),z=A(v(s==1?m.max:m.min,m,x,w)),G=new Path2D(i);return M(G,k,z),M(G,j,z),M(G,j,R),G})}function Kg(e,t,n,r,i,s){let l=null;if(e.length>0){l=new Path2D;const c=t==0?Wg:y2;let f=n;for(let p=0;pv[0]){let b=v[0]-f;b>0&&c(l,f,r,b,r+s),f=v[1]}}let d=n+i-f,m=10;d>0&&c(l,f,r-m/2,d,r+s+m)}return l}function ase(e,t,n){let r=e[e.length-1];r&&r[0]==t?r[1]=n:e.push([t,n])}function v2(e,t,n,r,i,s,l){let c=[],f=e.length;for(let d=i==1?n:r;d>=n&&d<=r;d+=i)if(t[d]===null){let p=d,v=d;if(i==1)for(;++d<=r&&t[d]===null;)v=d;else for(;--d>=n&&t[d]===null;)v=d;let b=s(e[p]),w=v==p?b:s(e[v]),S=p-i;b=l<=0&&S>=0&&S=0&&A>=0&&A=b&&c.push([b,w])}return c}function eL(e){return e==0?E4:e==1?Wn:t=>Gl(t,e)}function Q4(e){let t=e==0?Yg:Xg,n=e==0?(i,s,l,c,f,d)=>{i.arcTo(s,l,c,f,d)}:(i,s,l,c,f,d)=>{i.arcTo(l,s,f,c,d)},r=e==0?(i,s,l,c,f)=>{i.rect(s,l,c,f)}:(i,s,l,c,f)=>{i.rect(l,s,f,c)};return(i,s,l,c,f,d=0,m=0)=>{d==0&&m==0?r(i,s,l,c,f):(d=Aa(d,c/2,f/2),m=Aa(m,c/2,f/2),t(i,s+d,l),n(i,s+c,l,s+c,l+f,d),n(i,s+c,l+f,s,l+f,m),n(i,s,l+f,s,l,m),n(i,s,l,s+c,l,d),i.closePath())}}const Yg=(e,t,n)=>{e.moveTo(t,n)},Xg=(e,t,n)=>{e.moveTo(n,t)},Zf=(e,t,n)=>{e.lineTo(t,n)},Jf=(e,t,n)=>{e.lineTo(n,t)},Wg=Q4(0),y2=Q4(1),Z4=(e,t,n,r,i,s)=>{e.arc(t,n,r,i,s)},J4=(e,t,n,r,i,s)=>{e.arc(n,t,r,i,s)},e6=(e,t,n,r,i,s,l)=>{e.bezierCurveTo(t,n,r,i,s,l)},t6=(e,t,n,r,i,s,l)=>{e.bezierCurveTo(n,t,i,r,l,s)};function n6(e){return(t,n,r,i,s)=>Ru(t,n,(l,c,f,d,m,p,v,b,w,S,x)=>{let{pxRound:A,points:_}=l,M,E;d.ori==0?(M=Yg,E=Z4):(M=Xg,E=J4);const O=Yt(_.width*Et,3);let j=(_.size-_.width)/2*Et,R=Yt(j*2,3),k=new Path2D,z=new Path2D,{left:G,top:$,width:B,height:Z}=t.bbox;Wg(z,G-R,$-R,B+R*2,Z+R*2);const ee=J=>{if(f[J]!=null){let q=A(p(c[J],d,S,b)),F=A(v(f[J],m,x,w));M(k,q+j,F),E(k,q,F,j,0,Fv*2)}};if(s)s.forEach(ee);else for(let J=r;J<=i;J++)ee(J);return{stroke:O>0?k:null,fill:k,clip:z,flags:Rf|OO}})}function r6(e){return(t,n,r,i,s,l)=>{r!=i&&(s!=r&&l!=r&&e(t,n,r),s!=i&&l!=i&&e(t,n,i),e(t,n,l))}}const ose=r6(Zf),sse=r6(Jf);function i6(e){const t=_t(e==null?void 0:e.alignGaps,0);return(n,r,i,s)=>Ru(n,r,(l,c,f,d,m,p,v,b,w,S,x)=>{[i,s]=Vg(f,i,s);let A=l.pxRound,_=Z=>A(p(Z,d,S,b)),M=Z=>A(v(Z,m,x,w)),E,O;d.ori==0?(E=Zf,O=ose):(E=Jf,O=sse);const j=d.dir*(d.ori==0?1:-1),R={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:Rf},k=R.stroke;let z=!1;if(s-i>=S*4){let Z=X=>n.posToVal(X,d.key,!0),ee=null,J=null,q,F,ie,ce=_(c[j==1?i:s]),U=_(c[i]),D=_(c[s]),V=Z(j==1?U+1:D-1);for(let X=j==1?i:s;X>=i&&X<=s;X+=j){let ue=c[X],Se=(j==1?ueV)?ce:_(ue),ye=f[X];Se==ce?ye!=null?(F=ye,ee==null?(E(k,Se,M(F)),q=ee=J=F):FJ&&(J=F)):ye===null&&(z=!0):(ee!=null&&O(k,ce,M(ee),M(J),M(q),M(F)),ye!=null?(F=ye,E(k,Se,M(F)),ee=J=q=F):(ee=J=null,ye===null&&(z=!0)),ce=Se,V=Z(ce+j))}ee!=null&&ee!=J&&ie!=ce&&O(k,ce,M(ee),M(J),M(q),M(F))}else for(let Z=j==1?i:s;Z>=i&&Z<=s;Z+=j){let ee=f[Z];ee===null?z=!0:ee!=null&&E(k,_(c[Z]),M(ee))}let[$,B]=m2(n,r);if(l.fill!=null||$!=0){let Z=R.fill=new Path2D(k),ee=l.fillTo(n,r,l.min,l.max,$),J=M(ee),q=_(c[i]),F=_(c[s]);j==-1&&([F,q]=[q,F]),E(Z,F,J),E(Z,q,J)}if(!l.spanGaps){let Z=[];z&&Z.push(...v2(c,f,i,s,j,_,t)),R.gaps=Z=l.gaps(n,r,i,s,Z),R.clip=Kg(Z,d.ori,b,w,S,x)}return B!=0&&(R.band=B==2?[Vo(n,r,i,s,k,-1),Vo(n,r,i,s,k,1)]:Vo(n,r,i,s,k,B)),R})}function lse(e){const t=_t(e.align,1),n=_t(e.ascDesc,!1),r=_t(e.alignGaps,0),i=_t(e.extend,!1);return(s,l,c,f)=>Ru(s,l,(d,m,p,v,b,w,S,x,A,_,M)=>{[c,f]=Vg(p,c,f);let E=d.pxRound,{left:O,width:j}=s.bbox,R=U=>E(w(U,v,_,x)),k=U=>E(S(U,b,M,A)),z=v.ori==0?Zf:Jf;const G={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:Rf},$=G.stroke,B=v.dir*(v.ori==0?1:-1);let Z=k(p[B==1?c:f]),ee=R(m[B==1?c:f]),J=ee,q=ee;i&&t==-1&&(q=O,z($,q,Z)),z($,ee,Z);for(let U=B==1?c:f;U>=c&&U<=f;U+=B){let D=p[U];if(D==null)continue;let V=R(m[U]),X=k(D);t==1?z($,V,Z):z($,J,X),z($,V,X),Z=X,J=V}let F=J;i&&t==1&&(F=O+j,z($,F,Z));let[ie,ce]=m2(s,l);if(d.fill!=null||ie!=0){let U=G.fill=new Path2D($),D=d.fillTo(s,l,d.min,d.max,ie),V=k(D);z(U,F,V),z(U,q,V)}if(!d.spanGaps){let U=[];U.push(...v2(m,p,c,f,B,R,r));let D=d.width*Et/2,V=n||t==1?D:-D,X=n||t==-1?-D:D;U.forEach(ue=>{ue[0]+=V,ue[1]+=X}),G.gaps=U=d.gaps(s,l,c,f,U),G.clip=Kg(U,v.ori,x,A,_,M)}return ce!=0&&(G.band=ce==2?[Vo(s,l,c,f,$,-1),Vo(s,l,c,f,$,1)]:Vo(s,l,c,f,$,ce)),G})}function tL(e,t,n,r,i,s,l=Kt){if(e.length>1){let c=null;for(let f=0,d=1/0;f{}),{fill:p,stroke:v}=d;return(b,w,S,x)=>Ru(b,w,(A,_,M,E,O,j,R,k,z,G,$)=>{let B=A.pxRound,Z=n,ee=r*Et,J=c*Et,q=f*Et,F,ie;E.ori==0?[F,ie]=s(b,w):[ie,F]=s(b,w);const ce=E.dir*(E.ori==0?1:-1);let U=E.ori==0?Wg:y2,D=E.ori==0?m:(je,bt,cn,di,ki,Tr,hi)=>{m(je,bt,cn,ki,di,hi,Tr)},V=_t(b.bands,c2).find(je=>je.series[0]==w),X=V!=null?V.dir:0,ue=A.fillTo(b,w,A.min,A.max,X),be=B(R(ue,O,$,z)),Se,ye,Me,de=G,_e=B(A.width*Et),Ee=!1,he=null,Ie=null,Te=null,We=null;p!=null&&(_e==0||v!=null)&&(Ee=!0,he=p.values(b,w,S,x),Ie=new Map,new Set(he).forEach(je=>{je!=null&&Ie.set(je,new Path2D)}),_e>0&&(Te=v.values(b,w,S,x),We=new Map,new Set(Te).forEach(je=>{je!=null&&We.set(je,new Path2D)})));let{x0:nt,size:yt}=d;if(nt!=null&&yt!=null){Z=1,_=nt.values(b,w,S,x),nt.unit==2&&(_=_.map(cn=>b.posToVal(k+cn*G,E.key,!0)));let je=yt.values(b,w,S,x);yt.unit==2?ye=je[0]*G:ye=j(je[0],E,G,k)-j(0,E,G,k),de=tL(_,M,j,E,G,k,de),Me=de-ye+ee}else de=tL(_,M,j,E,G,k,de),Me=de*l+ee,ye=de-Me;Me<1&&(Me=0),_e>=ye/2&&(_e=0),Me<5&&(B=E4);let Qt=Me>0,Zt=de-Me-(Qt?_e:0);ye=B(wO(Zt,q,J)),Se=(Z==0?ye/2:Z==ce?0:ye)-Z*ce*((Z==0?ee/2:0)+(Qt?_e/2:0));const pt={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},kn=Ee?null:new Path2D;let Tn=null;if(V!=null)Tn=b.data[V.series[1]];else{let{y0:je,y1:bt}=d;je!=null&&bt!=null&&(M=bt.values(b,w,S,x),Tn=je.values(b,w,S,x))}let Br=F*ye,ze=ie*ye;for(let je=ce==1?S:x;je>=S&&je<=x;je+=ce){let bt=M[je];if(bt==null)continue;if(Tn!=null){let Bt=Tn[je]??0;if(bt-Bt==0)continue;be=R(Bt,O,$,z)}let cn=E.distr!=2||d!=null?_[je]:je,di=j(cn,E,G,k),ki=R(_t(bt,ue),O,$,z),Tr=B(di-Se),hi=B(Xr(ki,be)),pr=B(Aa(ki,be)),Ln=hi-pr;if(bt!=null){let Bt=bt<0?ze:Br,zn=bt<0?Br:ze;Ee?(_e>0&&Te[je]!=null&&U(We.get(Te[je]),Tr,pr+Pi(_e/2),ye,Xr(0,Ln-_e),Bt,zn),he[je]!=null&&U(Ie.get(he[je]),Tr,pr+Pi(_e/2),ye,Xr(0,Ln-_e),Bt,zn)):U(kn,Tr,pr+Pi(_e/2),ye,Xr(0,Ln-_e),Bt,zn),D(b,w,je,Tr-_e/2,pr,ye+_e,Ln)}}return _e>0?pt.stroke=Ee?We:kn:Ee||(pt._fill=A.width==0?A._fill:A._stroke??A._fill,pt.width=0),pt.fill=Ee?Ie:kn,pt})}function cse(e,t){const n=_t(t==null?void 0:t.alignGaps,0);return(r,i,s,l)=>Ru(r,i,(c,f,d,m,p,v,b,w,S,x,A)=>{[s,l]=Vg(d,s,l);let _=c.pxRound,M=F=>_(v(F,m,x,w)),E=F=>_(b(F,p,A,S)),O,j,R;m.ori==0?(O=Yg,R=Zf,j=e6):(O=Xg,R=Jf,j=t6);const k=m.dir*(m.ori==0?1:-1);let z=M(f[k==1?s:l]),G=z,$=[],B=[];for(let F=k==1?s:l;F>=s&&F<=l;F+=k)if(d[F]!=null){let ce=f[F],U=M(ce);$.push(G=U),B.push(E(d[F]))}const Z={stroke:e($,B,O,R,j,_),fill:null,clip:null,band:null,gaps:null,flags:Rf},ee=Z.stroke;let[J,q]=m2(r,i);if(c.fill!=null||J!=0){let F=Z.fill=new Path2D(ee),ie=c.fillTo(r,i,c.min,c.max,J),ce=E(ie);R(F,G,ce),R(F,z,ce)}if(!c.spanGaps){let F=[];F.push(...v2(f,d,s,l,k,M,n)),Z.gaps=F=c.gaps(r,i,s,l,F),Z.clip=Kg(F,m.ori,w,S,x,A)}return q!=0&&(Z.band=q==2?[Vo(r,i,s,l,ee,-1),Vo(r,i,s,l,ee,1)]:Vo(r,i,s,l,ee,q)),Z})}function fse(e){return cse(dse,e)}function dse(e,t,n,r,i,s){const l=e.length;if(l<2)return null;const c=new Path2D;if(n(c,e[0],t[0]),l==2)r(c,e[1],t[1]);else{let f=Array(l),d=Array(l-1),m=Array(l-1),p=Array(l-1);for(let v=0;v0!=d[v]>0?f[v]=0:(f[v]=3*(p[v-1]+p[v])/((2*p[v]+p[v-1])/d[v-1]+(p[v]+2*p[v-1])/d[v]),isFinite(f[v])||(f[v]=0));f[l-1]=d[l-2];for(let v=0;v{tr.pxRatio=Et}));const hse=i6(),pse=n6();function rL(e,t,n,r){return(r?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map((s,l)=>EO(s,l,t,n))}function mse(e,t){return e.map((n,r)=>r==0?{}:Hn({},t,n))}function EO(e,t,n,r){return Hn({},t==0?n:r,e)}function a6(e,t,n){return t==null?Pf:[t,n]}const vse=a6;function yse(e,t,n){return t==null?Pf:Zy(t,n,l2,!0)}function o6(e,t,n,r){return t==null?Pf:Hg(t,n,e.scales[r].log,!1)}const gse=o6;function s6(e,t,n,r){return t==null?Pf:s2(t,n,e.scales[r].log,!1)}const bse=s6;function xse(e,t,n,r,i){let s=Xr(k5(e),k5(t)),l=t-e,c=wa(i/r*l,n);do{let f=n[c],d=r*f/l;if(d>=i&&s+(f<5?ol.get(f):0)<=17)return[f,d]}while(++c(t=Wn((n=+i)*Et))+"px"),[e,t,n]}function Sse(e){e.show&&[e.font,e.labelFont].forEach(t=>{let n=Yt(t[2]*Et,1);t[0]=t[0].replace(/[0-9.]+px/,n+"px"),t[1]=n})}function tr(e,t,n){const r={mode:_t(e.mode,1)},i=r.mode;function s(P,N,I,H){let te=N.valToPct(P);return H+I*(N.dir==-1?1-te:te)}function l(P,N,I,H){let te=N.valToPct(P);return H+I*(N.dir==-1?te:1-te)}function c(P,N,I,H){return N.ori==0?s(P,N,I,H):l(P,N,I,H)}r.valToPosH=s,r.valToPosV=l;let f=!1;r.status=0;const d=r.root=Zi(Mae);if(e.id!=null&&(d.id=e.id),Ai(d,e.class),e.title){let P=Zi(Pae,d);P.textContent=e.title}const m=ya("canvas"),p=r.ctx=m.getContext("2d"),v=Zi(Dae,d);vu("click",v,P=>{P.target===w&&(jt!=Vr||kt!=Ra)&&xt.click(r,P)},!0);const b=r.under=Zi(Rae,v);v.appendChild(m);const w=r.over=Zi(Nae,v);e=Df(e);const S=+_t(e.pxAlign,1),x=eL(S);(e.plugins||[]).forEach(P=>{P.opts&&(e=P.opts(r,e)||e)});const A=e.ms||.001,_=r.series=i==1?rL(e.series||[],K5,Z5,!1):mse(e.series||[null],Q5),M=r.axes=rL(e.axes||[],G5,X5,!0),E=r.scales={},O=r.bands=e.bands||[];O.forEach(P=>{P.fill=ht(P.fill||null),P.dir=_t(P.dir,-1)});const j=i==2?_[1].facets[0].scale:_[0].scale,R={axes:fd,series:s0},k=(e.drawOrder||["axes","series"]).map(P=>R[P]);function z(P){const N=P.distr==3?I=>Uo(I>0?I:P.clamp(r,I,P.min,P.max,P.key)):P.distr==4?I=>h_(I,P.asinh):P.distr==100?I=>P.fwd(I):I=>I;return I=>{let H=N(I),{_min:te,_max:ae}=P,ve=ae-te;return(H-te)/ve}}function G(P){let N=E[P];if(N==null){let I=(e.scales||kh)[P]||kh;if(I.from!=null){G(I.from);let H=Hn({},E[I.from],I,{key:P});H.valToPct=z(H),E[P]=H}else{N=E[P]=Hn({},P==j?X4:rse,I),N.key=P;let H=N.time,te=N.range,ae=Hs(te);if((P!=j||i==2&&!H)&&(ae&&(te[0]==null||te[1]==null)&&(te={min:te[0]==null?D5:{mode:1,hard:te[0],soft:te[0]},max:te[1]==null?D5:{mode:1,hard:te[1],soft:te[1]}},ae=!1),!ae&&Gg(te))){let ve=te;te=(we,Ae,Ce)=>Ae==null?Pf:Zy(Ae,Ce,ve)}N.range=ht(te||(H?vse:P==j?N.distr==3?gse:N.distr==4?bse:a6:N.distr==3?o6:N.distr==4?s6:yse)),N.auto=ht(ae?!1:N.auto),N.clamp=ht(N.clamp||nse),N._min=N._max=null,N.valToPct=z(N)}}}G("x"),G("y"),i==1&&_.forEach(P=>{G(P.scale)}),M.forEach(P=>{G(P.scale)});for(let P in e.scales)G(P);const $=E[j],B=$.distr;let Z,ee;$.ori==0?(Ai(d,jae),Z=s,ee=l):(Ai(d,Cae),Z=l,ee=s);const J={};for(let P in E){let N=E[P];(N.min!=null||N.max!=null)&&(J[P]={min:N.min,max:N.max},N.min=N.max=null)}const q=e.tzDate||(P=>new Date(Wn(P/A))),F=e.fmtDate||f2,ie=A==1?joe(q):Doe(q),ce=V5(q,U5(A==1?Moe:Poe,F)),U=F5(q,H5(Noe,F)),D=[],V=r.legend=Hn({},zoe,e.legend),X=r.cursor=Hn({},Voe,{drag:{y:i==2}},e.cursor),ue=V.show,be=X.show,Se=V.markers;V.idxs=D,Se.width=ht(Se.width),Se.dash=ht(Se.dash),Se.stroke=ht(Se.stroke),Se.fill=ht(Se.fill);let ye,Me,de,_e=[],Ee=[],he,Ie=!1,Te={};if(V.live){const P=_[1]?_[1].values:null;Ie=P!=null,he=Ie?P(r,1,0):{_:0};for(let N in he)Te[N]=a2}if(ue)if(ye=ya("table",qae,d),de=ya("tbody",null,ye),V.mount(r,ye),Ie){Me=ya("thead",null,ye,de);let P=ya("tr",null,Me);ya("th",null,P);for(var We in he)ya("th",b5,P).textContent=We}else Ai(ye,Uae),V.live&&Ai(ye,Iae);const nt={show:!0},yt={show:!1};function Qt(P,N){if(N==0&&(Ie||!V.live||i==2))return Pf;let I=[],H=ya("tr",Vae,de,de.childNodes[N]);Ai(H,P.class),P.show||Ai(H,Wl);let te=ya("th",null,H);if(Se.show){let we=Zi(Hae,te);if(N>0){let Ae=Se.width(r,N);Ae&&(we.style.border=Ae+"px "+Se.dash(r,N)+" "+Se.stroke(r,N)),we.style.background=Se.fill(r,N)}}let ae=Zi(b5,te);P.label instanceof HTMLElement?ae.appendChild(P.label):ae.textContent=P.label,N>0&&(Se.show||(ae.style.color=P.width>0?Se.stroke(r,N):Se.fill(r,N)),pt("click",te,we=>{if(X._lock)return;pi(we);let Ae=_.indexOf(P);if((we.ctrlKey||we.metaKey)!=V.isolate){let Ce=_.some((Re,Ne)=>Ne>0&&Ne!=Ae&&Re.show);_.forEach((Re,Ne)=>{Ne>0&&Hr(Ne,Ce?Ne==Ae?nt:yt:nt,!0,gn.setSeries)})}else Hr(Ae,{show:!P.show},!0,gn.setSeries)},!1),io&&pt(_5,te,we=>{X._lock||(pi(we),Hr(_.indexOf(P),hs,!0,gn.setSeries))},!1));for(var ve in he){let we=ya("td",Fae,H);we.textContent="--",I.push(we)}return[H,I]}const Zt=new Map;function pt(P,N,I,H=!0){const te=Zt.get(N)||{},ae=X.bind[P](r,N,I,H);ae&&(vu(P,N,te[P]=ae),Zt.set(N,te))}function kn(P,N,I){const H=Zt.get(N)||{};for(let te in H)(P==null||te==P)&&(SO(te,N,H[te]),delete H[te]);P==null&&Zt.delete(N)}let Tn=0,Br=0,ze=0,je=0,bt=0,cn=0,di=bt,ki=cn,Tr=ze,hi=je,pr=0,Ln=0,Bt=0,zn=0;r.bbox={};let mr=!1,ku=!1,ns=!1,no=!1,ro=!1,vr=!1;function rs(P,N,I){(I||P!=r.width||N!=r.height)&&Ma(P,N),ss(!1),ns=!0,ku=!0,Da()}function Ma(P,N){r.width=Tn=ze=P,r.height=Br=je=N,bt=cn=0,Xp(),rd();let I=r.bbox;pr=I.left=Gl(bt*Et,.5),Ln=I.top=Gl(cn*Et,.5),Bt=I.width=Gl(ze*Et,.5),zn=I.height=Gl(je*Et,.5)}const Lu=3;function vl(){let P=!1,N=0;for(;!P;){N++;let I=Jp(N),H=em(N);P=N==Lu||I&&H,P||(Ma(r.width,r.height),ku=!0)}}function o0({width:P,height:N}){rs(P,N)}r.setSize=o0;function Xp(){let P=!1,N=!1,I=!1,H=!1;M.forEach((te,ae)=>{if(te.show&&te._show){let{side:ve,_size:we}=te,Ae=ve%2,Ce=te.label!=null?te.labelSize:0,Re=we+Ce;Re>0&&(Ae?(ze-=Re,ve==3?(bt+=Re,H=!0):I=!0):(je-=Re,ve==0?(cn+=Re,P=!0):N=!0))}}),Wr[0]=P,Wr[1]=I,Wr[2]=N,Wr[3]=H,ze-=ua[1]+ua[3],bt+=ua[3],je-=ua[2]+ua[0],cn+=ua[0]}function rd(){let P=bt+ze,N=cn+je,I=bt,H=cn;function te(ae,ve){switch(ae){case 1:return P+=ve,P-ve;case 2:return N+=ve,N-ve;case 3:return I-=ve,I+ve;case 0:return H-=ve,H+ve}}M.forEach((ae,ve)=>{if(ae.show&&ae._show){let we=ae.side;ae._pos=te(we,ae._size),ae.label!=null&&(ae._lpos=te(we,ae.labelSize))}})}if(X.dataIdx==null){let P=X.hover,N=P.skip=new Set(P.skip??[]);N.add(void 0);let I=P.prox=ht(P.prox),H=P.bias??(P.bias=0);X.dataIdx=(te,ae,ve,we)=>{if(ae==0)return ve;let Ae=ve,Ce=I(te,ae,ve,we)??Kt,Re=Ce>=0&&Ce0;)N.has(Ye[Be])||(et=Be);if(H==0||H==1)for(Be=ve;Ve==null&&Be++Ce&&(Ae=null);return Ae}}const pi=P=>{X.event=P};X.idxs=D,X._lock=!1;let ir=X.points;ir.show=ht(ir.show),ir.size=ht(ir.size),ir.stroke=ht(ir.stroke),ir.width=ht(ir.width),ir.fill=ht(ir.fill);const mi=r.focus=Hn({},e.focus||{alpha:.3},X.focus),io=mi.prox>=0,ao=io&&ir.one;let Er=[],ja=[],oo=[];function id(P,N){let I=ir.show(r,N);if(I instanceof HTMLElement)return Ai(I,Bae),Ai(I,P.class),qa(I,-10,-10,ze,je),w.insertBefore(I,Er[N]),I}function la(P,N){if(i==1||N>0){let I=i==1&&E[P.scale].time,H=P.value;P.value=I?$5(H)?F5(q,H5(H,F)):H||U:H||Joe,P.label=P.label||(I?Foe:Hoe)}if(ao||N>0){P.width=P.width==null?1:P.width,P.paths=P.paths||hse||roe,P.fillTo=ht(P.fillTo||ise),P.pxAlign=+_t(P.pxAlign,S),P.pxRound=eL(P.pxAlign),P.stroke=ht(P.stroke||null),P.fill=ht(P.fill||null),P._stroke=P._fill=P._paths=P._focus=null;let I=ese(Xr(1,P.width),1),H=P.points=Hn({},{size:I,width:Xr(1,I*.2),stroke:P.stroke,space:I*2,paths:pse,_stroke:null,_fill:null},P.points);H.show=ht(H.show),H.filter=ht(H.filter),H.fill=ht(H.fill),H.stroke=ht(H.stroke),H.paths=ht(H.paths),H.pxAlign=P.pxAlign}if(ue){let I=Qt(P,N);_e.splice(N,0,I[0]),Ee.splice(N,0,I[1]),V.values.push(null)}if(be){D.splice(N,0,null);let I=null;ao?N==0&&(I=id(P,N)):N>0&&(I=id(P,N)),Er.splice(N,0,I),ja.splice(N,0,0),oo.splice(N,0,0)}Mn("addSeries",N)}function Gn(P,N){N=N??_.length,P=i==1?EO(P,N,K5,Z5):EO(P,N,{},Q5),_.splice(N,0,P),la(_[N],N)}r.addSeries=Gn;function Mr(P){if(_.splice(P,1),ue){V.values.splice(P,1),Ee.splice(P,1);let N=_e.splice(P,1)[0];kn(null,N.firstChild),N.remove()}be&&(D.splice(P,1),Er.splice(P,1)[0].remove(),ja.splice(P,1),oo.splice(P,1)),Mn("delSeries",P)}r.delSeries=Mr;const Wr=[!1,!1,!1,!1];function ad(P,N){if(P._show=P.show,P.show){let I=P.side%2,H=E[P.scale];H==null&&(P.scale=I?_[1].scale:j,H=E[P.scale]);let te=H.time;P.size=ht(P.size),P.space=ht(P.space),P.rotate=ht(P.rotate),Hs(P.incrs)&&P.incrs.forEach(ve=>{!ol.has(ve)&&ol.set(ve,C4(ve))}),P.incrs=ht(P.incrs||(H.distr==2?Ooe:te?A==1?Eoe:Coe:Kl)),P.splits=ht(P.splits||(te&&H.distr==1?ie:H.distr==3?_O:H.distr==4?Yoe:Koe)),P.stroke=ht(P.stroke),P.grid.stroke=ht(P.grid.stroke),P.ticks.stroke=ht(P.ticks.stroke),P.border.stroke=ht(P.border.stroke);let ae=P.values;P.values=Hs(ae)&&!Hs(ae[0])?ht(ae):te?Hs(ae)?V5(q,U5(ae,F)):$5(ae)?Roe(q,ae):ae||ce:ae||Goe,P.filter=ht(P.filter||(H.distr>=3&&H.log==10?Qoe:H.distr==3&&H.log==2?Zoe:M4)),P.font=iL(P.font),P.labelFont=iL(P.labelFont),P._size=P.size(r,null,N,0),P._space=P._rotate=P._incrs=P._found=P._splits=P._values=null,P._size>0&&(Wr[N]=!0,P._el=Zi(kae,v))}}function yl(P,N,I,H){let[te,ae,ve,we]=I,Ae=N%2,Ce=0;return Ae==0&&(we||ae)&&(Ce=N==0&&!te||N==2&&!ve?Wn(G5.size/3):0),Ae==1&&(te||ve)&&(Ce=N==1&&!ae||N==3&&!we?Wn(X5.size/2):0),Ce}const Wp=r.padding=(e.padding||[yl,yl,yl,yl]).map(P=>ht(_t(P,yl))),ua=r._padding=Wp.map((P,N)=>P(r,N,Wr,0));let pn,yn=null,tn=null;const ca=i==1?_[0].idxs:null;let yr=null,Li=!1;function En(P,N){if(t=P??[],r.data=r._data=t,i==2){pn=0;for(let I=1;I<_.length;I++)pn+=t[I][0].length}else{t.length==0&&(r.data=r._data=t=[[]]),yr=t[0],pn=yr.length;let I=t;if(B==2){I=t.slice();let H=I[0]=Array(pn);for(let te=0;te=0,vr=!0,Da()}}r.setData=En;function zu(){Li=!0;let P,N;i==1&&(pn>0?(yn=ca[0]=0,tn=ca[1]=pn-1,P=t[0][yn],N=t[0][tn],B==2?(P=yn,N=tn):P==N&&(B==3?[P,N]=Hg(P,P,$.log,!1):B==4?[P,N]=s2(P,P,$.log,!1):$.time?N=P+Wn(86400/A):[P,N]=Zy(P,N,l2,!0))):(yn=ca[0]=P=null,tn=ca[1]=N=null)),Zr(j,P,N)}let gl,Qr,Ca,od,$u,Bu,sd,is,as,fn;function qr(P,N,I,H,te,ae){P??(P=S5),I??(I=c2),H??(H="butt"),te??(te=S5),ae??(ae="round"),P!=gl&&(p.strokeStyle=gl=P),te!=Qr&&(p.fillStyle=Qr=te),N!=Ca&&(p.lineWidth=Ca=N),ae!=$u&&(p.lineJoin=$u=ae),H!=Bu&&(p.lineCap=Bu=H),I!=od&&p.setLineDash(od=I)}function ld(P,N,I,H){N!=Qr&&(p.fillStyle=Qr=N),P!=sd&&(p.font=sd=P),I!=is&&(p.textAlign=is=I),H!=as&&(p.textBaseline=as=H)}function ud(P,N,I,H,te=0){if(H.length>0&&P.auto(r,Li)&&(N==null||N.min==null)){let ae=_t(yn,0),ve=_t(tn,H.length-1),we=I.min==null?Qae(H,ae,ve,te,P.distr==3):[I.min,I.max];P.min=Aa(P.min,I.min=we[0]),P.max=Xr(P.max,I.max=we[1])}}const qu={min:null,max:null};function Qp(){for(let H in E){let te=E[H];J[H]==null&&(te.min==null||J[j]!=null&&te.auto(r,Li))&&(J[H]=qu)}for(let H in E){let te=E[H];J[H]==null&&te.from!=null&&J[te.from]!=null&&(J[H]=qu)}J[j]!=null&&ss(!0);let P={};for(let H in J){let te=J[H];if(te!=null){let ae=P[H]=Df(E[H],ooe);if(te.min!=null)Hn(ae,te);else if(H!=j||i==2)if(pn==0&&ae.from==null){let ve=ae.range(r,null,null,H);ae.min=ve[0],ae.max=ve[1]}else ae.min=Kt,ae.max=-Kt}}if(pn>0){_.forEach((H,te)=>{if(i==1){let ae=H.scale,ve=J[ae];if(ve==null)return;let we=P[ae];if(te==0){let Ae=we.range(r,we.min,we.max,ae);we.min=Ae[0],we.max=Ae[1],yn=wa(we.min,t[0]),tn=wa(we.max,t[0]),tn-yn>1&&(t[0][yn]we.max&&tn--),H.min=yr[yn],H.max=yr[tn]}else H.show&&H.auto&&ud(we,ve,H,t[te],H.sorted);H.idxs[0]=yn,H.idxs[1]=tn}else if(te>0&&H.show&&H.auto){let[ae,ve]=H.facets,we=ae.scale,Ae=ve.scale,[Ce,Re]=t[te],Ne=P[we],Ke=P[Ae];Ne!=null&&ud(Ne,J[we],ae,Ce,ae.sorted),Ke!=null&&ud(Ke,J[Ae],ve,Re,ve.sorted),H.min=ve.min,H.max=ve.max}});for(let H in P){let te=P[H],ae=J[H];if(te.from==null&&(ae==null||ae.min==null)){let ve=te.range(r,te.min==Kt?null:te.min,te.max==-Kt?null:te.max,H);te.min=ve[0],te.max=ve[1]}}}for(let H in P){let te=P[H];if(te.from!=null){let ae=P[te.from];if(ae.min==null)te.min=te.max=null;else{let ve=te.range(r,ae.min,ae.max,H);te.min=ve[0],te.max=ve[1]}}}let N={},I=!1;for(let H in P){let te=P[H],ae=E[H];if(ae.min!=te.min||ae.max!=te.max){ae.min=te.min,ae.max=te.max;let ve=ae.distr;ae._min=ve==3?Uo(ae.min):ve==4?h_(ae.min,ae.asinh):ve==100?ae.fwd(ae.min):ae.min,ae._max=ve==3?Uo(ae.max):ve==4?h_(ae.max,ae.asinh):ve==100?ae.fwd(ae.max):ae.max,N[H]=I=!0}}if(I){_.forEach((H,te)=>{i==2?te>0&&N.y&&(H._paths=null):N[H.scale]&&(H._paths=null)});for(let H in N)ns=!0,Mn("setScale",H);be&&X.left>=0&&(no=vr=!0)}for(let H in J)J[H]=null}function Iu(P){let N=wO(yn-1,0,pn-1),I=wO(tn+1,0,pn-1);for(;P[N]==null&&N>0;)N--;for(;P[I]==null&&I0){let P=_.some(N=>N._focus)&&fn!=mi.alpha;P&&(p.globalAlpha=fn=mi.alpha),_.forEach((N,I)=>{if(I>0&&N.show&&(Ir(I,!1),Ir(I,!0),N._paths==null)){let H=fn;fn!=N.alpha&&(p.globalAlpha=fn=N.alpha);let te=i==2?[0,t[I][0].length-1]:Iu(t[I]);N._paths=N.paths(r,I,te[0],te[1]),fn!=H&&(p.globalAlpha=fn=H)}}),_.forEach((N,I)=>{if(I>0&&N.show){let H=fn;fn!=N.alpha&&(p.globalAlpha=fn=N.alpha),N._paths!=null&&Uu(I,!1);{let te=N._paths!=null?N._paths.gaps:null,ae=N.points.show(r,I,yn,tn,te),ve=N.points.filter(r,I,ae,te);(ae||ve)&&(N.points._paths=N.points.paths(r,I,yn,tn,ve),Uu(I,!0))}fn!=H&&(p.globalAlpha=fn=H),Mn("drawSeries",I)}}),P&&(p.globalAlpha=fn=1)}}function Ir(P,N){let I=N?_[P].points:_[P];I._stroke=I.stroke(r,P),I._fill=I.fill(r,P)}function Uu(P,N){let I=N?_[P].points:_[P],{stroke:H,fill:te,clip:ae,flags:ve,_stroke:we=I._stroke,_fill:Ae=I._fill,_width:Ce=I.width}=I._paths;Ce=Yt(Ce*Et,3);let Re=null,Ne=Ce%2/2;N&&Ae==null&&(Ae=Ce>0?"#fff":we);let Ke=I.pxAlign==1&&Ne>0;if(Ke&&p.translate(Ne,Ne),!N){let gt=pr-Ce/2,Ye=Ln-Ce/2,et=Bt+Ce,Ve=zn+Ce;Re=new Path2D,Re.rect(gt,Ye,et,Ve)}N?Pa(we,Ce,I.dash,I.cap,Ae,H,te,ve,ae):Zp(P,we,Ce,I.dash,I.cap,Ae,H,te,ve,Re,ae),Ke&&p.translate(-Ne,-Ne)}function Zp(P,N,I,H,te,ae,ve,we,Ae,Ce,Re){let Ne=!1;Ae!=0&&O.forEach((Ke,gt)=>{if(Ke.series[0]==P){let Ye=_[Ke.series[1]],et=t[Ke.series[1]],Ve=(Ye._paths||kh).band;Hs(Ve)&&(Ve=Ke.dir==1?Ve[0]:Ve[1]);let Be,qt=null;Ye.show&&Ve&&Jae(et,yn,tn)?(qt=Ke.fill(r,gt)||ae,Be=Ye._paths.clip):Ve=null,Pa(N,I,H,te,qt,ve,we,Ae,Ce,Re,Be,Ve),Ne=!0}}),Ne||Pa(N,I,H,te,ae,ve,we,Ae,Ce,Re)}const Vu=Rf|OO;function Pa(P,N,I,H,te,ae,ve,we,Ae,Ce,Re,Ne){qr(P,N,I,H,te),(Ae||Ce||Ne)&&(p.save(),Ae&&p.clip(Ae),Ce&&p.clip(Ce)),Ne?(we&Vu)==Vu?(p.clip(Ne),Re&&p.clip(Re),xl(te,ve),bl(P,ae,N)):we&OO?(xl(te,ve),p.clip(Ne),bl(P,ae,N)):we&Rf&&(p.save(),p.clip(Ne),Re&&p.clip(Re),xl(te,ve),p.restore(),bl(P,ae,N)):(xl(te,ve),bl(P,ae,N)),(Ae||Ce||Ne)&&p.restore()}function bl(P,N,I){I>0&&(N instanceof Map?N.forEach((H,te)=>{p.strokeStyle=gl=te,p.stroke(H)}):N!=null&&P&&p.stroke(N))}function xl(P,N){N instanceof Map?N.forEach((I,H)=>{p.fillStyle=Qr=H,p.fill(I)}):N!=null&&P&&p.fill(N)}function os(P,N,I,H){let te=M[P],ae;if(H<=0)ae=[0,0];else{let ve=te._space=te.space(r,P,N,I,H),we=te._incrs=te.incrs(r,P,N,I,H,ve);ae=xse(N,I,we,H,ve)}return te._found=ae}function cd(P,N,I,H,te,ae,ve,we,Ae,Ce){let Re=ve%2/2;S==1&&p.translate(Re,Re),qr(we,ve,Ae,Ce,we),p.beginPath();let Ne,Ke,gt,Ye,et=te+(H==0||H==3?-ae:ae);I==0?(Ke=te,Ye=et):(Ne=te,gt=et);for(let Ve=0;Ve{if(!I.show)return;let te=E[I.scale];if(te.min==null){I._show&&(N=!1,I._show=!1,ss(!1));return}else I._show||(N=!1,I._show=!0,ss(!1));let ae=I.side,ve=ae%2,{min:we,max:Ae}=te,[Ce,Re]=os(H,we,Ae,ve==0?ze:je);if(Re==0)return;let Ne=te.distr==2,Ke=I._splits=I.splits(r,H,we,Ae,Ce,Re,Ne),gt=te.distr==2?Ke.map(Be=>yr[Be]):Ke,Ye=te.distr==2?yr[Ke[1]]-yr[Ke[0]]:Ce,et=I._values=I.values(r,I.filter(r,gt,H,Re,Ye),H,Re,Ye);I._rotate=ae==2?I.rotate(r,et,H,Re):0;let Ve=I._size;I._size=na(I.size(r,et,H,P)),Ve!=null&&I._size!=Ve&&(N=!1)}),N}function em(P){let N=!0;return Wp.forEach((I,H)=>{let te=I(r,H,Wr,P);te!=ua[H]&&(N=!1),ua[H]=te}),N}function fd(){for(let P=0;Pyr[sr]):gt,et=Re.distr==2?yr[gt[1]]-yr[gt[0]]:Ae,Ve=N.ticks,Be=N.border,qt=Ve.show?Ve.size:0,nn=Wn(qt*Et),bn=Wn((N.alignTo==2?N._size-qt-N.gap:N.gap)*Et),Ct=N._rotate*-Fv/180,Lt=x(N._pos*Et),gr=(nn+bn)*we,jn=Lt+gr;ae=H==0?jn:0,te=H==1?jn:0;let Cr=N.font[0],Jr=N.align==1?Oc:N.align==2?c_:Ct>0?Oc:Ct<0?c_:H==0?"center":I==3?c_:Oc,ar=Ct||H==1?"middle":I==2?ph:x5;ld(Cr,ve,Jr,ar);let $n=N.font[1]*N.lineGap,Pr=gt.map(sr=>x(c(sr,Re,Ne,Ke))),ei=N._values;for(let sr=0;sr{I>0&&(N._paths=null,P&&(i==1?(N.min=null,N.max=null):N.facets.forEach(H=>{H.min=null,H.max=null})))})}let Hu=!1,ls=!1,Ur=[];function dd(){ls=!1;for(let P=0;P0&&queueMicrotask(dd)}r.batch=us;function so(){if(mr&&(Qp(),mr=!1),ns&&(vl(),ns=!1),ku){if(sn(b,Oc,bt),sn(b,ph,cn),sn(b,Sh,ze),sn(b,wh,je),sn(w,Oc,bt),sn(w,ph,cn),sn(w,Sh,ze),sn(w,wh,je),sn(v,Sh,Tn),sn(v,wh,Br),m.width=Wn(Tn*Et),m.height=Wn(Br*Et),M.forEach(({_el:P,_show:N,_size:I,_pos:H,side:te})=>{if(P!=null)if(N){let ae=te===3||te===0?I:0,ve=te%2==1;sn(P,ve?"left":"top",H-ae),sn(P,ve?"width":"height",I),sn(P,ve?"top":"left",ve?cn:bt),sn(P,ve?"height":"width",ve?je:ze),xO(P,Wl)}else Ai(P,Wl)}),gl=Qr=Ca=$u=Bu=sd=is=as=od=null,fn=1,Ol(!0),bt!=di||cn!=ki||ze!=Tr||je!=hi){ss(!1);let P=ze/Tr,N=je/hi;if(be&&!no&&X.left>=0){X.left*=P,X.top*=N,zi&&qa(zi,Wn(X.left),0,ze,je),jr&&qa(jr,0,Wn(X.top),ze,je);for(let I=0;I=0&&Ot.width>0){Ot.left*=P,Ot.width*=P,Ot.top*=N,Ot.height*=N;for(let I in gd)sn(fs,I,Ot[I])}di=bt,ki=cn,Tr=ze,hi=je}Mn("setSize"),ku=!1}Tn>0&&Br>0&&(p.clearRect(0,0,m.width,m.height),Mn("drawClear"),k.forEach(P=>P()),Mn("draw")),Ot.show&&ro&&(ds(Ot),ro=!1),be&&no&&(uo(null,!0,!1),no=!1),V.show&&V.live&&vr&&(vd(),vr=!1),f||(f=!0,r.status=1,Mn("ready")),Li=!1,Hu=!1}r.redraw=(P,N)=>{ns=N||!1,P!==!1?Zr(j,$.min,$.max):Da()};function Fu(P,N){let I=E[P];if(I.from==null){if(pn==0){let H=I.range(r,N.min,N.max,P);N.min=H[0],N.max=H[1]}if(N.min>N.max){let H=N.min;N.min=N.max,N.max=H}if(pn>1&&N.min!=null&&N.max!=null&&N.max-N.min<1e-16)return;P==j&&I.distr==2&&pn>0&&(N.min=wa(N.min,t[0]),N.max=wa(N.max,t[0]),N.min==N.max&&N.max++),J[P]=N,mr=!0,Da()}}r.setScale=Fu;let Sl,Gu,zi,jr,Ku,cs,Vr,Ra,wl,hd,jt,kt,fa=!1;const xt=X.drag;let Jt=xt.x,mn=xt.y;be&&(X.x&&(Sl=Zi(zae,w)),X.y&&(Gu=Zi($ae,w)),$.ori==0?(zi=Sl,jr=Gu):(zi=Gu,jr=Sl),jt=X.left,kt=X.top);const Ot=r.select=Hn({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),fs=Ot.show?Zi(Lae,Ot.over?w:b):null;function ds(P,N){if(Ot.show){for(let I in P)Ot[I]=P[I],I in gd&&sn(fs,I,P[I]);N!==!1&&Mn("setSelect")}}r.setSelect=ds;function pd(P){if(_[P].show)ue&&xO(_e[P],Wl);else if(ue&&Ai(_e[P],Wl),be){let I=ao?Er[0]:Er[P];I!=null&&qa(I,-10,-10,ze,je)}}function Zr(P,N,I){Fu(P,{min:N,max:I})}function Hr(P,N,I,H){N.focus!=null&&f0(P),N.show!=null&&_.forEach((te,ae)=>{ae>0&&(P==ae||P==null)&&(te.show=N.show,pd(ae),i==2?(Zr(te.facets[0].scale,null,null),Zr(te.facets[1].scale,null,null)):Zr(te.scale,null,null),Da())}),I!==!1&&Mn("setSeries",P,N),H&&ms("setSeries",r,P,N)}r.setSeries=Hr;function tm(P,N){Hn(O[P],N)}function l0(P,N){P.fill=ht(P.fill||null),P.dir=_t(P.dir,-1),N=N??O.length,O.splice(N,0,P)}function u0(P){P==null?O.length=0:O.splice(P,1)}r.addBand=l0,r.setBand=tm,r.delBand=u0;function c0(P,N){_[P].alpha=N,be&&Er[P]!=null&&(Er[P].style.opacity=N),ue&&_e[P]&&(_e[P].style.opacity=N)}let vi,Na,lo;const hs={focus:!0};function f0(P){if(P!=lo){let N=P==null,I=mi.alpha!=1;_.forEach((H,te)=>{if(i==1||te>0){let ae=N||te==0||te==P;H._focus=N?null:ae,I&&c0(te,ae?1:mi.alpha)}}),lo=P,I&&Da()}}ue&&io&&pt(A5,ye,P=>{X._lock||(pi(P),lo!=null&&Hr(null,hs,!0,gn.setSeries))});function $i(P,N,I){let H=E[N];I&&(P=P/Et-(H.ori==1?cn:bt));let te=ze;H.ori==1&&(te=je,P=te-P),H.dir==-1&&(P=te-P);let ae=H._min,ve=H._max,we=P/te,Ae=ae+(ve-ae)*we,Ce=H.distr;return Ce==3?Cf(10,Ae):Ce==4?toe(Ae,H.asinh):Ce==100?H.bwd(Ae):Ae}function nm(P,N){let I=$i(P,j,N);return wa(I,t[0],yn,tn)}r.valToIdx=P=>wa(P,t[0]),r.posToIdx=nm,r.posToVal=$i,r.valToPos=(P,N,I)=>E[N].ori==0?s(P,E[N],I?Bt:ze,I?pr:0):l(P,E[N],I?zn:je,I?Ln:0),r.setCursor=(P,N,I)=>{jt=P.left,kt=P.top,uo(null,N,I)};function rm(P,N){sn(fs,Oc,Ot.left=P),sn(fs,Sh,Ot.width=N)}function im(P,N){sn(fs,ph,Ot.top=P),sn(fs,wh,Ot.height=N)}let _l=$.ori==0?rm:im,Al=$.ori==1?rm:im;function md(){if(ue&&V.live)for(let P=i==2?1:0;P<_.length;P++){if(P==0&&Ie)continue;let N=V.values[P],I=0;for(let H in N)Ee[P][I++].firstChild.nodeValue=N[H]}}function vd(P,N){if(P!=null&&(P.idxs?P.idxs.forEach((I,H)=>{D[H]=I}):aoe(P.idx)||D.fill(P.idx),V.idx=D[0]),ue&&V.live){for(let I=0;I<_.length;I++)(I>0||i==1&&!Ie)&&d0(I,D[I]);md()}vr=!1,N!==!1&&Mn("setLegend")}r.setLegend=vd;function d0(P,N){let I=_[P],H=P==0&&B==2?yr:t[P],te;Ie?te=I.values(r,P,N)??Te:(te=I.value(r,N==null?null:H[N],P,N),te=te==null?Te:{_:te}),V.values[P]=te}function uo(P,N,I){wl=jt,hd=kt,[jt,kt]=X.move(r,jt,kt),X.left=jt,X.top=kt,be&&(zi&&qa(zi,Wn(jt),0,ze,je),jr&&qa(jr,0,Wn(kt),ze,je));let H,te=yn>tn;vi=Kt,Na=null;let ae=$.ori==0?ze:je,ve=$.ori==1?ze:je;if(jt<0||pn==0||te){H=X.idx=null;for(let we=0;we<_.length;we++){let Ae=Er[we];Ae!=null&&qa(Ae,-10,-10,ze,je)}io&&Hr(null,hs,!0,P==null&&gn.setSeries),V.live&&(D.fill(H),vr=!0)}else{let we,Ae,Ce;i==1&&(we=$.ori==0?jt:kt,Ae=$i(we,j),H=X.idx=wa(Ae,t[0],yn,tn),Ce=Z(t[0][H],$,ae,0));let Re=-10,Ne=-10,Ke=0,gt=0,Ye=!0,et="",Ve="";for(let Be=i==2?1:0;Be<_.length;Be++){let qt=_[Be],nn=D[Be],bn=nn==null?null:i==1?t[Be][nn]:t[Be][1][nn],Ct=X.dataIdx(r,Be,H,Ae),Lt=Ct==null?null:i==1?t[Be][Ct]:t[Be][1][Ct];if(vr=vr||Lt!=bn||Ct!=nn,D[Be]=Ct,Be>0&&qt.show){let gr=Ct==null?-10:Ct==H?Ce:Z(i==1?t[0][Ct]:t[Be][0][Ct],$,ae,0),jn=Lt==null?-10:ee(Lt,i==1?E[qt.scale]:E[qt.facets[1].scale],ve,0);if(io&&Lt!=null){let Cr=$.ori==1?jt:kt,Jr=Qn(mi.dist(r,Be,Ct,jn,Cr));if(Jr=0?1:-1,ei=$n>=0?1:-1;ei==Pr&&(ei==1?ar==1?Lt>=$n:Lt<=$n:ar==1?Lt<=$n:Lt>=$n)&&(vi=Jr,Na=Be)}else vi=Jr,Na=Be}}if(vr||ao){let Cr,Jr;$.ori==0?(Cr=gr,Jr=jn):(Cr=jn,Jr=gr);let ar,$n,Pr,ei,or,sr,Dr=!0,ka=ir.bbox;if(ka!=null){Dr=!1;let br=ka(r,Be);Pr=br.left,ei=br.top,ar=br.width,$n=br.height}else Pr=Cr,ei=Jr,ar=$n=ir.size(r,Be);if(sr=ir.fill(r,Be),or=ir.stroke(r,Be),ao)Be==Na&&vi<=mi.prox&&(Re=Pr,Ne=ei,Ke=ar,gt=$n,Ye=Dr,et=sr,Ve=or);else{let br=Er[Be];br!=null&&(ja[Be]=Pr,oo[Be]=ei,P5(br,ar,$n,Dr),j5(br,sr,or),qa(br,na(Pr),na(ei),ze,je))}}}}if(ao){let Be=mi.prox,qt=lo==null?vi<=Be:vi>Be||Na!=lo;if(vr||qt){let nn=Er[0];nn!=null&&(ja[0]=Re,oo[0]=Ne,P5(nn,Ke,gt,Ye),j5(nn,et,Ve),qa(nn,na(Re),na(Ne),ze,je))}}}if(Ot.show&&fa)if(P!=null){let[we,Ae]=gn.scales,[Ce,Re]=gn.match,[Ne,Ke]=P.cursor.sync.scales,gt=P.cursor.drag;if(Jt=gt._x,mn=gt._y,Jt||mn){let{left:Ye,top:et,width:Ve,height:Be}=P.select,qt=P.scales[Ne].ori,nn=P.posToVal,bn,Ct,Lt,gr,jn,Cr=we!=null&&Ce(we,Ne),Jr=Ae!=null&&Re(Ae,Ke);Cr&&Jt?(qt==0?(bn=Ye,Ct=Ve):(bn=et,Ct=Be),Lt=E[we],gr=Z(nn(bn,Ne),Lt,ae,0),jn=Z(nn(bn+Ct,Ne),Lt,ae,0),_l(Aa(gr,jn),Qn(jn-gr))):_l(0,ae),Jr&&mn?(qt==1?(bn=Ye,Ct=Ve):(bn=et,Ct=Be),Lt=E[Ae],gr=ee(nn(bn,Ke),Lt,ve,0),jn=ee(nn(bn+Ct,Ke),Lt,ve,0),Al(Aa(gr,jn),Qn(jn-gr))):Al(0,ve)}else bd()}else{let we=Qn(wl-Ku),Ae=Qn(hd-cs);if($.ori==1){let Ke=we;we=Ae,Ae=Ke}Jt=xt.x&&we>=xt.dist,mn=xt.y&&Ae>=xt.dist;let Ce=xt.uni;Ce!=null?Jt&&mn&&(Jt=we>=Ce,mn=Ae>=Ce,!Jt&&!mn&&(Ae>we?mn=!0:Jt=!0)):xt.x&&xt.y&&(Jt||mn)&&(Jt=mn=!0);let Re,Ne;Jt&&($.ori==0?(Re=Vr,Ne=jt):(Re=Ra,Ne=kt),_l(Aa(Re,Ne),Qn(Ne-Re)),mn||Al(0,ve)),mn&&($.ori==1?(Re=Vr,Ne=jt):(Re=Ra,Ne=kt),Al(Aa(Re,Ne),Qn(Ne-Re)),Jt||_l(0,ae)),!Jt&&!mn&&(_l(0,0),Al(0,0))}if(xt._x=Jt,xt._y=mn,P==null){if(I){if(cm!=null){let[we,Ae]=gn.scales;gn.values[0]=we!=null?$i($.ori==0?jt:kt,we):null,gn.values[1]=Ae!=null?$i($.ori==1?jt:kt,Ae):null}ms(f_,r,jt,kt,ze,je,H)}if(io){let we=I&&gn.setSeries,Ae=mi.prox;lo==null?vi<=Ae&&Hr(Na,hs,!0,we):vi>Ae?Hr(null,hs,!0,we):Na!=lo&&Hr(Na,hs,!0,we)}}vr&&(V.idx=H,vd()),N!==!1&&Mn("setCursor")}let da=null;Object.defineProperty(r,"rect",{get(){return da==null&&Ol(!1),da}});function Ol(P=!1){P?da=null:(da=w.getBoundingClientRect(),Mn("syncRect",da))}function am(P,N,I,H,te,ae,ve){X._lock||fa&&P!=null&&P.movementX==0&&P.movementY==0||(yd(P,N,I,H,te,ae,ve,!1,P!=null),P!=null?uo(null,!0,!0):uo(N,!0,!1))}function yd(P,N,I,H,te,ae,ve,we,Ae){if(da==null&&Ol(!1),pi(P),P!=null)I=P.clientX-da.left,H=P.clientY-da.top;else{if(I<0||H<0){jt=-10,kt=-10;return}let[Ce,Re]=gn.scales,Ne=N.cursor.sync,[Ke,gt]=Ne.values,[Ye,et]=Ne.scales,[Ve,Be]=gn.match,qt=N.axes[0].side%2==1,nn=$.ori==0?ze:je,bn=$.ori==1?ze:je,Ct=qt?ae:te,Lt=qt?te:ae,gr=qt?H:I,jn=qt?I:H;if(Ye!=null?I=Ve(Ce,Ye)?c(Ke,E[Ce],nn,0):-10:I=nn*(gr/Ct),et!=null?H=Be(Re,et)?c(gt,E[Re],bn,0):-10:H=bn*(jn/Lt),$.ori==1){let Cr=I;I=H,H=Cr}}Ae&&(N==null||N.cursor.event.type==f_)&&((I<=1||I>=ze-1)&&(I=Gl(I,ze)),(H<=1||H>=je-1)&&(H=Gl(H,je))),we?(Ku=I,cs=H,[Vr,Ra]=X.move(r,I,H)):(jt=I,kt=H)}const gd={width:0,height:0,left:0,top:0};function bd(){ds(gd,!1)}let om,sm,lm,um;function Yu(P,N,I,H,te,ae,ve){fa=!0,Jt=mn=xt._x=xt._y=!1,yd(P,N,I,H,te,ae,ve,!0,!1),P!=null&&(pt(d_,gO,ps,!1),ms(w5,r,Vr,Ra,ze,je,null));let{left:we,top:Ae,width:Ce,height:Re}=Ot;om=we,sm=Ae,lm=Ce,um=Re}function ps(P,N,I,H,te,ae,ve){fa=xt._x=xt._y=!1,yd(P,N,I,H,te,ae,ve,!1,!0);let{left:we,top:Ae,width:Ce,height:Re}=Ot,Ne=Ce>0||Re>0,Ke=om!=we||sm!=Ae||lm!=Ce||um!=Re;if(Ne&&Ke&&ds(Ot),xt.setScale&&Ne&&Ke){let gt=we,Ye=Ce,et=Ae,Ve=Re;if($.ori==1&&(gt=Ae,Ye=Re,et=we,Ve=Ce),Jt&&Zr(j,$i(gt,j),$i(gt+Ye,j)),mn)for(let Be in E){let qt=E[Be];Be!=j&&qt.from==null&&qt.min!=Kt&&Zr(Be,$i(et+Ve,Be),$i(et,Be))}bd()}else X.lock&&(X._lock=!X._lock,uo(N,!0,P!=null));P!=null&&(kn(d_,gO),ms(d_,r,jt,kt,ze,je,null))}function h0(P,N,I,H,te,ae,ve){if(X._lock)return;pi(P);let we=fa;if(fa){let Ae=!0,Ce=!0,Re=10,Ne,Ke;$.ori==0?(Ne=Jt,Ke=mn):(Ne=mn,Ke=Jt),Ne&&Ke&&(Ae=jt<=Re||jt>=ze-Re,Ce=kt<=Re||kt>=je-Re),Ne&&Ae&&(jt=jt{let te=gn.match[2];I=te(r,N,I),I!=-1&&Hr(I,H,!0,!1)},be&&(pt(w5,w,Yu),pt(f_,w,am),pt(_5,w,P=>{pi(P),Ol(!1)}),pt(A5,w,h0),pt(O5,w,xd),TO.add(r),r.syncRect=Ol);const Tl=r.hooks=e.hooks||{};function Mn(P,N,I){ls?Ur.push([P,N,I]):P in Tl&&Tl[P].forEach(H=>{H.call(null,r,N,I)})}(e.plugins||[]).forEach(P=>{for(let N in P.hooks)Tl[N]=(Tl[N]||[]).concat(P.hooks[N])});const fo=(P,N,I)=>I,gn=Hn({key:null,setSeries:!1,filters:{pub:L5,sub:L5},scales:[j,_[1]?_[1].scale:null],match:[z5,z5,fo],values:[null,null]},X.sync);gn.match.length==2&&gn.match.push(fo),X.sync=gn;const cm=gn.key,wd=W4(cm);function ms(P,N,I,H,te,ae,ve){gn.filters.pub(P,N,I,H,te,ae,ve)&&wd.pub(P,N,I,H,te,ae,ve)}wd.sub(r);function fm(P,N,I,H,te,ae,ve){gn.filters.sub(P,N,I,H,te,ae,ve)&&co[P](null,N,I,H,te,ae,ve)}r.pub=fm;function El(){wd.unsub(r),TO.delete(r),Zt.clear(),SO(Qy,Uc,Sd),d.remove(),ye==null||ye.remove(),Mn("destroy")}r.destroy=El;function ho(){Mn("init",e,t),En(t||e.data,!1),J[j]?Fu(j,J[j]):zu(),ro=Ot.show&&(Ot.width>0||Ot.height>0),no=vr=!0,rs(e.width,e.height)}return _.forEach(la),M.forEach(ad),n?n instanceof HTMLElement?(n.appendChild(d),ho()):n(r,ho):ho(),r}tr.assign=Hn;tr.fmtNum=u2;tr.rangeNum=Zy;tr.rangeLog=Hg;tr.rangeAsinh=s2;tr.orient=Ru;tr.pxRatio=Et;tr.join=doe;tr.fmtDate=f2,tr.tzDate=_oe;tr.sync=W4;{tr.addGap=ase,tr.clipGaps=Kg;let e=tr.paths={points:n6};e.linear=i6,e.stepped=lse,e.bars=use,e.spline=fse}const g2="";class Qg extends Error{constructor(n){super(`401 Unauthorized: ${n}`);iC(this,"status",401);this.name="UnauthorizedError"}}async function Mc(e,t){const n=await fetch(`${g2}${e}`,{...t,headers:{Accept:"application/json",...(t==null?void 0:t.headers)??{}}});if(n.status===401)throw De.getState().setAuthRequired(!0),new Qg(e);if(!n.ok){const r=await n.text().catch(()=>"");throw new Error(`${n.status} ${n.statusText}: ${r||e}`)}return n.json()}async function wse(){try{return(await fetch(`${g2}/health`,{headers:{Accept:"application/json"},cache:"no-store"})).status===401?"unauthorized":"ok"}catch{return"unreachable"}}async function _se(e){const t=await fetch(`${g2}/mtplx/browser-auth`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({api_key:e,next:"/dashboard/"})});if(t.status===401)throw new Qg("/mtplx/browser-auth");if(!t.ok){const n=await t.text().catch(()=>"");throw new Error(`${t.status} ${t.statusText}: ${n||"sign-in failed"}`)}}async function Nv(e,t){return Mc(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t??{})})}const ed={getHealth:()=>Mc("/health"),getMetrics:()=>Mc("/metrics"),getSessions:()=>Mc("/admin/sessions"),getPrefillHistory:()=>Mc("/v1/mtplx/prefill_history"),getSnapshot:()=>Mc("/v1/mtplx/snapshot"),postSettings:e=>Nv("/v1/mtplx/settings",e),postCancel:e=>Nv(`/v1/mtplx/cancel/${encodeURIComponent(e)}`,{}),postClearSession:e=>Nv(`/admin/sessions/${encodeURIComponent(e)}/clear`,{}),postClearCache:()=>Nv("/admin/cache/clear",{})};function Ase(){return Wz({queryKey:["metrics"],queryFn:ed.getMetrics,refetchInterval:1e3,refetchOnWindowFocus:!1})}function b2(){return Wz({queryKey:["prefillHistory"],queryFn:ed.getPrefillHistory,refetchInterval:5e3,refetchOnWindowFocus:!1})}function l6(e,t,n,r){var d;const i=e.axes[n];if(r>1)return i._size??50;let s=(((d=i.ticks)==null?void 0:d.size)??10)+(i.gap??5);const l=e.ctx.font,c=Array.isArray(i.font)?i.font[0]:i.font;c&&(e.ctx.font=c);let f=0;for(const m of t??[])f=Math.max(f,e.ctx.measureText(m).width);return e.ctx.font=l,s+=f/devicePixelRatio,Math.ceil(s)}function Ose(){const{data:e}=b2(),t=K.useRef(null),n=K.useRef(null),{aligned:r,mean:i}=K.useMemo(()=>{const s=[],l=[],c=(e==null?void 0:e.history)??[];let f=0,d=0;return c.forEach(m=>{typeof m.prefill_tok_s=="number"&&(s.push(m.t),l.push(m.prefill_tok_s),f+=m.prefill_tok_s,d+=1)}),{aligned:[s,l],mean:d>0?f/d:null}},[e]);return K.useEffect(()=>{var d,m;const s=t.current;if(!s)return;const l={width:s.clientWidth,height:140,padding:[4,8,4,0],cursor:{drag:{x:!1,y:!1,setScale:!1}},scales:{x:{time:!0},y:{range:(p,v,b)=>[Math.max(0,v*.85),b*1.1]}},axes:[{stroke:"rgba(200,210,220,0.4)",show:!0,gap:4,size:22},{stroke:"rgba(200,210,220,0.4)",values:(p,v)=>v.map(b=>`${b.toFixed(0)}`),size:l6}],legend:{show:!1},series:[{},{stroke:"rgba(79,182,243,0.95)",width:1.6,fill:"rgba(79,182,243,0.15)",points:{show:!1},paths:(m=(d=tr.paths).spline)==null?void 0:m.call(d)}]},c=new tr(l,r,s);n.current=c;const f=()=>c.setSize({width:s.clientWidth,height:140});return window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f),c.destroy(),n.current=null}},[]),K.useEffect(()=>{var s;(s=n.current)==null||s.setData(r)},[r]),T.jsx(ct,{title:"Prefill tok/s · last 100",subtitle:i!==null?`mean ${On(i)} tok/s`:"no prefill samples yet",children:T.jsx("div",{ref:t,className:"w-full"})})}/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xse=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),l6=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + */const Tse=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),u6=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var Sse={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"};/** + */var Ese={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.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wse=K.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:l,...c},f)=>K.createElement("svg",{ref:f,...Sse,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:l6("lucide",i),...c},[...l.map(([d,m])=>K.createElement(d,m)),...Array.isArray(s)?s:[s]]));/** + */const Mse=K.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:l,...c},f)=>K.createElement("svg",{ref:f,...Ese,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:u6("lucide",i),...c},[...l.map(([d,m])=>K.createElement(d,m)),...Array.isArray(s)?s:[s]]));/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const un=(e,t)=>{const n=K.forwardRef(({className:r,...i},s)=>K.createElement(wse,{ref:s,iconNode:t,className:l6(`lucide-${xse(e)}`,r),...i}));return n.displayName=`${e}`,n};/** + */const un=(e,t)=>{const n=K.forwardRef(({className:r,...i},s)=>K.createElement(Mse,{ref:s,iconNode:t,className:u6(`lucide-${Tse(e)}`,r),...i}));return n.displayName=`${e}`,n};/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _se=un("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"}]]);/** + */const jse=un("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.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ase=un("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const Cse=un("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ose=un("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const Pse=un("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Tse=un("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + */const Dse=un("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const EO=un("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"}]]);/** + */const MO=un("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.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ese=un("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** + */const Rse=un("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Mse=un("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/** + */const Nse=un("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jse=un("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"}]]);/** + */const kse=un("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.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Pse=un("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/** + */const Lse=un("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cse=un("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/** + */const zse=un("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const u6=un("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + */const c6=un("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Dse=un("MemoryStick",[["path",{d:"M6 19v-3",key:"1nvgqn"}],["path",{d:"M10 19v-3",key:"iu8nkm"}],["path",{d:"M14 19v-3",key:"kcehxu"}],["path",{d:"M18 19v-3",key:"1vh91z"}],["path",{d:"M8 11V9",key:"63erz4"}],["path",{d:"M16 11V9",key:"fru6f3"}],["path",{d:"M12 11V9",key:"ha00sb"}],["path",{d:"M2 15h20",key:"16ne18"}],["path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z",key:"lhddv3"}]]);/** + */const $se=un("MemoryStick",[["path",{d:"M6 19v-3",key:"1nvgqn"}],["path",{d:"M10 19v-3",key:"iu8nkm"}],["path",{d:"M14 19v-3",key:"kcehxu"}],["path",{d:"M18 19v-3",key:"1vh91z"}],["path",{d:"M8 11V9",key:"63erz4"}],["path",{d:"M16 11V9",key:"fru6f3"}],["path",{d:"M12 11V9",key:"ha00sb"}],["path",{d:"M2 15h20",key:"16ne18"}],["path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z",key:"lhddv3"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Rse=un("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** + */const Bse=un("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Nse=un("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const qse=un("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kse=un("SlidersVertical",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/** + */const Ise=un("SlidersVertical",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Lse=un("Snowflake",[["path",{d:"m10 20-1.25-2.5L6 18",key:"18frcb"}],["path",{d:"M10 4 8.75 6.5 6 6",key:"7mghy3"}],["path",{d:"m14 20 1.25-2.5L18 18",key:"1chtki"}],["path",{d:"m14 4 1.25 2.5L18 6",key:"1b4wsy"}],["path",{d:"m17 21-3-6h-4",key:"15hhxa"}],["path",{d:"m17 3-3 6 1.5 3",key:"11697g"}],["path",{d:"M2 12h6.5L10 9",key:"kv9z4n"}],["path",{d:"m20 10-1.5 2 1.5 2",key:"1swlpi"}],["path",{d:"M22 12h-6.5L14 15",key:"1mxi28"}],["path",{d:"m4 10 1.5 2L4 14",key:"k9enpj"}],["path",{d:"m7 21 3-6-1.5-3",key:"j8hb9u"}],["path",{d:"m7 3 3 6h4",key:"1otusx"}]]);/** + */const Use=un("Snowflake",[["path",{d:"m10 20-1.25-2.5L6 18",key:"18frcb"}],["path",{d:"M10 4 8.75 6.5 6 6",key:"7mghy3"}],["path",{d:"m14 20 1.25-2.5L18 18",key:"1chtki"}],["path",{d:"m14 4 1.25 2.5L18 6",key:"1b4wsy"}],["path",{d:"m17 21-3-6h-4",key:"15hhxa"}],["path",{d:"m17 3-3 6 1.5 3",key:"11697g"}],["path",{d:"M2 12h6.5L10 9",key:"kv9z4n"}],["path",{d:"m20 10-1.5 2 1.5 2",key:"1swlpi"}],["path",{d:"M22 12h-6.5L14 15",key:"1mxi28"}],["path",{d:"m4 10 1.5 2L4 14",key:"k9enpj"}],["path",{d:"m7 21 3-6-1.5-3",key:"j8hb9u"}],["path",{d:"m7 3 3 6h4",key:"1otusx"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zse=un("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** + */const Vse=un("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $se=un("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** + */const Hse=un("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Bse=un("Thermometer",[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]]);/** + */const Fse=un("Thermometer",[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qse=un("Trash",[["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"}]]);/** + */const Gse=un("Trash",[["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"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ise=un("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/** + */const Kse=un("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Use=un("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/** + */const Yse=un("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Vse=un("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/** + */const Xse=un("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const c6=un("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** + */const f6=un("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** * @license lucide-react v0.470.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Hse=un("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function Fse(){const e=De(p=>p.sessionBank),t=De(p=>p.sessions),n=De(p=>p.setSessionFilter),r=De(p=>p.sessionFilter),i=(e==null?void 0:e.max_entries)??8,s=(e==null?void 0:e.prefixes)??[],l=((t==null?void 0:t.sessions)??[]).reduce((p,v)=>(p[v.session_id]=v,p),{}),c=qf(),f=sg({mutationFn:p=>ed.postClearSession(p),onSuccess:()=>{c.invalidateQueries({queryKey:["sessions"]})}}),d=Array.from({length:i},(p,v)=>s[v]??null),m=(e==null?void 0:e.total_nbytes)??0;return T.jsx(ct,{title:"SessionBank · warm prefix cache",subtitle:`${s.length} / ${i} slots · ${li(m)} total${e!=null&&e.last_miss_reason?` · last miss: ${e.last_miss_reason}`:""}`,children:T.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:d.map((p,v)=>T.jsx(Gse,{index:v,slot:p,session:p?l[p.session_id]:void 0,isFiltered:!!(p&&r===p.session_id),onClickSession:b=>n(b),onEvict:b=>f.mutate(b)},v))})})}function Gse({index:e,slot:t,session:n,isFiltered:r,onClickSession:i,onEvict:s}){if(!t)return T.jsxs("div",{className:"rounded-lg border border-dashed border-[var(--border-soft)] bg-[var(--bg-elevated)] aspect-square p-3 grid place-items-center text-[var(--text-muted)] text-xs",children:["slot ",e+1," · empty"]});const l=Date.now()/1e3-t.last_access_s,c=!!(n!=null&&n.in_flight),f=l<30;return T.jsxs("button",{type:"button",onClick:()=>i(t.session_id),className:"group relative text-left rounded-lg border bg-[var(--bg-elevated)] p-3 transition-colors "+(r?"border-[var(--accent)] shadow-[0_0_0_1px_var(--accent)]":f?"border-[var(--accent)]/40 hover:border-[var(--accent)]":"border-[var(--border-soft)] hover:border-[var(--text-muted)]"),children:[T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsxs("span",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:["slot ",e+1]}),c?T.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-[var(--accent)]",children:[T.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--accent)] animate-pulse"}),"in flight"]}):f?T.jsx(Hse,{className:"size-3 text-[var(--accent-warm)]"}):T.jsx(Lse,{className:"size-3 text-[var(--accent-cool)]"})]}),T.jsx("div",{className:"text-xs font-mono text-[var(--text-primary)] mt-1 truncate",children:bu(t.session_id,24)}),T.jsxs("dl",{className:"mt-2 grid grid-cols-2 gap-x-2 gap-y-1 text-[11px]",children:[T.jsx(kv,{label:"prefix",value:We(t.prefix_len)}),T.jsx(kv,{label:"hits",value:We(t.hits)}),T.jsx(kv,{label:"bytes",value:li(t.nbytes)}),T.jsx(kv,{label:"age",value:ZO(t.last_access_s)})]}),T.jsx("button",{onClick:d=>{d.stopPropagation(),s(t.session_id)},className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 text-[var(--text-muted)] hover:text-[var(--accent-hot)] transition-opacity",title:"Evict this slot",children:T.jsx(c6,{className:"size-3.5"})})]})}function kv({label:e,value:t}){return T.jsxs("div",{className:"flex items-baseline justify-between gap-1",children:[T.jsx("dt",{className:"text-[var(--text-muted)] uppercase tracking-wider text-[9px]",children:e}),T.jsx("dd",{className:"text-[var(--text-primary)] tabular-nums",children:t})]})}const Kse=[{upper:.05,label:"<50ms"},{upper:.1,label:"50-100ms"},{upper:.25,label:"100-250ms"},{upper:.5,label:"250-500ms"},{upper:1,label:"0.5-1s"},{upper:2,label:"1-2s"},{upper:5,label:"2-5s"},{upper:1/0,label:">5s"}];function Yse(){const{data:e}=g2(),t=(e==null?void 0:e.history)??[],n=Kse.map(c=>({...c,count:0}));t.forEach(c=>{if(typeof c.ttft_s!="number")return;const f=n.find(d=>c.ttft_s<=d.upper);f&&(f.count+=1)});const r=t.map(c=>c.ttft_s).filter(c=>typeof c=="number").sort((c,f)=>c-f),i=r[Math.floor(r.length*.5)]??null,s=r[Math.floor(r.length*.95)]??null,l=r.length>0;return T.jsx(ct,{title:"TTFT distribution",subtitle:l?`p50 ${Zn(i)} · p95 ${Zn(s)} · n=${r.length}`:"no TTFT samples yet",children:T.jsx("div",{className:"h-[200px]",children:l?T.jsx(wg,{width:"100%",height:"100%",children:T.jsxs(n2,{data:n,margin:{top:4,right:20,left:0,bottom:0},children:[T.jsx(Ip,{stroke:"rgba(255,255,255,0.05)"}),T.jsx(pl,{dataKey:"label",stroke:"rgba(200,210,220,0.6)",tick:{fontSize:10}}),T.jsx(Wo,{stroke:"rgba(200,210,220,0.6)",allowDecimals:!1}),T.jsx(ji,{contentStyle:{background:"var(--bg-elevated)",border:"1px solid var(--border-soft)",borderRadius:8,fontSize:12}}),T.jsx(oa,{dataKey:"count",fill:"rgba(155,118,233,0.85)",radius:[6,6,0,0]})]})}):T.jsx("div",{className:"h-full grid place-items-center text-[var(--text-muted)] text-sm",children:"Generate a few requests to populate TTFT."})})})}function Xse(){return T.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[T.jsx("div",{className:"col-span-12",children:T.jsx(Fse,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-4",children:T.jsx(GV,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-4",children:T.jsx(KV,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-4",children:T.jsx(YV,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-7",children:T.jsx(xae,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-5",children:T.jsx(bse,{})}),T.jsx("div",{className:"col-span-12",children:T.jsx(Yse,{})})]})}const iL=["depth","temperature","top_p","top_k","presence_penalty","max_response_tokens","stream_interval","enable_thinking","reasoning_parser"],Wse=250,Qse=6e3;function Zse(){return T.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[T.jsx("div",{className:"col-span-12 lg:col-span-7",children:T.jsx(Jse,{})}),T.jsxs("div",{className:"col-span-12 lg:col-span-5",children:[T.jsx(nle,{}),T.jsx("div",{className:"mt-4",children:T.jsx(rle,{})})]})]})}function Jse(){const e=De(w=>w.settings),[t,n]=K.useState(e),[r,i]=K.useState(()=>new Set),[s,l]=K.useState([]),c=K.useRef(t);c.current=t;const f=De(w=>w.mergeSettings),d=qf(),m=sg({mutationFn:w=>ed.postSettings(w),onSuccess:w=>{const S={};iL.forEach(x=>{x in w&&(S[x]=w[x])}),f(S),d.invalidateQueries({queryKey:["snapshot"]})}}),[p,v]=K.useState(null);K.useEffect(()=>{if(!e)return;const w=c.current;if(!w){n(e);return}const S=iL.filter(x=>!r.has(x)&&w[x]!==e[x]);S.length!==0&&(n(x=>{if(!x)return e;const A={...x};return S.forEach(_=>{A[_]=e[_]}),A}),l(S))},[e,r]),K.useEffect(()=>{if(s.length===0)return;const w=window.setTimeout(()=>l([]),Qse);return()=>window.clearTimeout(w)},[s]);const b=(w,S)=>{n(x=>x&&{...x,[w]:S}),i(x=>{if(x.has(w))return x;const A=new Set(x);return A.add(w),A})};return K.useEffect(()=>{if(!t||!e||r.size===0)return;const w={};r.forEach(A=>{t[A]!==e[A]&&(w[A]=t[A])});const S=Object.keys(w);if(S.length===0){i(new Set);return}const x=window.setTimeout(()=>{m.mutate(w,{onSuccess:A=>{v(A.applied??w),i(_=>{const M=new Set(_);return S.forEach(E=>{var O;((O=c.current)==null?void 0:O[E])===w[E]&&M.delete(E)}),M})}})},Wse);return()=>window.clearTimeout(x)},[t]),t?T.jsx(ct,{title:"Defaults",subtitle:"server-side defaults applied to every chat completion",action:m.isPending?T.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"applying…"}):p?T.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["applied · ",Object.keys(p).join(", ")]}):void 0,children:T.jsxs("div",{className:"space-y-4",children:[T.jsx(Tc,{label:"depth",value:t.depth,min:0,max:5,onChange:w=>b("depth",w)}),T.jsx(Tc,{label:"temperature",value:t.temperature,min:0,max:2,step:.05,onChange:w=>b("temperature",w)}),T.jsx(Tc,{label:"top_p",value:t.top_p,min:0,max:1,step:.01,onChange:w=>b("top_p",w)}),T.jsx(Tc,{label:"top_k",value:t.top_k,min:0,max:2e3,step:1,onChange:w=>b("top_k",w)}),T.jsx(Tc,{label:"presence_penalty",value:t.presence_penalty??0,min:0,max:2,step:.05,onChange:w=>b("presence_penalty",w),description:"0 is exact (best for coding); 0.5-1.5 discourages repetition."}),T.jsx(Tc,{label:"stream_interval",value:t.stream_interval,min:1,max:32,step:1,onChange:w=>b("stream_interval",w)}),T.jsx(ele,{label:"enable_thinking",value:t.enable_thinking,onChange:w=>b("enable_thinking",w),description:"When on, requests default to including reasoning content."}),T.jsx(tle,{label:"reasoning_parser",value:t.reasoning_parser,options:["qwen3","poolside_v1","none"],onChange:w=>b("reasoning_parser",w)}),s.length>0?T.jsxs("div",{className:"text-xs text-[var(--accent-warm)]",children:["updated on the server: ",s.join(", ")]}):null,m.isError?T.jsx("div",{className:"text-xs text-[var(--accent-hot)]",children:String(m.error.message)}):null]})}):T.jsx(ct,{title:"Defaults",subtitle:"loading server settings...",children:T.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:"Settings will appear once the dashboard receives its first snapshot."})})}function Tc({label:e,value:t,min:n,max:r,step:i=1,onChange:s,description:l}){return T.jsxs("label",{className:"block",children:[T.jsxs("div",{className:"flex items-baseline justify-between text-xs text-[var(--text-muted)]",children:[T.jsx("span",{children:e}),T.jsx("span",{className:"tabular-nums text-[var(--text-primary)]",children:Number(t).toFixed(i<1?2:0)})]}),T.jsx("input",{type:"range",min:n,max:r,step:i,value:t,onChange:c=>s(Number(c.target.value)),className:"w-full mt-1 accent-[var(--accent)]"}),l?T.jsx("div",{className:"mt-0.5 text-xs text-[var(--text-muted)]",children:l}):null]})}function ele({label:e,value:t,onChange:n,description:r}){return T.jsxs("label",{className:"flex items-start justify-between gap-3",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-[var(--text-primary)]",children:e}),r?T.jsx("div",{className:"text-xs text-[var(--text-muted)]",children:r}):null]}),T.jsx("button",{type:"button",onClick:()=>n(!t),className:`h-5 w-9 rounded-full transition-colors relative shrink-0 ${t?"bg-[var(--accent)]":"bg-[var(--border-soft)]"}`,"aria-pressed":t,children:T.jsx("span",{className:`absolute top-0.5 h-4 w-4 rounded-full bg-white transition-transform ${t?"translate-x-4":"translate-x-0.5"}`})})]})}function tle({label:e,value:t,options:n,onChange:r}){return T.jsxs("label",{className:"block",children:[T.jsx("div",{className:"text-xs text-[var(--text-muted)]",children:e}),T.jsx("select",{value:t,onChange:i=>r(i.target.value),className:"mt-1 w-full bg-[var(--bg-elevated)] border border-[var(--border-soft)] rounded px-2 py-1.5 text-sm text-[var(--text-primary)]",children:n.map(i=>T.jsx("option",{value:i,children:i},i))})]})}function nle(){const e=De(i=>i.modelId),t=De(i=>i.profileName),n=`mtplx serve --model ${e??""} --profile ${t??""} --port 8000`,r=()=>{var i;typeof navigator<"u"&&((i=navigator.clipboard)==null||i.writeText(n))};return T.jsxs(ct,{title:"Restart required",subtitle:"profile · model · MTP · host · port can only change at startup",children:[T.jsxs("p",{className:"text-xs text-[var(--text-muted)] mb-3",children:["These settings live on ",T.jsx("code",{children:"state.args"})," but require a model reload to take effect. The dashboard refuses to mutate them through the live settings endpoint. Copy the CLI command instead."]}),T.jsx("div",{className:"rounded border border-[var(--border-soft)] bg-[var(--bg-elevated)] px-3 py-2 font-mono text-xs text-[var(--text-primary)] overflow-x-auto",children:n}),T.jsxs("button",{type:"button",onClick:r,className:"mt-3 inline-flex items-center gap-1.5 text-xs text-[var(--accent-cool)] hover:text-[var(--accent)]",children:[T.jsx(Tse,{className:"size-3.5"}),"copy restart command"]})]})}function rle(){const e=qf(),[t,n]=K.useState(!1),r=sg({mutationFn:()=>ed.postClearCache(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),n(!1)}});return T.jsxs(ct,{title:"Admin actions",subtitle:"bank-wide controls",children:[T.jsxs("button",{type:"button",onClick:()=>n(!0),className:"inline-flex items-center gap-2 text-sm text-[var(--accent-hot)] hover:bg-[var(--accent-hot)]/10 rounded px-3 py-2 transition-colors",children:[T.jsx(qse,{className:"size-4"}),"Clear all SessionBank entries"]}),t?T.jsxs("div",{className:"mt-3 p-3 rounded-md border border-[var(--accent-hot)]/40 bg-[var(--accent-hot)]/5 text-sm text-[var(--text-primary)]",children:[T.jsx("p",{children:"Evict every cached prefix? Future requests will pay full prefill until the cache refills."}),T.jsxs("div",{className:"mt-3 flex gap-2",children:[T.jsx("button",{type:"button",onClick:()=>r.mutate(),disabled:r.isPending,className:"text-xs px-3 py-1 rounded bg-[var(--accent-hot)] text-white disabled:opacity-50",children:r.isPending?"Clearing...":"Yes, clear cache"}),T.jsx("button",{type:"button",onClick:()=>n(!1),className:"text-xs px-3 py-1 rounded border border-[var(--border-soft)] text-[var(--text-muted)]",children:"Cancel"})]})]}):null]})}const b2=K.createContext({});function Vp(e){const t=K.useRef(null);return t.current===null&&(t.current=e()),t.current}const Zg=K.createContext(null),Hp=K.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class ile extends K.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function ale({children:e,isPresent:t}){const n=K.useId(),r=K.useRef(null),i=K.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=K.useContext(Hp);return K.useInsertionEffect(()=>{const{width:l,height:c,top:f,left:d}=i.current;if(t||!r.current||!l||!c)return;r.current.dataset.motionPopId=n;const m=document.createElement("style");return s&&(m.nonce=s),document.head.appendChild(m),m.sheet&&m.sheet.insertRule(` + */const Wse=un("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function Qse(){const e=De(p=>p.sessionBank),t=De(p=>p.sessions),n=De(p=>p.setSessionFilter),r=De(p=>p.sessionFilter),i=(e==null?void 0:e.max_entries)??8,s=(e==null?void 0:e.prefixes)??[],l=((t==null?void 0:t.sessions)??[]).reduce((p,v)=>(p[v.session_id]=v,p),{}),c=qf(),f=sg({mutationFn:p=>ed.postClearSession(p),onSuccess:()=>{c.invalidateQueries({queryKey:["sessions"]})}}),d=Array.from({length:i},(p,v)=>s[v]??null),m=(e==null?void 0:e.total_nbytes)??0;return T.jsx(ct,{title:"SessionBank · warm prefix cache",subtitle:`${s.length} / ${i} slots · ${li(m)} total${e!=null&&e.last_miss_reason?` · last miss: ${e.last_miss_reason}`:""}`,children:T.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:d.map((p,v)=>T.jsx(Zse,{index:v,slot:p,session:p?l[p.session_id]:void 0,isFiltered:!!(p&&r===p.session_id),onClickSession:b=>n(b),onEvict:b=>f.mutate(b)},v))})})}function Zse({index:e,slot:t,session:n,isFiltered:r,onClickSession:i,onEvict:s}){if(!t)return T.jsxs("div",{className:"rounded-lg border border-dashed border-[var(--border-soft)] bg-[var(--bg-elevated)] aspect-square p-3 grid place-items-center text-[var(--text-muted)] text-xs",children:["slot ",e+1," · empty"]});const l=Date.now()/1e3-t.last_access_s,c=!!(n!=null&&n.in_flight),f=l<30;return T.jsxs("button",{type:"button",onClick:()=>i(t.session_id),className:"group relative text-left rounded-lg border bg-[var(--bg-elevated)] p-3 transition-colors "+(r?"border-[var(--accent)] shadow-[0_0_0_1px_var(--accent)]":f?"border-[var(--accent)]/40 hover:border-[var(--accent)]":"border-[var(--border-soft)] hover:border-[var(--text-muted)]"),children:[T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsxs("span",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:["slot ",e+1]}),c?T.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-[var(--accent)]",children:[T.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--accent)] animate-pulse"}),"in flight"]}):f?T.jsx(Wse,{className:"size-3 text-[var(--accent-warm)]"}):T.jsx(Use,{className:"size-3 text-[var(--accent-cool)]"})]}),T.jsx("div",{className:"text-xs font-mono text-[var(--text-primary)] mt-1 truncate",children:bu(t.session_id,24)}),T.jsxs("dl",{className:"mt-2 grid grid-cols-2 gap-x-2 gap-y-1 text-[11px]",children:[T.jsx(kv,{label:"prefix",value:Xe(t.prefix_len)}),T.jsx(kv,{label:"hits",value:Xe(t.hits)}),T.jsx(kv,{label:"bytes",value:li(t.nbytes)}),T.jsx(kv,{label:"age",value:JO(t.last_access_s)})]}),T.jsx("button",{onClick:d=>{d.stopPropagation(),s(t.session_id)},className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 text-[var(--text-muted)] hover:text-[var(--accent-hot)] transition-opacity",title:"Evict this slot",children:T.jsx(f6,{className:"size-3.5"})})]})}function kv({label:e,value:t}){return T.jsxs("div",{className:"flex items-baseline justify-between gap-1",children:[T.jsx("dt",{className:"text-[var(--text-muted)] uppercase tracking-wider text-[9px]",children:e}),T.jsx("dd",{className:"text-[var(--text-primary)] tabular-nums",children:t})]})}const Jse=[{upper:.05,label:"<50ms"},{upper:.1,label:"50-100ms"},{upper:.25,label:"100-250ms"},{upper:.5,label:"250-500ms"},{upper:1,label:"0.5-1s"},{upper:2,label:"1-2s"},{upper:5,label:"2-5s"},{upper:1/0,label:">5s"}];function ele(){const{data:e}=b2(),t=(e==null?void 0:e.history)??[],n=Jse.map(c=>({...c,count:0}));t.forEach(c=>{if(typeof c.ttft_s!="number")return;const f=n.find(d=>c.ttft_s<=d.upper);f&&(f.count+=1)});const r=t.map(c=>c.ttft_s).filter(c=>typeof c=="number").sort((c,f)=>c-f),i=r[Math.floor(r.length*.5)]??null,s=r[Math.floor(r.length*.95)]??null,l=r.length>0;return T.jsx(ct,{title:"TTFT distribution",subtitle:l?`p50 ${Nn(i)} · p95 ${Nn(s)} · n=${r.length}`:"no TTFT samples yet",children:T.jsx("div",{className:"h-[200px]",children:l?T.jsx(wg,{width:"100%",height:"100%",children:T.jsxs(r2,{data:n,margin:{top:4,right:20,left:0,bottom:0},children:[T.jsx(Ip,{stroke:"rgba(255,255,255,0.05)"}),T.jsx(pl,{dataKey:"label",stroke:"rgba(200,210,220,0.6)",tick:{fontSize:10}}),T.jsx(Wo,{stroke:"rgba(200,210,220,0.6)",allowDecimals:!1}),T.jsx(ji,{contentStyle:{background:"var(--bg-elevated)",border:"1px solid var(--border-soft)",borderRadius:8,fontSize:12}}),T.jsx(oa,{dataKey:"count",fill:"rgba(155,118,233,0.85)",radius:[6,6,0,0]})]})}):T.jsx("div",{className:"h-full grid place-items-center text-[var(--text-muted)] text-sm",children:"Generate a few requests to populate TTFT."})})})}function tle(){return T.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[T.jsx("div",{className:"col-span-12",children:T.jsx(Qse,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-4",children:T.jsx(ZV,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-4",children:T.jsx(JV,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-4",children:T.jsx(eH,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-7",children:T.jsx(Tae,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-5",children:T.jsx(Ose,{})}),T.jsx("div",{className:"col-span-12",children:T.jsx(ele,{})})]})}const aL=["depth","temperature","top_p","top_k","presence_penalty","max_response_tokens","stream_interval","enable_thinking","reasoning_parser"],nle=250,rle=6e3;function ile(){return T.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[T.jsx("div",{className:"col-span-12 lg:col-span-7",children:T.jsx(ale,{})}),T.jsxs("div",{className:"col-span-12 lg:col-span-5",children:[T.jsx(lle,{}),T.jsx("div",{className:"mt-4",children:T.jsx(ule,{})})]})]})}function ale(){const e=De(w=>w.settings),[t,n]=K.useState(e),[r,i]=K.useState(()=>new Set),[s,l]=K.useState([]),c=K.useRef(t);c.current=t;const f=De(w=>w.mergeSettings),d=qf(),m=sg({mutationFn:w=>ed.postSettings(w),onSuccess:w=>{const S={};aL.forEach(x=>{x in w&&(S[x]=w[x])}),f(S),d.invalidateQueries({queryKey:["snapshot"]})}}),[p,v]=K.useState(null);K.useEffect(()=>{if(!e)return;const w=c.current;if(!w){n(e);return}const S=aL.filter(x=>!r.has(x)&&w[x]!==e[x]);S.length!==0&&(n(x=>{if(!x)return e;const A={...x};return S.forEach(_=>{A[_]=e[_]}),A}),l(S))},[e,r]),K.useEffect(()=>{if(s.length===0)return;const w=window.setTimeout(()=>l([]),rle);return()=>window.clearTimeout(w)},[s]);const b=(w,S)=>{n(x=>x&&{...x,[w]:S}),i(x=>{if(x.has(w))return x;const A=new Set(x);return A.add(w),A})};return K.useEffect(()=>{if(!t||!e||r.size===0)return;const w={};r.forEach(A=>{t[A]!==e[A]&&(w[A]=t[A])});const S=Object.keys(w);if(S.length===0){i(new Set);return}const x=window.setTimeout(()=>{m.mutate(w,{onSuccess:A=>{v(A.applied??w),i(_=>{const M=new Set(_);return S.forEach(E=>{var O;((O=c.current)==null?void 0:O[E])===w[E]&&M.delete(E)}),M})}})},nle);return()=>window.clearTimeout(x)},[t]),t?T.jsx(ct,{title:"Defaults",subtitle:"server-side defaults applied to every chat completion",action:m.isPending?T.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"applying…"}):p?T.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["applied · ",Object.keys(p).join(", ")]}):void 0,children:T.jsxs("div",{className:"space-y-4",children:[T.jsx(Tc,{label:"depth",value:t.depth,min:0,max:5,onChange:w=>b("depth",w)}),T.jsx(Tc,{label:"temperature",value:t.temperature,min:0,max:2,step:.05,onChange:w=>b("temperature",w)}),T.jsx(Tc,{label:"top_p",value:t.top_p,min:0,max:1,step:.01,onChange:w=>b("top_p",w)}),T.jsx(Tc,{label:"top_k",value:t.top_k,min:0,max:2e3,step:1,onChange:w=>b("top_k",w)}),T.jsx(Tc,{label:"presence_penalty",value:t.presence_penalty??0,min:0,max:2,step:.05,onChange:w=>b("presence_penalty",w),description:"0 is exact (best for coding); 0.5-1.5 discourages repetition."}),T.jsx(Tc,{label:"stream_interval",value:t.stream_interval,min:1,max:32,step:1,onChange:w=>b("stream_interval",w)}),T.jsx(ole,{label:"enable_thinking",value:t.enable_thinking,onChange:w=>b("enable_thinking",w),description:"When on, requests default to including reasoning content."}),T.jsx(sle,{label:"reasoning_parser",value:t.reasoning_parser,options:["qwen3","poolside_v1","none"],onChange:w=>b("reasoning_parser",w)}),s.length>0?T.jsxs("div",{className:"text-xs text-[var(--accent-warm)]",children:["updated on the server: ",s.join(", ")]}):null,m.isError?T.jsx("div",{className:"text-xs text-[var(--accent-hot)]",children:String(m.error.message)}):null]})}):T.jsx(ct,{title:"Defaults",subtitle:"loading server settings...",children:T.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:"Settings will appear once the dashboard receives its first snapshot."})})}function Tc({label:e,value:t,min:n,max:r,step:i=1,onChange:s,description:l}){return T.jsxs("label",{className:"block",children:[T.jsxs("div",{className:"flex items-baseline justify-between text-xs text-[var(--text-muted)]",children:[T.jsx("span",{children:e}),T.jsx("span",{className:"tabular-nums text-[var(--text-primary)]",children:Number(t).toFixed(i<1?2:0)})]}),T.jsx("input",{type:"range",min:n,max:r,step:i,value:t,onChange:c=>s(Number(c.target.value)),className:"w-full mt-1 accent-[var(--accent)]"}),l?T.jsx("div",{className:"mt-0.5 text-xs text-[var(--text-muted)]",children:l}):null]})}function ole({label:e,value:t,onChange:n,description:r}){return T.jsxs("label",{className:"flex items-start justify-between gap-3",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-[var(--text-primary)]",children:e}),r?T.jsx("div",{className:"text-xs text-[var(--text-muted)]",children:r}):null]}),T.jsx("button",{type:"button",onClick:()=>n(!t),className:`h-5 w-9 rounded-full transition-colors relative shrink-0 ${t?"bg-[var(--accent)]":"bg-[var(--border-soft)]"}`,"aria-pressed":t,children:T.jsx("span",{className:`absolute top-0.5 h-4 w-4 rounded-full bg-white transition-transform ${t?"translate-x-4":"translate-x-0.5"}`})})]})}function sle({label:e,value:t,options:n,onChange:r}){return T.jsxs("label",{className:"block",children:[T.jsx("div",{className:"text-xs text-[var(--text-muted)]",children:e}),T.jsx("select",{value:t,onChange:i=>r(i.target.value),className:"mt-1 w-full bg-[var(--bg-elevated)] border border-[var(--border-soft)] rounded px-2 py-1.5 text-sm text-[var(--text-primary)]",children:n.map(i=>T.jsx("option",{value:i,children:i},i))})]})}function lle(){const e=De(i=>i.modelId),t=De(i=>i.profileName),n=`mtplx serve --model ${e??""} --profile ${t??""} --port 8000`,r=()=>{var i;typeof navigator<"u"&&((i=navigator.clipboard)==null||i.writeText(n))};return T.jsxs(ct,{title:"Restart required",subtitle:"profile · model · MTP · host · port can only change at startup",children:[T.jsxs("p",{className:"text-xs text-[var(--text-muted)] mb-3",children:["These settings live on ",T.jsx("code",{children:"state.args"})," but require a model reload to take effect. The dashboard refuses to mutate them through the live settings endpoint. Copy the CLI command instead."]}),T.jsx("div",{className:"rounded border border-[var(--border-soft)] bg-[var(--bg-elevated)] px-3 py-2 font-mono text-xs text-[var(--text-primary)] overflow-x-auto",children:n}),T.jsxs("button",{type:"button",onClick:r,className:"mt-3 inline-flex items-center gap-1.5 text-xs text-[var(--accent-cool)] hover:text-[var(--accent)]",children:[T.jsx(Dse,{className:"size-3.5"}),"copy restart command"]})]})}function ule(){const e=qf(),[t,n]=K.useState(!1),r=sg({mutationFn:()=>ed.postClearCache(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),n(!1)}});return T.jsxs(ct,{title:"Admin actions",subtitle:"bank-wide controls",children:[T.jsxs("button",{type:"button",onClick:()=>n(!0),className:"inline-flex items-center gap-2 text-sm text-[var(--accent-hot)] hover:bg-[var(--accent-hot)]/10 rounded px-3 py-2 transition-colors",children:[T.jsx(Gse,{className:"size-4"}),"Clear all SessionBank entries"]}),t?T.jsxs("div",{className:"mt-3 p-3 rounded-md border border-[var(--accent-hot)]/40 bg-[var(--accent-hot)]/5 text-sm text-[var(--text-primary)]",children:[T.jsx("p",{children:"Evict every cached prefix? Future requests will pay full prefill until the cache refills."}),T.jsxs("div",{className:"mt-3 flex gap-2",children:[T.jsx("button",{type:"button",onClick:()=>r.mutate(),disabled:r.isPending,className:"text-xs px-3 py-1 rounded bg-[var(--accent-hot)] text-white disabled:opacity-50",children:r.isPending?"Clearing...":"Yes, clear cache"}),T.jsx("button",{type:"button",onClick:()=>n(!1),className:"text-xs px-3 py-1 rounded border border-[var(--border-soft)] text-[var(--text-muted)]",children:"Cancel"})]})]}):null]})}const x2=K.createContext({});function Vp(e){const t=K.useRef(null);return t.current===null&&(t.current=e()),t.current}const Zg=K.createContext(null),Hp=K.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class cle extends K.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function fle({children:e,isPresent:t}){const n=K.useId(),r=K.useRef(null),i=K.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=K.useContext(Hp);return K.useInsertionEffect(()=>{const{width:l,height:c,top:f,left:d}=i.current;if(t||!r.current||!l||!c)return;r.current.dataset.motionPopId=n;const m=document.createElement("style");return s&&(m.nonce=s),document.head.appendChild(m),m.sheet&&m.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${l}px !important; @@ -269,5 +271,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho top: ${f}px !important; left: ${d}px !important; } - `),()=>{document.head.removeChild(m)}},[t]),T.jsx(ile,{isPresent:t,childRef:r,sizeRef:i,children:K.cloneElement(e,{ref:r})})}const ole=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:l})=>{const c=Vp(sle),f=K.useId(),d=K.useCallback(p=>{c.set(p,!0);for(const v of c.values())if(!v)return;r&&r()},[c,r]),m=K.useMemo(()=>({id:f,initial:t,isPresent:n,custom:i,onExitComplete:d,register:p=>(c.set(p,!1),()=>c.delete(p))}),s?[Math.random(),d]:[n,d]);return K.useMemo(()=>{c.forEach((p,v)=>c.set(v,!1))},[n]),K.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),l==="popLayout"&&(e=T.jsx(ale,{isPresent:n,children:e})),T.jsx(Zg.Provider,{value:m,children:e})};function sle(){return new Map}function f6(e=!0){const t=K.useContext(Zg);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=K.useId();K.useEffect(()=>{e&&i(s)},[e]);const l=K.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,l]:[!0]}const Lv=e=>e.key||"";function aL(e){const t=[];return K.Children.forEach(e,n=>{K.isValidElement(n)&&t.push(n)}),t}const x2=typeof window<"u",Jg=x2?K.useLayoutEffect:K.useEffect,d6=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:l=!1})=>{const[c,f]=f6(l),d=K.useMemo(()=>aL(e),[e]),m=l&&!c?[]:d.map(Lv),p=K.useRef(!0),v=K.useRef(d),b=Vp(()=>new Map),[w,S]=K.useState(d),[x,A]=K.useState(d);Jg(()=>{p.current=!1,v.current=d;for(let E=0;E{const O=Lv(E),j=l&&!c?!1:d===x||m.includes(O),R=()=>{if(b.has(O))b.set(O,!0);else return;let k=!0;b.forEach(z=>{z||(k=!1)}),k&&(M==null||M(),A(v.current),l&&(f==null||f()),r&&r())};return T.jsx(ole,{isPresent:j,initial:!p.current||n?void 0:!1,custom:j?void 0:t,presenceAffectsLayout:i,mode:s,onExitComplete:j?void 0:R,children:E},O)})})},Di=e=>e;let h6=Di;const lle={useManualTiming:!1};function ule(e){let t=new Set,n=new Set,r=!1,i=!1;const s=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(d){s.has(d)&&(f.schedule(d),e()),d(l)}const f={schedule:(d,m=!1,p=!1)=>{const b=p&&r?t:n;return m&&s.add(d),b.has(d)||b.add(d),d},cancel:d=>{n.delete(d),s.delete(d)},process:d=>{if(l=d,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(c),t.clear(),r=!1,i&&(i=!1,f.process(d))}};return f}const zv=["read","resolveKeyframes","update","preRender","render","postRender"],cle=40;function p6(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,l=zv.reduce((A,_)=>(A[_]=ule(s),A),{}),{read:c,resolveKeyframes:f,update:d,preRender:m,render:p,postRender:v}=l,b=()=>{const A=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(A-i.timestamp,cle),1),i.timestamp=A,i.isProcessing=!0,c.process(i),f.process(i),d.process(i),m.process(i),p.process(i),v.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(b))},w=()=>{n=!0,r=!0,i.isProcessing||e(b)};return{schedule:zv.reduce((A,_)=>{const M=l[_];return A[_]=(E,O=!1,j=!1)=>(n||w(),M.schedule(E,O,j)),A},{}),cancel:A=>{for(let _=0;_oL[e].some(n=>!!t[n])};function fle(e){for(const t in e)Nf[t]={...Nf[t],...e[t]}}const dle=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function eg(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||dle.has(e)}let v6=e=>!eg(e);function hle(e){e&&(v6=t=>t.startsWith("on")?!eg(t):e(t))}try{hle(require("@emotion/is-prop-valid").default)}catch{}function ple(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(v6(i)||n===!0&&eg(i)||!t&&!eg(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function mle(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const e0=K.createContext({});function Tp(e){return typeof e=="string"||Array.isArray(e)}function t0(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const S2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],w2=["initial",...S2];function n0(e){return t0(e.animate)||w2.some(t=>Tp(e[t]))}function y6(e){return!!(n0(e)||e.variants)}function vle(e,t){if(n0(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Tp(n)?n:void 0,animate:Tp(r)?r:void 0}}return e.inherit!==!1?t:{}}function yle(e){const{initial:t,animate:n}=vle(e,K.useContext(e0));return K.useMemo(()=>({initial:t,animate:n}),[sL(t),sL(n)])}function sL(e){return Array.isArray(e)?e.join(" "):e}const gle=Symbol.for("motionComponentSymbol");function Dc(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ble(e,t,n){return K.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Dc(n)&&(n.current=r))},[t])}const _2=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),xle="framerAppearId",g6="data-"+_2(xle),{schedule:A2}=p6(queueMicrotask,!1),b6=K.createContext({});function Sle(e,t,n,r,i){var s,l;const{visualElement:c}=K.useContext(e0),f=K.useContext(m6),d=K.useContext(Zg),m=K.useContext(Hp).reducedMotion,p=K.useRef(null);r=r||f.renderer,!p.current&&r&&(p.current=r(e,{visualState:t,parent:c,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:m}));const v=p.current,b=K.useContext(b6);v&&!v.projection&&i&&(v.type==="html"||v.type==="svg")&&wle(p.current,n,i,b);const w=K.useRef(!1);K.useInsertionEffect(()=>{v&&w.current&&v.update(n,d)});const S=n[g6],x=K.useRef(!!S&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,S))&&((l=window.MotionHasOptimisedAnimation)===null||l===void 0?void 0:l.call(window,S)));return Jg(()=>{v&&(w.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),A2.render(v.render),x.current&&v.animationState&&v.animationState.animateChanges())}),K.useEffect(()=>{v&&(!x.current&&v.animationState&&v.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var A;(A=window.MotionHandoffMarkAsComplete)===null||A===void 0||A.call(window,S)}),x.current=!1))}),v}function wle(e,t,n,r){const{layoutId:i,layout:s,drag:l,dragConstraints:c,layoutScroll:f,layoutRoot:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:x6(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!l||c&&Dc(c),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:f,layoutRoot:d})}function x6(e){if(e)return e.options.allowProjection!==!1?e.projection:x6(e.parent)}function _le({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var s,l;e&&fle(e);function c(d,m){let p;const v={...K.useContext(Hp),...d,layoutId:Ale(d)},{isStatic:b}=v,w=yle(d),S=r(d,b);if(!b&&x2){Ole();const x=Tle(v);p=x.MeasureLayout,w.visualElement=Sle(i,S,v,t,x.ProjectionNode)}return T.jsxs(e0.Provider,{value:w,children:[p&&w.visualElement?T.jsx(p,{visualElement:w.visualElement,...v}):null,n(i,d,ble(S,w.visualElement,m),S,b,w.visualElement)]})}c.displayName=`motion.${typeof i=="string"?i:`create(${(l=(s=i.displayName)!==null&&s!==void 0?s:i.name)!==null&&l!==void 0?l:""})`}`;const f=K.forwardRef(c);return f[gle]=i,f}function Ale({layoutId:e}){const t=K.useContext(b2).id;return t&&e!==void 0?t+"-"+e:e}function Ole(e,t){K.useContext(m6).strict}function Tle(e){const{drag:t,layout:n}=Nf;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Ele=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function O2(e){return typeof e!="string"||e.includes("-")?!1:!!(Ele.indexOf(e)>-1||/[A-Z]/u.test(e))}function lL(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function T2(e,t,n,r){if(typeof t=="function"){const[i,s]=lL(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=lL(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const MO=e=>Array.isArray(e),Mle=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),jle=e=>MO(e)?e[e.length-1]||0:e,dr=e=>!!(e&&e.getVelocity);function Gv(e){const t=dr(e)?e.get():e;return Mle(t)?t.toValue():t}function Ple({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const l={latestValues:Cle(r,i,s,e),renderState:t()};return n&&(l.onMount=c=>n({props:r,current:c,...l}),l.onUpdate=c=>n(c)),l}const S6=e=>(t,n)=>{const r=K.useContext(e0),i=K.useContext(Zg),s=()=>Ple(e,t,r,i);return n?s():Vp(s)};function Cle(e,t,n,r){const i={},s=r(e,{});for(const v in s)i[v]=Gv(s[v]);let{initial:l,animate:c}=e;const f=n0(e),d=y6(e);t&&d&&!f&&e.inherit!==!1&&(l===void 0&&(l=t.initial),c===void 0&&(c=t.animate));let m=n?n.initial===!1:!1;m=m||l===!1;const p=m?c:l;if(p&&typeof p!="boolean"&&!t0(p)){const v=Array.isArray(p)?p:[p];for(let b=0;bt=>typeof t=="string"&&t.startsWith(e),_6=w6("--"),Dle=w6("var(--"),E2=e=>Dle(e)?Rle.test(e.split("/*")[0].trim()):!1,Rle=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,A6=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Zo=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},Ep={...nd,transform:e=>Zo(0,1,e)},$v={...nd,default:1},Fp=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Us=Fp("deg"),Za=Fp("%"),Ge=Fp("px"),Nle=Fp("vh"),kle=Fp("vw"),uL={...Za,parse:e=>Za.parse(e)/100,transform:e=>Za.transform(e*100)},Lle={borderWidth:Ge,borderTopWidth:Ge,borderRightWidth:Ge,borderBottomWidth:Ge,borderLeftWidth:Ge,borderRadius:Ge,radius:Ge,borderTopLeftRadius:Ge,borderTopRightRadius:Ge,borderBottomRightRadius:Ge,borderBottomLeftRadius:Ge,width:Ge,maxWidth:Ge,height:Ge,maxHeight:Ge,top:Ge,right:Ge,bottom:Ge,left:Ge,padding:Ge,paddingTop:Ge,paddingRight:Ge,paddingBottom:Ge,paddingLeft:Ge,margin:Ge,marginTop:Ge,marginRight:Ge,marginBottom:Ge,marginLeft:Ge,backgroundPositionX:Ge,backgroundPositionY:Ge},zle={rotate:Us,rotateX:Us,rotateY:Us,rotateZ:Us,scale:$v,scaleX:$v,scaleY:$v,scaleZ:$v,skew:Us,skewX:Us,skewY:Us,distance:Ge,translateX:Ge,translateY:Ge,translateZ:Ge,x:Ge,y:Ge,z:Ge,perspective:Ge,transformPerspective:Ge,opacity:Ep,originX:uL,originY:uL,originZ:Ge},cL={...nd,transform:Math.round},M2={...Lle,...zle,zIndex:cL,size:Ge,fillOpacity:Ep,strokeOpacity:Ep,numOctaves:cL},$le={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ble=td.length;function qle(e,t,n){let r="",i=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}}),O6=()=>({...C2(),attrs:{}}),D2=e=>typeof e=="string"&&e.toLowerCase()==="svg";function T6(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const E6=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function M6(e,t,n,r){T6(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(E6.has(i)?i:_2(i),t.attrs[i])}const tg={};function Fle(e){Object.assign(tg,e)}function j6(e,{layout:t,layoutId:n}){return Nu.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!tg[e]||e==="opacity")}function R2(e,t,n){var r;const{style:i}=e,s={};for(const l in i)(dr(i[l])||t.style&&dr(t.style[l])||j6(l,e)||((r=n==null?void 0:n.getValue(l))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[l]=i[l]);return s}function P6(e,t,n){const r=R2(e,t,n);for(const i in e)if(dr(e[i])||dr(t[i])){const s=td.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}function Gle(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const dL=["x","y","width","height","cx","cy","r"],Kle={useVisualState:S6({scrapeMotionValuesFromProps:P6,createRenderState:O6,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!e.drag;if(!s){for(const c in i)if(Nu.has(c)){s=!0;break}}if(!s)return;let l=!t;if(t)for(let c=0;c{Gle(n,r),Wt.render(()=>{P2(r,i,D2(n.tagName),e.transformTemplate),M6(n,r)})})}})},Yle={useVisualState:S6({scrapeMotionValuesFromProps:R2,createRenderState:C2})};function C6(e,t,n){for(const r in t)!dr(t[r])&&!j6(r,n)&&(e[r]=t[r])}function Xle({transformTemplate:e},t){return K.useMemo(()=>{const n=C2();return j2(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Wle(e,t){const n=e.style||{},r={};return C6(r,n,e),Object.assign(r,Xle(e,t)),r}function Qle(e,t){const n={},r=Wle(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function Zle(e,t,n,r){const i=K.useMemo(()=>{const s=O6();return P2(s,t,D2(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};C6(s,e.style,e),i.style={...s,...i.style}}return i}function Jle(e=!1){return(n,r,i,{latestValues:s},l)=>{const f=(O2(n)?Zle:Qle)(r,s,l,n),d=ple(r,typeof n=="string",e),m=n!==K.Fragment?{...d,...f,ref:i}:{},{children:p}=r,v=K.useMemo(()=>dr(p)?p.get():p,[p]);return K.createElement(n,{...m,children:v})}}function eue(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const l={...O2(r)?Kle:Yle,preloadedFeatures:e,useRender:Jle(i),createVisualElement:t,Component:r};return _le(l)}}function D6(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r(Kv===void 0&&Ja.set(cr.isProcessing||lle.useManualTiming?cr.timestamp:performance.now()),Kv),set:e=>{Kv=e,queueMicrotask(tue)}};function k2(e,t){e.indexOf(t)===-1&&e.push(t)}function L2(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class z2{constructor(){this.subscriptions=[]}add(t){return k2(this.subscriptions,t),()=>L2(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s!isNaN(parseFloat(e)),Lh={current:void 0};class rue{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=Ja.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ja.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=nue(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new z2);const r=this.events[t].add(n);return t==="change"?()=>{r(),Wt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Lh.current&&Lh.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=Ja.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>hL)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,hL);return N6(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function kf(e,t){return new rue(e,t)}function iue(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,kf(n))}function aue(e,t){const n=r0(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const l in s){const c=jle(s[l]);iue(e,l,c)}}function oue(e){return!!(dr(e)&&e.add)}function jO(e,t){const n=e.getValue("willChange");if(oue(n))return n.add(t)}function k6(e){return e.props[g6]}function $2(e){let t;return()=>(t===void 0&&(t=e()),t)}const sue=$2(()=>window.ScrollTimeline!==void 0);class lue{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r{if(sue()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;nn[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class uue extends lue{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const Ho=e=>e*1e3,Fo=e=>e/1e3;function B2(e){return typeof e=="function"}function pL(e,t){e.timeline=t,e.onfinish=null}const q2=e=>Array.isArray(e)&&typeof e[0]=="number",cue={linearEasing:void 0};function fue(e,t){const n=$2(e);return()=>{var r;return(r=cue[t])!==null&&r!==void 0?r:n()}}const ng=fue(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Lf=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},L6=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s`cubic-bezier(${e}, ${t}, ${n}, ${r})`,PO={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ah([0,.65,.55,1]),circOut:Ah([.55,0,1,.45]),backIn:Ah([.31,.01,.66,-.59]),backOut:Ah([.33,1.53,.69,.99])};function $6(e,t){if(e)return typeof e=="function"&&ng()?L6(e,t):q2(e)?Ah(e):Array.isArray(e)?e.map(n=>$6(n,t)||PO.easeOut):PO[e]}const B6=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,due=1e-7,hue=12;function pue(e,t,n,r,i){let s,l,c=0;do l=t+(n-t)/2,s=B6(l,r,i)-e,s>0?n=l:t=l;while(Math.abs(s)>due&&++cpue(s,0,1,e,n);return s=>s===0||s===1?s:B6(i(s),t,r)}const q6=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,I6=e=>t=>1-e(1-t),U6=Gp(.33,1.53,.69,.99),I2=I6(U6),V6=q6(I2),H6=e=>(e*=2)<1?.5*I2(e):.5*(2-Math.pow(2,-10*(e-1))),U2=e=>1-Math.sin(Math.acos(e)),F6=I6(U2),G6=q6(U2),K6=e=>/^0[^.\s]+$/u.test(e);function mue(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||K6(e):!0}const zh=e=>Math.round(e*1e5)/1e5,V2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function vue(e){return e==null}const yue=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,H2=(e,t)=>n=>!!(typeof n=="string"&&yue.test(n)&&n.startsWith(e)||t&&!vue(n)&&Object.prototype.hasOwnProperty.call(n,t)),Y6=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,l,c]=r.match(V2);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(l),alpha:c!==void 0?parseFloat(c):1}},gue=e=>Zo(0,255,e),g_={...nd,transform:e=>Math.round(gue(e))},ru={test:H2("rgb","red"),parse:Y6("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+g_.transform(e)+", "+g_.transform(t)+", "+g_.transform(n)+", "+zh(Ep.transform(r))+")"};function bue(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const CO={test:H2("#"),parse:bue,transform:ru.transform},Rc={test:H2("hsl","hue"),parse:Y6("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Za.transform(zh(t))+", "+Za.transform(zh(n))+", "+zh(Ep.transform(r))+")"},Lr={test:e=>ru.test(e)||CO.test(e)||Rc.test(e),parse:e=>ru.test(e)?ru.parse(e):Rc.test(e)?Rc.parse(e):CO.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ru.transform(e):Rc.transform(e)},xue=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Sue(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(V2))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(xue))===null||n===void 0?void 0:n.length)||0)>0}const X6="number",W6="color",wue="var",_ue="var(",mL="${}",Aue=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Mp(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const c=t.replace(Aue,f=>(Lr.test(f)?(r.color.push(s),i.push(W6),n.push(Lr.parse(f))):f.startsWith(_ue)?(r.var.push(s),i.push(wue),n.push(f)):(r.number.push(s),i.push(X6),n.push(parseFloat(f))),++s,mL)).split(mL);return{values:n,split:c,indexes:r,types:i}}function Q6(e){return Mp(e).values}function Z6(e){const{split:t,types:n}=Mp(e),r=t.length;return i=>{let s="";for(let l=0;ltypeof e=="number"?0:e;function Tue(e){const t=Q6(e);return Z6(e)(t.map(Oue))}const sl={test:Sue,parse:Q6,createTransformer:Z6,getAnimatableNone:Tue},Eue=new Set(["brightness","contrast","saturate","opacity"]);function Mue(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(V2)||[];if(!r)return e;const i=n.replace(r,"");let s=Eue.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const jue=/\b([a-z-]*)\(.*?\)/gu,DO={...sl,getAnimatableNone:e=>{const t=e.match(jue);return t?t.map(Mue).join(" "):e}},Pue={...M2,color:Lr,backgroundColor:Lr,outlineColor:Lr,fill:Lr,stroke:Lr,borderColor:Lr,borderTopColor:Lr,borderRightColor:Lr,borderBottomColor:Lr,borderLeftColor:Lr,filter:DO,WebkitFilter:DO},F2=e=>Pue[e];function J6(e,t){let n=F2(e);return n!==DO&&(n=sl),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Cue=new Set(["auto","none","0"]);function Due(e,t,n){let r=0,i;for(;re===nd||e===Ge,yL=(e,t)=>parseFloat(e.split(", ")[t]),gL=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return yL(i[1],t);{const s=r.match(/^matrix\((.+)\)$/u);return s?yL(s[1],e):0}},Rue=new Set(["x","y","z"]),Nue=td.filter(e=>!Rue.has(e));function kue(e){const t=[];return Nue.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const zf={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:gL(4,13),y:gL(5,14)};zf.translateX=zf.x;zf.translateY=zf.y;const yu=new Set;let RO=!1,NO=!1;function eI(){if(NO){const e=Array.from(yu).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=kue(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,l])=>{var c;(c=r.getValue(s))===null||c===void 0||c.set(l)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}NO=!1,RO=!1,yu.forEach(e=>e.complete()),yu.clear()}function tI(){yu.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(NO=!0)})}function Lue(){tI(),eI()}class G2{constructor(t,n,r,i,s,l=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=l}scheduleResolve(){this.isScheduled=!0,this.isAsync?(yu.add(this),RO||(RO=!0,Wt.read(tI),Wt.resolveKeyframes(eI))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let s=0;s/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),zue=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function $ue(e){const t=zue.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function rI(e,t,n=1){const[r,i]=$ue(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const l=s.trim();return nI(l)?parseFloat(l):l}return E2(i)?rI(i,t,n+1):i}const iI=e=>t=>t.test(e),Bue={test:e=>e==="auto",parse:e=>e},aI=[nd,Ge,Za,Us,kle,Nle,Bue],bL=e=>aI.find(iI(e));class oI extends G2{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let f=0;f{n.getValue(f).set(d)}),this.resolveNoneKeyframes()}}const xL=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(sl.test(e)||e==="0")&&!e.startsWith("url("));function que(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function i0(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(Uue),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const Vue=40;class sI{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:l="loop",...c}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ja.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:l,...c},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Vue?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Lue(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ja.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:l,onComplete:c,onUpdate:f,isGenerator:d}=this.options;if(!d&&!Iue(t,r,i,s))if(l)this.options.duration=0;else{f&&f(i0(t,this.options,n)),c&&c(),this.resolveFinishedPromise();return}const m=this.initPlayback(t,n);m!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...m},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const kO=2e4;function lI(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=kO?1/0:t}const vn=(e,t,n)=>e+(t-e)*n;function b_(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Hue({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,l=0;if(!t)i=s=l=n;else{const c=n<.5?n*(1+t):n+t-n*t,f=2*n-c;i=b_(f,c,e+1/3),s=b_(f,c,e),l=b_(f,c,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(l*255),alpha:r}}function rg(e,t){return n=>n>0?t:e}const x_=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Fue=[CO,ru,Rc],Gue=e=>Fue.find(t=>t.test(e));function SL(e){const t=Gue(e);if(!t)return!1;let n=t.parse(e);return t===Rc&&(n=Hue(n)),n}const wL=(e,t)=>{const n=SL(e),r=SL(t);if(!n||!r)return rg(e,t);const i={...n};return s=>(i.red=x_(n.red,r.red,s),i.green=x_(n.green,r.green,s),i.blue=x_(n.blue,r.blue,s),i.alpha=vn(n.alpha,r.alpha,s),ru.transform(i))},Kue=(e,t)=>n=>t(e(n)),Kp=(...e)=>e.reduce(Kue),LO=new Set(["none","hidden"]);function Yue(e,t){return LO.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Xue(e,t){return n=>vn(e,t,n)}function K2(e){return typeof e=="number"?Xue:typeof e=="string"?E2(e)?rg:Lr.test(e)?wL:Zue:Array.isArray(e)?uI:typeof e=="object"?Lr.test(e)?wL:Wue:rg}function uI(e,t){const n=[...e],r=n.length,i=e.map((s,l)=>K2(s)(s,t[l]));return s=>{for(let l=0;l{for(const s in r)n[s]=r[s](i);return n}}function Que(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let s=0;s{const n=sl.createTransformer(t),r=Mp(e),i=Mp(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?LO.has(e)&&!i.values.length||LO.has(t)&&!r.values.length?Yue(e,t):Kp(uI(Que(r,i),i.values),n):rg(e,t)};function cI(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?vn(e,t,n):K2(e)(e,t)}const Jue=5;function fI(e,t,n){const r=Math.max(t-Jue,0);return N6(n-e(r),t-r)}const _n={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},S_=.001;function ece({duration:e=_n.duration,bounce:t=_n.bounce,velocity:n=_n.velocity,mass:r=_n.mass}){let i,s,l=1-t;l=Zo(_n.minDamping,_n.maxDamping,l),e=Zo(_n.minDuration,_n.maxDuration,Fo(e)),l<1?(i=d=>{const m=d*l,p=m*e,v=m-n,b=zO(d,l),w=Math.exp(-p);return S_-v/b*w},s=d=>{const p=d*l*e,v=p*n+n,b=Math.pow(l,2)*Math.pow(d,2)*e,w=Math.exp(-p),S=zO(Math.pow(d,2),l);return(-i(d)+S_>0?-1:1)*((v-b)*w)/S}):(i=d=>{const m=Math.exp(-d*e),p=(d-n)*e+1;return-S_+m*p},s=d=>{const m=Math.exp(-d*e),p=(n-d)*(e*e);return m*p});const c=5/e,f=nce(i,s,c);if(e=Ho(e),isNaN(f))return{stiffness:_n.stiffness,damping:_n.damping,duration:e};{const d=Math.pow(f,2)*r;return{stiffness:d,damping:l*2*Math.sqrt(r*d),duration:e}}}const tce=12;function nce(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function ace(e){let t={velocity:_n.velocity,stiffness:_n.stiffness,damping:_n.damping,mass:_n.mass,isResolvedFromDuration:!1,...e};if(!_L(e,ice)&&_L(e,rce))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Zo(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:_n.mass,stiffness:i,damping:s}}else{const n=ece(e);t={...t,...n,mass:_n.mass},t.isResolvedFromDuration=!0}return t}function dI(e=_n.visualDuration,t=_n.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],c={done:!1,value:s},{stiffness:f,damping:d,mass:m,duration:p,velocity:v,isResolvedFromDuration:b}=ace({...n,velocity:-Fo(n.velocity||0)}),w=v||0,S=d/(2*Math.sqrt(f*m)),x=l-s,A=Fo(Math.sqrt(f/m)),_=Math.abs(x)<5;r||(r=_?_n.restSpeed.granular:_n.restSpeed.default),i||(i=_?_n.restDelta.granular:_n.restDelta.default);let M;if(S<1){const O=zO(A,S);M=j=>{const R=Math.exp(-S*A*j);return l-R*((w+S*A*x)/O*Math.sin(O*j)+x*Math.cos(O*j))}}else if(S===1)M=O=>l-Math.exp(-A*O)*(x+(w+A*x)*O);else{const O=A*Math.sqrt(S*S-1);M=j=>{const R=Math.exp(-S*A*j),k=Math.min(O*j,300);return l-R*((w+S*A*x)*Math.sinh(k)+O*x*Math.cosh(k))/O}}const E={calculatedDuration:b&&p||null,next:O=>{const j=M(O);if(b)c.done=O>=p;else{let R=0;S<1&&(R=O===0?Ho(w):fI(M,O,j));const k=Math.abs(R)<=r,z=Math.abs(l-j)<=i;c.done=k&&z}return c.value=c.done?l:j,c},toString:()=>{const O=Math.min(lI(E),kO),j=L6(R=>E.next(O*R).value,O,30);return O+"ms "+j}};return E}function AL({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:l,min:c,max:f,restDelta:d=.5,restSpeed:m}){const p=e[0],v={done:!1,value:p},b=k=>c!==void 0&&kf,w=k=>c===void 0?f:f===void 0||Math.abs(c-k)-S*Math.exp(-k/r),M=k=>A+_(k),E=k=>{const z=_(k),G=M(k);v.done=Math.abs(z)<=d,v.value=v.done?A:G};let O,j;const R=k=>{b(v.value)&&(O=k,j=dI({keyframes:[v.value,w(v.value)],velocity:fI(M,k,v.value),damping:i,stiffness:s,restDelta:d,restSpeed:m}))};return R(0),{calculatedDuration:null,next:k=>{let z=!1;return!j&&O===void 0&&(z=!0,E(k),R(k)),O!==void 0&&k>=O?j.next(k-O):(!z&&E(k),v)}}}const oce=Gp(.42,0,1,1),sce=Gp(0,0,.58,1),hI=Gp(.42,0,.58,1),lce=e=>Array.isArray(e)&&typeof e[0]!="number",uce={linear:Di,easeIn:oce,easeInOut:hI,easeOut:sce,circIn:U2,circInOut:G6,circOut:F6,backIn:I2,backInOut:V6,backOut:U6,anticipate:H6},OL=e=>{if(q2(e)){h6(e.length===4);const[t,n,r,i]=e;return Gp(t,n,r,i)}else if(typeof e=="string")return uce[e];return e};function cce(e,t,n){const r=[],i=n||cI,s=e.length-1;for(let l=0;lt[0];if(s===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=cce(t,r,i),f=c.length,d=m=>{if(l&&m1)for(;pd(Zo(e[0],e[s-1],m)):d}function fce(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Lf(0,t,r);e.push(vn(n,1,i))}}function dce(e){const t=[0];return fce(t,e.length-1),t}function hce(e,t){return e.map(n=>n*t)}function pce(e,t){return e.map(()=>t||hI).splice(0,e.length-1)}function ig({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=lce(r)?r.map(OL):OL(r),s={done:!1,value:t[0]},l=hce(n&&n.length===t.length?n:dce(t),e),c=pI(l,t,{ease:Array.isArray(i)?i:pce(t,i)});return{calculatedDuration:e,next:f=>(s.value=c(f),s.done=f>=e,s)}}const mce=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Wt.update(t,!0),stop:()=>Qo(t),now:()=>cr.isProcessing?cr.timestamp:Ja.now()}},vce={decay:AL,inertia:AL,tween:ig,keyframes:ig,spring:dI},yce=e=>e/100;class a0 extends sI{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:f}=this.options;f&&f()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,l=(i==null?void 0:i.KeyframeResolver)||G2,c=(f,d)=>this.onKeyframesResolved(f,d);this.resolver=new l(s,c,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:l=0}=this.options,c=B2(n)?n:vce[n]||ig;let f,d;c!==ig&&typeof t[0]!="number"&&(f=Kp(yce,cI(t[0],t[1])),t=[0,100]);const m=c({...this.options,keyframes:t});s==="mirror"&&(d=c({...this.options,keyframes:[...t].reverse(),velocity:-l})),m.calculatedDuration===null&&(m.calculatedDuration=lI(m));const{calculatedDuration:p}=m,v=p+i,b=v*(r+1)-i;return{generator:m,mirroredGenerator:d,mapPercentToKeyframes:f,calculatedDuration:p,resolvedDuration:v,totalDuration:b}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:k}=this.options;return{done:!0,value:k[k.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:l,mapPercentToKeyframes:c,keyframes:f,calculatedDuration:d,totalDuration:m,resolvedDuration:p}=r;if(this.startTime===null)return s.next(0);const{delay:v,repeat:b,repeatType:w,repeatDelay:S,onUpdate:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-m/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const A=this.currentTime-v*(this.speed>=0?1:-1),_=this.speed>=0?A<0:A>m;this.currentTime=Math.max(A,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=m);let M=this.currentTime,E=s;if(b){const k=Math.min(this.currentTime,m)/p;let z=Math.floor(k),G=k%1;!G&&k>=1&&(G=1),G===1&&z--,z=Math.min(z,b+1),!!(z%2)&&(w==="reverse"?(G=1-G,S&&(G-=S/p)):w==="mirror"&&(E=l)),M=Zo(0,1,G)*p}const O=_?{done:!1,value:f[0]}:E.next(M);c&&(O.value=c(O.value));let{done:j}=O;!_&&d!==null&&(j=this.speed>=0?this.currentTime>=m:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&j);return R&&i!==void 0&&(O.value=i0(f,this.options,i)),x&&x(O.value),R&&this.finish(),O}get duration(){const{resolved:t}=this;return t?Fo(t.calculatedDuration):0}get time(){return Fo(this.currentTime)}set time(t){t=Ho(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Fo(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=mce,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}function gce(e){return new a0(e)}const bce=new Set(["opacity","clipPath","filter","transform"]);function xce(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:l="loop",ease:c="easeInOut",times:f}={}){const d={[t]:n};f&&(d.offset=f);const m=$6(c,i);return Array.isArray(m)&&(d.easing=m),e.animate(d,{delay:r,duration:i,easing:Array.isArray(m)?"linear":m,fill:"both",iterations:s+1,direction:l==="reverse"?"alternate":"normal"})}const Sce=$2(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ag=10,wce=2e4;function _ce(e){return B2(e.type)||e.type==="spring"||!z6(e.ease)}function Ace(e,t){const n=new a0({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&sthis.onKeyframesResolved(l,c),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:s,type:l,motionValue:c,name:f,startTime:d}=this.options;if(!c.owner||!c.owner.current)return!1;if(typeof s=="string"&&ng()&&Oce(s)&&(s=mI[s]),_ce(this.options)){const{onComplete:p,onUpdate:v,motionValue:b,element:w,...S}=this.options,x=Ace(t,S);t=x.keyframes,t.length===1&&(t[1]=t[0]),r=x.duration,i=x.times,s=x.ease,l="keyframes"}const m=xce(c.owner.current,f,t,{...this.options,duration:r,times:i,ease:s});return m.startTime=d??this.calcStartTime(),this.pendingTimeline?(pL(m,this.pendingTimeline),this.pendingTimeline=void 0):m.onfinish=()=>{const{onComplete:p}=this.options;c.set(i0(t,this.options,n)),p&&p(),this.cancel(),this.resolveFinishedPromise()},{animation:m,duration:r,times:i,type:l,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Fo(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Fo(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Ho(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Di;const{animation:r}=n;pL(r,t)}return Di}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:s,ease:l,times:c}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:d,onUpdate:m,onComplete:p,element:v,...b}=this.options,w=new a0({...b,keyframes:r,duration:i,type:s,ease:l,times:c,isGenerator:!0}),S=Ho(this.time);d.setWithVelocity(w.sample(S-ag).value,w.sample(S).value,ag)}const{onStop:f}=this.options;f&&f(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:l,type:c}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:d}=n.owner.getProps();return Sce()&&r&&bce.has(r)&&!f&&!d&&!i&&s!=="mirror"&&l!==0&&c!=="inertia"}}const Tce={type:"spring",stiffness:500,damping:25,restSpeed:10},Ece=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Mce={type:"keyframes",duration:.8},jce={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Pce=(e,{keyframes:t})=>t.length>2?Mce:Nu.has(e)?e.startsWith("scale")?Ece(t[1]):Tce:jce;function Cce({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:l,repeatDelay:c,from:f,elapsed:d,...m}){return!!Object.keys(m).length}const Y2=(e,t,n,r={},i,s)=>l=>{const c=N2(r,e)||{},f=c.delay||r.delay||0;let{elapsed:d=0}=r;d=d-Ho(f);let m={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-d,onUpdate:v=>{t.set(v),c.onUpdate&&c.onUpdate(v)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:s?void 0:i};Cce(c)||(m={...m,...Pce(e,m)}),m.duration&&(m.duration=Ho(m.duration)),m.repeatDelay&&(m.repeatDelay=Ho(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let p=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(m.duration=0,m.delay===0&&(p=!0)),p&&!s&&t.get()!==void 0){const v=i0(m.keyframes,c);if(v!==void 0)return Wt.update(()=>{m.onUpdate(v),m.onComplete()}),new uue([])}return!s&&TL.supports(m)?new TL(m):new a0(m)};function Dce({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function vI(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var s;let{transition:l=e.getDefaultTransition(),transitionEnd:c,...f}=t;r&&(l=r);const d=[],m=i&&e.animationState&&e.animationState.getState()[i];for(const p in f){const v=e.getValue(p,(s=e.latestValues[p])!==null&&s!==void 0?s:null),b=f[p];if(b===void 0||m&&Dce(m,p))continue;const w={delay:n,...N2(l||{},p)};let S=!1;if(window.MotionHandoffAnimation){const A=k6(e);if(A){const _=window.MotionHandoffAnimation(A,p,Wt);_!==null&&(w.startTime=_,S=!0)}}jO(e,p),v.start(Y2(p,v,b,e.shouldReduceMotion&&R6.has(p)?{type:!1}:w,e,S));const x=v.animation;x&&d.push(x)}return c&&Promise.all(d).then(()=>{Wt.update(()=>{c&&aue(e,c)})}),d}function $O(e,t,n={}){var r;const i=r0(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const l=i?()=>Promise.all(vI(e,i,n)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:m=0,staggerChildren:p,staggerDirection:v}=s;return Rce(e,t,m+d,p,v,n)}:()=>Promise.resolve(),{when:f}=s;if(f){const[d,m]=f==="beforeChildren"?[l,c]:[c,l];return d().then(()=>m())}else return Promise.all([l(),c(n.delay)])}function Rce(e,t,n=0,r=0,i=1,s){const l=[],c=(e.variantChildren.size-1)*r,f=i===1?(d=0)=>d*r:(d=0)=>c-d*r;return Array.from(e.variantChildren).sort(Nce).forEach((d,m)=>{d.notify("AnimationStart",t),l.push($O(d,t,{...s,delay:n+f(m)}).then(()=>d.notify("AnimationComplete",t)))}),Promise.all(l)}function Nce(e,t){return e.sortNodePosition(t)}function kce(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>$O(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=$O(e,t,n);else{const i=typeof t=="function"?r0(e,t,n.custom):t;r=Promise.all(vI(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const Lce=w2.length;function yI(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?yI(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:r})=>kce(e,n,r)))}function qce(e){let t=Bce(e),n=EL(),r=!0;const i=f=>(d,m)=>{var p;const v=r0(e,m,f==="exit"?(p=e.presenceContext)===null||p===void 0?void 0:p.custom:void 0);if(v){const{transition:b,transitionEnd:w,...S}=v;d={...d,...S,...w}}return d};function s(f){t=f(e)}function l(f){const{props:d}=e,m=yI(e.parent)||{},p=[],v=new Set;let b={},w=1/0;for(let x=0;x<$ce;x++){const A=zce[x],_=n[A],M=d[A]!==void 0?d[A]:m[A],E=Tp(M),O=A===f?_.isActive:null;O===!1&&(w=x);let j=M===m[A]&&M!==d[A]&&E;if(j&&r&&e.manuallyAnimateOnMount&&(j=!1),_.protectedKeys={...b},!_.isActive&&O===null||!M&&!_.prevProp||t0(M)||typeof M=="boolean")continue;const R=Ice(_.prevProp,M);let k=R||A===f&&_.isActive&&!j&&E||x>w&&E,z=!1;const G=Array.isArray(M)?M:[M];let $=G.reduce(i(A),{});O===!1&&($={});const{prevResolvedValues:B={}}=_,Z={...B,...$},ee=F=>{k=!0,v.has(F)&&(z=!0,v.delete(F)),_.needsAnimating[F]=!0;const ie=e.getValue(F);ie&&(ie.liveStyle=!1)};for(const F in Z){const ie=$[F],ce=B[F];if(b.hasOwnProperty(F))continue;let U=!1;MO(ie)&&MO(ce)?U=!D6(ie,ce):U=ie!==ce,U?ie!=null?ee(F):v.add(F):ie!==void 0&&v.has(F)?ee(F):_.protectedKeys[F]=!0}_.prevProp=M,_.prevResolvedValues=$,_.isActive&&(b={...b,...$}),r&&e.blockInitialAnimation&&(k=!1),k&&(!(j&&R)||z)&&p.push(...G.map(F=>({animation:F,options:{type:A}})))}if(v.size){const x={};v.forEach(A=>{const _=e.getBaseTarget(A),M=e.getValue(A);M&&(M.liveStyle=!0),x[A]=_??null}),p.push({animation:x})}let S=!!p.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(S=!1),r=!1,S?t(p):Promise.resolve()}function c(f,d){var m;if(n[f].isActive===d)return Promise.resolve();(m=e.variantChildren)===null||m===void 0||m.forEach(v=>{var b;return(b=v.animationState)===null||b===void 0?void 0:b.setActive(f,d)}),n[f].isActive=d;const p=l(f);for(const v in n)n[v].protectedKeys={};return p}return{animateChanges:l,setActive:c,setAnimateFunction:s,getState:()=>n,reset:()=>{n=EL(),r=!0}}}function Ice(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!D6(t,e):!1}function Vl(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function EL(){return{animate:Vl(!0),whileInView:Vl(),whileHover:Vl(),whileTap:Vl(),whileDrag:Vl(),whileFocus:Vl(),exit:Vl()}}class ml{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Uce extends ml{constructor(t){super(t),t.animationState||(t.animationState=qce(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();t0(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let Vce=0;class Hce extends ml{constructor(){super(...arguments),this.id=Vce++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const Fce={animation:{Feature:Uce},exit:{Feature:Hce}},ga={x:!1,y:!1};function gI(){return ga.x||ga.y}function Gce(e){return e==="x"||e==="y"?ga[e]?null:(ga[e]=!0,()=>{ga[e]=!1}):ga.x||ga.y?null:(ga.x=ga.y=!0,()=>{ga.x=ga.y=!1})}const X2=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function jp(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Yp(e){return{point:{x:e.pageX,y:e.pageY}}}const Kce=e=>t=>X2(t)&&e(t,Yp(t));function $h(e,t,n,r){return jp(e,t,Kce(n),r)}const ML=(e,t)=>Math.abs(e-t);function Yce(e,t){const n=ML(e.x,t.x),r=ML(e.y,t.y);return Math.sqrt(n**2+r**2)}class bI{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=__(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,b=Yce(p.offset,{x:0,y:0})>=3;if(!v&&!b)return;const{point:w}=p,{timestamp:S}=cr;this.history.push({...w,timestamp:S});const{onStart:x,onMove:A}=this.handlers;v||(x&&x(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),A&&A(this.lastMoveEvent,p)},this.handlePointerMove=(p,v)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=w_(v,this.transformPagePoint),Wt.update(this.updatePoint,!0)},this.handlePointerUp=(p,v)=>{this.end();const{onEnd:b,onSessionEnd:w,resumeAnimation:S}=this.handlers;if(this.dragSnapToOrigin&&S&&S(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=__(p.type==="pointercancel"?this.lastMoveEventInfo:w_(v,this.transformPagePoint),this.history);this.startEvent&&b&&b(p,x),w&&w(p,x)},!X2(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const l=Yp(t),c=w_(l,this.transformPagePoint),{point:f}=c,{timestamp:d}=cr;this.history=[{...f,timestamp:d}];const{onSessionStart:m}=n;m&&m(t,__(c,this.history)),this.removeListeners=Kp($h(this.contextWindow,"pointermove",this.handlePointerMove),$h(this.contextWindow,"pointerup",this.handlePointerUp),$h(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Qo(this.updatePoint)}}function w_(e,t){return t?{point:t(e.point)}:e}function jL(e,t){return{x:e.x-t.x,y:e.y-t.y}}function __({point:e},t){return{point:e,delta:jL(e,xI(t)),offset:jL(e,Xce(t)),velocity:Wce(t,.1)}}function Xce(e){return e[0]}function xI(e){return e[e.length-1]}function Wce(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=xI(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Ho(t)));)n--;if(!r)return{x:0,y:0};const s=Fo(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const l={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}const SI=1e-4,Qce=1-SI,Zce=1+SI,wI=.01,Jce=0-wI,efe=0+wI;function Ri(e){return e.max-e.min}function tfe(e,t,n){return Math.abs(e-t)<=n}function PL(e,t,n,r=.5){e.origin=r,e.originPoint=vn(t.min,t.max,e.origin),e.scale=Ri(n)/Ri(t),e.translate=vn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Qce&&e.scale<=Zce||isNaN(e.scale))&&(e.scale=1),(e.translate>=Jce&&e.translate<=efe||isNaN(e.translate))&&(e.translate=0)}function Bh(e,t,n,r){PL(e.x,t.x,n.x,r?r.originX:void 0),PL(e.y,t.y,n.y,r?r.originY:void 0)}function CL(e,t,n){e.min=n.min+t.min,e.max=e.min+Ri(t)}function nfe(e,t,n){CL(e.x,t.x,n.x),CL(e.y,t.y,n.y)}function DL(e,t,n){e.min=t.min-n.min,e.max=e.min+Ri(t)}function qh(e,t,n){DL(e.x,t.x,n.x),DL(e.y,t.y,n.y)}function rfe(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?vn(n,e,r.max):Math.min(e,n)),e}function RL(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function ife(e,{top:t,left:n,bottom:r,right:i}){return{x:RL(e.x,n,i),y:RL(e.y,t,r)}}function NL(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Lf(t.min,t.max-r,e.min):r>i&&(n=Lf(e.min,e.max-i,t.min)),Zo(0,1,n)}function sfe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const BO=.35;function lfe(e=BO){return e===!1?e=0:e===!0&&(e=BO),{x:kL(e,"left","right"),y:kL(e,"top","bottom")}}function kL(e,t,n){return{min:LL(e,t),max:LL(e,n)}}function LL(e,t){return typeof e=="number"?e:e[t]||0}const zL=()=>({translate:0,scale:1,origin:0,originPoint:0}),Nc=()=>({x:zL(),y:zL()}),$L=()=>({min:0,max:0}),Dn=()=>({x:$L(),y:$L()});function Ji(e){return[e("x"),e("y")]}function _I({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ufe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function cfe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function A_(e){return e===void 0||e===1}function qO({scale:e,scaleX:t,scaleY:n}){return!A_(e)||!A_(t)||!A_(n)}function Yl(e){return qO(e)||AI(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function AI(e){return BL(e.x)||BL(e.y)}function BL(e){return e&&e!=="0%"}function og(e,t,n){const r=e-n,i=t*r;return n+i}function qL(e,t,n,r,i){return i!==void 0&&(e=og(e,i,r)),og(e,n,r)+t}function IO(e,t=0,n=1,r,i){e.min=qL(e.min,t,n,r,i),e.max=qL(e.max,t,n,r,i)}function OI(e,{x:t,y:n}){IO(e.x,t.translate,t.scale,t.originPoint),IO(e.y,n.translate,n.scale,n.originPoint)}const IL=.999999999999,UL=1.0000000000001;function ffe(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,l;for(let c=0;cIL&&(t.x=1),t.yIL&&(t.y=1)}function kc(e,t){e.min=e.min+t,e.max=e.max+t}function VL(e,t,n,r,i=.5){const s=vn(e.min,e.max,i);IO(e,t,n,s,r)}function Lc(e,t){VL(e.x,t.x,t.scaleX,t.scale,t.originX),VL(e.y,t.y,t.scaleY,t.scale,t.originY)}function TI(e,t){return _I(cfe(e.getBoundingClientRect(),t))}function dfe(e,t,n){const r=TI(e,n),{scroll:i}=t;return i&&(kc(r.x,i.offset.x),kc(r.y,i.offset.y)),r}const EI=({current:e})=>e?e.ownerDocument.defaultView:null,hfe=new WeakMap;class pfe{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Dn(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=m=>{const{dragSnapToOrigin:p}=this.getProps();p?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Yp(m).point)},s=(m,p)=>{const{drag:v,dragPropagation:b,onDragStart:w}=this.getProps();if(v&&!b&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Gce(v),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ji(x=>{let A=this.getAxisMotionValue(x).get()||0;if(Za.test(A)){const{projection:_}=this.visualElement;if(_&&_.layout){const M=_.layout.layoutBox[x];M&&(A=Ri(M)*(parseFloat(A)/100))}}this.originPoint[x]=A}),w&&Wt.postRender(()=>w(m,p)),jO(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},l=(m,p)=>{const{dragPropagation:v,dragDirectionLock:b,onDirectionLock:w,onDrag:S}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:x}=p;if(b&&this.currentDirection===null){this.currentDirection=mfe(x),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",p.point,x),this.updateAxis("y",p.point,x),this.visualElement.render(),S&&S(m,p)},c=(m,p)=>this.stop(m,p),f=()=>Ji(m=>{var p;return this.getAnimationState(m)==="paused"&&((p=this.getAxisMotionValue(m).animation)===null||p===void 0?void 0:p.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new bI(t,{onSessionStart:i,onStart:s,onMove:l,onSessionEnd:c,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,contextWindow:EI(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&Wt.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Bv(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let l=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(l=rfe(l,this.constraints[t],this.elastic[t])),s.set(l)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&Dc(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=ife(i.layoutBox,n):this.constraints=!1,this.elastic=lfe(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Ji(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=sfe(i.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Dc(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=dfe(r,i.root,this.visualElement.getTransformPagePoint());let l=afe(i.layout.layoutBox,s);if(n){const c=n(ufe(l));this.hasMutatedConstraints=!!c,c&&(l=_I(c))}return l}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:l,onDragTransitionEnd:c}=this.getProps(),f=this.constraints||{},d=Ji(m=>{if(!Bv(m,n,this.currentDirection))return;let p=f&&f[m]||{};l&&(p={min:0,max:0});const v=i?200:1e6,b=i?40:1e7,w={type:"inertia",velocity:r?t[m]:0,bounceStiffness:v,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...s,...p};return this.startAxisValueAnimation(m,w)});return Promise.all(d).then(c)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return jO(this.visualElement,t),r.start(Y2(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ji(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ji(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ji(n=>{const{drag:r}=this.getProps();if(!Bv(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:l,max:c}=i.layout.layoutBox[n];s.set(t[n]-vn(l,c,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Dc(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ji(l=>{const c=this.getAxisMotionValue(l);if(c&&this.constraints!==!1){const f=c.get();i[l]=ofe({min:f,max:f},this.constraints[l])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ji(l=>{if(!Bv(l,t,null))return;const c=this.getAxisMotionValue(l),{min:f,max:d}=this.constraints[l];c.set(vn(f,d,i[l]))})}addListeners(){if(!this.visualElement.current)return;hfe.set(this.visualElement,this);const t=this.visualElement.current,n=$h(t,"pointerdown",f=>{const{drag:d,dragListener:m=!0}=this.getProps();d&&m&&this.start(f)}),r=()=>{const{dragConstraints:f}=this.getProps();Dc(f)&&f.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Wt.read(r);const l=jp(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:d})=>{this.isDragging&&d&&(Ji(m=>{const p=this.getAxisMotionValue(m);p&&(this.originPoint[m]+=f[m].translate,p.set(p.get()+f[m].translate))}),this.visualElement.render())}));return()=>{l(),n(),s(),c&&c()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:l=BO,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:l,dragMomentum:c}}}function Bv(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function mfe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class vfe extends ml{constructor(t){super(t),this.removeGroupControls=Di,this.removeListeners=Di,this.controls=new pfe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Di}unmount(){this.removeGroupControls(),this.removeListeners()}}const HL=e=>(t,n)=>{e&&Wt.postRender(()=>e(t,n))};class yfe extends ml{constructor(){super(...arguments),this.removePointerDownListener=Di}onPointerDown(t){this.session=new bI(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:EI(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:HL(t),onStart:HL(n),onMove:r,onEnd:(s,l)=>{delete this.session,i&&Wt.postRender(()=>i(s,l))}}}mount(){this.removePointerDownListener=$h(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Yv={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function FL(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const vh={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ge.test(e))e=parseFloat(e);else return e;const n=FL(e,t.target.x),r=FL(e,t.target.y);return`${n}% ${r}%`}},gfe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=sl.parse(e);if(i.length>5)return r;const s=sl.createTransformer(e),l=typeof i[0]!="number"?1:0,c=n.x.scale*t.x,f=n.y.scale*t.y;i[0+l]/=c,i[1+l]/=f;const d=vn(c,f,.5);return typeof i[2+l]=="number"&&(i[2+l]/=d),typeof i[3+l]=="number"&&(i[3+l]/=d),s(i)}};class bfe extends K.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;Fle(xfe),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Yv.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,l=r.projection;return l&&(l.isPresent=s,i||t.layoutDependency!==n||n===void 0?l.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?l.promote():l.relegate()||Wt.postRender(()=>{const c=l.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),A2.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function MI(e){const[t,n]=f6(),r=K.useContext(b2);return T.jsx(bfe,{...e,layoutGroup:r,switchLayoutGroup:K.useContext(b6),isPresent:t,safeToRemove:n})}const xfe={borderRadius:{...vh,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:vh,borderTopRightRadius:vh,borderBottomLeftRadius:vh,borderBottomRightRadius:vh,boxShadow:gfe};function Sfe(e,t,n){const r=dr(e)?e:kf(e);return r.start(Y2("",r,t,n)),r.animation}function wfe(e){return e instanceof SVGElement&&e.tagName!=="svg"}const _fe=(e,t)=>e.depth-t.depth;class Afe{constructor(){this.children=[],this.isDirty=!1}add(t){k2(this.children,t),this.isDirty=!0}remove(t){L2(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(_fe),this.isDirty=!1,this.children.forEach(t)}}function Ofe(e,t){const n=Ja.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(Qo(r),e(s-t))};return Wt.read(r,!0),()=>Qo(r)}const jI=["TopLeft","TopRight","BottomLeft","BottomRight"],Tfe=jI.length,GL=e=>typeof e=="string"?parseFloat(e):e,KL=e=>typeof e=="number"||Ge.test(e);function Efe(e,t,n,r,i,s){i?(e.opacity=vn(0,n.opacity!==void 0?n.opacity:1,Mfe(r)),e.opacityExit=vn(t.opacity!==void 0?t.opacity:1,0,jfe(r))):s&&(e.opacity=vn(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let l=0;lrt?1:n(Lf(e,t,r))}function XL(e,t){e.min=t.min,e.max=t.max}function Wi(e,t){XL(e.x,t.x),XL(e.y,t.y)}function WL(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function QL(e,t,n,r,i){return e-=t,e=og(e,1/n,r),i!==void 0&&(e=og(e,1/i,r)),e}function Pfe(e,t=0,n=1,r=.5,i,s=e,l=e){if(Za.test(t)&&(t=parseFloat(t),t=vn(l.min,l.max,t/100)-l.min),typeof t!="number")return;let c=vn(s.min,s.max,r);e===s&&(c-=t),e.min=QL(e.min,t,n,c,i),e.max=QL(e.max,t,n,c,i)}function ZL(e,t,[n,r,i],s,l){Pfe(e,t[n],t[r],t[i],t.scale,s,l)}const Cfe=["x","scaleX","originX"],Dfe=["y","scaleY","originY"];function JL(e,t,n,r){ZL(e.x,t,Cfe,n?n.x:void 0,r?r.x:void 0),ZL(e.y,t,Dfe,n?n.y:void 0,r?r.y:void 0)}function ez(e){return e.translate===0&&e.scale===1}function CI(e){return ez(e.x)&&ez(e.y)}function tz(e,t){return e.min===t.min&&e.max===t.max}function Rfe(e,t){return tz(e.x,t.x)&&tz(e.y,t.y)}function nz(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function DI(e,t){return nz(e.x,t.x)&&nz(e.y,t.y)}function rz(e){return Ri(e.x)/Ri(e.y)}function iz(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Nfe{constructor(){this.members=[]}add(t){k2(this.members,t),t.scheduleRender()}remove(t){if(L2(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function kfe(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,l=(n==null?void 0:n.z)||0;if((i||s||l)&&(r=`translate3d(${i}px, ${s}px, ${l}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:d,rotate:m,rotateX:p,rotateY:v,skewX:b,skewY:w}=n;d&&(r=`perspective(${d}px) ${r}`),m&&(r+=`rotate(${m}deg) `),p&&(r+=`rotateX(${p}deg) `),v&&(r+=`rotateY(${v}deg) `),b&&(r+=`skewX(${b}deg) `),w&&(r+=`skewY(${w}deg) `)}const c=e.x.scale*t.x,f=e.y.scale*t.y;return(c!==1||f!==1)&&(r+=`scale(${c}, ${f})`),r||"none"}const Xl={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Oh=typeof window<"u"&&window.MotionDebug!==void 0,O_=["","X","Y","Z"],Lfe={visibility:"hidden"},az=1e3;let zfe=0;function T_(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function RI(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=k6(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Wt,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&RI(r)}function NI({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(l={},c=t==null?void 0:t()){this.id=zfe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Oh&&(Xl.totalNodes=Xl.resolvedTargetDeltas=Xl.recalculatedProjection=0),this.nodes.forEach(qfe),this.nodes.forEach(Ffe),this.nodes.forEach(Gfe),this.nodes.forEach(Ife),Oh&&window.MotionDebug.record(Xl)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let f=0;fthis.root.updateBlockedByResize=!1;e(l,()=>{this.root.updateBlockedByResize=!0,p&&p(),p=Ofe(v,250),Yv.hasAnimatedSinceResize&&(Yv.hasAnimatedSinceResize=!1,this.nodes.forEach(sz))})}f&&this.root.registerSharedNode(f,this),this.options.animate!==!1&&m&&(f||d)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:v,hasRelativeTargetChanged:b,layout:w})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||m.getDefaultTransition()||Qfe,{onLayoutAnimationStart:x,onLayoutAnimationComplete:A}=m.getProps(),_=!this.targetLayout||!DI(this.targetLayout,w)||b,M=!v&&b;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||M||v&&(_||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(p,M);const E={...N2(S,"layout"),onPlay:x,onComplete:A};(m.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E)}else v||sz(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=w})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Qo(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Kfe),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&RI(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let f=0;f{const O=E/1e3;lz(p.x,l.x,O),lz(p.y,l.y,O),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(qh(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Xfe(this.relativeTarget,this.relativeTargetOrigin,v,O),M&&Rfe(this.relativeTarget,M)&&(this.isProjectionDirty=!1),M||(M=Dn()),Wi(M,this.relativeTarget)),S&&(this.animationValues=m,Efe(m,d,this.latestValues,O,_,A)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=O},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Qo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Wt.update(()=>{Yv.hasAnimatedSinceResize=!0,this.currentAnimation=Sfe(0,az,{...l,onUpdate:c=>{this.mixTargetDelta(c),l.onUpdate&&l.onUpdate(c)},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(az),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:c,target:f,layout:d,latestValues:m}=l;if(!(!c||!f||!d)){if(this!==l&&this.layout&&d&&kI(this.options.animationType,this.layout.layoutBox,d.layoutBox)){f=this.target||Dn();const p=Ri(this.layout.layoutBox.x);f.x.min=l.target.x.min,f.x.max=f.x.min+p;const v=Ri(this.layout.layoutBox.y);f.y.min=l.target.y.min,f.y.max=f.y.min+v}Wi(c,f),Lc(c,m),Bh(this.projectionDeltaWithTransform,this.layoutCorrected,c,m)}}registerSharedNode(l,c){this.sharedNodes.has(l)||this.sharedNodes.set(l,new Nfe),this.sharedNodes.get(l).add(c);const d=c.options.initialPromotionConfig;c.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(c):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){var l;const{layoutId:c}=this.options;return c?((l=this.getStack())===null||l===void 0?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:c}=this.options;return c?(l=this.getStack())===null||l===void 0?void 0:l.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:c,preserveFollowOpacity:f}={}){const d=this.getStack();d&&d.promote(this,f),l&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let c=!1;const{latestValues:f}=l;if((f.z||f.rotate||f.rotateX||f.rotateY||f.rotateZ||f.skewX||f.skewY)&&(c=!0),!c)return;const d={};f.z&&T_("z",l,d,this.animationValues);for(let m=0;m{var c;return(c=l.currentAnimation)===null||c===void 0?void 0:c.stop()}),this.root.nodes.forEach(oz),this.root.sharedNodes.clear()}}}function $fe(e){e.updateLayout()}function Bfe(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,l=n.source!==e.layout.source;s==="size"?Ji(p=>{const v=l?n.measuredBox[p]:n.layoutBox[p],b=Ri(v);v.min=r[p].min,v.max=v.min+b}):kI(s,n.layoutBox,r)&&Ji(p=>{const v=l?n.measuredBox[p]:n.layoutBox[p],b=Ri(r[p]);v.max=v.min+b,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+b)});const c=Nc();Bh(c,r,n.layoutBox);const f=Nc();l?Bh(f,e.applyTransform(i,!0),n.measuredBox):Bh(f,r,n.layoutBox);const d=!CI(c);let m=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:v,layout:b}=p;if(v&&b){const w=Dn();qh(w,n.layoutBox,v.layoutBox);const S=Dn();qh(S,r,b.layoutBox),DI(w,S)||(m=!0),p.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=w,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:f,layoutDelta:c,hasLayoutChanged:d,hasRelativeTargetChanged:m})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function qfe(e){Oh&&Xl.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Ife(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Ufe(e){e.clearSnapshot()}function oz(e){e.clearMeasurements()}function Vfe(e){e.isLayoutDirty=!1}function Hfe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function sz(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Ffe(e){e.resolveTargetDelta()}function Gfe(e){e.calcProjection()}function Kfe(e){e.resetSkewAndRotation()}function Yfe(e){e.removeLeadSnapshot()}function lz(e,t,n){e.translate=vn(t.translate,0,n),e.scale=vn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function uz(e,t,n,r){e.min=vn(t.min,n.min,r),e.max=vn(t.max,n.max,r)}function Xfe(e,t,n,r){uz(e.x,t.x,n.x,r),uz(e.y,t.y,n.y,r)}function Wfe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Qfe={duration:.45,ease:[.4,0,.1,1]},cz=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),fz=cz("applewebkit/")&&!cz("chrome/")?Math.round:Di;function dz(e){e.min=fz(e.min),e.max=fz(e.max)}function Zfe(e){dz(e.x),dz(e.y)}function kI(e,t,n){return e==="position"||e==="preserve-aspect"&&!tfe(rz(t),rz(n),.2)}function Jfe(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const ede=NI({attachResizeListener:(e,t)=>jp(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),E_={current:void 0},LI=NI({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!E_.current){const e=new ede({});e.mount(window),e.setOptions({layoutScroll:!0}),E_.current=e}return E_.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),tde={pan:{Feature:yfe},drag:{Feature:vfe,ProjectionNode:LI,MeasureLayout:MI}};function nde(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const s=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function zI(e,t){const n=nde(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function hz(e){return t=>{t.pointerType==="touch"||gI()||e(t)}}function rde(e,t,n={}){const[r,i,s]=zI(e,n),l=hz(c=>{const{target:f}=c,d=t(c);if(typeof d!="function"||!f)return;const m=hz(p=>{d(p),f.removeEventListener("pointerleave",m)});f.addEventListener("pointerleave",m,i)});return r.forEach(c=>{c.addEventListener("pointerenter",l,i)}),s}function pz(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&Wt.postRender(()=>s(t,Yp(t)))}class ide extends ml{mount(){const{current:t}=this.node;t&&(this.unmount=rde(t,n=>(pz(this.node,n,"Start"),r=>pz(this.node,r,"End"))))}unmount(){}}class ade extends ml{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Kp(jp(this.node.current,"focus",()=>this.onFocus()),jp(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const $I=(e,t)=>t?e===t?!0:$I(e,t.parentElement):!1,ode=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function sde(e){return ode.has(e.tagName)||e.tabIndex!==-1}const Th=new WeakSet;function mz(e){return t=>{t.key==="Enter"&&e(t)}}function M_(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const lde=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=mz(()=>{if(Th.has(n))return;M_(n,"down");const i=mz(()=>{M_(n,"up")}),s=()=>M_(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function vz(e){return X2(e)&&!gI()}function ude(e,t,n={}){const[r,i,s]=zI(e,n),l=c=>{const f=c.currentTarget;if(!vz(c)||Th.has(f))return;Th.add(f);const d=t(c),m=(b,w)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",v),!(!vz(b)||!Th.has(f))&&(Th.delete(f),typeof d=="function"&&d(b,{success:w}))},p=b=>{m(b,n.useGlobalTarget||$I(f,b.target))},v=b=>{m(b,!1)};window.addEventListener("pointerup",p,i),window.addEventListener("pointercancel",v,i)};return r.forEach(c=>{!sde(c)&&c.getAttribute("tabindex")===null&&(c.tabIndex=0),(n.useGlobalTarget?window:c).addEventListener("pointerdown",l,i),c.addEventListener("focus",d=>lde(d,i),i)}),s}function yz(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&Wt.postRender(()=>s(t,Yp(t)))}class cde extends ml{mount(){const{current:t}=this.node;t&&(this.unmount=ude(t,n=>(yz(this.node,n,"Start"),(r,{success:i})=>yz(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const UO=new WeakMap,j_=new WeakMap,fde=e=>{const t=UO.get(e.target);t&&t(e)},dde=e=>{e.forEach(fde)};function hde({root:e,...t}){const n=e||document;j_.has(n)||j_.set(n,{});const r=j_.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(dde,{root:e,...t})),r[i]}function pde(e,t,n){const r=hde(t);return UO.set(e,n),r.observe(e),()=>{UO.delete(e),r.unobserve(e)}}const mde={some:0,all:1};class vde extends ml{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,l={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:mde[i]},c=f=>{const{isIntersecting:d}=f;if(this.isInView===d||(this.isInView=d,s&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:m,onViewportLeave:p}=this.node.getProps(),v=d?m:p;v&&v(f)};return pde(this.node.current,l,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(yde(t,n))&&this.startObserver()}unmount(){}}function yde({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const gde={inView:{Feature:vde},tap:{Feature:cde},focus:{Feature:ade},hover:{Feature:ide}},bde={layout:{ProjectionNode:LI,MeasureLayout:MI}},VO={current:null},BI={current:!1};function xde(){if(BI.current=!0,!!x2)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>VO.current=e.matches;e.addListener(t),t()}else VO.current=!1}const Sde=[...aI,Lr,sl],wde=e=>Sde.find(iI(e)),gz=new WeakMap;function _de(e,t,n){for(const r in t){const i=t[r],s=n[r];if(dr(i))e.addValue(r,i);else if(dr(s))e.addValue(r,kf(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const l=e.getValue(r);l.liveStyle===!0?l.jump(i):l.hasAnimated||l.set(i)}else{const l=e.getStaticValue(r);e.addValue(r,kf(l!==void 0?l:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const bz=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ade{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:l},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=G2,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const b=Ja.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),BI.current||xde(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:VO.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){gz.delete(this.current),this.projection&&this.projection.unmount(),Qo(this.notifyUpdate),Qo(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Nu.has(t),i=n.on("change",c=>{this.latestValues[t]=c,this.props.onUpdate&&Wt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let l;window.MotionCheckAppearSync&&(l=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),l&&l(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Nf){const n=Nf[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Dn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=kf(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(nI(i)||K6(i))?i=parseFloat(i):!wde(i)&&sl.test(n)&&(i=J6(t,n)),this.setBaseTarget(t,dr(i)?i.get():i)),dr(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const l=T2(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);l&&(i=l[t])}if(r&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!dr(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new z2),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class qI extends Ade{constructor(){super(...arguments),this.KeyframeResolver=oI}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;dr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Ode(e){return window.getComputedStyle(e)}class Tde extends qI{constructor(){super(...arguments),this.type="html",this.renderInstance=T6}readValueFromInstance(t,n){if(Nu.has(n)){const r=F2(n);return r&&r.default||0}else{const r=Ode(t),i=(_6(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return TI(t,n)}build(t,n,r){j2(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return R2(t,n,r)}}class Ede extends qI{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Dn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Nu.has(n)){const r=F2(n);return r&&r.default||0}return n=E6.has(n)?n:_2(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return P6(t,n,r)}build(t,n,r){P2(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){M6(t,n,r,i)}mount(t){this.isSVGTag=D2(t.tagName),super.mount(t)}}const Mde=(e,t)=>O2(e)?new Ede(t):new Tde(t,{allowProjection:e!==K.Fragment}),jde=eue({...Fce,...gde,...tde,...bde},Mde),$f=mle(jde);function W2(e){const t=Vp(()=>kf(e)),{isStatic:n}=K.useContext(Hp);if(n){const[,r]=K.useState(e);K.useEffect(()=>t.on("change",r),[])}return t}function II(e,t){const n=W2(t()),r=()=>n.set(t());return r(),Jg(()=>{const i=()=>Wt.preRender(r,!1,!0),s=e.map(l=>l.on("change",i));return()=>{s.forEach(l=>l()),Qo(r)}}),n}function xz(e){return typeof e=="number"?e:parseFloat(e)}function Pde(e,t={}){const{isStatic:n}=K.useContext(Hp),r=K.useRef(null),i=W2(dr(e)?xz(e.get()):e),s=K.useRef(i.get()),l=K.useRef(()=>{}),c=()=>{const d=r.current;d&&d.time===0&&d.sample(cr.delta),f(),r.current=gce({keyframes:[i.get(),s.current],velocity:i.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...t,onUpdate:l.current})},f=()=>{r.current&&r.current.stop()};return K.useInsertionEffect(()=>i.attach((d,m)=>n?m(d):(s.current=d,l.current=m,Wt.update(c),i.get()),f),[JSON.stringify(t)]),Jg(()=>{if(dr(e))return e.on("change",d=>i.set(xz(d)))},[i]),i}const Cde=e=>e&&typeof e=="object"&&e.mix,Dde=e=>Cde(e)?e.mix:void 0;function Rde(...e){const t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],s=e[2+n],l=e[3+n],c=pI(i,s,{mixer:Dde(s[0]),...l});return t?c(r):c}function Nde(e){Lh.current=[],e();const t=II(Lh.current,e);return Lh.current=void 0,t}function kde(e,t,n,r){if(typeof e=="function")return Nde(e);const i=typeof t=="function"?t:Rde(t,n,r);return Array.isArray(e)?Sz(e,i):Sz([e],([s])=>i(s))}function Sz(e,t){const n=Vp(()=>[]);return II(e,()=>{n.length=0;const r=e.length;for(let i=0;i{function n(r){if(r.key==="?"&&!r.metaKey&&!r.ctrlKey){const i=r.target;if(i&&/^(INPUT|TEXTAREA|SELECT)$/.test(i.tagName))return;r.preventDefault(),t(s=>!s)}else r.key==="Escape"&&t(!1)}return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),T.jsxs(T.Fragment,{children:[T.jsx("button",{type:"button",onClick:()=>t(!0),title:"Keyboard shortcuts (?)",className:"fixed bottom-16 right-4 z-30 inline-flex items-center justify-center rounded-full p-2 bg-[var(--bg-card)] border border-[var(--border-soft)] text-[var(--text-muted)] hover:text-[var(--text-primary)] shadow",children:T.jsx(Pse,{className:"size-4"})}),T.jsx(d6,{children:e?T.jsx($f.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 bg-black/60 grid place-items-center p-4",onClick:()=>t(!1),children:T.jsxs($f.div,{initial:{scale:.96,y:8},animate:{scale:1,y:0},exit:{scale:.96,y:8},className:"bg-[var(--bg-card)] border border-[var(--border-soft)] rounded-2xl p-6 max-w-md w-full",onClick:n=>n.stopPropagation(),children:[T.jsxs("div",{className:"flex items-center justify-between mb-4",children:[T.jsx("h2",{className:"text-base font-semibold text-[var(--text-primary)]",children:"Keyboard shortcuts"}),T.jsx("button",{type:"button",onClick:()=>t(!1),className:"text-[var(--text-muted)] hover:text-[var(--text-primary)]",children:T.jsx(c6,{className:"size-4"})})]}),T.jsx("dl",{className:"space-y-2 text-sm",children:Lde.map(n=>T.jsxs("div",{className:"flex items-center justify-between gap-4",children:[T.jsx("dt",{className:"font-mono text-[var(--accent)] bg-[var(--bg-elevated)] px-2 py-0.5 rounded border border-[var(--border-soft)]",children:n.key}),T.jsx("dd",{className:"text-[var(--text-muted)] text-right",children:n.label})]},n.key))})]})}):null})]})}function $de(e){if(!e)return"Apple Silicon";const t=e.toLowerCase();return t.includes("mac17")?"M5":t.includes("mac16")?"M4":t.includes("mac15")?"M3":t.includes("mac14")?"M2":t.includes("mac13")?"M1":"Apple Silicon"}function Bde(e,t){return(e??"").replace(/^Apple\s+/i,"").trim()||$de(t)}function qde(){const e=De(s=>s.machine),t=De(s=>s.profileName),n=De(s=>s.modelId),r=De(s=>s.contextWindow),i=Bde(e==null?void 0:e.chip,e==null?void 0:e.machine_model);return T.jsxs(ct,{title:"Hardware",subtitle:(e==null?void 0:e.machine_model)??"unknown machine model",children:[T.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[T.jsx(qv,{icon:T.jsx(EO,{className:"size-4 text-[var(--accent)]"}),label:"chip",value:i}),T.jsx(qv,{icon:T.jsx(Dse,{className:"size-4 text-[var(--accent-cool)]"}),label:"unified memory",value:li((e==null?void 0:e.unified_memory_bytes)??null)}),T.jsx(qv,{icon:T.jsx(zse,{className:"size-4 text-[var(--accent-warm)]"}),label:"profile",value:t??"—"}),T.jsx(qv,{icon:T.jsx(EO,{className:"size-4 text-[var(--text-muted)]"}),label:"context window",value:r?`${r.toLocaleString()} tok`:"—"})]}),T.jsxs("div",{className:"mt-3 text-xs text-[var(--text-muted)] truncate",children:["loaded model: ",T.jsx("span",{className:"text-[var(--text-primary)]",children:n??"—"})]})]})}function qv({icon:e,label:t,value:n}){return T.jsxs("div",{className:"rounded-md border border-[var(--border-soft)] bg-[var(--bg-elevated)] p-3",children:[T.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:[e,t]}),T.jsx("div",{className:"text-base font-semibold text-[var(--text-primary)] mt-1 truncate",children:n})]})}function Ide(){const e=De(S=>S.mem),t=De(S=>S.machine),n=De(S=>S.latest),r=Number((t==null?void 0:t.unified_memory_bytes)??0),i=Number((e==null?void 0:e.active_memory_bytes)??0),s=Number((e==null?void 0:e.cache_memory_bytes)??0),l=Number((e==null?void 0:e.peak_memory_bytes)??0),c=Number((n==null?void 0:n.peak_memory_bytes)??0),f=Math.max(l,c),d=Math.max(0,r-i-s),m=r>0?r:Math.max(i+s+d,1),p=i/m*100,v=s/m*100,b=d/m*100,w=r>0?Math.min(100,f/r*100):null;return T.jsxs(ct,{title:"MLX memory",subtitle:r>0?`${li(i+s)} live · ${li(d)} headroom · ${li(r)} unified`:"live MLX memory snapshot",children:[T.jsxs("div",{className:"relative h-6 w-full rounded-full overflow-hidden border border-[var(--border-soft)] bg-[var(--bg-elevated)]",children:[T.jsx("div",{className:"absolute inset-y-0 left-0 transition-[width] duration-500",style:{width:`${p}%`,background:"var(--accent)"}}),T.jsx("div",{className:"absolute inset-y-0 transition-[width] duration-500",style:{left:`${p}%`,width:`${v}%`,background:"var(--accent-cool)",opacity:.7}}),T.jsx("div",{className:"absolute inset-y-0 transition-[width] duration-500",style:{left:`${p+v}%`,width:`${b}%`,background:"rgba(255,255,255,0.06)"}}),w!==null&&w>0?T.jsx("div",{className:"absolute top-0 bottom-0 border-l-2 border-[var(--accent-warm)]",style:{left:`${w}%`},title:`Peak ${li(f)}`}):null]}),T.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 mt-3 text-xs",children:[T.jsx(Iv,{color:"var(--accent)",label:"active",value:li(i)}),T.jsx(Iv,{color:"var(--accent-cool)",label:"cache",value:li(s)}),T.jsx(Iv,{color:"var(--accent-warm)",label:"peak",value:li(f)}),T.jsx(Iv,{color:"rgba(255,255,255,0.15)",label:"headroom",value:li(d)})]}),e!=null&&e.ok?null:T.jsxs("p",{className:"text-xs text-[var(--text-muted)] mt-2",children:["MLX accessors unavailable: ",(e==null?void 0:e.error)??"unknown"]})]})}function Iv({color:e,label:t,value:n}){return T.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[T.jsx("span",{className:"w-2.5 h-2.5 rounded-sm",style:{background:e}}),T.jsx("span",{className:"text-[var(--text-muted)] uppercase tracking-wider text-[10px]",children:t}),T.jsx("span",{className:"ml-auto text-[var(--text-primary)] tabular-nums",children:n})]})}function Ude(){const e=De(n=>n.mem),t=De(n=>n.latest);return T.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[T.jsx("div",{className:"col-span-12",children:T.jsx(qde,{})}),T.jsx("div",{className:"col-span-12",children:T.jsx(Ide,{})}),T.jsx("div",{className:"col-span-12 sm:col-span-6 lg:col-span-4",children:T.jsx(ct,{title:"Active memory",subtitle:"MLX active allocation",children:T.jsx(Ya,{value:li((e==null?void 0:e.active_memory_bytes)??null),tone:"accent",caption:"live MLX accessor"})})}),T.jsx("div",{className:"col-span-12 sm:col-span-6 lg:col-span-4",children:T.jsx(ct,{title:"Cache memory",subtitle:"MLX cache allocator",children:T.jsx(Ya,{value:li((e==null?void 0:e.cache_memory_bytes)??null),tone:"cool",caption:"reusable buffer cache"})})}),T.jsx("div",{className:"col-span-12 sm:col-span-6 lg:col-span-4",children:T.jsx(ct,{title:"Peak memory",subtitle:"highest seen this process",children:T.jsx(Ya,{value:li(Math.max(Number((e==null?void 0:e.peak_memory_bytes)??0),Number((t==null?void 0:t.peak_memory_bytes)??0))||null),tone:"warm",caption:"includes last-request peak"})})})]})}var Q2={};(function e(t,n,r,i){var s=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),l=typeof Path2D=="function"&&typeof DOMMatrix=="function",c=(function(){if(!t.OffscreenCanvas)return!1;try{var U=new OffscreenCanvas(1,1),D=U.getContext("2d");D.fillRect(0,0,1,1);var V=U.transferToImageBitmap();D.createPattern(V,"no-repeat")}catch{return!1}return!0})();function f(){}function d(U){var D=n.exports.Promise,V=D!==void 0?D:t.Promise;return typeof V=="function"?new V(U):(U(f,f),null)}var m=(function(U,D){return{transform:function(V){if(U)return V;if(D.has(V))return D.get(V);var X=new OffscreenCanvas(V.width,V.height),ue=X.getContext("2d");return ue.drawImage(V,0,0),D.set(V,X),X},clear:function(){D.clear()}}})(c,new Map),p=(function(){var U=Math.floor(16.666666666666668),D,V,X={},ue=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(D=function(be){var Se=Math.random();return X[Se]=requestAnimationFrame(function ye(Me){ue===Me||ue+U-1i.newMaxTPSEvent),t=De(i=>i.consumeNewMaxTPS),n=De(i=>i.soundEnabled),r=K.useRef(0);return K.useEffect(()=>{if(!e)return;const i=Date.now();if(i-r.currentwindow.clearTimeout(s)},[e,t,n]),{newMaxBanner:e}}function Gde(){const{newMaxBanner:e}=Fde();return T.jsx("div",{className:"fixed top-16 right-4 z-50 pointer-events-none",children:T.jsx(d6,{children:e?T.jsxs($f.div,{initial:{opacity:0,y:-10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.95},transition:{type:"spring",stiffness:280,damping:22},className:"rounded-xl border border-[var(--accent)]/30 bg-[var(--bg-card)] shadow-[0_12px_40px_rgba(0,214,143,0.25)] px-4 py-3 flex items-center gap-3",children:[T.jsx(Ise,{className:"size-5 text-[var(--accent)]"}),T.jsxs("div",{className:"leading-tight",children:[T.jsx("div",{className:"text-sm font-semibold text-[var(--text-primary)]",children:"New all-time max"}),T.jsxs("div",{className:"text-xs text-[var(--text-muted)] tabular-nums",children:[On(e.tok_s)," tok/s"]})]})]},`${e.when_s}-${e.tok_s}`):null})})}function Kde(){const e=i$(),t=De(f=>f.lastCompletedPrefill),{data:n}=g2(),[r,i]=K.useState(()=>performance.now());K.useEffect(()=>{if(!e.active)return;const f=window.setInterval(()=>i(performance.now()),250);return()=>window.clearInterval(f)},[e.active]);const s=K.useRef(null);e.active?(!s.current||s.current.request_id!==e.request_id)&&(s.current={request_id:e.request_id,anchorMs:r,baseElapsed:e.elapsed_s}):s.current&&(s.current=null);const l=e.active&&s.current?s.current.baseElapsed+(r-s.current.anchorMs)/1e3:e.active?e.elapsed_s:0,c=(()=>{const d=((n==null?void 0:n.history)??[]).map(m=>m.prefill_tok_s).filter(m=>typeof m=="number"&&m>0);return d.length===0?null:d.reduce((m,p)=>m+p,0)/d.length})();return e.active?T.jsx(Yde,{view:e,liveElapsed:l}):T.jsxs(ct,{title:"Prefill",subtitle:t?`last: ${We(t.new_prefill_tokens??t.tokens_total)} tokens · ${Zn(t.elapsed_s)} · ${On(t.prefill_tok_s)} tok/s`:c!=null?`idle · historical mean ${On(c)} tok/s`:"idle · no prefill samples yet",children:[T.jsxs("div",{className:"grid grid-cols-3 gap-3 text-xs",children:[T.jsx(P_,{label:"last new tokens",value:We((t==null?void 0:t.new_prefill_tokens)??(t==null?void 0:t.tokens_total))}),T.jsx(P_,{label:"last cached",value:We(t==null?void 0:t.cached_tokens),tone:"cool"}),T.jsx(P_,{label:"last prefill tok/s",value:On(t==null?void 0:t.prefill_tok_s),tone:"accent"})]}),T.jsx("p",{className:"text-xs text-[var(--text-muted)] mt-3 leading-relaxed",children:"This panel goes live when the server starts chewing a prompt. During chunked prefill it shows progress %, live prefill tok/s, ETA, and elapsed time — what you watch while the decode gauge is still zero."})]})}function Yde({view:e,liveElapsed:t}){const n=e.tokens_done>0&&t>0?e.tokens_done/t:e.prefill_tok_s,r=Math.max(0,e.tokens_total-e.tokens_done),i=n&&n>0&&r>0?r/n:null,s=e.tokens_total>0?Math.min(100,e.tokens_done/e.tokens_total*100):0;return T.jsxs(ct,{title:T.jsxs("span",{className:"flex items-center gap-2",children:[T.jsx(u6,{className:"size-4 text-[var(--accent-warm)] animate-spin"}),T.jsx("span",{children:"Prefill in progress"})]}),subtitle:T.jsxs("span",{children:[We(e.tokens_done)," / ",We(e.tokens_total)," tokens",e.session_id?T.jsxs(T.Fragment,{children:[" · ",T.jsx("span",{className:"text-[var(--accent-cool)]",children:bu(e.session_id,18)})]}):null]}),children:[T.jsxs("div",{className:"relative h-6 w-full rounded-full bg-[var(--bg-elevated)] overflow-hidden border border-[var(--border-soft)]",children:[T.jsx($f.div,{className:"absolute inset-y-0 left-0",style:{background:"var(--accent-warm)"},initial:!1,animate:{width:`${s}%`},transition:{type:"spring",stiffness:80,damping:18,mass:.6}}),T.jsxs("div",{className:"absolute inset-0 grid place-items-center text-xs font-semibold tabular-nums text-[var(--text-primary)] mix-blend-difference",children:[s.toFixed(1),"%"]})]}),T.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mt-4 text-xs",children:[T.jsx(Uv,{label:"live prefill tok/s",value:On(n),tone:"accent"}),T.jsx(Uv,{label:"ETA",value:i!=null?Zn(i):"calculating",tone:"warm"}),T.jsx(Uv,{label:"elapsed",value:Zn(t)}),T.jsx(Uv,{label:"cached / total",value:`${We(e.cached_tokens)} / ${We(e.tokens_total)}`,tone:"cool"})]}),T.jsxs("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)] mt-3",children:["request ",bu(e.request_id,22)]})]})}function Uv({label:e,value:t,tone:n}){const r=n==="warm"?"text-[var(--accent-warm)]":n==="accent"?"text-[var(--accent)]":n==="cool"?"text-[var(--accent-cool)]":"text-[var(--text-primary)]";return T.jsxs("div",{className:"rounded-md border border-[var(--border-soft)] bg-[var(--bg-elevated)] px-3 py-2",children:[T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:e}),T.jsx("div",{className:`text-sm font-semibold tabular-nums ${r}`,children:t})]})}function P_({label:e,value:t,tone:n}){const r=n==="accent"?"text-[var(--accent)]":n==="cool"?"text-[var(--accent-cool)]":"text-[var(--text-primary)]";return T.jsxs("div",{className:"rounded-md border border-dashed border-[var(--border-soft)] px-3 py-2",children:[T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:e}),T.jsx("div",{className:`text-sm font-semibold tabular-nums ${r}`,children:t})]})}const Xde=[20,40,60],wz=80;function _z(e){return e>=60?"var(--accent)":e>=40?"var(--accent-cool)":e>=20?"var(--accent-warm)":"var(--accent-hot)"}function Wde(){const e=De(S=>S.liveTokS),t=De(S=>{var x;return((x=S.latest)==null?void 0:x.decode_tok_s)??null}),n=De(S=>S.rolling),r=i$(),i=K.useRef(null),s=typeof e=="number",l=s?e:t,c=Math.max(0,l??0),f=W2(c),d=Pde(f,{stiffness:140,damping:22,mass:.6}),m=kde(d,S=>S.toFixed(1)),p=K.useRef(s);p.current=s,K.useEffect(()=>{f.set(c)},[c,f]),K.useEffect(()=>{const S=i.current;if(!S)return;const x=window.devicePixelRatio||1,A=220;S.width=A*x,S.height=A*x,S.style.width=`${A}px`,S.style.height=`${A}px`;const _=S.getContext("2d");if(!_)return;let M=0;function E(j){if(!_)return;_.save(),_.scale(x,x),_.clearRect(0,0,A,A);const R=A/2,k=A/2+10,z=84,G=Math.PI*.75,$=Math.PI*2.25,B=$-G;_.beginPath(),_.arc(R,k,z,G,$),_.strokeStyle="rgba(255,255,255,0.06)",_.lineWidth=14,_.lineCap="round",_.stroke(),Xde.forEach(q=>{const F=Math.min(1,q/wz),ie=G+B*F;_.beginPath();const ce=z-18,U=z+8;_.moveTo(R+Math.cos(ie)*ce,k+Math.sin(ie)*ce),_.lineTo(R+Math.cos(ie)*U,k+Math.sin(ie)*U),_.strokeStyle="rgba(255,255,255,0.18)",_.lineWidth=1.5,_.stroke(),_.fillStyle="rgba(200,210,220,0.45)",_.font="10px ui-sans-serif, system-ui",_.textAlign="center",_.fillText(String(q),R+Math.cos(ie)*(z-30),k+Math.sin(ie)*(z-30)+3)});const Z=p.current,ee=Math.min(1,j/wz),J=G+B*ee;_.beginPath(),_.arc(R,k,z,G,J),_.strokeStyle=_z(j),_.globalAlpha=Z?1:.35,_.shadowColor=_z(j),_.shadowBlur=Z?16:0,_.lineWidth=14,_.lineCap="round",_.stroke(),_.shadowBlur=0,_.globalAlpha=1,_.fillStyle="rgba(255,255,255,0.7)",_.font="10px ui-sans-serif, system-ui",_.textAlign="center",_.fillText("tok/s",R,k+38),_.restore()}function O(){E(d.get()),M=requestAnimationFrame(O)}return M=requestAnimationFrame(O),()=>cancelAnimationFrame(M)},[d]);const v=(n==null?void 0:n.max)??null,b=(n==null?void 0:n.min)??null,w=(n==null?void 0:n.sticky_all_time_max)??null;return T.jsxs(ct,{title:"Live decode TPS",subtitle:r.active?`prefilling ${r.pct.toFixed(0)}% — decode not started`:s?`current ${On(e)} tok/s`:l!==null?`idle · last request ${On(l)} tok/s`:"waiting for generation",children:[T.jsxs("div",{className:"relative grid place-items-center min-h-[220px]",children:[T.jsx("canvas",{ref:i,"aria-hidden":"true"}),T.jsx("div",{className:"absolute inset-0 grid place-items-center pointer-events-none",children:T.jsx("div",{className:"text-center -mt-2",children:r.active?T.jsxs(T.Fragment,{children:[T.jsxs("span",{className:"inline-flex items-center gap-2 text-[20px] font-semibold tracking-wide text-[var(--accent-warm)] leading-none",children:[T.jsx(u6,{className:"size-5 animate-spin"}),"PREFILLING"]}),T.jsxs("span",{className:"text-xs text-[var(--text-muted)] mt-2 block tabular-nums",children:[r.pct.toFixed(1),"% · decode hasn't started yet"]})]}):T.jsxs(T.Fragment,{children:[T.jsx($f.span,{className:`block text-[44px] font-semibold tabular-nums leading-none ${s?"text-[var(--text-primary)]":"text-[var(--text-muted)]"}`,children:m}),T.jsx("span",{className:"text-xs text-[var(--text-muted)] mt-1 block",children:s?"live":l!==null?"last request":"idle"})]})})})]}),T.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-3 text-xs",children:[T.jsx(C_,{label:"window min",value:On(b)}),T.jsx(C_,{label:"window max",value:On(v),tone:"warm"}),T.jsx(C_,{label:"all-time",value:On(w),tone:"accent"})]})]})}function C_({label:e,value:t,tone:n}){const r=n==="warm"?"text-[var(--accent-warm)]":n==="accent"?"text-[var(--accent)]":"text-[var(--text-primary)]";return T.jsxs("div",{className:"bg-[var(--bg-elevated)] rounded-md px-2 py-1.5 border border-[var(--border-soft)]",children:[T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:e}),T.jsx("div",{className:`text-sm font-semibold tabular-nums ${r}`,children:t})]})}function Qde(){const e=VV(),t=De(f=>f.rolling),n=K.useRef(null),r=K.useRef(null),{data:i,maxPoint:s,minPoint:l}=K.useMemo(()=>{const f=[],d=[];let m=-1,p=-1;for(let v=0;ve[m].tok_s)&&(m=v),(p===-1||b.tok_s=0?e[m]:null,minPoint:p>=0?e[p]:null}},[e]);K.useEffect(()=>{var b,w;const f=n.current;if(!f)return;const m={width:f.clientWidth,height:220,padding:[8,16,8,8],cursor:{drag:{x:!1,y:!1,setScale:!1},focus:{prox:24},sync:{key:"tps",scales:["x",null]}},scales:{x:{time:!0},y:{range:(S,x,A)=>[Math.max(0,x*.9),A*1.05]}},axes:[{stroke:"rgba(200,210,220,0.55)",grid:{show:!0,stroke:"rgba(255,255,255,0.04)",width:1}},{stroke:"rgba(200,210,220,0.55)",grid:{show:!0,stroke:"rgba(255,255,255,0.04)",width:1},values:(S,x)=>x.map(A=>`${A.toFixed(0)} tok/s`),size:s6}],legend:{show:!1},series:[{},{label:"decode tok/s",stroke:"rgba(0,214,143,0.9)",width:2,points:{show:!1},paths:(w=(b=tr.paths).spline)==null?void 0:w.call(b),fill:"rgba(0,214,143,0.10)"}]},p=new tr(m,i,f);r.current=p;const v=()=>{p.setSize({width:f.clientWidth,height:220})};return window.addEventListener("resize",v),()=>{window.removeEventListener("resize",v),p.destroy(),r.current=null}},[]),K.useEffect(()=>{const f=r.current;f&&f.setData(i)},[i]);const c=De(f=>f.sessionFilter);return T.jsxs(ct,{title:"Decode TPS (last 5 min)",subtitle:t?`${t.count} samples · p50 ${On(t.p50)} · p95 ${On(t.p95)}${c?` · filtered by ${c}`:""}`:"no completed requests yet",children:[T.jsx("div",{ref:n,className:"w-full"}),(s||l)&&T.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-3 text-xs",children:[T.jsxs("div",{className:"rounded-md border border-[var(--border-soft)] bg-[var(--bg-elevated)] px-3 py-2 flex items-center justify-between",children:[T.jsx("span",{className:"text-[var(--text-muted)]",children:"window max"}),T.jsxs("span",{className:"text-[var(--accent-warm)] font-semibold tabular-nums",children:[On((s==null?void 0:s.tok_s)??null)," tok/s"]})]}),T.jsxs("div",{className:"rounded-md border border-[var(--border-soft)] bg-[var(--bg-elevated)] px-3 py-2 flex items-center justify-between",children:[T.jsx("span",{className:"text-[var(--text-muted)]",children:"window min"}),T.jsxs("span",{className:"text-[var(--accent-cool)] font-semibold tabular-nums",children:[On((l==null?void 0:l.tok_s)??null)," tok/s"]})]})]})]})}function Zde(){const e=De(t=>t.lifetime);return e?T.jsx(ct,{title:"Tokens served · this server",children:T.jsx(Ya,{value:We(e.tokens_total),unit:"tokens",tone:"accent",caption:T.jsxs("div",{className:"space-y-1",children:[T.jsxs("div",{children:[We(e.requests_total)," requests since ",Zn(e.uptime_s)," ago"]}),T.jsxs("div",{className:"text-[var(--text-muted)]",children:["prompt: ",We(e.prompt_tokens_total)," ·"," ","completion: ",We(e.completion_tokens_total)," ·"," ","cached: ",We(e.cached_tokens_total)]}),e.cancelled_total>0?T.jsxs("div",{className:"text-[var(--accent-warm)] text-xs",children:[We(e.cancelled_total)," cancelled"]}):null]})})}):T.jsx(ct,{title:"Tokens served · this server",children:T.jsx(Ya,{value:"—",caption:"waiting for first request"})})}function Jde(){var l;const e=De(c=>c.latest),t=De(c=>c.inFlight),n=De(c=>c.sessionBank),r=De(c=>c.contextWindow),i=(e==null?void 0:e.context_len)??0,s=r?Math.min(100,i/r*100):0;return T.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[T.jsx("div",{className:"col-span-12 lg:col-span-5",children:T.jsx(Wde,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-7",children:T.jsx(Qde,{})}),T.jsx("div",{className:"col-span-12",children:T.jsx(Kde,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-4",children:T.jsx(Zde,{})}),T.jsx("div",{className:"col-span-6 lg:col-span-4",children:T.jsx(ct,{title:"In flight",children:T.jsx(Ya,{value:We(t.length),unit:"requests",tone:t.length>0?"accent":"default",caption:t.length===0?"idle · waiting for next request":`${t.length} active · oldest ${Zn(Math.max(...t.map(c=>c.age_s)))}`})})}),T.jsx("div",{className:"col-span-6 lg:col-span-4",children:T.jsx(ct,{title:"Cache + context",subtitle:n?`${((l=n.prefixes)==null?void 0:l.length)??0} of ${n.max_entries} slots`:"—",children:T.jsx(Ya,{value:`${s.toFixed(0)}%`,unit:"context used",tone:s>=75?"warm":s>=95?"hot":"cool",caption:`${We(i)} / ${We(r)} tokens`})})}),T.jsx("div",{className:"col-span-12 lg:col-span-6",children:T.jsx(ct,{title:"Last request",subtitle:"from /metrics latest",children:T.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[T.jsx(Qi,{label:"decode tok/s",value:On(e==null?void 0:e.decode_tok_s),highlight:!0}),T.jsx(Qi,{label:"ttft",value:Zn(e==null?void 0:e.ttft_s)}),T.jsx(Qi,{label:"prompt eval",value:Zn(e==null?void 0:e.prompt_eval_time_s)}),T.jsx(Qi,{label:"decode",value:Zn(e==null?void 0:e.decode_elapsed_s)}),T.jsx(Qi,{label:"prefill tok/s",value:On(e==null?void 0:e.prefill_tok_s)}),T.jsx(Qi,{label:"cached",value:`${We(e==null?void 0:e.cached_tokens)} / ${We(e==null?void 0:e.prompt_tokens)}`})]})})}),T.jsx("div",{className:"col-span-12 lg:col-span-6",children:T.jsx(ct,{title:"Session",subtitle:"from latest envelope",children:T.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[T.jsx(Qi,{label:"session id",value:e!=null&&e.session_id?e.session_id:"—"}),T.jsx(Qi,{label:"cache hit",value:e!=null&&e.session_cache_hit?"yes":"no",highlight:!!(e!=null&&e.session_cache_hit)}),T.jsx(Qi,{label:"restore mode",value:(e==null?void 0:e.session_restore_mode)??"—"}),T.jsx(Qi,{label:"miss reason",value:(e==null?void 0:e.cache_miss_reason)??"—"}),T.jsx(Qi,{label:"mtp depth",value:We(e==null?void 0:e.mtp_depth)}),T.jsx(Qi,{label:"verify calls",value:We(e==null?void 0:e.verify_calls)})]})})})]})}function Qi({label:e,value:t,highlight:n=!1}){return T.jsxs("div",{className:"bg-[var(--bg-elevated)] rounded-md px-3 py-2 border border-[var(--border-soft)]",children:[T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:e}),T.jsx("div",{className:"text-sm font-semibold tabular-nums "+(n?"text-[var(--accent)]":"text-[var(--text-primary)]"),children:t})]})}function ehe(){const e=De(r=>r.inFlight),t=qf(),n=sg({mutationFn:r=>ed.postCancel(r),onSuccess:()=>{t.invalidateQueries({queryKey:["metrics"]})}});return T.jsx(ct,{title:"In-flight requests",subtitle:e.length===0?"no active generations":`${e.length} active · cancel is best-effort`,children:e.length===0?T.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:"Drive load from any client (Web UI, hippo, OpenAI SDK) to see live requests here."}):T.jsx("ul",{className:"divide-y divide-[var(--border-soft)] -mx-2",children:e.map(r=>{const i=r.last_progress,s=(i==null?void 0:i.completion_tokens)??0,l=i==null?void 0:i.decode_tok_s;return T.jsxs($f.li,{initial:{opacity:0,x:-6},animate:{opacity:1,x:0},exit:{opacity:0},className:"px-2 py-3 grid grid-cols-[1fr_auto] items-center gap-3",children:[T.jsxs("div",{className:"min-w-0",children:[T.jsxs("div",{className:"flex items-center gap-2 text-xs text-[var(--text-muted)]",children:[T.jsx("span",{className:"font-mono truncate",children:bu(r.request_id,28)}),r.session_id?T.jsx("span",{className:"text-[10px] uppercase tracking-wider text-[var(--accent-cool)]",children:bu(r.session_id,16)}):null]}),T.jsx("div",{className:"text-sm text-[var(--text-primary)] truncate",children:r.prompt_preview||"—"}),T.jsxs("div",{className:"text-xs text-[var(--text-muted)] flex flex-wrap gap-x-3 mt-1",children:[T.jsxs("span",{children:["age ",Zn(r.age_s)]}),T.jsxs("span",{children:[We(s)," tok"]}),typeof l=="number"&&l>0?T.jsxs("span",{className:"text-[var(--accent)]",children:[l.toFixed(1)," tok/s"]}):null]})]}),T.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 text-xs text-[var(--accent-hot)] hover:text-[var(--accent-hot)] hover:bg-[var(--accent-hot)]/10 rounded px-2 py-1 disabled:opacity-50",onClick:()=>n.mutate(r.request_id),disabled:n.isPending||r.cancelled,children:[T.jsx($se,{className:"size-3"}),r.cancelled?"cancelling":"cancel"]})]},r.request_id)})})})}function the(){var l,c,f;const e=gse(),t=HV(),n=De(d=>d.sessionFilter),r=K.useMemo(()=>{var p;const d=((p=e.data)==null?void 0:p.recent)??[],m=d.length>0?d:t;return n?m.filter(v=>v.session_id===n).reverse():m.slice().reverse()},[(l=e.data)==null?void 0:l.recent,t,n]),[i,s]=K.useState(new Set);return T.jsx(ct,{title:"Recent requests",subtitle:r.length===0?"no requests yet":`${r.length} of ${((f=(c=e.data)==null?void 0:c.recent)==null?void 0:f.length)??t.length}${n?` · filtered by ${n}`:""}`,children:r.length===0?T.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:"Drive a few requests against this server and they will appear here in order, most recent first."}):T.jsx("div",{className:"overflow-x-auto -mx-3",children:T.jsxs("table",{className:"min-w-full text-sm",children:[T.jsx("thead",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:T.jsxs("tr",{children:[T.jsx(Ia,{}),T.jsx(Ia,{children:"session"}),T.jsx(Ia,{align:"right",children:"prompt"}),T.jsx(Ia,{align:"right",children:"cached"}),T.jsx(Ia,{align:"right",children:"gen"}),T.jsx(Ia,{align:"right",children:"tok/s"}),T.jsx(Ia,{align:"right",children:"ttft"}),T.jsx(Ia,{align:"right",children:"verify"}),T.jsx(Ia,{children:"cache"}),T.jsx(Ia,{align:"right",children:"when"})]})}),T.jsx("tbody",{children:r.map((d,m)=>{const p=i.has(m);return T.jsx(nhe,{row:d,isOpen:p,onToggle:()=>s(v=>{const b=new Set(v);return b.has(m)?b.delete(m):b.add(m),b})},`${d.session_id??"x"}-${m}`)})})]})})})}function Ia({children:e,align:t="left"}){return T.jsx("th",{className:`px-3 py-2 font-medium whitespace-nowrap ${t==="right"?"text-right":"text-left"}`,children:e})}function Ua({children:e,align:t="left",highlight:n=!1}){return T.jsx("td",{className:`px-3 py-2 whitespace-nowrap ${t==="right"?"text-right tabular-nums":""} ${n?"text-[var(--accent)] font-medium":"text-[var(--text-primary)]"}`,children:e})}function nhe({row:e,isOpen:t,onToggle:n}){const r=e.session_id??"—",i=e.session_cache_hit?{label:"HIT",color:"text-[var(--accent)] bg-[var(--accent)]/10"}:{label:(e.cache_miss_reason??"MISS").toUpperCase(),color:"text-[var(--accent-warm)] bg-[var(--accent-warm)]/10"};return T.jsxs(T.Fragment,{children:[T.jsxs("tr",{className:"border-t border-[var(--border-soft)] hover:bg-[var(--bg-elevated)]/60",children:[T.jsx(Ua,{children:T.jsx("button",{type:"button",onClick:n,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)]","aria-label":t?"Collapse":"Expand",children:t?T.jsx(Ase,{className:"size-4"}):T.jsx(Ose,{className:"size-4"})})}),T.jsx(Ua,{children:T.jsx("span",{className:"font-mono text-xs",children:bu(r,20)})}),T.jsx(Ua,{align:"right",children:We(e.prompt_tokens)}),T.jsx(Ua,{align:"right",children:We(e.cached_tokens)}),T.jsx(Ua,{align:"right",children:We(e.completion_tokens)}),T.jsx(Ua,{align:"right",highlight:!0,children:On(e.decode_tok_s)}),T.jsx(Ua,{align:"right",children:Zn(e.ttft_s)}),T.jsx(Ua,{align:"right",children:We(e.verify_calls)}),T.jsx(Ua,{children:T.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] uppercase tracking-wider ${i.color}`,children:i.label})}),T.jsx(Ua,{align:"right",highlight:!1,children:T.jsx("span",{className:"text-[var(--text-muted)] text-xs",children:ZO(e.completed_at_s)})})]}),t?T.jsx("tr",{className:"bg-[var(--bg-elevated)]/40",children:T.jsx("td",{colSpan:10,className:"px-3 py-3",children:T.jsx("pre",{className:"text-[11px] leading-relaxed text-[var(--text-muted)] overflow-x-auto max-h-[260px]",children:JSON.stringify(e,null,2)})})}):null]})}function rhe(){return T.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[T.jsx("div",{className:"col-span-12",children:T.jsx(ehe,{})}),T.jsx("div",{className:"col-span-12",children:T.jsx(the,{})})]})}const Az={open:"bg-emerald-400 shadow-[0_0_12px_rgb(74,222,128,0.6)]",connecting:"bg-amber-400 animate-pulse",reconnecting:"bg-amber-500 animate-pulse",failed:"bg-rose-500",unauthorized:"bg-rose-500",idle:"bg-slate-500"},ihe={open:"live",connecting:"connecting",reconnecting:"reconnecting",failed:"offline",unauthorized:"sign-in required",idle:"idle"};function ahe(){const e=De(t=>t.connection);return T.jsxs("div",{className:"flex items-center gap-2 text-xs text-[var(--text-muted)]",children:[T.jsx("span",{className:nf("w-2 h-2 rounded-full",Az[e]??Az.idle)}),T.jsx("span",{className:"hidden sm:inline",children:ihe[e]??e})]})}function ohe(){const e=De(n=>n.connection);if(e==="open"||e==="idle"||e==="connecting"||e==="unauthorized")return null;const t=e==="failed"?"Connection to MTPLX lost. The dashboard will keep trying.":"Reconnecting to MTPLX...";return T.jsx("div",{className:"bg-amber-500/15 text-amber-300 text-xs px-4 py-1.5 text-center border-b border-amber-500/30",children:t})}function she(){const e=UV(),t=De(r=>r.sessionFilter)??"",n=De(r=>r.setSessionFilter);return T.jsxs("label",{className:"hidden md:flex items-center gap-2 text-xs text-[var(--text-muted)]",children:[T.jsx("span",{children:"Session"}),T.jsxs("select",{value:t,onChange:r=>n(r.target.value||null),className:"bg-[var(--bg-card)] border border-[var(--border-soft)] rounded px-2 py-1 text-xs text-[var(--text-primary)] focus:outline-none focus:ring-1 focus:ring-[var(--accent)]",children:[T.jsx("option",{value:"",children:"All sessions"}),e.map(r=>T.jsx("option",{value:r,children:bu(r,28)},r))]})]})}function lhe(){const e=De(n=>n.soundEnabled),t=De(n=>n.toggleSound);return T.jsx("button",{onClick:t,title:e?"Mute new-max chime (S)":"Enable new-max chime (S)",className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] inline-flex items-center",children:e?T.jsx(Use,{className:"size-4"}):T.jsx(Vse,{className:"size-4"})})}function uhe(){const e=De(n=>n.theme),t=De(n=>n.cycleTheme);return T.jsxs("button",{onClick:t,title:`Theme: ${e} (press T to cycle)`,className:"flex items-center gap-1.5 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)]",children:[T.jsx(Rse,{className:"size-4"}),T.jsx("span",{className:"hidden lg:inline",children:e})]})}const che=[{id:"overview",label:"Overview",icon:_se},{id:"speculative",label:"Speculative",icon:Cse},{id:"cache",label:"Cache",icon:Ese},{id:"memory",label:"Memory",icon:Mse},{id:"thermal",label:"Thermal",icon:Bse},{id:"requests",label:"Requests",icon:kse},{id:"settings",label:"Settings",icon:Nse}];function fhe({active:e,onSelect:t,children:n,bottomBar:r}){const i=De(d=>d.modelId),s=De(d=>d.profileName),l=De(d=>d.inFlight.length),[c,f]=K.useState(!1);return T.jsxs("div",{className:"min-h-dvh flex flex-col bg-[var(--bg-canvas)] text-[var(--text-primary)]",children:[T.jsx(ohe,{}),T.jsx(dhe,{modelId:i,profileName:s,activeRequests:l}),T.jsxs("div",{className:"flex-1 flex",children:[T.jsx(hhe,{active:e,onSelect:t,collapsed:c,setCollapsed:f}),T.jsx("main",{className:"flex-1 min-w-0 px-6 lg:px-8 py-6 lg:py-8 pb-24 overflow-x-hidden",children:n})]}),r?T.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-40 border-t border-[var(--border-soft)] bg-[var(--bg-elevated)]/90 backdrop-blur",children:r}):null]})}function dhe({modelId:e,profileName:t,activeRequests:n}){return T.jsxs("div",{className:"h-14 px-4 lg:px-6 flex items-center justify-between border-b border-[var(--border-soft)] bg-[var(--bg-elevated)]",children:[T.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[T.jsx("span",{className:"inline-flex items-center justify-center w-7 h-7 rounded-full bg-[var(--accent)] text-black font-bold text-sm",children:"M"}),T.jsxs("div",{className:"hidden sm:block leading-none",children:[T.jsx("div",{className:"text-sm font-semibold",children:"MTPLX"}),T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:"Live Dashboard"})]}),T.jsxs("div",{className:"hidden md:flex items-center gap-2 ml-4 text-xs text-[var(--text-muted)] min-w-0",children:[T.jsx(EO,{className:"size-3.5 shrink-0"}),T.jsx("span",{className:"truncate max-w-[280px]",children:e??"—"}),t?T.jsx("span",{className:"px-2 py-0.5 rounded-full border border-[var(--border-soft)] text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:t}):null,n>0?T.jsxs("span",{className:"px-2 py-0.5 rounded-full bg-[var(--accent)]/15 text-[var(--accent)] text-[10px] uppercase tracking-wider",children:[n," in flight"]}):null]})]}),T.jsxs("div",{className:"flex items-center gap-3",children:[T.jsx(she,{}),T.jsx(lhe,{}),T.jsx(uhe,{}),T.jsx(ahe,{})]})]})}function hhe({active:e,onSelect:t,collapsed:n,setCollapsed:r}){return T.jsxs("nav",{className:nf("shrink-0 border-r border-[var(--border-soft)] bg-[var(--bg-elevated)] flex flex-col py-3 transition-[width]",n?"w-14":"w-56"),children:[T.jsx("div",{className:"px-2 flex flex-col gap-1",children:che.map(i=>{const s=i.icon,l=e===i.id;return T.jsxs("button",{onClick:()=>t(i.id),className:nf("group w-full flex items-center gap-3 px-3 py-2 rounded-lg text-left text-sm transition-colors",l?"bg-[var(--bg-card)] text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-card)]/60"),title:n?i.label:void 0,children:[T.jsx(s,{className:"size-4 shrink-0"}),n?null:T.jsx("span",{className:"truncate",children:i.label}),l?T.jsx("span",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-[var(--accent)]"}):null]},i.id)})}),T.jsx("button",{onClick:()=>r(!n),className:"mt-auto mx-2 mb-2 text-[10px] uppercase tracking-widest text-[var(--text-muted)] hover:text-[var(--text-primary)] py-2",children:n?"Expand":"Collapse"})]})}function phe(){const e=De(f=>f.authRequired),[t,n]=K.useState(""),[r,i]=K.useState(!1),[s,l]=K.useState(null);if(!e)return null;async function c(f){f.preventDefault();const d=t.trim();if(!(!d||r)){i(!0),l(null);try{await yse(d),window.location.reload()}catch(m){l(m instanceof Qg?"That key was not accepted.":`Sign-in failed: ${m instanceof Error?m.message:String(m)}`),i(!1)}}}return T.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 grid place-items-center p-4",children:T.jsxs("form",{onSubmit:c,className:"bg-[var(--bg-card)] border border-[var(--border-soft)] rounded-2xl p-6 max-w-md w-full",children:[T.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[T.jsx("span",{className:"inline-flex items-center justify-center w-8 h-8 rounded-full bg-[var(--accent)]/15 text-[var(--accent)]",children:T.jsx(jse,{className:"size-4"})}),T.jsx("h2",{className:"text-base font-semibold text-[var(--text-primary)]",children:"Sign in to the dashboard"})]}),T.jsx("p",{className:"text-sm text-[var(--text-muted)] leading-relaxed",children:"This server was started with an API key. Paste it to continue, or open the dashboard link the server printed at startup."}),T.jsxs("label",{className:"block mt-4",children:[T.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"API key"}),T.jsx("input",{type:"password",autoComplete:"off",autoFocus:!0,value:t,onChange:f=>n(f.target.value),className:"mt-1 w-full bg-[var(--bg-elevated)] border border-[var(--border-soft)] rounded px-3 py-2 text-sm text-[var(--text-primary)] font-mono"})]}),s?T.jsx("div",{className:"mt-2 text-xs text-[var(--accent-hot)]",children:s}):null,T.jsx("button",{type:"submit",disabled:r||t.trim().length===0,className:"mt-4 w-full rounded-md bg-[var(--accent)] text-black text-sm font-semibold py-2 disabled:opacity-50",children:r?"Signing in…":"Sign in"})]})})}function mhe(){const e=De(f=>f.latest),t=(e==null?void 0:e.accepted_by_depth)??[],n=(e==null?void 0:e.drafted_by_depth)??[],r=(e==null?void 0:e.mean_accept_probability_by_depth)??[],i=X_(e==null?void 0:e.accepted_drafts,t),s=X_(e==null?void 0:e.drafted_tokens,n),l=Math.max(t.length,n.length,r.length),c=Array.from({length:l},(f,d)=>{const m=t[d]??0,p=n[d]??Math.max(m,1);return{depth:`D${d+1}`,accepted:m,drafted:p,rate:p>0?m/p*100:0,meanProb:r[d]!=null?r[d]*100:null}});return T.jsx(ct,{title:"Per-depth acceptance",subtitle:c.length>0?`${We(e==null?void 0:e.verify_calls)} verify calls · ${We(i)} accepted of ${We(s)} drafted`:"no completed generation yet",children:T.jsx("div",{className:"h-[260px]",children:c.length===0?T.jsx(vhe,{}):T.jsx(wg,{width:"100%",height:"100%",children:T.jsxs(gae,{data:c,margin:{top:8,right:24,left:0,bottom:0},children:[T.jsx(Ip,{stroke:"rgba(255,255,255,0.06)"}),T.jsx(pl,{dataKey:"depth",stroke:"rgba(200,210,220,0.6)"}),T.jsx(Wo,{yAxisId:"left",stroke:"rgba(200,210,220,0.6)",tickFormatter:f=>`${f}%`,domain:[0,100]}),T.jsx(Wo,{yAxisId:"right",orientation:"right",stroke:"rgba(240,180,41,0.7)",tickFormatter:f=>`${f}%`,domain:[0,100]}),T.jsx(ji,{contentStyle:{background:"var(--bg-elevated)",border:"1px solid var(--border-soft)",borderRadius:8},labelStyle:{color:"var(--text-muted)"},formatter:(f,d)=>typeof f=="number"?[`${f.toFixed(1)}%`,String(d)]:[String(f),String(d)]}),T.jsx(oa,{yAxisId:"left",dataKey:"rate",fill:"rgba(0,214,143,0.85)",name:"accept rate",radius:[6,6,0,0]}),T.jsx(Up,{yAxisId:"right",type:"monotone",dataKey:"meanProb",stroke:"rgba(240,180,41,0.95)",strokeWidth:2,dot:{r:4},name:"mean P(accept)"})]})})})})}function vhe(){return T.jsx("div",{className:"h-full grid place-items-center text-[var(--text-muted)] text-sm",children:"Run a generation to populate per-depth acceptance."})}const Oz=[{key:"verify_forward_time_s",label:"verify forward",color:"rgba(0,214,143,0.85)",description:"Forward pass through the verify graph (target model)"},{key:"verify_logits_eval_time_s",label:"logits eval",color:"rgba(79,182,243,0.85)",description:"Logits evaluation against MTP draft tokens"},{key:"verify_hidden_eval_time_s",label:"hidden eval",color:"rgba(155,118,233,0.85)",description:"Hidden-state evaluation for downstream cache writes"},{key:"verify_target_distribution_time_s",label:"target dist",color:"rgba(245,158,11,0.85)",description:"Target distribution computation (probability ratio)"},{key:"verify_eval_unattributed_time_s",label:"unattributed",color:"rgba(244,114,182,0.75)",description:"Unaccounted-for eval cost; ideally near zero"},{key:"accept_time_s",label:"accept",color:"rgba(0,214,143,0.55)",description:"Acceptance sampling + residual correction"},{key:"repair_time_s",label:"repair",color:"rgba(239,68,68,0.85)",description:"Repair pass after rejection (lazy when 0)"},{key:"snapshot_time_s",label:"snapshot",color:"rgba(200,210,220,0.45)",description:"Cache snapshot/restore"},{key:"capture_commit_time_s",label:"capture/commit",color:"rgba(0,214,143,0.35)",description:"Capture-commit verifier overhead"},{key:"rollback_time_s",label:"rollback",color:"rgba(240,88,106,0.55)",description:"State rollback after reject"}];function yhe(){const e=De(i=>i.latest),t=Number((e==null?void 0:e.verify_time_s)??0),n=Oz.map(i=>{const s=Number((e==null?void 0:e[i.key])??0)||0;return{...i,seconds:s,pct:t>0?s/t*100:0}}),r=n.some(i=>i.seconds>0);return T.jsx(ct,{title:"Verify-cycle waterfall",subtitle:e?`verify total ${Zn(t)} · target forward ${Zn(e==null?void 0:e.target_forward_time_s)} · draft ${Zn(e==null?void 0:e.draft_time_s)}`:"no completed verify cycle",children:T.jsx("div",{className:"h-[280px]",children:r?T.jsx(wg,{width:"100%",height:"100%",children:T.jsxs(n2,{layout:"vertical",data:n,margin:{top:4,right:30,left:110,bottom:0},children:[T.jsx(Ip,{stroke:"rgba(255,255,255,0.06)",horizontal:!1}),T.jsx(pl,{type:"number",stroke:"rgba(200,210,220,0.6)",tickFormatter:i=>`${(i*1e3).toFixed(0)}ms`}),T.jsx(Wo,{type:"category",dataKey:"label",stroke:"rgba(200,210,220,0.7)",width:100}),T.jsx(ji,{contentStyle:{background:"var(--bg-elevated)",border:"1px solid var(--border-soft)",borderRadius:8,fontSize:12},labelStyle:{color:"var(--text-muted)"},formatter:(i,s,l)=>{var f,d;const c=Oz.find(m=>{var p;return m.label===((p=l==null?void 0:l.payload)==null?void 0:p.label)});return typeof i!="number"?[i,(c==null?void 0:c.label)??"—"]:[`${Zn(i)} · ${((d=(f=l==null?void 0:l.payload)==null?void 0:f.pct)==null?void 0:d.toFixed(1))??"—"}%`,(c==null?void 0:c.description)??(c==null?void 0:c.label)??"—"]}}),T.jsx(oa,{dataKey:"seconds",radius:[0,6,6,0],children:n.map(i=>T.jsx(oa,{dataKey:"seconds",fill:i.color},i.key))})]})}):T.jsx("div",{className:"h-full grid place-items-center text-[var(--text-muted)] text-sm",children:"Run a generation to capture the verify decomposition."})})})}function ghe(){const e=De(i=>i.latest),t=X_(e==null?void 0:e.drafted_tokens,e==null?void 0:e.drafted_by_depth),n=(e==null?void 0:e.verify_calls)??0,r=n>0?t/n:null;return T.jsx(ct,{title:"Drafted / verify call",subtitle:"higher is faster",children:T.jsx(Ya,{value:r===null?"—":r.toFixed(2),unit:"tok/call",tone:typeof r=="number"&&r>=3?"accent":"default",caption:`${We(t)} drafted · ${We(n)} verifies`})})}function bhe(){const e=De(r=>r.latest),t=(e==null?void 0:e.correction_tokens)??0,n=(e==null?void 0:e.bonus_tokens)??0;return T.jsxs(ct,{title:"Correction vs bonus tokens",subtitle:"dropped + reborn tokens",children:[T.jsxs("div",{className:"flex items-baseline gap-6",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-2xl font-semibold text-[var(--accent-hot)] tabular-nums",children:We(t)}),T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:"correction"})]}),T.jsxs("div",{children:[T.jsx("div",{className:"text-2xl font-semibold text-[var(--accent)] tabular-nums",children:We(n)}),T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:"bonus"})]})]}),T.jsx("div",{className:"text-xs text-[var(--text-muted)] mt-3",children:"bonus = accepted > drafted at depth d; correction = residual fix-up"})]})}function xhe(){const e=De(r=>r.latest),t=(e==null?void 0:e.request_tok_s)??null,n=(e==null?void 0:e.decode_tok_s)??null;return T.jsx(ct,{title:"Decode vs request tok/s",subtitle:"decode excludes prefill",children:T.jsxs("div",{className:"flex items-baseline gap-6",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-2xl font-semibold text-[var(--accent)] tabular-nums",children:On(n)}),T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:"decode tok/s"})]}),T.jsxs("div",{children:[T.jsx("div",{className:"text-2xl font-semibold text-[var(--accent-cool)] tabular-nums",children:On(t)}),T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:"request tok/s"})]})]})})}function She(){return T.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[T.jsx("div",{className:"col-span-12 lg:col-span-6",children:T.jsx(mhe,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-6",children:T.jsx(yhe,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-4",children:T.jsx(ghe,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-4",children:T.jsx(bhe,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-4",children:T.jsx(xhe,{})})]})}function whe(){const e=De(t=>t.thermal);return!e||!e.ok||e.fans.length===0?T.jsx(ct,{title:"Fan rings",subtitle:"thermal polling disabled or unavailable",children:T.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:["Pass ",T.jsx("code",{children:"--enable-thermal-poll"})," when starting the MTPLX server to populate live fan RPMs. The poll uses",T.jsx("code",{children:" thermalforge status"})," at 1 Hz and is off by default to keep the hot path clean."]})}):T.jsx(ct,{title:"Fan rings",subtitle:`min ${We(e.min_rpm)} RPM · max ${We(e.max_rpm)} RPM`,children:T.jsx("div",{className:"grid grid-cols-2 gap-4",children:e.fans.map((t,n)=>T.jsx(_he,{index:n,fan:t},n))})})}function _he({index:e,fan:t}){const n=K.useRef(null),r=Number(t.actual_rpm??t.rpm??0),i=Number(t.target_rpm??r),s=Math.max(1,Number(t.max_capacity_rpm??7800)),l=String(t.mode??"auto"),c=Math.min(1,r/s),f=Math.min(1,i/s);return K.useEffect(()=>{const d=n.current;if(!d)return;const m=window.devicePixelRatio||1,p=140;d.width=p*m,d.height=p*m,d.style.width=`${p}px`,d.style.height=`${p}px`;const v=d.getContext("2d");if(!v)return;v.scale(m,m),v.clearRect(0,0,p,p);const b=p/2,w=p/2,S=56,x=Math.PI*.75,A=Math.PI*2.25,_=A-x;v.beginPath(),v.arc(b,w,S,x,A),v.strokeStyle="rgba(255,255,255,0.06)",v.lineWidth=10,v.lineCap="round",v.stroke();const M=x+_*c,E=c>.7?"rgba(240,88,106,0.9)":c>.4?"rgba(240,180,41,0.9)":"rgba(0,214,143,0.9)";v.beginPath(),v.arc(b,w,S,x,M),v.strokeStyle=E,v.shadowColor=E,v.shadowBlur=12,v.stroke(),v.shadowBlur=0;const O=x+_*f;v.beginPath();const j=S-10,R=S+6;v.moveTo(b+Math.cos(O)*j,w+Math.sin(O)*j),v.lineTo(b+Math.cos(O)*R,w+Math.sin(O)*R),v.strokeStyle="rgba(255,255,255,0.65)",v.lineWidth=2,v.stroke()},[r,i,s,c,f]),T.jsxs("div",{className:"rounded-lg border border-[var(--border-soft)] bg-[var(--bg-elevated)] p-3 grid place-items-center",children:[T.jsxs("div",{className:"relative",children:[T.jsx("canvas",{ref:n,"aria-hidden":"true"}),T.jsx("div",{className:"absolute inset-0 grid place-items-center pointer-events-none",children:T.jsxs("div",{className:"text-center",children:[T.jsx("div",{className:"text-2xl font-semibold tabular-nums text-[var(--text-primary)]",children:We(r)}),T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)] -mt-1",children:"RPM"})]})})]}),T.jsxs("div",{className:"mt-2 text-xs text-[var(--text-muted)] text-center",children:["F",e," · ",l," ",T.jsxs("span",{className:"text-[var(--text-primary)]",children:["/ ",We(s)," max"]})]})]})}function Ahe(){var n;const e=De(r=>r.thermal),t=De(r=>r.thermalWhenS);return T.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[T.jsx("div",{className:"col-span-12 lg:col-span-7",children:T.jsx(whe,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-5",children:T.jsx(ct,{title:"Thermal snapshot",subtitle:t?ZO(t):"no poll yet",children:e?T.jsxs("dl",{className:"text-sm space-y-1",children:[T.jsx(Vv,{label:"ok",value:String(e.ok)}),T.jsx(Vv,{label:"min RPM",value:String(e.min_rpm??"—")}),T.jsx(Vv,{label:"max RPM",value:String(e.max_rpm??"—")}),T.jsx(Vv,{label:"fans",value:String(((n=e.fans)==null?void 0:n.length)??0)})]}):T.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:["Thermal polling is off by default. Pass"," ",T.jsx("code",{children:"--enable-thermal-poll"})," when starting MTPLX."]})})}),T.jsx("div",{className:"col-span-12",children:T.jsx(ct,{title:"GPU MHz · coming in v2",subtitle:"ThermalForge does not expose GPU clock; powermetrics integration lands later",children:T.jsxs("p",{className:"text-sm text-[var(--text-muted)] leading-relaxed",children:["ThermalForge's ",T.jsx("code",{children:"status"})," JSON shape (verified May 2026) covers fan RPMs and modes but not GPU MHz or thermal pressure. The dashboard plan documents GPU MHz as a v2 add via ",T.jsx("code",{children:"powermetrics"}),"; until then this slot is intentionally empty so we don't render a fake number."]})})})]})}function Vv({label:e,value:t}){return T.jsxs("div",{className:"flex justify-between",children:[T.jsx("dt",{className:"text-[var(--text-muted)]",children:e}),T.jsx("dd",{className:"text-[var(--text-primary)] tabular-nums",children:t})]})}const D_=["overview","speculative","cache","memory","thermal","requests","settings"];function Ohe(e){const t=De(i=>i.cycleTheme),n=De(i=>i.togglePauseStream),r=De(i=>i.toggleSound);K.useEffect(()=>{function i(s){const l=s.target;if(!(l&&/^(INPUT|TEXTAREA|SELECT)$/.test(l.tagName))&&!(s.metaKey||s.ctrlKey||s.altKey))switch(s.key){case"t":t();break;case" ":s.preventDefault(),n();break;case"s":r();break;case"g":{const c=D_.findIndex(d=>d===document.body.dataset.activeTab),f=D_[(c+1)%D_.length];e(f);break}}}return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[t,n,r,e])}const R_=[1e3,2e3,4e3,8e3,16e3,3e4];function The(e){let t="idle",n=null,r=!1,i=0,s=null;function l(m){var p;t=m,(p=e.onConnectionChange)==null||p.call(e,m)}function c(){s!==null&&(clearTimeout(s),s=null)}function f(){if(r)return;l("reconnecting");const m=R_[Math.min(i,R_.length-1)];i+=1,s=setTimeout(d,m)}function d(){if(r)return;c(),l("connecting");try{n=new EventSource("/v1/mtplx/metrics/stream")}catch(p){console.error("EventSource construction failed",p),f();return}n.addEventListener("open",()=>{i=0,l("open")}),n.addEventListener("snapshot",p=>{try{const v=JSON.parse(p.data);e.onSnapshot(v)}catch(v){console.warn("failed to parse snapshot event",v)}});const m=p=>v=>{try{const b=JSON.parse(v.data);e.onEvent({...b,kind:p})}catch(b){console.warn(`failed to parse ${p} event`,b)}};n.addEventListener("progress",m("progress")),n.addEventListener("completed",m("completed")),n.addEventListener("new_max_tps",m("new_max_tps")),n.addEventListener("thermal",m("thermal")),n.addEventListener("prefill",m("prefill")),n.addEventListener("error",()=>{if(!r)if(n&&n.readyState===EventSource.CLOSED){try{n.close()}catch{}n=null,vse().then(p=>{var v;if(!r){if(p==="unauthorized"){l("unauthorized"),(v=e.onUnauthorized)==null||v.call(e);return}i>=R_.length&&l("failed"),f()}})}else l("reconnecting")})}return d(),{close:()=>{if(r=!0,c(),n){try{n.close()}catch{}n=null}l("idle")},state:()=>t}}function Ehe(){const e=K.useRef(null),t=De(s=>s.applySnapshot),n=De(s=>s.applyEvent),r=De(s=>s.setConnection),i=De(s=>s.setAuthRequired);K.useEffect(()=>{r("connecting");const s=The({onSnapshot:t,onEvent:n,onConnectionChange:r,onUnauthorized:()=>i(!0)});return e.current=s,()=>{s.close(),e.current=null}},[t,n,r,i])}const Mhe=new FU({defaultOptions:{queries:{staleTime:1e3,retry:(e,t)=>!(t instanceof Qg)&&e<1}}});function jhe(){return T.jsxs(GU,{client:Mhe,children:[T.jsx(Phe,{}),T.jsx(Gde,{}),T.jsx(zde,{}),T.jsx(phe,{})]})}function Phe(){const[e,t]=K.useState("overview");Ehe(),Ohe(t);const n=De(r=>r.pauseStream);return K.useEffect(()=>{document.body.dataset.activeTab=e},[e]),K.useEffect(()=>{document.body.dataset.streamPaused=String(n)},[n]),T.jsx(fhe,{active:e,onSelect:t,bottomBar:T.jsx(FV,{}),children:e==="overview"?T.jsx(Jde,{}):e==="speculative"?T.jsx(She,{}):e==="cache"?T.jsx(Xse,{}):e==="memory"?T.jsx(Ude,{}):e==="thermal"?T.jsx(Ahe,{}):e==="requests"?T.jsx(rhe,{}):e==="settings"?T.jsx(Zse,{}):null})}const UI=document.getElementById("root");if(!UI)throw new Error("MTPLX dashboard mount point #root is missing from index.html");bU.createRoot(UI).render(T.jsx(Q.StrictMode,{children:T.jsx(jhe,{})})); + `),()=>{document.head.removeChild(m)}},[t]),T.jsx(cle,{isPresent:t,childRef:r,sizeRef:i,children:K.cloneElement(e,{ref:r})})}const dle=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:l})=>{const c=Vp(hle),f=K.useId(),d=K.useCallback(p=>{c.set(p,!0);for(const v of c.values())if(!v)return;r&&r()},[c,r]),m=K.useMemo(()=>({id:f,initial:t,isPresent:n,custom:i,onExitComplete:d,register:p=>(c.set(p,!1),()=>c.delete(p))}),s?[Math.random(),d]:[n,d]);return K.useMemo(()=>{c.forEach((p,v)=>c.set(v,!1))},[n]),K.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),l==="popLayout"&&(e=T.jsx(fle,{isPresent:n,children:e})),T.jsx(Zg.Provider,{value:m,children:e})};function hle(){return new Map}function d6(e=!0){const t=K.useContext(Zg);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=K.useId();K.useEffect(()=>{e&&i(s)},[e]);const l=K.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,l]:[!0]}const Lv=e=>e.key||"";function oL(e){const t=[];return K.Children.forEach(e,n=>{K.isValidElement(n)&&t.push(n)}),t}const S2=typeof window<"u",Jg=S2?K.useLayoutEffect:K.useEffect,h6=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:l=!1})=>{const[c,f]=d6(l),d=K.useMemo(()=>oL(e),[e]),m=l&&!c?[]:d.map(Lv),p=K.useRef(!0),v=K.useRef(d),b=Vp(()=>new Map),[w,S]=K.useState(d),[x,A]=K.useState(d);Jg(()=>{p.current=!1,v.current=d;for(let E=0;E{const O=Lv(E),j=l&&!c?!1:d===x||m.includes(O),R=()=>{if(b.has(O))b.set(O,!0);else return;let k=!0;b.forEach(z=>{z||(k=!1)}),k&&(M==null||M(),A(v.current),l&&(f==null||f()),r&&r())};return T.jsx(dle,{isPresent:j,initial:!p.current||n?void 0:!1,custom:j?void 0:t,presenceAffectsLayout:i,mode:s,onExitComplete:j?void 0:R,children:E},O)})})},Di=e=>e;let p6=Di;const ple={useManualTiming:!1};function mle(e){let t=new Set,n=new Set,r=!1,i=!1;const s=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(d){s.has(d)&&(f.schedule(d),e()),d(l)}const f={schedule:(d,m=!1,p=!1)=>{const b=p&&r?t:n;return m&&s.add(d),b.has(d)||b.add(d),d},cancel:d=>{n.delete(d),s.delete(d)},process:d=>{if(l=d,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(c),t.clear(),r=!1,i&&(i=!1,f.process(d))}};return f}const zv=["read","resolveKeyframes","update","preRender","render","postRender"],vle=40;function m6(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,l=zv.reduce((A,_)=>(A[_]=mle(s),A),{}),{read:c,resolveKeyframes:f,update:d,preRender:m,render:p,postRender:v}=l,b=()=>{const A=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(A-i.timestamp,vle),1),i.timestamp=A,i.isProcessing=!0,c.process(i),f.process(i),d.process(i),m.process(i),p.process(i),v.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(b))},w=()=>{n=!0,r=!0,i.isProcessing||e(b)};return{schedule:zv.reduce((A,_)=>{const M=l[_];return A[_]=(E,O=!1,j=!1)=>(n||w(),M.schedule(E,O,j)),A},{}),cancel:A=>{for(let _=0;_sL[e].some(n=>!!t[n])};function yle(e){for(const t in e)Nf[t]={...Nf[t],...e[t]}}const gle=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function eg(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||gle.has(e)}let y6=e=>!eg(e);function ble(e){e&&(y6=t=>t.startsWith("on")?!eg(t):e(t))}try{ble(require("@emotion/is-prop-valid").default)}catch{}function xle(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(y6(i)||n===!0&&eg(i)||!t&&!eg(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function Sle(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const e0=K.createContext({});function Tp(e){return typeof e=="string"||Array.isArray(e)}function t0(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const w2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],_2=["initial",...w2];function n0(e){return t0(e.animate)||_2.some(t=>Tp(e[t]))}function g6(e){return!!(n0(e)||e.variants)}function wle(e,t){if(n0(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Tp(n)?n:void 0,animate:Tp(r)?r:void 0}}return e.inherit!==!1?t:{}}function _le(e){const{initial:t,animate:n}=wle(e,K.useContext(e0));return K.useMemo(()=>({initial:t,animate:n}),[lL(t),lL(n)])}function lL(e){return Array.isArray(e)?e.join(" "):e}const Ale=Symbol.for("motionComponentSymbol");function Dc(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ole(e,t,n){return K.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Dc(n)&&(n.current=r))},[t])}const A2=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Tle="framerAppearId",b6="data-"+A2(Tle),{schedule:O2}=m6(queueMicrotask,!1),x6=K.createContext({});function Ele(e,t,n,r,i){var s,l;const{visualElement:c}=K.useContext(e0),f=K.useContext(v6),d=K.useContext(Zg),m=K.useContext(Hp).reducedMotion,p=K.useRef(null);r=r||f.renderer,!p.current&&r&&(p.current=r(e,{visualState:t,parent:c,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:m}));const v=p.current,b=K.useContext(x6);v&&!v.projection&&i&&(v.type==="html"||v.type==="svg")&&Mle(p.current,n,i,b);const w=K.useRef(!1);K.useInsertionEffect(()=>{v&&w.current&&v.update(n,d)});const S=n[b6],x=K.useRef(!!S&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,S))&&((l=window.MotionHasOptimisedAnimation)===null||l===void 0?void 0:l.call(window,S)));return Jg(()=>{v&&(w.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),O2.render(v.render),x.current&&v.animationState&&v.animationState.animateChanges())}),K.useEffect(()=>{v&&(!x.current&&v.animationState&&v.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var A;(A=window.MotionHandoffMarkAsComplete)===null||A===void 0||A.call(window,S)}),x.current=!1))}),v}function Mle(e,t,n,r){const{layoutId:i,layout:s,drag:l,dragConstraints:c,layoutScroll:f,layoutRoot:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:S6(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!l||c&&Dc(c),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:f,layoutRoot:d})}function S6(e){if(e)return e.options.allowProjection!==!1?e.projection:S6(e.parent)}function jle({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var s,l;e&&yle(e);function c(d,m){let p;const v={...K.useContext(Hp),...d,layoutId:Cle(d)},{isStatic:b}=v,w=_le(d),S=r(d,b);if(!b&&S2){Ple();const x=Dle(v);p=x.MeasureLayout,w.visualElement=Ele(i,S,v,t,x.ProjectionNode)}return T.jsxs(e0.Provider,{value:w,children:[p&&w.visualElement?T.jsx(p,{visualElement:w.visualElement,...v}):null,n(i,d,Ole(S,w.visualElement,m),S,b,w.visualElement)]})}c.displayName=`motion.${typeof i=="string"?i:`create(${(l=(s=i.displayName)!==null&&s!==void 0?s:i.name)!==null&&l!==void 0?l:""})`}`;const f=K.forwardRef(c);return f[Ale]=i,f}function Cle({layoutId:e}){const t=K.useContext(x2).id;return t&&e!==void 0?t+"-"+e:e}function Ple(e,t){K.useContext(v6).strict}function Dle(e){const{drag:t,layout:n}=Nf;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Rle=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function T2(e){return typeof e!="string"||e.includes("-")?!1:!!(Rle.indexOf(e)>-1||/[A-Z]/u.test(e))}function uL(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function E2(e,t,n,r){if(typeof t=="function"){const[i,s]=uL(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=uL(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const jO=e=>Array.isArray(e),Nle=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),kle=e=>jO(e)?e[e.length-1]||0:e,dr=e=>!!(e&&e.getVelocity);function Gv(e){const t=dr(e)?e.get():e;return Nle(t)?t.toValue():t}function Lle({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const l={latestValues:zle(r,i,s,e),renderState:t()};return n&&(l.onMount=c=>n({props:r,current:c,...l}),l.onUpdate=c=>n(c)),l}const w6=e=>(t,n)=>{const r=K.useContext(e0),i=K.useContext(Zg),s=()=>Lle(e,t,r,i);return n?s():Vp(s)};function zle(e,t,n,r){const i={},s=r(e,{});for(const v in s)i[v]=Gv(s[v]);let{initial:l,animate:c}=e;const f=n0(e),d=g6(e);t&&d&&!f&&e.inherit!==!1&&(l===void 0&&(l=t.initial),c===void 0&&(c=t.animate));let m=n?n.initial===!1:!1;m=m||l===!1;const p=m?c:l;if(p&&typeof p!="boolean"&&!t0(p)){const v=Array.isArray(p)?p:[p];for(let b=0;bt=>typeof t=="string"&&t.startsWith(e),A6=_6("--"),$le=_6("var(--"),M2=e=>$le(e)?Ble.test(e.split("/*")[0].trim()):!1,Ble=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,O6=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Zo=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},Ep={...nd,transform:e=>Zo(0,1,e)},$v={...nd,default:1},Fp=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Us=Fp("deg"),Za=Fp("%"),Ge=Fp("px"),qle=Fp("vh"),Ile=Fp("vw"),cL={...Za,parse:e=>Za.parse(e)/100,transform:e=>Za.transform(e*100)},Ule={borderWidth:Ge,borderTopWidth:Ge,borderRightWidth:Ge,borderBottomWidth:Ge,borderLeftWidth:Ge,borderRadius:Ge,radius:Ge,borderTopLeftRadius:Ge,borderTopRightRadius:Ge,borderBottomRightRadius:Ge,borderBottomLeftRadius:Ge,width:Ge,maxWidth:Ge,height:Ge,maxHeight:Ge,top:Ge,right:Ge,bottom:Ge,left:Ge,padding:Ge,paddingTop:Ge,paddingRight:Ge,paddingBottom:Ge,paddingLeft:Ge,margin:Ge,marginTop:Ge,marginRight:Ge,marginBottom:Ge,marginLeft:Ge,backgroundPositionX:Ge,backgroundPositionY:Ge},Vle={rotate:Us,rotateX:Us,rotateY:Us,rotateZ:Us,scale:$v,scaleX:$v,scaleY:$v,scaleZ:$v,skew:Us,skewX:Us,skewY:Us,distance:Ge,translateX:Ge,translateY:Ge,translateZ:Ge,x:Ge,y:Ge,z:Ge,perspective:Ge,transformPerspective:Ge,opacity:Ep,originX:cL,originY:cL,originZ:Ge},fL={...nd,transform:Math.round},j2={...Ule,...Vle,zIndex:fL,size:Ge,fillOpacity:Ep,strokeOpacity:Ep,numOctaves:fL},Hle={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Fle=td.length;function Gle(e,t,n){let r="",i=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}}),T6=()=>({...D2(),attrs:{}}),R2=e=>typeof e=="string"&&e.toLowerCase()==="svg";function E6(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const M6=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function j6(e,t,n,r){E6(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(M6.has(i)?i:A2(i),t.attrs[i])}const tg={};function Qle(e){Object.assign(tg,e)}function C6(e,{layout:t,layoutId:n}){return Nu.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!tg[e]||e==="opacity")}function N2(e,t,n){var r;const{style:i}=e,s={};for(const l in i)(dr(i[l])||t.style&&dr(t.style[l])||C6(l,e)||((r=n==null?void 0:n.getValue(l))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[l]=i[l]);return s}function P6(e,t,n){const r=N2(e,t,n);for(const i in e)if(dr(e[i])||dr(t[i])){const s=td.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}function Zle(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const hL=["x","y","width","height","cx","cy","r"],Jle={useVisualState:w6({scrapeMotionValuesFromProps:P6,createRenderState:T6,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!e.drag;if(!s){for(const c in i)if(Nu.has(c)){s=!0;break}}if(!s)return;let l=!t;if(t)for(let c=0;c{Zle(n,r),Wt.render(()=>{P2(r,i,R2(n.tagName),e.transformTemplate),j6(n,r)})})}})},eue={useVisualState:w6({scrapeMotionValuesFromProps:N2,createRenderState:D2})};function D6(e,t,n){for(const r in t)!dr(t[r])&&!C6(r,n)&&(e[r]=t[r])}function tue({transformTemplate:e},t){return K.useMemo(()=>{const n=D2();return C2(n,t,e),Object.assign({},n.vars,n.style)},[t])}function nue(e,t){const n=e.style||{},r={};return D6(r,n,e),Object.assign(r,tue(e,t)),r}function rue(e,t){const n={},r=nue(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function iue(e,t,n,r){const i=K.useMemo(()=>{const s=T6();return P2(s,t,R2(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};D6(s,e.style,e),i.style={...s,...i.style}}return i}function aue(e=!1){return(n,r,i,{latestValues:s},l)=>{const f=(T2(n)?iue:rue)(r,s,l,n),d=xle(r,typeof n=="string",e),m=n!==K.Fragment?{...d,...f,ref:i}:{},{children:p}=r,v=K.useMemo(()=>dr(p)?p.get():p,[p]);return K.createElement(n,{...m,children:v})}}function oue(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const l={...T2(r)?Jle:eue,preloadedFeatures:e,useRender:aue(i),createVisualElement:t,Component:r};return jle(l)}}function R6(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r(Kv===void 0&&Ja.set(cr.isProcessing||ple.useManualTiming?cr.timestamp:performance.now()),Kv),set:e=>{Kv=e,queueMicrotask(sue)}};function L2(e,t){e.indexOf(t)===-1&&e.push(t)}function z2(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class $2{constructor(){this.subscriptions=[]}add(t){return L2(this.subscriptions,t),()=>z2(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s!isNaN(parseFloat(e)),Lh={current:void 0};class uue{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=Ja.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ja.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=lue(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new $2);const r=this.events[t].add(n);return t==="change"?()=>{r(),Wt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Lh.current&&Lh.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=Ja.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>pL)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,pL);return k6(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function kf(e,t){return new uue(e,t)}function cue(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,kf(n))}function fue(e,t){const n=r0(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const l in s){const c=kle(s[l]);cue(e,l,c)}}function due(e){return!!(dr(e)&&e.add)}function CO(e,t){const n=e.getValue("willChange");if(due(n))return n.add(t)}function L6(e){return e.props[b6]}function B2(e){let t;return()=>(t===void 0&&(t=e()),t)}const hue=B2(()=>window.ScrollTimeline!==void 0);class pue{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r{if(hue()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;nn[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class mue extends pue{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const Ho=e=>e*1e3,Fo=e=>e/1e3;function q2(e){return typeof e=="function"}function mL(e,t){e.timeline=t,e.onfinish=null}const I2=e=>Array.isArray(e)&&typeof e[0]=="number",vue={linearEasing:void 0};function yue(e,t){const n=B2(e);return()=>{var r;return(r=vue[t])!==null&&r!==void 0?r:n()}}const ng=yue(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Lf=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},z6=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s`cubic-bezier(${e}, ${t}, ${n}, ${r})`,PO={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ah([0,.65,.55,1]),circOut:Ah([.55,0,1,.45]),backIn:Ah([.31,.01,.66,-.59]),backOut:Ah([.33,1.53,.69,.99])};function B6(e,t){if(e)return typeof e=="function"&&ng()?z6(e,t):I2(e)?Ah(e):Array.isArray(e)?e.map(n=>B6(n,t)||PO.easeOut):PO[e]}const q6=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,gue=1e-7,bue=12;function xue(e,t,n,r,i){let s,l,c=0;do l=t+(n-t)/2,s=q6(l,r,i)-e,s>0?n=l:t=l;while(Math.abs(s)>gue&&++cxue(s,0,1,e,n);return s=>s===0||s===1?s:q6(i(s),t,r)}const I6=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,U6=e=>t=>1-e(1-t),V6=Gp(.33,1.53,.69,.99),U2=U6(V6),H6=I6(U2),F6=e=>(e*=2)<1?.5*U2(e):.5*(2-Math.pow(2,-10*(e-1))),V2=e=>1-Math.sin(Math.acos(e)),G6=U6(V2),K6=I6(V2),Y6=e=>/^0[^.\s]+$/u.test(e);function Sue(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Y6(e):!0}const zh=e=>Math.round(e*1e5)/1e5,H2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function wue(e){return e==null}const _ue=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,F2=(e,t)=>n=>!!(typeof n=="string"&&_ue.test(n)&&n.startsWith(e)||t&&!wue(n)&&Object.prototype.hasOwnProperty.call(n,t)),X6=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,l,c]=r.match(H2);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(l),alpha:c!==void 0?parseFloat(c):1}},Aue=e=>Zo(0,255,e),g_={...nd,transform:e=>Math.round(Aue(e))},ru={test:F2("rgb","red"),parse:X6("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+g_.transform(e)+", "+g_.transform(t)+", "+g_.transform(n)+", "+zh(Ep.transform(r))+")"};function Oue(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const DO={test:F2("#"),parse:Oue,transform:ru.transform},Rc={test:F2("hsl","hue"),parse:X6("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Za.transform(zh(t))+", "+Za.transform(zh(n))+", "+zh(Ep.transform(r))+")"},Lr={test:e=>ru.test(e)||DO.test(e)||Rc.test(e),parse:e=>ru.test(e)?ru.parse(e):Rc.test(e)?Rc.parse(e):DO.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ru.transform(e):Rc.transform(e)},Tue=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Eue(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(H2))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Tue))===null||n===void 0?void 0:n.length)||0)>0}const W6="number",Q6="color",Mue="var",jue="var(",vL="${}",Cue=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Mp(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const c=t.replace(Cue,f=>(Lr.test(f)?(r.color.push(s),i.push(Q6),n.push(Lr.parse(f))):f.startsWith(jue)?(r.var.push(s),i.push(Mue),n.push(f)):(r.number.push(s),i.push(W6),n.push(parseFloat(f))),++s,vL)).split(vL);return{values:n,split:c,indexes:r,types:i}}function Z6(e){return Mp(e).values}function J6(e){const{split:t,types:n}=Mp(e),r=t.length;return i=>{let s="";for(let l=0;ltypeof e=="number"?0:e;function Due(e){const t=Z6(e);return J6(e)(t.map(Pue))}const sl={test:Eue,parse:Z6,createTransformer:J6,getAnimatableNone:Due},Rue=new Set(["brightness","contrast","saturate","opacity"]);function Nue(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(H2)||[];if(!r)return e;const i=n.replace(r,"");let s=Rue.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const kue=/\b([a-z-]*)\(.*?\)/gu,RO={...sl,getAnimatableNone:e=>{const t=e.match(kue);return t?t.map(Nue).join(" "):e}},Lue={...j2,color:Lr,backgroundColor:Lr,outlineColor:Lr,fill:Lr,stroke:Lr,borderColor:Lr,borderTopColor:Lr,borderRightColor:Lr,borderBottomColor:Lr,borderLeftColor:Lr,filter:RO,WebkitFilter:RO},G2=e=>Lue[e];function eI(e,t){let n=G2(e);return n!==RO&&(n=sl),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const zue=new Set(["auto","none","0"]);function $ue(e,t,n){let r=0,i;for(;re===nd||e===Ge,gL=(e,t)=>parseFloat(e.split(", ")[t]),bL=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return gL(i[1],t);{const s=r.match(/^matrix\((.+)\)$/u);return s?gL(s[1],e):0}},Bue=new Set(["x","y","z"]),que=td.filter(e=>!Bue.has(e));function Iue(e){const t=[];return que.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const zf={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:bL(4,13),y:bL(5,14)};zf.translateX=zf.x;zf.translateY=zf.y;const yu=new Set;let NO=!1,kO=!1;function tI(){if(kO){const e=Array.from(yu).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=Iue(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,l])=>{var c;(c=r.getValue(s))===null||c===void 0||c.set(l)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}kO=!1,NO=!1,yu.forEach(e=>e.complete()),yu.clear()}function nI(){yu.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(kO=!0)})}function Uue(){nI(),tI()}class K2{constructor(t,n,r,i,s,l=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=l}scheduleResolve(){this.isScheduled=!0,this.isAsync?(yu.add(this),NO||(NO=!0,Wt.read(nI),Wt.resolveKeyframes(tI))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let s=0;s/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Vue=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Hue(e){const t=Vue.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function iI(e,t,n=1){const[r,i]=Hue(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const l=s.trim();return rI(l)?parseFloat(l):l}return M2(i)?iI(i,t,n+1):i}const aI=e=>t=>t.test(e),Fue={test:e=>e==="auto",parse:e=>e},oI=[nd,Ge,Za,Us,Ile,qle,Fue],xL=e=>oI.find(aI(e));class sI extends K2{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let f=0;f{n.getValue(f).set(d)}),this.resolveNoneKeyframes()}}const SL=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(sl.test(e)||e==="0")&&!e.startsWith("url("));function Gue(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function i0(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(Yue),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const Xue=40;class lI{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:l="loop",...c}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ja.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:l,...c},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Xue?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Uue(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ja.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:l,onComplete:c,onUpdate:f,isGenerator:d}=this.options;if(!d&&!Kue(t,r,i,s))if(l)this.options.duration=0;else{f&&f(i0(t,this.options,n)),c&&c(),this.resolveFinishedPromise();return}const m=this.initPlayback(t,n);m!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...m},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const LO=2e4;function uI(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=LO?1/0:t}const vn=(e,t,n)=>e+(t-e)*n;function b_(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Wue({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,l=0;if(!t)i=s=l=n;else{const c=n<.5?n*(1+t):n+t-n*t,f=2*n-c;i=b_(f,c,e+1/3),s=b_(f,c,e),l=b_(f,c,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(l*255),alpha:r}}function rg(e,t){return n=>n>0?t:e}const x_=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Que=[DO,ru,Rc],Zue=e=>Que.find(t=>t.test(e));function wL(e){const t=Zue(e);if(!t)return!1;let n=t.parse(e);return t===Rc&&(n=Wue(n)),n}const _L=(e,t)=>{const n=wL(e),r=wL(t);if(!n||!r)return rg(e,t);const i={...n};return s=>(i.red=x_(n.red,r.red,s),i.green=x_(n.green,r.green,s),i.blue=x_(n.blue,r.blue,s),i.alpha=vn(n.alpha,r.alpha,s),ru.transform(i))},Jue=(e,t)=>n=>t(e(n)),Kp=(...e)=>e.reduce(Jue),zO=new Set(["none","hidden"]);function ece(e,t){return zO.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function tce(e,t){return n=>vn(e,t,n)}function Y2(e){return typeof e=="number"?tce:typeof e=="string"?M2(e)?rg:Lr.test(e)?_L:ice:Array.isArray(e)?cI:typeof e=="object"?Lr.test(e)?_L:nce:rg}function cI(e,t){const n=[...e],r=n.length,i=e.map((s,l)=>Y2(s)(s,t[l]));return s=>{for(let l=0;l{for(const s in r)n[s]=r[s](i);return n}}function rce(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let s=0;s{const n=sl.createTransformer(t),r=Mp(e),i=Mp(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?zO.has(e)&&!i.values.length||zO.has(t)&&!r.values.length?ece(e,t):Kp(cI(rce(r,i),i.values),n):rg(e,t)};function fI(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?vn(e,t,n):Y2(e)(e,t)}const ace=5;function dI(e,t,n){const r=Math.max(t-ace,0);return k6(n-e(r),t-r)}const _n={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},S_=.001;function oce({duration:e=_n.duration,bounce:t=_n.bounce,velocity:n=_n.velocity,mass:r=_n.mass}){let i,s,l=1-t;l=Zo(_n.minDamping,_n.maxDamping,l),e=Zo(_n.minDuration,_n.maxDuration,Fo(e)),l<1?(i=d=>{const m=d*l,p=m*e,v=m-n,b=$O(d,l),w=Math.exp(-p);return S_-v/b*w},s=d=>{const p=d*l*e,v=p*n+n,b=Math.pow(l,2)*Math.pow(d,2)*e,w=Math.exp(-p),S=$O(Math.pow(d,2),l);return(-i(d)+S_>0?-1:1)*((v-b)*w)/S}):(i=d=>{const m=Math.exp(-d*e),p=(d-n)*e+1;return-S_+m*p},s=d=>{const m=Math.exp(-d*e),p=(n-d)*(e*e);return m*p});const c=5/e,f=lce(i,s,c);if(e=Ho(e),isNaN(f))return{stiffness:_n.stiffness,damping:_n.damping,duration:e};{const d=Math.pow(f,2)*r;return{stiffness:d,damping:l*2*Math.sqrt(r*d),duration:e}}}const sce=12;function lce(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function fce(e){let t={velocity:_n.velocity,stiffness:_n.stiffness,damping:_n.damping,mass:_n.mass,isResolvedFromDuration:!1,...e};if(!AL(e,cce)&&AL(e,uce))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Zo(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:_n.mass,stiffness:i,damping:s}}else{const n=oce(e);t={...t,...n,mass:_n.mass},t.isResolvedFromDuration=!0}return t}function hI(e=_n.visualDuration,t=_n.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],c={done:!1,value:s},{stiffness:f,damping:d,mass:m,duration:p,velocity:v,isResolvedFromDuration:b}=fce({...n,velocity:-Fo(n.velocity||0)}),w=v||0,S=d/(2*Math.sqrt(f*m)),x=l-s,A=Fo(Math.sqrt(f/m)),_=Math.abs(x)<5;r||(r=_?_n.restSpeed.granular:_n.restSpeed.default),i||(i=_?_n.restDelta.granular:_n.restDelta.default);let M;if(S<1){const O=$O(A,S);M=j=>{const R=Math.exp(-S*A*j);return l-R*((w+S*A*x)/O*Math.sin(O*j)+x*Math.cos(O*j))}}else if(S===1)M=O=>l-Math.exp(-A*O)*(x+(w+A*x)*O);else{const O=A*Math.sqrt(S*S-1);M=j=>{const R=Math.exp(-S*A*j),k=Math.min(O*j,300);return l-R*((w+S*A*x)*Math.sinh(k)+O*x*Math.cosh(k))/O}}const E={calculatedDuration:b&&p||null,next:O=>{const j=M(O);if(b)c.done=O>=p;else{let R=0;S<1&&(R=O===0?Ho(w):dI(M,O,j));const k=Math.abs(R)<=r,z=Math.abs(l-j)<=i;c.done=k&&z}return c.value=c.done?l:j,c},toString:()=>{const O=Math.min(uI(E),LO),j=z6(R=>E.next(O*R).value,O,30);return O+"ms "+j}};return E}function OL({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:l,min:c,max:f,restDelta:d=.5,restSpeed:m}){const p=e[0],v={done:!1,value:p},b=k=>c!==void 0&&kf,w=k=>c===void 0?f:f===void 0||Math.abs(c-k)-S*Math.exp(-k/r),M=k=>A+_(k),E=k=>{const z=_(k),G=M(k);v.done=Math.abs(z)<=d,v.value=v.done?A:G};let O,j;const R=k=>{b(v.value)&&(O=k,j=hI({keyframes:[v.value,w(v.value)],velocity:dI(M,k,v.value),damping:i,stiffness:s,restDelta:d,restSpeed:m}))};return R(0),{calculatedDuration:null,next:k=>{let z=!1;return!j&&O===void 0&&(z=!0,E(k),R(k)),O!==void 0&&k>=O?j.next(k-O):(!z&&E(k),v)}}}const dce=Gp(.42,0,1,1),hce=Gp(0,0,.58,1),pI=Gp(.42,0,.58,1),pce=e=>Array.isArray(e)&&typeof e[0]!="number",mce={linear:Di,easeIn:dce,easeInOut:pI,easeOut:hce,circIn:V2,circInOut:K6,circOut:G6,backIn:U2,backInOut:H6,backOut:V6,anticipate:F6},TL=e=>{if(I2(e)){p6(e.length===4);const[t,n,r,i]=e;return Gp(t,n,r,i)}else if(typeof e=="string")return mce[e];return e};function vce(e,t,n){const r=[],i=n||fI,s=e.length-1;for(let l=0;lt[0];if(s===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=vce(t,r,i),f=c.length,d=m=>{if(l&&m1)for(;pd(Zo(e[0],e[s-1],m)):d}function yce(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Lf(0,t,r);e.push(vn(n,1,i))}}function gce(e){const t=[0];return yce(t,e.length-1),t}function bce(e,t){return e.map(n=>n*t)}function xce(e,t){return e.map(()=>t||pI).splice(0,e.length-1)}function ig({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=pce(r)?r.map(TL):TL(r),s={done:!1,value:t[0]},l=bce(n&&n.length===t.length?n:gce(t),e),c=mI(l,t,{ease:Array.isArray(i)?i:xce(t,i)});return{calculatedDuration:e,next:f=>(s.value=c(f),s.done=f>=e,s)}}const Sce=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Wt.update(t,!0),stop:()=>Qo(t),now:()=>cr.isProcessing?cr.timestamp:Ja.now()}},wce={decay:OL,inertia:OL,tween:ig,keyframes:ig,spring:hI},_ce=e=>e/100;class a0 extends lI{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:f}=this.options;f&&f()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,l=(i==null?void 0:i.KeyframeResolver)||K2,c=(f,d)=>this.onKeyframesResolved(f,d);this.resolver=new l(s,c,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:l=0}=this.options,c=q2(n)?n:wce[n]||ig;let f,d;c!==ig&&typeof t[0]!="number"&&(f=Kp(_ce,fI(t[0],t[1])),t=[0,100]);const m=c({...this.options,keyframes:t});s==="mirror"&&(d=c({...this.options,keyframes:[...t].reverse(),velocity:-l})),m.calculatedDuration===null&&(m.calculatedDuration=uI(m));const{calculatedDuration:p}=m,v=p+i,b=v*(r+1)-i;return{generator:m,mirroredGenerator:d,mapPercentToKeyframes:f,calculatedDuration:p,resolvedDuration:v,totalDuration:b}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:k}=this.options;return{done:!0,value:k[k.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:l,mapPercentToKeyframes:c,keyframes:f,calculatedDuration:d,totalDuration:m,resolvedDuration:p}=r;if(this.startTime===null)return s.next(0);const{delay:v,repeat:b,repeatType:w,repeatDelay:S,onUpdate:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-m/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const A=this.currentTime-v*(this.speed>=0?1:-1),_=this.speed>=0?A<0:A>m;this.currentTime=Math.max(A,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=m);let M=this.currentTime,E=s;if(b){const k=Math.min(this.currentTime,m)/p;let z=Math.floor(k),G=k%1;!G&&k>=1&&(G=1),G===1&&z--,z=Math.min(z,b+1),!!(z%2)&&(w==="reverse"?(G=1-G,S&&(G-=S/p)):w==="mirror"&&(E=l)),M=Zo(0,1,G)*p}const O=_?{done:!1,value:f[0]}:E.next(M);c&&(O.value=c(O.value));let{done:j}=O;!_&&d!==null&&(j=this.speed>=0?this.currentTime>=m:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&j);return R&&i!==void 0&&(O.value=i0(f,this.options,i)),x&&x(O.value),R&&this.finish(),O}get duration(){const{resolved:t}=this;return t?Fo(t.calculatedDuration):0}get time(){return Fo(this.currentTime)}set time(t){t=Ho(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Fo(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Sce,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}function Ace(e){return new a0(e)}const Oce=new Set(["opacity","clipPath","filter","transform"]);function Tce(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:l="loop",ease:c="easeInOut",times:f}={}){const d={[t]:n};f&&(d.offset=f);const m=B6(c,i);return Array.isArray(m)&&(d.easing=m),e.animate(d,{delay:r,duration:i,easing:Array.isArray(m)?"linear":m,fill:"both",iterations:s+1,direction:l==="reverse"?"alternate":"normal"})}const Ece=B2(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ag=10,Mce=2e4;function jce(e){return q2(e.type)||e.type==="spring"||!$6(e.ease)}function Cce(e,t){const n=new a0({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&sthis.onKeyframesResolved(l,c),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:s,type:l,motionValue:c,name:f,startTime:d}=this.options;if(!c.owner||!c.owner.current)return!1;if(typeof s=="string"&&ng()&&Pce(s)&&(s=vI[s]),jce(this.options)){const{onComplete:p,onUpdate:v,motionValue:b,element:w,...S}=this.options,x=Cce(t,S);t=x.keyframes,t.length===1&&(t[1]=t[0]),r=x.duration,i=x.times,s=x.ease,l="keyframes"}const m=Tce(c.owner.current,f,t,{...this.options,duration:r,times:i,ease:s});return m.startTime=d??this.calcStartTime(),this.pendingTimeline?(mL(m,this.pendingTimeline),this.pendingTimeline=void 0):m.onfinish=()=>{const{onComplete:p}=this.options;c.set(i0(t,this.options,n)),p&&p(),this.cancel(),this.resolveFinishedPromise()},{animation:m,duration:r,times:i,type:l,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Fo(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Fo(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Ho(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Di;const{animation:r}=n;mL(r,t)}return Di}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:s,ease:l,times:c}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:d,onUpdate:m,onComplete:p,element:v,...b}=this.options,w=new a0({...b,keyframes:r,duration:i,type:s,ease:l,times:c,isGenerator:!0}),S=Ho(this.time);d.setWithVelocity(w.sample(S-ag).value,w.sample(S).value,ag)}const{onStop:f}=this.options;f&&f(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:l,type:c}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:d}=n.owner.getProps();return Ece()&&r&&Oce.has(r)&&!f&&!d&&!i&&s!=="mirror"&&l!==0&&c!=="inertia"}}const Dce={type:"spring",stiffness:500,damping:25,restSpeed:10},Rce=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Nce={type:"keyframes",duration:.8},kce={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Lce=(e,{keyframes:t})=>t.length>2?Nce:Nu.has(e)?e.startsWith("scale")?Rce(t[1]):Dce:kce;function zce({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:l,repeatDelay:c,from:f,elapsed:d,...m}){return!!Object.keys(m).length}const X2=(e,t,n,r={},i,s)=>l=>{const c=k2(r,e)||{},f=c.delay||r.delay||0;let{elapsed:d=0}=r;d=d-Ho(f);let m={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-d,onUpdate:v=>{t.set(v),c.onUpdate&&c.onUpdate(v)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:s?void 0:i};zce(c)||(m={...m,...Lce(e,m)}),m.duration&&(m.duration=Ho(m.duration)),m.repeatDelay&&(m.repeatDelay=Ho(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let p=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(m.duration=0,m.delay===0&&(p=!0)),p&&!s&&t.get()!==void 0){const v=i0(m.keyframes,c);if(v!==void 0)return Wt.update(()=>{m.onUpdate(v),m.onComplete()}),new mue([])}return!s&&EL.supports(m)?new EL(m):new a0(m)};function $ce({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function yI(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var s;let{transition:l=e.getDefaultTransition(),transitionEnd:c,...f}=t;r&&(l=r);const d=[],m=i&&e.animationState&&e.animationState.getState()[i];for(const p in f){const v=e.getValue(p,(s=e.latestValues[p])!==null&&s!==void 0?s:null),b=f[p];if(b===void 0||m&&$ce(m,p))continue;const w={delay:n,...k2(l||{},p)};let S=!1;if(window.MotionHandoffAnimation){const A=L6(e);if(A){const _=window.MotionHandoffAnimation(A,p,Wt);_!==null&&(w.startTime=_,S=!0)}}CO(e,p),v.start(X2(p,v,b,e.shouldReduceMotion&&N6.has(p)?{type:!1}:w,e,S));const x=v.animation;x&&d.push(x)}return c&&Promise.all(d).then(()=>{Wt.update(()=>{c&&fue(e,c)})}),d}function BO(e,t,n={}){var r;const i=r0(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const l=i?()=>Promise.all(yI(e,i,n)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:m=0,staggerChildren:p,staggerDirection:v}=s;return Bce(e,t,m+d,p,v,n)}:()=>Promise.resolve(),{when:f}=s;if(f){const[d,m]=f==="beforeChildren"?[l,c]:[c,l];return d().then(()=>m())}else return Promise.all([l(),c(n.delay)])}function Bce(e,t,n=0,r=0,i=1,s){const l=[],c=(e.variantChildren.size-1)*r,f=i===1?(d=0)=>d*r:(d=0)=>c-d*r;return Array.from(e.variantChildren).sort(qce).forEach((d,m)=>{d.notify("AnimationStart",t),l.push(BO(d,t,{...s,delay:n+f(m)}).then(()=>d.notify("AnimationComplete",t)))}),Promise.all(l)}function qce(e,t){return e.sortNodePosition(t)}function Ice(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>BO(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=BO(e,t,n);else{const i=typeof t=="function"?r0(e,t,n.custom):t;r=Promise.all(yI(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const Uce=_2.length;function gI(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?gI(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:r})=>Ice(e,n,r)))}function Gce(e){let t=Fce(e),n=ML(),r=!0;const i=f=>(d,m)=>{var p;const v=r0(e,m,f==="exit"?(p=e.presenceContext)===null||p===void 0?void 0:p.custom:void 0);if(v){const{transition:b,transitionEnd:w,...S}=v;d={...d,...S,...w}}return d};function s(f){t=f(e)}function l(f){const{props:d}=e,m=gI(e.parent)||{},p=[],v=new Set;let b={},w=1/0;for(let x=0;xw&&E,z=!1;const G=Array.isArray(M)?M:[M];let $=G.reduce(i(A),{});O===!1&&($={});const{prevResolvedValues:B={}}=_,Z={...B,...$},ee=F=>{k=!0,v.has(F)&&(z=!0,v.delete(F)),_.needsAnimating[F]=!0;const ie=e.getValue(F);ie&&(ie.liveStyle=!1)};for(const F in Z){const ie=$[F],ce=B[F];if(b.hasOwnProperty(F))continue;let U=!1;jO(ie)&&jO(ce)?U=!R6(ie,ce):U=ie!==ce,U?ie!=null?ee(F):v.add(F):ie!==void 0&&v.has(F)?ee(F):_.protectedKeys[F]=!0}_.prevProp=M,_.prevResolvedValues=$,_.isActive&&(b={...b,...$}),r&&e.blockInitialAnimation&&(k=!1),k&&(!(j&&R)||z)&&p.push(...G.map(F=>({animation:F,options:{type:A}})))}if(v.size){const x={};v.forEach(A=>{const _=e.getBaseTarget(A),M=e.getValue(A);M&&(M.liveStyle=!0),x[A]=_??null}),p.push({animation:x})}let S=!!p.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(S=!1),r=!1,S?t(p):Promise.resolve()}function c(f,d){var m;if(n[f].isActive===d)return Promise.resolve();(m=e.variantChildren)===null||m===void 0||m.forEach(v=>{var b;return(b=v.animationState)===null||b===void 0?void 0:b.setActive(f,d)}),n[f].isActive=d;const p=l(f);for(const v in n)n[v].protectedKeys={};return p}return{animateChanges:l,setActive:c,setAnimateFunction:s,getState:()=>n,reset:()=>{n=ML(),r=!0}}}function Kce(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!R6(t,e):!1}function Vl(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ML(){return{animate:Vl(!0),whileInView:Vl(),whileHover:Vl(),whileTap:Vl(),whileDrag:Vl(),whileFocus:Vl(),exit:Vl()}}class ml{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Yce extends ml{constructor(t){super(t),t.animationState||(t.animationState=Gce(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();t0(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let Xce=0;class Wce extends ml{constructor(){super(...arguments),this.id=Xce++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const Qce={animation:{Feature:Yce},exit:{Feature:Wce}},ga={x:!1,y:!1};function bI(){return ga.x||ga.y}function Zce(e){return e==="x"||e==="y"?ga[e]?null:(ga[e]=!0,()=>{ga[e]=!1}):ga.x||ga.y?null:(ga.x=ga.y=!0,()=>{ga.x=ga.y=!1})}const W2=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function jp(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Yp(e){return{point:{x:e.pageX,y:e.pageY}}}const Jce=e=>t=>W2(t)&&e(t,Yp(t));function $h(e,t,n,r){return jp(e,t,Jce(n),r)}const jL=(e,t)=>Math.abs(e-t);function efe(e,t){const n=jL(e.x,t.x),r=jL(e.y,t.y);return Math.sqrt(n**2+r**2)}class xI{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=__(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,b=efe(p.offset,{x:0,y:0})>=3;if(!v&&!b)return;const{point:w}=p,{timestamp:S}=cr;this.history.push({...w,timestamp:S});const{onStart:x,onMove:A}=this.handlers;v||(x&&x(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),A&&A(this.lastMoveEvent,p)},this.handlePointerMove=(p,v)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=w_(v,this.transformPagePoint),Wt.update(this.updatePoint,!0)},this.handlePointerUp=(p,v)=>{this.end();const{onEnd:b,onSessionEnd:w,resumeAnimation:S}=this.handlers;if(this.dragSnapToOrigin&&S&&S(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=__(p.type==="pointercancel"?this.lastMoveEventInfo:w_(v,this.transformPagePoint),this.history);this.startEvent&&b&&b(p,x),w&&w(p,x)},!W2(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const l=Yp(t),c=w_(l,this.transformPagePoint),{point:f}=c,{timestamp:d}=cr;this.history=[{...f,timestamp:d}];const{onSessionStart:m}=n;m&&m(t,__(c,this.history)),this.removeListeners=Kp($h(this.contextWindow,"pointermove",this.handlePointerMove),$h(this.contextWindow,"pointerup",this.handlePointerUp),$h(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Qo(this.updatePoint)}}function w_(e,t){return t?{point:t(e.point)}:e}function CL(e,t){return{x:e.x-t.x,y:e.y-t.y}}function __({point:e},t){return{point:e,delta:CL(e,SI(t)),offset:CL(e,tfe(t)),velocity:nfe(t,.1)}}function tfe(e){return e[0]}function SI(e){return e[e.length-1]}function nfe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=SI(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Ho(t)));)n--;if(!r)return{x:0,y:0};const s=Fo(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const l={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}const wI=1e-4,rfe=1-wI,ife=1+wI,_I=.01,afe=0-_I,ofe=0+_I;function Ri(e){return e.max-e.min}function sfe(e,t,n){return Math.abs(e-t)<=n}function PL(e,t,n,r=.5){e.origin=r,e.originPoint=vn(t.min,t.max,e.origin),e.scale=Ri(n)/Ri(t),e.translate=vn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=rfe&&e.scale<=ife||isNaN(e.scale))&&(e.scale=1),(e.translate>=afe&&e.translate<=ofe||isNaN(e.translate))&&(e.translate=0)}function Bh(e,t,n,r){PL(e.x,t.x,n.x,r?r.originX:void 0),PL(e.y,t.y,n.y,r?r.originY:void 0)}function DL(e,t,n){e.min=n.min+t.min,e.max=e.min+Ri(t)}function lfe(e,t,n){DL(e.x,t.x,n.x),DL(e.y,t.y,n.y)}function RL(e,t,n){e.min=t.min-n.min,e.max=e.min+Ri(t)}function qh(e,t,n){RL(e.x,t.x,n.x),RL(e.y,t.y,n.y)}function ufe(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?vn(n,e,r.max):Math.min(e,n)),e}function NL(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function cfe(e,{top:t,left:n,bottom:r,right:i}){return{x:NL(e.x,n,i),y:NL(e.y,t,r)}}function kL(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Lf(t.min,t.max-r,e.min):r>i&&(n=Lf(e.min,e.max-i,t.min)),Zo(0,1,n)}function hfe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const qO=.35;function pfe(e=qO){return e===!1?e=0:e===!0&&(e=qO),{x:LL(e,"left","right"),y:LL(e,"top","bottom")}}function LL(e,t,n){return{min:zL(e,t),max:zL(e,n)}}function zL(e,t){return typeof e=="number"?e:e[t]||0}const $L=()=>({translate:0,scale:1,origin:0,originPoint:0}),Nc=()=>({x:$L(),y:$L()}),BL=()=>({min:0,max:0}),Dn=()=>({x:BL(),y:BL()});function Ji(e){return[e("x"),e("y")]}function AI({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function mfe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function vfe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function A_(e){return e===void 0||e===1}function IO({scale:e,scaleX:t,scaleY:n}){return!A_(e)||!A_(t)||!A_(n)}function Yl(e){return IO(e)||OI(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function OI(e){return qL(e.x)||qL(e.y)}function qL(e){return e&&e!=="0%"}function og(e,t,n){const r=e-n,i=t*r;return n+i}function IL(e,t,n,r,i){return i!==void 0&&(e=og(e,i,r)),og(e,n,r)+t}function UO(e,t=0,n=1,r,i){e.min=IL(e.min,t,n,r,i),e.max=IL(e.max,t,n,r,i)}function TI(e,{x:t,y:n}){UO(e.x,t.translate,t.scale,t.originPoint),UO(e.y,n.translate,n.scale,n.originPoint)}const UL=.999999999999,VL=1.0000000000001;function yfe(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,l;for(let c=0;cUL&&(t.x=1),t.yUL&&(t.y=1)}function kc(e,t){e.min=e.min+t,e.max=e.max+t}function HL(e,t,n,r,i=.5){const s=vn(e.min,e.max,i);UO(e,t,n,s,r)}function Lc(e,t){HL(e.x,t.x,t.scaleX,t.scale,t.originX),HL(e.y,t.y,t.scaleY,t.scale,t.originY)}function EI(e,t){return AI(vfe(e.getBoundingClientRect(),t))}function gfe(e,t,n){const r=EI(e,n),{scroll:i}=t;return i&&(kc(r.x,i.offset.x),kc(r.y,i.offset.y)),r}const MI=({current:e})=>e?e.ownerDocument.defaultView:null,bfe=new WeakMap;class xfe{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Dn(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=m=>{const{dragSnapToOrigin:p}=this.getProps();p?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Yp(m).point)},s=(m,p)=>{const{drag:v,dragPropagation:b,onDragStart:w}=this.getProps();if(v&&!b&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Zce(v),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ji(x=>{let A=this.getAxisMotionValue(x).get()||0;if(Za.test(A)){const{projection:_}=this.visualElement;if(_&&_.layout){const M=_.layout.layoutBox[x];M&&(A=Ri(M)*(parseFloat(A)/100))}}this.originPoint[x]=A}),w&&Wt.postRender(()=>w(m,p)),CO(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},l=(m,p)=>{const{dragPropagation:v,dragDirectionLock:b,onDirectionLock:w,onDrag:S}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:x}=p;if(b&&this.currentDirection===null){this.currentDirection=Sfe(x),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",p.point,x),this.updateAxis("y",p.point,x),this.visualElement.render(),S&&S(m,p)},c=(m,p)=>this.stop(m,p),f=()=>Ji(m=>{var p;return this.getAnimationState(m)==="paused"&&((p=this.getAxisMotionValue(m).animation)===null||p===void 0?void 0:p.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new xI(t,{onSessionStart:i,onStart:s,onMove:l,onSessionEnd:c,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,contextWindow:MI(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&Wt.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Bv(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let l=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(l=ufe(l,this.constraints[t],this.elastic[t])),s.set(l)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&Dc(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=cfe(i.layoutBox,n):this.constraints=!1,this.elastic=pfe(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Ji(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=hfe(i.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Dc(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=gfe(r,i.root,this.visualElement.getTransformPagePoint());let l=ffe(i.layout.layoutBox,s);if(n){const c=n(mfe(l));this.hasMutatedConstraints=!!c,c&&(l=AI(c))}return l}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:l,onDragTransitionEnd:c}=this.getProps(),f=this.constraints||{},d=Ji(m=>{if(!Bv(m,n,this.currentDirection))return;let p=f&&f[m]||{};l&&(p={min:0,max:0});const v=i?200:1e6,b=i?40:1e7,w={type:"inertia",velocity:r?t[m]:0,bounceStiffness:v,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...s,...p};return this.startAxisValueAnimation(m,w)});return Promise.all(d).then(c)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return CO(this.visualElement,t),r.start(X2(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ji(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ji(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ji(n=>{const{drag:r}=this.getProps();if(!Bv(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:l,max:c}=i.layout.layoutBox[n];s.set(t[n]-vn(l,c,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Dc(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ji(l=>{const c=this.getAxisMotionValue(l);if(c&&this.constraints!==!1){const f=c.get();i[l]=dfe({min:f,max:f},this.constraints[l])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ji(l=>{if(!Bv(l,t,null))return;const c=this.getAxisMotionValue(l),{min:f,max:d}=this.constraints[l];c.set(vn(f,d,i[l]))})}addListeners(){if(!this.visualElement.current)return;bfe.set(this.visualElement,this);const t=this.visualElement.current,n=$h(t,"pointerdown",f=>{const{drag:d,dragListener:m=!0}=this.getProps();d&&m&&this.start(f)}),r=()=>{const{dragConstraints:f}=this.getProps();Dc(f)&&f.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Wt.read(r);const l=jp(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:d})=>{this.isDragging&&d&&(Ji(m=>{const p=this.getAxisMotionValue(m);p&&(this.originPoint[m]+=f[m].translate,p.set(p.get()+f[m].translate))}),this.visualElement.render())}));return()=>{l(),n(),s(),c&&c()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:l=qO,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:l,dragMomentum:c}}}function Bv(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Sfe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class wfe extends ml{constructor(t){super(t),this.removeGroupControls=Di,this.removeListeners=Di,this.controls=new xfe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Di}unmount(){this.removeGroupControls(),this.removeListeners()}}const FL=e=>(t,n)=>{e&&Wt.postRender(()=>e(t,n))};class _fe extends ml{constructor(){super(...arguments),this.removePointerDownListener=Di}onPointerDown(t){this.session=new xI(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:MI(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:FL(t),onStart:FL(n),onMove:r,onEnd:(s,l)=>{delete this.session,i&&Wt.postRender(()=>i(s,l))}}}mount(){this.removePointerDownListener=$h(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Yv={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function GL(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const vh={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ge.test(e))e=parseFloat(e);else return e;const n=GL(e,t.target.x),r=GL(e,t.target.y);return`${n}% ${r}%`}},Afe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=sl.parse(e);if(i.length>5)return r;const s=sl.createTransformer(e),l=typeof i[0]!="number"?1:0,c=n.x.scale*t.x,f=n.y.scale*t.y;i[0+l]/=c,i[1+l]/=f;const d=vn(c,f,.5);return typeof i[2+l]=="number"&&(i[2+l]/=d),typeof i[3+l]=="number"&&(i[3+l]/=d),s(i)}};class Ofe extends K.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;Qle(Tfe),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Yv.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,l=r.projection;return l&&(l.isPresent=s,i||t.layoutDependency!==n||n===void 0?l.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?l.promote():l.relegate()||Wt.postRender(()=>{const c=l.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),O2.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function jI(e){const[t,n]=d6(),r=K.useContext(x2);return T.jsx(Ofe,{...e,layoutGroup:r,switchLayoutGroup:K.useContext(x6),isPresent:t,safeToRemove:n})}const Tfe={borderRadius:{...vh,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:vh,borderTopRightRadius:vh,borderBottomLeftRadius:vh,borderBottomRightRadius:vh,boxShadow:Afe};function Efe(e,t,n){const r=dr(e)?e:kf(e);return r.start(X2("",r,t,n)),r.animation}function Mfe(e){return e instanceof SVGElement&&e.tagName!=="svg"}const jfe=(e,t)=>e.depth-t.depth;class Cfe{constructor(){this.children=[],this.isDirty=!1}add(t){L2(this.children,t),this.isDirty=!0}remove(t){z2(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(jfe),this.isDirty=!1,this.children.forEach(t)}}function Pfe(e,t){const n=Ja.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(Qo(r),e(s-t))};return Wt.read(r,!0),()=>Qo(r)}const CI=["TopLeft","TopRight","BottomLeft","BottomRight"],Dfe=CI.length,KL=e=>typeof e=="string"?parseFloat(e):e,YL=e=>typeof e=="number"||Ge.test(e);function Rfe(e,t,n,r,i,s){i?(e.opacity=vn(0,n.opacity!==void 0?n.opacity:1,Nfe(r)),e.opacityExit=vn(t.opacity!==void 0?t.opacity:1,0,kfe(r))):s&&(e.opacity=vn(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let l=0;lrt?1:n(Lf(e,t,r))}function WL(e,t){e.min=t.min,e.max=t.max}function Wi(e,t){WL(e.x,t.x),WL(e.y,t.y)}function QL(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function ZL(e,t,n,r,i){return e-=t,e=og(e,1/n,r),i!==void 0&&(e=og(e,1/i,r)),e}function Lfe(e,t=0,n=1,r=.5,i,s=e,l=e){if(Za.test(t)&&(t=parseFloat(t),t=vn(l.min,l.max,t/100)-l.min),typeof t!="number")return;let c=vn(s.min,s.max,r);e===s&&(c-=t),e.min=ZL(e.min,t,n,c,i),e.max=ZL(e.max,t,n,c,i)}function JL(e,t,[n,r,i],s,l){Lfe(e,t[n],t[r],t[i],t.scale,s,l)}const zfe=["x","scaleX","originX"],$fe=["y","scaleY","originY"];function ez(e,t,n,r){JL(e.x,t,zfe,n?n.x:void 0,r?r.x:void 0),JL(e.y,t,$fe,n?n.y:void 0,r?r.y:void 0)}function tz(e){return e.translate===0&&e.scale===1}function DI(e){return tz(e.x)&&tz(e.y)}function nz(e,t){return e.min===t.min&&e.max===t.max}function Bfe(e,t){return nz(e.x,t.x)&&nz(e.y,t.y)}function rz(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function RI(e,t){return rz(e.x,t.x)&&rz(e.y,t.y)}function iz(e){return Ri(e.x)/Ri(e.y)}function az(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class qfe{constructor(){this.members=[]}add(t){L2(this.members,t),t.scheduleRender()}remove(t){if(z2(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Ife(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,l=(n==null?void 0:n.z)||0;if((i||s||l)&&(r=`translate3d(${i}px, ${s}px, ${l}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:d,rotate:m,rotateX:p,rotateY:v,skewX:b,skewY:w}=n;d&&(r=`perspective(${d}px) ${r}`),m&&(r+=`rotate(${m}deg) `),p&&(r+=`rotateX(${p}deg) `),v&&(r+=`rotateY(${v}deg) `),b&&(r+=`skewX(${b}deg) `),w&&(r+=`skewY(${w}deg) `)}const c=e.x.scale*t.x,f=e.y.scale*t.y;return(c!==1||f!==1)&&(r+=`scale(${c}, ${f})`),r||"none"}const Xl={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Oh=typeof window<"u"&&window.MotionDebug!==void 0,O_=["","X","Y","Z"],Ufe={visibility:"hidden"},oz=1e3;let Vfe=0;function T_(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function NI(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=L6(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Wt,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&NI(r)}function kI({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(l={},c=t==null?void 0:t()){this.id=Vfe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Oh&&(Xl.totalNodes=Xl.resolvedTargetDeltas=Xl.recalculatedProjection=0),this.nodes.forEach(Gfe),this.nodes.forEach(Qfe),this.nodes.forEach(Zfe),this.nodes.forEach(Kfe),Oh&&window.MotionDebug.record(Xl)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let f=0;fthis.root.updateBlockedByResize=!1;e(l,()=>{this.root.updateBlockedByResize=!0,p&&p(),p=Pfe(v,250),Yv.hasAnimatedSinceResize&&(Yv.hasAnimatedSinceResize=!1,this.nodes.forEach(lz))})}f&&this.root.registerSharedNode(f,this),this.options.animate!==!1&&m&&(f||d)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:v,hasRelativeTargetChanged:b,layout:w})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||m.getDefaultTransition()||rde,{onLayoutAnimationStart:x,onLayoutAnimationComplete:A}=m.getProps(),_=!this.targetLayout||!RI(this.targetLayout,w)||b,M=!v&&b;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||M||v&&(_||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(p,M);const E={...k2(S,"layout"),onPlay:x,onComplete:A};(m.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E)}else v||lz(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=w})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Qo(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Jfe),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&NI(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let f=0;f{const O=E/1e3;uz(p.x,l.x,O),uz(p.y,l.y,O),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(qh(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),tde(this.relativeTarget,this.relativeTargetOrigin,v,O),M&&Bfe(this.relativeTarget,M)&&(this.isProjectionDirty=!1),M||(M=Dn()),Wi(M,this.relativeTarget)),S&&(this.animationValues=m,Rfe(m,d,this.latestValues,O,_,A)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=O},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Qo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Wt.update(()=>{Yv.hasAnimatedSinceResize=!0,this.currentAnimation=Efe(0,oz,{...l,onUpdate:c=>{this.mixTargetDelta(c),l.onUpdate&&l.onUpdate(c)},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(oz),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:c,target:f,layout:d,latestValues:m}=l;if(!(!c||!f||!d)){if(this!==l&&this.layout&&d&&LI(this.options.animationType,this.layout.layoutBox,d.layoutBox)){f=this.target||Dn();const p=Ri(this.layout.layoutBox.x);f.x.min=l.target.x.min,f.x.max=f.x.min+p;const v=Ri(this.layout.layoutBox.y);f.y.min=l.target.y.min,f.y.max=f.y.min+v}Wi(c,f),Lc(c,m),Bh(this.projectionDeltaWithTransform,this.layoutCorrected,c,m)}}registerSharedNode(l,c){this.sharedNodes.has(l)||this.sharedNodes.set(l,new qfe),this.sharedNodes.get(l).add(c);const d=c.options.initialPromotionConfig;c.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(c):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){var l;const{layoutId:c}=this.options;return c?((l=this.getStack())===null||l===void 0?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:c}=this.options;return c?(l=this.getStack())===null||l===void 0?void 0:l.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:c,preserveFollowOpacity:f}={}){const d=this.getStack();d&&d.promote(this,f),l&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let c=!1;const{latestValues:f}=l;if((f.z||f.rotate||f.rotateX||f.rotateY||f.rotateZ||f.skewX||f.skewY)&&(c=!0),!c)return;const d={};f.z&&T_("z",l,d,this.animationValues);for(let m=0;m{var c;return(c=l.currentAnimation)===null||c===void 0?void 0:c.stop()}),this.root.nodes.forEach(sz),this.root.sharedNodes.clear()}}}function Hfe(e){e.updateLayout()}function Ffe(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,l=n.source!==e.layout.source;s==="size"?Ji(p=>{const v=l?n.measuredBox[p]:n.layoutBox[p],b=Ri(v);v.min=r[p].min,v.max=v.min+b}):LI(s,n.layoutBox,r)&&Ji(p=>{const v=l?n.measuredBox[p]:n.layoutBox[p],b=Ri(r[p]);v.max=v.min+b,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+b)});const c=Nc();Bh(c,r,n.layoutBox);const f=Nc();l?Bh(f,e.applyTransform(i,!0),n.measuredBox):Bh(f,r,n.layoutBox);const d=!DI(c);let m=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:v,layout:b}=p;if(v&&b){const w=Dn();qh(w,n.layoutBox,v.layoutBox);const S=Dn();qh(S,r,b.layoutBox),RI(w,S)||(m=!0),p.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=w,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:f,layoutDelta:c,hasLayoutChanged:d,hasRelativeTargetChanged:m})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Gfe(e){Oh&&Xl.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Kfe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Yfe(e){e.clearSnapshot()}function sz(e){e.clearMeasurements()}function Xfe(e){e.isLayoutDirty=!1}function Wfe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function lz(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Qfe(e){e.resolveTargetDelta()}function Zfe(e){e.calcProjection()}function Jfe(e){e.resetSkewAndRotation()}function ede(e){e.removeLeadSnapshot()}function uz(e,t,n){e.translate=vn(t.translate,0,n),e.scale=vn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function cz(e,t,n,r){e.min=vn(t.min,n.min,r),e.max=vn(t.max,n.max,r)}function tde(e,t,n,r){cz(e.x,t.x,n.x,r),cz(e.y,t.y,n.y,r)}function nde(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const rde={duration:.45,ease:[.4,0,.1,1]},fz=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),dz=fz("applewebkit/")&&!fz("chrome/")?Math.round:Di;function hz(e){e.min=dz(e.min),e.max=dz(e.max)}function ide(e){hz(e.x),hz(e.y)}function LI(e,t,n){return e==="position"||e==="preserve-aspect"&&!sfe(iz(t),iz(n),.2)}function ade(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const ode=kI({attachResizeListener:(e,t)=>jp(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),E_={current:void 0},zI=kI({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!E_.current){const e=new ode({});e.mount(window),e.setOptions({layoutScroll:!0}),E_.current=e}return E_.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),sde={pan:{Feature:_fe},drag:{Feature:wfe,ProjectionNode:zI,MeasureLayout:jI}};function lde(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const s=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function $I(e,t){const n=lde(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function pz(e){return t=>{t.pointerType==="touch"||bI()||e(t)}}function ude(e,t,n={}){const[r,i,s]=$I(e,n),l=pz(c=>{const{target:f}=c,d=t(c);if(typeof d!="function"||!f)return;const m=pz(p=>{d(p),f.removeEventListener("pointerleave",m)});f.addEventListener("pointerleave",m,i)});return r.forEach(c=>{c.addEventListener("pointerenter",l,i)}),s}function mz(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&Wt.postRender(()=>s(t,Yp(t)))}class cde extends ml{mount(){const{current:t}=this.node;t&&(this.unmount=ude(t,n=>(mz(this.node,n,"Start"),r=>mz(this.node,r,"End"))))}unmount(){}}class fde extends ml{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Kp(jp(this.node.current,"focus",()=>this.onFocus()),jp(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const BI=(e,t)=>t?e===t?!0:BI(e,t.parentElement):!1,dde=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function hde(e){return dde.has(e.tagName)||e.tabIndex!==-1}const Th=new WeakSet;function vz(e){return t=>{t.key==="Enter"&&e(t)}}function M_(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const pde=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=vz(()=>{if(Th.has(n))return;M_(n,"down");const i=vz(()=>{M_(n,"up")}),s=()=>M_(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function yz(e){return W2(e)&&!bI()}function mde(e,t,n={}){const[r,i,s]=$I(e,n),l=c=>{const f=c.currentTarget;if(!yz(c)||Th.has(f))return;Th.add(f);const d=t(c),m=(b,w)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",v),!(!yz(b)||!Th.has(f))&&(Th.delete(f),typeof d=="function"&&d(b,{success:w}))},p=b=>{m(b,n.useGlobalTarget||BI(f,b.target))},v=b=>{m(b,!1)};window.addEventListener("pointerup",p,i),window.addEventListener("pointercancel",v,i)};return r.forEach(c=>{!hde(c)&&c.getAttribute("tabindex")===null&&(c.tabIndex=0),(n.useGlobalTarget?window:c).addEventListener("pointerdown",l,i),c.addEventListener("focus",d=>pde(d,i),i)}),s}function gz(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&Wt.postRender(()=>s(t,Yp(t)))}class vde extends ml{mount(){const{current:t}=this.node;t&&(this.unmount=mde(t,n=>(gz(this.node,n,"Start"),(r,{success:i})=>gz(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const VO=new WeakMap,j_=new WeakMap,yde=e=>{const t=VO.get(e.target);t&&t(e)},gde=e=>{e.forEach(yde)};function bde({root:e,...t}){const n=e||document;j_.has(n)||j_.set(n,{});const r=j_.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(gde,{root:e,...t})),r[i]}function xde(e,t,n){const r=bde(t);return VO.set(e,n),r.observe(e),()=>{VO.delete(e),r.unobserve(e)}}const Sde={some:0,all:1};class wde extends ml{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,l={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Sde[i]},c=f=>{const{isIntersecting:d}=f;if(this.isInView===d||(this.isInView=d,s&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:m,onViewportLeave:p}=this.node.getProps(),v=d?m:p;v&&v(f)};return xde(this.node.current,l,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(_de(t,n))&&this.startObserver()}unmount(){}}function _de({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Ade={inView:{Feature:wde},tap:{Feature:vde},focus:{Feature:fde},hover:{Feature:cde}},Ode={layout:{ProjectionNode:zI,MeasureLayout:jI}},HO={current:null},qI={current:!1};function Tde(){if(qI.current=!0,!!S2)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>HO.current=e.matches;e.addListener(t),t()}else HO.current=!1}const Ede=[...oI,Lr,sl],Mde=e=>Ede.find(aI(e)),bz=new WeakMap;function jde(e,t,n){for(const r in t){const i=t[r],s=n[r];if(dr(i))e.addValue(r,i);else if(dr(s))e.addValue(r,kf(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const l=e.getValue(r);l.liveStyle===!0?l.jump(i):l.hasAnimated||l.set(i)}else{const l=e.getStaticValue(r);e.addValue(r,kf(l!==void 0?l:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const xz=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Cde{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:l},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=K2,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const b=Ja.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),qI.current||Tde(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:HO.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){bz.delete(this.current),this.projection&&this.projection.unmount(),Qo(this.notifyUpdate),Qo(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Nu.has(t),i=n.on("change",c=>{this.latestValues[t]=c,this.props.onUpdate&&Wt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let l;window.MotionCheckAppearSync&&(l=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),l&&l(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Nf){const n=Nf[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Dn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=kf(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(rI(i)||Y6(i))?i=parseFloat(i):!Mde(i)&&sl.test(n)&&(i=eI(t,n)),this.setBaseTarget(t,dr(i)?i.get():i)),dr(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const l=E2(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);l&&(i=l[t])}if(r&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!dr(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new $2),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class II extends Cde{constructor(){super(...arguments),this.KeyframeResolver=sI}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;dr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Pde(e){return window.getComputedStyle(e)}class Dde extends II{constructor(){super(...arguments),this.type="html",this.renderInstance=E6}readValueFromInstance(t,n){if(Nu.has(n)){const r=G2(n);return r&&r.default||0}else{const r=Pde(t),i=(A6(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return EI(t,n)}build(t,n,r){C2(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return N2(t,n,r)}}class Rde extends II{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Dn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Nu.has(n)){const r=G2(n);return r&&r.default||0}return n=M6.has(n)?n:A2(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return P6(t,n,r)}build(t,n,r){P2(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){j6(t,n,r,i)}mount(t){this.isSVGTag=R2(t.tagName),super.mount(t)}}const Nde=(e,t)=>T2(e)?new Rde(t):new Dde(t,{allowProjection:e!==K.Fragment}),kde=oue({...Qce,...Ade,...sde,...Ode},Nde),$f=Sle(kde);function Q2(e){const t=Vp(()=>kf(e)),{isStatic:n}=K.useContext(Hp);if(n){const[,r]=K.useState(e);K.useEffect(()=>t.on("change",r),[])}return t}function UI(e,t){const n=Q2(t()),r=()=>n.set(t());return r(),Jg(()=>{const i=()=>Wt.preRender(r,!1,!0),s=e.map(l=>l.on("change",i));return()=>{s.forEach(l=>l()),Qo(r)}}),n}function Sz(e){return typeof e=="number"?e:parseFloat(e)}function Lde(e,t={}){const{isStatic:n}=K.useContext(Hp),r=K.useRef(null),i=Q2(dr(e)?Sz(e.get()):e),s=K.useRef(i.get()),l=K.useRef(()=>{}),c=()=>{const d=r.current;d&&d.time===0&&d.sample(cr.delta),f(),r.current=Ace({keyframes:[i.get(),s.current],velocity:i.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...t,onUpdate:l.current})},f=()=>{r.current&&r.current.stop()};return K.useInsertionEffect(()=>i.attach((d,m)=>n?m(d):(s.current=d,l.current=m,Wt.update(c),i.get()),f),[JSON.stringify(t)]),Jg(()=>{if(dr(e))return e.on("change",d=>i.set(Sz(d)))},[i]),i}const zde=e=>e&&typeof e=="object"&&e.mix,$de=e=>zde(e)?e.mix:void 0;function Bde(...e){const t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],s=e[2+n],l=e[3+n],c=mI(i,s,{mixer:$de(s[0]),...l});return t?c(r):c}function qde(e){Lh.current=[],e();const t=UI(Lh.current,e);return Lh.current=void 0,t}function Ide(e,t,n,r){if(typeof e=="function")return qde(e);const i=typeof t=="function"?t:Bde(t,n,r);return Array.isArray(e)?wz(e,i):wz([e],([s])=>i(s))}function wz(e,t){const n=Vp(()=>[]);return UI(e,()=>{n.length=0;const r=e.length;for(let i=0;i{function n(r){if(r.key==="?"&&!r.metaKey&&!r.ctrlKey){const i=r.target;if(i&&/^(INPUT|TEXTAREA|SELECT)$/.test(i.tagName))return;r.preventDefault(),t(s=>!s)}else r.key==="Escape"&&t(!1)}return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),T.jsxs(T.Fragment,{children:[T.jsx("button",{type:"button",onClick:()=>t(!0),title:"Keyboard shortcuts (?)",className:"fixed bottom-16 right-4 z-30 inline-flex items-center justify-center rounded-full p-2 bg-[var(--bg-card)] border border-[var(--border-soft)] text-[var(--text-muted)] hover:text-[var(--text-primary)] shadow",children:T.jsx(Lse,{className:"size-4"})}),T.jsx(h6,{children:e?T.jsx($f.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 bg-black/60 grid place-items-center p-4",onClick:()=>t(!1),children:T.jsxs($f.div,{initial:{scale:.96,y:8},animate:{scale:1,y:0},exit:{scale:.96,y:8},className:"bg-[var(--bg-card)] border border-[var(--border-soft)] rounded-2xl p-6 max-w-md w-full",onClick:n=>n.stopPropagation(),children:[T.jsxs("div",{className:"flex items-center justify-between mb-4",children:[T.jsx("h2",{className:"text-base font-semibold text-[var(--text-primary)]",children:"Keyboard shortcuts"}),T.jsx("button",{type:"button",onClick:()=>t(!1),className:"text-[var(--text-muted)] hover:text-[var(--text-primary)]",children:T.jsx(f6,{className:"size-4"})})]}),T.jsx("dl",{className:"space-y-2 text-sm",children:Ude.map(n=>T.jsxs("div",{className:"flex items-center justify-between gap-4",children:[T.jsx("dt",{className:"font-mono text-[var(--accent)] bg-[var(--bg-elevated)] px-2 py-0.5 rounded border border-[var(--border-soft)]",children:n.key}),T.jsx("dd",{className:"text-[var(--text-muted)] text-right",children:n.label})]},n.key))})]})}):null})]})}function Hde(e){if(!e)return"Apple Silicon";const t=e.toLowerCase();return t.includes("mac17")?"M5":t.includes("mac16")?"M4":t.includes("mac15")?"M3":t.includes("mac14")?"M2":t.includes("mac13")?"M1":"Apple Silicon"}function Fde(e,t){return(e??"").replace(/^Apple\s+/i,"").trim()||Hde(t)}function Gde(){const e=De(s=>s.machine),t=De(s=>s.profileName),n=De(s=>s.modelId),r=De(s=>s.contextWindow),i=Fde(e==null?void 0:e.chip,e==null?void 0:e.machine_model);return T.jsxs(ct,{title:"Hardware",subtitle:(e==null?void 0:e.machine_model)??"unknown machine model",children:[T.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[T.jsx(qv,{icon:T.jsx(MO,{className:"size-4 text-[var(--accent)]"}),label:"chip",value:i}),T.jsx(qv,{icon:T.jsx($se,{className:"size-4 text-[var(--accent-cool)]"}),label:"unified memory",value:li((e==null?void 0:e.unified_memory_bytes)??null)}),T.jsx(qv,{icon:T.jsx(Vse,{className:"size-4 text-[var(--accent-warm)]"}),label:"profile",value:t??"—"}),T.jsx(qv,{icon:T.jsx(MO,{className:"size-4 text-[var(--text-muted)]"}),label:"context window",value:r?`${r.toLocaleString()} tok`:"—"})]}),T.jsxs("div",{className:"mt-3 text-xs text-[var(--text-muted)] truncate",children:["loaded model: ",T.jsx("span",{className:"text-[var(--text-primary)]",children:n??"—"})]})]})}function qv({icon:e,label:t,value:n}){return T.jsxs("div",{className:"rounded-md border border-[var(--border-soft)] bg-[var(--bg-elevated)] p-3",children:[T.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:[e,t]}),T.jsx("div",{className:"text-base font-semibold text-[var(--text-primary)] mt-1 truncate",children:n})]})}function Kde(){const e=De(S=>S.mem),t=De(S=>S.machine),n=De(S=>S.latest),r=Number((t==null?void 0:t.unified_memory_bytes)??0),i=Number((e==null?void 0:e.active_memory_bytes)??0),s=Number((e==null?void 0:e.cache_memory_bytes)??0),l=Number((e==null?void 0:e.peak_memory_bytes)??0),c=Number((n==null?void 0:n.peak_memory_bytes)??0),f=Math.max(l,c),d=Math.max(0,r-i-s),m=r>0?r:Math.max(i+s+d,1),p=i/m*100,v=s/m*100,b=d/m*100,w=r>0?Math.min(100,f/r*100):null;return T.jsxs(ct,{title:"MLX memory",subtitle:r>0?`${li(i+s)} live · ${li(d)} headroom · ${li(r)} unified`:"live MLX memory snapshot",children:[T.jsxs("div",{className:"relative h-6 w-full rounded-full overflow-hidden border border-[var(--border-soft)] bg-[var(--bg-elevated)]",children:[T.jsx("div",{className:"absolute inset-y-0 left-0 transition-[width] duration-500",style:{width:`${p}%`,background:"var(--accent)"}}),T.jsx("div",{className:"absolute inset-y-0 transition-[width] duration-500",style:{left:`${p}%`,width:`${v}%`,background:"var(--accent-cool)",opacity:.7}}),T.jsx("div",{className:"absolute inset-y-0 transition-[width] duration-500",style:{left:`${p+v}%`,width:`${b}%`,background:"rgba(255,255,255,0.06)"}}),w!==null&&w>0?T.jsx("div",{className:"absolute top-0 bottom-0 border-l-2 border-[var(--accent-warm)]",style:{left:`${w}%`},title:`Peak ${li(f)}`}):null]}),T.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 mt-3 text-xs",children:[T.jsx(Iv,{color:"var(--accent)",label:"active",value:li(i)}),T.jsx(Iv,{color:"var(--accent-cool)",label:"cache",value:li(s)}),T.jsx(Iv,{color:"var(--accent-warm)",label:"peak",value:li(f)}),T.jsx(Iv,{color:"rgba(255,255,255,0.15)",label:"headroom",value:li(d)})]}),e!=null&&e.ok?null:T.jsxs("p",{className:"text-xs text-[var(--text-muted)] mt-2",children:["MLX accessors unavailable: ",(e==null?void 0:e.error)??"unknown"]})]})}function Iv({color:e,label:t,value:n}){return T.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[T.jsx("span",{className:"w-2.5 h-2.5 rounded-sm",style:{background:e}}),T.jsx("span",{className:"text-[var(--text-muted)] uppercase tracking-wider text-[10px]",children:t}),T.jsx("span",{className:"ml-auto text-[var(--text-primary)] tabular-nums",children:n})]})}function Yde(){const e=De(n=>n.mem),t=De(n=>n.latest);return T.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[T.jsx("div",{className:"col-span-12",children:T.jsx(Gde,{})}),T.jsx("div",{className:"col-span-12",children:T.jsx(Kde,{})}),T.jsx("div",{className:"col-span-12 sm:col-span-6 lg:col-span-4",children:T.jsx(ct,{title:"Active memory",subtitle:"MLX active allocation",children:T.jsx(Ya,{value:li((e==null?void 0:e.active_memory_bytes)??null),tone:"accent",caption:"live MLX accessor"})})}),T.jsx("div",{className:"col-span-12 sm:col-span-6 lg:col-span-4",children:T.jsx(ct,{title:"Cache memory",subtitle:"MLX cache allocator",children:T.jsx(Ya,{value:li((e==null?void 0:e.cache_memory_bytes)??null),tone:"cool",caption:"reusable buffer cache"})})}),T.jsx("div",{className:"col-span-12 sm:col-span-6 lg:col-span-4",children:T.jsx(ct,{title:"Peak memory",subtitle:"highest seen this process",children:T.jsx(Ya,{value:li(Math.max(Number((e==null?void 0:e.peak_memory_bytes)??0),Number((t==null?void 0:t.peak_memory_bytes)??0))||null),tone:"warm",caption:"includes last-request peak"})})})]})}var Z2={};(function e(t,n,r,i){var s=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),l=typeof Path2D=="function"&&typeof DOMMatrix=="function",c=(function(){if(!t.OffscreenCanvas)return!1;try{var U=new OffscreenCanvas(1,1),D=U.getContext("2d");D.fillRect(0,0,1,1);var V=U.transferToImageBitmap();D.createPattern(V,"no-repeat")}catch{return!1}return!0})();function f(){}function d(U){var D=n.exports.Promise,V=D!==void 0?D:t.Promise;return typeof V=="function"?new V(U):(U(f,f),null)}var m=(function(U,D){return{transform:function(V){if(U)return V;if(D.has(V))return D.get(V);var X=new OffscreenCanvas(V.width,V.height),ue=X.getContext("2d");return ue.drawImage(V,0,0),D.set(V,X),X},clear:function(){D.clear()}}})(c,new Map),p=(function(){var U=Math.floor(16.666666666666668),D,V,X={},ue=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(D=function(be){var Se=Math.random();return X[Se]=requestAnimationFrame(function ye(Me){ue===Me||ue+U-1i.newMaxTPSEvent),t=De(i=>i.consumeNewMaxTPS),n=De(i=>i.soundEnabled),r=K.useRef(0);return K.useEffect(()=>{if(!e)return;const i=Date.now();if(i-r.currentwindow.clearTimeout(s)},[e,t,n]),{newMaxBanner:e}}function Zde(){const{newMaxBanner:e}=Qde();return T.jsx("div",{className:"fixed top-16 right-4 z-50 pointer-events-none",children:T.jsx(h6,{children:e?T.jsxs($f.div,{initial:{opacity:0,y:-10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.95},transition:{type:"spring",stiffness:280,damping:22},className:"rounded-xl border border-[var(--accent)]/30 bg-[var(--bg-card)] shadow-[0_12px_40px_rgba(0,214,143,0.25)] px-4 py-3 flex items-center gap-3",children:[T.jsx(Kse,{className:"size-5 text-[var(--accent)]"}),T.jsxs("div",{className:"leading-tight",children:[T.jsx("div",{className:"text-sm font-semibold text-[var(--text-primary)]",children:"New all-time max"}),T.jsxs("div",{className:"text-xs text-[var(--text-muted)] tabular-nums",children:[On(e.tok_s)," tok/s"]})]})]},`${e.when_s}-${e.tok_s}`):null})})}function Jde(){const e=a$(),t=De(f=>f.lastCompletedPrefill),{data:n}=b2(),[r,i]=K.useState(()=>performance.now());K.useEffect(()=>{if(!e.active)return;const f=window.setInterval(()=>i(performance.now()),250);return()=>window.clearInterval(f)},[e.active]);const s=K.useRef(null);e.active?(!s.current||s.current.request_id!==e.request_id)&&(s.current={request_id:e.request_id,anchorMs:r,baseElapsed:e.elapsed_s}):s.current&&(s.current=null);const l=e.active&&s.current?s.current.baseElapsed+(r-s.current.anchorMs)/1e3:e.active?e.elapsed_s:0,c=(()=>{const d=((n==null?void 0:n.history)??[]).map(m=>m.prefill_tok_s).filter(m=>typeof m=="number"&&m>0);return d.length===0?null:d.reduce((m,p)=>m+p,0)/d.length})();return e.active?T.jsx(ehe,{view:e,liveElapsed:l}):T.jsxs(ct,{title:"Prefill",subtitle:t?`last: ${Xe(t.new_prefill_tokens??t.tokens_total)} tokens · ${Nn(t.elapsed_s)} · ${On(t.prefill_tok_s)} tok/s`:c!=null?`idle · historical mean ${On(c)} tok/s`:"idle · no prefill samples yet",children:[T.jsxs("div",{className:"grid grid-cols-3 gap-3 text-xs",children:[T.jsx(C_,{label:"last new tokens",value:Xe((t==null?void 0:t.new_prefill_tokens)??(t==null?void 0:t.tokens_total))}),T.jsx(C_,{label:"last cached",value:Xe(t==null?void 0:t.cached_tokens),tone:"cool"}),T.jsx(C_,{label:"last prefill tok/s",value:On(t==null?void 0:t.prefill_tok_s),tone:"accent"})]}),T.jsx("p",{className:"text-xs text-[var(--text-muted)] mt-3 leading-relaxed",children:"This panel goes live when the server starts chewing a prompt. During chunked prefill it shows progress %, live prefill tok/s, ETA, and elapsed time — what you watch while the decode gauge is still zero."})]})}function ehe({view:e,liveElapsed:t}){const n=e.tokens_done>0&&t>0?e.tokens_done/t:e.prefill_tok_s,r=Math.max(0,e.tokens_total-e.tokens_done),i=n&&n>0&&r>0?r/n:null,s=e.tokens_total>0?Math.min(100,e.tokens_done/e.tokens_total*100):0;return T.jsxs(ct,{title:T.jsxs("span",{className:"flex items-center gap-2",children:[T.jsx(c6,{className:"size-4 text-[var(--accent-warm)] animate-spin"}),T.jsx("span",{children:"Prefill in progress"})]}),subtitle:T.jsxs("span",{children:[Xe(e.tokens_done)," / ",Xe(e.tokens_total)," tokens",e.session_id?T.jsxs(T.Fragment,{children:[" · ",T.jsx("span",{className:"text-[var(--accent-cool)]",children:bu(e.session_id,18)})]}):null]}),children:[T.jsxs("div",{className:"relative h-6 w-full rounded-full bg-[var(--bg-elevated)] overflow-hidden border border-[var(--border-soft)]",children:[T.jsx($f.div,{className:"absolute inset-y-0 left-0",style:{background:"var(--accent-warm)"},initial:!1,animate:{width:`${s}%`},transition:{type:"spring",stiffness:80,damping:18,mass:.6}}),T.jsxs("div",{className:"absolute inset-0 grid place-items-center text-xs font-semibold tabular-nums text-[var(--text-primary)] mix-blend-difference",children:[s.toFixed(1),"%"]})]}),T.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mt-4 text-xs",children:[T.jsx(Uv,{label:"live prefill tok/s",value:On(n),tone:"accent"}),T.jsx(Uv,{label:"ETA",value:i!=null?Nn(i):"calculating",tone:"warm"}),T.jsx(Uv,{label:"elapsed",value:Nn(t)}),T.jsx(Uv,{label:"cached / total",value:`${Xe(e.cached_tokens)} / ${Xe(e.tokens_total)}`,tone:"cool"})]}),T.jsxs("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)] mt-3",children:["request ",bu(e.request_id,22)]})]})}function Uv({label:e,value:t,tone:n}){const r=n==="warm"?"text-[var(--accent-warm)]":n==="accent"?"text-[var(--accent)]":n==="cool"?"text-[var(--accent-cool)]":"text-[var(--text-primary)]";return T.jsxs("div",{className:"rounded-md border border-[var(--border-soft)] bg-[var(--bg-elevated)] px-3 py-2",children:[T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:e}),T.jsx("div",{className:`text-sm font-semibold tabular-nums ${r}`,children:t})]})}function C_({label:e,value:t,tone:n}){const r=n==="accent"?"text-[var(--accent)]":n==="cool"?"text-[var(--accent-cool)]":"text-[var(--text-primary)]";return T.jsxs("div",{className:"rounded-md border border-dashed border-[var(--border-soft)] px-3 py-2",children:[T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:e}),T.jsx("div",{className:`text-sm font-semibold tabular-nums ${r}`,children:t})]})}const the=[20,40,60],_z=80;function Az(e){return e>=60?"var(--accent)":e>=40?"var(--accent-cool)":e>=20?"var(--accent-warm)":"var(--accent-hot)"}function nhe(){const e=De(S=>S.liveTokS),t=De(S=>{var x;return((x=S.latest)==null?void 0:x.decode_tok_s)??null}),n=De(S=>S.rolling),r=a$(),i=K.useRef(null),s=typeof e=="number",l=s?e:t,c=Math.max(0,l??0),f=Q2(c),d=Lde(f,{stiffness:140,damping:22,mass:.6}),m=Ide(d,S=>S.toFixed(1)),p=K.useRef(s);p.current=s,K.useEffect(()=>{f.set(c)},[c,f]),K.useEffect(()=>{const S=i.current;if(!S)return;const x=window.devicePixelRatio||1,A=220;S.width=A*x,S.height=A*x,S.style.width=`${A}px`,S.style.height=`${A}px`;const _=S.getContext("2d");if(!_)return;let M=0;function E(j){if(!_)return;_.save(),_.scale(x,x),_.clearRect(0,0,A,A);const R=A/2,k=A/2+10,z=84,G=Math.PI*.75,$=Math.PI*2.25,B=$-G;_.beginPath(),_.arc(R,k,z,G,$),_.strokeStyle="rgba(255,255,255,0.06)",_.lineWidth=14,_.lineCap="round",_.stroke(),the.forEach(q=>{const F=Math.min(1,q/_z),ie=G+B*F;_.beginPath();const ce=z-18,U=z+8;_.moveTo(R+Math.cos(ie)*ce,k+Math.sin(ie)*ce),_.lineTo(R+Math.cos(ie)*U,k+Math.sin(ie)*U),_.strokeStyle="rgba(255,255,255,0.18)",_.lineWidth=1.5,_.stroke(),_.fillStyle="rgba(200,210,220,0.45)",_.font="10px ui-sans-serif, system-ui",_.textAlign="center",_.fillText(String(q),R+Math.cos(ie)*(z-30),k+Math.sin(ie)*(z-30)+3)});const Z=p.current,ee=Math.min(1,j/_z),J=G+B*ee;_.beginPath(),_.arc(R,k,z,G,J),_.strokeStyle=Az(j),_.globalAlpha=Z?1:.35,_.shadowColor=Az(j),_.shadowBlur=Z?16:0,_.lineWidth=14,_.lineCap="round",_.stroke(),_.shadowBlur=0,_.globalAlpha=1,_.fillStyle="rgba(255,255,255,0.7)",_.font="10px ui-sans-serif, system-ui",_.textAlign="center",_.fillText("tok/s",R,k+38),_.restore()}function O(){E(d.get()),M=requestAnimationFrame(O)}return M=requestAnimationFrame(O),()=>cancelAnimationFrame(M)},[d]);const v=(n==null?void 0:n.max)??null,b=(n==null?void 0:n.min)??null,w=(n==null?void 0:n.sticky_all_time_max)??null;return T.jsxs(ct,{title:"Live decode TPS",subtitle:r.active?`prefilling ${r.pct.toFixed(0)}% — decode not started`:s?`current ${On(e)} tok/s`:l!==null?`idle · last request ${On(l)} tok/s`:"waiting for generation",children:[T.jsxs("div",{className:"relative grid place-items-center min-h-[220px]",children:[T.jsx("canvas",{ref:i,"aria-hidden":"true"}),T.jsx("div",{className:"absolute inset-0 grid place-items-center pointer-events-none",children:T.jsx("div",{className:"text-center -mt-2",children:r.active?T.jsxs(T.Fragment,{children:[T.jsxs("span",{className:"inline-flex items-center gap-2 text-[20px] font-semibold tracking-wide text-[var(--accent-warm)] leading-none",children:[T.jsx(c6,{className:"size-5 animate-spin"}),"PREFILLING"]}),T.jsxs("span",{className:"text-xs text-[var(--text-muted)] mt-2 block tabular-nums",children:[r.pct.toFixed(1),"% · decode hasn't started yet"]})]}):T.jsxs(T.Fragment,{children:[T.jsx($f.span,{className:`block text-[44px] font-semibold tabular-nums leading-none ${s?"text-[var(--text-primary)]":"text-[var(--text-muted)]"}`,children:m}),T.jsx("span",{className:"text-xs text-[var(--text-muted)] mt-1 block",children:s?"live":l!==null?"last request":"idle"})]})})})]}),T.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-3 text-xs",children:[T.jsx(P_,{label:"window min",value:On(b)}),T.jsx(P_,{label:"window max",value:On(v),tone:"warm"}),T.jsx(P_,{label:"all-time",value:On(w),tone:"accent"})]})]})}function P_({label:e,value:t,tone:n}){const r=n==="warm"?"text-[var(--accent-warm)]":n==="accent"?"text-[var(--accent)]":"text-[var(--text-primary)]";return T.jsxs("div",{className:"bg-[var(--bg-elevated)] rounded-md px-2 py-1.5 border border-[var(--border-soft)]",children:[T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:e}),T.jsx("div",{className:`text-sm font-semibold tabular-nums ${r}`,children:t})]})}function rhe(){const e=HV(),t=De(f=>f.rolling),n=K.useRef(null),r=K.useRef(null),{data:i,maxPoint:s,minPoint:l}=K.useMemo(()=>{const f=[],d=[];let m=-1,p=-1;for(let v=0;ve[m].tok_s)&&(m=v),(p===-1||b.tok_s=0?e[m]:null,minPoint:p>=0?e[p]:null}},[e]);K.useEffect(()=>{var b,w;const f=n.current;if(!f)return;const m={width:f.clientWidth,height:220,padding:[8,16,8,8],cursor:{drag:{x:!1,y:!1,setScale:!1},focus:{prox:24},sync:{key:"tps",scales:["x",null]}},scales:{x:{time:!0},y:{range:(S,x,A)=>[Math.max(0,x*.9),A*1.05]}},axes:[{stroke:"rgba(200,210,220,0.55)",grid:{show:!0,stroke:"rgba(255,255,255,0.04)",width:1}},{stroke:"rgba(200,210,220,0.55)",grid:{show:!0,stroke:"rgba(255,255,255,0.04)",width:1},values:(S,x)=>x.map(A=>`${A.toFixed(0)} tok/s`),size:l6}],legend:{show:!1},series:[{},{label:"decode tok/s",stroke:"rgba(0,214,143,0.9)",width:2,points:{show:!1},paths:(w=(b=tr.paths).spline)==null?void 0:w.call(b),fill:"rgba(0,214,143,0.10)"}]},p=new tr(m,i,f);r.current=p;const v=()=>{p.setSize({width:f.clientWidth,height:220})};return window.addEventListener("resize",v),()=>{window.removeEventListener("resize",v),p.destroy(),r.current=null}},[]),K.useEffect(()=>{const f=r.current;f&&f.setData(i)},[i]);const c=De(f=>f.sessionFilter);return T.jsxs(ct,{title:"Decode TPS (last 5 min)",subtitle:t?`${t.count} samples · p50 ${On(t.p50)} · p95 ${On(t.p95)}${c?` · filtered by ${c}`:""}`:"no completed requests yet",children:[T.jsx("div",{ref:n,className:"w-full"}),(s||l)&&T.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-3 text-xs",children:[T.jsxs("div",{className:"rounded-md border border-[var(--border-soft)] bg-[var(--bg-elevated)] px-3 py-2 flex items-center justify-between",children:[T.jsx("span",{className:"text-[var(--text-muted)]",children:"window max"}),T.jsxs("span",{className:"text-[var(--accent-warm)] font-semibold tabular-nums",children:[On((s==null?void 0:s.tok_s)??null)," tok/s"]})]}),T.jsxs("div",{className:"rounded-md border border-[var(--border-soft)] bg-[var(--bg-elevated)] px-3 py-2 flex items-center justify-between",children:[T.jsx("span",{className:"text-[var(--text-muted)]",children:"window min"}),T.jsxs("span",{className:"text-[var(--accent-cool)] font-semibold tabular-nums",children:[On((l==null?void 0:l.tok_s)??null)," tok/s"]})]})]})]})}function ihe(){const e=De(t=>t.lifetime);return e?T.jsx(ct,{title:"Tokens served · this server",children:T.jsx(Ya,{value:Xe(e.tokens_total),unit:"tokens",tone:"accent",caption:T.jsxs("div",{className:"space-y-1",children:[T.jsxs("div",{children:[Xe(e.requests_total)," requests since ",Nn(e.uptime_s)," ago"]}),T.jsxs("div",{className:"text-[var(--text-muted)]",children:["prompt: ",Xe(e.prompt_tokens_total)," ·"," ","completion: ",Xe(e.completion_tokens_total)," ·"," ","cached: ",Xe(e.cached_tokens_total)]}),e.cancelled_total>0?T.jsxs("div",{className:"text-[var(--accent-warm)] text-xs",children:[Xe(e.cancelled_total)," cancelled"]}):null]})})}):T.jsx(ct,{title:"Tokens served · this server",children:T.jsx(Ya,{value:"—",caption:"waiting for first request"})})}function ahe(){var l;const e=De(c=>c.latest),t=De(c=>c.inFlight),n=De(c=>c.sessionBank),r=De(c=>c.contextWindow),i=(e==null?void 0:e.context_len)??0,s=r?Math.min(100,i/r*100):0;return T.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[T.jsx("div",{className:"col-span-12 lg:col-span-5",children:T.jsx(nhe,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-7",children:T.jsx(rhe,{})}),T.jsx("div",{className:"col-span-12",children:T.jsx(Jde,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-4",children:T.jsx(ihe,{})}),T.jsx("div",{className:"col-span-6 lg:col-span-4",children:T.jsx(ct,{title:"In flight",children:T.jsx(Ya,{value:Xe(t.length),unit:"requests",tone:t.length>0?"accent":"default",caption:t.length===0?"idle · waiting for next request":`${t.length} active · oldest ${Nn(Math.max(...t.map(c=>c.age_s)))}`})})}),T.jsx("div",{className:"col-span-6 lg:col-span-4",children:T.jsx(ct,{title:"Cache + context",subtitle:n?`${((l=n.prefixes)==null?void 0:l.length)??0} of ${n.max_entries} slots`:"—",children:T.jsx(Ya,{value:`${s.toFixed(0)}%`,unit:"context used",tone:s>=75?"warm":s>=95?"hot":"cool",caption:`${Xe(i)} / ${Xe(r)} tokens`})})}),T.jsx("div",{className:"col-span-12 lg:col-span-6",children:T.jsx(ct,{title:"Last request",subtitle:"from /metrics latest",children:T.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[T.jsx(Qi,{label:"decode tok/s",value:On(e==null?void 0:e.decode_tok_s),highlight:!0}),T.jsx(Qi,{label:"ttft",value:Nn(e==null?void 0:e.ttft_s)}),T.jsx(Qi,{label:"prompt eval",value:Nn(e==null?void 0:e.prompt_eval_time_s)}),T.jsx(Qi,{label:"decode",value:Nn(e==null?void 0:e.decode_elapsed_s)}),T.jsx(Qi,{label:"prefill tok/s",value:On(e==null?void 0:e.prefill_tok_s)}),T.jsx(Qi,{label:"cached",value:`${Xe(e==null?void 0:e.cached_tokens)} / ${Xe(e==null?void 0:e.prompt_tokens)}`})]})})}),T.jsx("div",{className:"col-span-12 lg:col-span-6",children:T.jsx(ct,{title:"Session",subtitle:"from latest envelope",children:T.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[T.jsx(Qi,{label:"session id",value:e!=null&&e.session_id?e.session_id:"—"}),T.jsx(Qi,{label:"cache hit",value:e!=null&&e.session_cache_hit?"yes":"no",highlight:!!(e!=null&&e.session_cache_hit)}),T.jsx(Qi,{label:"restore mode",value:(e==null?void 0:e.session_restore_mode)??"—"}),T.jsx(Qi,{label:"miss reason",value:(e==null?void 0:e.cache_miss_reason)??"—"}),T.jsx(Qi,{label:"mtp depth",value:Xe(e==null?void 0:e.mtp_depth)}),T.jsx(Qi,{label:"verify calls",value:Xe(e==null?void 0:e.verify_calls)})]})})})]})}function Qi({label:e,value:t,highlight:n=!1}){return T.jsxs("div",{className:"bg-[var(--bg-elevated)] rounded-md px-3 py-2 border border-[var(--border-soft)]",children:[T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:e}),T.jsx("div",{className:"text-sm font-semibold tabular-nums "+(n?"text-[var(--accent)]":"text-[var(--text-primary)]"),children:t})]})}function ohe(){const e=De(r=>r.inFlight),t=qf(),n=sg({mutationFn:r=>ed.postCancel(r),onSuccess:()=>{t.invalidateQueries({queryKey:["metrics"]})}});return T.jsx(ct,{title:"In-flight requests",subtitle:e.length===0?"no active generations":`${e.length} active · cancel is best-effort`,children:e.length===0?T.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:"Drive load from any client (Web UI, hippo, OpenAI SDK) to see live requests here."}):T.jsx("ul",{className:"divide-y divide-[var(--border-soft)] -mx-2",children:e.map(r=>{const i=r.last_progress,s=(i==null?void 0:i.completion_tokens)??0,l=i==null?void 0:i.decode_tok_s;return T.jsxs($f.li,{initial:{opacity:0,x:-6},animate:{opacity:1,x:0},exit:{opacity:0},className:"px-2 py-3 grid grid-cols-[1fr_auto] items-center gap-3",children:[T.jsxs("div",{className:"min-w-0",children:[T.jsxs("div",{className:"flex items-center gap-2 text-xs text-[var(--text-muted)]",children:[T.jsx("span",{className:"font-mono truncate",children:bu(r.request_id,28)}),r.session_id?T.jsx("span",{className:"text-[10px] uppercase tracking-wider text-[var(--accent-cool)]",children:bu(r.session_id,16)}):null]}),T.jsx("div",{className:"text-sm text-[var(--text-primary)] truncate",children:r.prompt_preview||"—"}),T.jsxs("div",{className:"text-xs text-[var(--text-muted)] flex flex-wrap gap-x-3 mt-1",children:[T.jsxs("span",{children:["age ",Nn(r.age_s)]}),T.jsxs("span",{children:[Xe(s)," tok"]}),typeof l=="number"&&l>0?T.jsxs("span",{className:"text-[var(--accent)]",children:[l.toFixed(1)," tok/s"]}):null]})]}),T.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 text-xs text-[var(--accent-hot)] hover:text-[var(--accent-hot)] hover:bg-[var(--accent-hot)]/10 rounded px-2 py-1 disabled:opacity-50",onClick:()=>n.mutate(r.request_id),disabled:n.isPending||r.cancelled,children:[T.jsx(Hse,{className:"size-3"}),r.cancelled?"cancelling":"cancel"]})]},r.request_id)})})})}function she(){var l,c,f;const e=Ase(),t=FV(),n=De(d=>d.sessionFilter),r=K.useMemo(()=>{var p;const d=((p=e.data)==null?void 0:p.recent)??[],m=d.length>0?d:t;return n?m.filter(v=>v.session_id===n).reverse():m.slice().reverse()},[(l=e.data)==null?void 0:l.recent,t,n]),[i,s]=K.useState(new Set);return T.jsx(ct,{title:"Recent requests",subtitle:r.length===0?"no requests yet":`${r.length} of ${((f=(c=e.data)==null?void 0:c.recent)==null?void 0:f.length)??t.length}${n?` · filtered by ${n}`:""}`,children:r.length===0?T.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:"Drive a few requests against this server and they will appear here in order, most recent first."}):T.jsx("div",{className:"overflow-x-auto -mx-3",children:T.jsxs("table",{className:"min-w-full text-sm",children:[T.jsx("thead",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:T.jsxs("tr",{children:[T.jsx(Ia,{}),T.jsx(Ia,{children:"session"}),T.jsx(Ia,{align:"right",children:"prompt"}),T.jsx(Ia,{align:"right",children:"cached"}),T.jsx(Ia,{align:"right",children:"gen"}),T.jsx(Ia,{align:"right",children:"tok/s"}),T.jsx(Ia,{align:"right",children:"ttft"}),T.jsx(Ia,{align:"right",children:"verify"}),T.jsx(Ia,{children:"cache"}),T.jsx(Ia,{align:"right",children:"when"})]})}),T.jsx("tbody",{children:r.map((d,m)=>{const p=i.has(m);return T.jsx(lhe,{row:d,isOpen:p,onToggle:()=>s(v=>{const b=new Set(v);return b.has(m)?b.delete(m):b.add(m),b})},`${d.session_id??"x"}-${m}`)})})]})})})}function Ia({children:e,align:t="left"}){return T.jsx("th",{className:`px-3 py-2 font-medium whitespace-nowrap ${t==="right"?"text-right":"text-left"}`,children:e})}function Ua({children:e,align:t="left",highlight:n=!1}){return T.jsx("td",{className:`px-3 py-2 whitespace-nowrap ${t==="right"?"text-right tabular-nums":""} ${n?"text-[var(--accent)] font-medium":"text-[var(--text-primary)]"}`,children:e})}function lhe({row:e,isOpen:t,onToggle:n}){const r=e.session_id??"—",i=WV(e),s=i?{label:i.label,color:"text-[var(--text-muted)] bg-[var(--text-muted)]/10",tooltip:i.tooltip}:e.session_cache_hit?{label:"HIT",color:"text-[var(--accent)] bg-[var(--accent)]/10",tooltip:void 0}:{label:(e.cache_miss_reason??"MISS").toUpperCase(),color:"text-[var(--accent-warm)] bg-[var(--accent-warm)]/10",tooltip:void 0};return T.jsxs(T.Fragment,{children:[T.jsxs("tr",{className:"border-t border-[var(--border-soft)] hover:bg-[var(--bg-elevated)]/60",children:[T.jsx(Ua,{children:T.jsx("button",{type:"button",onClick:n,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)]","aria-label":t?"Collapse":"Expand",children:t?T.jsx(Cse,{className:"size-4"}):T.jsx(Pse,{className:"size-4"})})}),T.jsx(Ua,{children:T.jsx("span",{className:"font-mono text-xs",children:bu(r,20)})}),T.jsx(Ua,{align:"right",children:Xe(e.prompt_tokens)}),T.jsx(Ua,{align:"right",children:Xe(e.cached_tokens)}),T.jsx(Ua,{align:"right",children:Xe(e.completion_tokens)}),T.jsx(Ua,{align:"right",highlight:!0,children:On(e.decode_tok_s)}),T.jsx(Ua,{align:"right",children:Nn(e.ttft_s)}),T.jsx(Ua,{align:"right",children:Xe(e.verify_calls)}),T.jsxs(Ua,{children:[T.jsx("span",{title:s.tooltip,className:`px-2 py-0.5 rounded-full text-[10px] uppercase tracking-wider ${s.color}`,children:s.label}),i!=null&&i.cacheHint?T.jsx("span",{className:"ml-2 text-[10px] text-[var(--text-muted)]",children:i.cacheHint}):null]}),T.jsx(Ua,{align:"right",highlight:!1,children:T.jsx("span",{className:"text-[var(--text-muted)] text-xs",children:JO(e.completed_at_s)})})]}),t?T.jsx("tr",{className:"bg-[var(--bg-elevated)]/40",children:T.jsx("td",{colSpan:10,className:"px-3 py-3",children:T.jsx("pre",{className:"text-[11px] leading-relaxed text-[var(--text-muted)] overflow-x-auto max-h-[260px]",children:JSON.stringify(e,null,2)})})}):null]})}function uhe(){return T.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[T.jsx("div",{className:"col-span-12",children:T.jsx(ohe,{})}),T.jsx("div",{className:"col-span-12",children:T.jsx(she,{})})]})}const Oz={open:"bg-emerald-400 shadow-[0_0_12px_rgb(74,222,128,0.6)]",connecting:"bg-amber-400 animate-pulse",reconnecting:"bg-amber-500 animate-pulse",failed:"bg-rose-500",unauthorized:"bg-rose-500",idle:"bg-slate-500"},che={open:"live",connecting:"connecting",reconnecting:"reconnecting",failed:"offline",unauthorized:"sign-in required",idle:"idle"};function fhe(){const e=De(t=>t.connection);return T.jsxs("div",{className:"flex items-center gap-2 text-xs text-[var(--text-muted)]",children:[T.jsx("span",{className:nf("w-2 h-2 rounded-full",Oz[e]??Oz.idle)}),T.jsx("span",{className:"hidden sm:inline",children:che[e]??e})]})}function dhe(){const e=De(n=>n.connection);if(e==="open"||e==="idle"||e==="connecting"||e==="unauthorized")return null;const t=e==="failed"?"Connection to MTPLX lost. The dashboard will keep trying.":"Reconnecting to MTPLX...";return T.jsx("div",{className:"bg-amber-500/15 text-amber-300 text-xs px-4 py-1.5 text-center border-b border-amber-500/30",children:t})}function hhe(){const e=VV(),t=De(r=>r.sessionFilter)??"",n=De(r=>r.setSessionFilter);return T.jsxs("label",{className:"hidden md:flex items-center gap-2 text-xs text-[var(--text-muted)]",children:[T.jsx("span",{children:"Session"}),T.jsxs("select",{value:t,onChange:r=>n(r.target.value||null),className:"bg-[var(--bg-card)] border border-[var(--border-soft)] rounded px-2 py-1 text-xs text-[var(--text-primary)] focus:outline-none focus:ring-1 focus:ring-[var(--accent)]",children:[T.jsx("option",{value:"",children:"All sessions"}),e.map(r=>T.jsx("option",{value:r,children:bu(r,28)},r))]})]})}function phe(){const e=De(n=>n.soundEnabled),t=De(n=>n.toggleSound);return T.jsx("button",{onClick:t,title:e?"Mute new-max chime (S)":"Enable new-max chime (S)",className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] inline-flex items-center",children:e?T.jsx(Yse,{className:"size-4"}):T.jsx(Xse,{className:"size-4"})})}function mhe(){const e=De(n=>n.theme),t=De(n=>n.cycleTheme);return T.jsxs("button",{onClick:t,title:`Theme: ${e} (press T to cycle)`,className:"flex items-center gap-1.5 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)]",children:[T.jsx(Bse,{className:"size-4"}),T.jsx("span",{className:"hidden lg:inline",children:e})]})}const vhe=[{id:"overview",label:"Overview",icon:jse},{id:"speculative",label:"Speculative",icon:zse},{id:"cache",label:"Cache",icon:Rse},{id:"memory",label:"Memory",icon:Nse},{id:"thermal",label:"Thermal",icon:Fse},{id:"requests",label:"Requests",icon:Ise},{id:"settings",label:"Settings",icon:qse}];function yhe({active:e,onSelect:t,children:n,bottomBar:r}){const i=De(d=>d.modelId),s=De(d=>d.profileName),l=De(d=>d.inFlight.length),[c,f]=K.useState(!1);return T.jsxs("div",{className:"min-h-dvh flex flex-col bg-[var(--bg-canvas)] text-[var(--text-primary)]",children:[T.jsx(dhe,{}),T.jsx(ghe,{modelId:i,profileName:s,activeRequests:l}),T.jsxs("div",{className:"flex-1 flex",children:[T.jsx(bhe,{active:e,onSelect:t,collapsed:c,setCollapsed:f}),T.jsx("main",{className:"flex-1 min-w-0 px-6 lg:px-8 py-6 lg:py-8 pb-24 overflow-x-hidden",children:n})]}),r?T.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-40 border-t border-[var(--border-soft)] bg-[var(--bg-elevated)]/90 backdrop-blur",children:r}):null]})}function ghe({modelId:e,profileName:t,activeRequests:n}){return T.jsxs("div",{className:"h-14 px-4 lg:px-6 flex items-center justify-between border-b border-[var(--border-soft)] bg-[var(--bg-elevated)]",children:[T.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[T.jsx("span",{className:"inline-flex items-center justify-center w-7 h-7 rounded-full bg-[var(--accent)] text-black font-bold text-sm",children:"M"}),T.jsxs("div",{className:"hidden sm:block leading-none",children:[T.jsx("div",{className:"text-sm font-semibold",children:"MTPLX"}),T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:"Live Dashboard"})]}),T.jsxs("div",{className:"hidden md:flex items-center gap-2 ml-4 text-xs text-[var(--text-muted)] min-w-0",children:[T.jsx(MO,{className:"size-3.5 shrink-0"}),T.jsx("span",{className:"truncate max-w-[280px]",children:e??"—"}),t?T.jsx("span",{className:"px-2 py-0.5 rounded-full border border-[var(--border-soft)] text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:t}):null,n>0?T.jsxs("span",{className:"px-2 py-0.5 rounded-full bg-[var(--accent)]/15 text-[var(--accent)] text-[10px] uppercase tracking-wider",children:[n," in flight"]}):null]})]}),T.jsxs("div",{className:"flex items-center gap-3",children:[T.jsx(hhe,{}),T.jsx(phe,{}),T.jsx(mhe,{}),T.jsx(fhe,{})]})]})}function bhe({active:e,onSelect:t,collapsed:n,setCollapsed:r}){return T.jsxs("nav",{className:nf("shrink-0 border-r border-[var(--border-soft)] bg-[var(--bg-elevated)] flex flex-col py-3 transition-[width]",n?"w-14":"w-56"),children:[T.jsx("div",{className:"px-2 flex flex-col gap-1",children:vhe.map(i=>{const s=i.icon,l=e===i.id;return T.jsxs("button",{onClick:()=>t(i.id),className:nf("group w-full flex items-center gap-3 px-3 py-2 rounded-lg text-left text-sm transition-colors",l?"bg-[var(--bg-card)] text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-card)]/60"),title:n?i.label:void 0,children:[T.jsx(s,{className:"size-4 shrink-0"}),n?null:T.jsx("span",{className:"truncate",children:i.label}),l?T.jsx("span",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-[var(--accent)]"}):null]},i.id)})}),T.jsx("button",{onClick:()=>r(!n),className:"mt-auto mx-2 mb-2 text-[10px] uppercase tracking-widest text-[var(--text-muted)] hover:text-[var(--text-primary)] py-2",children:n?"Expand":"Collapse"})]})}function xhe(){const e=De(f=>f.authRequired),[t,n]=K.useState(""),[r,i]=K.useState(!1),[s,l]=K.useState(null);if(!e)return null;async function c(f){f.preventDefault();const d=t.trim();if(!(!d||r)){i(!0),l(null);try{await _se(d),window.location.reload()}catch(m){l(m instanceof Qg?"That key was not accepted.":`Sign-in failed: ${m instanceof Error?m.message:String(m)}`),i(!1)}}}return T.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 grid place-items-center p-4",children:T.jsxs("form",{onSubmit:c,className:"bg-[var(--bg-card)] border border-[var(--border-soft)] rounded-2xl p-6 max-w-md w-full",children:[T.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[T.jsx("span",{className:"inline-flex items-center justify-center w-8 h-8 rounded-full bg-[var(--accent)]/15 text-[var(--accent)]",children:T.jsx(kse,{className:"size-4"})}),T.jsx("h2",{className:"text-base font-semibold text-[var(--text-primary)]",children:"Sign in to the dashboard"})]}),T.jsx("p",{className:"text-sm text-[var(--text-muted)] leading-relaxed",children:"This server was started with an API key. Paste it to continue, or open the dashboard link the server printed at startup."}),T.jsxs("label",{className:"block mt-4",children:[T.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"API key"}),T.jsx("input",{type:"password",autoComplete:"off",autoFocus:!0,value:t,onChange:f=>n(f.target.value),className:"mt-1 w-full bg-[var(--bg-elevated)] border border-[var(--border-soft)] rounded px-3 py-2 text-sm text-[var(--text-primary)] font-mono"})]}),s?T.jsx("div",{className:"mt-2 text-xs text-[var(--accent-hot)]",children:s}):null,T.jsx("button",{type:"submit",disabled:r||t.trim().length===0,className:"mt-4 w-full rounded-md bg-[var(--accent)] text-black text-sm font-semibold py-2 disabled:opacity-50",children:r?"Signing in…":"Sign in"})]})})}function She(){const e=De(f=>f.latest),t=(e==null?void 0:e.accepted_by_depth)??[],n=(e==null?void 0:e.drafted_by_depth)??[],r=(e==null?void 0:e.mean_accept_probability_by_depth)??[],i=X_(e==null?void 0:e.accepted_drafts,t),s=X_(e==null?void 0:e.drafted_tokens,n),l=Math.max(t.length,n.length,r.length),c=Array.from({length:l},(f,d)=>{const m=t[d]??0,p=n[d]??Math.max(m,1);return{depth:`D${d+1}`,accepted:m,drafted:p,rate:p>0?m/p*100:0,meanProb:r[d]!=null?r[d]*100:null}});return T.jsx(ct,{title:"Per-depth acceptance",subtitle:c.length>0?`${Xe(e==null?void 0:e.verify_calls)} verify calls · ${Xe(i)} accepted of ${Xe(s)} drafted`:"no completed generation yet",children:T.jsx("div",{className:"h-[260px]",children:c.length===0?T.jsx(whe,{}):T.jsx(wg,{width:"100%",height:"100%",children:T.jsxs(Aae,{data:c,margin:{top:8,right:24,left:0,bottom:0},children:[T.jsx(Ip,{stroke:"rgba(255,255,255,0.06)"}),T.jsx(pl,{dataKey:"depth",stroke:"rgba(200,210,220,0.6)"}),T.jsx(Wo,{yAxisId:"left",stroke:"rgba(200,210,220,0.6)",tickFormatter:f=>`${f}%`,domain:[0,100]}),T.jsx(Wo,{yAxisId:"right",orientation:"right",stroke:"rgba(240,180,41,0.7)",tickFormatter:f=>`${f}%`,domain:[0,100]}),T.jsx(ji,{contentStyle:{background:"var(--bg-elevated)",border:"1px solid var(--border-soft)",borderRadius:8},labelStyle:{color:"var(--text-muted)"},formatter:(f,d)=>typeof f=="number"?[`${f.toFixed(1)}%`,String(d)]:[String(f),String(d)]}),T.jsx(oa,{yAxisId:"left",dataKey:"rate",fill:"rgba(0,214,143,0.85)",name:"accept rate",radius:[6,6,0,0]}),T.jsx(Up,{yAxisId:"right",type:"monotone",dataKey:"meanProb",stroke:"rgba(240,180,41,0.95)",strokeWidth:2,dot:{r:4},name:"mean P(accept)"})]})})})})}function whe(){return T.jsx("div",{className:"h-full grid place-items-center text-[var(--text-muted)] text-sm",children:"Run a generation to populate per-depth acceptance."})}const Tz=[{key:"verify_forward_time_s",label:"verify forward",color:"rgba(0,214,143,0.85)",description:"Forward pass through the verify graph (target model)"},{key:"verify_logits_eval_time_s",label:"logits eval",color:"rgba(79,182,243,0.85)",description:"Logits evaluation against MTP draft tokens"},{key:"verify_hidden_eval_time_s",label:"hidden eval",color:"rgba(155,118,233,0.85)",description:"Hidden-state evaluation for downstream cache writes"},{key:"verify_target_distribution_time_s",label:"target dist",color:"rgba(245,158,11,0.85)",description:"Target distribution computation (probability ratio)"},{key:"verify_eval_unattributed_time_s",label:"unattributed",color:"rgba(244,114,182,0.75)",description:"Unaccounted-for eval cost; ideally near zero"},{key:"accept_time_s",label:"accept",color:"rgba(0,214,143,0.55)",description:"Acceptance sampling + residual correction"},{key:"repair_time_s",label:"repair",color:"rgba(239,68,68,0.85)",description:"Repair pass after rejection (lazy when 0)"},{key:"snapshot_time_s",label:"snapshot",color:"rgba(200,210,220,0.45)",description:"Cache snapshot/restore"},{key:"capture_commit_time_s",label:"capture/commit",color:"rgba(0,214,143,0.35)",description:"Capture-commit verifier overhead"},{key:"rollback_time_s",label:"rollback",color:"rgba(240,88,106,0.55)",description:"State rollback after reject"}];function _he(){const e=De(i=>i.latest),t=Number((e==null?void 0:e.verify_time_s)??0),n=Tz.map(i=>{const s=Number((e==null?void 0:e[i.key])??0)||0;return{...i,seconds:s,pct:t>0?s/t*100:0}}),r=n.some(i=>i.seconds>0);return T.jsx(ct,{title:"Verify-cycle waterfall",subtitle:e?`verify total ${Nn(t)} · target forward ${Nn(e==null?void 0:e.target_forward_time_s)} · draft ${Nn(e==null?void 0:e.draft_time_s)}`:"no completed verify cycle",children:T.jsx("div",{className:"h-[280px]",children:r?T.jsx(wg,{width:"100%",height:"100%",children:T.jsxs(r2,{layout:"vertical",data:n,margin:{top:4,right:30,left:110,bottom:0},children:[T.jsx(Ip,{stroke:"rgba(255,255,255,0.06)",horizontal:!1}),T.jsx(pl,{type:"number",stroke:"rgba(200,210,220,0.6)",tickFormatter:i=>`${(i*1e3).toFixed(0)}ms`}),T.jsx(Wo,{type:"category",dataKey:"label",stroke:"rgba(200,210,220,0.7)",width:100}),T.jsx(ji,{contentStyle:{background:"var(--bg-elevated)",border:"1px solid var(--border-soft)",borderRadius:8,fontSize:12},labelStyle:{color:"var(--text-muted)"},formatter:(i,s,l)=>{var f,d;const c=Tz.find(m=>{var p;return m.label===((p=l==null?void 0:l.payload)==null?void 0:p.label)});return typeof i!="number"?[i,(c==null?void 0:c.label)??"—"]:[`${Nn(i)} · ${((d=(f=l==null?void 0:l.payload)==null?void 0:f.pct)==null?void 0:d.toFixed(1))??"—"}%`,(c==null?void 0:c.description)??(c==null?void 0:c.label)??"—"]}}),T.jsx(oa,{dataKey:"seconds",radius:[0,6,6,0],children:n.map(i=>T.jsx(oa,{dataKey:"seconds",fill:i.color},i.key))})]})}):T.jsx("div",{className:"h-full grid place-items-center text-[var(--text-muted)] text-sm",children:"Run a generation to capture the verify decomposition."})})})}function Ahe(){const e=De(i=>i.latest),t=X_(e==null?void 0:e.drafted_tokens,e==null?void 0:e.drafted_by_depth),n=(e==null?void 0:e.verify_calls)??0,r=n>0?t/n:null;return T.jsx(ct,{title:"Drafted / verify call",subtitle:"higher is faster",children:T.jsx(Ya,{value:r===null?"—":r.toFixed(2),unit:"tok/call",tone:typeof r=="number"&&r>=3?"accent":"default",caption:`${Xe(t)} drafted · ${Xe(n)} verifies`})})}function Ohe(){const e=De(r=>r.latest),t=(e==null?void 0:e.correction_tokens)??0,n=(e==null?void 0:e.bonus_tokens)??0;return T.jsxs(ct,{title:"Correction vs bonus tokens",subtitle:"dropped + reborn tokens",children:[T.jsxs("div",{className:"flex items-baseline gap-6",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-2xl font-semibold text-[var(--accent-hot)] tabular-nums",children:Xe(t)}),T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:"correction"})]}),T.jsxs("div",{children:[T.jsx("div",{className:"text-2xl font-semibold text-[var(--accent)] tabular-nums",children:Xe(n)}),T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:"bonus"})]})]}),T.jsx("div",{className:"text-xs text-[var(--text-muted)] mt-3",children:"bonus = accepted > drafted at depth d; correction = residual fix-up"})]})}function The(){const e=De(r=>r.latest),t=(e==null?void 0:e.request_tok_s)??null,n=(e==null?void 0:e.decode_tok_s)??null;return T.jsx(ct,{title:"Decode vs request tok/s",subtitle:"decode excludes prefill",children:T.jsxs("div",{className:"flex items-baseline gap-6",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-2xl font-semibold text-[var(--accent)] tabular-nums",children:On(n)}),T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:"decode tok/s"})]}),T.jsxs("div",{children:[T.jsx("div",{className:"text-2xl font-semibold text-[var(--accent-cool)] tabular-nums",children:On(t)}),T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:"request tok/s"})]})]})})}function Ehe(){return T.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[T.jsx("div",{className:"col-span-12 lg:col-span-6",children:T.jsx(She,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-6",children:T.jsx(_he,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-4",children:T.jsx(Ahe,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-4",children:T.jsx(Ohe,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-4",children:T.jsx(The,{})})]})}function Mhe(){const e=De(t=>t.thermal);return!e||!e.ok||e.fans.length===0?T.jsx(ct,{title:"Fan rings",subtitle:"thermal polling disabled or unavailable",children:T.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:["Pass ",T.jsx("code",{children:"--enable-thermal-poll"})," when starting the MTPLX server to populate live fan RPMs. The poll uses",T.jsx("code",{children:" thermalforge status"})," at 1 Hz and is off by default to keep the hot path clean."]})}):T.jsx(ct,{title:"Fan rings",subtitle:`min ${Xe(e.min_rpm)} RPM · max ${Xe(e.max_rpm)} RPM`,children:T.jsx("div",{className:"grid grid-cols-2 gap-4",children:e.fans.map((t,n)=>T.jsx(jhe,{index:n,fan:t},n))})})}function jhe({index:e,fan:t}){const n=K.useRef(null),r=Number(t.actual_rpm??t.rpm??0),i=Number(t.target_rpm??r),s=Math.max(1,Number(t.max_capacity_rpm??7800)),l=String(t.mode??"auto"),c=Math.min(1,r/s),f=Math.min(1,i/s);return K.useEffect(()=>{const d=n.current;if(!d)return;const m=window.devicePixelRatio||1,p=140;d.width=p*m,d.height=p*m,d.style.width=`${p}px`,d.style.height=`${p}px`;const v=d.getContext("2d");if(!v)return;v.scale(m,m),v.clearRect(0,0,p,p);const b=p/2,w=p/2,S=56,x=Math.PI*.75,A=Math.PI*2.25,_=A-x;v.beginPath(),v.arc(b,w,S,x,A),v.strokeStyle="rgba(255,255,255,0.06)",v.lineWidth=10,v.lineCap="round",v.stroke();const M=x+_*c,E=c>.7?"rgba(240,88,106,0.9)":c>.4?"rgba(240,180,41,0.9)":"rgba(0,214,143,0.9)";v.beginPath(),v.arc(b,w,S,x,M),v.strokeStyle=E,v.shadowColor=E,v.shadowBlur=12,v.stroke(),v.shadowBlur=0;const O=x+_*f;v.beginPath();const j=S-10,R=S+6;v.moveTo(b+Math.cos(O)*j,w+Math.sin(O)*j),v.lineTo(b+Math.cos(O)*R,w+Math.sin(O)*R),v.strokeStyle="rgba(255,255,255,0.65)",v.lineWidth=2,v.stroke()},[r,i,s,c,f]),T.jsxs("div",{className:"rounded-lg border border-[var(--border-soft)] bg-[var(--bg-elevated)] p-3 grid place-items-center",children:[T.jsxs("div",{className:"relative",children:[T.jsx("canvas",{ref:n,"aria-hidden":"true"}),T.jsx("div",{className:"absolute inset-0 grid place-items-center pointer-events-none",children:T.jsxs("div",{className:"text-center",children:[T.jsx("div",{className:"text-2xl font-semibold tabular-nums text-[var(--text-primary)]",children:Xe(r)}),T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)] -mt-1",children:"RPM"})]})})]}),T.jsxs("div",{className:"mt-2 text-xs text-[var(--text-muted)] text-center",children:["F",e," · ",l," ",T.jsxs("span",{className:"text-[var(--text-primary)]",children:["/ ",Xe(s)," max"]})]})]})}function Che(){var n;const e=De(r=>r.thermal),t=De(r=>r.thermalWhenS);return T.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[T.jsx("div",{className:"col-span-12 lg:col-span-7",children:T.jsx(Mhe,{})}),T.jsx("div",{className:"col-span-12 lg:col-span-5",children:T.jsx(ct,{title:"Thermal snapshot",subtitle:t?JO(t):"no poll yet",children:e?T.jsxs("dl",{className:"text-sm space-y-1",children:[T.jsx(Vv,{label:"ok",value:String(e.ok)}),T.jsx(Vv,{label:"min RPM",value:String(e.min_rpm??"—")}),T.jsx(Vv,{label:"max RPM",value:String(e.max_rpm??"—")}),T.jsx(Vv,{label:"fans",value:String(((n=e.fans)==null?void 0:n.length)??0)})]}):T.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:["Thermal polling is off by default. Pass"," ",T.jsx("code",{children:"--enable-thermal-poll"})," when starting MTPLX."]})})}),T.jsx("div",{className:"col-span-12",children:T.jsx(ct,{title:"GPU MHz · coming in v2",subtitle:"ThermalForge does not expose GPU clock; powermetrics integration lands later",children:T.jsxs("p",{className:"text-sm text-[var(--text-muted)] leading-relaxed",children:["ThermalForge's ",T.jsx("code",{children:"status"})," JSON shape (verified May 2026) covers fan RPMs and modes but not GPU MHz or thermal pressure. The dashboard plan documents GPU MHz as a v2 add via ",T.jsx("code",{children:"powermetrics"}),"; until then this slot is intentionally empty so we don't render a fake number."]})})})]})}function Vv({label:e,value:t}){return T.jsxs("div",{className:"flex justify-between",children:[T.jsx("dt",{className:"text-[var(--text-muted)]",children:e}),T.jsx("dd",{className:"text-[var(--text-primary)] tabular-nums",children:t})]})}const D_=["overview","speculative","cache","memory","thermal","requests","settings"];function Phe(e){const t=De(i=>i.cycleTheme),n=De(i=>i.togglePauseStream),r=De(i=>i.toggleSound);K.useEffect(()=>{function i(s){const l=s.target;if(!(l&&/^(INPUT|TEXTAREA|SELECT)$/.test(l.tagName))&&!(s.metaKey||s.ctrlKey||s.altKey))switch(s.key){case"t":t();break;case" ":s.preventDefault(),n();break;case"s":r();break;case"g":{const c=D_.findIndex(d=>d===document.body.dataset.activeTab),f=D_[(c+1)%D_.length];e(f);break}}}return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[t,n,r,e])}const R_=[1e3,2e3,4e3,8e3,16e3,3e4];function Dhe(e){let t="idle",n=null,r=!1,i=0,s=null;function l(m){var p;t=m,(p=e.onConnectionChange)==null||p.call(e,m)}function c(){s!==null&&(clearTimeout(s),s=null)}function f(){if(r)return;l("reconnecting");const m=R_[Math.min(i,R_.length-1)];i+=1,s=setTimeout(d,m)}function d(){if(r)return;c(),l("connecting");try{n=new EventSource("/v1/mtplx/metrics/stream")}catch(p){console.error("EventSource construction failed",p),f();return}n.addEventListener("open",()=>{i=0,l("open")}),n.addEventListener("snapshot",p=>{try{const v=JSON.parse(p.data);e.onSnapshot(v)}catch(v){console.warn("failed to parse snapshot event",v)}});const m=p=>v=>{try{const b=JSON.parse(v.data);e.onEvent({...b,kind:p})}catch(b){console.warn(`failed to parse ${p} event`,b)}};n.addEventListener("progress",m("progress")),n.addEventListener("completed",m("completed")),n.addEventListener("new_max_tps",m("new_max_tps")),n.addEventListener("thermal",m("thermal")),n.addEventListener("prefill",m("prefill")),n.addEventListener("error",()=>{if(!r)if(n&&n.readyState===EventSource.CLOSED){try{n.close()}catch{}n=null,wse().then(p=>{var v;if(!r){if(p==="unauthorized"){l("unauthorized"),(v=e.onUnauthorized)==null||v.call(e);return}i>=R_.length&&l("failed"),f()}})}else l("reconnecting")})}return d(),{close:()=>{if(r=!0,c(),n){try{n.close()}catch{}n=null}l("idle")},state:()=>t}}function Rhe(){const e=K.useRef(null),t=De(s=>s.applySnapshot),n=De(s=>s.applyEvent),r=De(s=>s.setConnection),i=De(s=>s.setAuthRequired);K.useEffect(()=>{r("connecting");const s=Dhe({onSnapshot:t,onEvent:n,onConnectionChange:r,onUnauthorized:()=>i(!0)});return e.current=s,()=>{s.close(),e.current=null}},[t,n,r,i])}const Nhe=new GU({defaultOptions:{queries:{staleTime:1e3,retry:(e,t)=>!(t instanceof Qg)&&e<1}}});function khe(){return T.jsxs(KU,{client:Nhe,children:[T.jsx(Lhe,{}),T.jsx(Zde,{}),T.jsx(Vde,{}),T.jsx(xhe,{})]})}function Lhe(){const[e,t]=K.useState("overview");Rhe(),Phe(t);const n=De(r=>r.pauseStream);return K.useEffect(()=>{document.body.dataset.activeTab=e},[e]),K.useEffect(()=>{document.body.dataset.streamPaused=String(n)},[n]),T.jsx(yhe,{active:e,onSelect:t,bottomBar:T.jsx(GV,{}),children:e==="overview"?T.jsx(ahe,{}):e==="speculative"?T.jsx(Ehe,{}):e==="cache"?T.jsx(tle,{}):e==="memory"?T.jsx(Yde,{}):e==="thermal"?T.jsx(Che,{}):e==="requests"?T.jsx(uhe,{}):e==="settings"?T.jsx(ile,{}):null})}const VI=document.getElementById("root");if(!VI)throw new Error("MTPLX dashboard mount point #root is missing from index.html");xU.createRoot(VI).render(T.jsx(Q.StrictMode,{children:T.jsx(khe,{})})); diff --git a/mtplx/dashboard/_static/index.html b/mtplx/dashboard/_static/index.html index db0c8a9b7..11baa8a91 100644 --- a/mtplx/dashboard/_static/index.html +++ b/mtplx/dashboard/_static/index.html @@ -6,8 +6,8 @@ MTPLX Live Dashboard - - + +
diff --git a/mtplx/generation.py b/mtplx/generation.py index ebbd8eca7..66806982d 100644 --- a/mtplx/generation.py +++ b/mtplx/generation.py @@ -6776,6 +6776,18 @@ def _emit_prefill_complete(state: PromptState) -> PromptState: "prefill_compute_tok_s": compute_tok_s, "prefill_wall_tok_s": wall_tok_s, "cache_hit": bool(state.cache_hit), + # The cache outcome as the request's stats will report + # it, so a request cancelled during decode can still say + # where its prompt came from. + "cache_source": state.cache_source, + "cache_miss_reason": state.cache_miss_reason, + "ssd_cache_hit": bool(state.ssd_cache_hit), + "ssd_cached_tokens": int(state.ssd_cached_tokens), + "ssd_restore_s": float(state.ssd_restore_s), + "ssd_suffix_tokens": new_tokens if state.ssd_cache_hit else 0, + "session_restore_served": dict( + getattr(state, "restore_served", None) or {} + ), } ) except Exception: diff --git a/mtplx/server/dashboard_state.py b/mtplx/server/dashboard_state.py index 864a33010..4e4191fce 100644 --- a/mtplx/server/dashboard_state.py +++ b/mtplx/server/dashboard_state.py @@ -671,6 +671,9 @@ class DashboardState: lifetime: LifetimeCounters = field(default_factory=LifetimeCounters) prefill_history: PrefillHistory = field(default_factory=PrefillHistory) rereads: RereadLedger = field(default_factory=RereadLedger) + # The cache outcome of each recent completed prefill, for the receipt of + # a request cancelled before its stats exist. Same bounded ledger. + prefill_outcomes: RereadLedger = field(default_factory=RereadLedger) progress_events: ProgressEventGate = field(default_factory=ProgressEventGate) last_thermal: dict[str, Any] | None = None last_thermal_when_s: float = 0.0 diff --git a/mtplx/server/openai.py b/mtplx/server/openai.py index 30fb37fb0..12a140c7e 100644 --- a/mtplx/server/openai.py +++ b/mtplx/server/openai.py @@ -5174,6 +5174,12 @@ def _pump(self) -> None: "prefill_compute_tok_s": prefill_tok_s, "prefill_wall_tok_s": prefill_tok_s, "cache_hit": bool(job.session_cache_hit), + "cache_source": job.cache_source, + "cache_miss_reason": job.cache_miss_reason, + "ssd_cache_hit": bool(job.ssd_cache_hit), + "ssd_cached_tokens": int(job.ssd_cached_tokens), + "ssd_restore_s": float(job.ssd_restore_s), + "ssd_suffix_tokens": int(job.ssd_suffix_tokens), "scheduler_lane": "ar_batch", "request_id": job.request_id, } @@ -16764,6 +16770,10 @@ def _record_request_metrics(state: "ServerState", record: dict[str, Any]) -> Non reread = rereads.pop(str(record["request_id"])) if reread is not None: record.setdefault("reread", reread) + # Only a cancellation reads its prefill outcome; let it go here. + outcomes = getattr(state.dashboard, "prefill_outcomes", None) + if outcomes is not None: + outcomes.pop(str(record["request_id"])) safe = _json_safe(record) # Warmup generations (startup pass and the idle background ladder) are # not user requests: keep them out of the RAM ring that feeds the @@ -18305,6 +18315,43 @@ def _dashboard_record_completion( _safe_stdout_print(f"[dashboard] record_completion suppressed error: {exc!r}") +def _prefill_cache_outcome(payload: Mapping[str, Any]) -> dict[str, Any] | None: + """The cache outcome a completed prefill reports, in the request-log + field names and with the defaults ``_metrics_envelope`` applies, or None + when the event says nothing about the cache. + + A request cancelled during decode never reaches its stats; its receipt + takes these fields instead. + """ + + hit = payload.get("session_cache_hit", payload.get("cache_hit")) + if hit is None: + return None + hit = bool(hit) + prompt_tokens = int(payload.get("tokens_total") or 0) + cached_tokens = int(payload.get("cached_tokens") or 0) + new_prefill_tokens = payload.get("new_prefill_tokens") + if new_prefill_tokens is None: + new_prefill_tokens = prompt_tokens - cached_tokens + outcome: dict[str, Any] = { + "session_cache_hit": hit, + "cached_tokens": cached_tokens, + "new_prefill_tokens": max(0, int(new_prefill_tokens)), + "cache_source": str(payload.get("cache_source") or ("ram" if hit else "none")), + "cache_miss_reason": None if hit else payload.get("cache_miss_reason"), + "ssd_cache_hit": bool(payload.get("ssd_cache_hit") or False), + "ssd_cached_tokens": int(payload.get("ssd_cached_tokens") or 0), + "ssd_restore_s": float(payload.get("ssd_restore_s") or 0.0), + "ssd_suffix_tokens": int(payload.get("ssd_suffix_tokens") or 0), + } + if isinstance(payload.get("prompt_eval_time_s"), (int, float)): + outcome["prompt_eval_time_s"] = float(payload["prompt_eval_time_s"]) + served = payload.get("session_restore_served") + if isinstance(served, Mapping) and served: + outcome["session_restore_served"] = dict(served) + return outcome + + def _dashboard_publish_prefill( state: "ServerState", *, @@ -18384,6 +18431,11 @@ def _dashboard_publish_prefill( # for the SSE stream. if enriched.get("phase") == "completed": dashboard.in_flight.update_prefill(request_id, None) + outcome = _prefill_cache_outcome(enriched) + if outcome is not None: + dashboard.prefill_outcomes.put(request_id, outcome) + # Kept for the receipt only; the live view has no use for it. + enriched.pop("session_restore_served", None) else: dashboard.in_flight.update_prefill(request_id, enriched) dashboard.bus.publish({"kind": "prefill", "when_s": time.time(), **enriched}) @@ -25935,10 +25987,25 @@ def _record_stream_cancellation_metric( "server_tok_s": partial_tok_s, "partial_decode_tok_s": partial_tok_s, "partial_request_tok_s": partial_tok_s, - "session_cache_hit": False, + # Unknown until the prefill completes: None, not a miss. + "session_cache_hit": None, + "cached_tokens": None, + "new_prefill_tokens": None, + "cache_source": None, "cache_miss_reason": None, + "ttft_s": None, } + outcomes = getattr(getattr(state, "dashboard", None), "prefill_outcomes", None) + outcome = outcomes.pop(response_id) if outcomes is not None else None + if outcome is not None: + envelope.update(outcome) if token_times: + # As in _metrics_envelope: from the request's arrival to its first token. + received_s = request_observability.get("request_received_monotonic_s") + first_token_origin_s = ( + float(received_s) if isinstance(received_s, (int, float)) else stream_started_s + ) + envelope["ttft_s"] = max(0.0, token_times[0] - first_token_origin_s) envelope.update(_producer_gap_census(token_times)) envelope["sliding_decode_tok_s_first_32"] = _token_window_rate_first( token_times, 32 diff --git a/tests/test_prefill_reread.py b/tests/test_prefill_reread.py index ecc7dd5a7..f9a1b49de 100644 --- a/tests/test_prefill_reread.py +++ b/tests/test_prefill_reread.py @@ -617,6 +617,46 @@ def test_a_reply_that_changed_after_the_screenshot_resumes_at_the_change(vision_ assert explanation["recompute_tokens"] == len(second) - seam +@pytest.mark.parametrize("source", ["ram", "ssd"]) +def test_the_completed_prefill_reports_the_cache_outcome_the_stats_will(source): + model = _TinyModel() + events, record = _recorder(model) + prompt_state = restore_or_prefill_prompt_state( + _tiny_runtime(model), + IDS[:5], + session_bank=_ExactRestoreBank(3, source=source), + session_id="s", + prefill_callback=record, + ) + ((completed, _),) = [(p, c) for p, c in events if p.get("phase") == "completed"] + assert completed["cache_hit"] is prompt_state.cache_hit is True + assert completed["cached_tokens"] == prompt_state.cached_tokens == 3 + assert completed["new_prefill_tokens"] == prompt_state.suffix_tokens == 2 + assert completed["cache_source"] == prompt_state.cache_source == source + assert completed["cache_miss_reason"] is None + assert completed["ssd_cache_hit"] is (source == "ssd") + assert completed["ssd_cached_tokens"] == (3 if source == "ssd" else 0) + assert completed["ssd_suffix_tokens"] == (2 if source == "ssd" else 0) + assert completed["session_restore_served"] == prompt_state.restore_served + + +def test_the_completed_prefill_of_a_cold_read_reports_the_miss_reason(): + model = _TinyModel() + events, record = _recorder(model) + prompt_state = restore_or_prefill_prompt_state( + _tiny_runtime(model), + IDS[:6], + session_bank=_bank(), + session_id="new-session", + prefill_callback=record, + ) + ((completed, _),) = [(p, c) for p, c in events if p.get("phase") == "completed"] + assert completed["cache_hit"] is False + assert completed["cache_source"] == "none" + assert completed["cache_miss_reason"] == prompt_state.cache_miss_reason + assert completed["cache_miss_reason"] + + # ---- The server: classify, estimate, carry forward, receipt ------------- diff --git a/tests/test_server_openai.py b/tests/test_server_openai.py index 97caa81a7..62d36b121 100644 --- a/tests/test_server_openai.py +++ b/tests/test_server_openai.py @@ -5383,6 +5383,152 @@ def test_stream_cancellation_metric_keeps_partial_throughput(): assert latest["partial_request_tok_s"] == latest["request_tok_s"] +def _publish_completed_prefill(state, request_id, **fields): + openai._dashboard_publish_prefill( + state, + request_id=request_id, + session_id="ses_cancel", + payload={"phase": "completed", "tokens_total": 92819, **fields}, + ) + + +def test_stream_cancellation_metric_carries_the_known_cache_outcome(monkeypatch): + """A turn cancelled during decode after a RAM restore read MISS in the + request log: the receipt hard-coded session_cache_hit False.""" + + state = _fake_streaming_session_state() + published = [] + monkeypatch.setattr(state.dashboard.bus, "publish", published.append) + _publish_completed_prefill( + state, + "chatcmpl_cancel_hit", + cached_tokens=92636, + new_prefill_tokens=183, + cache_hit=True, + cache_source="ram", + cache_miss_reason=None, + ssd_cache_hit=False, + ssd_cached_tokens=0, + ssd_restore_s=0.0, + ssd_suffix_tokens=0, + prompt_eval_time_s=0.8, + session_restore_served={"actual_restore_point": 92636}, + ) + received_s = time.perf_counter() - 180.0 + openai._record_stream_cancellation_metric( + state, + response_id="chatcmpl_cancel_hit", + session_id="ses_cancel", + prompt_tokens=92819, + streamed_completion_tokens=3, + stream_started_s=received_s + 0.5, + reason="client_disconnected", + request_observability={"request_received_monotonic_s": received_s}, + client_disconnected=True, + token_times=[received_s + 2.0, received_s + 2.1, received_s + 2.2], + ) + + latest = state.last_metrics[-1] + assert latest["request_cancelled"] is True + assert latest["session_cache_hit"] is True + assert latest["cached_tokens"] == 92636 + assert latest["new_prefill_tokens"] == 183 + assert latest["cache_source"] == "ram" + assert latest["cache_miss_reason"] is None + assert latest["ssd_cache_hit"] is False + assert latest["prompt_eval_time_s"] == 0.8 + assert latest["session_restore_served"] == {"actual_restore_point": 92636} + assert latest["ttft_s"] == pytest.approx(2.0) + assert state.dashboard.prefill_outcomes.get("chatcmpl_cancel_hit") is None + # The live prefill event does not carry the served record. + (prefill_event,) = [e for e in published if e["kind"] == "prefill"] + assert "session_restore_served" not in prefill_event + assert prefill_event["cache_source"] == "ram" + + +def test_stream_cancellation_metric_carries_a_miss_and_its_reason(): + state = _fake_streaming_session_state() + _publish_completed_prefill( + state, + "chatcmpl_cancel_miss", + cached_tokens=0, + new_prefill_tokens=92819, + cache_hit=False, + cache_source="none", + cache_miss_reason="evicted", + ) + openai._record_stream_cancellation_metric( + state, + response_id="chatcmpl_cancel_miss", + session_id="ses_cancel", + prompt_tokens=92819, + streamed_completion_tokens=0, + stream_started_s=time.perf_counter() - 30.0, + reason="client_disconnected", + request_observability={}, + client_disconnected=True, + ) + + latest = state.last_metrics[-1] + assert latest["session_cache_hit"] is False + assert latest["cache_miss_reason"] == "evicted" + assert latest["cache_source"] == "none" + assert latest["new_prefill_tokens"] == 92819 + # No token reached the client: there is no first-token time. + assert latest["ttft_s"] is None + + +def test_stream_cancellation_before_the_prefill_completed_leaves_the_outcome_unknown(): + state = _fake_streaming_session_state() + openai._record_stream_cancellation_metric( + state, + response_id="chatcmpl_cancel_early", + session_id="ses_cancel", + prompt_tokens=92819, + streamed_completion_tokens=0, + stream_started_s=time.perf_counter() - 5.0, + reason="client_disconnected", + request_observability={}, + client_disconnected=True, + ) + + latest = state.last_metrics[-1] + for key in ( + "session_cache_hit", + "cached_tokens", + "new_prefill_tokens", + "cache_source", + "cache_miss_reason", + "ttft_s", + ): + assert key in latest + assert latest[key] is None, key + + +def test_a_completed_request_releases_its_prefill_outcome(): + state = _fake_streaming_session_state() + _publish_completed_prefill(state, "chatcmpl_done", cached_tokens=10, cache_hit=True) + assert state.dashboard.prefill_outcomes.get("chatcmpl_done") is not None + openai._record_request_metrics(state, {"request_id": "chatcmpl_done"}) + assert state.dashboard.prefill_outcomes.get("chatcmpl_done") is None + + +def test_prefill_cache_outcome_applies_the_envelope_defaults(): + outcome = openai._prefill_cache_outcome( + {"tokens_total": 100, "cached_tokens": 60, "cache_hit": True} + ) + assert outcome is not None + assert outcome["session_cache_hit"] is True + assert outcome["cache_source"] == "ram" + assert outcome["new_prefill_tokens"] == 40 + assert outcome["cache_miss_reason"] is None + # An event that says nothing about the cache gives no outcome. + assert openai._prefill_cache_outcome({"tokens_total": 100}) is None + # A hit never keeps a miss reason. + hit = openai._prefill_cache_outcome({"cache_hit": True, "cache_miss_reason": "evicted"}) + assert hit["cache_miss_reason"] is None + + @pytest.mark.parametrize( ("owner_admitted", "expected_calls", "expected_scope"), [