@ngrok/mantle 0.83.1 → 0.83.3
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/agent.json +1 -1
- package/dist/{alert-BuG2qS5l.js → alert-BpXQVXqv.js} +1 -1
- package/dist/{alert-B1HXfkYn.d.ts → alert-C4AFlLXD.d.ts} +1 -1
- package/dist/alert-center.d.ts +1 -1
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.d.ts +1 -1
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +1 -1
- package/dist/alert.js +1 -1
- package/dist/{anchor-3OGK2UKU.js → anchor-D2So_zuy.js} +1 -1
- package/dist/anchor.d.ts +8 -0
- package/dist/anchor.js +1 -1
- package/dist/app-layout.d.ts +8 -6
- package/dist/area-chart.d.ts +1 -1
- package/dist/area-chart.js +1 -1
- package/dist/badge.d.ts +7 -0
- package/dist/badge.js +1 -1
- package/dist/bar-chart.d.ts +1 -1
- package/dist/bar-chart.js +1 -1
- package/dist/{button-PoIujPMX.d.ts → button-BH79w6HV.d.ts} +10 -0
- package/dist/{button-BIf69CSV.d.ts → button-Dic5ZH4w.d.ts} +1 -1
- package/dist/{button-Cnja9Bsr.js → button-hEoKi6ZG.js} +1 -1
- package/dist/button.d.ts +2 -2
- package/dist/button.js +1 -1
- package/dist/chart-DorYMICt.js +2 -0
- package/dist/{chart-0zcFJh4n.d.ts → chart-TWkSYqAs.d.ts} +45 -7
- package/dist/code-block.d.ts +19 -1
- package/dist/code-block.js +1 -1
- package/dist/code.d.ts +8 -0
- package/dist/code.js +1 -1
- package/dist/command.js +1 -1
- package/dist/data-table.d.ts +1 -1
- package/dist/data-table.js +1 -1
- package/dist/field.d.ts +1 -1
- package/dist/field.js +1 -1
- package/dist/hover-card.d.ts +54 -0
- package/dist/hover-card.js +1 -1
- package/dist/{kbd-K8iaZ-Ti.js → kbd-B9qmYaW8.js} +1 -1
- package/dist/kbd.d.ts +7 -1
- package/dist/kbd.js +1 -1
- package/dist/line-chart.d.ts +1 -1
- package/dist/line-chart.js +1 -1
- package/dist/llms.txt +1 -1
- package/dist/mantle-dark-high-contrast.css +4 -0
- package/dist/mantle-dark.css +4 -0
- package/dist/mantle-light-high-contrast.css +4 -0
- package/dist/mantle.css +11 -1
- package/dist/pagination.d.ts +1 -1
- package/dist/popover-B1ZzHCym.js +1 -0
- package/dist/{popover-CE4OlWkd.d.ts → popover-C9fEVWL1.d.ts} +59 -0
- package/dist/popover.d.ts +1 -1
- package/dist/popover.js +1 -1
- package/dist/sandbar.d.ts +1 -1
- package/dist/sandbar.js +1 -1
- package/dist/scatter-plot.d.ts +1 -1
- package/dist/scatter-plot.js +1 -1
- package/dist/sidebar.d.ts +37 -24
- package/dist/sidebar.js +1 -1
- package/dist/skip-to-main-link.js +1 -1
- package/dist/split-button.d.ts +1 -1
- package/dist/split-button.js +1 -1
- package/package.json +1 -1
- package/dist/chart-DBxT9BNl.js +0 -2
- package/dist/popover-CQ9s7jG5.js +0 -1
package/dist/scatter-plot.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as PointShape, a as LegendPrimitiveProps, c as XAxisPrimitiveProps, f as ChartDatum, i as GridPrimitiveProps, l as YAxisPrimitiveProps, m as ChartSeriesSlot, n as ChartRootBaseProps, o as ReferenceLinePrimitiveProps, p as ChartDatumEvent, r as CopyButtonPrimitiveProps, s as TooltipPrimitiveProps, t as ChartAccessibilityProps, v as SeriesColor } from "./chart-
|
|
1
|
+
import { _ as PointShape, a as LegendPrimitiveProps, c as XAxisPrimitiveProps, f as ChartDatum, i as GridPrimitiveProps, l as YAxisPrimitiveProps, m as ChartSeriesSlot, n as ChartRootBaseProps, o as ReferenceLinePrimitiveProps, p as ChartDatumEvent, r as CopyButtonPrimitiveProps, s as TooltipPrimitiveProps, t as ChartAccessibilityProps, v as SeriesColor } from "./chart-TWkSYqAs.js";
|
|
2
2
|
//#region src/components/scatter-plot/scatter-plot.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Props for {@link ScatterPlot.Root}. Scatter x values must be continuous
|
package/dist/scatter-plot.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-
|
|
1
|
+
import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-DorYMICt.js";import{jsx as l}from"react/jsx-runtime";const u={Root:e=>l(o,{kind:`scatter`,componentName:`ScatterPlot`,slotName:`scatter-plot`,...e}),Point:e=>a(`ScatterPlot.Point`,`scatter`,e),Grid:e=>n(`ScatterPlot.Grid`,e),XAxis:e=>t(`ScatterPlot.XAxis`,e),YAxis:e=>r(`ScatterPlot.YAxis`,e),ReferenceLine:t=>e(`ScatterPlot.ReferenceLine`,t),Tooltip:e=>s(`ScatterPlot.Tooltip`,e),Legend:e=>l(i,{partName:`ScatterPlot.Legend`,slotName:`scatter-plot`,...e}),CopyButton:e=>l(c,{partName:`ScatterPlot.CopyButton`,slotName:`scatter-plot`,...e})};export{u as ScatterPlot};
|
package/dist/sidebar.d.ts
CHANGED
|
@@ -478,19 +478,31 @@ type SidebarHeaderProps = ComponentProps<"div"> & WithAsChild & WithDataSlot;
|
|
|
478
478
|
/**
|
|
479
479
|
* The top container of a `Sidebar.Nav`, pinned above the scrollable
|
|
480
480
|
* `Sidebar.Body`. Typically holds an app/product switcher built from
|
|
481
|
-
* `Sidebar.SwitcherTrigger` composed with a `DropdownMenu` or `Dialog`.
|
|
482
|
-
*
|
|
483
|
-
*
|
|
484
|
-
* `
|
|
485
|
-
* `AppLayout`, the toolbar derives its own height from the same
|
|
486
|
-
* overriding it at a shared ancestor (e.g. `AppLayout.Root`) moves
|
|
487
|
-
* together and the alignment holds by
|
|
481
|
+
* `Sidebar.SwitcherTrigger` composed with a `DropdownMenu` or `Dialog`.
|
|
482
|
+
*
|
|
483
|
+
* Its **first child** owns a band exactly `--sidebar-header-height` tall
|
|
484
|
+
* (default `4.5rem`) and centers inside it. When a sidebar header is composed
|
|
485
|
+
* inside an `AppLayout`, the toolbar derives its own height from the same
|
|
486
|
+
* variable, so overriding it at a shared ancestor (e.g. `AppLayout.Root`) moves
|
|
487
|
+
* the switcher row and the toolbar together and the alignment holds by
|
|
488
|
+
* construction.
|
|
489
|
+
*
|
|
490
|
+
* Every child after the first stacks flush below the band in its own row, the
|
|
491
|
+
* way rows stack in `Sidebar.Footer` — the band's own lower half is the space
|
|
492
|
+
* between them. The header grows to fit them. The band, and with it the toolbar,
|
|
493
|
+
* stays the height of the switcher row alone, so a search row pinned under the
|
|
494
|
+
* switcher (`Sidebar.SearchTrigger`) needs no override and no hand-copied
|
|
495
|
+
* padding.
|
|
496
|
+
*
|
|
497
|
+
* The alignment is positional: keep the aligned row as the header's first direct
|
|
498
|
+
* child. A wrapper around both rows takes the band itself. A first row taller
|
|
499
|
+
* than the band overflows it — raise the variable instead.
|
|
488
500
|
*
|
|
489
501
|
* **CSS variables (public API):**
|
|
490
502
|
*
|
|
491
503
|
* | CSS Variable | Default | Description |
|
|
492
504
|
* | --- | --- | --- |
|
|
493
|
-
* | `--sidebar-header-height` | `4.5rem` | The
|
|
505
|
+
* | `--sidebar-header-height` | `4.5rem` | The first child's band (72px) — the height an `AppLayout.Header` toolbar matches, not a cap on the header, which grows for every row after the first. Set it on a common ancestor of the sidebar and `AppLayout.Header`, not on `Sidebar.Nav`, so both rows read one value. |
|
|
494
506
|
*
|
|
495
507
|
* @see https://mantle.ngrok.com/components/navigation/sidebar#sidebarheader
|
|
496
508
|
*
|
|
@@ -1041,18 +1053,17 @@ type SidebarSearchTriggerProps = ComponentProps<"button"> & WithDataSlot & ({
|
|
|
1041
1053
|
/**
|
|
1042
1054
|
* The search row — the row that opens a search or command palette.
|
|
1043
1055
|
*
|
|
1044
|
-
* Put it at the top of `Sidebar.Body`, above the first `Sidebar.Group`: it
|
|
1045
|
-
*
|
|
1046
|
-
*
|
|
1056
|
+
* Put it at the top of `Sidebar.Body`, above the first `Sidebar.Group`: it lands
|
|
1057
|
+
* in the same `px-3` gutter as the navigation rows, so it shares their column in
|
|
1058
|
+
* both panel states, and it scrolls with them.
|
|
1047
1059
|
*
|
|
1048
|
-
* `Sidebar.Header`, under the switcher, also works
|
|
1049
|
-
*
|
|
1050
|
-
*
|
|
1051
|
-
*
|
|
1052
|
-
*
|
|
1053
|
-
*
|
|
1054
|
-
*
|
|
1055
|
-
* being center-aligned.
|
|
1060
|
+
* `Sidebar.Header`, under the switcher, also works, and pins the row above the
|
|
1061
|
+
* scrolling body instead. The switcher stays the header's first child, so it
|
|
1062
|
+
* keeps the `--sidebar-header-height` band an `AppLayout.Header` toolbar
|
|
1063
|
+
* matches, and this row takes the next row down — the header grows for it, so
|
|
1064
|
+
* nothing needs a token override. The header reserves no scrollbar gutter, so on
|
|
1065
|
+
* a platform whose scrollbars take space the row runs wider than the navigation
|
|
1066
|
+
* rows below it, which sit inside `Sidebar.Body`'s reserved gutter.
|
|
1056
1067
|
*
|
|
1057
1068
|
* It is deliberately a navigation row and not a text field. The row is the same
|
|
1058
1069
|
* chrome as a `Sidebar.ItemButton` — same height, padding, radius, hover, and
|
|
@@ -1685,8 +1696,9 @@ declare const Sidebar: {
|
|
|
1685
1696
|
readonly Trigger: typeof Trigger;
|
|
1686
1697
|
/**
|
|
1687
1698
|
* The pinned top container of the panel, typically holding the app
|
|
1688
|
-
* switcher (`Sidebar.SwitcherTrigger` + `DropdownMenu`/`Dialog`). Its
|
|
1689
|
-
*
|
|
1699
|
+
* switcher (`Sidebar.SwitcherTrigger` + `DropdownMenu`/`Dialog`). Its first
|
|
1700
|
+
* child owns the band that aligns the switcher with an `AppLayout.Header`;
|
|
1701
|
+
* later rows stack below the band.
|
|
1690
1702
|
*
|
|
1691
1703
|
* @see https://mantle.ngrok.com/components/navigation/sidebar#sidebarheader
|
|
1692
1704
|
*
|
|
@@ -2146,9 +2158,10 @@ declare const Sidebar: {
|
|
|
2146
2158
|
*/
|
|
2147
2159
|
readonly ItemButton: typeof ItemButton;
|
|
2148
2160
|
/**
|
|
2149
|
-
* The search row
|
|
2150
|
-
*
|
|
2151
|
-
*
|
|
2161
|
+
* The search row: an item-shaped row whose `shortcut` hint appears on hover or
|
|
2162
|
+
* focus, and the same chip as any other row in the collapsed icon rail. Goes
|
|
2163
|
+
* in `Sidebar.Body` to scroll with the navigation, or in `Sidebar.Header` to
|
|
2164
|
+
* stay pinned above it. Not state-wired — compose with
|
|
2152
2165
|
* `Command.SearchTrigger`.
|
|
2153
2166
|
*
|
|
2154
2167
|
* **Data attributes:**
|
package/dist/sidebar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-DpNWVci8.js";import{t as r}from"./button-CCkGqE1t.js";import{t as i}from"./use-is-hydrated-DDCqXmju.js";import{n as a}from"./separator-D0D6VyyM.js";import{n as o,t as s}from"./use-is-apple-platform-Cxwrb86L.js";import{t as c}from"./use-callback-ref-IYti9y7x.js";import{n as l}from"./cookie-ca4g5CKp.js";import{t as u}from"./sheet-BOSknSN9.js";import{r as d}from"./use-breakpoint-Dqu12Szq.js";import{t as f}from"./tooltip-Dnu35cjU.js";import{createContext as p,useCallback as m,useContext as h,useEffect as g,useId as _,useMemo as v,useRef as y,useState as b}from"react";import x from"tiny-invariant";import{Fragment as S,jsx as C,jsxs as w}from"react/jsx-runtime";import{SidebarSimpleIcon as T}from"@phosphor-icons/react/SidebarSimple";const E={sm:`hidden sm:block`,md:`hidden md:block`,lg:`hidden lg:block`},D=p(null);function O(){let e=h(D);return x(e,`useSidebar must be used within Sidebar.Root.`),e}function k(e){let t=h(D);return x(t,`Sidebar.${e} must be rendered inside Sidebar.Root.`),t}const A=[];function j(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`:!1}function M(){let e=Symbol(`sidebar-keyboard-shortcut`);return A.push(e),{isOwner:()=>A[0]===e,release:()=>{let t=A.indexOf(e);t!==-1&&A.splice(t,1)}}}const N=({children:e,defaultOpen:t=!0,keyboardShortcut:n=!0,mobileBreakpoint:r=`lg`,onOpenChange:i,onOpenMobileChange:a,open:s,openMobile:l})=>{let u=d(r),f=_(),p=s!=null,[h,x]=b(t),S=p?s:h,w=m(e=>{p||x(e),i?.(e)},[p,i]),T=l!=null,[E,O]=b(!1),k=T?l:E,A=m(e=>{T||O(e),a?.(e)},[T,a]),N=y(u);g(()=>{let e=N.current&&!u;N.current=u,e&&k&&A(!1)},[u,k,A]);let P=m(()=>{u?A(!k):w(!S)},[u,S,k,w,A]),F=c(P);g(()=>{if(!n)return;let e=M(),t=o(),r=n=>{if(!e.isOwner()||j(n.target))return;let r=t?n.metaKey:n.ctrlKey,i=t?n.ctrlKey:n.metaKey;n.key.toLowerCase()===`b`&&r&&!i&&!n.altKey&&!n.shiftKey&&(n.preventDefault(),F())};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),e.release()}},[n,F]);let I=v(()=>({isMobile:u,keyboardShortcut:n,mobileBreakpoint:r,navId:f,open:S,openMobile:k,setOpen:w,setOpenMobile:A,toggle:P}),[u,n,r,f,S,k,w,A,P]);return C(D.Provider,{value:I,children:e})},P=({"aria-label":n,"aria-labelledby":r,children:a,className:o,"data-slot":s,...c})=>{let{isMobile:l,mobileBreakpoint:d,navId:f,open:p,openMobile:m,setOpenMobile:h}=k(`Nav`),g=i(),_=n??(r==null?`Main`:void 0);return l?C(u.Root,{open:m,onOpenChange:h,children:w(u.Content,{side:`left`,preferredWidth:`sm:max-w-(--sidebar-width-mobile,18rem)`,"data-slot":t(s,`sidebar-nav`),"data-mobile":``,...r==null?null:{"aria-labelledby":r},className:e(`bg-base w-(--sidebar-width-mobile,18rem) max-w-full p-0`,o),...c,children:[C(u.Title,{className:`sr-only`,children:_??`Sidebar`}),C(`nav`,{id:f,"aria-label":_,"aria-labelledby":r,className:`flex h-full w-full min-w-0 flex-col text-sm`,children:a})]})}):C(`div`,{"data-slot":t(s,`sidebar-nav`),"data-state":p?`expanded`:`collapsed`,"data-hydrated":g?``:void 0,className:e(`group/sidebar-nav bg-base relative h-full w-(--sidebar-width,16rem) shrink-0 overflow-hidden`,`data-[state=collapsed]:w-(--sidebar-width-icon,3.25rem)`,!g&&E[d],g&&[`transition-[width] duration-200 ease-linear motion-reduce:transition-none`],o),...c,children:C(`nav`,{id:f,"aria-label":_,"aria-labelledby":r,className:`absolute inset-y-0 left-0 flex w-full min-w-0 flex-col text-sm`,children:a})})},F=C(T,{}),I=({label:e,shortcut:t})=>t==null?e:w(`span`,{className:`flex items-center gap-1.5`,children:[e,C(`span`,{"aria-hidden":!0,className:`inline-flex shrink-0 items-center gap-0.5 [&_kbd]:h-4 [&_kbd]:min-w-4 [&_kbd]:bg-neutral-500/25 [&_kbd]:px-0.5 [&_kbd]:text-xs`,children:t})]}),L=({appearance:e=`ghost`,"data-slot":n,icon:i=F,intent:a=`neutral`,label:o=`Toggle Sidebar`,onClick:c,shortcut:l,...u})=>{let{isMobile:d,keyboardShortcut:p,navId:m,open:h,openMobile:g,toggle:_}=k(`Trigger`),v=s(),y=d?g:h,b=!d||g,x=p?l:void 0,S=v?`Meta+B`:`Control+B`;return w(f.Root,{children:[C(f.Trigger,{asChild:!0,children:C(r,{appearance:e,"aria-controls":b?m:void 0,"aria-expanded":y,"aria-keyshortcuts":p?S:void 0,"data-slot":t(n,`sidebar-trigger`),"data-state":y?`expanded`:`collapsed`,icon:i,intent:a,label:o,onClick:e=>{c?.(e),e.defaultPrevented||_()},...u})}),C(f.Content,{"data-slot":`sidebar-trigger-tooltip`,children:C(I,{label:o,shortcut:x})})]})},R=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`div`,{"data-slot":t(o,`sidebar-header`),className:e(`flex h-(--sidebar-header-height,4.5rem) shrink-0 flex-col justify-center gap-2 px-3`,`group-data-[state=expanded]/sidebar-nav:pr-1`,a),...s,children:i}),z=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`div`,{"data-slot":t(o,`sidebar-body`),className:e(`scrollbar scrollbar-gutter-stable scroll-fade-y flex-1 scroll-py-6 space-y-2 overflow-y-auto overflow-x-hidden px-3 pt-1.5 pb-4`,`group-data-[state=expanded]/sidebar-nav:pr-1`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-none`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-gutter-auto`,`group-data-[state=collapsed]/sidebar-nav:[&::-webkit-scrollbar]:hidden`,a),...s,children:i}),B=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`div`,{"data-slot":t(o,`sidebar-footer`),className:e(`shrink-0 px-3 pt-3 pb-3.5`,`group-data-[state=expanded]/sidebar-nav:pr-1`,a),...s,children:i}),V=p(null),H=({asChild:r,children:i,className:a,"data-slot":o,...s})=>{let[c,l]=b(null),u=v(()=>({mountedLabelId:c,setMountedLabelId:l}),[c]),d=r?n:`div`;return C(V.Provider,{value:u,children:C(d,{"data-slot":t(o,`sidebar-group`),className:e(`pt-0.5`,a),...s,children:i})})},U=({asChild:r,children:i,className:a,"data-slot":o,id:s,...c})=>{let l=h(V),u=_(),d=s??(l==null?void 0:u),f=l?.setMountedLabelId;return g(()=>{if(f!=null&&d!=null)return f(d),()=>{f(null)}},[f,d]),C(r?n:`div`,{id:d,"data-slot":t(o,`sidebar-group-label`),className:e(`text-muted flex min-w-0 items-center gap-2 truncate px-2 py-1 text-xs font-medium`,`group-data-[state=collapsed]/sidebar-nav:opacity-0`,`group-data-[state=collapsed]/sidebar-nav:pointer-events-none`,`group-data-hydrated/sidebar-nav:transition-opacity group-data-hydrated/sidebar-nav:duration-200 group-data-hydrated/sidebar-nav:ease-linear group-data-hydrated/sidebar-nav:motion-reduce:transition-none`,a),...c,children:i})},W=({"aria-labelledby":r,asChild:i,children:a,className:o,"data-slot":s,...c})=>{let l=h(V);return C(i?n:`ul`,{"aria-labelledby":r??l?.mountedLabelId??void 0,"data-slot":t(s,`sidebar-list`),className:e(`mb-2 space-y-px`,o),...c,children:a})},G=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`li`,{"data-slot":t(o,`sidebar-item`),className:e(`list-none`,a),...s,children:i}),K=[`ring-focus-accent flex w-full min-w-0 items-center gap-2 truncate rounded-md px-2 py-1 text-left font-normal transition-none focus:outline-hidden focus-visible:ring-4`,`text-body hover:text-strong hover:bg-neutral-500/10`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`group-data-[state=collapsed]/sidebar-nav:ml-1`,`group-data-[state=collapsed]/sidebar-nav:w-7`,`group-data-[state=collapsed]/sidebar-nav:p-1`],q={Root:N,Nav:P,Trigger:L,Header:R,Body:z,Footer:B,Group:H,GroupLabel:U,List:W,Item:G,ItemButton:({asChild:r,children:i,className:a,current:o,"data-slot":s,type:c,...l})=>C(r?n:`button`,{"data-slot":t(s,`sidebar-item-button`),"data-current":o?``:void 0,"aria-current":o?`page`:void 0,type:r?c:c??`button`,className:e(K,`data-current:bg-neutral-500/15 data-current:text-strong`,`aria-[current=page]:bg-neutral-500/15 aria-[current=page]:text-strong`,`[&>svg]:text-muted hover:[&>svg]:text-strong data-current:[&>svg]:text-strong aria-[current=page]:[&>svg]:text-strong [&>svg:first-child]:size-5 [&>svg]:shrink-0`,a),...l,children:i}),SearchTrigger:({asChild:r,children:i,className:a,"data-slot":o,shortcut:s,type:c,...l})=>{let u=r?n:`button`,d=s==null?i:w(S,{children:[i,C(`span`,{"aria-hidden":!0,className:e(`pointer-events-none -mr-1 ml-auto inline-flex shrink-0 items-center gap-0.5 opacity-0 select-none`,`group-hover:opacity-100 group-focus-visible:opacity-100`,`group-data-[state=collapsed]/sidebar-nav:hidden`,`[&_kbd]:text-body [&_kbd]:h-5 [&_kbd]:min-w-5 [&_kbd]:bg-neutral-500/20 [&_kbd]:px-1 [&_kbd]:text-xs [&_kbd]:font-normal`),children:s})]});return C(u,{"data-slot":t(o,`sidebar-search-trigger`),type:r?c:c??`button`,className:e(`group`,K,`[&>svg:first-child]:text-muted hover:[&>svg:first-child]:text-strong [&>svg:first-child]:size-5 [&>svg]:shrink-0`,a),...l,children:d})},SwitcherTrigger:({asChild:r,children:i,className:a,"data-slot":o,type:s,...c})=>C(r?n:`button`,{"data-slot":t(o,`sidebar-switcher-trigger`),type:r?s:s??`button`,className:e(`text-body hover:text-strong hover:bg-neutral-500/10 flex w-full min-w-0 items-center gap-2 rounded-[0.625rem] py-1 pr-1.5 pl-1 text-left font-medium transition-none`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`ring-focus-accent focus:outline-hidden focus-visible:ring-4`,`*:first:size-7`,`group-data-[state=collapsed]/sidebar-nav:w-9`,`group-data-[state=collapsed]/sidebar-nav:p-1`,`group-data-[state=collapsed]/sidebar-nav:[&>:not(:first-child)]:sr-only`,a),...c,children:i}),Tooltip:({children:e,"data-slot":n,label:r,shortcut:i,side:a=`right`,...o})=>{let{isMobile:s,open:c}=k(`Tooltip`),l=!s&&!c,[u,d]=b(!1),[p,m]=b(l);return p!==l&&(m(l),d(!1)),w(f.Root,{disableHoverableContent:!0,onOpenChange:e=>{d(e&&l)},open:l&&u,children:[C(f.Trigger,{asChild:!0,children:e}),C(f.Content,{"data-slot":t(n,`sidebar-tooltip`),side:a,...o,children:C(I,{label:r,shortcut:i})})]})},Separator:({className:n,"data-slot":r,...i})=>C(a,{"data-slot":t(r,`sidebar-separator`),className:e(`my-3`,`group-data-[state=collapsed]/sidebar-nav:w-9`,n),...i})},J=`mantle-sidebar-state`,Y={collapsed:`collapsed`,expanded:`expanded`};function X(e){let t=l(e,J);if(t===Y.expanded)return!0;if(t===Y.collapsed)return!1}function Z(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?Y.expanded:Y.collapsed,c=[`${J}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{J as SIDEBAR_STATE_COOKIE_NAME,q as Sidebar,X as extractSidebarStateCookie,Z as serializeSidebarStateCookie,O as useSidebar};
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-DpNWVci8.js";import{t as r}from"./button-CCkGqE1t.js";import{t as i}from"./use-is-hydrated-DDCqXmju.js";import{n as a}from"./separator-D0D6VyyM.js";import{n as o,t as s}from"./use-is-apple-platform-Cxwrb86L.js";import{t as c}from"./use-callback-ref-IYti9y7x.js";import{n as l}from"./cookie-ca4g5CKp.js";import{t as u}from"./sheet-BOSknSN9.js";import{r as d}from"./use-breakpoint-Dqu12Szq.js";import{t as f}from"./tooltip-Dnu35cjU.js";import{createContext as p,useCallback as m,useContext as h,useEffect as g,useId as _,useMemo as v,useRef as y,useState as b}from"react";import x from"tiny-invariant";import{Fragment as S,jsx as C,jsxs as w}from"react/jsx-runtime";import{SidebarSimpleIcon as T}from"@phosphor-icons/react/SidebarSimple";const E={sm:`hidden sm:block`,md:`hidden md:block`,lg:`hidden lg:block`},D=p(null);function O(){let e=h(D);return x(e,`useSidebar must be used within Sidebar.Root.`),e}function k(e){let t=h(D);return x(t,`Sidebar.${e} must be rendered inside Sidebar.Root.`),t}const A=[];function j(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`:!1}function M(){let e=Symbol(`sidebar-keyboard-shortcut`);return A.push(e),{isOwner:()=>A[0]===e,release:()=>{let t=A.indexOf(e);t!==-1&&A.splice(t,1)}}}const N=({children:e,defaultOpen:t=!0,keyboardShortcut:n=!0,mobileBreakpoint:r=`lg`,onOpenChange:i,onOpenMobileChange:a,open:s,openMobile:l})=>{let u=d(r),f=_(),p=s!=null,[h,x]=b(t),S=p?s:h,w=m(e=>{p||x(e),i?.(e)},[p,i]),T=l!=null,[E,O]=b(!1),k=T?l:E,A=m(e=>{T||O(e),a?.(e)},[T,a]),N=y(u);g(()=>{let e=N.current&&!u;N.current=u,e&&k&&A(!1)},[u,k,A]);let P=m(()=>{u?A(!k):w(!S)},[u,S,k,w,A]),F=c(P);g(()=>{if(!n)return;let e=M(),t=o(),r=n=>{if(!e.isOwner()||j(n.target))return;let r=t?n.metaKey:n.ctrlKey,i=t?n.ctrlKey:n.metaKey;n.key.toLowerCase()===`b`&&r&&!i&&!n.altKey&&!n.shiftKey&&(n.preventDefault(),F())};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),e.release()}},[n,F]);let I=v(()=>({isMobile:u,keyboardShortcut:n,mobileBreakpoint:r,navId:f,open:S,openMobile:k,setOpen:w,setOpenMobile:A,toggle:P}),[u,n,r,f,S,k,w,A,P]);return C(D.Provider,{value:I,children:e})},P=({"aria-label":n,"aria-labelledby":r,children:a,className:o,"data-slot":s,...c})=>{let{isMobile:l,mobileBreakpoint:d,navId:f,open:p,openMobile:m,setOpenMobile:h}=k(`Nav`),g=i(),_=n??(r==null?`Main`:void 0);return l?C(u.Root,{open:m,onOpenChange:h,children:w(u.Content,{side:`left`,preferredWidth:`sm:max-w-(--sidebar-width-mobile,18rem)`,"data-slot":t(s,`sidebar-nav`),"data-mobile":``,...r==null?null:{"aria-labelledby":r},className:e(`bg-base w-(--sidebar-width-mobile,18rem) max-w-full p-0`,o),...c,children:[C(u.Title,{className:`sr-only`,children:_??`Sidebar`}),C(`nav`,{id:f,"aria-label":_,"aria-labelledby":r,className:`flex h-full w-full min-w-0 flex-col text-sm`,children:a})]})}):C(`div`,{"data-slot":t(s,`sidebar-nav`),"data-state":p?`expanded`:`collapsed`,"data-hydrated":g?``:void 0,className:e(`group/sidebar-nav bg-base relative h-full w-(--sidebar-width,16rem) shrink-0 overflow-hidden`,`data-[state=collapsed]:w-(--sidebar-width-icon,3.25rem)`,!g&&E[d],g&&[`transition-[width] duration-200 ease-linear motion-reduce:transition-none`],o),...c,children:C(`nav`,{id:f,"aria-label":_,"aria-labelledby":r,className:`absolute inset-y-0 left-0 flex w-full min-w-0 flex-col text-sm`,children:a})})},F=C(T,{}),I=({label:e,shortcut:t})=>t==null?e:w(`span`,{className:`flex items-center gap-1.5`,children:[e,C(`span`,{"aria-hidden":!0,className:`inline-flex shrink-0 items-center gap-0.5 [&_kbd]:h-4 [&_kbd]:min-w-4 [&_kbd]:bg-neutral-500/25 [&_kbd]:px-0.5 [&_kbd]:text-xs`,children:t})]}),L=({appearance:e=`ghost`,"data-slot":n,icon:i=F,intent:a=`neutral`,label:o=`Toggle Sidebar`,onClick:c,shortcut:l,...u})=>{let{isMobile:d,keyboardShortcut:p,navId:m,open:h,openMobile:g,toggle:_}=k(`Trigger`),v=s(),y=d?g:h,b=!d||g,x=p?l:void 0,S=v?`Meta+B`:`Control+B`;return w(f.Root,{children:[C(f.Trigger,{asChild:!0,children:C(r,{appearance:e,"aria-controls":b?m:void 0,"aria-expanded":y,"aria-keyshortcuts":p?S:void 0,"data-slot":t(n,`sidebar-trigger`),"data-state":y?`expanded`:`collapsed`,icon:i,intent:a,label:o,onClick:e=>{c?.(e),e.defaultPrevented||_()},...u})}),C(f.Content,{"data-slot":`sidebar-trigger-tooltip`,children:C(I,{label:o,shortcut:x})})]})},R=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`div`,{"data-slot":t(o,`sidebar-header`),className:e(`grid grid-cols-1 grid-rows-(--sidebar-header-height,4.5rem) shrink-0 items-center px-3`,`group-data-[state=expanded]/sidebar-nav:pr-1`,a),...s,children:i}),z=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`div`,{"data-slot":t(o,`sidebar-body`),className:e(`scrollbar scrollbar-gutter-stable scroll-fade-y flex-1 scroll-py-6 space-y-2 overflow-y-auto overflow-x-hidden px-3 pt-1.5 pb-4`,`group-data-[state=expanded]/sidebar-nav:pr-1`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-none`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-gutter-auto`,`group-data-[state=collapsed]/sidebar-nav:[&::-webkit-scrollbar]:hidden`,a),...s,children:i}),B=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`div`,{"data-slot":t(o,`sidebar-footer`),className:e(`shrink-0 px-3 pt-3 pb-3.5`,`group-data-[state=expanded]/sidebar-nav:pr-1`,a),...s,children:i}),V=p(null),H=({asChild:r,children:i,className:a,"data-slot":o,...s})=>{let[c,l]=b(null),u=v(()=>({mountedLabelId:c,setMountedLabelId:l}),[c]),d=r?n:`div`;return C(V.Provider,{value:u,children:C(d,{"data-slot":t(o,`sidebar-group`),className:e(`pt-0.5`,a),...s,children:i})})},U=({asChild:r,children:i,className:a,"data-slot":o,id:s,...c})=>{let l=h(V),u=_(),d=s??(l==null?void 0:u),f=l?.setMountedLabelId;return g(()=>{if(f!=null&&d!=null)return f(d),()=>{f(null)}},[f,d]),C(r?n:`div`,{id:d,"data-slot":t(o,`sidebar-group-label`),className:e(`text-muted flex min-w-0 items-center gap-2 truncate px-2 py-1 text-xs font-medium`,`group-data-[state=collapsed]/sidebar-nav:opacity-0`,`group-data-[state=collapsed]/sidebar-nav:pointer-events-none`,`group-data-hydrated/sidebar-nav:transition-opacity group-data-hydrated/sidebar-nav:duration-200 group-data-hydrated/sidebar-nav:ease-linear group-data-hydrated/sidebar-nav:motion-reduce:transition-none`,a),...c,children:i})},W=({"aria-labelledby":r,asChild:i,children:a,className:o,"data-slot":s,...c})=>{let l=h(V);return C(i?n:`ul`,{"aria-labelledby":r??l?.mountedLabelId??void 0,"data-slot":t(s,`sidebar-list`),className:e(`mb-2 space-y-px`,o),...c,children:a})},G=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`li`,{"data-slot":t(o,`sidebar-item`),className:e(`list-none`,a),...s,children:i}),K=[`ring-focus-accent flex w-full min-w-0 items-center gap-2 truncate rounded-md px-2 py-1 text-left font-normal transition-none focus:outline-hidden focus-visible:ring-4`,`text-body hover:text-strong hover:bg-neutral-500/10`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`group-data-[state=collapsed]/sidebar-nav:ml-1`,`group-data-[state=collapsed]/sidebar-nav:w-7`,`group-data-[state=collapsed]/sidebar-nav:p-1`],q={Root:N,Nav:P,Trigger:L,Header:R,Body:z,Footer:B,Group:H,GroupLabel:U,List:W,Item:G,ItemButton:({asChild:r,children:i,className:a,current:o,"data-slot":s,type:c,...l})=>C(r?n:`button`,{"data-slot":t(s,`sidebar-item-button`),"data-current":o?``:void 0,"aria-current":o?`page`:void 0,type:r?c:c??`button`,className:e(K,`data-current:bg-neutral-500/15 data-current:text-strong`,`aria-[current=page]:bg-neutral-500/15 aria-[current=page]:text-strong`,`[&>svg]:text-muted hover:[&>svg]:text-strong data-current:[&>svg]:text-strong aria-[current=page]:[&>svg]:text-strong [&>svg:first-child]:size-5 [&>svg]:shrink-0`,a),...l,children:i}),SearchTrigger:({asChild:r,children:i,className:a,"data-slot":o,shortcut:s,type:c,...l})=>{let u=r?n:`button`,d=s==null?i:w(S,{children:[i,C(`span`,{"aria-hidden":!0,className:e(`pointer-events-none -mr-1 ml-auto inline-flex shrink-0 items-center gap-0.5 opacity-0 select-none`,`group-hover:opacity-100 group-focus-visible:opacity-100`,`group-data-[state=collapsed]/sidebar-nav:hidden`,`[&_kbd]:text-body [&_kbd]:h-5 [&_kbd]:min-w-5 [&_kbd]:bg-neutral-500/20 [&_kbd]:px-1 [&_kbd]:text-xs [&_kbd]:font-normal`),children:s})]});return C(u,{"data-slot":t(o,`sidebar-search-trigger`),type:r?c:c??`button`,className:e(`group`,K,`[&>svg:first-child]:text-muted hover:[&>svg:first-child]:text-strong [&>svg:first-child]:size-5 [&>svg]:shrink-0`,a),...l,children:d})},SwitcherTrigger:({asChild:r,children:i,className:a,"data-slot":o,type:s,...c})=>C(r?n:`button`,{"data-slot":t(o,`sidebar-switcher-trigger`),type:r?s:s??`button`,className:e(`text-body hover:text-strong hover:bg-neutral-500/10 flex w-full min-w-0 items-center gap-2 rounded-[0.625rem] py-1 pr-1.5 pl-1 text-left font-medium transition-none`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`ring-focus-accent focus:outline-hidden focus-visible:ring-4`,`*:first:size-7`,`group-data-[state=collapsed]/sidebar-nav:w-9`,`group-data-[state=collapsed]/sidebar-nav:p-1`,`group-data-[state=collapsed]/sidebar-nav:[&>:not(:first-child)]:sr-only`,a),...c,children:i}),Tooltip:({children:e,"data-slot":n,label:r,shortcut:i,side:a=`right`,...o})=>{let{isMobile:s,open:c}=k(`Tooltip`),l=!s&&!c,[u,d]=b(!1),[p,m]=b(l);return p!==l&&(m(l),d(!1)),w(f.Root,{disableHoverableContent:!0,onOpenChange:e=>{d(e&&l)},open:l&&u,children:[C(f.Trigger,{asChild:!0,children:e}),C(f.Content,{"data-slot":t(n,`sidebar-tooltip`),side:a,...o,children:C(I,{label:r,shortcut:i})})]})},Separator:({className:n,"data-slot":r,...i})=>C(a,{"data-slot":t(r,`sidebar-separator`),className:e(`my-3`,`group-data-[state=collapsed]/sidebar-nav:w-9`,n),...i})},J=`mantle-sidebar-state`,Y={collapsed:`collapsed`,expanded:`expanded`};function X(e){let t=l(e,J);if(t===Y.expanded)return!0;if(t===Y.collapsed)return!1}function Z(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?Y.expanded:Y.collapsed,c=[`${J}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{J as SIDEBAR_STATE_COOKIE_NAME,q as Sidebar,X as extractSidebarStateCookie,Z as serializeSidebarStateCookie,O as useSidebar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./anchor-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./anchor-D2So_zuy.js";import{jsx as n}from"react/jsx-runtime";const r=({children:r=`Skip to main content`,className:i,onClick:a,targetId:o=`main`,...s})=>n(t,{...s,"data-slot":`skip-to-main-link`,href:`#${o}`,onClick:e=>{e.preventDefault(),window.history.replaceState(null,``,`#${o}`),document.getElementById(o)?.focus({preventScroll:!0}),a?.(e)},className:e(`not-focus:sr-only bg-card fixed top-2 left-2 z-max px-4 py-2 shadow-lg`,i),children:r});export{r as SkipToMainLink};
|
package/dist/split-button.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Button } from "./button-
|
|
1
|
+
import { t as Button } from "./button-BH79w6HV.js";
|
|
2
2
|
import { t as IconButton } from "./button-DJ7AAgII.js";
|
|
3
3
|
import { t as ButtonSize } from "./button-BCoI4bhP.js";
|
|
4
4
|
import { t as DropdownMenu } from "./dropdown-menu-DZOfj6HB.js";
|
package/dist/split-button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-lZ48P8Nn.js";import{t as n}from"./button-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-lZ48P8Nn.js";import{t as n}from"./button-hEoKi6ZG.js";import{t as r}from"./button-CCkGqE1t.js";import{t as i}from"./dropdown-menu-BRH0Wd_z.js";import{CaretDownIcon as a}from"@phosphor-icons/react/CaretDown";import{createContext as o,useContext as s,useMemo as c}from"react";import{jsx as l}from"react/jsx-runtime";const u=o({size:`md`}),d={Root:({className:t,children:n,dir:r,open:a,defaultOpen:o,onOpenChange:s,modal:d,size:f=`md`,ref:p,...m})=>{let h=c(()=>({size:f}),[f]);return l(i.Root,{dir:r,open:a,defaultOpen:o,onOpenChange:s,modal:d,children:l(u.Provider,{value:h,children:l(`div`,{"data-slot":`split-button`,"data-size":f,className:e(`flex flex-row [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:not(:first-child)]:-ml-px [&>*:focus]:relative [&>*:focus]:z-10 [&>*:hover]:relative [&>*:hover]:z-10 *:active:scale-100!`,t),ref:p,...m,children:n})})})},PrimaryAction:e=>{let{size:t}=s(u);return l(n,{appearance:`outlined`,intent:`neutral`,size:t,...e})},MenuTrigger:({icon:e,...n})=>{let{size:o}=s(u);return l(i.Trigger,{asChild:!0,className:`group`,children:l(r,{icon:e??l(t,{svg:l(a,{weight:`bold`,className:`size-4 group-data-[state=open]:-rotate-180 transition-transform ease-out duration-150`})}),appearance:`outlined`,intent:`neutral`,size:o,...n})})},MenuContent:({align:e=`end`,...t})=>l(i.Content,{align:e,...t}),MenuItem:({className:t,...n})=>l(i.Item,{className:e(`gap-2`,t),...n})};export{d as SplitButton};
|
package/package.json
CHANGED
package/dist/chart-DBxT9BNl.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./compose-refs-BdBMM9ga.js";import{t}from"./cx-IiQEAKf5.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./button-CCkGqE1t.js";import{t as i}from"./use-copy-to-clipboard-CSyp4Zk0.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=.5,O=(e,t)=>e<0?e:t,k=e=>{let{lower:t,upper:n,toPixel:r,reveal:i,gap:a}=e,o=r(t<0?n:t),s=o+(r(O(t,n))-o)*i;if(Math.abs(o-r(0))<D)return{baseline:o,value:s};let c=Math.min(a,Math.abs(o-s)/2);return{baseline:o-Math.sign(o-s)*c,value:s}},A=e=>{let{lower:t,upper:n,pileOuter:r,toPixel:i}=e;if(Number.isNaN(r))return!1;let a=i(O(t,n));return Math.abs(a-i(r))<D},j=[`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`,`chart-6`,`chart-7`,`chart-8`,`chart-other`],ee=e=>j.includes(e),te=e=>`--color-${e}`,ne=[`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`,`chart-6`,`chart-7`,`chart-8`],re=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},ie=(e,t)=>ee(t)?M(e,`var(${te(t)})`):re(t)?M(e,t):t,ae=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.1,L=1.6,R=e=>`oklch(from ${e} calc(l - 0.18) c h)`,z=(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)},B=(e,t)=>{let{size:n,width:r}=t;e.fillRect(0,n/2-r/2,n,r)},V=(e,t)=>{let{size:n,width:r}=t;e.fillRect(n/2-r/2,0,r,n)},oe={hatch:(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=F,e.beginPath(),z(e,t,`up`),e.stroke()},"hatch-reverse":(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=F,e.beginPath(),z(e,t,`down`),e.stroke()},crosshatch:(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=1,e.beginPath(),z(e,t,`up`),z(e,t,`down`),e.stroke()},perpendicular:(e,{size:t,ink:n,orientation:r})=>{e.fillStyle=n,r===`horizontal`?V(e,{size:t,width:2}):B(e,{size:t,width:2})},parallel:(e,{size:t,ink:n,orientation:r})=>{e.fillStyle=n,r===`horizontal`?B(e,{size:t,width:2}):V(e,{size:t,width:2})},grid:(e,{size:t,ink:n})=>{e.fillStyle=n,B(e,{size:t,width:I}),V(e,{size:t,width:I})},dots:(e,{size:t,ink:n})=>{e.fillStyle=n,e.beginPath(),e.arc(t/4,t/4,L,0,Math.PI*2),e.moveTo(3*t/4+L,3*t/4),e.arc(3*t/4,3*t/4,L,0,Math.PI*2),e.fill()}},se=(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),oe[n](c,{size:8,ink:i,orientation:o});let u=e.createPattern(s,`repeat`);return u?.setTransform({a:1/l,b:0,c:0,d:1/l,e:0,f:0}),u},H=e=>{let{pointCount:t,columnCount:n,wasDecimated:r}=e;return n<=0?!1:r?t>=n*3:t>=n*4},U=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}},ce=new Intl.NumberFormat,le=new Intl.NumberFormat(void 0,{maximumSignificantDigits:4}),W=new Map,G=(e,t)=>{let n=Object.is(e,-0)?0:e,r=t?.maximumFractionDigits;if(r!=null){let e=W.get(r);return e??(e=new Intl.NumberFormat(void 0,{maximumFractionDigits:r}),W.set(r,e)),e.format(n)}return n!==0&&Math.abs(n)<1?le.format(n):ce.format(n)},ue=e=>!Number.isFinite(e)||e<=0?0:Math.min(20,Math.max(0,-Math.floor(Math.log10(e)))),de=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}),fe=new Intl.DateTimeFormat(void 0,{year:`numeric`,month:`short`,day:`numeric`}),pe=e=>e.getHours()!==0||e.getMinutes()!==0||e.getSeconds()!==0||e.getMilliseconds()!==0,K=(e,t)=>typeof e==`string`?e:typeof e==`number`?G(e):Number.isNaN(e.getTime())?`—`:t?.datasetHasTimeOfDay??pe(e)?de.format(e):fe.format(e),me=(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},he=Math.PI/2-.05,ge=e=>({cosYaw:Math.cos(e.yaw),sinYaw:Math.sin(e.yaw),cosPitch:Math.cos(e.pitch),sinPitch:Math.sin(e.pitch)}),_e=(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}},ve=e=>Math.min(he,Math.max(-he,e)),ye=(e,t)=>{let n=t[1]-t[0];return n===0?0:(e-t[0])/n*2-1},be=[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1],[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],xe=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[1,5],[2,6],[3,7]],Se=Math.sqrt(50),Ce=Math.sqrt(10),we=Math.sqrt(2),q=(e,t,n,r)=>{let i=(t-e)/Math.max(0,n),a=r?.integer?Math.max(1,i):i,o=Math.floor(Math.log10(a)),s=a/10**o,c=s>=Se?10:s>=Ce?5:s>=we?2:1,l,u,d;return o<0?(d=10**-o/c,l=Math.round(e*d),u=Math.round(t*d),l/d<e&&(l+=1),u/d>t&&--u,d=-d):(d=10**o*c,l=Math.round(e/d),u=Math.round(t/d),l*d<e&&(l+=1),u*d>t&&--u),u<l&&.5<=n&&n<2?q(e,t,n*2,r):[l,u,d]},Te=(e,t,n,r)=>{if(!(n>0))return[];if(e===t)return r?.integer&&!Number.isInteger(e)?[]:[e];let i=t<e,[a,o,s]=i?q(t,e,n,r):q(e,t,n,r);if(!(o>=a))return[];let c=o-a+1,l=[];for(let e=0;e<c;e+=1){let t=i?o-e:a+e;l.push(s<0?t/-s:t*s)}return l},Ee=(e,t,n)=>q(e,t,n)[2],De=(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}},Oe=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}},J=(e,t)=>e.rangeStart+e.offset+t*e.step,Y=(e,t)=>J(e,t)+e.bandwidth/2,ke=(e,t)=>({start:J(e,t)-(e.step-e.bandwidth)/2,size:e.step}),Ae=(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))},je=(e,t,n)=>Te(e[0],e[1],t,n);let Me=null,Ne=null;const Pe=e=>{if(Ne!=null&&Me!=null&&Me[0]===e[0]&&Me[1]===e[1])return Ne;let t=b().domain([new Date(e[0]),new Date(e[1])]);return Me=[e[0],e[1]],Ne=t,t},Fe=(e,t)=>Pe(e).ticks(t).map(e=>e.getTime()),Ie=e=>{let t=Pe(e).tickFormat();return e=>t(new Date(e))},X=(e,t)=>{if(e[0]>e[1])return X([e[1],e[0]],t);if(e[0]===e[1]){let n=e[0],r=n===0?1:Math.abs(n)*.5;return X([n-r,n+r],t)}let n=e[0],r=e[1],i=NaN;for(let e=0;e<10;e++){let e=Ee(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]},Le=(e,t)=>{let n=X(e,t);return e[0]===0?[0,n[1]]:n},Re=e=>e===`monotone`?C:e===`step`?w:S,Z=e=>Math.round(e)+.5,ze=(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(Z(t.position),n.top),e.lineTo(Z(t.position),n.top+n.height),e.stroke();for(let t of a)e.globalAlpha=t.alpha,e.beginPath(),e.moveTo(n.left,Z(t.position)),e.lineTo(n.left+n.width,Z(t.position)),e.stroke();e.restore()},Be=(e,t)=>{let{plot:n,color:r,y:i}=t;e.strokeStyle=r,e.lineWidth=1,e.beginPath(),e.moveTo(n.left,Z(i)),e.lineTo(n.left+n.width,Z(i)),e.stroke()},Ve=(e,t)=>{let{plot:n,color:r,x:i}=t;e.strokeStyle=r,e.lineWidth=1,e.beginPath(),e.moveTo(Z(i),n.top),e.lineTo(Z(i),n.top+n.height),e.stroke()},He=(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()},Ue=(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()},We=(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(Re(r)).context(e);e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath(),c(i),e.stroke()},Ge=(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(Re(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(Re(r)).context(e);e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath(),u(i),e.stroke()},Ke=(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()},qe=(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(),Ke(e,{color:n,columns:i,columnToX:a,valueK:o,valueB:s})},Je=(e,t,n,r,i)=>{let a=!1;for(let[o,s]of i)a?e.lineTo(t+o*r,n+s*r):(e.moveTo(t+o*r,n+s*r),a=!0);e.closePath()},Ye=[[-1/3,-1],[1/3,-1],[1/3,-1/3],[1,-1/3],[1,1/3],[1/3,1/3],[1/3,1],[-1/3,1],[-1/3,1/3],[-1,1/3],[-1,-1/3],[-1/3,-1/3]],Xe=Ye.map(([e,t])=>[(e-t)/Math.SQRT2,(e+t)/Math.SQRT2]),Ze=Array.from({length:10},(e,t)=>{let n=-Math.PI/2+t*Math.PI/5,r=t%2==0?1:.382;return[Math.cos(n)*r,Math.sin(n)*r]}),Qe={circle:(e,t,n,r)=>{e.arc(t,n,r,0,Math.PI*2)},square:(e,t,n,r)=>{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()},triangle:(e,t,n,r)=>{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()},diamond:(e,t,n,r)=>{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()},"triangle-down":(e,t,n,r)=>{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()},plus:(e,t,n,r)=>{Je(e,t,n,r*1.189,Ye)},cross:(e,t,n,r)=>{Je(e,t,n,r*1.189,Xe)},star:(e,t,n,r)=>{Je(e,t,n,r*1.673,Ze)}},$e=(e,t,n,r,i)=>{Qe[i](e,t,n,r)},et=(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(),$e(e,o(t),s(t),4,i),e.fill(),e.stroke())},tt=5e3,nt=2e4,rt=(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>nt){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<=tt;e.strokeStyle=r,e.lineWidth=2;for(let t of o){let n=l(t);n<=0||(e.beginPath(),$e(e,s(t),c(t),n,i),e.fill(),u&&e.stroke())}},it=(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>nt){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<=tt;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(),$e(e,i[t]??0,a[t]??0,o[t]??0,c(t)),e.fill(),d&&e.stroke()}e.restore()},at=(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()},ot=(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()},st=(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,Z(a)),e.lineTo(n.left+n.width,Z(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))},ct=(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(Z(a),n.top),e.lineTo(Z(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)}},lt=(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()},ut=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),l=new Int32Array(n).fill(-1),u=new Int32Array(n).fill(-1);for(let d=0;d<t;d++){let t=e[d],f=r[d],p=i[d];if(t!=null&&f!=null&&p!=null)for(let e=0;e<n;e++){let n=t[e]??NaN;if(Number.isNaN(n)){f[e]=NaN,p[e]=NaN;continue}if(n>=0){let t=s[e]??0,r=t+n;s[e]=r,f[e]=t,p[e]=r,r>o&&(o=r),n>0&&(l[e]=d)}else{let t=c[e]??0,r=t+n;c[e]=r,f[e]=r,p[e]=t,r<a&&(a=r),u[e]=d}}}return{lower:r,upper:i,min:a,max:o,positiveEnd:l,negativeEnd:u}},dt=e=>1-(1-e)**3;var ft=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=dt(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}},pt=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 mt=e=>`${e.colorInput}|${e.texture}`,ht={bar:`BarChart.Bar`,line:`LineChart.Line`,area:`AreaChart.Area`,scatter:`ScatterPlot.Point`},gt=1e3;var _t=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=!0;#T=!0;#E=null;#D=new pt({speed:.16});#O=new pt({speed:.2});#k=new Map;#A=new Map;#j=!1;#M=new Map;#N=new Map;#P=0;#F=!1;#I=new Map;#L={alpha:0,target:0};#R=0;#z=null;#B=null;#V=null;#H={left:0,top:0,width:0,height:0};#U=null;#W=new Float64Array;#G=[0,1];#K={yaw:.65,pitch:-.35};#q=new pt({speed:.12});#J=new pt({speed:.16});#Y=null;#X=!1;#Z=null;#Q=new Int32Array;#$=new Map;#ee=``;#te=null;#ne=null;#re=null;#ie=void 0;#ae=null;#oe=!1;#se=null;#ce=null;#le={width:0,height:0};#ue=!1;#de=!1;#fe=0;#pe=!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.#Te()},this.#n.onPresentationChange=()=>{this.#Te()},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.#ke(),this.#I.clear(),this.#te=null,this.#Te())}),this.#o.observe(e.elements.plot),this.#c=new ResizeObserver(()=>{this.#le={width:this.#t.tooltip.offsetWidth,height:this.#t.tooltip.offsetHeight},this.#Ee()}),this.#c.observe(e.elements.tooltip));let t=e.elements.root.ownerDocument.documentElement;this.#s=P(t,()=>{this.#V=null,this.#Te()}),this.#me(),this.#J.jump([1,1])}destroy(){this.#pe=!0,this.#o?.disconnect(),this.#c?.disconnect(),this.#s?.(),this.#l?.(),this.#n.onSeriesChange=null,this.#n.onPresentationChange=null,this.#z!=null&&(clearTimeout(this.#z),this.#z=null),this.#fe!==0&&cancelAnimationFrame(this.#fe)}#me(){if(typeof matchMedia>`u`||this.#pe)return;this.#l?.();let e=matchMedia(`(resolution: ${this.#ke()}dppx)`),t=()=>{this.#f=this.#ke(),this.#I.clear(),this.#Te(),this.#me()};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.#M.clear(),t.animate&&!e.animate&&this.#he(),t.dimensions!==e.dimensions){let t=[+(e.dimensions>=2),+(e.dimensions>=3)],n=vt(e.dimensions);if(this.#ve()===0||!this.#j)this.#J.jump(t),this.#K=n,this.#q.jump([n.yaw,n.pitch]);else{let e=n.yaw+Math.round((this.#K.yaw-n.yaw)/(Math.PI*2))*Math.PI*2;this.#J.aim(t,performance.now()),this.#q.jump([this.#K.yaw,this.#K.pitch]),this.#q.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.#Te()}setCallbacks(e){this.#i=e}setRows(e){e!==this.#p&&(this.#p=e,this.#b=!0,this.#Te())}flushIngest(){!this.#b||this.#pe||(this.#b=!1,this.#ge())}setControlledActiveIndex(e){let t=this.#ae;this.#ae=null;let n=this.#ie!==void 0;if(this.#ie=e,e!==void 0){let n=t!=null&&t.index===e&&t.viaKeyboard;this.#nt(e==null?null:this.#$e(e),{viaKeyboard:n,notify:!1})}else n&&this.#nt(null,{viaKeyboard:!1,notify:!1});this.#Ee()}handlePointerMove(e,t){if(this.#Y!=null){let n=e-this.#Y.lastX,r=t-this.#Y.lastY;(this.#Y.moved||Math.abs(n)+Math.abs(r)>3)&&(this.#Y.moved=!0,this.#K={yaw:this.#K.yaw+n*.008,pitch:ve(this.#K.pitch+r*.008)},this.#q.jump([this.#K.yaw,this.#K.pitch]),this.#Y.lastX=e,this.#Y.lastY=t,this.#nt(null,{viaKeyboard:!1,notify:!1}),this.#Te());return}if(this.#se=e,this.#ce=t,this.#e===`scatter`){let n=this.#lt(e,t);this.#ne=n?.seriesKey??null,this.#te=n==null?null:{x:n.screenX,y:n.screenY},this.#nt(n?.index??null,{viaKeyboard:!1,notify:!0});return}let n=this.#et(e,t);this.#nt(n,{viaKeyboard:!1,notify:!0})}handlePointerDown(e,t){if(this.#X=!0,this.#xe()){this.#Y={lastX:e,lastY:t,moved:!1};return}this.handlePointerMove(e,t)}handlePointerUp(e,t){let n=this.#Y;this.#Y=null;let r=this.#X;if(this.#X=!1,n!=null){if(n.moved)return;this.handlePointerMove(e,t)}r&&this.handleActivate(e,t)}handlePointerLeave(){this.#se=null,this.#ce=null,this.#Y=null,this.#X=!1,this.#ne=null,this.#te=null,this.#nt(null,{viaKeyboard:!1,notify:!0})}handleActivate(e,t){let n=this.#Ze();if(n==null)return;let r=this.#Qe(n),i=this.#p[r];if(i==null)return;let a=this.#e===`scatter`?this.#ne:e==null||t==null?null:this.#tt(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.#Ze(),r=this.#F?Math.max(1,Math.floor(this.#m/Math.max(1,this.#H.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.#se=null,this.#ce=null,this.#ne=null,this.#te=null,this.#nt(a,{viaKeyboard:!0,notify:!0}),!0)}invalidateColors(){this.#V=null,this.#Te()}#he(){this.#D.jump(this.#ye()),this.#O.jump(this.#be()),this.#J.jump([+(this.#r.dimensions>=2),+(this.#r.dimensions>=3)]);let e=vt(this.#r.dimensions);this.#K=e,this.#q.jump([e.yaw,e.pitch]);for(let e of this.#k.values())e.snap();for(let e of this.#A.values())e.snap();this.#L.alpha=this.#L.target,this.#Te()}#ge(){let e=this.#p,{xKey:t,xScale:n}=this.#r,r=this.#n.seriesSpecs();this.#I.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.#Ce()} 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,this.#T=!0}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.#Ce()} xKey "${t}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),m(!a||o,`${this.#Ce()} 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=!0,h=new Int32Array(l);for(let e=0;e<l;e++){let t=c[e];t!=null&&(u[e]=t.x,Number.isInteger(t.x)||(p=!1),n===`time`?d[e]=new Date(t.x):d[e]=t.x,h[e]=t.source,t.source!==e&&(f=!1))}if(f)this.#_=null,this.#v=null;else{this.#_=h;let t=new Int32Array(e.length).fill(-1);for(let e=0;e<l;e++){let n=h[e];n!=null&&(t[n]=e)}this.#v=t}this.#m=l,this.#h=u,this.#g=d,this.#T=p}let a=!1;for(let e of this.#g)if(e instanceof Date&&pe(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.#xe()&&(n===`linear`||n===`time`)&&o!=null&&s!=null&&c!=null&&l!=null&&o>c&&s>=l?(this.#L.target=1,this.#R=performance.now()):(o!==c||s!==l)&&(this.#L.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,g=!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),Number.isInteger(s)||(g=!1))}m(u===0||r,`${ht[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,this.#w=g;let _=this.#r.zKey;if(this.#e===`scatter`&&_!=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,_);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 "${_}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),this.#W=t,this.#G=n===1/0?[0,1]:X([n,r],5)}else this.#W=new Float64Array;this.#Z=null,this.#te=null,this.#E=this.#r.stacked?ut(r.map(e=>this.#x.get(e.dataKey)??new Float64Array)):null,this.#F=H({pointCount:u,columnCount:Math.max(1,Math.round(this.#H.width*this.#f)),wasDecimated:this.#F});let v=this.#V;if(v!=null){for(let e of this.#n.seriesMeta())if(v.inputs.get(e.dataKey)!==mt(e)){this.#V=null;break}}this.#_e(r,f,d);let y=this.#Ze();y!=null&&this.#nt(Math.min(y,Math.max(0,u-1)),{viaKeyboard:this.#oe,notify:!1}),this.#ot({force:!0})}#_e(e,t,n){let r=performance.now(),i=this.#ve(),a=!this.#j;this.#j=this.#j||this.#m>0,a||i===0?(this.#D.jump(this.#ye()),this.#O.jump(this.#be())):(this.#D.aim(this.#ye(),r),this.#O.aim(this.#be(),r));let o=this.#m>0&&this.#m<=2500&&n,s=new Set,c=(e,t,n)=>{s.add(e);let a=this.#k.get(e);a??(a=new ft,this.#k.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.#E==null?c(e.dataKey,this.#x.get(e.dataKey)??new Float64Array,i):(c(`${e.dataKey}:lower`,this.#E.lower[n]??new Float64Array,i),c(`${e.dataKey}:upper`,this.#E.upper[n]??new Float64Array,i)),!this.#A.has(e.dataKey)&&this.#m>0){let t=new ft;t.retarget([0],{duration:0,now:r}),t.retarget([1],{duration:this.#ve(),now:r}),this.#A.set(e.dataKey,t)}});for(let e of this.#k.keys())s.has(e)||this.#k.delete(e)}#ve(){return!this.#r.animate||typeof matchMedia<`u`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches?0:280}#ye(){let[e,t]=this.#r.yDomain,n,r;if(this.#E==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.#E.min),r=Math.max(0,this.#E.max)),typeof e==`number`&&(n=e),typeof t==`number`&&(r=t),this.#m===0)return[0,1];let i=this.#e===`bar`||this.#e===`area`?Le([n,r],5):X([n,r],5);return[typeof e==`number`?e:i[0],typeof t==`number`?t:i[1]]}#be(){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`?X([e,t],5):[e,t]}#xe(){return this.#e===`scatter`&&this.#r.zKey!=null}#Se(){return this.#e===`bar`&&this.#r.orientation===`horizontal`}#Ce(){return`${ht[this.#e].split(`.`)[0]??`Chart`}.Root`}#we(e,t){let n=this.#B;n??(n=this.#t.canvas.ownerDocument.createElement(`canvas`),this.#B=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}}#Te(){this.#de=!0,this.#De()}#Ee(){this.#De()}#De(){this.#ue||this.#pe||(this.#ue=!0,this.#fe=requestAnimationFrame(()=>{this.#ue=!1,this.#fe=0,this.#Oe()}))}#Oe(){if(!this.#pe){if(this.flushIngest(),this.#de){this.#de=!1;let e=performance.now(),t=!1;t=this.#D.tick(e)||t,t=this.#O.tick(e)||t;for(let n of this.#k.values())t=n.tick(e)||t;for(let n of this.#A.values())t=n.tick(e)||t;if(t=this.#J.tick(e)||t,this.#q.tick(e)){t=!0;let e=this.#q.values();this.#K={yaw:e[0]??this.#K.yaw,pitch:e[1]??this.#K.pitch}}this.#Ae(),this.#Me(),t=this.#ze(e)||t,t&&this.#Te()}this.#dt()}}#ke(){return typeof devicePixelRatio==`number`&&devicePixelRatio>0?Math.min(devicePixelRatio,3):1}#Ae(){let e=this.#t.root,t=`${N(e.ownerDocument.documentElement)}|${this.#f}|${this.#r.orientation}`;if(this.#V?.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=ie(e,t.colorInput);if(i.set(t.dataKey,n),a.set(t.dataKey,mt(t)),r!=null&&t.mark===`bar`&&t.texture!==`solid`){let i=se(r,{texture:t.texture,color:n,ink:M(e,R(n)),devicePixelRatio:this.#f,orientation:this.#r.orientation});i!=null&&o.set(t.dataKey,i)}}this.#V={signature:t,series:i,inputs:a,barTextures:o,chrome:ae(e),fontFamily:n.getComputedStyle(e).fontFamily||`sans-serif`}}#je(e){let t=this.#V?.signature??``;t!==this.#ee&&(this.#$.clear(),this.#ee=t);let n=this.#$.get(e);if(n!=null)return n;let r=ie(this.#t.root,e);return this.#$.set(e,r),r}#Me(){let e=this.#n.getSnapshot(),t=this.#xe(),n=this.#Se(),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.#H={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.#V!=null){e.font=`11px ${this.#V.fontFamily}`;let t=0,r=n?this.#Re().map(e=>e.text):this.#Le().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.#H={left:c,top:8,width:Math.max(0,this.#u-c-8),height:s};let l=n?this.#H.top:this.#H.left,u=n?this.#H.top+this.#H.height:this.#H.left+this.#H.width;this.#U=this.#r.xScale===`band`?Oe({count:this.#m,rangeStart:l,rangeEnd:u,paddingInner:.2,paddingOuter:.1}):this.#r.xScale===`point`?Oe({count:this.#m,rangeStart:l,rangeEnd:u,paddingInner:1,paddingOuter:.5}):null,this.#F=H({pointCount:this.#m,columnCount:Math.max(1,Math.round(this.#H.width*this.#f)),wasDecimated:this.#F})}#Ne(){let e=this.#D.values();return De([e[0]??0,e[1]??1],[this.#H.top+this.#H.height,this.#H.top])}#Pe(){let e=this.#D.values(),t=this.#Se()?[this.#H.left,this.#H.left+this.#H.width]:[this.#H.top+this.#H.height,this.#H.top];return De([e[0]??0,e[1]??1],t)}#Fe(){let e=this.#O.values();return De([e[0]??0,e[1]??1],[this.#H.left,this.#H.left+this.#H.width])}#Ie(e){let t=this.#U;if(t!=null)return Y(t,e);let{k:n,b:r}=this.#Fe();return(this.#h[e]??0)*n+r}#Le(){let e=this.#n.getSnapshot(),t=this.#D.values(),n=je([t[0]??0,t[1]??1],e.yAxis?.tickCount??5,{integer:this.#w}),r=e.yAxis?.tickFormat,i=n.length>1?ue(Math.abs((n[1]??0)-(n[0]??0))):void 0;return n.map(e=>({value:e,text:r==null?G(e,i==null?void 0:{maximumFractionDigits:i}):r(e)}))}#Re(){let e=this.#n.getSnapshot(),t=e.xAxis?.tickFormat;if(this.#U!=null){let e=this.#Se(),n=e?this.#H.height:this.#H.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?K(n,{datasetHasTimeOfDay:this.#y}):t(n)})}return a}let n=this.#O.values(),r=[n[0]??0,n[1]??1],i=e.xAxis?.tickCount??Math.max(2,Math.floor(this.#H.width/90));if(this.#r.xScale===`time`){let e=Ie(r);return Fe(r,i).map(n=>({index:null,value:n,text:t==null?e(n):t(new Date(n))}))}let a=je(r,i,{integer:this.#T}),o=a.length>1?ue(Math.abs((a[1]??0)-(a[0]??0))):void 0;return a.map(e=>({index:null,value:e,text:t==null?G(e,o==null?void 0:{maximumFractionDigits:o}):t(e)}))}#ze(e){let t=this.#a,n=this.#V;if(t==null||n==null||this.#u<=0||this.#d<=0)return!1;let r=Math.min(50,Math.max(0,e-this.#P));this.#P=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.#H;if(c.width<=0||c.height<=0)return!1;let l=this.#Ne(),u=this.#Fe(),d=this.#n.seriesSpecs(),f=this.#xe(),p=this.#ve()===0,m=f?[]:this.#Be(t,n.fontFamily),h=f?[]:this.#Ve(t,n.fontFamily),g=yt(this.#M,m,r,p);g=yt(this.#N,h,r,p)||g;let _=this.#L;if(_.target===1){if(e-this.#R>gt)_.target=0;else if(this.#z==null){let t=gt-(e-this.#R)+17;this.#z=setTimeout(()=>{this.#z=null,this.#Te()},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.#Se(),y=v?this.#Pe():l,b=e=>this.#U==null?e*u.k+u.b:Y(this.#U,e),x=e=>e*y.k+y.b,S=[...this.#M.entries()].map(([e,t])=>({position:b(e),alpha:t.alpha})),C=[...this.#N.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;ze(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.#we(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.#qe(T,d):this.#Ke(T,d,l):this.#e===`scatter`?D=this.#st(T,d,l):this.#Je(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&&ot(t,{textColor:n.chrome.tickText,fontFamily:n.fontFamily,plot:c,center:D.center,axes:D.axes}),this.#e===`bar`&&this.#m>0&&(v?Ve(t,{plot:c,color:n.chrome.baseline,x:x(0)}):Be(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.#je(e.color);v?ct(t,{plot:c,color:i,textColor:n.chrome.tickText,x:r,label:e.label,fontFamily:n.fontFamily}):st(t,{plot:c,color:i,textColor:n.chrome.tickText,y:r,label:e.label,fontFamily:n.fontFamily})}let O=s.xAxis==null||f?[]:[...this.#M.entries()].map(([e,t])=>({position:b(e),text:t.text,alpha:t.alpha})),k=s.yAxis==null||f?[]:[...this.#N.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)&<(t,{plot:c,color:n.chrome.tickText,fontFamily:n.fontFamily,xLabels:A,yLabels:j}),g}#Be(e,t){e.font=`11px ${t}`;let n=this.#Se(),r=this.#Fe(),i=[],a=-1/0;for(let t of this.#Re()){let o=t.index!=null&&this.#U!=null,s=o&&this.#U!=null?Y(this.#U,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}#Ve(e,t){let n=this.#Le();if(!this.#Se())return n.map(e=>({key:e.value,text:e.text}));e.font=`11px ${t}`;let r=this.#Pe(),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}#He(e,t){let n=t===`value`?e.dataKey:`${e.dataKey}:${t}`;if(!this.#F&&this.#m<=2500){let e=this.#k.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.#E?.lower:this.#E?.upper)?.[r]??new Float64Array}#Ue(e){return this.#A.get(e)?.values()[0]??1}#We(e,t){if(e==null)return 0;let n=e[t]??0;return Number.isNaN(n)?0:n}#Ge(e,t,n){let r=this.#E;if(r==null)return!0;let i=r.lower[e]?.[t]??NaN,a=r.upper[e]?.[t]??NaN;if(Number.isNaN(i)||Number.isNaN(a))return!1;let o=i<0,s=(o?r.negativeEnd:r.positiveEnd)[t]??-1;if(s<0)return!1;let c=(o?r.lower:r.upper)[s]?.[t]??NaN;return A({lower:i,upper:a,pileOuter:c,toPixel:n})}#Ke(e,t,n){let r=this.#U,i=this.#V;if(r==null||i==null||this.#m===0||t.length===0)return;let a=this.#E!=null,o=a?1:t.length,s=r.bandwidth>=8*o?2:+(r.bandwidth>=3*o),c=(r.bandwidth-s*(o-1))/o,l=Math.min(24,c),u=e=>e*n.k+n.b;t.forEach((t,n)=>{let d=this.#Ue(t.dataKey),f=[],p=a?this.#He(t,`lower`):null,m=a?this.#He(t,`upper`):this.#He(t,`value`);for(let e=0;e<this.#m;e++){let t=m[e]??NaN;if(Number.isNaN(t))continue;let i=this.#We(p,e),h=a?J(r,e)+(r.bandwidth-l)/2:J(r,e)+(r.bandwidth-(c*o+s*(o-1)))/2+n*(c+s)+(c-l)/2,g=k({lower:i,upper:t,toPixel:u,reveal:d,gap:a?s:0});f.push({x:h,width:l,baselineY:g.baseline,valueY:g.value,rounded:this.#Ge(n,e,u)})}He(e,{fill:i.barTextures.get(t.dataKey)??i.series.get(t.dataKey)??`currentColor`,rects:f})})}#qe(e,t){let n=this.#U,r=this.#V;if(n==null||r==null||this.#m===0||t.length===0)return;let i=this.#Pe(),a=this.#E!=null,o=a?1:t.length,s=n.bandwidth>=8*o?2:+(n.bandwidth>=3*o),c=(n.bandwidth-s*(o-1))/o,l=Math.min(24,c),u=e=>e*i.k+i.b;t.forEach((t,i)=>{let d=this.#Ue(t.dataKey),f=[],p=a?this.#He(t,`lower`):null,m=a?this.#He(t,`upper`):this.#He(t,`value`);for(let e=0;e<this.#m;e++){let t=m[e]??NaN;if(Number.isNaN(t))continue;let r=this.#We(p,e),h=a?J(n,e)+(n.bandwidth-l)/2:J(n,e)+(n.bandwidth-(c*o+s*(o-1)))/2+i*(c+s)+(c-l)/2,g=k({lower:r,upper:t,toPixel:u,reveal:d,gap:a?s:0});f.push({y:h,height:l,baselineX:g.baseline,valueX:g.value,rounded:this.#Ge(i,e,u)})}Ue(e,{fill:r.barTextures.get(t.dataKey)??r.series.get(t.dataKey)??`currentColor`,rects:f})})}#Je(e,t,n){let r=this.#V;if(r==null||this.#m===0)return;let i=this.#Fe(),a=this.#U,o=e=>a==null?(this.#h[e]??0)*i.k+i.b:Y(a,e);t.forEach(t=>{let i=r.series.get(t.dataKey)??`currentColor`,a=this.#Ue(t.dataKey);if(e.save(),a<1&&(e.beginPath(),e.rect(this.#H.left,0,this.#H.width*a,this.#d),e.clip()),this.#F){this.#Ye(e,t,i,n),e.restore();return}let s=t.mark===`area`,c=this.#He(t,this.#E==null?`value`:`upper`),l=this.#E==null?null:this.#He(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;Ge(e,{color:i,curve:t.curve,indexes:d,xAt:o,y0At:r,y1At:f,definedAt:u})}else We(e,{color:i,curve:t.curve,indexes:d,xAt:o,yAt:f,definedAt:u}),t.markers&&this.#H.width/this.#m>=12&&et(e,{color:i,surface:r.chrome.surface,shape:this.#n.seriesShape(t.dataKey),indexes:d,xAt:o,yAt:f,definedAt:u});e.restore()})}#Ye(e,t,n,r){let i=Math.max(1,Math.round(this.#H.width*this.#f)),a=e=>this.#H.left+(e+.5)/this.#f;if(t.mark===`area`){let o=this.#Xe(`${t.dataKey}:upper`,this.#He(t,this.#E==null?`value`:`upper`),i),s=this.#E==null?null:this.#Xe(`${t.dataKey}:lower`,this.#He(t,`lower`),i);s==null?qe(e,{color:n,lowerColumns:wt(o,0),upperColumns:o,columnToX:a,valueK:r.k,valueB:r.b}):qe(e,{color:n,lowerColumns:s,upperColumns:o,columnToX:a,valueK:r.k,valueB:r.b});return}let o=this.#Xe(t.dataKey,this.#He(t,`value`),i);Ke(e,{color:n,columns:o,columnToX:a,valueK:r.k,valueB:r.b})}#Xe(e,t,n){let r=this.#O.values(),i=`${r[0]??0}:${r[1]??1}:${n}`,a=this.#I.get(e);if(a!=null&&a.key===i)return a.columns;let o=[r[0]??0,r[1]??1],s=De(o,[0,n]),c=U({xs:this.#h,values:t,startIndex:0,endIndex:this.#m-1,positionK:s.k,positionB:s.b,columnCount:n});return this.#I.set(e,{key:i,columns:c}),c}#Ze(){if(this.#m===0)return null;let e;return e=this.#ie===void 0?this.#re:this.#ie==null?null:this.#$e(this.#ie),e==null?null:Math.min(Math.max(0,e),this.#m-1)}#Qe(e){return this.#_==null?e:this.#_[e]??e}#$e(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}#et(e,t){if(this.#m===0)return null;let n=this.#U;if(n!=null)return Ae(n,this.#Se()?t:e);let{k:r,b:i}=this.#Fe();if(r===0)return 0;let a=e;if(this.#F){let t=Math.floor((e-this.#H.left)*this.#f);a=this.#H.left+(t+.5)/this.#f}return me(this.#h,this.#m,(a-i)/r)}#tt(e,t,n){let r=this.#n.seriesSpecs(),i=this.#Se(),a=this.#U;if(this.#e===`bar`&&this.#E==null&&a!=null&&r.length>1){let o=(i?n:t)-J(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.#Pe():this.#Ne(),c=i?t:n,l=this.#E;if(this.#e===`bar`&&l!=null)for(let t=0;t<r.length;t++){let n=l.lower[t]?.[e]??NaN,i=l.upper[t]?.[e]??NaN;if(Number.isNaN(n)||Number.isNaN(i)||n===i)continue;let a=n*o+s,u=i*o+s;if(c>=Math.min(a,u)&&c<=Math.max(a,u))return r[t]?.dataKey??null}let u=null,d=1/0;return r.forEach((t,n)=>{let r=(this.#E==null?this.#x.get(t.dataKey):this.#E.upper[n])?.[e]??NaN;if(Number.isNaN(r))return;let i=Math.abs(r*o+s-c);i<d&&(d=i,u=t.dataKey)}),u}#nt(e,t){let n=e==null||this.#m===0?null:Math.min(Math.max(0,e),this.#m-1),r=this.#ie!==void 0;if(t.notify&&n!==this.#Ze()){let e=n==null?null:this.#Qe(n);if(this.#i.onActiveIndexChange?.(e),r){this.#ae={index:e,viaKeyboard:t.viaKeyboard};return}}this.#oe=t.viaKeyboard,r||(this.#re=n),this.#ot(),this.#Ee()}#rt=null;#it=!1;#at=null;#ot(e={force:!1}){let t=this.#Ze();if(!e.force&&t===this.#rt&&this.#oe===this.#it&&this.#ne===this.#at)return;if(this.#rt=t,this.#it=this.#oe,this.#at=this.#ne,t==null||this.#m===0){this.#n.publishHover(null);return}let n=this.#Qe(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.#ne==null?i.filter(e=>e.value!=null):i.filter(e=>e.dataKey===this.#ne));let a={index:n,xValue:this.#g[t]??``,datum:r,points:i,viaKeyboard:this.#oe};if(this.#xe()){let e=this.#W[t]??NaN;a.zValue=Number.isNaN(e)?null:e}this.#n.publishHover(a)}#st(e,t,n){let r=this.#V;if(r==null||this.#m===0||t.length===0)return null;if(this.#xe())return this.#ct(e,t);let i=this.#Fe(),a=t.map(e=>{let t=this.#He(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.#He(t,`value`),l=a[s]??[];e.save(),e.globalAlpha=this.#Ue(t.dataKey),rt(e,{color:r.series.get(t.dataKey)??`currentColor`,surface:r.chrome.surface,shape:this.#n.seriesShape(t.dataKey),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}#ct(e,t){let n=this.#V;if(n==null)return null;let r=this.#H,i=ge(this.#K),a=r.left+r.width/2,o=r.top+r.height/2,s=this.#J.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.#O.values(),p=[f[0]??0,f[1]??1],m=this.#D.values(),h=[m[0]??0,m[1]??1],g=this.#G,_=t.map(e=>this.#Ue(e.dataKey)),v=this.#J.values(),y=v[0]??1,b=v[1]??1,x=(e,t,n)=>{let r=_e(e,t,n,i);return{x:a+r.x*d,y:o-r.y*d}},S=be.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)}];at(e,{gridColor:n.chrome.grid,axisColor:n.chrome.baseline,corners:S,edges:xe,cubeAlpha:b,axes:T});let E=this.#m*t.length,D=this.#Z;(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.#He(e,`value`);for(let e=0;e<this.#m;e++){let r=n[e]??NaN,s=this.#W[e]??NaN;if(Number.isNaN(r)||Number.isNaN(s))continue;let c=_e(ye(this.#h[e]??0,p),ye(r,h)*y,ye(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.#Z=D,this.#Q.length<k&&(this.#Q=new Int32Array(E));let A=this.#Q.subarray(0,k);for(let e=0;e<k;e++)A[e]=e;A.sort((e,t)=>(O[t]??0)-(O[e]??0));let j=t.map(e=>this.#n.seriesShape(e.dataKey));return it(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=>j[D.seriesIndex[e]??0]??`circle`,alphaAt:e=>_[D.seriesIndex[e]??0]??1,surface:n.chrome.surface}),{center:{x:a,y:o},axes:T}}#lt(e,t){let n=this.#n.seriesSpecs(),r=576,i=null;if(this.#xe()){let a=this.#Z;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.#Fe(),o=this.#Ne();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}#ut(e){let t=this.#n.seriesSpecs();if(this.#xe()){let t=this.#Z;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.#Fe(),r=this.#Ne();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}#dt(){let{crosshair:e,band:t,markers:n,tooltip:r}=this.#t,i=this.#Ze(),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.#H;if(s){let e=this.#te??this.#ut(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(xt(n.ownerDocument));let t=n.children[0];if(t instanceof HTMLElement){let n=this.#n.seriesMeta(),r=this.#ne==null?n.find(e=>{let t=this.#x.get(e.dataKey)?.[i]??NaN;return!Number.isNaN(t)}):n.find(e=>e.dataKey===this.#ne);t.style.opacity=`1`,St(t,r?.shape??`circle`,r?.color??`currentColor`),t.style.transform=`translate3d(${e.x}px, ${e.y}px, 0)`}this.#ft(e.x,e.y);return}let l=this.#Ie(i),u=this.#Se();if(o){let e=this.#U;if(e!=null){let n=ke(e,i),r=Math.max(1,n.size),a=n.start-(r-n.size)/2;u?(t.style.transform=`translate3d(${c.left}px, ${a}px, 0)`,t.style.width=`${c.width}px`,t.style.height=`${r}px`):(t.style.transform=`translate3d(${a}px, ${c.top}px, 0)`,t.style.width=`${r}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(xt(n.ownerDocument));let a=this.#Ne();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.#He(c,this.#E==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.#U!=null?this.#ft(this.#se??c.left+c.width/2,Y(this.#U,i)):this.#ft(l,this.#ce??c.top+8)}#ft(e,t){let n=this.#H,r=this.#t.tooltip,i=this.#le,a=e+12;a+i.width>n.left+n.width&&e-12-i.width>=n.left&&(a=e-12-i.width);let o=Math.max(0,Math.min(t-i.height/2,n.top+n.height-i.height));r.style.transform=`translate3d(${a}px, ${o}px, 0)`}};const vt=e=>e===3?{yaw:.65,pitch:-.35}:{yaw:0,pitch:0},yt=(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},bt={circle:`circle(50%)`,square:`inset(8%)`,triangle:`polygon(50% 0%, 100% 100%, 0% 100%)`,diamond:`polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)`,"triangle-down":`polygon(0% 0%, 100% 0%, 50% 100%)`,plus:`polygon(33.33% 0%, 66.67% 0%, 66.67% 33.33%, 100% 33.33%, 100% 66.67%, 66.67% 66.67%, 66.67% 100%, 33.33% 100%, 33.33% 66.67%, 0% 66.67%, 0% 33.33%, 33.33% 33.33%)`,cross:`polygon(73.57% 2.86%, 97.14% 26.43%, 73.57% 50%, 97.14% 73.57%, 73.57% 97.14%, 50% 73.57%, 26.43% 97.14%, 2.86% 73.57%, 26.43% 50%, 2.86% 26.43%, 26.43% 2.86%, 50% 26.43%)`,star:`polygon(50% 2.45%, 61.8% 38.77%, 100% 38.77%, 69.1% 61.23%, 80.9% 97.55%, 50% 75.1%, 19.1% 97.55%, 30.9% 61.23%, 0% 38.77%, 38.2% 38.77%)`},xt=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=bt[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,wt=(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)}),Tt=e=>e.replaceAll(`|`,`\\|`).replaceAll(/\s*\n\s*/g,` `),Et=e=>e instanceof Date?Number.isNaN(e.getTime())?`—`:e.toISOString():typeof e==`number`?Number.isFinite(e)?String(e):`—`:typeof e==`string`?Tt(e):`—`,Dt=e=>typeof e==`number`&&Number.isFinite(e)?String(e):`—`,Ot=e=>`| ${e.join(` | `)} |`,kt=({data:e,xKey:t,series:n,zKey:r})=>{let i=[Tt(t),...n.map(e=>Tt(e.label)),...r==null?[]:[Tt(r)]],a=e.map(e=>[Et(E(e,t)),...n.map(t=>Dt(E(e,t.dataKey))),...r==null?[]:[Dt(E(e,r))]]);return[Ot(i),Ot(i.map(()=>`---`)),...a.map(e=>Ot(e))].join(`
|
|
2
|
-
`)},At=(e,t)=>e==null?`var(${te(t)})`:ee(e)?`var(${te(e)})`:e,jt={"chart-1":`circle`,"chart-2":`square`,"chart-3":`triangle`,"chart-4":`diamond`,"chart-5":`triangle-down`,"chart-6":`plus`,"chart-7":`cross`,"chart-8":`star`,"chart-other":`circle`},Mt=(e,t)=>e??jt[t],Nt={1:`chart-1`,2:`chart-2`,3:`chart-3`,4:`chart-4`,5:`chart-5`,6:`chart-6`,7:`chart-7`,8:`chart-8`,other:`chart-other`},Pt=e=>{let t=new Set;for(let n of e)n.seriesSlot!=null&&n.seriesSlot!==`other`&&t.add(Nt[n.seriesSlot]);let n=new Map,r=new Set(t);for(let t of e){if(t.seriesSlot!=null){n.set(t.dataKey,Nt[t.seriesSlot]);continue}let e=ne.find(e=>!r.has(e))??`chart-other`;n.set(t.dataKey,e),r.add(e)}return n};var Ft=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=0;#a=null;#o=`vertical`;#s=null;#c=null;#l=new Map;#u=new Map;#d=null;#f=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)}seriesShape(e){let t=this.seriesSpecs(),n=Pt(t).get(e)??`chart-other`;return Mt(t.find(t=>t.dataKey===e)?.shape,n)}registerSeries(e){let t=this.#r.get(e.dataKey)??this.#i++;return this.#r.set(e.dataKey,t),this.#n.set(e.dataKey,{spec:e,sequence:t}),this.#p({seriesChanged:!0}),()=>{this.#n.get(e.dataKey)?.spec===e&&(this.#n.delete(e.dataKey),this.#p({seriesChanged:!0}))}}setOrientation(e){this.#o!==e&&(this.#o=e,this.#p())}registerGrid(e){let t={lines:e};return this.#a=t,this.#p(),()=>{this.#a===t&&(this.#a=null,this.#p())}}registerXAxis(e){return this.#s=e,this.#p(),()=>{this.#s===e&&(this.#s=null,this.#p())}}registerYAxis(e){return this.#c=e,this.#p(),()=>{this.#c===e&&(this.#c=null,this.#p())}}registerReferenceLine(e,t){let n=this.#u.get(e)??this.#i++;return this.#u.set(e,n),this.#l.set(e,{spec:t,sequence:n}),this.#p(),()=>{this.#l.get(e)?.spec===t&&(this.#l.delete(e),this.#p())}}registerTooltip(e){return this.#d=e,this.#p(),()=>{this.#d===e&&(this.#d=null,this.#p())}}publishHover(e){this.#f!==e&&(this.#f=e,this.#t={...this.#t,hover:e},this.#m())}seriesMeta(){let e=this.seriesSpecs(),t=Pt(e);return e.map(e=>{let n=t.get(e.dataKey)??`chart-other`;return{dataKey:e.dataKey,label:e.label,mark:e.mark,color:At(e.color,n),colorInput:e.color??n,shape:Mt(e.shape,n),texture:e.texture}})}#p(e={seriesChanged:!1}){this.#t={series:this.seriesMeta(),hover:this.#f,grid:this.#a,xAxis:this.#s,yAxis:this.#c,referenceLines:[...this.#l.values()].toSorted((e,t)=>e.sequence-t.sequence).map(e=>e.spec),tooltip:this.#d,orientation:this.#o},this.#m(),e.seriesChanged?this.onSeriesChange?.():this.onPresentationChange?.()}#m(){for(let e of this.#e)e()}};const It=a(null),Q=e=>{let t=o(It);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},Lt=e=>p(e.subscribe,e.getSnapshot,e.getSnapshot),Rt=(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`},zt=[`auto`,`auto`],Bt=({kind:r,componentName:i,slotName:a,data:o,xKey:s,xScale:p,zKey:v,dimensions:y=3,yDomain:b=zt,stacked:x=!1,orientation:S=`vertical`,animate:C=!0,pending:w=!1,decorative:T=!1,activeIndex:D,onActiveIndexChange:O,onDatumActivate:k,className:A,children:j,ref:ee,"data-slot":te,"aria-label":ne,"aria-labelledby":re,"aria-hidden":M,tabIndex:ie,...ae})=>{let[N]=f(()=>new Ft),P=d(null),[F]=f(()=>({kind:r,componentName:i,store:N,engineRef:P,dataRef:{current:{data:o,xKey:s,zKey:v}}}));l(()=>{F.dataRef.current={data:o,xKey:s,zKey:v}},[F,o,s,v]);let I=d(null),L=e(I,ee),R=d(null),z=d(null),B=d(null),V=d(null),oe=d(null),se=d(null),H=c(),U=r===`bar`?`band`:p??Rt(o,s);m(r!==`scatter`||o.length===0||U!==`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[ce,le]=b,W=u(()=>{for(let e of o){let t=E(e,s);if(t instanceof Date&&pe(t))return!0}return!1},[o,s]);return l(()=>{let e=I.current,t=R.current,n=z.current,i=B.current,a=V.current,o=oe.current,s=se.current;if(e==null||t==null||n==null||i==null||a==null||o==null||s==null)return;let c=new _t({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:U,yDomain:[ce,le],zKey:v??null,dimensions:y,stacked:x,orientation:S,animate:C}),N.setOrientation(S)},[N,s,U,ce,le,v,y,x,S,C]),l(()=>{P.current?.setRows(o)},[o]),l(()=>{P.current?.setCallbacks(T?{onDatumActivate:null,onActiveIndexChange:null}:{onDatumActivate:k??null,onActiveIndexChange:O??null})}),l(()=>{P.current?.setControlledActiveIndex(T?void 0:D)},[T,D]),l(()=>{P.current?.flushIngest()}),g(`div`,{"data-slot":n(te,a),className:t(`relative flex aspect-video w-full flex-col`,A),"aria-hidden":T?!0:M,tabIndex:T?void 0:ie,ref:L,...ae,children:_(It.Provider,{value:F,children:[_(`div`,{"data-slot":`${a}-plot`,className:t(`relative min-h-0 w-full flex-1`,w&&`opacity-60 transition-opacity duration-300`),ref:R,children:[g(`canvas`,{"data-slot":`${a}-canvas`,ref:z,"aria-hidden":!0,className:`absolute inset-0 size-full`}),T?null:_(h,{children:[g(`div`,{role:`application`,"aria-label":ne,"aria-labelledby":re,"aria-describedby":H,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`&&v!=null&&`touch-none cursor-grab active:cursor-grabbing`),onPointerDown:e=>{e.isTrusted&&r===`scatter`&&v!=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:H,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`,{"data-slot":`${a}-crosshair`,ref:B,"aria-hidden":!0,className:`bg-neutral-500 pointer-events-none absolute left-0 top-0 w-px opacity-0`}),g(`div`,{"data-slot":`${a}-hover-band`,ref:V,"aria-hidden":!0,className:`bg-neutral-500/10 pointer-events-none absolute left-0 top-0 rounded-sm opacity-0`}),g(`div`,{"data-slot":`${a}-markers`,ref:oe,"aria-hidden":!0,className:`pointer-events-none absolute inset-0 opacity-0`}),g(Jt,{slotName:a,store:N,tooltipRef:se,xHasTimeOfDay:W})]}),j,T?null:_(h,{children:[g(tn,{store:N,xHasTimeOfDay:W}),g(nn,{data:o,label:ne,slotName:a,store:N,xHasTimeOfDay:W,xKey:s,zKey:v})]})]})})},Vt=(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,seriesSlot:o,color:s,curve:c=`linear`,markers:u=!1,connectNulls:d=!1,shape:f,texture:p=`solid`}=n;return l(()=>r.store.registerSeries({dataKey:i,label:a??i,seriesSlot:o,color:s,mark:t,curve:c,markers:u,connectNulls:d,shape:f,texture:p}),[r.store,i,a,o,s,t,c,u,d,f,p]),null},Ht=(e,t)=>{let n=Q(e),{lines:r}=t;return l(()=>n.store.registerGrid(r),[n.store,r]),null},Ut=(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},Wt=(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},Gt=(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},Kt=(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},qt=(e,t,n)=>e==null?`—`:n==null?G(e):n(e,t),Jt=({slotName:n,store:r,tooltipRef:i,xHasTimeOfDay:a})=>{let o=Lt(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?K(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:qt(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?`—`:G(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)`,Yt=`forced-color-adjust-none [print-color-adjust:exact] [-webkit-print-color-adjust:exact]`,Xt={hatch:({ink:e})=>({backgroundImage:$(`135deg`,e)}),"hatch-reverse":({ink:e})=>({backgroundImage:$(`45deg`,e)}),crosshatch:({ink:e})=>({backgroundImage:`${$(`135deg`,e,4)}, ${$(`45deg`,e,4)}`}),perpendicular:({ink:e,orientation:t})=>({backgroundImage:$(t===`horizontal`?`90deg`:`0deg`,e)}),parallel:({ink:e,orientation:t})=>({backgroundImage:$(t===`horizontal`?`0deg`:`90deg`,e)}),grid:({ink:e})=>({backgroundImage:`${$(`0deg`,e,4)}, ${$(`90deg`,e,4)}`}),dots:({ink:e})=>({backgroundImage:`radial-gradient(circle at 1px 1px, ${e} 0.75px, transparent 0.8px)`,backgroundSize:`3px 3px`})},Zt=(e,t,n)=>e===`solid`?{}:Xt[e]({ink:R(t),orientation:n}),Qt=({series:e,orientation:n})=>e.mark===`bar`?g(`span`,{"aria-hidden":!0,"data-texture":e.texture,className:t(`size-2 shrink-0 rounded-[2px]`,Yt),style:{backgroundColor:e.color,...Zt(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`,Yt),style:{backgroundColor:e.color}}),g(`span`,{"data-shape":e.shape,className:t(`relative size-2`,Yt),style:{backgroundColor:e.color,clipPath:bt[e.shape]}})]}):g(`span`,{"aria-hidden":!0,"data-shape":e.shape,className:t(`size-2 shrink-0`,Yt),style:{backgroundColor:e.color,clipPath:bt[e.shape]}}),$t=({partName:e,slotName:n,className:r,children:i,...a})=>{let o=Q(e),s=Lt(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(Qt,{series:e,orientation:s.orientation}),e.label]},e.dataKey)):i(s.series)})},en=({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=kt({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})},tn=({store:e,xHasTimeOfDay:t})=>{let n=Lt(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`:G(e.value)}`).join(`, `),n=a.zValue===void 0?``:`, z: ${a.zValue==null?`no data`:G(a.zValue)}`,r=setTimeout(()=>{i(`${K(a.xValue,{datasetHasTimeOfDay:t})}. ${e}${n}`)},120);return()=>clearTimeout(r)},[a,t]),g(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:r})},nn=({data:e,label:t,slotName:n,store:r,xHasTimeOfDay:i,xKey:a,zKey:o})=>{let s=Lt(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?K(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?G(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?G(t):`—`})})()]},t)})})]})})};export{Gt as a,Ut as c,Ht as i,Wt as l,$t as n,Vt as o,Bt as r,Kt as s,en as t};
|
package/dist/popover-CQ9s7jG5.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{jsx as t}from"react/jsx-runtime";import*as n from"@radix-ui/react-popover";const r=n.Root,i=n.Trigger,a={Root:r,Anchor:n.Anchor,Close:n.Close,Content:({align:r=`center`,className:i,onClick:a,preferredWidth:o=`max-w-72`,ref:s,sideOffset:c=4,...l})=>t(n.Portal,{children:t(n.Content,{align:r,"data-slot":`popover-content`,className:e(`text-popover-foreground border-popover bg-popover data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 z-50 rounded-md border p-4 shadow-md outline-hidden`,o,i),onClick:e=>{e.stopPropagation(),a?.(e)},ref:s,sideOffset:c,...l})}),Trigger:i};export{a as t};
|