@graphysdk/react-renderer 0.0.1-plugins.0 → 0.0.1-plugins.10

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.
@@ -1,153 +0,0 @@
1
- import { jsx as f } from "react/jsx-runtime";
2
- import { useRef as d, useState as p, useCallback as l, useLayoutEffect as m, useMemo as v } from "react";
3
- import { createPortal as w } from "react-dom";
4
- import { a as h } from "./tooltip-body-Cp_va3oW.js";
5
- import { w as M, P as $, S as k, T as K, x as U, y as X, z as Y, f as j, t as q, l as F, k as Z, A as J, v as Q } from "./tooltip-body-Cp_va3oW.js";
6
- import { DEFAULT_COLOR_PALETTE as g, RESTING_HOVER_STATE as b } from "@graphysdk/viz-engine";
7
- function C(e, t) {
8
- return {
9
- type: e.type,
10
- zOrder: t.zOrder,
11
- draw: t.draw
12
- };
13
- }
14
- const R = 2147483646;
15
- function z() {
16
- const e = d(null), [t, r] = p(null), n = l(() => {
17
- const o = e.current;
18
- if (!o) return;
19
- const s = o.getBoundingClientRect(), u = {
20
- left: s.left,
21
- top: s.top,
22
- width: s.width,
23
- height: s.height
24
- };
25
- r((c) => c && E(c, u) ? c : u);
26
- }, []), i = l(
27
- (o) => {
28
- e.current = o;
29
- },
30
- []
31
- // stable, so attaching the ref never re-triggers the effect
32
- );
33
- return m(() => {
34
- if (!e.current) return;
35
- n();
36
- const o = new ResizeObserver(n);
37
- return o.observe(e.current), window.addEventListener("resize", n), window.addEventListener("scroll", n, !0), () => {
38
- o.disconnect(), window.removeEventListener("resize", n), window.removeEventListener("scroll", n, !0);
39
- };
40
- }, [n]), { ref: i, rect: t };
41
- }
42
- function A({ rect: e, children: t }) {
43
- return w(
44
- /* @__PURE__ */ f(
45
- "div",
46
- {
47
- style: {
48
- position: "fixed",
49
- left: e.left,
50
- top: e.top,
51
- width: e.width,
52
- height: e.height,
53
- pointerEvents: "none",
54
- zIndex: R,
55
- overflow: "visible"
56
- },
57
- children: t
58
- }
59
- ),
60
- document.body
61
- );
62
- }
63
- function E(e, t) {
64
- return e.left === t.left && e.top === t.top && e.width === t.width && e.height === t.height;
65
- }
66
- function* O(e, t) {
67
- for (const r of e)
68
- yield { kind: r[t], observation: r };
69
- }
70
- function B(e, t, r, n) {
71
- return e >= r && t >= n;
72
- }
73
- const _ = ({ children: e, style: t, ...r }) => /* @__PURE__ */ f(
74
- "svg",
75
- {
76
- width: "100%",
77
- height: "100%",
78
- viewBox: "0 0 1 1",
79
- preserveAspectRatio: "none",
80
- ...r,
81
- style: { overflow: "visible", ...t },
82
- children: e
83
- }
84
- );
85
- function H() {
86
- return v(() => {
87
- const e = g;
88
- return (t) => e[t % e.length] ?? e[0] ?? "#000000";
89
- }, []);
90
- }
91
- function N(e, t) {
92
- const { hitTesterRegistry: r } = h(), n = d(t);
93
- n.current = t, m(() => {
94
- const i = (o) => n.current(o);
95
- return r.set(e, i), () => {
96
- r.delete(e);
97
- };
98
- }, [r, e]);
99
- }
100
- function G(e) {
101
- const { engine: t, store: r, setCursor: n } = h();
102
- return l(
103
- (i, o) => {
104
- if (i === null) {
105
- r.getState().setHoverState(b), n(null);
106
- return;
107
- }
108
- r.getState().setHoverState(t.hoverByKey(e, i)), o && n(o);
109
- },
110
- [t, r, n, e]
111
- );
112
- }
113
- function x(e, t, r) {
114
- const n = a(e), i = a(t), o = (s, u) => Math.round(s + (u - s) * r);
115
- return `rgb(${o(n.red, i.red)}, ${o(n.green, i.green)}, ${o(n.blue, i.blue)})`;
116
- }
117
- function V(e, t) {
118
- return x(e, "#ffffff", t);
119
- }
120
- function a(e) {
121
- const t = e.replace("#", "");
122
- return {
123
- red: Number.parseInt(t.slice(0, 2), 16),
124
- green: Number.parseInt(t.slice(2, 4), 16),
125
- blue: Number.parseInt(t.slice(4, 6), 16)
126
- };
127
- }
128
- export {
129
- M as CompanionDot,
130
- A as PanelOverlayPortal,
131
- $ as PrimaryDot,
132
- k as Swatch,
133
- K as TooltipBody,
134
- U as TooltipRowView,
135
- _ as UnitSpaceSvg,
136
- C as defineAnnotationRenderer,
137
- X as defineGeomPlugin,
138
- Y as defineGeomRenderer,
139
- j as emToPx,
140
- B as fitsLabel,
141
- V as lighten,
142
- x as mixColor,
143
- O as partitionByKind,
144
- q as toPercent,
145
- F as toViewBoxX,
146
- Z as toViewBoxY,
147
- H as useCategoricalColor,
148
- N as useGeomHitTest,
149
- G as useGeomHover,
150
- z as usePanelScreenRect,
151
- J as useSvgPathMorph,
152
- Q as vars
153
- };
@@ -1,2 +0,0 @@
1
- "use strict";const s=require("react/jsx-runtime"),f=require("react"),Le=require("zustand/react/shallow"),Ne=require("zustand"),l=require("@graphysdk/viz-engine"),se=require("zustand/vanilla"),L=require("motion/react"),R=require("d3-shape"),$e=require("d3-interpolate-path"),de=require("color2k"),Ye=require("clsx"),Ue=(t=[])=>{const e=new Map;for(const n of t)e.set(n.type,n);return n=>e.get(n)??null},Ve=5,Ke=t=>{if(process.env.NODE_ENV==="production")return{emit:()=>{},subscribe:()=>Ze,getLastTrigger:()=>null,getLastCompile:()=>null,getCacheStats:()=>t.getCacheStats()};const e=new Set;let n=null;return{emit:r=>{const i=t.getLastCompile();if(i){n=r;for(const a of e)a(r,i)}},subscribe:r=>(e.add(r),()=>{e.delete(r)}),getLastTrigger:()=>n,getLastCompile:()=>t.getLastCompile(),getCacheStats:()=>t.getCacheStats()}},qe=()=>se.createStore(t=>({lastCompile:null,history:[],nextId:1,lastSnapshot:null,recordCompile:(e,n)=>t(r=>{if(r.lastSnapshot===n)return r;const i={id:r.nextId,label:Je(e),stages:n.stages,durationMs:n.durationMs};return{lastCompile:i,history:Qe(r.history,i,Ve),nextId:r.nextId+1,lastSnapshot:n}})})),Ze=()=>{},Je=t=>{switch(t.kind){case"init":return"init";case"input":return"input change";case"data":return"data change";case"command":return t.command.metadata.description}},Qe=(t,e,n)=>{const r=t.length>=n?t.length-(n-1):0;return[...t.slice(r),e]};function et(t){return t}function tt(t,e){return{...e,geom:t.type,highlightStrategy:t.highlightStrategy}}var nt=["canvasDefault","canvasBlue","canvasCyan","canvasGreen","canvasYellow","canvasOrange","canvasRed","canvasPink","canvasPurple","canvasGray","canvasInverse"],o={white:"var(--graphy-white)",black:"var(--graphy-black)",transparent:"var(--graphy-transparent)",grey100:"var(--graphy-grey-100)",grey95:"var(--graphy-grey-95)",grey90:"var(--graphy-grey-90)",grey85:"var(--graphy-grey-85)",grey80:"var(--graphy-grey-80)",grey75:"var(--graphy-grey-75)",grey70:"var(--graphy-grey-70)",grey60:"var(--graphy-grey-60)",grey50:"var(--graphy-grey-50)",grey0:"var(--graphy-grey-0)",greyGradient80:"var(--graphy-grey-gradient-80)",green60:"var(--graphy-green-60)",green50:"var(--graphy-green-50)",red60:"var(--graphy-red-60)",red50:"var(--graphy-red-50)",amber70:"var(--graphy-amber-70)",amber50:"var(--graphy-amber-50)",amber40:"var(--graphy-amber-40)",amber30:"var(--graphy-amber-30)",blue80:"var(--graphy-blue-80)",blue60:"var(--graphy-blue-60)",purple50:"var(--graphy-purple-50)",purple30:"var(--graphy-purple-30)",brand:"var(--graphy-brand)",success:"var(--graphy-success)",warning:"var(--graphy-warning)",alert:"var(--graphy-alert)",textPrimary:"var(--graphy-text-primary)",textSecondary:"var(--graphy-text-secondary)",textDisabled:"var(--graphy-text-disabled)",iconPrimary:"var(--graphy-icon-primary)",iconSecondary:"var(--graphy-icon-secondary)",iconStickerBackground:"var(--graphy-icon-sticker-background)",border100:"var(--graphy-border-100)",border50:"var(--graphy-border-50)",border10:"var(--graphy-border-10)",sunkenBackground:"var(--graphy-sunken-background)",defaultBackground:"var(--graphy-default-background)",raisedBackground:"var(--graphy-raised-background)",overlayBackground:"var(--graphy-overlay-background)",overlayBorderGradient:"var(--graphy-overlay-border-gradient)",graphBackground:"var(--graphy-graph-background)",gridLineColor:"var(--graphy-grid-line-color)",originLineColor:"var(--graphy-origin-line-color)",targetLineColor:"var(--graphy-target-line-color)",targetLineMarkerColor:"var(--graphy-target-line-marker-color)",targetLineLabelTextColor:"var(--graphy-target-line-label-text-color)",legendBackground:"var(--graphy-legend-background)",legendBorderColor:"var(--graphy-legend-border-color)",legendFocusOutlineColor:"var(--graphy-legend-focus-outline-color)",legendTextColor:"var(--graphy-legend-text-color)",dimmedSeriesLabelTextColor:"var(--graphy-dimmed-series-label-text-color)",dimmedSeriesLabelLineColor:"var(--graphy-dimmed-series-label-line-color)",trendNegativeColor:"var(--graphy-trend-negative-color)",trendPositiveColor:"var(--graphy-trend-positive-color)",trendNeutralColor:"var(--graphy-trend-neutral-color)",defaultAnnotationArrowStroke:"var(--graphy-default-annotation-arrow-stroke)",defaultAnnotationShapeStroke:"var(--graphy-default-annotation-shape-stroke)",defaultAnnotationShapeFill:"var(--graphy-default-annotation-shape-fill)",arrowAnnotationStickerOutlineColor:"var(--graphy-arrow-annotation-sticker-outline-color)",arrowAnnotationStickerOutlineColorInverse:"var(--graphy-arrow-annotation-sticker-outline-color-inverse)",annotationFrameBorderColor:"var(--graphy-annotation-frame-border-color)",annotationMenuTriggerIconColor:"var(--graphy-annotation-menu-trigger-icon-color)",heatmapEmptyTileBackground:"var(--graphy-heatmap-empty-tile-background)",dataLabelOutsideBackground:"var(--graphy-data-label-outside-background)",canvasDefault:"var(--graphy-canvas-default)",canvasBlue:"var(--graphy-canvas-blue)",canvasCyan:"var(--graphy-canvas-cyan)",canvasGreen:"var(--graphy-canvas-green)",canvasYellow:"var(--graphy-canvas-yellow)",canvasOrange:"var(--graphy-canvas-orange)",canvasRed:"var(--graphy-canvas-red)",canvasPink:"var(--graphy-canvas-pink)",canvasPurple:"var(--graphy-canvas-purple)",canvasGray:"var(--graphy-canvas-gray)",canvasInverse:"var(--graphy-canvas-inverse)",elevationXs:"var(--graphy-elevation-xs)",elevationSm:"var(--graphy-elevation-sm)",elevationMd:"var(--graphy-elevation-md)",elevationLg:"var(--graphy-elevation-lg)",radiiXs:"var(--graphy-radii-xs)",radiiSm:"var(--graphy-radii-sm)",radiiMd:"var(--graphy-radii-md)",radiiLg:"var(--graphy-radii-lg)",spaceXxs:"var(--graphy-space-xxs)",spaceXs:"var(--graphy-space-xs)",spaceSm:"var(--graphy-space-sm)",spaceMd:"var(--graphy-space-md)",spaceLg:"var(--graphy-space-lg)",spaceXl:"var(--graphy-space-xl)",zIndexToolbar:"var(--graphy-z-index-toolbar)",zIndexToolbarTooltip:"var(--graphy-z-index-toolbar-tooltip)",zIndexToolbarPopover:"var(--graphy-z-index-toolbar-popover)",toolbarBackgroundColor:"var(--graphy-toolbar-background-color)",toolbarButtonBackgroundColor:"var(--graphy-toolbar-button-background-color)",toolbarButtonBackgroundColorHovered:"var(--graphy-toolbar-button-background-color-hovered)",toolbarButtonBackgroundColorSelected:"var(--graphy-toolbar-button-background-color-selected)",toolbarSeparatorColor:"var(--graphy-toolbar-separator-color)",tooltipBackground:"var(--graphy-tooltip-background)",tooltipBorderColor:"var(--graphy-tooltip-border-color)",tooltipHeadingTextColor:"var(--graphy-tooltip-heading-text-color)",tooltipLabelTextColor:"var(--graphy-tooltip-label-text-color)",tooltipValueTextColor:"var(--graphy-tooltip-value-text-color)",tooltipPrimaryRowColor:"var(--graphy-tooltip-primary-row-color)",hoverGuideLineColor:"var(--graphy-hover-guide-line-color)",hoverGuideFillColor:"var(--graphy-hover-guide-fill-color)",hoveredBarBorderColor:"var(--graphy-hovered-bar-border-color)",hoveredPointRingColor:"var(--graphy-hovered-point-ring-color)",pointStrokeColor:"var(--graphy-point-stroke-color)",stackedBarHoverBorderColor:"var(--graphy-stacked-bar-hover-border-color)",fontFamilyDefault:"var(--graphy-font-family-default)",fontFamilyHeading:"var(--graphy-font-family-heading)",fontWeightRegular:"var(--graphy-font-weight-regular)",fontWeightMedium:"var(--graphy-font-weight-medium)",fontWeightSemibold:"var(--graphy-font-weight-semibold)",fontWeightBold:"var(--graphy-font-weight-bold)",fontWeightExtraBold:"var(--graphy-font-weight-extra-bold)",fontWeightBlack:"var(--graphy-font-weight-black)",textScale:"var(--graphy-text-scale)",fontSizeXxs:"var(--graphy-font-size-xxs)",fontSizeXs:"var(--graphy-font-size-xs)",fontSizeSm:"var(--graphy-font-size-sm)",fontSizeMd:"var(--graphy-font-size-md)",fontSizeLg:"var(--graphy-font-size-lg)",fontSizeXl:"var(--graphy-font-size-xl)",fontLineHeightXxs:"var(--graphy-font-line-height-xxs)",fontLineHeightXs:"var(--graphy-font-line-height-xs)",fontLineHeightSm:"var(--graphy-font-line-height-sm)",fontLineHeightMd:"var(--graphy-font-line-height-md)",fontLineHeightLg:"var(--graphy-font-line-height-lg)",fontLineHeightXl:"var(--graphy-font-line-height-xl)",fontSizeEditorBody:"var(--graphy-font-size-editor-body)",fontSizeHeadingSm:"var(--graphy-font-size-heading-sm)",fontSizeHeadingMd:"var(--graphy-font-size-heading-md)",fontSizeHeadingLg:"var(--graphy-font-size-heading-lg)",fontLineHeightEditorBody:"var(--graphy-font-line-height-editor-body)",fontLineHeightHeadingSm:"var(--graphy-font-line-height-heading-sm)",fontLineHeightHeadingMd:"var(--graphy-font-line-height-heading-md)",fontLineHeightHeadingLg:"var(--graphy-font-line-height-heading-lg)",fontTickLabel:"var(--graphy-font-tick-label)",fontAxisLabel:"var(--graphy-font-axis-label)",fontDataLabel:"var(--graphy-font-data-label)",fontStackTotal:"var(--graphy-font-stack-total)",fontLegendLabel:"var(--graphy-font-legend-label)",fontSeriesLabel:"var(--graphy-font-series-label)",fontTooltipLabel:"var(--graphy-font-tooltip-label)",fontTooltipHeading:"var(--graphy-font-tooltip-heading)",fontTooltipFooter:"var(--graphy-font-tooltip-footer)",fontJumboTooltipLabel:"var(--graphy-font-jumbo-tooltip-label)",fontJumboTooltip:"var(--graphy-font-jumbo-tooltip)",fontMiniTooltipLabel:"var(--graphy-font-mini-tooltip-label)",fontMiniTooltipFooter:"var(--graphy-font-mini-tooltip-footer)",fontTooltipCaption:"var(--graphy-font-tooltip-caption)",fontTooltipCaptionSmall:"var(--graphy-font-tooltip-caption-small)",fontTrendTag:"var(--graphy-font-trend-tag)",fontTrendTagSmall:"var(--graphy-font-trend-tag-small)",fontGoalLineLabel:"var(--graphy-font-goal-line-label)",fontPieLabel:"var(--graphy-font-pie-label)",fontPieChartTotal:"var(--graphy-font-pie-chart-total)",fontDifferenceArrowSmall:"var(--graphy-font-difference-arrow-small)",fontDifferenceArrowMedium:"var(--graphy-font-difference-arrow-medium)",fontDifferenceArrowLarge:"var(--graphy-font-difference-arrow-large)",fontButton:"var(--graphy-font-button)",fontInput:"var(--graphy-font-input)",fontInputLabel:"var(--graphy-font-input-label)",fontSelectLabel:"var(--graphy-font-select-label)",fontSelectDescription:"var(--graphy-font-select-description)",fontColorSelectLabel:"var(--graphy-font-color-select-label)",fontMenuTitle:"var(--graphy-font-menu-title)",fontMenuGroupTitle:"var(--graphy-font-menu-group-title)",fontMenuItemLabel:"var(--graphy-font-menu-item-label)",fontMenuItemLabelSecondary:"var(--graphy-font-menu-item-label-secondary)",fontUITooltip:"var(--graphy-font-uitooltip)",fontUITooltipSecondary:"var(--graphy-font-uitooltip-secondary)",fontErrorBoundaryTitle:"var(--graphy-font-error-boundary-title)",fontErrorBoundaryMessage:"var(--graphy-font-error-boundary-message)",fontTableCell:"var(--graphy-font-table-cell)",fontTableHeaderCell:"var(--graphy-font-table-header-cell)",fontSourceLabel:"var(--graphy-font-source-label)",fontSourceLink:"var(--graphy-font-source-link)",fontTextEditorH1:"var(--graphy-font-text-editor-h1)",fontTextEditorH2:"var(--graphy-font-text-editor-h2)",fontTextEditorH3:"var(--graphy-font-text-editor-h3)",fontTextEditorH6:"var(--graphy-font-text-editor-h6)",fontTextEditorBody:"var(--graphy-font-text-editor-body)",fontTextEditorLink:"var(--graphy-font-text-editor-link)",fontHighlightModeTitle:"var(--graphy-font-highlight-mode-title)",fontHighlightModeSubtitle:"var(--graphy-font-highlight-mode-subtitle)"};const le=1,Te=8,ot=12;o.pointStrokeColor;const rt=1;function at(t){return t}function j(t){return 1-t}const x=t=>`${Number.parseFloat((t*100).toFixed(4))}%`,it=2,st=.7,B=({hit:t})=>{const e=l.getColor(t.observation),n=(l.getAlpha(t.observation)??le)*st,r=(l.getSize(t.observation)??Te)/2;return s.jsx("circle",{cx:x(t.x),cy:x(j(t.y)),r,fill:e,opacity:n,stroke:o.hoveredPointRingColor,strokeWidth:it,"data-testid":"companion-point"})},Me=.3,Ce=1,C={type:"spring",stiffness:500,damping:60,mass:1},ke=1,lt=2,He=t=>t==="catmull-rom"?R.curveCatmullRom:R.curveLinear,q=t=>{switch(t){case"dashed":return"8 4";case"dotted":return"2 2";case"solid":return}},Z=(t,e)=>e.lineWidth!=="auto"?e.lineWidth:l.getStrokeWidth(t)??lt,J=t=>e=>`${t}:${l.getIdentityKey(e)}`,V=(t,e)=>{const n=L.useMotionValue(t);return f.useEffect(()=>{const r=$e.interpolatePath(n.get(),t);L.animate(0,1,{...e,onUpdate:i=>{const a=r(i);return n.set(a)}})},[e,t,n]),n};var O="_1d8mpa10";const Ae=(t,e)=>{const n=He(e.interpolate),r=R.area().curve(n),i=R.line().curve(n);if(t.mainAxis==="y"){const a=d=>j(l.getY(d)??0),g=d=>l.getXMin(d)??0,c=d=>l.getXMax(d)??l.getX(d)??0;r.y(a).x0(g).x1(c),i.y(a).x(c)}else{const a=d=>l.getX(d)??0,g=d=>j(l.getYMin(d)??0),c=d=>j(l.getYMax(d)??l.getY(d)??0);r.x(a).y0(g).y1(c),i.x(a).y(c)}if(e.missingValues==="gap"){const a=g=>l.getX(g)!==null&&l.getY(g)!==null;r.defined(a),i.defined(a)}return{lineGenerator:i,areaGenerator:r}},Ee=(t,e)=>e!=="connect"?t:t.filter(n=>l.getX(n)!==null&&l.getY(n)!==null),ct=f.memo(function({layer:e,coordSystem:n,isAnimated:r}){const{lineGenerator:i,areaGenerator:a}=f.useMemo(()=>Ae(n,e.params),[e.params,n]),g=f.useMemo(()=>{const c=J(e.id),d=[];return e.data.groupBy(l.GROUP_VARIABLES.group).forEach(u=>{const h=Ee([...u],e.params.missingValues),m=a(h),v=i(h);if(!m||!v)return;const y=h[0];if(!y)return;const S=l.getColor(y),P=l.getAlpha(y),T=Z(y,e.params),k=q(l.getLineType(y));d.push({key:c(y),areaPath:m,linePath:v,color:S,fillOpacity:P??Me,strokeWidth:T,strokeOpacity:Ce,strokeDasharray:k})}),d},[a,i,e.data,e.id,e.params]);return s.jsx("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"area",className:O,children:g.map(c=>s.jsx(gt,{areaPath:c.areaPath,linePath:c.linePath,color:c.color,fillOpacity:c.fillOpacity,strokeWidth:c.strokeWidth,strokeOpacity:c.strokeOpacity,strokeDasharray:c.strokeDasharray,isAnimated:r},c.key))})}),gt=({areaPath:t,linePath:e,color:n,fillOpacity:r,strokeWidth:i,strokeOpacity:a,strokeDasharray:g,isAnimated:c})=>c?s.jsx(dt,{areaPath:t,linePath:e,color:n,fillOpacity:r,strokeWidth:i,strokeOpacity:a,strokeDasharray:g}):s.jsxs("g",{children:[s.jsx("path",{d:t,fill:n,fillOpacity:r,stroke:"none"}),s.jsx("path",{d:e,fill:"none",stroke:n,strokeWidth:i,strokeOpacity:a,strokeDasharray:g,vectorEffect:"non-scaling-stroke"})]}),dt=({areaPath:t,linePath:e,color:n,fillOpacity:r,strokeWidth:i,strokeOpacity:a,strokeDasharray:g})=>{const c=V(t,C),d=V(e,C);return s.jsxs("g",{children:[s.jsx(L.motion.path,{d:c,fill:n,fillOpacity:r,stroke:"none"}),s.jsx(L.motion.path,{d,fill:"none",stroke:n,strokeWidth:i,strokeOpacity:a,strokeDasharray:g,vectorEffect:"non-scaling-stroke"})]})};var ht="_46ebsf0";const ne=1,ut=2,ft=1,pt=ot/2,mt=2.25,Q=({hit:t,...e})=>{const n=vt(t.observation),r=l.getColor(t.observation),i=l.getAlpha(t.observation)??le,a=x(t.x),g=x(j(t.y)),d=n+ne/2+ft+ne/2;return s.jsxs("g",{...e,className:ht,children:[s.jsx("circle",{cx:a,cy:g,r:d,fill:"none",stroke:o.hoveredPointRingColor,strokeWidth:ut}),s.jsx("circle",{cx:a,cy:g,r:n,fill:r,opacity:i,stroke:o.hoveredPointRingColor,strokeWidth:ne})]})},vt=t=>{const e=l.getSize(t);return l.isDefined(e)?e/mt:pt},yt=({layer:t,coordSystem:e,primary:n,companions:r})=>{const i=l.getGroup(n.observation),a=f.useMemo(()=>{const v=t.data.filter(l.GROUP_VARIABLES.group,"eq",i);return Ee([...v],t.params.missingValues)},[t.data,t.params.missingValues,i]),{areaPath:g,linePath:c}=f.useMemo(()=>{const{lineGenerator:v,areaGenerator:y}=Ae(e,t.params);return{areaPath:y(a)??"",linePath:v(a)??""}},[e,t.params,a]);if(!g||!c)return null;const d=l.getColor(n.observation),u=l.getAlpha(n.observation)??Me,h=Z(n.observation,t.params),m=q(l.getLineType(n.observation));return s.jsxs("g",{"data-testid":"hovered-area",children:[s.jsxs("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"area",className:O,children:[s.jsx("path",{d:g,fill:d,fillOpacity:u,stroke:"none","data-testid":"hovered-area-fill"}),s.jsx("path",{d:c,fill:"none",stroke:d,strokeWidth:h,strokeOpacity:Ce,strokeDasharray:m,vectorEffect:"non-scaling-stroke","data-testid":"hovered-area-edge"})]}),r.map(v=>s.jsx(B,{hit:v},`companion-${v.layerId}-${v.pointIndex}`)),s.jsx(Q,{hit:n,"data-testid":"hovered-area-point"})]})},xt={geom:"area",coord:"cartesian",highlightStrategy:"overlay-anchor",guideMode:"continuous",render:({layer:t,coordSystem:e,isAnimated:n})=>s.jsx(ct,{layer:t,coordSystem:e,isAnimated:n}),renderHover:({layer:t,coordSystem:e,primary:n,group:r,related:i})=>s.jsx(yt,{layer:t,coordSystem:e,primary:n,companions:[...r,...i]}),renderHoverCompanions:({related:t})=>s.jsx(s.Fragment,{children:t.map(e=>s.jsx(B,{hit:e},`companion-${e.layerId}-${e.pointIndex}`))}),getOverlayAnchor:({observation:t,coordSystem:e})=>{if(e.mainAxis==="x"){const i=l.getX(t),a=l.getYMax(t)??l.getY(t);return i===null||a===null?null:{x:i,y:a}}const n=l.getY(t),r=l.getXMax(t)??l.getX(t);return n===null||r===null?null:{x:r,y:n}}},Ie=1,G=4,Pe=(t,e)=>{const n=l.getXMin(e),r=l.getXMax(e),i=l.getYMin(e),a=l.getYMax(e)??l.getY(e);if(n===null||r===null||i===null||a===null)return null;if(t==="x"){let d=1-a,u=a-i;return u<0&&(d+=u,u=-u),{x:n,y:d,width:r-n,height:u}}let g=n,c=r-n;return c<0&&(g+=c,c=-c),{x:g,y:1-a,width:c,height:a-i}},St=f.memo(function({layer:e,coordSystem:n,isAnimated:r}){const i=f.useId(),a=f.useMemo(()=>{const c=J(e.id),d=new Map;for(const u of e.data){const h=Pe(n.mainAxis,u);if(!h)continue;const m=Lt(n.mainAxis,h),v=d.get(m),y={key:c(u),...h,fill:l.getColor(u),opacity:l.getAlpha(u)??Ie};v?v.push(y):d.set(m,[y])}return[...d.entries()].map(([u,h])=>({id:`${i}${u}`,bars:h,...Tt(h)}))},[i,n.mainAxis,e]),g=a.filter(c=>c.bars.length>1);return s.jsxs(s.Fragment,{children:[g.length>0&&s.jsx("defs",{children:g.map(c=>s.jsx("clipPath",{id:c.id,children:s.jsx(bt,{column:c,isAnimated:r})},c.id))}),a.map(c=>{const[d]=c.bars;if(c.bars.length===1&&d!==void 0){const{key:u,...h}=d;return s.jsx(he,{...h,rx:G,isAnimated:r},u)}return s.jsx("g",{clipPath:`url(#${c.id})`,children:c.bars.map(u=>{const{key:h,...m}=u;return s.jsx(he,{...m,isAnimated:r},h)})},c.id)})]})}),he=({isAnimated:t,rx:e,...n})=>t?s.jsx(L.motion.rect,{initial:!1,style:{transformBox:"view-box"},transition:C,fill:n.fill,opacity:n.opacity,rx:e,animate:{x:x(n.x),y:x(n.y),width:x(n.width),height:x(n.height),opacity:n.opacity}}):s.jsx("rect",{style:{transformBox:"view-box"},x:x(n.x),y:x(n.y),width:x(n.width),height:x(n.height),fill:n.fill,opacity:n.opacity,rx:e}),bt=({column:t,isAnimated:e})=>e?s.jsx(L.motion.rect,{initial:!1,style:{transformBox:"view-box"},transition:C,rx:G,animate:{x:x(t.x),y:x(t.y),width:x(t.width),height:x(t.height)}}):s.jsx("rect",{x:x(t.x),y:x(t.y),width:x(t.width),height:x(t.height),rx:G}),Lt=(t,e)=>t==="x"?`${e.x}-${e.width}`:`${e.y}-${e.height}`,Tt=t=>{let e=1/0,n=1/0,r=-1/0,i=-1/0;for(const a of t)a.x<e&&(e=a.x),a.y<n&&(n=a.y),a.x+a.width>r&&(r=a.x+a.width),a.y+a.height>i&&(i=a.y+a.height);return{x:e,y:n,width:r-e,height:i-n}};var Mt="_1i6dtb60";const D=3,Ct=({coordSystem:t,primary:e,panelRect:n})=>{const r=Pe(t.mainAxis,e.observation);if(!r)return null;const i=r.x*n.width,a=r.y*n.height,g=r.width*n.width,c=r.height*n.height,d=i-D,u=a-D,h=g+D*2,m=c+D*2,v=G+D,y=l.getColor(e.observation),S=l.getAlpha(e.observation)??Ie;return s.jsxs("g",{"data-testid":"hovered-bar",children:[s.jsx("rect",{x:d,y:u,width:h,height:m,rx:v,fill:o.hoveredBarBorderColor,className:Mt,"data-testid":"hovered-bar-border"}),s.jsx("rect",{x:x(r.x),y:x(r.y),width:x(r.width),height:x(r.height),fill:y,opacity:S,rx:G,"data-testid":"hovered-bar-fill"})]})},kt={geom:"bar",coord:"cartesian",highlightStrategy:"observation-rerender",guideMode:"bar",render:({layer:t,coordSystem:e,isAnimated:n})=>s.jsx(St,{layer:t,coordSystem:e,isAnimated:n}),renderHover:({coordSystem:t,primary:e,panelRect:n})=>s.jsx(Ct,{coordSystem:t,primary:e,panelRect:n}),renderHoverCompanions:()=>null},_e=t=>{const e=R.line().x(n=>l.getX(n)??0).y(n=>j(l.getY(n)??0)).curve(He(t.interpolate));return t.missingValues==="gap"&&e.defined(n=>l.getX(n)!==null&&l.getY(n)!==null),e},je=(t,e)=>e!=="connect"?t:t.filter(n=>l.getX(n)!==null&&l.getY(n)!==null),Ht=f.memo(function({layer:e,isAnimated:n}){const r=f.useMemo(()=>_e(e.params),[e.params]),i=f.useMemo(()=>{const a=J(e.id),g=[];return e.data.groupBy(l.GROUP_VARIABLES.group).forEach(c=>{const d=je([...c],e.params.missingValues),u=r(d);if(!u)return;const h=d[0];if(!h)return;const m=l.getColor(h),v=l.getAlpha(h),y=Z(h,e.params),S=q(l.getLineType(h));g.push({key:a(h),pathData:u,color:m,opacity:v??ke,strokeWidth:y,strokeDasharray:S})}),g},[r,e.data,e.id,e.params]);return s.jsx("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"line",className:O,children:i.map(a=>s.jsx(At,{pathData:a.pathData,color:a.color,strokeWidth:a.strokeWidth,opacity:a.opacity,strokeDasharray:a.strokeDasharray,isAnimated:n},a.key))})}),At=({pathData:t,color:e,strokeWidth:n,opacity:r,strokeDasharray:i,isAnimated:a})=>a?s.jsx(Et,{pathData:t,color:e,strokeWidth:n,opacity:r,strokeDasharray:i}):s.jsx("path",{d:t,fill:"none",stroke:e,strokeWidth:n,opacity:r,strokeDasharray:i,vectorEffect:"non-scaling-stroke"}),Et=({pathData:t,color:e,strokeWidth:n,opacity:r,strokeDasharray:i})=>{const a=V(t,C);return s.jsx(L.motion.path,{d:a,fill:"none",stroke:e,strokeWidth:n,opacity:r,strokeDasharray:i,vectorEffect:"non-scaling-stroke"})},It=({layer:t,primary:e,companions:n})=>{const r=l.getGroup(e.observation),i=f.useMemo(()=>{const h=t.data.filter(l.GROUP_VARIABLES.group,"eq",r);return je([...h],t.params.missingValues)},[t.data,t.params.missingValues,r]),a=f.useMemo(()=>_e(t.params)(i),[t.params,i]);if(!a)return null;const g=l.getColor(e.observation),c=l.getAlpha(e.observation)??ke,d=Z(e.observation,t.params),u=q(l.getLineType(e.observation));return s.jsxs("g",{"data-testid":"hovered-line",children:[s.jsx("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"line",className:O,children:s.jsx("path",{d:a,fill:"none",stroke:g,strokeWidth:d,opacity:c,strokeDasharray:u,vectorEffect:"non-scaling-stroke","data-testid":"hovered-line-path"})}),n.map(h=>s.jsx(B,{hit:h},`companion-${h.layerId}-${h.pointIndex}`)),s.jsx(Q,{hit:e,"data-testid":"hovered-line-point"})]})},Pt={geom:"line",coord:"cartesian",highlightStrategy:"overlay-anchor",guideMode:"continuous",render:({layer:t,isAnimated:e})=>s.jsx(Ht,{layer:t,isAnimated:e}),renderHover:({layer:t,primary:e,group:n,related:r})=>s.jsx(It,{layer:t,primary:e,companions:[...n,...r]}),renderHoverCompanions:({related:t})=>s.jsx(s.Fragment,{children:t.map(e=>s.jsx(B,{hit:e},`companion-${e.layerId}-${e.pointIndex}`))}),getOverlayAnchor:({observation:t})=>{const e=l.getX(t),n=l.getY(t);return e===null||n===null?null:{x:e,y:n}}},_t=f.memo(function({layer:e,isAnimated:n}){const r=f.useMemo(()=>{const i=[];for(const a of e.data){const g=l.getX(a),c=l.getY(a);if(g===null||c===null)continue;const d=l.getColor(a),u=l.getAlpha(a),h=l.getSize(a),m=l.getStrokeWidth(a);i.push({key:l.getIdentityKey(a),cx:g,cy:j(c),radius:(h??e.params.size)/2,fill:d,stroke:o.pointStrokeColor,opacity:u??le,strokeWidth:m??rt})}return i},[e.data,e.params.size]);return s.jsx(s.Fragment,{children:r.map(i=>n?s.jsx(L.motion.circle,{initial:!1,transition:C,fill:i.fill,stroke:i.stroke,strokeWidth:i.strokeWidth,animate:{cx:x(i.cx),cy:x(i.cy),r:i.radius,opacity:i.opacity}},i.key):s.jsx("circle",{cx:x(i.cx),cy:x(i.cy),r:i.radius,fill:i.fill,opacity:i.opacity,stroke:i.stroke,strokeWidth:i.strokeWidth},i.key))})}),jt={geom:"point",coord:"cartesian",highlightStrategy:"overlay-anchor",guideMode:null,render:({layer:t,isAnimated:e})=>s.jsx(_t,{layer:t,isAnimated:e}),renderHover:({primary:t,group:e,related:n})=>s.jsxs("g",{"data-testid":"hovered-point",children:[[...e,...n].map(r=>s.jsx(B,{hit:r},`companion-${r.layerId}-${r.pointIndex}`)),s.jsx(Q,{hit:t})]}),renderHoverCompanions:({related:t})=>s.jsx(s.Fragment,{children:t.map(e=>s.jsx(B,{hit:e},`companion-${e.layerId}-${e.pointIndex}`))}),getOverlayAnchor:({observation:t})=>{const e=l.getX(t),n=l.getY(t);return e===null||n===null?null:{x:e,y:n}}},Re=10,Be=(t,e)=>t*Re*e,Rt=/\p{Emoji_Presentation}|\p{Emoji}\uFE0F/gu,we="😀";class ee{constructor(){this.emojiCorrections=new Map,this.currentFont="";const n=new OffscreenCanvas(1,1).getContext("2d");if(!n)throw new Error("Failed to create OffscreenCanvas 2D context");this.ctx=n}static async create(){return typeof document<"u"&&"fonts"in document&&await document.fonts.ready,new ee}measureText(e,n){const r=l.buildFontString(n);this.setFont(r);const{width:i,fontBoundingBoxAscent:a,fontBoundingBoxDescent:g}=this.ctx.measureText(e);let c=i;const d=Bt(e);if(d>0){const u=this.getEmojiCorrection(r);c-=u*d}return{width:c,height:a+g,ascent:a,descent:g}}setFont(e){this.currentFont!==e&&(this.ctx.font=e,this.currentFont=e)}getEmojiCorrection(e){const n=this.emojiCorrections.get(e);if(n!==void 0)return n;this.setFont(e);const r=this.ctx.measureText(we).width,i=wt(e);let a=0;if(i!==null){const g=r-i;a=g>.5?g:0}return this.emojiCorrections.set(e,a),a}}let I=null;const Bt=t=>{const e=t.match(Rt);return e?e.length:0},wt=t=>{const e=Wt();return e?(e.style.font=t,e.getBoundingClientRect().width):null},Wt=()=>typeof document>"u"?null:(I||(I=document.createElement("span"),I.style.position="absolute",I.style.visibility="hidden",I.style.whiteSpace="nowrap",I.style.left="-9999px",I.textContent=we,document.body.appendChild(I)),I),We=f.createContext(null),Ot=({children:t,measurer:e})=>{const[n,r]=f.useState(null);f.useEffect(()=>{if(e!==void 0)return;let a=!1;const g=()=>{a||r(zt())};return(async()=>{typeof document<"u"&&"fonts"in document&&await document.fonts.ready,g()})(),typeof document<"u"&&"fonts"in document&&document.fonts.addEventListener("loadingdone",g),()=>{a=!0,typeof document<"u"&&"fonts"in document&&document.fonts.removeEventListener("loadingdone",g)}},[e]);const i=e??n;return i===null?null:s.jsx(We.Provider,{value:i,children:t})},Oe=()=>{const t=f.useContext(We);if(t===null)throw new Error("useTextMeasurer must be used inside a <TextMeasurerProvider>.");return t},zt=()=>{try{return new l.CachedTextMeasurer(new ee)}catch{return new l.CachedTextMeasurer(new l.HeuristicTextMeasurer)}},te=`'Inter', -apple-system, BlinkMacSystemFont, 'Open Sans', 'Segoe UI', 'Roboto', 'Oxygen-Sans', 'Ubuntu',
2
- 'Cantarell', 'Helvetica Neue', 'NotoSansArabic', 'NotoSansJP', 'NotoSansSC', 'NotoSansKR', 'NotoSerifKR', sans-serif, 'Apple Color Emoji', 'NotoColorEmoji'`,Dt=te,_={regular:400,medium:500,semibold:600,bold:700,extraBold:800,black:900},M={xxs:1,xs:1.1,sm:1.2,md:1.4,lg:1.6,xl:2,editorBody:1.5,headingSm:1.8,headingMd:2.2,headingLg:2.8},H={xxs:1,xs:1,sm:1.3,md:1.43,lg:1,xl:1,editorBody:1.47,headingSm:1.25,headingMd:1.41,headingLg:1.29},Ft=`var(--typography-chart-font-family, ${o.fontFamilyDefault})`,oe=`var(--typography-chart-heading-font-family, ${o.fontFamilyHeading})`,A=t=>`${t}em`,Gt={textScale:"1",fontFamilyDefault:te,fontFamilyHeading:Dt,fontWeightRegular:_.regular.toString(),fontWeightMedium:_.medium.toString(),fontWeightSemibold:_.semibold.toString(),fontWeightBold:_.bold.toString(),fontWeightExtraBold:_.extraBold.toString(),fontWeightBlack:_.black.toString(),fontSizeXxs:A(M.xxs),fontSizeXs:A(M.xs),fontSizeSm:A(M.sm),fontSizeMd:A(M.md),fontSizeLg:A(M.lg),fontSizeXl:A(M.xl),fontLineHeightXxs:H.xxs.toString(),fontLineHeightXs:H.xs.toString(),fontLineHeightSm:H.sm.toString(),fontLineHeightMd:H.md.toString(),fontLineHeightLg:H.lg.toString(),fontLineHeightXl:H.xl.toString()},Xt={fontSizeEditorBody:A(M.editorBody),fontSizeHeadingSm:A(M.headingSm),fontSizeHeadingMd:A(M.headingMd),fontSizeHeadingLg:A(M.headingLg),fontLineHeightEditorBody:H.editorBody.toString(),fontLineHeightHeadingSm:H.headingSm.toString(),fontLineHeightHeadingMd:H.headingMd.toString(),fontLineHeightHeadingLg:H.headingLg.toString()},p=(t,e,n,r=Ft)=>`${t} ${e}/${n} ${r}`,Nt={fontTickLabel:p(o.fontWeightMedium,o.fontSizeSm,o.fontLineHeightSm),fontAxisLabel:p(o.fontWeightMedium,o.fontSizeSm,o.fontLineHeightSm),fontDataLabel:p(o.fontWeightMedium,o.fontSizeXs,o.fontLineHeightXs),fontStackTotal:p(o.fontWeightSemibold,o.fontSizeXs,o.fontLineHeightXs),fontLegendLabel:p(o.fontWeightMedium,o.fontSizeSm,o.fontLineHeightSm),fontSeriesLabel:p(o.fontWeightSemibold,o.fontSizeSm,o.fontLineHeightSm),fontTooltipLabel:p(o.fontWeightMedium,o.fontSizeMd,o.fontLineHeightMd),fontTooltipHeading:p(o.fontWeightMedium,o.fontSizeSm,o.fontLineHeightSm),fontTooltipFooter:p(o.fontWeightRegular,o.fontSizeSm,o.fontLineHeightSm),fontJumboTooltipLabel:p(o.fontWeightRegular,o.fontSizeSm,o.fontLineHeightSm),fontJumboTooltip:p(o.fontWeightMedium,o.fontSizeHeadingMd,o.fontLineHeightHeadingMd),fontMiniTooltipLabel:p(o.fontWeightMedium,o.fontSizeSm,o.fontLineHeightSm),fontMiniTooltipFooter:p(o.fontWeightRegular,o.fontSizeSm,o.fontLineHeightSm),fontTooltipCaption:p(o.fontWeightMedium,o.fontSizeSm,o.fontLineHeightSm),fontTooltipCaptionSmall:p(o.fontWeightMedium,o.fontSizeXxs,o.fontLineHeightXxs),fontUITooltip:p(o.fontWeightMedium,o.fontSizeMd,o.fontLineHeightMd),fontUITooltipSecondary:p(o.fontWeightMedium,o.fontSizeSm,o.fontLineHeightSm),fontTrendTag:p(o.fontWeightMedium,o.fontSizeMd,o.fontLineHeightMd),fontTrendTagSmall:p(o.fontWeightMedium,o.fontSizeXs,o.fontLineHeightXs),fontGoalLineLabel:p(o.fontWeightMedium,o.fontSizeXs,o.fontLineHeightXs),fontPieLabel:p(o.fontWeightMedium,o.fontSizeXs,o.fontLineHeightXs),fontPieChartTotal:p(o.fontWeightBold,o.fontSizeHeadingLg,o.fontLineHeightHeadingLg),fontDifferenceArrowSmall:p(o.fontWeightMedium,o.fontSizeSm,o.fontLineHeightSm),fontDifferenceArrowMedium:p(o.fontWeightMedium,o.fontSizeLg,o.fontLineHeightLg),fontDifferenceArrowLarge:p(o.fontWeightSemibold,o.fontSizeXl,o.fontLineHeightXl),fontButton:p(o.fontWeightMedium,o.fontSizeMd,o.fontLineHeightMd),fontInput:p(o.fontWeightMedium,o.fontSizeMd,o.fontLineHeightMd),fontInputLabel:p(o.fontWeightMedium,o.fontSizeXxs,o.fontLineHeightXxs),fontSelectLabel:p(o.fontWeightMedium,o.fontSizeMd,o.fontLineHeightMd),fontSelectDescription:p(o.fontWeightMedium,o.fontSizeSm,o.fontLineHeightSm),fontColorSelectLabel:p(o.fontWeightMedium,o.fontSizeSm,o.fontLineHeightSm),fontMenuTitle:p(o.fontWeightSemibold,o.fontSizeMd,o.fontLineHeightMd),fontMenuGroupTitle:p(o.fontWeightMedium,o.fontSizeSm,o.fontLineHeightSm),fontMenuItemLabel:p(o.fontWeightMedium,o.fontSizeMd,o.fontLineHeightMd),fontMenuItemLabelSecondary:p(o.fontWeightMedium,o.fontSizeSm,o.fontLineHeightSm),fontErrorBoundaryTitle:p(o.fontWeightSemibold,o.fontSizeHeadingSm,o.fontLineHeightHeadingSm),fontErrorBoundaryMessage:p(o.fontWeightMedium,o.fontSizeMd,o.fontLineHeightMd),fontTableCell:p(o.fontWeightMedium,o.fontSizeMd,o.fontLineHeightMd),fontTableHeaderCell:p(o.fontWeightSemibold,o.fontSizeSm,o.fontLineHeightSm),fontSourceLabel:p(o.fontWeightMedium,o.fontSizeSm,o.fontLineHeightSm),fontSourceLink:p(o.fontWeightRegular,o.fontSizeSm,o.fontLineHeightSm),fontTextEditorH1:p(o.fontWeightBold,o.fontSizeHeadingLg,o.fontLineHeightHeadingLg,oe),fontTextEditorH2:p(o.fontWeightBold,o.fontSizeHeadingMd,o.fontLineHeightHeadingMd,oe),fontTextEditorH3:p(o.fontWeightSemibold,o.fontSizeHeadingSm,o.fontLineHeightHeadingSm,oe),fontTextEditorH6:p(o.fontWeightMedium,o.fontSizeSm,o.fontLineHeightSm),fontTextEditorBody:p(o.fontWeightMedium,o.fontSizeEditorBody,o.fontLineHeightEditorBody),fontTextEditorLink:p(o.fontWeightRegular,o.fontSizeMd,o.fontLineHeightMd),fontHighlightModeTitle:p(o.fontWeightBold,o.fontSizeMd,o.fontLineHeightMd),fontHighlightModeSubtitle:p(o.fontWeightMedium,o.fontSizeSm,o.fontLineHeightSm)},$t=11.7,Yt=M.xs,Ut=te,Vt=_.medium,F=5,Kt=5,ue=10,fe=10,qt=4,K=13,ze=6,re=12,pe=21.6,Zt="0 0 10 18",Jt="M2.48935 16.9323L9.07098 9.82964C9.51595 9.34944 9.51504 8.60728 9.0689 8.12818L2.48866 1.06172C1.85811 0.384586 0.974477 0 0.049217 0H0V18H0.0443689C0.972463 18 1.85854 17.6131 2.48935 16.9323Z",me="#FFFFFF",ae="#1A1A1A";var Qt="_16vokpr0";const en=(t,e)=>{const n=t.mapping.y!==void 0,r=e.mainAxis==="y";return n!==r},tn=(t,e)=>{const n=x(t?1-e:e);return t?{x1:"0%",y1:n,x2:"100%",y2:n}:{x1:n,y1:"0%",x2:n,y2:"100%"}},nn=(t,e)=>t==="solid"?{}:t==="dotted"?{strokeDasharray:`0 ${e*2}`,strokeLinecap:"round"}:{strokeDasharray:`${e*2} ${e*3}`,strokeLinecap:"round",strokeMiterlimit:16},on=t=>{const e=t.params.color,n=e??o.targetLineColor;let r=o.targetLineLabelTextColor;if(e!==void 0)try{r=de.getContrast(e,me)>de.getContrast(e,ae)?me:ae}catch{r=ae}return{lineColor:n,labelTextColor:r}},rn=(t,e)=>U(t)&&U(e)?`${t}: ${e}`:U(t)?t:U(e)?e:null,U=t=>t!=null&&t.trim()!=="";var an="_2qyyu60";const ve=2,sn=12,ln=12,ye=1,xe=2,cn=4,ce=({shape:t,color:e,lineType:n="solid",width:r=sn,height:i=ln})=>s.jsx("svg",{className:an,width:r,height:i,viewBox:`0 0 ${r} ${i}`,"aria-hidden":!0,"data-testid":"chart-swatch","data-shape":t,children:gn({shape:t,color:e,lineType:n,width:r,height:i})}),gn=({shape:t,color:e,lineType:n,width:r,height:i})=>{const a=dn(n,r);switch(t){case"square":return s.jsx("rect",{x:1,y:1,width:r-2,height:i-2,rx:2,fill:e});case"line":return s.jsx("line",{x1:a.x1,y1:i/2,x2:a.x2,y2:i/2,stroke:e,strokeWidth:ve,strokeLinecap:a.linecap,strokeDasharray:a.dashArray});case"circle":{const g=(Math.min(r,i)-2)/2;return s.jsx("circle",{cx:r/2,cy:i/2,r:g,fill:e})}case"area":{const g=i/2-1;return s.jsxs(s.Fragment,{children:[s.jsx("rect",{x:1,y:g,width:r-2,height:i-g-1,fill:e,opacity:.45}),s.jsx("line",{x1:a.x1,y1:g,x2:a.x2,y2:g,stroke:e,strokeWidth:ve,strokeLinecap:a.linecap,strokeDasharray:a.dashArray})]})}case"slice":return s.jsx("path",{d:`M 0 ${i} L ${r} ${i} A ${r} ${i} 0 0 0 0 0 Z`,fill:e})}},dn=(t,e)=>{if(t==="solid")return{x1:0,x2:e,dashArray:void 0,linecap:"round"};if(t==="dashed"){const r=(e-ye*(xe-1))/xe;return{x1:0,x2:e,dashArray:`${r} ${ye}`,linecap:"butt"}}const n=e/(cn-1);return{x1:0,x2:e,dashArray:`1 ${n}`,linecap:"round"}},hn=({labelPosition:t,linePosition:e,color:n,pillWidth:r,pillHeight:i,text:a,isAnimated:g})=>{const c=t==="start",d=c?-K:-(r-K),u=c?d+r-F:d+F-re,h=c?void 0:`rotate(180 ${u+re/2} ${i/2})`,m=c?"0%":"100%",v=x(1-e),y=s.jsxs("g",{transform:`translate(0, ${-i/2})`,pointerEvents:"none",children:[s.jsx("rect",{x:d,y:0,width:r,height:i,rx:ze,fill:n}),s.jsx("g",{transform:h,children:s.jsx("svg",{x:u,y:(i-pe)/2,width:re,height:pe,viewBox:Zt,overflow:"visible",children:s.jsx("path",{d:Jt,fill:n})})}),s.jsx("g",{transform:`translate(${d+F}, ${i/2})`,children:a})]});return g?s.jsx(L.motion.svg,{initial:!1,transition:C,x:m,animate:{y:v},overflow:"visible",children:y}):s.jsx("svg",{x:m,y:v,overflow:"visible",children:y})},un=({labelPosition:t,linePosition:e,color:n,pillWidth:r,pillHeight:i,text:a,isAnimated:g})=>{const c=t==="start",d=c?-K:-(i-K),u=x(e),h=c?"100%":"0%",m=s.jsxs("g",{transform:`translate(${-r/2}, 0)`,pointerEvents:"none",children:[s.jsx("rect",{x:0,y:d,width:r,height:i,rx:ze,fill:n}),s.jsx("g",{transform:`translate(${F}, ${d+i/2})`,children:a})]});return g?s.jsx(L.motion.svg,{initial:!1,transition:C,y:h,animate:{x:u},overflow:"visible",children:m}):s.jsx("svg",{x:u,y:h,overflow:"visible",children:m})},fn=({label:t,textWidth:e,labelPosition:n,isHorizontalLine:r,position:i,color:a,textColor:g,symbolShape:c,symbolColor:d,isAnimated:u})=>{const h=c===null?0:ue+qt,m=e+h+F*2,v=$t+Kt*2,y=s.jsxs(s.Fragment,{children:[c!==null&&d!==null&&s.jsx("g",{transform:`translate(0, ${-fe/2})`,children:s.jsx(ce,{shape:c,color:d,width:ue,height:fe})}),s.jsx("text",{x:h,textAnchor:"start",dominantBaseline:"central",fill:g,style:{font:o.fontGoalLineLabel},children:t})]});return r?s.jsx(hn,{labelPosition:n,linePosition:i,color:a,pillWidth:m,pillHeight:v,text:y,isAnimated:u}):s.jsx(un,{labelPosition:n,linePosition:i,color:a,pillWidth:m,pillHeight:v,text:y,isAnimated:u})},pn=({layer:t,isHorizontalLine:e,position:n,lineColor:r,isAnimated:i})=>{const a=tn(e,n),g=nn(t.params.lineType,t.params.strokeWidth);return i?s.jsx(L.motion.line,{initial:!1,transition:C,animate:{x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2},...g,stroke:r,strokeWidth:t.params.strokeWidth,vectorEffect:"non-scaling-stroke"}):s.jsx("line",{...a,...g,stroke:r,strokeWidth:t.params.strokeWidth,vectorEffect:"non-scaling-stroke"})},mn=f.memo(function({layer:e,coordSystem:n,formattingLocale:r,isAnimated:i}){const a=Oe(),{guides:g,numberFormat:c,textScale:d,layers:u,compiledLayers:h,colorScale:m}=ge(Le.useShallow(b=>({guides:b.guides,numberFormat:b.config.numberFormat,textScale:b.config.appearance.textScale,layers:b.spec.layers,compiledLayers:b.layers,colorScale:b.scales.color}))),v=f.useMemo(()=>l.buildAverageLineSymbols(u,h,m,n).get(e.id)??null,[u,h,m,n,e.id]),y=f.useMemo(()=>rn(e.params.label,l.formatRuleValue({guides:g,numberFormat:c,layer:e,locale:r})),[g,c,r,e]),S=f.useMemo(()=>({family:Ut,size:Be(Yt,d),weight:Vt}),[d]),P=f.useMemo(()=>y===null?0:a.measureText(y,S).width,[y,S,a]),T=e.data.getFirst();if(!T)return null;const{lineColor:k,labelTextColor:E}=on(e),w=en(e,n),z=w?l.getY(T):l.getX(T);return z===null?null:s.jsxs("g",{"data-geom":"rule",className:Qt,children:[s.jsx(pn,{layer:e,isHorizontalLine:w,position:z,lineColor:k,isAnimated:i}),y!==null&&s.jsx(fn,{label:y,textWidth:P,labelPosition:e.params.labelPosition,isHorizontalLine:w,position:z,color:k,textColor:E,symbolShape:v?.shape??null,symbolColor:v?.color??null,isAnimated:i})]})}),vn={geom:"rule",coord:"cartesian",highlightStrategy:null,guideMode:null,render:({layer:t,coordSystem:e,formattingLocale:n,isAnimated:r})=>s.jsx(mn,{layer:t,coordSystem:e,formattingLocale:n,isAnimated:r}),renderHover:()=>null,renderHoverCompanions:()=>null},De=1,ie=R.arc(),Se=Math.PI*2,yn=f.memo(function({layer:e,isAnimated:n}){const r=f.useRef(!1);f.useEffect(()=>{r.current=!0},[]);const i=f.useMemo(()=>{const a=J(e.id),g=[];for(const c of e.data){const d=a(c),{startAngle:u,endAngle:h}=l.getAngleExtent(c),{innerRadius:m,outerRadius:v}=l.getRadiusExtent(c);u===null||h===null||m===null||v===null||g.push({key:d,startAngle:u,endAngle:h,innerRadius:m,outerRadius:v,fill:l.getColor(c),opacity:l.getAlpha(c)??De})}return g},[e]);return s.jsx("svg",{viewBox:"-1 -1 2 2",preserveAspectRatio:"xMidYMid meet",width:"100%",height:"100%","data-geom":"bar",className:O,children:i.map(a=>{if(n){const{key:g,...c}=a;return s.jsx(xn,{isInitialRender:!r.current,...c},g)}return s.jsx("path",{d:ie({startAngle:a.startAngle,endAngle:a.endAngle,innerRadius:a.innerRadius,outerRadius:a.outerRadius})??void 0,fill:a.fill,opacity:a.opacity},a.key)})})}),xn=({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r,fill:i,opacity:a,isInitialRender:g})=>{const c=g?t:Se,d=g?e:Se,u=L.useSpring(c,C),h=L.useSpring(d,C),m=L.useMotionValue(ie({startAngle:c,endAngle:d,innerRadius:n,outerRadius:r})??"");return f.useEffect(()=>{u.set(t),h.set(e)},[u,h,t,e]),f.useEffect(()=>{const v=()=>{const P=u.get(),T=h.get();m.set(ie({startAngle:P,endAngle:T,innerRadius:n,outerRadius:r})??"")},y=u.on("change",v),S=h.on("change",v);return()=>{y(),S()}},[u,h,n,r,m]),s.jsx(L.motion.path,{d:m,fill:i,opacity:a,transition:C})},Sn=R.arc(),bn=({primary:t})=>{const{startAngle:e,endAngle:n}=l.getAngleExtent(t.observation),{innerRadius:r,outerRadius:i}=l.getRadiusExtent(t.observation);if(e===null||n===null||r===null||i===null)return null;const a=Sn({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i});if(!a)return null;const g=l.getColor(t.observation),c=l.getAlpha(t.observation)??De;return s.jsx("svg",{viewBox:"-1 -1 2 2",preserveAspectRatio:"xMidYMid meet",width:"100%",height:"100%","data-geom":"arc","data-testid":"hovered-arc",className:O,children:s.jsx("path",{d:a,fill:g,opacity:c})})},Ln={geom:"bar",coord:"polar",highlightStrategy:"observation-rerender",guideMode:null,render:({layer:t,isAnimated:e})=>s.jsx(yn,{layer:t,isAnimated:e}),renderHover:({primary:t})=>s.jsx(bn,{primary:t}),renderHoverCompanions:()=>null},be={bar:{cartesian:kt,polar:Ln},line:{cartesian:Pt},area:{cartesian:xt},point:{cartesian:jt},rule:{cartesian:vn}},Tn=(t=[])=>{const e={};for(const n of Object.keys(be))e[n]={...be[n]};for(const n of t){const r=e[n.geom]??{};r[n.coord]=n,e[n.geom]=r}return(n,r)=>e[n.geom]?.[r.type]??null},Mn=t=>se.createStore(e=>({compiled:t,setCompiled:n=>e(r=>r.compiled===n?r:{compiled:n})}));function Cn(t,e){const n=l.isGraphConfig(t)?t.themeOverrides:void 0;return f.useMemo(()=>({...e,...n}),[e,n])}const Fe=f.createContext(null),kn=({data:t,input:e,formattingLocale:n,onChange:r,customPalettes:i,theme:a="light",themeOverrides:g,geoms:c,plugins:d,annotationPlugins:u,children:h})=>{const[m]=f.useState(()=>l.createCompiler({geoms:c})),[v]=f.useState(()=>Ke(m)),y=f.useMemo(()=>Tn(d),[d]),S=f.useMemo(()=>Ue(u),[u]),P=Cn(e,g),T=f.useMemo(()=>({customPalettes:i,theme:a}),[i,a]),[k]=f.useState(()=>{const b=m.compile({input:e,data:t,ctx:T});return v.emit({kind:"init"}),Mn(b)}),E=f.useRef({input:e,data:t,ctx:T});f.useEffect(()=>{const b=e!==E.current.input,N=t!==E.current.data,W=T!==E.current.ctx;if(!b&&!N&&!W)return;const $=k.getState(),Y=b||W?m.compile({input:e,data:t,ctx:T}):m.recompile({spec:$.compiled.spec,data:t});E.current={input:e,data:t,ctx:T},$.setCompiled(Y),v.emit({kind:b?"input":"data"})},[e,t,T,m,k,v]);const w=f.useCallback(b=>{const N=k.getState(),W=b.apply(N.compiled.spec);if(!W)return;const $=m.recompile({spec:W.spec});if(N.setCompiled($),v.emit({kind:"command",command:b}),!r)return;const Y=l.convertSpecToInput(W.spec);E.current={input:Y,data:E.current.data,ctx:E.current.ctx},r(Y)},[r,m,v,k]),z=f.useMemo(()=>({store:k,dispatch:w,formattingLocale:n,compileBus:v,theme:a,themeOverrides:P,resolvePlugin:y,resolveAnnotationPlugin:S}),[k,w,n,v,a,P,y,S]);return s.jsx(Fe.Provider,{value:z,children:h})},X=()=>{const t=f.useContext(Fe);if(!t)throw new Error("useGraph* hooks must be used inside a <GraphProvider>");return t},ge=t=>{const{store:e}=X();return Ne.useStore(e,n=>t(n.compiled))},Hn=()=>{const{dispatch:t}=X();return t},An=()=>{const{resolvePlugin:t}=X();return t},En=()=>{const{resolveAnnotationPlugin:t}=X();return t},In=()=>se.createStore(t=>({hover:l.RESTING_HOVER_STATE,isPointerInside:!1,setHoverState:e=>t(n=>n.hover===e?n:{hover:e}),setPointerInside:e=>t(n=>n.isPointerInside===e?n:{isPointerInside:e})})),Pn=(t,e)=>{const n=f.useMemo(()=>({layers:t,coordSystem:e}),[t,e]),r=f.useRef(null);r.current===null&&(r.current=new l.HoverEngine(n));const i=r.current,a=f.useRef(!1);return f.useEffect(()=>{if(!a.current){a.current=!0;return}i.update(n)},[i,n]),i},Ge=f.createContext(null),_n=({children:t})=>{const{layers:e,coordSystem:n}=ge(Le.useShallow(d=>({layers:d.layers,coordSystem:d.coordSystem}))),r=Pn(e,n),[i]=f.useState(()=>In()),a=f.useRef(null),g=f.useRef(null);if(g.current===null){const d=new Map,u={current:null},h=new Set,m=y=>{if(u.current=y,i.getState().setPointerInside(y!==null),y!==null)for(const S of h)S()},v=y=>(h.add(y),()=>{h.delete(y)});g.current={engine:r,store:i,overlayRef:a,hitTesterRegistry:d,cursorRef:u,setCursor:m,subscribeCursorMove:v}}const{hitTesterRegistry:c}=g.current;return f.useEffect(()=>{r.setHitTesters(c)},[r,c]),s.jsx(Ge.Provider,{value:g.current,children:t})},jn=()=>{const t=f.useContext(Ge);if(t===null)throw new Error("useHoverContext must be used inside a <HoverProvider>.");return t};var Rn="_19519k80",Bn="_19519k81",wn="_19519k82",Wn="_19519k83",On="_19519k86",zn="_19519k87",Dn="_19519k88";const Fn=({content:t})=>s.jsxs(s.Fragment,{children:[t.header!==null&&s.jsx("div",{className:Rn,children:t.header}),s.jsx("div",{className:Bn,children:t.rows.map(e=>s.jsx(Xe,{row:e,shouldHighlight:e.isPrimary&&t.rows.length>1},e.key))})]}),Xe=({row:t,shouldHighlight:e})=>s.jsxs("div",{className:Ye(wn,{[Wn]:e}),"data-testid":"chart-tooltip-row",children:[t.swatchColor!==null?s.jsx(ce,{shape:t.swatchShape,color:t.swatchColor,lineType:t.swatchLineType}):null,s.jsx("span",{className:On,children:t.label}),s.jsx("span",{className:zn,children:t.value})]});exports.CANVAS_COLOR_KEYS=nt;exports.CanvasTextMeasurer=ee;exports.CompanionDot=B;exports.DEFAULT_FONT_FAMILY=te;exports.DEFAULT_POINT_SIZE=Te;exports.FONT_LINE_HEIGHT=H;exports.FONT_SIZE_EM=M;exports.FONT_WEIGHT=_;exports.GraphProvider=kn;exports.HoverProvider=_n;exports.PrimaryDot=Q;exports.ROOT_FONT_SIZE_PX=Re;exports.Swatch=ce;exports.TextMeasurerProvider=Ot;exports.TooltipBody=Fn;exports.TooltipRowView=Xe;exports.baseTypographyTokens=Gt;exports.createDevToolsStore=qe;exports.defineGeomPlugin=et;exports.defineGeomRenderer=tt;exports.elementTypographyTokens=Nt;exports.emToPx=Be;exports.root=Dn;exports.semanticTypographyTokens=Xt;exports.toPercent=x;exports.toViewBoxX=at;exports.toViewBoxY=j;exports.useCompiledSelector=ge;exports.useGraphCommandDispatcher=Hn;exports.useGraphContext=X;exports.useHoverContext=jn;exports.useResolveAnnotationPlugin=En;exports.useResolveGeomPlugin=An;exports.useSvgPathMorph=V;exports.useTextMeasurer=Oe;exports.vars=o;