@ngrok/mantle 0.81.0 → 0.81.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion.d.ts +6 -6
- package/dist/agent.json +1 -1
- package/dist/alert.d.ts +162 -60
- package/dist/alert.js +1 -1
- package/dist/area-chart.d.ts +4 -3
- package/dist/area-chart.js +1 -1
- package/dist/bar-chart.d.ts +4 -3
- package/dist/bar-chart.js +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar.js +1 -1
- package/dist/{chart-BcOC6Qj0.d.ts → chart-1cVjAcj8.d.ts} +81 -22
- package/dist/chart-Do2qkrxl.js +2 -0
- package/dist/checkbox.d.ts +12 -0
- package/dist/code-block.d.ts +46 -0
- package/dist/command.d.ts +67 -9
- package/dist/data-table.d.ts +1 -1
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +36 -16
- package/dist/dropdown-menu-BbbQuae2.d.ts +1 -0
- package/dist/{dropdown-menu-DZg-Cd69.d.ts → dropdown-menu-D6pMAY7I.d.ts} +138 -0
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/field.d.ts +12 -9
- package/dist/flag.d.ts +1 -1
- package/dist/icons.d.ts +52 -1
- package/dist/line-chart.d.ts +4 -3
- package/dist/line-chart.js +1 -1
- package/dist/llms.txt +1 -1
- package/dist/media-object.d.ts +42 -0
- package/dist/pagination.d.ts +6 -7
- package/dist/pagination.js +1 -1
- package/dist/radio-group.d.ts +119 -0
- package/dist/sandboxed-on-click.d.ts +2 -2
- package/dist/scatter-plot.d.ts +2 -2
- package/dist/scatter-plot.js +1 -1
- package/dist/sheet.d.ts +10 -10
- package/dist/split-button.d.ts +147 -8
- package/dist/split-button.js +1 -1
- package/dist/{table-Bo0vNxIJ.d.ts → table-CZBYEmyK.d.ts} +2 -2
- package/dist/table.d.ts +1 -1
- package/dist/text-area.d.ts +1 -1
- package/dist/{theme-CYNpplwN.d.ts → theme-FbfjYiD3.d.ts} +16 -0
- package/dist/theme-switcher.d.ts +2 -2
- package/dist/theme.d.ts +42 -2
- package/dist/toast.d.ts +4 -0
- package/dist/types.js +1 -1
- package/package.json +14 -14
- package/dist/chart-BROa2gqt.js +0 -2
- package/dist/dropdown-menu-Dw-OtXPm.d.ts +0 -1
package/dist/theme.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { a as isResolvedTheme, c as themes, i as Theme, n as $theme, o as isTheme, r as ResolvedTheme, s as resolvedThemes, t as $resolvedTheme } from "./theme-
|
|
1
|
+
import { a as isResolvedTheme, c as themes, i as Theme, n as $theme, o as isTheme, r as ResolvedTheme, s as resolvedThemes, t as $resolvedTheme } from "./theme-FbfjYiD3.js";
|
|
2
2
|
import { PropsWithChildren } from "react";
|
|
3
3
|
//#region src/components/theme/mantle-style-sheets.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Browser-accessible URLs for mantle's three lazy-loaded theme stylesheets.
|
|
6
6
|
*
|
|
7
7
|
* Use {@link mantleStyleSheetUrls} to create this object from Vite `?url` imports.
|
|
8
|
+
*
|
|
9
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
8
10
|
*/
|
|
9
11
|
type MantleThemeCssUrls = {
|
|
10
12
|
/**
|
|
@@ -51,8 +53,16 @@ type MantleThemeCssUrls = {
|
|
|
51
53
|
* // In JSX:
|
|
52
54
|
* <MantleStyleSheets {...themeUrls} nonce={nonce} ssrCookie={ssrCookie} />
|
|
53
55
|
* ```
|
|
56
|
+
*
|
|
57
|
+
* @see https://mantle.ngrok.com/components/primitives/theme#mantlestylesheeturls
|
|
54
58
|
*/
|
|
55
59
|
declare function mantleStyleSheetUrls(urls: MantleThemeCssUrls): MantleThemeCssUrls;
|
|
60
|
+
/**
|
|
61
|
+
* Props for {@link MantleStyleSheets} — the three theme stylesheet URLs plus optional
|
|
62
|
+
* `forceTheme`, `ssrCookie`, and `nonce`.
|
|
63
|
+
*
|
|
64
|
+
* @see https://mantle.ngrok.com/components/primitives/theme#mantlestylesheets
|
|
65
|
+
*/
|
|
56
66
|
type MantleStyleSheetsProps = MantleThemeCssUrls & {
|
|
57
67
|
/**
|
|
58
68
|
* Force a specific resolved theme's stylesheet to load unconditionally (`media="all"`),
|
|
@@ -105,6 +115,8 @@ type MantleStyleSheetsProps = MantleThemeCssUrls & {
|
|
|
105
115
|
* Use this when you need to inline the script directly into SSR HTML outside of a React
|
|
106
116
|
* context — for example, in a legacy Go service that renders the initial HTML response.
|
|
107
117
|
*
|
|
118
|
+
* @see https://mantle.ngrok.com/components/primitives/theme#fixmediascriptcontent
|
|
119
|
+
*
|
|
108
120
|
* @example
|
|
109
121
|
* ```go
|
|
110
122
|
* // In a Go template, inline script content that was pre-generated by mantle
|
|
@@ -138,6 +150,8 @@ declare function fixMediaScriptContent(forceTheme?: ResolvedTheme): string;
|
|
|
138
150
|
* When `forceTheme` is set, only the link tag for that theme is rendered — the others are
|
|
139
151
|
* omitted entirely to avoid unnecessary network requests.
|
|
140
152
|
*
|
|
153
|
+
* @see https://mantle.ngrok.com/components/primitives/theme#mantlestylesheets
|
|
154
|
+
*
|
|
141
155
|
* @example
|
|
142
156
|
* ```tsx
|
|
143
157
|
* // root.tsx
|
|
@@ -169,7 +183,7 @@ type ThemeProviderProps = PropsWithChildren;
|
|
|
169
183
|
*
|
|
170
184
|
* @example
|
|
171
185
|
* ```tsx
|
|
172
|
-
* <ThemeProvider
|
|
186
|
+
* <ThemeProvider>
|
|
173
187
|
* <App />
|
|
174
188
|
* </ThemeProvider>
|
|
175
189
|
* ```
|
|
@@ -178,11 +192,15 @@ declare function ThemeProvider({ children }: ThemeProviderProps): import("react"
|
|
|
178
192
|
/**
|
|
179
193
|
* useTheme returns the current theme and a function to set the theme.
|
|
180
194
|
*
|
|
195
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
196
|
+
*
|
|
181
197
|
* @note This function will throw an error if used outside of a ThemeProvider context tree.
|
|
182
198
|
*/
|
|
183
199
|
declare function useTheme(): ThemeProviderState;
|
|
184
200
|
/**
|
|
185
201
|
* Read the theme and applied theme from the `<html>` element.
|
|
202
|
+
*
|
|
203
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
186
204
|
*/
|
|
187
205
|
declare function readThemeFromHtmlElement(): {
|
|
188
206
|
appliedTheme: "dark" | "dark-high-contrast" | "light" | "light-high-contrast" | undefined;
|
|
@@ -191,12 +209,16 @@ declare function readThemeFromHtmlElement(): {
|
|
|
191
209
|
/**
|
|
192
210
|
* If the theme is "system", it will resolve the theme based on the user's media query preferences, otherwise it will return the theme as is.
|
|
193
211
|
* This will mirror the result that gets applied to the <html> element.
|
|
212
|
+
*
|
|
213
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
194
214
|
*/
|
|
195
215
|
declare function useAppliedTheme(): "dark" | "dark-high-contrast" | "light" | "light-high-contrast";
|
|
196
216
|
/**
|
|
197
217
|
* preventWrongThemeFlashScriptContent generates a script that prevents the wrong theme from flashing on initial page load.
|
|
198
218
|
* It checks cookies for a stored theme, and if none is found, it sets the default theme.
|
|
199
219
|
* It also applies the correct theme to the `<html>` element based on the user's media query preferences.
|
|
220
|
+
*
|
|
221
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
200
222
|
*/
|
|
201
223
|
declare function preventWrongThemeFlashScriptContent(): string;
|
|
202
224
|
type PreventWrongThemeFlashScriptProps = {
|
|
@@ -220,6 +242,8 @@ type PreventWrongThemeFlashScriptProps = {
|
|
|
220
242
|
*
|
|
221
243
|
* Place this as early as possible in the `<head>`.
|
|
222
244
|
*
|
|
245
|
+
* @see https://mantle.ngrok.com/components/primitives/theme#preventwrongthemeflashscript
|
|
246
|
+
*
|
|
223
247
|
* @example
|
|
224
248
|
* ```tsx
|
|
225
249
|
* // entry.server.tsx — send font preloads as HTTP headers (preferred for SSR)
|
|
@@ -258,6 +282,8 @@ type UseInitialHtmlThemePropsOptions = {
|
|
|
258
282
|
};
|
|
259
283
|
/**
|
|
260
284
|
* useInitialHtmlThemeProps returns the initial props that should be applied to the <html> element to prevent react hydration errors.
|
|
285
|
+
*
|
|
286
|
+
* @see https://mantle.ngrok.com/components/primitives/theme#useinitialhtmlthemeprops
|
|
261
287
|
*/
|
|
262
288
|
declare function useInitialHtmlThemeProps(props?: UseInitialHtmlThemePropsOptions): InitialThemeProps;
|
|
263
289
|
type GetStoredThemeOptions = {
|
|
@@ -274,6 +300,8 @@ type GetStoredThemeOptions = {
|
|
|
274
300
|
* {@link DEFAULT_THEME}. This function never throws; malformed encodings or
|
|
275
301
|
* missing cookies quietly return the default.
|
|
276
302
|
*
|
|
303
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
304
|
+
*
|
|
277
305
|
* @example
|
|
278
306
|
* getStoredTheme({ cookie: `${THEME_STORAGE_KEY}=dark; session=abc` }) // "dark"
|
|
279
307
|
* @example
|
|
@@ -287,6 +315,8 @@ declare function getStoredTheme({ cookie }: GetStoredThemeOptions): Theme;
|
|
|
287
315
|
* {@link useInitialHtmlThemeProps} without exposing the full `Cookie` header
|
|
288
316
|
* (which may contain HttpOnly/session cookies) in serialized loader data.
|
|
289
317
|
*
|
|
318
|
+
* @see https://mantle.ngrok.com/components/primitives/theme#extractthemecookie
|
|
319
|
+
*
|
|
290
320
|
* @example
|
|
291
321
|
* ```ts
|
|
292
322
|
* // app/root.tsx loader
|
|
@@ -310,12 +340,16 @@ declare function extractThemeCookie(cookieHeader: string | null | undefined): st
|
|
|
310
340
|
* The origin for the assets CDN where custom ngrok fonts and assets are hosted.
|
|
311
341
|
*
|
|
312
342
|
* Keep this stable across the app so we can preconnect/DNS-prefetch consistently.
|
|
343
|
+
*
|
|
344
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
313
345
|
* @public
|
|
314
346
|
*/
|
|
315
347
|
declare const assetsCdnOrigin = "https://assets.ngrok.com";
|
|
316
348
|
declare const coreFontNames: readonly ["roobert", "jetbrains-mono", "jetbrains-mono-italic", "family-regular", "family-italic"];
|
|
317
349
|
/**
|
|
318
350
|
* Named keys identifying each individual core font.
|
|
351
|
+
*
|
|
352
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
319
353
|
* @public
|
|
320
354
|
*/
|
|
321
355
|
type CoreFontName = (typeof coreFontNames)[number];
|
|
@@ -323,6 +357,8 @@ type FontPath = `/${string}` | (string & {});
|
|
|
323
357
|
/**
|
|
324
358
|
* Builds an absolute CDN URL for a given font.
|
|
325
359
|
*
|
|
360
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
361
|
+
*
|
|
326
362
|
* @returns {`https://assets.ngrok.com/fonts${T}`} An absolute, literal-typed CDN URL.
|
|
327
363
|
*
|
|
328
364
|
* @example
|
|
@@ -354,6 +390,8 @@ type PreloadFontProps = {
|
|
|
354
390
|
* addition to) an HTML `<link>` element. Sending this as a `Link` header lets
|
|
355
391
|
* the browser start the font fetch before it has parsed any HTML.
|
|
356
392
|
*
|
|
393
|
+
* @see https://mantle.ngrok.com/components/primitives/theme#preloadfontlink
|
|
394
|
+
*
|
|
357
395
|
* @remarks
|
|
358
396
|
* For best performance, also send a `preconnect` hint to {@link assetsCdnOrigin}
|
|
359
397
|
* in the same `Link` header.
|
|
@@ -378,6 +416,8 @@ declare function preloadFontLink(name: CoreFontName): string;
|
|
|
378
416
|
* Use this when you only need one or two specific fonts rather than all core
|
|
379
417
|
* fonts. Include it as early as possible in the document `<head>`.
|
|
380
418
|
*
|
|
419
|
+
* @see https://mantle.ngrok.com/components/primitives/theme#preloadfont
|
|
420
|
+
*
|
|
381
421
|
* @remarks
|
|
382
422
|
* For best performance, pair this with preconnect/dns-prefetch hints to the CDN.
|
|
383
423
|
*
|
package/dist/toast.d.ts
CHANGED
|
@@ -112,6 +112,7 @@ type ToastIconProps = Partial<SvgOnlyProps>;
|
|
|
112
112
|
* <Toast.Root intent="warning">
|
|
113
113
|
* <Toast.Icon />
|
|
114
114
|
* <Toast.Message>Warning message</Toast.Message>
|
|
115
|
+
* <Toast.Action>Dismiss</Toast.Action>
|
|
115
116
|
* </Toast.Root>
|
|
116
117
|
* ```
|
|
117
118
|
*/
|
|
@@ -144,6 +145,7 @@ type ToastMessageProps = ComponentProps<"p"> & WithAsChild;
|
|
|
144
145
|
* <Toast.Root intent="success">
|
|
145
146
|
* <Toast.Icon />
|
|
146
147
|
* <Toast.Message>Your changes have been saved</Toast.Message>
|
|
148
|
+
* <Toast.Action>Undo</Toast.Action>
|
|
147
149
|
* </Toast.Root>
|
|
148
150
|
* ```
|
|
149
151
|
*/
|
|
@@ -215,6 +217,7 @@ declare const Toast: {
|
|
|
215
217
|
* <Toast.Root intent="warning">
|
|
216
218
|
* <Toast.Icon />
|
|
217
219
|
* <Toast.Message>Warning message</Toast.Message>
|
|
220
|
+
* <Toast.Action>Dismiss</Toast.Action>
|
|
218
221
|
* </Toast.Root>
|
|
219
222
|
* ```
|
|
220
223
|
*/
|
|
@@ -229,6 +232,7 @@ declare const Toast: {
|
|
|
229
232
|
* <Toast.Root intent="success">
|
|
230
233
|
* <Toast.Icon />
|
|
231
234
|
* <Toast.Message>Your changes have been saved</Toast.Message>
|
|
235
|
+
* <Toast.Action>Undo</Toast.Action>
|
|
232
236
|
* </Toast.Root>
|
|
233
237
|
* ```
|
|
234
238
|
*/
|
package/dist/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./
|
|
1
|
+
import{t as e}from"./types-D85fCNV3.js";import{t}from"./booleanish-BfvnW6vy.js";export{e as $cssProperties,t as parseBooleanish};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngrok/mantle",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.1",
|
|
4
4
|
"description": "mantle is ngrok's UI library and design system.",
|
|
5
5
|
"homepage": "https://mantle.ngrok.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -94,8 +94,8 @@
|
|
|
94
94
|
"./selectable-list": "./dist/selectable-list.js",
|
|
95
95
|
"./separator": "./dist/separator.js",
|
|
96
96
|
"./sheet": "./dist/sheet.js",
|
|
97
|
-
"./skip-to-main-link": "./dist/skip-to-main-link.js",
|
|
98
97
|
"./skeleton": "./dist/skeleton.js",
|
|
98
|
+
"./skip-to-main-link": "./dist/skip-to-main-link.js",
|
|
99
99
|
"./slider": "./dist/slider.js",
|
|
100
100
|
"./slot": "./dist/slot.js",
|
|
101
101
|
"./split-button": "./dist/split-button.js",
|
|
@@ -114,19 +114,19 @@
|
|
|
114
114
|
"dependencies": {
|
|
115
115
|
"@ariakit/react": "0.4.34",
|
|
116
116
|
"@headlessui/react": "2.2.10",
|
|
117
|
-
"@radix-ui/react-dialog": "1.1.
|
|
118
|
-
"@radix-ui/react-dropdown-menu": "2.1.
|
|
119
|
-
"@radix-ui/react-hover-card": "1.1.
|
|
120
|
-
"@radix-ui/react-popover": "1.1.
|
|
121
|
-
"@radix-ui/react-progress": "1.1.
|
|
122
|
-
"@radix-ui/react-select": "2.3.
|
|
123
|
-
"@radix-ui/react-slider": "1.4.
|
|
124
|
-
"@radix-ui/react-slot": "1.3.
|
|
125
|
-
"@radix-ui/react-switch": "1.3.
|
|
126
|
-
"@radix-ui/react-tabs": "1.1.
|
|
127
|
-
"@radix-ui/react-tooltip": "1.2.
|
|
117
|
+
"@radix-ui/react-dialog": "1.1.21",
|
|
118
|
+
"@radix-ui/react-dropdown-menu": "2.1.22",
|
|
119
|
+
"@radix-ui/react-hover-card": "1.1.21",
|
|
120
|
+
"@radix-ui/react-popover": "1.1.21",
|
|
121
|
+
"@radix-ui/react-progress": "1.1.14",
|
|
122
|
+
"@radix-ui/react-select": "2.3.5",
|
|
123
|
+
"@radix-ui/react-slider": "1.4.5",
|
|
124
|
+
"@radix-ui/react-slot": "1.3.1",
|
|
125
|
+
"@radix-ui/react-switch": "1.3.5",
|
|
126
|
+
"@radix-ui/react-tabs": "1.1.19",
|
|
127
|
+
"@radix-ui/react-tooltip": "1.2.14",
|
|
128
128
|
"@tanstack/react-table": "8.21.3",
|
|
129
|
-
"@tanstack/react-virtual": "3.14.
|
|
129
|
+
"@tanstack/react-virtual": "3.14.8",
|
|
130
130
|
"class-variance-authority": "0.7.1",
|
|
131
131
|
"cmdk": "1.1.1",
|
|
132
132
|
"d3-scale": "4.0.2",
|
package/dist/chart-BROa2gqt.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./compose-refs-BdBMM9ga.js";import{t}from"./cx-IiQEAKf5.js";import{n}from"./slot-CDk0Bb9z.js";import{t as r}from"./button-BAno7KIU.js";import{t as i}from"./use-copy-to-clipboard-DqQ0_N3E.js";import{createContext as a,useContext as o,useEffect as s,useId as c,useLayoutEffect as l,useMemo as u,useRef as d,useState as f,useSyncExternalStore as p}from"react";import m from"tiny-invariant";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{CheckIcon as v}from"@phosphor-icons/react/Check";import{CopyIcon as y}from"@phosphor-icons/react/Copy";import{scaleTime as b}from"d3-scale";import{area as x,curveLinear as S,curveMonotoneX as C,curveStep as w,line as T}from"d3-shape";const E=(e,t)=>Reflect.get(e,t),D=[`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`,`chart-6`,`chart-7`,`chart-8`,`chart-other`],O=e=>D.includes(e),k=e=>`--color-${e}`,A=[`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`,`chart-6`,`chart-7`,`chart-8`],j=e=>{let t=e.toLowerCase();return t.includes(`var(`)||t.includes(`currentcolor`)},M=(e,t)=>{let n=e.ownerDocument,r=n.createElement(`span`);r.style.display=`none`,r.style.color=t,e.appendChild(r);let i=n.defaultView?.getComputedStyle(r).color??``;return r.remove(),i},ee=(e,t)=>O(t)?M(e,`var(${k(t)})`):j(t)?M(e,t):t,te=e=>({grid:M(e,`var(--border-color-card-muted)`),baseline:M(e,`var(--border-color-card)`),tickText:M(e,`var(--text-color-muted)`),reference:M(e,`var(--color-neutral-500)`),surface:M(e,`var(--background-color-card)`)}),N=e=>`${e.className}|${e.getAttribute(`data-applied-theme`)??``}|${e.getAttribute(`data-theme`)??``}`,P=(e,t)=>{let n=new MutationObserver(t);return n.observe(e,{attributes:!0,attributeFilter:[`class`,`data-applied-theme`,`data-theme`]}),()=>n.disconnect()},F=1.5,I=1.6,ne=e=>`oklch(from ${e} calc(l - 0.18) c h)`,L=(e,t,n)=>{let r=F;if(n===`up`){e.moveTo(-1.5,t+r),e.lineTo(t+r,-1.5),e.moveTo(-1.5,r),e.lineTo(r,-1.5),e.moveTo(t-r,t+r),e.lineTo(t+r,t-r);return}e.moveTo(-1.5,-1.5),e.lineTo(t+r,t+r),e.moveTo(t-r,-1.5),e.lineTo(t+r,r),e.moveTo(-1.5,t-r),e.lineTo(r,t+r)},re=(e,t)=>{let{texture:n,color:r,ink:i,devicePixelRatio:a,orientation:o}=t,s=e.canvas.ownerDocument.createElement(`canvas`);s.width=Math.max(1,Math.round(8*a)),s.height=s.width;let c=s.getContext(`2d`);if(c==null)return null;let l=s.width/8;c.scale(l,l),c.fillStyle=r,c.fillRect(0,0,8,8),n===`perpendicular`?(c.fillStyle=i,o===`horizontal`?c.fillRect(8/2-2/2,0,2,8):c.fillRect(0,8/2-2/2,8,2)):n===`dots`?(c.fillStyle=i,c.beginPath(),c.arc(8/4,8/4,I,0,Math.PI*2),c.moveTo(7.6,24/4),c.arc(24/4,24/4,I,0,Math.PI*2),c.fill()):(c.strokeStyle=i,c.lineWidth=n===`crosshatch`?1:F,c.beginPath(),(n===`hatch`||n===`crosshatch`)&&L(c,8,`up`),(n===`hatch-reverse`||n===`crosshatch`)&&L(c,8,`down`),c.stroke());let u=e.createPattern(s,`repeat`);return u?.setTransform({a:1/l,b:0,c:0,d:1/l,e:0,f:0}),u},R=e=>{let{pointCount:t,columnCount:n,wasDecimated:r}=e;return n<=0?!1:r?t>=n*3:t>=n*4},ie=e=>{let{xs:t,values:n,startIndex:r,endIndex:i,positionK:a,positionB:o,columnCount:s}=e,c=new Uint8Array(s),l=new Float64Array(s),u=new Float64Array(s),d=new Float64Array(s),f=new Float64Array(s);for(let e=r;e<=i;e++){let r=n[e]??NaN;if(Number.isNaN(r))continue;let i=t[e]??NaN,p=Math.floor(i*a+o);if(p===s&&(p=s-1),!(p<0||p>=s)){if(c[p]===0){c[p]=1,l[p]=r,u[p]=r,d[p]=r,f[p]=r;continue}r<(l[p]??1/0)&&(l[p]=r),r>(u[p]??-1/0)&&(u[p]=r),f[p]=r}}return{columnCount:s,hasData:c,minValue:l,maxValue:u,inValue:d,outValue:f}},ae=new Intl.NumberFormat,oe=new Intl.NumberFormat(void 0,{maximumSignificantDigits:4}),z=new Map,B=(e,t)=>{let n=Object.is(e,-0)?0:e,r=t?.maximumFractionDigits;if(r!=null){let e=z.get(r);return e??(e=new Intl.NumberFormat(void 0,{maximumFractionDigits:r}),z.set(r,e)),e.format(n)}return n!==0&&Math.abs(n)<1?oe.format(n):ae.format(n)},V=e=>!Number.isFinite(e)||e<=0?0:Math.min(20,Math.max(0,-Math.floor(Math.log10(e)))),se=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}),H=new Intl.DateTimeFormat(void 0,{year:`numeric`,month:`short`,day:`numeric`}),ce=e=>e.getHours()!==0||e.getMinutes()!==0||e.getSeconds()!==0||e.getMilliseconds()!==0,U=(e,t)=>typeof e==`string`?e:typeof e==`number`?B(e):Number.isNaN(e.getTime())?`—`:t?.datasetHasTimeOfDay??ce(e)?se.format(e):H.format(e),le=(e,t,n)=>{if(t<=0)return null;let r=0,i=t-1,a=e[0]??0,o=e[i]??0;if(n<=a)return 0;if(n>=o)return i;for(;i-r>1;){let t=r+i>>1;(e[t]??0)<=n?r=t:i=t}let s=n-(e[r]??0);return(e[i]??0)-n<s?i:r},ue=Math.PI/2-.05,de=e=>({cosYaw:Math.cos(e.yaw),sinYaw:Math.sin(e.yaw),cosPitch:Math.cos(e.pitch),sinPitch:Math.sin(e.pitch)}),fe=(e,t,n,r)=>{let i=e*r.cosYaw+n*r.sinYaw,a=-e*r.sinYaw+n*r.cosYaw,o=t*r.cosPitch-a*r.sinPitch,s=t*r.sinPitch+a*r.cosPitch,c=4/(4+s);return{x:i*c,y:o*c,depth:s,scale:c}},pe=e=>Math.min(ue,Math.max(-ue,e)),me=(e,t)=>{let n=t[1]-t[0];return n===0?0:(e-t[0])/n*2-1},he=[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1],[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],ge=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[1,5],[2,6],[3,7]],_e=Math.sqrt(50),ve=Math.sqrt(10),ye=Math.sqrt(2),W=(e,t,n)=>{let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=_e?10:a>=ve?5:a>=ye?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&(s+=1),c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&(s+=1),c*l>t&&--c),c<s&&.5<=n&&n<2?W(e,t,n*2):[s,c,l]},be=(e,t,n)=>{if(!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?W(t,e,n):W(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=[];for(let e=0;e<s;e+=1){let t=r?a-e:i+e;c.push(o<0?t/-o:t*o)}return c},xe=(e,t,n)=>W(e,t,n)[2],G=(e,t)=>{let n=e[1]-e[0];if(n===0)return{k:0,b:(t[0]+t[1])/2};let r=(t[1]-t[0])/n;return{k:r,b:t[0]-e[0]*r}},Se=e=>{let{count:t,rangeStart:n,rangeEnd:r,paddingInner:i,paddingOuter:a}=e,o=r-n;if(t<=0||o<=0)return{count:Math.max(0,t),rangeStart:n,step:0,bandwidth:0,offset:0};let s=o/Math.max(1,t-i+a*2);return{count:t,rangeStart:n,step:s,bandwidth:s*(1-i),offset:s*a}},K=(e,t)=>e.rangeStart+e.offset+t*e.step,q=(e,t)=>K(e,t)+e.bandwidth/2,Ce=(e,t)=>{if(e.count===0||e.step===0)return null;let n=Math.floor((t-e.rangeStart-e.offset+e.step/2-e.bandwidth/2)/e.step);return Math.min(e.count-1,Math.max(0,n))},we=(e,t)=>be(e[0],e[1],t);let J=null,Te=null;const Ee=e=>{if(Te!=null&&J!=null&&J[0]===e[0]&&J[1]===e[1])return Te;let t=b().domain([new Date(e[0]),new Date(e[1])]);return J=[e[0],e[1]],Te=t,t},De=(e,t)=>Ee(e).ticks(t).map(e=>e.getTime()),Oe=e=>{let t=Ee(e).tickFormat();return e=>t(new Date(e))},Y=(e,t)=>{if(e[0]>e[1])return Y([e[1],e[0]],t);if(e[0]===e[1]){let n=e[0],r=n===0?1:Math.abs(n)*.5;return Y([n-r,n+r],t)}let n=e[0],r=e[1],i=NaN;for(let e=0;e<10;e++){let e=xe(n,r,t);if(e===i||e===0||!Number.isFinite(e))break;if(e>0)n=Math.floor(n/e)*e,r=Math.ceil(r/e)*e;else{let t=-e;n=Math.floor(n*t)/t,r=Math.ceil(r*t)/t}i=e}return[n,r]},ke=e=>e===`monotone`?C:e===`step`?w:S,X=e=>Math.round(e)+.5,Ae=(e,t)=>{let{plot:n,color:r,xLines:i,yLines:a}=t;e.save(),e.strokeStyle=r,e.lineWidth=1;for(let t of i)e.globalAlpha=t.alpha,e.beginPath(),e.moveTo(X(t.position),n.top),e.lineTo(X(t.position),n.top+n.height),e.stroke();for(let t of a)e.globalAlpha=t.alpha,e.beginPath(),e.moveTo(n.left,X(t.position)),e.lineTo(n.left+n.width,X(t.position)),e.stroke();e.restore()},je=(e,t)=>{let{plot:n,color:r,y:i}=t;e.strokeStyle=r,e.lineWidth=1,e.beginPath(),e.moveTo(n.left,X(i)),e.lineTo(n.left+n.width,X(i)),e.stroke()},Me=(e,t)=>{let{plot:n,color:r,x:i}=t;e.strokeStyle=r,e.lineWidth=1,e.beginPath(),e.moveTo(X(i),n.top),e.lineTo(X(i),n.top+n.height),e.stroke()},Ne=(e,t)=>{let{fill:n,rects:r}=t;e.fillStyle=n,e.beginPath();for(let t of r){let n=Math.max(.5,t.width),r=Math.min(t.valueY,t.baselineY),i=Math.abs(t.baselineY-t.valueY);if(i===0)continue;let a=t.rounded&&n>=8?Math.min(4,n/2,i):0;if(a===0){e.rect(t.x,r,n,i);continue}t.valueY<=t.baselineY?e.roundRect(t.x,r,n,i,[a,a,0,0]):e.roundRect(t.x,r,n,i,[0,0,a,a])}e.fill()},Pe=(e,t)=>{let{fill:n,rects:r}=t;e.fillStyle=n,e.beginPath();for(let t of r){let n=Math.max(.5,t.height),r=Math.min(t.valueX,t.baselineX),i=Math.abs(t.valueX-t.baselineX);if(i===0)continue;let a=t.rounded&&n>=8?Math.min(4,n/2,i):0;if(a===0){e.rect(r,t.y,i,n);continue}t.valueX>=t.baselineX?e.roundRect(r,t.y,i,n,[0,a,a,0]):e.roundRect(r,t.y,i,n,[a,0,0,a])}e.fill()},Fe=(e,t)=>{let{color:n,curve:r,indexes:i,xAt:a,yAt:o,definedAt:s}=t,c=T().x(a).y(o).defined(s).curve(ke(r)).context(e);e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath(),c(i),e.stroke()},Ie=(e,t)=>{let{color:n,curve:r,indexes:i,xAt:a,y0At:o,y1At:s,definedAt:c}=t,l=x().x(a).y0(o).y1(s).defined(c).curve(ke(r)).context(e);e.beginPath(),l(i),e.save(),e.globalAlpha=.1,e.fillStyle=n,e.fill(),e.restore();let u=T().x(a).y(s).defined(c).curve(ke(r)).context(e);e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath(),u(i),e.stroke()},Le=(e,t)=>{let{color:n,columns:r,columnToX:i,valueK:a,valueB:o}=t;e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath();let s=!1;for(let t=0;t<r.columnCount;t++){if(r.hasData[t]===0){s=!1;continue}let n=i(t),c=(r.inValue[t]??0)*a+o,l=(r.minValue[t]??0)*a+o,u=(r.maxValue[t]??0)*a+o,d=(r.outValue[t]??0)*a+o;s?e.lineTo(n,c):(e.moveTo(n,c),s=!0),(l!==c||u!==c)&&(e.lineTo(n,l),e.lineTo(n,u)),d!==u&&e.lineTo(n,d)}e.stroke()},Re=(e,t)=>{let{color:n,lowerColumns:r,upperColumns:i,columnToX:a,valueK:o,valueB:s}=t;e.beginPath();let c=-1,l=t=>{if(c<0)return;let n=!1;for(let r=c;r<=t;r++){let t=a(r),c=(i.maxValue[r]??0)*o+s;n?e.lineTo(t,c):(e.moveTo(t,c),n=!0)}for(let n=t;n>=c;n--){let t=a(n),i=(r.minValue[n]??0)*o+s;e.lineTo(t,i)}e.closePath(),c=-1};for(let e=0;e<i.columnCount;e++){if(i.hasData[e]===0){l(e-1);continue}c<0&&(c=e)}l(i.columnCount-1),e.save(),e.globalAlpha=.1,e.fillStyle=n,e.fill(),e.restore(),Le(e,{color:n,columns:i,columnToX:a,valueK:o,valueB:s})},ze=(e,t,n,r,i)=>{if(i===`square`){let i=r*.886;e.moveTo(t-i,n-i),e.lineTo(t+i,n-i),e.lineTo(t+i,n+i),e.lineTo(t-i,n+i),e.closePath();return}if(i===`triangle`){let i=r*1.55;e.moveTo(t,n-i),e.lineTo(t+i*.866,n+i*.5),e.lineTo(t-i*.866,n+i*.5),e.closePath();return}if(i===`diamond`){let i=r*1.253;e.moveTo(t,n-i),e.lineTo(t+i,n),e.lineTo(t,n+i),e.lineTo(t-i,n),e.closePath();return}e.arc(t,n,r,0,Math.PI*2)},Be=(e,t)=>{let{color:n,surface:r,shape:i,indexes:a,xAt:o,yAt:s,definedAt:c}=t;e.fillStyle=n,e.strokeStyle=r,e.lineWidth=2;for(let t of a)c(t)&&(e.beginPath(),ze(e,o(t),s(t),4,i),e.fill(),e.stroke())},Ve=5e3,He=2e4,Ue=(e,t)=>{let{color:n,surface:r,shape:i,totalPointCount:a,indexes:o,xAt:s,yAt:c,radiusAt:l}=t;if(e.fillStyle=n,a>He){e.beginPath();for(let t of o)l(t)<=0||e.rect(s(t)-1,c(t)-1,2,2);e.fill();return}let u=a<=Ve;e.strokeStyle=r,e.lineWidth=2;for(let t of o){let n=l(t);n<=0||(e.beginPath(),ze(e,s(t),c(t),n,i),e.fill(),u&&e.stroke())}},We=(e,t)=>{let{count:n,order:r,screenX:i,screenY:a,radius:o,colorAt:s,shapeAt:c,alphaAt:l,surface:u}=t;if(e.save(),n>He){let t=``,n=-1;for(let c of r){let r=s(c);r!==t&&(e.fillStyle=r,t=r);let u=l(c);u!==n&&(e.globalAlpha=u,n=u);let d=Math.max(1,(o[c]??0)/2);e.fillRect((i[c]??0)-d/2,(a[c]??0)-d/2,d,d)}e.restore();return}let d=n<=Ve;e.strokeStyle=u,e.lineWidth=2;let f=``,p=-1;for(let t of r){let n=s(t);n!==f&&(e.fillStyle=n,f=n);let r=l(t);r!==p&&(e.globalAlpha=r,p=r),e.beginPath(),ze(e,i[t]??0,a[t]??0,o[t]??0,c(t)),e.fill(),d&&e.stroke()}e.restore()},Ge=(e,t)=>{let{gridColor:n,axisColor:r,corners:i,edges:a,cubeAlpha:o,axes:s}=t;if(e.save(),o>.01){e.globalAlpha=o,e.strokeStyle=n,e.lineWidth=1,e.beginPath();for(let[t,n]of a){let r=i[t],a=i[n];r!=null&&a!=null&&(e.moveTo(r.x,r.y),e.lineTo(a.x,a.y))}e.stroke()}e.strokeStyle=r;for(let{alpha:t,from:n,to:r}of s)t<=.01||(e.globalAlpha=t,e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(r.x,r.y),e.stroke());e.restore()},Ke=(e,t)=>{let{textColor:n,fontFamily:r,plot:i,center:a,axes:o}=t;e.save(),e.fillStyle=n,e.font=`11px ${r}`,e.textAlign=`center`,e.textBaseline=`middle`;for(let{label:t,alpha:n,from:r,to:s}of o){if(n<=.01)continue;let o=Math.hypot(r.x-a.x,r.y-a.y),c=Math.hypot(s.x-a.x,s.y-a.y),l=c>=o?s:r,u=c>=o?r:s,d=Math.max(1,Math.hypot(l.x-u.x,l.y-u.y)),f=(l.x-u.x)/d*16,p=(l.y-u.y)/d*16,m=Math.min(i.left+i.width-8,Math.max(i.left+8,l.x+f)),h=Math.min(i.top+i.height-6,Math.max(i.top+6,l.y+p));e.globalAlpha=n,e.fillText(t,m,h)}e.restore()},qe=(e,t)=>{let{plot:n,color:r,textColor:i,y:a,label:o,fontFamily:s}=t;e.strokeStyle=r,e.lineWidth=1,e.setLineDash([4,4]),e.beginPath(),e.moveTo(n.left,X(a)),e.lineTo(n.left+n.width,X(a)),e.stroke(),e.setLineDash([]),o!=null&&o.length>0&&(e.font=`11px ${s}`,e.fillStyle=i,e.textAlign=`right`,e.textBaseline=`bottom`,e.fillText(o,n.left+n.width-4,a-3))},Je=(e,t)=>{let{plot:n,color:r,textColor:i,x:a,label:o,fontFamily:s}=t;if(e.strokeStyle=r,e.lineWidth=1,e.setLineDash([4,4]),e.beginPath(),e.moveTo(X(a),n.top),e.lineTo(X(a),n.top+n.height),e.stroke(),e.setLineDash([]),o!=null&&o.length>0){e.font=`11px ${s}`,e.fillStyle=i;let t=e.measureText(o).width,r=a+4+t<=n.left+n.width;e.textAlign=r?`left`:`right`,e.textBaseline=`top`,e.fillText(o,r?a+4:a-4,n.top+3)}},Ye=(e,t)=>{let{plot:n,color:r,fontFamily:i,xLabels:a,yLabels:o}=t;e.save(),e.font=`11px ${i}`,e.fillStyle=r,e.textAlign=`right`,e.textBaseline=`middle`;for(let t of o)e.globalAlpha=t.alpha,e.fillText(t.text,n.left-8,t.position);e.textAlign=`center`,e.textBaseline=`top`;for(let t of a)e.globalAlpha=t.alpha,e.fillText(t.text,t.position,n.top+n.height+8);e.restore()},Xe=e=>{let t=e.length,n=e[0]?.length??0,r=[],i=[];for(let e=0;e<t;e++)r.push(new Float64Array(n)),i.push(new Float64Array(n));let a=0,o=0,s=new Float64Array(n),c=new Float64Array(n);for(let l=0;l<t;l++){let t=e[l],u=r[l],d=i[l];if(t!=null&&u!=null&&d!=null)for(let e=0;e<n;e++){let n=t[e]??NaN;if(Number.isNaN(n)){u[e]=NaN,d[e]=NaN;continue}if(n>=0){let t=s[e]??0,r=t+n;s[e]=r,u[e]=t,d[e]=r,r>o&&(o=r)}else{let t=c[e]??0,r=t+n;c[e]=r,u[e]=r,d[e]=t,r<a&&(a=r)}}}return{lower:r,upper:i,min:a,max:o}},Ze=e=>1-(1-e)**3;var Qe=class{#e=new Float64Array;#t=new Float64Array;#n=new Float64Array;#r=0;#i=0;#a=!1;get active(){return this.#a}values(){return this.#n}retarget(e,t){let{duration:n,now:r}=t,i=e.length,a=this.#n.length!==i;if(a&&(this.#e=new Float64Array(i),this.#t=new Float64Array(i),this.#n=new Float64Array(i)),a||n<=0){for(let t=0;t<i;t++){let n=e[t]??NaN;this.#e[t]=n,this.#t[t]=n,this.#n[t]=n}this.#a=!1;return}let o=!1;for(let t=0;t<i;t++){let n=e[t]??NaN,r=this.#n[t]??NaN;if(r!==n&&!(Number.isNaN(r)&&Number.isNaN(n))){o=!0;break}}if(!o){for(let t=0;t<i;t++)this.#t[t]=e[t]??NaN;this.#a=!1;return}for(let t=0;t<i;t++)this.#e[t]=this.#n[t]??NaN,this.#t[t]=e[t]??NaN;this.#r=r,this.#i=n,this.#a=!0}snap(){this.#n.set(this.#t),this.#a=!1}tick(e){if(!this.#a)return!1;let t=Math.min(1,(e-this.#r)/this.#i),n=Ze(t);for(let e=0;e<this.#n.length;e++){let t=this.#e[e]??NaN,r=this.#t[e]??NaN;if(Number.isNaN(t)||Number.isNaN(r)){this.#n[e]=r;continue}this.#n[e]=t+(r-t)*n}return t>=1&&(this.#a=!1),this.#a}},Z=class{#e=new Float64Array;#t=new Float64Array;#n=0;#r=!1;#i;#a;#o=0;constructor(e={}){this.#i=e.speed??.14,this.#a=e.epsilon??.001}get active(){return this.#r}values(){return this.#t}jump(e){this.#t.length!==e.length&&(this.#e=new Float64Array(e.length),this.#t=new Float64Array(e.length));for(let t=0;t<e.length;t++){let n=e[t]??NaN;this.#e[t]=n,this.#t[t]=n}this.#r=!1}aim(e,t){if(this.#t.length!==e.length){this.jump(e);return}let n=!1;for(let t=0;t<e.length;t++){let r=e[t]??NaN,i=this.#e[t]??NaN;if(i!==r&&!(Number.isNaN(i)&&Number.isNaN(r))){n=!0;break}}if(!n)return;let r=0;for(let t=0;t<e.length;t++){let n=e[t]??NaN;this.#e[t]=n;let i=Math.abs(n-(this.#t[t]??NaN));Number.isFinite(i)&&i>r&&(r=i)}this.#o=r,this.#r||(this.#r=!0,this.#n=t)}tick(e){if(!this.#r)return!1;let t=Math.min(50,Math.max(0,e-this.#n));this.#n=e;let n=1-(1-this.#i)**(t/16.67),r=Math.max(this.#o*this.#a,2**-52),i=!0;for(let e=0;e<this.#t.length;e++){let t=this.#e[e]??NaN,a=this.#t[e]??NaN;if(Number.isNaN(t)||Number.isNaN(a)){this.#t[e]=t;continue}let o=a+(t-a)*n;n>0&&o===a||Math.abs(t-o)<=r?this.#t[e]=t:(this.#t[e]=o,i=!1)}return this.#r=!i,this.#r}};const $e=e=>`${e.colorInput}|${e.texture}`,et={bar:`BarChart.Bar`,line:`LineChart.Line`,area:`AreaChart.Area`,scatter:`ScatterPlot.Point`},tt=1e3;var nt=class{#e;#t;#n;#r={xKey:``,xScale:`linear`,yDomain:[`auto`,`auto`],orientation:`vertical`,zKey:null,dimensions:3,stacked:!1,animate:!0};#i={onDatumActivate:null,onActiveIndexChange:null};#a;#o=null;#s=null;#c=null;#l=null;#u=0;#d=0;#f=1;#p=[];#m=0;#h=new Float64Array;#g=[];#_=null;#v=null;#y=!1;#b=!1;#x=new Map;#S=0;#C=0;#w=null;#T=new Z({speed:.16});#E=new Z({speed:.2});#D=new Map;#O=new Map;#k=!1;#A=new Map;#j=new Map;#M=0;#N=!1;#P=new Map;#F={alpha:0,target:0};#I=0;#L=null;#R=null;#z=null;#B={left:0,top:0,width:0,height:0};#V=null;#H=new Float64Array;#U=[0,1];#W={yaw:.65,pitch:-.35};#G=new Z({speed:.12});#K=new Z({speed:.16});#q=null;#J=!1;#Y=null;#X=new Int32Array;#Z=new Map;#Q=``;#$=null;#ee=null;#te=null;#ne=void 0;#re=null;#ie=!1;#ae=null;#oe=null;#se={width:0,height:0};#ce=!1;#le=!1;#ue=0;#de=!1;constructor(e){this.#e=e.kind,this.#t=e.elements,this.#n=e.store,this.#a=e.elements.canvas.getContext(`2d`),this.#n.onSeriesChange=()=>{this.#b=!0,this.#Ce()},this.#n.onPresentationChange=()=>{this.#Ce()},typeof ResizeObserver<`u`&&(this.#o=new ResizeObserver(e=>{let t=e[0];t!=null&&(this.#u=t.contentRect.width,this.#d=t.contentRect.height,this.#f=this.#De(),this.#P.clear(),this.#$=null,this.#Ce())}),this.#o.observe(e.elements.plot),this.#c=new ResizeObserver(()=>{this.#se={width:this.#t.tooltip.offsetWidth,height:this.#t.tooltip.offsetHeight},this.#we()}),this.#c.observe(e.elements.tooltip));let t=e.elements.root.ownerDocument.documentElement;this.#s=P(t,()=>{this.#z=null,this.#Ce()}),this.#fe(),this.#K.jump([1,1])}destroy(){this.#de=!0,this.#o?.disconnect(),this.#c?.disconnect(),this.#s?.(),this.#l?.(),this.#n.onSeriesChange=null,this.#n.onPresentationChange=null,this.#L!=null&&(clearTimeout(this.#L),this.#L=null),this.#ue!==0&&cancelAnimationFrame(this.#ue)}#fe(){if(typeof matchMedia>`u`||this.#de)return;this.#l?.();let e=matchMedia(`(resolution: ${this.#De()}dppx)`),t=()=>{this.#f=this.#De(),this.#P.clear(),this.#Ce(),this.#fe()};e.addEventListener(`change`,t,{once:!0}),this.#l=()=>e.removeEventListener(`change`,t)}setOptions(e){let t=this.#r;if(this.#r=e,t.xScale!==e.xScale&&this.#A.clear(),t.animate&&!e.animate&&this.#pe(),t.dimensions!==e.dimensions){let t=[+(e.dimensions>=2),+(e.dimensions>=3)],n=rt(e.dimensions);if(this.#ge()===0||!this.#k)this.#K.jump(t),this.#W=n,this.#G.jump([n.yaw,n.pitch]);else{let e=n.yaw+Math.round((this.#W.yaw-n.yaw)/(Math.PI*2))*Math.PI*2;this.#K.aim(t,performance.now()),this.#G.jump([this.#W.yaw,this.#W.pitch]),this.#G.aim([e,n.pitch],performance.now())}}(t.xKey!==e.xKey||t.xScale!==e.xScale||t.zKey!==e.zKey||t.stacked!==e.stacked||t.yDomain[0]!==e.yDomain[0]||t.yDomain[1]!==e.yDomain[1])&&(this.#b=!0),this.#Ce()}setCallbacks(e){this.#i=e}setRows(e){e!==this.#p&&(this.#p=e,this.#b=!0,this.#Ce())}flushIngest(){!this.#b||this.#de||(this.#b=!1,this.#me())}setControlledActiveIndex(e){let t=this.#re;this.#re=null;let n=this.#ne!==void 0;if(this.#ne=e,e!==void 0){let n=t!=null&&t.index===e&&t.viaKeyboard;this.#Qe(e==null?null:this.#Ye(e),{viaKeyboard:n,notify:!1})}else n&&this.#Qe(null,{viaKeyboard:!1,notify:!1});this.#we()}handlePointerMove(e,t){if(this.#q!=null){let n=e-this.#q.lastX,r=t-this.#q.lastY;(this.#q.moved||Math.abs(n)+Math.abs(r)>3)&&(this.#q.moved=!0,this.#W={yaw:this.#W.yaw+n*.008,pitch:pe(this.#W.pitch+r*.008)},this.#G.jump([this.#W.yaw,this.#W.pitch]),this.#q.lastX=e,this.#q.lastY=t,this.#Qe(null,{viaKeyboard:!1,notify:!1}),this.#Ce());return}if(this.#ae=e,this.#oe=t,this.#e===`scatter`){let n=this.#at(e,t);this.#ee=n?.seriesKey??null,this.#$=n==null?null:{x:n.screenX,y:n.screenY},this.#Qe(n?.index??null,{viaKeyboard:!1,notify:!0});return}let n=this.#Xe(e,t);this.#Qe(n,{viaKeyboard:!1,notify:!0})}handlePointerDown(e,t){if(this.#J=!0,this.#ye()){this.#q={lastX:e,lastY:t,moved:!1};return}this.handlePointerMove(e,t)}handlePointerUp(e,t){let n=this.#q;this.#q=null;let r=this.#J;if(this.#J=!1,n!=null){if(n.moved)return;this.handlePointerMove(e,t)}r&&this.handleActivate(e,t)}handlePointerLeave(){this.#ae=null,this.#oe=null,this.#q=null,this.#J=!1,this.#ee=null,this.#$=null,this.#Qe(null,{viaKeyboard:!1,notify:!0})}handleActivate(e,t){let n=this.#qe();if(n==null)return;let r=this.#Je(n),i=this.#p[r];if(i==null)return;let a=this.#e===`scatter`?this.#ee:e==null||t==null?null:this.#Ze(n,e,t);this.#i.onDatumActivate?.({index:r,xValue:this.#g[n]??``,datum:i,dataKey:a})}handleKeyDown(e){if(this.#m===0)return!1;let t=this.#m-1,n=this.#qe(),r=this.#N?Math.max(1,Math.floor(this.#m/Math.max(1,this.#B.width*this.#f))):1,i=Math.max(1,Math.floor(this.#m/10)),a=(()=>{switch(e){case`ArrowLeft`:return Math.max(0,(n??this.#m)-r);case`ArrowRight`:return Math.min(t,(n??-1)+r);case`PageUp`:return Math.min(t,(n??0)+i);case`PageDown`:return Math.max(0,(n??t)-i);case`Home`:return 0;case`End`:return t;case`Escape`:return null;default:return}})();return a===void 0?e===`Enter`||e===` `?(this.handleActivate(null,null),!0):!1:(this.#ae=null,this.#oe=null,this.#ee=null,this.#$=null,this.#Qe(a,{viaKeyboard:!0,notify:!0}),!0)}invalidateColors(){this.#z=null,this.#Ce()}#pe(){this.#T.jump(this.#_e()),this.#E.jump(this.#ve()),this.#K.jump([+(this.#r.dimensions>=2),+(this.#r.dimensions>=3)]);let e=rt(this.#r.dimensions);this.#W=e,this.#G.jump([e.yaw,e.pitch]);for(let e of this.#D.values())e.snap();for(let e of this.#O.values())e.snap();this.#F.alpha=this.#F.target,this.#Ce()}#me(){let e=this.#p,{xKey:t,xScale:n}=this.#r,r=this.#n.seriesSpecs();this.#P.clear();let i=this.#h;if(n===`band`||n===`point`){let n=e.length,r=new Float64Array(n),i=Array.from({length:n},()=>``),a=!1;for(let o=0;o<n;o++){let n=e[o],s=n==null?void 0:E(n,t);s!==void 0&&(a=!0),i[o]=typeof s==`string`||typeof s==`number`||s instanceof Date?s:String(s),r[o]=o}m(n===0||a,`${this.#xe()} xKey "${t}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),this.#_=null,this.#v=null,this.#m=n,this.#h=r,this.#g=i}else{let r=[],i=!1,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e[s],l=c==null?void 0:E(c,t);l!==void 0&&(i=!0),l!=null&&(a=!0);let u=ct(l,n===`time`);Number.isFinite(u)&&(r.push({source:s,x:u}),o=!0)}m(e.length===0||i,`${this.#xe()} xKey "${t}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),m(!a||o,`${this.#xe()} could not read any "${t}" values as ${n===`time`?`dates`:`numbers`} for the "${n}" x scale — check the xScale and the data types.`);let s=!0;for(let e=1;e<r.length;e++)if((r[e]?.x??0)<(r[e-1]?.x??0)){s=!1;break}let c=s?r:r.toSorted((e,t)=>e.x-t.x),l=c.length,u=new Float64Array(l),d=Array.from({length:l},()=>``),f=l===e.length,p=new Int32Array(l);for(let e=0;e<l;e++){let t=c[e];t!=null&&(u[e]=t.x,n===`time`?d[e]=new Date(t.x):d[e]=t.x,p[e]=t.source,t.source!==e&&(f=!1))}if(f)this.#_=null,this.#v=null;else{this.#_=p;let t=new Int32Array(e.length).fill(-1);for(let e=0;e<l;e++){let n=p[e];n!=null&&(t[n]=e)}this.#v=t}this.#m=l,this.#h=u,this.#g=d}let a=!1;for(let e of this.#g)if(e instanceof Date&&ce(e)){a=!0;break}this.#y=a;let o=this.#h[0],s=this.#h[this.#m-1],c=i[0],l=i[i.length-1];!this.#ye()&&(n===`linear`||n===`time`)&&o!=null&&s!=null&&c!=null&&l!=null&&o>c&&s>=l?(this.#F.target=1,this.#I=performance.now()):(o!==c||s!==l)&&(this.#F.target=0);let u=this.#m,d=i.length===u&&u<=2500;if(d){for(let e=0;e<u;e++)if(i[e]!==this.#h[e]){d=!1;break}}let f=this.#x;this.#x=new Map;let p=1/0,h=-1/0;for(let t of r){let n=new Float64Array(u),r=!1;for(let i=0;i<u;i++){let a=e[this.#_==null?i:this.#_[i]??i],o=a==null?void 0:E(a,t.dataKey);if(o===void 0){n[i]=NaN;continue}r=!0;let s=typeof o==`number`&&Number.isFinite(o)?o:NaN;n[i]=s,Number.isNaN(s)||(s<p&&(p=s),s>h&&(h=s))}m(u===0||r,`${et[t.mark]} dataKey "${t.dataKey}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),this.#x.set(t.dataKey,n)}this.#S=p===1/0?0:p,this.#C=h===-1/0?0:h;let g=this.#r.zKey;if(this.#e===`scatter`&&g!=null){let t=new Float64Array(u),n=1/0,r=-1/0,i=!1;for(let a=0;a<u;a++){let o=e[this.#_==null?a:this.#_[a]??a],s=o==null?void 0:E(o,g);s!==void 0&&(i=!0);let c=typeof s==`number`&&Number.isFinite(s)?s:NaN;t[a]=c,Number.isNaN(c)||(c<n&&(n=c),c>r&&(r=c))}m(u===0||i,`ScatterPlot.Root zKey "${g}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),this.#H=t,this.#U=n===1/0?[0,1]:Y([n,r],5)}else this.#H=new Float64Array;this.#Y=null,this.#$=null,this.#w=this.#r.stacked?Xe(r.map(e=>this.#x.get(e.dataKey)??new Float64Array)):null,this.#N=R({pointCount:u,columnCount:Math.max(1,Math.round(this.#B.width*this.#f)),wasDecimated:this.#N});let _=this.#z;if(_!=null){for(let e of this.#n.seriesMeta())if(_.inputs.get(e.dataKey)!==$e(e)){this.#z=null;break}}this.#he(r,f,d);let v=this.#qe();v!=null&&this.#Qe(Math.min(v,Math.max(0,u-1)),{viaKeyboard:this.#ie,notify:!1}),this.#nt({force:!0})}#he(e,t,n){let r=performance.now(),i=this.#ge(),a=!this.#k;this.#k=this.#k||this.#m>0,a||i===0?(this.#T.jump(this.#_e()),this.#E.jump(this.#ve())):(this.#T.aim(this.#_e(),r),this.#E.aim(this.#ve(),r));let o=this.#m>0&&this.#m<=2500&&n,s=new Set,c=(e,t,n)=>{s.add(e);let a=this.#D.get(e);a??(a=new Qe,this.#D.set(e,a));let c=o&&n&&a.values().length===t.length;a.retarget(t,{duration:c?i:0,now:r})};e.forEach((e,n)=>{let i=t.has(e.dataKey);if(this.#w==null?c(e.dataKey,this.#x.get(e.dataKey)??new Float64Array,i):(c(`${e.dataKey}:lower`,this.#w.lower[n]??new Float64Array,i),c(`${e.dataKey}:upper`,this.#w.upper[n]??new Float64Array,i)),!this.#O.has(e.dataKey)&&this.#m>0){let t=new Qe;t.retarget([0],{duration:0,now:r}),t.retarget([1],{duration:this.#ge(),now:r}),this.#O.set(e.dataKey,t)}});for(let e of this.#D.keys())s.has(e)||this.#D.delete(e)}#ge(){return!this.#r.animate||typeof matchMedia<`u`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches?0:280}#_e(){let[e,t]=this.#r.yDomain,n,r;if(this.#w==null?this.#e===`line`||this.#e===`scatter`?(n=this.#S,r=this.#C):(n=Math.min(0,this.#S),r=Math.max(0,this.#C)):(n=Math.min(0,this.#w.min),r=Math.max(0,this.#w.max)),typeof e==`number`&&(n=e),typeof t==`number`&&(r=t),this.#m===0)return[0,1];let i=Y([n,r],5);return[typeof e==`number`?e:i[0],typeof t==`number`?t:i[1]]}#ve(){if(this.#m===0)return[0,1];let e=this.#h[0]??0,t=this.#h[this.#m-1]??0;return e===t?[e-.5,t+.5]:this.#e===`scatter`?Y([e,t],5):[e,t]}#ye(){return this.#e===`scatter`&&this.#r.zKey!=null}#be(){return this.#e===`bar`&&this.#r.orientation===`horizontal`}#xe(){return`${et[this.#e].split(`.`)[0]??`Chart`}.Root`}#Se(e,t){let n=this.#R;n??(n=this.#t.canvas.ownerDocument.createElement(`canvas`),this.#R=n),(n.width!==e||n.height!==t)&&(n.width=e,n.height=t);let r=n.getContext(`2d`);return r==null?null:{canvas:n,ctx:r}}#Ce(){this.#le=!0,this.#Te()}#we(){this.#Te()}#Te(){this.#ce||this.#de||(this.#ce=!0,this.#ue=requestAnimationFrame(()=>{this.#ce=!1,this.#ue=0,this.#Ee()}))}#Ee(){if(!this.#de){if(this.flushIngest(),this.#le){this.#le=!1;let e=performance.now(),t=!1;t=this.#T.tick(e)||t,t=this.#E.tick(e)||t;for(let n of this.#D.values())t=n.tick(e)||t;for(let n of this.#O.values())t=n.tick(e)||t;if(t=this.#K.tick(e)||t,this.#G.tick(e)){t=!0;let e=this.#G.values();this.#W={yaw:e[0]??this.#W.yaw,pitch:e[1]??this.#W.pitch}}this.#Oe(),this.#Ae(),t=this.#Le(e)||t,t&&this.#Ce()}this.#st()}}#De(){return typeof devicePixelRatio==`number`&&devicePixelRatio>0?Math.min(devicePixelRatio,3):1}#Oe(){let e=this.#t.root,t=`${N(e.ownerDocument.documentElement)}|${this.#f}|${this.#r.orientation}`;if(this.#z?.signature===t)return;let n=e.ownerDocument.defaultView;if(n==null)return;let r=this.#a,i=new Map,a=new Map,o=new Map;for(let t of this.#n.seriesMeta()){let n=ee(e,t.colorInput);if(i.set(t.dataKey,n),a.set(t.dataKey,$e(t)),r!=null&&t.mark===`bar`&&t.texture!==`solid`){let i=re(r,{texture:t.texture,color:n,ink:M(e,ne(n)),devicePixelRatio:this.#f,orientation:this.#r.orientation});i!=null&&o.set(t.dataKey,i)}}this.#z={signature:t,series:i,inputs:a,barTextures:o,chrome:te(e),fontFamily:n.getComputedStyle(e).fontFamily||`sans-serif`}}#ke(e){let t=this.#z?.signature??``;t!==this.#Q&&(this.#Z.clear(),this.#Q=t);let n=this.#Z.get(e);if(n!=null)return n;let r=ee(this.#t.root,e);return this.#Z.set(e,r),r}#Ae(){let e=this.#n.getSnapshot(),t=this.#ye(),n=this.#be(),r=!t&&e.xAxis!=null,i=!t&&e.yAxis!=null,a=n?r:i,o=(n?i:r)?24:8,s=Math.max(0,this.#d-8-o);this.#B={left:8,top:8,width:Math.max(0,this.#u-16),height:s};let c=8;if(a){c=40;let e=this.#a;if(e!=null&&this.#z!=null){e.font=`11px ${this.#z.fontFamily}`;let t=0,r=n?this.#Ie().map(e=>e.text):this.#Fe().map(e=>e.text);for(let n of r){let r=e.measureText(n).width;r>t&&(t=r)}c=Math.ceil(t)+14}}this.#B={left:c,top:8,width:Math.max(0,this.#u-c-8),height:s};let l=n?this.#B.top:this.#B.left,u=n?this.#B.top+this.#B.height:this.#B.left+this.#B.width;this.#r.xScale===`band`?this.#V=Se({count:this.#m,rangeStart:l,rangeEnd:u,paddingInner:.2,paddingOuter:.1}):this.#r.xScale===`point`?this.#V=Se({count:this.#m,rangeStart:l,rangeEnd:u,paddingInner:1,paddingOuter:.5}):this.#V=null,this.#N=R({pointCount:this.#m,columnCount:Math.max(1,Math.round(this.#B.width*this.#f)),wasDecimated:this.#N})}#je(){let e=this.#T.values();return G([e[0]??0,e[1]??1],[this.#B.top+this.#B.height,this.#B.top])}#Me(){let e=this.#T.values(),t=this.#be()?[this.#B.left,this.#B.left+this.#B.width]:[this.#B.top+this.#B.height,this.#B.top];return G([e[0]??0,e[1]??1],t)}#Ne(){let e=this.#E.values();return G([e[0]??0,e[1]??1],[this.#B.left,this.#B.left+this.#B.width])}#Pe(e){let t=this.#V;if(t!=null)return q(t,e);let{k:n,b:r}=this.#Ne();return(this.#h[e]??0)*n+r}#Fe(){let e=this.#n.getSnapshot(),t=this.#T.values(),n=we([t[0]??0,t[1]??1],e.yAxis?.tickCount??5),r=e.yAxis?.tickFormat,i=n.length>1?V(Math.abs((n[1]??0)-(n[0]??0))):void 0;return n.map(e=>({value:e,text:r==null?B(e,i==null?void 0:{maximumFractionDigits:i}):r(e)}))}#Ie(){let e=this.#n.getSnapshot(),t=e.xAxis?.tickFormat;if(this.#V!=null){let e=this.#be(),n=e?this.#B.height:this.#B.width,r=Math.max(1,Math.floor(n/(e?15:60))),i=Math.max(1,Math.ceil(this.#m/r)),a=[];for(let e=0;e<this.#m;e+=i){let n=this.#g[e]??``;a.push({index:e,value:e,text:t==null?U(n,{datasetHasTimeOfDay:this.#y}):t(n)})}return a}let n=this.#E.values(),r=[n[0]??0,n[1]??1],i=e.xAxis?.tickCount??Math.max(2,Math.floor(this.#B.width/90));if(this.#r.xScale===`time`){let e=Oe(r);return De(r,i).map(n=>({index:null,value:n,text:t==null?e(n):t(new Date(n))}))}let a=we(r,i),o=a.length>1?V(Math.abs((a[1]??0)-(a[0]??0))):void 0;return a.map(e=>({index:null,value:e,text:t==null?B(e,o==null?void 0:{maximumFractionDigits:o}):t(e)}))}#Le(e){let t=this.#a,n=this.#z;if(t==null||n==null||this.#u<=0||this.#d<=0)return!1;let r=Math.min(50,Math.max(0,e-this.#M));this.#M=e;let i=this.#t.canvas,a=Math.round(this.#u*this.#f),o=Math.round(this.#d*this.#f);(i.width!==a||i.height!==o)&&(i.width=a,i.height=o),t.setTransform(this.#f,0,0,this.#f,0,0),t.clearRect(0,0,this.#u,this.#d);let s=this.#n.getSnapshot(),c=this.#B;if(c.width<=0||c.height<=0)return!1;let l=this.#je(),u=this.#Ne(),d=this.#n.seriesSpecs(),f=this.#ye(),p=this.#ge()===0,m=f?[]:this.#Re(t,n.fontFamily),h=f?[]:this.#ze(t,n.fontFamily),g=it(this.#A,m,r,p);g=it(this.#j,h,r,p)||g;let _=this.#F;if(_.target===1){if(e-this.#I>tt)_.target=0;else if(this.#L==null){let t=tt-(e-this.#I)+17;this.#L=setTimeout(()=>{this.#L=null,this.#Ce()},t)}}if(p)_.alpha=_.target;else{let e=1-(1-(_.target>_.alpha?.16:.08))**(r/16.67);_.alpha+=(_.target-_.alpha)*e,Math.abs(_.target-_.alpha)<.02&&(_.alpha=_.target)}_.alpha!==_.target&&(g=!0);let v=this.#be(),y=v?this.#Me():l,b=e=>this.#V==null?e*u.k+u.b:q(this.#V,e),x=e=>e*y.k+y.b,S=[...this.#A.entries()].map(([e,t])=>({position:b(e),alpha:t.alpha})),C=[...this.#j.entries()].map(([e,t])=>({position:x(e),alpha:t.alpha}));if(s.grid!=null&&!f){let e=s.grid.lines??(v?`vertical`:`horizontal`),r=v?S:C,i=v?C:S;Ae(t,{plot:c,color:n.chrome.grid,xLines:e===`horizontal`?[]:i,yLines:e===`vertical`?[]:r})}let w=Math.min(40,c.width*.25),T=t,E=null;_.alpha>.01&&w>1&&(E=this.#Se(a,o),E!=null&&(E.ctx.setTransform(this.#f,0,0,this.#f,0,0),E.ctx.clearRect(0,0,this.#u,this.#d),T=E.ctx)),T.save(),T.beginPath(),T.rect(c.left,c.top,c.width,c.height+1),T.clip();let D=null;if(this.#e===`bar`?v?this.#Ue(T,d):this.#He(T,d,l):this.#e===`scatter`?D=this.#rt(T,d,l):this.#We(T,d,l),T.restore(),E!=null){T.save(),T.globalCompositeOperation=`destination-out`;let e=T.createLinearGradient(c.left,0,c.left+w,0);e.addColorStop(0,`rgba(0, 0, 0, ${_.alpha})`),e.addColorStop(1,`rgba(0, 0, 0, 0)`),T.fillStyle=e,T.fillRect(c.left,c.top,w,c.height+1),T.restore(),t.drawImage(E.canvas,0,0,this.#u,this.#d)}D!=null&&Ke(t,{textColor:n.chrome.tickText,fontFamily:n.fontFamily,plot:c,center:D.center,axes:D.axes}),this.#e===`bar`&&this.#m>0&&(v?Me(t,{plot:c,color:n.chrome.baseline,x:x(0)}):je(t,{plot:c,color:n.chrome.baseline,y:x(0)}));for(let e of f?[]:s.referenceLines){let r=x(e.y);if(v?r<c.left||r>c.left+c.width:r<c.top||r>c.top+c.height)continue;let i=e.color==null?n.chrome.reference:this.#ke(e.color);v?Je(t,{plot:c,color:i,textColor:n.chrome.tickText,x:r,label:e.label,fontFamily:n.fontFamily}):qe(t,{plot:c,color:i,textColor:n.chrome.tickText,y:r,label:e.label,fontFamily:n.fontFamily})}let O=s.xAxis==null||f?[]:[...this.#A.entries()].map(([e,t])=>({position:b(e),text:t.text,alpha:t.alpha})),k=s.yAxis==null||f?[]:[...this.#j.entries()].map(([e,t])=>({position:x(e),text:t.text,alpha:t.alpha})),A=v?k:O,j=v?O:k;return(A.length>0||j.length>0)&&Ye(t,{plot:c,color:n.chrome.tickText,fontFamily:n.fontFamily,xLabels:A,yLabels:j}),g}#Re(e,t){e.font=`11px ${t}`;let n=this.#be(),r=this.#Ne(),i=[],a=-1/0;for(let t of this.#Ie()){let o=t.index!=null&&this.#V!=null,s=o&&this.#V!=null?q(this.#V,t.index??0):t.value*r.k+r.b,c=n?15/2:e.measureText(t.text).width/2,l=n?2:8;s-c<a+l||(a=s+c,i.push({key:o?t.index??0:t.value,text:t.text}))}return i}#ze(e,t){let n=this.#Fe();if(!this.#be())return n.map(e=>({key:e.value,text:e.text}));e.font=`11px ${t}`;let r=this.#Me(),i=[],a=-1/0;for(let t of n){let n=t.value*r.k+r.b,o=e.measureText(t.text).width/2;n-o<a+8||(a=n+o,i.push({key:t.value,text:t.text}))}return i}#Be(e,t){let n=t===`value`?e.dataKey:`${e.dataKey}:${t}`;if(!this.#N&&this.#m<=2500){let e=this.#D.get(n);if(e!=null&&e.values().length===this.#m)return e.values()}if(t===`value`)return this.#x.get(e.dataKey)??new Float64Array;let r=this.#n.seriesSpecs().findIndex(t=>t.dataKey===e.dataKey);return(t===`lower`?this.#w?.lower:this.#w?.upper)?.[r]??new Float64Array}#Ve(e){return this.#O.get(e)?.values()[0]??1}#He(e,t,n){let r=this.#V,i=this.#z;if(r==null||i==null||this.#m===0||t.length===0)return;let a=0*n.k+n.b,o=this.#w!=null,s=o?1:t.length,c=r.bandwidth>=8*s?2:+(r.bandwidth>=3*s),l=(r.bandwidth-c*(s-1))/s,u=Math.min(24,l);t.forEach((d,f)=>{let p=this.#Ve(d.dataKey),m=[],h=o?this.#Be(d,`lower`):null,g=o?this.#Be(d,`upper`):this.#Be(d,`value`),_=f===t.length-1;for(let e=0;e<this.#m;e++){let t=g[e]??NaN;if(Number.isNaN(t))continue;let i=h==null?0:h[e]??0,d=o?K(r,e)+(r.bandwidth-u)/2:K(r,e)+(r.bandwidth-(l*s+c*(s-1)))/2+f*(l+c)+(l-u)/2,v=Number.isNaN(i)?a:i*n.k+n.b,y=t*n.k+n.b;y=v+(y-v)*p,o&&h!=null&&f>0&&!Number.isNaN(i)&&c>0&&(v-=Math.sign(v-y)*c),m.push({x:d,width:u,baselineY:v,valueY:y,rounded:!o||_})}Ne(e,{fill:i.barTextures.get(d.dataKey)??i.series.get(d.dataKey)??`currentColor`,rects:m})})}#Ue(e,t){let n=this.#V,r=this.#z;if(n==null||r==null||this.#m===0||t.length===0)return;let i=this.#Me(),a=0*i.k+i.b,o=this.#w!=null,s=o?1:t.length,c=n.bandwidth>=8*s?2:+(n.bandwidth>=3*s),l=(n.bandwidth-c*(s-1))/s,u=Math.min(24,l);t.forEach((d,f)=>{let p=this.#Ve(d.dataKey),m=[],h=o?this.#Be(d,`lower`):null,g=o?this.#Be(d,`upper`):this.#Be(d,`value`),_=f===t.length-1;for(let e=0;e<this.#m;e++){let t=g[e]??NaN;if(Number.isNaN(t))continue;let r=h==null?0:h[e]??0,d=o?K(n,e)+(n.bandwidth-u)/2:K(n,e)+(n.bandwidth-(l*s+c*(s-1)))/2+f*(l+c)+(l-u)/2,v=Number.isNaN(r)?a:r*i.k+i.b,y=t*i.k+i.b;y=v+(y-v)*p,o&&h!=null&&f>0&&!Number.isNaN(r)&&c>0&&(v-=Math.sign(v-y)*c),m.push({y:d,height:u,baselineX:v,valueX:y,rounded:!o||_})}Pe(e,{fill:r.barTextures.get(d.dataKey)??r.series.get(d.dataKey)??`currentColor`,rects:m})})}#We(e,t,n){let r=this.#z;if(r==null||this.#m===0)return;let i=this.#Ne(),a=this.#V,o=e=>a==null?(this.#h[e]??0)*i.k+i.b:q(a,e);t.forEach(t=>{let i=r.series.get(t.dataKey)??`currentColor`,a=this.#Ve(t.dataKey);if(e.save(),a<1&&(e.beginPath(),e.rect(this.#B.left,0,this.#B.width*a,this.#d),e.clip()),this.#N){this.#Ge(e,t,i,n),e.restore();return}let s=t.mark===`area`,c=this.#Be(t,this.#w==null?`value`:`upper`),l=this.#w==null?null:this.#Be(t,`lower`),u=e=>!Number.isNaN(c[e]??NaN),d=[];for(let e=0;e<this.#m;e++)(!t.connectNulls||u(e))&&d.push(e);let f=e=>(c[e]??0)*n.k+n.b;if(s){let r=l==null?()=>0*n.k+n.b:e=>(l[e]??0)*n.k+n.b;Ie(e,{color:i,curve:t.curve,indexes:d,xAt:o,y0At:r,y1At:f,definedAt:u})}else Fe(e,{color:i,curve:t.curve,indexes:d,xAt:o,yAt:f,definedAt:u}),t.markers&&this.#B.width/this.#m>=12&&Be(e,{color:i,surface:r.chrome.surface,shape:t.shape,indexes:d,xAt:o,yAt:f,definedAt:u});e.restore()})}#Ge(e,t,n,r){let i=Math.max(1,Math.round(this.#B.width*this.#f)),a=e=>this.#B.left+(e+.5)/this.#f;if(t.mark===`area`){let o=this.#Ke(`${t.dataKey}:upper`,this.#Be(t,this.#w==null?`value`:`upper`),i),s=this.#w==null?null:this.#Ke(`${t.dataKey}:lower`,this.#Be(t,`lower`),i);s==null?Re(e,{color:n,lowerColumns:lt(o,0),upperColumns:o,columnToX:a,valueK:r.k,valueB:r.b}):Re(e,{color:n,lowerColumns:s,upperColumns:o,columnToX:a,valueK:r.k,valueB:r.b});return}Le(e,{color:n,columns:this.#Ke(t.dataKey,this.#Be(t,`value`),i),columnToX:a,valueK:r.k,valueB:r.b})}#Ke(e,t,n){let r=this.#E.values(),i=`${r[0]??0}:${r[1]??1}:${n}`,a=this.#P.get(e);if(a!=null&&a.key===i)return a.columns;let o=G([r[0]??0,r[1]??1],[0,n]),s=ie({xs:this.#h,values:t,startIndex:0,endIndex:this.#m-1,positionK:o.k,positionB:o.b,columnCount:n});return this.#P.set(e,{key:i,columns:s}),s}#qe(){if(this.#m===0)return null;let e;return e=this.#ne===void 0?this.#te:this.#ne==null?null:this.#Ye(this.#ne),e==null?null:Math.min(Math.max(0,e),this.#m-1)}#Je(e){return this.#_==null?e:this.#_[e]??e}#Ye(e){if(this.#p.length===0)return null;let t=Math.min(Math.max(0,e),this.#p.length-1);if(this.#v==null)return t;let n=this.#v[t]??-1;return n===-1?null:n}#Xe(e,t){if(this.#m===0)return null;let n=this.#V;if(n!=null)return Ce(n,this.#be()?t:e);let{k:r,b:i}=this.#Ne();if(r===0)return 0;let a=e;if(this.#N){let t=Math.floor((e-this.#B.left)*this.#f);a=this.#B.left+(t+.5)/this.#f}return le(this.#h,this.#m,(a-i)/r)}#Ze(e,t,n){let r=this.#n.seriesSpecs(),i=this.#be(),a=this.#V;if(this.#e===`bar`&&this.#w==null&&a!=null&&r.length>1){let o=(i?n:t)-K(a,e),s=Math.floor(o/Math.max(1,a.bandwidth)*r.length);return r[Math.min(r.length-1,Math.max(0,s))]?.dataKey??null}let{k:o,b:s}=i?this.#Me():this.#je(),c=i?t:n,l=null,u=1/0;return r.forEach((t,n)=>{let r=(this.#w==null?this.#x.get(t.dataKey):this.#w.upper[n])?.[e]??NaN;if(Number.isNaN(r))return;let i=Math.abs(r*o+s-c);i<u&&(u=i,l=t.dataKey)}),l}#Qe(e,t){let n=e==null||this.#m===0?null:Math.min(Math.max(0,e),this.#m-1),r=this.#ne!==void 0;if(t.notify&&n!==this.#qe()){let e=n==null?null:this.#Je(n);if(this.#i.onActiveIndexChange?.(e),r){this.#re={index:e,viaKeyboard:t.viaKeyboard};return}}this.#ie=t.viaKeyboard,r||(this.#te=n),this.#nt(),this.#we()}#$e=null;#et=!1;#tt=null;#nt(e={force:!1}){let t=this.#qe();if(!e.force&&t===this.#$e&&this.#ie===this.#et&&this.#ee===this.#tt)return;if(this.#$e=t,this.#et=this.#ie,this.#tt=this.#ee,t==null||this.#m===0){this.#n.publishHover(null);return}let n=this.#Je(t),r=this.#p[n]??{},i=this.#n.seriesMeta().map(e=>{let n=this.#x.get(e.dataKey)?.[t]??NaN;return{dataKey:e.dataKey,label:e.label,value:Number.isNaN(n)?null:n,color:e.color}});this.#r.stacked&&i.reverse(),this.#e===`scatter`&&(i=this.#ee==null?i.filter(e=>e.value!=null):i.filter(e=>e.dataKey===this.#ee));let a={index:n,xValue:this.#g[t]??``,datum:r,points:i,viaKeyboard:this.#ie};if(this.#ye()){let e=this.#H[t]??NaN;a.zValue=Number.isNaN(e)?null:e}this.#n.publishHover(a)}#rt(e,t,n){let r=this.#z;if(r==null||this.#m===0||t.length===0)return null;if(this.#ye())return this.#it(e,t);let i=this.#Ne(),a=t.map(e=>{let t=this.#Be(e,`value`),n=[];for(let e=0;e<this.#m;e++)Number.isNaN(t[e]??NaN)||n.push(e);return n}),o=a.reduce((e,t)=>e+t.length,0);return t.forEach((t,s)=>{let c=this.#Be(t,`value`),l=a[s]??[];e.save(),e.globalAlpha=this.#Ve(t.dataKey),Ue(e,{color:r.series.get(t.dataKey)??`currentColor`,surface:r.chrome.surface,shape:t.shape,totalPointCount:o,indexes:l,xAt:e=>(this.#h[e]??0)*i.k+i.b,yAt:e=>(c[e]??0)*n.k+n.b,radiusAt:()=>4}),e.restore()}),null}#it(e,t){let n=this.#z;if(n==null)return null;let r=this.#B,i=de(this.#W),a=r.left+r.width/2,o=r.top+r.height/2,s=this.#K.values(),c=s[0]??1,l=s[1]??1,u=.85-.22*c-.11*l,d=Math.min(r.width,r.height)/2*u,f=this.#E.values(),p=[f[0]??0,f[1]??1],m=this.#T.values(),h=[m[0]??0,m[1]??1],g=this.#U,_=t.map(e=>this.#Ve(e.dataKey)),v=this.#K.values(),y=v[0]??1,b=v[1]??1,x=(e,t,n)=>{let r=fe(e,t,n,i);return{x:a+r.x*d,y:o-r.y*d}},S=he.map(([e,t,n])=>x(e,t,n)),C=t[0],w=t.length===1&&C!=null?C.dataKey:`y`,T=[{label:this.#r.xKey,alpha:1,from:x(-1,-y,-b),to:x(1,-y,-b)},{label:w,alpha:y,from:x(-1,-1,-b),to:x(-1,1,-b)},{label:this.#r.zKey??`z`,alpha:b,from:x(-1,-y,-1),to:x(-1,-y,1)}];Ge(e,{gridColor:n.chrome.grid,axisColor:n.chrome.baseline,corners:S,edges:ge,cubeAlpha:b,axes:T});let E=this.#m*t.length,D=this.#Y;(D==null||D.screenX.length<E)&&(D={screenX:new Float64Array(E),screenY:new Float64Array(E),radius:new Float64Array(E),seriesIndex:new Int32Array(E),pointIndex:new Int32Array(E),depths:new Float64Array(E),count:0});let O=D.depths,k=0;t.forEach((e,t)=>{let n=this.#Be(e,`value`);for(let e=0;e<this.#m;e++){let r=n[e]??NaN,s=this.#H[e]??NaN;if(Number.isNaN(r)||Number.isNaN(s))continue;let c=fe(me(this.#h[e]??0,p),me(r,h)*y,me(s,g)*b,i);D.screenX[k]=a+c.x*d,D.screenY[k]=o-c.y*d,D.radius[k]=4*c.scale,D.seriesIndex[k]=t,D.pointIndex[k]=e,O[k]=c.depth,k+=1}}),D.count=k,this.#Y=D,this.#X.length<k&&(this.#X=new Int32Array(E));let A=this.#X.subarray(0,k);for(let e=0;e<k;e++)A[e]=e;return A.sort((e,t)=>(O[t]??0)-(O[e]??0)),We(e,{count:k,order:A,screenX:D.screenX,screenY:D.screenY,radius:D.radius,colorAt:e=>{let r=t[D.seriesIndex[e]??0];return r==null?`currentColor`:n.series.get(r.dataKey)??`currentColor`},shapeAt:e=>t[D.seriesIndex[e]??0]?.shape??`circle`,alphaAt:e=>_[D.seriesIndex[e]??0]??1,surface:n.chrome.surface}),{center:{x:a,y:o},axes:T}}#at(e,t){let n=this.#n.seriesSpecs(),r=576,i=null;if(this.#ye()){let a=this.#Y;if(a==null)return null;for(let o=0;o<a.count;o++){let s=(a.screenX[o]??0)-e,c=(a.screenY[o]??0)-t,l=s*s+c*c;if(l<r){let e=n[a.seriesIndex[o]??0];if(e==null)continue;r=l,i={seriesKey:e.dataKey,index:a.pointIndex[o]??0,screenX:a.screenX[o]??0,screenY:a.screenY[o]??0}}}return i}let a=this.#Ne(),o=this.#je();for(let s of n){let n=this.#x.get(s.dataKey);if(n!=null)for(let c=0;c<this.#m;c++){let l=n[c]??NaN;if(Number.isNaN(l))continue;let u=(this.#h[c]??0)*a.k+a.b,d=l*o.k+o.b,f=u-e,p=d-t,m=f*f+p*p;m<r&&(r=m,i={seriesKey:s.dataKey,index:c,screenX:u,screenY:d})}}return i}#ot(e){let t=this.#n.seriesSpecs();if(this.#ye()){let t=this.#Y;if(t==null)return null;for(let n=0;n<t.count;n++)if((t.pointIndex[n]??-1)===e)return{x:t.screenX[n]??0,y:t.screenY[n]??0};return null}let n=this.#Ne(),r=this.#je();for(let i of t){let t=this.#x.get(i.dataKey)?.[e]??NaN;if(!Number.isNaN(t))return{x:(this.#h[e]??0)*n.k+n.b,y:t*r.k+r.b}}return null}#st(){let{crosshair:e,band:t,markers:n,tooltip:r}=this.#t,i=this.#qe(),a=i!=null&&this.#m>0,o=this.#e===`bar`,s=this.#e===`scatter`;if(e.style.opacity=a&&!o&&!s?`1`:`0`,t.style.opacity=a&&o?`1`:`0`,n.style.opacity=a&&!o?`1`:`0`,r.style.opacity=a?`1`:`0`,!a)return;let c=this.#B;if(s){let e=this.#$??this.#ot(i);if(e==null){n.style.opacity=`0`,r.style.opacity=`0`;return}for(;n.children.length>1;)n.lastElementChild?.remove();n.children.length===0&&n.appendChild(ot(n.ownerDocument));let t=n.children[0];if(t instanceof HTMLElement){let n=this.#n.seriesMeta(),r=this.#ee==null?n.find(e=>{let t=this.#x.get(e.dataKey)?.[i]??NaN;return!Number.isNaN(t)}):n.find(e=>e.dataKey===this.#ee);t.style.opacity=`1`,st(t,r?.shape??`circle`,r?.color??`currentColor`),t.style.transform=`translate3d(${e.x}px, ${e.y}px, 0)`}this.#ct(e.x,e.y);return}let l=this.#Pe(i),u=this.#be();if(o){let e=this.#V;if(e!=null){let n=K(e,i)-(e.step-e.bandwidth)/2;u?(t.style.transform=`translate3d(${c.left}px, ${n}px, 0)`,t.style.width=`${c.width}px`,t.style.height=`${Math.max(e.step,24)}px`):(t.style.transform=`translate3d(${n}px, ${c.top}px, 0)`,t.style.width=`${Math.max(e.step,24)}px`,t.style.height=`${c.height}px`)}}else{e.style.transform=`translate3d(${l}px, ${c.top}px, 0)`,e.style.height=`${c.height}px`;let t=this.#n.seriesMeta(),r=this.#n.seriesSpecs();for(;n.children.length>t.length;)n.lastElementChild?.remove();for(;n.children.length<t.length;)n.appendChild(ot(n.ownerDocument));let a=this.#je();t.forEach((e,t)=>{let o=n.children[t];if(!(o instanceof HTMLElement))return;let s=this.#x.get(e.dataKey)?.[i]??NaN,c=r[t],u=c==null?NaN:this.#Be(c,this.#w==null?`value`:`upper`)[i]??NaN;if(Number.isNaN(s)||Number.isNaN(u)){o.style.opacity=`0`;return}o.style.opacity=`1`,st(o,e.shape,e.color),o.style.transform=`translate3d(${l}px, ${u*a.k+a.b}px, 0)`})}o&&u&&this.#V!=null?this.#ct(this.#ae??c.left+c.width/2,q(this.#V,i)):this.#ct(l,this.#oe??c.top+8)}#ct(e,t){let n=this.#B,r=this.#t.tooltip,i=this.#se,a=e+12;a+i.width>n.left+n.width&&e-12-i.width>=n.left&&(a=e-12-i.width);let o=Math.min(Math.max(n.top,t-i.height/2),n.top+n.height-i.height);r.style.transform=`translate3d(${a}px, ${Math.max(n.top,o)}px, 0)`}};const rt=e=>e===3?{yaw:.65,pitch:-.35}:{yaw:0,pitch:0},it=(e,t,n,r)=>{for(let t of e.values())t.target=0;for(let n of t){let t=e.get(n.key);t==null?e.set(n.key,{alpha:+!!r,target:1,text:n.text}):(t.target=1,t.text=n.text)}let i=1-.84**(n/16.67),a=1-.88**(n/16.67),o=!1;for(let[t,n]of e){if(r)n.alpha=n.target;else{let e=n.target>n.alpha?i:a;n.alpha+=(n.target-n.alpha)*e}if(n.target===1&&n.alpha>.98&&(n.alpha=1),n.target===0&&n.alpha<.03){e.delete(t);continue}n.alpha!==n.target&&(o=!0)}return o},at={circle:`circle(50%)`,square:`inset(8%)`,triangle:`polygon(50% 0%, 100% 100%, 0% 100%)`,diamond:`polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)`},ot=e=>{let t=e.createElement(`div`);t.setAttribute(`data-slot`,`chart-active-point`),t.style.position=`absolute`,t.style.width=`12px`,t.style.height=`12px`,t.style.left=`-6px`,t.style.top=`-6px`;let n=e.createElement(`div`);n.style.position=`absolute`,n.style.inset=`0`,n.style.backgroundColor=`var(--background-color-card)`;let r=e.createElement(`div`);return r.style.position=`absolute`,r.style.inset=`2px`,t.appendChild(n),t.appendChild(r),t},st=(e,t,n)=>{let r=at[t];e.setAttribute(`data-shape`,t);let[i,a]=e.children;i instanceof HTMLElement&&(i.style.clipPath=r),a instanceof HTMLElement&&(a.style.clipPath=r,a.style.backgroundColor=n)},ct=(e,t)=>e instanceof Date?e.getTime():typeof e==`number`?e:t&&typeof e==`string`?new Date(e).getTime():NaN,lt=(e,t)=>({columnCount:e.columnCount,hasData:e.hasData,minValue:new Float64Array(e.columnCount).fill(t),maxValue:new Float64Array(e.columnCount).fill(t),inValue:new Float64Array(e.columnCount).fill(t),outValue:new Float64Array(e.columnCount).fill(t)}),ut=e=>e.replaceAll(`|`,`\\|`).replaceAll(/\s*\n\s*/g,` `),dt=e=>e instanceof Date?Number.isNaN(e.getTime())?`—`:e.toISOString():typeof e==`number`?Number.isFinite(e)?String(e):`—`:typeof e==`string`?ut(e):`—`,ft=e=>typeof e==`number`&&Number.isFinite(e)?String(e):`—`,pt=e=>`| ${e.join(` | `)} |`,mt=({data:e,xKey:t,series:n,zKey:r})=>{let i=[ut(t),...n.map(e=>ut(e.label)),...r==null?[]:[ut(r)]],a=e.map(e=>[dt(E(e,t)),...n.map(t=>ft(E(e,t.dataKey))),...r==null?[]:[ft(E(e,r))]]);return[pt(i),pt(i.map(()=>`---`)),...a.map(e=>pt(e))].join(`
|
|
2
|
-
`)},ht=(e,t)=>e==null?`var(${k(t)})`:O(e)?`var(${k(e)})`:e;var gt=class{#e=new Set;#t={series:[],hover:null,grid:null,xAxis:null,yAxis:null,referenceLines:[],tooltip:null,orientation:`vertical`};#n=new Map;#r=new Map;#i=new Map;#a=new Set;#o=0;#s=0;#c=null;#l=`vertical`;#u=null;#d=null;#f=new Map;#p=new Map;#m=null;#h=null;onSeriesChange=null;onPresentationChange=null;subscribe=e=>(this.#e.add(e),()=>{this.#e.delete(e)});getSnapshot=()=>this.#t;seriesSpecs(){return[...this.#n.values()].toSorted((e,t)=>e.sequence-t.sequence).map(e=>e.spec)}slotFor(e){let t=this.#i.get(e);if(t!=null)return t;for(;this.#s<A.length&&this.#a.has(A[this.#s]??`chart-other`);)this.#s+=1;let n=A[this.#s]??`chart-other`;return this.#s<A.length&&(this.#s+=1),this.#i.set(e,n),this.#a.add(n),n}#g({token:e,pinnedBy:t}){for(let[n,r]of this.#i)if(r===e&&n!==t&&this.#n.get(n)?.spec.color!==e){this.#i.delete(n),this.slotFor(n);return}}registerSeries(e){let t=this.#r.get(e.dataKey)??this.#o++;return this.#r.set(e.dataKey,t),e.color==null?this.slotFor(e.dataKey):O(e.color)&&e.color!==`chart-other`&&(this.#a.add(e.color),this.#g({token:e.color,pinnedBy:e.dataKey})),this.#n.set(e.dataKey,{spec:e,sequence:t}),this.#_({seriesChanged:!0}),()=>{this.#n.get(e.dataKey)?.spec===e&&(this.#n.delete(e.dataKey),this.#_({seriesChanged:!0}))}}setOrientation(e){this.#l!==e&&(this.#l=e,this.#_())}registerGrid(e){let t={lines:e};return this.#c=t,this.#_(),()=>{this.#c===t&&(this.#c=null,this.#_())}}registerXAxis(e){return this.#u=e,this.#_(),()=>{this.#u===e&&(this.#u=null,this.#_())}}registerYAxis(e){return this.#d=e,this.#_(),()=>{this.#d===e&&(this.#d=null,this.#_())}}registerReferenceLine(e,t){let n=this.#p.get(e)??this.#o++;return this.#p.set(e,n),this.#f.set(e,{spec:t,sequence:n}),this.#_(),()=>{this.#f.get(e)?.spec===t&&(this.#f.delete(e),this.#_())}}registerTooltip(e){return this.#m=e,this.#_(),()=>{this.#m===e&&(this.#m=null,this.#_())}}publishHover(e){this.#h!==e&&(this.#h=e,this.#t={...this.#t,hover:e},this.#v())}seriesMeta(){return this.seriesSpecs().map(e=>({dataKey:e.dataKey,label:e.label,mark:e.mark,color:ht(e.color,this.#i.get(e.dataKey)??`chart-other`),colorInput:e.color??this.#i.get(e.dataKey)??`chart-other`,shape:e.shape,texture:e.texture}))}#_(e={seriesChanged:!1}){this.#t={series:this.seriesMeta(),hover:this.#h,grid:this.#c,xAxis:this.#u,yAxis:this.#d,referenceLines:[...this.#f.values()].toSorted((e,t)=>e.sequence-t.sequence).map(e=>e.spec),tooltip:this.#m,orientation:this.#l},this.#v(),e.seriesChanged?this.onSeriesChange?.():this.onPresentationChange?.()}#v(){for(let e of this.#e)e()}};const _t=a(null),Q=e=>{let t=o(_t);return m(t,`${e} must be composed inside ${e.split(`.`)[0]}.Root — it registers into the chart it belongs to and renders nothing on its own.`),t},vt=e=>p(e.subscribe,e.getSnapshot,e.getSnapshot),yt=(e,t)=>{for(let n of e){let e=E(n,t);if(e!=null)return e instanceof Date?`time`:typeof e==`number`?`linear`:`point`}return`point`},bt=[`auto`,`auto`],xt=({kind:r,componentName:i,slotName:a,data:o,xKey:s,xScale:p,zKey:h,dimensions:v=3,yDomain:y=bt,stacked:b=!1,orientation:x=`vertical`,animate:S=!0,pending:C=!1,activeIndex:w,onActiveIndexChange:T,onDatumActivate:D,className:O,children:k,ref:A,"data-slot":j,"aria-label":M,"aria-labelledby":ee,...te})=>{let[N]=f(()=>new gt),P=d(null),[F]=f(()=>({kind:r,componentName:i,store:N,engineRef:P,dataRef:{current:{data:o,xKey:s,zKey:h}}}));l(()=>{F.dataRef.current={data:o,xKey:s,zKey:h}},[F,o,s,h]);let I=d(null),ne=e(I,A),L=d(null),re=d(null),R=d(null),ie=d(null),ae=d(null),oe=d(null),z=c(),B=r===`bar`?`band`:p??yt(o,s);m(r!==`scatter`||o.length===0||B!==`point`,`${i}.Root requires numeric or Date x values — the "${s}" values are not numbers or dates, so they have no position on a continuous scatter axis.`);let[V,se]=y,H=u(()=>{for(let e of o){let t=E(e,s);if(t instanceof Date&&ce(t))return!0}return!1},[o,s]);return l(()=>{let e=I.current,t=L.current,n=re.current,i=R.current,a=ie.current,o=ae.current,s=oe.current;if(e==null||t==null||n==null||i==null||a==null||o==null||s==null)return;let c=new nt({kind:r,store:N,elements:{root:e,plot:t,canvas:n,crosshair:i,band:a,markers:o,tooltip:s}});return P.current=c,()=>{P.current=null,c.destroy()}},[r,N]),l(()=>{P.current?.setOptions({xKey:s,xScale:B,yDomain:[V,se],zKey:h??null,dimensions:v,stacked:b,orientation:x,animate:S}),N.setOrientation(x)},[N,s,B,V,se,h,v,b,x,S]),l(()=>{P.current?.setRows(o)},[o]),l(()=>{P.current?.setCallbacks({onDatumActivate:D??null,onActiveIndexChange:T??null})}),l(()=>{P.current?.setControlledActiveIndex(w)},[w]),l(()=>{P.current?.flushIngest()}),g(`div`,{"data-slot":n(j,a),className:t(`relative flex aspect-video w-full flex-col`,O),ref:ne,...te,children:_(_t.Provider,{value:F,children:[_(`div`,{"data-slot":`${a}-plot`,className:t(`relative min-h-0 w-full flex-1`,C&&`opacity-60 transition-opacity duration-300`),ref:L,children:[g(`canvas`,{"data-slot":`${a}-canvas`,ref:re,"aria-hidden":!0,className:`absolute inset-0 size-full`}),g(`div`,{role:`application`,"aria-label":M,"aria-labelledby":ee,"aria-describedby":z,tabIndex:0,className:t(`focus-visible:ring-focus-accent absolute inset-0 rounded-sm outline-none focus-visible:ring-2`,(r===`line`||r===`area`)&&`cursor-crosshair`,r===`scatter`&&h!=null&&`touch-none cursor-grab active:cursor-grabbing`),onPointerDown:e=>{e.isTrusted&&r===`scatter`&&h!=null&&e.currentTarget.setPointerCapture(e.pointerId),P.current?.handlePointerDown(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerMove:e=>{P.current?.handlePointerMove(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerUp:e=>{P.current?.handlePointerUp(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerLeave:()=>{P.current?.handlePointerLeave()},onPointerCancel:()=>{P.current?.handlePointerLeave()},onBlur:()=>{P.current?.handlePointerLeave()},onKeyDown:e=>{P.current?.handleKeyDown(e.key)&&e.preventDefault()}}),g(`span`,{id:z,className:`sr-only`,children:`Use the left and right arrow keys to move between data points, Home and End to jump to the first and last, and Enter to activate the current point.`}),g(`div`,{ref:R,"aria-hidden":!0,className:`bg-neutral-500 pointer-events-none absolute left-0 top-0 w-px opacity-0`}),g(`div`,{ref:ie,"aria-hidden":!0,className:`bg-neutral-500/10 pointer-events-none absolute left-0 top-0 rounded-sm opacity-0`}),g(`div`,{ref:ae,"aria-hidden":!0,className:`pointer-events-none absolute inset-0 opacity-0`}),g(kt,{slotName:a,store:N,tooltipRef:oe,xHasTimeOfDay:H})]}),k,g(Ft,{store:N,xHasTimeOfDay:H}),g(It,{data:o,label:M,slotName:a,store:N,xHasTimeOfDay:H,xKey:s,zKey:h})]})})},St=(e,t,n)=>{let r=Q(e);m(r.kind===t,`${e} cannot be composed inside ${r.componentName}.Root — compose ${r.componentName} series parts instead.`);let{dataKey:i,label:a,color:o,curve:s=`linear`,markers:c=!1,connectNulls:u=!1,shape:d=`circle`,texture:f=`solid`}=n;return l(()=>r.store.registerSeries({dataKey:i,label:a??i,color:o,mark:t,curve:s,markers:c,connectNulls:u,shape:d,texture:f}),[r.store,i,a,o,t,s,c,u,d,f]),null},Ct=(e,t)=>{let n=Q(e),{lines:r}=t;return l(()=>n.store.registerGrid(r),[n.store,r]),null},wt=(e,t)=>{let n=Q(e),{tickFormat:r,tickCount:i}=t;return l(()=>n.store.registerXAxis({tickFormat:r,tickCount:i}),[n.store,r,i]),null},Tt=(e,t)=>{let n=Q(e),{tickFormat:r,tickCount:i}=t;return l(()=>n.store.registerYAxis({tickFormat:r,tickCount:i}),[n.store,r,i]),null},Et=(e,t)=>{let n=Q(e),r=c(),{y:i,label:a,color:o}=t;return l(()=>n.store.registerReferenceLine(r,{y:i,label:a,color:o}),[n.store,r,i,a,o]),null},Dt=(e,t)=>{let n=Q(e),{labelFormat:r,valueFormat:i,indicator:a=`line`,footer:o,children:s,...c}=t;return l(()=>n.store.registerTooltip({labelFormat:r,valueFormat:i,indicator:a,footer:o,children:s,divProps:c})),null},Ot=(e,t,n)=>e==null?`—`:n==null?B(e):n(e,t),kt=({slotName:n,store:r,tooltipRef:i,xHasTimeOfDay:a})=>{let o=vt(r),s=o.tooltip,c=o.hover,{className:u,ref:f,style:p,...m}=s?.divProps??{},v=d(null),y=e(i,v);l(()=>{if(f==null)return;let e=v.current;if(typeof f==`function`){let t=f(e);return()=>{typeof t==`function`?t():f(null)}}return f.current=e,()=>{f.current=null}},[f]);let b=s?.footer;return g(`div`,{"data-slot":`${n}-tooltip`,ref:y,className:t(`bg-popover border-popover text-strong pointer-events-none absolute left-0 top-0 z-10 min-w-32 rounded-md border px-2.5 py-1.5 text-xs shadow-md`,u),style:{opacity:0,...p},...m,children:c==null?null:s?.children==null?_(h,{children:[g(`div`,{className:`text-muted font-medium`,children:s?.labelFormat==null?U(c.xValue,{datasetHasTimeOfDay:a}):s.labelFormat(c.xValue)}),g(`div`,{className:`mt-1 grid gap-1`,children:c.points.map(e=>_(`div`,{className:`flex items-center gap-1.5`,children:[s?.indicator===`none`?null:g(`span`,{"aria-hidden":!0,className:`h-2.5 w-0.5 shrink-0 rounded-full`,style:{backgroundColor:e.color}}),g(`span`,{className:`text-muted`,children:e.label}),g(`span`,{className:`text-strong ml-auto pl-3 font-medium tabular-nums`,children:Ot(e.value,e.dataKey,s?.valueFormat)})]},e.dataKey))}),c.zValue===void 0?null:_(`div`,{className:`mt-1 flex items-center gap-1.5`,children:[g(`span`,{className:`text-muted`,children:`z`}),g(`span`,{className:`text-strong ml-auto pl-3 font-medium tabular-nums`,children:c.zValue==null?`—`:B(c.zValue)})]}),b==null?null:g(`div`,{className:`text-muted mt-1`,children:typeof b==`function`?b(c):b})]}):s.children(c)})},$=(e,t,n=3)=>`repeating-linear-gradient(${e}, ${t} 0, ${t} 1px, transparent 1px, transparent ${n}px)`,At=`forced-color-adjust-none [print-color-adjust:exact] [-webkit-print-color-adjust:exact]`,jt=(e,t,n)=>{if(e===`solid`)return{};let r=ne(t);return e===`hatch`?{backgroundImage:$(`135deg`,r)}:e===`hatch-reverse`?{backgroundImage:$(`45deg`,r)}:e===`crosshatch`?{backgroundImage:`${$(`135deg`,r,4)}, ${$(`45deg`,r,4)}`}:e===`perpendicular`?{backgroundImage:$(n===`horizontal`?`90deg`:`0deg`,r)}:{backgroundImage:`radial-gradient(circle at 1px 1px, ${r} 0.75px, transparent 0.8px)`,backgroundSize:`3px 3px`}},Mt=({series:e,orientation:n})=>e.mark===`bar`?g(`span`,{"aria-hidden":!0,"data-texture":e.texture,className:t(`size-2 shrink-0 rounded-[2px]`,At),style:{backgroundColor:e.color,...jt(e.texture,e.color,n)}}):e.mark===`line`?_(`span`,{"aria-hidden":!0,className:`relative flex h-2 w-3 shrink-0 items-center justify-center`,children:[g(`span`,{className:t(`absolute inset-x-0 top-1/2 h-0.5 -translate-y-1/2 rounded-full`,At),style:{backgroundColor:e.color}}),g(`span`,{"data-shape":e.shape,className:t(`relative size-2`,At),style:{backgroundColor:e.color,clipPath:at[e.shape]}})]}):g(`span`,{"aria-hidden":!0,"data-shape":e.shape,className:t(`size-2 shrink-0`,At),style:{backgroundColor:e.color,clipPath:at[e.shape]}}),Nt=({partName:e,slotName:n,className:r,children:i,...a})=>{let o=Q(e),s=vt(o.store);return s.series.length<2?null:g(`div`,{"data-slot":`${n}-legend`,className:t(`text-muted flex flex-wrap items-center gap-x-4 gap-y-1 pt-3 text-xs`,r),...a,children:i==null?s.series.map(e=>_(`div`,{className:`flex items-center gap-1.5`,children:[g(Mt,{series:e,orientation:s.orientation}),e.label]},e.dataKey)):i(s.series)})},Pt=({partName:e,slotName:t,label:n=`Copy data as Markdown`,onCopy:a,onCopyError:o,onClick:c,ref:l,...u})=>{let p=Q(e),m=i(),[h,_]=f(!1),b=d(void 0);return s(()=>()=>{b.current!=null&&clearTimeout(b.current)},[]),g(r,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,"data-slot":`${t}-copy-button`,label:n,icon:g(h?v:y,{}),ref:l,onClick:async e=>{try{if(c?.(e),e.defaultPrevented){b.current!=null&&(clearTimeout(b.current),b.current=void 0),_(!1);return}let{data:t,xKey:n,zKey:r}=p.dataRef.current,i=mt({data:t,xKey:n,zKey:r,series:p.store.getSnapshot().series});await m(i),a?.(i),_(!0),b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{_(!1)},2e3)}catch(e){o?.(e)}},...u})},Ft=({store:e,xHasTimeOfDay:t})=>{let n=vt(e),[r,i]=f(``),a=n.hover;return s(()=>{if(a==null||!a.viaKeyboard){i(``);return}let e=a.points.map(e=>`${e.label}: ${e.value==null?`no data`:B(e.value)}`).join(`, `),n=a.zValue===void 0?``:`, z: ${a.zValue==null?`no data`:B(a.zValue)}`,r=setTimeout(()=>{i(`${U(a.xValue,{datasetHasTimeOfDay:t})}. ${e}${n}`)},120);return()=>clearTimeout(r)},[a,t]),g(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:r})},It=({data:e,label:t,slotName:n,store:r,xHasTimeOfDay:i,xKey:a,zKey:o})=>{let s=vt(r);if(e.length===0||s.series.length===0)return null;let c=e.slice(0,150);return g(`div`,{className:`sr-only`,"data-slot":`${n}-data-table`,children:_(`table`,{children:[g(`caption`,{children:`${t==null?`Chart data`:`${t} — chart data`}${e.length>150?`. Showing the first 150 of ${e.length} rows.`:`.`}`}),g(`thead`,{children:_(`tr`,{children:[g(`th`,{scope:`col`,children:a}),s.series.map(e=>g(`th`,{scope:`col`,children:e.label},e.dataKey)),o==null?null:g(`th`,{scope:`col`,children:o})]})}),g(`tbody`,{children:c.map((e,t)=>{let n=E(e,a),r=n instanceof Date&&!Number.isNaN(n.getTime()),c=typeof n==`string`||typeof n==`number`||n instanceof Date?U(n,{datasetHasTimeOfDay:i}):String(n);return _(`tr`,{children:[g(`th`,{scope:`row`,"data-value":typeof n==`number`&&Number.isFinite(n)?n:void 0,children:r?g(`time`,{dateTime:n.toISOString(),children:c}):c}),s.series.map(t=>{let n=E(e,t.dataKey),r=typeof n==`number`&&Number.isFinite(n);return g(`td`,{"data-value":r?n:void 0,children:r?B(n):`—`},t.dataKey)}),o==null?null:(()=>{let t=E(e,o),n=typeof t==`number`&&Number.isFinite(t);return g(`td`,{"data-value":n?t:void 0,children:n?B(t):`—`})})()]},t)})})]})})};export{Et as a,wt as c,Ct as i,Tt as l,Nt as n,St as o,xt as r,Dt as s,Pt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./dropdown-menu-DZg-Cd69.js";
|