semiotic 3.7.0 → 3.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/CLAUDE.md +3 -2
  2. package/README.md +30 -7
  3. package/ai/dist/mcp-server.js +417 -5
  4. package/ai/schema.json +1 -1
  5. package/ai/system-prompt.md +3 -3
  6. package/dist/components/AccessibleNavTree.d.ts +2 -1
  7. package/dist/components/Annotation.d.ts +1 -1
  8. package/dist/components/CategoryColors.d.ts +1 -1
  9. package/dist/components/ChartGrid.d.ts +1 -1
  10. package/dist/components/ContextLayout.d.ts +1 -1
  11. package/dist/components/DataSummaryContext.d.ts +1 -1
  12. package/dist/components/DetailsPanel.d.ts +1 -1
  13. package/dist/components/Legend.d.ts +3 -2
  14. package/dist/components/LinkedCharts.d.ts +1 -1
  15. package/dist/components/ThemeProvider.d.ts +1 -1
  16. package/dist/components/Tooltip/FlippingTooltip.d.ts +1 -1
  17. package/dist/components/Tooltip/Tooltip.d.ts +2 -2
  18. package/dist/components/ai/qualityScorecard.d.ts +11 -0
  19. package/dist/components/charts/geo/ChoroplethMap.d.ts +2 -1
  20. package/dist/components/charts/network/CirclePack.d.ts +2 -1
  21. package/dist/components/charts/network/OrbitDiagram.d.ts +1 -1
  22. package/dist/components/charts/network/TreeDiagram.d.ts +2 -1
  23. package/dist/components/charts/network/Treemap.d.ts +2 -1
  24. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +1 -1
  25. package/dist/components/charts/shared/ChartError.d.ts +2 -1
  26. package/dist/components/charts/shared/withChartWrapper.d.ts +1 -1
  27. package/dist/components/charts/xy/MinimapChart.d.ts +2 -1
  28. package/dist/components/charts/xy/ScatterplotMatrix.d.ts +2 -1
  29. package/dist/components/semiotic-server.d.ts +2 -1
  30. package/dist/components/server/renderEvidence.d.ts +92 -0
  31. package/dist/components/server/renderToStaticSVG.d.ts +14 -1
  32. package/dist/components/stream/AccessibleDataTable.d.ts +5 -5
  33. package/dist/components/stream/FocusRing.d.ts +2 -1
  34. package/dist/components/stream/MarginalGraphics.d.ts +2 -1
  35. package/dist/components/stream/NetworkSVGOverlay.d.ts +2 -1
  36. package/dist/components/stream/OrdinalBrushOverlay.d.ts +19 -1
  37. package/dist/components/stream/OrdinalSVGOverlay.d.ts +2 -2
  38. package/dist/components/stream/SVGOverlay.d.ts +3 -2
  39. package/dist/components/stream/XYBrushOverlay.d.ts +21 -1
  40. package/dist/geo.min.js +1 -1
  41. package/dist/geo.module.min.js +1 -1
  42. package/dist/network.min.js +1 -1
  43. package/dist/network.module.min.js +1 -1
  44. package/dist/ordinal.min.js +1 -1
  45. package/dist/ordinal.module.min.js +1 -1
  46. package/dist/realtime.min.js +1 -1
  47. package/dist/realtime.module.min.js +1 -1
  48. package/dist/semiotic-ai.min.js +1 -1
  49. package/dist/semiotic-ai.module.min.js +1 -1
  50. package/dist/semiotic-server.d.ts +2 -1
  51. package/dist/semiotic-themes.min.js +1 -1
  52. package/dist/semiotic-themes.module.min.js +1 -1
  53. package/dist/semiotic-utils.min.js +1 -1
  54. package/dist/semiotic-utils.module.min.js +1 -1
  55. package/dist/semiotic-value.min.js +1 -1
  56. package/dist/semiotic-value.module.min.js +1 -1
  57. package/dist/semiotic.min.js +1 -1
  58. package/dist/semiotic.module.min.js +1 -1
  59. package/dist/server.min.js +1 -1
  60. package/dist/server.module.min.js +1 -1
  61. package/dist/xy.min.js +1 -1
  62. package/dist/xy.module.min.js +1 -1
  63. package/package.json +2 -2
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{useRef as r,useMemo as n,useContext as o,useCallback as i,useSyncExternalStore as s,createContext as c,useState as l,useEffect as u}from"react";function d(e,t){const a=new EventTarget;let r=Object.assign(Object.assign({},e(function(e){r=Object.assign(Object.assign({},r),e(r)),a.dispatchEvent(new Event("update"))})),null!=t?t:{});return{getState:()=>r,subscribe:function(e){return a.addEventListener("update",e),()=>a.removeEventListener("update",e)}}}function p(e){if(!e.accessibility)return e;let t=e;if(e.accessibility.colorBlindSafe&&(t=Object.assign(Object.assign({},t),{colors:Object.assign(Object.assign({},t.colors),{categorical:y})})),e.accessibility.highContrast){const e="dark"===t.mode;t=Object.assign(Object.assign({},t),{colors:Object.assign(Object.assign({},t.colors),{text:e?"#ffffff":"#000000",textSecondary:e?"#cccccc":"#333333",grid:e?"#666666":"#999999",border:e?"#888888":"#000000"})})}return t}const y=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],g={mode:"light",colors:{primary:"#00a2ce",secondary:"#6c757d",categorical:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],sequential:"blues",diverging:"RdBu",background:"transparent",surface:"#ffffff",text:"#333",textSecondary:"#666",grid:"#e0e0e0",border:"#ccc",selection:"#00a2ce",selectionOpacity:.15,success:"#2ca02c",danger:"#d62728",warning:"#f0ad4e",error:"#b4181b",info:"#00a2ce"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},f={mode:"dark",colors:{primary:"#4fc3f7",secondary:"#90a4ae",categorical:["#4fc3f7","#ffb74d","#81c784","#ef5350","#ba68c8","#a1887f","#f06292","#90a4ae","#dce775","#4dd0e1"],sequential:"blues",diverging:"RdBu",background:"#1a1a2e",surface:"#252540",text:"#e0e0e0",textSecondary:"#aaa",grid:"#333",border:"#555",selection:"#4fc3f7",selectionOpacity:.15,success:"#81c784",danger:"#ef5350",warning:"#ffb74d",error:"#d84848",info:"#4fc3f7"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},h={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:y,sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#000000",textSecondary:"#333333",grid:"#999999",border:"#000000",focus:"#0000cc",selection:"#0000cc",selectionOpacity:.1,success:"#006400",danger:"#cc0000",warning:"#b15a00",error:"#8b0000",info:"#0000cc"},typography:{fontFamily:"system-ui, sans-serif",titleSize:18,labelSize:14,tickSize:12},tooltip:{background:"#000000",text:"#ffffff",borderRadius:"4px",fontSize:"14px",shadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},borderRadius:"4px"};function m(e,t){if("light"===t)return g;if("dark"===t)return f;if("high-contrast"===t)return h;if("string"==typeof t)return void 0!==console&&console.warn(`[ThemeStore] Unknown theme preset "${t}". Keeping current theme.`),e;if(t.mode&&"auto"!==t.mode){const e="dark"===t.mode?f:g;return p(Object.assign(Object.assign(Object.assign({},e),t),{colors:Object.assign(Object.assign({},e.colors),t.colors||{}),typography:Object.assign(Object.assign({},e.typography),t.typography||{})}))}return p(Object.assign(Object.assign(Object.assign({},e),t),{colors:Object.assign(Object.assign({},e.colors),t.colors||{}),typography:Object.assign(Object.assign({},e.typography),t.typography||{})}))}const[b,v]=function(t){let a=null;const l=()=>(a||(a=c(null)),a),u=d(t);return[function({children:a,initialState:o}){const i=r(o),s=n(()=>d(t,i.current),[]),c=l();return e(c.Provider,{value:s,children:a})},e=>{var t;const a=l(),n=null!==(t=o(a))&&void 0!==t?t:u,c=r(e);c.current=e;const d=i(()=>c.current(n.getState()),[n]),p=i(()=>c.current(n.getState()),[n]);return s(n.subscribe,d,p)}]}(e=>({theme:g,setTheme(t){e(e=>({theme:m(e.theme,t)}))}})),x=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"],A={danger:"#da1e28",warning:"#f1c21b",success:"#24a148",info:"#0043ce"},w={light:g,dark:f,"high-contrast":h,pastels:{mode:"light",colors:{primary:"#c9a0dc",secondary:"#b8a8c8",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#fdf6f0",surface:"#fff5ee",text:"#4a3728",textSecondary:"#8b7355",grid:"#e8d5c4",border:"#e8d5c4",focus:"#c9a0dc",annotation:"#c9a0dc",success:"#9ad4a3",danger:"#e8869a",warning:"#f0c888",error:"#c86070",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#fff5ee",text:"#4a3728",borderRadius:"8px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"10px"},"pastels-dark":{mode:"dark",colors:{primary:"#c9a0dc",secondary:"#a899c0",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#1a1525",surface:"#251e35",text:"#e8ddf0",textSecondary:"#a899c0",grid:"#3d3455",border:"#3d3455",focus:"#c9a0dc",annotation:"#c9a0dc",success:"#88d4ab",danger:"#f0a0c0",warning:"#f0c888",error:"#e87690",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#251e35",text:"#e8ddf0",borderRadius:"8px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"10px"},"bi-tool":{mode:"light",colors:{primary:"#2563eb",secondary:"#6b7280",categorical:["#2563eb","#0d9488","#ea580c","#6b7280"],sequential:"blues",background:"#f5f6f8",surface:"#ffffff",text:"#2c3e50",textSecondary:"#7f8c9b",grid:"#d8dce3",border:"#d8dce3",focus:"#2563eb",annotation:"#2563eb",success:"#10b981",danger:"#ef4444",warning:"#f59e0b",error:"#dc2626",info:"#2563eb"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2c3e50",borderRadius:"6px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"8px"},"bi-tool-dark":{mode:"dark",colors:{primary:"#3b82f6",secondary:"#9ca3af",categorical:["#3b82f6","#14b8a6","#f97316","#9ca3af"],sequential:"blues",background:"#111827",surface:"#1f2937",text:"#f3f4f6",textSecondary:"#9ca3af",grid:"#374151",border:"#374151",focus:"#3b82f6",annotation:"#3b82f6",success:"#34d399",danger:"#f87171",warning:"#fbbf24",error:"#ef4444",info:"#60a5fa"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f2937",text:"#f3f4f6",borderRadius:"6px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"8px"},italian:{mode:"light",colors:{primary:"#cc0000",secondary:"#666666",categorical:["#cc0000","#333333","#c8a415","#4682b4"],sequential:"reds",background:"#fafafa",surface:"#ffffff",text:"#1a1a1a",textSecondary:"#666666",grid:"#e0e0e0",border:"#e0e0e0",focus:"#cc0000",annotation:"#cc0000",success:"#556b2f",danger:"#cc0000",warning:"#c8a415",error:"#8b0000",info:"#4682b4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#1a1a1a",borderRadius:"2px",shadow:"0 2px 4px rgba(0, 0, 0, 0.15)"},borderRadius:"2px"},"italian-dark":{mode:"dark",colors:{primary:"#ff3333",secondary:"#aaaaaa",categorical:["#ff3333","#aaaaaa","#d4a843","#6aa4d4"],sequential:"reds",background:"#0a0a0a",surface:"#1a1a1a",text:"#f5f5f5",textSecondary:"#aaaaaa",grid:"#333333",border:"#333333",focus:"#ff3333",annotation:"#ff3333",success:"#7a8b5a",danger:"#ff3333",warning:"#d4a843",error:"#cc0000",info:"#6aa4d4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1a1a1a",text:"#f5f5f5",borderRadius:"2px",shadow:"0 2px 8px rgba(0, 0, 0, 0.5)"},borderRadius:"2px"},tufte:{mode:"light",colors:{primary:"#8b0000",secondary:"#555555",categorical:["#8b4513","#556b2f","#4a5568","#800020"],sequential:"oranges",background:"#fffff8",surface:"#fffff8",text:"#111111",textSecondary:"#555555",grid:"#e0ddd0",border:"#e0ddd0",focus:"#8b0000",annotation:"#8b0000",success:"#556b2f",danger:"#8b0000",warning:"#b88700",error:"#6b0000",info:"#4a5568"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#fffff8",text:"#111111",borderRadius:"2px",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},borderRadius:"0px"},"tufte-dark":{mode:"dark",colors:{primary:"#c05050",secondary:"#a09880",categorical:["#c08050","#7a8b5a","#8090a0","#a05060"],sequential:"oranges",background:"#1c1b18",surface:"#262520",text:"#e8e4d8",textSecondary:"#a09880",grid:"#3d3c35",border:"#3d3c35",focus:"#c05050",annotation:"#c05050",success:"#7a8b5a",danger:"#c05050",warning:"#c8a060",error:"#a04040",info:"#8090a0"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262520",text:"#e8e4d8",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.4)"},borderRadius:"0px"},journalist:{mode:"light",colors:{primary:"#e45050",secondary:"#666666",categorical:["#3a86c8","#e45050","#d4a843","#888888"],sequential:"blues",background:"#ffffff",surface:"#f8f8f8",text:"#222222",textSecondary:"#666666",grid:"#d4d4d4",border:"#d4d4d4",focus:"#e45050",annotation:"#e45050",success:"#2d7a3d",danger:"#c8303a",warning:"#d4a843",error:"#a02028",info:"#3a86c8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:18,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#f8f8f8",text:"#222222",borderRadius:"4px",shadow:"0 2px 6px rgba(0, 0, 0, 0.12)"},borderRadius:"4px"},"journalist-dark":{mode:"dark",colors:{primary:"#ff6b6b",secondary:"#a0a0a0",categorical:["#5a9fd8","#ff6b6b","#e0c060","#aaaaaa"],sequential:"blues",background:"#141414",surface:"#1e1e1e",text:"#ededed",textSecondary:"#a0a0a0",grid:"#383838",border:"#383838",focus:"#ff6b6b",annotation:"#ff6b6b",success:"#6fba78",danger:"#ff6b6b",warning:"#e0c060",error:"#d04040",info:"#5a9fd8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1e1e1e",text:"#ededed",borderRadius:"4px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"4px"},playful:{mode:"light",colors:{primary:"#8b5cf6",secondary:"#7c5a9e",categorical:["#8b5cf6","#ec4899","#06b6d4","#84cc16"],sequential:"viridis",background:"#fdf8ff",surface:"#ffffff",text:"#2d1b4e",textSecondary:"#7c5a9e",grid:"#e8d0f8",border:"#e8d0f8",focus:"#8b5cf6",annotation:"#8b5cf6",success:"#10d870",danger:"#ff4b6e",warning:"#ffaa33",error:"#e11d48",info:"#06b6d4"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2d1b4e",borderRadius:"12px",shadow:"0 4px 12px rgba(139, 92, 246, 0.15)"},borderRadius:"12px"},"playful-dark":{mode:"dark",colors:{primary:"#a78bfa",secondary:"#b8a0d8",categorical:["#a78bfa","#f472b6","#22d3ee","#a3e635"],sequential:"viridis",background:"#150a28",surface:"#1f1138",text:"#f0e8ff",textSecondary:"#b8a0d8",grid:"#3a2560",border:"#3a2560",focus:"#a78bfa",annotation:"#a78bfa",success:"#4ade80",danger:"#fb7185",warning:"#fbbf24",error:"#f43f5e",info:"#22d3ee"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f1138",text:"#f0e8ff",borderRadius:"12px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"12px"},carbon:{mode:"light",colors:{primary:"#0f62fe",secondary:"#525252",categorical:["#6929c4","#1192e8","#005d5d","#9f1853"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#161616",textSecondary:"#525252",grid:"#e0e0e0",border:"#e0e0e0",focus:"#0f62fe",annotation:"#0f62fe",success:"#24a148",danger:"#da1e28",warning:"#f1c21b",error:"#a2191f",info:"#0043ce"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#161616",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.2)"},borderRadius:"0px"},"carbon-dark":{mode:"dark",colors:{primary:"#4589ff",secondary:"#a8a8a8",categorical:["#a56eff","#33b1ff","#08bdba","#ff7eb6"],sequential:"blues",diverging:"RdBu",background:"#161616",surface:"#262626",text:"#f4f4f4",textSecondary:"#a8a8a8",grid:"#393939",border:"#393939",focus:"#4589ff",annotation:"#4589ff",success:"#42be65",danger:"#fa4d56",warning:"#f1c21b",error:"#da1e28",info:"#4589ff"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262626",text:"#f4f4f4",borderRadius:"2px",shadow:"0 4px 12px rgba(0, 0, 0, 0.5)"},borderRadius:"0px"}};function $(e){return w[e]}function S(e,t=":root"){var a,r,n,o,i;const s=[];return s.push(` --semiotic-bg: ${e.colors.background};`),s.push(` --semiotic-text: ${e.colors.text};`),s.push(` --semiotic-text-secondary: ${e.colors.textSecondary};`),s.push(` --semiotic-grid: ${e.colors.grid};`),s.push(` --semiotic-border: ${e.colors.border};`),s.push(` --semiotic-primary: ${e.colors.primary};`),s.push(` --semiotic-font-family: ${e.typography.fontFamily};`),e.colors.focus&&s.push(` --semiotic-focus: ${e.colors.focus};`),e.colors.selection&&s.push(` --semiotic-selection-color: ${e.colors.selection};`),null!=e.colors.selectionOpacity&&s.push(` --semiotic-selection-opacity: ${e.colors.selectionOpacity};`),e.colors.diverging&&s.push(` --semiotic-diverging: ${e.colors.diverging};`),(null===(a=e.tooltip)||void 0===a?void 0:a.background)&&s.push(` --semiotic-tooltip-bg: ${e.tooltip.background};`),(null===(r=e.tooltip)||void 0===r?void 0:r.text)&&s.push(` --semiotic-tooltip-text: ${e.tooltip.text};`),(null===(n=e.tooltip)||void 0===n?void 0:n.borderRadius)&&s.push(` --semiotic-tooltip-radius: ${e.tooltip.borderRadius};`),(null===(o=e.tooltip)||void 0===o?void 0:o.fontSize)&&s.push(` --semiotic-tooltip-font-size: ${e.tooltip.fontSize};`),(null===(i=e.tooltip)||void 0===i?void 0:i.shadow)&&s.push(` --semiotic-tooltip-shadow: ${e.tooltip.shadow};`),e.borderRadius&&s.push(` --semiotic-border-radius: ${e.borderRadius};`),e.colors.annotation&&s.push(` --semiotic-annotation-color: ${e.colors.annotation};`),null!=e.typography.legendSize&&s.push(` --semiotic-legend-font-size: ${e.typography.legendSize}px;`),null!=e.typography.titleFontSize&&s.push(` --semiotic-title-font-size: ${e.typography.titleFontSize}px;`),null!=e.typography.tickFontFamily&&s.push(` --semiotic-tick-font-family: ${e.typography.tickFontFamily};`),null!=e.typography.tickSize&&s.push(` --semiotic-tick-font-size: ${e.typography.tickSize}px;`),null!=e.typography.labelSize&&s.push(` --semiotic-axis-label-font-size: ${e.typography.labelSize}px;`),s.push(` --semiotic-secondary: ${e.colors.secondary||e.colors.primary};`),s.push(` --semiotic-surface: ${e.colors.surface||e.colors.background};`),e.colors.success&&s.push(` --semiotic-success: ${e.colors.success};`),e.colors.danger&&s.push(` --semiotic-danger: ${e.colors.danger};`),e.colors.warning&&s.push(` --semiotic-warning: ${e.colors.warning};`),e.colors.error&&s.push(` --semiotic-error: ${e.colors.error};`),e.colors.info&&s.push(` --semiotic-info: ${e.colors.info};`),`${t} {\n${s.join("\n")}\n}`}function k(e){var t,a,r,n,o,i;return{semiotic:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({bg:{$value:e.colors.background,$type:"color"},text:{$value:e.colors.text,$type:"color"},"text-secondary":{$value:e.colors.textSecondary,$type:"color"},grid:{$value:e.colors.grid,$type:"color"},border:{$value:e.colors.border,$type:"color"},primary:{$value:e.colors.primary,$type:"color"},focus:{$value:e.colors.focus||e.colors.primary,$type:"color"},"font-family":{$value:e.typography.fontFamily,$type:"fontFamily"},"border-radius":{$value:e.borderRadius||"8px",$type:"dimension"},tooltip:{bg:{$value:(null===(t=e.tooltip)||void 0===t?void 0:t.background)||e.colors.background,$type:"color"},text:{$value:(null===(a=e.tooltip)||void 0===a?void 0:a.text)||e.colors.text,$type:"color"},radius:{$value:(null===(r=e.tooltip)||void 0===r?void 0:r.borderRadius)||"6px",$type:"dimension"},"font-size":{$value:(null===(n=e.tooltip)||void 0===n?void 0:n.fontSize)||"14px",$type:"dimension"},shadow:{$value:(null===(o=e.tooltip)||void 0===o?void 0:o.shadow)||"0 2px 8px rgba(0,0,0,0.15)",$type:"shadow"}},selection:{color:{$value:e.colors.selection||e.colors.primary,$type:"color"},opacity:{$value:null!==(i=e.colors.selectionOpacity)&&void 0!==i?i:.2,$type:"number"}},categorical:{$value:e.colors.categorical,$type:"color",$description:"Categorical color palette"},sequential:{$value:e.colors.sequential,$type:"string",$description:"d3-scale-chromatic sequential scheme name"}},e.colors.diverging?{diverging:{$value:e.colors.diverging,$type:"string",$description:"d3-scale-chromatic diverging scheme name"}}:{}),e.colors.annotation?{"annotation-color":{$value:e.colors.annotation,$type:"color"}}:{}),null!=e.typography.legendSize?{"legend-font-size":{$value:e.typography.legendSize+"px",$type:"dimension"}}:{}),null!=e.typography.titleFontSize?{"title-font-size":{$value:e.typography.titleFontSize+"px",$type:"dimension"}}:{}),null!=e.typography.tickFontFamily?{"tick-font-family":{$value:e.typography.tickFontFamily,$type:"fontFamily"}}:{}),null!=e.typography.tickSize?{"tick-font-size":{$value:e.typography.tickSize+"px",$type:"dimension"}}:{}),null!=e.typography.labelSize?{"axis-label-font-size":{$value:e.typography.labelSize+"px",$type:"dimension"}}:{}),{secondary:{$value:e.colors.secondary||e.colors.primary,$type:"color"},surface:{$value:e.colors.surface||e.colors.background,$type:"color"}}),e.colors.success?{success:{$value:e.colors.success,$type:"color"}}:{}),e.colors.danger?{danger:{$value:e.colors.danger,$type:"color"}}:{}),e.colors.warning?{warning:{$value:e.colors.warning,$type:"color"}}:{}),e.colors.error?{error:{$value:e.colors.error,$type:"color"}}:{}),e.colors.info?{info:{$value:e.colors.info,$type:"color"}}:{})}}function j(e,t){if("function"==typeof e.addEventListener)return e.addEventListener("change",t),()=>e.removeEventListener("change",t);const a=e;return a.addListener(t),()=>a.removeListener(t)}function O(e){return!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia(e).matches}function C(){const[e,t]=l(()=>O("(prefers-reduced-motion: reduce)"));return u(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)");return t(e.matches),j(e,e=>t(e.matches))},[]),e}function z(){const[e,t]=l(()=>O("(forced-colors: active)"));return u(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(forced-colors: active)");return t(e.matches),j(e,e=>t(e.matches))},[]),e}const R=a.createContext(void 0),L="undefined"==typeof window?a.useEffect:a.useLayoutEffect;function F(e){if("string"!=typeof e)return e;if("light"===e||"dark"===e||"high-contrast"===e)return e;return $(e)||(void 0!==console&&console.warn(`[ThemeProvider] Unknown theme preset "${e}". Falling back to light theme.`),"light")}function P({theme:e}){const t=v(e=>e.setTheme),r=v(e=>e.theme),n=a.useRef(r);n.current=r;const o=a.useRef(null);a.useEffect(()=>{if(void 0!==e)return;if("undefined"==typeof window||!window.matchMedia)return;const a=window.matchMedia("(forced-colors: active)");return a.matches&&(o.current=n.current===h?g:n.current,t("high-contrast")),j(a,e=>{var a,r;e.matches?(o.current=n.current===h?null!==(a=o.current)&&void 0!==a?a:g:n.current,t("high-contrast")):(function(e,t){e(t===g?"light":t===f?"dark":t===h?"high-contrast":t)}(t,null!==(r=o.current)&&void 0!==r?r:g),o.current=null)})},[e,t]);const i=a.useRef(!1);return L(()=>{i.current?void 0!==e&&t(F(e)):i.current=!0},[e,t]),null}function B({children:t}){var r,n,o,i,s;const c=v(e=>e.theme),l=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({position:"relative","--semiotic-bg":c.colors.background,"--semiotic-text":c.colors.text,"--semiotic-text-secondary":c.colors.textSecondary,"--semiotic-grid":c.colors.grid,"--semiotic-border":c.colors.border,"--semiotic-cell-border":c.colors.cellBorder||c.colors.border,"--semiotic-primary":c.colors.primary,"--semiotic-font-family":c.typography.fontFamily},c.colors.focus?{"--semiotic-focus":c.colors.focus}:{}),(null===(r=c.tooltip)||void 0===r?void 0:r.background)?{"--semiotic-tooltip-bg":c.tooltip.background}:{}),(null===(n=c.tooltip)||void 0===n?void 0:n.text)?{"--semiotic-tooltip-text":c.tooltip.text}:{}),(null===(o=c.tooltip)||void 0===o?void 0:o.borderRadius)?{"--semiotic-tooltip-radius":c.tooltip.borderRadius}:{}),(null===(i=c.tooltip)||void 0===i?void 0:i.fontSize)?{"--semiotic-tooltip-font-size":c.tooltip.fontSize}:{}),(null===(s=c.tooltip)||void 0===s?void 0:s.shadow)?{"--semiotic-tooltip-shadow":c.tooltip.shadow}:{}),c.borderRadius?{"--semiotic-border-radius":c.borderRadius}:{}),c.colors.selection?{"--semiotic-selection-color":c.colors.selection}:{}),null!=c.colors.selectionOpacity?{"--semiotic-selection-opacity":c.colors.selectionOpacity+""}:{}),c.colors.diverging?{"--semiotic-diverging":c.colors.diverging}:{}),c.colors.annotation?{"--semiotic-annotation-color":c.colors.annotation}:{}),null!=c.typography.legendSize?{"--semiotic-legend-font-size":c.typography.legendSize+"px"}:{}),null!=c.typography.titleFontSize?{"--semiotic-title-font-size":c.typography.titleFontSize+"px"}:{}),null!=c.typography.tickFontFamily?{"--semiotic-tick-font-family":c.typography.tickFontFamily}:{}),null!=c.typography.tickSize?{"--semiotic-tick-font-size":c.typography.tickSize+"px"}:{}),null!=c.typography.labelSize?{"--semiotic-axis-label-font-size":c.typography.labelSize+"px"}:{}),{"--semiotic-secondary":c.colors.secondary||c.colors.primary,"--semiotic-surface":c.colors.surface||c.colors.background}),c.colors.success?{"--semiotic-success":c.colors.success}:{}),c.colors.danger?{"--semiotic-danger":c.colors.danger}:{}),c.colors.warning?{"--semiotic-warning":c.colors.warning}:{}),c.colors.error?{"--semiotic-error":c.colors.error}:{}),c.colors.info?{"--semiotic-info":c.colors.info}:{}),u=a.useContext(R),d={};return u&&(d["data-semiotic-theme"]=u),e("div",Object.assign({style:l},d,{children:t}))}function N({theme:r,children:n}){const o="string"==typeof r&&$(r)?r:void 0,i=a.useMemo(()=>function(e){return void 0!==e?m(g,F(e)):"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(forced-colors: active)").matches?h:g}(r),[r]);return e(b,{initialState:{theme:i},children:t(R.Provider,{value:o,children:[e(P,{theme:r}),e(B,{children:n})]})})}function T(){return v(e=>e.theme)}function M(e){if(null==e)return"";if("number"!=typeof e)return e+"";if(!isFinite(e))return e+"";if(0===e)return"0";const t=parseFloat(e.toPrecision(12)),a=Math.abs(t);return 1e9>a?1e6>a?1e4>a?Number.isInteger(t)?t+"":parseFloat(t.toPrecision(6))+"":parseFloat((t/1e3).toPrecision(3))+"K":parseFloat((t/1e6).toPrecision(3))+"M":parseFloat((t/1e9).toPrecision(3))+"B"}const _=864e5;function I(e){return 10>e?"0"+e:e+""}const D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(e){let t,a=e;return(r,n,o)=>{const i=r instanceof Date?r:new Date(r);e||!o||2>o.length||o===t||(t=o,a=function(e){if(2>e.length)return"days";const t=[];for(let a=1;e.length>a;a++)t.push(e[a]-e[a-1]);t.sort((e,t)=>e-t);const a=t[Math.floor(t.length/2)];return 12e4>a?"seconds":72e5>a?"minutes":2*_>a?"hours":60*_>a?"days":400*_>a?"months":"years"}(o));const s=a||"days";return null!=n&&0!==n&&o&&0!==o.length?function(e,t,a){const r=e.getUTCFullYear()!==t.getUTCFullYear(),n=r||e.getUTCMonth()!==t.getUTCMonth(),o=n||e.getUTCDate()!==t.getUTCDate(),i=o||e.getUTCHours()!==t.getUTCHours(),s=i||e.getUTCMinutes()!==t.getUTCMinutes(),c=D[e.getUTCMonth()],l=e.getUTCDate(),u=e.getUTCFullYear(),d=I(e.getUTCHours()),p=I(e.getUTCMinutes()),y=I(e.getUTCSeconds());switch(a){case"seconds":return r?`${c} ${l}, ${u} ${d}:${p}:${y}`:o?`${c} ${l} ${d}:${p}:${y}`:i?`${d}:${p}:${y}`:s?`${p}:${y}`:":"+y;case"minutes":return r?`${c} ${l}, ${u} ${d}:${p}`:o?`${c} ${l} ${d}:${p}`:i?`${d}:${p}`:":"+p;case"hours":return r?`${c} ${l}, ${u} ${d}:00`:n?`${c} ${l} ${d}:${p}`:o?`${c} ${l} ${d}:00`:d+":00";case"days":return r?`${c} ${l}, ${u}`:n?`${c} ${l}`:""+l;case"months":return r?`${c} ${u}`:""+c;case"years":return""+u}}(i,new Date(o[n-1]),s):function(e,t){const a=D[e.getUTCMonth()],r=e.getUTCDate(),n=e.getUTCFullYear(),o=I(e.getUTCHours()),i=I(e.getUTCMinutes()),s=I(e.getUTCSeconds());switch(t){case"seconds":return`${a} ${r}, ${n} ${o}:${i}:${s}`;case"minutes":case"hours":return`${a} ${r}, ${n} ${o}:${i}`;case"days":return`${a} ${r}, ${n}`;case"months":return`${a} ${n}`;case"years":return""+n}}(i,s)}}function q(e,t=.5){const a=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!a)return e;const r=Math.round(parseInt(a[1],16)*(1-t)),n=Math.round(parseInt(a[2],16)*(1-t)),o=Math.round(parseInt(a[3],16)*(1-t));return`#${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}function H(e,t=.5){const a=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!a)return e;const r=Math.round(parseInt(a[1],16)+(255-parseInt(a[1],16))*t),n=Math.round(parseInt(a[2],16)+(255-parseInt(a[2],16))*t),o=Math.round(parseInt(a[3],16)+(255-parseInt(a[3],16))*t);return`#${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}let U=null;function G(e={},t){const{background:a="transparent",stroke:r="#000",lineWidth:n=1.5,spacing:o=6,angle:i=45}=e,s=Math.max(8,Math.ceil(2*o));let c;try{c=function(e){return"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(e,e):(U||(U=document.createElement("canvas")),U.width=e,U.height=e,U)}(s)}catch(e){return null}const l=c.getContext("2d");if(!l)return null;a&&"transparent"!==a?(l.fillStyle=a,l.fillRect(0,0,s,s)):l.clearRect(0,0,s,s),l.strokeStyle=r,l.lineWidth=n,l.lineCap="square";const u=i*Math.PI/180;if(45===i||-45===i){const e=i>0?1:-1;for(let t=-s;2*s>=t;t+=o)l.beginPath(),l.moveTo(t,0),l.lineTo(t+e*s,s),l.stroke()}else{l.save(),l.translate(s/2,s/2),l.rotate(u);const e=2*s;for(let t=-e;e>=t;t+=o)l.beginPath(),l.moveTo(-e,t),l.lineTo(e,t),l.stroke();l.restore()}return(t||l).createPattern(c,"repeat")}function W(e,t){const a=e.length,r=t.length,n=Array(r+1);for(let e=0;r>=e;e++)n[e]=e;for(let o=1;a>=o;o++){let a=n[0];n[0]=o;for(let i=1;r>=i;i++){const r=n[i];n[i]=e[o-1]===t[i-1]?a:1+Math.min(a,n[i],n[i-1]),a=r}}return n[r]}function V(e,t,a=3){let r,n=a+1;for(const a of t){const t=W(e.toLowerCase(),a.toLowerCase());n>t&&(n=t,r=a)}return n>a?void 0:r}function J(e){return e.length>3?[e[0],e[Math.floor(e.length/2)],e[e.length-1]]:e}function Y(e,t){var a;if(0===t.length)return null;const r=e.toLowerCase();return t.find(e=>e.toLowerCase().includes(r)||r.includes(e.toLowerCase()))||(null!==(a=V(e,t,3))&&void 0!==a?a:null)}const K={width:{type:"number"},height:{type:"number"},margin:{type:"object"},className:{type:"string"},title:{type:"string"},enableHover:{type:"boolean"},showLegend:{type:"boolean"},showGrid:{type:"boolean"},colorBy:{type:["string","function"]},colorScheme:{type:["string","array"]},tooltip:{type:["boolean","function","object"]},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},axisExtent:{type:"string",enum:["nice","exact"]},frameProps:{type:"object"},onClick:{type:"function"}},X={xLabel:{type:"string"},yLabel:{type:"string"},xFormat:{type:"function"},yFormat:{type:"function"}},Q={categoryLabel:{type:"string"},valueLabel:{type:"string"},valueFormat:{type:"function"},categoryFormat:{type:"function"}},Z=["linear","monotoneX","monotoneY","step","stepAfter","stepBefore","basis","cardinal","catmullRom"],ee=["vertical","horizontal"],te={LineChart:{required:["data"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},K),X),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},lineBy:{type:["string","function"]},lineDataAccessor:{type:"string"},curve:{type:"string",enum:Z},lineWidth:{type:"number"},showPoints:{type:"boolean"},pointRadius:{type:"number"},fillArea:{type:"boolean"},areaOpacity:{type:"number"},forecast:{type:"object"},anomaly:{type:"object"},band:{type:["object","array"]}})},AreaChart:{required:["data"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},K),X),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},areaBy:{type:["string","function"]},lineDataAccessor:{type:"string"},curve:{type:"string",enum:Z},gradientFill:{type:["boolean","object"]},semanticGradient:{type:"array"},areaOpacity:{type:"number"},showLine:{type:"boolean"},lineWidth:{type:"number"},forecast:{type:"object"},anomaly:{type:"object"},band:{type:["object","array"]}})},DifferenceChart:{required:[],dataShape:"array",dataAccessors:["xAccessor","seriesAAccessor","seriesBAccessor"],props:Object.assign(Object.assign(Object.assign({},K),X),{data:{type:"array"},xAccessor:{type:["string","function"]},seriesAAccessor:{type:["string","function"]},seriesBAccessor:{type:["string","function"]},seriesALabel:{type:"string"},seriesBLabel:{type:"string"},seriesAColor:{type:"string"},seriesBColor:{type:"string"},showLines:{type:"boolean"},lineWidth:{type:"number"},showPoints:{type:"boolean"},pointRadius:{type:"number"},curve:{type:"string",enum:Z},areaOpacity:{type:"number"},gradientFill:{type:["boolean","object"]},xExtent:{type:"array"},yExtent:{type:"array"},pointIdAccessor:{type:["string","function"]},windowSize:{type:"number"}})},StackedAreaChart:{required:["data","areaBy"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},K),X),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},areaBy:{type:["string","function"]},lineDataAccessor:{type:"string"},curve:{type:"string",enum:Z},areaOpacity:{type:"number"},showLine:{type:"boolean"},lineWidth:{type:"number"},normalize:{type:"boolean"}})},Scatterplot:{required:["data"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},K),X),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},sizeBy:{type:["string","function"]},sizeRange:{type:"array"},pointRadius:{type:"number"},pointOpacity:{type:"number"},regression:{type:["boolean","string","object"]},forecast:{type:"object"},anomaly:{type:"object"}})},BubbleChart:{required:["data","sizeBy"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},K),X),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},sizeBy:{type:["string","function"]},sizeRange:{type:"array"},bubbleOpacity:{type:"number"},bubbleStrokeWidth:{type:"number"},bubbleStrokeColor:{type:"string"},regression:{type:["boolean","string","object"]}})},Heatmap:{required:["data"],dataShape:"array",dataAccessors:["xAccessor","yAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},K),X),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},colorScheme:{type:"string",enum:["blues","reds","greens","viridis","custom"]},customColorScale:{type:["object","function"]},showValues:{type:"boolean"},valueFormat:{type:"function"},cellBorderColor:{type:"string"},cellBorderWidth:{type:"number"},showLegend:{type:"boolean"},legendPosition:{type:"string",enum:["right","left","top","bottom"]}})},QuadrantChart:{required:[],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},K),X),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},quadrants:{type:"object"},xCenter:{type:"number"},yCenter:{type:"number"},centerlineStyle:{type:"object"},showQuadrantLabels:{type:"boolean"},quadrantLabelSize:{type:"number"},sizeBy:{type:["string","function"]},sizeRange:{type:"array"},pointRadius:{type:"number"},pointOpacity:{type:"number"}})},MultiAxisLineChart:{required:["series"],dataShape:"array",dataAccessors:["xAccessor"],props:Object.assign(Object.assign(Object.assign({},K),X),{data:{type:"array"},xAccessor:{type:["string","function"]},series:{type:"array"},colorScheme:{type:["string","array"]},curve:{type:"string"},lineWidth:{type:"number"},annotations:{type:"array"}})},CandlestickChart:{required:["highAccessor","lowAccessor"],dataShape:"array",dataAccessors:["xAccessor","highAccessor","lowAccessor"],props:Object.assign(Object.assign(Object.assign({},K),X),{data:{type:"array"},xAccessor:{type:["string","function"]},highAccessor:{type:["string","function"]},lowAccessor:{type:["string","function"]},openAccessor:{type:["string","function"]},closeAccessor:{type:["string","function"]},candlestickStyle:{type:"object"},mode:{type:"string",enum:["primary","context","sparkline"]},annotations:{type:"array"}})},ConnectedScatterplot:{required:["data"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},K),X),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},orderAccessor:{type:["string","function"]},orderLabel:{type:"string"},pointRadius:{type:"number"},pointIdAccessor:{type:["string","function"]},annotations:{type:"array"},regression:{type:["boolean","string","object"]},forecast:{type:"object"},anomaly:{type:"object"}})},BarChart:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},K),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:ee},sort:{type:["boolean","string","function"]},barPadding:{type:"number"},roundedTop:{type:"number"},regression:{type:["boolean","string","object"]}})},StackedBarChart:{required:["data","stackBy"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},K),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},stackBy:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:ee},normalize:{type:"boolean"},sort:{type:["boolean","string","function"]},barPadding:{type:"number"},roundedTop:{type:"number"}})},LikertChart:{required:[],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor","levelAccessor","countAccessor"],props:Object.assign(Object.assign(Object.assign({},K),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},levelAccessor:{type:["string","function"]},countAccessor:{type:["string","function"]},levels:{type:"array"},orientation:{type:"string",enum:ee},barPadding:{type:"number"}})},GroupedBarChart:{required:["data","groupBy"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},K),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},groupBy:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:ee},sort:{type:["boolean","string","function"]},barPadding:{type:"number"},roundedTop:{type:"number"}})},SwarmPlot:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},K),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:ee},sizeBy:{type:["string","function"]},sizeRange:{type:"array"},pointRadius:{type:"number"},pointOpacity:{type:"number"},categoryPadding:{type:"number"},brush:{type:"boolean"},onBrush:{type:"function"},linkedBrush:{type:["string","object"]}})},BoxPlot:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},K),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:ee},showOutliers:{type:"boolean"},outlierRadius:{type:"number"},categoryPadding:{type:"number"}})},Histogram:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},K),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},bins:{type:"number"},relative:{type:"boolean"},categoryPadding:{type:"number"},brush:{type:"boolean"},onBrush:{type:"function"},linkedBrush:{type:["string","object"]}})},ViolinPlot:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},K),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:ee},bins:{type:"number"},curve:{type:"string"},showIQR:{type:"boolean"},categoryPadding:{type:"number"},brush:{type:"boolean"},onBrush:{type:"function"},linkedBrush:{type:["string","object"]}})},RidgelinePlot:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},K),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},bins:{type:"number"},amplitude:{type:"number"},categoryPadding:{type:"number"}})},DotPlot:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},K),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:ee},sort:{type:["boolean","string","function"]},dotRadius:{type:"number"},categoryPadding:{type:"number"},regression:{type:["boolean","string","object"]}})},PieChart:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign({},K),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},startAngle:{type:"number"},cornerRadius:{type:"number"}})},DonutChart:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign({},K),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},innerRadius:{type:"number"},centerContent:{type:["object","string","number"]},startAngle:{type:"number"},cornerRadius:{type:"number"}})},GaugeChart:{required:["value"],dataShape:"none",dataAccessors:[],props:Object.assign(Object.assign({},K),{value:{type:"number"},min:{type:"number"},max:{type:"number"},thresholds:{type:"array"},gradientFill:{type:"object"},arcWidth:{type:"number"},cornerRadius:{type:"number"},sweep:{type:"number"},fillZones:{type:"boolean"},showNeedle:{type:"boolean"},needleColor:{type:"string"},color:{type:"string"},centerContent:{type:["object","string","number","function"]},valueFormat:{type:"function"},showScaleLabels:{type:"boolean"},backgroundColor:{type:"string"}})},FunnelChart:{required:["data"],dataShape:"array",dataAccessors:["stepAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},K),Q),{data:{type:"array"},stepAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},categoryAccessor:{type:["string","function"]},orientation:{type:"string",enum:["horizontal","vertical"]},connectorOpacity:{type:"number"},showCategoryTicks:{type:"boolean"},responsiveWidth:{type:"boolean"},legendPosition:{type:"string",enum:["right","left","top","bottom"]}})},SwimlaneChart:{required:["subcategoryAccessor"],dataShape:"array",dataAccessors:["categoryAccessor","subcategoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},K),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},subcategoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:["horizontal","vertical"]},barPadding:{type:"number"},roundedTop:{type:"number"},showCategoryTicks:{type:"boolean"},brush:{type:"boolean"},onBrush:{type:"function"},linkedBrush:{type:["string","object"]},responsiveWidth:{type:"boolean"},legendPosition:{type:"string",enum:["right","left","top","bottom"]}})},ForceDirectedGraph:{required:["nodes","edges"],dataShape:"network",dataAccessors:["nodeIDAccessor","sourceAccessor","targetAccessor"],props:Object.assign(Object.assign({},K),{nodes:{type:"array"},edges:{type:"array"},nodeIDAccessor:{type:["string","function"]},sourceAccessor:{type:["string","function"]},targetAccessor:{type:["string","function"]},nodeLabel:{type:["string","function"]},nodeSize:{type:["number","string","function"]},nodeSizeRange:{type:"array"},edgeWidth:{type:["number","string","function"]},edgeColor:{type:"string"},edgeOpacity:{type:"number"},iterations:{type:"number"},forceStrength:{type:"number"},showLabels:{type:"boolean"}})},SankeyDiagram:{required:["edges"],dataShape:"network",dataAccessors:["sourceAccessor","targetAccessor"],props:Object.assign(Object.assign({},K),{nodes:{type:"array"},edges:{type:"array"},sourceAccessor:{type:["string","function"]},targetAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},edgeColorBy:{type:["string","function"],enum:["source","target","gradient"]},orientation:{type:"string",enum:ee},nodeAlign:{type:"string",enum:["justify","left","right","center"]},nodePaddingRatio:{type:"number"},nodeWidth:{type:"number"},nodeLabel:{type:["string","function"]},showLabels:{type:"boolean"},edgeOpacity:{type:"number"},edgeSort:{type:"function"}})},ProcessSankey:{required:["domain"],dataShape:"network",dataAccessors:["sourceAccessor","targetAccessor"],props:Object.assign(Object.assign({},K),{nodes:{type:"array"},edges:{type:"array"},domain:{type:"array"},axisTicks:{type:"array"},sourceAccessor:{type:["string","function"]},targetAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},startTimeAccessor:{type:["string","function"]},endTimeAccessor:{type:["string","function"]},xExtentAccessor:{type:["string","function"]},edgeIdAccessor:{type:["string","function"]},legendPosition:{type:"string",enum:["right","left","top","bottom"]},pairing:{type:"string",enum:["value","temporal"]},packing:{type:"string",enum:["off","reuse"]},laneOrder:{type:"string",enum:["insertion","crossing-min","inside-out","crossing-min+inside-out"]},ribbonLane:{type:"string",enum:["source","target","both"]},lifetimeMode:{type:"string",enum:["full","half"]},showLaneRails:{type:"boolean"},showQualityReadout:{type:"boolean"},edgeOpacity:{type:"number"},timeFormat:{type:"function"},valueFormat:{type:"function"},showParticles:{type:"boolean"},particleStyle:{type:"object"}})},ChordDiagram:{required:["edges"],dataShape:"network",dataAccessors:["sourceAccessor","targetAccessor"],props:Object.assign(Object.assign({},K),{nodes:{type:"array"},edges:{type:"array"},sourceAccessor:{type:["string","function"]},targetAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},edgeColorBy:{type:["string","function"],enum:["source","target"]},padAngle:{type:"number"},groupWidth:{type:"number"},sortGroups:{type:"function"},nodeLabel:{type:["string","function"]},showLabels:{type:"boolean"},edgeOpacity:{type:"number"}})},TreeDiagram:{required:["data"],dataShape:"object",dataAccessors:[],props:Object.assign(Object.assign({},K),{data:{type:"object"},layout:{type:"string",enum:["tree","cluster","partition","treemap","circlepack"]},orientation:{type:"string",enum:["vertical","horizontal","radial"]},childrenAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},colorByDepth:{type:"boolean"},edgeStyle:{type:"string",enum:["line","curve"]},nodeLabel:{type:["string","function"]},showLabels:{type:"boolean"},nodeSize:{type:"number"}})},Treemap:{required:["data"],dataShape:"object",dataAccessors:[],props:Object.assign(Object.assign({},K),{data:{type:"object"},childrenAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},colorByDepth:{type:"boolean"},showLabels:{type:"boolean"},nodeLabel:{type:["string","function"]},nodeStyle:{type:"function"}})},CirclePack:{required:["data"],dataShape:"object",dataAccessors:[],props:Object.assign(Object.assign({},K),{data:{type:"object"},childrenAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},colorByDepth:{type:"boolean"},showLabels:{type:"boolean"},nodeLabel:{type:["string","function"]},circleOpacity:{type:"number"}})},OrbitDiagram:{required:["data"],dataShape:"object",dataAccessors:[],props:Object.assign(Object.assign({},K),{data:{type:"object"},childrenAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},orbitMode:{type:["string","array"]},speed:{type:"number"},revolution:{type:"function"},eccentricity:{type:["number","function"]},orbitSize:{type:["number","function"]},nodeRadius:{type:["number","function"]},showRings:{type:"boolean"},showLabels:{type:"boolean"},animated:{type:"boolean"},colorByDepth:{type:"boolean"},annotations:{type:"array"},foregroundGraphics:{type:"object"}})},RealtimeLineChart:{required:[],dataShape:"realtime",dataAccessors:[],props:{size:{type:"array"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},windowSize:{type:"number"},windowMode:{type:"string",enum:["sliding","stepping"]},arrowOfTime:{type:"string",enum:["left","right"]},stroke:{type:"string"},strokeWidth:{type:"number"},strokeDasharray:{type:"string"},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},width:{type:"number"},height:{type:"number"},decay:{type:"object"},pulse:{type:"object"},staleness:{type:"object"},transition:{type:"object"}}},RealtimeHistogram:{required:["binSize"],dataShape:"realtime",dataAccessors:[],props:{binSize:{type:"number"},direction:{type:"string",enum:["up","down"]},size:{type:"array"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},categoryAccessor:{type:["string","function"]},colors:{type:"object"},windowSize:{type:"number"},windowMode:{type:"string",enum:["sliding","stepping"]},arrowOfTime:{type:"string",enum:["left","right"]},fill:{type:"string"},stroke:{type:"string"},strokeWidth:{type:"number"},gap:{type:"number"},brush:{type:["boolean","string","object"]},onBrush:{type:"function"},linkedBrush:{type:["string","object"]},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},width:{type:"number"},height:{type:"number"},decay:{type:"object"},pulse:{type:"object"},staleness:{type:"object"},transition:{type:"object"}}},TemporalHistogram:{required:["data","binSize"],dataShape:"array",dataAccessors:["timeAccessor","valueAccessor","categoryAccessor"],props:{data:{type:"array"},binSize:{type:"number"},direction:{type:"string",enum:["up","down"]},size:{type:"array"},width:{type:"number"},height:{type:"number"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},categoryAccessor:{type:["string","function"]},colors:{type:"object"},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},fill:{type:"string"},stroke:{type:"string"},strokeWidth:{type:"number"},gap:{type:"number"},linkedHover:{type:["boolean","string","object"]},brush:{type:["boolean","string","object"]},onBrush:{type:"function"},linkedBrush:{type:["string","object"]}}},RealtimeSwarmChart:{required:[],dataShape:"realtime",dataAccessors:[],props:{size:{type:"array"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},categoryAccessor:{type:["string","function"]},colors:{type:"object"},windowSize:{type:"number"},windowMode:{type:"string",enum:["sliding","stepping"]},arrowOfTime:{type:"string",enum:["left","right"]},radius:{type:"number"},fill:{type:"string"},opacity:{type:"number"},stroke:{type:"string"},strokeWidth:{type:"number"},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},width:{type:"number"},height:{type:"number"},decay:{type:"object"},pulse:{type:"object"},staleness:{type:"object"},transition:{type:"object"}}},RealtimeWaterfallChart:{required:[],dataShape:"realtime",dataAccessors:[],props:{size:{type:"array"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},windowSize:{type:"number"},windowMode:{type:"string",enum:["sliding","stepping"]},arrowOfTime:{type:"string",enum:["left","right"]},positiveColor:{type:"string"},negativeColor:{type:"string"},connectorStroke:{type:"string"},connectorWidth:{type:"number"},gap:{type:"number"},stroke:{type:"string"},strokeWidth:{type:"number"},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},width:{type:"number"},height:{type:"number"},decay:{type:"object"},pulse:{type:"object"},staleness:{type:"object"},transition:{type:"object"}}},RealtimeHeatmap:{required:[],dataShape:"realtime",dataAccessors:[],props:{size:{type:"array"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},heatmapXBins:{type:"number"},heatmapYBins:{type:"number"},aggregation:{type:"string",enum:["count","sum","mean"]},windowSize:{type:"number"},windowMode:{type:"string",enum:["sliding","stepping"]},arrowOfTime:{type:"string",enum:["left","right"]},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},width:{type:"number"},height:{type:"number"},decay:{type:"object"},pulse:{type:"object"},staleness:{type:"object"}}},ScatterplotMatrix:{required:["data","fields"],dataShape:"array",dataAccessors:[],props:Object.assign(Object.assign({},K),{data:{type:"array"},fields:{type:"array"}})},MinimapChart:{required:["data"],dataShape:"array",dataAccessors:[],props:Object.assign(Object.assign({},K),{data:{type:"array"}})},ChoroplethMap:{required:["areas"],dataShape:"array",dataAccessors:["valueAccessor"],props:Object.assign(Object.assign({},K),{areas:{type:["array","string"]},valueAccessor:{type:["string","function"]},colorScheme:{type:["string","array"]},projection:{type:"string"}})},ProportionalSymbolMap:{required:["points"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign({},K),{points:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},sizeBy:{type:["string","function"]},areas:{type:["array","string"]}})},FlowMap:{required:["flows"],dataShape:"array",dataAccessors:[],props:Object.assign(Object.assign({},K),{flows:{type:"array"},nodes:{type:"array"},valueAccessor:{type:["string","function"]},lineIdAccessor:{type:["string","function"]}})},DistanceCartogram:{required:["points"],dataShape:"array",dataAccessors:[],props:Object.assign(Object.assign({},K),{points:{type:"array"},center:{type:"array"},costAccessor:{type:["string","function"]}})},BigNumber:{required:[],dataShape:"none",dataAccessors:[],props:{width:{type:["number","string"]},height:{type:["number","string"]},className:{type:"string"},onClick:{type:"function"},value:{type:"number"},label:{type:"string"},caption:{type:"string"},format:{type:["string","function"],enum:["number","currency","percent","compact","duration"]},locale:{type:"string"},currency:{type:"string"},precision:{type:"number"},prefix:{type:"string"},suffix:{type:"string"},unit:{type:"string"},comparison:{type:"object"},target:{type:"object"},delta:{type:"number"},deltaFormat:{type:["string","function"],enum:["number","currency","percent","compact","duration"]},showDeltaPercent:{type:"boolean"},direction:{type:"string",enum:["higher-is-better","lower-is-better","neutral"]},sentiment:{type:"string",enum:["auto","positive","negative","neutral"]},thresholds:{type:"array"},chartSlot:{type:["string","number","array","object","function"]},chartSize:{type:"number"},windowSize:{type:"number"},mode:{type:"string",enum:["tile","presentation","inline","thumbnail"]},align:{type:"string",enum:["start","center","end"]},padding:{type:["number","object"]},emphasis:{type:"string",enum:["primary","secondary"]},color:{type:"string"},background:{type:"string"},borderColor:{type:"string"},borderRadius:{type:["number","string"]},animate:{type:["boolean","object"]},stalenessThreshold:{type:"number"},staleLabel:{type:"string"},headerSlot:{type:["string","number","array","object","function"]},valueSlot:{type:["string","number","array","object","function"]},deltaSlot:{type:["string","number","array","object","function"]},trendSlot:{type:["string","number","array","object","function"]},footerSlot:{type:["string","number","array","object","function"]},onObservation:{type:"function"}}}};function ae(e,t){return(Array.isArray(t)?t:[t]).includes(Array.isArray(e)?"array":typeof e)}function re(e,t){const a=[],r=te[e];if(!r)return{valid:!1,errors:[`Unknown component "${e}". Valid components: ${Object.keys(te).join(", ")}`]};for(const n of r.required)null==t[n]&&a.push(`"${n}" is required for ${e}.`);for(const[e,n]of Object.entries(t)){if(null==n)continue;const t=r.props[e];if(t){if(!ae(n,t.type)){const r=Array.isArray(t.type)?t.type.join(" | "):t.type;a.push(`"${e}" should be ${r}, got ${Array.isArray(n)?"array":typeof n}.`);continue}t.enum&&"string"==typeof n&&!t.enum.includes(n)&&a.push(`"${e}" value "${n}" is not valid. Expected one of: ${t.enum.join(", ")}.`)}}const n=Object.keys(r.props),o=new Set(n);for(const r of Object.keys(t))if(void 0!==t[r]&&!o.has(r)){const t=V(r,n),o=t?`Unknown prop "${r}" for ${e}. Did you mean "${t}"?`:`Unknown prop "${r}" for ${e}. Valid props: ${n.join(", ")}.`;a.push(o)}if("array"===r.dataShape){const n=t.data,o={};for(const e of r.dataAccessors){const a=t[e];"string"==typeof a&&(o[e]=a)}const i=function({componentName:e,data:t,accessors:a,requiredProps:r}){if(r)for(const[t,a]of Object.entries(r))if(null==a)return`${e}: ${t} is required. Provide a field name or function.`;if(null==t)return null;if(!Array.isArray(t)||0===t.length)return e+": No data provided. Pass a non-empty array to the data prop.";if(!Array.isArray(t)&&"object"==typeof t)return e+": data should be an array, but received an object. If this is hierarchical data, use TreeDiagram, Treemap, or CirclePack instead.";if(a){const r=J(t).find(e=>e&&"object"==typeof e);if(r){const t=Object.keys(r);for(const[n,o]of Object.entries(a))if(o&&"string"==typeof o&&!(o in r)){const a=Y(o,t),r=a?` Try ${n}="${a}".`:"";return`${e}: ${n} "${o}" not found in data. Available fields: ${t.join(", ")}.${r}`}}}return null}({componentName:e,data:n,accessors:Object.keys(o).length>0?o:void 0});i&&a.push(i)}else if("object"===r.dataShape){const r=function({componentName:e,data:t,dataLabel:a="data"}){return null==t?`${e}: No ${a} provided. Pass a hierarchical object with children: { name: "root", children: [...] }.`:Array.isArray(t)?`${e}: ${a} should be a single root object, not an array. Expected: { name: "root", children: [...] }. If you have flat data, use LineChart, BarChart, or Scatterplot instead.`:null}({componentName:e,data:t.data});r&&a.push(r)}else if("network"===r.dataShape){const n=function({componentName:e,nodes:t,edges:a,nodesRequired:r=!1,edgesRequired:n=!0,accessors:o}){if(null==t&&null==a)return null;if(n&&(!a||!Array.isArray(a)||0===a.length))return e+': No edges provided. Pass a non-empty array: edges={[{ source: "A", target: "B", value: 10 }, ...]}.';if(r&&(!t||!Array.isArray(t)||0===t.length))return e+': No nodes provided. Pass a non-empty array: nodes={[{ id: "A" }, { id: "B" }, ...]}.';if(o&&t&&t.length>0){const a=J(t).find(e=>e&&"object"==typeof e);if(a){const t=Object.keys(a);for(const[r,n]of Object.entries(o))if(n&&"string"==typeof n&&!(n in a)){const a=Y(n,t),o=a?` Try ${r}="${a}".`:"";return`${e}: ${r} "${n}" not found in node data. Available fields: ${t.join(", ")}.${o}`}}}return null}({componentName:e,nodes:t.nodes,edges:t.edges,nodesRequired:r.required.includes("nodes"),edgesRequired:r.required.includes("edges")});n&&a.push(n)}return{valid:0===a.length,errors:a}}const ne=new Set(["label","callout","callout-circle","callout-rect","text","widget"]),oe=new Set(["label","callout","callout-circle","callout-rect"]);function ie(e){return"string"==typeof(null==e?void 0:e.type)?e.type:""}function se(e){return!!e&&"object"==typeof e&&ne.has(ie(e))}function ce(e){return oe.has(ie(e))&&!function(e){return Array.isArray(null==e?void 0:e.disable)&&e.disable.includes("connector")}(e)}const le=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),ue=new Set(["ForceDirectedGraph","SankeyDiagram","ChordDiagram"]),de=new Set(["BarChart","StackedBarChart","GroupedBarChart","AreaChart","StackedAreaChart"]),pe=new Set(["LineChart","AreaChart","StackedAreaChart"]),ye=new Set(["BarChart","StackedBarChart","GroupedBarChart","FunnelChart"]);function ge(e){const t=e.match(/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!t)return null;const[a,r,n]=[parseInt(t[1],16)/255,parseInt(t[2],16)/255,parseInt(t[3],16)/255],o=e=>e>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92;return.2126*o(a)+.7152*o(r)+.0722*o(n)}function fe(e,t){const a=ge(e),r=ge(t);return null===a||null===r?null:(Math.max(a,r)+.05)/(Math.min(a,r)+.05)}const he=["xAccessor","yAccessor","timeAccessor","valueAccessor","categoryAccessor","colorBy","sizeBy","lineBy","areaBy","stackBy","groupBy","orderAccessor","y0Accessor","sourceAccessor","targetAccessor","nodeIDAccessor","childrenAccessor","costAccessor"];function me(e,t){const a=[],r=re(e,t);for(const e of r.errors)a.push({severity:"error",code:"VALIDATION",message:e,fix:""});return te[e]?(function(e,t,a){const r=te[e];if(r){if("array"===r.dataShape){const e=t.data;e&&Array.isArray(e)&&0===e.length&&a.push({severity:"error",code:"EMPTY_DATA",message:"data is an empty array — chart will render blank.",fix:"Provide at least one data point: data={[{ x: 1, y: 2 }]}."})}"network"===r.dataShape&&t.edges&&Array.isArray(t.edges)&&0===t.edges.length&&a.push({severity:"error",code:"EMPTY_EDGES",message:"edges is an empty array — network chart will render blank.",fix:'Provide at least one edge: edges={[{ source: "A", target: "B" }]}.'})}}(e,t,a),function(e,t,a){const r=t.width,n=t.height;if(void 0===r||"number"==typeof r&&r>0||a.push({severity:"error",code:"BAD_WIDTH",message:`width=${JSON.stringify(r)} — chart needs a positive number.`,fix:"Set width={600} or use responsiveWidth={true}."}),void 0===n||"number"==typeof n&&n>0||a.push({severity:"error",code:"BAD_HEIGHT",message:`height=${JSON.stringify(n)} — chart needs a positive number.`,fix:"Set height={400} or use responsiveHeight={true}."}),t.size&&Array.isArray(t.size)){const[e,r]=t.size;(null!=e&&0>=e||null!=r&&0>=r)&&a.push({severity:"error",code:"BAD_SIZE",message:`size=[${e}, ${r}] — both dimensions must be positive.`,fix:"Set size={[600, 400]}."})}}(0,t,a),function(e,t,a){const r=te[e];if(!r||"array"!==r.dataShape)return;const n=t.data;if(!n||!Array.isArray(n)||0===n.length)return;const o=n[0];if(!o||"object"!=typeof o)return;const i=Object.keys(o);for(const e of r.dataAccessors){const r=t[e];"string"==typeof r&&(r in o||a.push({severity:"error",code:"ACCESSOR_MISSING",message:`${e}="${r}" not found in data. Available fields: ${i.join(", ")}.`,fix:`Change ${e} to one of: ${i.map(e=>`"${e}"`).join(", ")}.`}))}}(e,t,a),function(e,t,a){le.has(e)&&Array.isArray(t.data)&&a.push({severity:"error",code:"HIERARCHY_FLAT_ARRAY",message:e+" expects hierarchical data but received a flat array.",fix:'Pass a root object: data={{ name: "root", children: [...] }}. For flat data, use BarChart or LineChart.'})}(e,t,a),function(e,t,a){ue.has(e)&&(t.edges||t.data||a.push({severity:"error",code:"NETWORK_NO_EDGES",message:e+" requires an edges prop.",fix:'Provide edges={[{ source: "A", target: "B", value: 10 }]}.'}))}(e,t,a),function(e,t,a){const r=te[e];if(!r||"array"!==r.dataShape)return;const n=t.data;if(!n||!Array.isArray(n)||0===n.length)return;const o=n[0];if(!o||"object"!=typeof o)return;const i=t.xAccessor;"string"==typeof i&&o[i]instanceof Date&&!t.xFormat&&a.push({severity:"warning",code:"DATE_NO_FORMAT",message:`xAccessor "${i}" contains Date objects but no xFormat is provided. Axis ticks may display "[object Object]".`,fix:"Add xFormat={d => d.toLocaleDateString()} or use timestamps (d.getTime()) instead of Date objects."})}(e,t,a),function(e,t,a){t.linkedHover&&!t.selection&&a.push({severity:"warning",code:"LINKED_HOVER_NO_SELECTION",message:"linkedHover is set but selection is not — this chart emits hover events but won't highlight from others.",fix:`Add selection={{ name: "${"object"==typeof t.linkedHover&&t.linkedHover.name||"hl"}" }} to receive cross-highlights.`})}(0,t,a),function(e,t,a){var r;if(!de.has(e))return;const n=t.rExtent||t.yExtent;n&&Array.isArray(n)&&n.length>=1&&null!=n[0]&&0!==n[0]&&a.push({severity:"warning",code:"NON_ZERO_BASELINE",message:`${e} has a non-zero baseline (${n[0]}). Bar and area charts should start at zero to avoid exaggerating differences.`,fix:`Remove the custom extent minimum or set it to 0: rExtent={[0, ${null!==(r=n[1])&&void 0!==r?r:"auto"}]}. For trend-focused charts, use LineChart instead.`})}(e,t,a),function(e,t,a){if(!pe.has(e))return;if(t.gapStrategy)return;const r=t.data;if(!r||!Array.isArray(r)||0===r.length)return;const n=t.yAccessor||"y";"string"==typeof n&&r.some(e=>{const t=e[n];return null==t||Number.isNaN(t)})&&a.push({severity:"warning",code:"DATA_GAPS",message:`Data contains null/undefined/NaN values in "${n}". Default behavior breaks the line at gaps.`,fix:'Set gapStrategy="break" (default), "interpolate", or "zero" to control gap handling.'})}(e,t,a),function(e,t,a){var r,n;const o=null!==(r=t.width)&&void 0!==r?r:600,i=null!==(n=t.height)&&void 0!==n?n:400,s=t.margin;if(!s||"object"!=typeof s)return;const c=(s.left||0)+(s.right||0),l=(s.top||0)+(s.bottom||0);o>c||a.push({severity:"error",code:"MARGIN_OVERFLOW_H",message:`Horizontal margins (${c}px) >= width (${o}px) — no drawing area left.`,fix:"Reduce margin.left/right or increase width."}),i>l||a.push({severity:"error",code:"MARGIN_OVERFLOW_V",message:`Vertical margins (${l}px) >= height (${i}px) — no drawing area left.`,fix:"Reduce margin.top/bottom or increase height."})}(0,t,a),function(e,t,a){var r;const n=te[e];if(!n||"array"!==n.dataShape)return;const o=t.data;if(!o||!Array.isArray(o)||0===o.length)return;const i=[];t.xAccessor&&"string"==typeof t.xAccessor&&i.push({prop:"xAccessor",name:t.xAccessor}),t.yAccessor&&"string"==typeof t.yAccessor&&i.push({prop:"yAccessor",name:t.yAccessor}),t.valueAccessor&&"string"==typeof t.valueAccessor&&i.push({prop:"valueAccessor",name:t.valueAccessor});const s=Math.min(o.length,5);for(const e of i){let t=!0;for(let a=0;s>a;a++){const n=null===(r=o[a])||void 0===r?void 0:r[e.name];if("number"==typeof n&&Number.isFinite(n)){t=!1;break}}t&&a.push({severity:"error",code:"DEGENERATE_EXTENT",message:`${e.prop}="${e.name}" produces NaN or non-finite values for all sampled data points — chart extents will be invalid.`,fix:`Ensure data[].${e.name} contains finite numbers, or use a function accessor to transform values.`})}}(e,t,a),function(e,t,a){if(!ye.has(e))return;const r=t.barPadding;"number"==typeof r&&10>r&&a.push({severity:"warning",code:"BAR_PADDING_INVISIBLE",message:`barPadding=${r} is very small — bars may appear to have no spacing between them.`,fix:"Increase barPadding to at least 10 for visible gaps, e.g. barPadding={12}."})}(e,t,a),function(e,t,a){if("bottom"!==t.legendPosition)return;const r=t.margin;if(!r||"object"!=typeof r)return;const n=r.bottom;"number"==typeof n&&70>n&&a.push({severity:"warning",code:"BOTTOM_MARGIN_WITH_LEGEND",message:`legendPosition="bottom" with margin.bottom=${n}px — legend may overlap axis labels.`,fix:"Increase margin.bottom to at least 70, e.g. margin={{ ...margin, bottom: 80 }}."})}(0,t,a),function(e,t,a){var r;if(!t.showLegend)return;if("right"!==(null!==(r=t.legendPosition)&&void 0!==r?r:"right"))return;const n=t.margin;if(!n||"object"!=typeof n)return;const o=n.right;"number"==typeof o&&100>o&&a.push({severity:"warning",code:"LEGEND_MARGIN_TIGHT",message:`showLegend is true with legendPosition="right" but margin.right=${o}px — legend may be clipped or overlap the chart.`,fix:"Increase margin.right to at least 100, e.g. margin={{ ...margin, right: 120 }}."})}(0,t,a),function(e,t,a){if("Heatmap"!==e)return;const r=t.data;if(!r||!Array.isArray(r)||0===r.length)return;const n=r[0];if(n&&"object"==typeof n)for(const e of["xAccessor","yAccessor"]){const r=t[e];if("string"!=typeof r)continue;const o=n[r];"string"==typeof o&&a.push({severity:"warning",code:"HEATMAP_STRING_ACCESSOR",message:`${e}="${r}" resolves to string values (e.g. "${o}"). Heatmap will use categorical axis handling which may produce unexpected cell layout.`,fix:"If you intend categorical axes this is fine. Otherwise, convert values to numbers before passing data."})}}(e,t,a),function(e,t,a){const r=t.colorScheme;if(!r||!Array.isArray(r))return;const n="string"==typeof t.background?t.background:"#ffffff";if(!n.startsWith("#"))return;const o=[];for(const e of r){if("string"!=typeof e||!e.startsWith("#"))continue;const t=fe(e,n);null!==t&&3>t&&o.push(`${e} (${t.toFixed(1)}:1)`)}o.length>0&&a.push({severity:"warning",code:"LOW_COLOR_CONTRAST",message:`${o.length} color(s) in colorScheme have < 3:1 contrast against background "${n}": ${o.join(", ")}. Data marks may be hard to see.`,fix:'Use darker colors on light backgrounds or lighter colors on dark backgrounds. Import COLOR_BLIND_SAFE_CATEGORICAL from "semiotic" for an accessible preset.'})}(0,t,a),function(e,t,a){const r=t.colorScheme;if(!r||!Array.isArray(r)||2>r.length)return;const n=r.filter(e=>"string"==typeof e&&e.startsWith("#"));if(2>n.length)return;const o=[];for(let e=0;n.length-1>e;e++){const t=fe(n[e],n[e+1]);null!==t&&1.5>t&&o.push(`${n[e]} / ${n[e+1]} (${t.toFixed(1)}:1)`)}o.length>0&&a.push({severity:"warning",code:"LOW_ADJACENT_CONTRAST",message:`${o.length} adjacent color pair(s) in colorScheme have very similar luminance: ${o.join("; ")}. Categories may be hard to distinguish.`,fix:'Alternate light and dark colors in the scheme, or use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic" for a pre-tested palette.'})}(0,t,a),function(e,t,a){const r="string"==typeof t.title&&t.title.trim().length>0,n="string"==typeof t.description&&t.description.trim().length>0,o="string"==typeof t.summary&&t.summary.trim().length>0;r||n||o||a.push({severity:"warning",code:"MISSING_DESCRIPTION",message:'No title, description, or summary provided. Screen readers will use a generic label like "XY chart".',fix:'Add a title="..." prop for a brief label, or description="..." for a detailed aria-label, or summary="..." for a screen-reader-only note describing the chart\'s purpose.'})}(0,t,a),function(e,t,a){const r=[];for(const e of he)"function"==typeof t[e]&&r.push(e);r.length>0&&a.push({severity:"warning",code:"FUNCTION_ACCESSOR",message:`Function accessor${r.length>1?"s":""} detected: ${r.join(", ")}. If defined inline (e.g. \`xAccessor={d => d.value}\`), every parent re-render creates a new reference which may trigger unnecessary scene rebuilds.`,fix:'Use string accessors when possible (e.g. xAccessor="value"), or memoize with useCallback / define outside the component.'})}(0,t,a),function(e,t,a){const r=Array.isArray(t.annotations)?t.annotations:null;if(r)for(const e of r){if(!e||"object"!=typeof e)continue;const t=ie(e);if(!se(e)||"widget"===t)continue;const r=Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0),n="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:t,o=ce(e);!o&&r>120?a.push({severity:"warning",code:"ANNOTATION_FAR_NO_CONNECTOR",message:`Annotation "${n}" sits ~${Math.round(r)}px from its anchor with no connector — a reader can't tell what it refers to.`,fix:'Add a connector (connector: { end: "arrow" }, the label/callout default) or place the note adjacent to its target (smaller dx/dy).'}):o&&r>250&&a.push({severity:"warning",code:"ANNOTATION_LONG_CONNECTOR",message:`Annotation "${n}" uses a very long connector (~${Math.round(r)}px); prefer placing the note adjacent to its target when space allows.`,fix:"Reduce dx/dy so the note sits near its target, or keep the long connector only if proximity is genuinely infeasible."})}}(0,t,a),function(e,t,a){const r=Array.isArray(t.annotations)?t.annotations:null;if(!r)return;const n=r.filter(se).length;if(0===n)return;const o="number"==typeof t.width?t.width:600,i="number"==typeof t.height?t.height:400,s=function(e,t,a={}){return"number"==typeof a.maxAnnotations&&Number.isFinite(a.maxAnnotations)?Math.max(0,Math.floor(a.maxAnnotations)):e>0&&t>0?Math.max(1,Math.round(e*t/(a.areaPerAnnotation&&a.areaPerAnnotation>0?a.areaPerAnnotation:2e4))):1/0}(o,i);Number.isFinite(s)&&n>s&&a.push({severity:"warning",code:"ANNOTATION_DENSITY",message:`${n} note annotations on a ${o}×${i} chart exceed the ~${s} notes the plot area carries comfortably — the chart may read as cluttered.`,fix:'Mark the essential notes emphasis: "primary" and let density management shed the rest (autoPlaceAnnotations: { density: true }), enable progressive disclosure to reveal secondary notes on hover, or give the chart more room.'})}(0,t,a),{ok:a.every(e=>"warning"===e.severity),diagnoses:a}):{ok:0===a.length,diagnoses:a}}const be=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),ve=new Set(["PieChart","DonutChart","FunnelChart"]),xe=new Set(["BigNumber"]),Ae=new Set(["LineChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","ConnectedScatterplot","BubbleChart","QuadrantChart","MultiAxisLineChart","CandlestickChart","Heatmap","MinimapChart"]),we=new Set(["OrbitDiagram"]),$e=new Set(["RealtimeLineChart","RealtimeHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","ProcessSankey"]),Se=new Set(["MultiAxisLineChart"]),ke=new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),je={Scatterplot:"pointRadius",BubbleChart:"pointRadius",ConnectedScatterplot:"pointRadius",QuadrantChart:"pointRadius",SwarmPlot:"pointRadius",DotPlot:"dotRadius"},Oe=new Set(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#f0e442","#000000"]);function Ce(e){return"string"==typeof e&&e.trim().length>0}function ze(e){return"primary"===(null==e?void 0:e.emphasis)||"secondary"===(null==e?void 0:e.emphasis)||null!=function(e){var t;const a=null===(t=null==e?void 0:e.provenance)||void 0===t?void 0:t.confidence;return"number"==typeof a&&Number.isFinite(a)?a:null}(e)}function Re(e){const t=e.toLowerCase().replace(/[^a-z]/g,"");if(!t)return 0;if(3>=t.length)return 1;const a=t.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/,"").replace(/^y/,"").match(/[aeiouy]{1,2}/g);return a?a.length:1}function Le(e,t,a={}){const r=[],n=!!te[e],o=!0===a.inChartContainer,i=!0===a.describe,s=!0===a.navigable,c=xe.has(e),l=be.has(e),u=!1!==t.accessibleTable&&!c,d=Ce(t.title),p=Ce(t.description),y=Ce(t.summary),g=d||p||y,f=function(e){return!1!==e.tooltip||null!=e.onClick||null!=e.brush||null!=e.onBrush||null!=e.selection||null!=e.linkedHover||null!=e.linkedBrush}(t),h=Array.isArray(t.annotations)?t.annotations.filter(e=>!!e&&"object"==typeof e):[],m=n?"pass":"manual",b=n?"":` (unrecognized component "${e}" — verify manually that the built-in applies)`;if(r.push(function(e){const t={id:"perceivable.low-contrast",principle:"perceivable",heuristic:"Low contrast",critical:!0},a=e.colorScheme,r="string"==typeof e.background?e.background:null;if(r&&!r.startsWith("#"))return Object.assign(Object.assign({},t),{status:"manual",message:`Background "${r}" isn't a hex literal (theme/CSS variable) — contrast can't be verified statically.`,fix:'Pass a hex `background` (e.g. "#ffffff"/"#000000"), or verify contrast manually once the theme resolves.'});const n=null!=r?r:"#ffffff";if(!Array.isArray(a))return Object.assign(Object.assign({},t),{status:"manual",message:"Mark colors come from the theme/CSS variables — contrast can't be verified statically.",fix:"Confirm geometries/large text have ≥ 3:1 and regular text ≥ 4.5:1 contrast against the background."});const o=[];let i=0;for(const e of a){if("string"!=typeof e||!e.startsWith("#"))continue;const t=fe(e,n);null!=t&&(i++,3>t&&o.push(`${e} (${t.toFixed(1)}:1)`))}return Object.assign(Object.assign({},t),0===i?{status:"manual",message:"colorScheme has no parseable hex colors to check.",fix:"Verify contrast manually for non-hex colors."}:o.length>0?{status:"fail",message:`${o.length} color(s) fall below 3:1 contrast vs ${n}: ${o.join(", ")}.`,fix:"Darken (light background) or lighten (dark background) those colors, or use COLOR_BLIND_SAFE_CATEGORICAL."}:{status:"pass",message:`All ${i} checked colorScheme color(s) meet ≥ 3:1 contrast vs ${n}.`})}(t)),r.push(Object.assign({id:"perceivable.content-only-visual",principle:"perceivable",heuristic:"Content is only visual",critical:!0},c?{status:"pass",message:"BigNumber renders its value as real text with an ARIA label — available without vision."}:u?{status:"pass",message:"A screen-reader data table + live region expose the data non-visually (accessibleTable is on)."}:p&&y?{status:"manual",message:"accessibleTable is off; a description + summary are present. Verify they convey everything the chart shows.",fix:"Re-enable accessibleTable, or confirm via screen reader that the text alternative is complete."}:{status:"fail",message:"accessibleTable is disabled and there's no full text alternative — the data is only available visually.",fix:"Remove accessibleTable={false}, or provide a complete description/summary plus a data table."})),r.push({id:"perceivable.small-text",principle:"perceivable",heuristic:"Small text size",critical:!0,status:"pass",message:"Semiotic's default tick and axis-label fonts are 12px, meeting Chartability's 9pt/12px floor.",fix:"If a theme or override lowers --semiotic-tick-font-size below 12px, raise it back for low-vision audiences."}),r.push(Object.assign({id:"perceivable.seizure-risk",principle:"perceivable",heuristic:"Visual presents seizure risk",critical:!0},null!=t.pulse||we.has(e)?{status:"manual",message:"Pulse/continuous animation is in use. Confirm nothing flashes more than 3×/sec, especially saturated red.",fix:"Avoid red flashes and rapid (>3 Hz) flicker; reduced-motion is auto-honored, but verify the default presentation."}:{status:"manual",message:"No flashing detected statically. Confirm no element flashes more than 3×/sec.",fix:"Manual check — most static charts pass trivially."})),null!=t.colorBy){r.push(Object.assign({id:"perceivable.color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1},!0===t.directLabel||!0===t.showLabels?{status:"pass",message:"Categories are encoded by color (colorBy) and also directly labeled, so color isn't the only channel."}:{status:"warn",message:"Categories are encoded by color (colorBy) with no redundant channel — Semiotic does not yet ship texture/pattern fills.",fix:"Add direct labels (directLabel on LineChart/AreaChart, showLabels on network/hierarchy), keep categories ≤ ~7, and use a CVD-safe palette."}));const e=Array.isArray(t.colorScheme)?t.colorScheme:null,a=e?e.filter(e=>"string"==typeof e&&e.startsWith("#")).map(e=>e.toLowerCase()):[],n=a.length>0&&a.every(e=>Oe.has(e));r.push(Object.assign({id:"perceivable.cvd-safe",principle:"perceivable",heuristic:"Not CVD-friendly",critical:!1},n?{status:"pass",message:"colorScheme uses Semiotic's Wong colorblind-safe palette."}:{status:"manual",message:"Color encodes meaning; statically we can't confirm the palette is colorblind-safe.",fix:'Use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic", or test your scheme with Viz Palette / Chroma.'})),r.push({id:"flexible.textures-adjustable",principle:"flexible",heuristic:"Contrast and textures cannot be adjusted",critical:!1,status:"warn",message:"There's no per-category texture/pattern channel to toggle as an alternative to color.",fix:"Until texture fills land, ensure the encoding survives color removal: direct labels + a CVD-safe palette. Contrast itself is themeable via CSS variables."})}{const e=h.filter(se);if(e.length>0){const a=t.autoPlaceAnnotations,n="object"==typeof a&&null!==a&&!0===a.redundantCues,o=e.filter(e=>{if("string"!=typeof e.color)return!1;const t=ie(e),a=n&&"text"===t;return!(ce(e)||a)});r.push(Object.assign({id:"perceivable.annotation-association",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1},0===o.length?{status:"pass",message:"No annotation relies on color alone to indicate its target — wherever color is used, a connector, enclosure, or reference-line cue is present too."}:{status:"warn",message:`${o.length} of ${e.length} annotation(s) carry a color but no connector, enclosure, or reference-line cue, so a color-blind or non-visual reader can't tie them to their target (the correspondence problem).`,fix:"Add a connector (the label/callout default), place the note adjacent to its target, enclose the target, or enable autoPlaceAnnotations: { redundantCues: true } to give colored text notes a leader line — don't rely on color matching alone."}))}}r.push(Object.assign({id:"operable.single-input-modality",principle:"operable",heuristic:"Interaction modality only has one input type",critical:!0},n?{status:"pass",message:"Built-in keyboard navigation (arrows/Home/End/PageUp-Down/Enter) mirrors mouse hover."}:{status:"manual",message:`Can't confirm keyboard support for "${e}".`,fix:"Verify Tab + arrow-key operation."}));{const e=[];null==t.brush&&null==t.onBrush||e.push("brushing"),!0===t.zoomable&&e.push("zoom/pan"),"isolate"!==t.legendInteraction&&"highlight"!==t.legendInteraction||e.push("legend filtering"),e.length>0&&r.push({id:"operable.complex-action-alternatives",principle:"operable",heuristic:"Complex actions have no alternatives",critical:!1,status:"warn",message:`Mouse-driven ${e.join(", ")} ${e.length>1?"have":"has"} no built-in keyboard/standard-UI equivalent.`,fix:"Pair the complex interaction with a standard control (range inputs for a brush, buttons for zoom, a checkbox list for legend filtering) operable by keyboard and screen reader."})}{const a=je[e];if(a&&f){const e=t[a];"number"==typeof e&&e>0&&24>2*e&&r.push({id:"operable.target-size",principle:"operable",heuristic:"Target pointer interaction size is too small",critical:!1,status:"warn",message:`${a}=${e} gives a ~${2*e}px hit target, below the 24×24px minimum for pointer interaction.`,fix:"Increase the radius, or rely on the chart's hoverRadius / keyboard navigation as the alternative for precise selection."})}}r.push({id:"operable.tab-stops",principle:"operable",heuristic:"Inappropriate tab stops",critical:!1,status:m,message:`The chart takes a single tab stop and navigates data with arrow keys${b} — the recommended pattern for dense charts (no per-datum tab stops to wade through).`}),r.push(Object.assign({id:"operable.interaction-cues",principle:"operable",heuristic:"No interaction cues or instructions",critical:!0},f?y||p?{status:"manual",message:"Chart is interactive and has descriptive text. Confirm that text explains how to interact (keyboard + pointer).",fix:'State the interaction model in summary, e.g. "Use arrow keys to move between points."'}:{status:"warn",message:"Chart is interactive but nothing explains how to use it.",fix:"Describe the interaction in a summary or nearby text (keyboard navigation, what hover/click reveals)."}:{status:"not-applicable",message:"No interactive behavior detected."})),r.push({id:"operable.controls-override-at",principle:"operable",heuristic:"Controls override AT controls",critical:!0,status:m,message:`Keyboard handlers fire only while the chart has focus, so they don't hijack page/app screen-reader shortcuts${b}.`}),r.push({id:"operable.focus-indicator",principle:"operable",heuristic:"Keyboard focus indicator missing, obscured, or low contrast",critical:!1,status:m,message:`A shape-adaptive focus ring (var(--semiotic-focus)) marks the focused element${b}.`,fix:n?"Ensure --semiotic-focus keeps ≥ 3:1 contrast against your background.":void 0}),r.push(Object.assign({id:"understandable.title-summary-caption",principle:"understandable",heuristic:"No title, summary, or caption",critical:!0},g?{status:"pass",message:`Provided: ${[d&&"title",p&&"description",y&&"summary"].filter(Boolean).join(", ")}.`}:o?{status:"manual",message:"No title/description/summary on the chart. If the wrapping ChartContainer supplies a title/subtitle, this is covered at that layer — verify it does.",fix:"Give the ChartContainer a title (and optionally enable describe), or set title/description/summary on the chart."}:{status:"fail",message:"No title, description, or summary — the screen reader falls back to a generic label.",fix:"Add title/description/summary on the chart, or wrap it in a ChartContainer (the opt-in layer for title/caption/description chrome)."})),r.push(Object.assign({id:"understandable.explain-purpose",principle:"understandable",heuristic:"No explanation for purpose or for how to read",critical:!0},p||y?{status:"pass",message:"A description/summary is available to explain purpose and how to read the chart."}:i?{status:"manual",message:"ChartContainer's describe option explains how to read the chart (type, stats, trend). Confirm the domain purpose — why this chart exists — is also conveyed (title/subtitle).",fix:"Give the ChartContainer a title/subtitle stating the purpose; describe() covers the how-to-read half."}:d?{status:"warn",message:"Only a title is set — a label, not an explanation of purpose or how to read the chart.",fix:"Add a summary, or enable ChartContainer's describe option for an auto-generated how-to-read description."}:{status:"fail",message:"Nothing explains the chart's purpose or how to read it.",fix:"Add a summary/description, or wrap in a ChartContainer with a title and the describe option (the opt-in full-accessibility layer)."}));{const e=[t.description,t.summary].filter(Ce).join(". "),a=e?function(e){const t=e.split(/[.!?]+/).map(e=>e.trim()).filter(Boolean),a=e.trim().split(/\s+/).filter(Boolean);if(0===a.length||0===t.length)return null;let r=0;for(const e of a)r+=Re(e);return a.length/t.length*.39+r/a.length*11.8-15.59}(e):null;r.push(Object.assign({id:"understandable.reading-level",principle:"understandable",heuristic:"Reading level inappropriate",critical:!0},null==a?{status:"not-applicable",message:"No description/summary text to grade."}:a>9?{status:"warn",message:`Description/summary reads at ~grade ${a.toFixed(0)}; Chartability targets grade 9 or lower.`,fix:"Shorten sentences and prefer common words."}:{status:"pass",message:`Description/summary reads at ~grade ${Math.max(0,Math.round(a))} (≤ 9).`}))}if(Ae.has(e)){const e=Ce(t.xLabel),a=Ce(t.yLabel);r.push(Object.assign({id:"understandable.axis-labels",principle:"understandable",heuristic:"Axis labels are unclear or missing",critical:!1},e&&a?{status:"pass",message:"Both axes are labeled (xLabel, yLabel)."}:{status:"warn",message:`Missing axis label: ${[!e&&"xLabel",!a&&"yLabel"].filter(Boolean).join(", ")}. Ticks alone may not name the variable.`,fix:"Set xLabel and yLabel to name each axis's variable and units."}))}if(Se.has(e)&&r.push({id:"understandable.information-complexity",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,status:"warn",message:"Dual-axis chart: two y-scales are hard to read accurately and notoriously easy to misinterpret (the crossover point is arbitrary).",fix:"Confirm the second axis is necessary; consider two aligned charts (small multiples) or indexing both series to a common baseline. Label each axis and its series unambiguously."}),h.length>1){const e=h.filter(ze).length;r.push(Object.assign({id:"understandable.annotation-hierarchy",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1},e===h.length?{status:"pass",message:`All ${h.length} annotation(s) declare hierarchy through emphasis or provenance confidence, so the renderer can resolve reading order and visual priority.`}:0===e?{status:"warn",message:h.length+" annotations are present with no emphasis or provenance confidence; readers may not know which note is primary.",fix:'Mark the main annotation with emphasis="primary", set supporting notes to emphasis="secondary", or provide provenance.confidence so Semiotic can infer order.'}:{status:"warn",message:`${h.length-e} of ${h.length} annotation(s) have no emphasis or provenance confidence; readers may not know which note is primary among the unordered notes.`,fix:"Set emphasis on each annotation (primary/secondary), or provide provenance.confidence on all annotations so Semiotic can infer order."}))}(null!=t.forecast||null!=t.anomaly||null!=t.band||null!=t.regression)&&r.push({id:"understandable.uncertainty",principle:"understandable",heuristic:"Statistical uncertainty isn't clearly communicated",critical:!1,status:"manual",message:"The chart shows a forecast/regression/band/anomaly overlay. Confirm the uncertainty it represents is explained in text, not just drawn.",fix:"State the confidence interval / method in the summary, and label the band so it isn't mistaken for data."}),null!=t.animate&&!1!==t.animate&&r.push({id:"understandable.changes-followable",principle:"understandable",heuristic:"Changes are not easy to follow",critical:!1,status:m,message:`Transitions animate with object constancy and data changes are mirrored to the live region${b}.`,fix:n?"Keep transition durations in the 250ms–2s range so changes are followable but not slow.":void 0}),r.push({id:"robust.conforms-to-standards",principle:"robust",heuristic:"Does not conform to standards",critical:!1,status:"manual",message:"WCAG 2.1 / Section 508 conformance can't be settled from config alone.",fix:"Run an automated checker (axe) on the rendered output and test with real assistive tech."}),r.push({id:"robust.semantically-valid",principle:"robust",heuristic:"Semantically invalid",critical:!1,status:"manual",message:"Whether interactive elements expose correct roles/names is a render-time, screen-reader question.",fix:"Verify with a screen reader that buttons read as buttons, the chart as an image/group, etc."}),r.push({id:"robust.fragile-technology-support",principle:"robust",heuristic:"Fragile technology support",critical:!1,status:m,message:`Charts render on canvas with an SVG overlay and render to SVG in SSR, so access isn't tied to one rendering path${b}.`,fix:n?"Still test across NVDA+Firefox, JAWS+Chrome, and VoiceOver+Safari — AT support varies.":void 0}),r.push(Object.assign({id:"compromising.table",principle:"compromising",heuristic:"No table",critical:!0},c?{status:"not-applicable",message:"Single-value display — a table isn't meaningful."}:u?{status:"pass",message:"A human-readable data table is provided (accessibleTable)."}:{status:"fail",message:"accessibleTable is disabled — no human-readable table of the underlying data.",fix:"Remove accessibleTable={false} (unless title/summary/annotations already convey all the data)."})),c||r.push(Object.assign({id:"compromising.table-static",principle:"compromising",heuristic:"Table/data is static",critical:!1},o?{status:"manual",message:"Rendered in a ChartContainer. If a data-download action is enabled, the data is exportable.",fix:"Enable the ChartContainer data-download action so users can save the underlying data (keep it opt-in)."}:{status:"warn",message:"The data table is read-only — not downloadable, sortable, or filterable.",fix:"Wrap the chart in a ChartContainer and enable its data-download action (opt-in, so deployments can withhold it where export isn't allowed)."})),r.push({id:"compromising.shareable-state",principle:"compromising",heuristic:"State is not easy to share and reproduce",critical:!1,status:n?"pass":"manual",message:`Chart state serializes via toConfig/toURL/copyConfig${n?"":b}.`,fix:n?"Expose it to users via the ChartContainer copyConfig action or a shareable URL.":void 0}),r.push(Object.assign({id:"compromising.navigable-structure",principle:"compromising",heuristic:"Information cannot be navigated according to narrative or structure",critical:!1},s?{status:"pass",message:"ChartContainer's navigable option mounts a structured tree (chart → axes/series → data points) that screen readers can traverse."}:l?{status:"warn",message:"Hierarchical chart: built-in keyboard navigation is largely flat — it doesn't descend the tree structure.",fix:"Enable ChartContainer's navigable option for a structured navigation tree, or lean on the data table and a summary that conveys the hierarchy."}:{status:m,message:`Keyboard navigation steps through points and switches series/groups${b}.`,fix:n?"For deeper structure (axis → series → datum), enable ChartContainer's navigable option.":void 0}));{const a=Array.isArray(t.data)?t.data:null,n=Array.isArray(t.nodes)?t.nodes:null,o={id:"assistive.data-density",principle:"assistive",heuristic:"Data density is inappropriate",critical:!0};let i;i=ve.has(e)&&a&&a.length>7?Object.assign(Object.assign({},o),{status:"warn",message:a.length+" slices in a part-to-whole chart. Chartability suggests ≤ 5 categories; many thin slices are hard to perceive and to describe.",fix:'Group small slices into an "Other" category, or switch to a ranked bar chart.'}):Object.assign(Object.assign({},o),n&&n.length>200?{status:"warn",message:n.length+" nodes. A network this size is hard to navigate non-visually node by node.",fix:"Provide a summary of structure (clusters, hubs, components) and consider filtering or aggregating the graph."}:a&&a.length>5e3?{status:"warn",message:a.length+" data points. Canvas renders this fine, but the non-visual table/navigation become unwieldy.",fix:"Aggregate or bin for the accessible representation, or expose summary statistics rather than every row."}:a?{status:"pass",message:a.length+" data points — a reasonable density for non-visual consumption."}:n?{status:"pass",message:n.length+" nodes — a reasonable density for non-visual consumption."}:{status:"manual",message:"Data not provided inline (push mode); verify density at runtime."}),r.push(i)}{const e=Array.isArray(t.data)?t.data:null,a=["valueFormat","yFormat","xFormat","tickFormat","format"].some(e=>"function"==typeof t[e]||"string"==typeof t[e]);let n=!1;if(e&&!a)for(const t of e.slice(0,50))if(t&&"object"==typeof t){for(const e of Object.values(t))if("number"==typeof e&&Number.isFinite(e)&&Math.abs(e)>=1e5){n=!0;break}if(n)break}n&&r.push({id:"assistive.human-readable-numbers",principle:"assistive",heuristic:"Data in text is not human-readable",critical:!1,status:"warn",message:'Data includes large numbers (≥ 100,000) and no value/tick formatter — screen readers will read every digit (e.g. "six hundred fifty thousand…").',fix:'Pass valueFormat / yFormat (e.g. a compact formatter so 6,500,000 reads as "6.5M"); the formatter flows to ticks, tooltips, and the data table.'})}r.push(Object.assign({id:"assistive.features-described",principle:"assistive",heuristic:"Visually apparent features and relationships are not described",critical:!1},i?{status:"pass",message:"ChartContainer's describe option auto-generates an L1–L3 description (chart type, statistics, and trend) via describeChart()."}:y?{status:"manual",message:"A summary is present. Confirm it describes trends, extrema, clusters, and outliers — not just what the chart is.",fix:"Cover the L2/L3 content blind readers value most: direction of trend, peak/trough, notable outliers."}:{status:"warn",message:"No text describes the visually apparent trends, extrema, or outliers.",fix:"Enable ChartContainer's describe option (auto-generates via describeChart()), or write a summary covering the key trend and notable points."})),r.push(Object.assign({id:"assistive.skippable-navigation",principle:"assistive",heuristic:"Navigation and interaction is tedious",critical:!0},c?{status:"not-applicable",message:"Single value — nothing to skip."}:u?{status:"pass",message:'A "Skip to data table" link lets screen-reader users bypass point-by-point navigation.'}:{status:"warn",message:"accessibleTable is off, removing the skip-to-table affordance.",fix:"Keep accessibleTable enabled so users can skip past dense point navigation."})),r.push({id:"flexible.user-style-respected",principle:"flexible",heuristic:"User style change not respected",critical:!0,status:m,message:`Styling flows through CSS custom properties and honors forced-colors mode, so user/user-agent style changes cascade in${b}.`,fix:n?"Avoid hardcoding colors via frameProps style fns that bypass theme variables.":void 0}),r.push(Object.assign({id:"flexible.reduced-motion",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1},we.has(e)||$e.has(e)?{status:"warn",message:e+" animates continuously. prefers-reduced-motion is auto-honored, but there's no in-chart pause/stop control for users who don't set that preference.",fix:"Offer a pause/stop control for looping/streaming motion (Chartability requires it for animation > 2s)."}:{status:m,message:`prefers-reduced-motion is auto-detected; transitions fast-forward and looping animation stops${b}.`}));{const a=!0===t.responsiveWidth||!0===t.responsiveHeight,n=ke.has(e)&&!0===t.zoomable;r.push(Object.assign({id:"flexible.zoom-reflow",principle:"flexible",heuristic:"Zoom and reflow are not supported",critical:!1},a?{status:"pass",message:`Chart reflows to its container (${[!0===t.responsiveWidth&&"responsiveWidth",!0===t.responsiveHeight&&"responsiveHeight"].filter(Boolean).join(", ")}), so page zoom doesn't clip it.`}:n?{status:"pass",message:"Geo chart is zoomable/pannable."}:{status:"manual",message:"Fixed width/height — verify the chart survives browser zoom and reflow without clipping or loss of function.",fix:"Use responsiveWidth/responsiveHeight so the chart reflows to its container."}))}const v=r.filter(e=>"not-applicable"!==e.status).filter(e=>e.critical),x={criticalsPassed:v.filter(e=>"pass"===e.status).length,criticalsEvaluated:v.length,fails:r.filter(e=>"fail"===e.status).length,warnings:r.filter(e=>"warn"===e.status).length,manual:r.filter(e=>"manual"===e.status).length,passes:r.filter(e=>"pass"===e.status).length};return{component:e,ok:!v.some(e=>"fail"===e.status),summary:x,findings:r,reference:"Chartability (POUR-CAF) — https://chartability.github.io/POUR-CAF/. Not a pass/fail cert; pair with manual screen-reader testing (NVDA+Firefox, JAWS+Chrome, VoiceOver+Safari)."}}function Fe(e,{onlyCritical:t=!1}={}){const a=[];for(const r of e.findings)"fail"!==r.status&&"warn"!==r.status||t&&!r.critical||a.push(r.message);return a}const Pe={pass:"✓",fail:"✗",warn:"⚠",manual:"○","not-applicable":"·"},Be=["perceivable","operable","understandable","robust","compromising","assistive","flexible"];function Ne(e){const t=[],a=e.summary,r=e.ok?`${a.criticalsPassed}/${a.criticalsEvaluated} critical heuristics pass`:`${a.fails} blocking failure(s) — ${a.criticalsPassed}/${a.criticalsEvaluated} critical heuristics pass`;t.push(`${e.ok?"✓":"✗"} ${e.component}: accessibility audit (Chartability POUR-CAF)`),t.push(` ${r} · ${a.warnings} warning(s) · ${a.manual} to verify manually`);for(const a of Be){const r=e.findings.filter(e=>e.principle===a&&"not-applicable"!==e.status);if(0!==r.length){t.push(""),t.push(" "+a.toUpperCase());for(const e of r)t.push(` ${Pe[e.status]} ${e.id}${e.critical?" [critical]":""}: ${e.message}`),!e.fix||"fail"!==e.status&&"warn"!==e.status&&"manual"!==e.status||t.push(" → "+e.fix)}}return t.push(""),t.push(" Ref: "+e.reference),t.join("\n")}function Te(e,t){if("function"==typeof e)return t=>+e(t);const a=e||t;return e=>+e[a]}function Me(e,t){if("function"==typeof e)return e;const a=e||t;return e=>e[a]}const _e=new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),Ie=new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),De=new Set(["PieChart","DonutChart","FunnelChart"]),Ee=new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]);function qe(e,t){var a,r;return Ie.has(e)||De.has(e)||"SwimlaneChart"===e||"GaugeChart"===e?{measure:t.valueAccessor,measureFallback:"value",dimension:null!==(a=t.categoryAccessor)&&void 0!==a?a:t.stepAccessor,dimensionFallback:"category"}:{measure:null!==(r=t.yAccessor)&&void 0!==r?r:t.valueAccessor,measureFallback:"y",dimension:t.xAccessor,dimensionFallback:"x"}}function He(e){for(const t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){const a=e[t];if("string"==typeof a&&a)return a}}function Ue(e,t){return null==e?"—":e instanceof Date?e.toISOString().slice(0,10):"number"==typeof e?t(e):e+""}function Ge(e,t={}){var a,r;const n=!0===t.showRetractedAnnotations,o=!0===t.showSupersededAnnotations,i=new Set;for(const t of e){const e=null===(a=null==t?void 0:t.lifecycle)||void 0===a?void 0:a.supersedes;e&&"retracted"!==(null===(r=null==t?void 0:t.lifecycle)||void 0===r?void 0:r.status)&&i.add(e)}return e.filter(e=>{var t,a;if("retracted"===(null===(t=null==e?void 0:e.lifecycle)||void 0===t?void 0:t.status)&&!n)return!1;const r=null===(a=null==e?void 0:e.provenance)||void 0===a?void 0:a.stableId;return!(r&&i.has(r)&&!o)})}const We={LineChart:"line chart",AreaChart:"area chart",StackedAreaChart:"stacked area chart",DifferenceChart:"difference chart",Scatterplot:"scatter plot",BubbleChart:"bubble chart",ConnectedScatterplot:"connected scatter plot",QuadrantChart:"quadrant chart",MultiAxisLineChart:"dual-axis line chart",CandlestickChart:"candlestick chart",Heatmap:"heatmap",MinimapChart:"line chart",BarChart:"bar chart",StackedBarChart:"stacked bar chart",GroupedBarChart:"grouped bar chart",DotPlot:"dot plot",Histogram:"histogram",BoxPlot:"box plot",ViolinPlot:"violin plot",RidgelinePlot:"ridgeline plot",SwarmPlot:"swarm plot",PieChart:"pie chart",DonutChart:"donut chart",FunnelChart:"funnel chart",GaugeChart:"gauge",LikertChart:"Likert chart",SwimlaneChart:"swimlane chart",ForceDirectedGraph:"network graph",SankeyDiagram:"Sankey diagram",ProcessSankey:"temporal Sankey diagram",ChordDiagram:"chord diagram",TreeDiagram:"tree diagram",Treemap:"treemap",CirclePack:"circle-packing chart",OrbitDiagram:"orbit diagram",ChoroplethMap:"choropleth map",ProportionalSymbolMap:"proportional-symbol map",FlowMap:"flow map",DistanceCartogram:"distance cartogram",BigNumber:"single value"},Ve=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]);function Je(e){return We[e]||e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()+" chart"}const Ye=new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),Ke={"outlier-detection":"alerting","change-detection":"alerting",trend:"tracking","composition-over-time":"apportioning","compare-series":"comparing","compare-categories":"comparing",rank:"ranking","part-to-whole":"apportioning",distribution:"characterizing",correlation:"relating",flow:"tracing",hierarchy:"nesting",geo:"locating"},Xe={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},Qe=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],Ze={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"};function et(e){return Ke[e]}function tt(e,t){var a;const r=function(e){if(e){if("fits"in e||"buildProps"in e){const t=e,a={};for(const[e,r]of Object.entries(t.intentScores))"number"==typeof r&&Number.isFinite(r)&&(a[e]=r);return{family:t.family,intentScores:Object.keys(a).length?a:void 0}}return e}}(t);if(null==r?void 0:r.act)return r.act;if(null==r?void 0:r.intentScores){const e=function(e){let t,a=0;for(const[r,n]of Object.entries(e))if("number"==typeof n&&n>0)if(n>a)t=r,a=n;else if(n===a&&void 0!==t){const e=Qe.indexOf(r),a=Qe.indexOf(t);-1===e||-1!==a&&e>=a||(t=r)}return t}(r.intentScores);if(e&&Ke[e]&&(null!==(a=r.intentScores[e])&&void 0!==a?a:0)>=3)return Ke[e]}return(null==r?void 0:r.family)?Xe[r.family]:function(e){return De.has(e)||"StackedAreaChart"===e?"apportioning":Ye.has(e)?"relating":Ie.has(e)?"comparing":Ee.has(e)?"characterizing":_e.has(e)?"tracking":Ve.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}(e)}function at(e="en"){let t,a;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),a=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch(e){t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),a=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?1e4>Math.abs(e)?a.format(e):t.format(e):e+""}const rt={"y-threshold":"a threshold line","x-threshold":"a threshold line",band:"a highlighted band",label:"a label",callout:"a callout","callout-circle":"a callout","callout-rect":"a callout",text:"a text note",bracket:"a bracket",enclose:"an enclosure","rect-enclose":"an enclosure",highlight:"a highlight",widget:"a widget",trend:"a trend line",envelope:"an envelope","anomaly-band":"an anomaly band",forecast:"a forecast","category-highlight":"a category highlight"};function nt(e){const t=rt["string"==typeof e.type?e.type:"annotation"]||"an annotation",a=function(e){var t,a;const r=e.provenance&&"object"==typeof e.provenance?e.provenance:null,n=null!==(a=null!==(t=null==r?void 0:r.authorKind)&&void 0!==t?t:null==r?void 0:r.source)&&void 0!==a?a:null==r?void 0:r.basis;return"watcher"===n?"a watcher-flagged ":"agent"===n||"ai"===n||"llm-inference"===n?"an AI-suggested ":""}(e),r=a?a+t.replace(/^an? /,""):t,n="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return n?`${r} labeled "${n}"`:r}function ot(e,t,a={}){var r,n;const o=void 0!==a.levels,i=new Set(null!==(r=a.levels)&&void 0!==r?r:["l1","l2","l3"]);!o&&a.capability&&i.add("l4");const s=at(null!==(n=a.locale)&&void 0!==n?n:"en"),c=Je(e),l=Array.isArray(t.data)?t.data:null,u=He(t),{measure:d,measureFallback:p,dimension:y,dimensionFallback:g}=qe(e,t),f="string"==typeof d&&d?d:p,h="string"==typeof y&&y?y:g,m={};if(i.has("l1"))if(_e.has(e)||Ie.has(e))m.l1=`A ${c} of ${f} by ${h}`+(u?`, split by ${u}.`:".");else if(De.has(e))m.l1=`A ${c} showing ${f} across ${h} categories.`;else if(Ee.has(e))m.l1=`A ${c} of the distribution of ${f}`+(u?` by ${u}.`:".");else if(Ve.has(e)){const e=Array.isArray(t.nodes)?t.nodes.length:void 0,a=Array.isArray(t.edges)?t.edges.length:void 0,r=[null!=e?`${e} ${st(e,"node")}`:null,null!=a?`${a} ${st(a,"edge")}`:null].filter(Boolean);m.l1=`A ${c}${r.length?" with "+r.join(" and "):""}.`}else if("BigNumber"===e){const e="string"==typeof t.label?t.label:f;m.l1=`A single value${e?" for "+e:""}.`}else m.l1=`A ${c}.`;const b=_e.has(e)||Ie.has(e)||De.has(e)||Ee.has(e);let v=null;if((i.has("l2")||i.has("l3")||i.has("l4"))&&b&&l&&l.length>0&&(v=function(e,t,a,r){let n=0,o=0,i=1/0,s=-1/0,c=null,l=null,u=0,d=0,p=null,y=null,g=NaN,f=NaN;for(const a of e){const e=t(a);Number.isFinite(e)&&(0===n&&(g=e,p=a),f=e,y=a,i>e&&(i=e,c=a,u=n),e>s&&(s=e,l=a,d=n),n++,o+=e)}return 0===n?null:{count:n,min:i,max:s,mean:o/n,minLabel:Ue(null!=c?a(c):null,r),maxLabel:Ue(null!=l?a(l):null,r),first:g,last:f,firstLabel:Ue(null!=p?a(p):null,r),lastLabel:Ue(null!=y?a(y):null,r),minIndex:u,maxIndex:d}}(l,Te(d,p),Me(y,g),s)),i.has("l2")&&b&&(l&&0!==l.length?v&&(m.l2=De.has(e)?`${v.count} segments totaling ${s(function(e){return e.mean*e.count}(v))}. Largest is ${v.maxLabel} at ${s(v.max)}; smallest is ${v.minLabel} at ${s(v.min)}.`:`${f} ranges from ${s(v.min)} (${v.minLabel}) to ${s(v.max)} (${v.maxLabel}), with a mean of ${s(v.mean)} across ${v.count} points.`):m.l2="No data is loaded yet."),i.has("l3")&&v&&_e.has(e)?m.l3=function(e,t,a){const{first:r,last:n,min:o,max:i,maxLabel:s,minLabel:c,firstLabel:l,lastLabel:u,minIndex:d,maxIndex:p,count:y}=e,g=i-o,f=n-r;if(0===g)return`${it(t)} is constant at ${a(r)} across the series.`;if(.04>g/(Math.abs(e.mean)||1))return`${it(t)} ends roughly where it started (${a(r)} at ${l} to ${a(n)} at ${u}), ranging between ${a(o)} and ${a(i)}.`;const h=p>0&&y-1>p,m=d>0&&y-1>d,b=(i-Math.max(r,n))/g,v=(Math.min(r,n)-o)/g;return h&&b>.15?`Overall ${t} climbs to a peak of ${a(i)} (${s}), then falls to ${a(n)} (${u}).`:m&&v>.15?`Overall ${t} drops to a low of ${a(o)} (${c}), then recovers to ${a(n)} (${u}).`:.05>Math.abs(f)/g?`${it(t)} ends roughly where it started (${a(r)} at ${l} to ${a(n)} at ${u}), ranging between ${a(o)} and ${a(i)}.`:f>0?p===y-1?`Overall ${t} rises from ${a(r)} (${l}) to a peak of ${a(n)} (${u}).`:`Overall ${t} rises from ${a(r)} (${l}) to ${a(n)} (${u}), after peaking at ${a(i)} (${s}).`:d===y-1?`Overall ${t} falls from ${a(r)} (${l}) to a low of ${a(n)} (${u}).`:`Overall ${t} falls from ${a(r)} (${l}) to ${a(n)} (${u}), after dipping to ${a(o)} (${c}).`}(v,f,s):i.has("l3")&&v&&Ie.has(e)&&(m.l3=`The highest ${h} is ${v.maxLabel} and the lowest is ${v.minLabel}.`),i.has("l4")){const r=tt(e,a.capability);r&&(m.l4=function(e,t,a,r,n,o,i,s){const c=Ze[e],l=/^[aeiou]/i.test(c)?"an":"a";let u,d;switch(e){case"locating":u="This is a map",d="read values by location";break;case"presenting":u="This is a single-value display",d=`read ${"string"==typeof a.label&&a.label?a.label:n} as the headline number`;break;case"tracing":u=`This is ${l} ${c} chart`,d="follow the movement between states";break;case"nesting":u=`This is ${l} ${c} chart`,d="read it for nested structure and how children sum into their parents";break;case"relating":u=`This is ${l} ${c} chart`,d=`read it for whether ${o} and ${n} move together`;break;default:u=`This is ${l} ${c} chart`,d=function(e,t,a,r,n,o){if(!t)switch(e){case"alerting":return"watch for points that break from the rest";case"tracking":return"read it for the overall direction of "+a;case"comparing":return`compare ${a} across ${r}`;case"ranking":return"read it top to bottom by "+a;case"apportioning":return`read each ${r}'s share of the whole`;case"characterizing":return"read it for the spread and shape of "+a;default:return"read the highlighted features"}switch(e){case"alerting":return function(e,t,a){if(Ie.has(a)||De.has(a))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;const{first:r,last:n,min:o,max:i,minLabel:s,maxLabel:c,lastLabel:l,minIndex:u,maxIndex:d,count:p}=e,y=i-o;if(y>0){const e=d>0&&p-1>d,a=u>0&&p-1>u,g=(i-Math.max(r,n))/y,f=(Math.min(r,n)-o)/y;if(e&&g>.15)return`the peak of ${t(i)} at ${c} is the point to investigate`;if(a&&f>.15)return`the dip to ${t(o)} at ${s} is the point to investigate`;if(n>=i)return`the climb to ${t(n)} at ${l} warrants a closer look`;if(o>=n)return`the drop to ${t(n)} at ${l} warrants a closer look`}return`the extremes — ${c} (${t(i)}) and ${s} (${t(o)}) — are the points to check`}(t,n,o);case"tracking":return`read it for the trajectory of ${a}, which ${function(e){const t=e.max-e.min,a=e.last-e.first;return 0===t||.05>Math.abs(a)/t?"holds roughly steady":a>0?"rises":"falls"}(t)} from ${n(t.first)} (${t.firstLabel}) to ${n(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${a} across ${r}; ${t.maxLabel} leads at ${n(t.max)}`;case"ranking":return`read it top to bottom by ${a}; ${t.maxLabel} ranks highest at ${n(t.max)}`;case"apportioning":{const e=t.mean*t.count,a=e>0?Math.round(t.max/e*100):null;return`read each ${r}'s share of the ${n(e)} total; ${t.maxLabel} is the largest at ${n(t.max)}${null!=a?` (${a}%)`:""}`}case"characterizing":return`read it for the spread of ${a}, from ${n(t.min)} to ${n(t.max)}`;default:return"read the highlighted features"}}(e,r,n,o,i,t)}return`${u}; ${d}.${function(e,t){var a;if(!t)return"";const r=null===(a=t.familiarity)||void 0===a?void 0:a[e];return"number"!=typeof r||r>2?"":` This ${Je(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`}(t,s)}`}(r,e,t,v,f,h,s,a.audience))}const x=["l1","l2","l3","l4"].filter(e=>i.has(e)&&m[e]).map(e=>m[e]).join(" "),A=function(e){const t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;const a=Ge(t.filter(e=>!!e&&"object"==typeof e));if(0===a.length)return;const r=a.map(nt),n=r.slice(0,5),o=r.length-n.length,i=function(e){var t;return e.length>1?2===e.length?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`:null!==(t=e[0])&&void 0!==t?t:""}(n)+(o>0?`, and ${o} more`:""),s=a.length;return`The author has marked ${1===s?"one feature":s+" features"} on this chart: ${i}.`}(t);return Object.assign({text:A?`${A} ${x}`.trim():x,levels:m},A?{annotations:A}:{})}function it(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function st(e,t){return 1===e?t:t+"s"}function ct(e,t,a={}){var r,n,o;const i=null!==(r=a.locale)&&void 0!==r?r:"en",s=Math.max(1,null!==(n=a.maxLeaves)&&void 0!==n?n:200),c=at(i),l={id:"root",role:"chart",label:ot(e,t,{locale:i}).text||"Chart.",level:1,children:[]},u=function(e,t){const a=Array.isArray(e.annotations)?e.annotations:null;if(!a)return null;const r=Ge(a.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return null;let n=0;const o=r.slice(0,t).map(e=>{var t;const a=null===(t=e.lifecycle)||void 0===t?void 0:t.status,r=a&&"accepted"!==a?` (${a})`:"";return{id:"annotation-"+n++,role:"annotation",level:3,label:`${o=nt(e),o?o.charAt(0).toUpperCase()+o.slice(1):o}${r}.`,datum:e};var o});r.length>t&&o.push({id:"annotation-"+n++,role:"annotation",level:3,label:`…and ${r.length-t} more annotations.`});const i=r.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===i?"one marked feature":i+" marked features"}.`,children:o}}(t,s),d=Array.isArray(t.data)?t.data:null,p=_e.has(e)||Ie.has(e)||De.has(e)||Ee.has(e);if(!d||0===d.length||!p)return u&&(l.children=[u]),l;const{measure:y,measureFallback:g,dimension:f,dimensionFallback:h}=qe(e,t),m=Te(y,g),b=Me(f,h),v="string"==typeof y&&y?y:g,x="string"==typeof f&&f?f:h,A=He(t);let w=0;const $=e=>`${e}-${w++}`,S=(e,t)=>{const a=e.slice(0,s).map(e=>((e,t)=>{const a=m(e),r=Ue(b(e),c);return{id:$("datum"),role:"datum",level:t,label:`${r}: ${Number.isFinite(a)?c(a):"—"}`,value:Number.isFinite(a)?a:void 0,datum:e}})(e,t));return e.length>s&&a.push({id:$("more"),role:"datum",level:t,label:`…and ${e.length-s} more points`}),a},k=[];if(_e.has(e)||Ie.has(e)){let t=1/0,a=-1/0,r=1/0,n=-1/0;const o=[];let i=!0;for(const e of d){const s=m(e);Number.isFinite(s)&&(t>s&&(t=s),s>a&&(a=s));const c=b(e);o.push(c),"number"==typeof c&&Number.isFinite(c)?(r>c&&(r=c),c>n&&(n=c)):i=!1}const s=new Set,l=[];for(const e of o){const t=e+"";s.has(t)||(s.add(t),l.push(e))}const u=i?`${c(r)} to ${c(n)}`:`${Ue(l[0],c)} to ${Ue(l[l.length-1],c)} (${Ie.has(e)?l.length+" categories":d.length+" points"})`;k.push({id:$("axis"),role:"axis",level:2,label:`${Ie.has(e)?"Category axis":"X axis"}: ${x}, ${u}.`}),t>a||k.push({id:$("axis"),role:"axis",level:2,label:`Value axis: ${v}, ${c(t)} to ${c(a)}.`})}if(A){const a=Me(A,A),r=new Map;for(const e of d){const t=(null!==(o=a(e))&&void 0!==o?o:"—")+"",n=r.get(t);n?n.push(e):r.set(t,[e])}const n=[];for(const[a,o]of r){const r=ot(e,Object.assign(Object.assign({},t),{data:o}),{levels:["l2","l3"],locale:i}).text;n.push({id:$("series"),role:"series",level:2,label:`Series ${a}: ${r}`,children:S(o,3)})}l.children=[...k,...n]}else l.children=[...k,...S(d,2)];return u&&l.children.push(u),l}function lt(e,t){const a=[],r=e=>{if(a.push(e),e.children&&e.children.length>0&&t.has(e.id))for(const t of e.children)r(t)};return r(e),a}function ut(e){let t=1;if(e.children)for(const a of e.children)t+=ut(a);return t}function dt(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(a[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);r.length>n;n++)0>t.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(a[r[n]]=e[r[n]])}return a}function pt(e,t,a,r){return new(a||(a=Promise))(function(n,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(i,s)}c((r=r.apply(e,t||[])).next())})}function yt(e,t,a={}){var r;const{capability:n,audience:o,locale:i}=a,s=null!==(r=a.levels)&&void 0!==r?r:["l1","l2","l3"],c=!1!==a.includeStructure,l=tt(e,n),u=ot(e,t,{levels:l?[...s,"l4"]:s,locale:i,capability:n,audience:o}),d=u.levels,{l4:p}=d,y=dt(d,["l4"]),g=["l1","l2","l3"].map(e=>u.levels[e]).filter(Boolean).join(" "),f=Object.assign({levels:y,text:u.annotations?`${u.annotations} ${g}`.trim():g},u.annotations?{annotations:u.annotations}:{});let h;if(l&&p){const e=(m=n)?"fits"in m||"buildProps"in m?{family:m.family}:{family:m.family,intentScores:m.intentScores}:{};h={act:l,sentence:p,family:e.family,intentScores:e.intentScores}}var m;const b=c?ct(e,t,{maxLeaves:a.maxLeaves,locale:i}):void 0,v=[f.text,null==h?void 0:h.sentence].filter(Boolean).join(" ");return{component:e,description:f,intent:h,structure:b,text:v}}function gt(e,t=30){return Math.max((null!=e?e:4)+5,12,t)}"function"==typeof SuppressedError&&SuppressedError;const ft=new Set(["tooltip","onObservation","xFormat","yFormat","valueFormat","svgAnnotationRules","tooltipContent","onHover","tickFormatTime","tickFormatValue","edgeSort","sortGroups","centerContent","frameProps","controls","oFormat","rFormat","oSort","pieceStyle","summaryStyle","nodeStyle","edgeStyle","customHoverBehavior","customClickBehavior","customDoubleClickBehavior","onBrush","onTopologyChange","backgroundGraphics","foregroundGraphics","legend"]),ht=new Set(["data","nodes","edges"]),mt="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e));function bt(e,t,a){if(!te[e])throw Error(`Unknown component "${e}". Known components: ${Object.keys(te).join(", ")}`);const r=!1!==(null==a?void 0:a.includeData),n={};for(const[e,a]of Object.entries(t))null!=a&&(ft.has(e)||!r&&ht.has(e)||"function"!=typeof a&&((null==a?void 0:a.$$typeof)||(n[e]=mt(a))));return Object.assign({component:e,props:n,version:"1",createdAt:(new Date).toISOString()},(null==a?void 0:a.selections)?{selections:a.selections}:{})}function vt(e){if(!e.component||!e.props)throw Error("Invalid chart config: missing component or props");if(!te[e.component])throw Error(`Unknown component "${e.component}". This config may require a newer version of semiotic.`);return{componentName:e.component,props:mt(e.props)}}function xt(e){const t=JSON.stringify(e);return"sc="+btoa(unescape(encodeURIComponent(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function At(e){const t=new URLSearchParams(e.includes("?")?e.split("?")[1]:e).get("sc");if(!t)throw Error("No chart config found in URL (missing 'sc' parameter)");const a=t.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(escape(atob(a)));return JSON.parse(r)}function wt(e){return pt(this,arguments,void 0,function*(e,t="json"){const a="jsx"===t?$t(e):JSON.stringify(e,null,2);if("undefined"==typeof navigator||!navigator.clipboard)throw Error("Clipboard API not available. copyConfig requires a browser environment.");yield navigator.clipboard.writeText(a)})}function $t(e){const{component:t,props:a}=e,r=["<"+t];for(const[e,t]of Object.entries(a))if("string"==typeof t)r.push(` ${e}="${t}"`);else if("boolean"==typeof t&&!0===t)r.push(" "+e);else if("boolean"==typeof t&&!1===t)r.push(` ${e}={false}`);else if("number"==typeof t)r.push(` ${e}={${t}}`);else{const a=JSON.stringify(t);r.push(80>a.length?` ${e}={${a}}`:` ${e}={${JSON.stringify(t,null,2)}}`)}return r.push("/>"),r.join("\n")}function St(e){const t={};for(const[a,r]of e){const e=[];for(const[,t]of r.clauses){const a={};for(const[e,r]of Object.entries(t.fields))a[e]="point"===r.type?{type:"point",values:Array.from(r.values)}:{type:"interval",range:r.range};e.push({clientId:t.clientId,type:t.type,fields:a})}t[a]={name:r.name,resolution:r.resolution,clauses:e}}return t}function kt(e){const t=new Map;for(const[a,r]of Object.entries(e)){const e=new Map;for(const t of r.clauses){const a={};for(const[e,r]of Object.entries(t.fields))a[e]="point"===r.type?{type:"point",values:new Set(r.values)}:{type:"interval",range:r.range};e.set(t.clientId,{clientId:t.clientId,type:t.type,fields:a})}t.set(a,{name:r.name,resolution:r.resolution,clauses:e})}return t}function jt(e,t){return pt(this,void 0,void 0,function*(){const{format:a="png",filename:r="chart",scale:n=2,background:o="white"}=t||{},i=e.querySelector("svg");if(!i)throw Error("No SVG element found in the container");const s=i.cloneNode(!0),c=i.getBoundingClientRect();if(s.getAttribute("width")||s.setAttribute("width",c.width+""),s.getAttribute("height")||s.setAttribute("height",c.height+""),s.getAttribute("xmlns")||s.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ot(i,s),"svg"===a){const e=(new XMLSerializer).serializeToString(s);Ct(new Blob([e],{type:"image/svg+xml;charset=utf-8"}),r+".svg")}else{const t=c.width*n,a=c.height*n,i=document.createElement("canvas");i.width=t,i.height=a;const l=i.getContext("2d");l.fillStyle=o,l.fillRect(0,0,t,a),l.scale(n,n);const u=e.querySelector("canvas");u&&l.drawImage(u,0,0,c.width,c.height);const d=(new XMLSerializer).serializeToString(s),p=new Blob([d],{type:"image/svg+xml;charset=utf-8"}),y=URL.createObjectURL(p),g=new Image;g.width=c.width,g.height=c.height,yield new Promise((e,t)=>{g.onload=()=>{l.drawImage(g,0,0),i.toBlob(a=>{a?(Ct(a,r+".png"),e()):t(Error("Failed to create PNG blob"))},"image/png"),URL.revokeObjectURL(y)},g.onerror=()=>{URL.revokeObjectURL(y),t(Error("Failed to load SVG image"))},g.src=y})}})}function Ot(e,t){var a;const r=e.children,n=t.children,o=window.getComputedStyle(e),i=["fill","stroke","stroke-width","stroke-dasharray","opacity","fill-opacity","stroke-opacity","font-family","font-size","font-weight","text-anchor","dominant-baseline"];for(const e of i){const r=o.getPropertyValue(e);r&&"none"!==r&&""!==r&&(null===(a=t.style)||void 0===a||a.setProperty(e,r))}for(let e=0;Math.min(r.length,n.length)>e;e++)Ot(r[e],n[e])}function Ct(e,t){const a=URL.createObjectURL(e),r=document.createElement("a");r.href=a,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(a)}function zt(e){return"nominal"===e||"ordinal"===e}function Rt(e){return"quantitative"===e||"temporal"===e}const Lt={category10:"category10",category20:"category20",category20b:"category20",category20c:"category20",accent:"accent",dark2:"dark2",paired:"paired",pastel1:"pastel1",pastel2:"pastel2",set1:"set1",set2:"set2",set3:"set3",tableau10:"category10",tableau20:"category20"},Ft={linear:"linear","monotone-x":"monotoneX","monotone-y":"monotoneY",monotone:"monotoneX",step:"step","step-after":"stepAfter","step-before":"stepBefore",basis:"basis",cardinal:"cardinal","catmull-rom":"catmullRom"},Pt={sum:"sum",mean:"mean",average:"mean",count:"count",min:"min",max:"max",median:"mean"};function Bt(e){var t,a,r,n,o,i,s,c,l,u,d,p;const y=[],{type:g,markProps:f}=function(e){if("string"==typeof e)return{type:e,markProps:{}};const{type:t}=e;return{type:t,markProps:dt(e,["type"])}}(e.mark),h=e.encoding||{},m=h.x,b=h.y,v=h.color,x=h.size,A=h.theta,w=h.opacity;let $;(null===(t=e.data)||void 0===t?void 0:t.values)?$=e.data.values:(null===(a=e.data)||void 0===a?void 0:a.url)&&y.push("data.url is not supported — only inline data.values can be translated. Provide data manually."),e.transform&&e.transform.length>0&&y.push("Vega-Lite transforms are not supported. Pre-transform your data before passing to fromVegaLite()."),e.layer&&y.push('Layered specs ("layer") are not supported. Only single-mark specs can be translated.'),(e.hconcat||e.vconcat||e.concat)&&y.push('Concatenated views ("hconcat"/"vconcat"/"concat") are not supported. Translate each sub-spec individually.'),(e.facet||h.facet||h.row||h.column)&&y.push("Faceted views are not supported. Use Semiotic's LinkedCharts or render multiple charts manually."),e.repeat&&y.push('Repeated views ("repeat") are not supported. Translate each field combination individually.'),(e.params||e.selection)&&y.push("Selections/params are not supported. Use Semiotic's LinkedCharts and selection props for interactivity.");const S={};e.width&&(S.width=e.width),e.height&&(S.height=e.height);const k=function(e){if(e)return"string"==typeof e?e:e.text}(e.title);if(k&&(S.title=k),(null==v?void 0:v.field)&&(S.colorBy=v.field,null===(r=v.scale)||void 0===r?void 0:r.scheme)){const e=Lt[v.scale.scheme];e&&(S.colorScheme=e)}void 0!==(null==w?void 0:w.value)&&(S.pointOpacity=w.value);const j=null==m?void 0:m.aggregate,O=null==b?void 0:b.aggregate;if($&&(j||O)){const e=O?b:m,t=O?m:b,a=Pt[e.aggregate];if(a&&(null==t?void 0:t.field)&&e.field)$=function(e,t){const{groupBy:a,value:r,agg:n="sum"}=t,o=new Map;for(const t of e){const e=t[a]+"";o.has(e)||o.set(e,[]),o.get(e).push(Number(t[r]))}const i=[];for(const[e,t]of o){let r;switch(n){case"count":r=t.length;break;case"mean":r=t.reduce((e,t)=>e+t,0)/t.length;break;case"min":r=Math.min(...t);break;case"max":r=Math.max(...t);break;default:r=t.reduce((e,t)=>e+t,0)}i.push({[a]:e,value:r})}return i}($,{groupBy:t.field,value:e.field,agg:a});else if(("count"===a||"count"===e.aggregate)&&(null==t?void 0:t.field)&&$){const e=new Map;for(const a of $){const r=a[t.field]+"";e.set(r,(e.get(r)||0)+1)}$=Array.from(e,([e,a])=>({[t.field]:e,value:a}))}}if((null==m?void 0:m.bin)||(null==b?void 0:b.bin)){const e="Histogram";$&&(S.data=$),(null==m?void 0:m.bin)?(S.valueAccessor=m.field,(null==b?void 0:b.field)&&(S.categoryAccessor=b.field),(null===(n=m.axis)||void 0===n?void 0:n.title)&&(S.valueLabel=m.axis.title)):(null==b?void 0:b.bin)&&(S.valueAccessor=b.field,(null==m?void 0:m.field)&&(S.categoryAccessor=m.field),(null===(o=b.axis)||void 0===o?void 0:o.title)&&(S.valueLabel=b.axis.title));const t=(null==m?void 0:m.bin)||(null==b?void 0:b.bin),a="object"==typeof t?t.maxbins:void 0;return a&&(S.bins=a),Tt(e,S,y)}let C;switch(g){case"bar":C=function(e,t,a,r,n,o,i){var s,c,l,u,d,p;let y;return(null==a?void 0:a.field)&&!1!==(null==e?void 0:e.stack)&&!1!==(null==t?void 0:t.stack)&&null!==(null==e?void 0:e.stack)&&null!==(null==t?void 0:t.stack)?(y="StackedBarChart",r.stackBy=a.field):y="BarChart",zt(null==e?void 0:e.type)&&Rt(null==t?void 0:t.type)?(r.categoryAccessor=e.field,r.valueAccessor=i?"value":t.field,(null===(s=null==e?void 0:e.axis)||void 0===s?void 0:s.title)&&(r.categoryLabel=e.axis.title),(null===(c=null==t?void 0:t.axis)||void 0===c?void 0:c.title)&&(r.valueLabel=t.axis.title)):Rt(null==e?void 0:e.type)&&zt(null==t?void 0:t.type)?(r.categoryAccessor=t.field,r.valueAccessor=o?"value":e.field,r.orientation="horizontal",(null===(l=null==t?void 0:t.axis)||void 0===l?void 0:l.title)&&(r.categoryLabel=t.axis.title),(null===(u=null==e?void 0:e.axis)||void 0===u?void 0:u.title)&&(r.valueLabel=e.axis.title)):((null==e?void 0:e.field)&&(r.categoryAccessor=e.field),(null==t?void 0:t.field)&&(r.valueAccessor=i?"value":t.field),(null===(d=null==e?void 0:e.axis)||void 0===d?void 0:d.title)&&(r.categoryLabel=e.axis.title),(null===(p=null==t?void 0:t.axis)||void 0===p?void 0:p.title)&&(r.valueLabel=t.axis.title)),n&&(r.data=n),y}(m,b,v,S,$,j,O);break;case"line":if(C="LineChart",Nt(m,b,S,j,O),(null==v?void 0:v.field)&&(S.lineBy=v.field),f.interpolate){const e=Ft[f.interpolate];e&&(S.curve=e)}!0===f.point&&(S.showPoints=!0),$&&(S.data=$);break;case"area":if((null==v?void 0:v.field)?(C="StackedAreaChart",S.areaBy=v.field):C="AreaChart",Nt(m,b,S,j,O),f.interpolate){const e=Ft[f.interpolate];e&&(S.curve=e)}void 0!==f.opacity&&(S.areaOpacity=f.opacity),$&&(S.data=$);break;case"point":case"circle":case"square":(null==x?void 0:x.field)?(C="BubbleChart",S.sizeBy=x.field,(null===(i=x.scale)||void 0===i?void 0:i.range)&&(S.sizeRange=x.scale.range)):C="Scatterplot",Nt(m,b,S,j,O),$&&(S.data=$);break;case"rect":C="Heatmap",(null==m?void 0:m.field)&&(S.xAccessor=m.field),(null==b?void 0:b.field)&&(S.yAccessor=b.field),(null==v?void 0:v.field)&&(S.valueAccessor=v.field,delete S.colorBy),(null===(s=null==m?void 0:m.axis)||void 0===s?void 0:s.title)&&(S.xLabel=m.axis.title),(null===(c=null==b?void 0:b.axis)||void 0===c?void 0:c.title)&&(S.yLabel=b.axis.title),$&&(S.data=$);break;case"arc":f.innerRadius&&f.innerRadius>0?(C="DonutChart",S.innerRadius=f.innerRadius):C="PieChart",(null==A?void 0:A.field)?S.valueAccessor=A.field:(null==b?void 0:b.field)&&(S.valueAccessor=O?"value":b.field),(null==v?void 0:v.field)&&(S.categoryAccessor=v.field),(null==m?void 0:m.field)&&!(null==A?void 0:A.field)&&(S.categoryAccessor=m.field),$&&(S.data=$);break;case"tick":C="DotPlot",zt(null==m?void 0:m.type)?(S.categoryAccessor=m.field,(null==b?void 0:b.field)&&(S.valueAccessor=O?"value":b.field),(null===(l=null==m?void 0:m.axis)||void 0===l?void 0:l.title)&&(S.categoryLabel=m.axis.title),(null===(u=null==b?void 0:b.axis)||void 0===u?void 0:u.title)&&(S.valueLabel=b.axis.title)):zt(null==b?void 0:b.type)?(S.categoryAccessor=b.field,(null==m?void 0:m.field)&&(S.valueAccessor=j?"value":m.field),S.orientation="horizontal",(null===(d=null==b?void 0:b.axis)||void 0===d?void 0:d.title)&&(S.categoryLabel=b.axis.title),(null===(p=null==m?void 0:m.axis)||void 0===p?void 0:p.title)&&(S.valueLabel=m.axis.title)):((null==m?void 0:m.field)&&(S.categoryAccessor=m.field),(null==b?void 0:b.field)&&(S.valueAccessor=O?"value":b.field)),$&&(S.data=$);break;default:y.push(`Unsupported mark type "${g}". Defaulting to Scatterplot.`),C="Scatterplot",Nt(m,b,S,j,O),$&&(S.data=$)}return Tt(C,S,y)}function Nt(e,t,a,r,n){var o,i;(null==e?void 0:e.field)&&(a.xAccessor=r?"value":e.field),(null==t?void 0:t.field)&&(a.yAccessor=n?"value":t.field),(null===(o=null==e?void 0:e.axis)||void 0===o?void 0:o.title)&&(a.xLabel=e.axis.title),(null===(i=null==t?void 0:t.axis)||void 0===i?void 0:i.title)&&(a.yLabel=t.axis.title)}function Tt(e,t,a){const r={component:e,props:t,version:"1",createdAt:(new Date).toISOString()};if(a.length>0){r.warnings=a;for(const e of a)console.warn("[semiotic/fromVegaLite] "+e)}return r}class Mt{constructor(e){if(this._capacity=e,this.head=0,this._size=0,1>e)throw Error("RingBuffer capacity must be at least 1");this.buffer=Array(e)}push(e){let t;return this._size===this._capacity?t=this.buffer[this.head]:this._size++,this.buffer[this.head]=e,this.head=(this.head+1)%this._capacity,t}pushMany(e){const t=[];for(const a of e){const e=this.push(a);void 0!==e&&t.push(e)}return t}get(e){if(e>=0&&this._size>e)return this.buffer[(this.head-this._size+e+this._capacity)%this._capacity]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let e=0;return{next:()=>this._size>e?{done:!1,value:this.get(e++)}:{done:!0,value:void 0}}}forEach(e){const t=(this.head-this._size+this._capacity)%this._capacity;for(let a=0;this._size>a;a++)e(this.buffer[(t+a)%this._capacity],a)}toArray(){const e=Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let a=0;this._size>a;a++)e[a]=this.buffer[(t+a)%this._capacity];return e}resize(e){if(1>e)throw Error("RingBuffer capacity must be at least 1");const t=this.toArray(),a=[];for(;t.length>e;)a.push(t.shift());this._capacity=e,this.buffer=Array(e),this.head=0,this._size=0;for(const e of t)this.push(e);return a}update(e,t){const a=[],r=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;this._size>n;n++){const o=(r+n)%this._capacity,i=this.buffer[o];if(e(i)){let e;e="object"!=typeof i||null===i?i:Array.isArray(i)?[...i]:Object.assign({},i),a.push(e),this.buffer[o]=t(i)}}return a}remove(e){const t=[],a=[];if(this.forEach(r=>{e(r)?a.push(r):t.push(r)}),0===a.length)return a;this.buffer=Array(this._capacity),this.head=0,this._size=0;for(const e of t)this.push(e);return a}clear(){this.buffer=Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}}class _t{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(e){Number.isFinite(e)&&(this._min>e&&(this._min=e),e>this._max&&(this._max=e))}evict(e){e!==this._min&&e!==this._max||(this._dirty=!0)}recalculate(e,t){this._min=1/0,this._max=-1/0;for(const a of e){const e=t?t(a):a;Number.isFinite(e)&&(this._min>e&&(this._min=e),e>this._max&&(this._max=e))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}}const It={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, white)",padding:"8px 12px",borderRadius:"var(--semiotic-tooltip-radius, 6px)",fontSize:"var(--semiotic-tooltip-font-size, 14px)",fontFamily:"var(--semiotic-font-family, inherit)",lineHeight:"1.5",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.15))",pointerEvents:"none",maxWidth:"300px",wordWrap:"break-word"};function Dt(e,t){return"function"==typeof t?t(e):e[t]}function Et(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e){if(!Number.isFinite(e))return e+"";const t=Number.isInteger(e)?e:parseFloat(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():t+""}return e instanceof Date?e.toLocaleDateString():"object"==typeof e&&null!==e?void 0!==e.id?e.id+"":void 0!==e.name?e.name+"":JSON.stringify(e):e+""}function qt(a={}){const{fields:r,title:n,format:o,style:i={},className:s=""}=a;return a=>{if(!a||"object"!=typeof a)return null;let c;const l=[];if(n){const e=Dt(a,n);c=Et(e,o)}if(r&&r.length>0)r.forEach(e=>{let t,r,n;"string"==typeof e?(t=e,r=e,n=o):(t=e.label,r=e.accessor||e.key||"",n=e.format||o);const i=Dt(a,r);l.push({label:t,value:Et(i,n)})});else if(!n){const e=["value","y","name","id","label"];for(const t of e)if(void 0!==a[t]){c=Et(a[t],o);break}if(!c){const e=Object.keys(a).filter(e=>!e.startsWith("_"));e.length>0&&(c=Et(a[e[0]],o))}}const u=Object.assign(Object.assign({},It),i);return t("div",{className:("semiotic-tooltip "+s).trim(),style:u,children:[c&&e("div",{style:{fontWeight:l.length>0?"bold":"normal"},children:c}),l.map((e,a)=>t("div",{style:{marginTop:0===a&&c?"4px":0},children:[e.label&&t("span",{children:[e.label,": "]}),e.value]},a))]})}}function Ht(){return a=>{var r,n,o,i,s,c,l;const u=a.allSeries;if(!u||0===u.length){const t=null!==(n=null===(r=a.data)||void 0===r?void 0:r.value)&&void 0!==n?n:null===(o=a.data)||void 0===o?void 0:o.y;return e("div",{className:"semiotic-tooltip",style:It,children:e("div",{children:Et(t)})})}const d=null!==(c=null!==(i=a.xValue)&&void 0!==i?i:null===(s=a.data)||void 0===s?void 0:s.time)&&void 0!==c?c:null===(l=a.data)||void 0===l?void 0:l.x;return t("div",{className:"semiotic-tooltip",style:It,children:[null!=d&&e("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:Et(d)}),u.map((a,r)=>t("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[e("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:a.color,flexShrink:0}}),e("span",{style:{flex:1,fontSize:"0.85em"},children:a.group}),e("span",{style:{fontWeight:500,fontSize:"0.85em"},children:Et(a.value)})]},r))]})}}function Ut(t){if(!0!==t){if("function"==typeof t){const a=t;return t=>{var r;const n=(o=!0===(null==t?void 0:t.__semioticHoverData)||t&&void 0!==t.data&&"number"==typeof t.x&&"number"==typeof t.y&&t&&("node"===t.type||"edge"===t.type||void 0!==t.nodeOrEdge||void 0!==t.allSeries||void 0!==t.stats||void 0!==t.__chartType)?null!==(r=t.data)&&void 0!==r?r:{}:t,Array.isArray(o)?o[0]:o);var o;const i=a(n);return null==i?null:e("div",{className:"semiotic-tooltip",style:It,children:i})}}return!1!==t&&void 0!==t&&("object"==typeof t&&null!==t&&("fields"in t||"title"in t)?qt(t):qt())}}function Gt(e=240){const t=360-e,a=180+t/2,r=a*Math.PI/180;return{sweepRad:e*Math.PI/180,gapDeg:t,startAngleDeg:a,startAngleRad:r,offsetRad:-Math.PI/2+r}}function Wt(e,t,a,r,n){const o=a-t||1;return n+(Math.max(t,Math.min(a,e))-t)/o*r}function Vt(e=240){const{sweepRad:t,offsetRad:a}=Gt(e),r=[[Math.cos(a),Math.sin(a)],[Math.cos(a+t),Math.sin(a+t)],[0,0]];for(let e=0;2*Math.PI>e;e+=Math.PI/2)((e-a)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)>t+.001||r.push([Math.cos(e),Math.sin(e)]);const n=r.map(e=>e[0]),o=r.map(e=>e[1]),i=Math.min(...n),s=Math.max(...n),c=Math.min(...o),l=Math.max(...o);return{minX:i,maxX:s,minY:c,maxY:l,width:s-i,height:l-c,cx:(i+s)/2,cy:(c+l)/2}}const Jt=Symbol("semiotic.useStreamStatus.wrapped");function Yt(e={}){const{staleThresholdMs:t=5e3,pollIntervalMs:a=1e3}=e,o=r(null),[s,c]=l("idle"),[d,p]=l(null),y=n(()=>{const e={_frame:null,_origPush:null,_origPushMany:null};return{get current(){return e._frame},set current(t){const a=e._frame;if(a&&a!==t&&e._origPush&&e._origPushMany&&(a.push=e._origPush,a.pushMany=e._origPushMany,delete a[Jt]),e._frame=t,!t)return e._origPush=null,void(e._origPushMany=null);if(t[Jt])return;t[Jt]=!0;const r=t.push,n=t.pushMany,o=r.bind(t),i=n.bind(t);e._origPush=r,e._origPushMany=n,t.push=e=>(g(),o(e)),t.pushMany=e=>(e&&e.length>0&&g(),i(e))}}},[]),g=i(()=>{const e="undefined"!=typeof performance?performance.now():Date.now();o.current=e,p(e),c(e=>"active"===e?e:"active")},[]);return u(()=>{const e=setInterval(()=>{const e=o.current;if(null==e)return;const a=("undefined"!=typeof performance?performance.now():Date.now())-e>t;c(e=>{const t=a?"stale":"active";return e===t?e:t})},a);return()=>clearInterval(e)},[t,a]),{ref:y,status:s,lastPushTime:d}}export{A as CARBON_ALERT,x as CARBON_CATEGORICAL_14,y as COLOR_BLIND_SAFE_CATEGORICAL,f as DARK_THEME,h as HIGH_CONTRAST_THEME,_t as IncrementalExtent,g as LIGHT_THEME,Ht as MultiPointTooltip,Mt as RingBuffer,w as THEME_PRESETS,N as ThemeProvider,Fe as accessibilityCaveats,E as adaptiveTimeTicks,Le as auditAccessibility,ct as buildNavigationTree,yt as buildReaderGrounding,et as communicativeActForIntent,Vt as computeArcBoundingBox,$t as configToJSX,wt as copyConfig,ut as countNodes,G as createHatchPattern,q as darkenColor,ot as describeChart,kt as deserializeSelections,me as diagnoseConfig,jt as exportChart,lt as flattenVisible,Ne as formatAccessibilityAudit,vt as fromConfig,At as fromURL,Bt as fromVegaLite,gt as getHitRadius,H as lightenColor,Ut as normalizeTooltip,tt as resolveCommunicativeAct,$ as resolveThemePreset,St as serializeSelections,M as smartTickFormat,Gt as sweepToAngles,S as themeToCSS,k as themeToTokens,bt as toConfig,xt as toURL,z as useHighContrast,C as useReducedMotion,Yt as useStreamStatus,T as useTheme,re as validateProps,Wt as valueToAngle};
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{useRef as r,useMemo as n,useContext as o,useCallback as i,useSyncExternalStore as s,createContext as c,useState as l,useEffect as u}from"react";function d(e,t){const a=new EventTarget;let r=Object.assign(Object.assign({},e(function(e){r=Object.assign(Object.assign({},r),e(r)),a.dispatchEvent(new Event("update"))})),null!=t?t:{});return{getState:()=>r,subscribe:function(e){return a.addEventListener("update",e),()=>a.removeEventListener("update",e)}}}function p(e){if(!e.accessibility)return e;let t=e;if(e.accessibility.colorBlindSafe&&(t=Object.assign(Object.assign({},t),{colors:Object.assign(Object.assign({},t.colors),{categorical:g})})),e.accessibility.highContrast){const e="dark"===t.mode;t=Object.assign(Object.assign({},t),{colors:Object.assign(Object.assign({},t.colors),{text:e?"#ffffff":"#000000",textSecondary:e?"#cccccc":"#333333",grid:e?"#666666":"#999999",border:e?"#888888":"#000000"})})}return t}const g=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],f={mode:"light",colors:{primary:"#00a2ce",secondary:"#6c757d",categorical:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],sequential:"blues",diverging:"RdBu",background:"transparent",surface:"#ffffff",text:"#333",textSecondary:"#666",grid:"#e0e0e0",border:"#ccc",selection:"#00a2ce",selectionOpacity:.15,success:"#2ca02c",danger:"#d62728",warning:"#f0ad4e",error:"#b4181b",info:"#00a2ce"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},y={mode:"dark",colors:{primary:"#4fc3f7",secondary:"#90a4ae",categorical:["#4fc3f7","#ffb74d","#81c784","#ef5350","#ba68c8","#a1887f","#f06292","#90a4ae","#dce775","#4dd0e1"],sequential:"blues",diverging:"RdBu",background:"#1a1a2e",surface:"#252540",text:"#e0e0e0",textSecondary:"#aaa",grid:"#333",border:"#555",selection:"#4fc3f7",selectionOpacity:.15,success:"#81c784",danger:"#ef5350",warning:"#ffb74d",error:"#d84848",info:"#4fc3f7"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},h={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:g,sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#000000",textSecondary:"#333333",grid:"#999999",border:"#000000",focus:"#0000cc",selection:"#0000cc",selectionOpacity:.1,success:"#006400",danger:"#cc0000",warning:"#b15a00",error:"#8b0000",info:"#0000cc"},typography:{fontFamily:"system-ui, sans-serif",titleSize:18,labelSize:14,tickSize:12},tooltip:{background:"#000000",text:"#ffffff",borderRadius:"4px",fontSize:"14px",shadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},borderRadius:"4px"};function m(e,t){if("light"===t)return f;if("dark"===t)return y;if("high-contrast"===t)return h;if("string"==typeof t)return void 0!==console&&console.warn(`[ThemeStore] Unknown theme preset "${t}". Keeping current theme.`),e;if(t.mode&&"auto"!==t.mode){const e="dark"===t.mode?y:f;return p(Object.assign(Object.assign(Object.assign({},e),t),{colors:Object.assign(Object.assign({},e.colors),t.colors||{}),typography:Object.assign(Object.assign({},e.typography),t.typography||{})}))}return p(Object.assign(Object.assign(Object.assign({},e),t),{colors:Object.assign(Object.assign({},e.colors),t.colors||{}),typography:Object.assign(Object.assign({},e.typography),t.typography||{})}))}const[b,v]=function(t){let a=null;const l=()=>(a||(a=c(null)),a),u=d(t);return[function({children:a,initialState:o}){const i=r(o),s=n(()=>d(t,i.current),[]),c=l();return e(c.Provider,{value:s,children:a})},e=>{var t;const a=l(),n=null!==(t=o(a))&&void 0!==t?t:u,c=r(e);c.current=e;const d=i(()=>c.current(n.getState()),[n]),p=i(()=>c.current(n.getState()),[n]);return s(n.subscribe,d,p)}]}(e=>({theme:f,setTheme(t){e(e=>({theme:m(e.theme,t)}))}})),x=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"],A={danger:"#da1e28",warning:"#f1c21b",success:"#24a148",info:"#0043ce"},w={light:f,dark:y,"high-contrast":h,pastels:{mode:"light",colors:{primary:"#c9a0dc",secondary:"#b8a8c8",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#fdf6f0",surface:"#fff5ee",text:"#4a3728",textSecondary:"#7a644a",grid:"#e8d5c4",border:"#e8d5c4",focus:"#8a5fae",annotation:"#8a5fae",success:"#9ad4a3",danger:"#e8869a",warning:"#f0c888",error:"#c86070",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#fff5ee",text:"#4a3728",borderRadius:"8px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"10px"},"pastels-dark":{mode:"dark",colors:{primary:"#c9a0dc",secondary:"#a899c0",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#1a1525",surface:"#251e35",text:"#e8ddf0",textSecondary:"#a899c0",grid:"#3d3455",border:"#3d3455",focus:"#c9a0dc",annotation:"#c9a0dc",success:"#88d4ab",danger:"#f0a0c0",warning:"#f0c888",error:"#e87690",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#251e35",text:"#e8ddf0",borderRadius:"8px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"10px"},"bi-tool":{mode:"light",colors:{primary:"#2563eb",secondary:"#6b7280",categorical:["#2563eb","#0d9488","#ea580c","#6b7280"],sequential:"blues",background:"#f5f6f8",surface:"#ffffff",text:"#2c3e50",textSecondary:"#64717f",grid:"#d8dce3",border:"#d8dce3",focus:"#2563eb",annotation:"#2563eb",success:"#10b981",danger:"#ef4444",warning:"#f59e0b",error:"#dc2626",info:"#2563eb"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2c3e50",borderRadius:"6px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"8px"},"bi-tool-dark":{mode:"dark",colors:{primary:"#3b82f6",secondary:"#9ca3af",categorical:["#3b82f6","#14b8a6","#f97316","#9ca3af"],sequential:"blues",background:"#111827",surface:"#1f2937",text:"#f3f4f6",textSecondary:"#9ca3af",grid:"#374151",border:"#374151",focus:"#3b82f6",annotation:"#3b82f6",success:"#34d399",danger:"#f87171",warning:"#fbbf24",error:"#ef4444",info:"#60a5fa"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f2937",text:"#f3f4f6",borderRadius:"6px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"8px"},italian:{mode:"light",colors:{primary:"#cc0000",secondary:"#666666",categorical:["#cc0000","#333333","#c8a415","#4682b4"],sequential:"reds",background:"#fafafa",surface:"#ffffff",text:"#1a1a1a",textSecondary:"#666666",grid:"#e0e0e0",border:"#e0e0e0",focus:"#cc0000",annotation:"#cc0000",success:"#556b2f",danger:"#cc0000",warning:"#c8a415",error:"#8b0000",info:"#4682b4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#1a1a1a",borderRadius:"2px",shadow:"0 2px 4px rgba(0, 0, 0, 0.15)"},borderRadius:"2px"},"italian-dark":{mode:"dark",colors:{primary:"#ff3333",secondary:"#aaaaaa",categorical:["#ff3333","#aaaaaa","#d4a843","#6aa4d4"],sequential:"reds",background:"#0a0a0a",surface:"#1a1a1a",text:"#f5f5f5",textSecondary:"#aaaaaa",grid:"#333333",border:"#333333",focus:"#ff3333",annotation:"#ff3333",success:"#7a8b5a",danger:"#ff3333",warning:"#d4a843",error:"#cc0000",info:"#6aa4d4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1a1a1a",text:"#f5f5f5",borderRadius:"2px",shadow:"0 2px 8px rgba(0, 0, 0, 0.5)"},borderRadius:"2px"},tufte:{mode:"light",colors:{primary:"#8b0000",secondary:"#555555",categorical:["#8b4513","#556b2f","#4a5568","#800020"],sequential:"oranges",background:"#fffff8",surface:"#fffff8",text:"#111111",textSecondary:"#555555",grid:"#e0ddd0",border:"#e0ddd0",focus:"#8b0000",annotation:"#8b0000",success:"#556b2f",danger:"#8b0000",warning:"#b88700",error:"#6b0000",info:"#4a5568"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#fffff8",text:"#111111",borderRadius:"2px",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},borderRadius:"0px"},"tufte-dark":{mode:"dark",colors:{primary:"#c05050",secondary:"#a09880",categorical:["#c08050","#7a8b5a","#8090a0","#a05060"],sequential:"oranges",background:"#1c1b18",surface:"#262520",text:"#e8e4d8",textSecondary:"#a09880",grid:"#3d3c35",border:"#3d3c35",focus:"#c05050",annotation:"#d06a6a",success:"#7a8b5a",danger:"#c05050",warning:"#c8a060",error:"#a04040",info:"#8090a0"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262520",text:"#e8e4d8",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.4)"},borderRadius:"0px"},journalist:{mode:"light",colors:{primary:"#e45050",secondary:"#666666",categorical:["#3a86c8","#e45050","#d4a843","#888888"],sequential:"blues",background:"#ffffff",surface:"#f8f8f8",text:"#222222",textSecondary:"#666666",grid:"#d4d4d4",border:"#d4d4d4",focus:"#e45050",annotation:"#c63b3b",success:"#2d7a3d",danger:"#c8303a",warning:"#d4a843",error:"#a02028",info:"#3a86c8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:18,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#f8f8f8",text:"#222222",borderRadius:"4px",shadow:"0 2px 6px rgba(0, 0, 0, 0.12)"},borderRadius:"4px"},"journalist-dark":{mode:"dark",colors:{primary:"#ff6b6b",secondary:"#a0a0a0",categorical:["#5a9fd8","#ff6b6b","#e0c060","#aaaaaa"],sequential:"blues",background:"#141414",surface:"#1e1e1e",text:"#ededed",textSecondary:"#a0a0a0",grid:"#383838",border:"#383838",focus:"#ff6b6b",annotation:"#ff6b6b",success:"#6fba78",danger:"#ff6b6b",warning:"#e0c060",error:"#d04040",info:"#5a9fd8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1e1e1e",text:"#ededed",borderRadius:"4px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"4px"},playful:{mode:"light",colors:{primary:"#8b5cf6",secondary:"#7c5a9e",categorical:["#8b5cf6","#ec4899","#06b6d4","#84cc16"],sequential:"viridis",background:"#fdf8ff",surface:"#ffffff",text:"#2d1b4e",textSecondary:"#7c5a9e",grid:"#e8d0f8",border:"#e8d0f8",focus:"#8b5cf6",annotation:"#7a47e8",success:"#10d870",danger:"#ff4b6e",warning:"#ffaa33",error:"#e11d48",info:"#06b6d4"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2d1b4e",borderRadius:"12px",shadow:"0 4px 12px rgba(139, 92, 246, 0.15)"},borderRadius:"12px"},"playful-dark":{mode:"dark",colors:{primary:"#a78bfa",secondary:"#b8a0d8",categorical:["#a78bfa","#f472b6","#22d3ee","#a3e635"],sequential:"viridis",background:"#150a28",surface:"#1f1138",text:"#f0e8ff",textSecondary:"#b8a0d8",grid:"#3a2560",border:"#3a2560",focus:"#a78bfa",annotation:"#a78bfa",success:"#4ade80",danger:"#fb7185",warning:"#fbbf24",error:"#f43f5e",info:"#22d3ee"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f1138",text:"#f0e8ff",borderRadius:"12px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"12px"},carbon:{mode:"light",colors:{primary:"#0f62fe",secondary:"#525252",categorical:["#6929c4","#1192e8","#005d5d","#9f1853"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#161616",textSecondary:"#525252",grid:"#e0e0e0",border:"#e0e0e0",focus:"#0f62fe",annotation:"#0f62fe",success:"#24a148",danger:"#da1e28",warning:"#f1c21b",error:"#a2191f",info:"#0043ce"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#161616",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.2)"},borderRadius:"0px"},"carbon-dark":{mode:"dark",colors:{primary:"#4589ff",secondary:"#a8a8a8",categorical:["#a56eff","#33b1ff","#08bdba","#ff7eb6"],sequential:"blues",diverging:"RdBu",background:"#161616",surface:"#262626",text:"#f4f4f4",textSecondary:"#a8a8a8",grid:"#393939",border:"#393939",focus:"#4589ff",annotation:"#4589ff",success:"#42be65",danger:"#fa4d56",warning:"#f1c21b",error:"#da1e28",info:"#4589ff"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262626",text:"#f4f4f4",borderRadius:"2px",shadow:"0 4px 12px rgba(0, 0, 0, 0.5)"},borderRadius:"0px"}};function $(e){return w[e]}function S(e,t=":root"){var a,r,n,o,i;const s=[];return s.push(` --semiotic-bg: ${e.colors.background};`),s.push(` --semiotic-text: ${e.colors.text};`),s.push(` --semiotic-text-secondary: ${e.colors.textSecondary};`),s.push(` --semiotic-grid: ${e.colors.grid};`),s.push(` --semiotic-border: ${e.colors.border};`),s.push(` --semiotic-primary: ${e.colors.primary};`),s.push(` --semiotic-font-family: ${e.typography.fontFamily};`),e.colors.focus&&s.push(` --semiotic-focus: ${e.colors.focus};`),e.colors.selection&&s.push(` --semiotic-selection-color: ${e.colors.selection};`),null!=e.colors.selectionOpacity&&s.push(` --semiotic-selection-opacity: ${e.colors.selectionOpacity};`),e.colors.diverging&&s.push(` --semiotic-diverging: ${e.colors.diverging};`),(null===(a=e.tooltip)||void 0===a?void 0:a.background)&&s.push(` --semiotic-tooltip-bg: ${e.tooltip.background};`),(null===(r=e.tooltip)||void 0===r?void 0:r.text)&&s.push(` --semiotic-tooltip-text: ${e.tooltip.text};`),(null===(n=e.tooltip)||void 0===n?void 0:n.borderRadius)&&s.push(` --semiotic-tooltip-radius: ${e.tooltip.borderRadius};`),(null===(o=e.tooltip)||void 0===o?void 0:o.fontSize)&&s.push(` --semiotic-tooltip-font-size: ${e.tooltip.fontSize};`),(null===(i=e.tooltip)||void 0===i?void 0:i.shadow)&&s.push(` --semiotic-tooltip-shadow: ${e.tooltip.shadow};`),e.borderRadius&&s.push(` --semiotic-border-radius: ${e.borderRadius};`),e.colors.annotation&&s.push(` --semiotic-annotation-color: ${e.colors.annotation};`),null!=e.typography.legendSize&&s.push(` --semiotic-legend-font-size: ${e.typography.legendSize}px;`),null!=e.typography.titleFontSize&&s.push(` --semiotic-title-font-size: ${e.typography.titleFontSize}px;`),null!=e.typography.tickFontFamily&&s.push(` --semiotic-tick-font-family: ${e.typography.tickFontFamily};`),null!=e.typography.tickSize&&s.push(` --semiotic-tick-font-size: ${e.typography.tickSize}px;`),null!=e.typography.labelSize&&s.push(` --semiotic-axis-label-font-size: ${e.typography.labelSize}px;`),s.push(` --semiotic-secondary: ${e.colors.secondary||e.colors.primary};`),s.push(` --semiotic-surface: ${e.colors.surface||e.colors.background};`),e.colors.success&&s.push(` --semiotic-success: ${e.colors.success};`),e.colors.danger&&s.push(` --semiotic-danger: ${e.colors.danger};`),e.colors.warning&&s.push(` --semiotic-warning: ${e.colors.warning};`),e.colors.error&&s.push(` --semiotic-error: ${e.colors.error};`),e.colors.info&&s.push(` --semiotic-info: ${e.colors.info};`),`${t} {\n${s.join("\n")}\n}`}function k(e){var t,a,r,n,o,i;return{semiotic:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({bg:{$value:e.colors.background,$type:"color"},text:{$value:e.colors.text,$type:"color"},"text-secondary":{$value:e.colors.textSecondary,$type:"color"},grid:{$value:e.colors.grid,$type:"color"},border:{$value:e.colors.border,$type:"color"},primary:{$value:e.colors.primary,$type:"color"},focus:{$value:e.colors.focus||e.colors.primary,$type:"color"},"font-family":{$value:e.typography.fontFamily,$type:"fontFamily"},"border-radius":{$value:e.borderRadius||"8px",$type:"dimension"},tooltip:{bg:{$value:(null===(t=e.tooltip)||void 0===t?void 0:t.background)||e.colors.background,$type:"color"},text:{$value:(null===(a=e.tooltip)||void 0===a?void 0:a.text)||e.colors.text,$type:"color"},radius:{$value:(null===(r=e.tooltip)||void 0===r?void 0:r.borderRadius)||"6px",$type:"dimension"},"font-size":{$value:(null===(n=e.tooltip)||void 0===n?void 0:n.fontSize)||"14px",$type:"dimension"},shadow:{$value:(null===(o=e.tooltip)||void 0===o?void 0:o.shadow)||"0 2px 8px rgba(0,0,0,0.15)",$type:"shadow"}},selection:{color:{$value:e.colors.selection||e.colors.primary,$type:"color"},opacity:{$value:null!==(i=e.colors.selectionOpacity)&&void 0!==i?i:.2,$type:"number"}},categorical:{$value:e.colors.categorical,$type:"color",$description:"Categorical color palette"},sequential:{$value:e.colors.sequential,$type:"string",$description:"d3-scale-chromatic sequential scheme name"}},e.colors.diverging?{diverging:{$value:e.colors.diverging,$type:"string",$description:"d3-scale-chromatic diverging scheme name"}}:{}),e.colors.annotation?{"annotation-color":{$value:e.colors.annotation,$type:"color"}}:{}),null!=e.typography.legendSize?{"legend-font-size":{$value:e.typography.legendSize+"px",$type:"dimension"}}:{}),null!=e.typography.titleFontSize?{"title-font-size":{$value:e.typography.titleFontSize+"px",$type:"dimension"}}:{}),null!=e.typography.tickFontFamily?{"tick-font-family":{$value:e.typography.tickFontFamily,$type:"fontFamily"}}:{}),null!=e.typography.tickSize?{"tick-font-size":{$value:e.typography.tickSize+"px",$type:"dimension"}}:{}),null!=e.typography.labelSize?{"axis-label-font-size":{$value:e.typography.labelSize+"px",$type:"dimension"}}:{}),{secondary:{$value:e.colors.secondary||e.colors.primary,$type:"color"},surface:{$value:e.colors.surface||e.colors.background,$type:"color"}}),e.colors.success?{success:{$value:e.colors.success,$type:"color"}}:{}),e.colors.danger?{danger:{$value:e.colors.danger,$type:"color"}}:{}),e.colors.warning?{warning:{$value:e.colors.warning,$type:"color"}}:{}),e.colors.error?{error:{$value:e.colors.error,$type:"color"}}:{}),e.colors.info?{info:{$value:e.colors.info,$type:"color"}}:{})}}function j(e,t){if("function"==typeof e.addEventListener)return e.addEventListener("change",t),()=>e.removeEventListener("change",t);const a=e;return a.addListener(t),()=>a.removeListener(t)}function C(e){return!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia(e).matches}function O(){const[e,t]=l(()=>C("(prefers-reduced-motion: reduce)"));return u(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)");return t(e.matches),j(e,e=>t(e.matches))},[]),e}function z(){const[e,t]=l(()=>C("(forced-colors: active)"));return u(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(forced-colors: active)");return t(e.matches),j(e,e=>t(e.matches))},[]),e}const R=a.createContext(void 0),L="undefined"==typeof window?a.useEffect:a.useLayoutEffect;function F(e){if("string"!=typeof e)return e;if("light"===e||"dark"===e||"high-contrast"===e)return e;return $(e)||(void 0!==console&&console.warn(`[ThemeProvider] Unknown theme preset "${e}". Falling back to light theme.`),"light")}function P({theme:e}){const t=v(e=>e.setTheme),r=v(e=>e.theme),n=a.useRef(r);n.current=r;const o=a.useRef(null);a.useEffect(()=>{if(void 0!==e)return;if("undefined"==typeof window||!window.matchMedia)return;const a=window.matchMedia("(forced-colors: active)");return a.matches&&(o.current=n.current===h?f:n.current,t("high-contrast")),j(a,e=>{var a,r;e.matches?(o.current=n.current===h?null!==(a=o.current)&&void 0!==a?a:f:n.current,t("high-contrast")):(function(e,t){e(t===f?"light":t===y?"dark":t===h?"high-contrast":t)}(t,null!==(r=o.current)&&void 0!==r?r:f),o.current=null)})},[e,t]);const i=a.useRef(!1);return L(()=>{i.current?void 0!==e&&t(F(e)):i.current=!0},[e,t]),null}function N({children:t}){var r,n,o,i,s;const c=v(e=>e.theme),l=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({position:"relative","--semiotic-bg":c.colors.background,"--semiotic-text":c.colors.text,"--semiotic-text-secondary":c.colors.textSecondary,"--semiotic-grid":c.colors.grid,"--semiotic-border":c.colors.border,"--semiotic-cell-border":c.colors.cellBorder||c.colors.border,"--semiotic-primary":c.colors.primary,"--semiotic-font-family":c.typography.fontFamily},c.colors.focus?{"--semiotic-focus":c.colors.focus}:{}),(null===(r=c.tooltip)||void 0===r?void 0:r.background)?{"--semiotic-tooltip-bg":c.tooltip.background}:{}),(null===(n=c.tooltip)||void 0===n?void 0:n.text)?{"--semiotic-tooltip-text":c.tooltip.text}:{}),(null===(o=c.tooltip)||void 0===o?void 0:o.borderRadius)?{"--semiotic-tooltip-radius":c.tooltip.borderRadius}:{}),(null===(i=c.tooltip)||void 0===i?void 0:i.fontSize)?{"--semiotic-tooltip-font-size":c.tooltip.fontSize}:{}),(null===(s=c.tooltip)||void 0===s?void 0:s.shadow)?{"--semiotic-tooltip-shadow":c.tooltip.shadow}:{}),c.borderRadius?{"--semiotic-border-radius":c.borderRadius}:{}),c.colors.selection?{"--semiotic-selection-color":c.colors.selection}:{}),null!=c.colors.selectionOpacity?{"--semiotic-selection-opacity":c.colors.selectionOpacity+""}:{}),c.colors.diverging?{"--semiotic-diverging":c.colors.diverging}:{}),c.colors.annotation?{"--semiotic-annotation-color":c.colors.annotation}:{}),null!=c.typography.legendSize?{"--semiotic-legend-font-size":c.typography.legendSize+"px"}:{}),null!=c.typography.titleFontSize?{"--semiotic-title-font-size":c.typography.titleFontSize+"px"}:{}),null!=c.typography.tickFontFamily?{"--semiotic-tick-font-family":c.typography.tickFontFamily}:{}),null!=c.typography.tickSize?{"--semiotic-tick-font-size":c.typography.tickSize+"px"}:{}),null!=c.typography.labelSize?{"--semiotic-axis-label-font-size":c.typography.labelSize+"px"}:{}),{"--semiotic-secondary":c.colors.secondary||c.colors.primary,"--semiotic-surface":c.colors.surface||c.colors.background}),c.colors.success?{"--semiotic-success":c.colors.success}:{}),c.colors.danger?{"--semiotic-danger":c.colors.danger}:{}),c.colors.warning?{"--semiotic-warning":c.colors.warning}:{}),c.colors.error?{"--semiotic-error":c.colors.error}:{}),c.colors.info?{"--semiotic-info":c.colors.info}:{}),u=a.useContext(R),d={};return u&&(d["data-semiotic-theme"]=u),e("div",Object.assign({style:l},d,{children:t}))}function T({theme:r,children:n}){const o="string"==typeof r&&$(r)?r:void 0,i=a.useMemo(()=>function(e){return void 0!==e?m(f,F(e)):"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(forced-colors: active)").matches?h:f}(r),[r]);return e(b,{initialState:{theme:i},children:t(R.Provider,{value:o,children:[e(P,{theme:r}),e(N,{children:n})]})})}function B(){return v(e=>e.theme)}function M(e){if(null==e)return"";if("number"!=typeof e)return e+"";if(!isFinite(e))return e+"";if(0===e)return"0";const t=parseFloat(e.toPrecision(12)),a=Math.abs(t);return 1e9>a?1e6>a?1e4>a?Number.isInteger(t)?t+"":parseFloat(t.toPrecision(6))+"":parseFloat((t/1e3).toPrecision(3))+"K":parseFloat((t/1e6).toPrecision(3))+"M":parseFloat((t/1e9).toPrecision(3))+"B"}const _=864e5;function I(e){return 10>e?"0"+e:e+""}const E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function D(e){let t,a=e;return(r,n,o)=>{const i=r instanceof Date?r:new Date(r);e||!o||2>o.length||o===t||(t=o,a=function(e){if(2>e.length)return"days";const t=[];for(let a=1;e.length>a;a++)t.push(e[a]-e[a-1]);t.sort((e,t)=>e-t);const a=t[Math.floor(t.length/2)];return 12e4>a?"seconds":72e5>a?"minutes":2*_>a?"hours":60*_>a?"days":400*_>a?"months":"years"}(o));const s=a||"days";return null!=n&&0!==n&&o&&0!==o.length?function(e,t,a){const r=e.getUTCFullYear()!==t.getUTCFullYear(),n=r||e.getUTCMonth()!==t.getUTCMonth(),o=n||e.getUTCDate()!==t.getUTCDate(),i=o||e.getUTCHours()!==t.getUTCHours(),s=i||e.getUTCMinutes()!==t.getUTCMinutes(),c=E[e.getUTCMonth()],l=e.getUTCDate(),u=e.getUTCFullYear(),d=I(e.getUTCHours()),p=I(e.getUTCMinutes()),g=I(e.getUTCSeconds());switch(a){case"seconds":return r?`${c} ${l}, ${u} ${d}:${p}:${g}`:o?`${c} ${l} ${d}:${p}:${g}`:i?`${d}:${p}:${g}`:s?`${p}:${g}`:":"+g;case"minutes":return r?`${c} ${l}, ${u} ${d}:${p}`:o?`${c} ${l} ${d}:${p}`:i?`${d}:${p}`:":"+p;case"hours":return r?`${c} ${l}, ${u} ${d}:00`:n?`${c} ${l} ${d}:${p}`:o?`${c} ${l} ${d}:00`:d+":00";case"days":return r?`${c} ${l}, ${u}`:n?`${c} ${l}`:""+l;case"months":return r?`${c} ${u}`:""+c;case"years":return""+u}}(i,new Date(o[n-1]),s):function(e,t){const a=E[e.getUTCMonth()],r=e.getUTCDate(),n=e.getUTCFullYear(),o=I(e.getUTCHours()),i=I(e.getUTCMinutes()),s=I(e.getUTCSeconds());switch(t){case"seconds":return`${a} ${r}, ${n} ${o}:${i}:${s}`;case"minutes":case"hours":return`${a} ${r}, ${n} ${o}:${i}`;case"days":return`${a} ${r}, ${n}`;case"months":return`${a} ${n}`;case"years":return""+n}}(i,s)}}function q(e,t=.5){const a=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!a)return e;const r=Math.round(parseInt(a[1],16)*(1-t)),n=Math.round(parseInt(a[2],16)*(1-t)),o=Math.round(parseInt(a[3],16)*(1-t));return`#${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}function U(e,t=.5){const a=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!a)return e;const r=Math.round(parseInt(a[1],16)+(255-parseInt(a[1],16))*t),n=Math.round(parseInt(a[2],16)+(255-parseInt(a[2],16))*t),o=Math.round(parseInt(a[3],16)+(255-parseInt(a[3],16))*t);return`#${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}let H=null;function W(e={},t){const{background:a="transparent",stroke:r="#000",lineWidth:n=1.5,spacing:o=6,angle:i=45}=e,s=Math.max(8,Math.ceil(2*o));let c;try{c=function(e){return"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(e,e):(H||(H=document.createElement("canvas")),H.width=e,H.height=e,H)}(s)}catch(e){return null}const l=c.getContext("2d");if(!l)return null;a&&"transparent"!==a?(l.fillStyle=a,l.fillRect(0,0,s,s)):l.clearRect(0,0,s,s),l.strokeStyle=r,l.lineWidth=n,l.lineCap="square";const u=i*Math.PI/180;if(45===i||-45===i){const e=i>0?1:-1;for(let t=-s;2*s>=t;t+=o)l.beginPath(),l.moveTo(t,0),l.lineTo(t+e*s,s),l.stroke()}else{l.save(),l.translate(s/2,s/2),l.rotate(u);const e=2*s;for(let t=-e;e>=t;t+=o)l.beginPath(),l.moveTo(-e,t),l.lineTo(e,t),l.stroke();l.restore()}return(t||l).createPattern(c,"repeat")}function G(e,t){const a=e.length,r=t.length,n=Array(r+1);for(let e=0;r>=e;e++)n[e]=e;for(let o=1;a>=o;o++){let a=n[0];n[0]=o;for(let i=1;r>=i;i++){const r=n[i];n[i]=e[o-1]===t[i-1]?a:1+Math.min(a,n[i],n[i-1]),a=r}}return n[r]}function V(e,t,a=3){let r,n=a+1;for(const a of t){const t=G(e.toLowerCase(),a.toLowerCase());n>t&&(n=t,r=a)}return n>a?void 0:r}function Y(e){return e.length>3?[e[0],e[Math.floor(e.length/2)],e[e.length-1]]:e}function J(e,t){var a;if(0===t.length)return null;const r=e.toLowerCase();return t.find(e=>e.toLowerCase().includes(r)||r.includes(e.toLowerCase()))||(null!==(a=V(e,t,3))&&void 0!==a?a:null)}const X={width:{type:"number"},height:{type:"number"},margin:{type:"object"},className:{type:"string"},title:{type:"string"},enableHover:{type:"boolean"},showLegend:{type:"boolean"},showGrid:{type:"boolean"},colorBy:{type:["string","function"]},colorScheme:{type:["string","array"]},tooltip:{type:["boolean","function","object"]},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},axisExtent:{type:"string",enum:["nice","exact"]},frameProps:{type:"object"},onClick:{type:"function"}},K={xLabel:{type:"string"},yLabel:{type:"string"},xFormat:{type:"function"},yFormat:{type:"function"}},Q={categoryLabel:{type:"string"},valueLabel:{type:"string"},valueFormat:{type:"function"},categoryFormat:{type:"function"}},Z=["linear","monotoneX","monotoneY","step","stepAfter","stepBefore","basis","cardinal","catmullRom"],ee=["vertical","horizontal"],te={LineChart:{required:["data"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},X),K),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},lineBy:{type:["string","function"]},lineDataAccessor:{type:"string"},curve:{type:"string",enum:Z},lineWidth:{type:"number"},showPoints:{type:"boolean"},pointRadius:{type:"number"},fillArea:{type:"boolean"},areaOpacity:{type:"number"},forecast:{type:"object"},anomaly:{type:"object"},band:{type:["object","array"]}})},AreaChart:{required:["data"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},X),K),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},areaBy:{type:["string","function"]},lineDataAccessor:{type:"string"},curve:{type:"string",enum:Z},gradientFill:{type:["boolean","object"]},semanticGradient:{type:"array"},areaOpacity:{type:"number"},showLine:{type:"boolean"},lineWidth:{type:"number"},forecast:{type:"object"},anomaly:{type:"object"},band:{type:["object","array"]}})},DifferenceChart:{required:[],dataShape:"array",dataAccessors:["xAccessor","seriesAAccessor","seriesBAccessor"],props:Object.assign(Object.assign(Object.assign({},X),K),{data:{type:"array"},xAccessor:{type:["string","function"]},seriesAAccessor:{type:["string","function"]},seriesBAccessor:{type:["string","function"]},seriesALabel:{type:"string"},seriesBLabel:{type:"string"},seriesAColor:{type:"string"},seriesBColor:{type:"string"},showLines:{type:"boolean"},lineWidth:{type:"number"},showPoints:{type:"boolean"},pointRadius:{type:"number"},curve:{type:"string",enum:Z},areaOpacity:{type:"number"},gradientFill:{type:["boolean","object"]},xExtent:{type:"array"},yExtent:{type:"array"},pointIdAccessor:{type:["string","function"]},windowSize:{type:"number"}})},StackedAreaChart:{required:["data","areaBy"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},X),K),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},areaBy:{type:["string","function"]},lineDataAccessor:{type:"string"},curve:{type:"string",enum:Z},areaOpacity:{type:"number"},showLine:{type:"boolean"},lineWidth:{type:"number"},normalize:{type:"boolean"}})},Scatterplot:{required:["data"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},X),K),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},sizeBy:{type:["string","function"]},sizeRange:{type:"array"},pointRadius:{type:"number"},pointOpacity:{type:"number"},regression:{type:["boolean","string","object"]},forecast:{type:"object"},anomaly:{type:"object"}})},BubbleChart:{required:["data","sizeBy"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},X),K),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},sizeBy:{type:["string","function"]},sizeRange:{type:"array"},bubbleOpacity:{type:"number"},bubbleStrokeWidth:{type:"number"},bubbleStrokeColor:{type:"string"},regression:{type:["boolean","string","object"]}})},Heatmap:{required:["data"],dataShape:"array",dataAccessors:["xAccessor","yAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},X),K),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},colorScheme:{type:"string",enum:["blues","reds","greens","viridis","custom"]},customColorScale:{type:["object","function"]},showValues:{type:"boolean"},valueFormat:{type:"function"},cellBorderColor:{type:"string"},cellBorderWidth:{type:"number"},showLegend:{type:"boolean"},legendPosition:{type:"string",enum:["right","left","top","bottom"]}})},QuadrantChart:{required:[],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},X),K),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},quadrants:{type:"object"},xCenter:{type:"number"},yCenter:{type:"number"},centerlineStyle:{type:"object"},showQuadrantLabels:{type:"boolean"},quadrantLabelSize:{type:"number"},sizeBy:{type:["string","function"]},sizeRange:{type:"array"},pointRadius:{type:"number"},pointOpacity:{type:"number"}})},MultiAxisLineChart:{required:["series"],dataShape:"array",dataAccessors:["xAccessor"],props:Object.assign(Object.assign(Object.assign({},X),K),{data:{type:"array"},xAccessor:{type:["string","function"]},series:{type:"array"},colorScheme:{type:["string","array"]},curve:{type:"string"},lineWidth:{type:"number"},annotations:{type:"array"}})},CandlestickChart:{required:["highAccessor","lowAccessor"],dataShape:"array",dataAccessors:["xAccessor","highAccessor","lowAccessor"],props:Object.assign(Object.assign(Object.assign({},X),K),{data:{type:"array"},xAccessor:{type:["string","function"]},highAccessor:{type:["string","function"]},lowAccessor:{type:["string","function"]},openAccessor:{type:["string","function"]},closeAccessor:{type:["string","function"]},candlestickStyle:{type:"object"},mode:{type:"string",enum:["primary","context","sparkline"]},annotations:{type:"array"}})},ConnectedScatterplot:{required:["data"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},X),K),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},orderAccessor:{type:["string","function"]},orderLabel:{type:"string"},pointRadius:{type:"number"},pointIdAccessor:{type:["string","function"]},annotations:{type:"array"},regression:{type:["boolean","string","object"]},forecast:{type:"object"},anomaly:{type:"object"}})},BarChart:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},X),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:ee},sort:{type:["boolean","string","function"]},barPadding:{type:"number"},roundedTop:{type:"number"},regression:{type:["boolean","string","object"]}})},StackedBarChart:{required:["data","stackBy"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},X),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},stackBy:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:ee},normalize:{type:"boolean"},sort:{type:["boolean","string","function"]},barPadding:{type:"number"},roundedTop:{type:"number"}})},LikertChart:{required:[],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor","levelAccessor","countAccessor"],props:Object.assign(Object.assign(Object.assign({},X),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},levelAccessor:{type:["string","function"]},countAccessor:{type:["string","function"]},levels:{type:"array"},orientation:{type:"string",enum:ee},barPadding:{type:"number"}})},GroupedBarChart:{required:["data","groupBy"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},X),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},groupBy:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:ee},sort:{type:["boolean","string","function"]},barPadding:{type:"number"},roundedTop:{type:"number"}})},SwarmPlot:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},X),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:ee},sizeBy:{type:["string","function"]},sizeRange:{type:"array"},pointRadius:{type:"number"},pointOpacity:{type:"number"},categoryPadding:{type:"number"},brush:{type:"boolean"},onBrush:{type:"function"},linkedBrush:{type:["string","object"]}})},BoxPlot:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},X),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:ee},showOutliers:{type:"boolean"},outlierRadius:{type:"number"},categoryPadding:{type:"number"}})},Histogram:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},X),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},bins:{type:"number"},relative:{type:"boolean"},categoryPadding:{type:"number"},brush:{type:"boolean"},onBrush:{type:"function"},linkedBrush:{type:["string","object"]}})},ViolinPlot:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},X),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:ee},bins:{type:"number"},curve:{type:"string"},showIQR:{type:"boolean"},categoryPadding:{type:"number"},brush:{type:"boolean"},onBrush:{type:"function"},linkedBrush:{type:["string","object"]}})},RidgelinePlot:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},X),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},bins:{type:"number"},amplitude:{type:"number"},categoryPadding:{type:"number"}})},DotPlot:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},X),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:ee},sort:{type:["boolean","string","function"]},dotRadius:{type:"number"},categoryPadding:{type:"number"},regression:{type:["boolean","string","object"]}})},PieChart:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign({},X),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},startAngle:{type:"number"},cornerRadius:{type:"number"}})},DonutChart:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign({},X),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},innerRadius:{type:"number"},centerContent:{type:["object","string","number"]},startAngle:{type:"number"},cornerRadius:{type:"number"}})},GaugeChart:{required:["value"],dataShape:"none",dataAccessors:[],props:Object.assign(Object.assign({},X),{value:{type:"number"},min:{type:"number"},max:{type:"number"},thresholds:{type:"array"},gradientFill:{type:"object"},arcWidth:{type:"number"},cornerRadius:{type:"number"},sweep:{type:"number"},fillZones:{type:"boolean"},showNeedle:{type:"boolean"},needleColor:{type:"string"},color:{type:"string"},centerContent:{type:["object","string","number","function"]},valueFormat:{type:"function"},showScaleLabels:{type:"boolean"},backgroundColor:{type:"string"}})},FunnelChart:{required:["data"],dataShape:"array",dataAccessors:["stepAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},X),Q),{data:{type:"array"},stepAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},categoryAccessor:{type:["string","function"]},orientation:{type:"string",enum:["horizontal","vertical"]},connectorOpacity:{type:"number"},showCategoryTicks:{type:"boolean"},responsiveWidth:{type:"boolean"},legendPosition:{type:"string",enum:["right","left","top","bottom"]}})},SwimlaneChart:{required:["subcategoryAccessor"],dataShape:"array",dataAccessors:["categoryAccessor","subcategoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},X),Q),{data:{type:"array"},categoryAccessor:{type:["string","function"]},subcategoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:["horizontal","vertical"]},barPadding:{type:"number"},roundedTop:{type:"number"},showCategoryTicks:{type:"boolean"},brush:{type:"boolean"},onBrush:{type:"function"},linkedBrush:{type:["string","object"]},responsiveWidth:{type:"boolean"},legendPosition:{type:"string",enum:["right","left","top","bottom"]}})},ForceDirectedGraph:{required:["nodes","edges"],dataShape:"network",dataAccessors:["nodeIDAccessor","sourceAccessor","targetAccessor"],props:Object.assign(Object.assign({},X),{nodes:{type:"array"},edges:{type:"array"},nodeIDAccessor:{type:["string","function"]},sourceAccessor:{type:["string","function"]},targetAccessor:{type:["string","function"]},nodeLabel:{type:["string","function"]},nodeSize:{type:["number","string","function"]},nodeSizeRange:{type:"array"},edgeWidth:{type:["number","string","function"]},edgeColor:{type:"string"},edgeOpacity:{type:"number"},iterations:{type:"number"},forceStrength:{type:"number"},showLabels:{type:"boolean"}})},SankeyDiagram:{required:["edges"],dataShape:"network",dataAccessors:["sourceAccessor","targetAccessor"],props:Object.assign(Object.assign({},X),{nodes:{type:"array"},edges:{type:"array"},sourceAccessor:{type:["string","function"]},targetAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},edgeColorBy:{type:["string","function"],enum:["source","target","gradient"]},orientation:{type:"string",enum:ee},nodeAlign:{type:"string",enum:["justify","left","right","center"]},nodePaddingRatio:{type:"number"},nodeWidth:{type:"number"},nodeLabel:{type:["string","function"]},showLabels:{type:"boolean"},edgeOpacity:{type:"number"},edgeSort:{type:"function"}})},ProcessSankey:{required:["domain"],dataShape:"network",dataAccessors:["sourceAccessor","targetAccessor"],props:Object.assign(Object.assign({},X),{nodes:{type:"array"},edges:{type:"array"},domain:{type:"array"},axisTicks:{type:"array"},sourceAccessor:{type:["string","function"]},targetAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},startTimeAccessor:{type:["string","function"]},endTimeAccessor:{type:["string","function"]},xExtentAccessor:{type:["string","function"]},edgeIdAccessor:{type:["string","function"]},legendPosition:{type:"string",enum:["right","left","top","bottom"]},pairing:{type:"string",enum:["value","temporal"]},packing:{type:"string",enum:["off","reuse"]},laneOrder:{type:"string",enum:["insertion","crossing-min","inside-out","crossing-min+inside-out"]},ribbonLane:{type:"string",enum:["source","target","both"]},lifetimeMode:{type:"string",enum:["full","half"]},showLaneRails:{type:"boolean"},showQualityReadout:{type:"boolean"},edgeOpacity:{type:"number"},timeFormat:{type:"function"},valueFormat:{type:"function"},showParticles:{type:"boolean"},particleStyle:{type:"object"}})},ChordDiagram:{required:["edges"],dataShape:"network",dataAccessors:["sourceAccessor","targetAccessor"],props:Object.assign(Object.assign({},X),{nodes:{type:"array"},edges:{type:"array"},sourceAccessor:{type:["string","function"]},targetAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},edgeColorBy:{type:["string","function"],enum:["source","target"]},padAngle:{type:"number"},groupWidth:{type:"number"},sortGroups:{type:"function"},nodeLabel:{type:["string","function"]},showLabels:{type:"boolean"},edgeOpacity:{type:"number"}})},TreeDiagram:{required:["data"],dataShape:"object",dataAccessors:[],props:Object.assign(Object.assign({},X),{data:{type:"object"},layout:{type:"string",enum:["tree","cluster","partition","treemap","circlepack"]},orientation:{type:"string",enum:["vertical","horizontal","radial"]},childrenAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},colorByDepth:{type:"boolean"},edgeStyle:{type:"string",enum:["line","curve"]},nodeLabel:{type:["string","function"]},showLabels:{type:"boolean"},nodeSize:{type:"number"}})},Treemap:{required:["data"],dataShape:"object",dataAccessors:[],props:Object.assign(Object.assign({},X),{data:{type:"object"},childrenAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},colorByDepth:{type:"boolean"},showLabels:{type:"boolean"},nodeLabel:{type:["string","function"]},nodeStyle:{type:"function"}})},CirclePack:{required:["data"],dataShape:"object",dataAccessors:[],props:Object.assign(Object.assign({},X),{data:{type:"object"},childrenAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},colorByDepth:{type:"boolean"},showLabels:{type:"boolean"},nodeLabel:{type:["string","function"]},circleOpacity:{type:"number"}})},OrbitDiagram:{required:["data"],dataShape:"object",dataAccessors:[],props:Object.assign(Object.assign({},X),{data:{type:"object"},childrenAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},orbitMode:{type:["string","array"]},speed:{type:"number"},revolution:{type:"function"},eccentricity:{type:["number","function"]},orbitSize:{type:["number","function"]},nodeRadius:{type:["number","function"]},showRings:{type:"boolean"},showLabels:{type:"boolean"},animated:{type:"boolean"},colorByDepth:{type:"boolean"},annotations:{type:"array"},foregroundGraphics:{type:"object"}})},RealtimeLineChart:{required:[],dataShape:"realtime",dataAccessors:[],props:{size:{type:"array"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},windowSize:{type:"number"},windowMode:{type:"string",enum:["sliding","stepping"]},arrowOfTime:{type:"string",enum:["left","right"]},stroke:{type:"string"},strokeWidth:{type:"number"},strokeDasharray:{type:"string"},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},width:{type:"number"},height:{type:"number"},decay:{type:"object"},pulse:{type:"object"},staleness:{type:"object"},transition:{type:"object"}}},RealtimeHistogram:{required:["binSize"],dataShape:"realtime",dataAccessors:[],props:{binSize:{type:"number"},direction:{type:"string",enum:["up","down"]},size:{type:"array"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},categoryAccessor:{type:["string","function"]},colors:{type:"object"},windowSize:{type:"number"},windowMode:{type:"string",enum:["sliding","stepping"]},arrowOfTime:{type:"string",enum:["left","right"]},fill:{type:"string"},stroke:{type:"string"},strokeWidth:{type:"number"},gap:{type:"number"},brush:{type:["boolean","string","object"]},onBrush:{type:"function"},linkedBrush:{type:["string","object"]},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},width:{type:"number"},height:{type:"number"},decay:{type:"object"},pulse:{type:"object"},staleness:{type:"object"},transition:{type:"object"}}},TemporalHistogram:{required:["data","binSize"],dataShape:"array",dataAccessors:["timeAccessor","valueAccessor","categoryAccessor"],props:{data:{type:"array"},binSize:{type:"number"},direction:{type:"string",enum:["up","down"]},size:{type:"array"},width:{type:"number"},height:{type:"number"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},categoryAccessor:{type:["string","function"]},colors:{type:"object"},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},fill:{type:"string"},stroke:{type:"string"},strokeWidth:{type:"number"},gap:{type:"number"},linkedHover:{type:["boolean","string","object"]},brush:{type:["boolean","string","object"]},onBrush:{type:"function"},linkedBrush:{type:["string","object"]}}},RealtimeSwarmChart:{required:[],dataShape:"realtime",dataAccessors:[],props:{size:{type:"array"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},categoryAccessor:{type:["string","function"]},colors:{type:"object"},windowSize:{type:"number"},windowMode:{type:"string",enum:["sliding","stepping"]},arrowOfTime:{type:"string",enum:["left","right"]},radius:{type:"number"},fill:{type:"string"},opacity:{type:"number"},stroke:{type:"string"},strokeWidth:{type:"number"},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},width:{type:"number"},height:{type:"number"},decay:{type:"object"},pulse:{type:"object"},staleness:{type:"object"},transition:{type:"object"}}},RealtimeWaterfallChart:{required:[],dataShape:"realtime",dataAccessors:[],props:{size:{type:"array"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},windowSize:{type:"number"},windowMode:{type:"string",enum:["sliding","stepping"]},arrowOfTime:{type:"string",enum:["left","right"]},positiveColor:{type:"string"},negativeColor:{type:"string"},connectorStroke:{type:"string"},connectorWidth:{type:"number"},gap:{type:"number"},stroke:{type:"string"},strokeWidth:{type:"number"},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},width:{type:"number"},height:{type:"number"},decay:{type:"object"},pulse:{type:"object"},staleness:{type:"object"},transition:{type:"object"}}},RealtimeHeatmap:{required:[],dataShape:"realtime",dataAccessors:[],props:{size:{type:"array"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},heatmapXBins:{type:"number"},heatmapYBins:{type:"number"},aggregation:{type:"string",enum:["count","sum","mean"]},windowSize:{type:"number"},windowMode:{type:"string",enum:["sliding","stepping"]},arrowOfTime:{type:"string",enum:["left","right"]},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},width:{type:"number"},height:{type:"number"},decay:{type:"object"},pulse:{type:"object"},staleness:{type:"object"}}},ScatterplotMatrix:{required:["data","fields"],dataShape:"array",dataAccessors:[],props:Object.assign(Object.assign({},X),{data:{type:"array"},fields:{type:"array"}})},MinimapChart:{required:["data"],dataShape:"array",dataAccessors:[],props:Object.assign(Object.assign({},X),{data:{type:"array"}})},ChoroplethMap:{required:["areas"],dataShape:"array",dataAccessors:["valueAccessor"],props:Object.assign(Object.assign({},X),{areas:{type:["array","string"]},valueAccessor:{type:["string","function"]},colorScheme:{type:["string","array"]},projection:{type:"string"}})},ProportionalSymbolMap:{required:["points"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign({},X),{points:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},sizeBy:{type:["string","function"]},areas:{type:["array","string"]}})},FlowMap:{required:["flows"],dataShape:"array",dataAccessors:[],props:Object.assign(Object.assign({},X),{flows:{type:"array"},nodes:{type:"array"},valueAccessor:{type:["string","function"]},lineIdAccessor:{type:["string","function"]}})},DistanceCartogram:{required:["points"],dataShape:"array",dataAccessors:[],props:Object.assign(Object.assign({},X),{points:{type:"array"},center:{type:"array"},costAccessor:{type:["string","function"]}})},BigNumber:{required:[],dataShape:"none",dataAccessors:[],props:{width:{type:["number","string"]},height:{type:["number","string"]},className:{type:"string"},onClick:{type:"function"},value:{type:"number"},label:{type:"string"},caption:{type:"string"},format:{type:["string","function"],enum:["number","currency","percent","compact","duration"]},locale:{type:"string"},currency:{type:"string"},precision:{type:"number"},prefix:{type:"string"},suffix:{type:"string"},unit:{type:"string"},comparison:{type:"object"},target:{type:"object"},delta:{type:"number"},deltaFormat:{type:["string","function"],enum:["number","currency","percent","compact","duration"]},showDeltaPercent:{type:"boolean"},direction:{type:"string",enum:["higher-is-better","lower-is-better","neutral"]},sentiment:{type:"string",enum:["auto","positive","negative","neutral"]},thresholds:{type:"array"},chartSlot:{type:["string","number","array","object","function"]},chartSize:{type:"number"},windowSize:{type:"number"},mode:{type:"string",enum:["tile","presentation","inline","thumbnail"]},align:{type:"string",enum:["start","center","end"]},padding:{type:["number","object"]},emphasis:{type:"string",enum:["primary","secondary"]},color:{type:"string"},background:{type:"string"},borderColor:{type:"string"},borderRadius:{type:["number","string"]},animate:{type:["boolean","object"]},stalenessThreshold:{type:"number"},staleLabel:{type:"string"},headerSlot:{type:["string","number","array","object","function"]},valueSlot:{type:["string","number","array","object","function"]},deltaSlot:{type:["string","number","array","object","function"]},trendSlot:{type:["string","number","array","object","function"]},footerSlot:{type:["string","number","array","object","function"]},onObservation:{type:"function"}}}};function ae(e,t){return(Array.isArray(t)?t:[t]).includes(Array.isArray(e)?"array":typeof e)}function re(e,t){const a=[],r=te[e];if(!r)return{valid:!1,errors:[`Unknown component "${e}". Valid components: ${Object.keys(te).join(", ")}`]};for(const n of r.required)null==t[n]&&a.push(`"${n}" is required for ${e}.`);for(const[e,n]of Object.entries(t)){if(null==n)continue;const t=r.props[e];if(t){if(!ae(n,t.type)){const r=Array.isArray(t.type)?t.type.join(" | "):t.type;a.push(`"${e}" should be ${r}, got ${Array.isArray(n)?"array":typeof n}.`);continue}t.enum&&"string"==typeof n&&!t.enum.includes(n)&&a.push(`"${e}" value "${n}" is not valid. Expected one of: ${t.enum.join(", ")}.`)}}const n=Object.keys(r.props),o=new Set(n);for(const r of Object.keys(t))if(void 0!==t[r]&&!o.has(r)){const t=V(r,n),o=t?`Unknown prop "${r}" for ${e}. Did you mean "${t}"?`:`Unknown prop "${r}" for ${e}. Valid props: ${n.join(", ")}.`;a.push(o)}if("array"===r.dataShape){const n=t.data,o={};for(const e of r.dataAccessors){const a=t[e];"string"==typeof a&&(o[e]=a)}const i=function({componentName:e,data:t,accessors:a,requiredProps:r}){if(r)for(const[t,a]of Object.entries(r))if(null==a)return`${e}: ${t} is required. Provide a field name or function.`;if(null==t)return null;if(!Array.isArray(t)||0===t.length)return e+": No data provided. Pass a non-empty array to the data prop.";if(!Array.isArray(t)&&"object"==typeof t)return e+": data should be an array, but received an object. If this is hierarchical data, use TreeDiagram, Treemap, or CirclePack instead.";if(a){const r=Y(t).find(e=>e&&"object"==typeof e);if(r){const t=Object.keys(r);for(const[n,o]of Object.entries(a))if(o&&"string"==typeof o&&!(o in r)){const a=J(o,t),r=a?` Try ${n}="${a}".`:"";return`${e}: ${n} "${o}" not found in data. Available fields: ${t.join(", ")}.${r}`}}}return null}({componentName:e,data:n,accessors:Object.keys(o).length>0?o:void 0});i&&a.push(i)}else if("object"===r.dataShape){const r=function({componentName:e,data:t,dataLabel:a="data"}){return null==t?`${e}: No ${a} provided. Pass a hierarchical object with children: { name: "root", children: [...] }.`:Array.isArray(t)?`${e}: ${a} should be a single root object, not an array. Expected: { name: "root", children: [...] }. If you have flat data, use LineChart, BarChart, or Scatterplot instead.`:null}({componentName:e,data:t.data});r&&a.push(r)}else if("network"===r.dataShape){const n=function({componentName:e,nodes:t,edges:a,nodesRequired:r=!1,edgesRequired:n=!0,accessors:o}){if(null==t&&null==a)return null;if(n&&(!a||!Array.isArray(a)||0===a.length))return e+': No edges provided. Pass a non-empty array: edges={[{ source: "A", target: "B", value: 10 }, ...]}.';if(r&&(!t||!Array.isArray(t)||0===t.length))return e+': No nodes provided. Pass a non-empty array: nodes={[{ id: "A" }, { id: "B" }, ...]}.';if(o&&t&&t.length>0){const a=Y(t).find(e=>e&&"object"==typeof e);if(a){const t=Object.keys(a);for(const[r,n]of Object.entries(o))if(n&&"string"==typeof n&&!(n in a)){const a=J(n,t),o=a?` Try ${r}="${a}".`:"";return`${e}: ${r} "${n}" not found in node data. Available fields: ${t.join(", ")}.${o}`}}}return null}({componentName:e,nodes:t.nodes,edges:t.edges,nodesRequired:r.required.includes("nodes"),edgesRequired:r.required.includes("edges")});n&&a.push(n)}return{valid:0===a.length,errors:a}}const ne=new Set(["label","callout","callout-circle","callout-rect","text","widget"]),oe=new Set(["label","callout","callout-circle","callout-rect"]);function ie(e){return"string"==typeof(null==e?void 0:e.type)?e.type:""}function se(e){return!!e&&"object"==typeof e&&ne.has(ie(e))}function ce(e){return oe.has(ie(e))&&!function(e){return Array.isArray(null==e?void 0:e.disable)&&e.disable.includes("connector")}(e)}const le=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),ue=new Set(["ForceDirectedGraph","SankeyDiagram","ChordDiagram"]),de=new Set(["BarChart","StackedBarChart","GroupedBarChart","AreaChart","StackedAreaChart"]),pe=new Set(["LineChart","AreaChart","StackedAreaChart"]),ge=new Set(["BarChart","StackedBarChart","GroupedBarChart","FunnelChart"]);function fe(e){let t=e.replace(/^#/,"");/^[a-f\d]{3}$/i.test(t)&&(t=t.split("").map(e=>e+e).join(""));const a=t.match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!a)return null;const[r,n,o]=[parseInt(a[1],16)/255,parseInt(a[2],16)/255,parseInt(a[3],16)/255],i=e=>e>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92;return.2126*i(r)+.7152*i(n)+.0722*i(o)}function ye(e,t){const a=fe(e),r=fe(t);return null===a||null===r?null:(Math.max(a,r)+.05)/(Math.min(a,r)+.05)}const he=["xAccessor","yAccessor","timeAccessor","valueAccessor","categoryAccessor","colorBy","sizeBy","lineBy","areaBy","stackBy","groupBy","orderAccessor","y0Accessor","sourceAccessor","targetAccessor","nodeIDAccessor","childrenAccessor","costAccessor"];const me=["xExtent","yExtent","rExtent"],be=new Set(["LineChart","AreaChart","StackedAreaChart"]),ve={PieChart:"valueAccessor",DonutChart:"valueAccessor",FunnelChart:"valueAccessor"},xe={StackedBarChart:"valueAccessor",StackedAreaChart:"yAccessor"},Ae=new Set(["LineChart","AreaChart","StackedAreaChart","ConnectedScatterplot"]),we=new Set(["PieChart","DonutChart"]);function $e(e,t){const a=[],r=re(e,t);for(const e of r.errors)a.push({severity:"error",code:"VALIDATION",message:e,fix:""});return te[e]?(function(e,t,a){const r=te[e];if(r){if("array"===r.dataShape){const e=t.data;e&&Array.isArray(e)&&0===e.length&&a.push({severity:"error",code:"EMPTY_DATA",message:"data is an empty array — chart will render blank.",fix:"Provide at least one data point: data={[{ x: 1, y: 2 }]}."})}"network"===r.dataShape&&t.edges&&Array.isArray(t.edges)&&0===t.edges.length&&a.push({severity:"error",code:"EMPTY_EDGES",message:"edges is an empty array — network chart will render blank.",fix:'Provide at least one edge: edges={[{ source: "A", target: "B" }]}.'})}}(e,t,a),function(e,t,a){const r=t.width,n=t.height;if(void 0===r||"number"==typeof r&&r>0||a.push({severity:"error",code:"BAD_WIDTH",message:`width=${JSON.stringify(r)} — chart needs a positive number.`,fix:"Set width={600} or use responsiveWidth={true}."}),void 0===n||"number"==typeof n&&n>0||a.push({severity:"error",code:"BAD_HEIGHT",message:`height=${JSON.stringify(n)} — chart needs a positive number.`,fix:"Set height={400} or use responsiveHeight={true}."}),t.size&&Array.isArray(t.size)){const[e,r]=t.size;(null!=e&&0>=e||null!=r&&0>=r)&&a.push({severity:"error",code:"BAD_SIZE",message:`size=[${e}, ${r}] — both dimensions must be positive.`,fix:"Set size={[600, 400]}."})}}(0,t,a),function(e,t,a){const r=te[e];if(!r||"array"!==r.dataShape)return;const n=t.data;if(!n||!Array.isArray(n)||0===n.length)return;const o=n[0];if(!o||"object"!=typeof o)return;const i=Object.keys(o);for(const e of r.dataAccessors){const r=t[e];"string"==typeof r&&(r in o||a.push({severity:"error",code:"ACCESSOR_MISSING",message:`${e}="${r}" not found in data. Available fields: ${i.join(", ")}.`,fix:`Change ${e} to one of: ${i.map(e=>`"${e}"`).join(", ")}.`}))}}(e,t,a),function(e,t,a){le.has(e)&&Array.isArray(t.data)&&a.push({severity:"error",code:"HIERARCHY_FLAT_ARRAY",message:e+" expects hierarchical data but received a flat array.",fix:'Pass a root object: data={{ name: "root", children: [...] }}. For flat data, use BarChart or LineChart.'})}(e,t,a),function(e,t,a){ue.has(e)&&(t.edges||t.data||a.push({severity:"error",code:"NETWORK_NO_EDGES",message:e+" requires an edges prop.",fix:'Provide edges={[{ source: "A", target: "B", value: 10 }]}.'}))}(e,t,a),function(e,t,a){const r=te[e];if(!r||"array"!==r.dataShape)return;const n=t.data;if(!n||!Array.isArray(n)||0===n.length)return;const o=n[0];if(!o||"object"!=typeof o)return;const i=t.xAccessor;"string"==typeof i&&o[i]instanceof Date&&!t.xFormat&&a.push({severity:"warning",code:"DATE_NO_FORMAT",message:`xAccessor "${i}" contains Date objects but no xFormat is provided. Axis ticks may display "[object Object]".`,fix:"Add xFormat={d => d.toLocaleDateString()} or use timestamps (d.getTime()) instead of Date objects."})}(e,t,a),function(e,t,a){t.linkedHover&&!t.selection&&a.push({severity:"warning",code:"LINKED_HOVER_NO_SELECTION",message:"linkedHover is set but selection is not — this chart emits hover events but won't highlight from others.",fix:`Add selection={{ name: "${"object"==typeof t.linkedHover&&t.linkedHover.name||"hl"}" }} to receive cross-highlights.`})}(0,t,a),function(e,t,a){var r;if(!de.has(e))return;const n=t.rExtent||t.yExtent;n&&Array.isArray(n)&&n.length>=1&&null!=n[0]&&0!==n[0]&&a.push({severity:"warning",code:"NON_ZERO_BASELINE",message:`${e} has a non-zero baseline (${n[0]}). Bar and area charts should start at zero to avoid exaggerating differences.`,fix:`Remove the custom extent minimum or set it to 0: rExtent={[0, ${null!==(r=n[1])&&void 0!==r?r:"auto"}]}. For trend-focused charts, use LineChart instead.`})}(e,t,a),function(e,t,a){if(!pe.has(e))return;if(t.gapStrategy)return;const r=t.data;if(!r||!Array.isArray(r)||0===r.length)return;const n=t.yAccessor||"y";"string"==typeof n&&r.some(e=>{const t=e[n];return null==t||Number.isNaN(t)})&&a.push({severity:"warning",code:"DATA_GAPS",message:`Data contains null/undefined/NaN values in "${n}". Default behavior breaks the line at gaps.`,fix:'Set gapStrategy="break" (default), "interpolate", or "zero" to control gap handling.'})}(e,t,a),function(e,t,a){var r,n;const o=null!==(r=t.width)&&void 0!==r?r:600,i=null!==(n=t.height)&&void 0!==n?n:400,s=t.margin;if(!s||"object"!=typeof s)return;const c=(s.left||0)+(s.right||0),l=(s.top||0)+(s.bottom||0);o>c||a.push({severity:"error",code:"MARGIN_OVERFLOW_H",message:`Horizontal margins (${c}px) >= width (${o}px) — no drawing area left.`,fix:"Reduce margin.left/right or increase width."}),i>l||a.push({severity:"error",code:"MARGIN_OVERFLOW_V",message:`Vertical margins (${l}px) >= height (${i}px) — no drawing area left.`,fix:"Reduce margin.top/bottom or increase height."})}(0,t,a),function(e,t,a){var r;const n=te[e];if(!n||"array"!==n.dataShape)return;const o=t.data;if(!o||!Array.isArray(o)||0===o.length)return;const i=[];t.xAccessor&&"string"==typeof t.xAccessor&&i.push({prop:"xAccessor",name:t.xAccessor}),t.yAccessor&&"string"==typeof t.yAccessor&&i.push({prop:"yAccessor",name:t.yAccessor}),t.valueAccessor&&"string"==typeof t.valueAccessor&&i.push({prop:"valueAccessor",name:t.valueAccessor});const s=Math.min(o.length,5);for(const e of i){let t=!0;for(let a=0;s>a;a++){const n=null===(r=o[a])||void 0===r?void 0:r[e.name];if("number"==typeof n&&Number.isFinite(n)){t=!1;break}}t&&a.push({severity:"error",code:"DEGENERATE_EXTENT",message:`${e.prop}="${e.name}" produces NaN or non-finite values for all sampled data points — chart extents will be invalid.`,fix:`Ensure data[].${e.name} contains finite numbers, or use a function accessor to transform values.`})}}(e,t,a),function(e,t,a){if(!ge.has(e))return;const r=t.barPadding;"number"==typeof r&&10>r&&a.push({severity:"warning",code:"BAR_PADDING_INVISIBLE",message:`barPadding=${r} is very small — bars may appear to have no spacing between them.`,fix:"Increase barPadding to at least 10 for visible gaps, e.g. barPadding={12}."})}(e,t,a),function(e,t,a){if("bottom"!==t.legendPosition)return;const r=t.margin;if(!r||"object"!=typeof r)return;const n=r.bottom;"number"==typeof n&&70>n&&a.push({severity:"warning",code:"BOTTOM_MARGIN_WITH_LEGEND",message:`legendPosition="bottom" with margin.bottom=${n}px — legend may overlap axis labels.`,fix:"Increase margin.bottom to at least 70, e.g. margin={{ ...margin, bottom: 80 }}."})}(0,t,a),function(e,t,a){var r;if(!t.showLegend)return;if("right"!==(null!==(r=t.legendPosition)&&void 0!==r?r:"right"))return;const n=t.margin;if(!n||"object"!=typeof n)return;const o=n.right;"number"==typeof o&&100>o&&a.push({severity:"warning",code:"LEGEND_MARGIN_TIGHT",message:`showLegend is true with legendPosition="right" but margin.right=${o}px — legend may be clipped or overlap the chart.`,fix:"Increase margin.right to at least 100, e.g. margin={{ ...margin, right: 120 }}."})}(0,t,a),function(e,t,a){if("Heatmap"!==e)return;const r=t.data;if(!r||!Array.isArray(r)||0===r.length)return;const n=r[0];if(n&&"object"==typeof n)for(const e of["xAccessor","yAccessor"]){const r=t[e];if("string"!=typeof r)continue;const o=n[r];"string"==typeof o&&a.push({severity:"warning",code:"HEATMAP_STRING_ACCESSOR",message:`${e}="${r}" resolves to string values (e.g. "${o}"). Heatmap will use categorical axis handling which may produce unexpected cell layout.`,fix:"If you intend categorical axes this is fine. Otherwise, convert values to numbers before passing data."})}}(e,t,a),function(e,t,a){const r=t.colorScheme;if(!r||!Array.isArray(r))return;const n="string"==typeof t.background?t.background:"#ffffff";if(!n.startsWith("#"))return;const o=[];for(const e of r){if("string"!=typeof e||!e.startsWith("#"))continue;const t=ye(e,n);null!==t&&3>t&&o.push(`${e} (${t.toFixed(1)}:1)`)}o.length>0&&a.push({severity:"warning",code:"LOW_COLOR_CONTRAST",message:`${o.length} color(s) in colorScheme have < 3:1 contrast against background "${n}": ${o.join(", ")}. Data marks may be hard to see.`,fix:'Use darker colors on light backgrounds or lighter colors on dark backgrounds. Import COLOR_BLIND_SAFE_CATEGORICAL from "semiotic" for an accessible preset.'})}(0,t,a),function(e,t,a){const r=t.colorScheme;if(!r||!Array.isArray(r)||2>r.length)return;const n=r.filter(e=>"string"==typeof e&&e.startsWith("#"));if(2>n.length)return;const o=[];for(let e=0;n.length-1>e;e++){const t=ye(n[e],n[e+1]);null!==t&&1.5>t&&o.push(`${n[e]} / ${n[e+1]} (${t.toFixed(1)}:1)`)}o.length>0&&a.push({severity:"warning",code:"LOW_ADJACENT_CONTRAST",message:`${o.length} adjacent color pair(s) in colorScheme have very similar luminance: ${o.join("; ")}. Categories may be hard to distinguish.`,fix:'Alternate light and dark colors in the scheme, or use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic" for a pre-tested palette.'})}(0,t,a),function(e,t,a){const r="string"==typeof t.title&&t.title.trim().length>0,n="string"==typeof t.description&&t.description.trim().length>0,o="string"==typeof t.summary&&t.summary.trim().length>0;r||n||o||a.push({severity:"warning",code:"MISSING_DESCRIPTION",message:'No title, description, or summary provided. Screen readers will use a generic label like "XY chart".',fix:'Add a title="..." prop for a brief label, or description="..." for a detailed aria-label, or summary="..." for a screen-reader-only note describing the chart\'s purpose.'})}(0,t,a),function(e,t,a){const r=[];for(const e of he)"function"==typeof t[e]&&r.push(e);r.length>0&&a.push({severity:"warning",code:"FUNCTION_ACCESSOR",message:`Function accessor${r.length>1?"s":""} detected: ${r.join(", ")}. If defined inline (e.g. \`xAccessor={d => d.value}\`), every parent re-render creates a new reference which may trigger unnecessary scene rebuilds.`,fix:'Use string accessors when possible (e.g. xAccessor="value"), or memoize with useCallback / define outside the component.'})}(0,t,a),function(e,t,a){const r=Array.isArray(t.annotations)?t.annotations:null;if(r)for(const e of r){if(!e||"object"!=typeof e)continue;const t=ie(e);if(!se(e)||"widget"===t)continue;const r=Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0),n="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:t,o=ce(e);!o&&r>120?a.push({severity:"warning",code:"ANNOTATION_FAR_NO_CONNECTOR",message:`Annotation "${n}" sits ~${Math.round(r)}px from its anchor with no connector — a reader can't tell what it refers to.`,fix:'Add a connector (connector: { end: "arrow" }, the label/callout default) or place the note adjacent to its target (smaller dx/dy).'}):o&&r>250&&a.push({severity:"warning",code:"ANNOTATION_LONG_CONNECTOR",message:`Annotation "${n}" uses a very long connector (~${Math.round(r)}px); prefer placing the note adjacent to its target when space allows.`,fix:"Reduce dx/dy so the note sits near its target, or keep the long connector only if proximity is genuinely infeasible."})}}(0,t,a),function(e,t,a){const r=Array.isArray(t.annotations)?t.annotations:null;if(!r)return;const n=r.filter(se).length;if(0===n)return;const o="number"==typeof t.width?t.width:600,i="number"==typeof t.height?t.height:400,s=function(e,t,a={}){return"number"==typeof a.maxAnnotations&&Number.isFinite(a.maxAnnotations)?Math.max(0,Math.floor(a.maxAnnotations)):e>0&&t>0?Math.max(1,Math.round(e*t/(a.areaPerAnnotation&&a.areaPerAnnotation>0?a.areaPerAnnotation:2e4))):1/0}(o,i);Number.isFinite(s)&&n>s&&a.push({severity:"warning",code:"ANNOTATION_DENSITY",message:`${n} note annotations on a ${o}×${i} chart exceed the ~${s} notes the plot area carries comfortably — the chart may read as cluttered.`,fix:'Mark the essential notes emphasis: "primary" and let density management shed the rest (autoPlaceAnnotations: { density: true }), enable progressive disclosure to reveal secondary notes on hover, or give the chart more room.'})}(0,t,a),function(e,t,a){for(const e of me){const r=t[e];if(!Array.isArray(r)||2>r.length)continue;const[n,o]=r;"number"==typeof n&&"number"==typeof o&&n>o&&a.push({severity:"warning",code:"INVERTED_AXIS",message:`${e}=[${n}, ${o}] is descending — the axis renders inverted, so "up" reads as less. Inverted axes are a classic misleading-design pattern unless the inversion is the point.`,fix:`Order the extent ascending (${e}={[${o}, ${n}]}). If the inversion is deliberate (e.g. rank #1 at top), say so in the title or an annotation so readers aren't misled.`})}}(0,t,a),function(e,t,a){if("MultiAxisLineChart"!==e)return;const r=t.series;if(!Array.isArray(r)||2!==r.length)return;const n=r.filter(e=>!e||"object"!=typeof e||"string"!=typeof e.label||0===e.label.trim().length);n.length>0&&a.push({severity:"warning",code:"DUAL_AXIS_UNLABELED",message:`Dual-axis chart with ${n.length} unlabeled series. Two y-scales invite false equivalence between the lines; without per-series labels a reader can't tell which scale is whose.`,fix:'Give every series a label: series={[{ yAccessor: "a", label: "Revenue ($)" }, { yAccessor: "b", label: "Users" }]} — and consider whether two separate charts read more honestly.'})}(e,t,a),function(e,t,a){var r;if(!be.has(e))return;const n=t.xExtent;if(!Array.isArray(n)||2>n.length)return;const[o,i]=n;if("number"!=typeof o||"number"!=typeof i||o>=i)return;const s=t.data;if(!s||!Array.isArray(s)||4>s.length)return;const c=null!==(r=t.xAccessor)&&void 0!==r?r:"x";if("string"!=typeof c)return;let l=1/0,u=-1/0;for(const e of s){const t=null==e?void 0:e[c];"number"==typeof t&&Number.isFinite(t)&&(l>t&&(l=t),t>u&&(u=t))}if(!Number.isFinite(l)||!Number.isFinite(u)||l>=u)return;const d=u-l,p=Math.max(0,Math.min(i,u)-Math.max(o,l))/d;.7>p&&a.push({severity:"warning",code:"CHERRY_PICKED_WINDOW",message:`xExtent=[${o}, ${i}] shows only ~${Math.round(100*p)}% of the data's x range [${l}, ${u}] — a trend cropped to a favorable window is a classic misleading-design pattern.`,fix:'Widen xExtent to cover the data, filter the data itself so the chart shows what it has, or annotate the visible window ("Q4 only") so the cropping is explicit.'})}(e,t,a),function(e,t,a){const r=ve[e],n=xe[e];if(!r&&!n)return;if(n&&!t.normalize)return;const o=null!=r?r:n,i=t[o],s="string"==typeof i?i:"yAccessor"===o?"y":"value",c=t.data;if(!c||!Array.isArray(c)||0===c.length)return;const l=c.filter(e=>{const t=null==e?void 0:e[s];return"number"==typeof t&&0>t});l.length>0&&a.push({severity:r?"error":"warning",code:"PART_TO_WHOLE_NEGATIVE",message:`${l.length} negative value(s) in "${s}" — a part-to-whole encoding cannot represent negative parts${r?"; slice angles/areas for negatives are meaningless":"; normalized shares distort when parts are negative"}.`,fix:r?"Filter or transform negative values first, or switch to a BarChart/WaterfallChart, which encode signed values honestly.":"Drop normalize for signed data, or use a diverging BarChart so negative contributions read as negative."})}(e,t,a),function(e,t,a){Ae.has(e)&&"basis"===t.curve&&a.push({severity:"warning",code:"NON_PASSING_CURVE",message:'curve="basis" draws a B-spline that does NOT pass through your data points — rendered values differ from actual values everywhere except the endpoints.',fix:'Use curve="monotoneX" or curve="catmullRom" (both interpolate through every point), or keep "basis" only for deliberately schematic, clearly-labeled smoothing.'})}(e,t,a),function(e,t,a){if("LineChart"!==e&&"AreaChart"!==e)return;if("sparkline"===t.mode)return;if(t.responsiveWidth||t.responsiveHeight)return;const r="number"==typeof t.width?t.width:600,n="number"==typeof t.height?t.height:400;if(0>=r||0>=n)return;const o=r/n;if(o>8||.25>o){const e=o>8?"flattens":"exaggerates";a.push({severity:"warning",code:"EXTREME_ASPECT_RATIO",message:`${r}×${n} (${o.toFixed(1)}:1) is an extreme aspect ratio that ${e} the slopes a reader perceives — aspect-ratio distortion is a documented misleading-design pattern.`,fix:o>8?'Use a more balanced aspect (e.g. width/height between 1 and 3), or set mode="sparkline" if this is genuinely a sparkline strip.':"Use a more balanced aspect (e.g. width/height between 1 and 3); very tall trend charts overstate every change."})}}(e,t,a),function(e,t,a){if(!we.has(e))return;const r=t.data;if(!r||!Array.isArray(r)||0===r.length)return;const n=t.categoryAccessor,o="string"==typeof n?n:"category",i=new Set;for(const e of r){const t=null==e?void 0:e[o];null!=t&&i.add(t)}i.size>8&&a.push({severity:"warning",code:"PIE_TOO_MANY_SLICES",message:i.size+" slices — angle judgments degrade rapidly past ~8 categories (Cleveland & McGill), and thin slices become unreadable and unlabelable.",fix:`Use a BarChart or DotPlot for ${i.size} categories, or group the long tail into an "Other" slice before charting.`})}(e,t,a),{ok:a.every(e=>"warning"===e.severity),diagnoses:a}):{ok:0===a.length,diagnoses:a}}const Se=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),ke=new Set(["PieChart","DonutChart","FunnelChart"]),je=new Set(["BigNumber"]),Ce=new Set(["LineChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","ConnectedScatterplot","BubbleChart","QuadrantChart","MultiAxisLineChart","CandlestickChart","Heatmap","MinimapChart"]),Oe=new Set(["OrbitDiagram"]),ze=new Set(["RealtimeLineChart","RealtimeHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","ProcessSankey"]),Re=new Set(["MultiAxisLineChart"]),Le=new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),Fe={Scatterplot:"pointRadius",BubbleChart:"pointRadius",ConnectedScatterplot:"pointRadius",QuadrantChart:"pointRadius",SwarmPlot:"pointRadius",DotPlot:"dotRadius"},Pe=new Set(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#f0e442","#000000"]);function Ne(e){return"string"==typeof e&&e.trim().length>0}function Te(e){return"primary"===(null==e?void 0:e.emphasis)||"secondary"===(null==e?void 0:e.emphasis)||null!=function(e){var t;const a=null===(t=null==e?void 0:e.provenance)||void 0===t?void 0:t.confidence;return"number"==typeof a&&Number.isFinite(a)?a:null}(e)}function Be(e){const t=e.toLowerCase().replace(/[^a-z]/g,"");if(!t)return 0;if(3>=t.length)return 1;const a=t.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/,"").replace(/^y/,"").match(/[aeiouy]{1,2}/g);return a?a.length:1}function Me(e,t,a={}){const r=[],n=!!te[e],o=!0===a.inChartContainer,i=!0===a.describe,s=!0===a.navigable,c=je.has(e),l=Se.has(e),u=!1!==t.accessibleTable&&!c,d=Ne(t.title),p=Ne(t.description),g=Ne(t.summary),f=d||p||g,y=function(e){return!1!==e.tooltip||null!=e.onClick||null!=e.brush||null!=e.onBrush||null!=e.selection||null!=e.linkedHover||null!=e.linkedBrush}(t),h=Array.isArray(t.annotations)?t.annotations.filter(e=>!!e&&"object"==typeof e):[],m=n?"pass":"manual",b=n?"":` (unrecognized component "${e}" — verify manually that the built-in applies)`;if(r.push(function(e){const t={id:"perceivable.low-contrast",principle:"perceivable",heuristic:"Low contrast",critical:!0},a=e.colorScheme,r="string"==typeof e.background?e.background:null;if(r&&!r.startsWith("#"))return Object.assign(Object.assign({},t),{status:"manual",message:`Background "${r}" isn't a hex literal (theme/CSS variable) — contrast can't be verified statically.`,fix:'Pass a hex `background` (e.g. "#ffffff"/"#000000"), or verify contrast manually once the theme resolves.'});const n=null!=r?r:"#ffffff";if(!Array.isArray(a))return Object.assign(Object.assign({},t),{status:"manual",message:"Mark colors come from the theme/CSS variables — contrast can't be verified statically.",fix:"Confirm geometries/large text have ≥ 3:1 and regular text ≥ 4.5:1 contrast against the background."});const o=[];let i=0;for(const e of a){if("string"!=typeof e||!e.startsWith("#"))continue;const t=ye(e,n);null!=t&&(i++,3>t&&o.push(`${e} (${t.toFixed(1)}:1)`))}return Object.assign(Object.assign({},t),0===i?{status:"manual",message:"colorScheme has no parseable hex colors to check.",fix:"Verify contrast manually for non-hex colors."}:o.length>0?{status:"fail",message:`${o.length} color(s) fall below 3:1 contrast vs ${n}: ${o.join(", ")}.`,fix:"Darken (light background) or lighten (dark background) those colors, or use COLOR_BLIND_SAFE_CATEGORICAL."}:{status:"pass",message:`All ${i} checked colorScheme color(s) meet ≥ 3:1 contrast vs ${n}.`})}(t)),r.push(Object.assign({id:"perceivable.content-only-visual",principle:"perceivable",heuristic:"Content is only visual",critical:!0},c?{status:"pass",message:"BigNumber renders its value as real text with an ARIA label — available without vision."}:u?{status:"pass",message:"A screen-reader data table + live region expose the data non-visually (accessibleTable is on)."}:p&&g?{status:"manual",message:"accessibleTable is off; a description + summary are present. Verify they convey everything the chart shows.",fix:"Re-enable accessibleTable, or confirm via screen reader that the text alternative is complete."}:{status:"fail",message:"accessibleTable is disabled and there's no full text alternative — the data is only available visually.",fix:"Remove accessibleTable={false}, or provide a complete description/summary plus a data table."})),r.push({id:"perceivable.small-text",principle:"perceivable",heuristic:"Small text size",critical:!0,status:"pass",message:"Semiotic's default tick and axis-label fonts are 12px, meeting Chartability's 9pt/12px floor.",fix:"If a theme or override lowers --semiotic-tick-font-size below 12px, raise it back for low-vision audiences."}),r.push(Object.assign({id:"perceivable.seizure-risk",principle:"perceivable",heuristic:"Visual presents seizure risk",critical:!0},null!=t.pulse||Oe.has(e)?{status:"manual",message:"Pulse/continuous animation is in use. Confirm nothing flashes more than 3×/sec, especially saturated red.",fix:"Avoid red flashes and rapid (>3 Hz) flicker; reduced-motion is auto-honored, but verify the default presentation."}:{status:"manual",message:"No flashing detected statically. Confirm no element flashes more than 3×/sec.",fix:"Manual check — most static charts pass trivially."})),null!=t.colorBy){r.push(Object.assign({id:"perceivable.color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1},!0===t.directLabel||!0===t.showLabels?{status:"pass",message:"Categories are encoded by color (colorBy) and also directly labeled, so color isn't the only channel."}:{status:"warn",message:"Categories are encoded by color (colorBy) with no redundant channel — Semiotic does not yet ship texture/pattern fills.",fix:"Add direct labels (directLabel on LineChart/AreaChart, showLabels on network/hierarchy), keep categories ≤ ~7, and use a CVD-safe palette."}));const e=Array.isArray(t.colorScheme)?t.colorScheme:null,a=e?e.filter(e=>"string"==typeof e&&e.startsWith("#")).map(e=>e.toLowerCase()):[],n=a.length>0&&a.every(e=>Pe.has(e));r.push(Object.assign({id:"perceivable.cvd-safe",principle:"perceivable",heuristic:"Not CVD-friendly",critical:!1},n?{status:"pass",message:"colorScheme uses Semiotic's Wong colorblind-safe palette."}:{status:"manual",message:"Color encodes meaning; statically we can't confirm the palette is colorblind-safe.",fix:'Use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic", or test your scheme with Viz Palette / Chroma.'})),r.push({id:"flexible.textures-adjustable",principle:"flexible",heuristic:"Contrast and textures cannot be adjusted",critical:!1,status:"warn",message:"There's no per-category texture/pattern channel to toggle as an alternative to color.",fix:"Until texture fills land, ensure the encoding survives color removal: direct labels + a CVD-safe palette. Contrast itself is themeable via CSS variables."})}{const e=h.filter(se);if(e.length>0){const a=t.autoPlaceAnnotations,n="object"==typeof a&&null!==a&&!0===a.redundantCues,o=e.filter(e=>{if("string"!=typeof e.color)return!1;const t=ie(e),a=n&&"text"===t;return!(ce(e)||a)});r.push(Object.assign({id:"perceivable.annotation-association",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1},0===o.length?{status:"pass",message:"No annotation relies on color alone to indicate its target — wherever color is used, a connector, enclosure, or reference-line cue is present too."}:{status:"warn",message:`${o.length} of ${e.length} annotation(s) carry a color but no connector, enclosure, or reference-line cue, so a color-blind or non-visual reader can't tie them to their target (the correspondence problem).`,fix:"Add a connector (the label/callout default), place the note adjacent to its target, enclose the target, or enable autoPlaceAnnotations: { redundantCues: true } to give colored text notes a leader line — don't rely on color matching alone."}))}}r.push(Object.assign({id:"operable.single-input-modality",principle:"operable",heuristic:"Interaction modality only has one input type",critical:!0},n?{status:"pass",message:"Built-in keyboard navigation (arrows/Home/End/PageUp-Down/Enter) mirrors mouse hover."}:{status:"manual",message:`Can't confirm keyboard support for "${e}".`,fix:"Verify Tab + arrow-key operation."}));{const e=[];null==t.brush&&null==t.onBrush||e.push("brushing"),!0===t.zoomable&&e.push("zoom/pan"),"isolate"!==t.legendInteraction&&"highlight"!==t.legendInteraction||e.push("legend filtering"),e.length>0&&r.push({id:"operable.complex-action-alternatives",principle:"operable",heuristic:"Complex actions have no alternatives",critical:!1,status:"warn",message:`Mouse-driven ${e.join(", ")} ${e.length>1?"have":"has"} no built-in keyboard/standard-UI equivalent.`,fix:"Pair the complex interaction with a standard control (range inputs for a brush, buttons for zoom, a checkbox list for legend filtering) operable by keyboard and screen reader."})}{const a=Fe[e];if(a&&y){const e=t[a];"number"==typeof e&&e>0&&24>2*e&&r.push({id:"operable.target-size",principle:"operable",heuristic:"Target pointer interaction size is too small",critical:!1,status:"warn",message:`${a}=${e} gives a ~${2*e}px hit target, below the 24×24px minimum for pointer interaction.`,fix:"Increase the radius, or rely on the chart's hoverRadius / keyboard navigation as the alternative for precise selection."})}}r.push({id:"operable.tab-stops",principle:"operable",heuristic:"Inappropriate tab stops",critical:!1,status:m,message:`The chart takes a single tab stop and navigates data with arrow keys${b} — the recommended pattern for dense charts (no per-datum tab stops to wade through).`}),r.push(Object.assign({id:"operable.interaction-cues",principle:"operable",heuristic:"No interaction cues or instructions",critical:!0},y?g||p?{status:"manual",message:"Chart is interactive and has descriptive text. Confirm that text explains how to interact (keyboard + pointer).",fix:'State the interaction model in summary, e.g. "Use arrow keys to move between points."'}:{status:"warn",message:"Chart is interactive but nothing explains how to use it.",fix:"Describe the interaction in a summary or nearby text (keyboard navigation, what hover/click reveals)."}:{status:"not-applicable",message:"No interactive behavior detected."})),r.push({id:"operable.controls-override-at",principle:"operable",heuristic:"Controls override AT controls",critical:!0,status:m,message:`Keyboard handlers fire only while the chart has focus, so they don't hijack page/app screen-reader shortcuts${b}.`}),r.push({id:"operable.focus-indicator",principle:"operable",heuristic:"Keyboard focus indicator missing, obscured, or low contrast",critical:!1,status:m,message:`A shape-adaptive focus ring (var(--semiotic-focus)) marks the focused element${b}.`,fix:n?"Ensure --semiotic-focus keeps ≥ 3:1 contrast against your background.":void 0}),r.push(Object.assign({id:"understandable.title-summary-caption",principle:"understandable",heuristic:"No title, summary, or caption",critical:!0},f?{status:"pass",message:`Provided: ${[d&&"title",p&&"description",g&&"summary"].filter(Boolean).join(", ")}.`}:o?{status:"manual",message:"No title/description/summary on the chart. If the wrapping ChartContainer supplies a title/subtitle, this is covered at that layer — verify it does.",fix:"Give the ChartContainer a title (and optionally enable describe), or set title/description/summary on the chart."}:{status:"fail",message:"No title, description, or summary — the screen reader falls back to a generic label.",fix:"Add title/description/summary on the chart, or wrap it in a ChartContainer (the opt-in layer for title/caption/description chrome)."})),r.push(Object.assign({id:"understandable.explain-purpose",principle:"understandable",heuristic:"No explanation for purpose or for how to read",critical:!0},p||g?{status:"pass",message:"A description/summary is available to explain purpose and how to read the chart."}:i?{status:"manual",message:"ChartContainer's describe option explains how to read the chart (type, stats, trend). Confirm the domain purpose — why this chart exists — is also conveyed (title/subtitle).",fix:"Give the ChartContainer a title/subtitle stating the purpose; describe() covers the how-to-read half."}:d?{status:"warn",message:"Only a title is set — a label, not an explanation of purpose or how to read the chart.",fix:"Add a summary, or enable ChartContainer's describe option for an auto-generated how-to-read description."}:{status:"fail",message:"Nothing explains the chart's purpose or how to read it.",fix:"Add a summary/description, or wrap in a ChartContainer with a title and the describe option (the opt-in full-accessibility layer)."}));{const e=[t.description,t.summary].filter(Ne).join(". "),a=e?function(e){const t=e.split(/[.!?]+/).map(e=>e.trim()).filter(Boolean),a=e.trim().split(/\s+/).filter(Boolean);if(0===a.length||0===t.length)return null;let r=0;for(const e of a)r+=Be(e);return a.length/t.length*.39+r/a.length*11.8-15.59}(e):null;r.push(Object.assign({id:"understandable.reading-level",principle:"understandable",heuristic:"Reading level inappropriate",critical:!0},null==a?{status:"not-applicable",message:"No description/summary text to grade."}:a>9?{status:"warn",message:`Description/summary reads at ~grade ${a.toFixed(0)}; Chartability targets grade 9 or lower.`,fix:"Shorten sentences and prefer common words."}:{status:"pass",message:`Description/summary reads at ~grade ${Math.max(0,Math.round(a))} (≤ 9).`}))}if(Ce.has(e)){const e=Ne(t.xLabel),a=Ne(t.yLabel);r.push(Object.assign({id:"understandable.axis-labels",principle:"understandable",heuristic:"Axis labels are unclear or missing",critical:!1},e&&a?{status:"pass",message:"Both axes are labeled (xLabel, yLabel)."}:{status:"warn",message:`Missing axis label: ${[!e&&"xLabel",!a&&"yLabel"].filter(Boolean).join(", ")}. Ticks alone may not name the variable.`,fix:"Set xLabel and yLabel to name each axis's variable and units."}))}if(Re.has(e)&&r.push({id:"understandable.information-complexity",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,status:"warn",message:"Dual-axis chart: two y-scales are hard to read accurately and notoriously easy to misinterpret (the crossover point is arbitrary).",fix:"Confirm the second axis is necessary; consider two aligned charts (small multiples) or indexing both series to a common baseline. Label each axis and its series unambiguously."}),h.length>1){const e=h.filter(Te).length;r.push(Object.assign({id:"understandable.annotation-hierarchy",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1},e===h.length?{status:"pass",message:`All ${h.length} annotation(s) declare hierarchy through emphasis or provenance confidence, so the renderer can resolve reading order and visual priority.`}:0===e?{status:"warn",message:h.length+" annotations are present with no emphasis or provenance confidence; readers may not know which note is primary.",fix:'Mark the main annotation with emphasis="primary", set supporting notes to emphasis="secondary", or provide provenance.confidence so Semiotic can infer order.'}:{status:"warn",message:`${h.length-e} of ${h.length} annotation(s) have no emphasis or provenance confidence; readers may not know which note is primary among the unordered notes.`,fix:"Set emphasis on each annotation (primary/secondary), or provide provenance.confidence on all annotations so Semiotic can infer order."}))}(null!=t.forecast||null!=t.anomaly||null!=t.band||null!=t.regression)&&r.push({id:"understandable.uncertainty",principle:"understandable",heuristic:"Statistical uncertainty isn't clearly communicated",critical:!1,status:"manual",message:"The chart shows a forecast/regression/band/anomaly overlay. Confirm the uncertainty it represents is explained in text, not just drawn.",fix:"State the confidence interval / method in the summary, and label the band so it isn't mistaken for data."}),null!=t.animate&&!1!==t.animate&&r.push({id:"understandable.changes-followable",principle:"understandable",heuristic:"Changes are not easy to follow",critical:!1,status:m,message:`Transitions animate with object constancy and data changes are mirrored to the live region${b}.`,fix:n?"Keep transition durations in the 250ms–2s range so changes are followable but not slow.":void 0}),r.push({id:"robust.conforms-to-standards",principle:"robust",heuristic:"Does not conform to standards",critical:!1,status:"manual",message:"WCAG 2.1 / Section 508 conformance can't be settled from config alone.",fix:"Run an automated checker (axe) on the rendered output and test with real assistive tech."}),r.push({id:"robust.semantically-valid",principle:"robust",heuristic:"Semantically invalid",critical:!1,status:"manual",message:"Whether interactive elements expose correct roles/names is a render-time, screen-reader question.",fix:"Verify with a screen reader that buttons read as buttons, the chart as an image/group, etc."}),r.push({id:"robust.fragile-technology-support",principle:"robust",heuristic:"Fragile technology support",critical:!1,status:m,message:`Charts render on canvas with an SVG overlay and render to SVG in SSR, so access isn't tied to one rendering path${b}.`,fix:n?"Still test across NVDA+Firefox, JAWS+Chrome, and VoiceOver+Safari — AT support varies.":void 0}),r.push(Object.assign({id:"compromising.table",principle:"compromising",heuristic:"No table",critical:!0},c?{status:"not-applicable",message:"Single-value display — a table isn't meaningful."}:u?{status:"pass",message:"A human-readable data table is provided (accessibleTable)."}:{status:"fail",message:"accessibleTable is disabled — no human-readable table of the underlying data.",fix:"Remove accessibleTable={false} (unless title/summary/annotations already convey all the data)."})),c||r.push(Object.assign({id:"compromising.table-static",principle:"compromising",heuristic:"Table/data is static",critical:!1},o?{status:"manual",message:"Rendered in a ChartContainer. If a data-download action is enabled, the data is exportable.",fix:"Enable the ChartContainer data-download action so users can save the underlying data (keep it opt-in)."}:{status:"warn",message:"The data table is read-only — not downloadable, sortable, or filterable.",fix:"Wrap the chart in a ChartContainer and enable its data-download action (opt-in, so deployments can withhold it where export isn't allowed)."})),r.push({id:"compromising.shareable-state",principle:"compromising",heuristic:"State is not easy to share and reproduce",critical:!1,status:n?"pass":"manual",message:`Chart state serializes via toConfig/toURL/copyConfig${n?"":b}.`,fix:n?"Expose it to users via the ChartContainer copyConfig action or a shareable URL.":void 0}),r.push(Object.assign({id:"compromising.navigable-structure",principle:"compromising",heuristic:"Information cannot be navigated according to narrative or structure",critical:!1},s?{status:"pass",message:"ChartContainer's navigable option mounts a structured tree (chart → axes/series → data points) that screen readers can traverse."}:l?{status:"warn",message:"Hierarchical chart: built-in keyboard navigation is largely flat — it doesn't descend the tree structure.",fix:"Enable ChartContainer's navigable option for a structured navigation tree, or lean on the data table and a summary that conveys the hierarchy."}:{status:m,message:`Keyboard navigation steps through points and switches series/groups${b}.`,fix:n?"For deeper structure (axis → series → datum), enable ChartContainer's navigable option.":void 0}));{const a=Array.isArray(t.data)?t.data:null,n=Array.isArray(t.nodes)?t.nodes:null,o={id:"assistive.data-density",principle:"assistive",heuristic:"Data density is inappropriate",critical:!0};let i;i=ke.has(e)&&a&&a.length>7?Object.assign(Object.assign({},o),{status:"warn",message:a.length+" slices in a part-to-whole chart. Chartability suggests ≤ 5 categories; many thin slices are hard to perceive and to describe.",fix:'Group small slices into an "Other" category, or switch to a ranked bar chart.'}):Object.assign(Object.assign({},o),n&&n.length>200?{status:"warn",message:n.length+" nodes. A network this size is hard to navigate non-visually node by node.",fix:"Provide a summary of structure (clusters, hubs, components) and consider filtering or aggregating the graph."}:a&&a.length>5e3?{status:"warn",message:a.length+" data points. Canvas renders this fine, but the non-visual table/navigation become unwieldy.",fix:"Aggregate or bin for the accessible representation, or expose summary statistics rather than every row."}:a?{status:"pass",message:a.length+" data points — a reasonable density for non-visual consumption."}:n?{status:"pass",message:n.length+" nodes — a reasonable density for non-visual consumption."}:{status:"manual",message:"Data not provided inline (push mode); verify density at runtime."}),r.push(i)}{const e=Array.isArray(t.data)?t.data:null,a=["valueFormat","yFormat","xFormat","tickFormat","format"].some(e=>"function"==typeof t[e]||"string"==typeof t[e]);let n=!1;if(e&&!a)for(const t of e.slice(0,50))if(t&&"object"==typeof t){for(const e of Object.values(t))if("number"==typeof e&&Number.isFinite(e)&&Math.abs(e)>=1e5){n=!0;break}if(n)break}n&&r.push({id:"assistive.human-readable-numbers",principle:"assistive",heuristic:"Data in text is not human-readable",critical:!1,status:"warn",message:'Data includes large numbers (≥ 100,000) and no value/tick formatter — screen readers will read every digit (e.g. "six hundred fifty thousand…").',fix:'Pass valueFormat / yFormat (e.g. a compact formatter so 6,500,000 reads as "6.5M"); the formatter flows to ticks, tooltips, and the data table.'})}r.push(Object.assign({id:"assistive.features-described",principle:"assistive",heuristic:"Visually apparent features and relationships are not described",critical:!1},i?{status:"pass",message:"ChartContainer's describe option auto-generates an L1–L3 description (chart type, statistics, and trend) via describeChart()."}:g?{status:"manual",message:"A summary is present. Confirm it describes trends, extrema, clusters, and outliers — not just what the chart is.",fix:"Cover the L2/L3 content blind readers value most: direction of trend, peak/trough, notable outliers."}:{status:"warn",message:"No text describes the visually apparent trends, extrema, or outliers.",fix:"Enable ChartContainer's describe option (auto-generates via describeChart()), or write a summary covering the key trend and notable points."})),r.push(Object.assign({id:"assistive.skippable-navigation",principle:"assistive",heuristic:"Navigation and interaction is tedious",critical:!0},c?{status:"not-applicable",message:"Single value — nothing to skip."}:u?{status:"pass",message:'A "Skip to data table" link lets screen-reader users bypass point-by-point navigation.'}:{status:"warn",message:"accessibleTable is off, removing the skip-to-table affordance.",fix:"Keep accessibleTable enabled so users can skip past dense point navigation."})),r.push({id:"flexible.user-style-respected",principle:"flexible",heuristic:"User style change not respected",critical:!0,status:m,message:`Styling flows through CSS custom properties and honors forced-colors mode, so user/user-agent style changes cascade in${b}.`,fix:n?"Avoid hardcoding colors via frameProps style fns that bypass theme variables.":void 0}),r.push(Object.assign({id:"flexible.reduced-motion",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1},Oe.has(e)||ze.has(e)?{status:"warn",message:e+" animates continuously. prefers-reduced-motion is auto-honored, but there's no in-chart pause/stop control for users who don't set that preference.",fix:"Offer a pause/stop control for looping/streaming motion (Chartability requires it for animation > 2s)."}:{status:m,message:`prefers-reduced-motion is auto-detected; transitions fast-forward and looping animation stops${b}.`}));{const a=!0===t.responsiveWidth||!0===t.responsiveHeight,n=Le.has(e)&&!0===t.zoomable;r.push(Object.assign({id:"flexible.zoom-reflow",principle:"flexible",heuristic:"Zoom and reflow are not supported",critical:!1},a?{status:"pass",message:`Chart reflows to its container (${[!0===t.responsiveWidth&&"responsiveWidth",!0===t.responsiveHeight&&"responsiveHeight"].filter(Boolean).join(", ")}), so page zoom doesn't clip it.`}:n?{status:"pass",message:"Geo chart is zoomable/pannable."}:{status:"manual",message:"Fixed width/height — verify the chart survives browser zoom and reflow without clipping or loss of function.",fix:"Use responsiveWidth/responsiveHeight so the chart reflows to its container."}))}const v=r.filter(e=>"not-applicable"!==e.status).filter(e=>e.critical),x={criticalsPassed:v.filter(e=>"pass"===e.status).length,criticalsEvaluated:v.length,fails:r.filter(e=>"fail"===e.status).length,warnings:r.filter(e=>"warn"===e.status).length,manual:r.filter(e=>"manual"===e.status).length,passes:r.filter(e=>"pass"===e.status).length};return{component:e,ok:!v.some(e=>"fail"===e.status),summary:x,findings:r,reference:"Chartability (POUR-CAF) — https://chartability.github.io/POUR-CAF/. Not a pass/fail cert; pair with manual screen-reader testing (NVDA+Firefox, JAWS+Chrome, VoiceOver+Safari)."}}function _e(e,{onlyCritical:t=!1}={}){const a=[];for(const r of e.findings)"fail"!==r.status&&"warn"!==r.status||t&&!r.critical||a.push(r.message);return a}const Ie={pass:"✓",fail:"✗",warn:"⚠",manual:"○","not-applicable":"·"},Ee=["perceivable","operable","understandable","robust","compromising","assistive","flexible"];function De(e){const t=[],a=e.summary,r=e.ok?`${a.criticalsPassed}/${a.criticalsEvaluated} critical heuristics pass`:`${a.fails} blocking failure(s) — ${a.criticalsPassed}/${a.criticalsEvaluated} critical heuristics pass`;t.push(`${e.ok?"✓":"✗"} ${e.component}: accessibility audit (Chartability POUR-CAF)`),t.push(` ${r} · ${a.warnings} warning(s) · ${a.manual} to verify manually`);for(const a of Ee){const r=e.findings.filter(e=>e.principle===a&&"not-applicable"!==e.status);if(0!==r.length){t.push(""),t.push(" "+a.toUpperCase());for(const e of r)t.push(` ${Ie[e.status]} ${e.id}${e.critical?" [critical]":""}: ${e.message}`),!e.fix||"fail"!==e.status&&"warn"!==e.status&&"manual"!==e.status||t.push(" → "+e.fix)}}return t.push(""),t.push(" Ref: "+e.reference),t.join("\n")}function qe(e,t){if("function"==typeof e)return t=>+e(t);const a=e||t;return e=>+e[a]}function Ue(e,t){if("function"==typeof e)return e;const a=e||t;return e=>e[a]}const He=new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),We=new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),Ge=new Set(["PieChart","DonutChart","FunnelChart"]),Ve=new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]);function Ye(e,t){var a,r;return We.has(e)||Ge.has(e)||"SwimlaneChart"===e||"GaugeChart"===e?{measure:t.valueAccessor,measureFallback:"value",dimension:null!==(a=t.categoryAccessor)&&void 0!==a?a:t.stepAccessor,dimensionFallback:"category"}:{measure:null!==(r=t.yAccessor)&&void 0!==r?r:t.valueAccessor,measureFallback:"y",dimension:t.xAccessor,dimensionFallback:"x"}}function Je(e){for(const t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){const a=e[t];if("string"==typeof a&&a)return a}}function Xe(e,t){return null==e?"—":e instanceof Date?e.toISOString().slice(0,10):"number"==typeof e?t(e):e+""}function Ke(e,t={}){var a,r;const n=!0===t.showRetractedAnnotations,o=!0===t.showSupersededAnnotations,i=new Set;for(const t of e){const e=null===(a=null==t?void 0:t.lifecycle)||void 0===a?void 0:a.supersedes;e&&"retracted"!==(null===(r=null==t?void 0:t.lifecycle)||void 0===r?void 0:r.status)&&i.add(e)}return e.filter(e=>{var t,a;if("retracted"===(null===(t=null==e?void 0:e.lifecycle)||void 0===t?void 0:t.status)&&!n)return!1;const r=null===(a=null==e?void 0:e.provenance)||void 0===a?void 0:a.stableId;return!(r&&i.has(r)&&!o)})}const Qe={LineChart:"line chart",AreaChart:"area chart",StackedAreaChart:"stacked area chart",DifferenceChart:"difference chart",Scatterplot:"scatter plot",BubbleChart:"bubble chart",ConnectedScatterplot:"connected scatter plot",QuadrantChart:"quadrant chart",MultiAxisLineChart:"dual-axis line chart",CandlestickChart:"candlestick chart",Heatmap:"heatmap",MinimapChart:"line chart",BarChart:"bar chart",StackedBarChart:"stacked bar chart",GroupedBarChart:"grouped bar chart",DotPlot:"dot plot",Histogram:"histogram",BoxPlot:"box plot",ViolinPlot:"violin plot",RidgelinePlot:"ridgeline plot",SwarmPlot:"swarm plot",PieChart:"pie chart",DonutChart:"donut chart",FunnelChart:"funnel chart",GaugeChart:"gauge",LikertChart:"Likert chart",SwimlaneChart:"swimlane chart",ForceDirectedGraph:"network graph",SankeyDiagram:"Sankey diagram",ProcessSankey:"temporal Sankey diagram",ChordDiagram:"chord diagram",TreeDiagram:"tree diagram",Treemap:"treemap",CirclePack:"circle-packing chart",OrbitDiagram:"orbit diagram",ChoroplethMap:"choropleth map",ProportionalSymbolMap:"proportional-symbol map",FlowMap:"flow map",DistanceCartogram:"distance cartogram",BigNumber:"single value"},Ze=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]);function et(e){return Qe[e]||e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()+" chart"}const tt=new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),at={"outlier-detection":"alerting","change-detection":"alerting",trend:"tracking","composition-over-time":"apportioning","compare-series":"comparing","compare-categories":"comparing",rank:"ranking","part-to-whole":"apportioning",distribution:"characterizing",correlation:"relating",flow:"tracing",hierarchy:"nesting",geo:"locating"},rt={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},nt=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],ot={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"};function it(e){return at[e]}function st(e,t){var a;const r=function(e){if(e){if("fits"in e||"buildProps"in e){const t=e,a={};for(const[e,r]of Object.entries(t.intentScores))"number"==typeof r&&Number.isFinite(r)&&(a[e]=r);return{family:t.family,intentScores:Object.keys(a).length?a:void 0}}return e}}(t);if(null==r?void 0:r.act)return r.act;if(null==r?void 0:r.intentScores){const e=function(e){let t,a=0;for(const[r,n]of Object.entries(e))if("number"==typeof n&&n>0)if(n>a)t=r,a=n;else if(n===a&&void 0!==t){const e=nt.indexOf(r),a=nt.indexOf(t);-1===e||-1!==a&&e>=a||(t=r)}return t}(r.intentScores);if(e&&at[e]&&(null!==(a=r.intentScores[e])&&void 0!==a?a:0)>=3)return at[e]}return(null==r?void 0:r.family)?rt[r.family]:function(e){return Ge.has(e)||"StackedAreaChart"===e?"apportioning":tt.has(e)?"relating":We.has(e)?"comparing":Ve.has(e)?"characterizing":He.has(e)?"tracking":Ze.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}(e)}function ct(e="en"){let t,a;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),a=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch(e){t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),a=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?1e4>Math.abs(e)?a.format(e):t.format(e):e+""}const lt={"y-threshold":"a threshold line","x-threshold":"a threshold line",band:"a highlighted band",label:"a label",callout:"a callout","callout-circle":"a callout","callout-rect":"a callout",text:"a text note",bracket:"a bracket",enclose:"an enclosure","rect-enclose":"an enclosure",highlight:"a highlight",widget:"a widget",trend:"a trend line",envelope:"an envelope","anomaly-band":"an anomaly band",forecast:"a forecast","category-highlight":"a category highlight"};function ut(e){const t=lt["string"==typeof e.type?e.type:"annotation"]||"an annotation",a=function(e){var t,a;const r=e.provenance&&"object"==typeof e.provenance?e.provenance:null,n=null!==(a=null!==(t=null==r?void 0:r.authorKind)&&void 0!==t?t:null==r?void 0:r.source)&&void 0!==a?a:null==r?void 0:r.basis;return"watcher"===n?"a watcher-flagged ":"agent"===n||"ai"===n||"llm-inference"===n?"an AI-suggested ":""}(e),r=a?a+t.replace(/^an? /,""):t,n="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return n?`${r} labeled "${n}"`:r}function dt(e,t,a={}){var r,n;const o=void 0!==a.levels,i=new Set(null!==(r=a.levels)&&void 0!==r?r:["l1","l2","l3"]);!o&&a.capability&&i.add("l4");const s=ct(null!==(n=a.locale)&&void 0!==n?n:"en"),c=et(e),l=Array.isArray(t.data)?t.data:null,u=Je(t),{measure:d,measureFallback:p,dimension:g,dimensionFallback:f}=Ye(e,t),y="string"==typeof d&&d?d:p,h="string"==typeof g&&g?g:f,m={};if(i.has("l1"))if(He.has(e)||We.has(e))m.l1=`A ${c} of ${y} by ${h}`+(u?`, split by ${u}.`:".");else if(Ge.has(e))m.l1=`A ${c} showing ${y} across ${h} categories.`;else if(Ve.has(e))m.l1=`A ${c} of the distribution of ${y}`+(u?` by ${u}.`:".");else if(Ze.has(e)){const e=Array.isArray(t.nodes)?t.nodes.length:void 0,a=Array.isArray(t.edges)?t.edges.length:void 0,r=[null!=e?`${e} ${gt(e,"node")}`:null,null!=a?`${a} ${gt(a,"edge")}`:null].filter(Boolean);m.l1=`A ${c}${r.length?" with "+r.join(" and "):""}.`}else if("BigNumber"===e){const e="string"==typeof t.label?t.label:y;m.l1=`A single value${e?" for "+e:""}.`}else m.l1=`A ${c}.`;const b=He.has(e)||We.has(e)||Ge.has(e)||Ve.has(e);let v=null;if((i.has("l2")||i.has("l3")||i.has("l4"))&&b&&l&&l.length>0&&(v=function(e,t,a,r){let n=0,o=0,i=1/0,s=-1/0,c=null,l=null,u=0,d=0,p=null,g=null,f=NaN,y=NaN;for(const a of e){const e=t(a);Number.isFinite(e)&&(0===n&&(f=e,p=a),y=e,g=a,i>e&&(i=e,c=a,u=n),e>s&&(s=e,l=a,d=n),n++,o+=e)}return 0===n?null:{count:n,min:i,max:s,mean:o/n,minLabel:Xe(null!=c?a(c):null,r),maxLabel:Xe(null!=l?a(l):null,r),first:f,last:y,firstLabel:Xe(null!=p?a(p):null,r),lastLabel:Xe(null!=g?a(g):null,r),minIndex:u,maxIndex:d}}(l,qe(d,p),Ue(g,f),s)),i.has("l2")&&b&&(l&&0!==l.length?v&&(m.l2=Ge.has(e)?`${v.count} segments totaling ${s(function(e){return e.mean*e.count}(v))}. Largest is ${v.maxLabel} at ${s(v.max)}; smallest is ${v.minLabel} at ${s(v.min)}.`:`${y} ranges from ${s(v.min)} (${v.minLabel}) to ${s(v.max)} (${v.maxLabel}), with a mean of ${s(v.mean)} across ${v.count} points.`):m.l2="No data is loaded yet."),i.has("l3")&&v&&He.has(e)?m.l3=function(e,t,a){const{first:r,last:n,min:o,max:i,maxLabel:s,minLabel:c,firstLabel:l,lastLabel:u,minIndex:d,maxIndex:p,count:g}=e,f=i-o,y=n-r;if(0===f)return`${pt(t)} is constant at ${a(r)} across the series.`;if(.04>f/(Math.abs(e.mean)||1))return`${pt(t)} ends roughly where it started (${a(r)} at ${l} to ${a(n)} at ${u}), ranging between ${a(o)} and ${a(i)}.`;const h=p>0&&g-1>p,m=d>0&&g-1>d,b=(i-Math.max(r,n))/f,v=(Math.min(r,n)-o)/f;return h&&b>.15?`Overall ${t} climbs to a peak of ${a(i)} (${s}), then falls to ${a(n)} (${u}).`:m&&v>.15?`Overall ${t} drops to a low of ${a(o)} (${c}), then recovers to ${a(n)} (${u}).`:.05>Math.abs(y)/f?`${pt(t)} ends roughly where it started (${a(r)} at ${l} to ${a(n)} at ${u}), ranging between ${a(o)} and ${a(i)}.`:y>0?p===g-1?`Overall ${t} rises from ${a(r)} (${l}) to a peak of ${a(n)} (${u}).`:`Overall ${t} rises from ${a(r)} (${l}) to ${a(n)} (${u}), after peaking at ${a(i)} (${s}).`:d===g-1?`Overall ${t} falls from ${a(r)} (${l}) to a low of ${a(n)} (${u}).`:`Overall ${t} falls from ${a(r)} (${l}) to ${a(n)} (${u}), after dipping to ${a(o)} (${c}).`}(v,y,s):i.has("l3")&&v&&We.has(e)&&(m.l3=`The highest ${h} is ${v.maxLabel} and the lowest is ${v.minLabel}.`),i.has("l4")){const r=st(e,a.capability);r&&(m.l4=function(e,t,a,r,n,o,i,s){const c=ot[e],l=/^[aeiou]/i.test(c)?"an":"a";let u,d;switch(e){case"locating":u="This is a map",d="read values by location";break;case"presenting":u="This is a single-value display",d=`read ${"string"==typeof a.label&&a.label?a.label:n} as the headline number`;break;case"tracing":u=`This is ${l} ${c} chart`,d="follow the movement between states";break;case"nesting":u=`This is ${l} ${c} chart`,d="read it for nested structure and how children sum into their parents";break;case"relating":u=`This is ${l} ${c} chart`,d=`read it for whether ${o} and ${n} move together`;break;default:u=`This is ${l} ${c} chart`,d=function(e,t,a,r,n,o){if(!t)switch(e){case"alerting":return"watch for points that break from the rest";case"tracking":return"read it for the overall direction of "+a;case"comparing":return`compare ${a} across ${r}`;case"ranking":return"read it top to bottom by "+a;case"apportioning":return`read each ${r}'s share of the whole`;case"characterizing":return"read it for the spread and shape of "+a;default:return"read the highlighted features"}switch(e){case"alerting":return function(e,t,a){if(We.has(a)||Ge.has(a))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;const{first:r,last:n,min:o,max:i,minLabel:s,maxLabel:c,lastLabel:l,minIndex:u,maxIndex:d,count:p}=e,g=i-o;if(g>0){const e=d>0&&p-1>d,a=u>0&&p-1>u,f=(i-Math.max(r,n))/g,y=(Math.min(r,n)-o)/g;if(e&&f>.15)return`the peak of ${t(i)} at ${c} is the point to investigate`;if(a&&y>.15)return`the dip to ${t(o)} at ${s} is the point to investigate`;if(n>=i)return`the climb to ${t(n)} at ${l} warrants a closer look`;if(o>=n)return`the drop to ${t(n)} at ${l} warrants a closer look`}return`the extremes — ${c} (${t(i)}) and ${s} (${t(o)}) — are the points to check`}(t,n,o);case"tracking":return`read it for the trajectory of ${a}, which ${function(e){const t=e.max-e.min,a=e.last-e.first;return 0===t||.05>Math.abs(a)/t?"holds roughly steady":a>0?"rises":"falls"}(t)} from ${n(t.first)} (${t.firstLabel}) to ${n(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${a} across ${r}; ${t.maxLabel} leads at ${n(t.max)}`;case"ranking":return`read it top to bottom by ${a}; ${t.maxLabel} ranks highest at ${n(t.max)}`;case"apportioning":{const e=t.mean*t.count,a=e>0?Math.round(t.max/e*100):null;return`read each ${r}'s share of the ${n(e)} total; ${t.maxLabel} is the largest at ${n(t.max)}${null!=a?` (${a}%)`:""}`}case"characterizing":return`read it for the spread of ${a}, from ${n(t.min)} to ${n(t.max)}`;default:return"read the highlighted features"}}(e,r,n,o,i,t)}return`${u}; ${d}.${function(e,t){var a;if(!t)return"";const r=null===(a=t.familiarity)||void 0===a?void 0:a[e];return"number"!=typeof r||r>2?"":` This ${et(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`}(t,s)}`}(r,e,t,v,y,h,s,a.audience))}const x=["l1","l2","l3","l4"].filter(e=>i.has(e)&&m[e]).map(e=>m[e]).join(" "),A=function(e){const t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;const a=Ke(t.filter(e=>!!e&&"object"==typeof e));if(0===a.length)return;const r=a.map(ut),n=r.slice(0,5),o=r.length-n.length,i=function(e){var t;return e.length>1?2===e.length?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`:null!==(t=e[0])&&void 0!==t?t:""}(n)+(o>0?`, and ${o} more`:""),s=a.length;return`The author has marked ${1===s?"one feature":s+" features"} on this chart: ${i}.`}(t);return Object.assign({text:A?`${A} ${x}`.trim():x,levels:m},A?{annotations:A}:{})}function pt(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function gt(e,t){return 1===e?t:t+"s"}function ft(e,t,a={}){var r,n,o;const i=null!==(r=a.locale)&&void 0!==r?r:"en",s=Math.max(1,null!==(n=a.maxLeaves)&&void 0!==n?n:200),c=ct(i),l={id:"root",role:"chart",label:dt(e,t,{locale:i}).text||"Chart.",level:1,children:[]},u=function(e,t){const a=Array.isArray(e.annotations)?e.annotations:null;if(!a)return null;const r=Ke(a.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return null;let n=0;const o=r.slice(0,t).map(e=>{var t;const a=null===(t=e.lifecycle)||void 0===t?void 0:t.status,r=a&&"accepted"!==a?` (${a})`:"";return{id:"annotation-"+n++,role:"annotation",level:3,label:`${o=ut(e),o?o.charAt(0).toUpperCase()+o.slice(1):o}${r}.`,datum:e};var o});r.length>t&&o.push({id:"annotation-"+n++,role:"annotation",level:3,label:`…and ${r.length-t} more annotations.`});const i=r.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===i?"one marked feature":i+" marked features"}.`,children:o}}(t,s),d=Array.isArray(t.data)?t.data:null,p=He.has(e)||We.has(e)||Ge.has(e)||Ve.has(e);if(!d||0===d.length||!p)return u&&(l.children=[u]),l;const{measure:g,measureFallback:f,dimension:y,dimensionFallback:h}=Ye(e,t),m=qe(g,f),b=Ue(y,h),v="string"==typeof g&&g?g:f,x="string"==typeof y&&y?y:h,A=Je(t);let w=0;const $=e=>`${e}-${w++}`,S=(e,t)=>{const a=e.slice(0,s).map(e=>((e,t)=>{const a=m(e),r=Xe(b(e),c);return{id:$("datum"),role:"datum",level:t,label:`${r}: ${Number.isFinite(a)?c(a):"—"}`,value:Number.isFinite(a)?a:void 0,datum:e}})(e,t));return e.length>s&&a.push({id:$("more"),role:"datum",level:t,label:`…and ${e.length-s} more points`}),a},k=[];if(He.has(e)||We.has(e)){let t=1/0,a=-1/0,r=1/0,n=-1/0;const o=[];let i=!0;for(const e of d){const s=m(e);Number.isFinite(s)&&(t>s&&(t=s),s>a&&(a=s));const c=b(e);o.push(c),"number"==typeof c&&Number.isFinite(c)?(r>c&&(r=c),c>n&&(n=c)):i=!1}const s=new Set,l=[];for(const e of o){const t=e+"";s.has(t)||(s.add(t),l.push(e))}const u=i?`${c(r)} to ${c(n)}`:`${Xe(l[0],c)} to ${Xe(l[l.length-1],c)} (${We.has(e)?l.length+" categories":d.length+" points"})`;k.push({id:$("axis"),role:"axis",level:2,label:`${We.has(e)?"Category axis":"X axis"}: ${x}, ${u}.`}),t>a||k.push({id:$("axis"),role:"axis",level:2,label:`Value axis: ${v}, ${c(t)} to ${c(a)}.`})}if(A){const a=Ue(A,A),r=new Map;for(const e of d){const t=(null!==(o=a(e))&&void 0!==o?o:"—")+"",n=r.get(t);n?n.push(e):r.set(t,[e])}const n=[];for(const[a,o]of r){const r=dt(e,Object.assign(Object.assign({},t),{data:o}),{levels:["l2","l3"],locale:i}).text;n.push({id:$("series"),role:"series",level:2,label:`Series ${a}: ${r}`,children:S(o,3)})}l.children=[...k,...n]}else l.children=[...k,...S(d,2)];return u&&l.children.push(u),l}function yt(e,t){const a=[],r=e=>{if(a.push(e),e.children&&e.children.length>0&&t.has(e.id))for(const t of e.children)r(t)};return r(e),a}function ht(e){let t=1;if(e.children)for(const a of e.children)t+=ht(a);return t}function mt(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(a[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);r.length>n;n++)0>t.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(a[r[n]]=e[r[n]])}return a}function bt(e,t,a,r){return new(a||(a=Promise))(function(n,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(i,s)}c((r=r.apply(e,t||[])).next())})}function vt(e,t,a={}){var r;const{capability:n,audience:o,locale:i}=a,s=null!==(r=a.levels)&&void 0!==r?r:["l1","l2","l3"],c=!1!==a.includeStructure,l=st(e,n),u=dt(e,t,{levels:l?[...s,"l4"]:s,locale:i,capability:n,audience:o}),d=u.levels,{l4:p}=d,g=mt(d,["l4"]),f=["l1","l2","l3"].map(e=>u.levels[e]).filter(Boolean).join(" "),y=Object.assign({levels:g,text:u.annotations?`${u.annotations} ${f}`.trim():f},u.annotations?{annotations:u.annotations}:{});let h;if(l&&p){const e=(m=n)?"fits"in m||"buildProps"in m?{family:m.family}:{family:m.family,intentScores:m.intentScores}:{};h={act:l,sentence:p,family:e.family,intentScores:e.intentScores}}var m;const b=c?ft(e,t,{maxLeaves:a.maxLeaves,locale:i}):void 0,v=[y.text,null==h?void 0:h.sentence].filter(Boolean).join(" ");return{component:e,description:y,intent:h,structure:b,text:v}}function xt(e,t=30){return Math.max((null!=e?e:4)+5,12,t)}"function"==typeof SuppressedError&&SuppressedError;const At=new Set(["tooltip","onObservation","xFormat","yFormat","valueFormat","svgAnnotationRules","tooltipContent","onHover","tickFormatTime","tickFormatValue","edgeSort","sortGroups","centerContent","frameProps","controls","oFormat","rFormat","oSort","pieceStyle","summaryStyle","nodeStyle","edgeStyle","customHoverBehavior","customClickBehavior","customDoubleClickBehavior","onBrush","onTopologyChange","backgroundGraphics","foregroundGraphics","legend"]),wt=new Set(["data","nodes","edges"]),$t="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e));function St(e,t,a){if(!te[e])throw Error(`Unknown component "${e}". Known components: ${Object.keys(te).join(", ")}`);const r=!1!==(null==a?void 0:a.includeData),n={};for(const[e,a]of Object.entries(t))null!=a&&(At.has(e)||!r&&wt.has(e)||"function"!=typeof a&&((null==a?void 0:a.$$typeof)||(n[e]=$t(a))));return Object.assign({component:e,props:n,version:"1",createdAt:(new Date).toISOString()},(null==a?void 0:a.selections)?{selections:a.selections}:{})}function kt(e){if(!e.component||!e.props)throw Error("Invalid chart config: missing component or props");if(!te[e.component])throw Error(`Unknown component "${e.component}". This config may require a newer version of semiotic.`);return{componentName:e.component,props:$t(e.props)}}function jt(e){const t=JSON.stringify(e);return"sc="+btoa(unescape(encodeURIComponent(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Ct(e){const t=new URLSearchParams(e.includes("?")?e.split("?")[1]:e).get("sc");if(!t)throw Error("No chart config found in URL (missing 'sc' parameter)");const a=t.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(escape(atob(a)));return JSON.parse(r)}function Ot(e){return bt(this,arguments,void 0,function*(e,t="json"){const a="jsx"===t?zt(e):JSON.stringify(e,null,2);if("undefined"==typeof navigator||!navigator.clipboard)throw Error("Clipboard API not available. copyConfig requires a browser environment.");yield navigator.clipboard.writeText(a)})}function zt(e){const{component:t,props:a}=e,r=["<"+t];for(const[e,t]of Object.entries(a))if("string"==typeof t)r.push(` ${e}="${t}"`);else if("boolean"==typeof t&&!0===t)r.push(" "+e);else if("boolean"==typeof t&&!1===t)r.push(` ${e}={false}`);else if("number"==typeof t)r.push(` ${e}={${t}}`);else{const a=JSON.stringify(t);r.push(80>a.length?` ${e}={${a}}`:` ${e}={${JSON.stringify(t,null,2)}}`)}return r.push("/>"),r.join("\n")}function Rt(e){const t={};for(const[a,r]of e){const e=[];for(const[,t]of r.clauses){const a={};for(const[e,r]of Object.entries(t.fields))a[e]="point"===r.type?{type:"point",values:Array.from(r.values)}:{type:"interval",range:r.range};e.push({clientId:t.clientId,type:t.type,fields:a})}t[a]={name:r.name,resolution:r.resolution,clauses:e}}return t}function Lt(e){const t=new Map;for(const[a,r]of Object.entries(e)){const e=new Map;for(const t of r.clauses){const a={};for(const[e,r]of Object.entries(t.fields))a[e]="point"===r.type?{type:"point",values:new Set(r.values)}:{type:"interval",range:r.range};e.set(t.clientId,{clientId:t.clientId,type:t.type,fields:a})}t.set(a,{name:r.name,resolution:r.resolution,clauses:e})}return t}function Ft(e,t){return bt(this,void 0,void 0,function*(){const{format:a="png",filename:r="chart",scale:n=2,background:o="white"}=t||{},i=e.querySelector("svg");if(!i)throw Error("No SVG element found in the container");const s=i.cloneNode(!0),c=i.getBoundingClientRect();if(s.getAttribute("width")||s.setAttribute("width",c.width+""),s.getAttribute("height")||s.setAttribute("height",c.height+""),s.getAttribute("xmlns")||s.setAttribute("xmlns","http://www.w3.org/2000/svg"),Pt(i,s),"svg"===a){const e=(new XMLSerializer).serializeToString(s);Nt(new Blob([e],{type:"image/svg+xml;charset=utf-8"}),r+".svg")}else{const t=c.width*n,a=c.height*n,i=document.createElement("canvas");i.width=t,i.height=a;const l=i.getContext("2d");l.fillStyle=o,l.fillRect(0,0,t,a),l.scale(n,n);const u=e.querySelector("canvas");u&&l.drawImage(u,0,0,c.width,c.height);const d=(new XMLSerializer).serializeToString(s),p=new Blob([d],{type:"image/svg+xml;charset=utf-8"}),g=URL.createObjectURL(p),f=new Image;f.width=c.width,f.height=c.height,yield new Promise((e,t)=>{f.onload=()=>{l.drawImage(f,0,0),i.toBlob(a=>{a?(Nt(a,r+".png"),e()):t(Error("Failed to create PNG blob"))},"image/png"),URL.revokeObjectURL(g)},f.onerror=()=>{URL.revokeObjectURL(g),t(Error("Failed to load SVG image"))},f.src=g})}})}function Pt(e,t){var a;const r=e.children,n=t.children,o=window.getComputedStyle(e),i=["fill","stroke","stroke-width","stroke-dasharray","opacity","fill-opacity","stroke-opacity","font-family","font-size","font-weight","text-anchor","dominant-baseline"];for(const e of i){const r=o.getPropertyValue(e);r&&"none"!==r&&""!==r&&(null===(a=t.style)||void 0===a||a.setProperty(e,r))}for(let e=0;Math.min(r.length,n.length)>e;e++)Pt(r[e],n[e])}function Nt(e,t){const a=URL.createObjectURL(e),r=document.createElement("a");r.href=a,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(a)}function Tt(e){return"nominal"===e||"ordinal"===e}function Bt(e){return"quantitative"===e||"temporal"===e}const Mt={category10:"category10",category20:"category20",category20b:"category20",category20c:"category20",accent:"accent",dark2:"dark2",paired:"paired",pastel1:"pastel1",pastel2:"pastel2",set1:"set1",set2:"set2",set3:"set3",tableau10:"category10",tableau20:"category20"},_t={linear:"linear","monotone-x":"monotoneX","monotone-y":"monotoneY",monotone:"monotoneX",step:"step","step-after":"stepAfter","step-before":"stepBefore",basis:"basis",cardinal:"cardinal","catmull-rom":"catmullRom"},It={sum:"sum",mean:"mean",average:"mean",count:"count",min:"min",max:"max",median:"mean"};function Et(e){var t,a,r,n,o,i,s,c,l,u,d,p;const g=[],{type:f,markProps:y}=function(e){if("string"==typeof e)return{type:e,markProps:{}};const{type:t}=e;return{type:t,markProps:mt(e,["type"])}}(e.mark),h=e.encoding||{},m=h.x,b=h.y,v=h.color,x=h.size,A=h.theta,w=h.opacity;let $;(null===(t=e.data)||void 0===t?void 0:t.values)?$=e.data.values:(null===(a=e.data)||void 0===a?void 0:a.url)&&g.push("data.url is not supported — only inline data.values can be translated. Provide data manually."),e.transform&&e.transform.length>0&&g.push("Vega-Lite transforms are not supported. Pre-transform your data before passing to fromVegaLite()."),e.layer&&g.push('Layered specs ("layer") are not supported. Only single-mark specs can be translated.'),(e.hconcat||e.vconcat||e.concat)&&g.push('Concatenated views ("hconcat"/"vconcat"/"concat") are not supported. Translate each sub-spec individually.'),(e.facet||h.facet||h.row||h.column)&&g.push("Faceted views are not supported. Use Semiotic's LinkedCharts or render multiple charts manually."),e.repeat&&g.push('Repeated views ("repeat") are not supported. Translate each field combination individually.'),(e.params||e.selection)&&g.push("Selections/params are not supported. Use Semiotic's LinkedCharts and selection props for interactivity.");const S={};e.width&&(S.width=e.width),e.height&&(S.height=e.height);const k=function(e){if(e)return"string"==typeof e?e:e.text}(e.title);if(k&&(S.title=k),(null==v?void 0:v.field)&&(S.colorBy=v.field,null===(r=v.scale)||void 0===r?void 0:r.scheme)){const e=Mt[v.scale.scheme];e&&(S.colorScheme=e)}void 0!==(null==w?void 0:w.value)&&(S.pointOpacity=w.value);const j=null==m?void 0:m.aggregate,C=null==b?void 0:b.aggregate;if($&&(j||C)){const e=C?b:m,t=C?m:b,a=It[e.aggregate];if(a&&(null==t?void 0:t.field)&&e.field)$=function(e,t){const{groupBy:a,value:r,agg:n="sum"}=t,o=new Map;for(const t of e){const e=t[a]+"";o.has(e)||o.set(e,[]),o.get(e).push(Number(t[r]))}const i=[];for(const[e,t]of o){let r;switch(n){case"count":r=t.length;break;case"mean":r=t.reduce((e,t)=>e+t,0)/t.length;break;case"min":r=Math.min(...t);break;case"max":r=Math.max(...t);break;default:r=t.reduce((e,t)=>e+t,0)}i.push({[a]:e,value:r})}return i}($,{groupBy:t.field,value:e.field,agg:a});else if(("count"===a||"count"===e.aggregate)&&(null==t?void 0:t.field)&&$){const e=new Map;for(const a of $){const r=a[t.field]+"";e.set(r,(e.get(r)||0)+1)}$=Array.from(e,([e,a])=>({[t.field]:e,value:a}))}}if((null==m?void 0:m.bin)||(null==b?void 0:b.bin)){const e="Histogram";$&&(S.data=$),(null==m?void 0:m.bin)?(S.valueAccessor=m.field,(null==b?void 0:b.field)&&(S.categoryAccessor=b.field),(null===(n=m.axis)||void 0===n?void 0:n.title)&&(S.valueLabel=m.axis.title)):(null==b?void 0:b.bin)&&(S.valueAccessor=b.field,(null==m?void 0:m.field)&&(S.categoryAccessor=m.field),(null===(o=b.axis)||void 0===o?void 0:o.title)&&(S.valueLabel=b.axis.title));const t=(null==m?void 0:m.bin)||(null==b?void 0:b.bin),a="object"==typeof t?t.maxbins:void 0;return a&&(S.bins=a),qt(e,S,g)}let O;switch(f){case"bar":O=function(e,t,a,r,n,o,i){var s,c,l,u,d,p;let g;return(null==a?void 0:a.field)&&!1!==(null==e?void 0:e.stack)&&!1!==(null==t?void 0:t.stack)&&null!==(null==e?void 0:e.stack)&&null!==(null==t?void 0:t.stack)?(g="StackedBarChart",r.stackBy=a.field):g="BarChart",Tt(null==e?void 0:e.type)&&Bt(null==t?void 0:t.type)?(r.categoryAccessor=e.field,r.valueAccessor=i?"value":t.field,(null===(s=null==e?void 0:e.axis)||void 0===s?void 0:s.title)&&(r.categoryLabel=e.axis.title),(null===(c=null==t?void 0:t.axis)||void 0===c?void 0:c.title)&&(r.valueLabel=t.axis.title)):Bt(null==e?void 0:e.type)&&Tt(null==t?void 0:t.type)?(r.categoryAccessor=t.field,r.valueAccessor=o?"value":e.field,r.orientation="horizontal",(null===(l=null==t?void 0:t.axis)||void 0===l?void 0:l.title)&&(r.categoryLabel=t.axis.title),(null===(u=null==e?void 0:e.axis)||void 0===u?void 0:u.title)&&(r.valueLabel=e.axis.title)):((null==e?void 0:e.field)&&(r.categoryAccessor=e.field),(null==t?void 0:t.field)&&(r.valueAccessor=i?"value":t.field),(null===(d=null==e?void 0:e.axis)||void 0===d?void 0:d.title)&&(r.categoryLabel=e.axis.title),(null===(p=null==t?void 0:t.axis)||void 0===p?void 0:p.title)&&(r.valueLabel=t.axis.title)),n&&(r.data=n),g}(m,b,v,S,$,j,C);break;case"line":if(O="LineChart",Dt(m,b,S,j,C),(null==v?void 0:v.field)&&(S.lineBy=v.field),y.interpolate){const e=_t[y.interpolate];e&&(S.curve=e)}!0===y.point&&(S.showPoints=!0),$&&(S.data=$);break;case"area":if((null==v?void 0:v.field)?(O="StackedAreaChart",S.areaBy=v.field):O="AreaChart",Dt(m,b,S,j,C),y.interpolate){const e=_t[y.interpolate];e&&(S.curve=e)}void 0!==y.opacity&&(S.areaOpacity=y.opacity),$&&(S.data=$);break;case"point":case"circle":case"square":(null==x?void 0:x.field)?(O="BubbleChart",S.sizeBy=x.field,(null===(i=x.scale)||void 0===i?void 0:i.range)&&(S.sizeRange=x.scale.range)):O="Scatterplot",Dt(m,b,S,j,C),$&&(S.data=$);break;case"rect":O="Heatmap",(null==m?void 0:m.field)&&(S.xAccessor=m.field),(null==b?void 0:b.field)&&(S.yAccessor=b.field),(null==v?void 0:v.field)&&(S.valueAccessor=v.field,delete S.colorBy),(null===(s=null==m?void 0:m.axis)||void 0===s?void 0:s.title)&&(S.xLabel=m.axis.title),(null===(c=null==b?void 0:b.axis)||void 0===c?void 0:c.title)&&(S.yLabel=b.axis.title),$&&(S.data=$);break;case"arc":y.innerRadius&&y.innerRadius>0?(O="DonutChart",S.innerRadius=y.innerRadius):O="PieChart",(null==A?void 0:A.field)?S.valueAccessor=A.field:(null==b?void 0:b.field)&&(S.valueAccessor=C?"value":b.field),(null==v?void 0:v.field)&&(S.categoryAccessor=v.field),(null==m?void 0:m.field)&&!(null==A?void 0:A.field)&&(S.categoryAccessor=m.field),$&&(S.data=$);break;case"tick":O="DotPlot",Tt(null==m?void 0:m.type)?(S.categoryAccessor=m.field,(null==b?void 0:b.field)&&(S.valueAccessor=C?"value":b.field),(null===(l=null==m?void 0:m.axis)||void 0===l?void 0:l.title)&&(S.categoryLabel=m.axis.title),(null===(u=null==b?void 0:b.axis)||void 0===u?void 0:u.title)&&(S.valueLabel=b.axis.title)):Tt(null==b?void 0:b.type)?(S.categoryAccessor=b.field,(null==m?void 0:m.field)&&(S.valueAccessor=j?"value":m.field),S.orientation="horizontal",(null===(d=null==b?void 0:b.axis)||void 0===d?void 0:d.title)&&(S.categoryLabel=b.axis.title),(null===(p=null==m?void 0:m.axis)||void 0===p?void 0:p.title)&&(S.valueLabel=m.axis.title)):((null==m?void 0:m.field)&&(S.categoryAccessor=m.field),(null==b?void 0:b.field)&&(S.valueAccessor=C?"value":b.field)),$&&(S.data=$);break;default:g.push(`Unsupported mark type "${f}". Defaulting to Scatterplot.`),O="Scatterplot",Dt(m,b,S,j,C),$&&(S.data=$)}return qt(O,S,g)}function Dt(e,t,a,r,n){var o,i;(null==e?void 0:e.field)&&(a.xAccessor=r?"value":e.field),(null==t?void 0:t.field)&&(a.yAccessor=n?"value":t.field),(null===(o=null==e?void 0:e.axis)||void 0===o?void 0:o.title)&&(a.xLabel=e.axis.title),(null===(i=null==t?void 0:t.axis)||void 0===i?void 0:i.title)&&(a.yLabel=t.axis.title)}function qt(e,t,a){const r={component:e,props:t,version:"1",createdAt:(new Date).toISOString()};if(a.length>0){r.warnings=a;for(const e of a)console.warn("[semiotic/fromVegaLite] "+e)}return r}class Ut{constructor(e){if(this._capacity=e,this.head=0,this._size=0,1>e)throw Error("RingBuffer capacity must be at least 1");this.buffer=Array(e)}push(e){let t;return this._size===this._capacity?t=this.buffer[this.head]:this._size++,this.buffer[this.head]=e,this.head=(this.head+1)%this._capacity,t}pushMany(e){const t=[];for(const a of e){const e=this.push(a);void 0!==e&&t.push(e)}return t}get(e){if(e>=0&&this._size>e)return this.buffer[(this.head-this._size+e+this._capacity)%this._capacity]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let e=0;return{next:()=>this._size>e?{done:!1,value:this.get(e++)}:{done:!0,value:void 0}}}forEach(e){const t=(this.head-this._size+this._capacity)%this._capacity;for(let a=0;this._size>a;a++)e(this.buffer[(t+a)%this._capacity],a)}toArray(){const e=Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let a=0;this._size>a;a++)e[a]=this.buffer[(t+a)%this._capacity];return e}resize(e){if(1>e)throw Error("RingBuffer capacity must be at least 1");const t=this.toArray(),a=[];for(;t.length>e;)a.push(t.shift());this._capacity=e,this.buffer=Array(e),this.head=0,this._size=0;for(const e of t)this.push(e);return a}update(e,t){const a=[],r=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;this._size>n;n++){const o=(r+n)%this._capacity,i=this.buffer[o];if(e(i)){let e;e="object"!=typeof i||null===i?i:Array.isArray(i)?[...i]:Object.assign({},i),a.push(e),this.buffer[o]=t(i)}}return a}remove(e){const t=[],a=[];if(this.forEach(r=>{e(r)?a.push(r):t.push(r)}),0===a.length)return a;this.buffer=Array(this._capacity),this.head=0,this._size=0;for(const e of t)this.push(e);return a}clear(){this.buffer=Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}}class Ht{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(e){Number.isFinite(e)&&(this._min>e&&(this._min=e),e>this._max&&(this._max=e))}evict(e){e!==this._min&&e!==this._max||(this._dirty=!0)}recalculate(e,t){this._min=1/0,this._max=-1/0;for(const a of e){const e=t?t(a):a;Number.isFinite(e)&&(this._min>e&&(this._min=e),e>this._max&&(this._max=e))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}}const Wt={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, white)",padding:"8px 12px",borderRadius:"var(--semiotic-tooltip-radius, 6px)",fontSize:"var(--semiotic-tooltip-font-size, 14px)",fontFamily:"var(--semiotic-font-family, inherit)",lineHeight:"1.5",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.15))",pointerEvents:"none",maxWidth:"300px",wordWrap:"break-word"};function Gt(e,t){return"function"==typeof t?t(e):e[t]}function Vt(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e){if(!Number.isFinite(e))return e+"";const t=Number.isInteger(e)?e:parseFloat(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():t+""}return e instanceof Date?e.toLocaleDateString():"object"==typeof e&&null!==e?void 0!==e.id?e.id+"":void 0!==e.name?e.name+"":JSON.stringify(e):e+""}function Yt(a={}){const{fields:r,title:n,format:o,style:i={},className:s=""}=a;return a=>{if(!a||"object"!=typeof a)return null;let c;const l=[];if(n){const e=Gt(a,n);c=Vt(e,o)}if(r&&r.length>0)r.forEach(e=>{let t,r,n;"string"==typeof e?(t=e,r=e,n=o):(t=e.label,r=e.accessor||e.key||"",n=e.format||o);const i=Gt(a,r);l.push({label:t,value:Vt(i,n)})});else if(!n){const e=["value","y","name","id","label"];for(const t of e)if(void 0!==a[t]){c=Vt(a[t],o);break}if(!c){const e=Object.keys(a).filter(e=>!e.startsWith("_"));e.length>0&&(c=Vt(a[e[0]],o))}}const u=Object.assign(Object.assign({},Wt),i);return t("div",{className:("semiotic-tooltip "+s).trim(),style:u,children:[c&&e("div",{style:{fontWeight:l.length>0?"bold":"normal"},children:c}),l.map((e,a)=>t("div",{style:{marginTop:0===a&&c?"4px":0},children:[e.label&&t("span",{children:[e.label,": "]}),e.value]},a))]})}}function Jt(){return a=>{var r,n,o,i,s,c,l;const u=a.allSeries;if(!u||0===u.length){const t=null!==(n=null===(r=a.data)||void 0===r?void 0:r.value)&&void 0!==n?n:null===(o=a.data)||void 0===o?void 0:o.y;return e("div",{className:"semiotic-tooltip",style:Wt,children:e("div",{children:Vt(t)})})}const d=null!==(c=null!==(i=a.xValue)&&void 0!==i?i:null===(s=a.data)||void 0===s?void 0:s.time)&&void 0!==c?c:null===(l=a.data)||void 0===l?void 0:l.x;return t("div",{className:"semiotic-tooltip",style:Wt,children:[null!=d&&e("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:Vt(d)}),u.map((a,r)=>t("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[e("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:a.color,flexShrink:0}}),e("span",{style:{flex:1,fontSize:"0.85em"},children:a.group}),e("span",{style:{fontWeight:500,fontSize:"0.85em"},children:Vt(a.value)})]},r))]})}}function Xt(t){if(!0!==t){if("function"==typeof t){const a=t;return t=>{var r;const n=(o=!0===(null==t?void 0:t.__semioticHoverData)||t&&void 0!==t.data&&"number"==typeof t.x&&"number"==typeof t.y&&t&&("node"===t.type||"edge"===t.type||void 0!==t.nodeOrEdge||void 0!==t.allSeries||void 0!==t.stats||void 0!==t.__chartType)?null!==(r=t.data)&&void 0!==r?r:{}:t,Array.isArray(o)?o[0]:o);var o;const i=a(n);return null==i?null:e("div",{className:"semiotic-tooltip",style:Wt,children:i})}}return!1!==t&&void 0!==t&&("object"==typeof t&&null!==t&&("fields"in t||"title"in t)?Yt(t):Yt())}}function Kt(e=240){const t=360-e,a=180+t/2,r=a*Math.PI/180;return{sweepRad:e*Math.PI/180,gapDeg:t,startAngleDeg:a,startAngleRad:r,offsetRad:-Math.PI/2+r}}function Qt(e,t,a,r,n){const o=a-t||1;return n+(Math.max(t,Math.min(a,e))-t)/o*r}function Zt(e=240){const{sweepRad:t,offsetRad:a}=Kt(e),r=[[Math.cos(a),Math.sin(a)],[Math.cos(a+t),Math.sin(a+t)],[0,0]];for(let e=0;2*Math.PI>e;e+=Math.PI/2)((e-a)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)>t+.001||r.push([Math.cos(e),Math.sin(e)]);const n=r.map(e=>e[0]),o=r.map(e=>e[1]),i=Math.min(...n),s=Math.max(...n),c=Math.min(...o),l=Math.max(...o);return{minX:i,maxX:s,minY:c,maxY:l,width:s-i,height:l-c,cx:(i+s)/2,cy:(c+l)/2}}const ea=Symbol("semiotic.useStreamStatus.wrapped");function ta(e={}){const{staleThresholdMs:t=5e3,pollIntervalMs:a=1e3}=e,o=r(null),[s,c]=l("idle"),[d,p]=l(null),g=n(()=>{const e={_frame:null,_origPush:null,_origPushMany:null};return{get current(){return e._frame},set current(t){const a=e._frame;if(a&&a!==t&&e._origPush&&e._origPushMany&&(a.push=e._origPush,a.pushMany=e._origPushMany,delete a[ea]),e._frame=t,!t)return e._origPush=null,void(e._origPushMany=null);if(t[ea])return;t[ea]=!0;const r=t.push,n=t.pushMany,o=r.bind(t),i=n.bind(t);e._origPush=r,e._origPushMany=n,t.push=e=>(f(),o(e)),t.pushMany=e=>(e&&e.length>0&&f(),i(e))}}},[]),f=i(()=>{const e="undefined"!=typeof performance?performance.now():Date.now();o.current=e,p(e),c(e=>"active"===e?e:"active")},[]);return u(()=>{const e=setInterval(()=>{const e=o.current;if(null==e)return;const a=("undefined"!=typeof performance?performance.now():Date.now())-e>t;c(e=>{const t=a?"stale":"active";return e===t?e:t})},a);return()=>clearInterval(e)},[t,a]),{ref:g,status:s,lastPushTime:d}}export{A as CARBON_ALERT,x as CARBON_CATEGORICAL_14,g as COLOR_BLIND_SAFE_CATEGORICAL,y as DARK_THEME,h as HIGH_CONTRAST_THEME,Ht as IncrementalExtent,f as LIGHT_THEME,Jt as MultiPointTooltip,Ut as RingBuffer,w as THEME_PRESETS,T as ThemeProvider,_e as accessibilityCaveats,D as adaptiveTimeTicks,Me as auditAccessibility,ft as buildNavigationTree,vt as buildReaderGrounding,it as communicativeActForIntent,Zt as computeArcBoundingBox,zt as configToJSX,Ot as copyConfig,ht as countNodes,W as createHatchPattern,q as darkenColor,dt as describeChart,Lt as deserializeSelections,$e as diagnoseConfig,Ft as exportChart,yt as flattenVisible,De as formatAccessibilityAudit,kt as fromConfig,Ct as fromURL,Et as fromVegaLite,xt as getHitRadius,U as lightenColor,Xt as normalizeTooltip,st as resolveCommunicativeAct,$ as resolveThemePreset,Rt as serializeSelections,M as smartTickFormat,Kt as sweepToAngles,S as themeToCSS,k as themeToTokens,St as toConfig,jt as toURL,z as useHighContrast,O as useReducedMotion,ta as useStreamStatus,B as useTheme,re as validateProps,Qt as valueToAngle};