diff --git a/.playwright-mcp/console-2026-05-07T01-42-43-218Z.log b/.playwright-mcp/console-2026-05-07T01-42-43-218Z.log index 7298485..22bf460 100644 --- a/.playwright-mcp/console-2026-05-07T01-42-43-218Z.log +++ b/.playwright-mcp/console-2026-05-07T01-42-43-218Z.log @@ -21,3 +21,30 @@ [ 807915ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 [ 809704ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 [ 809719ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1130928ms] [INFO] %cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools font-weight:bold @ http://localhost:5174/node_modules/.vite/deps/react-dom_client.js?v=2852bbef:20102 +[ 1131032ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1131104ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1131280ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1135080ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1159795ms] [INFO] %cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools font-weight:bold @ http://localhost:5174/node_modules/.vite/deps/react-dom_client.js?v=2852bbef:20102 +[ 1159877ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1159909ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1160035ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1161960ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1217476ms] [INFO] %cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools font-weight:bold @ http://localhost:5174/node_modules/.vite/deps/react-dom_client.js?v=2852bbef:20102 +[ 1217588ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1217664ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1217706ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1221050ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1222400ms] [INFO] %cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools font-weight:bold @ http://localhost:5174/node_modules/.vite/deps/react-dom_client.js?v=2852bbef:20102 +[ 1222501ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1222577ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1222714ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1251951ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1481087ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1606956ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1609277ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1610697ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 2630632ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 2682900ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 2683117ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 diff --git a/.playwright-mcp/console-2026-05-07T02-28-20-118Z.log b/.playwright-mcp/console-2026-05-07T02-28-20-118Z.log new file mode 100644 index 0000000..0ce97e5 --- /dev/null +++ b/.playwright-mcp/console-2026-05-07T02-28-20-118Z.log @@ -0,0 +1,30 @@ +[ 2749778ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 2749924ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 2949730ms] [INFO] %cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools font-weight:bold @ http://localhost:5174/node_modules/.vite/deps/react-dom_client.js?v=2852bbef:20102 +[ 2949812ms] Error: Target container is not a DOM element. + at exports.createRoot (http://localhost:5174/node_modules/.vite/deps/react-dom_client.js?v=2852bbef:20110:17) + at http://localhost:5174/src/main.tsx?t=1778123649466:8:1 +[ 2963427ms] [INFO] %cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools font-weight:bold @ http://localhost:5174/node_modules/.vite/deps/react-dom_client.js?v=2852bbef:20102 +[ 2963551ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 2963676ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 2963871ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 3837344ms] [INFO] %cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools font-weight:bold @ http://localhost:5174/node_modules/.vite/deps/react-dom_client.js?v=2852bbef:20102 +[ 3837478ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 3837562ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 3837717ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 4034117ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 4034271ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 4870001ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 4870144ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 4901299ms] [INFO] %cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools font-weight:bold @ http://localhost:5174/node_modules/.vite/deps/react-dom_client.js?v=2852bbef:20102 +[ 4901407ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 4901477ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 4901535ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 4911798ms] [INFO] %cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools font-weight:bold @ http://localhost:5174/node_modules/.vite/deps/react-dom_client.js?v=2852bbef:20102 +[ 4911890ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 4911967ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 4912020ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 5117456ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 5117598ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 5342970ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 5443217ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://localhost:5174/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 diff --git a/.playwright-mcp/console-2026-05-07T07-18-02-154Z.log b/.playwright-mcp/console-2026-05-07T07-18-02-154Z.log new file mode 100644 index 0000000..fb27704 --- /dev/null +++ b/.playwright-mcp/console-2026-05-07T07-18-02-154Z.log @@ -0,0 +1,5 @@ +[ 773ms] [INFO] %cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools font-weight:bold @ http://127.0.0.1:5173/node_modules/.vite/deps/react-dom_client.js?v=2852bbef:20102 +[ 893ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://127.0.0.1:5173/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1181ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://127.0.0.1:5173/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1214ms] [WARNING] AG Charts - Option `annotations.toolbar.buttons[0].value` cannot be set to `"statistic-select"`; expecting a keyword such as 'line-menu', 'fibonacci-menu', 'text-menu', 'shape-menu', 'measurer-menu', 'line', 'horizontal-line', 'vertical-line', 'parallel-channel', 'disjoint-channel', 'fibonacci-retracement', 'fibonacci-retracement-trend-based', 'text', 'comment', 'callout', 'note' or 'clear', ignoring. @ http://127.0.0.1:5173/node_modules/.vite/deps/chunk-XDC3NMYR.js?v=2852bbef:834 +[ 1220ms] [ERROR] Failed to load resource: the server responded with a status of 404 (Not Found) @ http://127.0.0.1:5173/favicon.ico:0 diff --git a/.playwright-mcp/page-2026-05-07T07-18-03-376Z.yml b/.playwright-mcp/page-2026-05-07T07-18-03-376Z.yml new file mode 100644 index 0000000..6c68a7a --- /dev/null +++ b/.playwright-mcp/page-2026-05-07T07-18-03-376Z.yml @@ -0,0 +1,59 @@ +- main [ref=e3]: + - generic: + - generic: 众为数字化管理平台 + - generic: 众为数字化管理平台 + - generic: 众为数字化管理平台 + - generic: 众为数字化管理平台 + - generic: 众为数字化管理平台 + - generic: 众为数字化管理平台 + - generic: 众为数字化管理平台 + - generic: 众为数字化管理平台 + - generic: 众为数字化管理平台 + - generic: 众为数字化管理平台 + - generic: 众为数字化管理平台 + - generic: 众为数字化管理平台 + - generic: 众为数字化管理平台 + - generic: 众为数字化管理平台 + - generic: 众为数字化管理平台 + - generic: 众为数字化管理平台 + - generic: 众为数字化管理平台 + - generic: 众为数字化管理平台 + - region "年度费用模板" [ref=e4]: + - region "年度总费用图表" [ref=e5]: + - generic [ref=e6]: + - button "纵坐标:造价(元)" [ref=e8] [cursor=pointer]: 造价(元) + - generic [ref=e9]: 请选择右侧分类项 + - button "全屏(F11)" [ref=e10] [cursor=pointer] + - generic [ref=e12]: + - figure "图表,共有0个系列": + - generic [ref=e13]: + - img "interactive chart": + - generic: + - img + - img + - region [ref=e14] + - toolbar "标注" [ref=e15]: + - button "均" [disabled] [ref=e16]: + - generic: 均 + - button "Line Tool" [disabled] [ref=e17] + - button "Text Tool" [disabled] [ref=e18] + - button "Shape Tool" [disabled] [ref=e19] + - button "Fibonacci Tool" [disabled] [ref=e20] + - button "Clear annotations" [disabled] [ref=e21] + - status: + - generic: 没有数据显示 + - toolbar "缩放" [ref=e22]: + - button "缩小" [disabled] [ref=e23] + - button "放大" [ref=e24] [cursor=pointer] + - button "左移" [disabled] [ref=e25] + - button "右移" [disabled] [ref=e26] + - button "重置" [disabled] [ref=e27] + - complementary "选择内容" [ref=e28]: + - tablist "选择内容切换项" [ref=e29]: + - tab "自然地理区位" [selected] [ref=e30] [cursor=pointer] + - tab "设施类别" [ref=e31] [cursor=pointer] + - tab "建设阶段" [ref=e32] [cursor=pointer] + - tab "规划形式" [ref=e33] [cursor=pointer] + - generic [ref=e34]: + - generic [ref=e35]: 自然地理区位 + - generic [ref=e36]: 加载中 \ No newline at end of file diff --git a/1.png b/1.png deleted file mode 100644 index cf107e6..0000000 Binary files a/1.png and /dev/null differ diff --git a/chart-after-icons.png b/chart-after-icons.png deleted file mode 100644 index 5076322..0000000 Binary files a/chart-after-icons.png and /dev/null differ diff --git a/chart-ag-native.png b/chart-ag-native.png deleted file mode 100644 index a7121aa..0000000 Binary files a/chart-ag-native.png and /dev/null differ diff --git a/chart-before.png b/chart-before.png deleted file mode 100644 index 58e80db..0000000 Binary files a/chart-before.png and /dev/null differ diff --git a/chart-controls-top.png b/chart-controls-top.png deleted file mode 100644 index f2166f3..0000000 Binary files a/chart-controls-top.png and /dev/null differ diff --git a/chart-native-fixed.png b/chart-native-fixed.png deleted file mode 100644 index 45b5bb4..0000000 Binary files a/chart-native-fixed.png and /dev/null differ diff --git a/chart-native-zoom-clicked.png b/chart-native-zoom-clicked.png deleted file mode 100644 index 8ad9a9b..0000000 Binary files a/chart-native-zoom-clicked.png and /dev/null differ diff --git a/chart-tools-fixed.png b/chart-tools-fixed.png deleted file mode 100644 index 009d8c1..0000000 Binary files a/chart-tools-fixed.png and /dev/null differ diff --git a/chart-tools.png b/chart-tools.png deleted file mode 100644 index 1df2932..0000000 Binary files a/chart-tools.png and /dev/null differ diff --git a/chart-zoomed.png b/chart-zoomed.png deleted file mode 100644 index a030982..0000000 Binary files a/chart-zoomed.png and /dev/null differ diff --git a/index.html b/index.html index ccbc682..4ed0f49 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ AG Chart Service -
+
diff --git a/left-toolbar-after.png b/left-toolbar-after.png deleted file mode 100644 index 57c0f6c..0000000 Binary files a/left-toolbar-after.png and /dev/null differ diff --git a/left-toolbar-before.png b/left-toolbar-before.png deleted file mode 100644 index 356719e..0000000 Binary files a/left-toolbar-before.png and /dev/null differ diff --git a/left-toolbar-reset-last-final.png b/left-toolbar-reset-last-final.png deleted file mode 100644 index 5598dbb..0000000 Binary files a/left-toolbar-reset-last-final.png and /dev/null differ diff --git a/left-toolbar-reset-last-fixed.png b/left-toolbar-reset-last-fixed.png deleted file mode 100644 index c907350..0000000 Binary files a/left-toolbar-reset-last-fixed.png and /dev/null differ diff --git a/left-toolbar-reset-last.png b/left-toolbar-reset-last.png deleted file mode 100644 index c907350..0000000 Binary files a/left-toolbar-reset-last.png and /dev/null differ diff --git a/metric-vertical-button.png b/metric-vertical-button.png deleted file mode 100644 index 3688c1e..0000000 Binary files a/metric-vertical-button.png and /dev/null differ diff --git a/src/App.tsx b/src/App.tsx index acd0196..f21cb5a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -31,8 +31,93 @@ const metricOptions = [ { key: 'usableArea', label: '使用面积指标(元/m²)' }, ] as const; +const contentOptions = [ + { key: 'geoLocation', label: '自然地理区位' }, + { key: 'facilityType', label: '设施类别' }, + { key: 'constructionStage', label: '建设阶段' }, + { key: 'planningForm', label: '规划形式' }, +] as const; + +const browserTreeDefaults = { + treetype: '256', + checkStrictly: 'true', + requestid: '-1', + workflowid: '181028', + wfid: '181028', + billid: '-1812', + isbill: '1', + f_weaver_belongto_userid: '267', + f_weaver_belongto_usertype: '0', + wf_isagent: '0', + wf_beagenter: '0', + wfTestStr: '', + viewtype: '1', + fromModule: 'workflow', + wfCreater: '267', + disabledConditionCache: 'true', + companyId: '1', +}; + +const contentTreeConfigs = { + geoLocation: { + endpoint: '/api/public/browser/data/256', + treeid: '94004', + fieldid: '305425', + defaultExpandedLevel: 1, + }, + facilityType: { + endpoint: '/api/public/browser/data/256', + treeid: '94005', + fieldid: '305426', + defaultExpandedLevel: 3, + }, + constructionStage: { + endpoint: '/api/public/browser/data/256', + treeid: '94007', + fieldid: '305428', + defaultExpandedLevel: 1, + }, + planningForm: { + endpoint: '/api/public/browser/data/256', + treeid: '94006', + fieldid: '305427', + defaultExpandedLevel: 1, + }, +} as const; + +const chartLineColors = ['#0078a8', '#d14d72', '#1f8f4d', '#d96f23', '#6b5cc8', '#0d7680', '#9a6b12', '#b24b38']; + +// const mockGeoLocationPayload = { +// checkStrictly: true, +// type: 3, +// datas: [ +// { +// allVersionIds: '', +// canClick: false, +// checkStrictly: true, +// dsporder: 0, +// icon: '', +// id: '95005_22', +// isImgIcon: false, +// isParent: true, +// linkUrl: '/formmode/search/CustomSearchOpenTree.jsp?pid=95005_22', +// name: '中国', +// pid: '0_0', +// selected: false, +// title: '中国', +// type: '2', +// }, +// ], +// iconSetting: { +// bgColor: '#96358a', +// icon: 'icon-coms-ModelingEngine', +// fontColor: '#fff', +// }, +// }; + type StatisticKey = (typeof statisticOptions)[number]['key']; type MetricKey = (typeof metricOptions)[number]['key']; +type ContentKey = (typeof contentOptions)[number]['key']; type GroupKey = 'year'; type ApiBuildingFunctionStat = { group_key?: string | number | null; @@ -51,9 +136,30 @@ type ChartDatum = { medianValue: number | null; dataCount: number | null; }; +type TreeNode = { + id: string; + label: string; + children: TreeNode[]; + hasChildren: boolean; + canClick: boolean; + expanded: boolean; + loading: boolean; + loaded: boolean; +}; +type SelectedContentNode = { + id: string; + contentKey: ContentKey; + label: string; + color: string; +}; function formatWan(value: number) { - return `${Math.round(value / 10000).toLocaleString('zh-CN')}万`; + const wanValue = value / 10000; + const fractionDigits = Math.abs(wanValue) < 1 ? 4 : 2; + return `${wanValue.toLocaleString('zh-CN', { + minimumFractionDigits: 0, + maximumFractionDigits: fractionDigits, + })}万`; } function normalizeStat(row: ApiBuildingFunctionStat): ChartDatum { @@ -67,44 +173,422 @@ function normalizeStat(row: ApiBuildingFunctionStat): ChartDatum { }; } +function buildQuery(params: Record) { + const search = new URLSearchParams(); + Object.entries(params).forEach(([key, value]) => { + if (value == null) return; + search.set(key, String(value)); + }); + search.set('currenttime', String(Date.now())); + search.set('__random__', String(Date.now())); + return search.toString(); +} + +function pickArray(payload: unknown): unknown[] { + if (Array.isArray(payload)) return payload; + if (!payload || typeof payload !== 'object') return []; + + const source = payload as Record; + const candidates = [ + source.datas, + source.data, + source.data && typeof source.data === 'object' ? (source.data as Record).datas : null, + source.data && typeof source.data === 'object' ? (source.data as Record).list : null, + source.data && typeof source.data === 'object' ? (source.data as Record).treeDatas : null, + source.result, + source.rows, + source.list, + source.treeDatas, + source.children, + ]; + + for (const candidate of candidates) { + if (Array.isArray(candidate)) return candidate; + } + return []; +} + +function readText(row: Record, keys: string[]) { + for (const key of keys) { + const value = row[key]; + if (value !== null && value !== undefined && String(value).trim()) { + return String(value); + } + } + return ''; +} + +function normalizeTreeRows(rows: unknown[]): TreeNode[] { + return rows + .filter((row): row is Record => !!row && typeof row === 'object') + .map((row, index) => { + const children = normalizeTreeRows(pickArray(row.children ?? row.childs ?? row.subs)); + const id = readText(row, ['id', 'key', 'value', 'nodeid', 'treeid', 'browserid']) || `node-${index}`; + const label = readText(row, ['name', 'label', 'title', 'text', 'showname', 'showName', 'browsername', 'displayName']) || id; + const hasChildren = + children.length > 0 || + row.hasChild === true || + row.haschild === true || + row.isParent === true || + row.isparent === true || + row.children === true || + row.child === true; + const canClick = row.canClick === true || row.canClick === 'true' || row.canclick === true || row.canclick === 'true'; + + return { + id, + label, + children, + hasChildren, + canClick, + expanded: children.length > 0, + loading: false, + loaded: children.length > 0, + }; + }); +} + +function updateNode(nodes: TreeNode[], nodeId: string, updater: (node: TreeNode) => TreeNode): TreeNode[] { + return nodes.map((node) => { + if (node.id === nodeId) return updater(node); + return { + ...node, + children: updateNode(node.children, nodeId, updater), + }; + }); +} + +function getSelectionKey(contentKey: ContentKey, nodeId: string) { + return `${contentKey}:${nodeId}`; +} + +function getSeriesValueKey(index: number) { + return `amount${index}`; +} + +function renderTreeNodes( + nodes: TreeNode[], + contentKey: ContentKey, + selectedNodeKeys: Set, + getNodeColor: (contentKey: ContentKey, nodeId: string) => string, + onToggle: (nodeId: string) => void, + onSelect: (node: TreeNode) => void, + depth = 0, +) { + return ( +
    + {nodes.map((node) => { + const selected = selectedNodeKeys.has(getSelectionKey(contentKey, node.id)); + const color = node.canClick ? getNodeColor(contentKey, node.id) : undefined; + + return ( +
  • +
    + {node.hasChildren ? ( + + ) : ( + + )} + + {node.loading ? 加载中 : null} +
    + {node.expanded && node.children.length > 0 + ? renderTreeNodes(node.children, contentKey, selectedNodeKeys, getNodeColor, onToggle, onSelect, depth + 1) + : null} +
  • + ); + })} +
+ ); +} + function App() { const workspaceRef = useRef(null); const chartFrameRef = useRef(null); + const treeInitialLoadStartedRef = useRef>({ + geoLocation: false, + facilityType: false, + constructionStage: false, + planningForm: false, + }); const [statisticKey, setStatisticKey] = useState('avgValue'); const [metricKey, setMetricKey] = useState('cost'); const [groupKey, setGroupKey] = useState('year'); const [statisticMenuOpen, setStatisticMenuOpen] = useState(false); const [metricMenuOpen, setMetricMenuOpen] = useState(false); - const [chartData, setChartData] = useState([]); - const [loading, setLoading] = useState(true); + const [activeContentKey, setActiveContentKey] = useState('geoLocation'); + const [treeByContent, setTreeByContent] = useState>({ + geoLocation: [], + facilityType: [], + constructionStage: [], + planningForm: [], + }); + const [treeLoadingByContent, setTreeLoadingByContent] = useState>({ + geoLocation: false, + facilityType: false, + constructionStage: false, + planningForm: false, + }); + const [treeErrorByContent, setTreeErrorByContent] = useState>({ + geoLocation: null, + facilityType: null, + constructionStage: null, + planningForm: null, + }); + const [selectedContentNodes, setSelectedContentNodes] = useState([]); + const [chartDataBySelection, setChartDataBySelection] = useState>({}); + const [chartQueryVersion, setChartQueryVersion] = useState(0); + const [loading, setLoading] = useState(false); const [loadError, setLoadError] = useState(null); const selectedStatistic = statisticOptions.find((option) => option.key === statisticKey) ?? statisticOptions[0]; const selectedMetric = metricOptions.find((option) => option.key === metricKey) ?? metricOptions[0]; + const activeContent = contentOptions.find((option) => option.key === activeContentKey) ?? contentOptions[0]; + const activeTree = treeByContent[activeContentKey]; + const selectedNodeKeys = useMemo( + () => new Set(selectedContentNodes.map((node) => getSelectionKey(node.contentKey, node.id))), + [selectedContentNodes], + ); + + const getNodeColor = (contentKey: ContentKey, nodeId: string) => { + const selectedIndex = selectedContentNodes.findIndex((node) => node.contentKey === contentKey && node.id === nodeId); + if (selectedIndex >= 0) return selectedContentNodes[selectedIndex].color; + + let hash = 0; + const key = getSelectionKey(contentKey, nodeId); + for (let index = 0; index < key.length; index += 1) { + hash = (hash * 31 + key.charCodeAt(index)) % chartLineColors.length; + } + return chartLineColors[hash]; + }; + + const fetchContentTree = async (contentKey: ContentKey, nodeId?: string) => { + const config = contentTreeConfigs[contentKey]; + if (!config) { + throw new Error('接口待接入'); + } + const treeParams = { + ...browserTreeDefaults, + treeid: config.treeid, + cube_treeid: config.treeid, + fieldid: config.fieldid, + }; + const params = nodeId + ? { + ...treeParams, + type: '2', + id: nodeId, + isVirtual: '', + } + : { + ...treeParams, + pageSize: '10', + current: '1', + min: '1', + max: '10', + }; + const response = await fetch(`${config.endpoint}?${buildQuery(params)}`, { + credentials: 'include', + headers: { + 'X-Requested-With': 'XMLHttpRequest', + }, + }); + if (!response.ok) { + throw new Error(`HTTP ${response.status}`); + } + return normalizeTreeRows(pickArray(await response.json())); + }; + + const loadContentTreeWithDefaultExpansion = async (contentKey: ContentKey) => { + const defaultExpandedLevel = contentTreeConfigs[contentKey]?.defaultExpandedLevel ?? 0; + const loadChildren = async (nodes: TreeNode[], level: number): Promise => { + if (level > defaultExpandedLevel) return nodes; + + return Promise.all( + nodes.map(async (node) => { + if (!node.hasChildren) return node; + + const children = node.loaded ? node.children : await fetchContentTree(contentKey, node.id); + return { + ...node, + children: await loadChildren(children, level + 1), + expanded: true, + loading: false, + loaded: true, + hasChildren: node.hasChildren || children.length > 0, + }; + }), + ); + }; + + return loadChildren(await fetchContentTree(contentKey), 1); + }; + + const toggleContentNode = (nodeId: string) => { + if (!contentTreeConfigs[activeContentKey]) return; + const target = activeTree.find((node) => node.id === nodeId); + const visit = (nodes: TreeNode[]): TreeNode | null => { + for (const node of nodes) { + if (node.id === nodeId) return node; + const matched = visit(node.children); + if (matched) return matched; + } + return null; + }; + const node = target ?? visit(activeTree); + if (!node?.hasChildren) return; + + setTreeByContent((current) => ({ + ...current, + [activeContentKey]: updateNode(current[activeContentKey], nodeId, (node) => ({ + ...node, + expanded: node.loaded ? !node.expanded : node.expanded, + loading: node.loaded ? node.loading : true, + })), + })); + + if (node.loaded) return; + + const currentContentKey = activeContentKey; + fetchContentTree(currentContentKey, nodeId) + .then((children) => { + setTreeByContent((current) => ({ + ...current, + [currentContentKey]: updateNode(current[currentContentKey], nodeId, (currentNode) => ({ + ...currentNode, + children, + expanded: true, + loading: false, + loaded: true, + hasChildren: currentNode.hasChildren || children.length > 0, + })), + })); + }) + .catch((error) => { + setTreeByContent((current) => ({ + ...current, + [currentContentKey]: updateNode(current[currentContentKey], nodeId, (currentNode) => ({ + ...currentNode, + loading: false, + })), + })); + setTreeErrorByContent((current) => ({ + ...current, + [currentContentKey]: error instanceof Error ? error.message : '加载失败', + })); + }); + }; + + const toggleSelectedContentNode = (node: TreeNode) => { + const contentKey = activeContentKey; + setSelectedContentNodes((current) => { + const selectionKey = getSelectionKey(contentKey, node.id); + const existingIndex = current.findIndex((item) => getSelectionKey(item.contentKey, item.id) === selectionKey); + if (existingIndex >= 0) { + setChartDataBySelection((data) => { + const { [selectionKey]: _removed, ...rest } = data; + return rest; + }); + return current.filter((_, index) => index !== existingIndex); + } + + const usedColors = new Set(current.map((item) => item.color)); + const color = chartLineColors.find((item) => !usedColors.has(item)) ?? chartLineColors[current.length % chartLineColors.length]; + return [...current, { id: node.id, contentKey, label: node.label, color }]; + }); + }; + + const updateMetricKey = (nextMetricKey: MetricKey) => { + setMetricKey(nextMetricKey); + setChartDataBySelection({}); + setChartQueryVersion((version) => version + 1); + }; + + useEffect(() => { + if (!contentTreeConfigs[activeContentKey]) return; + if (treeByContent[activeContentKey].length > 0 || treeInitialLoadStartedRef.current[activeContentKey]) return; + + const currentContentKey = activeContentKey; + treeInitialLoadStartedRef.current[currentContentKey] = true; + setTreeLoadingByContent((current) => ({ ...current, [currentContentKey]: true })); + setTreeErrorByContent((current) => ({ ...current, [currentContentKey]: null })); + + loadContentTreeWithDefaultExpansion(currentContentKey) + .then((nodes) => { + setTreeByContent((current) => ({ ...current, [currentContentKey]: nodes })); + }) + .catch((error) => { + treeInitialLoadStartedRef.current[currentContentKey] = false; + setTreeErrorByContent((current) => ({ + ...current, + [currentContentKey]: error instanceof Error ? error.message : '加载失败', + })); + }) + .finally(() => { + setTreeLoadingByContent((current) => ({ ...current, [currentContentKey]: false })); + }); + }, [activeContentKey, treeByContent]); useEffect(() => { const controller = new AbortController(); async function loadStats() { + if (selectedContentNodes.length === 0) { + setChartDataBySelection({}); + setLoading(false); + setLoadError(null); + return; + } + setLoading(true); setLoadError(null); try { - const search = new URLSearchParams({ - groupBy: groupKey, - metric: metricKey, - }); - const response = await fetch(`${API_BASE_URL}/zw/getBuildingFunctionCostStats?${search.toString()}`, { - signal: controller.signal, - }); - if (!response.ok) { - throw new Error(`HTTP ${response.status}`); + const missingNodes = selectedContentNodes.filter((node) => !chartDataBySelection[getSelectionKey(node.contentKey, node.id)]); + if (missingNodes.length === 0) { + setLoading(false); + return; } - const payload = (await response.json()) as { data?: ApiBuildingFunctionStat[] }; - setChartData((payload.data ?? []).map(normalizeStat).slice(0, 36)); + + const results = await Promise.all( + missingNodes.map(async (node) => { + const search = new URLSearchParams({ + groupBy: groupKey, + metric: metricKey, + contentKey: node.contentKey, + nodeId: node.id, + }); + const response = await fetch(`${API_BASE_URL}/zw/getBuildingFunctionCostStats?${search.toString()}`, { + signal: controller.signal, + }); + if (!response.ok) { + throw new Error(`HTTP ${response.status}`); + } + const payload = (await response.json()) as { data?: ApiBuildingFunctionStat[] }; + return [getSelectionKey(node.contentKey, node.id), (payload.data ?? []).map(normalizeStat).slice(0, 36)] as const; + }), + ); + setChartDataBySelection((current) => ({ + ...current, + ...Object.fromEntries(results), + })); } catch (error) { if (controller.signal.aborted) return; setLoadError(error instanceof Error ? error.message : '接口请求失败'); - setChartData([]); + setChartDataBySelection({}); } finally { if (!controller.signal.aborted) { setLoading(false); @@ -117,7 +601,7 @@ function App() { return () => { controller.abort(); }; - }, [groupKey, metricKey]); + }, [chartDataBySelection, chartQueryVersion, groupKey, metricKey, selectedContentNodes]); useEffect(() => { const frame = chartFrameRef.current; @@ -126,7 +610,6 @@ function App() { const getFullscreenButton = () => frame.querySelector('.chart-fullscreen-button'); const getStatisticButton = () => frame.querySelector('.ag-charts-myButton-statistic')?.closest('.ag-charts-toolbar__button'); - const syncToolbarButtons = () => { const button = getFullscreenButton(); if (button) { @@ -145,6 +628,7 @@ function App() { const statisticButton = getStatisticButton(); if (statisticButton) { statisticButton.classList.add('chart-statistic-button'); + statisticButton.setAttribute('aria-expanded', String(statisticMenuOpen)); } }; @@ -177,6 +661,7 @@ function App() { event.preventDefault(); event.stopPropagation(); + event.stopImmediatePropagation(); if (button.classList.contains('chart-statistic-button')) { setMetricMenuOpen(false); setStatisticMenuOpen((open) => !open); @@ -196,6 +681,7 @@ function App() { event.preventDefault(); event.stopPropagation(); + event.stopImmediatePropagation(); if (button.classList.contains('chart-statistic-button')) { setMetricMenuOpen(false); setStatisticMenuOpen((open) => !open); @@ -227,14 +713,28 @@ function App() { frame.removeEventListener('keydown', handleToolbarKeyDown, true); observer.disconnect(); }; - }, []); + }, [statisticMenuOpen]); const chartOptions = useMemo(() => { const isCount = statisticKey === 'dataCount'; - const visibleData = chartData.map((datum) => ({ - groupName: datum.groupName, - amount: datum[statisticKey], - })); + const groupNames: string[] = []; + const groupNameSeen = new Set(); + selectedContentNodes.forEach((node) => { + const rows = chartDataBySelection[getSelectionKey(node.contentKey, node.id)] ?? []; + rows.forEach((datum) => { + if (groupNameSeen.has(datum.groupName)) return; + groupNameSeen.add(datum.groupName); + groupNames.push(datum.groupName); + }); + }); + const visibleData = groupNames.map((groupName) => { + const row: Record = { groupName }; + selectedContentNodes.forEach((node, index) => { + const datum = chartDataBySelection[getSelectionKey(node.contentKey, node.id)]?.find((item) => item.groupName === groupName); + row[getSeriesValueKey(index)] = datum?.[statisticKey] ?? null; + }); + return row; + }); return { theme: { @@ -290,7 +790,7 @@ function App() { toolbar: { buttons: ([ { - value: 'statistic-select', + value: 'note', tooltip: '切换统计指标', label: `${selectedStatistic.shortLabel}`, }, @@ -322,25 +822,23 @@ function App() { ] as unknown as NonNullable['toolbar']>['buttons']), }, }, - series: [ - { - type: 'line', - xKey: 'groupName', - yKey: 'amount', - yName: `${selectedMetric.label} ${selectedStatistic.label}`, - stroke: '#0078a8', - strokeWidth: 2, - marker: { - enabled: true, - fill: '#0078a8', - stroke: '#0078a8', - size: 5, - }, - interpolation: { - type: 'smooth', - }, + series: selectedContentNodes.map((node, index) => ({ + type: 'line', + xKey: 'groupName', + yKey: getSeriesValueKey(index), + yName: `${node.label} ${selectedStatistic.label}`, + stroke: node.color, + strokeWidth: 2, + marker: { + enabled: true, + fill: node.color, + stroke: node.color, + size: 5, }, - ], + interpolation: { + type: 'smooth', + }, + })), axes: { x: { type: 'category', @@ -398,13 +896,13 @@ function App() { }, }, legend: { - enabled: false, + enabled: selectedContentNodes.length > 1, }, tooltip: { enabled: true, }, }; - }, [chartData, selectedMetric.label, selectedStatistic.label, statisticKey]); + }, [chartDataBySelection, selectedContentNodes, selectedMetric.label, selectedStatistic.label, statisticKey]); return (
@@ -461,7 +959,7 @@ function App() { key={option.key} aria-current={option.key === metricKey} onClick={() => { - setMetricKey(option.key); + updateMetricKey(option.key); setMetricMenuOpen(false); }} > @@ -471,7 +969,9 @@ function App() { ) : null} - {loading || loadError ?
{loading ? '加载中' : loadError}
: null} + {loading || loadError || selectedContentNodes.length === 0 ? ( +
{loading ? '加载中' : loadError || '请选择右侧分类项'}
+ ) : null} @@ -479,7 +979,34 @@ function App() { -
); diff --git a/src/main.tsx b/src/main.tsx index 84bd146..9810412 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -6,8 +6,34 @@ import './styles.css'; ModuleRegistry.registerModules([AllCommunityModule]); -createRoot(document.getElementById('root')!).render( - - - , -); +declare global { + interface Window { + __zbChartRoot?: ReturnType; + } +} + +const mount = () => { + const container = document.getElementById('zbChart'); + if (!container) return false; + + window.__zbChartRoot ??= createRoot(container); + window.__zbChartRoot.render( + + + , + ); + return true; +}; + +if (!mount()) { + let retryCount = 0; + const timer = window.setInterval(() => { + retryCount += 1; + if (mount() || retryCount >= 40) { + window.clearInterval(timer); + if (retryCount >= 40) { + console.warn('zbChart container was not found.'); + } + } + }, 50); +} diff --git a/src/styles.css b/src/styles.css index b084daf..f3e67f7 100644 --- a/src/styles.css +++ b/src/styles.css @@ -176,7 +176,7 @@ button { height: calc(100vh - 26px); } -.workspace:fullscreen .right-placeholder { +.workspace:fullscreen .right-panel { display: block; min-width: 0; height: 100%; @@ -252,6 +252,17 @@ button { background: rgba(255, 252, 248, 0.94); } +.chart-frame .chart-statistic-button { + color: #46413b; +} + +.chart-frame .chart-statistic-button[aria-expanded="true"] { + color: #0078a8; + border-color: rgba(0, 120, 168, 0.36); + background: rgba(255, 252, 248, 0.94); + box-shadow: 0 1px 5px rgba(69, 54, 36, 0.12); +} + .metric-switcher { position: absolute; left: 74px; @@ -481,9 +492,177 @@ button { opacity: 0.38; } -.right-placeholder { +.right-panel { + display: grid; + grid-template-rows: auto minmax(0, 1fr); min-width: 0; height: 100%; + max-height: 100%; + padding-top: 24px; + overflow: hidden; +} + +.content-tabs { + display: flex; + align-items: center; + gap: 6px; + min-width: 0; + padding-bottom: 12px; +} + +.content-tab { + height: 32px; + padding: 0 12px; + border: 1px solid rgba(90, 82, 72, 0.18); + border-radius: 3px; + color: #46413b; + background: rgba(255, 249, 241, 0.62); + font-size: 14px; + line-height: 30px; + white-space: nowrap; + cursor: pointer; +} + +.content-tab:hover, +.content-tab[aria-selected="true"] { + color: #0078a8; + border-color: rgba(0, 120, 168, 0.36); + background: rgba(255, 252, 248, 0.94); + box-shadow: 0 1px 5px rgba(69, 54, 36, 0.12); +} + +.content-tree-panel { + min-width: 0; + min-height: 0; + max-height: 100%; + overflow-y: auto; + overflow-x: hidden; + padding: 14px 6px 14px 0; + border-top: 1px solid rgba(90, 82, 72, 0.14); +} + +.content-tree-title { + margin-bottom: 12px; + color: #262a33; + font-size: 18px; + font-weight: 600; + line-height: 24px; +} + +.content-tree-list { + margin: 0; + padding: 0; + list-style: none; +} + +.content-tree-node { + margin: 0; + padding: 0; +} + +.content-tree-row { + display: flex; + align-items: center; + width: 100%; + min-height: 42px; + border-radius: 3px; + color: #262a33; + background: transparent; + font-size: 17px; + line-height: 42px; + text-align: left; +} + +.content-tree-row:hover { + color: #0078a8; + background: rgba(255, 252, 248, 0.74); +} + +.content-tree-caret { + display: inline-grid; + width: 24px; + height: 24px; + place-items: center; + flex: 0 0 24px; + padding: 0; + border: 0; + color: #6f665e; + background: transparent; + font-size: 15px; + line-height: 24px; + cursor: pointer; +} + +.content-tree-caret.is-leaf { + color: transparent; + cursor: default; +} + +.content-tree-select { + display: flex; + align-items: center; + min-width: 0; + flex: 1 1 auto; + gap: 10px; + height: 38px; + padding: 0 6px 0 2px; + border: 0; + border-radius: 3px; + color: inherit; + background: transparent; + text-align: left; + cursor: pointer; +} + +.content-tree-select:disabled { + cursor: default; +} + +.content-tree-select:hover, +.content-tree-select[aria-pressed="true"] { + color: #0078a8; + background: rgba(255, 252, 248, 0.78); +} + +.content-tree-select:disabled:hover { + color: inherit; + background: transparent; +} + +.content-tree-select[aria-pressed="true"] { + font-weight: 600; +} + +.content-tree-series-mark { + width: 24px; + height: 4px; + flex: 0 0 24px; + border-radius: 2px; + opacity: 0.55; +} + +.content-tree-select[aria-pressed="true"] .content-tree-series-mark { + opacity: 1; +} + +.content-tree-label { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.content-tree-loading { + margin-left: 8px; + color: #7a7067; + font-size: 14px; +} + +.content-tree-empty { + padding: 16px 0; + color: #7a7067; + font-size: 17px; + line-height: 24px; } @media (max-width: 900px) { @@ -502,7 +681,11 @@ button { min-height: 520px; } - .right-placeholder { + .right-panel { min-height: 280px; } + + .content-tabs { + flex-wrap: wrap; + } } diff --git a/vite-dev.log b/vite-dev.log index 8a61b15..5c73de4 100644 --- a/vite-dev.log +++ b/vite-dev.log @@ -64,3 +64,37 @@ Port 5173 is in use, trying another one... 09:35:53 [vite] (client) hmr update /src/App.tsx 09:35:53 [vite] (client) hmr update /src/styles.css 09:36:43 [vite] (client) hmr update /src/App.tsx +09:40:50 [vite] (client) hmr update /src/App.tsx +09:41:06 [vite] (client) hmr update /src/styles.css +09:42:18 [vite] (client) hmr update /src/styles.css +09:55:02 [vite] (client) hmr update /src/App.tsx +09:55:36 [vite] (client) hmr update /src/App.tsx +09:55:49 [vite] (client) hmr update /src/styles.css +10:07:23 [vite] (client) hmr update /src/App.tsx +10:26:33 [vite] (client) hmr update /src/App.tsx +10:27:25 [vite] (client) hmr update /src/App.tsx +10:27:56 [vite] (client) hmr update /src/styles.css +11:14:09 [vite] (client) hmr update /src/App.tsx +11:16:09 [vite] (client) page reload zbChart/index.html +11:17:29 [vite] (client) page reload index.html +11:17:43 [vite] (client) page reload src/main.tsx +11:32:17 [vite] (client) page reload src/main.tsx +11:35:33 [vite] (client) hmr update /src/App.tsx +11:35:45 [vite] (client) hmr update /src/styles.css +11:49:29 [vite] (client) hmr update /src/App.tsx +11:52:03 [vite] (client) hmr update /src/styles.css +11:53:37 [vite] (client) hmr update /src/App.tsx +11:57:22 [vite] (client) hmr update /src/App.tsx +11:59:02 [vite] (client) hmr update /src/App.tsx +15:00:25 [vite] (client) hmr update /src/App.tsx +15:14:46 [vite] (client) hmr update /src/App.tsx +15:14:56 [vite] (client) hmr update /src/App.tsx +15:15:05 [vite] (client) hmr update /src/App.tsx +15:15:18 [vite] (client) hmr update /src/App.tsx +15:15:29 [vite] (client) hmr update /src/App.tsx +15:15:39 [vite] (client) hmr update /src/App.tsx +15:15:49 [vite] (client) hmr update /src/styles.css +15:54:06 [vite] (client) hmr update /src/App.tsx +15:54:29 [vite] (client) hmr update /src/styles.css +16:29:28 [vite] (client) hmr update /src/App.tsx +16:29:37 [vite] (client) hmr update /src/App.tsx diff --git a/zbChart/assets/index-BBo2g0gG.js b/zbChart/assets/index-BBo2g0gG.js new file mode 100644 index 0000000..fe32727 --- /dev/null +++ b/zbChart/assets/index-BBo2g0gG.js @@ -0,0 +1,42 @@ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function i(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(s){if(s.ep)return;s.ep=!0;const a=i(s);fetch(s.href,a)}})();var sC={exports:{}},wy={};var oz;function W6(){if(oz)return wy;oz=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function i(n,s,a){var o=null;if(a!==void 0&&(o=""+a),s.key!==void 0&&(o=""+s.key),"key"in s){a={};for(var r in s)r!=="key"&&(a[r]=s[r])}else a=s;return s=a.ref,{$$typeof:t,type:n,key:o,ref:s!==void 0?s:null,props:a}}return wy.Fragment=e,wy.jsx=i,wy.jsxs=i,wy}var rz;function K6(){return rz||(rz=1,sC.exports=W6()),sC.exports}var si=K6(),aC={exports:{}},re={};var lz;function Y6(){if(lz)return re;lz=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),r=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),g=Symbol.iterator;function f(G){return G===null||typeof G!="object"?null:(G=g&&G[g]||G["@@iterator"],typeof G=="function"?G:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,S={};function D(G,et,st){this.props=G,this.context=et,this.refs=S,this.updater=st||y}D.prototype.isReactComponent={},D.prototype.setState=function(G,et){if(typeof G!="object"&&typeof G!="function"&&G!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,G,et,"setState")},D.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function A(){}A.prototype=D.prototype;function I(G,et,st){this.props=G,this.context=et,this.refs=S,this.updater=st||y}var w=I.prototype=new A;w.constructor=I,x(w,D.prototype),w.isPureReactComponent=!0;var N=Array.isArray;function O(){}var L={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function P(G,et,st){var lt=st.ref;return{$$typeof:t,type:G,key:et,ref:lt!==void 0?lt:null,props:st}}function B(G,et){return P(G.type,et,G.props)}function F(G){return typeof G=="object"&&G!==null&&G.$$typeof===t}function H(G){var et={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(st){return et[st]})}var $=/\/+/g;function Y(G,et){return typeof G=="object"&&G!==null&&G.key!=null?H(""+G.key):et.toString(36)}function U(G){switch(G.status){case"fulfilled":return G.value;case"rejected":throw G.reason;default:switch(typeof G.status=="string"?G.then(O,O):(G.status="pending",G.then(function(et){G.status==="pending"&&(G.status="fulfilled",G.value=et)},function(et){G.status==="pending"&&(G.status="rejected",G.reason=et)})),G.status){case"fulfilled":return G.value;case"rejected":throw G.reason}}throw G}function V(G,et,st,lt,mt){var Dt=typeof G;(Dt==="undefined"||Dt==="boolean")&&(G=null);var kt=!1;if(G===null)kt=!0;else switch(Dt){case"bigint":case"string":case"number":kt=!0;break;case"object":switch(G.$$typeof){case t:case e:kt=!0;break;case u:return kt=G._init,V(kt(G._payload),et,st,lt,mt)}}if(kt)return mt=mt(G),kt=lt===""?"."+Y(G,0):lt,N(mt)?(st="",kt!=null&&(st=kt.replace($,"$&/")+"/"),V(mt,et,st,"",function(ae){return ae})):mt!=null&&(F(mt)&&(mt=B(mt,st+(mt.key==null||G&&G.key===mt.key?"":(""+mt.key).replace($,"$&/")+"/")+kt)),et.push(mt)),1;kt=0;var Vt=lt===""?".":lt+":";if(N(G))for(var Kt=0;Kt>>1,nt=V[q];if(0>>1;qs(st,W))lts(mt,st)?(V[q]=mt,V[lt]=W,q=lt):(V[q]=st,V[et]=W,q=et);else if(lts(mt,W))V[q]=mt,V[lt]=W,q=lt;else break t}}return Z}function s(V,Z){var W=V.sortIndex-Z.sortIndex;return W!==0?W:V.id-Z.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var o=Date,r=o.now();t.unstable_now=function(){return o.now()-r}}var l=[],c=[],u=1,d=null,g=3,f=!1,y=!1,x=!1,S=!1,D=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function w(V){for(var Z=i(c);Z!==null;){if(Z.callback===null)n(c);else if(Z.startTime<=V)n(c),Z.sortIndex=Z.expirationTime,e(l,Z);else break;Z=i(c)}}function N(V){if(x=!1,w(V),!y)if(i(l)!==null)y=!0,O||(O=!0,H());else{var Z=i(c);Z!==null&&U(N,Z.startTime-V)}}var O=!1,L=-1,R=5,P=-1;function B(){return S?!0:!(t.unstable_now()-PV&&B());){var q=d.callback;if(typeof q=="function"){d.callback=null,g=d.priorityLevel;var nt=q(d.expirationTime<=V);if(V=t.unstable_now(),typeof nt=="function"){d.callback=nt,w(V),Z=!0;break e}d===i(l)&&n(l),w(V)}else n(l);d=i(l)}if(d!==null)Z=!0;else{var G=i(c);G!==null&&U(N,G.startTime-V),Z=!1}}break t}finally{d=null,g=W,f=!1}Z=void 0}}finally{Z?H():O=!1}}}var H;if(typeof I=="function")H=function(){I(F)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,Y=$.port2;$.port1.onmessage=F,H=function(){Y.postMessage(null)}}else H=function(){D(F,0)};function U(V,Z){L=D(function(){V(t.unstable_now())},Z)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(V){V.callback=null},t.unstable_forceFrameRate=function(V){0>V||125q?(V.sortIndex=W,e(c,V),i(l)===null&&V===i(c)&&(x?(A(L),L=-1):x=!0,U(N,W-q))):(V.sortIndex=nt,e(l,V),y||f||(y=!0,O||(O=!0,H()))),V},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(V){var Z=g;return function(){var W=g;g=Z;try{return V.apply(this,arguments)}finally{g=W}}}})(lC)),lC}var uz;function X6(){return uz||(uz=1,rC.exports=$6()),rC.exports}var cC={exports:{}},Os={};var dz;function Z6(){if(dz)return Os;dz=1;var t=g1();function e(l){var c="https://react.dev/errors/"+l;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),cC.exports=Z6(),cC.exports}var gz;function Q6(){if(gz)return Ny;gz=1;var t=X6(),e=g1(),i=q6();function n(h){var p="https://react.dev/errors/"+h;if(1nt||(h.current=q[nt],q[nt]=null,nt--)}function st(h,p){nt++,q[nt]=h.current,h.current=p}var lt=G(null),mt=G(null),Dt=G(null),kt=G(null);function Vt(h,p){switch(st(Dt,p),st(mt,h),st(lt,null),p.nodeType){case 9:case 11:h=(h=p.documentElement)&&(h=h.namespaceURI)?N2(h):0;break;default:if(h=p.tagName,p=p.namespaceURI)p=N2(p),h=T2(p,h);else switch(h){case"svg":h=1;break;case"math":h=2;break;default:h=0}}et(lt),st(lt,h)}function Kt(){et(lt),et(mt),et(Dt)}function ae(h){h.memoizedState!==null&&st(kt,h);var p=lt.current,m=T2(p,h.type);p!==m&&(st(mt,h),st(lt,m))}function ne(h){mt.current===h&&(et(lt),et(mt)),kt.current===h&&(et(kt),Ay._currentValue=W)}var Qt,zt;function Pt(h){if(Qt===void 0)try{throw Error()}catch(m){var p=m.stack.trim().match(/\n( *(at )?)/);Qt=p&&p[1]||"",zt=-1)":-1k||Q[v]!==rt[k]){var yt=` +`+Q[v].replace(" at new "," at ");return h.displayName&&yt.includes("")&&(yt=yt.replace("",h.displayName)),yt}while(1<=v&&0<=k);break}}}finally{ue=!1,Error.prepareStackTrace=m}return(m=h?h.displayName||h.name:"")?Pt(m):""}function ke(h,p){switch(h.tag){case 26:case 27:case 5:return Pt(h.type);case 16:return Pt("Lazy");case 13:return h.child!==p&&p!==null?Pt("Suspense Fallback"):Pt("Suspense");case 19:return Pt("SuspenseList");case 0:case 15:return oe(h.type,!1);case 11:return oe(h.type.render,!1);case 1:return oe(h.type,!0);case 31:return Pt("Activity");default:return""}}function Ye(h){try{var p="",m=null;do p+=ke(h,m),m=h,h=h.return;while(h);return p}catch(v){return` +Error generating stack: `+v.message+` +`+v.stack}}var Ce=Object.prototype.hasOwnProperty,Di=t.unstable_scheduleCallback,zn=t.unstable_cancelCallback,Kn=t.unstable_shouldYield,ln=t.unstable_requestPaint,mi=t.unstable_now,Ya=t.unstable_getCurrentPriorityLevel,Lo=t.unstable_ImmediatePriority,mr=t.unstable_UserBlockingPriority,nh=t.unstable_NormalPriority,fv=t.unstable_LowPriority,cE=t.unstable_IdlePriority,CY=t.log,wY=t.unstable_setDisableYieldValue,zm=null,$a=null;function sh(h){if(typeof CY=="function"&&wY(h),$a&&typeof $a.setStrictMode=="function")try{$a.setStrictMode(zm,h)}catch{}}var Xa=Math.clz32?Math.clz32:LY,NY=Math.log,TY=Math.LN2;function LY(h){return h>>>=0,h===0?32:31-(NY(h)/TY|0)|0}var mv=256,yv=262144,bv=4194304;function Ju(h){var p=h&42;if(p!==0)return p;switch(h&-h){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return h&261888;case 262144:case 524288:case 1048576:case 2097152:return h&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return h&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return h}}function xv(h,p,m){var v=h.pendingLanes;if(v===0)return 0;var k=0,C=h.suspendedLanes,E=h.pingedLanes;h=h.warmLanes;var _=v&134217727;return _!==0?(v=_&~C,v!==0?k=Ju(v):(E&=_,E!==0?k=Ju(E):m||(m=_&~h,m!==0&&(k=Ju(m))))):(_=v&~C,_!==0?k=Ju(_):E!==0?k=Ju(E):m||(m=v&~h,m!==0&&(k=Ju(m)))),k===0?0:p!==0&&p!==k&&(p&C)===0&&(C=k&-k,m=p&-p,C>=m||C===32&&(m&4194048)!==0)?p:k}function Bm(h,p){return(h.pendingLanes&~(h.suspendedLanes&~h.pingedLanes)&p)===0}function OY(h,p){switch(h){case 1:case 2:case 4:case 8:case 64:return p+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return p+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function hE(){var h=bv;return bv<<=1,(bv&62914560)===0&&(bv=4194304),h}function KA(h){for(var p=[],m=0;31>m;m++)p.push(h);return p}function Vm(h,p){h.pendingLanes|=p,p!==268435456&&(h.suspendedLanes=0,h.pingedLanes=0,h.warmLanes=0)}function EY(h,p,m,v,k,C){var E=h.pendingLanes;h.pendingLanes=m,h.suspendedLanes=0,h.pingedLanes=0,h.warmLanes=0,h.expiredLanes&=m,h.entangledLanes&=m,h.errorRecoveryDisabledLanes&=m,h.shellSuspendCounter=0;var _=h.entanglements,Q=h.expirationTimes,rt=h.hiddenUpdates;for(m=E&~m;0"u")return null;try{return h.activeElement||h.body}catch{return h.body}}var _Y=/[\n"\\]/g;function Eo(h){return h.replace(_Y,function(p){return"\\"+p.charCodeAt(0).toString(16)+" "})}function QA(h,p,m,v,k,C,E,_){h.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?h.type=E:h.removeAttribute("type"),p!=null?E==="number"?(p===0&&h.value===""||h.value!=p)&&(h.value=""+Oo(p)):h.value!==""+Oo(p)&&(h.value=""+Oo(p)):E!=="submit"&&E!=="reset"||h.removeAttribute("value"),p!=null?JA(h,E,Oo(p)):m!=null?JA(h,E,Oo(m)):v!=null&&h.removeAttribute("value"),k==null&&C!=null&&(h.defaultChecked=!!C),k!=null&&(h.checked=k&&typeof k!="function"&&typeof k!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?h.name=""+Oo(_):h.removeAttribute("name")}function DE(h,p,m,v,k,C,E,_){if(C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(h.type=C),p!=null||m!=null){if(!(C!=="submit"&&C!=="reset"||p!=null)){qA(h);return}m=m!=null?""+Oo(m):"",p=p!=null?""+Oo(p):m,_||p===h.value||(h.value=p),h.defaultValue=p}v=v??k,v=typeof v!="function"&&typeof v!="symbol"&&!!v,h.checked=_?h.checked:!!v,h.defaultChecked=!!v,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(h.name=E),qA(h)}function JA(h,p,m){p==="number"&&Mv(h.ownerDocument)===h||h.defaultValue===""+m||(h.defaultValue=""+m)}function qp(h,p,m,v){if(h=h.options,p){p={};for(var k=0;k"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sI=!1;if($l)try{var jm={};Object.defineProperty(jm,"passive",{get:function(){sI=!0}}),window.addEventListener("test",jm,jm),window.removeEventListener("test",jm,jm)}catch{sI=!1}var oh=null,aI=null,Av=null;function TE(){if(Av)return Av;var h,p=aI,m=p.length,v,k="value"in oh?oh.value:oh.textContent,C=k.length;for(h=0;h=Wm),zE=" ",BE=!1;function VE(h,p){switch(h){case"keyup":return p$.indexOf(p.keyCode)!==-1;case"keydown":return p.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _E(h){return h=h.detail,typeof h=="object"&&"data"in h?h.data:null}var eg=!1;function f$(h,p){switch(h){case"compositionend":return _E(p);case"keypress":return p.which!==32?null:(BE=!0,zE);case"textInput":return h=p.data,h===zE&&BE?null:h;default:return null}}function m$(h,p){if(eg)return h==="compositionend"||!hI&&VE(h,p)?(h=TE(),Av=aI=oh=null,eg=!1,h):null;switch(h){case"paste":return null;case"keypress":if(!(p.ctrlKey||p.altKey||p.metaKey)||p.ctrlKey&&p.altKey){if(p.char&&1=p)return{node:m,offset:p-h};h=v}t:{for(;m;){if(m.nextSibling){m=m.nextSibling;break t}m=m.parentNode}m=void 0}m=YE(m)}}function XE(h,p){return h&&p?h===p?!0:h&&h.nodeType===3?!1:p&&p.nodeType===3?XE(h,p.parentNode):"contains"in h?h.contains(p):h.compareDocumentPosition?!!(h.compareDocumentPosition(p)&16):!1:!1}function ZE(h){h=h!=null&&h.ownerDocument!=null&&h.ownerDocument.defaultView!=null?h.ownerDocument.defaultView:window;for(var p=Mv(h.document);p instanceof h.HTMLIFrameElement;){try{var m=typeof p.contentWindow.location.href=="string"}catch{m=!1}if(m)h=p.contentWindow;else break;p=Mv(h.document)}return p}function pI(h){var p=h&&h.nodeName&&h.nodeName.toLowerCase();return p&&(p==="input"&&(h.type==="text"||h.type==="search"||h.type==="tel"||h.type==="url"||h.type==="password")||p==="textarea"||h.contentEditable==="true")}var A$=$l&&"documentMode"in document&&11>=document.documentMode,ig=null,gI=null,Xm=null,fI=!1;function qE(h,p,m){var v=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;fI||ig==null||ig!==Mv(v)||(v=ig,"selectionStart"in v&&pI(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),Xm&&$m(Xm,v)||(Xm=v,v=y0(gI,"onSelect"),0>=E,k-=E,Yr=1<<32-Xa(p)+k|m<ge?(Ne=Ht,Ht=null):Ne=Ht.sibling;var Ue=ct(it,Ht,ot[ge],vt);if(Ue===null){Ht===null&&(Ht=Ne);break}h&&Ht&&Ue.alternate===null&&p(it,Ht),tt=C(Ue,tt,ge),Ge===null?Yt=Ue:Ge.sibling=Ue,Ge=Ue,Ht=Ne}if(ge===ot.length)return m(it,Ht),Te&&Zl(it,ge),Yt;if(Ht===null){for(;gege?(Ne=Ht,Ht=null):Ne=Ht.sibling;var wh=ct(it,Ht,Ue.value,vt);if(wh===null){Ht===null&&(Ht=Ne);break}h&&Ht&&wh.alternate===null&&p(it,Ht),tt=C(wh,tt,ge),Ge===null?Yt=wh:Ge.sibling=wh,Ge=wh,Ht=Ne}if(Ue.done)return m(it,Ht),Te&&Zl(it,ge),Yt;if(Ht===null){for(;!Ue.done;ge++,Ue=ot.next())Ue=St(it,Ue.value,vt),Ue!==null&&(tt=C(Ue,tt,ge),Ge===null?Yt=Ue:Ge.sibling=Ue,Ge=Ue);return Te&&Zl(it,ge),Yt}for(Ht=v(Ht);!Ue.done;ge++,Ue=ot.next())Ue=ft(Ht,it,ge,Ue.value,vt),Ue!==null&&(h&&Ue.alternate!==null&&Ht.delete(Ue.key===null?ge:Ue.key),tt=C(Ue,tt,ge),Ge===null?Yt=Ue:Ge.sibling=Ue,Ge=Ue);return h&&Ht.forEach(function(U6){return p(it,U6)}),Te&&Zl(it,ge),Yt}function ci(it,tt,ot,vt){if(typeof ot=="object"&&ot!==null&&ot.type===x&&ot.key===null&&(ot=ot.props.children),typeof ot=="object"&&ot!==null){switch(ot.$$typeof){case f:t:{for(var Yt=ot.key;tt!==null;){if(tt.key===Yt){if(Yt=ot.type,Yt===x){if(tt.tag===7){m(it,tt.sibling),vt=k(tt,ot.props.children),vt.return=it,it=vt;break t}}else if(tt.elementType===Yt||typeof Yt=="object"&&Yt!==null&&Yt.$$typeof===R&&hd(Yt)===tt.type){m(it,tt.sibling),vt=k(tt,ot.props),ey(vt,ot),vt.return=it,it=vt;break t}m(it,tt);break}else p(it,tt);tt=tt.sibling}ot.type===x?(vt=ad(ot.props.children,it.mode,vt,ot.key),vt.return=it,it=vt):(vt=Rv(ot.type,ot.key,ot.props,null,it.mode,vt),ey(vt,ot),vt.return=it,it=vt)}return E(it);case y:t:{for(Yt=ot.key;tt!==null;){if(tt.key===Yt)if(tt.tag===4&&tt.stateNode.containerInfo===ot.containerInfo&&tt.stateNode.implementation===ot.implementation){m(it,tt.sibling),vt=k(tt,ot.children||[]),vt.return=it,it=vt;break t}else{m(it,tt);break}else p(it,tt);tt=tt.sibling}vt=MI(ot,it.mode,vt),vt.return=it,it=vt}return E(it);case R:return ot=hd(ot),ci(it,tt,ot,vt)}if(U(ot))return _t(it,tt,ot,vt);if(H(ot)){if(Yt=H(ot),typeof Yt!="function")throw Error(n(150));return ot=Yt.call(ot),te(it,tt,ot,vt)}if(typeof ot.then=="function")return ci(it,tt,Hv(ot),vt);if(ot.$$typeof===I)return ci(it,tt,Bv(it,ot),vt);jv(it,ot)}return typeof ot=="string"&&ot!==""||typeof ot=="number"||typeof ot=="bigint"?(ot=""+ot,tt!==null&&tt.tag===6?(m(it,tt.sibling),vt=k(tt,ot),vt.return=it,it=vt):(m(it,tt),vt=SI(ot,it.mode,vt),vt.return=it,it=vt),E(it)):m(it,tt)}return function(it,tt,ot,vt){try{ty=0;var Yt=ci(it,tt,ot,vt);return pg=null,Yt}catch(Ht){if(Ht===dg||Ht===_v)throw Ht;var Ge=qa(29,Ht,null,it.mode);return Ge.lanes=vt,Ge.return=it,Ge}}}var dd=vR(!0),SR=vR(!1),uh=!1;function RI(h){h.updateQueue={baseState:h.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function PI(h,p){h=h.updateQueue,p.updateQueue===h&&(p.updateQueue={baseState:h.baseState,firstBaseUpdate:h.firstBaseUpdate,lastBaseUpdate:h.lastBaseUpdate,shared:h.shared,callbacks:null})}function dh(h){return{lane:h,tag:0,payload:null,callback:null,next:null}}function ph(h,p,m){var v=h.updateQueue;if(v===null)return null;if(v=v.shared,($e&2)!==0){var k=v.pending;return k===null?p.next=p:(p.next=k.next,k.next=p),v.pending=p,p=Ev(h),sR(h,null,m),p}return Ov(h,v,p,m),Ev(h)}function iy(h,p,m){if(p=p.updateQueue,p!==null&&(p=p.shared,(m&4194048)!==0)){var v=p.lanes;v&=h.pendingLanes,m|=v,p.lanes=m,dE(h,m)}}function zI(h,p){var m=h.updateQueue,v=h.alternate;if(v!==null&&(v=v.updateQueue,m===v)){var k=null,C=null;if(m=m.firstBaseUpdate,m!==null){do{var E={lane:m.lane,tag:m.tag,payload:m.payload,callback:null,next:null};C===null?k=C=E:C=C.next=E,m=m.next}while(m!==null);C===null?k=C=p:C=C.next=p}else k=C=p;m={baseState:v.baseState,firstBaseUpdate:k,lastBaseUpdate:C,shared:v.shared,callbacks:v.callbacks},h.updateQueue=m;return}h=m.lastBaseUpdate,h===null?m.firstBaseUpdate=p:h.next=p,m.lastBaseUpdate=p}var BI=!1;function ny(){if(BI){var h=ug;if(h!==null)throw h}}function sy(h,p,m,v){BI=!1;var k=h.updateQueue;uh=!1;var C=k.firstBaseUpdate,E=k.lastBaseUpdate,_=k.shared.pending;if(_!==null){k.shared.pending=null;var Q=_,rt=Q.next;Q.next=null,E===null?C=rt:E.next=rt,E=Q;var yt=h.alternate;yt!==null&&(yt=yt.updateQueue,_=yt.lastBaseUpdate,_!==E&&(_===null?yt.firstBaseUpdate=rt:_.next=rt,yt.lastBaseUpdate=Q))}if(C!==null){var St=k.baseState;E=0,yt=rt=Q=null,_=C;do{var ct=_.lane&-536870913,ft=ct!==_.lane;if(ft?(we&ct)===ct:(v&ct)===ct){ct!==0&&ct===hg&&(BI=!0),yt!==null&&(yt=yt.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});t:{var _t=h,te=_;ct=p;var ci=m;switch(te.tag){case 1:if(_t=te.payload,typeof _t=="function"){St=_t.call(ci,St,ct);break t}St=_t;break t;case 3:_t.flags=_t.flags&-65537|128;case 0:if(_t=te.payload,ct=typeof _t=="function"?_t.call(ci,St,ct):_t,ct==null)break t;St=d({},St,ct);break t;case 2:uh=!0}}ct=_.callback,ct!==null&&(h.flags|=64,ft&&(h.flags|=8192),ft=k.callbacks,ft===null?k.callbacks=[ct]:ft.push(ct))}else ft={lane:ct,tag:_.tag,payload:_.payload,callback:_.callback,next:null},yt===null?(rt=yt=ft,Q=St):yt=yt.next=ft,E|=ct;if(_=_.next,_===null){if(_=k.shared.pending,_===null)break;ft=_,_=ft.next,ft.next=null,k.lastBaseUpdate=ft,k.shared.pending=null}}while(!0);yt===null&&(Q=St),k.baseState=Q,k.firstBaseUpdate=rt,k.lastBaseUpdate=yt,C===null&&(k.shared.lanes=0),bh|=E,h.lanes=E,h.memoizedState=St}}function MR(h,p){if(typeof h!="function")throw Error(n(191,h));h.call(p)}function DR(h,p){var m=h.callbacks;if(m!==null)for(h.callbacks=null,h=0;hC?C:8;var E=V.T,_={};V.T=_,ik(h,!1,p,m);try{var Q=k(),rt=V.S;if(rt!==null&&rt(_,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var yt=E$(Q,v);ry(h,p,yt,io(h))}else ry(h,p,v,io(h))}catch(St){ry(h,p,{then:function(){},status:"rejected",reason:St},io())}finally{Z.p=C,E!==null&&_.types!==null&&(E.types=_.types),V.T=E}}function _$(){}function tk(h,p,m,v){if(h.tag!==5)throw Error(n(476));var k=eP(h).queue;tP(h,k,p,W,m===null?_$:function(){return iP(h),m(v)})}function eP(h){var p=h.memoizedState;if(p!==null)return p;p={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tc,lastRenderedState:W},next:null};var m={};return p.next={memoizedState:m,baseState:m,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tc,lastRenderedState:m},next:null},h.memoizedState=p,h=h.alternate,h!==null&&(h.memoizedState=p),p}function iP(h){var p=eP(h);p.next===null&&(p=h.alternate.memoizedState),ry(h,p.next.queue,{},io())}function ek(){return ls(Ay)}function nP(){return hn().memoizedState}function sP(){return hn().memoizedState}function F$(h){for(var p=h.return;p!==null;){switch(p.tag){case 24:case 3:var m=io();h=dh(m);var v=ph(p,h,m);v!==null&&(xa(v,p,m),iy(v,p,m)),p={cache:TI()},h.payload=p;return}p=p.return}}function H$(h,p,m){var v=io();m={lane:v,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Qv(h)?oP(p,m):(m=xI(h,p,m,v),m!==null&&(xa(m,h,v),rP(m,p,v)))}function aP(h,p,m){var v=io();ry(h,p,m,v)}function ry(h,p,m,v){var k={lane:v,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null};if(Qv(h))oP(p,k);else{var C=h.alternate;if(h.lanes===0&&(C===null||C.lanes===0)&&(C=p.lastRenderedReducer,C!==null))try{var E=p.lastRenderedState,_=C(E,m);if(k.hasEagerState=!0,k.eagerState=_,Za(_,E))return Ov(h,p,k,0),ui===null&&Lv(),!1}catch{}if(m=xI(h,p,k,v),m!==null)return xa(m,h,v),rP(m,p,v),!0}return!1}function ik(h,p,m,v){if(v={lane:2,revertLane:Rk(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},Qv(h)){if(p)throw Error(n(479))}else p=xI(h,m,v,2),p!==null&&xa(p,h,2)}function Qv(h){var p=h.alternate;return h===de||p!==null&&p===de}function oP(h,p){fg=Wv=!0;var m=h.pending;m===null?p.next=p:(p.next=m.next,m.next=p),h.pending=p}function rP(h,p,m){if((m&4194048)!==0){var v=p.lanes;v&=h.pendingLanes,m|=v,p.lanes=m,dE(h,m)}}var ly={readContext:ls,use:$v,useCallback:en,useContext:en,useEffect:en,useImperativeHandle:en,useLayoutEffect:en,useInsertionEffect:en,useMemo:en,useReducer:en,useRef:en,useState:en,useDebugValue:en,useDeferredValue:en,useTransition:en,useSyncExternalStore:en,useId:en,useHostTransitionStatus:en,useFormState:en,useActionState:en,useOptimistic:en,useMemoCache:en,useCacheRefresh:en};ly.useEffectEvent=en;var lP={readContext:ls,use:$v,useCallback:function(h,p){return ea().memoizedState=[h,p===void 0?null:p],h},useContext:ls,useEffect:WR,useImperativeHandle:function(h,p,m){m=m!=null?m.concat([h]):null,Zv(4194308,4,XR.bind(null,p,h),m)},useLayoutEffect:function(h,p){return Zv(4194308,4,h,p)},useInsertionEffect:function(h,p){Zv(4,2,h,p)},useMemo:function(h,p){var m=ea();p=p===void 0?null:p;var v=h();if(pd){sh(!0);try{h()}finally{sh(!1)}}return m.memoizedState=[v,p],v},useReducer:function(h,p,m){var v=ea();if(m!==void 0){var k=m(p);if(pd){sh(!0);try{m(p)}finally{sh(!1)}}}else k=p;return v.memoizedState=v.baseState=k,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:h,lastRenderedState:k},v.queue=h,h=h.dispatch=H$.bind(null,de,h),[v.memoizedState,h]},useRef:function(h){var p=ea();return h={current:h},p.memoizedState=h},useState:function(h){h=XI(h);var p=h.queue,m=aP.bind(null,de,p);return p.dispatch=m,[h.memoizedState,m]},useDebugValue:QI,useDeferredValue:function(h,p){var m=ea();return JI(m,h,p)},useTransition:function(){var h=XI(!1);return h=tP.bind(null,de,h.queue,!0,!1),ea().memoizedState=h,[!1,h]},useSyncExternalStore:function(h,p,m){var v=de,k=ea();if(Te){if(m===void 0)throw Error(n(407));m=m()}else{if(m=p(),ui===null)throw Error(n(349));(we&127)!==0||NR(v,p,m)}k.memoizedState=m;var C={value:m,getSnapshot:p};return k.queue=C,WR(LR.bind(null,v,C,h),[h]),v.flags|=2048,yg(9,{destroy:void 0},TR.bind(null,v,C,m,p),null),m},useId:function(){var h=ea(),p=ui.identifierPrefix;if(Te){var m=$r,v=Yr;m=(v&~(1<<32-Xa(v)-1)).toString(32)+m,p="_"+p+"R_"+m,m=Kv++,0<\/script>",C=C.removeChild(C.firstChild);break;case"select":C=typeof v.is=="string"?E.createElement("select",{is:v.is}):E.createElement("select"),v.multiple?C.multiple=!0:v.size&&(C.size=v.size);break;default:C=typeof v.is=="string"?E.createElement(k,{is:v.is}):E.createElement(k)}}C[os]=p,C[pa]=v;t:for(E=p.child;E!==null;){if(E.tag===5||E.tag===6)C.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===p)break t;for(;E.sibling===null;){if(E.return===null||E.return===p)break t;E=E.return}E.sibling.return=E.return,E=E.sibling}p.stateNode=C;t:switch(hs(C,k,v),k){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break t;case"img":v=!0;break t;default:v=!1}v&&ic(p)}}return Ii(p),mk(p,p.type,h===null?null:h.memoizedProps,p.pendingProps,m),null;case 6:if(h&&p.stateNode!=null)h.memoizedProps!==v&&ic(p);else{if(typeof v!="string"&&p.stateNode===null)throw Error(n(166));if(h=Dt.current,lg(p)){if(h=p.stateNode,m=p.memoizedProps,v=null,k=rs,k!==null)switch(k.tag){case 27:case 5:v=k.memoizedProps}h[os]=p,h=!!(h.nodeValue===m||v!==null&&v.suppressHydrationWarning===!0||C2(h.nodeValue,m)),h||ch(p,!0)}else h=b0(h).createTextNode(v),h[os]=p,p.stateNode=h}return Ii(p),null;case 31:if(m=p.memoizedState,h===null||h.memoizedState!==null){if(v=lg(p),m!==null){if(h===null){if(!v)throw Error(n(318));if(h=p.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(n(557));h[os]=p}else od(),(p.flags&128)===0&&(p.memoizedState=null),p.flags|=4;Ii(p),h=!1}else m=kI(),h!==null&&h.memoizedState!==null&&(h.memoizedState.hydrationErrors=m),h=!0;if(!h)return p.flags&256?(Ja(p),p):(Ja(p),null);if((p.flags&128)!==0)throw Error(n(558))}return Ii(p),null;case 13:if(v=p.memoizedState,h===null||h.memoizedState!==null&&h.memoizedState.dehydrated!==null){if(k=lg(p),v!==null&&v.dehydrated!==null){if(h===null){if(!k)throw Error(n(318));if(k=p.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(n(317));k[os]=p}else od(),(p.flags&128)===0&&(p.memoizedState=null),p.flags|=4;Ii(p),k=!1}else k=kI(),h!==null&&h.memoizedState!==null&&(h.memoizedState.hydrationErrors=k),k=!0;if(!k)return p.flags&256?(Ja(p),p):(Ja(p),null)}return Ja(p),(p.flags&128)!==0?(p.lanes=m,p):(m=v!==null,h=h!==null&&h.memoizedState!==null,m&&(v=p.child,k=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(k=v.alternate.memoizedState.cachePool.pool),C=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(C=v.memoizedState.cachePool.pool),C!==k&&(v.flags|=2048)),m!==h&&m&&(p.child.flags|=8192),n0(p,p.updateQueue),Ii(p),null);case 4:return Kt(),h===null&&Vk(p.stateNode.containerInfo),Ii(p),null;case 10:return Ql(p.type),Ii(p),null;case 19:if(et(cn),v=p.memoizedState,v===null)return Ii(p),null;if(k=(p.flags&128)!==0,C=v.rendering,C===null)if(k)hy(v,!1);else{if(nn!==0||h!==null&&(h.flags&128)!==0)for(h=p.child;h!==null;){if(C=Uv(h),C!==null){for(p.flags|=128,hy(v,!1),h=C.updateQueue,p.updateQueue=h,n0(p,h),p.subtreeFlags=0,h=m,m=p.child;m!==null;)aR(m,h),m=m.sibling;return st(cn,cn.current&1|2),Te&&Zl(p,v.treeForkCount),p.child}h=h.sibling}v.tail!==null&&mi()>l0&&(p.flags|=128,k=!0,hy(v,!1),p.lanes=4194304)}else{if(!k)if(h=Uv(C),h!==null){if(p.flags|=128,k=!0,h=h.updateQueue,p.updateQueue=h,n0(p,h),hy(v,!0),v.tail===null&&v.tailMode==="hidden"&&!C.alternate&&!Te)return Ii(p),null}else 2*mi()-v.renderingStartTime>l0&&m!==536870912&&(p.flags|=128,k=!0,hy(v,!1),p.lanes=4194304);v.isBackwards?(C.sibling=p.child,p.child=C):(h=v.last,h!==null?h.sibling=C:p.child=C,v.last=C)}return v.tail!==null?(h=v.tail,v.rendering=h,v.tail=h.sibling,v.renderingStartTime=mi(),h.sibling=null,m=cn.current,st(cn,k?m&1|2:m&1),Te&&Zl(p,v.treeForkCount),h):(Ii(p),null);case 22:case 23:return Ja(p),_I(),v=p.memoizedState!==null,h!==null?h.memoizedState!==null!==v&&(p.flags|=8192):v&&(p.flags|=8192),v?(m&536870912)!==0&&(p.flags&128)===0&&(Ii(p),p.subtreeFlags&6&&(p.flags|=8192)):Ii(p),m=p.updateQueue,m!==null&&n0(p,m.retryQueue),m=null,h!==null&&h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(m=h.memoizedState.cachePool.pool),v=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(v=p.memoizedState.cachePool.pool),v!==m&&(p.flags|=2048),h!==null&&et(cd),null;case 24:return m=null,h!==null&&(m=h.memoizedState.cache),p.memoizedState.cache!==m&&(p.flags|=2048),Ql(Sn),Ii(p),null;case 25:return null;case 30:return null}throw Error(n(156,p.tag))}function K$(h,p){switch(AI(p),p.tag){case 1:return h=p.flags,h&65536?(p.flags=h&-65537|128,p):null;case 3:return Ql(Sn),Kt(),h=p.flags,(h&65536)!==0&&(h&128)===0?(p.flags=h&-65537|128,p):null;case 26:case 27:case 5:return ne(p),null;case 31:if(p.memoizedState!==null){if(Ja(p),p.alternate===null)throw Error(n(340));od()}return h=p.flags,h&65536?(p.flags=h&-65537|128,p):null;case 13:if(Ja(p),h=p.memoizedState,h!==null&&h.dehydrated!==null){if(p.alternate===null)throw Error(n(340));od()}return h=p.flags,h&65536?(p.flags=h&-65537|128,p):null;case 19:return et(cn),null;case 4:return Kt(),null;case 10:return Ql(p.type),null;case 22:case 23:return Ja(p),_I(),h!==null&&et(cd),h=p.flags,h&65536?(p.flags=h&-65537|128,p):null;case 24:return Ql(Sn),null;case 25:return null;default:return null}}function OP(h,p){switch(AI(p),p.tag){case 3:Ql(Sn),Kt();break;case 26:case 27:case 5:ne(p);break;case 4:Kt();break;case 31:p.memoizedState!==null&&Ja(p);break;case 13:Ja(p);break;case 19:et(cn);break;case 10:Ql(p.type);break;case 22:case 23:Ja(p),_I(),h!==null&&et(cd);break;case 24:Ql(Sn)}}function uy(h,p){try{var m=p.updateQueue,v=m!==null?m.lastEffect:null;if(v!==null){var k=v.next;m=k;do{if((m.tag&h)===h){v=void 0;var C=m.create,E=m.inst;v=C(),E.destroy=v}m=m.next}while(m!==k)}}catch(_){ni(p,p.return,_)}}function mh(h,p,m){try{var v=p.updateQueue,k=v!==null?v.lastEffect:null;if(k!==null){var C=k.next;v=C;do{if((v.tag&h)===h){var E=v.inst,_=E.destroy;if(_!==void 0){E.destroy=void 0,k=p;var Q=m,rt=_;try{rt()}catch(yt){ni(k,Q,yt)}}}v=v.next}while(v!==C)}}catch(yt){ni(p,p.return,yt)}}function EP(h){var p=h.updateQueue;if(p!==null){var m=h.stateNode;try{DR(p,m)}catch(v){ni(h,h.return,v)}}}function RP(h,p,m){m.props=gd(h.type,h.memoizedProps),m.state=h.memoizedState;try{m.componentWillUnmount()}catch(v){ni(h,p,v)}}function dy(h,p){try{var m=h.ref;if(m!==null){switch(h.tag){case 26:case 27:case 5:var v=h.stateNode;break;case 30:v=h.stateNode;break;default:v=h.stateNode}typeof m=="function"?h.refCleanup=m(v):m.current=v}}catch(k){ni(h,p,k)}}function Xr(h,p){var m=h.ref,v=h.refCleanup;if(m!==null)if(typeof v=="function")try{v()}catch(k){ni(h,p,k)}finally{h.refCleanup=null,h=h.alternate,h!=null&&(h.refCleanup=null)}else if(typeof m=="function")try{m(null)}catch(k){ni(h,p,k)}else m.current=null}function PP(h){var p=h.type,m=h.memoizedProps,v=h.stateNode;try{t:switch(p){case"button":case"input":case"select":case"textarea":m.autoFocus&&v.focus();break t;case"img":m.src?v.src=m.src:m.srcSet&&(v.srcset=m.srcSet)}}catch(k){ni(h,h.return,k)}}function yk(h,p,m){try{var v=h.stateNode;g6(v,h.type,m,p),v[pa]=p}catch(k){ni(h,h.return,k)}}function zP(h){return h.tag===5||h.tag===3||h.tag===26||h.tag===27&&Dh(h.type)||h.tag===4}function bk(h){t:for(;;){for(;h.sibling===null;){if(h.return===null||zP(h.return))return null;h=h.return}for(h.sibling.return=h.return,h=h.sibling;h.tag!==5&&h.tag!==6&&h.tag!==18;){if(h.tag===27&&Dh(h.type)||h.flags&2||h.child===null||h.tag===4)continue t;h.child.return=h,h=h.child}if(!(h.flags&2))return h.stateNode}}function xk(h,p,m){var v=h.tag;if(v===5||v===6)h=h.stateNode,p?(m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m).insertBefore(h,p):(p=m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m,p.appendChild(h),m=m._reactRootContainer,m!=null||p.onclick!==null||(p.onclick=Yl));else if(v!==4&&(v===27&&Dh(h.type)&&(m=h.stateNode,p=null),h=h.child,h!==null))for(xk(h,p,m),h=h.sibling;h!==null;)xk(h,p,m),h=h.sibling}function s0(h,p,m){var v=h.tag;if(v===5||v===6)h=h.stateNode,p?m.insertBefore(h,p):m.appendChild(h);else if(v!==4&&(v===27&&Dh(h.type)&&(m=h.stateNode),h=h.child,h!==null))for(s0(h,p,m),h=h.sibling;h!==null;)s0(h,p,m),h=h.sibling}function BP(h){var p=h.stateNode,m=h.memoizedProps;try{for(var v=h.type,k=p.attributes;k.length;)p.removeAttributeNode(k[0]);hs(p,v,m),p[os]=h,p[pa]=m}catch(C){ni(h,h.return,C)}}var nc=!1,An=!1,vk=!1,VP=typeof WeakSet=="function"?WeakSet:Set,$n=null;function Y$(h,p){if(h=h.containerInfo,Hk=I0,h=ZE(h),pI(h)){if("selectionStart"in h)var m={start:h.selectionStart,end:h.selectionEnd};else t:{m=(m=h.ownerDocument)&&m.defaultView||window;var v=m.getSelection&&m.getSelection();if(v&&v.rangeCount!==0){m=v.anchorNode;var k=v.anchorOffset,C=v.focusNode;v=v.focusOffset;try{m.nodeType,C.nodeType}catch{m=null;break t}var E=0,_=-1,Q=-1,rt=0,yt=0,St=h,ct=null;e:for(;;){for(var ft;St!==m||k!==0&&St.nodeType!==3||(_=E+k),St!==C||v!==0&&St.nodeType!==3||(Q=E+v),St.nodeType===3&&(E+=St.nodeValue.length),(ft=St.firstChild)!==null;)ct=St,St=ft;for(;;){if(St===h)break e;if(ct===m&&++rt===k&&(_=E),ct===C&&++yt===v&&(Q=E),(ft=St.nextSibling)!==null)break;St=ct,ct=St.parentNode}St=ft}m=_===-1||Q===-1?null:{start:_,end:Q}}else m=null}m=m||{start:0,end:0}}else m=null;for(jk={focusedElem:h,selectionRange:m},I0=!1,$n=p;$n!==null;)if(p=$n,h=p.child,(p.subtreeFlags&1028)!==0&&h!==null)h.return=p,$n=h;else for(;$n!==null;){switch(p=$n,C=p.alternate,h=p.flags,p.tag){case 0:if((h&4)!==0&&(h=p.updateQueue,h=h!==null?h.events:null,h!==null))for(m=0;m title"))),hs(C,v,m),C[os]=h,Yn(C),v=C;break t;case"link":var E=U2("link","href",k).get(v+(m.href||""));if(E){for(var _=0;_ci&&(E=ci,ci=te,te=E);var it=$E(_,te),tt=$E(_,ci);if(it&&tt&&(ft.rangeCount!==1||ft.anchorNode!==it.node||ft.anchorOffset!==it.offset||ft.focusNode!==tt.node||ft.focusOffset!==tt.offset)){var ot=St.createRange();ot.setStart(it.node,it.offset),ft.removeAllRanges(),te>ci?(ft.addRange(ot),ft.extend(tt.node,tt.offset)):(ot.setEnd(tt.node,tt.offset),ft.addRange(ot))}}}}for(St=[],ft=_;ft=ft.parentNode;)ft.nodeType===1&&St.push({element:ft,left:ft.scrollLeft,top:ft.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_m?32:m,V.T=null,m=Ck,Ck=null;var C=vh,E=lc;if(Bn=0,Mg=vh=null,lc=0,($e&6)!==0)throw Error(n(331));var _=$e;if($e|=4,XP(C.current),KP(C,C.current,E,m),$e=_,by(0,!1),$a&&typeof $a.onPostCommitFiberRoot=="function")try{$a.onPostCommitFiberRoot(zm,C)}catch{}return!0}finally{Z.p=k,V.T=v,p2(h,p)}}function f2(h,p,m){p=Po(m,p),p=ok(h.stateNode,p,2),h=ph(h,p,2),h!==null&&(Vm(h,2),Zr(h))}function ni(h,p,m){if(h.tag===3)f2(h,h,m);else for(;p!==null;){if(p.tag===3){f2(p,h,m);break}else if(p.tag===1){var v=p.stateNode;if(typeof p.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(xh===null||!xh.has(v))){h=Po(m,h),m=mP(2),v=ph(p,m,2),v!==null&&(yP(m,v,p,h),Vm(v,2),Zr(v));break}}p=p.return}}function Lk(h,p,m){var v=h.pingCache;if(v===null){v=h.pingCache=new Z$;var k=new Set;v.set(p,k)}else k=v.get(p),k===void 0&&(k=new Set,v.set(p,k));k.has(m)||(Dk=!0,k.add(m),h=e6.bind(null,h,p,m),p.then(h,h))}function e6(h,p,m){var v=h.pingCache;v!==null&&v.delete(p),h.pingedLanes|=h.suspendedLanes&m,h.warmLanes&=~m,ui===h&&(we&m)===m&&(nn===4||nn===3&&(we&62914560)===we&&300>mi()-r0?($e&2)===0&&Dg(h,0):Ak|=m,Sg===we&&(Sg=0)),Zr(h)}function m2(h,p){p===0&&(p=hE()),h=sd(h,p),h!==null&&(Vm(h,p),Zr(h))}function i6(h){var p=h.memoizedState,m=0;p!==null&&(m=p.retryLane),m2(h,m)}function n6(h,p){var m=0;switch(h.tag){case 31:case 13:var v=h.stateNode,k=h.memoizedState;k!==null&&(m=k.retryLane);break;case 19:v=h.stateNode;break;case 22:v=h.stateNode._retryCache;break;default:throw Error(n(314))}v!==null&&v.delete(p),m2(h,m)}function s6(h,p){return Di(h,p)}var g0=null,Ig=null,Ok=!1,f0=!1,Ek=!1,Mh=0;function Zr(h){h!==Ig&&h.next===null&&(Ig===null?g0=Ig=h:Ig=Ig.next=h),f0=!0,Ok||(Ok=!0,o6())}function by(h,p){if(!Ek&&f0){Ek=!0;do for(var m=!1,v=g0;v!==null;){if(h!==0){var k=v.pendingLanes;if(k===0)var C=0;else{var E=v.suspendedLanes,_=v.pingedLanes;C=(1<<31-Xa(42|h)+1)-1,C&=k&~(E&~_),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(m=!0,v2(v,C))}else C=we,C=xv(v,v===ui?C:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(C&3)===0||Bm(v,C)||(m=!0,v2(v,C));v=v.next}while(m);Ek=!1}}function a6(){y2()}function y2(){f0=Ok=!1;var h=0;Mh!==0&&m6()&&(h=Mh);for(var p=mi(),m=null,v=g0;v!==null;){var k=v.next,C=b2(v,p);C===0?(v.next=null,m===null?g0=k:m.next=k,k===null&&(Ig=m)):(m=v,(h!==0||(C&3)!==0)&&(f0=!0)),v=k}Bn!==0&&Bn!==5||by(h),Mh!==0&&(Mh=0)}function b2(h,p){for(var m=h.suspendedLanes,v=h.pingedLanes,k=h.expirationTimes,C=h.pendingLanes&-62914561;0_)break;var yt=Q.transferSize,St=Q.initiatorType;yt&&w2(St)&&(Q=Q.responseEnd,E+=yt*(Q<_?1:(_-rt)/(Q-rt)))}if(--v,p+=8*(C+E)/(k.duration/1e3),h++,10"u"?null:document;function F2(h,p,m){var v=kg;if(v&&typeof p=="string"&&p){var k=Eo(p);k='link[rel="'+h+'"][href="'+k+'"]',typeof m=="string"&&(k+='[crossorigin="'+m+'"]'),_2.has(k)||(_2.add(k),h={rel:h,crossOrigin:m,href:p},v.querySelector(k)===null&&(p=v.createElement("link"),hs(p,"link",h),Yn(p),v.head.appendChild(p)))}}function I6(h){cc.D(h),F2("dns-prefetch",h,null)}function k6(h,p){cc.C(h,p),F2("preconnect",h,p)}function C6(h,p,m){cc.L(h,p,m);var v=kg;if(v&&h&&p){var k='link[rel="preload"][as="'+Eo(p)+'"]';p==="image"&&m&&m.imageSrcSet?(k+='[imagesrcset="'+Eo(m.imageSrcSet)+'"]',typeof m.imageSizes=="string"&&(k+='[imagesizes="'+Eo(m.imageSizes)+'"]')):k+='[href="'+Eo(h)+'"]';var C=k;switch(p){case"style":C=Cg(h);break;case"script":C=wg(h)}Ho.has(C)||(h=d({rel:"preload",href:p==="image"&&m&&m.imageSrcSet?void 0:h,as:p},m),Ho.set(C,h),v.querySelector(k)!==null||p==="style"&&v.querySelector(My(C))||p==="script"&&v.querySelector(Dy(C))||(p=v.createElement("link"),hs(p,"link",h),Yn(p),v.head.appendChild(p)))}}function w6(h,p){cc.m(h,p);var m=kg;if(m&&h){var v=p&&typeof p.as=="string"?p.as:"script",k='link[rel="modulepreload"][as="'+Eo(v)+'"][href="'+Eo(h)+'"]',C=k;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=wg(h)}if(!Ho.has(C)&&(h=d({rel:"modulepreload",href:h},p),Ho.set(C,h),m.querySelector(k)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(m.querySelector(Dy(C)))return}v=m.createElement("link"),hs(v,"link",h),Yn(v),m.head.appendChild(v)}}}function N6(h,p,m){cc.S(h,p,m);var v=kg;if(v&&h){var k=Xp(v).hoistableStyles,C=Cg(h);p=p||"default";var E=k.get(C);if(!E){var _={loading:0,preload:null};if(E=v.querySelector(My(C)))_.loading=5;else{h=d({rel:"stylesheet",href:h,"data-precedence":p},m),(m=Ho.get(C))&&Xk(h,m);var Q=E=v.createElement("link");Yn(Q),hs(Q,"link",h),Q._p=new Promise(function(rt,yt){Q.onload=rt,Q.onerror=yt}),Q.addEventListener("load",function(){_.loading|=1}),Q.addEventListener("error",function(){_.loading|=2}),_.loading|=4,v0(E,p,v)}E={type:"stylesheet",instance:E,count:1,state:_},k.set(C,E)}}}function T6(h,p){cc.X(h,p);var m=kg;if(m&&h){var v=Xp(m).hoistableScripts,k=wg(h),C=v.get(k);C||(C=m.querySelector(Dy(k)),C||(h=d({src:h,async:!0},p),(p=Ho.get(k))&&Zk(h,p),C=m.createElement("script"),Yn(C),hs(C,"link",h),m.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},v.set(k,C))}}function L6(h,p){cc.M(h,p);var m=kg;if(m&&h){var v=Xp(m).hoistableScripts,k=wg(h),C=v.get(k);C||(C=m.querySelector(Dy(k)),C||(h=d({src:h,async:!0,type:"module"},p),(p=Ho.get(k))&&Zk(h,p),C=m.createElement("script"),Yn(C),hs(C,"link",h),m.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},v.set(k,C))}}function H2(h,p,m,v){var k=(k=Dt.current)?x0(k):null;if(!k)throw Error(n(446));switch(h){case"meta":case"title":return null;case"style":return typeof m.precedence=="string"&&typeof m.href=="string"?(p=Cg(m.href),m=Xp(k).hoistableStyles,v=m.get(p),v||(v={type:"style",instance:null,count:0,state:null},m.set(p,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(m.rel==="stylesheet"&&typeof m.href=="string"&&typeof m.precedence=="string"){h=Cg(m.href);var C=Xp(k).hoistableStyles,E=C.get(h);if(E||(k=k.ownerDocument||k,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(h,E),(C=k.querySelector(My(h)))&&!C._p&&(E.instance=C,E.state.loading=5),Ho.has(h)||(m={rel:"preload",as:"style",href:m.href,crossOrigin:m.crossOrigin,integrity:m.integrity,media:m.media,hrefLang:m.hrefLang,referrerPolicy:m.referrerPolicy},Ho.set(h,m),C||O6(k,h,m,E.state))),p&&v===null)throw Error(n(528,""));return E}if(p&&v!==null)throw Error(n(529,""));return null;case"script":return p=m.async,m=m.src,typeof m=="string"&&p&&typeof p!="function"&&typeof p!="symbol"?(p=wg(m),m=Xp(k).hoistableScripts,v=m.get(p),v||(v={type:"script",instance:null,count:0,state:null},m.set(p,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,h))}}function Cg(h){return'href="'+Eo(h)+'"'}function My(h){return'link[rel="stylesheet"]['+h+"]"}function j2(h){return d({},h,{"data-precedence":h.precedence,precedence:null})}function O6(h,p,m,v){h.querySelector('link[rel="preload"][as="style"]['+p+"]")?v.loading=1:(p=h.createElement("link"),v.preload=p,p.addEventListener("load",function(){return v.loading|=1}),p.addEventListener("error",function(){return v.loading|=2}),hs(p,"link",m),Yn(p),h.head.appendChild(p))}function wg(h){return'[src="'+Eo(h)+'"]'}function Dy(h){return"script[async]"+h}function G2(h,p,m){if(p.count++,p.instance===null)switch(p.type){case"style":var v=h.querySelector('style[data-href~="'+Eo(m.href)+'"]');if(v)return p.instance=v,Yn(v),v;var k=d({},m,{"data-href":m.href,"data-precedence":m.precedence,href:null,precedence:null});return v=(h.ownerDocument||h).createElement("style"),Yn(v),hs(v,"style",k),v0(v,m.precedence,h),p.instance=v;case"stylesheet":k=Cg(m.href);var C=h.querySelector(My(k));if(C)return p.state.loading|=4,p.instance=C,Yn(C),C;v=j2(m),(k=Ho.get(k))&&Xk(v,k),C=(h.ownerDocument||h).createElement("link"),Yn(C);var E=C;return E._p=new Promise(function(_,Q){E.onload=_,E.onerror=Q}),hs(C,"link",v),p.state.loading|=4,v0(C,m.precedence,h),p.instance=C;case"script":return C=wg(m.src),(k=h.querySelector(Dy(C)))?(p.instance=k,Yn(k),k):(v=m,(k=Ho.get(C))&&(v=d({},m),Zk(v,k)),h=h.ownerDocument||h,k=h.createElement("script"),Yn(k),hs(k,"link",v),h.head.appendChild(k),p.instance=k);case"void":return null;default:throw Error(n(443,p.type))}else p.type==="stylesheet"&&(p.state.loading&4)===0&&(v=p.instance,p.state.loading|=4,v0(v,m.precedence,h));return p.instance}function v0(h,p,m){for(var v=m.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),k=v.length?v[v.length-1]:null,C=k,E=0;E title"):null)}function E6(h,p,m){if(m===1||p.itemProp!=null)return!1;switch(h){case"meta":case"title":return!0;case"style":if(typeof p.precedence!="string"||typeof p.href!="string"||p.href==="")break;return!0;case"link":if(typeof p.rel!="string"||typeof p.href!="string"||p.href===""||p.onLoad||p.onError)break;return p.rel==="stylesheet"?(h=p.disabled,typeof p.precedence=="string"&&h==null):!0;case"script":if(p.async&&typeof p.async!="function"&&typeof p.async!="symbol"&&!p.onLoad&&!p.onError&&p.src&&typeof p.src=="string")return!0}return!1}function K2(h){return!(h.type==="stylesheet"&&(h.state.loading&3)===0)}function R6(h,p,m,v){if(m.type==="stylesheet"&&(typeof v.media!="string"||matchMedia(v.media).matches!==!1)&&(m.state.loading&4)===0){if(m.instance===null){var k=Cg(v.href),C=p.querySelector(My(k));if(C){p=C._p,p!==null&&typeof p=="object"&&typeof p.then=="function"&&(h.count++,h=M0.bind(h),p.then(h,h)),m.state.loading|=4,m.instance=C,Yn(C);return}C=p.ownerDocument||p,v=j2(v),(k=Ho.get(k))&&Xk(v,k),C=C.createElement("link"),Yn(C);var E=C;E._p=new Promise(function(_,Q){E.onload=_,E.onerror=Q}),hs(C,"link",v),m.instance=C}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(m,p),(p=m.state.preload)&&(m.state.loading&3)===0&&(h.count++,m=M0.bind(h),p.addEventListener("load",m),p.addEventListener("error",m))}}var qk=0;function P6(h,p){return h.stylesheets&&h.count===0&&A0(h,h.stylesheets),0qk?50:800)+p);return h.unsuspend=m,function(){h.unsuspend=null,clearTimeout(v),clearTimeout(k)}}:null}function M0(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)A0(this,this.stylesheets);else if(this.unsuspend){var h=this.unsuspend;this.unsuspend=null,h()}}}var D0=null;function A0(h,p){h.stylesheets=null,h.unsuspend!==null&&(h.count++,D0=new Map,p.forEach(z6,h),D0=null,M0.call(h))}function z6(h,p){if(!(p.state.loading&4)){var m=D0.get(h);if(m)var v=m.get(null);else{m=new Map,D0.set(h,m);for(var k=h.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),oC.exports=Q6(),oC.exports}var tX=J6(),BH=Object.defineProperty,Vf=(t,e)=>{for(var i in e)BH(t,i,{get:e[i],enumerable:!0})},Br=(t,e,i,n)=>{for(var s=void 0,a=t.length-1,o;a>=0;a--)(o=t[a])&&(s=o(e,i,s)||s);return s&&BH(e,i,s),s},Le=(t=>(t.Chart="chart",t.Axis="axis",t.Series="series",t.Plugin="plugin",t.AxisPlugin="axis:plugin",t.SeriesPlugin="series:plugin",t.Preset="preset",t))(Le||{});function Lb(t){return t.domain}var wi=(t=>(t[t.Leading=0]="Leading",t[t.Trailing=1]="Trailing",t[t.Interpolate=2]="Interpolate",t))(wi||{}),cr=class{constructor(){this.events=new Map}on(t,e){return this.events.has(t)||this.events.set(t,new Set),this.events.get(t)?.add(e),()=>this.off(t,e)}off(t,e){const i=this.events.get(t);i&&(i.delete(e),i.size===0&&this.events.delete(t))}emit(t,e){const i=this.events.get(t);if(i)for(const n of i)n(e)}clear(t){t?this.events.delete(t):this.events.clear()}},XM=class{constructor(t){if(this.maxCacheSize=t,this.store=new Map,t<=0)throw new Error("LRUCache size must be greater than 0")}get(t){if(!this.store.has(t))return;const e=this.store.get(t);return this.store.delete(t),this.store.set(t,e),e}has(t){return this.store.has(t)}set(t,e){return this.store.set(t,e),this.store.size>this.maxCacheSize&&this.store.delete(this.store.keys().next().value),e}clear(){this.store.clear()}},Gt={};Vf(Gt,{Time:()=>lX,check:()=>nf,create:()=>qH,inDevelopmentMode:()=>QH});function dx(t){return t===void 0?[]:Array.isArray(t)?t:[t]}function ZM(t){return Array.from(new Set(t))}function px(t,e){return t.reduce((i,n)=>{const s=e(n);return i[s]??(i[s]=[]),i[s].push(n),i},{})}function tr(t,e){if(t==null||e==null||t.length!==e.length)return!1;for(let i=0;i{const a=i.get(n)??1/0,o=i.get(s)??1/0;return a-o})}function _H(t,e){let i=0;for(;i=0&&e(t[i]);)i-=1;const n=t.length-1-i;n!==0&&t.splice(t.length-n,n)}function HH(t,e,i){const n=[t],s=Math.round((e-t)/(i-1));if(s>0)for(let a=t+s;a=i-1);a+=s);return n.push(e),n}var ja={};typeof globalThis.window<"u"&&(ja.window=globalThis.window);typeof document<"u"?ja.document=document:typeof globalThis.global<"u"&&(ja.document=globalThis.document);function bp(t){return t?ja.document?.[t]:ja.document}function Ml(t){return t?ja.window?.[t]:ja.window}function jH(t){ja.document=t}function GH(t){ja.window=t}function qM(){return ja.window?.OffscreenCanvas??globalThis.OffscreenCanvas}function Ob(){return ja.window?.Path2D??globalThis.Path2D}function f1(){return ja.window?.DOMMatrix??globalThis.DOMMatrix}function UH(){return ja.window?.Image??globalThis.Image}function WH(){return ja.window?.ResizeObserver??globalThis.ResizeObserver}var KH=1,eX=11;function JS(t){return t!=null&&typeof t.nodeType=="number"}function m1(t){return t!=null&&t.nodeType===KH}function YH(t){return t!=null&&t.nodeType===eX}function Eb(t){return t!=null&&t.nodeType===KH&&"style"in t}var pt={};Vf(pt,{error:()=>$H,errorOnce:()=>nX,log:()=>QM,logGroup:()=>ZH,reset:()=>sX,table:()=>iX,warn:()=>cl,warnOnce:()=>uo});var Xw=new Set;function QM(...t){console.log(...t)}function cl(t,...e){console.warn(`AG Charts - ${t}`,...e)}function $H(t,...e){typeof t=="object"?console.error("AG Charts error",t,...e):console.error(`AG Charts - ${t}`,...e)}function iX(...t){console.table(...t)}function XH(t,e,i){let n;t instanceof Error?n=t.message:typeof t=="string"?n=t:typeof t=="object"?n=JSON.stringify(t):n=String(t);const s=`${e}: ${n}`;Xw.has(s)||(i(t),Xw.add(s))}function uo(t,...e){XH(t,"Logger.warn",i=>cl(i,...e))}function nX(t,...e){XH(t,"Logger.error",i=>$H(i,...e))}function sX(){Xw.clear()}function aX(t){return typeof t=="object"&&t!==null&&"then"in t}function ZH(t,e){console.groupCollapsed(t);let i=!0;try{const n=e();return aX(n)?(i=!1,n.finally(()=>{console.groupEnd()})):n}finally{i&&console.groupEnd()}}var oX=2e3,mz=Date.now();function rX(){const t=Date.now()-mz;if(t>oX){const e=(Math.floor(t/100)/10).toFixed(1);QM(`**** ${e}s since last log message ****`)}mz=Date.now()}function qH(...t){return Object.assign((...i)=>{nf(...t)&&(typeof i[0]=="function"&&(i=dx(i[0]())),rX(),QM(...i))},{check:()=>nf(...t),group:(i,n)=>nf(...t)?ZH(i,n):n()})}function nf(...t){return t.length===0&&t.push(!0),dx(Ml("agChartsDebug")).some(i=>t.includes(i))}function QH(t){if(nf("dev"))return t()}function lX(t,e={}){const{logResult:i=!0,logStack:n=!1,logArgs:s=!1,logData:a}=e;return function(o,r,l){const c=l.value;l.value=function(...u){const d=performance.now(),g=c.apply(this,u),y={duration:performance.now()-d};return i&&(y.result=g),s&&(y.args=u),n&&(y.stack=new Error("Stack trace for timing debug").stack),a&&(y.logData=a(this)),QM(t,y),g}}}var Vr={};Vf(Vr,{flush:()=>t4,record:()=>JH});var Zw=new Map;function JH(t,e){nf("scene:stats:verbose")&&Zw.set(t,e)}function t4(){const t=Object.fromEntries(Zw);return Zw.clear(),t}var po={},Ut={};Vf(Ut,{RegistryMode:()=>e4,getAxisModule:()=>gX,getChartModule:()=>fX,getPresetModule:()=>mX,getSeriesModule:()=>yX,hasModule:()=>uX,isEnterprise:()=>xX,isIntegrated:()=>vX,isModuleType:()=>_f,isUmd:()=>SX,listModules:()=>dX,listModulesByType:()=>pX,register:()=>y1,registerModules:()=>cX,reset:()=>hX,setRegistryMode:()=>bX});var e4=(t=>(t.Enterprise="enterprise",t.Integrated="integrated",t.UMD="umd",t))(e4||{}),gx=new Set,kl=new Map;function yz(t){if(kl.set(t.name,t),t.dependencies)for(const e of t.dependencies)y1(e)}function y1(t){const e=kl.get(t.name);if(!e){yz(t);return}if(e.version===t.version){!e.enterprise&&t.enterprise&&yz(t);return}throw new Error([`AG Charts - Module '${t.name}' already registered with different version:`,`${e.version} vs ${t.version}`,"","Check your package.json for conflicting dependencies - depending on your package manager","one of these commands may help:","- npm ls ag-charts-community","- yarn why ag-charts-community"].join(` +`))}function cX(t){for(const e of t.flat())y1(e)}function hX(){gx.clear(),kl.clear()}function uX(t){return kl.has(t)}function*dX(){for(const t of kl.values())yield t}function*pX(t){for(const e of kl.values())_f(t,e)&&(yield e)}function gX(t){const e=kl.get(t);if(_f("axis",e))return e}function fX(t){const e=kl.get(t);if(_f("chart",e))return e;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}function mX(t){const e=kl.get(t);if(_f("preset",e))return e}function yX(t){const e=kl.get(t);if(_f("series",e))return e}function bX(t){gx.add(t)}function xX(){return gx.has("enterprise")}function vX(){return gx.has("integrated")}function SX(){return gx.has("umd")}function _f(t,e){return e?.type===t}var qe=class{constructor(){this.callbacks=new Set}flush(){for(const t of this.callbacks)t();this.callbacks.clear()}merge(t){for(const e of t.callbacks)this.callbacks.add(e)}register(...t){for(const e of t)e&&this.callbacks.add(e)}},Ln=class{constructor(){this.cleanup=new qe}destroy(){this.cleanup.flush()}},Ff="…",au=/\r?\n/g,Rb="​",i4=/[\s.,;:-]{1,5}$/,Ty;function n4(t){if(Ty==null){const i=Ml("Option");Ty=new i().style}Ty.color=t;const e=Ty.color||null;return Ty.color="",e}function ff(t){return t?.ownerDocument.defaultView?.getComputedStyle(t).direction==="rtl"}function tM(t,e){if(!t)return;const{x:i,y:n,width:s,height:a}=MX(e);O0(t.style,"width",s),O0(t.style,"height",a),O0(t.style,"left",i),O0(t.style,"top",n)}function s4(t){const e=Number.parseFloat(t.style.width),i=Number.parseFloat(t.style.height),n=Number.parseFloat(t.style.left),s=Number.parseFloat(t.style.top),a=Number.isFinite(e)?e:t.offsetWidth,o=Number.isFinite(i)?i:t.offsetHeight,r=Number.isFinite(n)?n:t.offsetLeft,l=Number.isFinite(s)?s:t.offsetTop;return{x:r,y:l,width:a,height:o}}function b1(t){if(t.focus({preventScroll:!0}),t.lastChild?.textContent==null)return;const{ownerDocument:e}=t,i=e.createRange();i.setStart(t.lastChild,t.lastChild.textContent.length),i.setEnd(t.lastChild,t.lastChild.textContent.length);const n=e.defaultView?.getSelection();n?.removeAllRanges(),n?.addRange(i)}function a4(){const t=Ml("navigator");if("scheduling"in t){const e=t.scheduling;if("isInputPending"in e)return e.isInputPending({includeContinuous:!0})}return!1}function mu(t){return`ag-charts-icon ag-charts-icon-${t}`}function MX(t){let{x:e,y:i,width:n,height:s}=t;return(n==null||n>0)&&(s==null||s>0)?t:(e!=null&&n!=null&&n<0&&(n=-n,e=e-n),i!=null&&s!=null&&s<0&&(s=-s,i=i-s),{x:e,y:i,width:n,height:s})}function O0(t,e,i){i==null?t.removeProperty(e):t.setProperty(e,`${i}px`)}function go(t){return t!=null}function qt(t){return Array.isArray(t)}function o4(t){return typeof t=="boolean"}function aa(t){return t instanceof Date}function Ac(t){return aa(t)&&!Number.isNaN(Number(t))}function r4(t){return t instanceof RegExp}function Cl(t){return typeof t=="function"}function Bt(t){return typeof t=="object"&&t!==null&&!qt(t)}function Pb(t){return qt(t)||Ie(t)}function Ie(t){return typeof t=="object"&&t!==null&&t.constructor?.name==="Object"}function cb(t){if(typeof t!="object"||t===null)return!1;for(const e in t)return!1;return!0}function zi(t){return typeof t=="string"}function Je(t){return typeof t=="number"}function Ae(t){return Number.isFinite(t)}function x1(t){return t!=null&&t.nodeType===1&&"style"in t}function DX(t,e){return zi(e)&&Object.keys(t).includes(e)}function AX(t,e){return Object.values(t).includes(e)}function hb(t){return typeof t=="symbol"}function l4(t){return zi(t)&&(t==="none"||n4(t)!=null)}function jd(t,e){return t in e}function v1({fontSize:t,fontStyle:e,fontWeight:i,fontFamily:n}){let s="";return e&&e!=="normal"&&(s+=`${e} `),i&&i!=="normal"&&i!==400&&(s+=`${i===700?"bold":i} `),s+=`${t}px`,s+=` ${n}`,s}function nr(t,e=1.15){return Math.round(t*e)}function bi(t){return String(t??"")}function qw(t){return S1(t.replace(i4,""))+Ff}var IX=new Set([1575,1577,1583,1584,1585,1586,1608]);function kX(t){return t>=1568&&t<=1610&&!IX.has(t)}function S1(t){if(!t)return t;const e=t.codePointAt(t.length-1);return kX(e)?t+"‍":t}function c4(t){return Rb+t+Rb}function h4(t){return t.replaceAll(Rb,"")}function u4(t){return qt(t)?JM(t.at(-1)):wu(bi(t))}function wu(t){return t.endsWith(Ff)}function JM(t){return bi(t?.text).endsWith(Ff)}var bz=typeof Intl<"u"&&typeof Intl.Segmenter=="function"?new Intl.Segmenter(void 0,{granularity:"grapheme"}):void 0;function Sc(t){return bz?Array.from(bz.segment(t),e=>e.segment):Array.from(t)}function yu(t,e="and",i=String,n=1/0){if(t.length===0)return"";if(t.length===1)return i(t[0]);t=t.map(i);const s=t.pop();if(t.length>=n){const a=t.length-(n-1);return`${t.slice(0,n-1).join(", ")}, and ${a} more ${e} ${s}`}return`${t.join(", ")} ${e} ${s}`}function zb(t,e=1/0){if(typeof t=="number"){if(Number.isNaN(t))return"NaN";if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity"}const i=JSON.stringify(t)??typeof t;return i.length>e?`${i.slice(0,e)}... (+${i.length-e} characters)`:i}function d4(t){let e=1;for(let i=0;ic),r=new Array(s+1);for(let l=1;l<=a;l++){r[0]=l;for(let c=1;c<=s;c++){const u=n[l-1]===i[c-1]?0:1;r[c]=Math.min(o[c]+1,r[c-1]+1,o[c-1]+u)}[o,r]=[r,o]}return o[s]}function g4(t){return t.replaceAll(CX,(e,i)=>(i>0?"-":"")+e.toLowerCase())}var CX=/[A-Z]+(?![a-z])|[A-Z]/g;function ce(t,e=""){return t==null?e:qt(t)?t.map(i=>bi(i.text)).join(""):zi(t)?t:String(t)}function M1(t,e=0,i){const{leading:n=!1,trailing:s=!0,maxWait:a=1/0}=i??{};let o,r;if(ar=null,e),t(...c);return}let u=e;if(a!==1/0&&r){const d=Date.now()-r;e>a-d&&(u=a-d)}clearTimeout(o),r??(r=Date.now()),o=setTimeout(()=>{r=null,s&&t(...c)},u)}return Object.assign(l,{cancel(){clearTimeout(o),r=null}})}function Qw(t,e,i){const{leading:n=!0,trailing:s=!0}=i??{};let a,o,r=!1;function l(){s&&o?(a=setTimeout(l,e),t(...o)):r=!1,o=null}function c(...u){r?o=u:(r=!0,a=setTimeout(l,e),n?t(...u):o=u)}return Object.assign(c,{cancel(){clearTimeout(a),r=!1,o=null}})}function D1(t,e,i=""){try{return t(...e)}catch(n){const s=i?` \`${i}\``:"";uo(`Uncaught exception in user callback${s}`,n)}}var sr=Symbol("description"),f4=Symbol("required"),eM=Symbol("marked"),tD=Symbol("undocumented"),Bb=Symbol("union"),wX=[["placement","position"],["padding","spacing","gap"],["color","fill","stroke"],["whisker","wick"],["src","url"],["width","thickness"],["show","visible","enabled"]].reduce((t,e)=>{for(const i of e)t.set(i.toLowerCase(),new Set(e.filter(n=>n!==i)));return t},new Map),m4=(t=>(t.Invalid="invalid",t.Required="required",t.Unknown="unknown",t))(m4||{});function Vb(t,e){return Ae(e)?`${t}[${e}]`:t?`${t}.${e}`:e}var ou=class{constructor(t,e,i,n,s){this.type=t,this.description=e,this.value=i,this.path=n,this.key=s}setUnionType(t,e){if(this.path.startsWith(e)){const i=this.path.slice(e.length);this.altPath=`${e}[type=${t}]${i}`}}getPrefix(){const{altPath:t=this.path,key:e}=this;return!t&&!e?"Value":`Option \`${e?Vb(t,e):t}\``}toString(){const{description:t="unknown",type:e,value:i}=this;return e==="required"&&i==null?`${this.getPrefix()} is required and has not been provided; expecting ${t}, ignoring.`:`${this.getPrefix()} cannot be set to \`${zb(i,50)}\`; expecting ${t}, ignoring.`}},eD=class extends ou{constructor(t,e,i,n){super("unknown",void 0,e,i,n),this.suggestions=t,this.key=n}getPrefix(){return`Unknown option \`${Vb(this.altPath??this.path,this.key)}\``}getPostfix(){const t=yu(NX(this.key,this.suggestions),"or",e=>`\`${e}\``);return t?`; Did you mean ${t}? Ignoring.`:", ignoring."}toString(){return`${this.getPrefix()}${this.getPostfix()}`}};function ts(t,e,i=""){if(!Bt(t))return{cleared:null,invalid:[new ou("required","an object",t,i)]};const n={},s=[],a=new Set(Object.keys(t)),o=[];if(Bb in e){const r=Object.keys(e),l=e[Bb];if(t.type!=null&&r.includes(t.type)||t.type==null&&l!=null){const{type:c=l,...u}=t,d=ts(u,e[c],i);Object.assign(n,{type:c},d.cleared);for(const g of d.invalid)g.setUnionType(c,i);s.push(...d.invalid)}else{const c=yu(r,"or",u=>`'${u}'`);s.push(new ou("required",`a keyword such as ${c}`,t.type,i,"type"))}return{cleared:n,invalid:s}}for(const r of Object.keys(e)){const l=e[r],c=l[f4],u=t[r];if(a.delete(r),u===void 0&&(l[tD]||o.push(r),!c))continue;const d=Vb(i,r);if(Cl(l)){const f=l(u,{options:t,path:d});if(typeof f=="object"){if(s.push(...f.invalid),f.valid){n[r]=f.cleared;continue}else if(Xd(f.invalid,d))continue}else if(f){n[r]=u;continue}s.push(new ou(c?"required":"invalid",l[sr],u,i,r))}else{const g=ts(u,l,d);g.cleared!=null&&(n[r]=g.cleared),s.push(...g.invalid)}}for(const r of a){const l=t[r];l!==void 0&&s.push(new eD(o,l,i,r))}return{cleared:n,invalid:s}}function NX(t,e,i=2){const n=t.toLowerCase(),s=wX.get(n);return e.filter(a=>{const o=a.toLowerCase();return s?.has(a)===!0||o.includes(n)||p4(n,o)<=i})}function xe(t,e){if(Cl(t)){let i=function(n,s){return t(n,s)};return i[sr]=e,i}else return{...t,[sr]:e}}function ht(t){return Object.assign(Cl(t)?(e,i)=>t(e,i):Pi(t),{[f4]:!0,[sr]:t[sr]})}function Mt(t){return Object.assign(Cl(t)?(e,i)=>t(e,i):Pi(t),{[tD]:!0,[sr]:t[sr]})}var Pi=(t,e="an object",i=!1)=>xe((n,s)=>{const a=ts(n,t,s.path),o=!Xd(a.invalid,s.path);return{valid:o,cleared:o||!i?a.cleared:null,invalid:a.invalid}},e),xp=(t,e,i)=>({...t,[sr]:e,[Bb]:i}),Me=(...t)=>xe((e,i)=>{const n=[];for(const s of t){const a=s(e,i);if(typeof a=="object"){if(n.push(...a.invalid),!a.valid)return{valid:!1,cleared:e,invalid:n};e=a.cleared}else if(!a)return!1}return{valid:!0,cleared:e,invalid:n}},yu(t.filter(e=>!e[tD]).map(e=>e[sr]).filter(go),"and")),Xt=(...t)=>xe((e,i)=>{for(const n of t){const s=n(e,i);if(typeof s=="object"?s.valid:s)return s}return!1},yu(t.filter(e=>!e[tD]).map(e=>e[sr]).filter(go),"or")),mf=t=>Ae(t)||Ac(t),TX=t=>aa(t)||(Ae(t)||zi(t))&&Ac(new Date(t)),wl=xe(qt,"an array"),J=xe(o4,"a boolean"),ai=xe(Cl,"a function"),It=xe(l4,"a color string"),_s=xe(TX,"a date"),jt=xe(go,"a defined value"),gt=xe(Ae,"a number"),Nu=xe(Bt,"an object"),K=xe(zi,"a string"),A1=xe(x1,"an html element"),Tu=(t,e=1/0)=>{let i;return e===1/0?i=`an array of at least ${t} items`:t===e?i=`an array of exactly ${t} items`:t===0?i=`an array of no more than ${e} items`:i=`an array of at least ${t} and no more than ${e} items`,xe(n=>qt(n)&&n.length>=t&&n.length<=e,i)},I1=(t,e=1/0)=>{let i;return e===1/0?i=`a string of at least ${t} characters`:t===e?i=`an string of exactly ${t} characters`:t===0?i=`an string of no more than ${e} characters`:i=`an string of at least ${t} and no more than ${e} characters`,xe(n=>zi(n)&&n.length>=t&&n.length<=e,i)},k1=(t,e=!0)=>xe(i=>Ae(i)&&(i>t||e&&i===t),`a number greater than ${e?"or equal to ":""}${t}`),y4=(t,e)=>xe(i=>Ae(i)&&i>=t&&i<=e,`a number between ${t} and ${e} inclusive`),X=k1(0),bo=k1(0,!1),Ot=y4(0,1),Fs=t=>xe((e,{options:i})=>!mf(e)||!mf(i[t])||exe((e,{options:i})=>!mf(e)||!mf(i[t])||e<=i[t],`the value to be less than or equal to \`${t}\``),Hs=t=>xe((e,{options:i})=>!mf(e)||!mf(i[t])||e>i[t],`the value to be greater than \`${t}\``);function dt(...t){Bt(t[0])&&(t=Object.values(t[0]));const e=yu(t,"or",i=>`'${i}'`);return xe(i=>t.includes(i),`a keyword such as ${e}`)}function fx(){return dt}var Jt=t=>xe(e=>t===e,`the value ${JSON.stringify(t)}`),LX=(t,e)=>xe(i=>i instanceof t,e??`an instance of ${t.name}`),Ft=(t,e,i=!0)=>xe((n,s)=>{if(!qt(n))return!1;let a=i;const o=[],r=[],l=c=>{a=i?a&&c:a||c};if(n.length===0)return{valid:!0,cleared:o,invalid:r};for(let c=0;cxe((i,n)=>{if(!qt(i))return!1;const s=[],a=[];for(let o=0;oxe((i,n)=>{if(!Cl(i))return!1;if(eM in i)return!0;const s=e??t[sr];return{valid:!0,cleared:Object.assign((...o)=>{const r=D1(i,o);if(r==null)return;const l=t(r,{options:r,path:""});if(typeof l=="object"){if(x4(l,n,s,r),l.valid)return l.cleared}else{if(l)return r;uo(`Callback \`${n.path}\` returned an invalid value \`${zb(r,50)}\`; expecting ${s}, ignoring.`)}},{[eM]:!0}),invalid:[]}},"a function"),Be=(t,e="an object")=>xe((i,n)=>{if(!Cl(i))return!1;if(eM in i)return!0;const s=e;return{valid:!0,cleared:Object.assign((...o)=>{const r=D1(i,o,n.path);if(r==null)return;const l=ts(r,t);return x4(l,n,s,r),l.cleared},{[eM]:!0}),invalid:[]}},"a function");function Xd(t,e){return t.some(i=>i.type==="required"&&i.path===e)}function x4(t,e,i,n){if(t.invalid.length!==0){if(qt(n)){const s=i??t.invalid[0]?.description??"a valid value";return uo(`Callback \`${e.path}\` returned an invalid value \`${zb(n,50)}\`; expecting ${s}, ignoring.`)}for(const s of t.invalid){if(s instanceof eD)return uo(`Callback \`${e.path}\` returned an unknown property \`${Vb(s.path,s.key)}\`${s.getPostfix()}`);const a=zb(s.value,50);uo(s.key?`Callback \`${e.path}\` returned an invalid property \`${Vb(s.path,s.key)}\`: \`${a}\`; expecting ${s.description}, ignoring.`:`Callback \`${e.path}\` returned an invalid value \`${a}\`; expecting ${i??s.description}, ignoring.`)}}}function Nt(t,e,i){return Math.min(i,Math.max(t,e))}function v4(t,e,i=1e-10){return t>=e[0]-i&&t<=e[1]+i}function be(t,e,i=1e-10){return t===e||Math.abs(t-e)=1e21){let s;[e,s]=e.split("e"),s!=null&&(i=Number(s))}const n=e.split(".")[1]?.length??0;return Math.max(n-i,0)}var A4=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,I4=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/;function k4(t){if(!zi(t))return!1;const e=I4.exec(t);return A4.test(e?e[2]:t)}function iD(t){let e,i;const n=I4.exec(t);n&&([,e,t,i]=n);const s=A4.exec(t);if(!s){uo(`The number formatter is invalid: ${t}`);return}const[,a,o,r,l,c,u,d,g,f,y]=s;return{fill:a,align:o,sign:r,symbol:l,zero:c,width:Number.parseInt(u),comma:d,precision:Number.parseInt(g),trim:!!f,type:y,prefix:e,suffix:i}}function C1(t){const e=typeof t=="string"?iD(t):t;if(e==null)return;const{fill:i,align:n,sign:s="-",symbol:a,zero:o,width:r,comma:l,type:c,prefix:u="",suffix:d="",precision:g}=e;let{trim:f}=e;const y=g==null||Number.isNaN(g);let x;if(!c)x=Ko.g,f=!0;else if(c in Ko&&c in qg)x=y?qg[c]:Ko[c];else if(c in Ko)x=Ko[c];else if(c in qg)x=qg[c];else throw new Error(`The number formatter type is invalid: ${c}`);const S=c?6:12;let D;y||(D=g);let A=n,I=i;return o&&(I??(I="0"),A??(A="=")),(w,N)=>{let O;D!=null?O=D:c==="f"||c==="%"?O=N??S:c?O=S:O=N??S;let L=x(w,O);f&&(L=RX(L)),l&&(L=PX(L,l));const R=_X(a,c),P=R?.length??0;R&&(L=`${R}${L}`),c==="s"&&(L=`${L}${zX(w)}`),(c==="%"||c==="p")&&(L=`${L}%`);const{value:B,prefixLength:F}=BX(w,L,s),H=F+P;let $=B;return r!=null&&!Number.isNaN(r)&&($=VX($,r,I??" ",A,H)),$=`${u}${$}${d}`,$}}var qg={b:t=>E0(t).toString(2),c:t=>String.fromCodePoint(t),d:t=>Math.round(Math.abs(t)).toFixed(0),o:t=>E0(t).toString(8),x:t=>E0(t).toString(16),X:t=>qg.x(t).toUpperCase(),n:t=>qg.d(t),"%":t=>`${E0(t*100).toFixed(0)}`},Ko={e:(t,e)=>Math.abs(t).toExponential(e),E:(t,e)=>Ko.e(t,e).toUpperCase(),f:(t,e)=>Math.abs(t).toFixed(e),F:(t,e)=>Ko.f(t,e).toUpperCase(),g:(t,e)=>{if(t===0)return"0";const i=Math.abs(t),n=Math.floor(Math.log10(i));return n>=-4&&nKo.g(t,e).toUpperCase(),n:(t,e)=>Ko.g(t,e),p:(t,e)=>Ko.r(t*100,e),r:(t,e)=>{if(t===0)return"0";const i=Math.abs(t),s=Math.floor(Math.log10(i))-(e-1);if(s<=0)return i.toFixed(-s);const a=10**s;return(Math.round(i/a)*a).toFixed()},s:(t,e)=>{const i=N4(t);return Ko.r(t/10**i,e)},"%":(t,e)=>Ko.f(t*100,e)},C4=-24,w4=24,OX={[C4]:"y",[-21]:"z",[-18]:"a",[-15]:"f",[-12]:"p",[-9]:"n",[-6]:"µ",[-3]:"m",0:"",3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",[w4]:"Y"},EX="−";function E0(t){return Math.floor(Math.abs(t))}function RX(t){if(!t.endsWith("0")||!t.includes("."))return t;let e=t.length-1;for(;e>0;)if(t[e]=="0")e-=1;else if(t[e]=="."){e-=1;break}else break;return t.substring(0,e+1)}function PX(t,e){let i=t.indexOf(".");i<0&&(i=t.length);const n=t.substring(0,i).split(""),s=t.substring(i);for(let a=n.length-3;a>0;a-=3)n.splice(a,0,e);return`${n.join("")}${s}`}function zX(t){return OX[N4(t)]}function N4(t){return Nt(C4,t?Math.floor(Math.log10(Math.abs(t))/3)*3:0,w4)}function BX(t,e,i=""){if(i==="(")return t>=0?{value:e,prefixLength:0}:{value:`(${e})`,prefixLength:1};let n="";return t<0?n=EX:i==="+"?n="+":i===" "&&(n=" "),{value:`${n}${e}`,prefixLength:n.length}}function VX(t,e,i=" ",n=">",s=0){const a=e-t.length;if(a<=0)return t;const o=i.repeat(a);if(n==="="){const r=Math.min(Math.max(s,0),t.length),l=t.slice(0,r),c=t.slice(r);return`${l}${o}${c}`}if(n===">"||!n)return o+t;if(n==="<")return`${t}${o}`;if(n==="^"){const r=Math.ceil(a/2),l=Math.floor(a/2);return`${i.repeat(r)}${t}${i.repeat(l)}`}return o+t}function _X(t,e){if(t==="#")switch(e){case"b":return"0b";case"o":return"0o";case"x":return"0x";case"X":return"0X";default:return""}return t??""}var Fb=t=>{if(!Bt(t))return!1;const e=Object.keys(t);return e.length===1&&e[0].startsWith("$")},FX=Pi({color:It,stop:Ot},""),w1=xe(t=>{let e=-1/0;for(const i of t)if(i?.stop!=null){if(i.stop{let i;if(typeof t=="string")tN.includes(t)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new ou("invalid",`a legend placement string: ["${tN.join('", "')}"]`,t,e.path)));else{const{cleared:n,invalid:s}=ts(t,UX);i={valid:s.length===0,cleared:n,invalid:s}}return i},"a legend position object or placement string"),xu=Xt(dt("circle","cross","diamond","heart","plus","pin","square","star","triangle"),ai),R4=dt("never","always","hyphenate","on-space"),sM=dt("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),rD=Xt(X,dt("exact","nearest","area")),P4=Xt(X,dt("exact","nearest")),xo=Xt(K,gt,_s,Xi({text:ht(K),...De},"text segments array")),db={enabled:J,text:xo,textAlign:dt("left","center","right"),wrapping:dt("never","always","hyphenate","on-space"),spacing:X,maxWidth:X,maxHeight:X,...De};db.padding=Mt(X);db.truncate=Mt(J);var R0={enabled:J,text:xo,renderer:Is(Xt(K,A1))},hC=["defaults","download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series","separator"],z4={type:dt("action","separator"),showOn:dt("always","series-area","series-node","legend-item"),label:ht(K),enabled:J,action:ai,items:(t,e)=>aM(t,e)};z4.iconUrl=Mt(K);var WX=Pi(z4),KX=xe((t,e)=>{let i;return typeof t=="string"?hC.includes(t)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new ou("invalid",`a context menu item string alias: ["${hC.join('", "')}"]`,t,e.path))):i=WX(t,e),i},`a context menu item object or string alias: [${hC.join(", ")}]`),aM=Ft(KX,"a menu items array",!1),Zh={label:K,ariaLabel:K,tooltip:K,iconPosition:dt("before","after"),icon:dt("align-center","align-left","align-right","arrow-drawing","arrow-down-drawing","arrow-up-drawing","callout-annotation","candlestick-series","chevron-filled-down","chevron-right","close","comment-annotation","date-range-drawing","date-price-range-drawing","delete","disjoint-channel-drawing","drag-handle","fill-color","line-style-solid","line-style-dashed","line-style-dotted","high-low-series","hlc-series","hollow-candlestick-series","horizontal-line-drawing","line-color","line-series","line-with-markers-series","locked","measurer-drawing","note-annotation","ohlc-series","pan-end","pan-left","pan-right","pan-start","parallel-channel-drawing","position-bottom","position-center","position-top","price-label-annotation","price-range-drawing","reset","settings","step-line-series","text-annotation","trend-line-drawing","fibonacci-retracement-drawing","fibonacci-retracement-trend-based-drawing","unlocked","vertical-line-drawing","zoom-in","zoom-out")},vr=Xt(K,Is(xo)),B4=Pi({x:vr,y:vr,angle:vr,radius:vr,size:vr,color:vr,label:vr,secondaryLabel:vr,sectorLabel:vr,calloutLabel:vr,legendItem:vr}),_r=xe(k4,"a valid number format string"),vp=dt("millisecond","second","minute","hour","day","month","year"),V4={unit:ht(vp),step:bo,epoch:_s,utc:J};V4.every=ai;var jf=Pi(V4,"a time interval object"),Zt={width:X,height:X,minWidth:X,minHeight:X,suppressFieldDotNotation:J,title:db,subtitle:db,footnote:db,padding:{top:X,right:X,bottom:X,left:X},seriesArea:{border:Zd,clip:J,cornerRadius:gt,padding:Ar},legend:{enabled:J,position:nM,orientation:dt("horizontal","vertical"),maxWidth:X,maxHeight:X,spacing:X,border:Zd,cornerRadius:gt,padding:Ar,fill:Ga,fillOpacity:Ot,preventHidingAll:J,reverseOrder:J,toggleSeries:J,item:{marker:{size:X,shape:xu,padding:X,strokeWidth:X},line:{length:X,strokeWidth:X},label:{maxLength:X,formatter:ai,...De},maxWidth:X,paddingX:X,paddingY:X,showSeriesStroke:J},pagination:{marker:{size:X,shape:xu,padding:X},activeStyle:{...wt,...bt},inactiveStyle:{...wt,...bt},highlightStyle:{...wt,...bt},label:De},listeners:{legendItemClick:ai,legendItemDoubleClick:ai}},gradientLegend:{enabled:J,position:nM,spacing:X,reverseOrder:J,border:Zd,cornerRadius:gt,padding:Ar,fill:Ga,fillOpacity:Ot,gradient:{preferredLength:X,thickness:X},scale:{label:{...De,minSpacing:X,format:_r,formatter:ai},padding:X,interval:{step:gt,values:wl,minSpacing:Me(X,Fs("maxSpacing")),maxSpacing:Me(X,Hs("minSpacing"))}}},listeners:{seriesNodeClick:ai,seriesNodeDoubleClick:ai,seriesVisibilityChange:ai,activeChange:ai,click:ai,doubleClick:ai,annotations:ai,zoom:ai},loadGoogleFonts:J,highlight:{drawingMode:dt("overlay","cutout"),range:dt("tooltip","node")},overlays:{loading:R0,noData:R0,noVisibleSeries:R0,unsupportedBrowser:R0},tooltip:{enabled:J,showArrow:J,pagination:J,delay:X,range:rD,wrapping:R4,mode:dt("single","shared","compact"),position:{anchorTo:dt("pointer","node","chart"),placement:Xt(sM,Ft(sM)),xOffset:gt,yOffset:gt}},animation:jt,flashOnUpdate:jt,contextMenu:jt,context:()=>!0,dataSource:{getData:ai},keyboard:{enabled:J,tabIndex:gt,initialFocus:fx()("data-start","data-end","viewport-start","viewport-end")},touch:{dragAction:dt("none","drag","hover")},ranges:{enabled:J,enableOutOfRange:J,position:dt("top-left","top","top-right","bottom-left","bottom","bottom-right"),spacing:X,button:{...ia,...bt,textColor:It,...De,cornerRadius:X,padding:Ar,active:{...ia,stroke:bt.stroke,textColor:It},disabled:{...ia,stroke:bt.stroke,textColor:It},hover:{...ia,stroke:bt.stroke,textColor:It}},dropdown:{visible:dt("auto","always","never"),...ia,...bt,textColor:It,...De,cornerRadius:X,padding:Ar,active:{...ia,stroke:bt.stroke,textColor:It},disabled:{...ia,stroke:bt.stroke,textColor:It},hover:{...ia,stroke:bt.stroke,textColor:It}},gap:X,...ia,...bt,textColor:It,...De,cornerRadius:X,padding:Ar,active:{...ia,stroke:bt.stroke,textColor:It},disabled:{...ia,stroke:bt.stroke,textColor:It},hover:{...ia,stroke:bt.stroke,textColor:It},buttons:Xi({...Zh,enabled:J,value:Xt(gt,Me(Ft(Xt(gt,_s)),Tu(2,2)),jf,vp,ai)},"range button options array")},locale:{localeText:Nu,getLocaleText:Is(K)},background:{visible:J,fill:It,image:{url:ht(K),top:gt,right:gt,bottom:gt,left:gt,width:X,height:X,opacity:Ot}},styleNonce:K,sync:jt,zoom:jt,scrollbar:jt,formatter:Xt(Is(xo),B4),enableRtl:J};Zt.highlight.enabled=Mt(J);Zt.dataSource.requestThrottle=Mt(X);Zt.dataSource.updateThrottle=Mt(X);Zt.dataSource.updateDuringInteraction=Mt(J);Zt.statusBar=Mt(jt);Zt.ranges.minSize=Mt(X);Zt.foreground=Mt({visible:J,text:K,image:{url:K,top:gt,right:gt,bottom:gt,left:gt,width:X,height:X,opacity:Ot},...wt});Zt.overrideDevicePixelRatio=Mt(gt);Zt.sync.domainMode=Mt(dt("direction","position","key"));Zt.displayNullData=Mt(J);var Ee={cursor:K,context:()=>!0,showInLegend:J,nodeClickRange:rD,listeners:{seriesNodeClick:ai,seriesNodeDoubleClick:ai},highlight:T1(Si)};Ee.allowNullKeys=Mt(J);var _e={...Ee,id:K,visible:J,context:()=>!0,data:wl};_e.seriesGrouping=Mt(jt);var Lu={shape:xu,size:X,...wt,...bt,...Lt},Lr={enabled:J,itemStyler:Be({...wt,...bt,...Lt,shape:xu,size:X}),...Lu},ei={enabled:J,formatter:Is(xo),format:_r,itemStyler:Be({enabled:J,...qo,...De}),...qo,...De},vu={...ei,lineHeight:X,minimumFontSize:X,wrapping:R4,overflowStrategy:dt("ellipsis","hide")},mx={visible:J,cap:{visible:J,length:X,lengthRatio:Ot,...bt,...Lt},...bt,...Lt},lD={...mx,xLowerKey:K,xUpperKey:K,yLowerKey:K,yUpperKey:K,xLowerName:K,xUpperName:K,yLowerName:K,yUpperName:K,itemStyler:Be({visible:J,...bt,...Lt,cap:{visible:J,length:X,lengthRatio:Ot,...bt,...Lt}})},Re={enabled:J,showArrow:J,range:P4,renderer:Is(Xt(K,gt,_s,Pi({heading:K,title:K,symbol:{marker:{enabled:J,shape:xu,...wt,stroke:It,strokeOpacity:Ot,strokeWidth:X,...Lt},line:{enabled:J,stroke:It,strokeWidth:X,strokeOpacity:Ot,...Lt}},data:Xi({label:ht(K),value:ht(Xt(K,gt,_s))})},"tooltip renderer result object"))),position:{anchorTo:dt("node","pointer","chart"),placement:Xt(sM,Ft(sM)),xOffset:gt,yOffset:gt},interaction:{enabled:J}},_4={...Re,range:rD},Nl={enabled:J,xOffset:gt,yOffset:gt,blur:X,color:It},cD=xp({linear:{},smooth:{tension:Ot},step:{position:dt("start","middle","end")}},"interpolation line options"),oM=Symbol("BREAK"),pb="__decorator_config",P0="__decorator_accessors";function b(t,e){L1(t,e).optional=!0}function L1(t,e){if(Object.getOwnPropertyDescriptor(t,pb)==null&&Object.defineProperty(t,pb,{value:{}}),Object.getOwnPropertyDescriptor(t,P0)==null){const u=Object.getPrototypeOf(t)?.[P0]?.slice()??[];Object.defineProperty(t,P0,{value:u})}const i=t[pb],n=e.toString();if(i[n]!=null)return i[n];i[n]={setters:[],getters:[],observers:[]};const s=Object.getOwnPropertyDescriptor(t,e);let a=s?.get,o=s?.set;if(a==null||o==null){const c=t[P0];let u=c.indexOf(e);u===-1&&(u=c.push(e)-1),a??(a=function(){let d=this.__accessors;return d==null&&(d=c.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:d})),d[u]}),o??(o=function(d){let g=this.__accessors;g==null&&(g=c.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:g})),g[u]=d})}return Object.defineProperty(t,e,{set:function(c){const{setters:u,observers:d}=i[n];let g;u.some(f=>f.length>2)&&(g=a.call(this));for(const f of u)if(c=f(this,e,c,g),c===oM)return;o.call(this,c);for(const f of d)f(this,c,g)},get:function(){let c=a.call(this);for(const u of i[n].getters)if(c=u(this,e,c),c===oM)return;return c},enumerable:!0,configurable:!1}),i[n]}function Su(t,e,i){return(n,s)=>{const a=L1(n,s);a.setters.push(t),e&&a.getters.unshift(e),i&&Object.assign(a,i)}}function O1(t){return(e,i)=>{L1(e,i).observers.push(t)}}function hD(t){return t!==void 0&&pb in t}function ru(t){const e=new Set;for(;hD(t);)e.add(t?.[pb]),t=Object.getPrototypeOf(t);return Array.from(e).flatMap(i=>Object.keys(i))}function F4(t){return ru(t).reduce((e,i)=>(e[String(i)]=t[i]??null,e),{})}function*Mu(...t){for(const e of t)e!=null&&(e[Symbol.iterator]?yield*e:yield e)}function H4(t){return t!=null&&typeof t=="object"&&Symbol.iterator in t?t:[t]}function Ra(t){for(const e of t)return e;throw new Error("AG Charts - no first() value found")}function*Xe(t){const e=[void 0,void 0];for(const i of Object.keys(t))e[0]=i,e[1]=t[i],yield e}function hl(t){return Object.keys(t)}function ks(t,e){return Array.isArray(t)?!Array.isArray(e)||t.length!==e.length?!1:t.every((i,n)=>ks(i,e[n])):Ie(t)?Ie(e)?E1(t,e,ks):!1:t===e}function E1(t,e,i){if(Object.is(t,e))return!0;for(const n of Object.keys(e))if(!(n in t))return!1;for(const n of Object.keys(t))if(!(n in e)||!i(t[n],e[n]))return!1;return!0}function Et(...t){const e={};for(const i of t){if(!Bt(i))continue;const n=hD(i)?ru(i):Object.keys(i);for(const s of n)Ie(e[s])&&Ie(i[s])?e[s]=Et(e[s],i[s]):e[s]??(e[s]=i[s])}return e}function Hb(...t){const e={};for(const i of t){if(!Bt(i))continue;const n=hD(i)?ru(i):Object.keys(i);for(const s of n)Ie(e[s])&&Ie(i[s])?e[s]=Hb(e[s],i[s]):s in e||(e[s]??(e[s]=i[s]))}return e}function YX(t,...e){return e&&qt(t)?t.map(i=>Et(i,...e)):t}function af(t,e){const i={};for(const[n,s]of Xe(t))i[n]=e(s,n,t);return i}function At(t,e){const i={...t};for(const n of e)delete i[n];return i}function PS(t,e){if(t==null)return;const i={};for(const n of e)Object.hasOwn(t,n)&&(i[n]=t[n]);return i}function j4(t,e){if(t==null)return!0;for(const[i,n]of Xe(t))if(!e(i,n))return!1;return!0}function G4(t){const e={};if(t==null)return e;for(const[i,n]of t)e[i]=n;return e}function R1(t,e){return(qt(e)?e:e.split(".")).reduce((n,s)=>n[s],t)}var P1=new Set(["__proto__","constructor","prototype"]);function z1(t,e,i){const n=qt(e)?e.slice():e.split("."),s=n.pop();if(n.some(o=>P1.has(o)))return;const a=n.reduce((o,r)=>o[r],t);return a[s]=i,a[s]}function rM(t,e,i){if(i===void 0)return e;for(const n of t){const s=i[n];s!==void 0&&(e[n]=s)}return e}function eN(t,e,i){const n=i??Object.keys(e);for(let s=0,a=n.length;s(t[t.SMALLEST=8]="SMALLEST",t[t.SMALLER=10]="SMALLER",t[t.SMALL=12]="SMALL",t[t.MEDIUM=13]="MEDIUM",t[t.LARGE=14]="LARGE",t[t.LARGEST=17]="LARGEST",t))(zc||{}),Wh=12,Cn={SMALLEST:8/Wh,SMALLER:10/Wh,SMALL:12/Wh,MEDIUM:13/Wh,LARGE:14/Wh,LARGEST:17/Wh},he=(t=>(t.TOP="top",t.TOP_RIGHT="top-right",t.TOP_LEFT="top-left",t.RIGHT="right",t.RIGHT_TOP="right-top",t.RIGHT_BOTTOM="right-bottom",t.BOTTOM="bottom",t.BOTTOM_RIGHT="bottom-right",t.BOTTOM_LEFT="bottom-left",t.LEFT="left",t.LEFT_TOP="left-top",t.LEFT_BOTTOM="left-bottom",t))(he||{}),ie=(t=>(t.CATEGORY="category",t.GROUPED_CATEGORY="grouped-category",t.ORDINAL_TIME="ordinal-time",t.UNIT_TIME="unit-time",t.TIME="time",t.NUMBER="number",t.LOG="log",t))(ie||{}),sn=(t=>(t.ANGLE_CATEGORY="angle-category",t.ANGLE_NUMBER="angle-number",t.RADIUS_CATEGORY="radius-category",t.RADIUS_NUMBER="radius-number",t))(sn||{}),yf=(t=>(t.CIRCLE="circle",t.POLYGON="polygon",t))(yf||{}),yd=(t,e,i)=>t*(1-i)+e*i,uC=t=>{const e=t<0?-1:1,i=Math.abs(t);return i<=.04045?t/12.92:e*((i+.055)/1.055)**2.4},dC=t=>{const e=t<0?-1:1,i=Math.abs(t);return i>.0031308?e*(1.055*i**(1/2.4)-.055):12.92*t},K4=class je{constructor(e,i,n,s=1){this.r=Nt(0,e||0,1),this.g=Nt(0,i||0,1),this.b=Nt(0,n||0,1),this.a=Nt(0,s||0,1)}static validColorString(e){return e.includes("#")?!!je.parseHex(e):e.includes("rgb")?!!je.stringToRgba(e):je.nameToHex.has(e.toLowerCase())}static fromString(e){if(e.includes("#"))return je.fromHexString(e);const i=je.nameToHex.get(e.toLowerCase());if(i)return je.fromHexString(i);if(e.includes("rgb"))return je.fromRgbaString(e);throw new Error(`Invalid color string: '${e}'`)}static parseHex(e){e=e.replaceAll(" ","").slice(1);let i;switch(e.length){case 6:case 8:i=[];for(let n=0;nNumber.parseInt(n,16)).map(n=>n+n*16);break}if(i?.length>=3&&i.every(n=>n>=0))return i.length===3&&i.push(255),i}static fromHexString(e){const i=je.parseHex(e);if(i){const[n,s,a,o]=i;return new je(n/255,s/255,a/255,o/255)}throw new Error(`Malformed hexadecimal color string: '${e}'`)}static stringToRgba(e){let i=-1,n=-1;for(let r=0;r=0?f:f+360;return[y,x,S]}static OKLCHtoRGB(e,i,n){const s=e,a=i*Math.cos(n*Math.PI/180),o=i*Math.sin(n*Math.PI/180),r=(s+.3963377774*a+.2158037573*o)**3,l=(s-.1055613458*a-.0638541728*o)**3,c=(s-.0894841775*a-1.291485548*o)**3,u=4.0767416621*r-3.3077115913*l+.2309699292*c,d=-1.2684380046*r+2.6097574011*l-.3413193965*c,g=-.0041960863*r-.7034186147*l+1.707614701*c,f=dC(u),y=dC(d),x=dC(g);return[f,y,x]}static RGBtoHSL(e,i,n){const s=Math.min(e,i,n),a=Math.max(e,i,n),o=(a+s)/2;let r,l;if(a===s)r=0,l=0;else{const c=a-s;l=o>.5?c/(2-a-s):c/(a+s),a===e?r=(i-n)/c+(i1&&(u-=1),u<1/6?a+(s-a)*6*u:u<1/2?s:u<2/3?a+(s-a)*(2/3-u)*6:a}const r=o(e/360+1/3),l=o(e/360),c=o(e/360-1/3);return[r,l,c]}static RGBtoHSB(e,i,n){const s=Math.min(e,i,n),a=Math.max(e,i,n),o=a===0?0:(a-s)/a;let r=0;if(s!==a){const l=a-s,c=(a-e)/l,u=(a-i)/l,d=(a-n)/l;e===a?r=d-u:i===a?r=2+c-d:r=4+u-c,r/=6,r<0&&(r=r+1)}return[r*360,o,a]}static HSBtoRGB(e,i,n){e=(e%360+360)%360/360;let s=0,a=0,o=0;if(i===0)s=a=o=n;else{const r=(e-Math.floor(e))*6,l=r-Math.floor(r),c=n*(1-i),u=n*(1-i*l),d=n*(1-i*(1-l));switch(Math.trunc(r)){case 0:s=n,a=d,o=c;break;case 1:s=u,a=n,o=c;break;case 2:s=c,a=n,o=d;break;case 3:s=c,a=u,o=n;break;case 4:s=d,a=c,o=n;break;case 5:s=n,a=c,o=u;break}}return[s,a,o]}static mix(e,i,n){return new je(yd(e.r,i.r,n),yd(e.g,i.g,n),yd(e.b,i.b,n),yd(e.a,i.a,n))}static lighten(e,i){const n=je.RGBtoOKLCH(e.r,e.g,e.b);return je.fromOKLCH(Nt(0,n[0]+i,1),n[1],n[2])}static darken(e,i){const n=je.RGBtoOKLCH(e.r,e.g,e.b);return je.fromOKLCH(Nt(0,n[0]-i,1),n[1],n[2])}static interpolate(e,i){const n=1/(e.length-1),s=e.map(a=>je.RGBtoOKLCH(a.r,a.g,a.b));return Array.from({length:i},(a,o)=>{const r=o/(i-1),l=e.length<=2?0:Math.min(Math.floor(r*(e.length-1)),e.length-2),c=(r-l*n)/n,u=s[l],d=s[l+1];return je.fromOKLCH(yd(u[0],d[0],c),yd(u[1],d[1],c),yd(u[2],d[2],c))})}};K4.nameToHex=new Map([["aliceblue","#F0F8FF"],["antiquewhite","#FAEBD7"],["aqua","#00FFFF"],["aquamarine","#7FFFD4"],["azure","#F0FFFF"],["beige","#F5F5DC"],["bisque","#FFE4C4"],["black","#000000"],["blanchedalmond","#FFEBCD"],["blue","#0000FF"],["blueviolet","#8A2BE2"],["brown","#A52A2A"],["burlywood","#DEB887"],["cadetblue","#5F9EA0"],["chartreuse","#7FFF00"],["chocolate","#D2691E"],["coral","#FF7F50"],["cornflowerblue","#6495ED"],["cornsilk","#FFF8DC"],["crimson","#DC143C"],["cyan","#00FFFF"],["darkblue","#00008B"],["darkcyan","#008B8B"],["darkgoldenrod","#B8860B"],["darkgray","#A9A9A9"],["darkgreen","#006400"],["darkgrey","#A9A9A9"],["darkkhaki","#BDB76B"],["darkmagenta","#8B008B"],["darkolivegreen","#556B2F"],["darkorange","#FF8C00"],["darkorchid","#9932CC"],["darkred","#8B0000"],["darksalmon","#E9967A"],["darkseagreen","#8FBC8F"],["darkslateblue","#483D8B"],["darkslategray","#2F4F4F"],["darkslategrey","#2F4F4F"],["darkturquoise","#00CED1"],["darkviolet","#9400D3"],["deeppink","#FF1493"],["deepskyblue","#00BFFF"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1E90FF"],["firebrick","#B22222"],["floralwhite","#FFFAF0"],["forestgreen","#228B22"],["fuchsia","#FF00FF"],["gainsboro","#DCDCDC"],["ghostwhite","#F8F8FF"],["gold","#FFD700"],["goldenrod","#DAA520"],["gray","#808080"],["green","#008000"],["greenyellow","#ADFF2F"],["grey","#808080"],["honeydew","#F0FFF0"],["hotpink","#FF69B4"],["indianred","#CD5C5C"],["indigo","#4B0082"],["ivory","#FFFFF0"],["khaki","#F0E68C"],["lavender","#E6E6FA"],["lavenderblush","#FFF0F5"],["lawngreen","#7CFC00"],["lemonchiffon","#FFFACD"],["lightblue","#ADD8E6"],["lightcoral","#F08080"],["lightcyan","#E0FFFF"],["lightgoldenrodyellow","#FAFAD2"],["lightgray","#D3D3D3"],["lightgreen","#90EE90"],["lightgrey","#D3D3D3"],["lightpink","#FFB6C1"],["lightsalmon","#FFA07A"],["lightseagreen","#20B2AA"],["lightskyblue","#87CEFA"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#B0C4DE"],["lightyellow","#FFFFE0"],["lime","#00FF00"],["limegreen","#32CD32"],["linen","#FAF0E6"],["magenta","#FF00FF"],["maroon","#800000"],["mediumaquamarine","#66CDAA"],["mediumblue","#0000CD"],["mediumorchid","#BA55D3"],["mediumpurple","#9370DB"],["mediumseagreen","#3CB371"],["mediumslateblue","#7B68EE"],["mediumspringgreen","#00FA9A"],["mediumturquoise","#48D1CC"],["mediumvioletred","#C71585"],["midnightblue","#191970"],["mintcream","#F5FFFA"],["mistyrose","#FFE4E1"],["moccasin","#FFE4B5"],["navajowhite","#FFDEAD"],["navy","#000080"],["oldlace","#FDF5E6"],["olive","#808000"],["olivedrab","#6B8E23"],["orange","#FFA500"],["orangered","#FF4500"],["orchid","#DA70D6"],["palegoldenrod","#EEE8AA"],["palegreen","#98FB98"],["paleturquoise","#AFEEEE"],["palevioletred","#DB7093"],["papayawhip","#FFEFD5"],["peachpuff","#FFDAB9"],["peru","#CD853F"],["pink","#FFC0CB"],["plum","#DDA0DD"],["powderblue","#B0E0E6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#FF0000"],["rosybrown","#BC8F8F"],["royalblue","#4169E1"],["saddlebrown","#8B4513"],["salmon","#FA8072"],["sandybrown","#F4A460"],["seagreen","#2E8B57"],["seashell","#FFF5EE"],["sienna","#A0522D"],["silver","#C0C0C0"],["skyblue","#87CEEB"],["slateblue","#6A5ACD"],["slategray","#708090"],["slategrey","#708090"],["snow","#FFFAFA"],["springgreen","#00FF7F"],["steelblue","#4682B4"],["tan","#D2B48C"],["teal","#008080"],["thistle","#D8BFD8"],["tomato","#FF6347"],["transparent","#00000000"],["turquoise","#40E0D0"],["violet","#EE82EE"],["wheat","#F5DEB3"],["white","#FFFFFF"],["whitesmoke","#F5F5F5"],["yellow","#FFFF00"],["yellowgreen","#9ACD32"]]);var se=K4,Y4={x:{position:"bottom",type:{$if:[{$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},"number","category"]}},y:{position:"left",type:{$if:[{$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},"category","number"]}}},$X={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillFallback"},{$palette:"fill"}]},XX={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillsFallback"},{$palette:"fills"}]},bx={$if:[{$isGradient:{$palette:"fill"}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},xx={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},[{$palette:"fillFallback"},{$palette:"fillFallback"}],{$palette:"range2"}]},ZX={type:"gradient",gradient:"linear",bounds:"item",colorStops:[{color:"black"}],rotation:0,reverse:!1,colorSpace:"rgb"},Tl={type:"gradient",gradient:"linear",bounds:"item",colorStops:{$shallow:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]}},rotation:0,reverse:!1,colorSpace:"rgb"},$4={...Tl,colorStops:{$shallow:[{color:{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"black",.15]}},{color:{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"white",.15]}}]}},qX={...Tl,colorStops:{$map:[{color:{$value:"$1"}},{$path:["/0",void 0,{$palette:"gradients"}]}]}},B1=t=>({...Tl,colorStops:{$shallow:{$if:[{$or:[{$isGradient:{$palette:`${t}.fill`}},{$isPattern:{$palette:`${t}.fill`}},{$isImage:{$palette:`${t}.fill`}}]},{$path:["/colorStops",void 0,{$palette:`${t}.fill`}]},[{color:{$mix:[{$palette:`${t}.fill`},"black",.15]}},{color:{$mix:[{$palette:`${t}.fill`},"white",.15]}}]]}}}),pD={type:"gradient",gradient:"radial",bounds:"item",colorStops:{$shallow:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]}},rotation:0,reverse:!1,colorSpace:"rgb"},Sp={...pD,reverse:!0},QX={...pD,bounds:"series"},X4={...pD,bounds:"series",reverse:!0},JX={type:"gradient",gradient:"conic",bounds:"series",colorStops:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]},rotation:0,reverse:!1,colorSpace:"rgb"},Cs={type:"pattern",pattern:"forward-slanted-lines",width:{$isUserOption:["./height",{$path:"./height"},10]},height:{$isUserOption:["./width",{$path:"./width"},10]},padding:2,fill:{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/fill",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},fillOpacity:1,stroke:bx,strokeOpacity:1,strokeWidth:{$switch:[{$path:"./pattern"},0,[["backward-slanted-lines","forward-slanted-lines","horizontal-lines","vertical-lines"],4]]},backgroundFill:"none",backgroundFillOpacity:1,rotation:0,scale:1},t8={...Cs,stroke:{$if:[{$isGradient:{$palette:"fill"}},{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/stroke",{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$path:["/0",void 0,{$palette:"fills"}]}]},{$path:["/0",void 0,{$palette:"fills"}]}]}]},fill:{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/fill",{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$path:["/0",void 0,{$palette:"fills"}]}]},{$path:["/0",void 0,{$palette:"fills"}]}]}]}},e8={type:"pattern",pattern:"forward-slanted-lines",width:8,height:8,padding:1,fill:"black",fillOpacity:1,backgroundFill:"white",backgroundFillOpacity:1,stroke:"black",strokeOpacity:1,strokeWidth:1,rotation:0,scale:1},Z4={...Cs,fill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]}},V1=t=>({...Cs,stroke:{$if:[{$isGradient:{$palette:`${t}.fill`}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:`${t}.fill`}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:`${t}.fill`}]},{$palette:`${t}.fill`}]}]}}),$s={type:"image",backgroundFill:{$palette:"fillFallback"},backgroundFillOpacity:1,repeat:"no-repeat",fit:"contain",rotation:0},i8={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8};function So(t){return af(t,e=>{const i=se.fromString(e);return[se.darken(i,.15).toString(),e,se.lighten(i,.15).toString()]})}var Oe={padding:8,cornerRadius:4,fill:{$if:[{$and:[{$eq:[{$path:"./fill/type"},"image"]},{$isUserOption:["./fill/backgroundFill",!1,!0]}]},{backgroundFill:"transparent"},void 0]},border:{enabled:{$isUserOption:["../border",!0,!1]},strokeWidth:1,stroke:{$foregroundOpacity:.08}}},gD={$isUserOption:["/highlight/enabled",{$path:"/highlight/enabled"},!0]},Bc={enabled:gD,unhighlightedItem:{opacity:.6},unhighlightedSeries:{opacity:.2}},fD={enabled:gD,unhighlightedSeries:{opacity:.2}},_1={enabled:gD,unhighlightedItem:{opacity:.2},unhighlightedSeries:{opacity:.2}},n8={enabled:gD,unhighlightedItem:{opacity:.2}},F1={border:{enabled:!1,stroke:{$foregroundBackgroundMix:.25},strokeOpacity:1,strokeWidth:1},cornerRadius:4,fillOpacity:1,padding:{$if:[{$eq:[{$path:"./border/enabled"},!0]},5,{$isUserOption:["./fill",5,0]}]}},mD={enabled:!1,key:"x",segments:{$apply:{fill:{$applySwitch:[{$path:"type"},{$path:"../../../fill"},["gradient",Tl],["image",$s],["pattern",Cs]]},stroke:{$path:"../../../stroke"},fillOpacity:{$path:"../../../fillOpacity"},strokeWidth:{$isUserOption:["./stroke",{$isUserOption:["../../../strokeWidth",{$path:"../../../strokeWidth"},{$if:[{$greaterThan:[{$path:"../../../strokeWidth"},0]},{$path:"../../../strokeWidth"},2]}]},{$path:"../../../strokeWidth"}]},strokeOpacity:{$path:"../../../strokeOpacity"},lineDash:{$path:"../../../lineDash"},lineDashOffset:{$path:"../../../lineDashOffset"}}}},H1=class iN{constructor(e){this.version=e.split("-")[0]}save(...e){const i={version:this.version};for(const n of Object.values(e))i[n.mementoOriginatorKey]=this.encode(n,n.createMemento());return i}restore(e,...i){if(!Bt(e)){uo(`Could not restore data of type [${e===null?"null":typeof e}], expecting an object, ignoring.`);return}if(!("version"in e)||typeof e.version!="string"){uo("Could not restore data, missing [version] string in object, ignoring.");return}for(const n of i){const s=this.decode(n,e[n.mementoOriginatorKey]),a=[];if(!n.guardMemento(s,a)){let o=`Could not restore [${n.mementoOriginatorKey}] data, value was invalid, ignoring.`;a.length>0&&(o+=` + +${a.join(` + +`)} + +`),uo(o,s);return}n.restoreMemento(this.version,e.version,s)}}encode(e,i){try{return JSON.parse(JSON.stringify(i,iN.encodeTypes))}catch(n){throw new Error(`Failed to encode [${e.mementoOriginatorKey}] value [${n}].`,{cause:n})}}decode(e,i){if(i==null)return i;try{return JSON.parse(JSON.stringify(i),iN.decodeTypes)}catch(n){throw new Error(`Failed to decode [${e.mementoOriginatorKey}] value [${n}].`,{cause:n})}}static encodeTypes(e,i){return aa(this[e])?{__type:"date",value:this[e].toISOString()}:i}static decodeTypes(e,i){return Bt(this[e])&&"__type"in this[e]&&this[e].__type==="date"?new Date(this[e].value):i}},z=(t=>(t.X="x",t.Y="y",t.Angle="angle",t.Radius="radius",t))(z||{}),Ct=(t=>(t[t.FULL=0]="FULL",t[t.UPDATE_DATA=1]="UPDATE_DATA",t[t.PROCESS_DATA=2]="PROCESS_DATA",t[t.PROCESS_DOMAIN=3]="PROCESS_DOMAIN",t[t.PROCESS_RANGE=4]="PROCESS_RANGE",t[t.PERFORM_LAYOUT=5]="PERFORM_LAYOUT",t[t.PRE_SERIES_UPDATE=6]="PRE_SERIES_UPDATE",t[t.SERIES_UPDATE=7]="SERIES_UPDATE",t[t.PRE_SCENE_RENDER=8]="PRE_SCENE_RENDER",t[t.SCENE_RENDER=9]="SCENE_RENDER",t[t.NONE=10]="NONE",t))(Ct||{}),pe=(t=>(t[t.CHART_BACKGROUND=0]="CHART_BACKGROUND",t[t.AXIS_BAND_HIGHLIGHT=1]="AXIS_BAND_HIGHLIGHT",t[t.AXIS_GRID=2]="AXIS_GRID",t[t.AXIS=3]="AXIS",t[t.SERIES_AREA_CONTAINER=4]="SERIES_AREA_CONTAINER",t[t.ZOOM_SELECTION=5]="ZOOM_SELECTION",t[t.SERIES_CROSSLINE_RANGE=6]="SERIES_CROSSLINE_RANGE",t[t.SERIES_LAYER=7]="SERIES_LAYER",t[t.AXIS_FOREGROUND=8]="AXIS_FOREGROUND",t[t.SERIES_CROSSHAIR=9]="SERIES_CROSSHAIR",t[t.SERIES_CROSSLINE_LINE=10]="SERIES_CROSSLINE_LINE",t[t.SERIES_ANNOTATION=11]="SERIES_ANNOTATION",t[t.CHART_ANNOTATION=12]="CHART_ANNOTATION",t[t.CHART_ANNOTATION_FOCUSED=13]="CHART_ANNOTATION_FOCUSED",t[t.STATUS_BAR=14]="STATUS_BAR",t[t.SERIES_LABEL=15]="SERIES_LABEL",t[t.LEGEND=16]="LEGEND",t[t.NAVIGATOR=17]="NAVIGATOR",t[t.FOREGROUND=18]="FOREGROUND",t))(pe||{}),Vs=(t=>(t[t.BACKGROUND=0]="BACKGROUND",t[t.ANY_CONTENT=1]="ANY_CONTENT",t))(Vs||{}),Mc=(t=>(t[t.FOREGROUND=0]="FOREGROUND",t[t.HIGHLIGHT=1]="HIGHLIGHT",t[t.LABEL=2]="LABEL",t))(Mc||{}),gl=(t=>(t[t.BACKGROUND=0]="BACKGROUND",t[t.FOREGROUND=1]="FOREGROUND",t[t.HIGHLIGHT=2]="HIGHLIGHT",t[t.LABEL=3]="LABEL",t))(gl||{});function qd(t){const{placement:e="bottom",floating:i=!1,xOffset:n=0,yOffset:s=0}=typeof t=="string"?{placement:t,floating:!1}:t;return{placement:e,floating:i,xOffset:n,yOffset:s}}var xt=class{handleUnknownProperties(t,e){}set(t){const{className:e=this.constructor.name}=this.constructor;if(t==null)return this.clear(),this;if(typeof t!="object")return cl(`unable to set ${e} - expecting a properties object`),this;const i=new Set(Object.keys(t));for(const n of ru(this))if(i.has(n)){const s=t[n],a=this;if(of(a[n]))if(a[n]instanceof ss){const o=a[n].reset(s);o==null?cl(`unable to set [${String(n)}] - expecting a properties array`):a[n]=o}else a[n].set(s);else Ie(s)?a[n]=Hb(s,a[n]??{}):a[n]=s;i.delete(n)}this.handleUnknownProperties(i,t);for(const n of i)cl(`unable to set [${String(n)}] in ${e} - property is unknown`);return this}clear(){for(const t of ru(this)){const e=this[t];of(e)?e.clear():this[t]=void 0}return this}toJson(){return ru(this).reduce((t,e)=>{const i=this[e];return t[String(e)]=of(i)?i.toJson():i,t},{})}},ss=class q4 extends Array{constructor(e,...i){super(i.length);const s=(a=>!!a?.prototype?.constructor?.name)(e)?a=>new e().set(a):e;Object.defineProperty(this,"itemFactory",{value:s,enumerable:!1,configurable:!1}),this.set(i)}set(e){if(qt(e)){this.length=e.length;for(let i=0;ie?.toJson?.()??e)}};function of(t){return t instanceof xt||t instanceof ss}var Mp=class extends xt{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};Br([b],Mp.prototype,"type");Br([b],Mp.prototype,"tension");Br([b],Mp.prototype,"position");function bf(t,e){const[i,n]=xi(e);return Nt(i,t,n)}function xi(t){if(t.length===0)return[];const e=[1/0,-1/0];for(const i of t)ie[1]&&(e[1]=i);return e}function Tc(t){const[e,i]=xi(t);return i-e}function Gf(t){return t=Math.trunc(t),t<=0?1:t===1?2:1<<32-Math.clz32(t-1)}function nN(t){return t=Math.trunc(t),t<=0?0:t===1?1:1<<31-Math.clz32(t)}var Ca=0,wa=1,Na=2,Ta=3,er=4,Vc=1e3,s8=10,Ou=64,sp=4294967295,a8=3,o8=20,pC=100;function sN(t,e,i,n,s,a,o,r){let l=0;for(;ln;)s-=1,l+=1;if(l>=pC||n>=s)return a;const c=Number.isFinite(e)?ar(t[s],e,i,r)-ar(t[n],e,i,r):xf(s,t.length)-xf(n,t.length);if(c===0||!Number.isFinite(c))return a;const u=Math.abs(c)/(s-n);let d;if(oo8?d=!1:d=u<=a,a=Math.min(a,u),!d)return a;const g=Math.floor((n+s)/2),f=sN(t,e,i,n,g,a,o+1,r),y=sN(t,e,i,g+1,s,a,o+1,r);return Math.min(f,y,a)}function r8(t,e,i,n){return sN(t,e,i,0,t.length-1,1/(t.length-1),0,n)}function _c(t,e,i,n){if(Number.isFinite(e)){const s=n?.smallestKeyInterval,a=n?.xNeedsValueOf??!0,o=s==null?r8(t,e,i,a):s/(i-e);return Gf(Math.trunc(1/o))>>3}else{let s=Math.ceil(Math.log2(t.length))-1;return s=Math.min(Math.max(s,0),24),Math.trunc(2**s)}}function gn(t,e){const{domain:i,sortMetadata:n}=e;switch(t){case"category":return[Number.NaN,Number.NaN];case"number":case"time":case"ordinal-time":case"unit-time":{if(i.length===0)return[1/0,-1/0];if(n?.sortOrder===1)return[Number(i[0]),Number(i.at(-1))];if(n?.sortOrder===-1)return[Number(i.at(-1)),Number(i[0])];let s=1/0,a=-1/0;for(const o of i){const r=Number(o);s=Math.min(s,r),a=Math.max(a,r)}return[s,a]}case"color":case"log":case"mercator":return[0,0]}}function xf(t,e){return t/e}function ar(t,e,i,n){return n?(t.valueOf()-e)/(i-e):(t-e)/(i-e)}function yD(t,e){return Math.trunc(Math.min(Math.floor(t*e),e-1)*er)}function l8(t,e,i,n,s,{xNeedsValueOf:a=!0,xValuesLength:o}={}){const r=t[s];if(r==null)return-1;const l=o??t.length,c=Number.isFinite(e)?ar(r,e,i,a):xf(s,l);return yD(c,n)}function c8(t,e,i,n){for(const s of n)if(i===t[e+s])return!0;return!1}function Fc(t,e,i,n,s,a,{positive:o,split:r=!1,xNeedsValueOf:l=!0,yNeedsValueOf:c=!0,reuseIndexData:u,reuseValueData:d,reuseNegativeIndexData:g,reuseNegativeValueData:f}={}){const y=Number.NaN,x=a*er,S=u?.length===x?u:new Uint32Array(x),D=d?.length===x?d:new Float64Array(x);let A,I;r&&(g?.length===x?A=g:A=new Uint32Array(x),f?.length===x?I=f:I=new Float64Array(x));const w=Number.isFinite(n)&&Number.isFinite(s),N=t.length;w&&(D.fill(y),S.fill(sp),r&&(I.fill(y),A.fill(sp)));const O=w?a/(s-n):a*(1/N);let L=-1,R=-1,P=y,B=-1,F=y,H=-1,$=y,Y=-1,U=y,V=-1,Z=-1,W=y,q=-1,nt=y,G=-1,et=y,st=-1,lt=y;const mt=t.length,Dt=e===i;for(let kt=0;kt=0;else if(o!=null&&ne>=0!==o)continue;let Pt;w?l?Pt=(Vt.valueOf()-n)*O:Pt=(Vt-n)*O:Pt=kt*O;const ue=Math.floor(Pt),oe=(ueF&&(B=kt,F=Pt),ke&&Qt<$&&(H=kt,$=Qt),Ye&&ne>U&&(Y=kt,U=ne))}else{oe!==V&&(V!==-1&&(A[V]=Z,A[V+1]=q,A[V+2]=G,A[V+3]=st,I[V]=W,I[V+1]=nt,I[V+2]=et,I[V+3]=lt),V=oe,Z=-1,W=y,q=-1,nt=y,G=-1,et=y,st=-1,lt=y);const ke=Qt===Qt,Ye=ne===ne;Z===-1?(Z=kt,W=Pt,q=kt,nt=Pt,ke&&(G=kt,et=Qt),Ye&&(st=kt,lt=ne)):(Ptnt&&(q=kt,nt=Pt),ke&&Qtlt&&(st=kt,lt=ne))}}return L!==-1&&(S[L]=R,S[L+1]=B,S[L+2]=H,S[L+3]=Y,D[L]=P,D[L+1]=F,D[L+2]=$,D[L+3]=U),r&&V!==-1&&(A[V]=Z,A[V+1]=q,A[V+2]=G,A[V+3]=st,I[V]=W,I[V+1]=nt,I[V+2]=et,I[V+3]=lt),{indexData:S,valueData:D,negativeIndexData:A,negativeValueData:I}}function ap(t,e,i,{inPlace:n=!1,midpointData:s,reuseIndexData:a,reuseValueData:o}={}){const r=Math.trunc(i/2),l=r*er;let c;n?c=t:a?.length===l?c=a:c=new Uint32Array(l);let u;n?u=e:o?.length===l?u=o:u=new Float64Array(l);const d=s??new Uint32Array(r);for(let g=0;ge[x+wa]?y:x,w=t[I+wa];c[f+wa]=w,u[f+wa]=e[I+wa],d[g]=A+w>>1;const N=S||e[y+Na]e[x+Ta]?y:x;c[f+Ta]=t[O+Ta],u[f+Ta]=e[O+Ta]}return{maxRange:r,indexData:c,valueData:u,midpointData:d}}function ul(t,e,i,n=Ca,s=wa,a=-1){const o=i?.length===t?i:new Uint32Array(t);for(let r=0,l=0;r>1}return o}function h8(t,{collectLevel:e,shouldContinue:i,minRange:n=Ou,compactInPlace:s=!1}){let a=t,o=e(a);const r=[o];for(;a.maxRange>n&&i(o,a);){const l=ap(a.indexData,a.valueData,a.maxRange,{inPlace:s});a={maxRange:l.maxRange,indexData:l.indexData,valueData:l.valueData,midpointData:l.midpointData},o=e(a),r.push(o)}return r.reverse(),r}function Eu(t,e,i,n,s){if(e.lengthD.maxRange===d);let{indexData:f,valueData:y}=Fc(e,i,n,a,o,d,{xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:g?.indexData,reuseValueData:g?.valueData}),x=ul(d,f,g?.midpointIndices);const S=[{maxRange:d,indexData:f,valueData:y,midpointIndices:x}];for(;d>Ou;){const D=d,A=Math.trunc(D/2),I=u?.find(N=>N.maxRange===A),w=ap(f,y,D,{reuseIndexData:I?.indexData,reuseValueData:I?.valueData});d=w.maxRange,f=w.indexData,y=w.valueData,x=w.midpointData??ul(d,f,I?.midpointIndices),S.push({maxRange:d,indexData:f,valueData:y,midpointIndices:x})}return S.reverse(),S}function bD(t,e,i,n,s){if(e.lengthw.maxRange===f),{indexData:x,valueData:S}=Fc(e,i,n,a,o,f,{xNeedsValueOf:c,yNeedsValueOf:u,reuseIndexData:y?.indexData,reuseValueData:y?.valueData}),D=ul(f,x,y?.midpointIndices),A={maxRange:f,indexData:x,valueData:S,midpointIndices:D};function I(){return Eu([a,o],e,i,n,{smallestKeyInterval:r,xNeedsValueOf:c,yNeedsValueOf:u,existingFilters:d})?.filter(N=>N.maxRange!==f)??[]}return{immediate:[A],computeRemaining:I}}var Qd=Symbol("is-dark-theme"),Dp=Symbol("default-shadow-colour"),qh=Symbol("default-caption-layout-style"),Qh=Symbol("default-caption-alignment"),j1=Symbol("palette-up-stroke"),G1=Symbol("palette-down-stroke"),U1=Symbol("palette-up-fill"),W1=Symbol("palette-down-fill"),K1=Symbol("palette-neutral-stroke"),Y1=Symbol("palette-neutral-fill"),$1=Symbol("palette-alt-up-stroke"),X1=Symbol("palette-alt-down-stroke"),Z1=Symbol("palette-alt-up-fill"),q1=Symbol("palette-alt-down-fill"),Q1=Symbol("palette-gray-fill"),J1=Symbol("palette-gray-stroke"),xD=Symbol("default-polar-series-stroke"),vD=Symbol("default-sparkline-crosshair-stroke"),ra=Symbol("default-financial-charts-annotation-stroke"),jb=Symbol("default-hierarchy-strokes"),SD=Symbol("default-text-annotation-color"),Ws=Symbol("default-financial-charts-annotation-background-fill"),vx=Symbol("default-annotation-handle-fill"),Sx=Symbol("default-annotation-statistics-fill"),Mx=Symbol("default-annotation-statistics-stroke"),Dx=Symbol("default-annotation-statistics-color"),Ax=Symbol("default-annotation-statistics-divider-stroke"),Gb=Symbol("default-annotation-statistics-fill"),Ub=Symbol("default-annotation-statistics-stroke"),Ix=Symbol("default-textbox-fill"),kx=Symbol("default-textbox-stroke"),Cx=Symbol("default-textbox-color"),wx=Symbol("default-toolbar-position");function u8(t,e){return"context"in t}function xz(t,e){return t!=null&&u8(t)&&e!=null&&typeof e=="object"&&e.context===void 0?(e.context=t.context,!0):!1}function js(t,e,i){if(Array.isArray(t)){for(const n of t)if(xz(n,i))break}else xz(t,i);return e(i)}var Q4=class{constructor(){this.cache=new WeakMap}call(t,e,i){let n,s=this.cache.get(e);try{n=JSON.stringify(i)}catch{return this.invoke(t,e,s,void 0,i)}return s==null&&(s=new Map,this.cache.set(e,s)),s.has(n)?s.get(n):this.invoke(t,e,s,n,i)}invoke(t,e,i,n,s){try{const a=js(t,e,s);return i&&n!=null&&i.set(n,a),a}catch(a){uo("User callback errored, ignoring",a);return}}invalidateCache(){this.cache=new WeakMap}},J4=class{constructor(t,e=t.defaultView){this.fallbackDocument=t,this.fallbackWindow=e,this.windowEvents=new Map}destroy(){this.removeWindowEvents(),this.container=void 0,this.cachedDocument=void 0,this.cachedWindow=void 0,this.windowEvents.clear()}get document(){return this.cachedDocument??this.fallbackDocument}get window(){return this.cachedWindow??this.fallbackWindow}getContainer(){return this.container}setContainer(t){if(this.container=t,t==null)return;const e=t.ownerDocument,i=e.defaultView??void 0,n=e!==this.document;n&&this.removeWindowEvents(),this.cachedDocument=e,this.cachedWindow=i,n&&this.reattachWindowEvents()}removeWindowEvents(){for(const[t,e]of this.windowEvents)for(const{listener:i,options:n}of e)this.window.removeEventListener(t,i,n)}reattachWindowEvents(){for(const[t,e]of this.windowEvents)for(const{listener:i,options:n}of e)this.window.addEventListener(t,i,n)}get devicePixelRatio(){return this.window.devicePixelRatio}get innerWidth(){return this.window.innerWidth}get innerHeight(){return this.window.innerHeight}get navigator(){return this.window.navigator}getComputedStyle(t,e){return this.window.getComputedStyle(t,e)}matchMedia(t){return this.window.matchMedia?.(t)}getSelection(){return this.window.getSelection()}requestAnimationFrame(t){return this.window.requestAnimationFrame(t)}cancelAnimationFrame(t){this.window.cancelAnimationFrame(t)}shimIdleCallback(t,e){return setTimeout(()=>t(null),e?.timeout)}requestIdleCallback(t,e){return typeof this.window.requestIdleCallback=="function"?this.window.requestIdleCallback(t,e):this.shimIdleCallback(t,e)}cancelIdleCallback(t){return typeof this.window.cancelIdleCallback=="function"?this.window.cancelIdleCallback(t):clearTimeout(t)}attachListener(t,e,i){let n=this.windowEvents.get(t);n==null&&(n=new Set,this.windowEvents.set(t,n));const s=()=>{n?.delete(o),n?.size===0&&this.windowEvents.delete(t)},a=Bt(i)&&i.once?r=>{s(),e(r)}:e,o={listener:a,options:i};return n.add(o),this.window.addEventListener(t,a,i),()=>{s(),this.window.removeEventListener(t,a,i)}}get body(){return this.document.body}get head(){return this.document.head}isReady(){return this.document.readyState==="complete"}createElement(t,e,i){const n=this.document.createElement(t);if(typeof e=="object"&&(i=e,e=void 0),e)for(const s of e.split(" "))n.classList.add(s);return i&&Object.assign(n.style,i),n}createSvgElement(t){return this.document.createElementNS("http://www.w3.org/2000/svg",t)}createResizeObserver(t){const e=this.window.ResizeObserver;if(e!=null)return new e(t)}createIntersectionObserver(t,e){const i=this.window.IntersectionObserver;if(i!=null)return new i(t,e)}};function tT(t,e,i=1/0){const n=e,s=i,a=t%180*(Math.PI/180),o=Math.abs(Math.sin(a)),r=Math.abs(Math.cos(a));if(o===0)return{width:n,height:s};if(r===0)return{width:s,height:n};if(!Number.isFinite(s)){const c=r/o,u=n/(r+c*o);return{width:u,height:c*u}}const l=r*r-o*o;if(l===0){const c=Math.min(n,s)/Math.SQRT2;return{width:c,height:c}}return{width:Math.abs((n*r-s*o)/l),height:Math.abs((s*r-n*o)/l)}}function d8(t,e,i=1/0){const n=e,s=i,a=t%180*(Math.PI/180),o=Math.abs(Math.sin(a)),r=Math.abs(Math.cos(a));return o===0?{width:n,height:s}:r===0?{width:s,height:n}:{width:n*r+s*o,height:n*o+s*r}}function eT(t,e,i,n=0,s=0){const a=Math.cos(i),o=Math.sin(i),r=t-n,l=e-s;return{x:n+r*a-l*o,y:s+r*o+l*a}}var Qo=Math.PI*2,Ly=Math.PI/2;function ze(t){return t%=Qo,t+=Qo,t%=Qo,t}function Wb(t){return t%=Qo,t+=Qo,t!==Qo&&(t%=Qo),t}function uM(t){return t%=Qo,t<-Math.PI?t+=Qo:t>=Math.PI&&(t-=Qo),t}function Ba(t,e,i){const n=ze(t),s=ze(e),a=ze(i);return sa?s<=n||n<=a:e!==i}function Ze(t){return t/180*Math.PI}function tj(t){return t/Math.PI*180}function fl(t,e){return t=ze(t),e=ze(e),e-t+(t>e?Qo:0)}function ej(t){const e=ze(t);return e<=Ly?e/Ly:e<=Math.PI?(Math.PI-e)/Ly:e<=1.5*Math.PI?(e-Math.PI)/Ly:(Qo-e)/Ly}function aN(t,e,i){const n=ej(i);return t*n+e*Math.abs(1-n)}function Dl(t){return t?ze(Ze(t)):0}var dM=class{constructor(){this.queue=[]}waitForCompletion(t=50){const e=this.queue;function i(n){function s(){clearTimeout(o),n(!0)}function a(){const r=e.indexOf(s);r<0||(e.splice(r,1),n(!1))}const o=setTimeout(a,t);e.push(s)}return new Promise(i)}notify(){for(const t of this.queue.splice(0))t()}};function oN(t=0){function e(i){setTimeout(i,t)}return new Promise(e)}async function p8(t,e,i=`Timeout after ${e}ms`){let n;const s=new Promise((a,o)=>{n=setTimeout(()=>o(new Error(i)),e)});try{return await Promise.race([t,s])}finally{clearTimeout(n)}}function Nh(t){return t==="true"}function g8(t){return Number(t)}function no(t){return t}var f8={role:no,"aria-checked":Nh,"aria-controls":no,"aria-describedby":no,"aria-disabled":Nh,"aria-expanded":Nh,"aria-haspopup":no,"aria-hidden":Nh,"aria-label":no,"aria-labelledby":no,"aria-live":no,"aria-orientation":no,"aria-selected":Nh,"data-focus-override":Nh,"data-focus-visible-override":Nh,"data-preventdefault":Nh,class:no,for:no,id:no,tabindex:g8,title:no,placeholder:no};function ye(t,e,i){i==null||i===""||i===""?t?.removeAttribute(e):t?.setAttribute(e,i.toString())}function Nr(t,e){if(e!=null)for(const[i,n]of Xe(e))i!=="class"&&ye(t,i,n)}function Jd(t,e,i){if(!Eb(t))return;const n=t.getAttribute(e);return n===null?i:f8[e]?.(n)??void 0}function Cr(t,e,i){t!=null&&(i==null?t.style.removeProperty(e):t.style.setProperty(e,i.toString()))}function ij(t,e){for(const[i,n]of Xe(e))Cr(t,i,n)}function qi(t,e){const i=Array.isArray(t)?t:t.split(".");if(i.length===1){const[n]=i;return Su((s,a,o)=>s[n]=o,s=>s[n],e)}return Su((n,s,a)=>z1(n,i,a),n=>R1(n,i),e)}function m8(t){return Su((e,i,n)=>e[t]=n)}function pi(t,e){return Su((i,n,s)=>i[t][e??n]=s)}function Pe(t){const{newValue:e,oldValue:i,changeValue:n}=t;return Su((s,a,o,r)=>(o!==r&&(r!==void 0&&i?.call(s,r),o!==void 0&&e?.call(s,o),n?.call(s,o,r)),o))}function Bi(t){return O1(t)}var Ru=class extends xt{constructor(t){super(),this.node=t,this.enabled=!1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=1}};Br([Pe({changeValue(t){t?this.node.strokeWidth=this.strokeWidth:this.node.strokeWidth=0}}),b],Ru.prototype,"enabled");Br([pi("node","stroke"),b],Ru.prototype,"stroke");Br([pi("node","strokeOpacity"),b],Ru.prototype,"strokeOpacity");Br([Pe({changeValue(t){this.enabled?this.node.strokeWidth=t:this.node.strokeWidth=0}}),b],Ru.prototype,"strokeWidth");function iT(t,e,i,n,s){return et.x&&it.y}function MD(t,e,i,n=0,s=0){return e>=t.x&&e+n<=t.x+t.width&&i>=t.y&&i+s<=t.y+t.height}function nj(t){return t==null||t.height===0||t.width===0||Number.isNaN(t.height)||Number.isNaN(t.width)}function sj(t,e){return t===e?!0:t==null||e==null?!1:t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Dr(t,e,i){if(t>e)return;let n;for(;e>=t;){const s=Math.floor((e+t)/2);i(s)?(n=s,t=s+1):e=s-1}return n}function vf(t,e,i){if(t>e)return;let n;for(;e>=t;){const s=Math.floor((e+t)/2);i(s)?(n=s,e=s-1):t=s+1}return n}function nT(t,e,i){if(t>e)return;let n;for(;e>=t;){const s=Math.floor((e+t)/2),a=i(s);a==null?e=s-1:(n=a,t=s+1)}return n}function y8(t,e,i){if(t>e)return;let n;for(;e>=t;){const s=Math.floor((e+t)/2),a=i(s);a==null?t=s+1:(n=a,e=s-1)}return n}function aj(t=0,e=0){const i=qM();return new i(t,e).getContext("2d")}var b8=800,x8=600,v8={quality:1};function S8(t){const e=class extends t{constructor(...n){super(...n),this.gpu=!1}toBuffer(n,s){return super.toBuffer(n,{...s,msaa:!1})}transferToImageBitmap(){const{width:n,height:s}=this,a=new e(Math.max(1,n),Math.max(1,s));return n>0&&s>0&&a.getContext("2d").drawCanvas(this,0,0,n,s),Object.defineProperty(a,"close",{value:()=>{}}),a}};return e}var vz=!1;function M8(t,e){vz||(vz=!0,Object.defineProperty(t.prototype,"fillText",{value:function(i,n,s){let a=this.outlineText(i);a=a.transform(new e([1,0,0,1,n,s])),this.fill(a)},writable:!0,configurable:!0}))}var D8=class{constructor(t){this.getter=t}get(){return this.result??(this.result=this.getter()),this.result}clear(){this.result=void 0}},oj=class{constructor(t){this.getter=t}get(){let t=this.result?.deref();return t||(t=this.getter(),this.result=new WeakRef(t),t)}clear(){this.result=void 0}};function sT(t,e){return t.valueOf()-e.valueOf()}function A8(t){let e=Number.NaN;const i=[];for(const n of t){const s=n.valueOf();e!==s&&i.push(n),e=s}return i}function rN(t){const e=t.slice().sort(sT);return aT(e)==null?A8(e):e}function aT(t){if(t.length===0)return 1;const e=Number(t.at(-1))>Number(t[0])?1:-1;let i=-1/0*e;for(const n of t){const s=n.valueOf();if(Math.sign(s-i)!==e)return;i=s}return e}function oT(){return(t,e)=>{const i=[`Property [${t}] is deprecated.`,e].filter(Boolean).join(" ");uo(i)}}function I8(t,e){const i=oT(),n=e?.default;return Su((s,a,o)=>(o!==n&&i(a.toString(),t),o))}function k8(t,e){const i=oT();return Su((n,s,a)=>(a!==n[t]&&(i(s.toString(),`Use [${t}] instead.`),z1(n,t,e?e(a):a)),oM),(n,s)=>(i(s.toString(),`Use [${t}] instead.`),R1(n,t)))}function rj(t,e){const i=Math.max(t.length,e.length),n=new Set,s=new Set;for(let a=0;a0||s.size>0,added:n,removed:s}}function gb(t,e,i,n){const s=t-i,a=e-n;return s*s+a*a}function Jh(t,e,i,n,s,a,o){if(i===s&&n===a)return Math.min(o,gb(t,e,i,n));const r=s-i,l=a-n,c=Math.max(0,Math.min(1,((t-i)*r+(e-n)*l)/(r*r+l*l))),u=i+c*r,d=n+c*l;return Math.min(o,gb(t,e,u,d))}function C8(t,e,i,n,s,a,o,r,l){r&&([o,a]=[a,o]);const c=Math.atan2(e-n,t-i);if(!Ba(c,a,o)){const d=i+Math.cos(a)*s,g=n+Math.sin(a)*s,f=i+Math.cos(a)*s,y=n+Math.sin(a)*s;return Math.min(l,gb(t,e,d,g),gb(t,e,f,y))}const u=s-Math.sqrt(gb(t,e,i,n));return Math.min(l,u*u)}function Ll(t,e){if(t.length===0)return null;if(e!==void 0){const a=t.at(0),o=t.at(-1),r=a instanceof Date?a.getTime():a,l=o instanceof Date?o.getTime():o;if(typeof r=="number"&&typeof l=="number")return e===1?[r,l]:[l,r]}let i=1/0,n=-1/0;for(const a of t){const o=a instanceof Date?a.getTime():a;typeof o=="number"&&(on&&(n=o))}const s=[i,n];return s.every(Number.isFinite)?s:null}function Uf(t,e,i,n,s,a,o){let r=!1;const l=Ll(t,o),c=l&&a?[a(l[0]),a(l[1])]:l;if(c==null){let g;return e!=null&&i!=null&&e<=i?g=[e,i]:n!=null&&s!=null&&n<=s&&(g=[n,s]),{extent:g??[],clipped:!1}}let[u,d]=c;return e!=null?(r||(r=e>u),u=e):n!=null&&nd&&(d=s),u>d?{extent:[],clipped:!1}:{extent:[u,d],clipped:r}}function DD(t,e,i,n,s){const{extent:a,clipped:o}=Uf(t.domain,Je(e)?new Date(e):e,Je(i)?new Date(i):i,Je(n)?new Date(n):n,Je(s)?new Date(s):s,r=>new Date(r),t.sortMetadata?.sortOrder);return{extent:a.map(r=>new Date(r)),clipped:o}}var w8=new Intl.NumberFormat("en-US",{style:"percent"});function Or(t,e=2){return typeof t=="number"?cj(t,e):typeof t=="string"?t:String(t??"")}function lj(t){return w8.format(t)}var Sz=new Map().set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function cj(t,e){let i=Sz.get(e);return i||(i=new Intl.NumberFormat("en-US",{maximumFractionDigits:e,useGrouping:!1}),Sz.set(e,i)),i.format(t)}function hj(t){return Array.isArray(t)&&t.length>=2&&t.every(Ae)}function zS(t){return Array.isArray(t)&&t.length>=2&&t.every(hj)}function N8(t){const e=t[0],i=t.at(-1);return i===void 0?!1:be(e[0],i[0],.001)&&be(e[1],i[1],.001)}function Mz(t){return Array.isArray(t)&&t.every(zS)&&t.every(N8)}function uj(t){if(t===null)return!0;if(!Bt(t)||t.type==null)return!1;const{type:e,coordinates:i}=t;switch(e){case"GeometryCollection":return Array.isArray(t.geometries)&&t.geometries.every(uj);case"MultiPolygon":return Array.isArray(i)&&i.every(Mz);case"Polygon":return Mz(i);case"MultiLineString":return Array.isArray(i)&&i.every(zS);case"LineString":return zS(i);case"MultiPoint":return zS(i);case"Point":return hj(i);default:return!1}}function T8(t){return Bt(t)&&t.type==="Feature"&&uj(t.geometry)}function L8(t){return Bt(t)&&t.type==="FeatureCollection"&&Array.isArray(t.features)&&t.features.every(T8)}var dj=xe(L8,"a GeoJSON object"),pj=class{constructor(t,e,i){this._vertexCount=0,this._edgeCount=0,this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[],this.cachedNeighboursEdge=t,this.processedEdge=e,this.singleValueEdges=i}clear(){this._vertexCount=0,this._edgeCount=0,this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[],this.singleValueEdges?.clear()}getVertexCount(){return this._vertexCount}getEdgeCount(){return this._edgeCount}addVertex(t){const e=new gj(t);return this._vertexCount++,e}addEdge(t,e,i){i===this.cachedNeighboursEdge?t.updateCachedNeighbours().set(e.value,e):i===this.processedEdge&&(this.pendingProcessingEdgesFrom.push(t),this.pendingProcessingEdgesTo.push(e));const{edges:n}=t,s=n.get(i);s?s.includes(e)||(this.singleValueEdges?.has(i)?n.set(i,[e]):(s.push(e),this._edgeCount++)):(n.set(i,[e]),this._edgeCount++)}removeVertex(t){this._vertexCount--;const e=t.edges;if(e){for(const[,i]of e)this._vertexCount-=i.length;t.clear()}}removeEdge(t,e,i){const n=t.edges.get(i);if(!n)return;const s=n.indexOf(e);s!==-1&&(n.splice(s,1),n.length===0&&t.edges.delete(i),this._edgeCount--,i===this.cachedNeighboursEdge&&t.readCachedNeighbours()?.delete(e.value))}removeEdges(t,e){t.edges.delete(e)}getVertexValue(t){return t.value}*neighbours(t){for(const[,e]of t.edges)for(const i of e)yield i}*neighboursAndEdges(t){for(const[e,i]of t.edges)for(const n of i)yield[n,e]}neighboursWithEdgeValue(t,e){return t.edges.get(e)}findNeighbour(t,e){return t.edges.get(e)?.[0]}findNeighbourValue(t,e){const i=this.findNeighbour(t,e);if(i)return this.getVertexValue(i)}findNeighbourWithValue(t,e,i){const n=i==null?this.neighbours(t):this.neighboursWithEdgeValue(t,i);if(n){for(const s of n)if(this.getVertexValue(s)===e)return s}}findVertexAlongEdge(t,e,i){if(i===this.cachedNeighboursEdge){let s;for(const a of e)if(s=(s??t).readCachedNeighbours()?.get(a),!s)return;return s}if(e.length===0)return;let n=t;for(const s of e){const a=n?this.neighboursWithEdgeValue(n,i):void 0;if(!a)return;n=a.find(o=>o.value===s)}return n}adjacent(t,e){for(const[,i]of t.edges)if(i.includes(e))return!0;return!1}},gj=class{constructor(t){this.value=t,this.edges=new Map}readCachedNeighbours(){return this._cachedNeighbours}updateCachedNeighbours(){return this._cachedNeighbours??(this._cachedNeighbours=new Map),this._cachedNeighbours}clear(){this.edges.clear(),this._cachedNeighbours?.clear()}},lN="class-instance";function or(t,e,i){if(qt(e)){if(!qt(t)||t.length!==e.length||e.some((n,s)=>or(t[s],n,i)!=null))return e}else if(Ie(e)){if(!Ie(t))return e;const n={},s=new Set([...Object.keys(t),...Object.keys(e)]);for(const a of s)if(t[a]!==e[a])if(i?.has(a))n[a]=e[a];else if(typeof t[a]==typeof e[a]){const o=or(t[a],e[a],i);o!==null&&(n[a]=o)}else n[a]=e[a];return Object.keys(n).length?n:null}else if(t!==e)return e;return null}function fj(t,e){for(const i of Object.keys(t))if(t[i]!==e?.[i])return!1;return!0}function le(t,e){return qt(t)?O8(t,e):Ie(t)?E8(t,e):t instanceof Map?new Map(le(Array.from(t))):Gd(t)}function O8(t,e){const i=[],n=e?.seen;for(const s of t){if(typeof s=="object"&&n?.includes(s)){cl("cycle detected in array",s);continue}n?.push(s),i.push(le(s,e)),n?.pop()}return i}function E8(t,e){const i={};for(const n of Object.keys(t))e?.assign?.has(n)?i[n]=t[n]:e?.shallow?.has(n)?i[n]=Gd(t[n]):i[n]=le(t[n],e);return i}function Gd(t){return qt(t)?t.slice(0):Ie(t)?{...t}:aa(t)?new Date(t):r4(t)?new RegExp(t.source,t.flags):t}function Ic(t,e,i,n,s,a){if(qt(t)){a=e(t,n,s,a);let o=0;for(const r of t)a=Ic(r,e,i,n?.[o],s,a),o++}else if(Ie(t)){a=e(t,n,s,a);for(const o of Object.keys(t)){if(i?.has(o))continue;const r=t[o];a=Ic(r,e,i,n?.[o],s,a)}}return a}function fb(t,e,i={}){const{path:n,matcherPath:s=n?.replace(/(\[[0-9+]+])/i,"[]"),skip:a=[]}=i;if(t==null)throw new Error(`AG Charts - target is uninitialised: ${n??""}`);if(e==null)return t;if(of(t))return t.set(e);const o=t,r=gC(t);for(const l of Object.keys(e)){if(P1.has(l))continue;const c=`${s?s+".":""}${l}`;if(a.includes(c))continue;const u=e[l],d=`${n?n+".":""}${l}`,g=o.constructor,f=o[l];try{const y=gC(f),x=gC(u);if(r===lN&&!(l in t||l==="context")){if(u===void 0)continue;cl(`unable to set [${d}] in ${g?.name} - property is unknown`);continue}if(y!=null&&x!=null&&x!==y&&(y!==lN||x!=="object")){cl(`unable to set [${d}] in ${g?.name} - can't apply type of [${x}], allowed types are: [${y}]`);continue}if(of(f))u===void 0?f.clear():f.set(u);else if(x==="object"&&l!=="context"){if(!(l in o)){cl(`unable to set [${d}] in ${g?.name} - property is unknown`);continue}f==null?o[l]=u:fb(f,u,{...i,path:d,matcherPath:c})}else o[l]=u}catch(y){cl(`unable to set [${d}] in [${g?.name}]; nested error is: ${y.message}`)}}return t}function gC(t){return t==null?null:x1(t)||aa(t)?"primitive":qt(t)?"array":Bt(t)?Ie(t)?"object":lN:Cl(t)?"function":"primitive"}function Qe(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function rT(t,e,i){return Qe(t,"keydown",n=>{const s=i?.()??["Escape"];AD(n,...s)&&e(n)})}function mj(t,e){const i=t.ownerDocument.defaultView,n=Qe(i,"mousedown",s=>{[0,2].includes(s.button)&&!bj(t,s)&&(e(),n())});return n}function yj(t,e){const i=t.ownerDocument.defaultView,n=Qe(i,"touchstart",s=>{Array.from(s.targetTouches).some(o=>!bj(t,o))&&(e(),n())});return n}function bj(t,e){return m1(e.target)&&e.target.shadowRoot!=null?!0:JS(e.target)&&t.contains(e.target)}function xj(t,e,i){const n=s=>{for(const a of e)ye(a,"data-focus-visible-override",s)};return n(i),Qe(t,"keydown",()=>n(!0),{once:!0})}function Nx(t){return!(t.shiftKey||t.altKey||t.ctrlKey||t.metaKey)}function AD(t,...e){return Nx(t)&&e.includes(t.key)}function Dz(t,e,i){return Qe(t,"keydown",n=>{AD(n,i)&&e.focus()})}var R8={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}},P8={nextKey:"ArrowLeft",prevKey:"ArrowRight"};function mb(t,e){return e&&t==="horizontal"?P8:R8[t]}function cN(t){const{orientation:e,buttons:i,wrapAround:n=!1,onEscape:s,onFocus:a,onBlur:o}=t,{nextKey:r,prevKey:l}=mb(e,ff(i[0])),c=f=>{if(f.target&&"tabIndex"in f.target){for(const y of i)y.tabIndex=-1;f.target.tabIndex=0}},[u,d]=n?[i.length,i.length]:[0,1/0],g=new qe;for(let f=0;f{AD(D,r,l)&&D.preventDefault()})),x.tabIndex=f===0?0:-1}return g}function z8(t,e){return i=>{if(t.ariaDisabled==="true")return i.preventDefault();e(i)}}function lT(t){return"button"in t?t.button===0:Nx(t)&&(t.code==="Space"||t.key==="Enter")}function cT(t){const e=t?.target;if(m1(e)&&"tabindex"in e.attributes)return e}function vj(t){return Qe(t,"keydown",e=>{if(e.defaultPrevented)return;Jd(e.target,"data-preventdefault",!0)&&AD(e,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&e.preventDefault()})}var hN=new Map,Sj=1;function B8(){hN.clear(),Sj=1}function Nn(t){const e=t.constructor;let i=Object.hasOwn(e,"className")?e.className:e.name;QH(()=>{if(!i)throw new Error(`The ${String(e)} is missing the 'className' property.`)}),i??(i="Unknown");const n=(hN.get(i)??0)+1;return hN.set(i,n),`${i}-${n}`}function lu(){return`ag-charts-${Sj++}`}function yb(){return crypto.randomUUID?.()??V8()}function V8(){const t=new Uint8Array(16);crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let e="";for(let i=0;i0)n={value:a,next:n},s=n;else{for(s=s;s.next!=null&&i(s.next.value,a)<=0;)s=s.next;s.next={value:a,next:s.next}}return n}var Oy=new WeakMap;function Wf(t,e){const i=JSON.stringify(t,null,0);return Oy.has(e)||Oy.set(e,new Map),Oy.get(e)?.has(i)||Oy.get(e)?.set(i,e(t)),Oy.get(e)?.get(i)}var fC=class{constructor(){this.weak=new WeakMap,this.strong=new Map,this.set=!1,this.value=void 0}};function Pu(t,e){let i=new fC;const n=(...s)=>{let a=i;for(const o of s){const r=typeof o=="object"||typeof o=="symbol"?a.weak:a.strong;let l=r.get(o);l==null&&(l=new fC,r.set(o,l)),a=l}if(a.set)return e?.("hit",t,s),a.value;{const o=t(...s);return a.set=!0,a.value=o,e?.("miss",t,s),o}};return n.reset=()=>{i=new fC},n}function xs(t,e){const i=new Map,n=(...o)=>o.map(r=>typeof r=="object"||typeof r=="symbol"?r:(i.has(r)||i.set(r,{v:r}),i.get(r))),s={},a=new WeakMap;return(...o)=>{const r=o.length===0?[s]:n(...o);let l=a;for(const d of r.slice(0,-1))l.has(d)||l.set(d,new WeakMap),l=l.get(d);const c=r.at(-1);let u=l.get(c);return u?e?.("hit",t,o):(u=t(...o),l.set(c,u),e?.("miss",t,o)),u}}function Tx(t,e,i,n=1/0){const s={nearest:void 0,distanceSquared:n};for(const a of i){const o=a.distanceSquared(t,e);if(o===0)return{nearest:a,distanceSquared:0};o{})}function uN(t,e){const i=ru(e);if(i.length===0)return;const n=F4(t);for(const s of i)s in n&&(e[s]=n[s])}var Dj=class{transitionRoot(t,e){this.parent?this.parent.transitionRoot(t,e):this.transition(t,e)}},dT=class Da extends Dj{constructor(e,i,n){super(),this.defaultState=e,this.states=i,this.enterEach=n,this.debug=qH(!0,"animation"),this.state=e,this.debug(`%c${this.constructor.name} | init -> ${e}`,mC)}transition(e,i){if(!this.transitionChild(e,i)||this.state===Da.child||this.state===Da.parent)return;const s=this.state,a=this.states[this.state];let o=a[e];const r=`%c${this.constructor.name} | ${this.state} -> ${e} ->`;if(Array.isArray(o))o=o.find(u=>{if(!u.guard)return!0;const d=u.guard(i);return d||this.debug(`${r} (guarded)`,u.target,yC),d});else if(typeof o=="object"&&!(o instanceof Da)&&o.guard&&!o.guard(i)){this.debug(`${r} (guarded)`,o.target,yC);return}if(!o){this.debug(`${r} ${this.state}`,yC);return}const l=this.getDestinationState(o),c=l===this.state?void 0:a.onExit;this.debug(`${r} ${l}`,mC),this.state=l,typeof o=="function"?o(i):typeof o=="object"&&!(o instanceof Da)&&o.action?.(i),c?.(),this.enterEach?.(s,l),l!==s&&l!==Da.child&&l!==Da.parent&&this.states[l].onEnter?.(s,i)}transitionAsync(e,i){setTimeout(()=>{this.transition(e,i)},0)}is(e){return this.state===Da.child&&this.childState?this.childState.is(e):this.state===e}resetHierarchy(){this.debug(`%c${this.constructor.name} | ${this.state} -> [resetHierarchy] -> ${this.defaultState}`,"color: green"),this.state=this.defaultState}transitionChild(e,i){return this.state!==Da.child||!this.childState||(uN(this,this.childState),this.childState.transition(e,i),!this.childState.is(Da.parent))?!0:(this.debug(`%c${this.constructor.name} | ${this.state} -> ${e} -> ${this.defaultState}`,mC),this.state=this.defaultState,this.states[this.state].onEnter?.(),this.childState.resetHierarchy(),!1)}getDestinationState(e){let i=this.state;return typeof e=="string"?i=e:e instanceof Da?(this.childState=e,this.childState.parent=this,i=Da.child):typeof e=="object"&&(e.target instanceof Da?(this.childState=e.target,this.childState.parent=this,i=Da.child):e.target!=null&&(i=e.target)),i}};dT.child="__child";dT.parent="__parent";var Rt=dT,Aj=class extends Dj{constructor(...t){super(),this.stateMachines=t;for(const e of t)e.parent=this}transition(t,e){for(const i of this.stateMachines)uN(this,i),i.transition(t,e)}transitionAsync(t,e){for(const i of this.stateMachines)uN(this,i),i.transitionAsync(t,e)}},pT=class{constructor(t,e){this.ctx=t,this.measureTextCached=e,this.baselineMap=new Map,this.charMap=new Map,this.lineHeightCache=null}baselineDistance(t){if(t==="alphabetic")return 0;if(this.baselineMap.has(t))return this.baselineMap.get(t);this.ctx.textBaseline=t;const{alphabeticBaseline:e}=this.ctx.measureText("");return this.baselineMap.set(t,e),this.ctx.textBaseline="alphabetic",e}lineHeight(){return this.lineHeightCache??(this.lineHeightCache=this.measureText("").height),this.lineHeightCache}measureText(t){const e=this.measureTextCached?.(t)??this.ctx.measureText(t),{width:i,fontBoundingBoxAscent:n=e.emHeightAscent,fontBoundingBoxDescent:s=e.emHeightDescent}=e,a=n+s;return{width:i,height:a,ascent:n,descent:s}}measureLines(t){const e=typeof t=="string"?t.split(au):t;let i=0,n=0;const s=e.map(a=>{const o=this.measureText(a);return i1?this.ctx.measureText(t).width:this.charMap.get(t)??this.charWidth(t)}charWidth(t){const{width:e}=this.ctx.measureText(t);return this.charMap.set(t,e),e}},dN=new XM(50);function Ve(t){typeof t=="object"&&(t=v1(t));let e=dN.get(t);if(e)return e;const i=new XM(1e4),n=aj();return n.font=t,e=new pT(n,s=>{let a=i.get(s);return a||(a=n.measureText(s),i.set(s,a),a)}),dN.set(t,e),e}Ve.clear=()=>dN.clear();function Va(t,e){let i={segments:[],width:0,height:0,ascent:0,descent:0};const n=[i];for(const o of t){const{text:r,fontSize:l=e.fontSize,fontStyle:c=e.fontStyle,fontWeight:u=e.fontWeight,fontFamily:d=e.fontFamily,...g}=o,f={fontSize:l,fontStyle:c,fontWeight:u,fontFamily:d},y=Ve(f),x=bi(r).split(au);for(let S=0;S0&&(i={segments:[],width:0,height:0,ascent:0,descent:0},n.push(i)),D&&(i.width+=A.width,i.ascent=Math.max(i.ascent,A.ascent),i.descent=Math.max(i.descent,A.descent),i.height=Math.max(i.height,i.ascent+i.descent),i.segments.push({...f,...g,text:D,textMetrics:A}))}}let s=0,a=0;for(const o of n)s=Math.max(s,o.width),a+=o.height;return{width:s,height:a,lineMetrics:n}}function $t(t,e,i){const n=bp().createElement(t);if(typeof e=="object"&&(i=e,e=void 0),e)for(const s of e.split(" "))n.classList.add(s);return i&&Object.assign(n.style,i),n}function $i(t){return bp().createElementNS("http://www.w3.org/2000/svg",t)}function Ij(t,e){const i=bp("body"),n=$t("a",{display:"none"});n.href=t,n.download=e,i.appendChild(n),n.click(),setTimeout(()=>n.remove())}function Az(t,e){return e.overflow==="hide"&&t.some(wu)}function Lx(t,e){return qt(t)?gT(t,e):Ox(bi(t),e).join(` +`)}function kc(t,e){return Ox(t,e).join(` +`)}function Ox(t,e){return BS(t,e)}function tp(t,e,i,n){const s=e.textWidth(Ff),a=Sc(t);let o=0,r=0;for(const c of a){const u=e.textWidth(c);if(o+u>i)break;o+=u,r+=c.length}if(r===t.length&&(!n||o+s<=i))return n?qw(t):t;t=t.slice(0,r).trimEnd();const l=Sc(t);for(;l.length&&e.textWidth(t)+s>i;){for(l.pop();l.length&&l.at(-1).trim()==="";)l.pop();t=l.join("")}return qw(t)}function BS(t,e,i=0){const n=t.split(au),s=Ve(e.font),a=[];if(e.textWrap==="never"){for(const c of n){const u=tp(c.trimEnd(),s,Math.max(0,e.maxWidth-i));if(!u)break;a.push(u),i=0}return Az(a,e)?[]:a}const o=e.textWrap==="hyphenate",r=e.textWrap==null||e.textWrap==="on-space";for(const c of n){let u=c.trimEnd();if(u===""){a.push(u);continue}let d=Sc(u),g=0,f=0,y=0,x=0;for(a.length||(y=i);ge.maxWidth){if(g===0){u="";break}let D=s.textWidth(u.slice(0,f+S.length));if(a.length||(D+=i),D<=e.maxWidth){y=D,f+=S.length,g++;continue}if(x){const N=_8(u,x+1),O=s.textWidth(N);if(O<=e.maxWidth){a.push(u.slice(0,x).trimEnd()),u=u.slice(x).trimStart(),d=Sc(u),g=0,f=0,y=0,x=0;continue}else r&&O>e.maxWidth&&a.push(u.slice(0,x).trimEnd(),tp(u.slice(x).trimStart(),s,e.maxWidth,!0))}else if(r){const N=tp(u,s,e.maxWidth,!0);N&&a.push(N)}if(r){u="";break}const A=o?"-":"";let I=u.slice(0,f).trim();const w=Sc(I);for(;w.length&&s.textWidth(I+A)>e.maxWidth;){for(w.pop();w.length&&w.at(-1).trim()==="";)w.pop();I=w.join("")}if(I&&I!==Rb)a.push(S1(I)+A);else{u="";break}u=u.slice(I.length).trimStart(),d=Sc(u),g=0,f=0,y=0,x=0;continue}f+=S.length,g++}u&&a.push(u)}F8(a,s,e);const l=kj(a,s,e);return Az(l,e)?[]:l}function _8(t,e){const i=t.indexOf(" ",e);return i===-1?t.slice(e):t.slice(e,i)}function kj(t,e,i){if(!Ae(i.maxHeight))return t;const{height:n,lineMetrics:s}=e.measureLines(t);if(n<=i.maxHeight)return t;for(let a=0,o=0;ai.maxHeight){if(i.overflow==="hide"||a===0)return[];const r=t.slice(0,a),l=r.pop();return r.concat(wu(l)?l:tp(l,e,i.maxWidth,!0))}return t}function F8(t,e,i){if(i.avoidOrphans===!1||t.length<2)return;const{length:n}=t,s=t[n-1],a=t[n-2];if(Sc(a).lengthi){n.length&&o();break}if(s+r<=e.maxWidth){s+=r,a+=l,n.push(...c);continue}for(const u of c){if(s+u.textMetrics.width<=e.maxWidth){s+=u.textMetrics.width,n.push(u);continue}const d=Ve(u),g=c4(u.text),f={...e,font:u,maxHeight:i-a};let y=BS(g,{...f,overflow:"hide"},s);if(y.length===0)if(e.textWrap==="never")y=BS(g,f,s);else{y=BS(g,f);const D=n.at(-1);D&&(D.text+=` +`,s=0)}if(y.length===0){o();break}const x=y.findIndex(wu);x!==-1&&(y=y.slice(0,x+1));const S=y.at(-1);for(const D of y){const A=h4(D),I=d.measureText(A),w={...u,text:A,textMetrics:I};D===S?s+=I.width:(w.text+=` +`,s=0),a+=I.height,n.push(w)}if(x!==-1)break}}return n}function pM(t,[e,i],[n,s]){const a=s-n,o=i-e,r=e+o*t[0],l=e+o*t[1];return[(r-n)/a,(l-n)/a]}var rf=1e3,tu=rf*60,ep=tu*60,op=ep*24,Cj=op*7,fT=op*30,Kb=op*365,Tg=new Date().getTimezoneOffset()*tu,Kf={millisecond:{milliseconds:1,hierarchy:"day",encode(t){return t.getTime()},decode(t){return new Date(t)}},second:{milliseconds:rf,hierarchy:"day",encode(t,e){const i=e?0:Tg;return Math.floor((t.getTime()-i)/rf)},decode(t,e){const i=e?0:Tg;return new Date(i+t*rf)}},minute:{milliseconds:tu,hierarchy:"day",encode(t,e){const i=e?0:Tg;return Math.floor((t.getTime()-i)/tu)},decode(t,e){const i=e?0:Tg;return new Date(i+t*tu)}},hour:{milliseconds:ep,hierarchy:"day",encode(t,e){const i=e?0:Tg;return Math.floor((t.getTime()-i)/ep)},decode(t,e){const i=e?0:Tg;return new Date(i+t*ep)}},day:{milliseconds:op,hierarchy:"month",encode(t,e){const i=e?0:t.getTimezoneOffset()*tu;return Math.floor((t.getTime()-i)/op)},decode(t,e){let i;return e?(i=new Date(0),i.setUTCDate(i.getUTCDate()+t),i.setUTCHours(0,0,0,0)):(i=new Date(1970,0,1),i.setDate(i.getDate()+t)),i}},month:{milliseconds:fT,hierarchy:"year",encode(t,e){return e?t.getUTCFullYear()*12+t.getUTCMonth():t.getFullYear()*12+t.getMonth()},decode(t,e){if(e){const i=Math.floor(t/12),n=t-i*12;return new Date(Date.UTC(i,n,1))}else{const i=Math.floor(t/12),n=t-i*12;return new Date(i,n,1)}}},year:{milliseconds:Kb,hierarchy:void 0,encode(t,e){return e?t.getUTCFullYear():t.getFullYear()},decode(t,e){let i;return e?(i=new Date,i.setUTCFullYear(t),i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0)):i=new Date(t,0,1,0,0,0,0),i}}};function Yf(t){return typeof t=="string"?{unit:t,step:1,epoch:void 0,utc:!1}:{unit:t.unit,step:t.step??1,epoch:t.epoch,utc:t.utc??!1}}function Ex(t,e,i,n){if(i==null)return 0;const s=Kf[t];return Math.floor(s.encode(new Date(i),n))%e}function Sf(t,e,i,n,s){const a=Kf[e];return Math.floor((a.encode(new Date(t),n)-s)/i)}function $f(t,e,i,n,s){return Kf[e].decode(t*i+s,n)}function gM(t,e,i,n,s){const a=new Date(t),o=Sf(a,e,i,n,s);return $f(o,e,i,n,s)}function fM(t,e,i,n,s){const a=new Date(Number(t)-1),o=Sf(a,e,i,n,s);return $f(o+1,e,i,n,s)}function La(t,e){const{unit:i,step:n,epoch:s,utc:a}=Yf(t),o=Ex(i,n,s,a);return gM(e,i,n,a,o)}function wj(t,e){const{unit:i,step:n,epoch:s,utc:a}=Yf(t),o=Ex(i,n,s,a);return fM(e,i,n,a,o)}function Nj(t,e){const{unit:i,step:n,epoch:s,utc:a}=Yf(t),o=Ex(i,n,s,a);return $f(Sf(fM(e,i,n,a,o),i,n,a,o)-1,i,n,a,o)}function mT(t,e){const{unit:i,step:n,epoch:s,utc:a}=Yf(t),o=Ex(i,n,s,a);return $f(Sf(gM(e,i,n,a,o),i,n,a,o)+1,i,n,a,o)}function yT(t,e,i){if(t.valueOf()>e.valueOf()&&([t,e]=[e,t],i!=null&&(i=[1-i[1],1-i[0]])),i!=null){const n=e.valueOf()-t.valueOf(),s=t.valueOf();t=new Date(s+i[0]*n),e=new Date(s+i[1]*n)}return[new Date(t),new Date(e)]}function Yb(t,e,i,{extend:n=!1,visibleRange:s=[0,1],limit:a,defaultAlignment:o="start"}={}){const r=Yf(t),{unit:l,step:c,utc:u}=r;let d;r.epoch!=null?d=r.epoch:o==="interval"?d=void 0:e.valueOf()>i.valueOf()?d=i:d=e;const g=Ex(r.unit,r.step,d,r.utc);let[f,y]=yT(e,i,s);f=n?gM(f,l,c,u,g):fM(f,l,c,u,g),y=n?fM(y,l,c,u,g):gM(y,l,c,u,g);const x=Sf(f,l,c,u,g);let S=Sf(y,l,c,u,g);return a!=null&&S-x>a&&(S=x+a),{range:[x,S],unit:l,step:c,utc:u,offset:g}}function mM(t,e,i,n){const{range:[s,a]}=Yb(t,e,i,n);return Math.abs(a-s)}function fo(t,e,i,n){const{range:[s,a],unit:o,step:r,utc:l,offset:c}=Yb(t,e,i,n),u=[];for(let d=s;d<=a;d+=1){const g=$f(d,o,r,l,c);u.push(g)}return u}function Tj(t,e,i,n){const{range:[s,a],unit:o,step:r,utc:l,offset:c}=Yb(t,e,i,n),u=Math.max(0,a-s+1),d=new Array(u);for(let g=0;g0?1:-1))}else if(n.setMonth(t.getMonth()+e),e!==0)for(;n.getMonth()===t.getMonth();)n.setDate(n.getDate()+(e>0?1:-1));return n}},year:{adjust(t,e,i){const n=new Date(t.getTime());return i?n.setUTCFullYear(t.getUTCFullYear()+e):n.setFullYear(t.getFullYear()+e),n}}};function Oj(t,e){const{unit:i,step:n,utc:s}=Yf(t);return U8[i].adjust(e,-n,s)}function Er(t){return typeof t=="string"?t:t.unit}function Al(t){return typeof t=="string"?1:t.step??1}function rp(t){return typeof t=="string"?void 0:t.epoch}function Rx(t){return Kf[Er(t)].hierarchy}function Ms(t){return Al(t)*Kf[Er(t)].milliseconds}var Ej=["millisecond","second","minute","hour","day","month","year"];function Rj(t){return Ie(t)?"unit"in t&&Ej.includes(t.unit):!1}function Pj(t){return zi(t)&&Ej.includes(t)}var ji=(t,e)=>({duration:Ms(t)*e,timeInterval:t,step:e}),yM=[ji({unit:"second"},1),ji({unit:"second"},5),ji({unit:"second"},15),ji({unit:"second"},30),ji({unit:"minute"},1),ji({unit:"minute"},5),ji({unit:"minute"},15),ji({unit:"minute"},30),ji({unit:"hour"},1),ji({unit:"hour"},3),ji({unit:"hour"},6),ji({unit:"hour"},12),ji({unit:"day"},1),ji({unit:"day"},2),ji({unit:"day",step:7},1),ji({unit:"day",step:7},2),ji({unit:"day",step:7},3),ji({unit:"month"},1),ji({unit:"month"},2),ji({unit:"month"},3),ji({unit:"month"},4),ji({unit:"month"},6),ji({unit:"year"},1)],zj=[1,2,5,10];function Iz(t,e){return Math.abs(Math.round(t)-t)=i?Math.abs(e-t)/i+1:1}function Xf(t,e,i,n,s,a){if(t===e)return{ticks:[t],count:1,firstTickIndex:0};if(i<2)return{ticks:[t,e],count:2,firstTickIndex:0};const o=Mf(t,e,i,n,s);if(!Number.isFinite(o))return{ticks:[],count:0,firstTickIndex:void 0};let r=t,l=e;Iz(r/o,1e-12)||(r=Math.ceil(r/o)*o),Iz(l/o,1e-12)||(l=Math.floor(l/o)*o),a!=null&&(a=pM(a,[t,e],[r,l]));const{ticks:c}=Df(r,l,o,a),u=c.at(0);return{ticks:c,count:Bj(r,l,o),firstTickIndex:u==null?void 0:Math.round((u-r)/o)}}var W8=Math.floor(2*Cj/fT*10)/10;function kz({timeInterval:t,step:e}){const i=Ms(t)*e,n=Rx(t),s=n?Ms(n):void 0;return i<=(s??1/0)*W8}function xT(t,{weekStart:e}){if(t.unit==="day"&&t.step===7)return e}function Px(t,e,i,n,s,{weekStart:a,primaryOnly:o=!1,targetInterval:r}){if(i<=0)return;const l=r??Math.abs(e-t)/Math.max(i,1),c=yM.findLast(f=>(!o||kz(f))&&l>f.duration),u=yM.find(f=>(!o||kz(f))&&l<=f.duration);if(c==null)return{unit:"millisecond",step:Math.max(Mf(t,e,i,n,s),1)};if(u==null)return{unit:"year",step:r==null?Mf(t/Kb,e/Kb,i,n,s):1};const{timeInterval:d,step:g}=l-c.duration=n&&d<=s;if(c&&!g)continue;const f=Math.abs(d-i);(l>f||c!==g)&&(c||(c=g),l=f,r=u)}return r*o}function Cz(t){for(let e=t.length-1;e>=0;e-=1)if(t[e]!=="0")return e+1;return 0}function vT(t,e){const i=iD(e??",f");if(i==null)return;(i.precision==null||Number.isNaN(i.precision))&&(!i.type||"eEFgGnprs".includes(i.type)?i.precision=Math.max(...t.map(s=>{if(!Number.isFinite(s))return 0;const[a,o]=s.toExponential((i.type?6:12)-1).split(/[.e]/g);return(a!=="1"&&a!=="-1"?1:0)+Cz(o)+1})):"f%".includes(i.type)&&(i.precision=Math.max(...t.map(s=>{if(!Number.isFinite(s)||s===0)return 0;const a=Math.floor(Math.log10(Math.abs(s))),o=i.type?6:12,r=s.toExponential(o-1).split(/[.e]/g)[1],l=Cz(r);return Math.max(0,l-a)}))));const n=C1(i);return s=>n(Number(s))}function Df(t,e,i,n){if(!Number.isFinite(i)||i<=0)return{ticks:[],count:0,firstTickIndex:void 0};if(t===e)return{ticks:[t],count:1,firstTickIndex:0};const s=10**Hf(i),a=Math.min(t,e),o=Math.max(t,e);let r,l;if(n!=null&&(n[0]!==0||n[1]!==1)){const d=e-t,g=t+d*n[0],f=e-d*(1-n[1]);r=Math.min(g,f),l=Math.max(g,f)}else r=a,l=o;r=Math.floor(r*s)/s,l=Math.ceil(l*s)/s;const c=[];for(let d=0;;d+=1){const g=Math.round((a+i*d)*s)/s;if(g>o)break;g>=r&&g<=l&&c.push(g)}const u=c.at(0);return{ticks:c,count:Bj(a,o,i),firstTickIndex:u==null?void 0:Math.round((u-a)/i)}}function lp(t,e){return t>=e?(uo("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0):!1}function ST(t,e){const i=Math.abs(e-t),n=10**Math.floor(Math.log10(i));let s=1/0,a=[t,e];for(const o of zj){const r=o*n,l=Math.floor(t/r)*r,c=Math.ceil(e/r)*r,u=1-i/Math.abs(c-l);s>u&&(s=u,a=[l,c])}return a}function MT(t,e,i,n,s,a){if(t<=0)return{minTickCount:0,maxTickCount:0,tickCount:0};a=Math.max(a,t/(s+1)),i??(i=a),n??(n=t),i>n&&(i===a?i=n:n=i),i=Math.max(i,1);const o=Math.max(1,Math.floor(t/(e*i))),r=Math.min(o,Math.ceil(t/(e*n))),l=Nt(r,Math.floor(s/e),o);return{minTickCount:r,maxTickCount:o,tickCount:l}}function Ss(t){return t instanceof Date?t.getTime():t}function zx(t){return t{const i=t.get(e);return i?(t.set(e,i+1),`${e}_${i}`):(t.set(e,1),e)}}function DT(t){return t!=null&&Object.hasOwn(t,"toString")&&zi(t.toString())}function Vj(t){return t!=null&&Object.hasOwn(t,"valueOf")&&Ae(t.valueOf())}function Af(t){return Ae(t)||Ac(t)||Vj(t)}function _j(t,e){return t!=null&&(!e||Af(t))}function bM(t){return DT(t)&&Object.hasOwn(t,"id")?t.id:t}function pN(t){return DT(t)&&Object.hasOwn(t,"value")?t.value:t}var at={};Vf(at,{add:()=>K8,angle:()=>q8,apply:()=>o9,distance:()=>$8,distanceSquared:()=>X8,equal:()=>s9,from:()=>a9,gradient:()=>J8,intercept:()=>t9,intersectAtX:()=>i9,intersectAtY:()=>e9,length:()=>wD,lengthSquared:()=>Fj,multiply:()=>Y8,normalized:()=>Z8,origin:()=>Hj,required:()=>r9,rotate:()=>Q8,round:()=>n9,sub:()=>AT});function K8(t,e){return typeof e=="number"?{x:t.x+e,y:t.y+e}:{x:t.x+e.x,y:t.y+e.y}}function AT(t,e){return typeof e=="number"?{x:t.x-e,y:t.y-e}:{x:t.x-e.x,y:t.y-e.y}}function Y8(t,e){return typeof e=="number"?{x:t.x*e,y:t.y*e}:{x:t.x*e.x,y:t.y*e.y}}function wD(t){return Math.hypot(t.x,t.y)}function Fj(t){return t.x*t.x+t.y*t.y}function $8(t,e){return wD(AT(t,e))}function X8(t,e){return Fj(AT(t,e))}function Z8(t){const e=wD(t);return{x:t.x/e,y:t.y/e}}function q8(t,e){return e==null?Math.atan2(t.y,t.x):Math.atan2(t.y,t.x)-Math.atan2(e.y,e.x)}function Q8(t,e,i=Hj()){const n=wD(t);return{x:i.x+n*Math.cos(e),y:i.y+n*Math.sin(e)}}function J8(t,e,i){const n=e.x-t.x;return(i==null?e.y-t.y:i-e.y-(i-t.y))/n}function t9(t,e,i){return(i==null?t.y:i-t.y)-e*t.x}function e9(t,e,i=0,n){return{x:t===1/0?1/0:(i-e)/t,y:n==null?i:n-i}}function i9(t,e,i=0,n){const s=t===1/0?1/0:t*i+e;return{x:i,y:n==null?s:n-s}}function n9(t,e=2){return{x:_b(t.x,e),y:_b(t.y,e)}}function s9(t,e){return t.x===e.x&&t.y===e.y}function a9(t,e){if(typeof t=="number")return{x:t,y:e};if("currentX"in t)return{x:t.currentX,y:t.currentY};if("offsetWidth"in t)return{x:t.offsetWidth,y:t.offsetHeight};if("width"in t)return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y+t.height}];if("x1"in t)return[{x:t.x1,y:t.y1},{x:t.x2,y:t.y2}];throw new Error(`Values can not be converted into a vector: [${JSON.stringify(t)}] [${e}]`)}function o9(t,e){return t.x=e.x,t.y=e.y,t}function r9(t){return{x:t?.x??0,y:t?.y??0}}function Hj(){return{x:0,y:0}}var Wt={};Vf(Wt,{bottomCenter:()=>d9,center:()=>u9,clone:()=>m9,collides:()=>y9,end:()=>c9,from:()=>b9,height:()=>g9,normalise:()=>xM,origin:()=>x9,round:()=>f9,start:()=>l9,topCenter:()=>h9,width:()=>p9});function l9(t){return{x:t.x1,y:t.y1}}function c9(t){return{x:t.x2,y:t.y2}}function h9(t){return{x:(t.x1+t.x2)/2,y:Math.min(t.y1,t.y2)}}function u9(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function d9(t){return{x:(t.x1+t.x2)/2,y:Math.max(t.y1,t.y2)}}function p9(t){return Math.abs(t.x2-t.x1)}function g9(t){return Math.abs(t.y2-t.y1)}function f9(t){return{x1:Math.round(t.x1),y1:Math.round(t.y1),x2:Math.round(t.x2),y2:Math.round(t.y2)}}function m9(t){return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}}function y9(t,e){const i=xM(t),n=xM(e);return i.x1<=n.x2&&i.x2>=n.x1&&i.y1<=n.y2&&i.y2>=n.y1}function xM(t){return{x1:Math.min(t.x1,t.x2),x2:Math.max(t.x1,t.x2),y1:Math.min(t.y1,t.y2),y2:Math.max(t.y1,t.y2)}}function b9(t,e,i,n){if(typeof t=="number")return{x1:t,y1:e,x2:i,y2:n};if("width"in t)return xM({x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height});throw new Error(`Values can not be converted into a vector4: [${JSON.stringify(t)}] [${e}] [${i}] [${n}]`)}function x9(){return{x1:0,y1:0,x2:0,y2:0}}function an(t){return Bt(t)&&t.type=="gradient"}function v9(t){return qt(t)&&t.every(an)}function jj(t){return qt(t)&&t.every(e=>typeof e=="string")}function ir(t){return t!==null&&Bt(t)&&t.type=="pattern"}function ml(t){return t!==null&&Bt(t)&&t.type=="image"}function S9(t){return an(t)||ir(t)}function dl(t,e,i,n,s){return(1-s)**3*t+3*(1-s)**2*s*e+3*(1-s)*s**2*i+s**3*n}function vM(t,e,i,n,s){if(s<=Math.min(t,n))return t=Math.max(t,n))return t0&&l<1)return[l]}return[]}const r=a*a-4*s*o;if(r>=0){const l=Math.sqrt(r),c=(-a+l)/(2*s),u=(-a-l)/(2*s);return[c,u].filter(d=>d>0&&d<1)}return[]}function Gj(t,e,i,n,s,a,o,r){const l=wz(t,i,s,o),c=wz(e,n,a,r);return[...l,...c]}function xC(t,e,i){const n=dl(t[0].x,t[1].x,t[2].x,t[3].x,.5),s=dl(t[0].y,t[1].y,t[2].y,t[3].y,.5),a=Math.hypot(n-e,s-i),o=Math.min(Math.hypot(t[0].x-e,t[0].y-i),Math.hypot(t[1].x-e,t[1].y-i),Math.hypot(t[2].x-e,t[2].y-i),Math.hypot(t[3].x-e,t[3].y-i));return{points:t,distance:a,minDistance:o}}function Uj(t,e,i,n,s,a,o,r,l,c,u=1){let g={value:xC([{x:t,y:e},{x:i,y:n},{x:s,y:a},{x:o,y:r}],l,c),next:null},f;for(;g!=null;){const{points:y,distance:x,minDistance:S}=g.value;if(g=g.next,(f==null||xe.minDistance-t.minDistance;function M9({point:t,anchor:e},i,n,s,a){if(t.size===0)return!1;let o=t.x,r=t.y;e!=null&&(o-=(e.x-.5)*t.size,r-=(e.y-.5)*t.size);let l=o;oi+s&&(l=i+s);let c=r;rn+a&&(c=n+a);const u=o-l,d=r-c;return Math.hypot(u,d)<=t.size/2}function Wj(t){return t!=null&&typeof t.point=="object"&&typeof t.label=="object"}var D9={top:{x:0,y:-1},bottom:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0},"top-left":{x:-1,y:-1},"top-right":{x:1,y:-1},"bottom-left":{x:-1,y:1},"bottom-right":{x:1,y:1}};function Kj(t,e,i=5){const n=new Map,s=[],a=new Map(Array.from(t.entries(),([r,l])=>[r,l.toSorted((c,u)=>u.point.size-c.point.size)])),o=[...a.values()].flat();for(const[r,l]of a.entries()){const c=[];if(l[0]?.label){for(let u=0,d=l.length;u0&&g.placement!=null){const R=D9[g.placement];w=(D/2+I+i)*R.x,N=(A/2+I+i)*R.y}let O=f.x-D/2+w,L=f.y-A/2+N;if(x&&(O-=(x.x-.5)*f.size,L-=(x.y-.5)*f.size),MD(e,O,L,D,A)&&!o.some(R=>M9(R,O,L,D,A))&&!s.some(R=>iT(R,O,L,D,A))){const R={index:u,text:S,x:O,y:L,width:D,height:A,datum:g};c.push(R),s.push(R)}}n.set(r,c)}}return n}function Tz(t){return t.type==="continuous"||t.type==="log"}function Lz(t){return t.type==="category"}function Au(t){return"variant"in t&&t.variant==="unit-time"}function Oz(t){return!("variant"in t)}function yl(t,e){return t===void 0||e===void 0?t!==void 0||e!==void 0:Tz(t)&&Tz(e)?t.type===e.type&&tr(t.domain,e.domain)&&tr(t.range,e.range):Lz(t)&&Lz(e)?Au(t)&&Au(e)?t.firstBandTime===e.firstBandTime&&t.lastBandTime===e.lastBandTime&&t.bandCount===e.bandCount&&t.intervalMs===e.intervalMs&&t.inset===e.inset&&t.step===e.step:Oz(t)&&Oz(e)?t.inset===e.inset&&t.step===e.step&&tr(t.domain,e.domain):!1:!1}function cp(t){return t==null?!1:t.type==="category"?Au(t)?Number.isFinite(t.firstBandTime)&&Number.isFinite(t.lastBandTime)&&Number.isFinite(t.bandCount)&&t.bandCount>0:t.domain.every(e=>e!=null):t.domain.every(e=>Number.isFinite(e)||e instanceof Date)&&t.range.every(e=>Number.isFinite(e))}function Ks(t){switch(t.type){case"linear":case"step":case"multi-line":return[{x:t.x0,y:t.y0},{x:t.x1,y:t.y1}];case"cubic":return[{x:t.cp0x,y:t.cp0y},{x:t.cp3x,y:t.cp3y}]}}function A9(t){const e=Ks(t);return e[0].x>e[1].x&&e.reverse(),e}function SM(t,e){const{x:i,y:n}=e;switch(t.type){case"linear":return{type:"linear",moveTo:t.moveTo,x0:i,y0:n,x1:i,y1:n};case"step":return{type:"step",moveTo:t.moveTo,x0:i,y0:n,x1:i,y1:n,stepX:i};case"cubic":return{type:"cubic",moveTo:t.moveTo,cp0x:i,cp0y:n,cp1x:i,cp1y:n,cp2x:i,cp2y:n,cp3x:i,cp3y:n};case"multi-line":return{type:"multi-line",moveTo:t.moveTo,x0:i,y0:n,x1:i,y1:n,midPoints:t.midPoints.map(()=>({x:i,y:n}))}}}function If(t,e,i){const[n,s]=Ks(t),a=s.x===n.x?0:(i.x-e.x)/(s.x-n.x),o=s.y===n.y?0:(i.y-e.y)/(s.y-n.y);switch(t.type){case"linear":return{type:"linear",moveTo:t.moveTo,x0:e.x,y0:e.y,x1:i.x,y1:i.y};case"cubic":return{type:"cubic",moveTo:t.moveTo,cp0x:e.x,cp0y:e.y,cp1x:i.x-(t.cp2x-n.x)*a,cp1y:i.y-(t.cp2y-n.y)*o,cp2x:i.x-(t.cp1x-n.x)*a,cp2y:i.y-(t.cp1y-n.y)*o,cp3x:i.x,cp3y:i.y};case"step":return{type:"step",moveTo:t.moveTo,x0:e.x,y0:e.y,x1:i.x,y1:i.y,stepX:i.x-(t.stepX-n.x)*a};case"multi-line":return{type:"multi-line",moveTo:t.moveTo,x0:e.x,y0:e.y,x1:i.x,y1:i.y,midPoints:t.midPoints.map(r=>({x:e.x+(r.x-n.x)*a,y:e.y+(r.y-n.y)*o}))}}}function IT(t,e,i){const{moveTo:n}=t,[s,a]=A9(t),{x:o,y:r}=s,{x:l,y:c}=a;if(il)return If(t,a,a);switch(t.type){case"linear":{const u=r===c?void 0:(c-r)/(l-o),d=u==null?r:u*(e-o)+r,g=u==null?r:u*(i-o)+r;return{type:"linear",moveTo:n,x0:e,y0:d,x1:i,y1:g}}case"step":if(i<=t.stepX){const u=t.y0;return{type:"step",moveTo:n,x0:e,y0:u,x1:i,y1:u,stepX:i}}else if(e>=t.stepX){const u=t.y1;return{type:"step",moveTo:n,x0:e,y0:u,x1:i,y1:u,stepX:e}}else{const{y0:u,y1:d,stepX:g}=t;return{type:"step",moveTo:n,x0:e,y0:u,x1:i,y1:d,stepX:g}}case"cubic":{const u=vM(t.cp0x,t.cp1x,t.cp2x,t.cp3x,e);let[d,g]=$b(t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,u);const f=vM(g[0].x,g[1].x,g[2].x,g[3].x,i);return[g,d]=$b(g[0].x,g[0].y,g[1].x,g[1].y,g[2].x,g[2].y,g[3].x,g[3].y,f),{type:"cubic",moveTo:n,cp0x:g[0].x,cp0y:g[0].y,cp1x:g[1].x,cp1y:g[1].y,cp2x:g[2].x,cp2y:g[2].y,cp3x:g[3].x,cp3y:g[3].y}}case"multi-line":{const{midPoints:u}=t,d=u.findLastIndex(O=>O.x<=e);let g=u.findIndex(O=>O.x>=i);g===-1&&(g=u.length);const f=d>=0?u[d]:void 0,y=f?.x??o,x=f?.y??r,S=g(t[t.MoveTo=0]="MoveTo",t[t.LineTo=1]="LineTo",t[t.Skip=2]="Skip",t))(sa||{});function Yj(t){const e=[];let i=0,n=Number.NaN,s=Number.NaN;for(const{x:a,y:o}of t){if(i>0){const r=i===1;e.push({type:"linear",moveTo:r,x0:n,y0:s,x1:a,y1:o})}i+=1,n=a,s=o}return e}var I9={start:0,middle:.5,end:1};function $j(t,e){const i=[];let n=0,s=Number.NaN,a=Number.NaN;const o=typeof e=="number"?e:I9[e];for(const{x:r,y:l}of t){if(n>0){const c=n===1,u=s+(r-s)*o;i.push({type:"step",moveTo:c,x0:s,y0:a,x1:r,y1:l,stepX:u})}n+=1,s=r,a=l}return i}function Xj(t,e){const i=Array.isArray(t)?t:Array.from(t);if(i.length<=1)return[];const n=.05,s=i.map((o,r)=>{const l=r===0?o:i[r-1],c=r===i.length-1?o:i[r+1],u=r===0||r===i.length-1;if(Math.sign(l.y-o.y)===Math.sign(c.y-o.y))return 0;if(!u){const d=Math.abs(l.y-c.y),g=Math.abs(o.y-l.y)/d,f=Math.abs(o.y-c.y)/d;if(g<=n||1-g<=n||f<=n||1-f<=n)return 0}return(c.y-l.y)/(c.x-l.x)});s[1]===0&&(s[0]*=2),s.at(-2)===0&&(s[s.length-1]*=2);const a=[];for(let o=1;oMath.abs(g)&&(f*=Math.abs(g/y),y=Math.sign(y)*Math.abs(g)),l===0&&Math.abs(S)>Math.abs(g)&&(x*=Math.abs(g/S),S=Math.sign(S)*Math.abs(g)),a.push({type:"cubic",moveTo:o===1,cp0x:r.x,cp0y:r.y,cp1x:r.x+f,cp1y:r.y+y,cp2x:c.x-x,cp2y:c.y-S,cp3x:c.x,cp3y:c.y})}return a}var vo=0,Hn=1;function Ni(t){return{x:{min:t?.x?.min??vo,max:t?.x?.max??Hn},y:{min:t?.y?.min??vo,max:t?.y?.max??Hn}}}var Zf=class extends xt{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(t){this._dirty=!1}isDirty(){return this._dirty}onChangeDetection(t){this.markDirty()}},z0={days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]};function kT(t,e=new Date(t.getFullYear(),0,1)){const i=t.getTimezoneOffset()-e.getTimezoneOffset(),n=t.getTime()-e.getTime()+i*6e4,s=36e5*24;return Math.floor(n/s)}function Ez(t,e){const n=new Date(t.getFullYear(),0,1).getDay(),s=(e-n+7)%7,a=new Date(t.getFullYear(),0,s+1);return a<=t?Math.floor(kT(t,a)/7)+1:0}var k9=0,Zj=1,Rz=4;function qj(t,e=t.getFullYear()){const n=new Date(e,0,1).getDay(),s=(Rz-n+7)%7,a=new Date(e,0,s-(Rz-Zj)+1);return a<=t?Math.floor(kT(t,a)/7)+1:qj(t,e-1)}function C9(t){const e=t.getTimezoneOffset(),i=Math.abs(e);return`${e>0?"-":"+"}${ys(Math.floor(i/60),2,"0")}${ys(Math.floor(i%60),2,"0")}`}var w9={a:t=>z0.shortDays[t.getDay()],A:t=>z0.days[t.getDay()],b:t=>z0.shortMonths[t.getMonth()],B:t=>z0.months[t.getMonth()],c:"%x, %X",d:(t,e)=>ys(t.getDate(),2,e??"0"),e:"%_d",f:(t,e)=>ys(t.getMilliseconds()*1e3,6,e??"0"),H:(t,e)=>ys(t.getHours(),2,e??"0"),I:(t,e)=>{const i=t.getHours()%12;return i===0?"12":ys(i,2,e??"0")},j:(t,e)=>ys(kT(t)+1,3,e??"0"),m:(t,e)=>ys(t.getMonth()+1,2,e??"0"),M:(t,e)=>ys(t.getMinutes(),2,e??"0"),L:(t,e)=>ys(t.getMilliseconds(),3,e??"0"),p:t=>t.getHours()<12?"AM":"PM",Q:t=>String(t.getTime()),s:t=>String(Math.floor(t.getTime()/1e3)),S:(t,e)=>ys(t.getSeconds(),2,e??"0"),u:t=>{let e=t.getDay();return e<1&&(e+=7),String(e%7)},U:(t,e)=>ys(Ez(t,k9),2,e??"0"),V:(t,e)=>ys(qj(t),2,e??"0"),w:(t,e)=>ys(t.getDay(),2,e??"0"),W:(t,e)=>ys(Ez(t,Zj),2,e??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(t,e)=>ys(t.getFullYear()%100,2,e??"0"),Y:(t,e)=>ys(t.getFullYear(),4,e??"0"),Z:t=>C9(t),"%":()=>"%"},N9={_:" ",0:"0","-":""};function ys(t,e,i){const n=String(Math.floor(t));return n.length>=e?n:`${i.repeat(e-n.length)}${n}`}function kf(t){const e=[];for(;t.length>0;){let i=t.indexOf("%");if(i!==0){const r=i>0?t.substring(0,i):t;e.push(r)}if(i<0)break;const n=t[i+1],s=N9[n];s!=null&&i++;const a=t[i+1],o=w9[a];if(typeof o=="function")e.push([o,s]);else if(typeof o=="string"){const r=kf(o);e.push([r,s])}else e.push(`${s??""}${a}`);t=t.substring(i+2)}return i=>{const n=typeof i=="number"?new Date(i):i;return e.map(s=>typeof s=="string"?s:s[0](n,s[1])).join("")}}function Xy(t,e){const i=$t("button",ND("ag-charts-input ag-charts-button",e));return t.label===void 0?(i.append(eG(t.icon)),i.ariaLabel=t.altText):i.append(t.label),i.addEventListener("click",t.onPress),Nr(i,e),i}function Qj(t,e){const i=$t("input",ND("ag-charts-input ag-charts-checkbox",e));return i.type="checkbox",i.checked=t.checked,i.addEventListener("change",n=>t.onChange(i.checked,n)),i.addEventListener("keydown",n=>{lT(n)&&(n.preventDefault(),i.click())}),Nr(i,e),i}function Jj(t,e){const i=$t("select",ND("ag-charts-input ag-charts-select",e));return i.append(...t.options.map(n=>{const s=$t("option");return s.value=n.value,s.textContent=n.label,s})),ye(i,"data-preventdefault",!1),i.value=t.value,i.addEventListener("change",n=>t.onChange(i.value,n)),Nr(i,e),i}function tG(t,e){const i=$t("textarea",ND("ag-charts-input ag-charts-textarea",e));return i.value=t.value,i.addEventListener("input",n=>t.onChange(i.value,n)),Nr(i,e),ye(i,"data-preventdefault",!1),i}function eG(t){const e=$t("span",`ag-charts-icon ag-charts-icon-${t}`);return ye(e,"aria-hidden",!0),e}function ND(t,e){return e==null?t:`${t} ${e.class}`}var iG=t=>t,T9=t=>1-Math.cos(t*Math.PI/2),Lc=t=>Math.sin(t*Math.PI/2),L9=t=>-(Math.cos(t*Math.PI)-1)/2,O9=t=>t*t,E9=t=>1-(1-t)**2,R9=t=>t<.5?2*t*t:1-(-2*t+2)**2/2,nG=t=>2*Math.asin(t)/Math.PI,sG=(t,e)=>t===e;function ut(t){return function(e,i){const n=`__${i}`;e[i]||CT(e,i,n,t)}}function TD(t){return ut(t)}function Bu(t){return ut(t)}function Vx(t){const e=t??{};return e.equals=tr,ut(t)}function fe(t){return function(e,i){const n=`__${i}`;e[i]||CT(e,i,n,t)}}function _x(t){return function(e,i){const n=`__${i}`;e[i]||CT(e,i,n,t)}}function CT(t,e,i,n){const{changeCb:s,convertor:a,checkDirtyOnAssignment:o=!1}=n??{},r={changeCb:s,checkDirtyOnAssignment:o,convertor:a},l=B9(i,z9(P9(V9(i,r),r),r),r);function c(){return this[i]}Object.defineProperty(t,e,{set:l,get:c,enumerable:!0,configurable:!0})}function P9(t,e){const{convertor:i}=e;if(i){let n=function(a){t.call(this,s(a))};const s=i;return n}return t}var aG=Symbol("no-change");function z9(t,e){const{changeCb:i}=e;if(i){let n=function(a){const o=t.call(this,a);return o!==aG&&s.call(this,this),o};const s=i;return n}return t}function B9(t,e,i){const{checkDirtyOnAssignment:n}=i;return n?function(a){const o=e.call(this,a);return a?._dirty===!0&&this.markDirty(t),o}:e}function V9(t,e){const{equals:i=sG}=e;function n(s){const a=this[t];return i(s,a)?aG:(this[t]=s,this.onChangeDetection(t),s)}return n}const _9=Object.freeze(Object.defineProperty({__proto__:null,AGGREGATION_INDEX_UNSET:sp,AGGREGATION_INDEX_X_MAX:wa,AGGREGATION_INDEX_X_MIN:Ca,AGGREGATION_INDEX_Y_MAX:Ta,AGGREGATION_INDEX_Y_MIN:Na,AGGREGATION_MAX_POINTS:s8,AGGREGATION_MIN_RANGE:Ou,AGGREGATION_SPAN:er,AGGREGATION_THRESHOLD:Vc,AbstractModuleInstance:Ln,ActionOnSet:Pe,AdjacencyListGraph:pj,AgDocument:J4,AsyncAwaitQueue:dM,BASE_FONT_SIZE:Wh,BREAK_TRANSFORM_CHAIN:oM,BaseProperties:xt,Border:Ru,CANVAS_HEIGHT:x8,CANVAS_TO_BUFFER_DEFAULTS:v8,CANVAS_WIDTH:b8,CARTESIAN_AXIS_TYPE:ie,CARTESIAN_POSITION:he,CallbackCache:Q4,ChangeDetectableProperties:Zf,ChartAxisDirection:z,ChartUpdateType:Ct,CleanupRegistry:qe,Color:se,ConfiguredCanvasMixin:S8,DEFAULT_ANNOTATION_HANDLE_FILL:vx,DEFAULT_ANNOTATION_STATISTICS_COLOR:Dx,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:Ax,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:Gb,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:Ub,DEFAULT_ANNOTATION_STATISTICS_FILL:Sx,DEFAULT_ANNOTATION_STATISTICS_STROKE:Mx,DEFAULT_CAPTION_ALIGNMENT:Qh,DEFAULT_CAPTION_LAYOUT_STYLE:qh,DEFAULT_FIBONACCI_STROKES:jb,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:Ws,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:ra,DEFAULT_POLAR_SERIES_STROKE:xD,DEFAULT_SHADOW_COLOUR:Dp,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:vD,DEFAULT_TEXTBOX_COLOR:Cx,DEFAULT_TEXTBOX_FILL:Ix,DEFAULT_TEXTBOX_STROKE:kx,DEFAULT_TEXT_ANNOTATION_COLOR:SD,DEFAULT_TOOLBAR_POSITION:wx,DIRECTION_SWAP_AXES:Y4,Debug:Gt,DebugMetrics:Vr,DeclaredSceneChangeDetection:fe,DeclaredSceneObjectChangeDetection:_x,Deprecated:I8,DeprecatedAndRenamedTo:k8,EllipsisChar:Ff,ErrorType:m4,EventEmitter:cr,FILL_GRADIENT_BLANK_DEFAULTS:ZX,FILL_GRADIENT_CONIC_SERIES_DEFAULTS:JX,FILL_GRADIENT_LINEAR_DEFAULTS:Tl,FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS:$4,FILL_GRADIENT_LINEAR_KEYED_DEFAULTS:B1,FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS:qX,FILL_GRADIENT_RADIAL_DEFAULTS:pD,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS:Sp,FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS:X4,FILL_GRADIENT_RADIAL_SERIES_DEFAULTS:QX,FILL_IMAGE_BLANK_DEFAULTS:i8,FILL_IMAGE_DEFAULTS:$s,FILL_PATTERN_BLANK_DEFAULTS:e8,FILL_PATTERN_DEFAULTS:Cs,FILL_PATTERN_HIERARCHY_DEFAULTS:Z4,FILL_PATTERN_KEYED_DEFAULTS:V1,FILL_PATTERN_SINGLE_DEFAULTS:t8,FONT_SIZE:zc,FONT_SIZE_RATIO:Cn,IS_DARK_THEME:Qd,InterpolationProperties:Mp,LABEL_BOXING_DEFAULTS:Oe,LEGEND_CONTAINER_THEME:F1,LRUCache:XM,LineSplitter:au,Logger:pt,MARKER_SERIES_HIGHLIGHT_STYLE:fD,MULTI_SERIES_HIGHLIGHT_STYLE:Bc,MementoCaretaker:H1,ModuleRegistry:Ut,ModuleType:Le,ObserveChanges:Bi,PALETTE_ALT_DOWN_FILL:q1,PALETTE_ALT_DOWN_STROKE:X1,PALETTE_ALT_NEUTRAL_FILL:Q1,PALETTE_ALT_NEUTRAL_STROKE:J1,PALETTE_ALT_UP_FILL:Z1,PALETTE_ALT_UP_STROKE:$1,PALETTE_DOWN_FILL:W1,PALETTE_DOWN_STROKE:G1,PALETTE_NEUTRAL_FILL:Y1,PALETTE_NEUTRAL_STROKE:K1,PALETTE_UP_FILL:U1,PALETTE_UP_STROKE:j1,PART_WHOLE_HIGHLIGHT_STYLE:_1,POLAR_AXIS_SHAPE:yf,POLAR_AXIS_TYPE:sn,Padding:zu,ParallelStateMachine:Aj,PolarZIndexMap:gl,PropertiesArray:ss,Property:b,ProxyOnWrite:m8,ProxyProperty:qi,ProxyPropertyOnWrite:pi,SAFE_FILLS_OPERATION:XX,SAFE_FILL_OPERATION:$X,SAFE_RANGE2_OPERATION:xx,SAFE_STROKE_FILL_OPERATION:bx,SEGMENTATION_DEFAULTS:mD,SINGLE_SERIES_HIGHLIGHT_STYLE:n8,SKIP_JS_BUILTINS:P1,ScaleAlignment:wi,SceneArrayChangeDetection:Vx,SceneChangeDetection:ut,SceneObjectChangeDetection:Bu,SceneRefChangeDetection:TD,SeriesContentZIndexMap:Mc,SeriesZIndexMap:Vs,SimpleCache:D8,SpanJoin:sa,StateMachine:Rt,StateMachineProperty:Fe,TRIPLE_EQ:sG,TextMeasurer:pT,TickIntervals:yM,TrimCharsRegex:i4,TrimEdgeGuard:Rb,UNIT_MAX:Hn,UNIT_MIN:vo,UnknownError:eD,ValidationError:ou,Vec2:at,Vec4:Wt,Vertex:gj,WeakCache:oj,ZIndexMap:pe,addEscapeEventListener:rT,addFakeTransformToInstanceProperty:b,addMouseCloseListener:mj,addObserverToInstanceProperty:O1,addOverrideFocusVisibleEventListener:xj,addTouchCloseListener:yj,addTransformToInstanceProperty:Su,aggregationBucketForDatum:l8,aggregationDatumMatchesIndex:c8,aggregationDomain:gn,aggregationIndexForXRatio:yD,aggregationRangeFittingPoints:_c,aggregationXRatioForDatumIndex:xf,aggregationXRatioForXValue:ar,and:Me,angleBetween:fl,angularPadding:aN,appendEllipsis:qw,applySkiaPatches:M8,arcDistanceSquared:C8,areScalingEqual:yl,array:wl,arrayLength:Tu,arrayOf:Ft,arrayOfDefs:Xi,arraysEqual:tr,assignIfNotStrictlyEqual:eN,attachDescription:xe,attachListener:Qe,autoSizedLabelOptionsDefs:vu,barHighlightOptionsDef:Tr,bezier2DDistance:Uj,bezier2DExtrema:Gj,boolean:J,borderOptionsDef:Zd,boxCollides:iT,boxContains:MD,boxEmpty:nj,boxesEqual:sj,buildDateFormatter:kf,cachedTextMeasurer:Ve,calcLineHeight:nr,calculatePlacement:uT,callWithContext:js,callback:ai,callbackDefs:Be,callbackOf:Is,ceilTo:M4,checkDatum:_j,circularSliceArray:kr,clamp:Nt,clampArray:bf,clipLines:kj,clipSpanX:IT,collapseSpanToPoint:SM,collectAggregationLevels:h8,color:It,colorStopsOrderValidator:w1,colorUnion:Ga,commonChartOptionsDefs:Zt,commonSeriesOptionsDefs:_e,commonSeriesThemeableOptionsDefs:Ee,compactAggregationIndices:ap,compareDates:sT,computeExtremesAggregation:Eu,computeExtremesAggregationPartial:bD,constant:Jt,contextMenuItemsArray:aM,countFractionDigits:Hf,countLines:d4,createAggregationIndices:Fc,createButton:Xy,createCanvasContext:aj,createCheckbox:Qj,createDeprecationWarning:oT,createElement:$t,createElementId:lu,createIcon:eG,createId:Nn,createIdsGenerator:CD,createNumberFormatter:C1,createSelect:Jj,createSvgElement:$i,createTextArea:tG,createTicks:Xf,date:_s,dateToNumber:Ss,dateTruncationForDomain:kD,datesSortOrder:aT,debounce:M1,decodeIntervalValue:Lj,deepClone:le,deepFreeze:za,defaultEpoch:xT,defined:jt,definedZoomState:Ni,diffArrays:rj,distribute:HH,downloadUrl:Ij,dropFirstWhile:_H,dropLastWhile:FH,durationDay:op,durationHour:ep,durationMinute:tu,durationMonth:fT,durationSecond:rf,durationWeek:Cj,durationYear:Kb,easeIn:T9,easeInOut:L9,easeInOutQuad:R9,easeInQuad:O9,easeOut:Lc,easeOutQuad:E9,encodedToTimestamp:Hh,enterpriseRegistry:po,entries:Xe,errorBarOptionsDefs:lD,errorBarThemeableOptionsDefs:mx,estimateTickCount:MT,evaluateBezier:dl,every:j4,expandLegendPosition:qd,extent:Ll,extractDecoratedProperties:F4,extractDomain:Lb,fillCssOptionsDef:ia,fillGradientDefaults:sD,fillImageDefaults:oD,fillOptionsDef:wt,fillPatternDefaults:aD,findMaxIndex:Dr,findMaxValue:nT,findMinIndex:vf,findMinMax:xi,findMinValue:y8,findRangeExtent:Tc,first:Ra,flush:t4,focusCursorAtEnd:b1,fontFamilyFull:iM,fontOptionsDef:De,fontWeight:ub,formatNumber:cj,formatObjectValidator:B4,formatPercent:lj,formatValue:Or,fromPairs:G4,generateUUID:yb,geoJson:dj,getAngleRatioRadians:ej,getAttribute:Jd,getDOMMatrix:f1,getDocument:bp,getElementBBox:s4,getIconClassNames:mu,getImage:UH,getLastFocus:cT,getMaxInnerRectSize:tT,getMidpointsForIndices:ul,getMinOuterRectSize:d8,getOffscreenCanvas:qM,getPath:R1,getPath2D:Ob,getPrevNextKeys:mb,getResizeObserver:WH,getSequentialColors:So,getTickTimeInterval:Px,getWindow:Ml,googleFont:Jw,gradientColorStops:nD,gradientStrict:RS,graphemeSegments:Sc,greaterThan:Hs,groupBy:px,guardTextEdges:c4,hasNoModifiers:Nx,hasRequiredInPath:Xd,highlightOptionsDef:T1,htmlElement:A1,inRange:v4,initRovingTabIndex:cN,insertListItemsSorted:hT,instanceOf:LX,interpolationOptionsDefs:cD,intervalAgo:Oj,intervalCeil:wj,intervalEpoch:rp,intervalExtent:yT,intervalFloor:La,intervalHierarchy:Rx,intervalMilliseconds:Ms,intervalNext:mT,intervalPrevious:Nj,intervalRange:fo,intervalRangeCount:mM,intervalRangeNumeric:Tj,intervalRangeStartIndex:bT,intervalStep:Al,intervalUnit:Er,inverseEaseOut:nG,isArray:qt,isBetweenAngles:Ba,isBoolean:o4,isButtonClickEvent:lT,isColor:l4,isContinuous:Af,isDate:aa,isDecoratedObject:hD,isDefined:go,isDenseInterval:lp,isDirectionRtl:ff,isDocumentFragment:YH,isElement:m1,isEmptyObject:cb,isEnumKey:DX,isEnumValue:AX,isFiniteNumber:Ae,isFunction:Cl,isGradientFill:an,isGradientFillArray:v9,isGradientOrPatternFill:S9,isHTMLElement:Eb,isHtmlElement:x1,isImageFill:ml,isInputPending:a4,isInteger:S4,isKeyOf:jd,isNegative:sf,isNode:JS,isNumber:Je,isNumberEqual:be,isNumberObject:Vj,isObject:Bt,isObjectLike:Pb,isObjectWithProperty:U4,isObjectWithStringProperty:W4,isPatternFill:ir,isPlainObject:Ie,isPointLabelDatum:Wj,isProperties:of,isRegExp:r4,isScaleValid:cp,isSegmentTruncated:JM,isString:zi,isStringFillArray:jj,isStringObject:DT,isSymbol:hb,isTextTruncated:wu,isTimeInterval:Rj,isTimeIntervalUnit:Pj,isTruncated:u4,isUnitTimeCategoryScaling:Au,isValidDate:Ac,isValidNumberFormat:k4,iterate:Mu,joinFormatted:yu,jsonApply:fb,jsonDiff:or,jsonPropertyCompare:fj,jsonWalk:Ic,kebabCase:g4,labelBoxOptionsDef:qo,legendPositionValidator:nM,lessThan:Fs,lessThanOrEqual:b4,levenshteinDistance:p4,lineDashOptionsDef:Lt,lineDistanceSquared:Jh,lineHighlightOptionsDef:bu,lineSegmentOptions:L4,lineSegmentation:O4,linear:iG,linearGaugeSeriesOptionsDef:Du,linearGaugeSeriesThemeableOptionsDef:cM,linearGaugeTargetOptionsDef:uD,linearPoints:Yj,listDecoratedProperties:ru,lowestGranularityForInterval:zx,lowestGranularityUnitForTicks:ID,lowestGranularityUnitForValue:Bx,makeAccessibleClickListener:z8,mapValues:af,markerOptionsDefs:Lr,markerStyleOptionsDefs:Lu,measureTextSegments:Va,memo:Wf,merge:Hb,mergeArrayDefaults:YX,mergeDefaults:Et,modulus:D4,multiSeriesHighlightOptionsDef:Zi,nearestSquared:Tx,nearestSquaredInContainer:Mj,nextPowerOf2:Gf,niceTicksDomain:ST,normalisedExtentWithMetadata:Uf,normalisedTimeExtentWithMetadata:DD,normalizeAngle180:uM,normalizeAngle360:ze,normalizeAngle360FromDegrees:Dl,normalizeAngle360Inclusive:Wb,number:gt,numberFormatValidator:_r,numberMin:k1,numberRange:y4,object:Nu,objectsEqual:ks,objectsEqualWith:E1,optionsDefs:Pi,or:Xt,padding:Ar,paddingOptions:E4,parseColor:n4,parseNumberFormat:iD,partialAssign:rM,pause:oN,pick:PS,placeLabels:Kj,positiveNumber:X,positiveNumberNonZero:bo,preserveArabicJoining:S1,previousPowerOf2:nN,radialGaugeSeriesOptionsDef:yx,radialGaugeSeriesThemeableOptionsDef:hM,radialGaugeTargetOptionsDef:dD,range:Df,rangeValidator:rD,ratio:Ot,readIntegratedWrappedValue:pN,record:JH,required:ht,rescaleSpan:If,rescaleVisibleRange:pM,resetIds:B8,rotatePoint:eT,roundTo:_b,safeCall:D1,seriesLabelOptionsDefs:ei,seriesTooltipRangeValidator:P4,setAttribute:ye,setAttributes:Nr,setDocument:jH,setElementBBox:tM,setElementStyle:Cr,setElementStyles:ij,setPath:z1,setWindow:GH,shadowOptionsDefs:Nl,shallowClone:Gd,shapeHighlightOptionsDef:Si,shapeSegmentOptions:T4,shapeSegmentation:Pc,shapeValidator:xu,simpleMemorize:xs,simpleMemorize2:Pu,smoothPoints:Xj,solveBezier:vM,sortAndUniqueDates:rN,sortBasedOnArray:VH,spanRange:Ks,splitBezier2D:$b,stepPoints:$j,stopPageScrolling:vj,strictObjectKeys:hl,strictUnion:fx,string:K,stringLength:I1,stringifyValue:zb,strokeOptionsDef:bt,textOrSegments:xo,themeOperator:Fb,throttle:Qw,tickFormat:vT,tickStep:Mf,timeInterval:jf,timeIntervalUnit:vp,toArray:dx,toDegrees:tj,toFontString:v1,toIterable:H4,toPlainText:ce,toRadians:Ze,toTextString:bi,toolbarButtonOptionsDefs:Zh,tooltipOptionsDefs:Re,tooltipOptionsDefsWithArea:_4,transformIntegratedCategoryValue:bM,truncateLine:tp,typeUnion:xp,undocumented:Mt,unguardTextEdges:h4,union:dt,unionSymbol:Bb,unique:ZM,validate:ts,withTimeout:p8,without:At,wrapLines:Ox,wrapText:kc,wrapTextOrSegments:Lx,wrapTextSegments:gT},Symbol.toStringTag,{value:"Module"}));var wT=Object.defineProperty,oG=Object.getOwnPropertyDescriptor,F9=Object.getOwnPropertyNames,H9=Object.prototype.hasOwnProperty,Ap=(t,e)=>{for(var i in e)wT(t,i,{get:e[i],enumerable:!0})},j9=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of F9(e))!H9.call(t,s)&&s!==i&&wT(t,s,{get:()=>e[s],enumerable:!(n=oG(e,s))||n.enumerable});return t},G9=(t,e,i)=>(j9(t,e,"default"),i),T=(t,e,i,n)=>{for(var s=n>1?void 0:n?oG(e,i):e,a=t.length-1,o;a>=0;a--)(o=t[a])&&(s=(n?o(e,i,s):o(s))||s);return n&&s&&wT(e,i,s),s},U9={ariaInitSeriesArea:"interactive chart",ariaAnnounceHoverDatum:"${datum}",ariaAnnounceChart:"chart, ${seriesCount}[number] series",ariaAnnounceStandaloneChart:"chart, ${caption}",ariaAnnounceHierarchyChart:"hierarchy chart, ${caption}",ariaAnnounceGaugeChart:"gauge chart, ${caption}",ariaAnnounceHierarchyDatum:"level ${level}[number], ${count}[number] children, ${description}",ariaAnnounceFlowProportionLink:"link ${index} of ${count}, from ${from} to ${to}, ${sizeName} ${size}",ariaAnnounceFlowProportionNode:"node ${index} of ${count}, ${description}",ariaDescriptionLegendItem:"Press Space or Enter to toggle visibility",ariaLabelAddHorizontalLine:"Add Horizontal Line",ariaLabelAnnotationsToolbar:"Annotations",ariaLabelAnnotationOptionsToolbar:"Annotation Options",ariaLabelAnnotationSettingsDialog:"Annotation Settings",ariaLabelColor:"Color",ariaLabelColorPicker:"Color picker",ariaLabelColorPickerAlpha:"Transparency",ariaLabelColorPickerHue:"Hue",ariaLabelColorPickerMultiColor:"Multi Color",ariaLabelColorPickerPalette:"Palette",ariaLabelFinancialCharts:"Financial Charts",ariaLabelGaugeTarget:"Target",ariaLabelGaugeValue:"Value",ariaLabelLegend:"Legend",ariaLabelLegendPagination:"Legend Pagination",ariaLabelLegendPagePrevious:"Previous Legend Page",ariaLabelLegendPageNext:"Next Legend Page",ariaLabelLegendItem:"${label}, Legend item ${index}[number] of ${count}[number]",ariaLabelLegendItemUnknown:"Unknown legend item",ariaLabelNavigator:"Navigator",ariaLabelNavigatorRange:"Range",ariaLabelScrollbarHorizontal:"X-axis scrollbar",ariaLabelScrollbarVertical:"Y-axis scrollbar",ariaLabelNavigatorMinimum:"Minimum",ariaLabelNavigatorMaximum:"Maximum",ariaLabelRangesToolbar:"Ranges",ariaLabelSettingsTabBar:"Settings",ariaLabelZoomToolbar:"Zoom",ariaRoleDescription2DSlider:"2D slider",ariaValueColorPalette:"s ${s}[percent0to2dp], v ${v}[percent0to2dp]",ariaValueColorPaletteFirstV:"v ${v}[percent0to2dp], s ${s}[percent0to2dp]",ariaValuePanRange:"${min}[percent0to2dp] to ${max}[percent0to2dp]",iconAltTextLineStyleSolid:"Solid",iconAltTextLineStyleDashed:"Long-dashed",iconAltTextLineStyleDotted:"Short-dashed",iconAltTextPositionTop:"Top",iconAltTextPositionCenter:"Center",iconAltTextPositionBottom:"Bottom",iconAltTextAlignLeft:"Left",iconAltTextAlignCenter:"Center",iconAltTextAlignRight:"Right",iconAltTextClose:"Close",overlayLoadingData:"Loading data...",overlayNoData:"No data to display",overlayNoVisibleSeries:"No visible series",overlayUnsupportedBrowser:"Incompatible browser version. Please upgrade your browser.",seriesHistogramTooltipFrequency:"Frequency",seriesHistogramTooltipSum:"${yName} (sum)",seriesHistogramTooltipCount:"${yName} (count)",seriesHistogramTooltipMean:"${yName} (mean)",toolbarSeriesTypeDropdown:"Chart Type",toolbarSeriesTypeOHLC:"OHLC",toolbarSeriesTypeHLC:"HLC",toolbarSeriesTypeHighLow:"High Low",toolbarSeriesTypeCandles:"Candles",toolbarSeriesTypeHollowCandles:"Hollow Candles",toolbarSeriesTypeLine:"Line",toolbarSeriesTypeLineWithMarkers:"Line with Markers",toolbarSeriesTypeStepLine:"Step Line",toolbarAnnotationsTrendLine:"Trend Line",toolbarAnnotationsFibonacciRetracement:"Fib Retracement",toolbarAnnotationsFibonacciRetracementTrendBased:"Fib Trend Based",toolbarAnnotationsHorizontalLine:"Horizontal Line",toolbarAnnotationsVerticalLine:"Vertical Line",toolbarAnnotationsParallelChannel:"Parallel Channel",toolbarAnnotationsDisjointChannel:"Disjoint Channel",toolbarAnnotationsClearAll:"Clear All",toolbarAnnotationsFillColor:"Fill Color",toolbarAnnotationsLineColor:"Line Color",toolbarAnnotationsLineStyle:"Line Style",toolbarAnnotationsLineStrokeWidth:"Line Stroke Width",toolbarAnnotationsSettings:"Settings",toolbarAnnotationsTextColor:"Text Color",toolbarAnnotationsTextSize:"Text Size",toolbarAnnotationsLock:"Lock",toolbarAnnotationsUnlock:"Unlock",toolbarAnnotationsDelete:"Delete",toolbarAnnotationsDragHandle:"Drag Toolbar",toolbarAnnotationsLineAnnotations:"Trend Lines",toolbarAnnotationsFibonacciAnnotations:"Fibonacci",toolbarAnnotationsTextAnnotations:"Text Annotations",toolbarAnnotationsShapeAnnotations:"Arrows",toolbarAnnotationsMeasurerAnnotations:"Measurers",toolbarAnnotationsCallout:"Callout",toolbarAnnotationsComment:"Comment",toolbarAnnotationsNote:"Note",toolbarAnnotationsText:"Text",toolbarAnnotationsArrow:"Arrow",toolbarAnnotationsArrowUp:"Arrow Up",toolbarAnnotationsArrowDown:"Arrow Down",toolbarAnnotationsDateRange:"Date Range",toolbarAnnotationsPriceRange:"Price Range",toolbarAnnotationsDatePriceRange:"Date and Price",toolbarAnnotationsQuickDatePriceRange:"Measure",toolbarRange1Month:"1M",toolbarRange1MonthAria:"1 month",toolbarRange3Months:"3M",toolbarRange3MonthsAria:"3 months",toolbarRange6Months:"6M",toolbarRange6MonthsAria:"6 months",toolbarRangeYearToDate:"YTD",toolbarRangeYearToDateAria:"Year to date",toolbarRange1Year:"1Y",toolbarRange1YearAria:"1 year",toolbarRangeAll:"All",toolbarRangeAllAria:"All",toolbarRangeSelectRange:"Select range",toolbarRangeSelectRangeAria:"Select range",toolbarZoomZoomOut:"Zoom out",toolbarZoomZoomIn:"Zoom in",toolbarZoomPanLeft:"Pan left",toolbarZoomPanRight:"Pan right",toolbarZoomPanStart:"Pan to the start",toolbarZoomPanEnd:"Pan to the end",toolbarZoomReset:"Reset the zoom",contextMenuDownload:"Download",contextMenuToggleSeriesVisibility:"Toggle Visibility",contextMenuToggleOtherSeries:"Toggle Other Series",contextMenuZoomToCursor:"Zoom to here",contextMenuPanToCursor:"Pan to here",contextMenuResetZoom:"Reset zoom",dialogHeaderChannel:"Channel",dialogHeaderLine:"Line",dialogHeaderFibonacciRange:"Fib Retracement",dialogHeaderDateRange:"Date Range",dialogHeaderPriceRange:"Price Range",dialogHeaderDatePriceRange:"Date and Price",dialogHeaderText:"Text",dialogInputAlign:"Align",dialogInputColorPicker:"Color",dialogInputColorPickerAltText:"Text Color",dialogInputFillColorPicker:"Fill",dialogInputFillColorPickerAltText:"Fill Color",dialogInputExtendChannelStart:"Extend channel start",dialogInputExtendChannelEnd:"Extend channel end",dialogInputExtendLineStart:"Extend line start",dialogInputExtendLineEnd:"Extend line end",dialogInputExtendAbove:"Extend above",dialogInputExtendBelow:"Extend below",dialogInputExtendLeft:"Extend left",dialogInputExtendRight:"Extend right",dialogInputReverse:"Reverse",dialogInputShowFill:"Show Fill",dialogInputFontSize:"Size",dialogInputFontSizeAltText:"Font Size",dialogInputLineStyle:"Dash",dialogInputPosition:"Position",dialogInputStrokeWidth:"Weight",dialogInputStrokeWidthAltText:"Line Weight",dialogInputFibonacciBands:"Bands",dialogInputFibonacciBandsAltText:"Fibonacci Bands",inputTextareaPlaceholder:"Add Text",measurerDateRangeBars:"${value}[number] bars",measurerPriceRangeValue:"${value}[number]",measurerPriceRangePercent:"${value}[percent]",measurerVolume:"Vol ${value}",tooltipPaginationStatus:"${index}[number] of ${count}[number]"},LD=Symbol("interpolate"),MM=t=>t[LD]!=null,Xb=class Hg{constructor(e,i,n,s){this.x=e,this.y=i,this.width=n,this.height=s}static fromObject({x:e,y:i,width:n,height:s}){return new Hg(e,i,n,s)}static merge(e){let i=1/0,n=1/0,s=-1/0,a=-1/0;for(const o of e)o.xs&&(s=Es(o.x,o.width)),Es(o.y,o.height)>a&&(a=Es(o.y,o.height));return new Hg(i,n,s-i,a-n)}static nearestBox(e,i,n){return Tx(e,i,n)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:Es(this.x,this.width),bottom:Es(this.y,this.height),toJSON(){return{}}}}clone(){const{x:e,y:i,width:n,height:s}=this;return new Hg(e,i,n,s)}equals(e){return sj(this,e)}containsPoint(e,i){return MD(this,e,i)}intersectsWith(e){return!(this.x+this.width<=e.x||e.x+e.width<=this.x||this.y+this.height<=e.y||e.y+e.height<=this.y)}intersection(e){const i=Math.max(this.x,e.x),n=Math.max(this.y,e.y),s=Math.min(Es(this.x,this.width),Es(e.x,e.width)),a=Math.min(Es(this.y,this.height),Es(e.y,e.height));if(!(i>s||n>a))return new Hg(i,n,s-i,a-n)}collidesBBox(e){return this.xe.x&&this.ye.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(e,i){if(this.containsPoint(e,i))return 0;const n=e-Nt(this.x,e,Es(this.x,this.width)),s=i-Nt(this.y,i,Es(this.y,this.height));return n*n+s*s}shrink(e,i){if(typeof e=="number")this.applyMargin(e,i);else for(const n of Object.keys(e)){const s=e[n];typeof s=="number"&&this.applyMargin(s,n)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(e,i){if(typeof e=="number")this.applyMargin(-e,i);else for(const n of Object.keys(e)){const s=e[n];typeof s=="number"&&this.applyMargin(-s,n)}return this}applyMargin(e,i){switch(i){case"top":this.y+=e;case"bottom":this.height-=e;break;case"left":this.x+=e;case"right":this.width-=e;break;case"vertical":this.y+=e,this.height-=e*2;break;case"horizontal":this.x+=e,this.width-=e*2;break;case void 0:this.x+=e,this.y+=e,this.width-=e*2,this.height-=e*2;break}}translate(e,i){return this.x+=e,this.y+=i,this}[LD](e,i){return new Hg(this.x*(1-i)+e.x*i,this.y*(1-i)+e.y*i,this.width*(1-i)+e.width*i,this.height*(1-i)+e.height*i)}};Xb.zero=Object.freeze(new Xb(0,0,0,0));Xb.NaN=Object.freeze(new Xb(Number.NaN,Number.NaN,Number.NaN,Number.NaN));var Tt=Xb;function Es(t,e){return t===-1/0&&e===1/0?1/0:t+e}function rG({context:t,pixelRatio:e,width:i,height:n}){t.save();try{t.resetTransform(),t.clearRect(0,0,Math.ceil(i*e),Math.ceil(n*e))}finally{t.restore()}}function lG(t){if(Gt.check("canvas")){const e=t.save.bind(t),i=t.restore.bind(t);let n=0;Object.assign(t,{save(){e(),n++},restore(){if(n===0)throw new Error("AG Charts - Unable to restore() past depth 0");i(),n--},verifyDepthZero(){if(n!==0)throw new Error(`AG Charts - Save/restore depth is non-zero: ${n}`)}})}}function Pz(t,e,i){return[Math.floor(t*i),Math.floor(e*i)]}var vC;function W9(){const t=qM();return vC??(vC=new t(1,1)),vC}var NT=class{constructor(t){const{width:e,height:i,pixelRatio:n,willReadFrequently:s=!1}=t;this.width=e,this.height=i,this.pixelRatio=n;const[a,o]=Pz(e,i,n),r=qM();this.canvas=new r(a,o),this.context=this.canvas.getContext("2d",{willReadFrequently:s}),this.context.setTransform(n,0,0,n,0,0),lG(this.context)}drawImage(t,e=0,i=0){return t.drawImage(this.canvas,e,i)}transferToImageBitmap(){return this.canvas.width<1||this.canvas.height<1?W9().transferToImageBitmap():this.canvas.transferToImageBitmap()}resize(t,e,i){if(!(t>0&&e>0))return;const{canvas:n,context:s}=this;if(t!==this.width||e!==this.height||i!==this.pixelRatio){const[a,o]=Pz(t,e,i);n.width=a,n.height=o}s.setTransform(i,0,0,i,0,0),this.width=t,this.height=e,this.pixelRatio=i}clear(){rG(this)}destroy(){this.canvas.width=0,this.canvas.height=0,this.context.clearRect(0,0,0,0),this.canvas=null,this.context=null,Object.freeze(this)}},SC=(t,e)=>Math.sign(t-e);function cG(t,e){if(typeof t=="number"&&typeof e=="number")return SC(t,e);const i=typeof t=="number"?[t]:t,n=typeof e=="number"?[e]:e,s=Math.min(i.length,n.length);for(let a=0;a(t[t.All=0]="All",t[t.None=1]="None",t))(hG||{}),K9=5,hp=class gN{constructor(e){this.serialNumber=gN._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=Nn(this),this.name=void 0,this.transitionOut=void 0,this.pointerEvents=0,this._datum=void 0,this._previousDatum=void 0,this.scene=void 0,this._debugDirtyProperties=void 0,this.parentNode=void 0,this.cachedBBox=void 0,this.isContainerNode=!1,this.visible=!0,this.zIndex=0,this.batchLevel=0,this.batchDirty=!1,this.name=e?.name,this.tag=e?.tag??Number.NaN,this.zIndex=e?.zIndex??0,this.scene=e?.scene,(e?.debugDirty??gN._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(e,i,n){const s=e?.toSVG();if(s==null||!s.elements.length&&!s.defs?.length)return;const a=$i("svg");if(a.setAttribute("width",String(i)),a.setAttribute("height",String(n)),a.setAttribute("viewBox",`0 0 ${i} ${n}`),a.setAttribute("overflow","visible"),s.defs?.length){const o=$i("defs");o.append(...s.defs),a.append(o)}return a.append(...s.elements),a.outerHTML}static*extractBBoxes(e,i){for(const n of e)if(!i||n.visible&&!n.transitionOut){const s=n.getBBox();s&&(yield s)}}get datum(){return this._datum}set datum(e){this._datum!==e&&(this._previousDatum=this._datum,this._datum=e)}get previousDatum(){return this._previousDatum}get layerManager(){return this.scene?.layersManager}get imageLoader(){return this.scene?.imageLoader}closestDatum(){for(const{datum:e}of this.traverseUp(!0))if(e!=null)return e}preRender(e,i=1){if(this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=i,this.childNodeCounts.thisComplexity=i,this.batchLevel>0||this.batchDirty)throw new Error("AG Charts - illegal rendering state; batched update in progress");return this.childNodeCounts}isolatedRender(e){e.ctx.save();try{this.render(e)}catch(i){const n=i.errorCount??1;if(n>=K9)throw i.errorCount=n,i;pt.warnOnce("Error during rendering",i,i.stack)}finally{e.ctx.restore()}}render(e){const{stats:i}=e;if(this.debugDirtyProperties(),e.debugNodeSearch){const n=this.name??this.id;e.debugNodeSearch.some(s=>typeof s=="string"?s===n:s.test(n))&&(e.debugNodes[this.name??this.id]=this)}i&&(i.nodesRendered++,i.opsPerformed+=this.childNodeCounts.thisComplexity)}setScene(e){this.scene=e}*traverseUp(e){e&&(yield this);let i=this.parentNode;for(;i;)yield i,i=i.parentNode}isRoot(){return!this.parentNode}removeChild(e){throw new Error(`AG Charts - internal error, unknown child node ${e.name??e.id} in $${this.name??this.id}`)}remove(){this.parentNode?.removeChild(this)}destroy(){this.parentNode&&this.remove()}batchedUpdate(e){this.batchLevel++;try{e()}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}}setProperties(e){this.batchLevel++;try{eN(this,e)}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}setPropertiesWithKeys(e,i){this.batchLevel++;try{eN(this,e,i)}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}containsPoint(e,i){return!1}pickNode(e,i){if(this.containsPoint(e,i))return this}pickNodes(e,i,n=[]){return this.containsPoint(e,i)&&n.push(this),n}getBBox(){return this.cachedBBox??(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}onChangeDetection(e){this.markDirty(e)}markDirtyChildrenOrder(){this.cachedBBox=void 0}markDirty(e){if(this.batchLevel>0){this.batchDirty=!0;return}e!=null&&this._debugDirtyProperties&&this.markDebugProperties(e),this.cachedBBox=void 0,this.parentNode?.markDirty()}markDebugProperties(e){const i=this._debugDirtyProperties?.get(e)??[],n=new Error("Stack trace for property change tracking").stack?.split(` +`).filter(s=>s!=="Error"&&!s.includes(".markDebugProperties")&&!s.includes(".markDirty")&&!s.includes("Object.assign ")&&!s.includes(`${this.constructor.name}.`))??"unknown";i.push(n[0].replace(" at ","").trim()),this._debugDirtyProperties?.set(e,i)}debugDirtyProperties(){if(this._debugDirtyProperties!=null){if(!this._debugDirtyProperties.has("__first__"))for(const[e,i]of this._debugDirtyProperties.entries())i.length>1&&pt.logGroup(`Property changed multiple times before render: ${this.constructor.name}.${e} (${i.length}x)`,()=>{for(const n of i)pt.log(n)});this._debugDirtyProperties.clear()}}static handleNodeZIndexChange(e){e.onZIndexChange()}onZIndexChange(){this.parentNode?.markDirtyChildrenOrder()}resolveFont(){}toSVG(){}};hp.className="AbstractNode";hp._nextSerialNumber=0;hp._debugEnabled=!1;T([fe()],hp.prototype,"visible",2);T([fe({changeCb:hp.handleNodeZIndexChange})],hp.prototype,"zIndex",2);var Oc=hp,OD=class{ticks(t,e,i){}niceDomain(t,e=this.domain){return e}get bandwidth(){}get step(){}get inset(){}},ED=(t,e)=>{const i=Symbol(String(e));t[i]=void 0,Object.defineProperty(t,e,{get(){return this[i]},set(n){this[i]!==n&&(this[i]=n,this.invalid=!0)},enumerable:!0,configurable:!1})};function uG(t,e,i){if(i==null||i[0]===0&&i[1]===1)return;const n=Nt(0,Math.floor(i[0]*t.length),t.length),s=Nt(0,Math.ceil(i[1]*t.length),t.length),a=e?t.length-s:n,o=e?t.length-n:s;return[a,o]}function zz(t,e,i){return uG(t,e,i)??[0,t.length]}function dG(t,e,i){const n=uG(t,e,i);if(n==null)return{ticks:t,count:t.length,firstTickIndex:0};const[s,a]=n;return{ticks:t.slice(s,a),count:t.length,firstTickIndex:s}}function RD(t){const e=pN(t.at(0)),i=pN(t.at(-1));return e!=null&&i!=null?[e,i]:[void 0,void 0]}var Bz=t=>{const e=se.fromString(t),[i,n,s]=se.RGBtoOKLCH(e.r,e.g,e.b);return{l:i,c:n,h:s,a:e.a}},MC=1e-6,Vz=t=>t.c1-MC,Y9=(t,e,i)=>{i=Nt(0,i,1);let n;if(Vz(t))n=e.h;else if(Vz(e))n=t.h;else{const r=t.h;let l=e.h;const c=e.h-t.h;c>180?l-=360:c<-180&&(l+=360),n=r*(1-i)+l*i}const s=t.c*(1-i)+e.c*i,a=t.l*(1-i)+e.l*i,o=t.a*(1-i)+e.a*i;return se.fromOKLCH(a,s,n,o)},qf=class extends OD{constructor(){super(...arguments),this.type="color",this.defaultTickCount=0,this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(Bz)}update(){const{domain:e,range:i}=this;e.length<2&&(pt.warnOnce("`colorDomain` should have at least 2 values."),e.length===0?e.push(0,1):e.length===1&&e.push(e[0]+1));for(let n=1;na){pt.warnOnce("`colorDomain` values should be supplied in ascending order."),e.sort((o,r)=>o-r);break}}if(i.length0?i[0]:"black");this.parsedRange=this.range.map(Bz)}normalizeDomains(...e){return{domain:e.map(i=>i.domain).flat(),animatable:!0}}toDomain(){}convert(e){this.refresh();const{domain:i,range:n,parsedRange:s}=this,a=i[0],o=i.at(-1),r=n[0],l=n.at(-1);if(e<=a)return r;if(e>=o)return l;let c,u;if(i.length===2){const f=(e-a)/(o-a),y=1/(n.length-1);c=n.length<=2?0:Math.min(Math.floor(f*(n.length-1)),n.length-2),u=(f-c*y)/y}else{for(c=0;c{const{stop:n}=e,s=t.at(i+1)?.color;return s==null?[e]:[e,{stop:n,color:s}]})}function Q9(t,e){const i=e==="discrete"?1:0,n=t.map((s,a,{length:o})=>({stop:(a+i)/(o-1+i),color:s}));return e==="discrete"?pG(n):n}function gG(t,e,i,n="continuous"){const s=t.map(y=>typeof y=="string"?{color:y}:y);if(s.length===0)return Q9(e,n);if(!q9(s))return pt.warnOnce("[fills] must have the stops defined in ascending order"),[];const a=Math.min(...i),o=Math.max(...i),r=n==="discrete",l=new Float64Array(s.length);let c=0,u=-1;for(let y=0;y=u){u=s.length-1;for(let D=y+1;Dy.color!=null)?.color,g;const f=s.map((y,x)=>{let S=y?.color;const D=l[x];return S!=null?d=S:d==null?(g==null&&(g=new qf,g.domain=[0,1],g.range=e),S=g.convert(D)):S=d,{stop:D,color:S}});return n==="discrete"?pG(f):f}var J9=class{constructor(e,i){this.imageLoader=e,this._cache=void 0,this.url=i.url,this.backgroundFill=i.backgroundFill??"black",this.backgroundFillOpacity=i.backgroundFillOpacity??1,this.repeat=i.repeat??"no-repeat",this.width=i.width,this.height=i.height,this.fit=i.fit??"stretch",this.rotation=i.rotation??0}createCanvasImage(e,i,n,s){if(!i)return null;const[a,o]=this.getSize(i.width,i.height,n,s);return a<1||o<1?(pt.warnOnce("Image fill is too small to render, ignoring."),null):e.createPattern(i,this.repeat)}getSize(e,i,n,s){const{fit:a}=this;let o=e,r=i,l=1;const c=n/s,u=e/i;return a==="stretch"||e===0||i===0?(o=n,r=s):a==="contain"?l=u>c?n/e:s/i:a==="cover"&&(l=u>c?s/i:n/e),[Math.max(1,o*l),Math.max(1,r*l)]}setImageTransform(e,i){if(typeof e=="string")return;const{url:n,rotation:s,width:a,height:o}=this,r=this.imageLoader?.loadImage(n);if(!r)return;const l=Dl(s),c=Math.cos(l),u=Math.sin(l),[d,g]=this.getSize(r.width,r.height,a??i.width,o??i.height),f=d/r.width,y=g/r.height,x=i.x+i.width/2,S=i.y+i.height/2,D=c*d-u*g,A=u*d+c*g,I=D/2,w=A/2,N=f1();e?.setTransform(new N([c*f,u*y,-u*f,c*y,x-I,S-w]))}createPattern(e,i,n,s){const a=this.width??i,o=this.height??n,r=this._cache;if(r?.ctx===e&&r.width===a&&r.height===o)return r.pattern;const l=this.imageLoader?.loadImage(this.url,s),c=this.createCanvasImage(e,l,a,o);if(c!=null)return this._cache={ctx:e,pattern:c,width:a,height:o},c}toSvg(e,i){const{url:n,rotation:s,backgroundFill:a,backgroundFillOpacity:o}=this,{x:r,y:l,width:c,height:u}=e,d=$i("pattern");d.setAttribute("viewBox",`0 0 ${c} ${u}`),d.setAttribute("x",String(r)),d.setAttribute("y",String(l)),d.setAttribute("width",String(c)),d.setAttribute("height",String(u)),d.setAttribute("patternUnits","userSpaceOnUse");const g=$i("rect");g.setAttribute("x","0"),g.setAttribute("y","0"),g.setAttribute("width",String(c)),g.setAttribute("height",String(u)),g.setAttribute("fill",a),g.setAttribute("fill-opacity",String(o)),d.appendChild(g);const f=$i("image");return f.setAttribute("href",n),f.setAttribute("x","0"),f.setAttribute("y","0"),f.setAttribute("width",String(c)),f.setAttribute("height",String(u)),f.setAttribute("preserveAspectRatio","none"),f.setAttribute("transform",`scale(${1/i}) rotate(${s}, ${c/2}, ${u/2})`),d.appendChild(f),d}},tZ=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,di=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,eZ=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,_z=/^[01]/,iZ={z:[],h:[di],v:[di],m:[di,di],l:[di,di],t:[di,di],s:[di,di,di,di],q:[di,di,di,di],c:[di,di,di,di,di,di],a:[di,di,di,_z,_z,di,di]};function nZ(t){if(!t)return;const e=[];let i=0,n;for(;i=0&&i<=1?[i]:[]}function oZ(t,e,i,n=1e-6){if(Math.abs(t)=0&&o<=1&&a.push(o)}else if(s>0){const o=Math.sqrt(s),r=(-e-o)/(2*t),l=(-e+o)/(2*t);r>=0&&r<=1&&a.push(r),l>=0&&l<=1&&a.push(l)}return a}function rZ(t,e,i,n,s=1e-6){if(Math.abs(t)=0){const f=Math.sqrt(u),y=Math.sign(c+f)*Math.pow(Math.abs(c+f),d),x=Math.sign(c-f)*Math.pow(Math.abs(c-f),d),S=Math.abs(Math.sqrt(3)*(y-x)/2),D=-d*a+(y+x);if(D>=0&&D<=1&&g.push(D),Math.abs(S)=0&&A<=1&&g.push(A)}}else{const f=Math.acos(c/Math.sqrt(-l*l*l)),y=d*a,x=2*Math.sqrt(-l),S=x*Math.cos(d*f)-y,D=x*Math.cos(d*(f+2*Math.PI))-y,A=x*Math.cos(d*(f+4*Math.PI))-y;S>=0&&S<=1&&g.push(S),D>=0&&D<=1&&g.push(D),A>=0&&A<=1&&g.push(A)}return g}function bb(t,e,i,n,s,a,o,r){const l=(i-t)*(r-a)-(n-e)*(o-s);if(l===0)return 0;const c=((o-s)*(e-a)-(t-s)*(r-a))/l,u=((i-t)*(e-a)-(n-e)*(t-s))/l;return c>=0&&c<=1&&u>=0&&u<=1?1:0}function lZ(t,e,i,n,s,a,o,r,l,c,u,d){let g=0;const f=c-d,y=u-l,x=l*(d-c)-c*(u-l),S=Fz(t,i,s,o),D=Fz(e,n,a,r),A=f*S[0]+y*D[0],I=f*S[1]+y*D[1],w=f*S[2]+y*D[2],N=f*S[3]+y*D[3]+x,O=rZ(A,I,w,N);for(const L of O){const R=L*L,P=L*R,B=S[0]*P+S[1]*R+S[2]*L+S[3],F=D[0]*P+D[1]*R+D[2]*L+D[3];let H;l===u?H=(F-c)/(d-c):H=(B-l)/(u-l),H>=0&&H<=1&&g++}return g}function Fz(t,e,i,n){return[-t+3*e-3*i+n,3*t-6*e+3*i,-3*t+3*e,t]}var Cf=class{constructor(){this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.commandsLength=0,this.paramsLength=0,this.cx=Number.NaN,this.cy=Number.NaN,this.sx=Number.NaN,this.sy=Number.NaN,this.openedPath=!1,this.closedPath=!1;const e=Ob();this.path2d=new e}isEmpty(){return this.commandsLength===0}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commandsLength||this.previousParams.length!==this.paramsLength||this.previousCommands.toString()!==this.commands.slice(0,this.commandsLength).toString()||this.previousParams.toString()!==this.params.slice(0,this.paramsLength).toString()}getPath2D(){return this.path2d}moveTo(e,i){this.openedPath=!0,this.sx=e,this.sy=i,this.cx=e,this.cy=i,this.path2d.moveTo(e,i),this.commands[this.commandsLength++]=0,this.params[this.paramsLength++]=e,this.params[this.paramsLength++]=i}lineTo(e,i){this.openedPath?(this.cx=e,this.cy=i,this.path2d.lineTo(e,i),this.commands[this.commandsLength++]=1,this.params[this.paramsLength++]=e,this.params[this.paramsLength++]=i):this.moveTo(e,i)}cubicCurveTo(e,i,n,s,a,o){this.openedPath||this.moveTo(e,i),this.path2d.bezierCurveTo(e,i,n,s,a,o),this.commands[this.commandsLength++]=2,this.params[this.paramsLength++]=e,this.params[this.paramsLength++]=i,this.params[this.paramsLength++]=n,this.params[this.paramsLength++]=s,this.params[this.paramsLength++]=a,this.params[this.paramsLength++]=o}closePath(){this.openedPath&&(this.cx=this.sx,this.cy=this.sy,this.sx=Number.NaN,this.sy=Number.NaN,this.path2d.closePath(),this.commands[this.commandsLength++]=3,this.openedPath=!1,this.closedPath=!0)}rect(e,i,n,s){this.moveTo(e,i),this.lineTo(e+n,i),this.lineTo(e+n,i+s),this.lineTo(e,i+s),this.closePath()}roundRect(e,i,n,s,a){a=Math.min(a,n/2,s/2),this.moveTo(e,i+a),this.arc(e+a,i+a,a,Math.PI,1.5*Math.PI),this.lineTo(e+a,i),this.lineTo(e+n-a,i),this.arc(e+n-a,i+a,a,1.5*Math.PI,2*Math.PI),this.lineTo(e+n,i+a),this.lineTo(e+n,i+s-a),this.arc(e+n-a,i+s-a,a,0,Math.PI/2),this.lineTo(e+n-a,i+s),this.lineTo(e+a,i+s),this.arc(e+ +a,i+s-a,a,Math.PI/2,Math.PI),this.lineTo(e,i+s-a),this.closePath()}ellipse(e,i,n,s,a,o,r,l=!1){const c=n,u=s/n,d=Math.cos(a),g=Math.sin(a),f=-u*g,y=u*d,x=c*Math.cos(o),S=c*Math.sin(o),D=e+d*x+f*S,A=i+g*x+y*S,I=(D-this.cx)**2+(A-this.cy)**2;this.openedPath?I>1e-6&&this.lineTo(D,A):this.moveTo(D,A);let w=l?-ze(o-r):ze(r-o);Math.abs(Math.abs(r-o)-2*Math.PI)<1e-6&&w<2*Math.PI&&(w+=2*Math.PI*(l?-1:1));const N=Math.max(Math.ceil(Math.abs(w)/(Math.PI/2)),1),O=w/N,L=4/3*Math.tan(O/4);for(let R=0;R=1?(A=Math.sqrt(A),n*=A,s*=A):(A=Math.sqrt(1/A-1),o===r&&(A=-A),N=A*n*D,O=-A*s*S,I+=f*N-g*O,w+=g*N+f*O);const L=Math.atan2((x-O)/s,(y-N)/n),R=Math.atan2((-x-O)/s,(-y-N)/n)-L,P=L+R,B=!!(1-r);this.ellipse(I,w,n,s,a,L,P,B)}clear(e){e?(this.previousCommands=this.commands.slice(0,this.commandsLength),this.previousParams=this.params.slice(0,this.paramsLength),this.previousClosedPath=this.closedPath,this.commands=[],this.params=[],this.commandsLength=0,this.paramsLength=0):(this.commandsLength=0,this.paramsLength=0);const i=Ob();this.path2d=new i,this.openedPath=!1,this.closedPath=!1}isPointInPath(e,i){const n=this.commands,s=this.params,a=this.commandsLength,o=-1e4,r=-1e4;let l=Number.NaN,c=Number.NaN,u=0,d=0,g=0;for(let f=0,y=0;f({x:i,y:n})){const i=[],{commands:n,params:s}=this,a=(r,l)=>{i.push(r);for(let c=0;c{n=Math.min(y,n),s=Math.min(f,s),a=Math.max(f,a),o=Math.max(y,o),r=f,l=y};let g=0;for(let f=0;fs!==0)){const s=i.length%2===1?[...i,...i]:i;t.setAttribute("stroke-dasharray",s.join(" ")),n!=null&&t.setAttribute("stroke-dashoffset",String(n))}}var is=class extends Oc{constructor(){super(...arguments),this.drawingMode="overlay",this.fillOpacity=1,this.strokeOpacity=1,this.fill="black",this.strokeWidth=0,this.lineDashOffset=0,this.opacity=1}getGradient(e){if(an(e))return this.createGradient(e)}createGradient(e){const{colorSpace:i="rgb",gradient:n="linear",colorStops:s,rotation:a=0,reverse:o=!1}=e;if(s==null)return;let r=gG(s,["black"],[0,1]);switch(o&&(r=r.map(l=>({color:l.color,stop:1-l.stop})).reverse()),n){case"linear":return new X9(i,r,a);case"radial":return new Z9(i,r);case"conic":return new $9(i,r,a)}}getPattern(e){if(ir(e))return this.createPattern(e)}createPattern(e){return new hZ(e)}getImage(e){if(ml(e))return this.createImage(e)}createImage(e){return new J9(this.imageLoader,e)}onFillChange(){typeof this.fill=="object"&&ks(this._cachedFill??{},this.fill)||(this.fillGradient=this.getGradient(this.fill),this.fillPattern=this.getPattern(this.fill),this.fillImage=this.getImage(this.fill),this._cachedFill=this.fill)}onStrokeChange(){this.strokeGradient=this.getGradient(this.stroke)}align(e,i){return Fn(this.layerManager?.canvas?.pixelRatio??1,e,i)}markDirty(e){super.markDirty(e),this.cachedDefaultGradientFillBBox=void 0}fillStroke(e,i){this.__drawingMode==="cutout"&&(e.globalCompositeOperation="destination-out",this.executeFill(e,i),e.globalCompositeOperation="source-over"),this.renderFill(e,i),this.renderStroke(e,i)}renderFill(e,i){const{__fill:n,__fillOpacity:s=1,fillImage:a}=this;if(n!=null&&n!=="none"&&s>0){const o=e.globalAlpha;a&&(e.globalAlpha=a.backgroundFillOpacity,e.fillStyle=a.backgroundFill,this.executeFill(e,i),e.globalAlpha=o),this.applyFillAndAlpha(e),this.applyShadow(e),this.executeFill(e,i),e.globalAlpha=o,this.fillShadow?.enabled&&(e.shadowColor="rgba(0, 0, 0, 0)")}}executeFill(e,i){i?e.fill(i):e.fill()}applyFillAndAlpha(e){const{__fill:i,fillGradient:n,fillPattern:s,fillImage:a,__fillOpacity:o=1,__opacity:r=1}=this,l=r*o;if(l!==1&&(e.globalAlpha*=l),n){const{fillBBox:c=this.getDefaultGradientFillBBox()??this.getBBox(),fillParams:u}=this;e.fillStyle=n.createGradient(e,c,u)??"black"}else if(s){const{x:c,y:u}=this.getBBox(),d=this.layerManager?.canvas?.pixelRatio??1,g=s.createPattern(e,d);s.setPatternTransform(g,d,c,u),g?e.fillStyle=g:(e.fillStyle=s.fill,e.globalAlpha*=s.fillOpacity)}else if(a){const c=this.getBBox(),u=a.createPattern(e,c.width,c.height,this);a.setImageTransform(u,c),e.fillStyle=u??"transparent"}else e.fillStyle=typeof i=="string"?i:"black"}applyStrokeAndAlpha(e){const{__stroke:i,__strokeOpacity:n=1,strokeGradient:s,__opacity:a=1}=this;e.strokeStyle=s?.createGradient(e,this.getBBox())??(typeof i=="string"?i:void 0)??"black";const o=a*n;o!==1&&(e.globalAlpha*=o)}applyShadow(e){const i=this.layerManager?.canvas.pixelRatio??1,{__fillShadow:n}=this;n?.enabled&&(e.shadowColor=n.color,e.shadowOffsetX=n.xOffset*i,e.shadowOffsetY=n.yOffset*i,e.shadowBlur=n.blur*i)}renderStroke(e,i){const{__stroke:n,__strokeWidth:s=0,__strokeOpacity:a=1,__lineDash:o,__lineDashOffset:r,__lineCap:l,__lineJoin:c,__miterLimit:u}=this;if(n!=null&&n!=="none"&&s>0&&a>0){const{globalAlpha:d}=e;this.applyStrokeAndAlpha(e),e.lineWidth=s,o&&e.setLineDash(o),r&&(e.lineDashOffset=r),l&&(e.lineCap=l),c&&(e.lineJoin=c),u!=null&&(e.miterLimit=u),this.executeStroke(e,i),e.globalAlpha=d}}executeStroke(e,i){i?e.stroke(i):e.stroke()}getDefaultGradientFillBBox(){return this.cachedDefaultGradientFillBBox??(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(e,i){return this.isPointInPath(e,i)}applySvgFillAttributes(e,i){const{fill:n,fillOpacity:s}=this;if(typeof n=="string")e.setAttribute("fill",n);else if(an(n)&&this.fillGradient){i??(i=[]);const a=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),o=yb();a.setAttribute("id",o),i.push(a),e.setAttribute("fill",`url(#${o})`)}else if(ir(n)&&this.fillPattern){i??(i=[]);const a=this.fillPattern.toSvg(),o=yb();a.setAttribute("id",o),i.push(a),e.setAttribute("fill",`url(#${o})`)}else if(ml(n)&&this.fillImage){i??(i=[]);const a=this.layerManager?.canvas?.pixelRatio??1,o=this.fillImage.toSvg(this.getBBox(),a),r=yb();o.setAttribute("id",r),i.push(o),e.setAttribute("fill",`url(#${r})`)}else e.setAttribute("fill","none");return e.setAttribute("fill-opacity",String(s)),i}applySvgStrokeAttributes(e){const{stroke:i,strokeOpacity:n,strokeWidth:s,lineDash:a,lineDashOffset:o}=this;uZ(e,{stroke:zi(i)?i:void 0,strokeOpacity:n,strokeWidth:s}),dZ(e,{lineDash:a,lineDashOffset:o})}static handleFillChange(e){e.onFillChange()}static handleStrokeChange(e){e.onStrokeChange()}setStyleProperties(e,i,n){const s=e?.opacity??1,a=e?.fill,o=(e?.fillOpacity??1)*s,r=(e?.strokeOpacity??1)*s,l=e?.strokeWidth??0,c=e?.lineDashOffset??0;let u=!1;this.__fillOpacity!==o&&(this.__fillOpacity=o,u=!0),this.__strokeOpacity!==r&&(this.__strokeOpacity=r,u=!0),this.__strokeWidth!==l&&(this.__strokeWidth=l,u=!0),this.__lineDashOffset!==c&&(this.__lineDashOffset=c,u=!0),this.__lineDash!==e?.lineDash&&(this.__lineDash=e?.lineDash,u=!0),this.setFillProperties(a,i,n),a!==this.fill&&(this.fill=a),e?.stroke!==this.stroke&&(this.stroke=e?.stroke),u&&this.markDirty()}setFillProperties(e,i,n){const s=i==null||!an(e)||e.bounds==null||e.bounds==="item"?void 0:i[e.bounds];let a=!1;this.__fillBBox!==s&&(this.__fillBBox=s,a=!0),this.__fillParams!==n&&(this.__fillParams=n,a=!0),a&&(this.onFillChange(),this.markDirty())}};T([fe()],is.prototype,"drawingMode",2);T([fe()],is.prototype,"fillOpacity",2);T([fe()],is.prototype,"strokeOpacity",2);T([_x({changeCb:is.handleFillChange})],is.prototype,"fill",2);T([Bu({changeCb:is.handleStrokeChange})],is.prototype,"stroke",2);T([fe()],is.prototype,"strokeWidth",2);T([Vx()],is.prototype,"lineDash",2);T([fe()],is.prototype,"lineDashOffset",2);T([fe()],is.prototype,"lineCap",2);T([fe()],is.prototype,"lineJoin",2);T([fe()],is.prototype,"miterLimit",2);T([fe({convertor:t=>Nt(0,t??1,1)})],is.prototype,"opacity",2);T([Bu({checkDirtyOnAssignment:!0})],is.prototype,"fillShadow",2);T([_x({changeCb:t=>t.onFillChange()})],is.prototype,"fillBBox",2);T([_x({changeCb:t=>t.onFillChange()})],is.prototype,"fillParams",2);var Ip=is,fG=[1,0,0,1,0,0],up=class VS{get e(){return[...this.elements]}constructor(e=fG){this.elements=[...e]}setElements(e){const i=this.elements;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],this}get identity(){const e=this.elements;return be(e[0],1)&&be(e[1],0)&&be(e[2],0)&&be(e[3],1)&&be(e[4],0)&&be(e[5],0)}AxB(e,i,n){const s=e[0]*i[0]+e[2]*i[1],a=e[1]*i[0]+e[3]*i[1],o=e[0]*i[2]+e[2]*i[3],r=e[1]*i[2]+e[3]*i[3],l=e[0]*i[4]+e[2]*i[5]+e[4],c=e[1]*i[4]+e[3]*i[5]+e[5];n=n??e,n[0]=s,n[1]=a,n[2]=o,n[3]=r,n[4]=l,n[5]=c}multiplySelf(e){return this.AxB(this.elements,e.elements),this}multiply(e){const i=[Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN];return e instanceof VS?this.AxB(this.elements,e.elements,i):this.AxB(this.elements,[e.a,e.b,e.c,e.d,e.e,e.f],i),new VS(i)}preMultiplySelf(e){return this.AxB(e.elements,this.elements,this.elements),this}inverse(){const e=this.elements;let i=e[0],n=e[1],s=e[2],a=e[3];const o=e[4],r=e[5],l=1/(i*a-n*s);return i*=l,n*=l,s*=l,a*=l,new VS([a,-n,-s,i,s*r-a*o,n*o-i*r])}invertSelf(){const e=this.elements;let i=e[0],n=e[1],s=e[2],a=e[3];const o=e[4],r=e[5],l=1/(i*a-n*s);return i*=l,n*=l,s*=l,a*=l,e[0]=a,e[1]=-n,e[2]=-s,e[3]=i,e[4]=s*r-a*o,e[5]=n*o-i*r,this}transformPoint(e,i){const n=this.elements;return{x:e*n[0]+i*n[2]+n[4],y:e*n[1]+i*n[3]+n[5]}}transformBBox(e,i){const n=this.elements,s=n[0],a=n[1],o=n[2],r=n[3],l=e.width*.5,c=e.height*.5,u=e.x+l,d=e.y+c,g=Math.abs(l*s)+Math.abs(c*o),f=Math.abs(l*a)+Math.abs(c*r);return i??(i=new Tt(0,0,0,0)),i.x=u*s+d*o+n[4]-g,i.y=u*a+d*r+n[5]-f,i.width=g+g,i.height=f+f,i}toContext(e){if(this.identity)return;const i=this.elements;e.transform(i[0],i[1],i[2],i[3],i[4],i[5])}static updateTransformMatrix(e,i,n,s,a,o,r){const l=i,c=n;let u,d;l===1&&c===1?(u=0,d=0):(u=r?.scalingCenterX??0,d=r?.scalingCenterY??0);const g=s,f=Math.cos(g),y=Math.sin(g);let x,S;g===0?(x=0,S=0):(x=r?.rotationCenterX??0,S=r?.rotationCenterY??0);const D=a,A=o,I=u*(1-l)-x,w=d*(1-c)-S;return e.setElements([f*l,y*l,-y*c,f*c,f*I-y*w+x+D,y*I+f*w+S+A]),e}};function Th(t){return yG(t.constructor)}var mG=Symbol("isMatrixTransform");function yG(t){return t[mG]===!0}function OT(t){var e,i;const n=t;if(yG(t))return t;const s=Symbol("matrix_combined_transform");class a extends n{constructor(){super(...arguments),this[i]=new up,this._dirtyTransform=!0}onChangeDetection(r){super.onChangeDetection(r),this._dirtyTransform=!0,!(this.batchLevel>0)&&this.markDirty("transform")}updateMatrix(r){}computeTransformMatrix(){this._dirtyTransform&&(this[s].setElements(fG),this.updateMatrix(this[s]),this._dirtyTransform=!1)}toParent(r){return this.computeTransformMatrix(),this[s].identity?r.clone():this[s].transformBBox(r)}toParentPoint(r,l){return this.computeTransformMatrix(),this[s].identity?{x:r,y:l}:this[s].transformPoint(r,l)}fromParent(r){return this.computeTransformMatrix(),this[s].identity?r.clone():this[s].inverse().transformBBox(r)}fromParentPoint(r,l){return this.computeTransformMatrix(),this[s].identity?{x:r,y:l}:this[s].inverse().transformPoint(r,l)}computeBBox(){const r=super.computeBBox();return r&&this.toParent(r)}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(r,l){return{x:r,y:l}=this.fromParentPoint(r,l),super.pickNode(r,l)}pickNodes(r,l,c){return{x:r,y:l}=this.fromParentPoint(r,l),super.pickNodes(r,l,c)}render(r){this.computeTransformMatrix();const{ctx:l}=r,c=this[s];let u=!1;try{c.identity||(l.save(),u=!0,c.toContext(l)),super.render(r)}finally{u&&l.restore()}}toSVG(){this.computeTransformMatrix();const r=super.toSVG(),l=this[s];if(l.identity||r==null)return r;const c=$i("g");c.append(...r.elements);const[u,d,g,f,y,x]=l.e;return c.setAttribute("transform",`matrix(${u} ${d} ${g} ${f} ${y} ${x})`),{elements:[c],defs:r.defs}}}return e=mG,i=s,a[e]=!0,a}function Qf(t){var e;const i=t,n=Symbol("matrix_rotation");class s extends OT(i){constructor(){super(...arguments),this[e]=new up,this.rotationCenterX=0,this.rotationCenterY=0,this.rotation=0}updateMatrix(o){super.updateMatrix(o);const{rotation:r,rotationCenterX:l,rotationCenterY:c}=this;r!==0&&(up.updateTransformMatrix(this[n],1,1,r,0,0,{rotationCenterX:l,rotationCenterY:c}),o.multiplySelf(this[n]))}}return e=n,T([ut()],s.prototype,"rotationCenterX",2),T([ut()],s.prototype,"rotationCenterY",2),T([ut()],s.prototype,"rotation",2),s}function pZ(t){return"scalingX"in t&&"scalingY"in t&&"scalingCenterX"in t&&"scalingCenterY"in t}function PD(t){var e;const i=t,n=Symbol("matrix_scale");class s extends OT(i){constructor(){super(...arguments),this[e]=new up,this.scalingX=1,this.scalingY=1,this.scalingCenterX=0,this.scalingCenterY=0}updateMatrix(o){super.updateMatrix(o);const{scalingX:r,scalingY:l,scalingCenterX:c,scalingCenterY:u}=this;r===1&&l===1||(up.updateTransformMatrix(this[n],r,l,0,0,0,{scalingCenterX:c,scalingCenterY:u}),o.multiplySelf(this[n]))}resetScalingProperties(o,r,l,c){this.__scalingX=o,this.__scalingY=r,this.__scalingCenterX=l,this.__scalingCenterY=c,this.onChangeDetection("scaling")}}return e=n,T([ut()],s.prototype,"scalingX",2),T([ut()],s.prototype,"scalingY",2),T([ut()],s.prototype,"scalingCenterX",2),T([ut()],s.prototype,"scalingCenterY",2),s}function Jf(t){var e;const i=t,n=Symbol("matrix_translation");class s extends OT(i){constructor(){super(...arguments),this[e]=new up,this.translationX=0,this.translationY=0}updateMatrix(o){super.updateMatrix(o);const{translationX:r,translationY:l}=this;r===0&&l===0||(up.updateTransformMatrix(this[n],1,1,0,r,l),o.multiplySelf(this[n]))}}return e=n,T([ut()],s.prototype,"translationX",2),T([ut()],s.prototype,"translationY",2),s}var Ti=class{static fromCanvas(e,i){const n=[];for(const s of e.traverseUp())Th(s)&&n.unshift(s);for(const s of n)i=s.fromParent(i);return Th(e)&&(i=e.fromParent(i)),i}static toCanvas(e,i){i==null?i=e.getBBox():Th(e)&&(i=e.toParent(i));for(const n of e.traverseUp())Th(n)&&(i=n.toParent(i));return i}static fromCanvasPoint(e,i,n){const s=[];for(const a of e.traverseUp())Th(a)&&s.unshift(a);for(const a of s)({x:i,y:n}=a.fromParentPoint(i,n));return Th(e)&&({x:i,y:n}=e.fromParentPoint(i,n)),{x:i,y:n}}static toCanvasPoint(e,i,n){Th(e)&&({x:i,y:n}=e.toParentPoint(i,n));for(const s of e.traverseUp())Th(s)&&({x:i,y:n}=s.toParentPoint(i,n));return{x:i,y:n}}},B0,ET=class Zy extends Oc{constructor(e){super(e),this.childNodes=new Set,this.dirty=!1,this.dirtyZIndex=!1,this.clipRect=void 0,this.opacity=1,this._childFontDirty=!0,this.layer=void 0,this.image=void 0,this._lastWidth=Number.NaN,this._lastHeight=Number.NaN,this._lastDevicePixelRatio=Number.NaN,this.isContainerNode=!0,this.renderToOffscreenCanvas=e?.renderToOffscreenCanvas===!0,this.optimizeForInfrequentRedraws=e?.optimizeForInfrequentRedraws===!0}static is(e){return e instanceof Zy}static computeChildrenBBox(e,i=!0){return Tt.merge(Oc.extractBBoxes(e,i))}static compareChildren(e,i){return cG(e.__zIndex,i.__zIndex)||e.serialNumber-i.serialNumber}containsPoint(e,i){return!0}computeBBox(){return Zy.computeChildrenBBox(this.children())}computeSafeClippingBBox(e){const i=this.computeBBox();if(i?.isFinite()!==!0)return;let n=0;const s=4;for(const g of this.descendants())g instanceof Ip&&(n=Math.max(n,g.strokeWidth));const a=Math.max(1,n/2*s),{x:o,y:r}=Ti.toCanvasPoint(this,0,0),l=Gz(e,o+i.x-a)-o,c=Gz(e,r+i.y-a)-r,u=Math.ceil(i.x+i.width-l+a),d=Math.ceil(i.y+i.height-c+a);return new Tt(l,c,u,d)}prepareSharedCanvas(e,i,n){return B0?.pixelRatio===n?B0.resize(e,i,n):B0=new NT({width:e,height:i,pixelRatio:n}),B0}setScene(e){const i=this.scene;super.setScene(e),this.layer&&i&&i!==e&&(i.layersManager.removeLayer(this.layer),this.layer=void 0);for(const n of this.children())n.setScene(e)}resolveFont(){if(!this.renderToOffscreenCanvas)return this.resolveChildFont()}resolveChildFont(){if(this._childFontDirty){this._cachedChildFont=void 0;for(const e of this.children()){const i=e.resolveFont();if(i!=null){this._cachedChildFont=i;break}}this._childFontDirty=!1}return this._cachedChildFont}markDirty(e){this.dirty=!0,this._childFontDirty=!0,super.markDirty(e)}markDirtyChildrenOrder(){super.markDirtyChildrenOrder(),this.dirtyZIndex=!0,this.markDirty()}append(e){for(const i of H4(e))i.remove(),this.childNodes.add(i),i.parentNode=this,i.setScene(this.scene);this.markDirtyChildrenOrder(),this.markDirty()}appendChild(e){return this.append(e),e}removeChild(e){if(!this.childNodes?.delete(e))throw new Error(`AG Charts - internal error, unknown child node ${e.name??e.id} in $${this.name??this.id}`);e.parentNode=void 0,e.setScene(),this.markDirtyChildrenOrder(),this.markDirty()}clear(){for(const e of this.children())delete e.parentNode,e.setScene();this.childNodes?.clear(),this.markDirty()}pickNode(e,i){if(!(!this.visible||this.pointerEvents===1||!this.containsPoint(e,i))){if(this.childNodes!=null&&this.childNodes.size!==0){const n=[...this.children()];for(let s=n.length-1;s>=0;s--){const o=n[s].pickNode(e,i);if(o!=null)return o}}else if(!this.isContainerNode)return this}}pickNodes(e,i,n=[]){if(!this.visible||this.pointerEvents===1||!this.containsPoint(e,i))return n;this.isContainerNode||n.push(this);for(const s of this.children())s.pickNodes(e,i,n);return n}isDirty(e){const{width:i,height:n,devicePixelRatio:s}=e,{dirty:a,layer:o}=this,r=o!=null&&(this._lastWidth!==i||this._lastHeight!==n),l=this._lastDevicePixelRatio!==s;return this._lastWidth=i,this._lastHeight=n,this._lastDevicePixelRatio=s,a||r||l}preRender(e){let i;if(this.dirty){i=super.preRender(e,0);for(const n of this.children()){const s=n.preRender(e);i.groups+=s.groups,i.nonGroups+=s.nonGroups,i.complexity+=s.complexity}i.groups+=1,i.nonGroups-=1}else i=this.childNodeCounts;return this.renderToOffscreenCanvas&&!this.optimizeForInfrequentRedraws&&i.nonGroups>0&&this.getVisibility()?this.layer??(this.layer=this.layerManager?.addLayer({name:this.name})):this.layer!=null&&(this.layerManager?.removeLayer(this.layer),this.layer=void 0),i}render(e){const{layer:i,renderToOffscreenCanvas:n}=this,s={...e},a=this.isDirty(e);if(this.dirty=!1,!n){this.renderInContext(s),super.render(s);return}const{ctx:o,stats:r,devicePixelRatio:l}=e;let{image:c}=this;if(a){c?.bitmap.close(),c=void 0;const d=i?void 0:this.computeSafeClippingBBox(l),g=(f,...y)=>{const x=f.context;x.direction=s.direction,s.ctx=x,f.clear(),x.save();try{x.setTransform(...y),x.globalAlpha=1,this.renderInContext(s)}finally{x.restore(),x.verifyDepthZero?.()}};if(i)g(i,o.getTransform());else if(d){const{x:f,y,width:x,height:S}=d,D=Math.floor(x*l),A=Math.floor(S*l);if(D>0&&A>0){const I=this.prepareSharedCanvas(x,S,l);g(I,l,0,0,l,-f*l,-y*l),c={bitmap:I.transferToImageBitmap(),x:f,y,width:x,height:S}}}this.image=c,r&&r.layersRendered++}else r&&r.layersSkipped++;const{globalAlpha:u}=o;if(o.globalAlpha=u*this.opacity,i){o.save();try{o.resetTransform(),i.drawImage(o)}finally{o.restore()}}else if(c){const{bitmap:d,x:g,y:f,width:y,height:x}=c;o.drawImage(d,0,0,y*l,x*l,g,f,y,x)}o.globalAlpha=u,super.render(s)}applyClip(e,i){const{x:n,y:s,width:a,height:o}=i;e.beginPath(),e.rect(n,s,a,o),e.clip()}renderInContext(e){const{ctx:i,stats:n}=e;this.dirtyZIndex&&(this.sortChildren(Zy.compareChildren),this.dirtyZIndex=!1),i.save();try{i.globalAlpha*=this.opacity;const s=this.resolveChildFont();s!=null&&i.font!==s&&(i.font=s),this.clipRect!=null&&(this.applyClip(i,this.clipRect),e.clipBBox=Ti.toCanvas(this,this.clipRect));for(const a of this.children()){if(!a.visible){n&&(n.nodesSkipped+=a.childNodeCounts.nonGroups+a.childNodeCounts.groups,n.opsSkipped+=a.childNodeCounts.complexity);continue}a.isolatedRender(e)}}finally{i.restore()}}sortChildren(e){if(!this.childNodes)return;const i=[...this.childNodes].sort(e);this.childNodes.clear();for(const n of i)this.childNodes.add(n)}*children(){yield*this.childNodes}*excludeChildren(e){for(const i of this.children())(e.instance&&!(i instanceof e.instance)||e.name&&i.name!==e.name)&&(yield i)}*descendants(){for(const e of this.children())yield e,e instanceof Zy&&(yield*e.descendants())}setClipRect(e){this.clipRect=e?Ti.fromCanvas(this,e):void 0}setClipRectCanvasSpace(e){this.clipRect=e}getVisibility(){for(const e of this.traverseUp(!0))if(!e.visible)return!1;return!0}toSVG(){if(!this.visible)return;const e=[],i=[];for(const n of this.children()){const s=n.toSVG();s!=null&&(i.push(...s.elements),s.defs!=null&&e.push(...s.defs))}return{elements:i,defs:e}}};ET.className="Group";T([ut({convertor:t=>Nt(0,t,1)})],ET.prototype,"opacity",2);var ee=ET,gZ=class extends PD(ee){};(class extends Qf(ee){});var Ds=class extends Jf(ee){},jg=class extends Qf(Jf(ee)){},fZ=class{constructor(){this.stats=new Map,this.lastLogTime=Date.now(),this.LOG_INTERVAL_MS=1e4,this.startPeriodicLogging()}startPeriodicLogging(){Gt.check("scene:stats","scene:stats:verbose")&&(this.stopPeriodicLogging(),this.intervalId=setInterval(()=>{this.logAccumulatedStats()},this.LOG_INTERVAL_MS))}stopPeriodicLogging(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0)}recordTiming(t,e){const i=this.stats.get(t);i?(i.min=Math.min(i.min,e),i.max=Math.max(i.max,e),i.sum+=e,i.count+=1):this.stats.set(t,{min:e,max:e,sum:e,count:1})}recordTimings(t){for(const[e,i]of Object.entries(t))e!=="start"&&typeof i=="number"&&this.recordTiming(e,i)}logAccumulatedStats(){if(this.stats.size===0)return;const t=(Date.now()-this.lastLogTime)/1e3,e=Array.from(this.stats.keys()).sort((a,o)=>a==="⏱️"?-1:o==="⏱️"?1:a.localeCompare(o)),i=[];for(const a of e){const o=this.stats.get(a),r=o.sum/o.count;i.push(`${a}[${o.min.toFixed(1)}/${r.toFixed(1)}/${o.max.toFixed(1)}]ms`)}const s=this.stats.get("⏱️")?.count??0;pt.log(`📊 Stats (${t.toFixed(0)}s, ${s} renders): ${i.join(" ")}`),this.stats.clear(),this.lastLogTime=Date.now()}destroy(){this.stopPeriodicLogging(),this.stats.clear()}},lf,Ud=0;function mZ(){return lf??(lf=new fZ),lf}function yZ(){Ud++;let t=!1;return()=>{t||Ud===0||(t=!0,Ud--,Ud===0&&xG())}}function bZ(t){for(const e of["B","KB","MB","GB"]){if(t<1536)return`${t.toFixed(1)}${e}`;t/=1024}return`${t.toFixed(1)}TB}`}function xZ(){if(!("memory"in performance))return;const{totalJSHeapSize:t,usedJSHeapSize:e,jsHeapSizeLimit:i}=performance.memory,n=[];for(const s of[e,t,i])typeof s=="number"&&n.push(bZ(s));return`Heap ${n.join(" / ")}`}function Kz(t,e,i,n,s={},a=Tt.zero,o){if(!Gt.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:r=0,layersSkipped:l=0,nodesRendered:c=0,nodesSkipped:u=0,opsPerformed:d=0,opsSkipped:g=0}=n??{},f=performance.now(),{start:y,...x}=e,S=f-y,D=mZ();D.recordTimings(x),D.recordTiming("⏱️",S);const A=Object.entries(x).map(([W,q])=>Yz(W,q)).filter(W=>W!=null).join(" + "),I=Object.entries(s).map(([W,q])=>`${W}: ${JSON.stringify(q)}`).join(" ; "),w=Gt.check("scene:stats:verbose"),N=w?xZ():null,O=w?Vr.flush():{},L=Object.entries(O),R=[],P=[];for(const[W,q]of L)W.endsWith(":aggregation")&&Array.isArray(q)?R.push(`${W.replace(":aggregation","")}(${q.join(",")})`):W.endsWith(":nodeData")&&typeof q=="number"&&P.push(`${W.replace(":nodeData","")}(${q})`);const B=R.length>0?`Aggregation: ${R.join(", ")}`:null,F=P.length>0?`NodeData: ${P.join(", ")}`:null,H=[`${Yz("⏱️",y,f)} (${A})`,`${I}`,B,F,`Layers: ${w?AC(r,l):t.size}`,w?`Nodes: ${AC(c,u)}`:null,w?`Ops: ${AC(d,g)}`:null,N].filter(zi),$=new pT(i),Y=new Map(H.map(W=>[W,$.measureText(W)])),U=Math.max(...Array.from(Y.values(),W=>W.width)),V=IZ(Y.values(),W=>W.height),Z=2+a.x;i.save();try{i.fillStyle=o?.background??"white",i.fillRect(Z,0,U,V),i.fillStyle=o?.foreground??"black";let W=0;for(const[q,nt]of Y.entries())W+=nt.height,i.fillText(q,Z,W)}catch(W){pt.warnOnce("Error during debug stats rendering",W)}finally{i.restore()}}function vZ(t){const e=dx(Ml("agChartsSceneDebug")),i=[];for(const n of e)n==="layout"?i.push("seriesRoot","legend","root",/Axis-\d+-axis/):i.push(n);t.debugNodeSearch=i}function SZ(t,e){t.save();try{for(const[i,n]of Object.entries(e)){const s=Ti.toCanvas(n);if(!s){pt.log(`Scene.render() - no bbox for debugged node [${i}].`);continue}t.globalAlpha=.8,t.strokeStyle="red",t.lineWidth=1,t.strokeRect(s.x,s.y,s.width,s.height),t.fillStyle="red",t.strokeStyle="white",t.font="16px sans-serif",t.textBaseline="top",t.textAlign="left",t.lineWidth=2,t.strokeText(i,s.x,s.y,s.width),t.fillText(i,s.x,s.y,s.width)}}catch(i){pt.warnOnce("Error during debug rendering",i)}finally{t.restore()}}var MZ=new Set,DZ=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function AZ(t){const{...e}=t;for(const i of Object.keys(e))DZ.has(i)||typeof e[i]!="number"&&typeof e[i]!="string"&&typeof e[i]!="boolean"&&(MZ.add(i),delete e[i]);return e}function _S(t,e){if(!Gt.check(!0,"scene"))return{};let i=0;return{node:e==="json"?AZ(t):t,name:t.name??t.id,dirty:t instanceof ee?t.dirty:void 0,...Array.from(t instanceof ee?t.children():[],n=>_S(n,e)).reduce((n,s)=>{let{name:a}=s;const{node:{visible:o,opacity:r,zIndex:l,translationX:c,translationY:u,rotation:d,scalingX:g,scalingY:f},node:y}=s;(!o||r<=0)&&(a=`(${a})`),ee.is(y)&&y.renderToOffscreenCanvas&&(a=`*${a}*`);const x=Array.isArray(l)?`(${l.join(", ")})`:l,S=[`${(i++).toString().padStart(3,"0")}|`,`${a??""}`,`z: ${x}`,c&&`x: ${c}`,u&&`y: ${u}`,d&&`r: ${d}`,g!=null&&g!==1&&`sx: ${g}`,f!=null&&f!==1&&`sy: ${f}`].filter(I=>!!I).join(" ");let D=S,A=1;for(;n[D]!=null&&A<100;)D=`${S} (${A++})`;return n[D]=s,n},{})}}function bG(t){const e=t instanceof ee?t.dirty:void 0;if(!e)return{dirtyTree:{},paths:[]};const i=Array.from(t instanceof ee?t.children():[],a=>bG(a)).filter(a=>a.paths.length>0),n=ee.is(t)?t.name??t.id:t.id,s=i.length?i.flatMap(a=>a.paths).map(a=>`${n}.${a}`):[n];return{dirtyTree:{name:n,node:t,dirty:e,...i.map(a=>a.dirtyTree).filter(a=>a.dirty!=null).reduce((a,o)=>(a[o.name??""]=o,a),{})},paths:s}}function AC(t,e){const i=t+e;return`${t} / ${i} (${Math.round(100*t/i)}%)`}function Yz(t,e,i){const n=i==null?e:i-e;return`${t}: ${Math.round(n*100)/100}ms`}function IZ(t,e){let i=0;for(const n of t)i+=e(n);return i}function xG(t=!1){if(!lf){t&&(Ud=0);return}!t&&Ud>0||(lf.destroy(),lf=void 0,t&&(Ud=0))}var kZ=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(t){return new Promise((e,i)=>{this.acquireQueue.push([t,e,i]),this.available&&this.dispatchNext().catch(i)})}async acquireImmediately(t){return this.available?(await this.acquire(t),!0):!1}async waitForClearAcquireQueue(){return this.acquire(()=>Promise.resolve(void 0))}async dispatchNext(){this.available=!1;let[t,e,i]=this.acquireQueue.shift()??[];for(;t;){try{await t(),e?.()}catch(n){i?.(n)}[t,e,i]=this.acquireQueue.shift()??[]}this.available=!0}},vG=class{constructor(){this.eventListeners=new Map}addEventListener(t,e){if(typeof e!="function")throw new TypeError("AG Charts - listener must be a Function");const i=this.eventListeners.get(t);i?i.add(e):this.eventListeners.set(t,new Set([e]))}removeEventListener(t,e){const i=this.eventListeners.get(t);i!=null&&(i.delete(e),i.size===0&&this.eventListeners.delete(t))}hasEventListener(t){return this.eventListeners.has(t)}clearEventListeners(){this.eventListeners.clear()}fireEvent(t){const e=this.eventListeners.get(t.type);if(e)for(const i of e)i(t)}};function CZ(t,e){function i(s,a){return t.requestAnimationFrame(s)}function n(s){t.cancelAnimationFrame(s)}return SG(i,e,n)}function RT(t){function e(n,s=0){if(s===0){queueMicrotask(n);return}return setTimeout(n,s)}function i(n){clearTimeout(n)}return SG(e,t,i)}function SG(t,e,i){let n=0,s=!1,a,o,r;function l(){return s}function c(){s=!1,r=void 0,o?.(),o=void 0,a=void 0,n>0&&(r=t(u))}function u(){const x=n;n=0,s=!0;const S=e({count:x});if(!S){c();return}S.then(c,c)}function d(x){n===0&&!l()&&(r=t(u,x)),n++}function g(){r!=null&&i&&(i(r),r=void 0,n=0)}async function f(){if(l())for(a??(a=new Promise(y));l();)await a}function y(x){o=x}return{schedule:d,cancel:g,waitForCompletion:f}}var qy=(t,{x0:e,y0:i,x1:n,y1:s,cx:a,cy:o},r,l)=>{if(l&&t.moveTo(e,i),e!==n||i!==s){const c=Math.atan2(i-o,e-a),u=Math.atan2(s-o,n-a);t.arc(a,o,r,c,u)}else t.lineTo(e,i)},Tn=class extends Ip{constructor(){super(...arguments),this.path=new Cf,this._clipX=Number.NaN,this._clipY=Number.NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=Number.NaN}set clipX(e){this._clipX=e,this.dirtyPath=!0}set clipY(e){this._clipY=e,this.dirtyPath=!0}set dirtyPath(e){this._dirtyPath!==e&&(this._dirtyPath=e,e&&this.markDirty("path"))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){this._dirtyPath||(this.dirtyPath=this.path.isDirty()||(this.fillShadow?.isDirty()??!1)||(this._clipPath?.isDirty()??!1))}resetPathDirty(){this.path.clear(!0),this._dirtyPath=!1}isPathDirty(){return this.path.isDirty()}onChangeDetection(e){this._dirtyPath||(this._dirtyPath=!0,super.onChangeDetection(e))}computeBBox(){return this.updatePathIfDirty(),this.path.computeBBox()}isPointInPath(e,i){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,i)}distanceSquared(e,i){return this.distanceSquaredTransformedPoint(e,i)}svgPathData(e){return this.updatePathIfDirty(),this.path.toSVG(e)}distanceSquaredTransformedPoint(e,i){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,i)?0:this.path.distanceSquared(e,i)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(e){return e.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=e.devicePixelRatio,this.updatePathIfDirty(),super.preRender(e,this.path.commands.length)}render(e){const{ctx:i}=e;if(this.clip&&!Number.isNaN(this._clipX)&&!Number.isNaN(this._clipY)){i.save();try{const n=this.strokeWidth/2;this._clipPath??(this._clipPath=new Cf),this._clipPath.clear(),this._clipPath.rect(-n,-n,this._clipX+n,this._clipY+n+n),i.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(i)}finally{i.restore()}}else this._clipPath=void 0,this.drawPath(i);this.fillShadow?.markClean(),super.render(e)}drawPath(e){this.fillStroke(e,this.path.getPath2D())}toSVG(){if(!this.visible)return;const e=$i("path");e.setAttribute("d",this.svgPathData());const i=this.applySvgFillAttributes(e,[]);return this.applySvgStrokeAttributes(e),{elements:[e],defs:i}}};Tn.className="Path";T([ut()],Tn.prototype,"clip",2);T([ut()],Tn.prototype,"clipX",1);T([ut()],Tn.prototype,"clipY",1);function V0(t,e,i,n,s){let a=!1,o=!1,r=n-Math.sqrt(Math.max(s**2-i**2,0)),l=0,c=0,u=i-Math.sqrt(Math.max(s**2-n**2,0));return r>t?(a=!0,r=t,l=i-Math.sqrt(Math.max(s**2-(n-t)**2))):be(r,0)&&(r=0),u>e?(o=!0,c=n-Math.sqrt(Math.max(s**2-(i-e)**2)),u=e):be(u,0)&&(u=0),{leading0:r,leading1:l,trailing0:c,trailing1:u,leadingClipped:a,trailingClipped:o}}function FS(t,e,i,n,s,a,o){let{topLeft:r,topRight:l,bottomRight:c,bottomLeft:u}=a;const d=Math.max(r+u,l+c),g=Math.max(r+l,u+c);if(d<=0&&g<=0){if(o==null)t.rect(e,i,n,s);else{const L=Math.max(e,o.x),R=Math.min(e+n,o.x+o.width),P=Math.max(i,o.y),B=Math.min(i+s,o.y+o.height);t.rect(L,P,R-L,B-P)}return}else if(o==null&&r===l&&r===c&&r===u){t.roundRect(e,i,n,s,r);return}if(n<0&&(e+=n,n=Math.abs(n)),s<0&&(i+=s,s=Math.abs(s)),n<=0||s<=0)return;if(o==null)o=new Tt(e,i,n,s);else{const L=Math.max(e,o.x),R=Math.min(e+n,o.x+o.width),P=Math.max(i,o.y),B=Math.min(i+s,o.y+o.height);o=new Tt(L,P,R-L,B-P)}const f=Math.max(d/s,g/n,1);f>1&&(r/=f,l/=f,c/=f,u/=f);let y=!0,x=!0,S=!0,D=!0,A,I,w,N;if(y){const L=V0(o.height,o.width,Math.max(e+r-o.x,0),Math.max(i+r-o.y,0),r);L.leadingClipped&&(D=!1),L.trailingClipped&&(x=!1);const R=Math.max(o.x+L.leading1,o.x),P=Math.max(o.y+L.leading0,o.y),B=Math.max(o.x+L.trailing1,o.x),F=Math.max(o.y+L.trailing0,o.y),H=e+r,$=i+r;A={x0:R,y0:P,x1:B,y1:F,cx:H,cy:$}}if(x){const L=V0(o.width,o.height,Math.max(i+l-o.y,0),Math.max(o.x+o.width-(e+n-l),0),l);L.leadingClipped&&(y=!1),L.trailingClipped&&(S=!1);const R=Math.min(o.x+o.width-L.leading0,o.x+o.width),P=Math.max(o.y+L.leading1,o.y),B=Math.min(o.x+o.width-L.trailing0,o.x+o.width),F=Math.max(o.y+L.trailing1,o.y),H=e+n-l,$=i+l;I={x0:R,y0:P,x1:B,y1:F,cx:H,cy:$}}if(S){const L=V0(o.height,o.width,Math.max(o.x+o.width-(e+n-c),0),Math.max(o.y+o.height-(i+s-c),0),c);L.leadingClipped&&(x=!1),L.trailingClipped&&(D=!1);const R=Math.min(o.x+o.width-L.leading1,o.x+o.width),P=Math.min(o.y+o.height-L.leading0,o.y+o.height),B=Math.min(o.x+o.width-L.trailing1,o.x+o.width),F=Math.min(o.y+o.height-L.trailing0,o.y+o.height),H=e+n-c,$=i+s-c;w={x0:R,y0:P,x1:B,y1:F,cx:H,cy:$}}if(D){const L=V0(o.width,o.height,Math.max(o.y+o.height-(i+s-u),0),Math.max(e+u-o.x,0),u);L.leadingClipped&&(S=!1),L.trailingClipped&&(y=!1);const R=Math.max(o.x+L.leading0,o.x),P=Math.min(o.y+o.height-L.leading1,o.y+o.height),B=Math.max(o.x+L.trailing0,o.x),F=Math.min(o.y+o.height-L.trailing1,o.y+o.height),H=e+u,$=i+s-u;N={x0:R,y0:P,x1:B,y1:F,cx:H,cy:$}}let O=!1;y&&A!=null&&(qy(t,A,r,!O),O||(O=!0)),x&&I!=null&&(qy(t,I,l,!O),O||(O=!0)),S&&w!=null&&(qy(t,w,c,!O),O||(O=!0)),D&&N!=null&&qy(t,N,u,!O),t.closePath()}var On=class extends Tn{constructor(){super(...arguments),this.borderPath=new Cf,this.x=0,this.y=0,this.width=10,this.height=10,this.topLeftCornerRadius=0,this.topRightCornerRadius=0,this.bottomRightCornerRadius=0,this.bottomLeftCornerRadius=0,this.clipBBox=void 0,this.crisp=!1,this.lastUpdatePathStrokeWidth=this.__strokeWidth,this.effectiveStrokeWidth=this.__strokeWidth,this.hittester=super.isPointInPath.bind(this),this.distanceCalculator=super.distanceSquaredTransformedPoint.bind(this),this.microPixelEffectOpacity=1}set cornerRadius(e){this.topLeftCornerRadius=e,this.topRightCornerRadius=e,this.bottomRightCornerRadius=e,this.bottomLeftCornerRadius=e}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.__strokeWidth||!!(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:e,borderPath:i,__crisp:n,__topLeftCornerRadius:s,__topRightCornerRadius:a,__bottomRightCornerRadius:o,__bottomLeftCornerRadius:r}=this;let{__x:l,__y:c,__width:u,__height:d,__strokeWidth:g,__clipBBox:f}=this;const x=1/(this.layerManager?.canvas.pixelRatio??1);let S=1;if(e.clear(),i.clear(),u===0||d===0){this.effectiveStrokeWidth=0,this.lastUpdatePathStrokeWidth=0,this.microPixelEffectOpacity=0;return}if(n&&(u<=x&&(S*=u/x),d<=x&&(S*=d/x),u=this.align(l,u),d=this.align(c,d),l=this.align(l),c=this.align(c),f=f==null?void 0:new Tt(this.align(f.x),this.align(f.y),this.align(f.x,f.width),this.align(f.y,f.height))),g)if(u0?s-g:0,topRight:a>0?a-g:0,bottomRight:o>0?o-g:0,bottomLeft:r>0?r-g:0};this.borderClipPath=void 0,u>0&&d>0&&(A==null||A?.width>0&&A?.height>0)&&(FS(e,l,c,u,d,I,A),FS(i,l,c,u,d,I,A))}else this.borderClipPath=this.borderClipPath??new Cf,this.borderClipPath.clear(),this.borderClipPath.rect(l,c,u,d),i.rect(l,c,u,d);else{const D={topLeft:s,topRight:a,bottomRight:o,bottomLeft:r};this.borderClipPath=void 0,FS(e,l,c,u,d,D,f)}if([s,a,o,r].every(wZ)){let D=function(w,N){return I.getBBox().distanceSquared(w,N)};const A=this.getBBox();this.hittester=A.containsPoint.bind(A);const I=this;this.distanceSquared=D}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=g,this.lastUpdatePathStrokeWidth=g,this.microPixelEffectOpacity=S}computeBBox(){const{__x:e,__y:i,__width:n,__height:s,__clipBBox:a}=this;return a?.clone()??new Tt(e,i,n,s)}isPointInPath(e,i){return this.hittester(e,i)}get midPoint(){return{x:this.__x+this.__width/2,y:this.__y+this.__height/2}}setStaticProperties(e,i,n,s,a,o,r,l){this.__drawingMode=e,this.__topLeftCornerRadius=i,this.__topRightCornerRadius=n,this.__bottomRightCornerRadius=s,this.__bottomLeftCornerRadius=a,this.__visible=o,this.__crisp=r,this.__fillShadow=l,this.dirtyPath=!0,this.markDirty()}resetAnimationProperties(e,i,n,s,a,o){this.__x=e,this.__y=i,this.__width=n,this.__height=s,this.__opacity=a,this.__clipBBox=o,this.dirtyPath=!0,this.markDirty()}distanceSquared(e,i){return this.distanceCalculator(e,i)}applyFillAndAlpha(e){super.applyFillAndAlpha(e),e.globalAlpha*=this.microPixelEffectOpacity}applyStrokeAndAlpha(e){super.applyStrokeAndAlpha(e),e.globalAlpha*=this.microPixelEffectOpacity}renderStroke(e){const{stroke:i,effectiveStrokeWidth:n}=this;if(i&&n){const{globalAlpha:s}=e,{lineDash:a,lineDashOffset:o,lineCap:r,lineJoin:l,borderPath:c,borderClipPath:u}=this;u&&e.clip(u.getPath2D()),this.applyStrokeAndAlpha(e),e.lineWidth=n,a&&e.setLineDash(a),o&&(e.lineDashOffset=o),r&&(e.lineCap=r),l&&(e.lineJoin=l),e.stroke(c.getPath2D()),e.globalAlpha=s}}};On.className="Rect";T([fe()],On.prototype,"x",2);T([fe()],On.prototype,"y",2);T([fe()],On.prototype,"width",2);T([fe()],On.prototype,"height",2);T([fe()],On.prototype,"topLeftCornerRadius",2);T([fe()],On.prototype,"topRightCornerRadius",2);T([fe()],On.prototype,"bottomRightCornerRadius",2);T([fe()],On.prototype,"bottomLeftCornerRadius",2);T([fe({})],On.prototype,"clipBBox",2);T([fe()],On.prototype,"crisp",2);function wZ(t){return t===0}var Ua=class Aa extends Ip{constructor(e){super(e),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontCache=void 0,this.fontSize=Aa.defaultFontSize,this.fontFamily="sans-serif",this.textAlign="start",this.textBaseline="alphabetic",this.boxPadding=0,this.trimText=e?.trimText??!0}onTextChange(){if(this.richText?.clear(),this.textMap?.clear(),qt(this.text))this.lines=[],this.richText??(this.richText=new ee),this.richText.setScene(this.scene),this.richText.append(this.text.flatMap(e=>bi(e.text).split(au)).filter(Boolean).map(()=>new Aa({trimText:!1})));else{const e=bi(this.text).split(au);this.lines=this.trimText?e.map(i=>i.trim()):e}}get font(){return this.fontCache??(this.fontCache=v1(this)),this.fontCache}resolveFont(){if(this.hasRenderableText())return this.font}static measureBBox(e,i,n,s){if(qt(e)){const{font:a,lineHeight:o,textAlign:r,textBaseline:l}=s,{width:c,height:u,lineMetrics:d}=Va(e,a),g=o?o*d.length:u,f=Aa.calcTopOffset(g,d[0],l),y=Aa.calcLeftOffset(c,r);return new Tt(i-y,n-f,c,g)}else return Aa.computeBBox(bi(e).split(au),i,n,s)}static computeBBox(e,i,n,s){const{font:a,lineHeight:o,textAlign:r,textBaseline:l,isRtl:c}=s,{width:u,height:d,lineMetrics:g}=Ve(a).measureLines(e),f=o?o*g.length:d,y=Aa.calcTopOffset(f,g[0],l),x=Aa.calcLeftOffset(u,r,c);return new Tt(i-x,n-y,u,f)}static calcTopOffset(e,i,n){switch(n){case"alphabetic":return i?.ascent??0;case"middle":return e/2;case"bottom":return e;default:return 0}}static calcSegmentedTopOffset(e,i,n){switch(n){case"alphabetic":return i[0]?.ascent??0;case"middle":return i.length===1?i[0].ascent+i[0].segments.reduce((s,a)=>Math.min(s,Ve(a).baselineDistance("middle")),0):e/2;case"bottom":return e;default:return 0}}static calcLeftOffset(e,i,n){let s=0;switch(i){case"center":s=.5;break;case"right":case(n?"start":"end"):s=1}return e*s}getBBox(){const e=super.getBBox();if(!this.textMap?.size||!qt(this.text))return e;const{height:i,lineMetrics:n}=Va(this.text,this),s=Aa.calcSegmentedTopOffset(i,n,this.textBaseline),a=this.y-s;return e.y===a?e:new Tt(e.x,a,e.width,e.height)}computeBBox(){if(!this.hasRenderableText())return new Tt(this.x,this.y,0,0);if(this.generateTextMap(),this.textMap?.size){const l=Tt.merge(this.textMap.values());return l.x=this.x-Aa.calcLeftOffset(l.width,this.textAlign),l.y=this.y,l}const e=this.scene?.isRtl,{x:i,y:n,lines:s,textBaseline:a,textAlign:o}=this,r=Aa.computeBBox(s,i,n,{font:this,textBaseline:a,textAlign:o,isRtl:e});return this.boxing!=null&&r.grow(this.boxPadding),r}getTextMeasureBBox(){return this.computeBBox()}getPlainText(){return ce(this.text)}isPointInPath(e,i){return this.getBBox()?.containsPoint(e,i)??!1}setScene(e){this.richText?.setScene(e),super.setScene(e)}generateTextMap(){if(!qt(this.text)||this.textMap?.size)return;this.textMap??(this.textMap=new Map);let e=0;const i=this.richText.children();for(const{width:n,height:s,ascent:a,segments:o}of Va(this.text,this).lineMetrics){let r=0;for(const{color:l,textMetrics:c,...u}of o){const d=i.next().value;d.x=this.x-n/2+r,d.y=a+e,d.setProperties({...u,fill:l??this.fill});const g=d.getBBox();this.textMap.set(d,g),r+=c.width}e+=s}}render(e){const{ctx:i,stats:n}=e;if(!this.layerManager||!this.hasRenderableText()){n&&(n.nodesSkipped+=1);return}if(qt(this.text)&&this.richText){this.generateTextMap();const s=this.richText.getBBox(),{width:a,height:o,lineMetrics:r}=Va(this.text,this);let l=0;switch(this.textAlign){case"left":case"start":l=a/2;break;case"right":case"end":l=a/-2}const c=this.y-Aa.calcSegmentedTopOffset(o,r,this.textBaseline);this.renderBoxing(e,s.clone().translate(l,c)),i.save(),i.translate(l,c),this.richText.opacity=this.opacity,this.richText.render(e),i.restore()}else this.renderText(e);if(Aa.debug.check()){const s=this.getBBox();i.lineWidth=this.textMap?.size?2:1,i.strokeStyle=this.textMap?.size?"blue":"red",i.strokeRect(s.x,s.y,s.width,s.height)}super.render(e)}markDirty(e){return this.textMap?.clear(),super.markDirty(e)}renderText(e){const{fill:i,stroke:n,strokeWidth:s,font:a,textAlign:o}=this;if(!i&&!(n&&s)||!this.layerManager)return super.render(e);const{ctx:r}=e;r.font!==a&&(r.font=a),r.textAlign=o,this.renderBoxing(e),this.fillStroke(r)}renderBoxing(e,i){if(!this.boxing)return;const n=i??Aa.computeBBox(this.lines,this.x,this.y,this);if(n.width===0||n.height===0)return;const{x:s,y:a,width:o,height:r}=n.grow(this.boxPadding);this.boxing.opacity=this.opacity,this.boxing.x=s,this.boxing.y=a,this.boxing.width=o,this.boxing.height=r,this.boxing.preRender(e),this.boxing.render(e)}executeFill(e){this.renderLines((i,n,s)=>e.fillText(i,n,s))}executeStroke(e){this.renderLines((i,n,s)=>e.strokeText(i,n,s))}renderLines(e){const{x:i,y:n,lines:s}=this;if(!Number.isFinite(i)||!Number.isFinite(n))return;const a=Ve(this),{lineMetrics:o}=a.measureLines(s),{textBaseline:r,lineHeight:l=a.lineHeight()}=this;let c=0;r==="top"?c=o[0].ascent:(r==="middle"||r==="bottom")&&(c=l*(1-s.length),r==="middle"?(c/=2,c-=a.baselineDistance(r)):c-=o[0].descent);for(const u of o)e(u.text,i,n+c),c+=l}setFont(e){this.fontFamily=e.fontFamily,this.fontSize=e.fontSize,this.fontStyle=e.fontStyle,this.fontWeight=e.fontWeight}setAlign(e){this.textAlign=e.textAlign,this.textBaseline=e.textBaseline}setBoxing(e){const i=e.border?.enabled?e.border?.stroke:void 0;e.fill!=null||i!=null?(this.boxing??(this.boxing=new On({scene:this.scene})),this.boxing.fill=e.fill,this.boxing.fillOpacity=e.fillOpacity??1,this.boxing.cornerRadius=e.cornerRadius??0,this.boxing.stroke=i,this.boxing.strokeWidth=e.border?.strokeWidth??0,this.boxing.strokeOpacity=e.border?.strokeOpacity??1,this.boxPadding=e.padding??0):this.boxing&&(this.boxing.destroy(),this.boxing=void 0)}hasBoxing(){return this.boxing!=null}getBoxingProperties(){const{fill:e,fillOpacity:i,cornerRadius:n,stroke:s,strokeWidth:a,strokeOpacity:o}=this.boxing??{};return{border:{enabled:s!=null,stroke:s,strokeWidth:a,strokeOpacity:o},cornerRadius:n,fill:e,fillOpacity:i,padding:this.boxPadding}}toSVG(){if(!this.visible||!this.hasRenderableText())return;const e=this.text;if(e==null)return;const i=$i("text");if(qt(e))for(const n of e){const s=$i("tspan");Wz(s,{fontSize:n.fontSize??this.fontSize,fontFamily:n.fontFamily??this.fontFamily,fontWeight:n.fontWeight??this.fontWeight,fontStyle:n.fontStyle??this.fontStyle}),this.applySvgFillAttributes(s),s.textContent=bi(n.text),i.append(s)}else this.applySvgFillAttributes(i),Wz(i,this),i.setAttribute("text-anchor",{center:"middle",left:"start",right:"end",start:"start",end:"end"}[this.textAlign??"start"]),i.setAttribute("alignment-baseline",this.textBaseline),i.setAttribute("x",String(this.x)),i.setAttribute("y",String(this.y)),i.textContent=bi(e);return{elements:[i]}}hasRenderableText(){const{text:e}=this;return e==null?!1:qt(e)?!0:bi(e)!==""}};Ua.className="Text";Ua.debug=Gt.create(!0,"scene:text");Ua.defaultFontSize=10;T([ut()],Ua.prototype,"x",2);T([ut()],Ua.prototype,"y",2);T([TD({changeCb:t=>t.onTextChange()})],Ua.prototype,"text",2);T([ut({changeCb:t=>{t.fontCache=void 0}})],Ua.prototype,"fontStyle",2);T([ut({changeCb:t=>{t.fontCache=void 0}})],Ua.prototype,"fontWeight",2);T([ut({changeCb:t=>{t.fontCache=void 0}})],Ua.prototype,"fontSize",2);T([ut({changeCb:t=>{t.fontCache=void 0}})],Ua.prototype,"fontFamily",2);T([ut()],Ua.prototype,"textAlign",2);T([ut()],Ua.prototype,"textBaseline",2);T([ut()],Ua.prototype,"lineHeight",2);var Pa=Ua,MG=class extends Qf(Pa){},wf=class extends Qf(Jf(Pa)){},tm=class extends Ln{constructor(e){super(),this.ctx=e,this.rectNode=new On,this.textNode=new Pa,this.fill="white",this.node=this.createNode(),this.node.append([this.rectNode,this.textNode]),this.visible=!0,this.cleanup.register(e.scene.attachNode(this.node),e.eventsHub.on("layout:complete",i=>this.onLayoutComplete(i)))}createNode(){return new ee({name:"background",zIndex:pe.CHART_BACKGROUND})}onLayoutComplete(e){const{width:i,height:n}=e.chart;this.rectNode.width=i,this.rectNode.height=n}};T([b,pi("node","visible")],tm.prototype,"visible",2);T([b,pi("rectNode","fill")],tm.prototype,"fill",2);T([b],tm.prototype,"image",2);T([b,pi("textNode")],tm.prototype,"text",2);var Ri=class extends xt{constructor(){super(...arguments),this.id=Nn(this),this.node=new MG({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=zc.SMALLER,this.fontFamily="sans-serif",this.wrapping="always",this.truncate=!0,this.padding=0,this.layoutStyle="block",this.truncated=!1}registerInteraction(t,e){return t.eventsHub.on("layout:complete",()=>this.updateA11yText(t,e))}computeTextWrap(t,e){const{text:i,padding:n,wrapping:s,truncate:a}=this,o=a?t:1/0,r=a?e:1/0,l=Math.min(this.maxWidth??1/0,o)-n*2,c=this.maxHeight??r-n*2,u={maxWidth:l,maxHeight:c,font:this,textWrap:s};if(!Number.isFinite(l)&&!Number.isFinite(c)){this.node.text=i;return}let d;qt(i)?(d=gT(i,u),this.truncated=d.some(JM)):(d=kc(bi(i),u),this.truncated=wu(d)),this.node.text=d}updateA11yText(t,e){const{proxyInteractionService:i}=t;if(!this.enabled||!this.text){this.destroyProxyText();return}const n=Ti.toCanvas(this.node);if(!n)return;const{id:s}=this;this.proxyText==null&&(this.proxyText=i.createProxyElement({type:"text",domManagerId:s,where:e}),this.proxyTextListeners=[this.proxyText.addListener("mousemove",r=>this.handleMouseMove(t,r)),this.proxyText.addListener("mouseleave",r=>this.handleMouseLeave(t,r))]);const a=ce(this.text);a!==this.lastProxyTextContent&&(this.proxyText.textContent=a,this.lastProxyTextContent=a);const{lastProxyBBox:o}=this;(o==null||n.x!==o.x||n.y!==o.y||n.width!==o.width||n.height!==o.height)&&(this.proxyText.setBounds(n),this.lastProxyBBox={x:n.x,y:n.y,width:n.width,height:n.height})}handleMouseMove(t,e){if(e!=null&&this.enabled&&this.truncated){const{x:i,y:n}=Ti.toCanvas(this.node),s=e.sourceEvent.offsetX+i,a=e.sourceEvent.offsetY+n;t.tooltipManager.updateTooltip(this.id,{canvasX:s,canvasY:a,showArrow:!1},[{type:"structured",title:ce(this.text)}])}}handleMouseLeave(t,e){t.tooltipManager.removeTooltip(this.id,void 0,!0)}destroy(){this.destroyProxyText()}destroyProxyText(){if(this.proxyText!=null){for(const t of this.proxyTextListeners??[])t();this.proxyTextListeners=void 0,this.proxyText.destroy(),this.proxyText=void 0,this.lastProxyTextContent=void 0,this.lastProxyBBox=void 0}}};Ri.className="Caption";T([b,pi("node","visible")],Ri.prototype,"enabled",2);T([b,pi("node")],Ri.prototype,"text",2);T([b,pi("node")],Ri.prototype,"textAlign",2);T([b,pi("node")],Ri.prototype,"fontStyle",2);T([b,pi("node")],Ri.prototype,"fontWeight",2);T([b,pi("node")],Ri.prototype,"fontSize",2);T([b,pi("node")],Ri.prototype,"fontFamily",2);T([b,pi("node","fill")],Ri.prototype,"color",2);T([b],Ri.prototype,"spacing",2);T([b],Ri.prototype,"maxWidth",2);T([b],Ri.prototype,"maxHeight",2);T([b],Ri.prototype,"wrapping",2);T([b],Ri.prototype,"truncate",2);T([b],Ri.prototype,"padding",2);T([b],Ri.prototype,"layoutStyle",2);var zD=class extends Array{destroy(){for(const t of this)t.destroy();this.length=0}findById(t){return this.find(e=>e.id===t)}matches(t){return this.length===Object.keys(t).length&&j4(t,(e,i)=>Bt(i)&&"type"in i&&this.findById(e)?.type===i.type)}getById(t){const e=this.findById(t);if(!e)throw new Error(`Could not find axis by id [${t}].`);return e}},NZ=class extends zD{get[z.X](){return this.getById(z.X)}get[z.Y](){return this.getById(z.Y)}perpendicular(t){const e=t.direction===z.X?z.Y:z.X;return this[e]}},TZ=class extends zD{get[z.Angle](){return this.getById(z.Angle)}get[z.Radius](){return this.getById(z.Radius)}},BD=class{constructor(){this.title=new Ri,this.subtitle=new Ri,this.footnote=new Ri}positionCaptions({layoutBox:t}){const{title:e,subtitle:i,footnote:n}=this,s=t.height/10;e.enabled&&(this.positionCaption("top",e,t,s),this.shrinkLayoutByCaption("top",e,t)),i.enabled&&(this.positionCaption("top",i,t,s),this.shrinkLayoutByCaption("top",i,t)),n.enabled&&(this.positionCaption("bottom",n,t,s),this.shrinkLayoutByCaption("bottom",n,t))}positionAbsoluteCaptions(t){const{title:e,subtitle:i,footnote:n}=this,{rect:s}=t.series;for(const a of[e,i,n])if(a.layoutStyle==="overlay"){if(a.textAlign==="left")a.node.x=s.x+a.padding;else if(a.textAlign==="right"){const o=a.node.getBBox();a.node.x=s.x+s.width-o.width-a.padding}}}computeX(t,e){return t==="left"?e.x:t==="right"?e.x+e.width:e.x+e.width/2}positionCaption(t,e,i,n){if(!e.text)return;const{lineMetrics:s}=qt(e.text)?Va(e.text,e):Ve(e).measureLines(bi(e.text)),a=Math.max(s[0].height,n);e.node.x=this.computeX(e.textAlign,i)+e.padding,e.node.y=i.y+(t==="top"?0:i.height)+e.padding,e.node.textBaseline=t,e.computeTextWrap(i.width,a)}shrinkLayoutByCaption(t,e,i){if(e.layoutStyle==="block"){const n=e.node.getBBox().clone(),{spacing:s=0}=e;t==="bottom"&&qt(e.text)&&(n.y-=n.height),i.shrink(Math.ceil(t==="top"?n.y-i.y+n.height+s:i.y+i.height-n.y+s),t)}}};T([b],BD.prototype,"title",2);T([b],BD.prototype,"subtitle",2);T([b],BD.prototype,"footnote",2);var LZ=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],OZ=class{constructor(t){this.chartService=t,this.mementoOriginatorKey="chartType"}createMemento(){let t=this.chartService.publicApi?.getOptions()?.chartType;return t??(t="candlestick"),t}guardMemento(t){return t==null||LZ.includes(t)}restoreMemento(t,e,i){if(i==null)return;const n={chartType:i};this.chartService.publicApi?.updateDelta(n).catch(s=>pt.error("error restoring state",s))}},oi="13.2.1",$z=Symbol("previous-memento-not-found"),EZ=class{constructor(t){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=Gt.create(!0,"history"),this.cleanup=new qe,this.cleanup.register(t.on("series:undo",this.undo.bind(this)),t.on("series:redo",this.redo.bind(this)))}destroy(){this.cleanup.flush()}addMementoOriginator(t){this.originators.set(t.mementoOriginatorKey,t),this.clearState.set(t.mementoOriginatorKey,t.createMemento()),this.debugEvent("History add originator:",t.mementoOriginatorKey)}clear(){this.debug("History clear:",Object.keys(this.originators)),this.history=[],this.historyIndex=-1;for(const[t,e]of this.originators.entries())this.clearState.set(t,e.createMemento())}record(t,...e){this.historyIndexthis.maxHistoryLength&&(this.history=this.history.slice(-this.maxHistoryLength));const i=new Map;for(const n of e){if(!this.originators.has(n.mementoOriginatorKey))throw new Error(`Originator [${n.mementoOriginatorKey}] has not been added to the HistoryManager.`);i.set(n.mementoOriginatorKey,n.createMemento())}this.history.push({label:t,mementos:i}),this.historyIndex=this.history.length-1,this.debugEvent(`History record: [${t}]`)}undo(){const t=this.history[this.historyIndex];if(t){for(const e of t.mementos.keys()){const i=this.findPreviousMemento(e);if(i===$z)throw new Error(`Could not find previous memento for [${e}].`);this.restoreMemento(e,i)}this.historyIndex-=1,this.debugEvent(`History undo: [${t.label}]`)}}redo(){const t=this.history[this.historyIndex+1];if(t){for(const[e,i]of t.mementos.entries())this.restoreMemento(e,i);this.historyIndex+=1,this.debugEvent(`History redo: [${t.label}]`)}}findPreviousMemento(t){for(let e=this.historyIndex-1;e>=0;e--)if(this.history[e].mementos.has(t))return this.history[e].mementos.get(t);return this.clearState.has(t)?this.clearState.get(t):$z}restoreMemento(t,e){this.originators.get(t)?.restoreMemento(oi,oi,e)}debugEvent(...t){this.debug(...t,this.history.map((e,i)=>i===this.historyIndex?`** ${e.label} **`:e.label))}},RZ=class{constructor(){this.caretaker=new H1(oi),this.state=new Map}setState(t,e){ks(this.state.get(t.mementoOriginatorKey),e)||this.setStateAndRestore(t,e)}setStateAndRestore(t,e){this.state.set(t.mementoOriginatorKey,e),this.restoreState(t)}restoreState(t){const{caretaker:e,state:i}=this;if(!i.has(t.mementoOriginatorKey))return;const n=i.get(t.mementoOriginatorKey);e.restore({version:e.version,[t.mementoOriginatorKey]:n},t)}},PZ=`.ag-charts-wrapper,.ag-charts-wrapper:after,.ag-charts-wrapper:before,.ag-charts-wrapper *,.ag-charts-wrapper *:after,.ag-charts-wrapper *:before{box-sizing:border-box}.ag-charts-wrapper{--align-items: center;--justify-content: center;position:relative;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ag-charts-wrapper--safe-horizontal{--justify-content: flex-start}.ag-charts-wrapper--safe-vertical{--align-items: flex-start}.ag-charts-tab-guard{width:0;height:0;position:absolute;pointer-events:none}.ag-charts-canvas-background{position:absolute}.ag-charts-canvas-center{position:absolute;touch-action:auto;pointer-events:auto;display:flex;align-items:var(--align-items);justify-content:var(--justify-content)}.ag-charts-canvas-container,.ag-charts-canvas{position:relative;user-select:none;-webkit-user-select:none}.ag-charts-canvas-container>*,.ag-charts-canvas>*{pointer-events:none}.ag-charts-canvas canvas{display:block}.ag-charts-series-area{outline:none;pointer-events:auto;position:absolute}.ag-charts-swapchain{top:0;left:0;outline:none;opacity:0;pointer-events:none;position:absolute;width:100%;height:100%}.ag-charts-swapchain:focus-visible{opacity:1}.ag-charts-canvas-proxy,.ag-charts-canvas-overlay{position:absolute;inset:0;pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-canvas-overlay>*{position:absolute;pointer-events:auto}.ag-charts-canvas-overlay>[role=presentation]{left:0}.ag-charts-theme-default,.ag-charts-theme-default-dark{--ag-charts-accent-color: #2196f3;--ag-charts-background-color: #fff;--ag-charts-border-color: #dddddd;--ag-charts-border-radius: 4px;--ag-charts-chart-background-color: #fff;--ag-charts-chart-padding: 20px;--ag-charts-focus-color: #e4f2fe;--ag-charts-focus-shadow: 0 0 0 3px #2196f3;--ag-charts-foreground-color: #181d1f;--ag-charts-font-family: Verdana, sans-serif;--ag-charts-font-size: 12px;--ag-charts-font-weight: 400;--ag-charts-popup-shadow: 0 0 16px rgba(0, 0, 0, .15);--ag-charts-subtle-text-color: #8c8c8c;--ag-charts-text-color: #181d1f;--ag-charts-chrome-background-color: #fafafa;--ag-charts-chrome-font-family: Verdana, sans-serif;--ag-charts-chrome-font-size: 12px;--ag-charts-chrome-font-weight: 400;--ag-charts-chrome-subtle-text-color: #8c8c8c;--ag-charts-chrome-text-color: #181d1f;--ag-charts-button-background-color: #fff;--ag-charts-button-border-width: 1px;--ag-charts-button-font-weight: normal;--ag-charts-button-text-color: inherit;--ag-charts-input-background-color: #fff;--ag-charts-input-border-width: 1px;--ag-charts-input-text-color: #181d1f;--ag-charts-menu-background-color: #fafafa;--ag-charts-menu-border-width: 1px;--ag-charts-menu-text-color: #181d1f;--ag-charts-panel-background-color: #fafafa;--ag-charts-panel-text-color: #181d1f;--ag-charts-tooltip-background-color: #fafafa;--ag-charts-tooltip-border-width: 1px;--ag-charts-tooltip-text-color: #181d1f;--ag-charts-tooltip-subtle-text-color: #8c8c8c;--ag-charts-crosshair-label-background-color: #fafafa;--ag-charts-crosshair-label-text-color: #181d1f;--ag-charts-spacing: 4px;--ag-charts-icon-size: 16px;--ag-charts-input-border-radius: var(--ag-charts-border-radius);--ag-charts-input-focus-border-color: var(--ag-charts-accent-color);--ag-charts-input-focus-text-color: var(--ag-charts-accent-color);--ag-charts-input-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-input-disabled-border-color: var(--ag-charts-border-color);--ag-charts-input-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-input-text-color) 50% );--ag-charts-input-placeholder-text-color: color-mix( in srgb, var(--ag-charts-input-background-color), var(--ag-charts-input-text-color) 60% );--ag-charts-button-border-radius: var(--ag-charts-border-radius);--ag-charts-button-focus-background-color: color-mix( in srgb, var(--ag-charts-button-background-color), var(--ag-charts-accent-color) 12% );--ag-charts-button-focus-border-color: var(--ag-charts-accent-color);--ag-charts-button-focus-text-color: var(--ag-charts-accent-color);--ag-charts-button-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-button-disabled-border-color: var(--ag-charts-border-color);--ag-charts-button-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-chrome-text-color) 50% );--ag-charts-checkbox-background-color: color-mix( in srgb, var(--ag-charts-background-color), var(--ag-charts-foreground-color) 35% );--ag-charts-checkbox-checked-background-color: var(--ag-charts-accent-color);--ag-charts-tooltip-border-radius: var(--ag-charts-border-radius);--ag-charts-menu-border-radius: var(--ag-charts-border-radius);--ag-charts-chrome-font-size-small: var(--ag-charts-chrome-font-size);--ag-charts-chrome-font-size-medium: calc(var(--ag-charts-chrome-font-size) * (13 / 12));--ag-charts-chrome-font-size-large: calc(var(--ag-charts-chrome-font-size) * (14 / 12));--ag-charts-border-width: 1px;--ag-charts-border: var(--ag-charts-border-width) solid var(--ag-charts-border-color);--ag-charts-focus-border: 1px solid var(--ag-charts-accent-color);--ag-charts-focus-border-shadow: 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%);--ag-charts-layer-menu: 6;--ag-charts-layer-ui-overlay: 5;--ag-charts-layer-tooltip: 4;--ag-charts-layer-toolbar: 3;--ag-charts-layer-crosshair: 2;--ag-charts-layer-annotations: 1}.ag-chart-canvas-wrapper .ag-charts-theme-default{--ag-charts-border-radius: var(--ag-border-radius, 4px);--ag-charts-border: var(--ag-borders-critical, solid 1px) var(--ag-charts-border-color);--ag-charts-focus-shadow: var(--ag-focus-shadow, 0 0 0 3px var(--ag-charts-accent-color));--ag-charts-focus-border-shadow: var( --ag-focus-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%) )}.ag-charts-icon{display:block;width:20px;height:20px;speak:none;speak:never;mask:var(--icon) center / contain no-repeat;background-color:currentColor;transition:background-color .25s ease-in-out}.ag-charts-icon-align-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNyAxMGg2djFIN3pNNCA3aDEydjFINHptMSA2aDEwdjFINXoiLz48L3N2Zz4=)}.ag-charts-icon-align-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNCAxMGg2djFINHptMC0zaDEydjFINHptMCA2aDEwdjFINHoiLz48L3N2Zz4=)}.ag-charts-icon-align-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTAgMTBoNnYxaC02ek00IDdoMTJ2MUg0em0yIDZoMTB2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-arrow-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1LjI5MyA0LjVIMTIuNXYtMUgxN3Y0aC0xVjUuMjA3bC05LjY0NiA5LjY0Ny0uNzA4LS43MDh6IiBmaWxsPSIjMDAwIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDE2YTIuNSAyLjUgMCAxIDEtNSAwIDIuNSAyLjUgMCAwIDEgNSAwbS0yLjUgMS41YTEuNSAxLjUgMCAxIDAgMC0zIDEuNSAxLjUgMCAwIDAgMCAzIiBmaWxsPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-arrow-down-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02IDhMMS41IDhMMTAgMThMMTguNSA4TDE0IDhMMTQgM0w2IDNMNiA4Wk03IDRMNyA5SDMuNjYyNDRMMTAgMTYuNDU2TDE2LjMzNzYgOUwxMyA5TDEzIDRMNyA0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-arrow-up-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNCAxMkgxOC41TDEwIDJMMS41IDEySDZMNi4wMDAwMiAxN0gxNFYxMlpNMTMgMTZWMTFIMTYuMzM3NkwxMCAzLjU0NDA1TDMuNjYyNDQgMTFIN0w3LjAwMDAyIDE2SDEzWiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-callout-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtNC41MTRhMjYgMjYgMCAwIDAtMi4wMTcgMS41NGwtLjMxNC4yNmMtLjU1LjQ1Ny0xLjExNS45MjYtMS43NiAxLjQtLjY2OS40OTEtMS41NjItLjAxMi0xLjU2Mi0uOFYxNEg0LjVBMS41IDEuNSAwIDAgMSAzIDEyLjV6TTQuNSA0YS41LjUgMCAwIDAtLjUuNXY4YS41LjUgMCAwIDAgLjUuNWgxLjgzM3YzLjM3MmEzNiAzNiAwIDAgMCAxLjY3OC0xLjMzOGwuMzItLjI2NWEyNiAyNiAwIDAgMSAyLjIyNS0xLjY4NWwuMTI2LS4wODRIMTUuNWEuNS41IDAgMCAwIC41LS41di04YS41LjUgMCAwIDAtLjUtLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyAxdjNoMnYxMkg3djNINnYtM0g0VjRoMlYxek01IDVoM3YxMEg1ek0xMSAxNFY2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6bTEtN2gzdjZoLTN6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-chevron-filled-down{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMy42NjcgNS4zMzQgOCAxMC42NjdsNC4zMzQtNS4zMzN6IiBmaWxsPSIjMTgxZDFmIi8+PC9zdmc+)}.ag-charts-icon-chevron-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjQ3IDUuNDdhLjc1Ljc1IDAgMCAxIDEuMDYgMGw0IDRhLjc1Ljc1IDAgMCAxIDAgMS4wNmwtNCA0YS43NS43NSAwIDAgMS0xLjA2LTEuMDZMMTAuOTQgMTAgNy40NyA2LjUzYS43NS43NSAwIDAgMSAwLTEuMDYiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-close{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNSA1IDEwIDEwTTUgMTUgMTUgNSIgc3Ryb2tlPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-comment-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy41MTMgMy45OTVhNi41IDYuNSAwIDAgMSA2LjA5OCAxMS40MWMtLjU4OC4zOTMtMS4yMTcuNTM2LTEuODI5LjU4NWExMyAxMyAwIDAgMS0xLjI3LjAxN0EyNyAyNyAwIDAgMCAxMCAxNkg0LjVhLjUuNSAwIDAgMS0uNS0uNVYxMHEwLS4yNDctLjAwNy0uNTEzYy0uMDA4LS40MTYtLjAxNi0uODU3LjAxNy0xLjI2OS4wNS0uNjEyLjE5Mi0xLjI0LjU4NS0xLjgzYTYuNSA2LjUgMCAwIDEgMi45MTgtMi4zOTNtMy41Ni42MWE1LjUgNS41IDAgMCAwLTUuNjQ2IDIuMzRjLS4yNjYuMzk3LS4zNzkuODQyLS40MiAxLjM1NC0uMDMuMzYtLjAyMi43MTgtLjAxNSAxLjEwOFE1IDkuNjg5IDUgMTB2NWg1cS4zMTEuMDAxLjU5My4wMDhjLjM5LjAwNy43NDcuMDE1IDEuMTA4LS4wMTUuNTEyLS4wNDEuOTU3LS4xNTQgMS4zNTUtLjQyYTUuNSA1LjUgMCAwIDAtMS45ODMtOS45NjciIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-crosshair-add-line{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-date-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMiAyaDF2MTZIMnptMTUgMGgxdjE2aC0xeiIgZmlsbD0iIzE4MUQxRiIvPjxwYXRoIGQ9Ik0xMy4xNTcgMTFINXYtMWg3Ljc5M0wxMSA4LjIwN2wuNzA3LS43MDcgMy4xODIgMy4xODItMy4xODIgMy4xODItLjcwNy0uNzA3eiIgZmlsbD0iIzAwMCIvPjwvc3ZnPg==)}.ag-charts-icon-date-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMyAySDJ2MTZoMXptMy41MDcgNC44OUw4LjUgNC44OTVWMTBINXYxaDMuNXY3aDF2LTdoNS4wODhsLTEuOTU3IDEuOTU3LjcwNy43MDcgMy4xODItMy4xODJMMTMuMzM4IDcuM2wtLjcwNy43MDdMMTQuNjI0IDEwSDkuNVY0LjkzMmwxLjk1NyAxLjk1Ny43MDctLjcwN0w4Ljk4MiAzIDUuOCA2LjE4MnoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-delete{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTguNDk2IDguOTk2QS41LjUgMCAwIDEgOSA5LjQ5MnY0YS41LjUgMCAxIDEtMSAuMDA4di00YS41LjUgMCAwIDEgLjQ5Ni0uNTA0TTEyIDkuNWEuNS41IDAgMCAwLTEgMHY0YS41LjUgMCAwIDAgMSAweiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTYgNVYzLjVBMi41IDIuNSAwIDAgMSA4LjUgMWgzQTIuNSAyLjUgMCAwIDEgMTQgMy41VjVoMi44MzNhLjUuNSAwIDAgMSAwIDFIMTV2MTAuMjVjMCAuNDE1LS4wNjYuODYzLS4zIDEuMjIxLS4yNTcuMzk0LS42NzIuNjEyLTEuMi42MTJoLTdjLS41MjggMC0uOTQzLS4yMTgtMS4yLS42MTItLjIzNC0uMzU4LS4zLS44MDYtLjMtMS4yMjFWNkgzLjMzM2EuNS41IDAgMCAxIDAtMXptMS0xLjVBMS41IDEuNSAwIDAgMSA4LjUgMmgzQTEuNSAxLjUgMCAwIDEgMTMgMy41VjVIN3pNNiAxNi4yNVY2aDh2MTAuMjVjMCAuMzM1LS4wNTkuNTU0LS4xMzguNjc1LS4wNTUuMDg1LS4xNC4xNTgtLjM2Mi4xNThoLTdjLS4yMjIgMC0uMzA3LS4wNzMtLjM2Mi0uMTU4LS4wOC0uMTIxLS4xMzgtLjM0LS4xMzgtLjY3NSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-disjoint-channel,.ag-charts-icon-disjoint-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTkuMDI4IDE3LjQ2YTIuMjUgMi4yNSAwIDAgMC00LjA5Mi0xLjg1bC05LjUxMS0yLjM3OGEyLjI1IDIuMjUgMCAxIDAtLjIyNS45NzRsOS40NzUgMi4zNjlhMi4yNTEgMi4yNTEgMCAwIDAgNC4zNTMuODg2bS0xLjY2Mi0xLjk2NWExLjI1IDEuMjUgMCAxIDEtLjg4NSAyLjMzOCAxLjI1IDEuMjUgMCAwIDEgLjg4NS0yLjMzOE00LjM0MyAxMy42NjlhMS4yNSAxLjI1IDAgMSAwLTIuMzM4LS44ODUgMS4yNSAxLjI1IDAgMCAwIDIuMzM4Ljg4NU0zLjk3IDguNzY5YTIuMjUgMi4yNSAwIDAgMCAxLjQ1NS0yLjExbDkuNTExLTIuMzc4YTIuMjUgMi4yNSAwIDEgMC0uMjYtLjk2NUw1LjIgNS42ODVhMi4yNSAyLjI1IDAgMSAwLTEuMjMgMy4wODRtLjM3My0yLjU0N2ExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjc1LTMuNDM4YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-drag-handle{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjcuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjxjaXJjbGUgY3g9IjEzLjc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iMTMuNzUiIGN5PSIxMS43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjExLjc1IiByPSIuNzUiIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjUiLz48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iMTEuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA1aDEydjFIMnoiLz48Y2lyY2xlIGN4PSIxNS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4yNSIgY3k9IjE0LjUiIHI9IjEuNzUiIHN0cm9rZT0iIzAwMCIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik0xOCAxNUg2di0xaDEyem0wLTQuNUgydi0xaDE2eiIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-trend-based-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJtNC45OTYgMTIuNjc0IDMuMjkxLTUuNzQzLjg2OC40OTctMy4yOTEgNS43NDN6Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4zNTEiIGN5PSIxNC41IiByPSIxLjc1IiBzdHJva2U9IiMwMDAiLz48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTggNmgtN1Y1aDd6bTAgNC41aC03di0xaDd6bTAgNC41SDZ2LTFoMTJ6Ii8+PC9zdmc+)}.ag-charts-icon-fill-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtOC4wNzEgNC4wNi0uOTI0LS45MjQuNzA3LS43MDcgNy4yODggNy4yODgtNC45NSA0Ljk1YTMuNSAzLjUgMCAwIDEtNC45NSAwbC0xLjQxNC0xLjQxNGEzLjUgMy41IDAgMCAxIDAtNC45NXptLjcwNy43MDhMNC41MzYgOS4wMWEyLjUgMi41IDAgMCAwIDAgMy41MzZMNS45NSAxMy45NmEyLjUgMi41IDAgMCAwIDMuNTM1IDBsNC4yNDMtNC4yNDN6bTYuOSA3LjIwMi0uMzQ1LjM2My0uMzQ0LS4zNjNhLjUuNSAwIDAgMSAuNjg4IDBtLS4zNDUgMS4wOGE4IDggMCAwIDAtLjI4LjMyMyA0LjMgNC4zIDAgMCAwLS40MDkuNTgyYy0uMTEzLjIwMS0uMTQ0LjMyNi0uMTQ0LjM3OGEuODMzLjgzMyAwIDAgMCAxLjY2NyAwYzAtLjA1Mi0uMDMxLS4xNzctLjE0NC0uMzc4YTQuMyA0LjMgMCAwIDAtLjQxLS41ODIgOCA4IDAgMCAwLS4yOC0uMzIybS0uMzQ0LTEuMDguMzQ0LjM2My4zNDQtLjM2My4wMDIuMDAyLjAwNC4wMDQuMDEzLjAxMmE2IDYgMCAwIDEgLjIwNi4yMDhjLjEzMS4xMzYuMzA4LjMyNy40ODUuNTQ1LjE3Ni4yMTUuMzYzLjQ2Ny41MDcuNzI0LjEzNy4yNDMuMjczLjU1My4yNzMuODY4YTEuODMzIDEuODMzIDAgMSAxLTMuNjY3IDBjMC0uMzE1LjEzNi0uNjI1LjI3My0uODY4LjE0NC0uMjU3LjMzLS41MDkuNTA3LS43MjRhOSA5IDAgMCAxIC42NDUtLjcwOGwuMDQ2LS4wNDUuMDEzLS4wMTIuMDA0LS4wMDR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-high-low-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyA0aDJ2MTJINFY0aDNNNSA1aDN2MTBINXpNMTEgMTRWNmg1djhoLTVtMS03aDN2NmgtM3oiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-hlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTYzIDEuODM3LTUuMzM0IDExLjYyMUw2Ljk1NyA4LjEybC00LjE5OSA5LjYyMi0uOTE2LS40IDQuNzU2LTEwLjlMMTIuNDkgMTEuOCAxNy4yNTQgMS40MnoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjQiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTUuODI1IDIuNzA0LjU1IDEzLjc4NWwuOTAyLjQzIDQuNzI0LTkuOTE5IDYuMDM0IDUuMDI5IDMuMjU1LTguMTQtLjkyOC0uMzctMi43NDUgNi44NnptNy44NTIgMTQuNjM2IDUuNzgtMTMuMTM5LS45MTUtLjQwMi01LjIxOSAxMS44Ni02LjAwNS01LjUwNC0zLjI3OCA3LjY0OC45Mi4zOTQgMi43MjItNi4zNTJ6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-hollow-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1vcGFjaXR5PSIuMTUiIGQ9Ik01IDVoM3YxMEg1eiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTcgMXYzaDJ2MTJIN3YzSDZ2LTNINFY0aDJWMXpNNSA1aDN2MTBINXptNyAyaDN2NmgtM3ptLTEgN1Y2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-horizontal-line,.ag-charts-icon-horizontal-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNLjUgOS41aDcuMzA2YTIuMjUgMi4yNSAwIDAgMSA0LjM4OCAwSDE5LjV2MWgtNy4zMDZhMi4yNSAyLjI1IDAgMCAxLTQuMzg4IDBILjV6bTkuNSAxLjc1YTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-line-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTQuMjQyIDIuNzIyYy0uNjEyIDAtMS4yLjI0My0xLjYzMi42NzVsLTEuMzQzIDEuMzQ0YS41LjUgMCAwIDAtLjExMi4xMTJMNC4wNSAxMS45NTljLS4yMDcuMjA3LS4zNi40Ni0uNDQ2Ljc0di4wMDFsLS42OSAyLjc2N3YuMDAyYS44Mi44MiAwIDAgMCAxLjAyMiAxLjAyMWguMDAybDIuNjM0LS44MjJjLjI4LS4wODUuNTM0LS4yMzcuNzQtLjQ0M2w3LjEwNy03LjEwOGEuNS41IDAgMCAwIC4xMTItLjExMmwxLjM0My0xLjM0M2EyLjMwOCAyLjMwOCAwIDAgMC0xLjYzMi0zLjk0TTE0LjEyMiA3bDEuMDQ0LTEuMDQ1YTEuMzA4IDEuMzA4IDAgMSAwLTEuODQ5LTEuODVMMTIuMjcxIDUuMTV6bS0yLjU1OC0xLjE0Mi02LjgwNyA2LjgwOWEuOC44IDAgMCAwLS4xOTYuMzI1bC0uNzUgMi40NjggMi40Ny0uNzQ5YS44LjggMCAwIDAgLjMyNS0uMTk0bDYuODA4LTYuODF6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTcuMzYyIDQuODczLTQuNTk0IDYuNjU0LTQuODUtMy4zMTctNC4yNTEgNi45NzctLjg1NC0uNTJMNy42MTIgNi43OWw0Ljg5OSAzLjM1IDQuMDI4LTUuODM2eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-line-style-dashed{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDR2MUgyem0xMiAwaDR2MWgtNHpNOCA5aDR2MUg4eiIvPjwvc3ZnPg==)}.ag-charts-icon-line-style-dotted{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIyLjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSI4LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTAuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSIxMi41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjE0LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-line-style-solid{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDE2djFIMnoiLz48L3N2Zz4=)}.ag-charts-icon-line-with-markers-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTk4IDQuODg4LTMuNTU2IDQuOTE4YTIuMjUgMi4yNSAwIDEgMS0zLjg2Ni43NWwtMS40MzItLjlhMi4yNCAyLjI0IDAgMCAxLTIuMDA5LjQzNWwtMy44MjggNi40MjgtLjg2LS41MTJMNi40NSA5LjYyM2EyLjI1IDIuMjUgMCAxIDEgMy41MS0uNzYxbDEuMzI5LjgzNWEyLjI0IDIuMjQgMCAwIDEgMi41NTctLjQ5N2wzLjU0Mi00Ljg5OHptLTQuOTYgNS4xNTNhMS4yNSAxLjI1IDAgMSAwLS42NCAyLjQxOSAxLjI1IDEuMjUgMCAwIDAgLjY0LTIuNDE5TTkuMSA4LjMyMXEuMDY2LS4xOTIuMDY3LS40MDRhMS4yNSAxLjI1IDAgMSAwLS4wNjcuNDA0IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-lock,.ag-charts-icon-locked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuMjA3IDMuNzY0YTIuODk0IDIuODk0IDAgMCAwLTIuODk1IDIuODk0VjloNS43ODlWNi42NThhMi44OTQgMi44OTQgMCAwIDAtMi44OTUtMi44OTRNMTQuMSA5VjYuNjU4YTMuODk0IDMuODk0IDAgMSAwLTcuNzg5IDB2Mi4zNDlBMi41IDIuNSAwIDAgMCA0IDExLjV2M0EyLjUgMi41IDAgMCAwIDYuNSAxN2g4YTIuNSAyLjUgMCAwIDAgMi41LTIuNXYtM0EyLjUgMi41IDAgMCAwIDE0LjUgOXpNNi41IDEwQTEuNSAxLjUgMCAwIDAgNSAxMS41djNBMS41IDEuNSAwIDAgMCA2LjUgMTZoOGExLjUgMS41IDAgMCAwIDEuNS0xLjV2LTNhMS41IDEuNSAwIDAgMC0xLjUtMS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-measurer-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTQuNDYxIDEyLjcxIDEuNTMyLTEuNTMxIDEuNDE0IDEuNDE0LjcwNy0uNzA3TDYuNyAxMC40NzJsMS41MzItMS41MzMgMiAyIC43MDctLjcwNy0yLTIgNi4wMS02LjAxIDIuODMgMi44MjhMNS4wNSAxNy43NzggMi4yMjIgMTQuOTVsMS41MzItMS41MzIgMS40MTQgMS40MTQuNzA3LS43MDd6TS44MDggMTQuOTVsLjcwNy0uNzA3TDE0LjI0MyAxLjUxNWwuNzA3LS43MDcuNzA3LjcwNyAyLjgyOCAyLjgyOC43MDcuNzA3LS43MDcuNzA3TDUuNzU3IDE4LjQ4NWwtLjcwNy43MDctLjcwNy0uNzA3LTIuODI4LTIuODI4em0xMS4wNzgtNi44MzVMMTAuNDcgNi43bC43MDctLjcwNyAxLjQxNSAxLjQxNHptLjgyNC0zLjY1NCAxIDEgLjcwOC0uNzA3LTEtMXoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-note-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtMy4yMWwtMS40NjkgMi41N2ExIDEgMCAwIDEtMS42ODIuMDg1TDcuMjQzIDE0SDQuNUExLjUgMS41IDAgMCAxIDMgMTIuNXpNNC41IDRhLjUuNSAwIDAgMC0uNS41djhhLjUuNSAwIDAgMCAuNS41aDMuMjU3bDIuMTk2IDMuMDc0TDExLjcxIDEzaDMuNzlhLjUuNSAwIDAgMCAuNS0uNXYtOGEuNS41IDAgMCAwLS41LS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNi41IDYuNUEuNS41IDAgMCAxIDcgNmg2YS41LjUgMCAwIDEgMCAxSDdhLjUuNSAwIDAgMS0uNS0uNU02LjUgOS41QS41LjUgMCAwIDEgNyA5aDZhLjUuNSAwIDAgMSAwIDFIN2EuNS41IDAgMCAxLS41LS41IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-ohlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTEzIDExaC0zdi0xaDNWM2gxdjJoNHYxaC00djExaC0xek02IDE3di0yaDN2LTFINlY0SDV2MUgydjFoM3YxMXoiLz48L3N2Zz4=)}.ag-charts-icon-pan-end{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0ibTYuNjQ2IDEzLjgxMy0uMzUzLjM1NC43MDcuNzA3LjM1NC0uMzU0ek0xMS4xNjYgMTBsLjM1NC4zNTQuMzU0LS4zNTQtLjM1NC0uMzU0ek03LjM1NSA1LjQ4IDcgNS4xMjZsLS43MDcuNzA3LjM1My4zNTR6bTAgOS4wNCA0LjE2Ni00LjE2Ni0uNzA3LS43MDgtNC4xNjcgNC4xNjd6bTQuMTY2LTQuODc0TDcuMzU0IDUuNDhsLS43MDguNzA3IDQuMTY3IDQuMTY3ek0xMy4wODMgNXYxMGgxVjV6Ii8+PC9zdmc+)}.ag-charts-icon-pan-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuNzkgNS44MzMgOC42MjUgMTBsNC4xNjYgNC4xNjctLjcwNy43MDdMNy4yMSAxMGw0Ljg3My00Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy4yMSAxNC4xNjcgMTEuMzc2IDEwIDcuMjEgNS44MzNsLjcwNy0uNzA3TDEyLjc5IDEwbC00Ljg3MyA0Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-start{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgNXYxMGgxVjV6TTkuNjI0IDEwbDQuMTY2LTQuMTY3LS43MDctLjcwN0w4LjIxIDEwbDQuODc0IDQuODc0LjcwNy0uNzA3eiIvPjwvc3ZnPg==)}.ag-charts-icon-parallel-channel,.ag-charts-icon-parallel-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTcuNzIgNS4zMzFBMi4yNSAyLjI1IDAgMSAwIDE0LjcwNSAzLjZsLTkuNDkgNC41NjJhMi4yNSAyLjI1IDAgMSAwIC4yMDkgMS4wMWw5LjY2Mi00LjY0NmEyLjI1IDIuMjUgMCAwIDAgMi42MzQuODA1bS4zNzMtMi41NDdhMS4yNSAxLjI1IDAgMSAxLTIuMzM4Ljg4NSAxLjI1IDEuMjUgMCAwIDEgMi4zMzgtLjg4NU00LjM0MyA4LjY3YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODVNNS4zMDcgMTYuNzI4YTIuMjUgMi4yNSAwIDEgMS0uNTI1LS44NThsOS45MjMtNC43N2EyLjI1IDIuMjUgMCAxIDEgLjM4MS45MjZ6bS0uOTY0LjI3NGExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjAyMy01LjEwNmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-position-bottom{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzem0zLTNoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgMTNoOHYxSDZ6Ii8+PC9zdmc+)}.ag-charts-icon-position-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMyAxMGgxNHYxSDN6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDdoOHYxSDZ6bTAgNmg4djFINnoiLz48L3N2Zz4=)}.ag-charts-icon-position-top{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzeiIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik02IDdoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDEzaDh2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-price-label-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNC41IDNBMS41IDEuNSAwIDAgMCAzIDQuNVYxM2ExLjUgMS41IDAgMCAwIDEuNSAxLjVoLjgzM3YuMDU3Yy4yNDItLjI5OS41OTctLjUwMyAxLS41NDhWMTMuNUg0LjVBLjUuNSAwIDAgMSA0IDEzVjQuNWEuNS41IDAgMCAxIC41LS41aDExYS41LjUgMCAwIDEgLjUuNXY4YS41LjUgMCAwIDEtLjUuNWgtNC44MThsLS4xMjYuMDg0YTI2IDI2IDAgMCAwLTIuMjI1IDEuNjg1bC0uMzIuMjY1LS4wNjguMDU2YTEuNSAxLjUgMCAwIDEtMi42MDkgMS4zNTRjLjAzMy43NjMuOTA1IDEuMjM4IDEuNTYuNzU2LjY0Ni0uNDc0IDEuMjEtLjk0MyAxLjc2MS0xLjRsLjMxMy0uMjZBMjYgMjYgMCAwIDEgMTAuOTg2IDE0SDE1LjVhMS41IDEuNSAwIDAgMCAxLjUtMS41di04QTEuNSAxLjUgMCAwIDAgMTUuNSAzeiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOC43MTYgMTQuODE1YTIuMjUgMi4yNSAwIDEgMS00LjIxIDEuNTkzIDIuMjUgMi4yNSAwIDAgMSA0LjIxLTEuNTkzbS0xLjY2MiAxLjk2NmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS41IDYuMjI4IDcuMTY3IDguMzc2IDYuNSA3Ljc2MiA5LjUgNWwzIDIuNzYyLS42NjcuNjE0eiIgZmlsbD0iIzAwMCIvPjxwYXRoIGQ9Ik0yIDE4di0xaDE2djF6TTIgM1YyaDE2djF6IiBmaWxsPSIjMTgxRDFGIi8+PC9zdmc+)}.ag-charts-icon-reset{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuMDQgNC40NDVhNS44MSA1LjgxIDAgMCAwLTcuMjU3IDIuNDUzLjUuNSAwIDAgMS0uODY1LS41MDJBNi44MSA2LjgxIDAgMSAxIDMgOS44MTNhLjUuNSAwIDAgMSAxIDAgNS44MSA1LjgxIDAgMSAwIDguMDQtNS4zNjgiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTQuMjg5IDMuMDAyYS41LjUgMCAwIDEgLjUuNXYyLjY1NWgyLjY1NWEuNS41IDAgMCAxIDAgMUg0LjI5YS41LjUgMCAwIDEtLjUtLjVWMy41MDJhLjUuNSAwIDAgMSAuNS0uNSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-settings{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkIj48cGF0aCBkPSJNMTAgMTNhMyAzIDAgMSAwIDAtNiAzIDMgMCAwIDAgMCA2bTAtMWEyIDIgMCAxIDEtLjAwMS0zLjk5OUEyIDIgMCAwIDEgMTAgMTIiLz48cGF0aCBkPSJNMi4zMSAxNC4zNDVjLS44MTctMS40OTEuMDI3LTIuNDk5LjQ3NC0yLjg2NS41MzEtLjQzNC45NjktLjM2NS45NzItMS40OC0uMDAzLTEuMTE1LS40NDEtMS4wNDYtLjk3Mi0xLjQ4MS0uNDU0LS4zNzEtMS4zMTctMS40MDUtLjQzNC0yLjkzNmwuMDA1LS4wMDljLjg4NC0xLjUyIDIuMjA3LTEuMjkgMi43NTUtMS4wODMuNjQxLjI0My44MDEuNjU2IDEuNzY4LjEwMS45NjQtLjU2LjY4Ni0uOTA0Ljc5Ni0xLjU4Mi4wOTQtLjU3OC41NTktMS44NDMgMi4zMjYtMS44NDNoLjAxYzEuNzU5LjAwNSAyLjIyMiAxLjI2NiAyLjMxNiAxLjg0My4xMS42NzgtLjE2OCAxLjAyMi43OTYgMS41ODIuOTY3LjU1NSAxLjEyNy4xNDIgMS43NjgtLjEwMS41NDktLjIwOCAxLjg3Ni0uNDM4IDIuNzYgMS4wOTJzLjAyIDIuNTY1LS40MzQgMi45MzZjLS41MzEuNDM1LS45NjkuMzY2LS45NzIgMS40ODEuMDAzIDEuMTE1LjQ0MSAxLjA0Ni45NzIgMS40OC40NTQuMzcyIDEuMzE3IDEuNDA2LjQzNCAyLjkzN2wtLjAwNS4wMDljLS44ODQgMS41Mi0yLjIwNyAxLjI5LTIuNzU1IDEuMDgzLS42NDEtLjI0My0uODAxLS42NTYtMS43NjgtLjEwMS0uOTY0LjU2LS42ODYuOTA0LS43OTYgMS41ODEtLjA5NC41NzktLjU1OSAxLjg0NC0yLjMyNiAxLjg0NGgtLjAxYy0xLjc1OS0uMDA1LTIuMjIyLTEuMjY2LTIuMzE2LTEuODQ0LS4xMS0uNjc3LjE2OC0xLjAyMS0uNzk2LTEuNTgxLS45NjctLjU1NS0xLjEyNy0uMTQyLTEuNzY4LjEwMS0uNTQ5LjIwOC0xLjg3Ni40MzgtMi43Ni0xLjA5MmwtLjAyLS4wMzZ6TTkuOTg0IDIuMTYySDEwYzEuMzU1IDAgMS4zNDIgMS4wMzkgMS4zNTMgMS40MjUuMDA4LjMxMi4wNCAxLjE2IDEuMjU5IDEuODcybC4wMTUuMDA4YzEuMjI1LjcgMS45NzYuMzA0IDIuMjUxLjE1NS4zMzctLjE4MyAxLjIyNi0uNzExIDEuOTAyLjQ0NWwuMDA4LjAxNGMuNjc4IDEuMTczLS4yMjkgMS42ODItLjU1OCAxLjg4NC0uMjY2LjE2My0uOTg0LjYxNS0uOTkxIDIuMDI3di4wMTZjLjAwNyAxLjQxMi43MjUgMS44NjQuOTkxIDIuMDI3LjMyOC4yMDEgMS4yMjkuNzA3LjU2NiAxLjg3bC0uMDA4LjAxNGMtLjY3NyAxLjE3NC0xLjU3MS42NDMtMS45MS40NTktLjI3NS0uMTQ5LTEuMDI2LS41NDUtMi4yNTEuMTU0bC0uMDE1LjAwOWMtMS4yMTkuNzEyLTEuMjUxIDEuNTYtMS4yNTkgMS44NzItLjAxMS4zODYuMDAyIDEuNDI1LTEuMzUzIDEuNDI1cy0xLjM0Mi0xLjAzOS0xLjM1My0xLjQyNWMtLjAwOC0uMzEyLS4wNC0xLjE2LTEuMjU5LTEuODcybC0uMDE1LS4wMDljLTEuMjI1LS42OTktMS45NzYtLjMwMy0yLjI1MS0uMTU0LS4zMzYuMTgzLTEuMjE5LjcwNi0xLjg5NC0uNDMybC0uMDE2LS4wMjdjLS42NzgtMS4xNzQuMjI5LTEuNjgyLjU1OC0xLjg4NC4yNjYtLjE2My45ODQtLjYxNS45OTEtMi4wMjd2LS4wMTZjLS4wMDctMS40MTItLjcyNS0xLjg2NC0uOTkxLTIuMDI3LS4zMjgtLjIwMS0xLjIyOS0uNzA3LS41NjYtMS44N2wuMDA4LS4wMTRjLjY3Ny0xLjE3NCAxLjU3MS0uNjQzIDEuOTEtLjQ1OS4yNzUuMTQ5IDEuMDI2LjU0NSAyLjI1MS0uMTU1bC4wMTUtLjAwOGMxLjIxOS0uNzEyIDEuMjUxLTEuNTYgMS4yNTktMS44NzIuMDEtLjM4NC0uMDAyLTEuNDE3IDEuMzM3LTEuNDI1Ii8+PC9zdmc+)}.ag-charts-icon-step-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzE4MUQxRiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNiA0aDV2OGgzVjhoNXYxaC00djRoLTVWNUg3djEwSDJ2LTFoNHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-text-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDRIMTZWN0gxNVY1SDEwLjVWMTVIMTRWMTZINlYxNUg5LjVWNUg1VjdINFY0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-trend-line,.ag-charts-icon-trend-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS4zMTQgMTAuOTM4YTIuMjUgMi4yNSAwIDEgMSAuMDEtMWg5LjM1MmEyLjI1IDIuMjUgMCAxIDEgLjAxIDF6bS0yLjE4OS43MjlhMS4yNSAxLjI1IDAgMSAwIDAtMi41IDEuMjUgMS4yNSAwIDAgMCAwIDIuNW0xMy43NSAwYTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-unlock,.ag-charts-icon-unlocked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNjUxIDMuNWEyLjg5NCAyLjg5NCAwIDAgMC0yLjg5NCAyLjg5NFY5SDE0LjVhMi41IDIuNSAwIDAgMSAyLjUgMi41djNhMi41IDIuNSAwIDAgMS0yLjUgMi41aC04QTIuNSAyLjUgMCAwIDEgNCAxNC41di0zQTIuNSAyLjUgMCAwIDEgNi41IDloLjI1N1Y2LjM5NGEzLjg5NCAzLjg5NCAwIDEgMSA3Ljc4OSAwIC41LjUgMCAwIDEtMSAwQTIuODk0IDIuODk0IDAgMCAwIDEwLjY1IDMuNU02LjUgMTBBMS41IDEuNSAwIDAgMCA1IDExLjV2M0ExLjUgMS41IDAgMCAwIDYuNSAxNmg4YTEuNSAxLjUgMCAwIDAgMS41LTEuNXYtM2ExLjUgMS41IDAgMCAwLTEuNS0xLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-vertical-line,.ag-charts-icon-vertical-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNSA3LjgwNmEyLjI1IDIuMjUgMCAwIDEgMCA0LjM4OFYxOS41aC0xdi03LjMwNmEyLjI1IDIuMjUgMCAwIDEgMC00LjM4OFYuNWgxem0tLjUuOTQ0YTEuMjUgMS4yNSAwIDEgMSAwIDIuNSAxLjI1IDEuMjUgMCAwIDEgMC0yLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-zoom-in{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-zoom-out{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS41IDEwYS41LjUgMCAwIDEgLjUtLjVoOGEuNS41IDAgMCAxIDAgMUg2YS41LjUgMCAwIDEtLjUtLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-zoom-in-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20taW4iPjxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiLz48bGluZSB4MT0iMjEiIHgyPSIxNi42NSIgeTE9IjIxIiB5Mj0iMTYuNjUiLz48bGluZSB4MT0iMTEiIHgyPSIxMSIgeTE9IjgiIHkyPSIxNCIvPjxsaW5lIHgxPSI4IiB4Mj0iMTQiIHkxPSIxMSIgeTI9IjExIi8+PC9zdmc+)}.ag-charts-icon-zoom-out-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20tb3V0Ij48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=)}.ag-charts-input{--input-layer-active: 1;--input-layer-focus: 2;--input-padding: calc(var(--ag-charts-spacing) * 2);--input-padding-large: calc(var(--ag-charts-spacing) * 2.5);color:var(--ag-charts-input-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);transition-duration:.25s;transition-property:none;transition-timing-function:ease-out}.ag-charts-input:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--input-layer-focus)}.ag-charts-button{background:var(--ag-charts-button-background-color);border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-button-border-radius);border-style:solid;border-width:var(--ag-charts-button-border-width);color:var(--ag-charts-button-text-color);cursor:pointer;padding:var(--input-padding);transition-property:background,border-color}.ag-charts-button:hover{background:var(--ag-charts-focus-color)}.ag-charts-button:has(.ag-charts-icon){padding:2px}.ag-charts-checkbox{--checkbox-transition-duration: .1s;appearance:none;background:var(--ag-charts-checkbox-background-color);border-radius:calc(var(--ag-charts-border-radius) * 9);cursor:pointer;height:18px;margin:0;transition-duration:var(--checkbox-transition-duration);transition-property:margin;width:29px}.ag-charts-checkbox:before{display:block;background:var(--ag-charts-input-background-color);border-radius:calc(var(--ag-charts-border-radius) * 7);content:" ";height:14px;margin:2px;transition-duration:var(--checkbox-transition-duration);transition-property:margin;transition-timing-function:var(--ag-charts-input-transition-easing);width:14px}.ag-charts-checkbox:checked{background:var(--ag-charts-checkbox-checked-background-color)}.ag-charts-checkbox:checked:before{margin-inline-start:13px}.ag-charts-select{background:var(--ag-charts-input-background-color);border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-input-border-radius);border-style:solid;border-width:var(--ag-charts-input-border-width);padding:3px 2px 4px;font-size:inherit}.ag-charts-textarea{--textarea-line-height: 1.38;background:var(--ag-charts-input-background-color);border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-input-border-radius);border-style:solid;border-width:var(--ag-charts-input-border-width);line-height:var(--textarea-line-height);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);padding:var(--input-padding-large) var(--input-padding)}.ag-charts-textarea::placeholder{color:var(--ag-charts-input-placeholder-text-color)}.ag-charts-proxy-container{pointer-events:none;position:absolute}.ag-charts-proxy-legend-toolbar{pointer-events:auto}.ag-charts-proxy-legend-toolbar>div[role=listitem]{pointer-events:none}.ag-charts-proxy-elem{-webkit-appearance:none;appearance:none;background:none;border:none;color:#0000;overflow:hidden;pointer-events:auto;position:absolute}.ag-charts-proxy-elem::-moz-range-thumb,.ag-charts-proxy-elem::-moz-range-track{opacity:0}.ag-charts-proxy-elem::-webkit-slider-runnable-track,.ag-charts-proxy-elem::-webkit-slider-thumb{opacity:0}.ag-charts-proxy-elem[data-focus-override=true],.ag-charts-proxy-elem:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-proxy-elem[data-focus-override=false]{outline:none;box-shadow:none}.ag-charts-proxy-elem svg{display:block}.ag-charts-proxy-scrollbar-slider:focus-visible{outline:none;box-shadow:none}.ag-charts-proxy-scrollbar-thumb-focus{border:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);box-sizing:border-box;opacity:0;pointer-events:none}.ag-charts-proxy-scrollbar-slider:focus-visible~.ag-charts-proxy-scrollbar-thumb-focus{opacity:1}.ag-charts-focus-indicator{position:absolute;display:block;pointer-events:none;user-select:none;-webkit-user-select:none;width:100%;height:100%}.ag-charts-focus-indicator>div{position:absolute;outline:solid 1px var(--ag-charts-chrome-background-color);box-shadow:var(--ag-charts-focus-shadow)}.ag-charts-focus-indicator>svg{width:100%;height:100%;fill:none;overflow:visible}.ag-charts-focus-svg-outer-path{stroke:var(--ag-charts-chrome-background-color);stroke-width:4px}.ag-charts-focus-svg-inner-path{stroke:var(--ag-charts-accent-color);stroke-width:2px}.ag-charts-overlay{color:#181d1f;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay{color:#fff}.ag-charts-overlay--loading{color:#8c8c8c}.ag-charts-overlay__loading-background{background:#fff;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-overlay__loading-background{background:#192232}.ag-charts-tooltip{--tooltip-arrow-size: 8px;--tooltip-row-spacing: 8px;--tooltip-column-spacing: 16px;position:fixed;inset:unset;margin:0;padding:0;overflow:visible;top:var(--top, 0px);left:var(--left, 0px);width:max-content;max-width:100%;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);color:var(--ag-charts-tooltip-text-color);background:var(--ag-charts-tooltip-background-color);border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-tooltip-border-radius);border-style:solid;border-width:var(--ag-charts-tooltip-border-width);box-shadow:var(--ag-charts-popup-shadow)}.ag-charts-tooltip--compact .ag-charts-tooltip-content{--tooltip-row-spacing: 2px;--tooltip-column-spacing: 8px;padding:3px 6px}.ag-charts-tooltip--arrow-top:before,.ag-charts-tooltip--arrow-right:before,.ag-charts-tooltip--arrow-bottom:before,.ag-charts-tooltip--arrow-left:before{content:"";position:absolute;display:block;width:var(--tooltip-arrow-size);height:var(--tooltip-arrow-size);border:inherit;border-bottom-color:transparent;border-right-color:transparent;background:inherit;clip-path:polygon(0 0,100% 0,100% 1px,1px 100%,0 100%)}.ag-charts-tooltip--arrow-top:before{bottom:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * .5)) rotate(45deg)}.ag-charts-tooltip--arrow-bottom:before{top:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * -.5)) rotate(225deg)}.ag-charts-tooltip--arrow-left:before{right:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * .5)) rotate(315deg)}.ag-charts-tooltip--arrow-right:before{left:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * -.5)) rotate(135deg)}.ag-charts-tooltip--no-interaction{pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-tooltip--wrap-always{overflow-wrap:break-word;word-break:break-word;hyphens:none}.ag-charts-tooltip--wrap-hyphenate{overflow-wrap:break-word;word-break:break-word;hyphens:auto}.ag-charts-tooltip--wrap-on-space{overflow-wrap:normal;word-break:normal}.ag-charts-tooltip--wrap-never{white-space:nowrap}.ag-charts-tooltip-heading,.ag-charts-tooltip-title,.ag-charts-tooltip-label,.ag-charts-tooltip-value{overflow:hidden;text-overflow:ellipsis}.ag-charts-tooltip-content{display:grid;grid:auto-flow minmax(1em,auto) / 1fr;padding:8px 12px;gap:var(--tooltip-row-spacing)}.ag-charts-tooltip-content:has(.ag-charts-tooltip-symbol){grid:auto-flow minmax(1em,auto) / auto 1fr}.ag-charts-tooltip-heading{grid-column:1 / -1}.ag-charts-tooltip-symbol{grid-column:1 / 2;place-self:center}.ag-charts-tooltip-symbol svg{display:block}.ag-charts-tooltip-title{grid-column:-2 / -1}.ag-charts-tooltip-row{grid-column:1 / -1;display:flex;gap:var(--tooltip-column-spacing);align-items:baseline;justify-content:space-between;overflow:hidden}.ag-charts-tooltip-row--inline{grid-column:-2 / -1}.ag-charts-tooltip-label{flex:1;min-width:0}.ag-charts-tooltip-value{min-width:0}.ag-charts-tooltip-footer{grid-column:1 / -1;color:var(--ag-charts-tooltip-subtle-text-color);text-align:center}.ag-charts-popover{position:absolute;border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-border-radius);border-style:solid;border-width:var(--ag-charts-border-width);background:var(--ag-charts-panel-background-color);color:var(--ag-charts-chrome-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);box-shadow:var(--ag-charts-popup-shadow);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-menu{--item-padding: 6px 12px;--icon-color: var(--ag-charts-menu-text-color);display:grid;grid:auto-flow auto / 1fr;column-gap:12px;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-menu:has(.ag-charts-menu__icon,.ag-charts-menu__row--stroke-width-visible){grid:auto-flow auto / auto 1fr}.ag-charts-menu__row--stroke-width-visible:before{content:"";height:var(--strokeWidth);width:12px;background:var(--icon-color)}.ag-charts-menu__row--stroke-width-visible[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-menu__row{display:grid;grid-column:1 / -1;grid-template-columns:subgrid;align-items:center;padding:var(--item-padding)}.ag-charts-menu__row:not(.ag-charts-menu__row--active){cursor:pointer}.ag-charts-menu__row:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.ag-charts-menu__row:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.ag-charts-menu__row:focus{background:var(--ag-charts-focus-color)}.ag-charts-menu__row:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--ag-charts-layer-menu)}.ag-charts-menu__row--active{--icon-color: var(--ag-charts-accent-color);background:var(--ag-charts-focus-color);color:var(--ag-charts-accent-color)}.ag-charts-menu__row[aria-disabled=true]{background:var(--ag-charts-button-disabled-background-color);color:var(--ag-charts-button-disabled-text-color);cursor:default}.ag-charts-menu__label{grid-column:-1 / span 1;text-wrap:nowrap}.ag-charts-toolbar{--toolbar-size: 34px;--toolbar-border-radius: var(--ag-charts-border-radius);--toolbar-button-background-color: var(--ag-charts-chrome-background-color);--toolbar-button-border-color: var(--ag-charts-border-color);--toolbar-button-border-width: var(--ag-charts-button-border-width);--toolbar-button-gap: 0;--toolbar-button-padding: 6px;--toolbar-button-text-color: var(--ag-charts-button-text-color);--toolbar-button-background-color--active: var(--ag-charts-focus-color);--toolbar-button-border-color--active: var(--ag-charts-accent-color);--toolbar-button-text-color--active: var(--ag-charts-accent-color);--toolbar-button-background-color--disabled: var(--ag-charts-button-disabled-background-color);--toolbar-button-border-color--disabled: var(--toolbar-button-border-color);--toolbar-button-text-color--disabled: var(--ag-charts-button-disabled-text-color);--toolbar-button-background-color--hover: var(--ag-charts-focus-color);--toolbar-button-border-color--hover: var(--toolbar-button-border-color);--toolbar-button-text-color--hover: var(--toolbar-button-text-color);align-items:center;display:flex;flex-wrap:nowrap;gap:var(--toolbar-button-gap);position:absolute}.ag-charts-toolbar__button{align-items:center;background:var(--toolbar-button-background-color);border-color:var(--toolbar-button-border-color);border-style:solid;border-width:var(--toolbar-button-border-width);color:var(--toolbar-button-text-color);cursor:pointer;display:flex;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-medium);font-weight:var(--ag-charts-chrome-font-weight);justify-content:center;min-height:var(--toolbar-size);min-width:var(--toolbar-size);padding:var(--toolbar-button-padding);position:relative;transition:background-color .25s ease-in-out,border-color .25s ease-in-out,color .25s ease-in-out;white-space:nowrap}.ag-charts-toolbar__button:hover{background:var(--toolbar-button-background-color--hover);border-color:var(--toolbar-button-border-color--hover);color:var(--toolbar-button-text-color--hover);z-index:1}.ag-charts-toolbar__button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-toolbar__button--active,.ag-charts-toolbar__button--active:hover{background:var(--toolbar-button-background-color--active);border-color:var(--toolbar-button-border-color--active);color:var(--toolbar-button-text-color--active);z-index:2}.ag-charts-toolbar__button[aria-disabled=true]{background:var(--toolbar-button-background-color--disabled);border-color:var(--toolbar-button-border-color--disabled);color:var(--toolbar-button-text-color--disabled);cursor:default}.ag-charts-toolbar--horizontal{flex-direction:row;.ag-charts-toolbar__button{border-inline-end-width:0}.ag-charts-toolbar__button--first{border-end-start-radius:var(--toolbar-border-radius);border-start-start-radius:var(--toolbar-border-radius);margin:0}.ag-charts-toolbar__button--last{border-end-end-radius:var(--toolbar-border-radius);border-start-end-radius:var(--toolbar-border-radius);border-inline-end-width:var(--toolbar-button-border-width);margin-inline-end:0}.ag-charts-toolbar__button:hover,.ag-charts-toolbar__button--active,.ag-charts-toolbar__button--active:hover{border-inline-end-width:var(--toolbar-button-border-width);margin-inline-end:calc(-1 * var(--toolbar-button-border-width));&.ag-charts-toolbar__button--last{margin-inline-end:0}}.ag-charts-toolbar__button:hover+.ag-charts-toolbar__button:not(.ag-charts-toolbar__button--active){border-inline-start-color:var(--toolbar-button-border-color--hover)}.ag-charts-toolbar__button--active+.ag-charts-toolbar__button{border-inline-start-color:var(--toolbar-button-border-color--active)}}.ag-charts-toolbar--vertical{flex-direction:column;.ag-charts-toolbar__button{margin:-1px 0 0;max-width:100%}.ag-charts-toolbar__button--first{border-start-start-radius:var(--ag-charts-border-radius);border-start-end-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--last{border-end-start-radius:var(--ag-charts-border-radius);border-end-end-radius:var(--ag-charts-border-radius)}}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{margin-inline-start:calc(var(--ag-charts-spacing) * 2)}.ag-charts-toolbar__label+.ag-charts-toolbar__icon{margin-inline-start:calc(var(--ag-charts-spacing) * 2)}.ag-charts-toolbar__icon,.ag-charts-toolbar__label{pointer-events:none}.ag-charts-floating-toolbar{border:none;display:flex;.ag-charts-toolbar{align-items:unset;position:unset}.ag-charts-toolbar__button:hover{border-inline-end-width:0;margin-inline-end:0;+.ag-charts-toolbar__button:not(.ag-charts-toolbar__button--active){border-inline-start-width:var(--toolbar-button-border-width);border-inline-start-color:var(--toolbar-button-border-color--hover)}&.ag-charts-toolbar__button--last{margin-inline-end:0}}.ag-charts-toolbar__button--active,.ag-charts-toolbar__button--active:hover{border-inline-end-width:0;margin-inline-end:0;+.ag-charts-toolbar__button:not(.ag-charts-toolbar__button--active){border-inline-start-width:var(--toolbar-button-border-width);border-inline-start-color:var(--toolbar-button-border-color--active)}&.ag-charts-toolbar__button--last{margin-inline-end:0}}}.ag-charts-floating-toolbar__drag-handle{align-items:center;background:var(--ag-charts-chrome-background-color);border-color:var(--ag-charts-border-color);border-style:solid;border-width:var(--ag-charts-border-width);border-end-start-radius:var(--ag-charts-border-radius);border-start-start-radius:var(--ag-charts-border-radius);border-inline-end-width:0;cursor:grab;display:flex;justify-content:center;min-width:24px;padding-inline-start:0;padding-inline-end:0}.ag-charts-floating-toolbar__drag-handle--dragging{cursor:grabbing} +`,PT=class{constructor(){this.cleanup=new qe,this.destroyed=!1}destroy(){this.cleanup.flush(),this.destroyed=!0}},zZ=class HS{constructor(e,i,n){this.element=e,this.topTabGuard=i,this.bottomTabGuard=n,this.cleanup=new qe,this.guardTabIndex=0,this.hasFocus=!1,this.initTabGuard(this.topTabGuard,!1),this.initTabGuard(this.bottomTabGuard,!0),this.element.addEventListener("focus",()=>this.onFocus(),{capture:!0}),this.element.addEventListener("blur",s=>this.onBlur(s),{capture:!0})}set tabIndex(e){this.guardTabIndex=e,this.guardTabIndex===0?this.setGuardIndices(void 0):this.hasFocus||this.setGuardIndices(this.guardTabIndex)}destroy(){this.cleanup.flush()}initTabGuard(e,i){this.cleanup.register(Qe(e,"focus",()=>this.onTab(e,i)))}setGuardIndices(e){const i=e;ye(this.topTabGuard,"tabindex",i),ye(this.bottomTabGuard,"tabindex",i)}onFocus(){this.hasFocus=!0,this.guardTabIndex!==0&&this.setGuardIndices(0)}onBlur({relatedTarget:e}){const{topTabGuard:i,bottomTabGuard:n}=this;this.hasFocus=!1,this.guardTabIndex!==0&&e!==i&&e!==n&&this.setGuardIndices(this.guardTabIndex)}onTab(e,i){if(this.guardTabIndex!==0){let n;e.tabIndex===0?(n=this.findExitTarget(!i),this.setGuardIndices(this.guardTabIndex)):n=this.findEnterTarget(i),n?.focus()}}static queryFocusable(e,i){const n=e.ownerDocument.defaultView;return Array.from(e.querySelectorAll(i)).filter(s=>{if(Eb(s)){const a=n.getComputedStyle(s);return a.display!=="none"&&a.visibility!=="none"}return!1})}findEnterTarget(e){const i=HS.queryFocusable(this.element,'[tabindex="0"]'),n=e?i.length-1:0;return i[n]}findExitTarget(e){const i=HS.queryFocusable(this.element.ownerDocument.body,"[tabindex]").filter(a=>a.tabIndex>0).sort((a,o)=>a.tabIndex-o.tabIndex),{before:n,after:s}=HS.findBeforeAndAfter(i,this.guardTabIndex);return e?n:s}static findBeforeAndAfter(e,i){let n=0,s=e.length-1,a,o;for(;n<=s;){const r=Math.floor((n+s)/2),l=e[r].tabIndex;if(l===i){a=e[r-1]||void 0,o=e[r+1]||void 0;break}else l{i.matches||(this.devicePixelRatio=this.agDocument.devicePixelRatio,this.unregisterDevicePixelRatioListener(),this.registerDevicePixelRatioListener(),this.callback(this.pixelRatio))},this.devicePixelRatio=t.devicePixelRatio}get pixelRatio(){return this.devicePixelRatio}observe(){this.registerDevicePixelRatioListener()}disconnect(){this.unregisterDevicePixelRatioListener()}unregisterDevicePixelRatioListener(){this.devicePixelRatioMediaQuery?.removeEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=void 0}registerDevicePixelRatioListener(){const t=this.agDocument.matchMedia(`(resolution: ${this.pixelRatio}dppx)`);t?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=t}},VZ=class{constructor(t){this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0;for(const[i,n,s]of this.queuedObserveRequests)this.observe(i,n,s);this.queuedObserveRequests=[],this.observeWindow()},this.resizeObserver=t.createResizeObserver(i=>{for(const{target:n,contentRect:{width:s,height:a}}of i){const o=this.elements.get(n);this.checkSize(o,n,s,a)}});let e;this.pixelRatioObserver=new BZ(t,()=>{clearTimeout(e),e=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady=t.isReady(),this.documentReady?this.observeWindow():this.removeLoadListener=t.attachListener("load",this.onLoad)}destroy(){this.removeLoadListener?.(),this.removeLoadListener=void 0,this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.pixelRatioObserver?.disconnect(),this.pixelRatioObserver=void 0}observeWindow(){this.pixelRatioObserver?.observe()}checkPixelRatio(){const t=this.pixelRatioObserver?.pixelRatio??1;for(const[e,i]of this.elements)if(i.size!=null&&i.size.pixelRatio!==t){const{width:n,height:s}=i.size;i.size={width:n,height:s,pixelRatio:t},i.cb(i.size,e)}}checkSize(t,e,i,n){if(t&&(i!==t.size?.width||n!==t.size?.height)){const s=this.pixelRatioObserver?.pixelRatio??1;t.size={width:i,height:n,pixelRatio:s},t.cb(t.size,e)}}observe(t,e,i){if(!this.documentReady){this.queuedObserveRequests.push([t,e,i]);return}this.elements.has(t)?this.removeFromQueue(t):this.resizeObserver?.observe(t);const n={cb:e};if(this.elements.set(t,n),!i?.skipInitialRead){const s=t.ownerDocument.defaultView?.getComputedStyle(t),a=t.clientWidth-(Number.parseFloat(s?.paddingLeft??"0")+Number.parseFloat(s?.paddingRight??"0")),o=t.clientHeight-(Number.parseFloat(s?.paddingTop??"0")+Number.parseFloat(s?.paddingBottom??"0"));(a>0||o>0)&&this.checkSize(n,t,a,o)}}unobserve(t){this.resizeObserver?.unobserve(t),this.elements.delete(t),this.removeFromQueue(t),this.elements.size||this.destroy()}removeFromQueue(t){this.queuedObserveRequests=this.queuedObserveRequests.filter(([e])=>e!==t)}},DM=class extends Map{constructor(t,e){super(),this.defaultValue=t,this.defaultState=e}set(t,e){return this.delete(t),e!==void 0&&super.set(t,e),delete this.cachedState,delete this.cachedValue,this}delete(t){return delete this.cachedState,delete this.cachedValue,super.delete(t)}stateId(){return this.cachedState??(this.cachedState=Array.from(this.keys()).pop()??this.defaultState),this.cachedState}stateValue(){return this.cachedValue??(this.cachedValue=Array.from(this.values()).pop()??this.defaultValue),this.cachedValue}},_Z=["translate"],jS=class{constructor(t,e){this.element=t,this.cache={},this.pendingWrites=new Map,this.deferredMode=e?.deferredMode,this.sizeMonitor=e?.sizeMonitor,this.skipInitialRead=e?.skipInitialRead??!1}get isConnected(){return this.element.isConnected}scheduleFlush(){this.deferredMode?this.deferredMode.scheduleFlush():this.flush()}contains(t){return this.element.contains(t)}addEventListener(t,e,i){this.element.addEventListener(t,e,i)}removeEventListener(t,e,i){this.element.removeEventListener(t,e,i)}get innerHTML(){return this.pendingWrites?this.cache.innerHTML??"":this.element.innerHTML}changed(t,e){return this.cache[t]===e?!1:(this.cache[t]=e,!0)}invalidate(t){delete this.cache[t]}setProperty(t,e){const i=`p:${t}`;if(this.changed(i,e)){if(_Z.includes(t)){this.element.style.setProperty(t,e);return}this.pendingWrites.set(i,()=>{this.element.style.setProperty(t,e)}),this.scheduleFlush()}}toggleClass(t,e){const i=`c:${t}`;this.changed(i,e)&&(this.pendingWrites.set(i,()=>{this.element.classList.toggle(t,e)}),this.scheduleFlush())}setAttr(t,e){const i=`a:${t}`;this.changed(i,e)&&(this.pendingWrites.set(i,()=>{e==null?this.element.removeAttribute(t):this.element.setAttribute(t,e)}),this.scheduleFlush())}setData(t,e){const i=`d:${t}`;this.changed(i,e)&&(this.pendingWrites.set(i,()=>{this.element.dataset[t]=e}),this.scheduleFlush())}getData(t){const e=`d:${t}`;return this.pendingWrites?this.cache[e]:this.element.dataset[t]}setInnerHTML(t){return this.changed("innerHTML",t)?(this.pendingWrites.set("innerHTML",()=>{this.element.innerHTML=t}),this.scheduleFlush(),this.invalidate("contentStyles"),!0):!1}setContentStyles(t){if(this.changed("contentStyles",JSON.stringify(t))){const e=()=>{const i=this.element.firstElementChild??this.element;Object.assign(i.style,t)};this.pendingWrites.set("contentStyles",e),this.scheduleFlush()}}flush(){if(this.pendingWrites){for(const t of this.pendingWrites.values())t();this.pendingWrites.clear()}}flushKey(t){const e=this.pendingWrites.get(t);e&&(e(),this.pendingWrites.delete(t))}togglePopover(t){t?this.changed("popover",!0)&&(this.pendingWrites.set("popover",()=>{this.element.togglePopover(!0)}),this.scheduleFlush()):(this.pendingWrites.delete("popover"),this.changed("popover",!1)&&this.element.togglePopover(!1))}appendChild(t){this.element.appendChild(t)}set innerText(t){this.element.innerText=t,this.invalidate("innerHTML")}addResizeListener(t){const{sizeMonitor:e,element:i,skipInitialRead:n}=this;if(e==null)throw new Error("AG Charts - addResizeListener requires a SizeMonitor");return e.observe(i,s=>t(s),{skipInitialRead:n}),()=>e.unobserve(i)}reset(){this.cache={}}},FZ='',HZ=["styles","canvas","canvas-background","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area","tooltip-container"],jZ=new Set(["styles","canvas-container","canvas","tooltip-container"]),Xz={safeHorizontal:"ag-charts-wrapper--safe-horizontal",safeVertical:"ag-charts-wrapper--safe-vertical"},GZ=new Map([["styles",{childElementType:"style"}],["canvas",{childElementType:"canvas"}],["canvas-proxy",{childElementType:"div"}],["canvas-overlay",{childElementType:"div"}],["canvas-center",{childElementType:"div"}],["series-area",{childElementType:"div"}],["tooltip-container",{childElementType:"div"}]]);function UZ(t,e,i){const n=t.createIntersectionObserver(s=>{for(const a of s)a.target===e&&i(a.intersectionRatio)},{root:e});return n?.observe(e),n}var DG={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON(){return DG}};function Zz(t,e){const i=$t("div");return i.className="ag-charts-tab-guard",t.insertAdjacentElement(e,i),i}var VD=class Bd extends PT{constructor(e,i,n,s,a,o,r="normal"){super(),this.eventsHub=e,this.chart=i,this.agDocument=n,this.styleContainer=a,this.skipCss=o,this.mode=r,this.anchorName=`--${Nn(this)}`,this.styles=new Map,this.pendingContainer=void 0,this.container=void 0,this.documentRoot=void 0,this.initiallyConnected=void 0,this.containerSize=void 0,this.cursorState=new DM("default"),this._lastCursor=void 0,this._lastCenterSize=void 0,this.deferredProxies=new Map,this.deferredMode={scheduleFlush:this.scheduleFlush.bind(this)},this.minWidth=0,this.minHeight=0,this._isRtl=!1,this._deferring=!1,this.sizeMonitor=new VZ(n),this.element=this.initDOM(),this.elementProxy=new jS(this.element,{deferredMode:this.deferredMode}),this.rootElements=this.initRootElements(),this.rootElements.canvas.element.style.setProperty("anchor-name",this.anchorName),this.sizeMonitor.observe(this.rootElements.canvas.element,()=>this.invalidateRectCaches(),{skipInitialRead:this.mode==="minimal"});let l=!1;if(this.observer=UZ(n,this.element,c=>{c===0&&!l&&this.eventsHub.emit("dom:hidden",null),l=c===0}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",PZ),this.setContainer(s),this.cleanup.register(vj(this.element)),this.setupGlobalListeners(),this.mode==="normal"){const c=this.rootElements["canvas-center"].element;if(c==null)throw new Error("Error initializing tab guards");const u=Zz(c,"beforebegin"),d=Zz(c,"afterend");this.tabGuards=new zZ(c,u,d)}}initDOM(){if(this.mode==="normal"){const n=$t("div");return n.innerHTML=FZ,n.firstChild}const e=$t("div");e.role="presentation",e.dataset.agCharts="",e.classList.add("ag-charts-wrapper");const i=$t("div");return e.appendChild(i),i.role="presentation",i.classList.add("ag-charts-series-area"),e}initRootElements(){const{mode:e,element:i}=this,n={};for(const s of HZ){const a=`ag-charts-${s}`;let o;if(e==="normal"?o=i.classList.contains(a)?i:i.getElementsByClassName(a)[0]:jZ.has(s)?o=i:o=i.getElementsByClassName(a)[0]??$t("div"),o==null)throw new Error(`AG Charts - unable to find DOM element ${a}`);n[s]={element:o,children:new Map,listeners:[]}}return n}destroy(){super.destroy(),this.observer?.unobserve(this.element),this.sizeMonitor.unobserve(this.rootElements.canvas.element),this.container&&this.sizeMonitor.unobserve(this.container),this.pendingContainer=void 0;for(const e of Object.values(this.rootElements)){for(const i of e.children.values())i.remove();e.element.remove()}this.element.remove()}scheduleFlush(){this._deferring||this._pendingFlush==null&&(this._pendingFlush=setTimeout(()=>{this._pendingFlush=void 0,!this._deferring&&this.flushDeferredProxies()}))}flushDeferredProxies(){this._pendingFlush!=null&&(clearTimeout(this._pendingFlush),this._pendingFlush=void 0),this.elementProxy.flush();for(const e of this.deferredProxies.values())e.flush();this.updateStylesLocation(),this.mode!=="minimal"&&(this.pendingContainer==null||this.pendingContainer===this.container||(Bd.batchedUpdateContainer.length===0&&setTimeout(this.applyBatchedUpdateContainer.bind(this),0),Bd.batchedUpdateContainer.push(this)))}applyBatchedUpdateContainer(){for(const e of Bd.batchedUpdateContainer)e.destroyed||e.updateContainer();Bd.batchedUpdateContainer.splice(0)}updateStylesLocation(){if(!(this.initiallyConnected===!0||this.container?.isConnected===!1)){this.documentRoot=this.getShadowDocumentRoot(this.container),this.initiallyConnected=!0;for(const e of this.rootElements.styles.children.keys())this.removeChild("styles",e);for(const[e,i]of this.styles)this.addStyles(e,i)}}setSizeOptions(e=300,i=300,n,s){const{style:a}=this.element;this.minWidth=n??e,this.minHeight=s??i,a.minWidth=`${this.minWidth}px`,a.minHeight=`${this.minHeight}px`,this.updateContainerClassName()}updateContainerSize(){const e=this.containerSize==null?"hidden":"",i=this.containerSize?`${this.containerSize.width??0}px`:"",n=this.containerSize?`${this.containerSize.height??0}px`:"",s=this._lastCenterSize;if(s==null||s.visibility!==e||s.width!==i||s.height!==n){this._lastCenterSize={visibility:e,width:i,height:n};const{style:a}=this.rootElements["canvas-center"].element;a.visibility=e,a.width=i,a.height=n}this.updateContainerClassName()}setTabGuardIndex(e){this.tabGuards&&(this.tabGuards.tabIndex=e)}setContainer(e){e!==this.container&&(this.pendingContainer=e,(this.mode==="minimal"||this.container==null)&&this.updateContainer())}updateContainer(){const{pendingContainer:e}=this;if(!(e==null||e===this.container)){if(this.container&&(this.element.remove(),this.sizeMonitor.unobserve(this.container)),this.documentRoot!=null)for(const i of this.rootElements.styles.children.keys())this.removeChild("styles",i);this.container=e,this.pendingContainer=void 0,this.agDocument.setContainer(e),this.documentRoot=this.getShadowDocumentRoot(e),this.initiallyConnected=e.isConnected;for(const[i,n]of this.styles)this.addStyles(i,n);e.appendChild(this.element),this.sizeMonitor.observe(e,i=>{this.containerSize=i,this.updateContainerSize(),this.invalidateRectCaches(),this.eventsHub.emit("dom:resize",null)},{skipInitialRead:this.mode==="minimal"}),this.invalidateAllCaches(),this.updateRtl(),this.eventsHub.emit("dom:container-change",null)}}setThemeClass(e){const i="ag-charts-theme-";for(const n of Array.from(this.element.classList))n.startsWith(i)&&n!==e&&this.element.classList.remove(n);this.element.classList.add(e)}setThemeParameters(e){this.setCSSVariables("--ag-charts",void 0,void 0,e)}setModuleCSSVariables(e,i,n,s,a){this.setCSSVariables(`--ag-charts-${e}`,i,n,s,a)}setCSSVariables(e,i,n,s,a){for(const[o,r]of Xe(s)){let l=o,c=`${r}`;o.endsWith("Size")||o.endsWith("Radius")||a?.includes(o)?c=`${r}px`:o.endsWith("Border")&&typeof r=="boolean"&&(l=`${o}Width`,c=r?"var(--ag-charts-border-width)":"0"),l=`${e}${i?"__":""}${i??""}-${g4(l)}${n?"--":""}${n??""}`,this.element.style.setProperty(l,c)}}updateCanvasLabel(e){ye(this.rootElements["canvas-proxy"].element,"aria-label",e)}getEventElement(e,i){return["focus","blur","keydown","keyup"].includes(i)?this.rootElements["series-area"].element:e}addEventListener(e,i,n){const s=this.getEventElement(this.element,e);return Qe(s,e,i,n)}removeEventListener(e,i,n){this.getEventElement(this.element,e).removeEventListener(e,i,n)}getBoundingClientRect(){return this._cachedCanvasRect??(this._cachedCanvasRect=this.rootElements.canvas.element.getBoundingClientRect()),this._cachedCanvasRect}getOverlayClientRect(){const{innerWidth:e,innerHeight:i}=this.agDocument,n=new Tt(0,0,e,i),s=this.getRawOverlayClientRect();return n.intersection(s)?.toDOMRect()??DG}findScrollableContainer(){if(this._cachedScrollableContainer!==void 0)return this._cachedScrollableContainer;let e=this.element;const i=this.element.getRootNode()?.fullscreenElement;for(;e!=null;){let n;if(i!=null&&e===i)n=!0;else{const a=e.computedStyleMap?.()?.get("overflow-y")?.toString();n=a==="auto"||a==="scroll"}if(n)return this._cachedScrollableContainer=e,e;e=e.parentElement}return this._cachedScrollableContainer=null,null}getRawOverlayClientRect(){if(this._cachedRawOverlayRect!=null)return this._cachedRawOverlayRect;const e=this.findScrollableContainer();if(e!=null)return this._cachedRawOverlayRect=Tt.fromObject(e.getBoundingClientRect()),this._cachedRawOverlayRect;if(this.documentRoot!=null)return this._cachedRawOverlayRect=Tt.fromObject(this.documentRoot.getBoundingClientRect()),this._cachedRawOverlayRect;const{innerWidth:i,innerHeight:n}=this.agDocument;return this._cachedRawOverlayRect=new Tt(0,0,i,n),this._cachedRawOverlayRect}getShadowDocumentRoot(e=this.container){const i=e?.ownerDocument?.body??this.agDocument.body;for(;e!=null;){if(e===i)return;if(YH(e.parentNode))return e;e=e.parentNode}}getParent(e){return this.rootElements[e].element}getChildBoundingClientRect(e){const{children:i}=this.rootElements[e],n=[];for(const s of i.values())n.push(Tt.fromObject(s.getBoundingClientRect()));return Tt.merge(n)}isManagedChildDOMElement(e,i,n){const{children:s}=this.rootElements[i],a=s?.get(n);return a!=null&&e.contains(a)}contains(e,i){return i==null?this.element.contains(e):this.rootElements[i].element.contains(e)}addStyles(e,i){const n="data-ag-charts";if(this.styles.set(e,i),this.container==null||this.skipCss)return;const s=r=>r.getAttribute(n)===e,a=r=>{const l=new Set(["TITLE","META"]);let c=!0,u;for(const g of r.children){if(c&&l.has(g.tagName)){u=g;continue}if(c=!1,s(g))return;g.hasAttribute(n)&&(u=g)}const d=$t("style");return this.chart.styleNonce!=null&&(d.nonce=this.chart.styleNonce),u==null?r.prepend(d):r.insertBefore(d,u.nextSibling),d};let o;this.styleContainer?o=a(this.styleContainer):this.initiallyConnected===!1?o=this.addChild("styles",e):this.documentRoot==null&&!Bd.headStyles.has(e)?(o=a(this.agDocument.head),Bd.headStyles.add(e)):this.documentRoot!=null&&(o=this.addChild("styles",e)),!(o==null||s(o))&&(o.setAttribute(n,e),o.innerHTML=i)}removeStyles(e){this.removeChild("styles",e)}updateCursor(e,i){this.cursorState.set(e,i);const n=this.cursorState.stateValue();n!==this._lastCursor&&(this._lastCursor=n,this.element.style.cursor=n)}getCursor(){return this.element.style.cursor}get isRtl(){return this._isRtl}setEnableRtl(e){this.enableRtl=e,this.updateRtl()}updateRtl(){const e=this.enableRtl??(this.mode==="minimal"?!1:ff(this.container??this.pendingContainer));e!==this._isRtl&&(this._isRtl=e,this.element.dir=e?"rtl":"ltr",this.eventsHub.emit("rtl:change",null))}addChild(e,i,n,s){const{element:a,children:o,listeners:r}=this.rootElements[e];if(!o)throw new Error("AG Charts - unable to create DOM elements after destroy()");if(o.has(i))return o.get(i);const{childElementType:l="div"}=GZ.get(e)??{};if(n&&n.tagName.toLowerCase()!==l.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const c=n??$t(l);for(const[u,d,g]of r)c.addEventListener(u,d,g);if(o.set(i,c),l==="style"&&this.chart.styleNonce!=null&&(c.nonce=this.chart.styleNonce),s){const u=a.querySelector(s.query);if(u==null)throw new Error(`AG Charts - addChild query failed ${s.query}`);u.insertAdjacentElement(s.where,c)}else a?.appendChild(c);return c}addProxyChild(e,i){const n=this.addChild(e,i),s=this.mode==="minimal";return new jS(n,{sizeMonitor:this.sizeMonitor,skipInitialRead:s})}addDeferredProxyChild(e,i){const n=this.addChild(e,i),s=this.mode==="minimal",a=new jS(n,{deferredMode:this.deferredMode,sizeMonitor:this.sizeMonitor,skipInitialRead:s});return this.deferredProxies.set(`${e}:${i}`,a),a}setDeferring(e){this.mode!=="minimal"&&(this._deferring=e,e||this.flushDeferredProxies())}removeChild(e,i){const{children:n}=this.rootElements[e];n&&(n.get(i)?.remove(),n.delete(i),this.deferredProxies.delete(`${e}:${i}`))}incrementDataCounter(e){const i=this.elementProxy.getData(e)??"0";this.elementProxy.setData(e,String(Number(i)+1))}setDataBoolean(e,i){this.elementProxy.setData(e,String(i))}setDataNumber(e,i){this.elementProxy.setData(e,String(i))}getDocument(){return this.agDocument}invalidateRectCaches(){this._cachedCanvasRect=void 0,this._cachedRawOverlayRect=void 0}invalidateAllCaches(){this.invalidateRectCaches(),this._cachedScrollableContainer=void 0}setupGlobalListeners(){const e=this.element.ownerDocument.defaultView;if(e==null)return;const i=()=>this.invalidateRectCaches(),n=()=>this.invalidateAllCaches();e.addEventListener("scroll",i,{capture:!0,passive:!0}),e.addEventListener("resize",i,{capture:!0,passive:!0}),this.element.ownerDocument.addEventListener("fullscreenchange",n),this.cleanup.register(()=>{e.removeEventListener("scroll",i,{capture:!0}),e.removeEventListener("resize",i,{capture:!0}),this.element.ownerDocument.removeEventListener("fullscreenchange",n)})}updateContainerClassName(){const{element:e,containerSize:i,minWidth:n,minHeight:s}=this;e.classList.toggle(Xz.safeHorizontal,n>=(i?.width??1/0)),e.classList.toggle(Xz.safeVertical,s>=(i?.height??1/0))}};VD.className="DOMManager";VD.batchedUpdateContainer=[];VD.headStyles=new Set;var AG=VD;function Lg(t,e,i){const{offsetX:n,offsetY:s,clientX:a,clientY:o}=e,{currentX:r,currentY:l}=cu.calcCurrentXY(i,e);return{type:t,device:"mouse",offsetX:n,offsetY:s,clientX:a,clientY:o,currentX:r,currentY:l,sourceEvent:e}}function _0(t,e,i){return{type:t,sourceEvent:e}}var qz={change:{isNative:!0,allocator(t,e){return{type:"change",sourceEvent:t}}},blur:{isNative:!0,allocator(t,e){return{type:"blur",sourceEvent:t}}},focus:{isNative:!0,allocator(t,e){return{type:"focus",sourceEvent:t}}},keydown:{isNative:!0,allocator(t){return{type:"keydown",sourceEvent:t}}},keyup:{isNative:!0,allocator(t){return{type:"keyup",sourceEvent:t}}},contextmenu:{isNative:!0,allocator(t,e){return Lg("contextmenu",t,e)}},click:{isNative:!0,allocator(t,e){return Lg("click",t,e)}},dblclick:{isNative:!0,allocator(t,e){return Lg("dblclick",t,e)}},mouseenter:{isNative:!0,allocator(t,e){return Lg("mouseenter",t,e)}},mousemove:{isNative:!0,allocator(t,e){return Lg("mousemove",t,e)}},mouseleave:{isNative:!0,allocator(t,e){return Lg("mouseleave",t,e)}},wheel:{isNative:!0,allocator(t,e){const{offsetX:i,offsetY:n,clientX:s,clientY:a}=t,o=t.deltaMode===0?.01:1;let r=t.deltaX*o,l=t.deltaY*o;return Math.abs(t.deltaX)===0&&t.shiftKey&&([r,l]=[l,r]),{type:"wheel",offsetX:i,offsetY:n,clientX:s,clientY:a,deltaX:r,deltaY:l,sourceEvent:t}}},touchstart:{isNative:!0,allocator(t,e){return _0("touchstart",t)}},touchmove:{isNative:!0,allocator(t,e){return _0("touchmove",t)}},touchend:{isNative:!0,allocator(t,e){return _0("touchend",t)}},touchcancel:{isNative:!0,allocator(t,e){return _0("touchcancel",t)}},"drag-start":void 0,"drag-move":void 0,"drag-end":void 0,"collapse-widget":void 0,"expand-widget":void 0,"expand-controlled-widget":void 0},cu=class{static alloc(t,e,i){const n=qz[t].allocator;return n(e,i)}static isHTMLEvent(t){return qz[t]?.isNative===!0}static calcCurrentXY(t,e){const i=t.getBoundingClientRect();return{currentX:e.clientX-i.x,currentY:e.clientY-i.y}}},WZ=class{constructor(){this.widgetListeners={},this.sourceListeners={}}initSourceHandler(t,e){this.sourceListeners??(this.sourceListeners={}),this.sourceListeners[t]=e}lazyGetWidgetListeners(t,e){var i;if(!(t in(this.sourceListeners??{}))){const n=a=>{const o=cu.alloc(t,a,e.getElement());this.dispatch(t,e,o)},s={};(t.startsWith("touch")||t==="wheel")&&(s.passive=!1),this.initSourceHandler(t,n),e.getElement().addEventListener(t,n,s)}return this.widgetListeners??(this.widgetListeners={}),(i=this.widgetListeners)[t]??(i[t]=[]),this.widgetListeners[t]}add(t,e,i){this.lazyGetWidgetListeners(t,e).push(i)}remove(t,e,i){const n=this.lazyGetWidgetListeners(t,e),s=n.indexOf(i);s>-1&&n.splice(s,1)}destroy(t){if(this.widgetListeners=void 0,this.sourceListeners){for(const[e,i]of Xe(this.sourceListeners))t.getElement().removeEventListener(e,i);this.sourceListeners=void 0}}dispatch(t,e,i){for(const n of this.widgetListeners?.[t]??[])n(i,e)}},KZ=class{constructor(t,e,i,n){this.glob=t,this.self=e,this.cleanup=new qe,this.mousegeneral=l=>{l.stopPropagation(),l.stopImmediatePropagation()},this.mousemove=l=>{l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mousemove(l)},this.mouseup=l=>{l.button===0&&(l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mouseup(l),this.destroy())};const{mousegeneral:s,mousemove:a,mouseup:o}=this,r=n.view;this.cleanup.register(Qe(r,"mousedown",s,{capture:!0}),Qe(r,"mouseenter",s,{capture:!0}),Qe(r,"mouseleave",s,{capture:!0}),Qe(r,"mouseout",s,{capture:!0}),Qe(r,"mouseover",s,{capture:!0}),Qe(r,"mousemove",a,{capture:!0}),Qe(r,"mouseup",o,{capture:!0})),e.mouseDragger=this,t.globalMouseDragCallbacks=i,t.globalMouseDragCallbacks.mousedown(n),n.stopPropagation(),n.stopImmediatePropagation()}destroy(){this.cleanup.flush(),this.glob.globalMouseDragCallbacks=void 0,this.self.mouseDragger=void 0}};function YZ(t,e,i,n){if(t.globalMouseDragCallbacks==null)return new KZ(t,e,i,n)}var $Z=500,XZ=100;function ZZ(t,e){const i=t.clientX-e.clientX,n=t.clientY-e.clientY;return i*i+n*n}var fN=!1,qZ=class{constructor(t,e,i,n,s){this.glob=t,this.self=e,this.initialTouch=n,this.target=s,this.cleanup=new qe,this.longTapInterrupted=!1,this.longtap=()=>{const{target:r,initialTouch:l}=this;if(!this.longTapInterrupted){const c=new qe;r.dispatchEvent(new TouchEvent("touchcancel",{touches:[l],bubbles:!0})),fN=!0;const u=x=>x.preventDefault(),d=x=>{fN=!1,x.preventDefault(),c.flush()};c.register(Qe(r,"touchmove",u,{passive:!1}),Qe(r,"touchend",d,{passive:!1}),Qe(r,"touchcancel",d,{passive:!1}));const{clientX:g,clientY:f}=l,y=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:r.ownerDocument.defaultView,clientX:g,clientY:f,pointerType:"touch"});r.dispatchEvent(y)}},this.touchmove=r=>{const{glob:l,self:c,initialTouch:u}=this,d=this.findInitialFinger(r.targetTouches);d!=null&&(this.longTapInterrupted=this.longTapInterrupted||ZZ(u,d)>XZ,c.dragTouchEnabled&&l.globalTouchDragCallbacks?.touchmove(r,d))},this.touchend=r=>{this.longTapInterrupted=!0;const l=this.findInitialFinger(r.changedTouches,r.touches);l!=null&&this.glob.globalTouchDragCallbacks?.touchend(r,l),this.destroy()},this.longtapTimer=setTimeout(this.longtap,$Z);const{touchmove:a,touchend:o}=this;this.cleanup.register(Qe(s,"touchmove",a,{passive:!1}),Qe(s,"touchstart",o,{passive:!1}),Qe(s,"touchend",o,{passive:!1}),Qe(s,"touchcancel",o,{passive:!1})),e.touchDragger=this,t.globalTouchDragCallbacks=i}destroy(){clearTimeout(this.longtapTimer),this.cleanup.flush(),this.glob.globalTouchDragCallbacks=void 0,this.self.touchDragger=void 0}findInitialFinger(...t){const e=t.flatMap(i=>Array.from(i));return Array.from(e).find(i=>i.identifier===this.initialTouch.identifier)}};function QZ(t,e,i,n,s){if(!(t.globalTouchDragCallbacks!=null||fN))return new qZ(t,e,i,n,s)}function IC(t,e,i,n){const{currentX:s,currentY:a}=cu.calcCurrentXY(t.getElement(),n),o=n.pageX-i.pageX,r=n.pageY-i.pageY;return{type:e,device:"mouse",offsetX:i.offsetX+o,offsetY:i.offsetY+r,clientX:n.clientX,clientY:n.clientY,currentX:s,currentY:a,originDeltaX:o,originDeltaY:r,sourceEvent:n}}function JZ(t,{pageX:e,pageY:i}){const{x:n,y:s}=t.getElement().getBoundingClientRect();return{offsetX:e-n,offsetY:i-s}}function kC(t,e,i,n,s){const{currentX:a,currentY:o}=cu.calcCurrentXY(t.getElement(),s),r=s.pageX-i.pageX,l=s.pageY-i.pageY;return{type:e,device:"touch",offsetX:i.offsetX+r,offsetY:i.offsetY+l,clientX:s.clientX,clientY:s.clientY,currentX:a,currentY:o,originDeltaX:r,originDeltaY:l,sourceEvent:n}}var Qz={},Jz=class{constructor(t){this.dispatchCallback=t,this.dragTouchEnabled=!0}destroy(){this.dragTriggerRemover?.(),this.dragTriggerRemover=void 0,this.listeners?.clear(),this.mouseDragger?.destroy(),this.touchDragger?.destroy()}getListenerSet(t){this.listeners??(this.listeners=new Map);let e=this.listeners.get(t);return e===void 0&&(e=new Set,this.listeners.set(t,e)),e}add(t,e,i){switch(this.getListenerSet(t).add(i),t){case"drag-start":case"drag-move":case"drag-end":{this.registerDragTrigger(e);break}}}remove(t,e,i){this.getListenerSet(t).delete(i)}registerDragTrigger(t){if(this.dragTriggerRemover==null){const e=t.getElement(),i=new qe;i.register(Qe(e,"mousedown",n=>this.triggerMouseDrag(t,n)),Qe(e,"touchstart",n=>this.triggerTouchDrag(t,n),{passive:!1})),this.dragTriggerRemover=()=>i.flush()}}triggerMouseDrag(t,e){if(e.button===0){if(e.view==null){const i=t.getElement().ownerDocument.defaultView;e=new i.MouseEvent(e.type,{...e,view:i})}this.startMouseDrag(t,e)}}startMouseDrag(t,e){const i={pageX:Number.NaN,pageY:Number.NaN,offsetX:Number.NaN,offsetY:Number.NaN};rM(["pageX","pageY","offsetX","offsetY"],i,e);const n={mousedown:s=>{const a=IC(t,"drag-start",i,s);this.dispatch("drag-start",t,a)},mousemove:s=>{const a=IC(t,"drag-move",i,s);this.dispatch("drag-move",t,a)},mouseup:s=>{const a=IC(t,"drag-end",i,s);this.dispatch("drag-end",t,a),this.endDrag(t,a)}};this.mouseDragger=YZ(Qz,this,n,e)}endDrag(t,{sourceEvent:e,clientX:i,clientY:n}){const s=t.getElement(),a=s.getBoundingClientRect();MD(a,i,n)||(s.dispatchEvent(new MouseEvent("mouseleave",e)),e.target?.dispatchEvent(new MouseEvent("mouseenter",e)))}triggerTouchDrag(t,e){const i=e.targetTouches[0];e.targetTouches.length===1&&i!=null&&this.startOneFingerTouch(t,e,i)}startOneFingerTouch(t,e,i){const n={pageX:Number.NaN,pageY:Number.NaN,...JZ(t,i)};rM(["pageX","pageY"],n,i);const s={touchmove:(r,l)=>{const c=kC(t,"drag-move",n,r,l);this.dispatch("drag-move",t,c)},touchend:(r,l)=>{const c=kC(t,"drag-end",n,r,l);this.dispatch("drag-end",t,c)}},a=t.getElement();this.touchDragger=QZ(Qz,this,s,i,a);const o=kC(t,"drag-start",n,e,i);this.dispatch("drag-start",t,o)}dispatch(t,e,i){for(const n of this.getListenerSet(t))n(i,e);this.dispatchCallback(t,i)}},tq=class{constructor(t){this.elem=t}setBounds(t){tM(this.elemContainer??this.elem,t)}getBounds(){return s4(this.elemContainer??this.elem)}static setElementContainer(t,e){const i=t.getBounds();tM(e,i),ij(t.elem,{width:"100%",height:"100%"}),t.elem.remove(),t.elemContainer=e,t.elemContainer.replaceChildren(t.elem)}},Vu=class extends tq{constructor(){super(...arguments),this.index=Number.NaN,this.children=[]}set id(t){ye(this.elem,"id",t)}get id(){return Jd(this.elem,"id")}getElement(){return this.elem}getBoundingClientRect(){return this.elem.getBoundingClientRect()}get clientWidth(){return this.elem.clientWidth}get clientHeight(){return this.elem.clientHeight}destroy(){this.destroyListener?.(),this.destroyListener=void 0,this.remove();for(const t of this.children)t.parent=void 0,t.destroy();this.children.length=0,this.destructor(),this.remove(),this.internalListener?.destroy(),this.htmlListener?.destroy(this)}remove(){this.elem.remove(),this.elemContainer?.remove()}setHidden(t){Cr(this.elem,"display",t?"none":void 0)}isHidden(){const{defaultView:t}=this.elem.ownerDocument;return t?.getComputedStyle(this.elem).display==="none"}setCursor(t){Cr(this.elem,"cursor",t)}setTextContent(t){this.elem.textContent=t??null}setAriaDescribedBy(t){ye(this.elem,"aria-describedby",t)}setAriaHidden(t){ye(this.elem,"aria-hidden",t)}setAriaLabel(t){ye(this.elem,"aria-label",t)}setAriaExpanded(t){ye(this.elem,"aria-expanded",t)}setAriaControls(t){ye(this.elem,"aria-controls",t)}setAriaHasPopup(t){ye(this.elem,"aria-haspopup",t)}setInnerHTML(t){this.elem.innerHTML=t}setPointerEvents(t){Cr(this.elem,"pointer-events",t)}setCSSVariable(t,e){this.elem.style.setProperty(t,e)}isDisabled(){return Jd(this.elem,"aria-disabled",!1)}hasPopup(){const t=Jd(this.elem,"aria-haspopup");return t!==void 0&&t!=="false"}parseFloat(t){return t===""?0:Number.parseFloat(t)}cssLeft(){return this.parseFloat(this.elem.style.left)}cssTop(){return this.parseFloat(this.elem.style.top)}cssWidth(){return this.parseFloat(this.elem.style.width)}cssHeight(){return this.parseFloat(this.elem.style.height)}focus(t){this.elem.focus(t)}setFocusOverride(t){ye(this.elem,"data-focus-override",t)}setPreventsDefault(t){ye(this.elem,"data-preventdefault",t)}setTabIndex(t){ye(this.elem,"tabindex",t)}addChild(t){this.addChildToDOM(t,this.getBefore(t)),this.children.push(t),t.index=this.children.length-1,t.parent=this,this.onChildAdded(t)}removeChild(t){const e=this.children.indexOf(t);this.children.splice(e,1),this.removeChildFromDOM(t),this.onChildRemoved(t)}moveChild(t,e){t.domIndex!==e&&(t.domIndex=e,this.removeChildFromDOM(t),this.addChildToDOM(t,this.getBefore(t)))}addClass(...t){this.elem.classList.add(...t)}removeClass(...t){this.elem.classList.remove(...t)}toggleClass(t,e){this.elem.classList.toggle(t,e)}appendOrInsert(t,e){e?e.getElement().insertAdjacentElement("beforebegin",t):this.elem.appendChild(t)}addChildToDOM(t,e){this.appendOrInsert(t.getElement(),e)}removeChildFromDOM(t){t.getElement().remove()}onChildAdded(t){}onChildRemoved(t){}getBefore({domIndex:t}){if(t!==void 0)return this.children.filter(e=>e.domIndex!==void 0&&e.domIndex>t).reduce((e,i)=>!e||i.domIndexthis.removeListener(t,e)}removeListener(t,e){cu.isHTMLEvent(t)?this.htmlListener?.remove(t,this,e):this.htmlListener!=null&&this.internalListener?.remove(t,this,e)}setDragTouchEnabled(t){this.internalListener??(this.internalListener=new Jz(this.onDispatch.bind(this))),this.internalListener.dragTouchEnabled=t}onDispatch(t,e){if(!e.sourceEvent?.bubbles)return;let{parent:i}=this;for(;i!=null;){const{internalListener:n}=i;if(n!=null){const s={...e,...cu.calcCurrentXY(i.getElement(),e)};n.dispatch(t,i,s)}i=i.parent}}},eq=class extends Vu{constructor(){super($t("div")),this.textElement=$i("text"),this.textElement.role="presentation",this.svgElement=$i("svg"),this.svgElement.appendChild(this.textElement),this.svgElement.style.width="100%",this.svgElement.style.opacity="0",this.svgElement.role="presentation",this.elem.appendChild(this.svgElement),this.elem.role="presentation"}set textContent(t){this.textElement.textContent=t;const i=this.textElement.getBBox?.();i&&this.svgElement.setAttribute("viewBox",`${i.x} ${i.y} ${i.width} ${i.height}`)}get textContent(){return this.textElement.textContent}destructor(){}},iq=class{constructor(t,e){this.getDispatcher=e,this.onExpanded=()=>{this.controller.setAriaExpanded(!0);const i=this.getDispatcher();if(i&&this.controls){const n={type:"expand-controlled-widget",controlled:this.controls};i.dispatch("expand-controlled-widget",this.controller,n)}},this.onCollapsed=i=>{this.controller.setAriaExpanded(!1),i.mode==="0"&&this.controller.focus()},t.setAriaExpanded(!1),this.controller=t}destroy(){this.controls?.collapse({mode:"2"}),this.setControlled(void 0)}setControlled(t){this.controls&&(this.controls.removeListener("expand-widget",this.onExpanded),this.controls.removeListener("collapse-widget",this.onCollapsed)),this.controls=t,this.controls&&(this.controller.setAriaControls(this.controls.id),this.controls.addListener("expand-widget",this.onExpanded),this.controls.addListener("collapse-widget",this.onCollapsed))}getControlled(){return this.controls}expandControlled(t){this.controller.isDisabled()||this.controls?.expand({controller:this.controller,sourceEvent:void 0,overrideFocusVisible:t?.overrideFocusVisible})}},zT=class extends Vu{constructor(t,e){super(t),ye(this.elem,"role",e),this.setEnabled(!0),this.addListener("keydown",({sourceEvent:i})=>{lT(i)&&(i.preventDefault(),this.htmlListener?.dispatch("click",this,{type:"click",device:"keyboard",sourceEvent:i}))})}lazyControllerImpl(){return this.controllerImpl??(this.controllerImpl=new iq(this,()=>this.internalListener)),this.controllerImpl}destructor(){this.controllerImpl?.destroy()}setEnabled(t){ye(this.elem,"aria-disabled",!t)}setControlled(t){return this.lazyControllerImpl().setControlled(t)}getControlled(){return this.lazyControllerImpl().getControlled()}expandControlled(t){return this.lazyControllerImpl().expandControlled(t)}addListener(t,e){return super.addListener(t,(i,n)=>{(t==="click"||t==="dblclick")&&this.isDisabled()||e(i,n)})}},_D=class extends zT{constructor(){super($t("button"))}},IG=class extends Vu{constructor(){super($t("div")),ye(this.elem,"role","group")}destructor(){}},BT=class extends Vu{constructor(t,e){super($t("div")),this.focusedChildIndex=0,this.onChildFocus=(i,n)=>{const s=this.children[this.focusedChildIndex];this.focusedChildIndex=n.index,s?.setTabIndex(-1),n.setTabIndex(0)},this.onChildKeyDown=(i,n)=>{const s=this.orientation,a=ff(this.elem);let o,r;s==="both"?(o=mb("horizontal",a),r=mb("vertical")):(o=mb(s,a),r=void 0);let l=-1;if(Nx(i.sourceEvent)){const c=i.sourceEvent.key;c===o.nextKey||c===r?.nextKey?l=n.index+1:(c===o.prevKey||c===r?.prevKey)&&(l=n.index-1)}this.children[l]?.focus()},ye(this.elem,"role",e),this.orientation=t}get orientation(){return Jd(this.elem,"aria-orientation")??"both"}set orientation(t){ye(this.elem,"aria-orientation",t==="both"?void 0:t)}focus(){this.children[this.focusedChildIndex]?.focus()}clear(){this.focusedChildIndex=0;for(const t of this.children)this.removeChildListeners(t),t.parent=void 0;this.elem.textContent="",this.children.length=0}addChildListeners(t){t.addListener("focus",this.onChildFocus),t.addListener("keydown",this.onChildKeyDown)}removeChildListeners(t){t.removeListener("focus",this.onChildFocus),t.removeListener("keydown",this.onChildKeyDown)}onChildAdded(t){this.addChildListeners(t),t.setTabIndex(this.children.length===1?0:-1)}onChildRemoved(t){this.removeChildListeners(t);const{focusedChildIndex:e,children:i}=this,n=e===t.index;for(let s=0;sthis.getElement().step=e.attributeValue,n=()=>this.getElement().step=this._step.attributeValue;this._keyboardStep={step:e,onKeyDown:i,onKeyUp:n,onBlur:n},this.addListener("keydown",this._keyboardStep.onKeyDown),this.addListener("keyup",this._keyboardStep.onKeyUp),this.addListener("blur",this._keyboardStep.onBlur)}}get orientation(){return Jd(this.elem,"aria-orientation")??"both"}set orientation(e){ye(this.elem,"aria-orientation",e==="both"?void 0:e),Qy.registerDefaultPreventers(this,e)}destructor(){}clampValueRatio(e,i){const n=this.getValueRatio(),s=Nt(e,n,i);return s!==n&&this.setValueRatio(s),s}setValueRatio(e,i){const{divider:n}=this.step,s=Math.round(e*1e4)/n,{ariaValueText:a=lj(s/n)}=i??{},o=this.getElement();o.value=`${s}`,o.ariaValueText=a,o.ariaValueNow=`${s}`}getValueRatio(){return this.getElement().valueAsNumber/this.step.divider}static registerDefaultPreventers(e,i){i==="both"?e.removeListener("keydown",Qy.onKeyDown):e.addListener("keydown",Qy.onKeyDown)}static onKeyDown(e,i){let n=[];const{orientation:s}=i;s==="horizontal"?n=["ArrowUp","ArrowDown"]:s==="vertical"&&(n=["ArrowLeft","ArrowRight"]),n.includes(e.sourceEvent.code)&&e.sourceEvent.preventDefault()}};VT.STEP_ONE={attributeValue:"1",divider:1};VT.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var _T=VT,sq=class extends _D{constructor(){super(),ye(this.elem,"role","switch"),this.setChecked(!1)}setChecked(t){ye(this.elem,"aria-checked",t)}},FD=class extends BT{constructor(t="horizontal"){super(t,"toolbar")}destructor(){}};function Og(t,e){return e.params?.type===t}function aq(t){if(t==="button")return new _D;if(t==="slider")return new _T;if(t==="toolbar")return new FD;if(t==="group")return new IG;if(t==="list")return new nq;if(t==="region")return new Nf($t("div"));if(t==="text")return new eq;if(t==="listswitch")return new sq;throw new Error("AG Charts - error allocating meta")}function tB(t){const e={params:t,result:void 0};return e.result=aq(e.params.type),e}var oq=class{constructor(t,e,i){this.eventsHub=t,this.localeManager=e,this.domManager=i,this.cleanup=new qe}destroy(){this.cleanup.flush()}addLocalisation(t){t(),this.cleanup.register(this.eventsHub.on("locale:change",t))}createProxyContainer(t){const e=tB(t),{params:i,result:n}=e,s=n.getElement();this.domManager.addChild("canvas-proxy",i.domManagerId,s),s.classList.add(...i.classList,"ag-charts-proxy-container"),s.role=i.role??i.type,Og("toolbar",e)&&(e.result.orientation=e.params.orientation);const{ariaLabel:a}=i;return a&&this.addLocalisation(()=>{s.ariaLabel=this.localeManager.t(a.id,a.params)}),n}createProxyElement(t){const e=tB(t);if(Og("button",e)){const{params:i,result:n}=e,s=n.getElement();if(this.initInteract(i,n),typeof i.textContent=="string")s.textContent=i.textContent;else{const{textContent:a}=i;this.addLocalisation(()=>{s.textContent=this.localeManager.t(a.id,a.params)})}this.setParent(e.params,e.result)}if(Og("slider",e)){const{params:i,result:n}=e,s=n.getElement();this.initInteract(i,n),s.type="range",s.role=i.role??"presentation",s.style.margin="0px",this.addLocalisation(()=>{s.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),this.setParent(e.params,e.result)}if(Og("text",e)){const{params:i,result:n}=e;this.initElement(i,n),this.setParent(e.params,e.result)}if(Og("listswitch",e)){const{params:i,result:n}=e;this.initInteract(i,n),n.setTextContent(i.textContent),n.setChecked(i.ariaChecked),n.setAriaDescribedBy(i.ariaDescribedBy),this.setParent(e.params,e.result)}if(Og("region",e)){const{params:i,result:n}=e,s=n.getElement();this.initInteract(i,n),s.role=i.role??"region",this.setParent(e.params,e.result)}return e.result}initElement(t,e){const i=e.getElement();return Cr(i,"cursor",t.cursor),i.classList.toggle("ag-charts-proxy-elem",!0),t.classList?.length&&i.classList.add(...t.classList),i}initInteract(t,e){const{tabIndex:i,domIndex:n}=t,s=this.initElement(t,e);i!==void 0&&(s.tabIndex=i),n!==void 0&&(e.domIndex=n)}setParent(t,e){if("parent"in t)t.parent?.addChild(e);else{const i={where:t.where,query:".ag-charts-series-area"};this.domManager.addChild("canvas-proxy",t.domManagerId,e.getElement(),i),e.destroyListener=()=>{this.domManager.removeChild("canvas-proxy",t.domManagerId)}}}},rq=/\$\{(\w+)}(?:\[(\w+)])?/gi,CC={number:new Intl.NumberFormat("en-US"),percent:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}),percent0to2dp:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2}),date:new Intl.DateTimeFormat("en-US",{dateStyle:"full"}),time:new Intl.DateTimeFormat("en-US",{timeStyle:"full"}),datetime:new Intl.DateTimeFormat("en-US",{dateStyle:"full",timeStyle:"full"})},lq=({defaultValue:t,variables:e})=>t?.replaceAll(rq,(i,n,s)=>{const a=e[n],o=s==null?null:CC[s];return s!=null&&o==null&&pt.warnOnce(`Format style [${s}] is not supported`),o!=null?o.format(a):typeof a=="number"?CC.number.format(a):a instanceof Date?CC.datetime.format(a):String(a)}),cq=class{constructor(t){this.eventsHub=t,this.localeText=void 0,this.getLocaleText=void 0}setLocaleText(t){this.localeText!==t&&(this.localeText=t,this.eventsHub.emit("locale:change",null))}setLocaleTextFormatter(t){this.getLocaleText=t,this.getLocaleText!==t&&(this.getLocaleText=t,this.eventsHub.emit("locale:change",null))}t(t,e={}){const{localeText:i=U9,getLocaleText:n}=this,s=i[t];return String(n?.({key:t,defaultValue:s,variables:e})??lq({defaultValue:s,variables:e})??t)}},hq=class{constructor(t){this.width=600,this.height=300,this.direction="ltr";const{width:e,height:i,willReadFrequently:n=!1}=t;this.element=t.canvasElement,this.pixelRatio=t.pixelRatio,this.element.style.display="block",this.element.style.width=(e??this.width)+"px",this.element.style.height=(i??this.height)+"px",this.element.width=Math.round((e??this.width)*this.pixelRatio),this.element.height=Math.round((i??this.height)*this.pixelRatio),this.context=this.element.getContext("2d",{willReadFrequently:n}),this.context.direction=this.direction,this.resize(e??0,i??0,this.pixelRatio),lG(this.context)}drawImage(t,e=0,i=0){return t.drawImage(this.context.canvas,e,i)}toDataURL(t){return this.element.toDataURL(t)}resize(t,e,i){if(!(t>0&&e>0))return;const{element:n,context:s}=this;n.width=Math.round(t*i),n.height=Math.round(e*i),s.setTransform(i,0,0,i,0,0),n.style.width=t+"px",n.style.height=e+"px",this.width=t,this.height=e,this.pixelRatio=i}setDirection(t){this.direction=t?"rtl":"ltr",this.element.dir=this.direction,this.context.direction=this.direction}clear(){rG(this)}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}reset(){this.context.reset(),this.context.verifyDepthZero?.(),this.context.direction=this.direction}},uq=class extends cr{constructor(){super(...arguments),this.cache=new Map,this.imageLoadingCount=0}loadImage(t,e){const i=this.cache.get(t);if(i?.image)return i.image;if(i!=null&&e){i.nodes.add(e);return}if(!e)return;const n={image:void 0,nodes:new Set([e])},s=UH(),a=new s;return this.imageLoadingCount++,a.onload=()=>{n.image=a;for(const o of n.nodes)o.markDirty();n.nodes.clear(),this.imageLoadingCount--,this.emit("image-loaded",{uri:t})},a.onerror=()=>{this.imageLoadingCount--,n.nodes.clear(),this.emit("image-error",{uri:t})},a.src=t,this.cache.set(t,n),n.image}waitingToLoad(){return this.imageLoadingCount>0}destroy(){for(const t of this.cache.values())t.nodes.clear();this.cache.clear()}},dq=class{constructor(t){this.canvas=t,this.debug=Gt.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(t,e,i){this.canvas.resize(t,e,i);for(const{canvas:n}of this.layersMap.values())n.resize(t,e,i)}addLayer(t){const{width:e,height:i,pixelRatio:n}=this.canvas,{name:s}=t,a=new NT({width:e,height:i,pixelRatio:n});return this.layersMap.set(a,{id:this.nextLayerId++,name:s,canvas:a}),this.debug("Scene.addLayer() - layers",this.layersMap),a}removeLayer(t){this.layersMap.has(t)&&(this.layersMap.delete(t),t.destroy(),this.debug("Scene.removeLayer() - layers",this.layersMap))}clear(){for(const t of this.layersMap.values())t.canvas.destroy();this.layersMap.clear()}},HD=class extends cr{constructor(t){super(),this.debug=Gt.create(!0,"scene"),this.id=Nn(this),this.imageLoader=new uq,this.root=null,this.pendingSize=null,this.isDirty=!1,this.direction="ltr",this.cleanup=new qe,this.updateDebugFlags(),this.canvas=new hq(t),this.layersManager=new dq(this.canvas),this.cleanup.register(this.imageLoader.on("image-loaded",()=>{this.emit("scene-changed",{})}),this.imageLoader.on("image-error",({uri:e})=>{pt.warnOnce(`Unable to load image ${e}`)}))}waitingForUpdate(){return this.imageLoader?.waitingToLoad()??!1}get width(){return this.pendingSize?.[0]??this.canvas.width}get height(){return this.pendingSize?.[1]??this.canvas.height}get pixelRatio(){return this.pendingSize?.[2]??this.canvas.pixelRatio}get isRtl(){return this.direction==="rtl"}setContainer(t){const{element:e}=this.canvas;return e.remove(),t.appendChild(e),this}setRoot(t){return this.root===t?this:(this.isDirty=!0,this.root?.setScene(),this.root=t,t&&(t.visible=!0,t.setScene(this)),this)}updateDebugFlags(){Gt.inDevelopmentMode(()=>Oc._debugEnabled=!0)}clearCanvas(){this.canvas.clear()}attachNode(t){return this.appendChild(t),()=>t.remove()}appendChild(t){return this.root?.appendChild(t),this}removeChild(t){return t.remove(),this}download(t,e){Ij(this.canvas.toDataURL(e),t?.trim()??"image")}getDataURL(t){return this.canvas.toDataURL(t)}resize(t,e,i){return t=Math.round(t),e=Math.round(e),i??(i=this.pixelRatio),t>0&&e>0&&(t!==this.width||e!==this.height||i!==this.pixelRatio)?(this.pendingSize=[t,e,i],this.isDirty=!0,!0):!1}setDirection(t){this.direction=t?"rtl":"ltr",this.canvas.setDirection(t)}updateBaseFont(){const t=this.root?.resolveFont();t!=null&&t!==this._baseFont&&(this._baseFont=t,this.canvas.context.font=t)}applyPendingResize(){return this.pendingSize?(this.layersManager.resize(...this.pendingSize),this.pendingSize=null,this._baseFont!=null&&(this.canvas.context.font=this._baseFont),!0):!1}render(t){const{debugSplitTimes:e={start:performance.now()},extraDebugStats:i,seriesRect:n,debugColors:s}=t??{},{canvas:a,canvas:{context:o}={},root:r,width:l,height:c,pixelRatio:u}=this;if(!o)return;const d=Gt.check("scene:stats","scene:stats:verbose");d&&this.ensureDebugStatsRegistration();const g=performance.now(),f=this.applyPendingResize();if(r&&!r.visible){this.isDirty=!1;return}let y;if(r instanceof ee&&(y=r.dirty),r!=null&&y===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:_S(r,"console")}),d&&Kz(this.layersManager,e,o,void 0,i,n,s);return}const x={ctx:o,direction:this.direction,width:l,height:c,devicePixelRatio:u,debugNodes:{}};Gt.check("scene:stats:verbose")&&(x.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),vZ(x);let S=!1;if((y!==!1||f)&&(S=!0,a.clear()),r&&Gt.check("scene:dirtyTree")){const{dirtyTree:D,paths:A}=bG(r);Gt.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:D,paths:A})}if(r&&S){if(r.visible&&r.preRender(x),this.debug.check()){const D=_S(r,"console");this.debug("Scene.render() - before",{canvasCleared:S,tree:D})}if(r.visible)try{o.save(),r.render(x),o.restore()}catch(D){throw this.canvas.reset(),D}}e["✍️"]=performance.now()-g,o.verifyDepthZero?.(),this.isDirty=!1,d&&Kz(this.layersManager,e,o,x.stats,i,n,s),SZ(o,x.debugNodes),r&&this.debug.check()&&this.debug("Scene.render() - after",{tree:_S(r,"console"),canvasCleared:S})}ensureDebugStatsRegistration(){if(this.releaseDebugStats)return;const t=yZ(),e=()=>{t(),this.releaseDebugStats=void 0};this.releaseDebugStats=e,this.cleanup.register(e)}toSVG(){const{root:t,width:e,height:i}=this;if(t!=null)return Oc.toSVG(t,e,i)}strip(){const{context:t,pixelRatio:e}=this.canvas;t.setTransform(e,0,0,e,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1,this.clear()}destroy(){this.strip(),this.canvas.destroy(),this.imageLoader.destroy(),this.cleanup.flush(),xG(),Object.assign(this,{canvas:void 0})}};HD.className="Scene";var pq=class{constructor(t,e,i){this.eventsHub=t,this.annotationRoot=e,this.fireChartEvent=i,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(t){return t==null||qt(t)}restoreMemento(t,e,i){this.annotations=this.cleanData(i??[]).map(n=>{const s=this.getAnnotationTypeStyles(n.type);return Et(n,s)}),this.eventsHub.emit("annotations:restore",{annotations:this.annotations})}updateData(t){this.annotations=this.cleanData(t??[])}fireChangedEvent(){this.fireChartEvent({type:"annotations",annotations:le([...this.annotations])})}attachNode(t){return this.annotationRoot.append(t),()=>(t.remove(),this)}setAnnotationStyles(t){this.styles=t}getAnnotationTypeStyles(t){return this.styles?.[t]}cleanData(t){for(const e of t)"textAlign"in e&&delete e.textAlign;return t}},gq=class{constructor(t,e){this.eventsHub=t,this.sceneRoot=e,this.axes=new Map,this.axisGridGroup=new ee({name:"Axes-Grids",zIndex:pe.AXIS_GRID}),this.axisGroup=new ee({name:"Axes",zIndex:pe.AXIS}),this.axisLabelGroup=new ee({name:"Axes-Labels",zIndex:pe.SERIES_LABEL}),this.axisCrosslineRangeGroup=new ee({name:"Axes-Crosslines-Range",zIndex:pe.SERIES_CROSSLINE_RANGE}),this.axisCrosslineLineGroup=new ee({name:"Axes-Crosslines-Line",zIndex:pe.SERIES_CROSSLINE_LINE}),this.axisCrosslineLabelGroup=new ee({name:"Axes-Crosslines-Label",zIndex:pe.SERIES_LABEL}),this.sceneRoot.appendChild(this.axisGroup),this.sceneRoot.appendChild(this.axisGridGroup),this.sceneRoot.appendChild(this.axisLabelGroup),this.sceneRoot.appendChild(this.axisCrosslineRangeGroup),this.sceneRoot.appendChild(this.axisCrosslineLineGroup),this.sceneRoot.appendChild(this.axisCrosslineLabelGroup)}updateAxes(t,e){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const n of t)e.includes(n)||(n.detachAxis(i),n.destroy());for(const n of e)t?.includes(n)||n.attachAxis(i);this.axes.clear();for(const n of e){const s=n.createAxisContext();this.axes.has(s.direction)?this.axes.get(s.direction)?.push(s):this.axes.set(s.direction,[s])}this.eventsHub.emit("axis:change",null)}getAxisIdContext(t){for(const[,e]of this.axes)for(const i of e)if(i.axisId===t)return i}getAxisContext(t){return this.axes.get(t)??[]}destroy(){this.axes.clear(),this.axisGroup.remove(),this.axisGridGroup.remove()}},FT=class{constructor(t,e,i){this.eventsHub=t,this.caller=e,this.animationManager=i,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.isLoadingData=!1,this.freshRequests=[],this.requestCounter=0,this.pendingData=void 0,this.debug=Gt.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(t){typeof t=="function"&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=t,this.isLoadingInitialData=!0,this.animationManager.skip(),this.eventsHub.emit("data:source-change",null))}clearCallback(){this.dataSourceCallback=void 0}load(t){const{pendingData:e}=this;if(e!=null&&(e.params.windowStart==null&&e.params.windowEnd==null||e.params.windowStart?.valueOf()===t.windowStart?.valueOf()&&e.params.windowEnd?.valueOf()===t.windowEnd?.valueOf())){const i=this.requestCounter++;this.isLoadingInitialData=!1,this.dispatch(i,e.data);return}this.isLoadingData=!0,this.throttledFetch(t)}isLazy(){return this.dataSourceCallback!=null}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}async getData(){const{latestRequest:t}=this;if(!t)return;const{params:e,fetchRequest:i}=t,n=await i;return{params:e,data:n}}restoreData(t){this.pendingData=t}createThrottledFetch(t){return Qw(e=>this.fetch(e).catch(i=>pt.error("callback failed",i)),t,{leading:!1,trailing:!0})}createThrottledDispatch(t){return Qw((e,i)=>this.dispatch(e,i),t,{leading:!0,trailing:!0})}dispatch(t,e){this.debug(`DataService - dispatching 'data-load' | ${t}`),this.eventsHub.emit("data:load",{data:e})}async fetch(t){"context"in this.caller&&(t.context=this.caller.context);const e=Promise.resolve().then(async()=>{if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const i=performance.now(),n=this.requestCounter++;this.debug(`DataService - requesting | ${n}`);let s;try{s=await this.dataSourceCallback(t),this.debug(`DataService - response | ${performance.now()-i}ms | ${n}`)}catch(o){this.debug(`DataService - request failed | ${n}`),pt.errorOnce(`DataService - request failed | [${o}]`)}this.isLoadingInitialData=!1;const a=this.freshRequests.indexOf(e);return a===-1||this.dispatchOnlyLatest&&a!==this.freshRequests.length-1?(this.debug(`DataService - discarding stale request | ${n}`),s):(this.freshRequests=this.freshRequests.slice(a+1),this.freshRequests.length===0&&(this.isLoadingData=!1),Array.isArray(s)?this.throttledDispatch(n,s):this.eventsHub.emit("data:error",null),s)});this.latestRequest={params:t,fetchRequest:e},this.freshRequests.push(e),await e}};T([Pe({newValue(t){this.throttledDispatch=this.createThrottledDispatch(t)}})],FT.prototype,"dispatchThrottle",2);T([Pe({newValue(t){this.throttledFetch=this.createThrottledFetch(t)}})],FT.prototype,"requestThrottle",2);var fq=class{constructor(t,e){this.domManager=t,this.eventsHub=e,this.observers=[]}updateFonts(t){if(!(!t||t.size===0)){this.loadFonts(t);for(const e of t)this.observeFontStatus(e)}}destroy(){for(const t of this.observers)t.disconnect();this.observers=[]}loadFonts(t){const e=Array.from(t).map(a=>encodeURIComponent(a)),i=":wght@100;200;300;400;500;600;700;800;900",n=`${i}&family=`,s=`@import url('https://fonts.googleapis.com/css2?family=${e.join(n)}${i}&display=swap'); +`;this.domManager.addStyles(`google-font-${e.join("-")}`,s)}observeFontStatus(t){const e=WH();if(e===void 0)return;const n=this.domManager.getDocument().createElement("div",{position:"absolute",top:"0",margin:"0",padding:"0",overflow:"hidden",visibility:"hidden",width:"auto",maxWidth:"none",fontSynthesis:"none",fontFamily:t,fontSize:"16px",whiteSpace:"nowrap"});n.textContent="UVWxyz",this.domManager.addChild("canvas-container",`font-check-${encodeURIComponent(t)}`,n);const s=new e(a=>{const o=a?.at(0)?.contentBoxSize.at(0)?.inlineSize;o!=null&&o>0&&(Ve.clear(),this.eventsHub.emit("font:load",null))});s.observe(n),this.observers.push(s)}},kG=class{constructor(){this.registeredListeners=new Map}addListener(t,e){const i={symbol:Symbol(t),handler:e};return this.registeredListeners.has(t)?this.registeredListeners.get(t).push(i):this.registeredListeners.set(t,[i]),()=>this.removeListener(i.symbol)}removeListener(t){for(const[e,i]of this.registeredListeners.entries()){const n=i.findIndex(s=>s.symbol===t);if(n>=0){i.splice(n,1),i.length===0&&this.registeredListeners.delete(e);break}}}dispatch(t,...e){for(const i of this.getListenersByType(t))try{i.handler(...e)}catch(n){pt.errorOnce(n)}}getListenersByType(t){return this.registeredListeners.get(t)??[]}destroy(){this.registeredListeners.clear()}},il={millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e",month:"%b",year:"%Y"},mq={millisecond:"%Y %b %e %H:%M:%S.%L",second:"%Y %b %e %H:%M:%S",minute:"%Y %b %e %H:%M",hour:"%Y %b %e %H:%M",day:"%Y %b %e",month:"%Y %b",year:"%Y"},Rs={year:0,month:1,day:2,hour:3,minute:4,second:5,millisecond:6},yq=/%[-_0]?L/,bq=/%[-_0]?S/,xq=/%[-_0]?M/,vq=/%[-_0]?[HI]/,Sq=/^%[-_0]?[de]$/,Mq=/^%[-_0]?[Bbm]$/,Dq=/^%[-_0]?[Yy]$/;function Aq(t,e,i){if(typeof t=="string")return t;t??(t=il);const{millisecond:n=il.millisecond,second:s=il.second,minute:a=il.minute,hour:o=il.hour,day:r=il.day,month:l=il.month,year:c=il.year}=t,u=Rs[e],d=mq[e],g=i?Rs[i]:-1;if(g=Rs.year&&!Dq.test(c)||g=Rs.month&&!Mq.test(l)||g=Rs.day&&!Sq.test(r))return d;let f;switch(e){case"year":return c;case"month":return g=Rs.hour&&!vq.test(f)||u>=Rs.minute&&!xq.test(f)||u>=Rs.second&&!bq.test(f)||u>=Rs.millisecond&&!yq.test(f))return d;let y;return g{const o=GS.mergeSpecifiers(e,i)??il;return GS.getFormatter("date",o,n,s,{truncateDate:a})}),this.formatter=void 0}static mergeSpecifiers(...e){let i;for(const n of e)Ie(n)&&Ie(i)?i={...i,...n}:i=n;return i}static getFormatter(e,i,n,s="long",{truncateDate:a}={}){if(Ie(i)){if(e!=="date"){pt.warn("Date formatter configuration is not supported for non-date types.");return}n??(n="millisecond");const o=s==="component"?i?.[n]??il[n]:Aq(i,n,a);return kf(o)}switch(e){case"number":{const o=iD(i);return o==null?void 0:C1(o)}case"date":return kf(i);case"category":return o=>i.replace("%s",String(o))}}setFormatter(e){this.formatter!==e&&(this.formatter=e,this.formats.clear(),this.dateFormatter.reset(),this.dispatch("format-changed"))}format(e,i,{specifier:n,truncateDate:s,allowNull:a}={}){if(i.value==null&&!a)return;const{formatter:o}=this;if(o==null)return;if(typeof o=="function"){const u=e(o,i);return u==null?void 0:String(u)}const r=o[i.property];if(r==null)return;if(typeof r=="function"){const u=e(r,i);return u==null?u:bi(u)}else if(i.type==="date"){const{unit:u,style:d}=i;return this.dateFormatter(r,n,u,d,s)?.(i.value)}const l=n??r;if(typeof l!="string")return;let c=this.formats.get(l);return c==null&&(c=GS.getFormatter(i.type,l),this.formats.set(l,c)),c?.(i.value,i.type==="number"?i.fractionDigits:void 0)}defaultFormat(e,{specifier:i,truncateDate:n}={}){const{formatter:s}=this,a=typeof s=="function"?void 0:s?.[e.property];switch(e.type){case"date":{const{unit:o,style:r}=e,l=a!=null&&typeof a!="function"?a:void 0;return this.dateFormatter(l,i,o,r,n)?.(e.value)??String(e.value)}case"number":return Or(e.value,e.fractionDigits);case"category":return e.value==null?"":Array.isArray(e.value)?e.value.join(" - "):typeof e.value=="string"?e.value:typeof e.value=="number"?Or(e.value):String(e.value)}}},CG={activeItem:{type:ht(fx()("series-node","legend")),seriesId:K,itemId:ht(Xt(K,X))},frozen:J},Fx={mode:Mt(dt("integrated","standalone")),withinStudio:Mt(J),container:A1,context:()=>!0,theme:jt,series:wl,annotations:jt,navigator:jt,scrollbar:jt,initialState:{active:CG,chartType:K,annotations:jt,legend:Xi({visible:J,seriesId:K,itemId:K,legendItemName:K},"legend state array"),zoom:jt}},Iq={...Zt,...Fx,axes:Nu,data:wl,dataIdKey:K},kq={...Zt,...Fx,axes:Nu,data:wl,dataIdKey:K},Cq={...Zt,...Fx,data:wl,dataIdKey:K,topology:dj},wq={...Zt,...Fx,data:wl,dataIdKey:K},wG=(t=>(t[t.Default=64]="Default",t[t.ZoomDrag=32]="ZoomDrag",t[t.Annotations=16]="Annotations",t[t.ContextMenu=8]="ContextMenu",t[t.Animation=4]="Animation",t[t.AnnotationsSelected=2]="AnnotationsSelected",t[t.Frozen=1]="Frozen",t[t.Hoverable=82]="Hoverable",t[t.Clickable=83]="Clickable",t[t.Focusable=69]="Focusable",t[t.Keyable=87]="Keyable",t[t.ContextMenuable=72]="ContextMenuable",t[t.AnnotationsMoveable=18]="AnnotationsMoveable",t[t.AnnotationsDraggable=114]="AnnotationsDraggable",t[t.ZoomDraggable=101]="ZoomDraggable",t[t.ZoomClickable=69]="ZoomClickable",t[t.ZoomWheelable=119]="ZoomWheelable",t[t.All=126]="All",t))(wG||{}),NG=class{constructor(){this.stateQueue=68}pushState(t){this.stateQueue|=t}popState(t){this.stateQueue&=~t}isState(t){return!!(this.stateQueue&-this.stateQueue&t)}},Nq=class{constructor(t,e,i,n,s){this.chartService=t,this.eventsHub=e,this.interactionManager=n,this.fireEvent=s,this.mementoOriginatorKey="active",this.updateable=!0,this.didLayout=!1,this.pendingMemento=void 0;const a=i.addListener("pre-scene-render",()=>{this.didLayout=!0;const{pendingMemento:o}=this;o&&(this.restoreMemento(o.version,o.mementoVersion,o.memento),this.pendingMemento=void 0),a()})}isFrozen(){return this.interactionManager.isState(1)}clear(){return this.update(void 0,void 0)}update(t,e){return this.performUpdate("user-interaction",t,e,!1)}performUpdate(t,e,i,n){if(!this.updateable)return!1;const s=this.currentItem;let a=!1;if(n||!ks(s,e)){const{frozen:o,activeItem:r}=this.createMementoWithItem(e),{datum:l}=i??{};this.fireEvent({type:"activeChange",source:t,frozen:o,activeItem:r,datum:l,dataIdKey:i?.series.data?.dataIdKey,preventDefault:()=>{a=!0}})}return a||(this.currentItem=e,this.eventsHub.emit("active:update",e)),a}createMemento(){return this.createMementoWithItem(this.currentItem)}createMementoWithItem(t){const e=this.isFrozen();switch(t?.type){case"series-node":case"legend":{const{type:i,seriesId:n,itemId:s}=t;return{frozen:e,activeItem:{type:i,seriesId:n,itemId:s}}}default:return t?.type,{frozen:e}}}guardMemento(t,e){if(t==null)return!0;const i=ts(t,Fx.initialState.active);return e.push(...i.invalid.map(n=>n.toString())),i.invalid.length===0}restoreMemento(t,e,i){if(!this.didLayout){this.pendingMemento={version:t,mementoVersion:e,memento:i};return}this.updateable=!1;const[n,s]=this.performRestoration(i?.activeItem);this.updateable=!0;const a=this.isFrozen(),o=i?.frozen,r=o===void 0?!1:a!==o;o===!0?this.interactionManager.pushState(1):o===!1&&this.interactionManager.popState(1),this.performUpdate("state-change",n,s,r)}performRestoration(t){let e=!1;const i=()=>e=!0;let n;const s=r=>n=r,a=this.pendingMemento!==void 0,o=this.chartService.id;return this.eventsHub.emit("active:load-memento",{initialState:a,chartId:o,activeItem:t,reject:i,setDatum:s}),e?[void 0,void 0]:[t,n]}};function Tq(t,e){return i=>Number(t)*(1-i)+Number(e)*i}function TG(t,e){if(typeof t=="string")try{t=se.fromString(t)}catch{t=se.fromArray([0,0,0])}if(typeof e=="string")try{e=se.fromString(e)}catch{e=se.fromArray([0,0,0])}return i=>se.mix(t,e,i).toRgbaString()}var mN=.2,Ey=["initial","remove","update","add","trailing","end","none"],Zb={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:mN,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1+mN,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}};function Lq(t){return t.every(e=>e instanceof Oc)}function HT(t){return Lq(t)?{nodes:t,selections:[]}:{nodes:[],selections:t}}function yN(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((i,n)=>yN(i,e[n])):MM(t)&&MM(e)?t.equals(e):Ie(t)&&Ie(e)?E1(t,e,yN):!1}var Oq=class{constructor(e){this.isComplete=!1,this.elapsed=0,this.iteration=0,this.isPlaying=!1,this.isReverse=!1,this.id=e.id,this.groupId=e.groupId,this.autoplay=e.autoplay??!0,this.ease=e.ease??iG,this.phase=e.phase;const i=e.duration??Zb[this.phase].animationDuration;this.duration=i*e.defaultDuration,this.delay=(e.delay??0)*e.defaultDuration,this.onComplete=e.onComplete,this.onPlay=e.onPlay,this.onStop=e.onStop,this.onUpdate=e.onUpdate,this.interpolate=this.createInterpolator(e.from,e.to),this.from=e.from,e.skip===!0&&(this.onUpdate?.(e.to,!1,this),this.onStop?.(this),this.onComplete?.(this),this.isComplete=!0),e.collapsable!==!1&&(this.duration=this.checkCollapse(e,this.duration))}checkCollapse(e,i){return yN(e.from,e.to)?0:i}play(e=!1){this.isPlaying||this.isComplete||(this.isPlaying=!0,this.onPlay?.(this),this.autoplay&&(this.autoplay=!1,e&&this.onUpdate?.(this.from,!0,this)))}stop(){this.isPlaying=!1,this.isComplete||(this.isComplete=!0,this.onStop?.(this))}update(e){if(this.isComplete)return e;!this.isPlaying&&this.autoplay&&this.play(!0);const i=this.elapsed;if(this.elapsed+=e,this.delay>this.elapsed)return 0;const n=this.interpolate(this.isReverse?1-this.delta:this.delta);this.onUpdate?.(n,!1,this);const s=this.delay+this.duration;return this.elapsed>=s?(this.stop(),this.isComplete=!0,this.onComplete?.(this),e-(s-i)):0}get delta(){return this.ease(Nt(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(e,i){if(typeof i!="object"||MM(i))return this.interpolateValue(e,i);if(Array.isArray(i)){const s=[];for(let a=0;a{const o=[];for(const r of s)o.push(r(a));return o}}const n=[];for(const s of Object.keys(i)){const a=this.createInterpolator(e[s],i[s]);a!=null&&n.push([s,a])}return s=>{const a={};for(const[o,r]of n)a[o]=r(s);return a}}interpolateValue(e,i){if(!(e==null||i==null)){if(MM(e))return n=>e[LD](i,n);try{switch(typeof e){case"number":return Tq(e,i);case"string":return TG(e,i);case"boolean":if(e===i)return()=>e;break;case"object":return()=>e;default:throw new Error(`Unable to interpolate values: ${e}, ${i}`)}}catch{}throw new Error(`Unable to interpolate values: ${e}, ${i}`)}}};function Eq(t,e,i,n){return e=t.endIndex)return!1;if(e<=t.startIndex&&n>=t.endIndex)t.startIndex=e,t.endIndex=e;else if(e<=t.startIndex){const s=n-t.startIndex,a=t.endIndex-t.startIndex;t.startIndex=e,t.endIndex=t.startIndex+Math.max(0,a-s)}else n>=t.endIndex?t.endIndex=Math.max(t.startIndex,e):t.endIndex=Math.max(t.startIndex,t.endIndex-i);return!0}function LG(t,e){const i=Math.ceil(t/1e3);return Math.max(e,i)}function OG(t,e){return Math.max(1,Math.ceil(t/e))}function Pq(t){return t.filter(e=>e.endIndex>e.startIndex)}function zq(t,e,i){if(!e.enableBanding||t0&&t.handleInsertion(i.index,i.insertCount),i.deleteCount>0&&t.handleRemoval(i.index,i.deleteCount)}function Vq(t,e){for(const i of e)t.handleInsertion(i,0)}function _q(t,e){Bq(t,e.spliceOps),e.updatedIndices.size>0&&Vq(t,e.updatedIndices)}var Fq=1e3,Hq=10,EG=class{constructor(t={}){this.bands=[],this.dataSize=0,this.config={minDataSizeForBanding:t.minDataSizeForBanding??Fq,targetBandCount:t.targetBandCount??Hq,maxBandSize:t.maxBandSize??1/0,enableBanding:t.enableBanding??!0}}applyIndexMap(t){_q(this,t)}initializeBands(t){this.dataSize=Math.max(0,t),this.bands=zq(this.dataSize,this.config,(e,i)=>this.createBand(e,i))}getBandCount(){return this.bands.length}handleInsertion(t,e){if(this.dataSize+=e,this.bands.length===0){this.initializeBands(this.dataSize);return}const i=LG(this.dataSize,this.config.targetBandCount),n=OG(this.dataSize,i),s=Math.ceil(n*1.1);for(let a=0;a0){o.endIndex-o.startIndex>=n?this.bands.push(this.createBand(t,t+e)):(o.endIndex+=e,o.isDirty=!0);break}Eq(o,t,e,r)&&(o.isDirty=!0,e>0&&ts&&this.splitBand(a,n))}}handleRemoval(t,e){if(e<=0||this.bands.length===0)return;const i=Math.min(e,Math.max(0,this.dataSize-t));if(!(i<=0)){this.dataSize=Math.max(0,this.dataSize-i);for(const n of this.bands)Rq(n,t,i)&&(n.isDirty=!0);this.bands=Pq(this.bands)}}splitBand(t,e){const i=this.bands[t],n=i.endIndex-i.startIndex,s=Math.min(e,Math.floor(n/2)),a=i.startIndex+s,o=this.createBand(i.startIndex,a),r=this.createBand(a,i.endIndex);this.bands.splice(t,1,o,r)}getStats(){const t=this.bands.filter(e=>e.isDirty);return{totalBands:this.bands.length,dirtyBands:t.length,dataSize:this.dataSize}}markRangeDirty(t,e){for(const i of this.bands)ti.startIndex&&(i.isDirty=!0)}},oo=class RG{constructor(){this.domain=new Set,this.dateTimestamps=new Set,this.hasDateValues=!1,this.sortedValues=null,this.sortOrder=void 0,this.isSortedUnique=!1}static is(e){return e instanceof RG}setSortedUniqueMode(e,i){i&&(this.isSortedUnique=!0,this.sortOrder=e,this.sortedValues=[])}extend(e){this.isSortedUnique&&this.sortedValues?(this.sortedValues.push(e),e instanceof Date&&(this.hasDateValues=!0)):e instanceof Date?(this.hasDateValues=!0,this.dateTimestamps.add(e.valueOf())):this.domain.add(e)}getDomain(){if(this.isSortedUnique&&this.sortedValues){let e=!1;return this.sortedValues.filter(i=>{if(i==null)return e?!1:(e=!0,!0);if(i instanceof Date&&Number.isNaN(i.valueOf())){if(e)return!1;e=!0}return!0})}if(this.hasDateValues){const e=Array.from(this.dateTimestamps,i=>new Date(i));return this.domain.size>0?[...e,...Array.from(this.domain)]:e}return Array.from(this.domain)}isDateDomain(){return this.hasDateValues}isSortedUniqueMode(){return this.isSortedUnique}getSortOrder(){return this.sortOrder}mergeFrom(e){if(this.isSortedUnique&&e.isSortedUnique&&this.sortOrder===e.sortOrder&&this.sortOrder!==void 0&&e.sortedValues){e.hasDateValues&&(this.hasDateValues=!0),this.sortedValues??(this.sortedValues=[]),this.sortedValues.push(...e.sortedValues);return}if(this.convertToSetMode(),e.hasDateValues&&(this.hasDateValues=!0),e.isSortedUnique&&e.sortedValues)for(const i of e.sortedValues)i instanceof Date?this.dateTimestamps.add(i.valueOf()):this.domain.add(i);else{for(const i of e.dateTimestamps)this.dateTimestamps.add(i);for(const i of e.domain)this.domain.add(i)}}convertToSetMode(){if(this.isSortedUnique){if(this.sortedValues){for(const e of this.sortedValues)e instanceof Date?this.dateTimestamps.add(e.valueOf()):this.domain.add(e);this.sortedValues=null}this.isSortedUnique=!1,this.sortOrder=void 0}}},co=class PG{constructor(){this.domain=[1/0,-1/0]}static is(e){return e instanceof PG}static extendDomain(e,i=[1/0,-1/0]){for(const n of e)typeof n=="number"&&(i[0]>n&&(i[0]=n),i[1]e&&(this.domain[0]=e),this.domain[1]1&&super.splitBand(t,e)}markBandsDirty(t,e){this.markRangeDirty(t,e),this.fullDomainCache=null}markAllBandsDirty(){for(const t of this.bands)t.isDirty=!0;this.fullDomainCache=null}extendBandsFromData(t,e){const i=t.length;for(const n of this.bands){if(!n.isDirty)continue;const s=this.domainFactory();this.isDiscrete&&this.sortOrder!==void 0&&this.isUnique&&oo.is(s)&&s.setSortedUniqueMode(this.sortOrder,this.isUnique),n.subDomain=s;const{startIndex:a,endIndex:o}=n;for(let r=a;rt.isDirty)}extend(t){this.markAllBandsDirty(),this.fullDomainCache=null}canUseSortedConcatenation(){if(!this.sortOrder||!this.isUnique||!this.isDiscrete)return!1;for(const t of this.bands)if(!oo.is(t.subDomain)||!t.subDomain.isSortedUniqueMode()||t.subDomain.getSortOrder()!==this.sortOrder)return!1;return!0}concatenateSortedDomains(){const t=new oo;t.setSortedUniqueMode(this.sortOrder,this.isUnique);for(const e of this.bands)oo.is(e.subDomain)&&t.mergeFrom(e.subDomain);return t.getDomain()}deduplicateNulls(t){let e=!1;return t.filter(i=>{if(i==null)return e?!1:(e=!0,!0);if(i instanceof Date&&Number.isNaN(i.valueOf())){if(e)return!1;e=!0}return!0})}getDomain(){if(this.fullDomainCache!==null)return this.fullDomainCache;if(this.bands.length===0)return this.fullDomainCache=[],[];if(this.bands.length===1){const t=this.bands[0].subDomain.getDomain();return this.fullDomainCache=this.isDiscrete?this.deduplicateNulls(t):t,this.fullDomainCache}if(this.isDiscrete){const t=this.bands[0].subDomain;if(oo.is(t))if(this.canUseSortedConcatenation())this.fullDomainCache=this.deduplicateNulls(this.concatenateSortedDomains());else{const e=new oo;for(const i of this.bands)oo.is(i.subDomain)&&e.mergeFrom(i.subDomain);this.fullDomainCache=this.deduplicateNulls(e.getDomain())}else{const e=new Set;for(const i of this.bands)for(const n of i.subDomain.getDomain())e.add(n);this.fullDomainCache=Array.from(e)}}else{let t,e;for(const i of this.bands){const n=i.subDomain.getDomain();if(n.length===2){const[s,a]=n;(t===void 0||s!=null&&t!=null&&se)&&(e=a)}}t!==void 0&&e!==void 0?this.fullDomainCache=[t,e]:this.fullDomainCache=[]}return this.fullDomainCache}getStats(){const t=this.bands.filter(i=>i.isDirty).length,e=this.bands.reduce((i,n)=>i+(n.endIndex-n.startIndex),0);return{bandCount:this.bands.length,dirtyBandCount:t,averageBandSize:this.bands.length>0?e/this.bands.length:0,dataSize:this.dataSize}}};function zG(t,e=[0,0]){for(const i of t)typeof i=="number"&&(i<0&&(e[0]+=i),i>0&&(e[1]+=i));return e}function jq(t,e){const i=e?.visible??!0;return{id:t,type:"aggregate",matchGroupIds:e?.matchGroupId?[e?.matchGroupId]:void 0,aggregateFunction:n=>zG(n),groupAggregateFunction:(n,s=[0,0])=>(i&&(s[0]+=n?.[0]??0,s[1]+=n?.[1]??0),s)}}function Gq(t,e){return{id:t,matchGroupIds:[e],type:"aggregate",aggregateFunction:n=>co.extendDomain(n)}}function eB(t,e){const i=e?.visible??!0;return{id:t,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(n,s=[0,0])=>(i&&(s[0]+=n?.[0]??0,s[1]+=n?.[1]??0),s)}}function Uq(t,e){const i=e?.visible??!0;return{id:t,matchGroupIds:e?.matchGroupId?[e?.matchGroupId]:void 0,type:"aggregate",aggregateFunction:s=>zG(s),groupAggregateFunction:(s,a=[0,0,-1])=>(i&&(a[0]+=s?.[0]??0,a[2]++,a[1]+=s?.[1]??0),a),finalFunction:(s=[0,0,0])=>{const a=s[0]+s[1];return a>=0?[0,a/s[2]]:[a/s[2],0]}}}function iB(t,e,i){const n={id:t,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(s,a=[])=>{const o=a[1]-a[0];return e.aggregateFunction(s).map(r=>r/o)}};return e.groupAggregateFunction&&(n.groupAggregateFunction=e.groupAggregateFunction),n}function Wq(t){return()=>{let e=0;return i=>Ae(i)?(e+=t?Math.max(0,i):i,e):i}}function Kq(){return()=>{let t=0;return e=>{if(!Ae(e))return e;const i=t;return t+=e,i}}}var bN="\0__AG_NULL__\0",xN="\0__AG_UNDEFINED__\0";function BG(t){return t===null?bN:t===void 0?xN:Array.isArray(t)?"["+t.map(BG).join(",")+"]":Bt(t)?JSON.stringify(t):String(t)}function vN(t){return t.map(BG).join("-")}function _a(t){const e=t?.map(Number);return e?.every(Number.isFinite)?e:[]}function VG(t,e){return e?.get(t.id)??0}function SN(t){return"scopes"in t&&Array.isArray(t.scopes)}function nl(t,e){const i=[];for(let n=0;n{let i=e;for(const n of t)i=i[n];return i}}var Xq=class{constructor(t,e,i){this.ctx=t,this.scopeCacheManager=e,this.resolvers=i}aggregateUngroupedData(t){const e=this.ctx.aggregates.map(()=>[1/0,-1/0]);t.domain.aggValues=e;const{columns:i,dataSources:n}=t,s=Ra(n.keys()),a=t.keys.map(l=>l.get(s)),o=n.get(s)?.data??[],r=this.ctx.keys.some(l=>l.allowNullKey===!0);t.aggregation=o?.map((l,c)=>{const u=[];for(const[d,g]of this.ctx.aggregates.entries()){const f=this.valueGroupIdxLookup(g);let y=g.groupAggregateFunction?.()??[1/0,-1/0];const x=f.map(I=>i[I][c]),S=MN(a,c,r),D=S==null?void 0:g.aggregateFunction(x,S);D&&(y=g.groupAggregateFunction?.(D,y)??co.extendDomain(D,y));const A=g.finalFunction?.(y)??y;u[d]=A,co.extendDomain(A,e[d])}return u})}aggregateGroupedData(t){const e=this.ctx.aggregates.map(()=>[1/0,-1/0]);t.domain.aggValues=e;const{columns:i}=t;for(const[n,s]of this.ctx.aggregates.entries()){const a=this.valueGroupIdxLookup(s);for(let o=0;or.datumIndices[g]?.length??0));for(let g=0;g{const S=r.datumIndices[x]?.[g];if(S==null)return;const D=this.resolvers.resolveAbsoluteIndex(o,S);return i[x][D]}),y=s.aggregateFunction(f,l);y&&(c=s.groupAggregateFunction?.(y,c)??co.extendDomain(y,c))}const d=s.finalFunction?.(c)??c;r.aggregation[n]=d,co.extendDomain(d,e[n])}}}postProcessGroups(t){const{groupProcessors:e}=this.ctx,{columnScopes:i,columns:n,invalidData:s}=t;for(const a of e){const o=this.valueGroupIdxLookup(a),r=a.adjust()();for(let l=0;lnew oo:()=>new co,this.ctx.bandingConfig,n),e.set(t,s)),s&&n&&s.setSortOrderMetadata(i?.sortOrder,i?.isUnique??!1),s||(n?new oo:new co)}extendDomainFromData(t,e,i){if(t instanceof xb)t.extendBandsFromData(e,i);else for(let n=0;ne.includes(i))}function nB(t,e){if(t.valueType==="category"){for(const i of e)if(i.property===t.property&&i.valueType===t.valueType&&Qq(i.scopes,t.scopes)&&i.validation===t.validation)return i}}var Jq=class{constructor(t,e,i){this.ctx=t,this.initializer=e,this.scopeCacheManager=i,this.processValueFactory=new qq(t)}recomputeDomains(t){const e=this.ctx.debug.check()?performance.now():0,i=t[qb];let n;const s=t[hu],a=this.setupDefinitionDomains(this.ctx.keys,i,s),o=new Map;for(const u of this.ctx.values){const d=nB(u,this.ctx.keys);d&&o.set(u,d)}const r=this.setupValueDomainsWithSharing(this.ctx.values,i,a,o),l=new Set;for(const[,u]of o){const d=a.get(u);d&&l.add(d)}this.initializeDomainBands(this.ctx.keys,a,u=>{const d=t.keys[u];return Math.max(...Array.from(d.values()).map(g=>g.length))},u=>String(u.property)),this.initializeDomainBands(this.ctx.values,r,u=>t.columns[u].length,u=>String(u.property));const c=new Map;if(i.size>0){n={totalBands:0,dirtyBands:0,totalData:0};for(const u of i.values())if(u instanceof xb){const d=u.getStats();c.set(u,d),n.totalBands+=d.bandCount,n.dirtyBands+=d.dirtyBandCount,n.totalData=Math.max(n.totalData,d.dataSize)}}if(this.extendDomainsFromData(this.ctx.keys,a,(u,d)=>t.keys[u]?.get(d),u=>u.scopes??[],u=>t.invalidKeys?.get(u)),this.extendDomainsFromData(this.ctx.values,r,(u,d)=>t.columns[u],u=>[Ra(u.scopes)],u=>t.invalidKeys?.get(u),l),t.domain.keys=this.ctx.keys.map(function(d){const g=a.get(d),f=g.getDomain();return co.is(g)&&f[0]>f[1]?[]:f}),t.domain.values=this.ctx.values.map(function(d){const g=r.get(d),f=g.getDomain();return co.is(g)&&f[0]>f[1]?[]:f}),t.type==="grouped"&&(t.domain.groups=t.groups.map(u=>u.keys)),this.collectDomainBandingMetadata(t,a,r,i,c),this.ctx.debug.check()&&e>0){const d=performance.now()-e;if(n&&n.totalBands>0){const g=n.dirtyBands/n.totalBands,f=Math.round(g*n.totalData);this.ctx.debug(`recomputeDomains with banding: ${d.toFixed(2)}ms, bands: ${n.dirtyBands}/${n.totalBands} dirty, data scanned: ~${f}/${n.totalData} (${(g*100).toFixed(1)}%)`)}else this.ctx.debug(`recomputeDomains: ${d.toFixed(2)}ms (no banding)`)}}setupDefinitionDomains(t,e,i){const n=new Map;for(const[s,a]of t.entries()){const o=i?.get(s);n.set(a,this.initializer.setupDomainForDefinition(a,e,o))}return n}initializeDomainBands(t,e,i,n){for(const[s,a]of t.entries()){const o=e.get(a);if(!o)continue;const r=i(s);this.initializer.initializeBandedDomain(o,r,n(a))}}extendDomainsFromData(t,e,i,n,s,a){for(const[o,r]of t.entries()){const l=e.get(r);if(l&&!a?.has(l))for(const c of n(r)){if(!c)continue;const u=i(o,c);if(!u)continue;const d=s(c);this.initializer.extendDomainFromData(l,u,d)}}}setupValueDomainsWithSharing(t,e,i,n){const s=new Map;for(const a of t){const o=n.get(a);if(o){const r=i.get(o);if(r){s.set(a,r);continue}}s.set(a,this.initializer.setupDomainForDefinition(a,e))}return s}initDataDomainProcessor(t){const{keys:e,values:i}=this.ctx,n=new Set;for(const g of i)if(g.scopes)for(const f of g.scopes)n.add(f);const s=new Map,a=new Map;let o=!0;const r=()=>{for(const g of e)g.valueType==="category"?s.set(g,new oo):s.set(g,new co);for(const g of i){const f=nB(g,e);if(f){const y=s.get(f);if(y){s.set(g,y),o&&(o=(g.scopes?.length??0)===n.size);continue}}g.valueType==="category"?s.set(g,new oo):(s.set(g,new co),o&&(o=(g.scopes?.length??0)===n.size))}};r();const l=this.scopeCacheManager.buildAccessors(Mu(e,i)),c=new WeakMap;for(const g of Mu(e,i)){const f=l.get(g.property),y=s.get(g),x={value:void 0,missing:!1,valid:!1},S=this.processValueFactory.createProcessValueFn(g,f,y,x,a,t);c.set(g,S)}function u(g){const f=c.get(g);if(!f)throw new Error("AG Charts - missing processValue function for definition");return f}function d(g,f,y,x){return u(g)(f,y,x)}return{dataDomain:s,processValue:d,getProcessValue:u,initDataDomain:r,scopes:n,allScopesHaveSameDefs:o}}collectDomainBandingMetadata(t,e,i,n,s){t.optimizations??(t.optimizations={});const a=(l,c)=>l.map(u=>{const d=c.get(u),g=n.get(u),f=d instanceof xb;let y;f||(y=u.valueType==="category"?"discrete domain":"not configured");let x;if(f&&g){const S=s.get(g)??g.getStats(),D=S.bandCount>0?S.dirtyBandCount/S.bandCount:0;x={totalBands:S.bandCount,dirtyBands:S.dirtyBandCount,dataSize:S.dataSize,scanRatio:D}}return{property:String(u.property),applied:f,reason:y,stats:x}}),o=a(this.ctx.keys,e),r=a(this.ctx.values,i);t.optimizations.domainBanding={keyDefs:o,valueDefs:r}}};function t7(){return{lastValue:void 0,sortOrder:0,isUnique:!0,isOrdered:!0}}function e7(t,e){const i=typeof e=="number"?e:e?.valueOf?.();if(typeof i!="number"||!Number.isFinite(i))return;if(t.lastValue===void 0){t.lastValue=i;return}const n=i-t.lastValue;if(n===0)t.isUnique=!1;else if(t.isOrdered){const s=n>0?1:-1;t.sortOrder===0?t.sortOrder=s:t.sortOrder!==s&&(t.isOrdered=!1)}t.lastValue=i}function i7(t){return{sortOrder:t.isOrdered&&t.sortOrder!==0?t.sortOrder:void 0,isUnique:t.isUnique,isDirty:!1}}var n7=class{constructor(t,e){this.ctx=t,this.domainManager=e}extractData(t){const{dataDomain:e,getProcessValue:i,allScopesHaveSameDefs:n}=this.domainManager.initDataDomainProcessor("extend"),{keys:s,values:a}=this.ctx,{invalidData:o,invalidKeys:r,invalidKeyCount:l,invalidDataCount:c,missingData:u,allKeyMappings:d,keySortOrders:g}=this.extractKeys(s,t,i),{columns:f,columnScopes:y,columnNeedValueOf:x,partialValidDataCount:S,maxDataLength:D}=this.extractValues(o,c,u,a,t,r,i),A=I=>{const w=e.get(I),N=w.getDomain();return co.is(w)&&N[0]>N[1]?[]:N};return{type:"ungrouped",input:{count:D},scopes:new Set(t.keys()),dataSources:t,aggregation:void 0,keys:[...d.values()],columns:f,columnScopes:y,columnNeedValueOf:x,invalidKeys:r,invalidKeyCount:l,invalidData:o,invalidDataCount:c,missingData:u,domain:{keys:s.map(A),values:a.map(A)},defs:{allScopesHaveSameDefs:n,keys:s,values:a},partialValidDataCount:S,time:0,version:0,[GT]:new Map,[hu]:g,[jT]:new Map,[qb]:new Map,[ip]:new Map}}extractKeys(t,e,i){const n=new Map,s=new Map,a=new Map,o=new Map,r=new Map,l=new Map,c=new Map;let u,d;const g=t.map(y=>i(y)),f=(y,x)=>{const S=d.get(y);u.set(x,u.get(S)),n.has(S)&&(n.set(x,n.get(S)),s.set(x,s.get(S)),o.set(x,o.get(S)))};for(const[y,x]of t.entries()){const{invalidValue:S,scopes:D}=x,A=g[y];u=new Map,d=new Map,l.set(x,u);const I=t7();for(const w of D??[]){const N=e.get(w)?.data??[];if(d.has(N)){f(N,w);continue}const O=[];u.set(w,O),d.set(N,w);let L,R,P=0,B;for(let F=0;Fo(f));for(const[f,y]of n.entries()){const{invalidValue:x}=y,S=g[f];if(new Set(y.scopes.map(R=>s.get(R))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(y)}`);const A=new Set(y.scopes),I=Ra(y.scopes),w=s.get(I)?.data??[],N=new Array,O=a.get(I);let L=!1;for(let R=0;R0?1-S/y:0;t.optimizations.batchMerging={originalBatchCount:y,mergedBatchCount:S,mergeRatio:I}}const D=x.length===1,A=Object.freeze(nl(x[0][1].length,_G));for(const[I,w,N,O,L,R]of x){const P=s[Ra(w)];for(let B=0;BW[B]);if(F==null||F.length===0)throw new Error("AG Charts - no keys found for scope(s): "+I.join(", "));const H=e?.(F)??F,$=d==null?void 0:vN(H);let Y=d?.get($),U,V,Z=!1;if(Y==null?(U={keys:H,datumIndices:[],aggregation:[],validScopes:l},V=f++,Y=[V,U],Z=!0,d?.set($,Y),c.push(U.keys),u.push(U)):([V,U]=Y,g=!1),L?.[B]===!0){U.validScopes===l&&(U.validScopes=new Set(l.values()));for(const W of O)U.validScopes.delete(W)}if(Z&&B===V&&D)U.datumIndices=A;else{!Z&&U.datumIndices===A&&(U.datumIndices=A.map(W=>[...W]));for(const W of w)(i=U.datumIndices)[W]??(i[W]=[]),U.datumIndices[W].push(B-V)}}}return{...t,type:"grouped",domain:{...t.domain,groups:c},groups:u,groupsUnique:g,optimizations:t.optimizations,[qb]:t[qb],[ip]:t[ip]}}groupBatches(t,e,i,n,s,a){const o=[],r=new Set;for(const l of t){const c=e.map((y,x)=>x).filter(y=>!r.has(y)&&i[y].has(l));if(c.length===0)continue;for(const y of c)r.add(y);const u=new Set;for(const y of c)for(const x of i[y])u.add(x);const d=n.map(y=>y.get(l)).filter(y=>y!=null),g=s?.get(l),f=a?.get(l);o.push([l,c,d,u,g,f])}return this.mergeCompatibleBatches(o)}areBatchesCompatible(t,e){const[,,i,,n,s]=t,[,,a,,o,r]=e;return i.every((l,c)=>l===a[c])&&s===r&&n===o}mergeCompatibleBatches(t){const e=[],i=new Set;for(let n=0;n0}function a7(t){return t.removedIndices.size===0&&t.totalAppendCount===0&&t.totalPrependCount>0}function o7(t){return t.removedIndices.size===0}function r7(t){return t.removedIndices.size===0&&t.totalPrependCount===0&&t.totalAppendCount===0&&t.spliceOps.every(e=>e.insertCount===0&&e.deleteCount===0)}function l7(t){return t.removedIndices.size>0&&t.totalPrependCount===0&&t.totalAppendCount===0&&t.spliceOps.every(e=>e.insertCount===0)}function c7(t){return AN(t.removedIndices)>0}function AN(t){if(t.size===0)return 0;const e=Array.from(t).sort((i,n)=>i-n);if(e[0]!==0)return 0;for(let i=0;i0&&t.totalPrependCount===0}var u7=class{constructor(t,e){this.indexMap=t,this.prependValues=e.prependValues,this.appendValues=e.appendValues,this.insertionValues=e.insertionValues}getRemovedIndices(){return Array.from(this.indexMap.removedIndices).sort((t,e)=>t-e)}getUpdatedIndices(){return Array.from(this.indexMap.updatedIndices).sort((t,e)=>t-e)}forEachPreservedIndex(t){const{originalLength:e,removedIndices:i,totalPrependCount:n}=this.indexMap;let s=0;const a=Array.from(i).sort((r,l)=>r-l);let o=0;for(let r=0;r0?Array.from({length:o.insertCount},function(u,d){return e(o.index+d)}):[],l=t.splice(o.index,o.deleteCount,...r);i&&l.length>0&&i(l,o)}t.length!==s&&(t.length=s)}}},d7=class extends EG{constructor(t={}){super(t),this.lastDirtyBandCount=0,this.lastScanRatio=0,this.statsCaptured=!1}createBand(t,e){return{startIndex:t,endIndex:e,cachedResult:void 0,isDirty:!0}}initializeBands(t){super.initializeBands(t),this.statsCaptured=!1}getBands(){return this.bands}evaluateFromData(t,e,i=!1){const n=t.reducer();for(const s of this.bands){if(i&&!s.isDirty)continue;const a=t.needsOverlap&&s.startIndex>0?Math.max(0,s.startIndex-1):s.startIndex,o=this.evaluateRange(t,n,e,a,s.endIndex);s.cachedResult=o,s.isDirty=!1}}getResult(t){const e=this.bands.map(i=>i.cachedResult);return t.combineResults(e)}evaluateRange(t,e,i,n,s){let a=t.initialValue;const{keyColumns:o,keysParam:r,rawData:l}=i,c=Math.min(s,l.length);for(let u=n;ui.isDirty),e=t.reduce((i,n)=>i+(n.endIndex-n.startIndex),0);this.lastDirtyBandCount=t.length,this.lastScanRatio=this.dataSize>0?e/this.dataSize:0,this.statsCaptured=!0}getStats(){const t=this.bands.filter(n=>!n.isDirty&&n.cachedResult!==void 0);let e,i;if(this.statsCaptured)e=this.lastDirtyBandCount,i=this.lastScanRatio;else{const n=this.bands.filter(a=>a.isDirty),s=n.reduce((a,o)=>a+(o.endIndex-o.startIndex),0);e=n.length,i=this.dataSize>0?s/this.dataSize:0}return{totalBands:this.bands.length,dirtyBands:e,dataSize:this.dataSize,scanRatio:i,cacheHits:t.length}}},aB=class{constructor(t={}){this.bandingConfig=t}static evaluateRange(t,e,i,n,s){let a=t.initialValue;const{keyColumns:o,keysParam:r,rawData:l}=i,c=Math.min(s,l.length);for(let u=n;uo.get(i)).filter(o=>o!=null),a=s.map(()=>{});return{scopeId:i,rawData:n,keyColumns:s,keysParam:a}}},p7=class{constructor(t,e){this.ctx=t,this.reducerManager=e}isReprocessingSupported(t){if(t.type==="grouped"){if(!t.groupsUnique||this.getUniqueDataSets(t).size!==1)return!1;const s=Ra(t.scopes);if(t.invalidKeys?.get(s)?.some(o=>o))return!1}return this.ctx.aggregates.length>0||this.ctx.reducers.some(n=>n.supportsBanding!==!0||typeof n.combineResults!="function")||this.ctx.processors.some(n=>n.incrementalCalculate===void 0)||this.ctx.propertyProcessors.length>0?!1:this.ctx.groupProcessors.every(n=>n.supportsReprocessing??!1)}reprocessData(t,e,i,n,s,a){const o=performance.now(),r=this.collectScopeChanges(t,e);if(r.size===0)return t;this.commitPendingTransactions(t);const l=this.buildDefinitionProcessors(this.ctx.keys,i),c=this.buildDefinitionProcessors(this.ctx.values,i),u=this.processAllInsertions(t,r,l,c);this.processAllUpdates(t,r,l,c,u),this.updateBandsForChanges(t,r);const d=this.transformKeysArrays(t,r,u);this.transformColumnsArrays(t,r,u),this.transformInvalidityArrays(t,r,u),this.reprocessBandedReducers(t,r),t.type==="grouped"&&(this.transformGroupsArray(t,r,u),this.ctx.groupProcessors.length>0&&n(t,r)),this.invalidateSortOrdersForChanges(t,r),s(t),this.reprocessProcessors(t),t.reduced?.diff!=null&&r.size>0&&this.generateDiffMetadata(t,r,d),this.updateProcessedDataMetadata(t);const g=performance.now();t.time=g-o,t.version+=1,a(t,"reprocess");const f=US(r);return t.changeDescription=f.size===1?f.values().next().value:void 0,t}updateBandsForChanges(t,e){const i=t[qb];if(i.size===0)return;const n=US(e);for(const s of n){const{indexMap:a}=s;for(const o of i.values())o.applyIndexMap(a)}}reprocessBandedReducers(t,e){if(t.type!=="ungrouped")return;const i=this.ctx.reducers.filter(n=>n.supportsBanding&&typeof n.combineResults=="function");if(i.length!==0){t.reduced??(t.reduced={});for(const n of i){const s=this.reducerManager.evaluate(n,t,{reuseCleanBands:!0,beforeEvaluate:(a,o)=>{if(!o.scopeId)return;const r=e.get(o.scopeId);r&&a.applyIndexMap(r.indexMap)}});s!==void 0&&(t.reduced[n.property]=s)}}}collectScopeChanges(t,e){const i=new Map;for(const[n,s]of t.dataSources){const a=e?.get(s)??s.getChangeDescription();a&&i.set(n,a)}return i}commitPendingTransactions(t){const e=this.getUniqueDataSets(t);for(const i of e)i.commitPendingTransactions()}buildDefinitionProcessors(t,e){return t.map((i,n)=>({def:i,index:n,processValue:e(i)}))}processAllInsertions(t,e,i,n){const s=new Map;for(const[a,o]of e){const r=t.dataSources.get(a);if(!r)continue;const l=this.processInsertionsOnce(a,o,r,i,n);s.set(a,l)}return s}processAllUpdates(t,e,i,n,s){for(const[a,o]of e){const r=t.dataSources.get(a);if(!r)continue;const l=o.getUpdatedIndices();if(l.length===0)continue;let c=s.get(a);c||(c=new Map,s.set(a,c));for(const u of l){if(u<0||u>=r.data.length)continue;const d=this.processDatum(r,u,a,i,n);d&&c.set(u,d)}}}processInsertionsOnce(t,e,i,n,s){const a=new Map,{finalLength:o}=e.indexMap;for(const r of e.indexMap.spliceOps)if(!(r.insertCount<=0))for(let l=0;l=o)continue;const u=this.processDatum(i,c,t,n,s);u&&a.set(c,u)}return a}processDatum(t,e,i,n,s){const a=t.data[e],o=new Map,r=new Map;let l=!1,c=!1,u=!1;if(a==null||typeof a!="object")l=!0,c=!0;else{for(const{index:d,def:g,processValue:f}of n){if(!g.scopes?.includes(i))continue;const y=f(a,e,i);o.set(d,{value:y.value,valid:y.valid}),y.valid||(l=!0)}for(const{index:d,def:g,processValue:f}of s){if(!g.scopes?.includes(i))continue;const y=f(a,e,g.scopes);r.set(d,{value:y.value,valid:y.valid}),y.valid||(c=!0),y.missing&&(u=!0)}}return{keys:o,values:r,hasInvalidKey:l,hasInvalidValue:c,hasMissingValue:u}}transformArraysWithCache(t,e,i,n,s,a){for(const[o,r]of t.entries())for(const l of s(r)){const c=e.get(l);if(!c)continue;const u=n(o,l);if(!u)continue;const d=i.get(l);this.applyChangeDescWithCache(c,u,d,(g,f)=>a(g,r,o))}}transformKeysArrays(t,e,i){const n=new Map,s=r=>{let l=n.get(r);return l||(l={tuples:[]},n.set(r,l)),l},a=new WeakSet;for(const[r,l]of this.ctx.keys.entries())for(const c of l.scopes??[]){const u=e.get(c);if(!u)continue;const d=t.keys[r]?.get(c);if(!d)continue;if(a.has(d)){const x=Array.from(t.keys[r].entries()).find(([S,D])=>D===d)?.[0];x&&x!==c&&n.has(x)&&n.set(c,n.get(x));continue}a.add(d);const g=i.get(c),f=s(c);let y=0;this.applyChangeDescWithCache(u,d,g,x=>{const S=x?.keys.get(r);return S?.valid?S.value:l.invalidValue},x=>{for(const S of x)f.tuples[y]||(f.tuples[y]=new Array(this.ctx.keys.length)),f.tuples[y][r]=S,y+=1})}const o=new Map;for(const[r,{tuples:l}]of n){if(l.length===0)continue;const c=new Set;for(const u of l){const d=[];for(const[g,f]of u.entries())this.ctx.keys[g].scopes?.includes(r)&&d.push(f);d.length>0&&c.add(vN(d))}o.set(r,c)}return o}transformColumnsArrays(t,e,i){this.transformArraysWithCache(this.ctx.values,e,i,n=>t.columns[n],n=>[Ra(n.scopes)],(n,s,a)=>{if(n){if(n.hasInvalidKey)return s.invalidValue;const o=n.values.get(a);return o?.valid?o.value:s.invalidValue}return s.invalidValue})}transformInvalidityMap(t,e,i,n){const s=new Set;for(const[a,o]of e){let r=t.get(a);if(!r){const c=i.get(a);if(c&&Array.from(c.values()).some(n))r=nl(o.indexMap.originalLength,!1),t.set(a,r);else continue}if(s.has(r))continue;s.add(r);const l=i.get(a);this.applyChangeDescWithCache(o,r,l,(c,u)=>n(c))}}transformInvalidityArrays(t,e,i){t.invalidKeys&&this.transformInvalidityMap(t.invalidKeys,e,i,n=>n?.hasInvalidKey??!1),t.invalidData&&this.transformInvalidityMap(t.invalidData,e,i,n=>n?n.hasInvalidKey||n.hasInvalidValue:!1),t.missingData&&this.transformInvalidityMap(t.missingData,e,i,n=>n?.hasMissingValue??!1)}applyChangeDescWithCache(t,e,i,n,s){t.applyToArray(e,o=>{const r=i?.get(o);return n(r,o)},s);const a=t.getUpdatedIndices();if(a.length!==0)for(const o of a){if(o<0||o>=e.length)continue;const r=i?.get(o);e[o]=n(r,o)}}transformGroupsArray(t,e,i){const n=Ra(t.scopes),s=e.get(n);if(!s)return;const a=i.get(n);for(const[,r]of a??[])if(r.hasInvalidKey)throw new Error("AG Charts - reprocessing grouped data with invalid keys not supported. This typically indicates a data quality issue that requires full reprocessing.");s.applyToArray(t.groups,r=>this.createDataGroupForInsertion(r,t,n,a));const o=s.getUpdatedIndices();if(o.length>0)for(const r of o)r<0||r>=t.groups.length||(t.groups[r]=this.createDataGroupForInsertion(r,t,n,a))}createDataGroupForInsertion(t,e,i,n){const s=[];for(const d of e.keys){const g=d.get(i);g&&s.push(g[t])}const a=e.groups[0],o=()=>Object.freeze(nl(e.columnScopes.length,_G)),r=a?.datumIndices??o(),c=n?.get(t)?.hasInvalidValue??!1;let u;return c?(u=new Set(e.scopes),u.delete(i)):u=e.scopes,{keys:s,datumIndices:r,aggregation:[],validScopes:u}}generateDiffMetadata(t,e,i){const n=(s,a)=>{const o=[];for(const r of t.keys){const l=r.get(s);if(!l)return;o.push(l[a])}return o.length>0?vN(o):void 0};for(const[s,a]of e){const o={changed:!0,added:new Set,removed:i.get(s)??new Set,updated:new Set,moved:new Set};for(const c of a.indexMap.spliceOps)if(c.insertCount>0)for(let u=0;u0)for(let c=l;c0)for(let c=0;c{if(c!==u){const d=n(s,u);d&&o.moved.add(d)}});t.reduced.diff[s]=o}}updateProcessedDataMetadata(t){let e=0;for(const n of t.dataSources.values())e=Math.max(e,n.data.length);t.input.count=e;let i=0;for(const[n,s]of t.invalidData??new Map){const a=t.invalidKeys?.get(n);for(let o=0;o{if(typeof o=="number")return o;if(o instanceof Date)return o.valueOf()};let s=n(e);const a=t.sortOrder;for(const o of i){const r=n(o);if(r===void 0)continue;if(s===void 0){s=r;continue}const l=r-s;if(l===0&&(t.isUnique=!1),t.sortOrder!==void 0){let c=0;l>0?c=1:l<0&&(c=-1),c!==0&&c!==a&&(t.sortOrder=void 0)}s=r}}updateKeySortOrdersForAppend(t,e){for(const[i,n]of t.keys.entries()){const s=t[hu].get(i);if(!s)continue;const a=Ra(n.values());if(!a||a.length<=e)continue;const o=e>0?a[e-1]:void 0,r=a.slice(e);this.updateSortOrderForAppend(s,o,r)}}invalidateSortOrdersForChanges(t,e){const i=US(e);let n=!0,s=!1,a=!1,o,r;for(const l of i){const{indexMap:c}=l;r7(c)||(sB(c)?(s=!0,o=c.originalLength):l7(c)||(h7(c)?(a=!0,r={originalLength:c.originalLength,removedCount:c.removedIndices.size}):n=!1))}n?s&&o!==void 0?this.updateKeySortOrdersForAppend(t,o):a&&r&&this.updateKeySortOrdersForRollingWindow(t,r):(t[hu].clear(),t[jT].clear())}updateKeySortOrdersForRollingWindow(t,e){const{originalLength:i,removedCount:n}=e;for(const[s,a]of t.keys.entries()){const o=t[hu].get(s);if(!o)continue;const r=Ra(a.values());if(!r||r.length===0)continue;const l=i-n,c=l>0?r[l-1]:void 0,u=r.slice(l);this.updateSortOrderForAppend(o,c,u)}}invalidateCachesForChanges(t){this.markDomainRangesDirty(t[GT])}markDomainRangesDirty(t){for(const e of t.values())e.isDirty=!0}recountInvalid(t,e){if(!(!t||!e))for(const[i,n]of t){const s=n.filter(Boolean).length;s===0?(t.delete(i),e.delete(i)):e.set(i,s)}}reprocessProcessors(t){if(this.ctx.processors.length!==0){t.reduced??(t.reduced={});for(const e of this.ctx.processors){const i=t.reduced[e.property],n=e.incrementalCalculate?.(t,i)??e.calculate(t,i);t.reduced[e.property]=n}}}getUniqueDataSets(t){return new Set(t.dataSources.values())}},bd=0,xd=1,qr=2,g7=class Jy{constructor(e){this.isDirty=!1;const i=e.reduce((a,o)=>Math.max(a,o.length),0),{maxLevelSize:n,buffer:s}=Jy.createBuffer(i);this.maxLevelSize=n,this.buffer=s,this.dataLength=i,this.populateBuffer(e)}static computeMaxLevelSize(e){let n=1<<32-Math.clz32(e);return e===n/2&&(n=n>>>1),n}static createBuffer(e){const i=Jy.computeMaxLevelSize(e),n=new Float64Array((i*2-1)*2).fill(Number.NaN);return{maxLevelSize:i,buffer:n}}populateBuffer(e){const{maxLevelSize:i,buffer:n}=this,s=i-1;for(const a of e){const o=a.length;for(let r=0;rd)&&(n[c+1]=l)}}for(let a=i>>>1;a>=1;a>>>=1){const o=a-1,r=o+a<<1;let l=o<<1,c=r;for(let u=0;ux?y:x,l+=2,c+=4}}}rebuild(e){const i=e.reduce((s,a)=>Math.max(s,a.length),0);if(Jy.computeMaxLevelSize(i)===this.maxLevelSize)this.buffer.fill(Number.NaN);else{const{maxLevelSize:s,buffer:a}=Jy.createBuffer(i);this.maxLevelSize=s,this.buffer=a}this.dataLength=i,this.populateBuffer(e)}updateValue(e,i){const{maxLevelSize:n,buffer:s}=this,a=n+e-1,o=Math.trunc(a*qr)+bd,r=Math.trunc(a*qr)+xd;s[o]=Number.NaN,s[r]=Number.NaN;for(const l of i){const c=Number(l),u=s[o],d=s[r];(!Number.isFinite(u)||cd)&&(s[r]=c)}this.propagateUp(a)}updateValues(e){for(const{index:i,values:n}of e)this.updateValue(i,n)}propagateUp(e){const{buffer:i}=this;for(;e>0;){const n=Math.trunc((e-1)/2),s=2*n+1,a=2*n+2,o=i[Math.trunc(s*qr)+bd],r=i[Math.trunc(s*qr)+xd],l=i[Math.trunc(a*qr)+bd],c=i[Math.trunc(a*qr)+xd];i[Math.trunc(n*qr)+bd]=!Number.isFinite(l)||oc?r:c,e=n}}computeRangeInto(e,i,n,s,a,o,r){const l=a+o-1;if(l=n)return r;if(a>=i&&l1&&(s=Math.trunc(s*2),o=Math.trunc(o/2),this.computeRangeInto(e,i,n,Math.trunc(s+1),a,o,r),this.computeRangeInto(e,i,n,Math.trunc(s+2),a+o,o,r));return r}rangeBetween(e,i,n){const s=n??[0,0];if(e>i)return s[0]=Number.NaN,s[1]=Number.NaN,s;const{maxLevelSize:a,buffer:o}=this;return s[0]=1/0,s[1]=-1/0,this.computeRangeInto(o,e,i,0,0,a,s),s}getRange(e){const{buffer:i}=this,n=e??[0,0];return n[0]=i[bd],n[1]=i[xd],n}get range(){const{buffer:e}=this;return[e[bd],e[xd]]}get length(){return this.dataLength}};function f7(t,e){const i=t.length;if(t.length<=1)return 1;let n=0,s=t[0];for(let a=1;athis.resolveProcessedDataIndexById(t,d)),o=s.input.count;if(i<=0&&n>=o){const d=s.domain.values;let g=1/0,f=-1/0;for(const y of a){const x=d[y];x!=null&&(x[0]f&&(f=x[1]))}return this.rangeBetweenBuffer[0]=g,this.rangeBetweenBuffer[1]=f,this.rangeBetweenBuffer}const r=a.join(":"),l=s[GT],c=a.map(d=>s.columns[d]);let u=l.get(r);return u==null?(u=new g7(c),l.set(r,u)):u.isDirty&&(u.rebuild(c),u.isDirty=!1),u.rangeBetween(i,n,this.rangeBetweenBuffer)}getSortOrder(t,e,i,n){const s=i.get(e);if(s==null||s.isDirty){const a={sortOrder:f7(t,n)};return i.set(e,a),a.sortOrder}return s.sortOrder}getKeySortOrder(t,e,i){const n=this.resolveProcessedDataIndexById(t,e),s=i.keys[n]?.get(t.id);return s?this.getSortOrder(s,n,i[hu],!0):void 0}getKeySortEntry(t,e,i){const n=this.resolveProcessedDataIndexById(t,e),s=i[hu].get(n);return s?.isDirty?void 0:s}getColumnSortOrder(t,e,i){const n=this.resolveProcessedDataIndexById(t,e),s=i.columnNeedValueOf?.[n]??!0;return this.getSortOrder(i.columns[n],n,i[jT],s)}getDomainsByType(t,e){switch(t){case"key":return e.domain.keys;case"value":return e.domain.values;case"aggregate":return e.domain.aggValues;case"group-value-processor":return e.domain.groups;default:return null}}},y7=class{constructor(t){this.ctx=t}processScopeCache(){this.ctx.scopeCache.clear();for(const t of Mu(this.ctx.keys,this.ctx.values,this.ctx.aggregates))if(t.idsMap)for(const[e,i]of t.idsMap)for(const n of i)if(!this.ctx.scopeCache.has(e))this.ctx.scopeCache.set(e,new Map([[n,t]]));else{if(this.ctx.scopeCache.get(e)?.has(n))throw new Error("duplicate definition ids on the same scope are not allowed.");this.ctx.scopeCache.get(e).set(n,t)}}valueGroupIdxLookup({matchGroupIds:t}){const e=[];for(const[i,n]of this.ctx.values.entries())(!t||n.groupId&&t.includes(n.groupId))&&e.push(i);return e}valueIdxLookup(t,e){const i=t==null||t.length===0,n=typeof e=="string"?e:e.id,s=o=>{if(o.idsMap){for(const[r,l]of o.idsMap)if(t?.includes(r)&&l.has(n))return!0}return!1},a=this.ctx.values.reduce((o,r,l)=>((r.scopes==null||i&&!r.scopes.length||r.scopes.some(u=>t?.includes(u)))&&(r.property===n||r.id===n||s(r))&&o.push(l),o),[]);if(a.length===0)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(e)} in scope(s) ${JSON.stringify(t)}`);return a}buildAccessors(t){const e=new Map;if(this.ctx.suppressFieldDotNotation)return e;for(const i of t){if(!(i.property.includes(".")||i.property.includes("[")))continue;const s=Yq(i.property);if(s==null){pt.warnOnce("Invalid property path [%s]",i.property);continue}const a=$q(s);e.set(i.property,a)}return e}},IN=class{constructor(t,e="standalone",i=!1,n){this.opts=t,this.mode=e,this.suppressFieldDotNotation=i,this.eventsHub=n,this.debug=Gt.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[];let s=!0;for(const c of t.props){if(c.type==="key"&&!s)throw new Error("AG Charts - internal config error: keys must come before values.");c.type==="value"&&s&&(s=!1)}const a=({matchGroupIds:c=[]})=>{for(const u of c)if(this.values.every(d=>d.groupId!==u))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${u}).`)},o=new Set,r=new Set;for(const c of t.props){const u=c.type==="key"?o:r;if(SN(c)&&c.scopes)for(const d of c.scopes)u.add(d);switch(c.type){case"key":this.keys.push({...c,index:this.keys.length,missing:new Map});break;case"value":if(c.property==null)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(c)}`);this.values.push({...c,index:this.values.length,missing:new Map});break;case"aggregate":a(c),this.aggregates.push({...c,index:this.aggregates.length});break;case"group-value-processor":a(c),this.groupProcessors.push({...c,index:this.groupProcessors.length});break;case"property-value-processor":this.propertyProcessors.push({...c,index:this.propertyProcessors.length});break;case"reducer":this.reducers.push({...c,index:this.reducers.length});break;case"processor":this.processors.push({...c,index:this.processors.length});break}}if(this.opts.groupByKeys||this.opts.groupByFn!=null){const c=new Set(r.values());for(const u of o)c.delete(u);if(c.size>0)throw new Error(`AG Charts - scopes missing key for grouping, illegal configuration: ${[...c.values()]}`)}const l={keys:this.keys,values:this.values,aggregates:this.aggregates,groupProcessors:this.groupProcessors,propertyProcessors:this.propertyProcessors,reducers:this.reducers,processors:this.processors,debug:this.debug,mode:this.mode,bandingConfig:this.opts.domainBandingConfig,suppressFieldDotNotation:this.suppressFieldDotNotation,scopeCache:this.scopeCache};this.resolvers=new m7(l),this.scopeCacheManager=new y7(l),this.domainInitializer=new Zq(l),this.domainManager=new Jq(l,this.domainInitializer,this.scopeCacheManager),this.reducerManager=new aB(this.opts.domainBandingConfig),this.dataExtractor=new n7(l,this.domainManager),this.dataGrouper=new s7(l),this.aggregator=new Xq(l,this.scopeCacheManager,this.resolvers),this.incrementalProcessor=new p7(l,this.reducerManager)}resolveProcessedDataDefById(t,e){return this.resolvers.resolveProcessedDataDefById(t,e)}resolveProcessedDataIndexById(t,e){return this.resolvers.resolveProcessedDataIndexById(t,e)}resolveKeysById(t,e,i){return this.resolvers.resolveKeysById(t,e,i)}hasColumnById(t,e){return this.resolvers.hasColumnById(t,e)}resolveColumnById(t,e,i){return this.resolvers.resolveColumnById(t,e,i)}resolveColumnNeedsValueOf(t,e,i){return this.resolvers.resolveColumnNeedsValueOf(t,e,i)}resolveMissingDataCount(t){return this.resolvers.resolveMissingDataCount(t)}*forEachDatum(t,e,i,n){const s=e.columnScopes.findIndex(a=>a.has(t.id));for(const a of i.datumIndices[s]??[]){const o=this.resolvers.resolveAbsoluteIndex(n,a);yield e.columns[s][o]}}getUniqueDataSets(t){return new Set(t.dataSources.values())}*forEachGroupDatum(t,e){const i=e.columnScopes.findIndex(a=>a.has(t.id)),n={groupIndex:0,columnIndex:i},s=[];for(const a of e.groups){n.group=a;for(const o of a.datumIndices[i]??s)n.datumIndex=this.resolvers.resolveAbsoluteIndex(n.groupIndex,o),yield n;n.groupIndex++}}getDomain(t,e,i,n){const s=this.resolvers.getDomain(t,e,i,n);if(i==="key"&&s.length>0){const a=this.getKeySortMetadata(t,e,n);return{domain:s,sortMetadata:a}}return{domain:s}}getDomainBetweenRange(t,e,[i,n],s){return this.resolvers.getDomainBetweenRange(t,e,[i,n],s)}getKeySortOrder(t,e,i){return this.resolvers.getKeySortOrder(t,e,i)}getColumnSortOrder(t,e,i){return this.resolvers.getColumnSortOrder(t,e,i)}getKeySortMetadata(t,e,i){const n=this.resolvers.getKeySortEntry(t,e,i);if(n?.sortOrder!=null)return{sortOrder:n.sortOrder,isUnique:n.isUnique}}processData(t){const{opts:{groupByKeys:e,groupByFn:i},aggregates:n,groupProcessors:s,reducers:a,processors:o,propertyProcessors:r}=this,l=performance.now();if(e&&this.keys.length===0)return;let c=this.extractData(t);e?c=this.dataGrouper.groupData(c):i&&(c=this.dataGrouper.groupData(c,i(c))),s.length>0&&c.type==="grouped"&&this.aggregator.postProcessGroups(c),n.length>0&&c.type==="ungrouped"?this.aggregator.aggregateUngroupedData(c):n.length>0&&c.type==="grouped"&&this.aggregator.aggregateGroupedData(c),r.length>0&&this.postProcessProperties(c),a.length>0&&this.reduceData(c),o.length>0&&this.postProcessData(c),this.warnDataMissingProperties(t);const u=performance.now();return c.time=u-l,c.version+=1,this.collectOptimizationMetadata(c,"full-process"),this.debug.check()&&b7(c),this.processScopeCache(),c}isReprocessingSupported(t){return this.incrementalProcessor.isReprocessingSupported(t)}reprocessData(t,e){if(!this.isReprocessingSupported(t)){this.debug.check()&&this.debug("Falling back to full reprocessing - incremental not supported for current configuration");const a=this.getUniqueDataSets(t);for(const o of a)o.commitPendingTransactions();return this.processData(t.dataSources)}const{getProcessValue:i}=this.initDataDomainProcessor("skip"),n=this.incrementalProcessor.reprocessData(t,e,i,this.reprocessGroupProcessors.bind(this),this.recomputeDomains.bind(this),this.collectOptimizationMetadata.bind(this)),{diff:s}=n.reduced??{};return s&&this.eventsHub?.emit("datamodel:diff",{diff:s}),n}recomputeDomains(t){this.domainManager.recomputeDomains(t)}warnDataMissingProperties(t){this.dataExtractor.warnDataMissingProperties(t)}processScopeCache(){this.scopeCacheManager.processScopeCache()}valueGroupIdxLookup(t){return this.scopeCacheManager.valueGroupIdxLookup(t)}valueIdxLookup(t,e){return this.scopeCacheManager.valueIdxLookup(t,e)}extractData(t){return this.dataExtractor.extractData(t)}reprocessGroupProcessors(t,e){const{groupProcessors:i}=this,{columns:n}=t;for(const a of i)if(!a.supportsReprocessing)throw new Error("AG Charts - attempted to reprocess group processor that does not support reprocessing. This is an internal error that should not occur.");const s=US(e);for(const a of i){const o=this.valueGroupIdxLookup(a),r=a.adjust()();for(const l of s){const{indexMap:c}=l;for(const u of c.spliceOps)if(u.insertCount>0)for(let d=0;dr.get(n)).filter(r=>r!=null),o=a.map(()=>{});return aB.evaluateRange(t,i,{rawData:s,keyColumns:a,keysParam:o},0,s.length)}postProcessData(t){t.reduced??(t.reduced={});for(const i of this.processors)t.reduced[i.property]=i.calculate(t,t.reduced[i.property]);const{diff:e}=t.reduced;e&&this.eventsHub?.emit("datamodel:diff",{diff:e})}initDataDomainProcessor(t){return this.domainManager.initDataDomainProcessor(t)}collectOptimizationMetadata(t,e){const i=t.optimizations?.domainBanding,n=t[ip];this.reducers.length>0&&n&&this.collectReducerBandingMetadata(t,n);const s=t.optimizations?.reducerBanding;t.optimizations={performance:{processingTime:t.time,pathTaken:e},...i&&{domainBanding:i},...s&&{reducerBanding:s}};const a=this.isReprocessingSupported(t),o=e==="reprocess";let r;if(!a){const l=[];if(t.type==="grouped"){t.groupsUnique||l.push("groupsUnique=false"),this.getUniqueDataSets(t).size!==1&&l.push("multiple data sources");const u=Ra(t.scopes);t.invalidKeys?.get(u)?.some(g=>g)&&l.push("has invalid keys")}this.aggregates.length>0&&l.push("has aggregates"),this.reducers.filter(c=>!c.supportsBanding).length>0&&l.push("has reducers"),this.processors.filter(c=>c.incrementalCalculate===void 0).length>0&&l.push("has processors"),this.propertyProcessors.length>0&&l.push("has property processors"),r=l.length>0?l.join(", "):void 0}if(t.optimizations.reprocessing={applied:o,reason:r},t.type==="grouped"){let l=0;const c=t.groups[0];if(c){const u=c.datumIndices;for(const d of t.groups)d.datumIndices===u&&l++}t.optimizations.sharedDatumIndices={applied:l>0,sharedGroupCount:l,totalGroupCount:t.groups.length}}}collectReducerBandingMetadata(t,e){if(this.reducers.length===0)return;t.optimizations??(t.optimizations={});const i=[];for(const n of this.reducers){const s=e.get(n.property),a=this.shouldUseReducerBanding(n,t)&&s!=null;let o;a||(n.supportsBanding!==!0?o="reducer does not support banding":t.type!=="ungrouped"?o="grouped data not supported":n.combineResults===void 0?o="missing combineResults function":o="banding not applied");let r;a&&s&&(r=s.getStats()),i.push({property:String(n.property),applied:a,reason:o,stats:r})}t.optimizations.reducerBanding={reducers:i}}buildAccessors(t){return this.scopeCacheManager.buildAccessors(t)}};function b7(t){const e=(i,n)=>{n.length>0&&(pt.log(`DataModel.processData() - ${i}`),pt.table(n))};if(pt.log("DataModel.processData() - processedData",t),e("Key Domains",t.domain.keys),e("Value Domains",t.domain.values),e("Aggregate Domains",t.domain.aggValues??[]),t.optimizations){pt.log("DataModel.processData() - Optimization Summary");const i=t.optimizations;if(i.performance&&pt.log(` Performance: ${i.performance.processingTime.toFixed(2)}ms (${i.performance.pathTaken})`),i.reprocessing){const n=i.reprocessing.applied?"✓":"✗",s=i.reprocessing.reason?` (${i.reprocessing.reason})`:"";pt.log(` Reprocessing: ${n}${s}`)}if(i.domainBanding){const n=i.domainBanding.keyDefs.filter(r=>r.applied),s=i.domainBanding.valueDefs.filter(r=>r.applied),a=n.length+s.length,o=i.domainBanding.keyDefs.length+i.domainBanding.valueDefs.length;if(a>0){pt.log(` Domain Banding: ✓ (${a}/${o} definitions)`);for(const r of[...n,...s])if(r.stats){const l=(r.stats.scanRatio*100).toFixed(1);pt.log(` ${r.property}: scanned ${r.stats.dirtyBands}/${r.stats.totalBands} bands (${l}%)`)}}else{const r=[...i.domainBanding.keyDefs.filter(c=>!c.applied).map(c=>c.reason),...i.domainBanding.valueDefs.filter(c=>!c.applied).map(c=>c.reason)],l=[...new Set(r)].join(", ");pt.log(` Domain Banding: ✗ (${l})`)}}if(i.sharedDatumIndices){const n=i.sharedDatumIndices.applied?"✓":"✗",s=`${i.sharedDatumIndices.sharedGroupCount}/${i.sharedDatumIndices.totalGroupCount}`;pt.log(` Shared DatumIndices: ${n} (${s} groups)`)}if(i.batchMerging){const n=(i.batchMerging.mergeRatio*100).toFixed(0),s=`${i.batchMerging.originalBatchCount} → ${i.batchMerging.mergedBatchCount}`;pt.log(` Batch Merging: ${s} (${n}% reduction)`)}}}var FG=1e3;function HG(t,e,i){const n=t.filter(s=>typeof s=="number"&&Number.isFinite(s));return n.length>0?i(n):e}function rr(t){return t.input.count<=FG}function jG(t){return t!=null&&Af(t)}function x7(t){return t!=null}function v7(t){return!0}function GG(t,e){switch(t){case"number":case"log":case"time":case"unit-time":case"ordinal-time":case"color":return jG;default:return e?v7:x7}}function UG(t){switch(t){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function uu(t,e,i={}){const n=i.allowNullKey??!1;return{property:t,type:"key",valueType:UG(e),validation:i.validation??GG(e,n),...i}}function Ci(t,e,i={}){const n=i.allowNullKey??!1;return{property:t,type:"value",valueType:UG(e),validation:i.validation??GG(e,n),...i}}function S7(t,e={}){return{property:t,type:"value",valueType:"range",missingValue:1,processor:function(){return function(){return 1}},...e}}var M7=function(t){return t};function WG(...t){const e=t.filter(i=>i!=null);return e.length===0?()=>M7:e.length===1?e[0]:function(){const n=e.map(s=>s());return function(a,o){return n.reduce((r,l)=>l(r,o),a)}}}function D7(t,e={}){const{min:i=-1/0,max:n=1/0,processor:s,...a}=e;return{type:"value",property:t,valueType:"range",validation:jG,processor:WG(s,function(){return function(l){return Ae(l)?Nt(i,l,n):l}}),...a}}function kN(t,e,i={}){const{onlyPositive:n,processor:s,...a}=i;return{...Ci(t,e,a),processor:WG(s,Wq(n))}}function A7(t,e,i={}){return{...Ci(t,e,i),processor:Kq()}}function Wd(t,e,i,n){return[Ci(t,n,i),P7(i.groupId,e,i.separateNegative),...i.rangeId==null?[]:[Gq(i.rangeId,i.groupId)]]}var KG={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer(){let t=Number.NaN;return function(i,n){const s=n[0],a=typeof s=="number"?s:Number(s);if(!Number.isFinite(a))return i;const o=t;if(t=a,!Number.isFinite(t))return i;const r=Math.abs(a-o),l=i??1/0;return r>0&&rMath.min(...e))},needsOverlap:!0},YG={type:"reducer",property:"largestKeyInterval",initialValue:-1/0,reducer(){let t=Number.NaN;return function(i,n){const s=n[0],a=typeof s=="number"?s:Number(s);if(!Number.isFinite(a))return i;const o=t;if(t=a,!Number.isFinite(t))return i;const r=Math.abs(a-o),l=i??-1/0;return r>0&&r>l?r:l}},supportsBanding:!0,combineResults(t){return HG(t,-1/0,e=>Math.max(...e))},needsOverlap:!0},I7={type:"processor",property:"sortedGroupDomain",calculate:function({domain:{groups:e}}){return e?.slice().sort((i,n)=>{for(let s=0;s{if(n===0)return 0;const s=(i??0)*t/n;return s>=0?Math.min(t,s):Math.max(-t,s)};return()=>()=>(i,n,s,a)=>{const o=C7(i,n,s,a);for(const r of n){const l=s.datumIndices[r];if(l!=null)for(const c of l){const u=a+c,d=i[r],g=d[u];if(g==null){d[u]=void 0;continue}d[u]=e(g,o)}}}}function C7(t,e,i,n){const s=[0,0];for(const a of e){const o=t[a],r=i.datumIndices[a];if(r!=null)for(const l of r){const c=n+l,u=o[c];if(u==null)continue;const d=typeof u=="number"?u:Math.max(...u.map(f=>f??0)),g=d<0?0:1;g===0?s[g]=Math.min(s[g],d):s[g]=Math.max(s[g],d)}}return Math.max(Math.abs(s[0]),s[1])}function jD(t,e){return{type:"group-value-processor",matchGroupIds:t,adjust:Wf({normaliseTo:e},k7)}}function w7({normaliseTo:t,zeroDomain:e,rangeMin:i,rangeMax:n}){const s=t[1]-t[0],a=function(r,l,c){const u=t[0]+(r-l)/c*s;return c===0?e:u>=t[1]?t[1]:uu.scopes.includes(t)&&u.id===e),r=s.defs.values.findIndex(u=>u.scopes.includes(t)&&u.id===i),l=s.columns[o],c=s.columns[r];if(l.length!==c.length)return!0;for(let u=0;uMath.abs(l[u]))return!0;return!1}}function T7(t,e,i){return{type:"processor",property:"filteredValueExceedUnfiltered",calculate:Wf([t,e,i],N7)}}var vb=1,AM=2;function L7(t,e,i){let n=vb|AM;if(t.valueType==="category")return e.lengtho)&&(n&=~AM),Number.isFinite(o)&&s===o&&(n&=~vb),s=o}return n}function O7(t){return function(i,n){if(!rr(i))return;const{keys:s,values:a}=i.defs,{input:o,domain:{values:r},columns:l}=i;let c=!0,u=!0;if(o.count!==0){const d=i[hu];for(let g=0;(c||u)&&g0){let g=vb|AM;for(let f=0;g!==0&&fA.get(t)),u=n.keys.map(A=>A.get(t)),d=e.columns,g=n.columns,f=z7(t,e,n);if(f==null)return s;const y=Math.max(e.input.count,n.input.count),x=n.defs.keys.some(A=>A.allowNullKey===!0);for(let A=0;A0||r.size>0||l.size>0,added:new Set(o.keys()),updated:new Set(r.keys()),removed:new Set(l.keys()),moved:new Set(a.keys())};return{...s,[t]:D}}}}function As(...t){if(t.length===1){const e=bM(t[0]);if(e===null)return bN;if(e===void 0)return xN;if(typeof e=="boolean"||typeof e=="number"||typeof e=="string")return e}return t.map(e=>{const i=bM(e);return i===null?bN:i===void 0?xN:i}).join("___")}var rB=class{constructor(t){this.maxAnimationTime=t,this.debug=Gt.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(Ey.map(e=>[e,[]])),this.skipAnimations=!1,this.animationTimeConsumed=0,this.isReady=!1}get size(){return this.controllers.size}get consumedTimeMs(){return this.animationTimeConsumed}isActive(){return this.controllers.size>0}getActiveControllers(){return this.phases.get(Ey[this.currentPhase])??[]}checkOverlappingId(t){t!=null&&this.controllers.has(t)&&(this.controllers.get(t).stop(),this.debug(`Skipping animation batch due to update of existing animation: ${t}`),this.skip())}addAnimation(t){if(t.isComplete)return;if(Ey.indexOf(t.phase)=0&&e?.splice(i,1)}progress(t){if(!this.isReady)return;let e=t===0?.01:t;const i=()=>{const c=Ey[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:c,phaseMeta:Zb[c]}};let{phase:n,phaseControllers:s,phaseMeta:a}=i();const o=()=>Ey[this.currentPhase]==null,r=()=>{for({phase:n,phaseControllers:s,phaseMeta:a}=i();!o()&&s.length===0;)this.currentPhase++,{phase:n,phaseControllers:s,phaseMeta:a}=i(),this.debug(`AnimationBatch - phase changing to ${n}`,{unusedTime:e},s)},l=this.controllers.size;this.debug(`AnimationBatch - ${t}ms; phase ${n} with ${s?.length} of ${l}`);do{const c=e,u=a.skipIfNoEarlierAnimations&&this.animationTimeConsumed===0;let d=0;for(const g of s)u?g.stop():e=Math.min(g.update(c),e),g.isComplete&&(d++,this.removeAnimation(g));this.animationTimeConsumed+=c-e,this.debug(`AnimationBatch - updated ${s.length} controllers; ${d} completed`,s),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),r()}while(e>0&&!o());this.animationTimeConsumed>this.maxAnimationTime&&(this.debug("Animation batch exceeded max animation time, skipping",[...this.controllers]),this.stop())}ready(){if(this.isReady)return;this.isReady=!0,this.debug(`AnimationBatch - ready; skipped: ${this.skipAnimations}`,[...this.controllers]);let t=!0;for(const[,e]of this.controllers)if(e.duration>0&&Zb[e.phase].skipIfNoEarlierAnimations!==!0){t=!1;break}if(!t)for(const[,e]of this.controllers)e.autoplay&&e.play(!0)}skip(t=!0){if(this.skipAnimations===!1&&t===!0){for(const e of this.controllers.values())e.stop();this.controllers.clear()}this.skipAnimations=t}play(){for(const t of this.controllers.values())t.play()}stop(){for(const t of this.controllers.values())try{t.stop(),this.removeAnimation(t)}catch(e){pt.error("Error during animation stop",e)}this.dispatchStopped()}stopByAnimationId(t){if(t!=null&&this.controllers.has(t)){const e=this.controllers.get(t);e&&(e.stop(),this.removeAnimation(e))}}stopByAnimationGroupId(t){for(const e of this.controllers.values())e.groupId===t&&this.stopByAnimationId(e.id)}dispatchStopped(){for(const t of this.stoppedCbs)t();this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}getRemainingTime(t){if(!this.isActive())return 0;let e=0;for(const[i,n]of this.phases)n.length!==0&&(t!=null&&t!==i||(e+=Math.max(...n.map(s=>s.isComplete?0:s.delay+s.duration-(s.elapsed??0)))));return e}destroy(){this.stop(),this.controllers.clear()}};function lB(t){return t==null?!0:!Number.isNaN(t)&&t>=0&&t<=2}var B7=class{constructor(t,e,i){this.agDocument=t,this.interactionManager=e,this.chartUpdateMutex=i,this.defaultDuration=1e3,this.maxAnimatableItems=FG,this.batch=new rB(this.defaultDuration*1.5),this.debug=Gt.create(!0,"animation"),this.events=new cr,this.rafAvailable=typeof requestAnimationFrame<"u",this.isPlaying=!0,this.requestId=null,this.skipAnimations=!0,this.currentAnonymousAnimationId=0,this.cumulativeAnimationTime=0}addListener(t,e){return this.events.on(t,e)}animate(t){const e=this.batch;try{e.checkOverlappingId(t.id)}catch(r){this.failsafeOnError(r);return}let{id:i}=t;i==null&&(i=`__${this.currentAnonymousAnimationId}`,this.currentAnonymousAnimationId+=1);const n=this.isSkipped()&&!t.forceAnimation||t.phase==="none";n&&this.debug("AnimationManager - skipping animation");const{delay:s,duration:a}=t;if(!lB(s))throw new Error(`Animation delay of ${s} is unsupported (${i})`);if(!lB(a))throw new Error(`Animation duration of ${a} is unsupported (${i})`);const o=new Oq({...t,id:i,skip:n,autoplay:this.isPlaying?t.autoplay:!1,phase:t.phase,defaultDuration:this.defaultDuration});if(!this.forceTimeJump(o,this.defaultDuration))return this.batch.addAnimation(o),o}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(t){this.failsafeOnError(t)}this.requestAnimation()}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(t){try{this.batch.stopByAnimationId(t)}catch(e){this.failsafeOnError(e)}}stopByAnimationGroupId(t){try{this.batch.stopByAnimationGroupId(t)}catch(e){this.failsafeOnError(e)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(t=!0){this.skipAnimations=t}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}getRemainingTime(t){return this.batch.getRemainingTime(t)}getCumulativeAnimationTime(){return this.cumulativeAnimationTime}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:new Error("Stack trace for animation skip tracking").stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(t){this.requestId=this.agDocument.requestAnimationFrame(e=>{t(e).catch(i=>pt.error(i))})}forceTimeJump(t,e){return!1}requestAnimation(){if(!this.rafAvailable||!this.batch.isActive()||this.requestId!==null)return;let t;const e=async i=>{await this.debug.group("AnimationManager.onAnimationFrame()",async()=>{const n=()=>{const s=i-(t??i);t=i,this.debug("AnimationManager",{controllersCount:this.batch.size,deltaTime:s}),this.interactionManager.pushState(4);try{this.batch.progress(s),this.cumulativeAnimationTime+=s}catch(a){this.failsafeOnError(a)}this.events.emit("animation-frame",{type:"animation-frame",deltaMs:s})};this.isSkippingFrames()?await this.chartUpdateMutex.acquireImmediately(n):await this.chartUpdateMutex.acquire(n),this.batch.isActive()?this.scheduleAnimationFrame(e):(this.batch.stop(),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}))})};this.events.emit("animation-start",{type:"animation-start",deltaMs:0}),this.scheduleAnimationFrame(e)}cancelAnimation(){this.requestId!==null&&(this.agDocument.cancelAnimationFrame(this.requestId),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}),this.requestId=null,this.startBatch())}failsafeOnError(t,e=!0){pt.error("Error during animation, skipping animations",t),e&&this.cancelAnimation()}startBatch(t){this.debug(`AnimationManager - startBatch() with skipAnimations=${t}.`),this.reset(),this.batch.destroy(),this.batch=new rB(this.defaultDuration*1.5),t===!0&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(4),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(t){this.batch.stoppedCbs.add(t)}destroy(){this.stop(),this.events.clear()}},V7=class{constructor(){this.download={type:"action",showOn:"always",label:"contextMenuDownload",enabled:!0,action:void 0,items:void 0},this["zoom-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuZoomToCursor",enabled:!0,action:void 0,items:void 0},this["pan-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuPanToCursor",enabled:!0,action:void 0,items:void 0},this["reset-zoom"]={type:"action",showOn:"series-area",label:"contextMenuResetZoom",enabled:!0,action:void 0,items:void 0},this["toggle-series-visibility"]={type:"action",showOn:"legend-item",label:"contextMenuToggleSeriesVisibility",enabled:!0,action:void 0,items:void 0},this["toggle-other-series"]={type:"action",showOn:"legend-item",label:"contextMenuToggleOtherSeries",enabled:!0,action:void 0,items:void 0},this.separator={type:"separator",showOn:"always",label:"separator",enabled:!0,action:void 0,items:void 0}}},_7=class{constructor(){this.defaults=["download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series"]}},F7=class{constructor(){this.items=new V7,this.lists=new _7}},$G=class{constructor(e){this.eventsHub=e,this.builtins=new F7,this.hiddenActions=new Set,this.toggle("zoom-to-cursor","hide"),this.toggle("pan-to-cursor","hide"),this.toggle("reset-zoom","hide")}static check(e,i){return i.showOn==e}static checkCallback(e,i,n){return e===i}dispatchContext(e,i,n,s){const{widgetEvent:a}=i;if(a.sourceEvent.defaultPrevented)return;const o=s?.x??i.canvasX,r=s?.y??i.canvasY,l={showOn:e,x:o,y:r,context:n,widgetEvent:a};this.eventsHub.emit("context-menu:setup",l),this.eventsHub.emit("context-menu:complete",l)}isVisible(e){return!this.hiddenActions.has(e)}toggle(e,i){switch(i??(i=this.isVisible(e)?"hide":"show"),i){case"show":this.hiddenActions.delete(e);break;case"hide":this.hiddenActions.add(e);break}}},XG=class ZG{constructor(e){this.eventsHub=e,this.highlightStates=new DM,this.pendingUnhighlights=new Map,this.unhighlightDelay=100,this.highlightInViewport=!0}updateHighlight(e,i,n=!1,s){const a=this.getActiveHighlight();if(i==null&&n&&this.unhighlightDelay>0){if(!this.pendingUnhighlights.has(e)){const r=RT(()=>{this.applyPendingUnhighlight(e)});this.pendingUnhighlights.set(e,{scheduler:r}),r.schedule(this.unhighlightDelay)}return}const o=this.pendingUnhighlights.get(e);o&&(o.scheduler.cancel(),this.pendingUnhighlights.delete(e)),i?this.highlightStates.set(e,i):this.highlightStates.delete(e),this.maybeEmitChange(e,a,s)}maybeEmitChange(e,i,n){const s=n??!0,a=this.getActiveHighlight();if(!this.isEqual(a,i)||this.highlightInViewport!==s){const o=a?.series?.isHighlightEnabled()===!1;this.highlightInViewport=s,this.eventsHub.emit(ZG.HIGHLIGHT_CHANGE_EVENT,{callerId:e,currentHighlight:a,previousHighlight:i,highlightSuppressed:o,highlightInViewport:s})}}applyPendingUnhighlight(e){if(!this.pendingUnhighlights.has(e))return;this.pendingUnhighlights.delete(e);const i=this.getActiveHighlight();this.highlightStates.delete(e),this.maybeEmitChange(e,i,!0)}getActiveHighlight(){return this.highlightStates.stateValue()}destroy(){for(const{scheduler:e}of this.pendingUnhighlights.values())e.cancel();this.pendingUnhighlights.clear()}isEqual(e,i){return e===i?!0:e!=null&&i!=null&&e.series===i.series&&this.idsMatch(e,i)&&this.pointsMatch(e,i)&&e.datum===i.datum}idsMatch(e,i){return e.itemId!=null&&i.itemId!=null&&e.itemId===i.itemId||e.datumIndex!=null&&i.datumIndex!=null&&ks(e.datumIndex,i.datumIndex)}pointsMatch(e,i){return this.pointsAreEqual(e.point,i.point)&&this.pointsAreEqual(e.midPoint,i.midPoint)&&this.pointsAreEqual(e.xBar?.lowerPoint,i.xBar?.lowerPoint)&&this.pointsAreEqual(e.xBar?.upperPoint,i.xBar?.upperPoint)&&this.pointsAreEqual(e.yBar?.lowerPoint,i.yBar?.lowerPoint)&&this.pointsAreEqual(e.yBar?.upperPoint,i.yBar?.upperPoint)}pointsAreEqual(e,i){return e===i||e!==void 0&&i!==void 0&&e.x===i.x&&e.y===i.y}};XG.HIGHLIGHT_CHANGE_EVENT="highlight:change";var qG=XG,QG=(t=>(t[t.None=0]="None",t[t.Item=1]="Item",t[t.Series=2]="Series",t[t.OtherSeries=3]="OtherSeries",t[t.OtherItem=4]="OtherItem",t))(QG||{}),UT=[0,1,2,3,4];function H7(t){switch(t){case 1:return["highlightedItem","highlightedSeries"];case 4:return["unhighlightedItem","highlightedSeries"];case 2:return["highlightedSeries"];case 3:return["unhighlightedSeries"];case 0:return[]}}function em(t){const e=i=>i;switch(t){case 1:return"highlighted-item";case 4:return"unhighlighted-item";case 2:return"highlighted-series";case 3:return"unhighlighted-series";case 0:return"none";default:return e(t)}}var _u=class extends xt{};T([b],_u.prototype,"fill",2);T([b],_u.prototype,"fillOpacity",2);T([b],_u.prototype,"stroke",2);T([b],_u.prototype,"strokeWidth",2);T([b],_u.prototype,"strokeOpacity",2);T([b],_u.prototype,"lineDash",2);T([b],_u.prototype,"lineDashOffset",2);var Hc=class extends xt{constructor(){super(...arguments),this.enabled=!0,this.range="tooltip",this.bringToFront=!0,this.highlightedItem={},this.unhighlightedItem={},this.highlightedSeries={},this.unhighlightedSeries={}}getStyle(e){const i=H7(e);return i.length===0?{}:Et(...i.map(n=>this[n]))}};T([b],Hc.prototype,"enabled",2);T([b],Hc.prototype,"range",2);T([b],Hc.prototype,"bringToFront",2);T([b],Hc.prototype,"highlightedItem",2);T([b],Hc.prototype,"unhighlightedItem",2);T([b],Hc.prototype,"highlightedSeries",2);T([b],Hc.prototype,"unhighlightedSeries",2);var Ol=class extends xt{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};T([b],Ol.prototype,"start",2);T([b],Ol.prototype,"stop",2);T([b],Ol.prototype,"fill",2);T([b],Ol.prototype,"fillOpacity",2);T([b],Ol.prototype,"stroke",2);T([b],Ol.prototype,"strokeWidth",2);T([b],Ol.prototype,"strokeOpacity",2);T([b],Ol.prototype,"lineDash",2);T([b],Ol.prototype,"lineDashOffset",2);var UD=class{constructor(){this.key="x",this.segments=new ss(Ol)}};T([b],UD.prototype,"enabled",2);T([b],UD.prototype,"key",2);T([b],UD.prototype,"segments",2);var Fu=class extends xt{constructor(){super(...arguments),this.type="gradient",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1,this.colorSpace="rgb"}};T([b],Fu.prototype,"type",2);T([b],Fu.prototype,"colorStops",2);T([b],Fu.prototype,"bounds",2);T([b],Fu.prototype,"gradient",2);T([b],Fu.prototype,"rotation",2);T([b],Fu.prototype,"reverse",2);T([b],Fu.prototype,"colorSpace",2);var En=class extends xt{constructor(){super(...arguments),this.type="pattern",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.scale=1,this.reverse=!1,this.pattern="forward-slanted-lines",this.width=26,this.height=26,this.padding=6,this.fill="black",this.fillOpacity=1,this.backgroundFill="white",this.backgroundFillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0}};T([b],En.prototype,"type",2);T([b],En.prototype,"colorStops",2);T([b],En.prototype,"bounds",2);T([b],En.prototype,"gradient",2);T([b],En.prototype,"rotation",2);T([b],En.prototype,"scale",2);T([b],En.prototype,"reverse",2);T([b],En.prototype,"path",2);T([b],En.prototype,"pattern",2);T([b],En.prototype,"width",2);T([b],En.prototype,"height",2);T([b],En.prototype,"padding",2);T([b],En.prototype,"fill",2);T([b],En.prototype,"fillOpacity",2);T([b],En.prototype,"backgroundFill",2);T([b],En.prototype,"backgroundFillOpacity",2);T([b],En.prototype,"stroke",2);T([b],En.prototype,"strokeOpacity",2);T([b],En.prototype,"strokeWidth",2);var jc=class extends xt{constructor(){super(...arguments),this.type="image",this.url="",this.rotation=0,this.scale=1,this.backgroundFill="black",this.backgroundFillOpacity=1,this.repeat="no-repeat",this.fit="contain"}};T([b],jc.prototype,"type",2);T([b],jc.prototype,"url",2);T([b],jc.prototype,"rotation",2);T([b],jc.prototype,"scale",2);T([b],jc.prototype,"backgroundFill",2);T([b],jc.prototype,"backgroundFillOpacity",2);T([b],jc.prototype,"repeat",2);T([b],jc.prototype,"fit",2);var Fr=class extends xt{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new Hc}handleUnknownProperties(e,i){"context"in i&&(this.context=i.context,e.delete("context")),"allowNullKeys"in i&&(this.allowNullKeys=i.allowNullKeys,e.delete("allowNullKeys"))}};T([b],Fr.prototype,"id",2);T([b],Fr.prototype,"visible",2);T([b],Fr.prototype,"focusPriority",2);T([b],Fr.prototype,"showInLegend",2);T([b],Fr.prototype,"cursor",2);T([b],Fr.prototype,"nodeClickRange",2);T([b],Fr.prototype,"highlight",2);function cB(t,e){if(e.length===0)return[!1,!1];const i=e[0],n=e.at(-1);if(typeof i=="string"||i===null||i===void 0)return[t===i,t===n];if(t==null)return[!1,!1];const s=t.valueOf();if(i==null||n==null)return[!1,!1];let a=i.valueOf(),o=n.valueOf();return a>o&&([a,o]=[o,a]),[s===a,s===o]}function WT(t,e,i,n,s,a){const[o,r]=cB(e,a),[l,c]=cB(t,s);return{xKey:i,yKey:n,xValue:t,yValue:e,first:l,last:c,min:o,max:r}}function Qb(t,e,[i,n],s){let a=vf(0,e-1,r=>{const l=t===1?r:e-r,c=s(l)?.[1]??Number.NaN;return!Number.isFinite(c)||c>=i})??0,o=Dr(0,e-1,r=>{const l=t===1?r:e-r,c=s(l)?.[0]??Number.NaN;return!Number.isFinite(c)||c<=n})??e-1;return t===-1&&([a,o]=[e-o,e-a]),a=Math.max(a,0),o=Math.min(o+1,e),[a,o]}function KT(t,e,i){if(i){const{x:s,y:a,width:o,height:r}=i;return{canvasX:s+o/2,canvasY:a+r/2}}const n=e.yBar?.upperPoint??e.midPoint??t.datumMidPoint?.(e);if(n){const{x:s,y:a}=Ti.toCanvasPoint(t.contentGroup,n.x,n.y);return{canvasX:Math.round(s),canvasY:Math.round(a)}}}function j7(t,e,i,n,s){let a=-1,o=0,r=0,l=!1;for(;o=0&&(r+=1),l&&r<0&&(r-=1),ce){l=!0;continue}s(c)&&(o+=1)}return o}function YT(t){const e={};for(const i of UT)e[i]=t(void 0,!1,i);return e}function G7(t,...e){const i={};for(const n of e??["default"])for(const s of UT){const a=i[n]??(i[n]={});a[s]=t(void 0,!1,s,n)}return i}function CN(t){return(t?.opacity??1)<1||(t?.fillOpacity??1)<1||(t?.strokeOpacity??1)<1}var hB=new Map;function U7(t){if(t==null)return!1;const e=t.fill;if(!zi(e))return!1;const i=e.trim(),n=i.toLowerCase();if(n==="transparent"||n==="none")return!1;let s=hB.get(i);if(s==null){try{s=se.fromString(i).a===1}catch{s=!1}hB.set(i,s)}return s}function W7(t,e){return t!=="cutout"?t:U7(e)?"cutout":"overlay"}function JG(t,e,i){for(const n of e??[])switch(typeof t){case"string":if(n.itemId===t)return n;if(n.itemId===void 0&&i!==void 0){const s=n.datum?.[i];if(s!=null&&String(s)===t)return n}break;case"number":if(n.datumIndex===t||n.itemId===void 0&&i!==void 0&&n.datum?.[i]===t)return n;break;default:return t}}var IM=class{constructor(e,i,n,s){this.domManager=n,this.tooltip=s,this.stateTracker=new DM,this.suppressState=new DM(!1),this.appliedState=null,this.pendingRemovals=new Map,this.removeDelay=100,this.cleanup=new qe,this.cleanup.register(s.setup(i,n),e.on("dom:hidden",()=>this.tooltip.hide()))}destroy(){for(const{scheduler:e}of this.pendingRemovals.values())e.cancel();this.pendingRemovals.clear(),this.cleanup.flush()}updateTooltip(e,i,n,s){const a=this.pendingRemovals.get(e);a&&(a.scheduler.cancel(),this.pendingRemovals.delete(e)),n??(n=this.stateTracker.get(e)?.content),this.stateTracker.set(e,{meta:i,content:n,pagination:s}),this.applyStates()}removeTooltip(e,i,n=!1){if(n&&this.removeDelay>0){const a=this.pendingRemovals.get(e);if(a){i&&(a.lastMeta=i);return}const o=RT(()=>{this.applyPendingRemoval(e)});this.pendingRemovals.set(e,{scheduler:o,lastMeta:i}),o.schedule(this.removeDelay);return}const s=this.pendingRemovals.get(e);s&&(s.scheduler.cancel(),this.pendingRemovals.delete(e)),this.stateTracker.delete(e),this.applyStates()}suppressTooltip(e){this.suppressState.set(e,!0)}unsuppressTooltip(e){this.suppressState.delete(e)}applyPendingRemoval(e){this.pendingRemovals.has(e)&&(this.pendingRemovals.delete(e),this.stateTracker.delete(e),this.applyStates())}applyStates(){const e=this.stateTracker.stateId(),i=e?this.stateTracker.get(e):void 0;if(this.suppressState.stateValue()||i?.meta==null||i?.content==null){this.appliedState=null,this.tooltip.hide();return}const n=this.domManager.getBoundingClientRect(),s=this.tooltip.bounds==="extended"?this.domManager.getOverlayClientRect():n;if(ks(this.appliedState?.content,i?.content)&&ks(this.appliedState?.pagination,i?.pagination)){const a=this.tooltip.isVisible();this.tooltip.show(s,n,i?.meta,null,void 0,a)}else this.tooltip.show(s,n,i?.meta,i?.content,i?.pagination);this.appliedState=i}static makeTooltipMeta(e,i,n,s){const{canvasX:a,canvasY:o}=e,r=i.properties.tooltip,{placement:l,anchorTo:c,xOffset:u,yOffset:d}=r.position,g=KT(i,n,s);return{canvasX:a,canvasY:o,nodeCanvasX:g?.canvasX??a,nodeCanvasY:g?.canvasY??o,enableInteraction:r.interaction?.enabled??!1,showArrow:r.showArrow,position:{placement:l,anchorTo:c,xOffset:u,yOffset:d}}}},uB=3,K7=505,dB=30;function TC(t,e){const{device:i,offsetX:n,offsetY:s,clientX:a,clientY:o,currentX:r,currentY:l,sourceEvent:c}=e;return{type:t,device:i,offsetX:n,offsetY:s,clientX:a,clientY:o,currentX:r,currentY:l,sourceEvent:c}}function pB(t,e){const i=t*t+e*e,n=uB*uB;return i>=n}function Y7(t,e){const i=t.clientX-e.clientX,n=t.clientY-e.clientY,s=i*i+n*n,a=dB*dB;return s=2){const i=e[0];this.domainNeedsValueOf=i!=null&&typeof i=="object",this.domainNeedsValueOf?(this.d0Cache=e[0].valueOf(),this.d1Cache=e[1].valueOf()):(this.d0Cache=e[0],this.d1Cache=e[1])}else this.d0Cache=Number.NaN,this.d1Cache=Number.NaN}normalizeDomains(...e){return e3(...e)}calcBandwidth(e=1,i=1){const{domain:n}=this,s=this.getPixelRange();if(n.length===0)return s;let o=Math.abs(this.d1Cache-this.d0Cache)/e+1;if(i!==0){const r=Math.floor(s);o=Math.min(o,r)}return s/Math.max(1,o)}convert(e,i){const{domain:n}=this;if(!n||n.length<2||e==null)return Number.NaN;const{range:s}=this,a=i?.clamp??this.defaultClamp;let o=this.d0Cache,r=this.d1Cache,l=typeof e=="number"?e:e.valueOf();if(this.transform&&(o=this.transform(o),r=this.transform(r),l=this.transform(l)),a){const[u,d]=xi([o,r]);if(ld)return s[1]}if(o===r)return(s[0]+s[1])/2;if(l===o)return s[0];if(l===r)return s[1];const c=s[0];return c+(l-o)/(r-o)*(s[1]-c)}invert(e,i){const{domain:n}=this;if(n.length<2)return;let s=this.d0Cache,a=this.d1Cache;this.transform&&(s=this.transform(s),a=this.transform(a));const{range:o}=this,[r,l]=o;let c;return r===l?c=this.toDomain((s+a)/2):c=this.toDomain(s+(e-r)/(l-r)*(a-s)),this.transformInvert?this.transformInvert(c):c}getDomainMinMax(){return RD(this.domain)}getPixelRange(){const[e,i]=this.range;return Math.abs(i-e)}};t3.defaultTickCount=5;var ti=t3;function e3(...t){let e,i=1/0,n,s=-1/0;for(const a of t){const o=a.domain;for(const r of o){const l=r.valueOf();ls&&(s=l,n=r)}}return e!=null&&n!=null?{domain:[e,n],animatable:!0}:{domain:[],animatable:!1}}var $T=class i3 extends OD{constructor(){super(...arguments),this.invalid=!0,this.range=[0,1],this.round=!1,this._bandwidth=1,this._step=1,this._inset=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0}static is(e){return e instanceof i3}get bandwidth(){return this.refresh(),this._bandwidth}get step(){return this.refresh(),this._step}get inset(){return this.refresh(),this._inset}get rawBandwidth(){return this.refresh(),this._rawBandwidth}set padding(e){e=Nt(0,e,1),this._paddingInner=e,this._paddingOuter=e}get padding(){return this._paddingInner}set paddingInner(e){this.invalid=!0,this._paddingInner=Nt(0,e,1)}get paddingInner(){return this._paddingInner}set paddingOuter(e){this.invalid=!0,this._paddingOuter=Nt(0,e,1)}get paddingOuter(){return this._paddingOuter}getBandCountForUpdate(){return this.bands.length}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&pt.warnOnce("Expected update to not invalidate scale"))}convert(e,i){this.refresh();const n=this.findIndex(e,i?.alignment,i?.alignmentExclusive);return n==null||n<0||n>=this.getBandCountForUpdate()?Number.NaN:this.ordinalRange(n)}getDomainMinMax(){return RD(this.domain)}invertNearestIndex(e){this.refresh();const i=this.getBandCountForUpdate();if(i===0)return-1;let n=0,s=i-1,a=1/0,o=0;for(;n<=s;){const r=Math.trunc((s+n)/2),l=this.ordinalRange(r),c=Math.abs(l-e);if(c===0)return r;c0,c=l?Math.floor(r):r;let u=e+(o-c*(a-n))/2,d=c*(1-n);l&&(u=Math.round(u),d=Math.round(d)),this._step=c,this._inset=u,this._bandwidth=d,this._rawBandwidth=r*(1-n)}ordinalRange(e){const{_inset:i,_step:n,range:s}=this,a=Math.min(s[0],s[1]),o=Math.max(s[0],s[1]);return Nt(a,i+n*e,o)}};T([ED],$T.prototype,"range",2);T([ED],$T.prototype,"round",2);var Rr=$T,Z7=1e3,gB=20;function fB(t,e=0,i=t.length-1){const n=i-e+1;if(n<2)return{isUniform:!1};if(e<0||i>=t.length)return{isUniform:!1};const s=Array.from({length:gB},(l,c)=>e+Math.floor(c*(n-1)/(gB-1))),a=s.map(l=>t[l].valueOf()),o=(a.at(-1)-a[0])/(n-1);if(!Number.isFinite(o)||o===0)return{isUniform:!1};const r=Math.abs(o*.01);for(let l=1;lr)return{isUniform:!1}}return{isUniform:!0,interval:o}}var Gc=class n3 extends Rr{static is(e){return e instanceof n3}toDomain(e){return new Date(e)}get reversed(){const{domain:e}=this;return e.length>0&&e[0].valueOf()>e.at(-1).valueOf()}get numericBands(){return this.bands.map(e=>e.valueOf())}convert(e,i){this.refresh(),e instanceof Date||(e=new Date(e));const{domain:n,reversed:s}=this,a=this.numericBands,o=a.length;if(n.length<=0)return Number.NaN;const r=this.ordinalRange(0),l=this.ordinalRange(o-1);if(o===0)return r;if(i?.clamp===!0){const{range:I}=this;if(e.valueOf()a.at(-1))return I[1]}if((i?.alignment??wi.Leading)!==wi.Interpolate){const I=super.convert(e,i);return s?l-(I-r):I}const u=e.valueOf();let d=this.findIndex(e)??0,g;s?(d=Math.min(Math.max(d,1),o-1),g=-1):(d=Math.min(Math.max(d,0),o-2),g=1);const f=a[d],y=a[d+g],x=this.ordinalRange(d),S=this.ordinalRange(d+g),A=(u-f)/(y-f)*(S-x)+x;return s?l-(A-r):A}invert(e,i=!1){this.refresh();const{domain:n}=this;if(n.length<=0)return;const s=this.bands,a=this.getBandCountForUpdate(),o=n[0].valueOf()>n.at(-1).valueOf();let r;return i?r=this.invertNearestIndex(e-this.bandwidth/2):r=vf(0,a-1,c=>this.ordinalRange(c)>=e)??a-1,s[o?a-1-r:r]}getUniformityCache(e){}findIndex(e,i=wi.Leading,n=!1){if(e==null)return;const s=this.numericBands,a=s.length;if(a===0)return;if(a===1)return 0;const o=e.valueOf();return i===wi.Trailing!==n?vf(0,a-1,l=>s[l]>=o):Dr(0,a-1,l=>s[l]<=o)}},s3=(t=>(t[t.None=0]="None",t[t.WhenViewportTooSmallScaleXYProportionally=1]="WhenViewportTooSmallScaleXYProportionally",t[t.WhenViewportTooSmallScaleXYDisproportionally=2]="WhenViewportTooSmallScaleXYDisproportionally",t))(s3||{});function Lh(t,e,i,n,s){return e+(n-e)*((s-t)/(i-t))}function mB(t,e,i,n,s){return t+(s-e)*((i-t)/(n-e))}function yB(t,e,i){return[mB(t,i.min,e,i.max,0),mB(t,i.min,e,i.max,1)]}function q7(t,e,i){const[n,s]=yB(t.x1,t.x2,e),[a,o]=yB(t.y1,t.y2,i);return{x1:n,x2:s,y1:a,y2:o}}function a3(t,e){const i=e.width>t.width,n=e.height>t.height;return{x:i,y:n}}function bB(t,e,i,n,s,a){if(i<=s&&a<=n)return i;const o=s-i,r=a-n,l=Math.abs(o)xe((e,{options:i})=>!ti.is(t?.scale)&&!Gc.is(t?.scale)||e==null||i.end==null?!0:e1)&&(pt.warnOnce(`Attempted to update axis (${e}) zoom to an invalid ratio of [{ min: ${n}, max: ${s} }], expecting a ratio of 0 to 1. Ignoring.`),delete t[e])}}function vB(t,e){const i={};for(const{id:n,direction:s}of t){const{min:a,max:o}=e[n]??{min:0,max:1};i[n]={min:a,max:o,direction:s}}return i}function SB(t,e){const i=hl(t),n=hl(e);if(i.length!==n.length)return!1;for(const s of i)if(!n.includes(s))return!1;for(const s of i){const a=t[s],o=e[s];if(a!==o&&(a==null||o==null||a.direction!==o.direction||a.min!==o.min||a.max!==o.max))return!1}return!0}function sQ(t){return{source:"user-interaction",sourceDetail:t}}var r3=class extends PT{constructor(t,e,i){super(),this.eventsHub=t,this.fireChartEvent=i,this.mementoOriginatorKey="zoom",this.state={},this.axes=[],this.didLayoutAxes=!1,this.lastRestoredState={},this.restoreRequiredRangeIterations=0,this.independentAxes=!1,this.navigatorModule=!1,this.zoomModule=!1,this.debug=Gt.create(!0,"zoom"),this.panToBBoxScalingMode=2,this.pendingMemento=void 0,this.cleanup.register(t.on("zoom:change-request",n=>{this.constrainZoomToRequiredWidth(n)}),e.addListener("pre-series-update",({requiredRangeRatio:n,requiredRangeDirection:s,requiredRange:a})=>{this.didLayoutAxes=!0;const{pendingMemento:o}=this;o?this.restoreMemento(o.version,o.mementoVersion,o.memento):this.restoreRequiredRange(n,s,a),this.updateZoom({source:"chart-update",sourceDetail:"unspecified"})}),e.addListener("update-complete",({wasShortcut:n})=>{if(!n&&this.pendingZoomEventSource){const s=this.pendingZoomEventSource;this.fireChartEvent({type:"zoom",source:s,...this.getMementoRanges()}),this.pendingZoomEventSource=void 0}}))}toCoreZoomState(t){const e={};let i;const{state:n}=this;if(this.independentAxes){const s=this.getPrimaryAxisId(z.X),a=this.getPrimaryAxisId(z.Y);i=[],s&&i.push(s),a&&i.push(a)}else i=hl(n);for(const s of i){const{direction:a}=n[s]??{};if(a!=null){const o=t[a];if(o){const{min:r,max:l}=o;e[s]={min:r,max:l,direction:a}}}}return e}toZoomState(t){let e,i;for(const n of hl(t)){const{min:s,max:a,direction:o}=t[n];o===z.X?e??(e={min:s,max:a}):o===z.Y&&(i??(i={min:s,max:a}))}if(e||i)return{x:e,y:i}}createMemento(){return this.getMementoRanges()}guardMemento(t,e){if(t==null)return!0;if(!Bt(t))return!1;const i=this.getPrimaryAxis(z.X),n=this.getPrimaryAxis(z.Y),s={rangeX:{start:xB(i),end:jt},rangeY:{start:xB(n),end:jt},ratioX:{start:jt,end:jt},ratioY:{start:jt,end:jt},autoScaledAxes:jt},{invalid:a}=ts(t,s);return a.length>0?(e.push(...a.map(String)),!1):!0}restoreMemento(t,e,i){if(!this.axes||!this.didLayoutAxes){this.pendingMemento={version:t,mementoVersion:e,memento:i};return}this.pendingMemento=void 0;const n=Ni(this.getZoom());i?.rangeX?n.x=this.rangeToRatioDirection(z.X,i.rangeX)??{min:0,max:1}:i?.ratioX?n.x={min:i.ratioX.start??0,max:i.ratioX.end??1}:n.x={min:0,max:1};const{navigatorModule:s,zoomModule:a}=this;this.eventsHub.emit("zoom:load-memento",{zoom:n,memento:i,navigatorModule:s,zoomModule:a});const o=this.toCoreZoomState(n);this.lastRestoredState=za(le(o)),this.updateChanges({source:"state-change",sourceDetail:"internal-restoreMemento",changes:o,isReset:!1})}findAxis(t){for(const e of this.axes)if(e.id===t)return e}getAxes(){return this.axes}setAxes(t){const{axes:e}=this;e.length=0;for(const s of t)"range"in s&&e.push(s);const i=this.state,n=vB(t,i);this.state=n,this.lastRestoredState=vB(t,this.lastRestoredState),this.updateChanges({source:"chart-update",sourceDetail:"internal-setAxes",changes:n,isReset:!1})}setIndependentAxes(t=!0){this.independentAxes=t}setNavigatorEnabled(t=!0){this.navigatorModule=t}setZoomModuleEnabled(t=!0){this.zoomModule=t}isNavigatorEnabled(){return this.navigatorModule}isZoomEnabled(){return this.zoomModule}updateZoom({source:t,sourceDetail:e},i){const n=this.toCoreZoomState(i??{});return this.updateChanges({source:t,sourceDetail:e,changes:n,isReset:!1})}computeChangedAxesIds(t){const e=[],i=this.state;for(const n of hl(t)){const s=t[n]??{min:0,max:1},a=i[n];(a==null||a.min!==s.min||a.max!==s.max)&&e.push(n)}return e}updateChanges(t){const{source:e,sourceDetail:i,isReset:n,changes:s}=t;nQ(s);const a=this.computeChangedAxesIds(s),o=le(this.state),r=le(this.state);for(const l of a){const c=r[l];c!=null&&(c.min=s[l]?.min??0,c.max=s[l]?.max??1)}return this.state=r,this.dispatch(e,i,a,n,o)}resetZoom({source:t,sourceDetail:e}){this.updateChanges({source:t,sourceDetail:e,changes:this.getRestoredZoom(),isReset:!0})}resetAxisZoom({source:t,sourceDetail:e},i){this.updateChanges({source:t,sourceDetail:e,changes:{[i]:this.getRestoredZoom()[i]},isReset:!0})}panToBBox(t,e){if(!this.isZoomEnabled()&&!this.isNavigatorEnabled())return!1;const i=this.getZoom();if(i===void 0||!i.x&&!i.y)return!1;const{panToBBoxScalingMode:n}=this;if(!(t.width>0&&t.height>0&&(n!==0||Math.abs(e.width)<=Math.abs(t.width)&&Math.abs(e.height)<=Math.abs(t.height))))return pt.warnOnce("cannot pan to target BBox - chart too small?"),!1;const a=J7(n,t,i,e),o=this.toCoreZoomState(a);return this.updateChanges({source:"user-interaction",sourceDetail:"internal-panToBBox",changes:o,isReset:!1})}fireZoomPanStartEvent(t){this.eventsHub.emit("zoom:pan-start",{callerId:t})}updateWith({source:t,sourceDetail:e},i,n){const s=this.getPrimaryAxis(i);if(!s)return;const a=s.scale.getDomainMinMax();if(!a)return;const[o,r]=s.visibleRange,l=this.getRange(s.id,{min:o,max:r});if(!l)return;const[c,u]=a,{start:d,end:g}=l,f=n(c,u,d,g,t);if(!this.isValidUpdateWithResult(f)){this.resetZoom({source:t,sourceDetail:e});return}const[y,x]=f,S=this.rangeToRatioAxis(s,{start:y,end:x});S&&this.updateChanges({source:t,sourceDetail:e,changes:{[i]:S},isReset:!1})}isValidUpdateWith(t,e,i){const n=this.getPrimaryAxis(t);if(!n)return!0;const s=n.scale.getDomainMinMax();if(!s)return!0;const[a,o]=n.visibleRange,r=this.getRange(n.id,{min:a,max:o});if(!r)return!0;const[l,c]=s,{start:u,end:d}=r,g=e(l,c,u,d,i);if(!this.isValidUpdateWithResult(g))return!0;const[f,y]=g;let x=!0;return f!=null&&x&&(x=f>=l),y!=null&&x&&(x=y<=c),f!=null&&y!=null&&x&&(x=f<=y),x}getZoom(){return this.toZoomState(this.state)}getAxisZoom(t){return this.state[t]??{min:0,max:1}}getAxisZooms(){return this.state}getCoreZoom(){return this.state}getRestoredZoom(){return this.lastRestoredState}getPrimaryAxisId(t){return this.getPrimaryAxis(t)?.id}getBoundSeries(){const t=this.getPrimaryAxis(z.X),e=this.getPrimaryAxis(z.Y);let i;if(this.independentAxes){const n=new Set(t?.boundSeries??[]),s=new Set(e?.boundSeries??[]);i=new Set;for(const a of n)s.has(a)&&i.add(a)}else i=new Set([...t?.boundSeries??[],...e?.boundSeries??[]]);return i}constrainZoomToItemCount(t,e,i){let n=[t.x.min,t.x.max],s=i?void 0:[t.y.min,t.y.max];for(const r of this.getBoundSeries()){const l=r.getZoomRangeFittingItems(n,s,e);l!=null&&(n=l.x,s=l.y)}const a={min:n[0],max:n[1]},o=s?{min:s[0],max:s[1]}:void 0;return Ni({x:a,y:o})}isVisibleItemsCountAtLeast(t,e,i){const n=this.getBoundSeries(),s=[t.x.min,t.x.max],a=!i.includeYVisibleRange&&i.autoScaleYAxis?void 0:[t.y.min,t.y.max];let o=0;for(const r of n){const l=e-(o??0),c=r.getVisibleItems(s,a,l);if(o+=c,o>=e)return!0}return n.size===0}getMementoRanges(){const t=Ni(this.getZoom()),e={rangeX:this.getRangeDirection(z.X,t.x),rangeY:this.getRangeDirection(z.Y,t.y),ratioX:{start:t.x.min,end:t.x.max},ratioY:{start:t.y.min,end:t.y.max},autoScaledAxes:void 0};return this.eventsHub.emit("zoom:save-memento",{memento:e}),e}restoreRequiredRange(t,e,i){const{lastRestoredRequiredRange:n,lastRestoredRequiredRangeDirection:s}=this;this.lastRequiredRange!==i&&(this.lastRequiredRange=i,this.restoreRequiredRangeIterations=0),this.restoreRequiredRangeIterations+=1;const a=e!==z.X&&e!==z.Y,o=s===e&&n===t,r=t===0&&(n==null||n===0);if(a||o||r||this.restoreRequiredRangeIterations>1){this.restoreRequiredRangeIterations=0;return}const l=this.getPrimaryAxisId(e);if(!l)return;const c=this.getAxisZoom(l),u=Math.min(1,1/t);let d=0,g=1;e===z.X?(d=Nt(0,1-u,c.min),g=Nt(0,d+u,1)):(g=Math.min(1,c.max),d=g-u,d<0&&(g-=d,d=0),d=Nt(0,d,1),g=Nt(0,g,1)),this.lastRestoredRequiredRange=t,this.lastRestoredRequiredRangeDirection=e;const f={[e]:{min:d,max:g}},y=this.toCoreZoomState(f);this.lastRestoredState=za(le(y)),this.updateChanges({source:"state-change",sourceDetail:"internal-requiredWidth",changes:y,isReset:!1})}constrainZoomToRequiredWidth(t){if(this.lastRestoredRequiredRange==null||this.lastRestoredRequiredRangeDirection==null)return;const e=this.lastRestoredRequiredRangeDirection,i=this.getPrimaryAxisId(this.lastRestoredRequiredRangeDirection);if(!i)return;const n=t.stateAsDefinedZoom(),s=t.oldState[i],a=n[e].max-n[e].min,o=1/this.lastRestoredRequiredRange;Math.abs(a-o)<1e-12||a<=o||t.constrainZoom({...n,[e]:{min:s.min,max:s.min+o}})}dispatch(t,e,i,n,s){const{x:a,y:o}=this.getZoom()??{},r=this.state;let l;const c=this.debug,u=this,d={source:t,sourceDetail:e,isReset:n,changedAxes:i,state:r,oldState:s,x:a,y:o,stateAsDefinedZoom(){return Ni(u.toZoomState(d.state))},constrainZoom(f){this.constrainChanges(u.toCoreZoomState(f))},constrainChanges(f){c.check()&&c("ZoomManager.constrainChanges()",r,"->",f,new Error().stack),l??(l=le(r));for(const y of hl(f)){const x=f[y],S=l[y];x&&S&&(S.min=x.min,S.max=x.max)}d.state=l}};this.eventsHub.emit("zoom:change-request",d),l&&!SB(r,l)&&(this.state=l);const g=!SB(s,this.state);if(g){const f=this.getZoom()??{};this.eventsHub.emit("zoom:change-complete",{source:t,sourceDetail:e,x:f.x}),this.pendingZoomEventSource=t}return g}getRange(t,e){return this.getRangeAxis(this.findAxis(t),e)}getRangeDirection(t,e){return this.getRangeAxis(this.getPrimaryAxis(t),e)}getRangeAxis(t,e){if(!t)return;const i=this.getDomainPixelExtents(t);if(!i)return;const[n,s]=i;let a,o;return n<=s?(a=t.scale.invert(0,!0),o=t.scale.invert(n+(s-n)*e.max,!0)):(a=t.scale.invert(n-(n-s)*e.min,!0),o=t.scale.invert(0,!0)),{start:a,end:o}}rangeToRatio(t,e){return this.rangeToRatioAxis(this.findAxis(t),e)}rangeToRatioDirection(t,e){return this.rangeToRatioAxis(this.getPrimaryAxis(t),e)}rangeToRatioAxis(t,e){if(!t)return;const i=this.getDomainPixelExtents(t);if(!i)return;const[n,s]=i,{scale:a}=t,{start:o,end:r}=e,[l=wi.Leading,c=wi.Trailing]=o3(o,r);let u=o==null?n:a.convert(o,{alignment:l,alignmentExclusive:!0}),d=r==null?s:a.convert(r,{alignment:c,alignmentExclusive:!0})+(a.bandwidth??0);if(!Ae(u)||!Ae(d))return;const[g,f]=[Math.min(n,s),Math.max(n,s)];u=Nt(g,u,f),d=Nt(g,d,f);const y=s-n;if(y===0)return;const x=Math.abs((u-n)/y),S=Math.abs((d-n)/y);if(!(x>=S))return{min:x,max:S}}getPrimaryAxis(t){return this.axes?.find(e=>e.direction===t)}getDomainPixelExtents(t){const[e,i]=t.scale.range;if(!(!Ae(e)||!Ae(i)))return[e,i]}isValidUpdateWithResult(t){return t==null||!Array.isArray(t)||t.length<1?!1:t.every(e=>e==null||typeof e=="number"||Ac(e))}},XT=(t=>(t[t.Caption=0]="Caption",t[t.Legend=1]="Legend",t[t.ToolbarLeft=2]="ToolbarLeft",t[t.ToolbarBottom=3]="ToolbarBottom",t[t.Scrollbar=4]="Scrollbar",t[t.Navigator=5]="Navigator",t[t.Overlay=6]="Overlay",t))(XT||{}),aQ=class{constructor(t){this.eventsHub=t,this.elements=new Map}registerElement(t,e){return this.elements.has(t)?this.elements.get(t).add(e):this.elements.set(t,new Set([e])),()=>this.elements.get(t)?.delete(e)}createContext(t,e){const i={width:t,height:e,layoutBox:new Tt(0,0,t,e),scrollbars:{}};for(const n of Object.values(XT)){if(typeof n!="number")continue;const s=this.elements.get(n);if(s)for(const a of s)a(i)}return i}emitLayoutComplete({width:t,height:e},i){this.eventsHub.emit("layout:complete",{axes:i.axes??{},chart:{width:t,height:e},clipSeries:i.clipSeries??!1,series:i.series,layoutBox:i.layoutBox})}},oQ=class{constructor(){this.labelData=new Map}updateLabels(t,e,i=Tt.zero){const n={x:-e.left,y:-e.top,width:i.width+e.left+e.right,height:i.height+e.top+e.bottom},s=new Set(t.map(o=>o.id));for(const o of this.labelData.keys())s.has(o)||this.labelData.delete(o);for(const o of t){const r=o.getLabelData();r.every(Wj)&&this.labelData.set(o.id,r)}const a=Kj(this.labelData,n,5);for(const o of t)o.updatePlacedLabelData?.(a.get(o.id)??[])}},rQ=class{constructor(t){this.eventsHub=t,this.mementoOriginatorKey="legend",this.legendDataMap=new Map}createMemento(){return this.getData().filter(({hideInLegend:t,isFixed:e})=>!t&&!e).map(({enabled:t,seriesId:e,itemId:i,legendItemName:n})=>({visible:t,seriesId:e,itemId:i,legendItemName:n}))}guardMemento(t){return t==null||qt(t)}restoreMemento(t,e,i){if(i)for(const n of i){const{seriesId:s,data:a}=this.getRestoredData(n)??{};!s||!a||this.updateData(s,a)}this.update()}getRestoredData(t){const{seriesId:e,itemId:i,legendItemName:n,visible:s}=t;if(e){const o=(this.legendDataMap.get(e)??[]).map(r=>{const l=r.seriesId===e&&(!i||r.itemId===i);return l&&r.isFixed&&this.warnFixed(r.seriesId,r.itemId),!r.isFixed&&l?{...r,enabled:s}:r});return{seriesId:e,data:o}}if(!(i==null&&n==null))for(const a of this.getData()){if(i!=null&&a.itemId!==i||n!=null&&a.legendItemName!==n)continue;if(a.isFixed){this.warnFixed(a.seriesId,i);return}const o=(this.legendDataMap.get(a.seriesId)??[]).map(r=>r.itemId===i||r.legendItemName===n?{...r,enabled:s}:r);return{seriesId:a.seriesId,data:o}}}warnFixed(t,e){pt.warnOnce(`The legend item with seriesId [${t}] and itemId [${e}] is not configurable, this series item cannot be toggled through the legend.`)}update(t){this.eventsHub.emit("legend:change",{legendData:t??this.getData()})}updateData(t,e=[]){this.eventsHub.emit("legend:change-partial",{seriesId:t,legendData:e}),this.legendDataMap.set(t,e)}clearData(){this.legendDataMap.clear()}toggleItem(t,e,i,n){if(n){for(const r of this.getData()){const l=(this.legendDataMap.get(r.seriesId)??[]).map(c=>c.legendItemName===n?{...c,enabled:t}:c);this.updateData(r.seriesId,l)}return}const s=this.getData(e),a=s.length===1,o=s.map(r=>i==null&&a||r.itemId===i?{...r,enabled:t}:r);this.updateData(e,o)}getData(t){return t?this.legendDataMap.get(t)??[]:[...this.legendDataMap].reduce((e,[i,n])=>e.concat(n),[])}getDatum({seriesId:t,itemId:e}={}){return this.getData(t).find(i=>i.itemId===e)}getSeriesEnabled(t){const e=this.getData(t);if(e.length>0)return e.some(i=>i.enabled)}getItemEnabled({seriesId:t,itemId:e}={}){return this.getDatum({seriesId:t,itemId:e})?.enabled??!0}},lQ=class{updateCallback(t){this.resolvePartialCallback=t}resolvePartial(t,e,i){return this.resolvePartialCallback?.(t,e,i)}},cQ=class extends Rr{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this._hasFixedWidth=!1,this._paddingInnerWidth=0,this._domain=[],this._bandRanges=new Map}set domain(t){this._domain!==t&&(t.length===0&&(this._bandRanges.clear(),this._hasFixedWidth=!1),this.invalid=!0,this._domain=t)}get domain(){return this._domain}get bands(){return this.domain}get paddingInnerWidth(){return this._hasFixedWidth?this._paddingInnerWidth:this.paddingInner*this._bandwidth}addBand(t,e,i){this._domain.push(this.getDomainValue(t,e)),this._bandRanges.has(t)||this._bandRanges.set(t,new Map),this._bandRanges.get(t).set(e,i),this._hasFixedWidth||(this._hasFixedWidth=i!=null),this.invalid=!0}getDomainValue(t,e){return`${t}-${e}`}findIndex(t){let e=0;for(const i of this._bandRanges.keys()){if(i===t)return e;e++}}convert(t){const{_bandwidth:e,_bandRanges:i,_inset:n,_paddingInnerWidth:s}=this;let a=n;const o=t.split("-"),r=Number(o[0]);if(!this._hasFixedWidth)return super.convert(r);for(let l=0;l0&&u>=0?u/a:r/n,f=g;o===n&&u>0&&(d+=u/2),this.round&&Math.floor(f)>0&&(d=Math.round(d),f=Math.round(f)),u<0&&(g=0,f=0),this._inset=d,this._bandwidth=f,this._rawBandwidth=g,this._paddingInnerWidth=l}normalizeDomains(...t){return{domain:[],animatable:!1}}toDomain(t){}},hQ=class{constructor(){this.groups=new Map,this.groupScales=new Map}registerSeries({internalId:t,seriesGrouping:e,visible:i,width:n,type:s}){if(!e)return;let a=this.groups.get(s);a==null&&(a=new Map,this.groups.set(s,a)),a.set(t,{grouping:e,visible:i,width:n})}updateSeries({internalId:t,seriesGrouping:e,visible:i,width:n,type:s}){if(!e)return;const a=this.groups.get(s)?.get(t);a&&(a.grouping=e,a.width=n,a.visible=i)}deregisterSeries({internalId:t,type:e}){const i=this.groups.get(e);i!=null&&(i.delete(t),i.size===0&&this.groups.delete(e))}getVisiblePeerGroupIndex({type:t,seriesGrouping:e,visible:i}){if(!e)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const n=new Set,s=new Set,a=this.groups.get(t);for(const r of a?.values()??[])r.visible&&(n.add(r.grouping.groupIndex),r.grouping.groupIndex===e.groupIndex&&s.add(r.grouping.stackIndex));const o=Array.from(n);return o.sort((r,l)=>r-l),{visibleGroupCount:o.length,visibleSameStackCount:s.size,index:o.indexOf(e.groupIndex)}}updateGroupScale({type:t},e,i){const n=this.groupScales.get(t)??new cQ;this.groupScales.set(t,n),n.domain=[];const s=this.groups.get(t);for(const a of s?.values()??[])a.visible&&n.addBand(a.grouping.groupIndex,a.grouping.stackIndex,a.width);n.domain.length===0&&n.addBand(0,0,void 0),n.range=[0,e],i.type==="grouped-category"?n.paddingInner=i.groupPaddingInner:i.type==="category"||i.type==="unit-time"?(n.paddingInner=i.groupPaddingInner,n.round=n.padding!==0):n.padding=0,n.update()}getGroupScale({type:t}){return this.groupScales.get(t)}getGroupBandWidth(t){const{seriesGrouping:e}=t;if(!e)return 0;const i=this.getGroupScale(t);if(!i)return 0;const n=this.groups.get(t.type);if(!n)return i.bandwidth;let s=0;for(const a of n.values())a.visible&&a.grouping.groupIndex===e.groupIndex&&(s=Math.max(s,a.width??i.bandwidth));return s||i.bandwidth}getGroupOffset(t){const{seriesGrouping:e}=t;if(!e)return 0;const i=this.getGroupScale(t);if(!i)return 0;const n=i.getDomainValue(e.groupIndex,e.stackIndex);return i.convert(n)}getStackOffset(t,e){const{seriesGrouping:i}=t;if(!i)return 0;const n=this.groups.get(t.type);if(!n)return 0;const s=this.getGroupScale(t);if(!s||(i.stackCount??0)<1)return 0;let o=0;for(const r of n.values())r.visible&&r.grouping.groupIndex===i.groupIndex&&(o=Math.max(o,r.width??s.bandwidth));return o===0?0:o/2-e/2}getDatumOffset(t,e,i,n){const s=this.groups.get(t.type);if(!t.visible||!t.seriesGrouping||!s||e.get(t.internalId)?.[n]||i.get(t.internalId)?.[n])return 0;const a=new Set;for(const[g,f]of s)f.visible&&!e.get(g)?.[n]&&!i.get(g)?.[n]&&a.add(f.grouping.groupIndex);if(a.size===t.seriesGrouping?.groupCount)return 0;const o=this.groupScales.get(t.type),r=new Map,l=new Map;for(const[g,f]of s)g!==t.internalId&&f.visible&&(a.has(f.grouping.groupIndex)||(t.seriesGrouping.groupIndexf.grouping.groupIndex&&r.set(f.grouping.groupIndex,Math.max(f.width??o?.bandwidth??0,r.get(f.grouping.groupIndex)??0))));let c=0;for(const[,g]of l)c+=g;for(const[,g]of r)c-=g;c/=2;const u=(o?.paddingInnerWidth??0)/2,d=(l.size-r.size)*u;return c+d}},uQ=class{constructor(){this.events=new cr}addListener(t,e){return this.events.on(t,e)}destroy(){this.events.clear()}dispatchUpdateComplete(t,e){this.events.emit("update-complete",{type:"update-complete",apiUpdate:t,wasShortcut:e})}dispatchPreDomUpdate(){this.events.emit("pre-dom-update",{type:"pre-dom-update"})}dispatchPreSeriesUpdate(t,e,i){this.events.emit("pre-series-update",{type:"pre-series-update",requiredRangeRatio:t,requiredRangeDirection:e,requiredRange:i})}dispatchPreSceneRender(t){this.events.emit("pre-scene-render",{type:"pre-scene-render",apiUpdate:t})}dispatchProcessData({series:t}){this.events.emit("process-data",{type:"process-data",series:t})}},dQ=class{constructor(t,e){this.eventsHub=new cr,this.callbackCache=new Q4,this.highlightManager=new qG(this.eventsHub),this.formatManager=new Tf,this.layoutManager=new aQ(this.eventsHub),this.localeManager=new cq(this.eventsHub),this.seriesStateManager=new hQ,this.stateManager=new RZ,this.seriesLabelLayoutManager=new oQ,this.cleanup=new qe;const{scene:i,root:n,syncManager:s,agDocument:a,container:o,fireEvent:r,updateMutex:l,styleContainer:c,skipCss:u,chartType:d,domMode:g,withDragInterpretation:f}=e;this.chartService=t,this.syncManager=s,this.agDocument=a,this.domManager=new AG(this.eventsHub,this.chartService,this.agDocument,o,c,u,g),this.widgets=new X7(this.domManager,{withDragInterpretation:f});const y=this.agDocument.window,x=this.domManager.addChild("canvas","scene-canvas",i?.canvas.element);this.scene=i??new HD({canvasElement:x,pixelRatio:y.devicePixelRatio??1}),this.scene.setRoot(n),this.axisManager=new gq(this.eventsHub,n),this.legendManager=new rQ(this.eventsHub),this.annotationManager=new pq(this.eventsHub,t.annotationRoot,r),this.chartTypeOriginator=new OZ(t),this.interactionManager=new NG,this.contextMenuRegistry=new $G(this.eventsHub),this.optionsGraphService=new lQ,this.updateService=new uQ,this.activeManager=new Nq(this.chartService,this.eventsHub,this.updateService,this.interactionManager,r),this.proxyInteractionService=new oq(this.eventsHub,this.localeManager,this.domManager),this.fontManager=new fq(this.domManager,this.eventsHub),this.historyManager=new EZ(this.eventsHub),this.animationManager=new B7(this.agDocument,this.interactionManager,l),this.dataService=new FT(this.eventsHub,t,this.animationManager),this.tooltipManager=new IM(this.eventsHub,this.localeManager,this.domManager,t.tooltip),this.zoomManager=new r3(this.eventsHub,this.updateService,r);for(const S of Ut.listModulesByType(Le.Plugin))(!S.chartType||S.chartType===d)&&S.patchContext?.(this)}destroy(){this.animationManager.destroy(),this.axisManager.destroy(),this.callbackCache.invalidateCache(),this.domManager.destroy(),this.fontManager.destroy(),this.proxyInteractionService.destroy(),this.tooltipManager.destroy(),this.zoomManager.destroy(),this.widgets.destroy(),this.cleanup.flush()}},WD=class extends xt{constructor(){super(...arguments),this.enabled=!0,this.range="tooltip",this.drawingMode="cutout"}};T([b],WD.prototype,"enabled",2);T([b],WD.prototype,"range",2);T([b],WD.prototype,"drawingMode",2);function pQ(t,e){if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}function gQ(t,e){if(t==null||e==null)return t===e;if(t.size!==e.size)return!1;for(const[i,n]of t){const s=e.get(i);if(s==null||!pQ(n,s))return!1}return!0}function fQ(t,e){if(t.length!==e.length)return!1;for(let i=0;ie.type==="key").map(e=>e.property).join(";")}var ZT=class Uo{constructor(e,i,n){this.mode=e,this.suppressFieldDotNotation=i,this.eventsHub=n,this.debug=Gt.create(!0,"data-model"),this.requested=[],this.status="setup"}async request(e,i,n){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");return new Promise((s,a)=>{this.requested.push({id:e,opts:n,dataSet:i,resolve:s,reject:a})})}execute(e){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");this.status="executed";const i=new Map;for(const o of this.requested)o.dataSet.hasPendingTransactions()&&i.set(o.dataSet,o.dataSet.getChangeDescription()),o.dataSet.commitPendingTransactions();this.debug("DataController.execute() - requested",this.requested);const n=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",n);const s=this.mergeRequested(n);this.debug("DataController.execute() - merged",s),this.debug.check()&&(Ml().processedData=[]);const a=[];for(const{dataSet:o,ids:r,opts:l,resolves:c,rejects:u}of s){let d=function(A){return yQ(A,o,r,l)};const g=e?.find(d),f=(A,I)=>{if(this.debug.check()&&Ml("processedData").push(I),I==null){for(const w of u)w(new Error("AG Charts - no processed data generated"));return}a.push({opts:l,dataSet:o,dataLength:o.data.length,ids:r,dataModel:A,processedData:I});for(const w of c)w({dataModel:A,processedData:I})},y=()=>{try{const A=new IN(l,this.mode,this.suppressFieldDotNotation,this.eventsHub),I=new Map(n.map(N=>[N.id,N.dataSet])),w=A.processData(I);return f(A,w),A}catch(A){for(const I of u)I(A)}};if(g==null){y();continue}const{dataModel:x,processedData:S}=g,D=i.get(o);if(S&&D&&x.isReprocessingSupported(S)){if(this.debug("DataController.execute() - reprocessing data",S,o),x.reprocessData(S,i),Gt.check("data-model:reprocess-diff")){const A=new IN(l,this.mode,this.suppressFieldDotNotation,this.eventsHub),I=new Map(n.map(R=>[R.id,R.dataSet])),w=A.processData(I),N=JSON.parse(JSON.stringify(S,Uo.jsonReplacer)),O=JSON.parse(JSON.stringify(w,Uo.jsonReplacer));delete N.time,delete N.optimizations,delete O.time,delete O.optimizations;const L=or(O,N);L?(pt.log("⚠️ DATA-MODEL REPROCESS DIFF DETECTED ⚠️"),pt.log("Difference between incremental update and full reprocess:"),pt.log(""),pt.log("BASELINE (full reprocess):"),pt.log(JSON.stringify(O,null,2)),pt.log(""),pt.log("REPROCESSED (incremental update):"),pt.log(JSON.stringify(N,null,2)),pt.log(""),pt.log("DIFF (what changed):"),pt.log(JSON.stringify(L,null,2))):pt.log("✅ Data-model reprocess matches baseline (no diff)")}f(x,S);continue}y()}return a}validateRequests(e){const i=[];for(const[n,s]of e.entries())n>0&&s.dataSet.data.length!==e[0].dataSet.data.length&&s.opts.groupByData===!1&&s.opts.groupByKeys===!1?s.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):i.push(s);return i}mergeRequested(e){const i=[];for(const n of e){const s=i.find(Uo.groupMatch(n));s?s.push(n):i.push([n])}return i.map(Uo.mergeRequests)}static groupMatch({dataSet:e,opts:i}){const{groupByData:n,groupByKeys:s=!1,groupByFn:a,props:o}=i,r=MB(o);return([l])=>(n===!1||l.dataSet===e)&&(l.opts.groupByKeys??!1)===s&&l.opts.groupByFn===a&&MB(l.opts.props)===r}static mergeRequests(e){const i={ids:[],rejects:[],resolves:[],dataSet:e[0].dataSet,opts:{...e[0].opts,props:[]}},n=new Map,s=new Map;let a=0;for(const o of e){const{id:r,dataSet:l,resolve:c,reject:u,opts:{props:d,...g}}=o;i.ids.push(r),i.rejects.push(u),i.resolves.push(c),i.dataSet??(i.dataSet=l),i.opts??(i.opts={...g,props:[]});for(const f of d){const y={...f,scopes:[r],data:l.data};Uo.createIdsMap(r,y);let x;Uo.crossScopeMergableTypes.has(y.type)?x=-1:s.has(l.data)?x=s.get(l.data):(x=a++,s.set(l.data,x));const S=`${y.type}-${x}-${y.groupId}`,D=n.get(S),A=D?.find(I=>Uo.deepEqual(I,y));if(D==null){i.opts.props.push(y),n.set(S,[y]);continue}else if(A==null){i.opts.props.push(y),D.push(y);continue}y.scopes!=null&&(A.scopes??(A.scopes=[]),A.scopes.push(...y.scopes)),(A.type==="key"||A.type==="value")&&y.idsMap?.size&&(A.idsMap??(A.idsMap=new Map),Uo.mergeIdsMap(y.idsMap,A.idsMap))}}return i}static mergeIdsMap(e,i){for(const[n,s]of e){const a=i.get(n);if(a==null)i.set(n,new Set(s));else for(const o of s)a.add(o)}}static createIdsMap(e,i){i.id!=null&&(i.idsMap??(i.idsMap=new Map),i.idsMap.has(e)?i.idsMap.get(e).add(i.id):i.idsMap.set(e,new Set([i.id])))}static deepEqual(e,i){if(e===i)return!0;if(e&&i&&typeof e=="object"&&typeof i=="object"){if(e.constructor!==i.constructor)return!1;let n,s;if(Array.isArray(e)){if(s=e.length,s!==i.length)return!1;for(n=s-1;n>=0;n--)if(!Uo.deepEqual(e[n],i[n]))return!1;return!0}const a=Object.keys(e);if(s=a.length,s!==Object.keys(i).length)return!1;for(n=s-1;n>=0;n--){const o=a[n];if(!Uo.skipKeys.has(o)&&(!Object.hasOwn(i,o)||!Uo.deepEqual(e[o],i[o])))return!1}return!0}return!1}static jsonReplacer(e,i){return i instanceof Map?{__type:"Map",value:Array.from(i.entries())}:i instanceof Set?{__type:"Set",value:Array.from(i)}:i}};ZT.crossScopeMergableTypes=new Set(["key","group-value-processor"]);ZT.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var l3=ZT,Sb=class KS{constructor(e,i){this.data=e,this.dataIdKey=i,this.pendingTransactions=[]}static empty(e){return new KS([],e)}static wrap(e,i){return new KS(e,i)}netSize(){if(!this.hasPendingTransactions())return this.data.length;const e=this.getChangeDescription();return e?e.indexMap.finalLength:this.data.length}addTransaction(e){const i=this.normalizeTransaction(e);this.pendingTransactions.push(i),this.cachedChangeDescription=void 0}deepClone(){return new KS([...this.data],this.dataIdKey)}normalizeTransaction(e){const{add:i,addIndex:n,prepend:s,append:a,remove:o,update:r}=e;if(i===void 0)return e;const l={remove:o,update:r};if(s&&(l.prepend=s),a&&(l.append=a),i&&i.length>0){const c=this.netSize();n===void 0||n>=c?l.append=a?[...a,...i]:i:n===0?l.prepend=s?[...i,...s]:i:l.insertions=[{index:n,items:i}]}return l}hasPendingTransactions(){return this.pendingTransactions.length>0}getPendingTransactionCount(){return this.pendingTransactions.length}commitPendingTransactions(){if(this.dataIdKey!=null&&this.data.length>0&&this.getIdToIndexMap(),!this.hasPendingTransactions())return!1;const e=this.getChangeDescription();if(!e)return!1;const i=e.getPrependedValues(),n=e.getInsertionValues(),s=e.getAppendedValues(),a=[...i,...n,...s];let o=0;if(e.applyToArray(this.data,function(l){if(o>=a.length)throw new Error(`AG Charts - Internal error: No insertion value found for index ${l}`);return a[o++]}),this.cachedPendingReplacements&&this.cachedPendingReplacements.size>0){const{updatedIndices:r}=e.indexMap;for(const l of r){const c=this.getIdValue(this.data[l]);c!==void 0&&this.cachedPendingReplacements.has(c)&&(this.data[l]=this.cachedPendingReplacements.get(c))}}return this.pendingTransactions=[],this.cachedChangeDescription=void 0,this.cachedPendingReplacements=void 0,this.updateItemToIndexCache(e,s,i,n),this.updateIdToIndexCache(e,s,i,n),!0}updateItemToIndexCache(e,i,n,s){if(!this.itemToIndexCache)return;if(this.dataIdKey){this.itemToIndexCache=void 0;return}const{indexMap:a}=e,{totalPrependCount:o,totalAppendCount:r,removedIndices:l}=a,c=l.size>0,u=s.length>0;if(!c&&o===0&&r===0&&!u)return;if(u){this.itemToIndexCache=void 0;return}const d=AN(l);if(c&&d===0){this.itemToIndexCache=void 0;return}const g=this.itemToIndexCache,f=o-d;if(f!==0)for(const[x,S]of g)l.has(S)?g.delete(x):g.set(x,S+f);else if(c)for(const[x,S]of g)l.has(S)&&g.delete(x);for(let x=0;x0,u=s.length>0;if(!c&&o===0&&r===0&&!u)return;if(u){this.idToIndexCache=void 0;return}const d=AN(l);if(c&&d===0){this.idToIndexCache=void 0;return}const g=this.idToIndexCache,f=o-d;if(f!==0)for(const[x,S]of g)l.has(S)?g.delete(x):g.set(x,S+f);else if(c)for(const[x,S]of g)l.has(S)&&g.delete(x);for(let x=n.length-1;x>=0;x--){const S=this.getIdValue(n[x]);S!==void 0&&g.set(S,x)}const y=a.finalLength-r;for(let x=0;x0;)i.has(n[s])?(i.delete(n[s]),n.splice(s,1)):s++;if(i.size===0)break}}buildIndexMap(){const e=this.data.length,i=this.collectTransactionEffects(),n=i.prependsList.flat(),s=i.appendsList.flat(),a=i.insertionsList.flat(),o=n.length,r=s.length,l=a.length,c=e-i.removedOriginalIndices.size,u=o+c+l+r,d=i.removedOriginalIndices.size>0?this.getSortedRemovedIndices(i.removedOriginalIndices):void 0,g=this.buildSpliceOperations(o,l,r,c,i.trackedInsertions,d?.desc,d?.asc),f=this.resolveUpdatedIndices(o,l,c,i.updateTracking,d?.asc,i.updatedOriginalIndices,i.trackedInsertions);return{indexMap:{originalLength:e,finalLength:u,spliceOps:g,removedIndices:i.removedOriginalIndices,updatedIndices:f,totalPrependCount:o,totalAppendCount:r},prependValues:n,appendValues:s,insertionValues:a,pendingReplacements:i.pendingReplacements}}getSortedRemovedIndices(e){const i=Array.from(e).sort((n,s)=>n-s);return{asc:i,desc:[...i].reverse()}}collectTransactionEffects(){const e={prependsList:[],appendsList:[],insertionsList:[],trackedInsertions:[],removedOriginalIndices:new Set,updatedOriginalIndices:new Set,virtualLength:this.data.length};for(const i of this.pendingTransactions){const{prepend:n,append:s,insertions:a,remove:o,update:r}=i;this.applyPrepends(n,e),this.applyInsertions(a,e),this.applyAppends(s,e),this.applyRemovals(o,e),this.applyUpdates(r,e)}return{prependsList:e.prependsList,appendsList:e.appendsList,insertionsList:e.insertionsList,trackedInsertions:e.trackedInsertions,removedOriginalIndices:e.removedOriginalIndices,updatedOriginalIndices:e.updatedOriginalIndices,updateTracking:e.updateTracking,pendingReplacements:e.pendingReplacements}}applyPrepends(e,i){!Array.isArray(e)||e.length===0||(i.prependsList.unshift([...e]),i.virtualLength+=e.length)}applyInsertions(e,i){if(Array.isArray(e))for(const{index:n,items:s}of e)n>=0&&n<=i.virtualLength&&s.length>0&&(i.trackedInsertions.push({virtualIndex:n,items:[...s]}),i.insertionsList.push([...s]),i.virtualLength+=s.length)}applyAppends(e,i){!Array.isArray(e)||e.length===0||(i.appendsList.push([...e]),i.virtualLength+=e.length)}applyRemovals(e,i){!Array.isArray(e)||e.length===0||(this.dataIdKey?this.applyRemovalsById(e,i):this.applyRemovalsByRef(e,i))}applyRemovalsByRef(e,i){const n=new Set(e);if(this.removeFromGroups(i.prependsList,n),n.size>0&&this.removeFromGroups(i.insertionsList,n),i.trackedInsertions.length>0&&this.removeFromTrackedInsertions(e,i),n.size>0&&this.removeFromGroups(i.appendsList,n),n.size>0)for(let s=0;s0;s++){const a=this.data[s];n.has(a)&&(i.removedOriginalIndices.add(s),n.delete(a),i.virtualLength--)}n.size>0&&pt.warnOnce("applyTransaction() remove includes items not present in current data; ignoring missing items.")}applyRemovalsById(e,i){const n=new Set;for(const s of e){const a=this.getIdValue(s);a===void 0?pt.warnOnce(`applyTransaction() remove item is missing '${this.dataIdKey}' field; ignoring.`):n.add(a)}if(n.size!==0){if(this.removeFromGroupsById(i.prependsList,n),n.size>0&&this.removeFromGroupsById(i.insertionsList,n),i.trackedInsertions.length>0&&this.removeFromTrackedInsertionsById(e,i),n.size>0&&this.removeFromGroupsById(i.appendsList,n),n.size>0){const s=this.getIdToIndexMap();for(const a of n){const o=s.get(a);o!==void 0&&(i.removedOriginalIndices.add(o),i.virtualLength--,n.delete(a))}}n.size>0&&pt.warnOnce("applyTransaction() remove includes items not present in current data; ignoring missing items.")}}applyUpdates(e,i){!Array.isArray(e)||e.length===0||(this.dataIdKey?this.applyUpdatesById(e,i):this.applyUpdatesByRef(e,i))}applyUpdatesByRef(e,i){const n=new Set(e),s=this.collectUpdatedIndicesFromGroups(i.prependsList,n),a=n.size>0?this.collectUpdatedIndicesFromGroups(i.insertionsList,n):[],o=n.size>0?this.collectUpdatedIndicesFromGroups(i.appendsList,n):[];n.size>0&&this.collectUpdatedOriginalIndices(n,i),i.updateTracking={updatedPrependsIndices:s,updatedAppendsIndices:o,updatedInsertionsIndices:a},n.size>0&&pt.warnOnce("applyTransaction() update includes items not present in current data; ignoring missing items.")}applyUpdatesById(e,i){const n=new Map;for(const r of e){const l=this.getIdValue(r);l===void 0?pt.warnOnce(`applyTransaction() update item is missing '${this.dataIdKey}' field; ignoring.`):n.set(l,r)}if(n.size===0)return;const s=this.collectUpdatedIndicesFromGroupsById(i.prependsList,n),a=n.size>0?this.collectUpdatedIndicesFromGroupsById(i.insertionsList,n):[],o=n.size>0?this.collectUpdatedIndicesFromGroupsById(i.appendsList,n):[];n.size>0&&this.collectUpdatedOriginalIndicesById(n,i),i.updateTracking={updatedPrependsIndices:s,updatedAppendsIndices:o,updatedInsertionsIndices:a},n.size>0&&pt.warnOnce("applyTransaction() update includes items not present in current data; ignoring missing items.")}collectUpdatedIndicesFromGroups(e,i){if(i.size===0||e.length===0)return[];const n=[];let s=0;for(const a of e){for(const o of a)i.has(o)&&(n.push(s),i.delete(o)),s++;if(i.size===0)break}return n}getItemToIndexMap(){if(this.itemToIndexCache===void 0){this.itemToIndexCache=new Map;for(let e=0;e0&&pt.warnOnce(`dataIdKey '${this.dataIdKey}' was not found on any data item.`)}return this.idToIndexCache}removeFromGroupsById(e,i){for(const n of e){let s=0;for(;s0;){const a=this.getIdValue(n[s]);a!==void 0&&i.has(a)?(i.delete(a),n.splice(s,1)):s++}if(i.size===0)break}}collectUpdatedIndicesFromGroupsById(e,i){if(i.size===0||e.length===0)return[];const n=[];let s=0;for(const a of e){for(let o=0;o0&&this.adjustLaterInsertionsAfterRemoval(i.trackedInsertions,n,s,a,o)}}removeFromTrackedInsertionsById(e,i){const n=new Set;for(const s of e){const a=this.getIdValue(s);a!==void 0&&n.add(a)}if(n.size!==0)for(let s=0;s0&&this.adjustLaterInsertionsAfterRemoval(i.trackedInsertions,s,a,o,r),n.size===0)break}}adjustLaterInsertionsAfterRemoval(e,i,n,s,a){const o=a.length;for(let r=i+1;r0&&(l.virtualIndex-=u)}}buildSpliceOperations(e,i,n,s,a,o,r){const l=[];if(e>0&&l.push({index:0,deleteCount:0,insertCount:e}),o&&o.length>0){let c=o[0],u=1;for(let d=1;d0)for(const c of a){const u=this.countRemovalsBeforeIndex(r,e,c.virtualIndex),d=c.virtualIndex-u;l.push({index:d,deleteCount:0,insertCount:c.items.length})}return n>0&&l.push({index:e+s+i,deleteCount:0,insertCount:n}),l}countRemovalsBeforeIndex(e,i,n){if(!e||e.length===0)return 0;let s=0;for(const a of e)if(a+i0){const c=Array.from(o).sort((d,g)=>d-g);let u=0;for(const d of c){if(a)for(;u0&&r.length>0){let u=0;for(const d of r){const g=this.countRemovalsBeforeIndex(a,e,d.virtualIndex),f=d.virtualIndex-g;for(let y=0;yi!==this.chart)}getGroupSyncMode(e=dc.DEFAULT_GROUP){return this.getGroupMembers(e).some(i=>i.series.length>1)?"multi-series":"single-series"}get(e){return dc.chartsGroups.get(e)}};qT.chartsGroups=new Map;qT.DEFAULT_GROUP=Symbol("sync-group-default");var bQ=qT,KD=class extends xt{constructor(){super(...arguments),this.enabled=!1,this.initialFocus="data-start"}};T([b],KD.prototype,"enabled",2);T([b],KD.prototype,"tabIndex",2);T([b],KD.prototype,"initialFocus",2);var c3={};Ap(c3,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>wr,fromToMotion:()=>dn,staticFromToMotion:()=>Uc});var wr={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function dn(t,e,i,n,s,a,o){const{fromFn:r,toFn:l,applyFn:c=(y,x)=>y.setProperties(x)}=s,{nodes:u,selections:d}=HT(n),g=(y,x)=>{let S,D=0,A=0;for(const I of x){const w=y[D]===I,N={last:A>=x.length-1,lastLive:D>=y.length-1,prev:x[A-1],prevFromProps:S,prevLive:y[D-1],next:x[A+1],nextLive:y[D+(w?1:0)]},O=`${t}_${e}_${I.id}`;i.stopByAnimationId(O);let L="unknown";w?a&&o&&(L=xQ(I,I.datum,a,o)):L="removed",I.transitionOut=L==="removed";const{phase:R,start:P,finish:B,delay:F,duration:H,...$}=r(I,I.datum,L,N),{phase:Y,start:U,finish:V,delay:Z,duration:W,...q}=l(I,I.datum,L,N),nt=B==null;i.animate({id:O,groupId:t,phase:R??Y??"update",duration:H??W,delay:F??Z,from:$,to:q,ease:Lc,collapsable:nt,onPlay:()=>{const G={...P,...U,...$};c(I,G,"start")},onUpdate(G){c(I,G,"update")},onStop:()=>{const G={...P,...U,...$,...q,...B,...V};c(I,G,"end")}}),w&&D++,A++,S=$}};let f=0;for(const y of d){const x=y.nodes(),S=x.filter(D=>!y.isGarbage(D));g(S,x),i.animate({id:`${t}_${e}_selection_${f}`,groupId:t,phase:"end",from:0,to:1,ease:Lc,onStop(){y.cleanup()}}),f++}g(u,u)}function Uc(t,e,i,n,s,a,o){const{nodes:r,selections:l}=HT(n),{start:c,finish:u,phase:d}=o;i.animate({id:`${t}_${e}`,groupId:t,phase:d??"update",from:s,to:a,ease:Lc,onPlay:()=>{if(c){for(const g of r)g.setProperties(c);for(const g of l){const f=g.nodes();g.batchedUpdate(function(){for(const x of f)x.setProperties(c)})}}},onUpdate(g){for(const f of r)f.setProperties(g);for(const f of l){const y=f.nodes();f.batchedUpdate(function(){for(const S of y)S.setProperties(g)})}},onStop:()=>{for(const g of r)g.setProperties({...a,...u});for(const g of l){const f=g.nodes();g.batchedUpdate(function(){for(const x of f)x.setProperties({...a,...u});g.cleanup()})}}})}function xQ(t,e,i,n){const s=i(t,e);return n.added.has(s)?"added":n.removed.has(s)?"removed":t.previousDatum==null&&t.datum!=null?"added":t.previousDatum!=null&&t.datum==null?"removed":"updated"}var h3={};Ap(h3,{resetMotion:()=>Qn});function Qn(t,e){const{nodes:i,selections:n}=HT(t);for(const s of n){const a=s.nodes();s.batchedUpdate(function(){for(const r of a){const l=e(r,r.datum);r.setProperties(l)}s.cleanup()})}for(const s of i){const a=e(s,s.datum);s.setProperties(a)}}var pn=class Vd{constructor(e,i,n=!0){this.parentNode=e,this.autoCleanup=n,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=Gt.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(Oc,i)?()=>new i:i}static select(e,i,n=!0){return new Vd(e,i,n)}static selectAll(e,i){const n=[],s=a=>{if(i(a)&&n.push(a),a instanceof ee)for(const o of a.children())s(o)};return s(e),n}static selectByClass(e,...i){return Vd.selectAll(e,n=>i.some(s=>n instanceof s))}static selectByTag(e,i){return Vd.selectAll(e,n=>n.tag===i)}createNode(e,i,n){const s=this.nodeFactory(e);return s.datum=e,i?.(s),n==null?this._nodes.push(s):this._nodes.splice(n,0,s),this.parentNode.appendChild(s),s}update(e,i,n){if(this.garbageBin.size>0&&this.debug("Selection - update() called with pending garbage",e),n&&this._nodesMap.size===0&&this._nodes.length>0)for(const s of this._nodes)this.garbageBin.add(s);if(!n&&this._nodesMap.size>0&&this._nodesMap.clear(),n){const s=new Map,a=new Map;for(let o=0;o=e.length?this.garbageBin.add(this._nodes[a]):a>=this._nodes.length?this.createNode(e[a],i):(this._nodes[a].datum=e[a],this.garbageBin.delete(this._nodes[a]))}return this.data=e.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){if(this.garbageBin.size===0)return this;const e=this;function i(n){return e.garbageBin.has(n)?(e._nodesMap.delete(n),e.garbageBin.delete(n),n.destroy(),!1):!0}return this._nodes=this._nodes.filter(i),this}clear(){this.update([]);for(const e of this._nodesMap.keys())this.garbageBin.add(e);return this._nodesMap.clear(),this}isGarbage(e){return this.garbageBin.has(e)}each(e){const i=this._nodes;return this.parentNode.batchedUpdate(function(){for(const s of i.entries())e(s[1],s[1].datum,s[0])}),this}*[Symbol.iterator](){for(let e=0;e_j(a,n)&&!Number.isNaN(e.convert(a,{clamp:!0}));if(t.type==="range"){const[a,o]=i;return s(a)&&s(o)}else return s(i)}var vQ={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:-1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},SQ={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:-1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},MQ={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},DQ={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},Cp=class extends Mo{constructor(){super(...arguments),this.padding=5}};T([b],Cp.prototype,"enabled",2);T([b],Cp.prototype,"padding",2);T([b],Cp.prototype,"text",2);T([b],Cp.prototype,"position",2);T([b],Cp.prototype,"rotation",2);T([b],Cp.prototype,"parallel",2);var Xs=class extends xt{constructor(){super(),this.id=Nn(this),this.defaultColorRange=[],this.fill="#c16068",this.label=new Cp,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.gridPadding=0,this.position="top",this.rangeGroup=new ee({name:this.id}),this.lineGroup=new ee({name:this.id}),this.labelGroup=new ee({name:this.id}),this.crossLineRange=this.lineGroup.appendChild(new El),this.crossLineLabel=this.labelGroup.appendChild(new wf),this.data=void 0,this.startLine=!1,this.endLine=!1,this._isRange=void 0,this.crossLineRange.pointerEvents=1}get defaultLabelPosition(){return"top"}update(t){const{enabled:e,type:i,data:n,scale:s}=this;if(!s||!e||!t||!d3(this,s)||n==null){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,this.updateNodes();const a=i==="range";a!==this._isRange&&(a?this.rangeGroup.appendChild(this.crossLineRange):this.lineGroup.appendChild(this.crossLineRange)),this._isRange=a}calculateLayout(t){if(this.data=void 0,!t)return;const{type:e,range:i,value:n,scale:s,clippedRange:a,strokeWidth:o=0}=this;if(!s)return;const r=s.bandwidth??0,l=s.step??0,c=s instanceof Rr?(l-r)/2:0;let[u,d]=xi(a);u-=r,d+=r;let g,f,y,x;if(e==="line"){const S=r/2;if(g=s.convert(n)+S,f=Number.NaN,y=s.convert(n,{clamp:!0})+S,x=Number.NaN,y>=d||y<=u)return}else if(i){const[S,D]=i,[A,I]=o3(S,D);if(g=s.convert(S,{alignment:A}),f=s.convert(D,{alignment:I}),y=s.convert(S,{clamp:!0,alignment:A}),x=s.convert(D,{clamp:!0,alignment:I}),y>x&&([y,x]=[x,y],[g,f]=[f,g]),y>=d||x<=u)return;Number.isFinite(g)&&(y-=c),Number.isFinite(f)&&(f+=r,x+=r+c)}else return;y=bf(y,a),x=bf(x,a),g-c>=y&&(g-=c),f+c<=x&&(f+=c),this.startLine=o>0&&g>=y&&g<=y+c,this.endLine=o>0&&f>=x-r-c&&f<=x,this.data=[y,x],this.label.enabled===!1||this.label.text}updateNodes(){const{position:t,data:[e,i]=[0,0],gridLength:n,gridPadding:s}=this,a=Number.isFinite(i)?i-e:0,o=t==="bottom"||t==="right"?-1:1,r=Math.min(o*s,o*(n+s));let l;switch(t){case"top":case"bottom":l=new Tt(e,r,a,n);break;case"left":case"right":l=new Tt(r,e,n,a)}this.updateRangeNode(l);const{label:c}=this;c.enabled!==!1&&c.text&&(this.updateLabel(),this.positionLabel(l))}updateRangeNode(t){const{type:e,position:i,crossLineRange:n,startLine:s,endLine:a,fill:o,fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:u,lineDash:d}=this;n.x1=t.x,n.x2=t.x+t.width,n.y1=t.y,n.y2=t.y+t.height,n.horizontal=i==="top"||i==="bottom",n.startLine=s,n.endLine=a,n.fill=e==="range"?o:void 0,n.fillOpacity=r??1,n.stroke=l,n.strokeWidth=c??1,n.strokeOpacity=u??1,n.lineDash=d}updateLabel(){const{crossLineLabel:t,label:e}=this;e.text&&(t.fill=e.color,t.text=e.text,t.textAlign="center",t.textBaseline="middle",t.setFont(e),t.setBoxing(e))}get anchor(){const t=this.position==="left"||this.position==="right",e=this.type==="range",{position:i=this.defaultLabelPosition}=this.label;return e?(t?MQ:DQ)[i]:(t?vQ:SQ)[i]}positionLabel(t){const{crossLineLabel:e,label:{padding:i,rotation:n},anchor:s}=this;e.rotation=Ze(n??0);const a=e.getBBox();if(!a)return;const{width:o,height:r}=a,l=typeof i=="number"?0:(i.right??0)-(i.left??0),c=typeof i=="number"?0:(i.bottom??0)-(i.top??0);let u=o/2,d=r/2;typeof i=="number"&&!e.hasBoxing()&&(u+=i,d+=i);const g=t.x+t.width*(s.rangeH+1)/2-u*s.labelH-l/2,f=t.y+t.height*(s.rangeV+1)/2-d*s.labelV-c/2;e.x=g,e.y=f,e.rotationCenterX=g,e.rotationCenterY=f}computeLabelSize(){const{label:t}=this;if(t.enabled===!1||!t.text)return;const e=new wf;e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=t.text,e.rotation=Ze(t.rotation??0),e.textBaseline="middle",e.textAlign="center";const i=e.getBBox();if(!i)return;const{width:n,height:s}=i;return{width:n,height:s}}calculatePadding(t){const{label:{padding:e},anchor:i}=this,n=this.computeLabelSize();if(!n)return;const{width:s,height:a}=n,o=typeof e=="number"?e*2:(e.left??0)+(e.right??0),r=typeof e=="number"?e*2:(e.top??0)+(e.bottom??0),l=o+s,c=r+a,u=this.position==="left"||this.position==="right";u&&(i.rangeH===-1&&i.labelH===1?t.left=Math.max(t.left??0,l):i.rangeH===1&&i.labelH===-1&&(t.right=Math.max(t.right??0,l))),u||(i.rangeV===-1&&i.labelV===1?t.top=Math.max(t.top??0,c):i.rangeV===1&&i.labelV===-1&&(t.bottom=Math.max(t.bottom??0,c)))}};Xs.className="CrossLine";T([b],Xs.prototype,"enabled",2);T([b],Xs.prototype,"type",2);T([b],Xs.prototype,"range",2);T([b],Xs.prototype,"value",2);T([b],Xs.prototype,"defaultColorRange",2);T([b],Xs.prototype,"fill",2);T([b],Xs.prototype,"fillOpacity",2);T([b],Xs.prototype,"stroke",2);T([b],Xs.prototype,"strokeWidth",2);T([b],Xs.prototype,"strokeOpacity",2);T([b],Xs.prototype,"lineDash",2);T([b],Xs.prototype,"label",2);var YD=class{constructor(){this.enabled=!0,this.width=1,this.style=[{fill:void 0,fillOpacity:1,stroke:void 0,strokeWidth:void 0,lineDash:[]}]}};T([b],YD.prototype,"enabled",2);T([b],YD.prototype,"width",2);T([b],YD.prototype,"style",2);var wp=class extends xt{};T([b],wp.prototype,"placement",2);T([b],wp.prototype,"step",2);T([b],wp.prototype,"values",2);T([b],wp.prototype,"minSpacing",2);T([b],wp.prototype,"maxSpacing",2);var Mi=class extends xt{constructor(){super(...arguments),this.enabled=!0,this.border=new kp,this.wrapping="never",this.truncate=!1,this.spacing=5,this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1,this._formatters={"component:year":void 0,"component:month":void 0,"component:day":void 0,"component:none":void 0,"long:year":void 0,"long:month":void 0,"long:day":void 0,"long:none":void 0}}getSideFlag(){return this.mirrored?1:-1}formatValue(e,i,n,s){const{formatter:a,format:o}=this,{type:r,value:l,domain:c,boundSeries:u}=i,d=i.type==="number"?i.fractionDigits:void 0,g=i.type==="date"?i.unit:void 0;let f;if(a!=null){const y=i.type==="date"?i.step:void 0,x=i.type==="number"?i.visibleDomain:void 0;f=e(a,{value:l,index:n,domain:c,fractionDigits:d,unit:g,step:y,boundSeries:u,visibleDomain:x})}if(o!=null&&f==null){const{specifier:y,dateStyle:x="long",truncateDate:S}=s??{},D=`${x}:${S??"none"}`;let A=this._formatters[D];const I=Tf.mergeSpecifiers(y,o);(A?.type!==r||A?.unit!==g||!ks(A?.mergedFormat,I))&&(A={type:r,mergedFormat:I,unit:g,formatter:Tf.getFormatter(r,I,g,x,{truncateDate:S})},this._formatters[D]=A),f=A.formatter?.(l,d)}return f==null||qt(f)?f:String(f)}};T([b],Mi.prototype,"enabled",2);T([b],Mi.prototype,"border",2);T([b],Mi.prototype,"cornerRadius",2);T([b],Mi.prototype,"fill",2);T([b],Mi.prototype,"fillOpacity",2);T([b],Mi.prototype,"fontStyle",2);T([b],Mi.prototype,"fontWeight",2);T([b],Mi.prototype,"fontSize",2);T([b],Mi.prototype,"fontFamily",2);T([b],Mi.prototype,"wrapping",2);T([b],Mi.prototype,"truncate",2);T([b],Mi.prototype,"spacing",2);T([b],Mi.prototype,"minSpacing",2);T([b],Mi.prototype,"color",2);T([b],Mi.prototype,"rotation",2);T([b],Mi.prototype,"avoidCollisions",2);T([b],Mi.prototype,"mirrored",2);T([b],Mi.prototype,"padding",2);T([b],Mi.prototype,"parallel",2);T([b],Mi.prototype,"itemStyler",2);T([b],Mi.prototype,"formatter",2);T([b],Mi.prototype,"format",2);var $D=class{constructor(){this.enabled=!0,this.width=1,this.stroke=void 0}};T([b],$D.prototype,"enabled",2);T([b],$D.prototype,"width",2);T([b],$D.prototype,"stroke",2);var Np=class extends xt{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6}};T([b],Np.prototype,"enabled",2);T([b],Np.prototype,"width",2);T([b],Np.prototype,"size",2);T([b],Np.prototype,"stroke",2);var Wa=class extends xt{constructor(){super(...arguments),this.caption=new Ri,this.enabled=!1,this.fontSize=zc.SMALLER,this.fontFamily="sans-serif",this.wrapping="always",this.truncate=!0}};T([b],Wa.prototype,"enabled",2);T([b],Wa.prototype,"text",2);T([b],Wa.prototype,"spacing",2);T([b],Wa.prototype,"fontStyle",2);T([b],Wa.prototype,"fontWeight",2);T([b],Wa.prototype,"fontSize",2);T([b],Wa.prototype,"fontFamily",2);T([b],Wa.prototype,"color",2);T([b],Wa.prototype,"maxWidth",2);T([b],Wa.prototype,"maxHeight",2);T([b],Wa.prototype,"wrapping",2);T([b],Wa.prototype,"truncate",2);T([b],Wa.prototype,"formatter",2);var p3=(t=>(t[t.TickAndDomain=0]="TickAndDomain",t[t.TicksOnly=1]="TicksOnly",t[t.Off=2]="Off",t))(p3||{});function AQ(t){const[e,i]=xi(t.range),n=Math.floor(e),s=Math.ceil(i);return{min:n,max:s,visible:n!==s}}var NN=Math.PI*2,IQ=NN/2;function kQ(t,e){return Math.abs(e-t)e?e+NN:e-NN}function CQ(t){const{min:e,max:i}=t,n=l=>li;return{tick:{fromFn(l,c,u){let{x1:d,x2:g,y1:f,y2:y}=l,x=l.opacity;return(u==="added"||n(c.offset))&&({x1:d,x2:g,y1:f,y2:y}=c,x=0),{x1:d,x2:g,y1:f,y2:y,opacity:x,phase:wr[u]}},toFn(l,c,u){const{x1:d,x2:g,y1:f,y2:y}=c;let x=1;return u==="removed"&&(x=0),{x1:d,x2:g,y1:f,y2:y,opacity:x}},applyFn(l,c){l.setProperties(c),l.visible=!n(l.y)}},line:{fromFn(l,c){const{x1:u,x2:d,y1:g,y2:f}=l.previousDatum??c;return{x1:u,x2:d,y1:g,y2:f,phase:wr.updated}},toFn(l,c){const{x1:u,x2:d,y1:g,y2:f}=c;return{x1:u,x2:d,y1:g,y2:f}}},label:{fromFn(l,c,u){const d=l.previousDatum??c;let{x:g,y:f,rotationCenterX:y,rotationCenterY:x,rotation:S}=d,D=l.opacity;return u==="removed"||n(d.y)?S=c.rotation:(u==="added"||n(l.datum.y))&&({x:g,y:f,rotationCenterX:y,rotationCenterY:x,rotation:S}=c,D=0),{x:g,y:f,rotationCenterX:y,rotationCenterY:x,rotation:S,opacity:D,phase:wr[u]}},toFn(l,c,u){const{x:d,y:g,rotationCenterX:f,rotationCenterY:y}=c;let x=0,S=1;return u==="added"?x=c.rotation:u==="removed"?(S=0,x=c.rotation):x=kQ(l.previousDatum?.rotation??c.rotation,c.rotation),{x:d,y:g,rotationCenterX:f,rotationCenterY:y,rotation:x,opacity:S,finish:{rotation:c.rotation}}}},group:{fromFn(l,c){const{translationX:u,translationY:d}=l;return{translationX:u,translationY:d,phase:wr.updated}},toFn(l,c){const{translationX:u,translationY:d}=c;return{translationX:u,translationY:d}}}}}function wQ(){return(t,e)=>({translationX:e.translationX,translationY:e.translationY})}function CM(){return(t,e)=>({x:e.x,y:e.y,rotationCenterX:e.rotationCenterX,rotationCenterY:e.rotationCenterY,rotation:e.rotation})}function DB(){return(t,e)=>{const{x1:i,x2:n,y1:s,y2:a}=e;return{x1:i,x2:n,y1:s,y2:a}}}function NQ(){return(t,e)=>{const{x1:i,x2:n,y1:s,y2:a}=e;return{x:i,y:s,width:n-i,height:a-s}}}var g3=(t=>(t[t.TickLines=0]="TickLines",t[t.AxisLine=1]="AxisLine",t[t.TickLabels=2]="TickLabels",t))(g3||{});function AB(t,e){return t.domain===e.domain&&t.rangeExtent===e.rangeExtent&&t.nice[0]===e.nice[0]&&t.nice[1]===e.nice[1]&&t.gridLength===e.gridLength&&t.visibleRange[0]===e.visibleRange[0]&&t.visibleRange[1]===e.visibleRange[1]&&t.scrollbarKey===e.scrollbarKey&&t.initialPrimaryTickCount?.unzoomed===e.initialPrimaryTickCount?.unzoomed&&t.initialPrimaryTickCount?.zoomed===e.initialPrimaryTickCount?.zoomed}function IB(t,e,i){const n=t.bandwidth??0,a=((t.step??0)-n)/2,o=t.convert(i),r=o-a,l=o+n+a;return[o,bf(r,e),bf(l,e)]}var Hu=class f3{constructor(e,i){this.moduleCtx=e,this.scale=i,this.id="unknown",this._crossLines=[],this.nice=!0,this.reverse=!1,this.interval=new wp,this.dataDomain={domain:[],clipped:!1},this.allowNull=!1,this.title=new Wa,this.gridLength=0,this.gridPadding=0,this.seriesAreaPadding=0,this.layoutConstraints={stacked:!0,align:"justify",width:100,unit:"percent"},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new ee({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new jg({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new jg({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new ee({name:`${this.id}-Labels`,zIndex:pe.SERIES_ANNOTATION}),this.gridGroup=new Ds({name:`${this.id}-Axis-grid`,zIndex:pe.AXIS_GRID}),this.gridFillGroup=this.gridGroup.appendChild(new ee({name:`${this.id}-gridFills`})),this.gridLineGroup=this.gridGroup.appendChild(new ee({name:`${this.id}-gridLines`})),this.crossLineRangeGroup=new jg({name:`${this.id}-CrossLines-Range`,zIndex:pe.SERIES_CROSSLINE_RANGE}),this.crossLineLineGroup=new jg({name:`${this.id}-CrossLines-Line`,zIndex:pe.SERIES_CROSSLINE_LINE}),this.crossLineLabelGroup=new jg({name:`${this.id}-CrossLines-Label`,zIndex:pe.SERIES_LABEL}),this.tickLabelGroupSelection=pn.select(this.tickLabelGroup,wf,!1),this.line=new $D,this.tick=new Np,this.gridLine=new YD,this.label=this.createLabel(),this.defaultTickMinSpacing=f3.defaultTickMinSpacing,this.translation={x:0,y:0},this.layout={label:{fractionDigits:0,spacing:this.label.spacing,format:this.label.format},labelThickness:0},this.axisContext=void 0,this.cleanup=new qe,this.isHovering=!1,this.range=[0,1],this.visibleRange=[0,1],this.animatable=!0,this.tickLayout=void 0,this.formatterBoundSeries=new oj(()=>{const{direction:n,boundSeries:s}=this;return za(s.flatMap(a=>a.getFormatterContext(n)))}),this.moduleMap=new QT,this.range=this.scale.range.slice();for(const n of this.crossLines)this.initCrossLine(n);this.cleanup.register(this.moduleCtx.widgets.containerWidget.addListener("mousemove",n=>this.onMouseMove(n)),this.moduleCtx.widgets.containerWidget.addListener("mouseleave",()=>this.endHovering()))}set crossLines(e){const{CrossLineConstructor:i}=this.constructor;for(const n of this._crossLines)this.detachCrossLine(n);this._crossLines=e.map(n=>{const s=new i;return s.set(n),s});for(const n of this._crossLines)this.attachCrossLine(n),this.initCrossLine(n)}get crossLines(){return this._crossLines}get type(){return this.constructor.type??""}get primaryLabel(){}get primaryTick(){}isCategoryLike(){return!1}resetAnimation(e){}onMouseMove(e){const n=this.tickLabelGroup.pickNode(e.currentX,e.currentY)?.datum,{textUntruncated:s=void 0}=n??{};s?(this.moduleCtx.tooltipManager.updateTooltip(this.id,{canvasX:e.currentX,canvasY:e.currentY,showArrow:!1},[{type:"structured",title:s}]),this.isHovering=!0):this.endHovering()}endHovering(){this.isHovering&&(this.moduleCtx.tooltipManager.removeTooltip(this.id,void 0,!0),this.isHovering=!1)}attachCrossLine(e){this.crossLineRangeGroup.appendChild(e.rangeGroup),this.crossLineLineGroup.appendChild(e.lineGroup),this.crossLineLabelGroup.appendChild(e.labelGroup)}detachCrossLine(e){e.rangeGroup.remove(),e.lineGroup.remove(),e.labelGroup.remove()}destroy(){this.moduleMap.destroy(),this.cleanup.flush()}setScaleRange(e){const{range:i,scale:n}=this,s=(i[1]-i[0])/(e[1]-e[0]),a=s*e[0],o=i[0]-a;n.range=[o,o+s]}updateScale(){const{range:[e,i]}=this;this.setScaleRange(this.visibleRange);for(const n of this.crossLines)n.clippedRange=[e,i]}setCrossLinesVisible(e){this.crossLineRangeGroup.visible=e,this.crossLineLineGroup.visible=e,this.crossLineLabelGroup.visible=e}attachAxis(e){e.gridNode.appendChild(this.gridGroup),e.axisNode.appendChild(this.axisGroup),e.labelNode.appendChild(this.labelGroup),e.crossLineRangeNode.appendChild(this.crossLineRangeGroup),e.crossLineLineNode.appendChild(this.crossLineLineGroup),e.crossLineLabelNode.appendChild(this.crossLineLabelGroup)}detachAxis(){this.gridGroup.remove(),this.axisGroup.remove(),this.labelGroup.remove(),this.crossLineRangeGroup.remove(),this.crossLineLineGroup.remove(),this.crossLineLabelGroup.remove()}attachLabel(e){this.labelGroup.append(e)}inRange(e,i=0){const[n,s]=xi(this.range);return e>=n-i&&e<=s+i}getRangeOverflow(e){const{range:i,visibleRange:n}=this,s=(i[1]-i[0])/(n[1]-n[0]),[a,o]=xi([i[0]-s*n[0],i[0]-s*n[0]+s]);return eo?e-o:0}onGridLengthChange(e,i){i^e&&this.onGridVisibilityChange();for(const n of this.crossLines)this.initCrossLine(n)}onGridVisibilityChange(){}createLabel(){return new Mi}update(){this.formatterBoundSeries.clear(),this.updatePosition(),this.updateSelections(),this.gridLineGroup.visible=this.gridLine.enabled,this.updateLabels(),this.updateCrossLines()}getLabelStyles(e,i,n=this.label){const s={border:n.border,color:n.color,cornerRadius:n.cornerRadius,fill:n.fill,fillOpacity:n.fillOpacity,fontFamily:n.fontFamily,fontSize:n.fontSize,fontStyle:n.fontStyle,fontWeight:n.fontWeight,padding:n.padding,spacing:n.spacing};let a;n.itemStyler&&(a=this.cachedCallWithContext(n.itemStyler,{...e,...s}));const o=Et(a,i,s);return{border:o.border,color:o.color,cornerRadius:o.cornerRadius,fill:o.fill,fillOpacity:o.fillOpacity,fontFamily:o.fontFamily,fontSize:o.fontSize,fontStyle:o.fontStyle,fontWeight:o.fontWeight,padding:o.padding,spacing:o.spacing}}getTickSize(e=this.tick){return e.enabled?e.size:0}getTickSpacing(e=this.tick){if(!e.enabled)return 0;const i=this.chartLayout?.scrollbars?.[this.id];return!i?.enabled||i.placement!=="inner"?0:i.tickSpacing??0}processData(){this.invalidateLayoutCache();const{includeInvisibleDomains:e,boundSeries:i,direction:n}=this,a=(e?i:i.filter(o=>o.isEnabled())).map(o=>o.getDomain(n));this.setDomains(...a)}getDomainExtentsNice(){return[this.nice,this.nice]}setDomains(...e){let i,n;if(e.length>0){const s=this.scale.normalizeDomains(...e);i={domain:s.domain,sortMetadata:{sortOrder:1}},n=s.animatable}else i={domain:[]},n=!0;this.dataDomain=this.normaliseDataDomain(i),this.allowNull=this.dataDomain.domain.some(function(s){return s==null}),this.reverse&&(this.dataDomain={...this.dataDomain,domain:this.dataDomain.domain.toReversed()}),this.animatable=n}calculateDomain(e,i="none"){const{dataDomain:{domain:n},range:s,scale:a,gridLength:o}=this,r=Tc(s),l=[0,1],c=this.getDomainExtentsNice();this.updateScale();const{unzoomedTickLayoutCache:u}=this;let d;if(u==null||!AB(u,{domain:n,rangeExtent:r,nice:c,gridLength:o,visibleRange:l,initialPrimaryTickCount:e,scrollbarKey:i})){const g=a.range;this.setScaleRange([0,1]);const f=c.map(y=>y?0:2);d=this.calculateTickLayout(n,f,[0,1],e),a.range=g,this.unzoomedTickLayoutCache={domain:n,rangeExtent:r,nice:c,gridLength:o,visibleRange:l,initialPrimaryTickCount:e,scrollbarKey:i,tickLayout:d}}else d=u.tickLayout;return this.updateScale(),a.domain=d.niceDomain,{unzoomedTickLayout:d,domain:a.domain}}calculateLayout(e,i){this.chartLayout=i;const n=this.getScrollbarLayoutCacheKey(i),{visibleRange:s}=this,a=s[0]===0&&s[1]===1,{unzoomedTickLayout:o,domain:r}=this.calculateDomain(e,n),l=this.getDomainExtentsNice();let c;if(a)c=o;else{const{range:x,gridLength:S}=this,D=Tc(x),A=l.map(w=>w?1:2),{tickLayoutCache:I}=this;I==null||!AB(I,{domain:r,rangeExtent:D,nice:l,gridLength:S,visibleRange:s,initialPrimaryTickCount:e,scrollbarKey:n})?(c=this.calculateTickLayout(r,A,s,e),this.tickLayoutCache={domain:r,rangeExtent:D,nice:l,gridLength:S,visibleRange:s,initialPrimaryTickCount:e,scrollbarKey:n,tickLayout:c}):c=I.tickLayout}const{rawTickCount:u=0,fractionDigits:d,bbox:g}=c,f=o.rawTickCount??0,y=u!==0&&f!==0?{zoomed:u,unzoomed:f}:void 0;return this.tickLayout=c.layout,this.layout.label={fractionDigits:d,spacing:this.label.spacing,format:this.label.format},this.layoutCrossLines(),{primaryTickCount:y,bbox:g}}invalidateLayoutCache(){this.unzoomedTickLayoutCache=void 0,this.tickLayoutCache=void 0,this.tickLayout=void 0}getScrollbarLayoutCacheKey(e){const i=e?.scrollbars?.[this.id];return i?.enabled?`${i.placement}:${i.spacing}:${i.thickness}:${i.tickSpacing}`:"none"}updateCrossLines(){const e=this.hasDefinedDomain()||this.hasVisibleSeries();for(const i of this.crossLines)i.gridPadding=this.gridPadding,i.update(e)}updatePosition(){const{crossLineRangeGroup:e,crossLineLineGroup:i,crossLineLabelGroup:n,gridGroup:s,translation:a}=this,o=Math.floor(a.x),r=Math.floor(a.y);s.setProperties({translationX:o,translationY:r}),e.setProperties({translationX:o,translationY:r}),i.setProperties({translationX:o,translationY:r}),n.setProperties({translationX:o,translationY:r})}tickFormatter(e,i,n,s,a,o="long"){const{moduleCtx:r,label:l}=this,{formatManager:c}=r,u=n?this.primaryLabel:void 0,d=this.tickFormatParams(e,i,s,a),g=this.formatterBoundSeries.get();let f,y,x;if(d.type==="number")f=d.fractionDigits;else if(d.type==="date"){const{unit:O,step:L,epoch:R}=d;y={unit:O,step:L,epoch:R},x=d.truncateDate}const S=this.uncachedCallWithContext.bind(this),D={datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"axis-label",property:this.getFormatterProperty(),domain:e,boundSeries:g},A=u??l,I=n?l.format:void 0,{allowNull:w}=this,N={specifier:Tf.mergeSpecifiers(u?.format,l.format),truncateDate:x,allowNull:w};return(O,L)=>{const R=this.datumFormatParams(O,D,f,y,o);return R.value=O,A.formatValue(S,R,L,{specifier:I,dateStyle:o,truncateDate:x})??c.format(S,R,N)??c.defaultFormat(R,N)}}formatDatum(e,i,n,s,a,o,r,l,c,u,d){if(i==null&&!d)return"";const{moduleCtx:g,dataDomain:f}=this;l??(l=f.domain);const{formatManager:y}=g,x=this.formatterBoundSeries.get();let S;switch(n){case"crosshair":case"annotation-label":S=this.layout.label.fractionDigits+1;break;case"series-label":S=2;break;case"tooltip":S=3;break;case"legend-label":S=void 0;break}const D=this.datumFormatParams(i,{source:n,datum:o,seriesId:s,legendItemName:a,key:r,property:this.getFormatterProperty(),domain:l,boundSeries:x},S,void 0,"long"),{type:A,value:I}=D,w=this.createCallWithContext(e),N=c?.formatValue(w,A,I,u??D)??y.format(w,D,{allowNull:d})??this.label.formatValue(w,D,Number.NaN)??y.defaultFormat(D);return qt(N)?N:String(N)}getBBox(){return this.axisGroup.getBBox()}initCrossLine(e){e.scale=this.scale,e.gridLength=this.gridLength,e.gridPadding=this.gridPadding}hasVisibleSeries(){return this.boundSeries.some(e=>e.isEnabled())}clipTickLines(e,i,n,s){this.tickLineGroup.setClipRect(new Tt(e,i,n,s))}clipGrid(e,i,n,s){this.gridGroup.setClipRect(new Tt(e,i,n,s))}getFormatterProperty(){const{direction:e,boundSeries:i}=this;let n=e;for(const s of i){const a=s.resolveKeyDirection(e);if(a!==e){n=a;break}}return n}getTitleFormatterParams(e){const{direction:i}=this,n=this.formatterBoundSeries.get();return{domain:e,direction:i,boundSeries:n,defaultValue:this.title?.text}}normaliseDataDomain(e){return{domain:[...e.domain],clipped:!1}}getLayoutTranslation(){return this.translation}getLayoutState(){return{id:this.id,rect:this.getBBox(),translation:this.getLayoutTranslation(),gridPadding:this.gridPadding,seriesAreaPadding:this.seriesAreaPadding,tickSize:this.getTickSize(),direction:this.direction,domain:this.dataDomain.domain,scale:this.scale,...this.layout}}getModuleMap(){return this.moduleMap}getUpdateTypeOnResize(){return Ct.PERFORM_LAYOUT}createModuleContext(){return this.axisContext??(this.axisContext=this.createAxisContext()),{...this.moduleCtx,parent:this.axisContext}}createAxisContext(){const{scale:e}=this;return{axisId:this.id,scale:this.scale,direction:this.direction,continuous:ti.is(e)||Gc.is(e),getCanvasBounds:()=>Ti.toCanvas(this.axisGroup),seriesKeyProperties:()=>this.boundSeries.reduce((i,n)=>{const s=n.getKeyProperties(this.direction);for(const a of s)i.add(a);return i},new Set),seriesIds:()=>this.boundSeries.map(i=>i.id),scaleInvert:i=>e.invert(i,!0),scaleInvertNearest:i=>e.invert(i,!0),formatScaleValue:(i,n,s)=>{const{allowNull:a}=this;return this.formatDatum(void 0,i,n,void 0,void 0,void 0,void 0,void 0,s,void 0,a)},attachLabel:i=>this.attachLabel(i),inRange:(i,n)=>this.inRange(i,n),getRangeOverflow:i=>this.getRangeOverflow(i),pickBand:i=>this.pickBand(i),measureBand:i=>this.measureBand(i)}}pickBand(e){if(!Rr.is(this.scale))return;const{scale:i,range:n,id:s}=this,a=i.invert(this.isVertical()?e.y:e.x,!0),[o,r,l]=IB(i,n,a);return{id:s,value:a,band:[r,l],position:o}}measureBand(e){if(!Rr.is(this.scale))return;const[,i,n]=IB(this.scale,this.range,e);return{band:[i,n]}}isVertical(){return this.direction===z.Y}isReversed(){return this.reverse}cachedCallWithContext(e,i){const{callbackCache:n,chartService:s}=this.moduleCtx;return n.call([this,s],e,i)}uncachedCallWithContext(e,i){const{chartService:n}=this.moduleCtx;return js([this,n],e,i)}createCallWithContext(e){const{chartService:i}=this.moduleCtx;return(n,s)=>js([e,this,i],n,s)}};Hu.defaultTickMinSpacing=50;Hu.CrossLineConstructor=Xs;T([b],Hu.prototype,"nice",2);T([b],Hu.prototype,"reverse",2);T([b],Hu.prototype,"interval",2);T([b],Hu.prototype,"title",2);T([Bi((t,e,i)=>t.onGridLengthChange(e,i))],Hu.prototype,"gridLength",2);var JT=Hu,tL=class extends Mi{constructor(){super(...arguments),this.autoRotateAngle=335}};T([b],tL.prototype,"autoRotate",2);T([b],tL.prototype,"autoRotateAngle",2);var Of=class m3 extends Rr{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this.index=new Map,this.indexInitialized=!1,this._domain=[]}static is(e){return e instanceof m3}set domain(e){this._domain!==e&&(this.invalid=!0,this._domain=e,this.index.clear(),this.indexInitialized=!1)}get domain(){return this._domain}get bands(){return this._domain}normalizeDomains(...e){let i;const n=new Set;let s=!0;for(const a of e){const o=a.domain;n.has(o)||(n.add(o),i==null?i=kB(o):(s&&(s=TQ(o,i)),i=kB([...i,...o])))}return i??(i=[]),{domain:i,animatable:s}}toDomain(e){}invert(e,i=!1){this.refresh();const n=i?this.bandwidth/2:0,s=this.invertNearestIndex(Math.max(0,e-n));return i||e===this.ordinalRange(s)?this.domain[s]:void 0}ticks(e,i=this.domain,n){const{bands:s}=this;let{tickCount:a}=e;if(a===0){const x=s.length>1?1:0;return{ticks:s[x]?[s[x]]:[],count:void 0,firstTickIndex:x}}let o=a!=null&&a!==0?Math.trunc(s.length/a):1;if(o=nN(o),o<=1)return dG(i,!1,n);a=Math.trunc(s.length/o);const r=o*a,l=nN(Math.trunc((s.length-r)/2)),c=Nt(0,Math.floor((n?.[0]??0)*s.length),s.length),u=Nt(0,Math.ceil((n?.[1]??1)*s.length),s.length),d=Math.floor((c-l)/o)*o+l,g=Math.ceil((u-l)/o)*o+l,f=[];for(let x=d;x=0&&x0?this.findIndex(f[0]):void 0;return y!=null&&(y=Math.floor((y-l)/o)),{ticks:f,count:void 0,firstTickIndex:y}}findIndex(e){const{index:i,indexInitialized:n}=this;if(!n){const{domain:s}=this;for(let a=0;ao%d.duration===0);if(r){const{timeInterval:d,step:g,duration:f}=r,y={...d,step:g*Al(d)*Math.round(o/f),epoch:xT(d,{weekStart:XD})};return fo(y,new Date(t),new Date(e),{visibleRange:s,extend:a})}let l=new Date(Math.min(t,e));const c=new Date(Math.max(t,e)),u=[];for(;l<=c;)u.push(l),l=new Date(l),l.setMilliseconds(l.getMilliseconds()+o);return u}function OQ(t,e,i,n){const{interval:s}=i,a=Math.min(Ss(t),Ss(e)),o=Math.max(Ss(t),Ss(e));let r;if(Ie(s)||typeof s=="string")r=s;else{let d;typeof s=="number"&&(d=(o-a)/Math.max(s,1),lp(d,n)&&(d=void 0)),d??(d=i.tickCount??ti.defaultTickCount),r=Px(a,o,d,i.minTickCount,i.maxTickCount,{weekStart:XD})}if(r==null)return[t,e];const l=fo(r,new Date(a),new Date(o),{extend:!0});if(l==null||l.length<2)return[t,e];const c=l[0],u=l.at(-1);return t<=e?[c,u]:[u,c]}var EQ=1e3,du=class x3 extends Gc{constructor(){super(...arguments),this.type="ordinal-time",this.defaultTickCount=ti.defaultTickCount,this._domain=[],this.isReversed=!1}static is(e){return e instanceof x3}set domain(e){e!==this._domain&&(this.invalid=!0,this._domain=e,this._bands=void 0,this._numericBands=void 0,this._uniformityCache=void 0,this.isReversed=CB(e))}get domain(){return this._domain}get bands(){return this._bands??(this._bands=this.isReversed?this.domain.slice().reverse():this.domain),this._bands}get numericBands(){return this._numericBands??(this._numericBands=this.bands.map(e=>e.valueOf())),this._numericBands}getUniformityCache(e){const{bands:i}=this,n=i.length;if(!e||e[0]===0&&e[1]===1)return n>EQ&&this._uniformityCache===void 0&&(this._uniformityCache=fB(i)),this._uniformityCache;const s=Math.floor(e[0]*n),a=Math.min(Math.ceil(e[1]*n),n-1);return fB(i,s,a)}normalizeDomains(...e){const i=e.filter(a=>a.domain.length>0);if(i.length===0)return{domain:[],animatable:!1};const n=i[0].domain,s=i.every(a=>a.domain===n);if(i.length===1||s){const a=i[0];let o=a.domain,r,l=!1;return a.sortMetadata?.sortOrder===void 0?r=aT(o):(r=a.sortMetadata.sortOrder,l=a.sortMetadata.isUnique??!1),r===-1?o=o.slice().reverse():r==null&&(o=l?o.slice().sort((c,u)=>c.valueOf()-u.valueOf()):rN(o.slice())),{domain:o,animatable:!0}}return{domain:rN(i.map(a=>a.domain).flat()),animatable:!0}}ticks(e,i,n=[0,1],{extend:s=!1,dropInitial:a=!1}={}){const{interval:o,maxTickCount:r,tickCount:l=r}=e,{bands:c,reversed:u}=this;if(!c.length)return;if(u&&(n=[1-n[1],1-n[0]]),this.refresh(),o==null){const{ticks:I,tickOffset:w,tickEvery:N}=this.getDefaultTicks(i,l,n,s);let O=I.length>0?this.findIndex(I[0]):void 0;return O=O==null?void 0:Math.floor((O-w)/N),{ticks:I,count:void 0,firstTickIndex:O}}let d,g;i&&i.length>=2?(d=i[0].valueOf(),g=i.at(-1).valueOf()):(d=c[0].valueOf(),g=c.at(-1).valueOf());const[f,y]=this.range,x=Math.abs(y-f),S=b3({start:d,stop:g,interval:o,availableRange:x,visibleRange:n,extend:s})??this.getDefaultTicks(i,l,n,s).ticks,D=[];let A=-1;for(const I of S){const w=this.findIndex(I,wi.Trailing)??-1,N=w===A;A=w,!(a&&w===0)&&w!==-1&&!N&&D.push(c[w])}return{ticks:D,count:void 0,firstTickIndex:void 0}}stepTicks(e,i,n=[0,1],s=!0){const a=i?this.bandDomainIndices(i):void 0,o=this.ticksEvery(a,n,e,0,!1),r=o.at(-1),l=s&&e>1?a?.[1]:void 0,c=l!=null&&r!=null?this.findIndex(r):void 0;return c!=null&&l!=null&&l-c0&&t[0]>t.at(-1)}var RQ=1e3,TN=5e7,eu=class v3 extends Gc{constructor(){super(...arguments),this.type="unit-time",this.defaultTickCount=1/0,this._domain=[],this._bands=void 0}static is(e){return e instanceof v3}static supportsInterval(e,i){return wB(e,i)}set domain(e){if(e!==this._domain){if(e.length===this._domain.length&&e.length>=2&&e[0].valueOf()===this._domain[0].valueOf()&&e[1].valueOf()===this._domain[1].valueOf()){this._domain=e;return}this._domain=e,this.invalidateCaches()}}get domain(){return this._domain}get interval(){return this._interval}set interval(e){this._interval!==e&&(this._interval=e,this.invalidateCaches())}invalidateCaches(){this._bands=void 0,this._numericBands=void 0,this._uniformityCache=void 0,this._domainBoundaries=void 0,this._bandRangeCache=void 0,this._encodedBands=void 0,this._encodingParams=void 0,this._linearParams=void 0}get bands(){if(this._bands===void 0)if(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null){const e=this._encodingParams;this._bands=this._encodedBands.map(i=>Lj(i,e))}else this._bands=[];return this._bands}get numericBands(){if(this._numericBands===void 0)if(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null){const e=this._encodingParams;this._numericBands=this._encodedBands.map(i=>Hh(i,e))}else this._numericBands=[];return this._numericBands}ensureEncodedBands(){if(this._encodedBands!==void 0)return;const{domain:e,interval:i}=this;if(e.length<2||i==null){this._encodedBands=[];return}const n=this.getCachedBandRange();if(n==null){this._encodedBands=[];return}const[s,a]=n,o={visibleRange:[0,1],extend:!1};if(mM(i,s,a,o)>TN){pt.warnOnce("the configured unit results in too many bands, ignoring. Supply a larger unit."),this._encodedBands=[];return}const{encodedValues:r,encodingParams:l}=Tj(i,s,a,o);this._encodedBands=r,this._encodingParams=l}getBandCountForUpdate(){return this.ensureEncodedBands(),this._encodedBands?.length??0}getUniformityCache(e){const i=this.getBandCountForUpdate();if(!e||e[0]===0&&e[1]===1){if(i>RQ&&this._uniformityCache===void 0)if(this.ensureEncodedBands(),this._encodingParams!=null&&this._encodedBands!=null&&this._encodedBands.length>=2){const n=Hh(this._encodedBands[0],this._encodingParams),s=Hh(this._encodedBands[1],this._encodingParams);this._uniformityCache={isUniform:!0,interval:s-n}}else this._uniformityCache={isUniform:!1};return this._uniformityCache}if(this.ensureEncodedBands(),this._encodingParams!=null&&this._encodedBands!=null&&this._encodedBands.length>=2){const n=Hh(this._encodedBands[0],this._encodingParams);return{isUniform:!0,interval:Hh(this._encodedBands[1],this._encodingParams)-n}}return{isUniform:!1}}normalizeDomains(...e){return e3(...e)}getCachedBandRange(){const{domain:e,interval:i}=this;if(!(e.length<2||i==null))return this._bandRangeCache??(this._bandRangeCache={start:La(i,e[0]),stop:La(i,e[1])}),[this._bandRangeCache.start,this._bandRangeCache.stop]}getDomainBoundaries(){const{interval:e}=this;if(e!=null){if(this._domainBoundaries===void 0){const i=this.getCachedBandRange();if(i==null)return;const[n,s]=i,a=Math.min(n.valueOf(),s.valueOf()),o=Math.max(n.valueOf(),s.valueOf()),r=mT(e,new Date(o)).valueOf();this._domainBoundaries={d0:a,dNext:r}}return this._domainBoundaries}}getLinearParams(){if(this._linearParams===void 0&&(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null&&this._encodedBands.length>=2)){const e=Hh(this._encodedBands[0],this._encodingParams),i=Hh(this._encodedBands[1],this._encodingParams);this._linearParams={firstBandTime:e,intervalMs:i-e}}return this._linearParams}isLinearUnit(){const e=this._encodingParams?.unit;return e==="millisecond"||e==="second"||e==="minute"||e==="hour"}findIndex(e,i=wi.Leading){if(e==null)return;const n=this.getBandCountForUpdate();if(n===0)return;if(n===1)return 0;const s=this.getLinearParams();if(s==null||s.intervalMs===0)return super.findIndex(e,i);const{firstBandTime:a,intervalMs:o}=s,r=e.valueOf(),l=(r-a)/o;let c=i===wi.Trailing?Math.ceil(l):Math.floor(l);if(c=Math.max(0,Math.min(c,n-1)),this.isLinearUnit()){if(i===wi.Trailing){if(a+c*or&&c===0)return;return c}const u=this.numericBands;if(i===wi.Trailing){for(;c>0&&u[c-1]>=r;)c--;for(;c0&&u[c]>r;)c--;if(u[c]>r)return}return c}convert(e,i){this.refresh(),e instanceof Date||(e=new Date(e));const{domain:n,interval:s}=this;if(n.length<2)return Number.NaN;if(i?.clamp!==!0&&s!=null){const a=this.getDomainBoundaries();if(a!=null){const o=e.valueOf();if(o=a.dNext)return Number.NaN}}return super.convert(e,i)}calculateBands(e,i,n=!1){const s=e===this.domain&&i[0]===0&&i[1]===1&&!n;if(s&&this._bands!=null)return{bands:this._bands,firstBandIndex:0};if(e.length<2)return{bands:[],firstBandIndex:void 0};const{interval:a}=this;if(a==null)return{bands:[],firstBandIndex:void 0};const o={visibleRange:i,extend:n};if(!wB(e,a,o))return{bands:[],firstBandIndex:void 0};const r=e===this.domain?this.getCachedBandRange():LN(e,a);if(r==null)return{bands:[],firstBandIndex:void 0};const[l,c]=r;if(mM(a,l,c,o)>TN)return pt.warnOnce("the configured unit results in too many bands, ignoring. Supply a larger unit."),{bands:[],firstBandIndex:void 0};const u=fo(a,l,c,o),d=bT(a,l,c,o);return s&&(this._bands=u),{bands:u,firstBandIndex:d}}ticks({interval:e},i=this.domain,n=[0,1],{extend:s=!1}={}){if(i.length<2)return;const a=i===this.domain&&!s;if(a&&e!=null)return this.ticksFromNumericBands(e,i,n);let o,r,l;return a?({bands:o}=this.calculateBands(i,[0,1],!1),l=zz(o,!1,n),r=l[0]):{bands:o,firstBandIndex:r}=this.calculateBands(i,n,s),e==null?{ticks:o,count:void 0,firstTickIndex:r}:this.ticksFromBands(e,o,i,n,s,l,r)}ticksFromNumericBands(e,i,n){const s=this.numericBands,a=s.length;if(a===0)return{ticks:[],count:0,firstTickIndex:void 0};const o=zz(s,!1,n),r=o[0],l=this.interval?Ms(this.interval):1/0,c=Math.min(i[0].valueOf(),i[1].valueOf()),u=Math.max(i[0].valueOf(),i[1].valueOf());let d,g,f;if(Ie(e)||typeof e=="string")d=fo(e,i[0],i[1],{extend:!0,visibleRange:n}).map(I=>I.valueOf()),g=0,f=d.length-1;else{const A=o[0],I=o[1]-1;d=s,g=Dr(A,I,w=>s[w]<=c)??A,f=Dr(A,I,w=>s[w]<=u)??I}const y=[];let x;for(let A=g;A<=f;A++){const I=d[A],w=Dr(0,a-1,N=>s[N]<=I);w!=null&&w!==x&&I-s[w]<=l&&y.push(s[w]),x=w}const[S,D]=this.sliceTickWindow(y,c,u,!1);return{ticks:y.slice(S,D+1).map(A=>new Date(A)),count:y.length,firstTickIndex:r}}ticksFromBands(e,i,n,s,a,o,r){const l=this.interval?Ms(this.interval):1/0,c=Math.min(n[0].valueOf(),n[1].valueOf()),u=Math.max(n[0].valueOf(),n[1].valueOf());let d,g,f;if(Ie(e)||typeof e=="string")d=fo(e,n[0],n[1],{extend:!0,visibleRange:s}),g=0,f=d.length-1;else{const I=o?o[0]:0,w=o?o[1]-1:i.length-1;d=i,g=Dr(I,w,N=>i[N].valueOf()<=c)??I,f=Dr(I,w,N=>i[N].valueOf()<=u)??w}const y=[];let x;for(let I=g;I<=f;I++){const w=d[I].valueOf(),N=Dr(0,i.length-1,L=>i[L].valueOf()<=w),O=N!=null&&N!=x?i[N]:void 0;x=N,O!=null&&w-O.getTime()<=l&&y.push(O)}const S=y.map(I=>I.valueOf()),[D,A]=this.sliceTickWindow(S,c,u,a);return{ticks:y.slice(D,A+1),count:y.length,firstTickIndex:r}}sliceTickWindow(e,i,n,s){let a,o;if(this.interval){const c=LN([new Date(i),new Date(n)],this.interval);a=c[0].valueOf(),o=c[1].valueOf()}else a=i,o=n;let r=vf(0,e.length-1,c=>e[c]>=a)??0,l=Dr(0,e.length-1,c=>e[c]<=o)??e.length-1;return s&&(r=Math.max(r-1,0),l=Math.min(l+1,e.length-1)),[r,l]}};function wB(t,e,i){const[n,s]=LN(t,e);return mM(e,n,s,i)<=TN}function LN(t,e){const i=La(e,t[0]),n=La(e,t[1]);return[i,n]}function PQ(t,e,i,n,s){let[a,o]=xi(e.map(Number));const r=Math.floor(i.unzoomed);if(r<=1){const[D,A]=zQ(a,o),I=5*Math.pow(2,-Math.ceil(Math.log2(s[1]-s[0]))),{ticks:w}=Xf(D,A,I,void 0,void 0,s),N=[t.toDomain(D),t.toDomain(A)];return n&&N.reverse(),{domain:N,ticks:w}}if(a===o){const D=Math.floor(Math.log10(a)),A=Math.pow(10,D),I=Math.min(A,1),w=r-1;a-=I*Math.floor(w/2),o=a+I*w}let l=a,c=o;l=BQ(l,c,r);const u=_Q(l,c,r),d=r-1;c=l+d*u;const g=Math.floor(l/u)*u,f=Math.floor(c/u)*u;g<=a&&f>=o&&(l=g,c=f);const y=[t.toDomain(l),t.toDomain(c)];n&&y.reverse();const x=u*((i.unzoomed-1)/(i.zoomed-1)),S=VQ(l,x,Math.floor(i.zoomed));return{domain:y,ticks:S}}function zQ(t,e){let i=t,n=e,s=0;do{[i,n]=ST(i,n);const{ticks:a}=Xf(i,n,5);if(a.length%2===1)return[i,n];i-=1,n+=1}while(s++<10);return[t,e]}function BQ(t,e,i){t=Math.floor(t);const n=Math.abs(e-t)/(i-1),s=Math.floor(Math.log10(n)),a=Math.pow(10,s);return Math.floor(t/a)*a}function VQ(t,e,i){const n=Hf(e),s=Math.pow(10,n),a=[];for(let o=0;o0&&n<=1?i:n>1&&n<=2?2*i:n>2&&n<=5?5*i:n>5&&n<=10?10*i:t}var HQ=18,jQ=[1,2,3,4,6,8,9,10,12];function NB(t,e=0){const i=[];for(const n of t){const{x:s,y:a,width:o,height:r}=n;if(i.some(l=>iT(l,s,a,o+e,r+e)))return!0;i.push(n)}return!1}function GQ(t,e,i,n){if(t==null)return e;if(typeof t!="number"){const r=e[0],l=typeof t=="string"?{unit:t,epoch:r}:{...t,epoch:r};return fo(l,e[0],e[1],{visibleRange:i,extend:n})}const s=[],a=e[0].valueOf(),o=e[1].valueOf();for(let r=a;r<=o;r+=t)s.push(new Date(r));return s}function TB(t,e){if(t.length!==e.length)return!1;for(let i=0;i{const I=Rr.is(c)&&c.bandwidth||1/0,w=(c.bandwidth??0)/2,N=KQ(u.enabled,s,e,i,r,l,d);let O=f?y:I,L=f?I:y;if(u.rotation){const P=tT(u.rotation,O,L);O=P.width,L=P.height}const R={font:u,maxWidth:O,maxHeight:L,overflow:u.truncate?"ellipsis":"hide",textWrap:u.wrapping};for(let P=0;P(d?c:u)?.(g,f)??String(g)}function YQ(t,e,i,n,s,a,o,r){if(!Ef.is(t)&&!Gc.is(t))return;const l=Rx(a);if(l==null)return;o&&(e=[1-e[1],1-e[0]]);const c=Math.min(t.domain[0].valueOf(),t.domain.at(-1).valueOf()),u=Math.max(t.domain[0].valueOf(),t.domain.at(-1).valueOf());let[d,g]=yT(new Date(c),new Date(u),e);d=La(l,d),d.valueOf()>=c&&(d=Nj(l,d)),g=wj(l,g),g.valueOf()<=u&&(g=mT(l,g));const f=fo(l,d,g),y=Ms(a),x=du.is(t),S={...s,interval:a},D=[];let A,I,w,N=0;if(du.is(t)){const O=Er(a);I=r!=null&&Ms(r)>=Ms(O)?2:3,w=wi.Trailing;const L=i/n,R=t.bandCount(e)/(L*HQ);N=jQ.findLast(P=>R>=P)??1}else eu.is(t)&&(t.interval==null||Ms(t.interval)>=y)?I=1:(I=0,w=wi.Interpolate);for(let O=0;OZ.valueOf(){switch(I){case 0:case 3:return Z.valueOf()+y>R.valueOf();case 1:case 2:return Z.valueOf()>=R.valueOf()}}),$.length===0)continue;const Y=$[0],U=sT(Y,L);(I===0?U===0:U<=y)&&(!x||!P)&&(A??(A=new Set),A.add(D.length)),D.push(...$)}return A?.size===1&&A.has(0)&&(A=void 0),{ticks:D,primaryTicksIndices:A,alignment:w}}function $Q(t,e,i,n,s){const a=LB(t.format,n);if(a==null)return{width:0,height:0};const o=kf(a),r=n?Rx(n):void 0,l=LB(e?.format,r),c=l?kf(l):o,u=new Date(i[0]),d=new Date(i.at(-1)),g=r?fo(r,new Date(i[0]),new Date(i.at(-1)),{extend:!0}):void 0;let f=0,y=0;if(o!=null){const x=Lf(t),S=x.left+x.right,D=x.top+x.bottom;let A,I;g!=null&&g.length>1?(A=g[0],I=g[1]):(A=u,I=d);const w=fo(n,A,I,{limit:50});for(const N of w){const O=o(N),{width:L,height:R}=s.measureLines(O);f=Math.max(f,L+S),y=Math.max(y,R+D)}}if(c!=null&&g!=null){const x=Lf(e),S=x.left+x.right,D=x.top+x.bottom;for(const A of g){const I=c(A),{width:w,height:N}=s.measureLines(I);f=Math.max(f,w+S),y=Math.max(y,N+D)}}return{width:Math.ceil(f),height:Math.ceil(y)}}function XQ(t,e,i,n){return t&&!e?i*n===-1?"top":"bottom":"middle"}function ZQ(t,e,i,n,s){const a=e>0&&e<=Math.PI,o=i>0&&i<=Math.PI,r=a||o?-1:1;if(t)if(e||i){if(n*r===-1)return"right"}else return"center";else if(n*s===-1)return"right";return"left"}function LB(t,e){if(t!=null){if(typeof t=="string")return t;if(Ie(t)&&e!=null)return t[Er(e)]}}function qQ(t,e,i=0){const n=Dl(t),s=!n&&i>=0&&i<=Math.PI?-1:1,a=!n&&i-Math.PI/2>=0&&i-Math.PI/2<=Math.PI?-1:1,o=e?s*(Math.PI/2):0;return{configuredRotation:n,defaultRotation:o,parallelFlipFlag:s,regularFlipFlag:a}}var QQ=new Date(1970,0,4);function M3(t){const{label:e,domain:i,axisRotation:n,labelOffset:s,sideFlag:a}=t,{defaultRotation:o,configuredRotation:r,parallelFlipFlag:l,regularFlipFlag:c}=qQ(e.rotation,e.parallel,n),u=r+o,d=(R,P=0)=>{const B=e.minSpacing??(r===0&&P===0?10:0),F=u+P,H=Lf(e);return NB(eJ(t,R,F),B)||NB(iJ(R.ticks,s,F,H),B)},{maxTickCount:g}=D3(t),f=JQ(t),y=e.enabled&&e.avoidCollisions,x=Number.isFinite(g)?g:10,S=y&&e.autoRotate&&e.rotation==null;let D=0,A=0,I=!0,w={tickDomain:[],niceDomain:i,ticks:[],rawTicks:[],rawTickCount:void 0,timeInterval:void 0,fractionDigits:0};for(;I&&D<=x;)({tickData:w,index:D}=tJ(t,f,w,D)),A=S&&d(w,0)?Dl(e.autoRotateAngle):0,I=y&&d(w,A);const N=ZQ(e.parallel,r,A,a,c),O=XQ(e.parallel,r,a,l),L=r+A;return{tickData:w,textAlign:N,textBaseline:O,rotation:L}}function JQ(t){return t.interval?.values?2:t.primaryTickCount!=null?1:0}function D3({scale:t,domain:e,range:i,visibleRange:n,label:s,defaultTickMinSpacing:a,interval:{minSpacing:o,maxSpacing:r}}){const{defaultTickCount:l}=t,c=Tc(i),u=Tc(n);if(Of.is(t)||du.is(t)&&e.length<1e3){const d=Of.is(t)?e.length:Math.min(e.length,Math.max(1,Math.floor(c/(u*a)))),g=Math.ceil(c/(u*s.fontSize));return{tickCount:Math.min(g,d),minTickCount:0,maxTickCount:d}}return MT(c,u,o,r,l,a)}function tJ(t,e,i,n){const{step:s,values:a}=t.interval,{maxTickCount:o,minTickCount:r,tickCount:l}=D3(t),c=P=>Math.max(l-P,r),u=s==null&&a==null&&c(n)>r,d=i.rawTicks,g=l-r,f={minTickCount:r,maxTickCount:o,tickCount:c(n)};let y=OB(t,e,f);if(u&&TB(y.rawTicks,d)){let P=n,B=g;for(;P<=B;){n=Math.trunc((P+B)/2),f.tickCount=c(n);const F=OB(t,e,f);TB(F.rawTicks,d)?P=n+1:(y=F,B=n-1)}}const{tickDomain:x,niceDomain:S,rawTicks:D,rawTickCount:A,rawFirstTickIndex:I,generatePrimaryTicks:w,primaryTicksIndices:N,alignment:O,fractionDigits:L,timeInterval:R}=y;return{tickData:{tickDomain:x,niceDomain:S,rawTicks:D,rawTickCount:A,fractionDigits:L,timeInterval:R,ticks:WQ(t,{niceDomain:S,rawTicks:D,rawFirstTickIndex:I,generatePrimaryTicks:w,primaryTicksIndices:N,alignment:O,fractionDigits:L,timeInterval:R})},index:n+1}}function OB(t,e,i){const{domain:n,reverse:s,visibleRange:a,scale:o,interval:r,primaryLabel:l,niceMode:c,primaryTickCount:u,minimumTimeGranularity:d}=t,g={nice:c.map(P=>P===0),interval:r.step,...i},f={...g,nice:c.map(P=>P===0||P===1)};let y;e===1&&u!=null&&ti.is(o)&&(y=PQ(o,n,u,s,a));const x=c.includes(0)?y?.domain??o.niceDomain(g,n):n;let S=x,D,A,I,w,N,O;const L=l?.enabled===!0&&f.interval==null;S3(o,x,()=>{switch(e){case 2:if(S=r.values,D=r.values,A=D.length,du.is(o)?O=wi.Trailing:eu.is(o)&&(O=wi.Interpolate),ti.is(o)){const[P,B]=xi(x.map(Number));D=D.filter(F=>Number(F)>=P&&Number(F)<=B).sort((F,H)=>Number(F)-Number(H))}break;case 1:if(y)D=y.ticks,A=y.ticks.length;else{const P=o.ticks(f,x,a);D=P?.ticks,A=P?.count}break;default:{const{tickCount:P,minTickCount:B,maxTickCount:F}=i;if(x.length>0&&f.interval==null&&(eu.is(o)||L&&(Ef.is(o)||du.is(o)))){const Y=x,U=Math.min(Y[0].valueOf(),Y.at(-1).valueOf()),V=Math.max(Y[0].valueOf(),Y.at(-1).valueOf());w=Px(U,V,P,B,F,{weekStart:l==null?QQ:void 0,primaryOnly:!0})}let H;du.is(o)?H=d:eu.is(o)&&(H=o.interval),H!=null&&w!=null&&Ms(H)>=Ms(w)&&(w=H);const $=w?YQ(o,a,P,F,f,w,s,d):void 0;if($)({ticks:D,primaryTicksIndices:N,alignment:O}=$);else{const Y=eu.is(o)&&f.interval==null&&w!=null?{...f,interval:w}:f,U=o.ticks(Y,x,a);if(D=U?.ticks,A=U?.count,I=U?.firstTickIndex,Ef.is(o)||Gc.is(o)){const V=typeof f.interval=="number"?zx(f.interval):f.interval;w??(w=V??U?.timeInterval)}}}}}),D??(D=[]);let R=0;for(const P of D){if(typeof P!="number")continue;const B=Hf(P);B>R&&(R=B)}return L||(N=void 0),{tickDomain:S,niceDomain:x,rawTicks:D,rawTickCount:A,rawFirstTickIndex:I,generatePrimaryTicks:L,primaryTicksIndices:N,alignment:O,fractionDigits:R,timeInterval:w}}function eJ(t,e,i){const{niceDomain:n,ticks:s,timeInterval:a}=e;if(a==null)return[];const o=UQ(s),{label:r,labelOffset:l,primaryLabel:c,domain:u}=t,{width:d,height:g}=$Q(r,c,n??u,a,Ve(r)),f=[];for(const y of[0,o]){const{x,y:S}=eT(l,y,i);f.push({x,y:S,width:d,height:g})}return f}function iJ(t,e,i,n){const s=[],a=n.left+n.right,o=n.top+n.bottom;for(const{tickLabel:r,textMetrics:l,translation:c}of t){if(!r)continue;const{x:u,y:d}=eT(e,c,i),g=l.width+a,f=l.height+o;s.push({x:u,y:d,width:g,height:f})}return s}var jx=class A3 extends JT{constructor(e,i){super(e,i),this.maxThicknessRatio=.3,this.crossAxisTranslation={x:0,y:0},this.minimumTimeGranularity=void 0,this.headingLabelGroup=this.axisGroup.appendChild(new Ds({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new Ds({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new mo({zIndex:1})),this.tickLineGroupSelection=pn.select(this.tickLineGroup,mo,!1),this.gridLineGroupSelection=pn.select(this.gridLineGroup,mo,!1),this.gridFillGroupSelection=pn.select(this.gridFillGroup,On,!1),this.tempText=new wf({debugDirty:!1}),this.tempCaption=new Ri,this.animationManager=e.animationManager,this.animationState=new Rt("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:s=>this.animateReadyUpdate(s),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this.headingLabelGroup.appendChild(this.title.caption.node);let n;this.cleanup.register(e.eventsHub.on("layout:complete",s=>{const a=[s.chart.width,s.chart.height];n!=null&&!tr(a,n)&&this.animationState.transition("resize"),n=a}),this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(e){return e instanceof A3}get horizontal(){return this.position==="top"||this.position==="bottom"}onGridVisibilityChange(){}resetAnimation(e){e==="initial"&&this.animationState.transition("reset")}get direction(){return this.position==="top"||this.position==="bottom"?z.X:z.Y}createAxisContext(){return{...super.createAxisContext(),position:this.position}}createLabel(){return new tL}updateDirection(){switch(this.position){case"top":this.label.mirrored=!0,this.label.parallel=!0;break;case"right":this.label.mirrored=!0,this.label.parallel=!1;break;case"bottom":this.label.mirrored=!1,this.label.parallel=!0;break;case"left":this.label.mirrored=!1,this.label.parallel=!1;break}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}calculateLayout(e,i){return this.updateDirection(),super.calculateLayout(e,i)}layoutCrossLines(){const e=this.hasDefinedDomain()||this.hasVisibleSeries();for(const i of this.crossLines)i.calculateLayout?.(e)}calculateTickLayout(e,i,n,s){const a=this.label.getSideFlag(),o=a*(this.getTickSize()+this.getTickSpacing()+this.label.spacing+this.seriesAreaPadding),r=this.chartLayout?.scrollbars?.[this.id],l=this.getScrollbarThickness(r);if(i[0]===2&&i[1]===2&&this.label.enabled===!1&&this.tick.enabled===!1&&this.gridLine.enabled===!1){const{bbox:lt,spacing:mt}=this.measureAxisLayout(e,[],[],r,l);return{ticks:[],rawTickCount:0,tickDomain:e,niceDomain:e,fractionDigits:0,timeInterval:void 0,bbox:lt,layout:{ticks:[],tickLines:[],gridLines:[],gridFills:[],labels:[],spacing:mt}}}const{label:c,primaryLabel:u,scale:d,range:g,interval:f,reverse:y,defaultTickMinSpacing:x,minimumTimeGranularity:S}=this,D=M3({label:c,scale:d,interval:f,primaryLabel:u,domain:e,range:g,reverse:y,niceMode:i,visibleRange:n,defaultTickMinSpacing:x,minimumTimeGranularity:S,sideFlag:a,labelOffset:o,primaryTickCount:s,axisRotation:this.horizontal?Math.PI/-2:0,isVertical:this.direction===z.Y,sizeLimit:this.chartLayout?.sizeLimit,inRange:lt=>this.inRange(lt,.001),tickFormatter:(...lt)=>this.tickFormatter(...lt)}),{tickData:A}=D;if(this.label.avoidCollisions&&this.horizontal&&A.ticks.length>2&&(ti.is(this.scale)||Gc.is(this.scale))){const lt=this.chartLayout?.padding.right??0,mt=A.ticks.at(-1);mt?.tickLabel!=null&&mt.translation+mt.textMetrics.width/2>g[1]+lt&&(mt.tickLabel=void 0,n[0]===0&&n[1]===1&&(A.ticks[0].tickLabel=void 0))}const{ticks:w,tickDomain:N,rawTicks:O,rawTickCount:L,fractionDigits:R,timeInterval:P,niceDomain:B}=A,F=w.map(lt=>this.getTickLabelProps(lt,D,l)),{position:H,gridPadding:$,gridLength:Y}=this,U=H==="bottom"||H==="right"?-1:1,V=U*$,Z=U*(Y+$),W=this.calculateGridLines(w,V,Z),q=this.calculateGridFills(w,V,Z),nt=this.calculateTickLines(w,U,l),{bbox:G,spacing:et}=this.measureAxisLayout(N,w,F,r,l);return{ticks:O,rawTickCount:L,tickDomain:N,niceDomain:B,fractionDigits:R,timeInterval:P,bbox:G,layout:{ticks:w,gridLines:W,gridFills:q,tickLines:nt,labels:F,spacing:et}}}calculateGridLines(e,i,n){return e.map((s,a)=>this.calculateGridLine(s,a,i,n,e))}calculateGridLine({index:e,tickId:i,translation:n},s,a,o,r){const{gridLine:l,horizontal:c}=this,[u,d,g,f]=c?[n,a,n,o]:[a,n,o,n],{style:y}=l,{stroke:x,strokeWidth:S=0,lineDash:D}=y[e%y.length]??{};return{tickId:i,offset:n,x1:u,y1:d,x2:g,y2:f,stroke:x,strokeWidth:S,lineDash:D}}calculateGridFills(e,i,n){const{horizontal:s,range:a,type:o}=this,r=[];if(e.length==0)return r;let l=0;const c=!s&&o==="unit-time";if(c&&e[0].translationa[0]){const d={tickId:`before:${e[0].tickId}`,translation:a[0]};r.push(this.calculateGridFill(d,-1,e[0].index,i,n,e)),l=1}return r.push(...e.map((d,g)=>this.calculateGridFill(d,g,d.index+l,i,n,e))),r}calculateGridFill({tickId:e,translation:i},n,s,a,o,r){const{gridLine:l,horizontal:c,range:u}=this,d=r[n+1],g=i,f=d?d.translation:u[1],[y,x,S,D]=c?[g,Math.max(a,o),f,Math.min(a,o)]:[Math.min(a,o),Math.min(g,f),Math.max(a,o),Math.max(g,f)],{fill:A,fillOpacity:I}=l.style[s%l.style.length]??{};return{tickId:e,x1:y,y1:x,x2:S,y2:D,fill:A,fillOpacity:I}}calculateTickLines(e,i,n=0){return e.map(s=>this.calculateTickLine(s,s.index,i,e,n))}calculateTickLine({isPrimary:e,tickId:i,translation:n},s,a,o,r=0){const{horizontal:l,tick:c,primaryTick:u}=this,d=e&&u?u:c,g=this.getTickSize(d),f=this.getTickSpacing(d),y=-a*(r+f),x=-a*g,[S,D,A,I]=l?[n,y,n,y+x]:[y,n,y+x,n],{stroke:w,width:N}=d;return{tickId:i,offset:n,x1:S,y1:D,x2:A,y2:I,stroke:w,strokeWidth:N,lineDash:void 0}}update(){this.updateDirection();const e=Array.from(this.tickLabelGroupSelection.nodes(),o=>o.datum.tickId);super.update();const{tickLayout:i}=this;if(this.updateTitle(this.scale.domain,i?.spacing??0),this.animatable||this.moduleCtx.animationManager.skipCurrentBatch(),i){const{ticks:o}=i;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const r=o.map(c=>c.tickId),l=rj(e,r);this.animationState.transition("update",l)}}const{enabled:n,stroke:s,width:a}=this.line;this.lineNode.setProperties({stroke:s,strokeWidth:n?a:0}),this.updateTickLines(),this.updateGridLines(),this.updateGridFills()}getAxisTransform(){return{translationX:Math.floor(this.translation.x+this.crossAxisTranslation.x),translationY:Math.floor(this.translation.y+this.crossAxisTranslation.y)}}getLayoutTranslation(){const{translationX:e,translationY:i}=this.getAxisTransform();return{x:e,y:i}}getLayoutState(){return{...super.getLayoutState(),position:this.position}}updatePosition(){super.updatePosition();const e=this.getAxisTransform();this.tickLineGroup.datum=e,this.tickLabelGroup.datum=e,this.lineNodeGroup.datum=e,this.headingLabelGroup.datum=e}setAxisVisible(e){this.tickLineGroup.visible=e&&(this.tick.enabled||(this.primaryTick?.enabled??!1)),this.tickLabelGroup.visible=e&&(this.label.enabled||(this.primaryTick?.enabled??!1)),this.lineNodeGroup.visible=e,this.headingLabelGroup.visible=e}getAxisLineCoordinates(){const{horizontal:e}=this,[i,n]=xi(this.lineRange??this.range);return e?{x1:i,x2:n,y1:0,y2:0}:{x1:0,x2:0,y1:i,y2:n}}getTickLineBBox(e,i){const{translation:n}=e,{position:s,primaryTick:a}=this;let o=this.getTickSize();a?.enabled&&(o=Math.max(o,this.getTickSize(a)));const r=s==="bottom"||s==="right"?-1:1,l=this.getTickSpacing(this.tick),c=-r*(i+l),u=c,d=c-r*(o+l),g=Math.min(u,d),f=Math.max(u,d);switch(s){case"top":return new Tt(n,g,0,f-g);case"bottom":return new Tt(n,g,0,f-g);case"left":return new Tt(g,n,f-g,0);case"right":return new Tt(g,n,f-g,0)}}lineNodeBBox(){const{position:e,seriesAreaPadding:i}=this,{y1:n,y2:s}=this.getAxisLineCoordinates(),a=s-n;switch(e){case"top":return new Tt(n,-i,a,i);case"bottom":return new Tt(n,0,a,i);case"left":return new Tt(-i,n,i,a);case"right":return new Tt(0,n,i,a)}}titleBBox(e,i){const{tempCaption:n}=this,s=Math.abs(this.range[1]-this.range[0])||1/0;return n.node.setProperties(this.titleProps(n,e,i)),n.computeTextWrap(s,this.thickness??1/0),n.node.getBBox()}getScrollbarThickness(e){return e?.enabled&&e.placement==="inner"?e.spacing+e.thickness:0}resolveScrollbarLayout(e,i){if(!e)return;const{position:n}=this,s=n==="top"||n==="left"?-1:1;if(e.placement==="inner"){const o=s===1?e.spacing:-e.spacing-e.thickness;return{...e,offset:o}}const a=s===1?i+e.spacing:-i-e.spacing-e.thickness;return{...e,offset:a}}applyScrollbarLayout(e,i,n){const s=this.resolveScrollbarLayout(n,i);let a=i;if(s){const{offset:o,thickness:r,placement:l}=s;l==="outer"&&(a+=s.spacing+r),this.horizontal?e.push(new Tt(0,o,0,r)):e.push(new Tt(o,0,r,0))}return{spacing:a,scrollbarLayout:s}}measureAxisLayout(e,i,n,s,a){const{tick:o,primaryTick:r,label:l,primaryLabel:c,title:u,position:d,horizontal:g,seriesAreaPadding:f}=this,y=[];if(y.push(this.lineNodeBBox()),o.enabled||r?.enabled)for(const N of i)y.push(this.getTickLineBBox(N,a));const{tempText:x}=this;if(l.enabled)for(const N of n){if(!N.visible)continue;x.setProperties(N);const O=x.getBBox();O&&y.push(O)}if(c?.enabled&&d==="bottom"&&(y.push(new Tt(0,nr(l.fontSize)+2,1,this.getTickSize(o)+this.getTickSpacing(o)+l.spacing+f)),c.format!=null)){const{format:O}=c,R=(Ie(O)?Object.values(O):[O]).reduce((P,B)=>Math.max(P,d4(B)),0);y.push(new Tt(0,this.getTickSize(r??o)+this.getTickSpacing(r??o)+c.spacing+f,1,R*nr(c.fontSize)+2))}const S=Tt.merge(y),D=g?S.height:S.width,{spacing:A,scrollbarLayout:I}=this.applyScrollbarLayout(y,D,s);return this.layout.labelThickness=D,this.layout.scrollbar=I,u.enabled&&y.push(this.titleBBox(e,A)),{bbox:Tt.merge(y),spacing:A}}titleProps(e,i,n){const{title:s}=this;if(!s.enabled)return e.enabled=!1,{visible:!1,text:"",textBaseline:"bottom",x:0,y:0,rotationCenterX:0,rotationCenterY:0,rotation:0};e.enabled=!0,e.color=s.color,e.fontFamily=s.fontFamily,e.fontSize=s.fontSize,e.fontStyle=s.fontStyle,e.fontWeight=s.fontWeight,e.wrapping=s.wrapping,e.truncate=s.truncate,e.maxWidth=s.maxWidth,e.maxHeight=s.maxHeight;const{range:a}=this,o=(a[0]+a[1])/2,r=s.spacing+n;let l,c,u,d;switch(this.position){case"top":l=o,c=-r,u=0,d="bottom";break;case"bottom":l=o,c=r,u=0,d="top";break;case"left":l=-r,c=o,u=Math.PI/-2,d="bottom";break;case"right":l=r,c=o,u=Math.PI/2,d="bottom";break}const{formatter:g=y=>y.defaultValue}=s,f=this.cachedCallWithContext(g,this.getTitleFormatterParams(i));return e.text=f,{visible:!0,text:f,textBaseline:d,x:l,y:c,rotationCenterX:l,rotationCenterY:c,rotation:u}}getTickLabelProps(e,i,n){const{horizontal:s,primaryLabel:a,primaryTick:o,seriesAreaPadding:r,scale:l}=this,{tickId:c,tickLabel:u="",translation:d,isPrimary:g,textUntruncated:f}=e,y=g&&a?.enabled?a:this.label,x=g&&o?.enabled?o:this.tick,{rotation:S,textBaseline:D,textAlign:A}=i,{range:I}=l,w=this.label.getSideFlag(),N=Lf(y)[this.position];let O=w*(this.getTickSize(x)+this.getTickSpacing(x)+y.spacing+r)-N;n&&(O+=w*n);const L=u!=="",R=s?d:O,P=s?-O:d;return{...this.getLabelStyles({value:e.tick,formattedValue:u},void 0,y),tickId:c,rotation:S,text:u,textAlign:A,textBaseline:D,textUntruncated:f,visible:L,x:R,y:P,rotationCenterX:R,rotationCenterY:P,range:I}}updateSelections(){if(!this.tickLayout)return;const e=this.getAxisLineCoordinates(),{tickLines:i,gridLines:n,gridFills:s,labels:a}=this.tickLayout,o=r=>r.tickId;this.lineNode.datum=e,this.gridLineGroupSelection.update(this.gridLine.enabled?n:[],void 0,o),this.gridFillGroupSelection.update(this.gridLine.enabled?s:[],void 0,o),this.tickLineGroupSelection.update(i,void 0,o),this.tickLabelGroupSelection.update(a,void 0,o)}updateGridLines(){this.gridLineGroupSelection.each((e,i)=>{e.stroke=i.stroke,e.strokeWidth=i.strokeWidth,e.lineDash=i.lineDash})}updateGridFills(){this.gridFillGroupSelection.each((e,i)=>{e.fill=i.fill,e.fillOpacity=i.fillOpacity??1})}updateTickLines(){this.tickLineGroupSelection.each((e,i)=>{e.stroke=i.stroke,e.strokeWidth=i.strokeWidth,e.lineDash=i.lineDash})}updateTitle(e,i){const{caption:n}=this.title,s=this.titleProps(n,e,i);if(n.node.visible=s.visible,n.node.text=s.text,n.node.textBaseline=s.textBaseline,n.node.datum=s,s.visible){const a=Math.abs(this.range[1]-this.range[0])||1/0;n.computeTextWrap(a,this.thickness??1/0)}}updateLabels(){this.label.enabled&&this.tickLabelGroupSelection.each((e,i)=>{e.fill=i.color,e.text=i.text,e.textBaseline=i.textBaseline,e.textAlign=i.textAlign??"center",e.pointerEvents=i.textUntruncated==null?1:0,e.setFont(i),e.setBoxing(i)})}animateReadyUpdate(e){const{animationManager:i}=this.moduleCtx,n=AQ(this),s=CQ(n);dn(this.id,"axis-group",i,[this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],s.group),dn(this.id,"line",i,[this.lineNode],s.line),dn(this.id,"line-paths",i,[this.gridLineGroupSelection,this.tickLineGroupSelection],s.tick,(a,o)=>o.tickId,e),dn(this.id,"tick-labels",i,[this.tickLabelGroupSelection],s.label,(a,o)=>o.tickId,e),dn(this.id,"title",i,[this.title.caption.node],s.label,(a,o)=>o.tickId,e)}resetSelectionNodes(){Qn([this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],wQ()),Qn([this.gridLineGroupSelection,this.tickLineGroupSelection],DB()),Qn([this.gridFillGroupSelection],NQ()),Qn([this.tickLabelGroupSelection],CM()),Qn([this.title.caption.node],CM()),Qn([this.lineNode],DB())}};T([b],jx.prototype,"thickness",2);T([b],jx.prototype,"maxThicknessRatio",2);T([b],jx.prototype,"position",2);T([b],jx.prototype,"crossAt",2);var Gx=jx,I3=["right","top","left","bottom"];function nJ(t){return typeof t=="string"&&I3.includes(t)}function sJ(t){const e=[],i=[],n=[...I3];for(const s of t)s instanceof Gx&&(nJ(s.position)?i.push(s.position):e.push(s));for(const s of e){let a;do a=n.pop();while(a&&i.includes(a));if(a==null)break;s.position=a}}var EB=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function aJ(t,e,i){const n=new Map,s=d=>{if(d===void 0)return EB;if(n.has(d))return n.get(d);const g=Ut.getSeriesModule(d)?.matchingKeys??EB;return n.set(d,g),g},a=(d,g,f)=>{const y=s(d),x=[d];for(const S of y)S in g&&g[S]!=null&&x.push(`${S}=${g[S]}`);return f?.seriesGrouping&&x.push(`seriesGrouping.groupId=${f?.seriesGrouping.groupId}`),x.join(";")},o=new Map;let r=0;for(const d of t){const g=a(d.type,d.properties,i?.[r]);o.has(g)||o.set(g,[]),o.get(g)?.push([d,r++])}const l=new Map;r=0;for(const d of e){const g=a(d.type,d,d);l.has(g)||l.set(g,[]),l.get(g)?.push([d,r++])}if(![...o.keys()].some(d=>l.has(d)))return{status:"no-overlap",oldKeys:o.keys(),newKeys:l.keys()};const u=[];for(const[d,g]of l.entries())for(const[f,y]of g){const x=o.get(d);if(x==null||x.length<1){u.push({opts:f,targetIdx:y,idx:y,status:"add"}),o.delete(d);continue}const[S,D]=x.shift(),A=i?.[D]??{},I=or(A,f??{}),{groupIndex:w,stackIndex:N}=I?.seriesGrouping??{};w!=null||N!=null?u.push({opts:f,series:S,diff:I,targetIdx:y,idx:D,status:"series-grouping"}):I?u.push({opts:f,series:S,diff:I,targetIdx:y,idx:D,status:"update"}):u.push({opts:f,series:S,targetIdx:y,idx:D,status:"no-op"}),x.length===0&&o.delete(d)}for(const d of o.values())for(const[g,f]of d)u.push({series:g,idx:f,targetIdx:-1,status:"remove"});return{status:"overlap",changes:u}}var iu=new Map([{type:"chart",name:"cartesian",moduleId:"CartesianChartModule"},{type:"chart",name:"standalone",moduleId:"StandaloneChartModule",enterprise:!0},{type:"chart",name:"polar",moduleId:"PolarChartModule"},{type:"chart",name:"topology",moduleId:"TopologyChartModule",enterprise:!0},{type:"axis",name:"number",chartType:"cartesian",moduleId:"NumberAxisModule"},{type:"axis",name:"log",chartType:"cartesian",moduleId:"LogAxisModule"},{type:"axis",name:"time",chartType:"cartesian",moduleId:"TimeAxisModule"},{type:"axis",name:"unit-time",chartType:"cartesian",moduleId:"UnitTimeAxisModule"},{type:"axis",name:"category",chartType:"cartesian",moduleId:"CategoryAxisModule"},{type:"axis",name:"grouped-category",chartType:"cartesian",moduleId:"GroupedCategoryAxisModule"},{type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,moduleId:"OrdinalTimeAxisModule"},{type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,moduleId:"AngleCategoryAxisModule"},{type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,moduleId:"AngleNumberAxisModule"},{type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,moduleId:"RadiusCategoryAxisModule"},{type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,moduleId:"RadiusNumberAxisModule"},{type:"series",name:"bar",chartType:"cartesian",moduleId:"BarSeriesModule"},{type:"series",name:"scatter",chartType:"cartesian",moduleId:"ScatterSeriesModule"},{type:"series",name:"bubble",chartType:"cartesian",moduleId:"BubbleSeriesModule"},{type:"series",name:"line",chartType:"cartesian",moduleId:"LineSeriesModule"},{type:"series",name:"area",chartType:"cartesian",moduleId:"AreaSeriesModule"},{type:"series",name:"pie",chartType:"polar",moduleId:"PieSeriesModule"},{type:"series",name:"donut",chartType:"polar",moduleId:"DonutSeriesModule"},{type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,moduleId:"BoxPlotSeriesModule"},{type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,moduleId:"CandlestickSeriesModule"},{type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,moduleId:"ConeFunnelSeriesModule"},{type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,moduleId:"FunnelSeriesModule"},{type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,moduleId:"OhlcSeriesModule"},{type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,moduleId:"HeatmapSeriesModule"},{type:"series",name:"histogram",chartType:"cartesian",moduleId:"HistogramSeriesModule"},{type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,moduleId:"RangeAreaSeriesModule"},{type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,moduleId:"RangeBarSeriesModule"},{type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,moduleId:"WaterfallSeriesModule"},{type:"series",name:"nightingale",chartType:"polar",enterprise:!0,moduleId:"NightingaleSeriesModule"},{type:"series",name:"radar-area",chartType:"polar",enterprise:!0,moduleId:"RadarAreaSeriesModule"},{type:"series",name:"radar-line",chartType:"polar",enterprise:!0,moduleId:"RadarLineSeriesModule"},{type:"series",name:"radial-bar",chartType:"polar",enterprise:!0,moduleId:"RadialBarSeriesModule"},{type:"series",name:"radial-column",chartType:"polar",enterprise:!0,moduleId:"RadialColumnSeriesModule"},{type:"series",name:"map-shape",chartType:"topology",enterprise:!0,moduleId:"MapShapeSeriesModule"},{type:"series",name:"map-line",chartType:"topology",enterprise:!0,moduleId:"MapLineSeriesModule"},{type:"series",name:"map-marker",chartType:"topology",enterprise:!0,moduleId:"MapMarkerSeriesModule"},{type:"series",name:"map-shape-background",chartType:"topology",enterprise:!0,moduleId:"MapShapeBackgroundSeriesModule"},{type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,moduleId:"MapLineBackgroundSeriesModule"},{type:"series",name:"pyramid",chartType:"standalone",enterprise:!0,moduleId:"PyramidSeriesModule"},{type:"series",name:"linear-gauge",chartType:"standalone",enterprise:!0,moduleId:"LinearGaugeModule"},{type:"series",name:"radial-gauge",chartType:"standalone",enterprise:!0,moduleId:"RadialGaugeModule"},{type:"series",name:"sunburst",chartType:"standalone",enterprise:!0,moduleId:"SunburstSeriesModule"},{type:"series",name:"treemap",chartType:"standalone",enterprise:!0,moduleId:"TreemapSeriesModule"},{type:"series",name:"chord",chartType:"standalone",enterprise:!0,moduleId:"ChordSeriesModule"},{type:"series",name:"sankey",chartType:"standalone",enterprise:!0,moduleId:"SankeySeriesModule"},{type:"plugin",name:"animation",enterprise:!0,moduleId:"AnimationModule"},{type:"plugin",name:"annotations",chartType:"cartesian",enterprise:!0,moduleId:"AnnotationsModule"},{type:"plugin",name:"legend",moduleId:"LegendModule"},{type:"plugin",name:"locale",moduleId:"LocaleModule"},{type:"plugin",name:"chartToolbar",chartType:"cartesian",enterprise:!0,moduleId:"ChartToolbarModule"},{type:"plugin",name:"contextMenu",enterprise:!0,moduleId:"ContextMenuModule"},{type:"plugin",name:"statusBar",chartType:"cartesian",enterprise:!0,moduleId:"StatusBarModule"},{type:"plugin",name:"dataSource",enterprise:!0,moduleId:"DataSourceModule"},{type:"plugin",name:"sync",chartType:"cartesian",enterprise:!0,moduleId:"SyncModule"},{type:"plugin",name:"ranges",chartType:"cartesian",enterprise:!0,moduleId:"RangesModule"},{type:"plugin",name:"zoom",enterprise:!0,moduleId:"ZoomModule"},{type:"plugin",name:"flashOnUpdate",enterprise:!0,moduleId:"FlashOnUpdateModule"},{type:"plugin",name:"gradientLegend",enterprise:!0,moduleId:"GradientLegendModule"},{type:"plugin",name:"navigator",chartType:"cartesian",enterprise:!0,moduleId:"NavigatorModule"},{type:"plugin",name:"scrollbar",chartType:"cartesian",enterprise:!0,moduleId:"ScrollbarModule"},{type:"axis:plugin",name:"crosshair",chartType:"cartesian",enterprise:!0,moduleId:"CrosshairModule"},{type:"axis:plugin",name:"bandHighlight",chartType:"cartesian",enterprise:!0,moduleId:"BandHighlightModule"},{type:"series:plugin",name:"errorBar",chartType:"cartesian",enterprise:!0,moduleId:"ErrorBarsModule"},{type:"preset",name:"gauge-preset",chartType:"standalone",enterprise:!0,moduleId:"GaugePresetModule"},{type:"preset",name:"price-volume",chartType:"cartesian",enterprise:!0,moduleId:"PriceVolumePresetModule"},{type:"preset",name:"sparkline",moduleId:"SparklinePresetModule"}].map(t=>[t.name,t]));function oJ(t){const e=iu.get(t);return e?.type===Le.Series?e.chartType:void 0}function Mb(t){const e=t.series?.[0]?.type??"line";return Ut.getSeriesModule(e)?.chartType??oJ(e)??"unknown"}function rJ(t){return Mb(t)==="cartesian"}var lJ=class extends QT{*legends(){for(const t of Ut.listModulesByType(Le.Plugin))(t.name==="legend"||t.name==="gradientLegend")&&(yield{legendType:t.name==="legend"?"category":"gradient",legend:this.getModule(t.name)})}},ON="ag-charts-overlay",cJ="ag-charts-dark-overlay",Kd=class extends xt{constructor(t,e){super(),this.className=t,this.defaultMessageId=e,this.enabled=!0}getText(t){return qt(this.text)?ce(this.text):this.rendererAsText?this.rendererAsText:t.t(bi(this.text)||this.defaultMessageId)}getElement(t,e,i,n){if(this.content?.remove(),this.rendererAsText=void 0,this.focusBox=n,this.renderer){const s={},a=js(t,this.renderer,s);if(Eb(a))this.content=a;else{const o=$t("div");o.innerHTML=a;const{firstElementChild:r}=o;Eb(r)&&o.childElementCount===1?this.content=r:this.content=o}this.rendererAsText=this.content?.textContent?.trim()}else{const s=$t("div",{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",height:"100%",margin:"8px",fontFamily:"var(--ag-charts-font-family)",fontSize:"var(--ag-charts-font-size)",fontWeight:"var(--ag-charts-font-weight)"});if(qt(this.text)){const a=$t("div");for(const o of this.text){const r=$t("span",{color:o.color,fontSize:`${o.fontSize}px`,fontFamily:o.fontFamily??"inherit",fontWeight:String(o.fontWeight),fontStyle:o.fontStyle});r.innerText=bi(o.text),a.appendChild(r)}s.appendChild(a)}else s.innerText=this.getText(i);this.content=s,this.content.classList.add(this.className),e?.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(a){s.style.opacity=String(a)},onStop(){s.style.opacity="1"}})}return this.content}removeElement(t=()=>this.content?.remove(),e){if(this.content){if(e){const{content:i}=this;e.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(n){i.style.opacity=String(n)},onStop(){t?.()}})}else t?.();this.content=void 0,this.focusBox=void 0}}};T([b],Kd.prototype,"enabled",2);T([b],Kd.prototype,"text",2);T([b],Kd.prototype,"renderer",2);var im=class extends xt{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new Kd("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new Kd("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new Kd("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new Kd("ag-charts-unsupported-browser","overlayUnsupportedBrowser")}getFocusInfo(t){for(const e of[this.loading,this.noData,this.noVisibleSeries,this.unsupportedBrowser])if(e.focusBox!==void 0)return{text:e.getText(t),rect:e.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement(),this.unsupportedBrowser.removeElement()}};T([b],im.prototype,"darkTheme",2);T([b],im.prototype,"loading",2);T([b],im.prototype,"noData",2);T([b],im.prototype,"noVisibleSeries",2);T([b],im.prototype,"unsupportedBrowser",2);function hJ(t,e,i){const{animationDuration:n}=Zb.add,s=n*i,a=t.createElement("div",`${ON}--loading`,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"100%",boxSizing:"border-box",font:"13px Verdana, sans-serif",userSelect:"none",animation:`ag-charts-loading ${s}ms linear 50ms both`}),o=t.createElement("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),r=t.createElement("p",{marginTop:"1em"});r.innerText=e;const l=t.createElement("div",`${ON}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),c=t.createElement("style");return c.innerText=["@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }","@keyframes ag-charts-loading-matrix {","0% { background-position: 0% 0%, 50% 0%, 100% 0%; }","100% { background-position: 0% 100%, 50% 100%, 100% 100%; }","}"].join(" "),a.replaceChildren(c,o,r,l),a}var Ux=class extends xt{constructor(t){super(),this.ctx=t,this.rectNode=new On,this.border=new Ru(this.rectNode),this.cornerRadius=0,this.padding=0,this.cleanup=new qe,this.node=this.createNode(),this.node.append([this.rectNode]),this.rectNode.fill=void 0,this.cleanup.register(t.scene.attachNode(this.node),t.eventsHub.on("layout:complete",e=>this.onLayoutComplete(e)))}destroy(){this.cleanup.flush()}getPadding(){const{border:t,padding:e}=this,i=t.enabled?t.strokeWidth:0;if(typeof e=="number"){const n=e+i;return{top:n,right:n,bottom:n,left:n}}return{top:(e.top??0)+i,right:(e.right??0)+i,bottom:(e.bottom??0)+i,left:(e.left??0)+i}}createNode(){return new ee({name:"series-area-container",zIndex:pe.SERIES_AREA_CONTAINER})}onLayoutComplete(t){const{x:e,y:i,width:n,height:s}=t.series.paddedRect;this.rectNode.x=e,this.rectNode.y=i,this.rectNode.width=n,this.rectNode.height=s}};T([b],Ux.prototype,"border",2);T([b],Ux.prototype,"clip",2);T([pi("rectNode","cornerRadius"),b],Ux.prototype,"cornerRadius",2);T([b],Ux.prototype,"padding",2);function ZD(t,e){if(t.itemId!==void 0)return t.itemId;if(e!==void 0){const i=t.datum?.[e];if(i!=null)return typeof i=="number"?i:String(i)}return typeof t.datumIndex=="number"?t.datumIndex:JSON.stringify(t.datumIndex)}function EN(t,e){return t.series===e.series&&ks(t.datumIndex,e.datumIndex)}function uJ(t,e){return e==null?-1:t.findIndex(i=>EN(i,e))}var dJ=class{constructor(t,e){this.activeManager=t,this.tooltipProperties=e,this.candidates=[],this.blockEntrance=!1,this.activationPrevented=!1}clear(){this.candidates.length=0,this.pendingPickedNodes=void 0}popPendingPickedNodes(){const t=this.pendingPickedNodes;return this.pendingPickedNodes=void 0,t}getActivationArgs(t){if(t===void 0)return[void 0,void 0];{const e=t.series.id,i=ZD(t,t.series.data?.dataIdKey);return[{type:"series-node",seriesId:e,itemId:i},t]}}maybeActivate(t,e,i){if(this.blockEntrance)throw new Error("PickManager.maybeActivate is not re-entrant");try{this.activationPrevented=!1,this.blockEntrance=!0;const[n,s]=this.getActivationArgs(t);this.activeManager.update(n,s)?this.activationPrevented=!0:(this.active=t,e(i?.defaultCbArg))}finally{this.blockEntrance=!1}}onClearUI(){this.activeManager.clear(),this.clear()}onClearAPI(){this.clear()}onPickedNodesHighlight(t){if(t!==void 0){const i=this.active;if(this.tooltipProperties.pagination&&i!==void 0){const n=t.matches.find(s=>EN(s,i));if(n)return n}}return t?.matches[0]}onPickedNodesTooltip(t){if(t!==void 0&&this.tooltipProperties.pagination){const i=this.active,n=t.matches;this.candidates=n;let s=uJ(n,i);s===-1&&(s=0);const a=n[s],o={index:s,length:n.length};return{active:a,paginationState:o}}return{active:t?.matches[0]}}onPickedNodesAPI(t){return this.pendingPickedNodes=t,t.matches[0]}onPickedNodesAPIDebounced(){return{active:this.onPickedNodesHighlight(this.popPendingPickedNodes())}}nextCandidate(){if(this.tooltipProperties.pagination){const{candidates:t}=this,e=this.active,i=e==null?-1:t.findIndex(o=>EN(o,e));if(i===-1)return{active:void 0,paginationState:void 0};let n=i+1;n>=t.length&&(n=0);const s=t[n],a={index:n,length:this.candidates.length};return{active:s,paginationState:a}}return{active:this.active}}wasActivationPrevented(){return this.activationPrevented}};function k3(t,e,i,n){if(an(t))return{type:"gradient",gradient:t.gradient??e.gradient,colorStops:t.colorStops??e.colorStops,bounds:t.bounds??e.bounds,rotation:t.rotation??e.rotation,reverse:t.reverse??e.reverse,colorSpace:t.colorSpace??e.colorSpace};if(ir(t)){const s=t.pattern??i.pattern;let a=t.strokeWidth;s==="backward-slanted-lines"||s==="forward-slanted-lines"||s==="horizontal-lines"||s==="vertical-lines"?a??(a=i.strokeWidth):a??(a=0);const o=t.width??t.height??i.width,r=t.height??t.width??i.height;return{type:"pattern",pattern:s,width:o,height:r,path:t.path,padding:t.padding??i.padding,fill:t.fill??i.fill,fillOpacity:t.fillOpacity??i.fillOpacity,backgroundFill:t.backgroundFill??i.backgroundFill,backgroundFillOpacity:t.backgroundFillOpacity??i.backgroundFillOpacity,stroke:t.stroke??i.stroke,strokeOpacity:t.strokeOpacity??i.strokeOpacity,strokeWidth:a,rotation:t.rotation??i.rotation,scale:t.scale??i.scale}}return ml(t)?{type:"image",url:t.url,width:t.width,height:t.height,backgroundFill:t.backgroundFill??n.backgroundFill,backgroundFillOpacity:t.backgroundFillOpacity??n.backgroundFillOpacity,rotation:t.rotation??n.rotation,repeat:t.repeat??n.repeat,fit:t.fit??n.fit}:t}function RN(t,e,i,n){return!an(t?.fill)&&!ir(t?.fill)&&!ml(t?.fill)?t:{...t,fill:k3(t.fill,e,i,n)}}var C3=(t=>(t[t.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",t[t.NEAREST_NODE=1]="NEAREST_NODE",t[t.AXIS_ALIGNED=2]="AXIS_ALIGNED",t))(C3||{}),pJ=.25,gJ=.125,qD=class{constructor(t,e,i,n){this.type=t,this.event=e,this.defaultPrevented=!1,this.datum=i.datum,this.seriesId=n.id,this.dataIdKey=n.data?.dataIdKey,this.itemId=ZD(i,this.dataIdKey)}preventDefault(){this.defaultPrevented=!0}},PN=class{constructor(t,e){this.series=t,this.seriesGrouping=e,this.type="groupingChanged"}};function RB(t){switch(t){case"x":return z.X;case"y":return z.Y;case"angle":return z.Angle;case"radius":return z.Radius}}function OC(t){switch(t){case z.X:return"x";case z.Y:return"y";case z.Angle:return"angle";case z.Radius:return"radius";default:return"x"}}var Wx=class extends vG{constructor(e){super(),this.cleanup=new qe,this.usesPlacedLabels=!1,this.alwaysClip=!1,this.hasChangesOnHighlight=!1,this.seriesGrouping=void 0,this.NodeEvent=qD,this.internalId=Nn(this),this.contentGroup=new Ds({name:`${this.internalId}-content`,zIndex:Vs.ANY_CONTENT}),this.highlightGroup=new Ds({name:`${this.internalId}-highlight`,zIndex:Vs.ANY_CONTENT}),this.highlightNodeGroup=this.highlightGroup.appendChild(new ee({name:`${this.internalId}-highlight-node`})),this.highlightLabelGroup=this.highlightGroup.appendChild(new ee({name:`${this.internalId}-highlight-label`,zIndex:Mc.LABEL})),this.annotationGroup=new Ds({name:`${this.internalId}-annotation`}),this.labelGroup=new Ds({name:`${this.internalId}-series-labels`}),this.axes={},this.directions=[z.X,z.Y],this.nodeDataRefresh=!0,this.processedDataUpdated=!0,this.moduleMap=new QT,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this.declarationOrder=-1,this._broughtToFront=!1,this.events=new cr,this._pickNodeCache=new XM(5),this.fireEventWrapper=c=>super.fireEvent(c);const{moduleCtx:i,pickModes:n,propertyKeys:s={},propertyNames:a={},canHaveAxes:o=!1,usesPlacedLabels:r=!1,alwaysClip:l=!1}=e;this.ctx=i,this.propertyKeys=s,this.propertyNames=a,this.canHaveAxes=o,this.usesPlacedLabels=r,this.pickModes=n,this.alwaysClip=l,this.highlightLabelGroup.pointerEvents=1,this.cleanup.register(this.ctx.eventsHub.on("data:update",c=>this.setChartData(c)),this.ctx.eventsHub.on("highlight:change",c=>this.onChangeHighlight(c)))}get pickModeAxis(){return"main"}get id(){return this.properties?.id??this.internalId}get type(){return this.constructor.type??""}get focusable(){return!0}get data(){return this._data??this._chartData}set visible(e){this.properties.visible=e,this.ctx.legendManager.toggleItem(e,this.id),this.ctx.legendManager.update(),this.visibleMaybeChanged()}get visible(){return this.ctx.legendManager.getSeriesEnabled(this.id)??this.properties.visible}get hasData(){const e=this.data;return e==null?!1:e.netSize()>0}get tooltipEnabled(){return this.properties.tooltip?.enabled}onDataChange(){this.nodeDataRefresh=!0,this.processedDataUpdated=!0,this._pickNodeCache.clear()}setOptionsData(e){this._data=e,this.onDataChange()}isHighlightEnabled(){return this.properties.highlight.enabled}setChartData(e){this._chartData=e,this.data===e&&this.onDataChange()}onSeriesGroupingChange(e,i){const{internalId:n,type:s,visible:a}=this;e&&this.ctx.seriesStateManager.deregisterSeries(this),i&&this.ctx.seriesStateManager.registerSeries({internalId:n,type:s,visible:a,seriesGrouping:i,width:"width"in this.properties?this.properties.width:0}),this.fireEvent(new PN(this,i))}getBandScalePadding(){return{inner:1,outer:0}}attachSeries(e,i,n){e.appendChild(this.contentGroup),i.appendChild(this.highlightGroup),i.appendChild(this.labelGroup),n?.appendChild(this.annotationGroup)}detachSeries(e,i,n){this.contentGroup.remove(),this.highlightGroup.remove(),this.labelGroup.remove(),this.annotationGroup.remove()}setSeriesIndex(e,i=!1){const n=this.bringToFront();return!i&&e===this.declarationOrder&&n===this._broughtToFront?!1:(this.declarationOrder=e,this._broughtToFront=n,this.setZIndex(n?Number.MAX_VALUE:e),this.fireEvent(new PN(this,this.seriesGrouping)),!0)}setZIndex(e){this.contentGroup.zIndex=[Vs.ANY_CONTENT,e,Mc.FOREGROUND],this.highlightGroup.zIndex=[Vs.ANY_CONTENT,e,Mc.HIGHLIGHT],this.labelGroup.zIndex=[Vs.ANY_CONTENT,e,Mc.LABEL],this.annotationGroup.zIndex=e}renderToOffscreenCanvas(){return!1}hasHighlightOpacity(){if(!this.properties.highlight.enabled)return!1;const e=this.ctx.highlightManager.getActiveHighlight();if(e==null||e.series?.isHighlightEnabled()===!1)return!1;const{unhighlightedItem:i,unhighlightedSeries:n}=this.properties.highlight;return CN(i)||CN(n)}getDrawingMode(e,i="cutout"){return e?i:this.hasHighlightOpacity()?this.ctx.chartService.highlight?.drawingMode??"overlay":"overlay"}getAnimationDrawingModes(){const e=this.getDrawingMode(!1);return{start:{drawingMode:"overlay"},finish:{drawingMode:e}}}addEventListener(e,i){return super.addEventListener(e,i)}removeEventListener(e,i){return super.removeEventListener(e,i)}hasEventListener(e){return super.hasEventListener(e)}updatedDomains(){}destroy(){this.cleanup.flush(),this.resetDatumCallbackCache(),this.ctx.seriesStateManager.deregisterSeries(this)}getPropertyValues(e,i){const n=RB(e),s=n==null?e:OC(this.resolveKeyDirection(n)),a=i?.[s],o=[];if(!a)return o;const r=(...l)=>{for(const c of l)Array.isArray(c)?r(...c):typeof c=="object"?r(...Object.values(c)):o.push(c)};return r(...a.map(l=>this.properties[l])),o}getKeyAxis(e){}getKeys(e){return this.getPropertyValues(OC(e),this.propertyKeys)}getKeyProperties(e){return this.propertyKeys[this.resolveKeyDirection(e)]??[]}getNames(e){return this.getPropertyValues(OC(e),this.propertyNames)}getFormatterContext(e){const{id:i}=this,n=this.getPropertyValues(e,this.propertyKeys),s=this.getPropertyValues(e,this.propertyNames),a=[];for(let o=0;os.getDomain(e)).flat();return n.length===0?i:{domain:i.domain.concat(n)}}getRange(e,i){return this.getSeriesRange(e,i)}getMinimumRangeSeries(e){}getMinimumRangeChart(e){return 0}getZoomRangeFittingItems(e,i,n){}getVisibleItems(e,i,n){return 1/0}toCanvasFromMidPoint(e){const{x:i=0,y:n=0}=e.midPoint??{};return Ti.toCanvasPoint(this.contentGroup,i,n)}markNodeDataDirty(){this.nodeDataRefresh=!0,this._pickNodeCache.clear(),this.visibleMaybeChanged()}visibleMaybeChanged(){const{internalId:e,seriesGrouping:i,type:n,visible:s}=this;this.ctx.seriesStateManager.updateSeries({internalId:e,type:n,visible:s,seriesGrouping:i,width:"width"in this.properties?this.properties.width:0})}getOpacity(){if(!this.properties.highlight)return 1;const{opacity:i=1}=this.getHighlightStyle();return i}getHighlightState(e,i,n,s){return this.properties.highlight.enabled?i?1:e?.series==null||e.series.isHighlightEnabled()===!1?0:this.isSeriesHighlighted(e,s)?this.isItemHighlighted(e,n)==null?2:4:3:0}getHighlightStateString(e,i,n,s){return em(this.getHighlightState(e,i,n,s))}onChangeHighlight(e){const i=e.previousHighlight,n=e.currentHighlight,s=this.getHighlightState(n),a=this.getHighlightState(i);this.setSeriesIndex(this.declarationOrder);const o=this.hasItemStylers();if(!o&&s===a){this.hasChangesOnHighlight=!1;return}const{highlightedSeries:r,unhighlightedItem:l,unhighlightedSeries:c}=this.properties.highlight;this.hasChangesOnHighlight=o||!cb(r)||!cb(l)||!cb(c)}bringToFront(){return this.properties.highlight.enabled&&this.properties.highlight.bringToFront&&this.isSeriesHighlighted(this.ctx.highlightManager.getActiveHighlight())}isSeriesHighlighted(e,i){return this.properties.highlight.enabled?e?.series===this:!1}isItemHighlighted(e,i){if(!(e?.datumIndex==null||i==null))return e.datumIndex===i}getHighlightStyle(e,i,n,s){const a=this.ctx.highlightManager?.getActiveHighlight();return n??(n=this.getHighlightState(a,e,i,s)),this.properties.highlight.getStyle(n)}resolveMarkerDrawingModeForState(e,i){return W7(e,i)}filterItemStylerFillParams(e){return an(e)?At(e,["bounds","colorSpace","gradient","reverse"]):ir(e)?At(e,["padding"]):e}getModuleTooltipParams(){return this.moduleMap.mapModules(e=>e.getTooltipParams()).reduce((e,i)=>Object.assign(e,i),{})}pickNodes(e,i,n=!1){const{pickModes:s,pickModeAxis:a,visible:o,contentGroup:r}=this;if(!o||!r.visible)return;let l=1/0;if(i==="tooltip"||i==="highlight-tooltip"){const{tooltip:f}=this.properties;l=typeof f.range=="number"?f.range:1/0,n||(n=f.range==="exact")}else if(i==="event"||i==="context-menu"){const{nodeClickRange:f}=this.properties;l=typeof f=="number"?f:1/0,n||(n=f==="exact")}const c=s.filter(f=>!n||f===0),{x:u,y:d}=e,g=JSON.stringify({x:u,y:d,maxDistance:l,selectedPickModes:c});if(this._pickNodeCache.has(g))return this._pickNodeCache.get(g);for(const f of c){let y;switch(f){case 0:{const x=this.pickNodesExactShape(e);y=x.length===0?void 0:{datums:x,distance:0};break}case 1:{const x=this.pickNodeClosestDatum(e),S=x?.distance===0?this.pickNodesExactShape(e):void 0;S!=null&&S.length!==0?y={datums:S,distance:0}:x?y={datums:[x.datum],distance:x.distance}:y=void 0;break}case 2:{const x=a==null?void 0:this.pickNodeMainAxisFirst(e,a==="main-category");y=x==null?void 0:{datums:[x.datum],distance:x.distance};break}}if(y&&y.distance<=l)return this._pickNodeCache.set(g,{pickMode:f,datums:y.datums,distance:y.distance})}return this._pickNodeCache.set(g,void 0)}pickNodesExactShape(e){const i=[];for(const n of this.contentGroup.pickNodes(e.x,e.y)){const s=n.closestDatum();typeof s=="object"&&s!=null&&s.missing!==!0&&i.push(s)}return i}pickNodeClosestDatum(e){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(e,i){const n=Tx(e.x,e.y,i),s=n.nearest?.closestDatum();if(typeof s=="object"&&s!=null&&s.missing!==!0)return{datum:s,distance:Math.sqrt(n.distanceSquared)}}pickNodeMainAxisFirst(e,i){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}getLabelData(){return[]}updatePlacedLabelData(e){}fireEvent(e){js([this.properties,this.ctx.chartService],this.fireEventWrapper,e)}fireNodeClickEvent(e,i){const n=new this.NodeEvent("seriesNodeClick",e,i,this);return this.fireEvent(n),!n.defaultPrevented}fireNodeDoubleClickEvent(e,i){const n=new this.NodeEvent("seriesNodeDoubleClick",e,i,this);return this.fireEvent(n),!n.defaultPrevented}createNodeContextMenuActionEvent(e,i){return new this.NodeEvent("nodeContextMenuAction",e,i,this)}onLegendInitialState(e,i){const{visible:n=!0,itemId:s,legendItemName:a}=i??{};this.toggleSeriesItem(n,e,s,a)}onLegendItemClick(e){const{enabled:i,itemId:n,series:s,legendType:a}=e,o="legendItemName"in this.properties?this.properties.legendItemName:void 0,r="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=o!=null&&o===e.legendItemName;(s.id===this.id||l||r!=null)&&this.toggleSeriesItem(i,a,n,o,e)}onLegendItemDoubleClick(e){const{enabled:i,itemId:n,series:s,numVisibleItems:a,legendType:o}=e,r="legendItemName"in this.properties?this.properties.legendItemName:void 0,l="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,c=r!=null&&r===e.legendItemName;s.id===this.id||c||l!=null?this.toggleSeriesItem(!0,o,n,r,e):i&&a===1?this.toggleSeriesItem(!0,o,void 0,r):this.toggleSeriesItem(!1,o,void 0,r)}toggleSeriesItem(e,i,n,s,a){const o=this.id;(e||i!=="category")&&(this.visible=e),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const r={type:"seriesVisibilityChange",seriesId:o,itemId:n,legendItemName:a?.legendItemName??s,visible:e};this.fireEvent(r),this.ctx.legendManager.toggleItem(e,o,n,s)}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return{...this.ctx,series:this}}getAxisValueText(e,i,n,s,a,o,r){const{id:l,properties:c}=this;return e.formatDatum(c,n,i,l,o,s,a,void 0,void 0,void 0,r)}getLabelText(e,i,n,s,a,o,r,l=!1){if(e==null&&!l)return"";const{axes:c,canHaveAxes:u,ctx:d,id:g,properties:f}=this,y="series-label",x="legendItemName"in f?f.legendItemName:void 0,S={seriesId:this.id,...r},D=u?RB(s):void 0,A=D==null?void 0:c[this.resolveKeyDirection(D)];if(A!=null)return A.formatDatum(f,e,y,g,x,i,n,a,o,S,l);const{formatManager:I}=d,w=this.callWithContext.bind(this),N=L=>o.formatValue(w,L.type,L.value,S)??I.format(w,L)??(e==null?"":String(e)),O=this.getFormatterContext(s);switch(s){case"y":case"color":case"size":return N({type:"number",value:e,datum:i,seriesId:g,legendItemName:x,key:n,source:y,property:s,domain:a,boundSeries:O,fractionDigits:void 0,visibleDomain:void 0});case"x":case"radius":case"angle":case"label":case"secondaryLabel":case"calloutLabel":case"sectorLabel":case"legendItem":return N({type:"category",value:e,datum:i,seriesId:g,legendItemName:x,key:n,source:y,property:s,domain:a,boundSeries:O})}}getMarkerStyle(e,{datumIndex:i,datum:n,point:s},a,o,r={size:s?.size??e.size??0},l){const{itemStyler:c}=e,{highlightState:u,isHighlight:d=!1,checkForHighlight:g=!0,resolveMarkerSubPath:f=["marker"],resolveStyler:y=!1}=o??{},x=["series",`${this.declarationOrder}`,...f];if(y){const I={permissivePath:!0},w=this.ctx.optionsGraphService.resolvePartial(x,r,I);w&&(r={...w,size:w.size??r.size})}const S=g?this.getHighlightStyle(d,i,u):void 0;let A=Et(S,r,e.getStyle(),l);if(c&&a){const I=this.ctx.highlightManager?.getActiveHighlight(),w=this.getHighlightStateString(I,d,i),N=this.filterItemStylerFillParams(A.fill),O=this.cachedCallWithContext(c,{seriesId:this.id,...A,fill:N,...a,highlightState:w,datum:n}),L=this.ctx.optionsGraphService.resolvePartial(x,O);A=Et(L,A)}return A}applyMarkerStyle(e,i,n,s,{applyTranslation:a=!0,selected:o=!0}={}){const{shape:r,size:l=0}=e,c=this.visible&&l>0&&n&&!Number.isNaN(n.x)&&!Number.isNaN(n.y);if(i.setStyleProperties(e,s),a?i.setProperties({visible:c,shape:r,size:l,x:n?.x,y:n?.y,scalingCenterX:n?.x,scalingCenterY:n?.y}):i.setProperties({visible:c,shape:r,size:l}),o||(i.fillOpacity*=pJ,i.strokeOpacity*=gJ),typeof r=="function"&&!i.dirtyPath){i.path.clear(!0),i.updatePath(),i.checkPathDirty();const u=i.getBBox();if(n!=null&&u.isFinite()){const d=u.computeCenter(),[g,f]=["x","y"].map(y=>(e.strokeWidth??0)+Math.abs(d[y]-n[y]));n.focusSize=Math.max(u.width+g,u.height+f)}}}get nodeDataDependencies(){return this._nodeDataDependencies??{seriesRectWidth:Number.NaN,seriesRectHeight:Number.NaN}}checkResize(e){const{width:i,height:n}=e??{width:Number.NaN,height:Number.NaN},s=e?{seriesRectWidth:i,seriesRectHeight:n}:void 0,a=or(this.nodeDataDependencies,s)!=null;return a&&(this._nodeDataDependencies=s,this.markNodeDataDirty()),a}pickFocus(e){}pickViewportFocus(e){}resetDatumCallbackCache(){this.datumCallbackCache.clear()}cachedDatumCallback(e,i){const{datumCallbackCache:n}=this,s=n.get(e);if(s!=null)return s;try{const a=i();return n.set(e,a),a}catch(a){pt.error(String(a))}}cachedCallWithContext(e,i){return this.ctx.callbackCache.call([this.properties,this.ctx.chartService],e,i)}callWithContext(e,i){return js([this.properties,this.ctx.chartService],e,i)}formatTooltipWithContext(e,i,n){return e.formatTooltip([this.properties,this.ctx.chartService],i,n)}minTimeInterval(){}needsDataModelDiff(){return!this.ctx.animationManager.isSkipped()||!!this.chart?.flashOnUpdateEnabled}};Wx.className="Series";T([Pe({changeValue:function(t,e){this.onSeriesGroupingChange(e,t)}})],Wx.prototype,"seriesGrouping",2);var fJ=class{constructor(t){this.swapChain=t,this.focusVisibleStyle=!1,this.div=$t("div"),this.svg=$i("svg"),this.outerPath=$i("path"),this.innerPath=$i("path"),this.svg.append(this.outerPath),this.svg.append(this.innerPath),this.outerPath.classList.add("ag-charts-focus-svg-outer-path"),this.innerPath.classList.add("ag-charts-focus-svg-inner-path"),this.element=$t("div","ag-charts-focus-indicator"),this.element.ariaHidden="true",this.element.append(this.svg),this.swapChain.addListener("swap",e=>this.onSwap(e))}clear(){}update(t,e,i){if(e!=null)if(t instanceof Tn){const n=(a,o)=>{let{x:r,y:l}=Ti.toCanvasPoint(t,a,o);return r-=e.x??0,l-=e.y??0,{x:r,y:l}},s=t.svgPathData(n);this.outerPath.setAttribute("d",s),this.innerPath.setAttribute("d",s),this.show(this.svg)}else{let n;if(i){const s=Math.max(t.x-e.x,0),a=Math.max(t.y-e.y,0),o=Math.min(t.x+t.width-e.x,e.width),r=Math.min(t.y+t.height-e.y,e.height);n=new Tt(s,a,o-s,r-a)}else n=new Tt(t.x-e.x,t.y-e.y,t.width,t.height);tM(this.div,n),this.show(this.div)}}onSwap(t){t!==this.element.parentElement&&(this.element.remove(),t.appendChild(this.element),this.overrideFocusVisible(this.focusVisible))}show(t){this.element.innerHTML="",this.element.append(t)}overrideFocusVisible(t){this.focusVisible=t;const e={true:"1",false:"0",undefined:""};this.element.parentElement?.style.setProperty("opacity",e[`${t}`])}isFocusVisible(){return this.focusVisible??this.focusVisibleStyle}onFocus(){this.overrideFocusVisible(void 0);const t=this.element.parentElement,e=this.element.ownerDocument.defaultView;return this.focusVisibleStyle=t!=null&&e.getComputedStyle(t).opacity==="1",this.focusVisibleStyle}onBlur(){this.overrideFocusVisible(void 0),this.focusVisibleStyle=!1}},mJ=class{constructor(t,e,i,n){this.label1=t,this.label2=e,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=s=>(Cr(s.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",s)),this.onFocus=s=>(Cr(s.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",s)),ye(this.label1,"id",lu()),ye(this.label2,"id",lu()),Cr(this.label1,"display","none"),Cr(this.label2,"display","none"),this.label1.textContent=n,this.label2.textContent=n,this.activeAnnouncer=this.createAnnouncer(i),this.inactiveAnnouncer=this.createAnnouncer(i),ye(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap(n)}createAnnouncer(t){const e=$t("div");return e.role=t,e.className="ag-charts-swapchain",e.addEventListener("blur",this.onBlur),e.addEventListener("focus",this.onFocus),e}destroy(){for(const t of[this.activeAnnouncer,this.inactiveAnnouncer])t.removeEventListener("blur",this.onBlur),t.removeEventListener("focus",this.onFocus),t.remove()}focus(t){this.focusOptions=t,this.activeAnnouncer.focus(t),this.focusOptions=void 0}update(t){this.skipDispatch=!0,this.swap(t),this.hasFocus&&this.activeAnnouncer.focus(this.focusOptions),this.skipDispatch=!1}addListener(t,e){this.listeners[t].push(e),t==="swap"&&e(this.activeAnnouncer)}dispatch(t,e){t==="focus"?this.hasFocus=!0:t==="blur"&&(this.hasFocus=!1);for(const i of this.listeners[t])i(e)}swap(t){const e=this.activeAnnouncer.tabIndex;this.label2.textContent=t,[this.inactiveAnnouncer,this.activeAnnouncer]=[this.activeAnnouncer,this.inactiveAnnouncer],[this.label1,this.label2]=[this.label2,this.label1],Nr(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),Nr(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:e}),this.dispatch("swap",this.activeAnnouncer)}},yJ={arrowdown:{bindings:[{code:"ArrowDown"}]},arrowleft:{bindings:[{code:"ArrowLeft"}]},arrowright:{bindings:[{code:"ArrowRight"}]},arrowup:{bindings:[{code:"ArrowUp"}]},home:{bindings:[{code:"Home"}]},end:{bindings:[{code:"End"}]},delete:{bindings:[{key:"Backspace"},{key:"Delete"}],activatesFocusIndicator:!1},redo:{bindings:[{key:"y",ctrlOrMeta:!0},{key:"z",ctrlOrMeta:!0,shift:!0}],activatesFocusIndicator:!1},undo:{bindings:[{key:"z",ctrlOrMeta:!0}],activatesFocusIndicator:!1},submit:{bindings:[{key:"Enter"},{code:"Enter"},{code:"Space"}]},zoomin:{bindings:[{key:"+"},{code:"ZoomIn"},{code:"Add"}],activatesFocusIndicator:!1},zoomout:{bindings:[{key:"-"},{code:"ZoomOut"},{code:"Substract"}],activatesFocusIndicator:!1},panxleft:{bindings:[{key:"PageUp"},{code:"PageUp"}],activatesFocusIndicator:!0},panxright:{bindings:[{key:"PageDown"},{code:"PageDown"}],activatesFocusIndicator:!0}};function bJ(t,e){for(const i of e)if("code"in i){if(i.code===t.code)return!0}else if(i.key===t.key&&(i.shift===void 0||i.shift===t.shiftKey)&&(i.ctrlOrMeta===void 0||i.ctrlOrMeta===t.ctrlKey||i.ctrlOrMeta===t.metaKey))return!0;return!1}function xJ(t){for(const[e,{activatesFocusIndicator:i=!0,bindings:n}]of Xe(yJ))if(bJ(t,n))return{name:e,activatesFocusIndicator:i}}function vJ(t,e,i){const n=KT(t,i.datum,i.movedBounds);if(n!=null)return{x:n.canvasX,y:n.canvasY};const s=i.bounds;if(s!=null){if(s instanceof Tt){const{x:a,y:o}=s.computeCenter();return{x:e.x+a,y:e.y+o}}return Ti.toCanvas(s).computeCenter()}}function zN({bounds:t}){return t instanceof Tt?t:t!=null?Ti.toCanvas(t):Tt.NaN}function SJ(t,e,i){const{x:n,y:s}=vJ(t,e,i)??{};if(n!==void 0&&s!==void 0)return{type:"keyboard",canvasX:n,canvasY:s}}var PB=.1,zB=200,BB=12,MJ=.5,DJ=class{constructor(t){this.agDocument=t,this.events=new cr,this.x1=Number.NaN,this.y1=Number.NaN,this.x=Number.NaN,this.y=Number.NaN,this.vx=0,this.vy=0,this.t0=Number.NaN,this.animationFrameHandle=void 0}reset(){this.x=Number.NaN,this.y=Number.NaN,this.animationFrameHandle!=null&&(this.agDocument.cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0)}update(t,e){if(Number.isNaN(this.x)||Number.isNaN(this.y)){this.x=t,this.y=e,this.vx=0,this.vy=0,this.emitUpdate(),this.animationFrameHandle!=null&&(this.agDocument.cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0);return}this.x1=t,this.y1=e,this.t0=Date.now(),this.animationFrameHandle??(this.animationFrameHandle=this.agDocument.requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:t,y1:e,t0:i}=this,n=Date.now(),s=n-i;this.t0=n;const a=.001,o=Math.trunc(Math.ceil(s/(a*1e3)));let{x:r,y:l,vx:c,vy:u}=this;for(let d=0;d"))}function tb(t,e){const{path:i,size:n}=t,{x:s,y:a}=t;i.clear();let o=!1;for(const[r,l]of e){const c=s+(r-.5)*n,u=a+(l-.5)*n;o?i.lineTo(c,u):i.moveTo(c,u),o=!0}i.closePath()}var AJ={circle({path:t,x:e,y:i,size:n}){const s=n/2;t.arc(e,i,s,0,Math.PI*2),t.closePath()},cross(t){tb(t,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},diamond(t){tb(t,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:t,x:e,y:i,size:n}){const s=n/4;i=i+s/2,t.arc(e-s,i-s,s,Ze(130),Ze(330)),t.arc(e+s,i-s,s,Ze(220),Ze(50)),t.lineTo(e,i+s),t.closePath()},pin({path:t,x:e,y:i,size:n}){t.moveTo(e+(.891-.5)*n,i+(.391-.5)*n),t.cubicCurveTo(e+(.891-.5)*n,i+(.606-.5)*n,e+(.5-.5)*n,i+(1-.5)*n,e+(.5-.5)*n,i+(1-.5)*n),t.cubicCurveTo(e+(.5-.5)*n,i+(1-.5)*n,e+(.109-.5)*n,i+(.606-.5)*n,e+(.109-.5)*n,i+(.391-.5)*n),t.cubicCurveTo(e+(.109-.5)*n,i+(.175-.5)*n,e+(.284-.5)*n,i+(0-.5)*n,e+(.5-.5)*n,i+(0-.5)*n),t.cubicCurveTo(e+(.716-.5)*n,i+(0-.5)*n,e+(.891-.5)*n,i+(.175-.5)*n,e+(.891-.5)*n,i+(.391-.5)*n),t.closePath()},plus(t){tb(t,[[1/3,0],[2/3,0],[2/3,1/3],[1,1/3],[1,2/3],[2/3,2/3],[2/3,1],[1/3,1],[1/3,2/3],[0,2/3],[0,1/3],[1/3,1/3]])},square({path:t,x:e,y:i,size:n,pixelRatio:s}){const a=n/2;t.moveTo(Fn(s,e-a),Fn(s,i-a)),t.lineTo(Fn(s,e+a),Fn(s,i-a)),t.lineTo(Fn(s,e+a),Fn(s,i+a)),t.lineTo(Fn(s,e-a),Fn(s,i+a)),t.closePath()},star({path:t,x:e,y:i,size:n}){const a=n/2,o=a/2,r=Math.PI/2;for(let l=0;l<10;l++){const c=l%2===0?a:o,u=l*Math.PI/5-r,d=e+Math.cos(u)*c,g=i+Math.sin(u)*c;t.lineTo(d,g)}t.closePath()},triangle(t){tb(t,[[.5,0],[1,.87],[0,.87]])}},Kx=class extends Tn{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}isPointInPath(t,e){return this.distanceSquared(t,e)<=0}get midPoint(){return{x:this.x,y:this.y}}distanceSquared(t,e){const i=wn.anchor(this.shape),n=t-this.x+(i.x-.5)*this.size,s=e-this.y+(i.y-.5)*this.size,a=this.size/2;return Math.max(n*n+s*s-a*a,0)}updatePath(){const{path:t,shape:e,x:i,y:n,size:s}=this,a=this.layerManager?.canvas?.pixelRatio??1,o=wn.anchor(e),r={path:t,x:i-(o.x-.5)*s,y:n-(o.y-.5)*s,size:s,pixelRatio:a};t.clear(),typeof e=="string"?AJ[e](r):typeof e=="function"&&e(r)}computeBBox(){const{x:t,y:e,size:i}=this,n=wn.anchor(this.shape);return new Tt(t-i*n.x,e-i*n.y,i,i)}executeFill(t,e){if(e)return super.executeFill(t,e)}executeStroke(t,e){if(e)return super.executeStroke(t,e)}};T([_x({})],Kx.prototype,"shape",2);T([fe()],Kx.prototype,"x",2);T([fe()],Kx.prototype,"y",2);T([fe({convertor:Math.abs})],Kx.prototype,"size",2);var wn=class extends Qf(PD(Jf(Kx))){static anchor(e){return e==="pin"?{x:.5,y:1}:typeof e=="function"&&"anchor"in e?e.anchor:{x:.5,y:.5}}constructor(e){super(e),e?.shape!=null&&(this.shape=e.shape)}resetAnimationProperties(e,i,n,s,a,o){this.__x=e,this.__y=i,this.__size=n,this.__opacity=s,this.resetScalingProperties(a,o,e,i),this.dirtyPath=!0,this.markDirty()}};function IJ(t,e,i=e*(5/3)){const n=new ee,s=Math.min(t.marker.strokeWidth??1,2),a=t.line?.enabled?Math.min(t.line.strokeWidth,2):0,o=Math.max(t.marker.enabled===!1?0:e,t.line==null?0:i),r=Math.max(t.marker.enabled===!1?0:e,a);if(t.line?.enabled){const{stroke:l,strokeOpacity:c,lineDash:u}=t.line,d=new mo;d.x1=0,d.y1=r/2,d.x2=o,d.y2=r/2,d.stroke=l,d.strokeOpacity=c,d.strokeWidth=a,d.lineDash=u,n.append(d)}if(t.marker.enabled!==!1){const{shape:l,fill:c,fillOpacity:u,stroke:d,strokeOpacity:g,lineDash:f,lineDashOffset:y}=t.marker,x=new wn;x.shape=l??"square",x.size=e,x.fill=c,x.fillOpacity=u??1,x.stroke=d,x.strokeOpacity=g??1,x.strokeWidth=s,x.lineDash=f,x.lineDashOffset=y??0;const S=wn.anchor(l),D=o/2+(S.x-.5)*e,A=r/2+(S.y-.5)*e,I=e/(e+s);x.x=D,x.y=A,x.scalingCenterX=D,x.scalingCenterY=A,x.scalingX=I,x.scalingY=I,n.append(x)}return ee.toSVG(n,o,r)}var es="ag-charts-tooltip",kJ="ag-charts-tooltip--dark";function Cc(t){return t==null?!1:Array.isArray(t)?t.some(e=>Cc(e.text)):bi(t).trim()!==""}function dp(t,e=!1){return t==null?!e:typeof t=="number"&&!Number.isFinite(t)}function CJ(t){return t.type==="raw"||!t.data||t.data.length===0?!1:t.data.every(e=>e.missing===!0)}function w3(t){const e=[],i=new Map;for(const n of t)if(!CJ(n))if(n.type==="structured"){const{heading:s}=n,a=Cc(s)?i.get(s):void 0,o={type:"structured",heading:s,items:[n]};a==null?(i.set(s,o),e.push(o)):a.items.push(n)}else e.push(n);return e}function wJ(t){const e=bp().createElement("div");e.innerHTML=t;const i=e.textContent?.trim();return i??(pt.warnOnce("cannot retrieve tooltip textContent (required for aria-label)"),"")}function NJ(t){const e=w3(t),i=[];for(const n of e){if(n.type==="raw"){i.push(wJ(n.rawHtmlString));continue}Cc(n.heading)&&i.push(ce(n.heading));for(const s of n.items)if(Cc(s.title)&&i.push(ce(s.title)),s.data)for(const a of s.data)a.missing!==!0&&i.push(a.label??a.fallbackLabel,ce(a.value))}return i.filter(n=>n!=="").join("; ")}function N3(t,e,i){let n="";Cc(t)?(n+=`${cf(t)}`,n+=" ",n+=`${cf(e)}`):n+=`${cf(e)}`;const s=[`${es}-row`];return i&&s.push(`${es}-row--inline`),n=`
${n}
`,n}function TJ(t){let e="";if(t.data?.length&&t.data.every(a=>a.missing===!0))return e;const i=Cc(t.title),n=!i&&t.data?.length===1,s=t.symbol==null?void 0:IJ(t.symbol,12);if(s!=null&&(i||t.data?.length)&&(e+=`${s}`),i&&(e+=`${cf(t.title)}`,e+=" "),t.data)for(const a of t.data)a.missing!==!0&&(e+=N3(a.label??a.fallbackLabel,ce(a.value),n),e+=" ");return e}function T3(t,e){if(t==null||e.length===1)return;const i=t?.t("tooltipPaginationStatus",{index:e.index+1,count:e.length});return``}function VB(t,e,i,n){const s=e.items.length===1?e.items[0]:void 0;let a,o,r;switch(i){case"compact":a=!0,o=ce(s?.title);break;case"single":const u=Cc(e.heading);a=s!=null&&(!u||s.title==null)&&s.data?.length===1&&s.data[0].label==null&&s.data[0].value!=null,r=ce(u?e.heading:s?.title);break;case"shared":a=!1}let l="";if(a&&s!=null){if(Cc(o)&&(l+=`${cf(o)}`),s.data)for(const u of s.data)u.missing!==!0&&(l+=N3(u.label??r,ce(u.value),!1),l+=" ")}else{Cc(e.heading)&&(l+=`${cf(ce(e.heading))}`,l+=" ");for(const u of e.items)l+=TJ(u)}if(l.length===0)return;const c=i!=="compact"&&n!=null?T3(t,n):void 0;return c+null&&(l+=c),l=`
${l.trimEnd()}
`,l}function LJ(t,e){const i=e==null?void 0:T3(t,e);return i==null?"":`
${i}
`}function OJ(t,e,i,n){const s=w3(e);if(s.length!==0){if(s.length===1&&s[0].type==="structured")return VB(t,s[0],i,n);{const a=s.map(o=>o.type==="structured"?VB(t,o,i):o.rawHtmlString);return n!=null&&a.push(LJ(t,n)??""),a.join("")}}}var EJ={left:-1,"top-left":-1,"bottom-left":-1,top:0,center:0,bottom:0,right:1,"top-right":1,"bottom-right":1},RJ={"top-left":-1,top:-1,"top-right":-1,left:0,center:0,right:0,"bottom-left":1,bottom:1,"bottom-right":1},PJ={left:3,"top-left":void 0,"bottom-left":void 0,top:2,center:void 0,bottom:1,right:0,"top-right":void 0,"bottom-right":void 0},_B={top:2,bottom:2,left:1,right:1,"top-right":3,"top-left":3,"bottom-right":3,"bottom-left":3,center:0},zJ={pointer:"top",node:"top",chart:"top-left"},nm=class extends xt{constructor(){super(...arguments),this.xOffset=0,this.yOffset=0}};T([b],nm.prototype,"xOffset",2);T([b],nm.prototype,"yOffset",2);T([b],nm.prototype,"anchorTo",2);T([b],nm.prototype,"placement",2);var Hr=class extends xt{constructor(t){super(),this.agDocument=t,this.enabled=!0,this.mode="single",this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new nm,this.pagination=!1,this.darkTheme=!1,this.bounds="extended",this.cleanup=new qe,this.springAnimation=new DJ(this.agDocument),this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this._elementSize=void 0,this._showTimeout=void 0,this.arrowPosition=void 0,this._visible=!1,this.positionParams=void 0,this.localeManager=void 0,this.cleanup.register(this.springAnimation.events.on("update",()=>{this.updateTooltipPosition()}))}get interactive(){return this.enableInteraction}setup(t,e){this.elementProxy=e.addDeferredProxyChild("tooltip-container",es),this.elementProxy.toggleClass(es,!0),this.elementProxy.setProperty("position-anchor",e.anchorName),this.elementProxy.setAttr("popover","manual");const i=this.elementProxy.addResizeListener(n=>{this._elementSize=n,this.updateTooltipPosition()});return this.localeManager=t,()=>{e.removeChild("tooltip-container",es),this.cleanup.flush(),i()}}isVisible(){return this._visible}contains(t){return this.elementProxy?.contains(t)??!1}updateTooltipPosition(){const{elementProxy:t,_elementSize:e,positionParams:i}=this;if(t==null||e==null||i==null)return;const{canvasRect:n,relativeRect:s,meta:a}=i,{x:o,y:r}=this.springAnimation,l=a.position?.anchorTo??"pointer";let c=a.position?.placement??zJ[l];Array.isArray(c)||(c=[c]);const u=a.position?.xOffset??0,d=a.position?.yOffset??0,g=s.x,f=s.y,y=s.width-e.width-1+g,x=s.height-e.height+f;let S=0,D,A,I=!1;do{D=c[S],S+=1;const R=this.getTooltipBounds({elementSize:e,placement:D,anchorTo:l,canvasX:o,canvasY:r,yOffset:d,xOffset:u,canvasRect:n});A=uT(e.width,e.height,s,R),I=!1,_B[D]&1&&(I||(I=A.xy)),_B[D]&2&&(I||(I=A.yx))}while(S{(r.relatedTarget==null||JS(r.relatedTarget)&&!this.contains(r.relatedTarget))&&this.popInteractiveLeaveCallback()}},a.addEventListener("focusout",this.interactiveLeave.listener),a.addEventListener("mouseout",this.interactiveLeave.listener)),o}popInteractiveLeaveCallback(){const{interactiveLeave:t,elementProxy:e}=this;this.interactiveLeave=void 0,t&&(e&&(e.removeEventListener("focusout",t.listener),e.removeEventListener("mouseout",t.listener)),t.callback())}toggle(t,e=!1){const{delay:i}=this;t&&i>0&&!e?this._showTimeout??(this._showTimeout=setTimeout(()=>{this._showTimeout=void 0,this.toggleCallback(!0)},i)):(clearTimeout(this._showTimeout),this._showTimeout=void 0,this.toggleCallback(t))}toggleCallback(t){this.elementProxy?.isConnected&&this._visible!==t&&(this._visible=t,this.elementProxy.togglePopover(t),t?this.updateTooltipPosition():(this.springAnimation.reset(),this.popInteractiveLeaveCallback(),this.elementProxy.reset()))}updateClassModifiers(){if(!this.elementProxy?.isConnected)return;const{elementProxy:t}=this,{enableInteraction:e,arrowPosition:i,mode:n,darkTheme:s,wrapping:a}=this,o=(r,l)=>t.toggleClass(`${es}--${r}`,l);o("no-interaction",!e),o("arrow-top",i===1),o("arrow-right",i===3),o("arrow-bottom",i===2),o("arrow-left",i===0),o("compact",n==="compact"),t.toggleClass(kJ,s);for(const r of this.wrapTypes)t.toggleClass(`${es}--wrap-${r}`,r===a)}getTooltipBounds(t){const{elementSize:e,anchorTo:i,placement:n,canvasX:s,canvasY:a,yOffset:o,xOffset:r,canvasRect:l}=t,{width:c,height:u}=e,d={width:c,height:u};if(i==="node"||i==="pointer"){const g=EJ[n],f=RJ[n];return d.top=a+o+u*(f-1)/2+8*f,d.left=s+r+c*(g-1)/2+8*g,d}switch(n){case"top":return d.top=o,d.left=l.width/2-c/2+r,d;case"right":return d.top=l.height/2-u/2+o,d.left=l.width-c+r,d;case"left":return d.top=l.height/2-u/2+o,d.left=r,d;case"bottom":return d.top=l.height-u+o,d.left=l.width/2-c/2+r,d;case"top-left":return d.top=o,d.left=r,d;case"top-right":return d.top=o,d.left=l.width-c+r,d;case"bottom-right":return d.top=l.height-u+o,d.left=l.width-c+r,d;case"bottom-left":return d.top=l.height-u+o,d.left=r,d}return d}};T([b],Hr.prototype,"enabled",2);T([b],Hr.prototype,"mode",2);T([b],Hr.prototype,"showArrow",2);T([b],Hr.prototype,"delay",2);T([b],Hr.prototype,"range",2);T([b],Hr.prototype,"wrapping",2);T([b],Hr.prototype,"position",2);T([b],Hr.prototype,"pagination",2);T([b],Hr.prototype,"darkTheme",2);T([b],Hr.prototype,"bounds",2);function BJ(t,e){for(const i of t)if(Ti.toCanvas(i.node).intersectsWith(e))return!0;return!1}function VJ(t){switch(t.sourceDetail){case"keyboard-page(1)":case"keyboard-page(-1)":return"viewport-start";case"keyboard-page(home)":return"data-start";case"keyboard-page(end)":return"data-end";default:return}}var L3=class extends PT{constructor(t){super(),this.chart=t,this.id=Nn(this),this.series=[],this.announceMode="when-changed",this.highlight={pendingHoverEvent:void 0,appliedHoverEvent:void 0,stashedHoverEvent:void 0},this.tooltip={lastHover:void 0},this.activeState={lastActive:void 0,highlightInViewport:!0},this._device="pointer",this.focus={initialized:!1,sortedSeries:[],series:void 0,seriesIndex:0,datumIndex:0,datum:void 0,pendingViewportFocus:void 0},this.cachedTooltipContent=void 0,this.hoverScheduler=this.createHoverScheduler(),this.pickManager=new dJ(t.ctx.activeManager,t.tooltip);const e=t.ctx.localeManager.t("ariaInitSeriesArea"),i=t.ctx.domManager.addChild("series-area","series-area-aria-label1"),n=t.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new mJ(i,n,"img",e),this.swapChain.addListener("blur",r=>this.onBlur(r)),this.swapChain.addListener("focus",()=>this.onFocus()),t.ctx.domManager.mode==="normal"&&(this.focusIndicator=new fJ(this.swapChain),this.focusIndicator.overrideFocusVisible(t.mode==="integrated"?!1:void 0));const{seriesDragInterpreter:s,seriesWidget:a,containerWidget:o}=t.ctx.widgets;a.setTabIndex(-1),this.cleanup.register(()=>t.ctx.domManager.removeChild("series-area","series-area-aria-label1"),()=>t.ctx.domManager.removeChild("series-area","series-area-aria-label2"),a.addListener("focus",()=>this.swapChain.focus({preventScroll:!0})),a.addListener("mousemove",r=>this.onHover(r,a)),a.addListener("wheel",r=>this.onWheel(r)),a.addListener("mouseleave",r=>this.onLeave(r)),a.addListener("keydown",r=>this.onKeyDown(r)),a.addListener("contextmenu",(r,l)=>this.onContextMenu(r,l)),o.addListener("contextmenu",(r,l)=>this.onContextMenu(r,l)),o.addListener("click",(r,l)=>this.onClick(r,l)),o.addListener("dblclick",(r,l)=>this.onClick(r,l)),t.ctx.animationManager.addListener("animation-start",()=>this.onAnimationStart()),t.ctx.eventsHub.on("active:load-memento",r=>this.onActiveLoadMemento(r)),t.ctx.eventsHub.on("active:update",r=>this.onActiveUpdate(r)),t.ctx.eventsHub.on("dom:resize",()=>this.onResize()),t.ctx.eventsHub.on("dom:container-change",()=>this.resetHoverScheduler()),t.ctx.eventsHub.on("highlight:change",r=>this.changeHighlightDatum(r)),t.ctx.eventsHub.on("highlight:selection-updated",r=>this.onHighlightSelectionUpdate(r)),t.ctx.eventsHub.on("layout:complete",r=>this.layoutComplete(r)),t.ctx.updateService.addListener("pre-scene-render",()=>this.preSceneRender()),t.ctx.updateService.addListener("update-complete",()=>this.updateComplete()),t.ctx.eventsHub.on("zoom:change-complete",r=>this.onZoomChangeComplete(r)),t.ctx.eventsHub.on("zoom:pan-start",()=>this.clearAll())),s&&this.cleanup.register(s.events.on("drag-move",r=>this.onDragMove(r,a)),s.events.on("click",r=>this.onClick(r,a)),s.events.on("dblclick",r=>this.onClick(r,a)))}get bbox(){return(this.seriesRect??Tt.zero).clone()}setHoverDevice(t){(t==="setState"||!this.isState(1))&&(this._device=t)}getHoverDevice(){return this._device}initFocus(t){if(!this.focus.initialized)switch(this.focus.initialized=!0,t){case"data-end":{this.focus.datumIndex=Number.MAX_VALUE;break}case"viewport-start":case"viewport-end":{this.focus.pendingViewportFocus=t;break}}}isState(t){return this.chart.ctx.interactionManager.isState(t)}isIgnoredTouch(t){return!(t.device!=="touch"||t.type==="click"||this.chart.ctx.chartService.touch.dragAction==="hover"||this.chart.ctx.chartService.touch.dragAction==="drag"&&this.isState(18))}dataChanged(){var t;this.cachedTooltipContent=void 0,this.highlight.appliedHoverEvent&&((t=this.highlight).stashedHoverEvent??(t.stashedHoverEvent=this.highlight.appliedHoverEvent),this.clearHighlight()),this.getHoverDevice()!=="setState"&&(this.chart.ctx.tooltipManager.removeTooltip(this.id),this.focusIndicator?.clear())}preSceneRender(){this.highlight.stashedHoverEvent!=null&&(this.highlight.pendingHoverEvent=this.tooltip.lastHover??this.highlight.stashedHoverEvent,this.highlight.stashedHoverEvent=void 0,this.handleHoverHighlight(!0)),this.tooltip.lastHover!=null&&this.handleHoverTooltip(this.tooltip.lastHover,!0),this.getHoverDevice()==="setState"&&this.refreshSetState()}updateComplete(){const{pendingViewportFocus:t}=this.focus;t&&this.focus.series!==void 0?(this.focus.pendingViewportFocus=void 0,this.pickViewportFocus(t)):this.isState(69)&&this.focusIndicator?.isFocusVisible()&&(this.announceMode!=="always"&&(this.announceMode="never"),this.refreshFocus())}update(t,e){this.chart.ctx.eventsHub.emit("chart:request-update",{type:t,opts:e})}seriesChanged(t){this.focus.sortedSeries=[...t].sort((e,i)=>{let n=e.properties.focusPriority??1/0,s=i.properties.focusPriority??1/0;return n===s&&([n,s]=[e.declarationOrder,i.declarationOrder]),ns?1:0}),this.series=t}layoutComplete(t){this.seriesRect=t.series.rect,this.hoverRect=t.series.rect,this.chart.ctx.widgets.seriesWidget.setBounds(t.series.rect),this.chart.ctx.domManager.mode==="normal"&&this.chart.ctx.widgets.chartWidget.setBounds(t.chart)}onAnimationStart(){this.getHoverDevice()!=="setState"&&this.clearAll()}onResize(){const t=this.chart.ctx.highlightManager.getActiveHighlight();this.clearAll(),this.pickManager.wasActivationPrevented()&&t!==void 0&&(this.setHoverDevice("setState"),this.activeState.lastActive={itemId:ZD(t),seriesId:t.series.id})}onZoomChangeComplete(t){this.clearAll(),this.focus.pendingViewportFocus=VJ(t)}onContextMenu(t,e){const{sourceEvent:i}=t;if(i.currentTarget!=e.getElement())return;if(e!==this.chart.ctx.widgets.seriesWidget){if(this.isState(72)){const{currentX:c,currentY:u}=t;this.chart.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:t,canvasX:c,canvasY:u},void 0)}return}let n,s;if(this.focusIndicator?.isFocusVisible())n=this.chart.ctx.highlightManager.getActiveHighlight(),n&&this.seriesRect&&n.midPoint&&(s=Ti.toCanvasPoint(n.series.contentGroup,n.midPoint.x,n.midPoint.y));else if(this.isState(72)){const c=this.pickNodes({x:t.currentX,y:t.currentY},"context-menu");c&&(this.pickManager.maybeActivate(void 0,()=>{this.chart.ctx.highlightManager.updateHighlight(this.id)}),n=c.matches[0])}const a=n?.series;this.clearAll();const o=t.currentX+e.cssLeft(),r=t.currentY+e.cssTop(),{datumIndex:l}=n??{};a&&n&&l!=null?this.chart.ctx.contextMenuRegistry.dispatchContext("series-node",{widgetEvent:t,canvasX:o,canvasY:r},{pickedSeries:a,pickedNode:{...n,datumIndex:l}},s):this.chart.ctx.contextMenuRegistry.dispatchContext("series-area",{widgetEvent:t,canvasX:o,canvasY:r},void 0,s)}onLeave(t){!this.isState(82)||t.sourceEvent.relatedTarget?.className==="ag-charts-text-input__textarea"||this.maybeEnterInteractiveTooltip(t.sourceEvent)||(this.chart.ctx.domManager.updateCursor(this.id),this.getHoverDevice()!=="keyboard"&&this.clearAll(!0))}onWheel(t){this.isState(82)&&(this.focusIndicator?.overrideFocusVisible(!1),this.setHoverDevice("pointer"))}onDragMove(t,e){this.isState(82)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(t,e))}onHover(t,e){this.isState(83)&&this.onHoverLikeEvent(t,e)}onHoverLikeEvent(t,e){if(this.isIgnoredTouch(t)||(t.device==="touch"&&this.chart.ctx.chartService.touch.dragAction==="hover"&&t.sourceEvent.preventDefault(),e!==this.chart.ctx.widgets.seriesWidget))return;this.tooltip.lastHover=t,this.setHoverDevice("pointer"),this.highlight.pendingHoverEvent=t,this.hoverScheduler.schedule();let i;if(this.isState(65)){const{currentX:s,currentY:a}=t;i=this.pickNodes({x:s,y:a},"event");const o=i?.matches,r=o?.[0];r?.series.hasEventListener("seriesNodeClick")||r?.series.hasEventListener("seriesNodeDoubleClick")||o!=null&&o.length>1&&this.chart.tooltip.pagination?this.chart.ctx.domManager.updateCursor(this.id,"pointer"):this.chart.ctx.domManager.updateCursor(this.id)}const n=!!i?.matches.length;this.emitSeriesAreaHoverEvent(t,n)}onClick(t,e){if(t.device==="keyboard"||(e===this.chart.ctx.widgets.seriesWidget&&this.chart.ctx.animationManager.isActive()&&this.chart.ctx.animationManager.skipCurrentBatch(),t.device==="touch"&&e===this.chart.ctx.widgets.seriesWidget&&this.swapChain.focus({preventScroll:!0}),!this.isState(83)))return;if(e===this.chart.ctx.widgets.seriesWidget){if(!e.getElement().contains(t.sourceEvent.target))return}else if(t.sourceEvent.target!=e.getElement())return;this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(t,e);const i=e===this.chart.ctx.widgets.seriesWidget;if(this.isState(18)){i&&this.emitSeriesAreaClickEvent(t,!1);return}if(i){if(this.checkSeriesNodeClick(t)){this.emitSeriesAreaClickEvent(t,!0),this.update(Ct.SERIES_UPDATE),t.sourceEvent.preventDefault();return}this.emitSeriesAreaClickEvent(t,!1)}const n={type:t.type==="click"?"click":"doubleClick",event:t.sourceEvent};this.chart.fireEvent(n)}emitSeriesAreaHoverEvent(t,e){const{canvasX:i,canvasY:n}=this.toCanvasCoordinates(t),s={canvasX:i,canvasY:n,consumed:e,sourceEvent:t.sourceEvent};this.chart.ctx.eventsHub.emit("series-area:hover",s)}emitSeriesAreaClickEvent(t,e){if(!("currentX"in t))return;const{canvasX:i,canvasY:n}=this.toCanvasCoordinates(t),s={canvasX:i,canvasY:n,consumed:e,sourceEvent:t.sourceEvent};this.chart.ctx.eventsHub.emit("series-area:click",s)}toCanvasCoordinates(t){return{canvasX:t.currentX+(this.hoverRect?.x??this.seriesRect?.x??0),canvasY:t.currentY+(this.hoverRect?.y??this.seriesRect?.y??0)}}onFocus(){if(!this.isState(69)||!this.focusIndicator)return;this.initFocus(this.chart.keyboard.initialFocus);const t=this.focusIndicator.onFocus();this.setHoverDevice(t?"keyboard":"pointer");const{pendingViewportFocus:e}=this.focus;this.refreshFocus()===4&&e&&(this.focus.pendingViewportFocus=void 0,this.pickViewportFocus(e))}onBlur(t){this.isState(69)&&(this.setHoverDevice("pointer"),!this.isState(1)&&!this.maybeEnterInteractiveTooltip(t)&&this.clearAll(!0),this.focusIndicator?.onBlur())}onKeyDown(t){if(!this.isState(87))return;const e=xJ(t.sourceEvent);switch(e?.activatesFocusIndicator===!1&&this.focusIndicator?.overrideFocusVisible(this.getHoverDevice()==="keyboard"),e?.name){case"redo":return this.chart.ctx.eventsHub.emit("series:redo",null);case"undo":return this.chart.ctx.eventsHub.emit("series:undo",null);case"zoomin":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:1,widgetEvent:t});case"zoomout":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:-1,widgetEvent:t});case"panxleft":return this.onPage(-1,t);case"panxright":return this.onPage(1,t);case"arrowup":return this.onArrow(-1,0,t);case"arrowdown":return this.onArrow(1,0,t);case"arrowleft":return this.onArrow(0,-1,t);case"arrowright":return this.onArrow(0,1,t);case"home":return this.onHome(t);case"end":return this.onEnd(t);case"submit":return this.onSubmit(t);case"delete":return;default:e?.name}}onPage(t,e){if(!this.chart.hasPgUpPgDownSupport()||!this.onNav(e))return;const i=this.focus.series?.axes.x?.reverse??!1;this.chart.ctx.eventsHub.emit("series:keynav-panx",{delta:t,reverse:i,widgetEvent:e})}onNav(t){return this.isState(69)?(this.setHoverDevice("keyboard"),this.focusIndicator?.overrideFocusVisible(!0),t.sourceEvent.preventDefault(),!0):!1}onArrow(t,e,i){this.onNav(i)&&(this.focus.seriesIndex+=t,this.focus.datumIndex+=e,this.handleFocusFromUserInput({datumIndexDelta:e,otherIndexDelta:t}))}onHome(t){if(this.chart.hasViewportSupport())return this.onPage("home",t);this.onNav(t)&&this.handleFocusFromUserInput({otherIndex:this.focus.seriesIndex,datumIndex:0})}onEnd(t){if(this.chart.hasViewportSupport())return this.onPage("end",t);if(!this.onNav(t))return;const e=this.focus.series?.data?.data.length;e!==void 0&&this.handleFocusFromUserInput({otherIndex:this.focus.seriesIndex,datumIndex:e-1})}onSubmit(t){if(!this.onNav(t))return;const{series:e,datum:i}=this.focus,n=t.sourceEvent;e!=null&&i!=null?e.fireNodeClickEvent(n,i):this.chart.fireEvent({type:"click",event:n})}checkSeriesNodeClick(t){var e;const i=this.pickNodes({x:t.currentX,y:t.currentY},"event"),n=this.pickManager.onPickedNodesTooltip(i);if(i===void 0||n.active===void 0)return!1;const s=n.paginationState==null?i.distance:0;if(t.type==="click"){if(n.active.series.fireNodeClickEvent(t.sourceEvent,n.active)){const o=this.pickManager.nextCandidate();if(o.active!==void 0){const{active:r}=o,{canvasX:l,canvasY:c}=this.toCanvasCoordinates(t);(e=this.highlight).pendingHoverEvent??(e.pendingHoverEvent=this.highlight.appliedHoverEvent),this.handleHoverHighlight(!1,{active:r,defaultCb:()=>{this.showTooltip(r,l,c,o.paginationState)}})}}return!0}return t.type==="dblclick"?(t.preventZoomDblClick=s===0,n.active.series.fireNodeDoubleClickEvent(t.sourceEvent,n.active),!0):!1}handleFocusFromUserInput(t){this.handleFocus(t),this.chart.ctx.eventsHub.emit("series:focus-change",null)}refreshFocus(){return this.handleFocus({datumIndexDelta:0,otherIndexDelta:0})}handleFocus(t){const e=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);if(e==null){const i=this.handleSeriesFocus(t);return i===0?this.announceMode="when-changed":this.announceMode="always",i}else return this.focusIndicator?.update(e.rect,this.seriesRect,!1),this.swapChain.update(e.text),this.announceMode="always",0}handleSeriesFocus(t){return"datumIndexDelta"in t?this.handleSeriesFocusDeltas(t):this.handleSeriesFocusIndices(t)}makeUpdateFocusParamsFromDeltas(t){const{otherIndexDelta:e,datumIndexDelta:i}=t;if(this.chart.chartType==="standalone"){this.focus.series=this.focus.sortedSeries[0];const c=this.focus.datumIndex,u=this.focus.seriesIndex,d=this.focus.datumIndex-i,g=this.focus.seriesIndex-e;return{datumIndex:c,datumIndexDelta:i,oldDatumIndex:d,otherIndex:u,otherIndexDelta:e,oldOtherIndex:g}}const{focus:n}=this,s=n.sortedSeries.filter(c=>c.visible&&c.focusable);if(s.length===0)return 1;const a=n.datumIndex-i,o=n.seriesIndex-e;n.seriesIndex=Nt(0,n.seriesIndex,s.length-1),n.series=s[n.seriesIndex];const r=this.focus.datumIndex,l=this.focus.seriesIndex;return{datumIndex:r,datumIndexDelta:i,oldDatumIndex:a,otherIndex:l,otherIndexDelta:e,oldOtherIndex:o}}handleSeriesFocusDeltas(t){const e=this.makeUpdateFocusParamsFromDeltas(t);return e===1?1:this.pickFocus(e)}handleSeriesFocusIndices(t){const{datumIndex:e,otherIndex:i}=t,n=this.focus.datumIndex,s=this.focus.seriesIndex;return this.pickFocus({datumIndex:e,datumIndexDelta:e-n,oldDatumIndex:n,otherIndex:i,otherIndexDelta:i-s,oldOtherIndex:s})}pickFocus(t){const{datumIndex:e,datumIndexDelta:i,otherIndex:n,otherIndexDelta:s}=t,{focus:a,hoverRect:o,seriesRect:r}=this;if(a.series==null||o==null)return 1;const l={datumIndex:e,datumIndexDelta:i,otherIndex:n,otherIndexDelta:s,seriesRect:r},c=a.series.pickFocus(l);return c?this.updatePickedFocus(t,c):2}pickViewportFocus(t){const{focus:e,hoverRect:i}=this;if(e.series==null||i==null)return 1;const n=e.series.pickViewportFocus({where:t,hoverRect:i,otherIndex:e.seriesIndex});if(!n)return 2;const s={datumIndex:n.datumIndex,datumIndexDelta:0,oldDatumIndex:this.focus.datumIndex,otherIndex:n.otherIndex??this.focus.seriesIndex,otherIndexDelta:0,oldOtherIndex:this.focus.seriesIndex};return this.updatePickedFocus(s,n)}updatePickedFocus(t,e){const{datumIndexDelta:i,oldDatumIndex:n,otherIndexDelta:s,oldOtherIndex:a}=t,{focus:o,hoverRect:r}=this;if(o.series==null||r==null)return 1;if(o.pendingViewportFocus!==void 0)return 4;const{datum:l}=e;if(o.datum=l,o.datumIndex=e.datumIndex,e.otherIndex!=null&&(o.seriesIndex=e.otherIndex),this.focusIndicator?.isFocusVisible()){this.chart.ctx.animationManager.reset();const d=zN(e),{x:g,y:f}=d.computeCenter();if(!r.containsPoint(g,f)&&this.chart.ctx.zoomManager.panToBBox(r,d))return 3;const{x1:y,x2:x,y1:S,y2:D}=Wt.from(d),A=r.containsPoint(y,S),I=r.containsPoint(x,S),w=r.containsPoint(y,D),N=r.containsPoint(x,D);if(!(A||I||w||N)){const O=Wt.from(r);e.movedBounds=d.clone(),yO.x2&&x>O.x2&&(e.movedBounds.x=O.x2-2,e.movedBounds.width=4),SO.y2&&D>O.y2&&(e.movedBounds.y=O.y2-2,e.movedBounds.height=4)}}this.focusIndicator?.update(e.movedBounds??e.bounds,this.seriesRect,e.clipFocusBox);const c=this.getTooltipContent(l,"aria-label"),u=SJ(o.series,r,e);if(u!=null&&this.getHoverDevice()==="keyboard"&&(this.clearCachedEvents(),!this.isState(1))){const d=IM.makeTooltipMeta(u,o.series,l,e.movedBounds);this.pickManager.maybeActivate(l,({series:g})=>{this.chart.ctx.highlightManager.updateHighlight(this.id,l),this.isTooltipEnabled(g)&&this.chart.ctx.tooltipManager.updateTooltip(this.id,d,c)},{defaultCbArg:{series:o.series}})}return this.maybeAnnouncePickedFocus(i,n,s,a,e,c),0}maybeAnnouncePickedFocus(t,e,i,n,s,a){const{focus:o}=this;let r;this.announceMode==="when-changed"?t===0&&i===0||e!==s.datumIndex||n!==(s.otherIndex??o.seriesIndex)?r="always":r="never":r=this.announceMode,r==="always"&&this.swapChain.update(this.getDatumAriaText(s.datum,a))}getDatumAriaText(t,e){const i=e==null?"":NJ(e);return this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum",{datum:t.series.getDatumAriaText?.(t,i)??i})}clearHighlight(t=!1){this.pickManager.maybeActivate(void 0,()=>{this.highlight.pendingHoverEvent=void 0,this.highlight.appliedHoverEvent=void 0,this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,t)})}clearTooltip(t=!1){this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,t),this.tooltip.lastHover=void 0}clearAll(t=!1){this.isState(1)||(this.pickManager.onClearUI(),this.clearHighlight(t),this.pickManager.wasActivationPrevented()||this.clearTooltip(t),this.focusIndicator?.clear())}clearStaleHighlightTooltip(){this.getHoverDevice()==="setState"&&(this.clearCachedEvents(),this.chart.ctx.highlightManager.updateHighlight(this.id,void 0),this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0))}clearUnpreventable(){this.activeState.lastActive=void 0,this.pickManager.onClearUI(),this.clearHighlight(!1),this.clearTooltip(!1)}clearCachedEvents(){this.tooltip.lastHover=void 0,this.highlight.appliedHoverEvent=void 0,this.highlight.pendingHoverEvent=void 0,this.highlight.stashedHoverEvent=void 0}createHoverScheduler(){return CZ(this.chart.ctx.domManager.getDocument(),()=>{if(this.getHoverDevice()==="setState")return this.handleHoverFromState();if(!(!this.tooltip.lastHover&&!this.highlight.pendingHoverEvent)){if(this.chart.getUpdateType()<=Ct.SERIES_UPDATE){this.hoverScheduler.schedule();return}this.highlight.pendingHoverEvent&&this.handleHoverHighlight(!1),this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!1)}})}resetHoverScheduler(){this.hoverScheduler.cancel(),this.hoverScheduler=this.createHoverScheduler()}handleHoverFromState(){const{active:t,paginationState:e}=this.pickManager.onPickedNodesAPIDebounced();t!==void 0&&this.pickManager.maybeActivate(t,()=>{const i=KT(t.series,t,void 0);if(this.chart.tooltip.enabled){if(!t.series.visible)this.clearStaleHighlightTooltip();else if(i){const{canvasX:n,canvasY:s}=i,a=this.activeState.highlightInViewport;this.chart.ctx.highlightManager.updateHighlight(this.id,t,!1,a),a?this.showTooltip(t,n,s,e):this.clearTooltip()}}})}handleHoverHighlight(t,e){this.highlight.appliedHoverEvent=this.highlight.pendingHoverEvent,this.highlight.pendingHoverEvent=void 0;const i=this.highlight.appliedHoverEvent;if(!i||!this.isState(82))return;const{canvasX:n,canvasY:s}=this.toCanvasCoordinates(i);if(t?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(n,s)){this.clearHighlight();return}const{range:a}=this.chart.highlight,o=a==="tooltip"?"highlight-tooltip":"highlight",r=e?.active??this.pickManager.onPickedNodesHighlight(this.pickNodes({x:i.currentX,y:i.currentY},o));r===void 0?this.pickManager.maybeActivate(void 0,()=>{this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,!0),e?.defaultCb()}):this.pickManager.maybeActivate(r,()=>{this.chart.ctx.highlightManager.updateHighlight(this.id,r,!1),e?.defaultCb()})}handleHoverTooltip(t,e){if(!this.isState(82))return;const{canvasX:i,canvasY:n}=this.toCanvasCoordinates(t),s=t.sourceEvent.target;if(e?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(i,n)){this.getHoverDevice()=="pointer"&&this.clearTooltip();return}if(s&&this.chart.tooltip.interactive&&this.chart.ctx.domManager.isManagedChildDOMElement(s,"canvas-overlay",es))return;const a=this.pickNodes({x:t.currentX,y:t.currentY},"tooltip"),{active:o,paginationState:r}=this.pickManager.onPickedNodesTooltip(a);this.pickManager.wasActivationPrevented()||(o===void 0?this.getHoverDevice()=="pointer"&&this.clearTooltip(!0):this.showTooltip(o,i,n,r))}showTooltip(t,e,i,n){const s=this.getTooltipContent(t,"tooltip");if(s!=null){const{series:o}=t,r=IM.makeTooltipMeta({type:"pointermove",canvasX:e,canvasY:i},o,t,void 0);this.chart.ctx.tooltipManager.updateTooltip(this.id,r,s,n)}else this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,!0)}maybeEnterInteractiveTooltip(t){return this.chart.tooltip.maybeEnterInteractiveTooltip(t,()=>{this.pickManager.maybeActivate(void 0,()=>{this.tooltip.lastHover=void 0,this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,!0),this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,!0)})})}changeHighlightDatum(t){const e=t.previousHighlight?.series,i=t.currentHighlight?.series;e?.properties.cursor&&t.previousHighlight?.datum&&this.chart.ctx.domManager.updateCursor(e.id),i?.properties.cursor&&i.properties.cursor!=="default"&&t.currentHighlight?.datum&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor);const n=e?.isHighlightEnabled()??!1;if(t.highlightSuppressed&&!n)return;const s=t.highlightSuppressed!==!n;this.getHoverDevice()==="setState"||i==null||e==null||s?this.update(Ct.SERIES_UPDATE,{clearCallbackCache:!0}):this.update(Ct.SERIES_UPDATE,{seriesToUpdate:new Set([e,i].filter(Boolean)),clearCallbackCache:!0})}onHighlightSelectionUpdate(t){if(!this.isState(1)||!this.seriesRect){this.activeState.highlightInViewport=!0;return}if(t.highlightSelection.length===0)return;const e=BJ(t.highlightSelection,this.seriesRect);this.activeState.highlightInViewport=e}pickNodes(t,e,i){const n=[...this.series].reverse(),s=e==="event"||e==="context-menu",a=e==="tooltip"||e==="highlight-tooltip",o=g=>{if(s)return g.properties.nodeClickRange;if(a)return g.properties.tooltip.range},{x:r,y:l}=t,c=new Set;for(const g of n)g.visible&&g.contentGroup.visible&&o(g)==="area"&&g.isPointInArea?.(r,l)&&c.add(g);const u=c.size>0;let d;for(const g of n){if(!g.visible||!g.contentGroup.visible||u&&!(o(g)==="area"&&c.has(g)))continue;const f=g.pickNodes(t,e,i);if(f==null||f.datums.length===0)continue;const{datums:y,distance:x}=f;if(f.datums.length!==0)if(x===0){d?.distance!==0&&(d={matches:[],distance:0});for(const S of y)d.matches.push(S)}else(d==null||d.distance>x)&&(d={matches:y,distance:x})}return d}isTooltipEnabled(t){return t.tooltipEnabled??this.chart.tooltip.enabled}getTooltipContent(t,e){const{series:i,datumIndex:n}=t;let s;if(e==="aria-label"||this.isTooltipEnabled(i)){const{cachedTooltipContent:a}=this;if(a?.series===i&&a.datumIndex===n)s=a.content;else{const o=this.chart.getTooltipContent(i,n,t,e);this.cachedTooltipContent={series:i,datumIndex:n,content:o},s=o}}else this.cachedTooltipContent=void 0;return s}onActiveLoadMemento(t){switch(t.activeItem?.type){case void 0:case"legend":return this.onActiveClear();case"series-node":return this.onActiveDatum(t.activeItem,t);default:return t.activeItem?.type}}onActiveUpdate(t){t?.type==="legend"&&(this.clearStaleHighlightTooltip(),this.activeState.lastActive="legend")}onActiveClear(){this.pickManager.onClearAPI(),this.setHoverDevice("setState"),this.activeState.lastActive=void 0,this.clearHighlight(),this.clearTooltip()}refreshSetState(){if(this.activeState.lastActive===void 0)this.pickManager.onClearUI(),this.clearHighlight(!1),this.clearTooltip(!1);else if(this.activeState.lastActive!=="legend"){const{seriesId:t,itemId:e}=this.activeState.lastActive,i=this.findPickedNodes(t,e);i===void 0?this.clearUnpreventable():i==="series-hidden"?this.isState(1)?this.clearStaleHighlightTooltip():this.pickManager.maybeActivate(void 0,()=>{this.activeState.lastActive=void 0,this.clearCachedEvents(),this.chart.ctx.highlightManager.updateHighlight(this.id,void 0),this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0)}):(this.pickManager.onPickedNodesAPI(i),this.hoverScheduler.schedule())}}onActiveDatum(t,e){const{seriesId:i,itemId:n}=t,s=this.findPickedNodes(i,n);if(s===void 0)e.reject(),this.onActiveClear();else{if(s!=="series-hidden"){const a=this.pickManager.onPickedNodesAPI(s);e.setDatum(a)}this.setHoverDevice("setState"),this.activeState.lastActive={seriesId:i,itemId:n},e.initialState?(this.chart.ctx.scene.applyPendingResize(),this.handleHoverFromState()):(this.clearCachedEvents(),this.hoverScheduler.schedule())}}findPickedNodes(t,e){const i=this.series.find(s=>s.id===t);if(i==null){pt.warn(`Cannot find seriesId: "${t}"`);return}if(!i.visible)return"series-hidden";const n=i.findNodeDatum(e);if(n==null){pt.warn(`Cannot find itemId: ${JSON.stringify(e)}`);return}return{matches:[n],distance:0}}};L3.className="SeriesAreaManager";var FB=30,_J=class{constructor(t){this.seriesRoot=t,this.groups=new Map,this.series=new Map,this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(t){this.expectedSeriesCount=t}getGroupIndex(t){const{internalId:e,seriesGrouping:i}=t;return i?.groupIndex??e}getGroupType(t,e){return e?"top":t.type}requestGroup(t){const{internalId:e,contentGroup:i}=t,n=t.bringToFront(),s=this.getGroupType(t,n),a=this.getGroupIndex(t),o=this.series.get(e);if(o!=null)throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(o)}`);this.series.size===0&&(this.mode=this.expectedSeriesCount>=FB?"aggressive-grouping":"normal");let r=this.groups.get(s);r==null&&(r=new Map,this.groups.set(s,r));const l=this.lookupIdx(a);let c=r.get(l);return c==null&&(c={type:s,id:l,seriesIds:[],group:this.seriesRoot.appendChild(new ee({name:`${t.contentGroup.name??s}-managed-layer`,zIndex:t.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},r.set(l,c)),this.series.set(e,{layerState:c,seriesConfig:t,bringToFront:n}),c.seriesIds.push(e),c.group.appendChild(i),c.group}changeGroup(t){const{internalId:e,contentGroup:i}=t,n=t.bringToFront(),s=this.getGroupType(t,n),a=this.series.get(e),o=a?this.getGroupType(a.seriesConfig,a.bringToFront):void 0,r=this.getGroupIndex(t),l=this.lookupIdx(r),c=this.groups.get(s)?.get(l);if(!(o===s&&c?.seriesIds.includes(e)===!0))return this.series.has(e)&&this._releaseGroup({internalId:e,contentGroup:i,type:o}),this.requestGroup(t)}releaseGroup(t){const{internalId:e,contentGroup:i}=t,n=this.getGroupType(t,t.bringToFront());this._releaseGroup({internalId:e,contentGroup:i,type:n})}_releaseGroup(t){const{internalId:e,contentGroup:i,type:n}=t;if(!this.series.has(e))throw new Error(`AG Charts - series doesn't have an allocated layer: ${e}`);const s=this.series.get(e)?.layerState;s&&(s.seriesIds=s.seriesIds.filter(a=>a!==e),i.remove()),s?.seriesIds.length===0?(s.group.remove(),this.groups.get(s.type)?.delete(s.id),this.groups.get(n)?.delete(e)):s!=null&&s.seriesIds.length>0&&(s.group.zIndex=this.getLowestSeriesZIndex(s.seriesIds)),this.series.delete(e)}updateLayerCompositing(){for(const t of this.groups.values())for(const e of t.values()){const{group:i,seriesIds:n}=e;let s;n.length===0?s=!1:n.length>1?s=!0:s=this.series.get(n[0])?.seriesConfig.renderToOffscreenCanvas()===!0,i.renderToOffscreenCanvas=s,i.zIndex=this.getLowestSeriesZIndex(n)}}lookupIdx(t){return this.mode==="normal"?t:typeof t=="string"&&(t=Number(t.split("-").at(-1)),!Number.isFinite(t))?0:Math.floor(Nt(0,t/this.expectedSeriesCount,1)*FB)}destroy(){for(const t of this.groups.values())for(const e of t.values())e.group.remove();this.groups.clear(),this.series.clear()}getLowestSeriesZIndex(t){let e;for(const i of t){const s=this.series.get(i)?.seriesConfig.contentGroup.zIndex??Vs.ANY_CONTENT;if(e==null||s==null){e=s;continue}e=cG(e,s)<=0?e:s}return e??Vs.ANY_CONTENT}},O3=class extends xt{constructor(){super(...arguments),this.dragAction="drag"}};T([b],O3.prototype,"dragAction",2);var FJ=class{constructor(t,e,i,n,s,a){this.chart=t,this.eventsHub=e,this.dataService=i,this.updateService=n,this.zoomManager=s,this.animationManager=a,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.cleanup=new qe,this.cleanup.register(this.eventsHub.on("data:source-change",()=>this.onDataSourceChange()),this.eventsHub.on("data:load",()=>this.onDataLoad()),this.eventsHub.on("data:error",()=>this.onDataError()),this.updateService.addListener("update-complete",o=>this.onUpdateComplete(o)),this.eventsHub.on("zoom:change-complete",()=>this.onZoomChange()))}destroy(){this.cleanup.flush()}onDataLoad(){this.animationManager.skip(),this.eventsHub.emit("chart:request-update",{type:Ct.UPDATE_DATA})}onDataError(){this.eventsHub.emit("chart:request-update",{type:Ct.PERFORM_LAYOUT})}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(t){!t.apiUpdate&&!this.dirtyZoom&&!this.dirtyDataSource||t.wasShortcut||this.updateWindow(t)}onZoomChange(){this.dirtyZoom=!0}updateWindow(t){if(!this.dataService.isLazy())return;const e=this.getValidAxis();let i,n=!0;if(e){const s=this.zoomManager.getAxisZoom(e.id);i=this.getAxisWindow(e,s),n=this.shouldRefresh(t,e,s)}this.dirtyZoom=!1,this.dirtyDataSource=!1,n&&this.dataService.load({windowStart:i?.min,windowEnd:i?.max})}getValidAxis(){return this.chart.axes.find(t=>t.type==="time")}shouldRefresh(t,e,i){if(t.apiUpdate||this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const n=this.lastAxisZooms.get(e.id);return n&&i.min===n.min&&i.max===n.max?!1:(this.lastAxisZooms.set(e.id,i),!0)}getAxisWindow(t,e){const{domain:i}=t.scale;if(!e||i.length===0||Number.isNaN(Number(i[0])))return;const n=Number(i[1])-Number(i[0]),s=new Date(Number(i[0])+n*e.min),a=new Date(Number(i[0])+n*e.max);return{min:s,max:a}}},HJ=/^((?!chrome|android).)*safari/i,jJ=/Version\/(\d+(\.\d+)?)/,GJ=/Chrome/,UJ=/Chrome\/(\d+)/,WJ=/Edg/,KJ=/OPR/;function YJ(){const{userAgent:t}=Ml("navigator");if(HJ.test(t)){const e=jJ.exec(t);if(e==null)return!1;const i=Number.parseFloat(e[1]),n=Math.floor(i)>16;return n||pt.warnOnce(`Unsupported Safari version: ${i}; ${t}`),!n}else if(GJ.test(t)&&!WJ.test(t)&&!KJ.test(t)){const e=UJ.exec(t);if(e==null)return!1;const i=Number.parseInt(e[1],10),n=i>126;return n||pt.warnOnce(`Unsupported Chrome version: ${i}; ${t}`),!n}return!1}var $J=new Set(["map-shape-background","map-line-background"]),XJ=class{constructor(t,e,i,n,s,a,o){this.chartLike=t,this.overlays=e,this.eventsHub=i,this.dataService=n,this.localeManager=s,this.animationManager=a,this.domManager=o,this.cleanup=new qe,this.overlayElem=this.domManager.addProxyChild("canvas-overlay","overlay"),this.overlayElem.setAttr("role","status"),this.overlayElem.setAttr("aria-atomic","false"),this.overlayElem.setAttr("aria-live","polite"),this.overlayElem.toggleClass(ON,!0),this.cleanup.register(this.eventsHub.on("layout:complete",r=>this.onLayoutComplete(r)))}destroy(){this.cleanup.flush(),this.domManager.removeChild("canvas-overlay","overlay")}onLayoutComplete({series:{rect:t}}){const e=this.dataService.isLoading(),i=this.chartLike.series.some(c=>c.hasData),n=this.chartLike.series.some(c=>c.visible&&!$J.has(c.type));this.overlayElem.toggleClass(cJ,this.overlays.darkTheme),this.overlayElem.setProperty("left",`${t.x}px`),this.overlayElem.setProperty("top",`${t.y}px`),this.overlayElem.setProperty("width",`${t.width}px`),this.overlayElem.setProperty("height",`${t.height}px`);const s=e,a=!e&&!i,o=i&&!n,r=this.overlays.unsupportedBrowser.enabled&&YJ();s?this.showOverlay(this.overlays.loading,t):this.hideOverlay(this.overlays.loading),a?this.showOverlay(this.overlays.noData,t):this.hideOverlay(this.overlays.noData),o?this.showOverlay(this.overlays.noVisibleSeries,t):this.hideOverlay(this.overlays.noVisibleSeries),r?this.showOverlay(this.overlays.unsupportedBrowser,t):this.hideOverlay(this.overlays.unsupportedBrowser);const l=s||a||o||r;this.overlayElem.setAttr("aria-hidden",String(!l))}showOverlay(t,e){if(!t.enabled)return;const i=t.getElement(this.chartLike,this.animationManager,this.localeManager,e);this.overlayElem.appendChild(i)}hideOverlay(t){t.removeElement(()=>{this.overlayElem.innerText=" "},this.animationManager)}},jo=Gt.create(!0,"opts"),vi=class E3 extends vG{constructor(e,i){var n;super(),this.id=Nn(this),this.seriesRoot=new Ds({name:`${this.id}-series-root`,zIndex:pe.SERIES_LAYER}),this.annotationRoot=new Ds({name:`${this.id}-annotation-root`,zIndex:pe.SERIES_ANNOTATION}),this.titleGroup=new ee({name:"titles",zIndex:pe.SERIES_LABEL,renderToOffscreenCanvas:!0,optimizeForInfrequentRedraws:!0}),this.debug=Gt.create(!0,"chart"),this.extraDebugStats={},this.data=Sb.empty(),this._firstAutoSize=!0,this._autoSizeNotify=new dM,this._requiredRange=0,this._requiredRangeDirection=z.X,this.chartCaptions=new BD,this.padding=new zu(20),this.keyboard=new KD,this.touch=new O3,this.mode="standalone",this.withinStudio=void 0,this.styleNonce=void 0,this.formatter=void 0,this.suppressFieldDotNotation=!1,this.loadGoogleFonts=!1,this.dataIdKey=void 0,this.destroyed=!1,this.cleanup=new qe,this.chartAnimationPhase="initial",this.modulesManager=new lJ,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this.syncStatus="init",this.fireEventWrapper=g=>super.fireEvent(g),this.apiUpdate=!1,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new dM,this.performUpdateType=Ct.NONE,this.runningUpdateType=Ct.NONE,this.currentProcessingUpdateType=Ct.NONE,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new kZ,this.clearCallbackCacheOnUpdate=!1,this.updateRequestors={},this.performUpdateTrigger=RT(({count:g})=>{this.destroyed||this.updateMutex.acquire(this.tryPerformUpdate.bind(this,g)).catch(f=>pt.errorOnce(f))}),this._performUpdateSplits={},this._previousSplit=0,this.axes=this.createChartAxes(),this.series=[],this._cachedData=void 0,this.onSeriesNodeClick=g=>{this.fireEvent(g)},this.onSeriesNodeDoubleClick=g=>{this.fireEvent(g)},this.onSeriesVisibilityChange=g=>{this.fireEvent(g)},this.seriesGroupingChanged=g=>{if(!(g instanceof PN))return;const{series:f,seriesGrouping:y}=g;if(f.contentGroup.isRoot())return;const x=this.seriesLayerManager.changeGroup({internalId:f.internalId,type:f.type,contentGroup:f.contentGroup,bringToFront:()=>f.bringToFront(),renderToOffscreenCanvas:()=>f.renderToOffscreenCanvas(),seriesGrouping:y});x!=null&&f.attachSeries(x,this.seriesRoot,this.annotationRoot)},this.chartOptions=e;const s=i?.scene,a=i?.container??e.processedOptions.container??void 0,o=i?.styleContainer??e.specialOverrides.styleContainer,r=e.specialOverrides.skipCss;s&&(this._firstAutoSize=!1,this._lastAutoSize=[s.width,s.height,s.pixelRatio]);const l=new ee({name:"root"});l.visible=!1,l.append(this.seriesRoot),l.append(this.annotationRoot),l.append(this.titleGroup),this.titleGroup.append(this.title.node),this.titleGroup.append(this.subtitle.node),this.titleGroup.append(this.footnote.node);const c=new J4(e.specialOverrides.document,e.specialOverrides.window);this.tooltip=new Hr(c),this.seriesLayerManager=new _J(this.seriesRoot),this.mode=e.userOptions.mode??this.mode,this.styleNonce=e.processedOptions.styleNonce;const u=this.ctx=new dQ(this,{chartType:this.getChartType(),scene:s,root:l,container:a,styleContainer:o,skipCss:r,agDocument:c,domMode:e.optionMetadata.domMode,withDragInterpretation:e.optionMetadata.withDragInterpretation??!0,syncManager:new bQ(this),fireEvent:g=>this.fireEvent(g),updateMutex:this.updateMutex});e.optionMetadata.presetType==="sparkline"&&(u.highlightManager.unhighlightDelay=0,u.tooltipManager.removeDelay=0),this.cleanup.register(u.eventsHub.on("dom:resize",()=>this.parentResize(u.domManager.containerSize)),u.eventsHub.on("font:load",()=>{this.title.node.markDirty(),this.subtitle.node.markDirty(),this.footnote.node.markDirty(),this.update(Ct.PERFORM_LAYOUT)}),u.eventsHub.on("rtl:change",()=>{u.scene.setDirection(u.domManager.isRtl),this.update(Ct.PERFORM_LAYOUT)}),u.eventsHub.on("chart:request-update",g=>this.update(g.type,g.opts)),u.scene.on("scene-changed",()=>this.update(Ct.SCENE_RENDER))),u.scene.setDirection(u.domManager.isRtl),this.overlays=new im,(n=this.overlays.loading).renderer??(n.renderer=()=>hJ(u.agDocument,this.overlays.loading.getText(u.localeManager),u.animationManager.defaultDuration)),this.processors=[new FJ(this,u.eventsHub,u.dataService,u.updateService,u.zoomManager,u.animationManager),new XJ(this,this.overlays,u.eventsHub,u.dataService,u.localeManager,u.animationManager,u.domManager)],this.highlight=new WD,this.container=a;const d=this.getModuleContext();this.background=po.createBackground?.(d)??new tm(d),this.foreground=po.createForeground?.(d),this.seriesArea=new Ux(d),u.domManager.setDataBoolean("animating",!1),u.domManager.setDataNumber("animationTimeMs",0),this.seriesAreaManager=new L3(this.initSeriesAreaDependencies()),this.cleanup.register(u.layoutManager.registerElement(0,g=>{g.layoutBox.shrink(this.padding.toJson()),this.chartCaptions.positionCaptions(g)}),u.eventsHub.on("layout:complete",g=>this.chartCaptions.positionAbsoluteCaptions(g)),u.eventsHub.on("data:load",g=>{this.data=this.createDataSet(g.data)}),this.title.registerInteraction(d,"beforebegin"),this.subtitle.registerInteraction(d,"beforebegin"),this.footnote.registerInteraction(d,"afterend"),()=>this.title.destroy(),()=>this.subtitle.destroy(),()=>this.footnote.destroy(),this.ctx.agDocument.attachListener("pagehide",g=>{g.persisted||this.destroy()}),u.animationManager.addListener("animation-frame",()=>{this.update(Ct.SCENE_RENDER),u.domManager.setDataNumber("animationTimeMs",u.animationManager.getCumulativeAnimationTime())}),u.animationManager.addListener("animation-start",()=>u.domManager.setDataBoolean("animating",!0)),u.animationManager.addListener("animation-stop",()=>{u.domManager.setDataBoolean("animating",!1),u.domManager.setDataNumber("animationTimeMs",u.animationManager.getCumulativeAnimationTime())}),u.eventsHub.on("zoom:change-complete",()=>{const g=this.chartAnimationPhase==="initial";for(const f of this.series)f.animationState?.transition("updateData");if(g)for(const f of this.axes)f.resetAnimation(this.chartAnimationPhase);this.update(Ct.PERFORM_LAYOUT,{forceNodeDataRefresh:!0,skipAnimations:!g})})),this.parentResize(u.domManager.containerSize)}static getInstance(e){return E3.chartsInstances.get(e)}get canvasElement(){return this.ctx.scene.canvas.element}download(e,i){this.ctx.scene.download(e,i)}getCanvasDataURL(e){return this.ctx.scene.getDataURL(e)}toSVG(){return this.ctx.scene.toSVG()}get seriesAreaBoundingBox(){return this.seriesAreaManager.bbox}getOptions(){return this.queuedUserOptions.at(-1)??this.chartOptions.userOptions}getChartOptions(){return this.queuedChartOptions.at(-1)??this.chartOptions}isDataTransactionSupported(){return!0}createDataSet(e){return new Sb(e,this.dataIdKey)}overrideFocusVisible(e){this.seriesAreaManager.focusIndicator?.overrideFocusVisible(e)}fireEvent(e){js(this,this.fireEventWrapper,e)}initSeriesAreaDependencies(){const{ctx:e,tooltip:i,highlight:n,keyboard:s,overlays:a,seriesRoot:o,mode:r}=this,l=this.getChartType(),c=()=>this.hasViewportSupport(),u=()=>this.hasPgUpPgDownSupport(),d=this.fireEvent.bind(this);return{hasViewportSupport:c,hasPgUpPgDownSupport:u,fireEvent:d,getUpdateType:()=>this.performUpdateType,getTooltipContent:(y,x,S,D)=>this.getTooltipContent(y,x,S,D),chartType:l,ctx:e,tooltip:i,highlight:n,keyboard:s,overlays:a,seriesRoot:o,mode:r}}getModuleContext(){return this.ctx}getTooltipContent(e,i,n,s){const o=s==="aria-label"||e.properties.tooltip.enabled!==!1?e.getTooltipContent(i,n):void 0,r=o==null?[]:[o];if(this.tooltip.mode!=="shared"||this.series.length===1)return r;const l=e.getCategoryValue(i);return l==null?r:this.series.flatMap(c=>{if(c===e)return r;if(!c.isEnabled()||c.properties.tooltip.enabled===!1)return[];const u=c.datumIndexForCategoryValue(l),d=u==null?void 0:c.getTooltipContent(u,void 0);return d==null?[]:[d]})}getCaptionText(){return[this.title,this.subtitle,this.footnote].filter(e=>e.enabled&&e.text).map(e=>e.text).join(". ")}getAriaLabel(){return this.ctx.localeManager.t("ariaAnnounceChart",{seriesCount:this.series.length})}refreshSeriesUserVisibility(e,i){for(let n=0;n{if(!this.destroyed)try{await e(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}}).catch(i=>pt.errorOnce(i)))}clearCallbackCache(){this.ctx.callbackCache.invalidateCache();for(const e of this.series)e.resetDatumCallbackCache()}update(e=Ct.FULL,i){if(this.destroyed)return;const{forceNodeDataRefresh:n=!1,skipAnimations:s,seriesToUpdate:a=this.series,newAnimationBatch:o,apiUpdate:r=!1,clearCallbackCache:l=!1}=i??{};if(this.apiUpdate=r,this.ctx.widgets.seriesWidget.setDragTouchEnabled(this.touch.dragAction!=="none"),n)for(const c of this.series)c.markNodeDataDirty();for(const c of a)this.seriesToUpdate.add(c);if(s&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),o&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),(e===Ct.FULL||l)&&(this.clearCallbackCacheOnUpdate=!0),this.debug.check()){let c=new Error("Stack trace for update tracking").stack??"";c=c.replaceAll(/\([^)]*/g,""),this.updateRequestors[c]=e,this.currentProcessingUpdateType!==Ct.NONE&&this.currentProcessingUpdateType>=e&&this.debug.group(`Chart.update() - ⚠️ received update for earlier update stage ${Ct[e]} ⚠️`,()=>{this.debug(`Current processing update type: ${Ct[this.currentProcessingUpdateType]}`),this.debug("Update from: ",c)})}e0?"⚠️ redo #"+this.updateShortcutCount+" ⚠️ ":""}`;await this.debug.group(`Chart.performUpdate() ${i}`,async()=>{await this.performUpdate(e)})}catch(i){pt.error("update error",i,i.stack)}}async performUpdate(e){const{performUpdateType:i,extraDebugStats:n,_performUpdateSplits:s,ctx:a}=this,o=[...this.seriesToUpdate];switch(this.clearCallbackCacheOnUpdate&&(this.clearCallbackCacheOnUpdate=!1,this.clearCallbackCache()),this.performUpdateType=Ct.NONE,this.seriesToUpdate.clear(),this.runningUpdateType=i,this.currentProcessingUpdateType=i,this.updateShortcutCount===0&&ithis.chartAnimationPhase="ready")),this.ctx.scene.updateDebugFlags(),this.debug("Chart.performUpdate() - start",Ct[i]),this._previousSplit=performance.now(),s.start??(s.start=this._previousSplit),a.domManager.setDeferring(!0),i){case Ct.FULL:if(this.checkUpdateShortcut(Ct.FULL))break;this.ctx.updateService.dispatchPreDomUpdate(),this.updateDOM();case Ct.UPDATE_DATA:if(this.checkUpdateShortcut(Ct.UPDATE_DATA))break;this.updateData(),this.updateSplits("⬇️");case Ct.PROCESS_DATA:if(this.checkUpdateShortcut(Ct.PROCESS_DATA))break;if(await this.processData(),this.seriesAreaManager.dataChanged(),this.pendingLocaleText){const l=this.modulesManager.getModule("locale");l&&"localeText"in l&&(l.localeText=this.pendingLocaleText),this.pendingLocaleText=void 0}this.updateSplits("📊");case Ct.PROCESS_DOMAIN:if(this.checkUpdateShortcut(Ct.PROCESS_DOMAIN))break;await this.processDomains(),this.updateSplits("⛰️");case Ct.PROCESS_RANGE:if(this.checkUpdateShortcut(Ct.PROCESS_RANGE))break;this.processRanges(),this.updateSplits("📐");case Ct.PERFORM_LAYOUT:if(await this.checkFirstAutoSize(),this.checkUpdateShortcut(Ct.PERFORM_LAYOUT))break;await this.processLayout(),this.updateSplits("⌖");case Ct.PRE_SERIES_UPDATE:if(this.checkUpdateShortcut(Ct.PRE_SERIES_UPDATE))break;this.preSeriesUpdate(),this.updateSplits("❓");case Ct.SERIES_UPDATE:{if(this.checkUpdateShortcut(Ct.SERIES_UPDATE))break;this.seriesRoot.renderToOffscreenCanvas=this.highlight.drawingMode==="cutout",await this.updateSeries(o),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing(),this.updateSplits("🤔")}case Ct.PRE_SCENE_RENDER:if(this.checkUpdateShortcut(Ct.PRE_SCENE_RENDER))break;a.updateService.dispatchPreSceneRender(this.apiUpdate),a.scene.updateBaseFont(),this.updateSplits("↖");case Ct.SCENE_RENDER:if(this.checkUpdateShortcut(Ct.SCENE_RENDER))break;a.animationManager.endBatch(),n.updateShortcutCount=this.updateShortcutCount,a.scene.render({debugSplitTimes:s,extraDebugStats:n,seriesRect:this.seriesRect,debugColors:Gt.check("scene:stats","scene:stats:verbose")?this.getDebugColors():void 0}),this.extraDebugStats={};for(const l of Object.keys(s))delete s[l];this.ctx.domManager.incrementDataCounter("sceneRenders");case Ct.NONE:this.updateShortcutCount=0,this.updateRequestors={},this.currentProcessingUpdateType=Ct.NONE,this._performUpdateSkipAnimations=!1,a.animationManager.endBatch()}this.destroyed||(a.updateService.dispatchUpdateComplete(this.apiUpdate,this.updateShortcutCount>0),this.apiUpdate=!1,this.ctx.domManager.setDataBoolean("updatePending",!1),this.runningUpdateType=Ct.NONE,this.syncStatus="ready"),this._performUpdateNotify.notify(),a.domManager.setDeferring(!1);const r=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:_b(r-s.start),count:e,performUpdateType:Ct[i]})}updateThemeClassName(){const e="ag-charts-theme-",i=[`${e}default`,`${e}default-dark`];let n=i[0],s=!1,{theme:a}=this.chartOptions.processedOptions;for(;typeof a!="string"&&a!=null;)a=a.baseTheme;typeof a=="string"&&(n=a.replace("ag-",e),s=a.includes("-dark")),i.includes(n)||(n=s?i[1]:i[0]),this.ctx.domManager.setThemeClass(n)}updateDOM(){this.updateThemeClassName();const{enabled:e,tabIndex:i}=this.keyboard;this.ctx.domManager.setTabGuardIndex(e?i??0:-1),this.ctx.domManager.setThemeParameters(this.chartOptions.themeParameters)}updateAriaLabels(){this.ctx.domManager.updateCanvasLabel(this.getAriaLabel())}checkUpdateShortcut(e){return this.destroyed?!0:this.updateShortcutCount>3?(pt.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=e?(this.debug("Chart.checkUpdateShortcut() - BLOCKED AT: ",Ct[e]," BY REQUEST FOR: ",Ct[this.performUpdateType]),this.updateShortcutCount++,!0):(this.debug("Chart.checkUpdateShortcut() - PROCEEDING TO: ",Ct[e]),this.currentProcessingUpdateType=e,!1)}async checkFirstAutoSize(){this.width!=null&&this.height!=null||this._lastAutoSize||await this._autoSizeNotify.waitForCompletion(500)||this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}createChartAxes(){return new zD}onAxisChange(e,i){i==null&&e.length===0||this.ctx.axisManager.updateAxes(i??[],e)}onSeriesChange(e,i){const n=i?.filter(s=>!e.includes(s))??[];this.destroySeries(n),this.seriesLayerManager?.setSeriesCount(e.length);for(const s of e){if(i?.includes(s))continue;const a=this.seriesLayerManager.requestGroup(s);s.attachSeries(a,this.seriesRoot,this.annotationRoot),s.chart={},Object.defineProperty(s.chart,"mode",{get:()=>this.mode}),Object.defineProperty(s.chart,"isMiniChart",{get:()=>!1}),Object.defineProperty(s.chart,"flashOnUpdateEnabled",{get:()=>!!this.modulesManager.getModule("flashOnUpdate")?.enabled}),Object.defineProperty(s.chart,"seriesRect",{get:()=>this.seriesRect}),s.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(s)}this.seriesAreaManager?.seriesChanged(e)}destroySeries(e){if(e)for(const i of e)i.removeEventListener("seriesNodeClick",this.onSeriesNodeClick),i.removeEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),i.removeEventListener("groupingChanged",this.seriesGroupingChanged),i.destroy(),this.seriesLayerManager.releaseGroup(i),i.detachSeries(void 0,this.seriesRoot,this.annotationRoot),i.chart=void 0}addSeriesListeners(e){this.hasEventListener("seriesNodeClick")&&e.addEventListener("seriesNodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&e.addEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),this.hasEventListener("seriesVisibilityChange")&&e.addEventListener("seriesVisibilityChange",this.onSeriesVisibilityChange),e.addEventListener("groupingChanged",this.seriesGroupingChanged)}assignSeriesToAxes(){for(const e of this.axes){let i=function(n){return n.axes[e.direction]===e};e.boundSeries=this.series.filter(i)}}assignAxesToSeries(){for(const e of this.series)for(const i of e.directions){const n=e.getKeyAxis(i)??i,s=this.axes.findById(n);if(!s){pt.warnOnce(`no matching axis for direction [${i}] and id [${n}]; check series and axes configuration.`);return}e.axes[i]=s}}parentResize(e){if(e==null||this.width!=null&&this.height!=null)return;let{width:i,height:n}=e;const{pixelRatio:s}=e;if(i=Math.floor(i),n=Math.floor(n),i===0&&n===0)return;const[a=0,o=0,r=1]=this._lastAutoSize??[];a===i&&o===n&&r===s||(this._lastAutoSize=[i,n,s],this.resize("SizeMonitor",{}))}resize(e,i){const{scene:n,animationManager:s}=this.ctx,{inWidth:a,inHeight:o,inMinWidth:r,inMinHeight:l,inOverrideDevicePixelRatio:c}=i;this.ctx.domManager.setSizeOptions(r??this.minWidth,l??this.minHeight,a??this.width,o??this.height);const u=a??this.width??this._lastAutoSize?.[0],d=o??this.height??this._lastAutoSize?.[1],g=c??this.overrideDevicePixelRatio??this._lastAutoSize?.[2];if(this.debug(`Chart.resize() from ${e}`,{width:u,height:d,pixelRatio:g,stack:new Error("Stack trace for resize tracking").stack}),!(u==null||d==null||!Ae(u)||!Ae(d))&&n.resize(u,d,g)){s.reset();let f=!0;(this.width==null||this.height==null)&&this._firstAutoSize&&(f=!1,this._firstAutoSize=!1);let y=Ct.PERFORM_LAYOUT;for(const x of this.axes){const S=x.getUpdateTypeOnResize();Sn.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const e=new l3(this.mode,this.suppressFieldDotNotation,this.ctx.eventsHub),i=[];for(const n of this.series)i.push(n.processData(e)??Promise.resolve());for(const n of this.modulesManager.modules())n?.processData&&i.push(n.processData(e)??Promise.resolve());this._cachedData=e.execute(this._cachedData),this.updateSplits("🏭"),await Promise.all(i),this.updateLegends()}async processDomains(){for(const e of this.axes)e.processData();for(const e of this.series)e.updatedDomains()}processRanges(){var e;const i={},n={},s=new Map;this._requiredRangeDirection=z.X;for(const a of this.series)a.visible&&(i[e=a.type]??(i[e]=[]),a.getMinimumRangeSeries(i[a.type]),a.resolveKeyDirection(z.X)===z.Y&&(this._requiredRangeDirection=z.Y),s.has(a.type)||s.set(a.type,a));for(const[a,o]of s)n[a]=o.getMinimumRangeChart(i[a]);Object.keys(n).length===0?this._requiredRange=0:this._requiredRange=Math.ceil(Math.max(...Object.values(n)));for(const a of this.axes)a.requiredRange=this._requiredRange}updateLegends(e){for(const i of Ut.listModulesByType(Le.Plugin))switch(i.name){case"legend":this.setCategoryLegendData(e);break;case"gradientLegend":const n=this.modulesManager.getModule("gradientLegend");n.data=this.series.filter(s=>s.properties.showInLegend).flatMap(s=>s.getLegendData("gradient"));break}}setCategoryLegendData(e){const{legendManager:i,stateManager:n}=this.ctx;if(e)for(const a of this.series){const o=e.find(r=>r.seriesId===a.id);a.onLegendInitialState("category",o)}const s=this.series.flatMap(a=>{const o=a.getLegendData("category");return i.updateData(a.id,o),o});if(e){n.setStateAndRestore(i,e);return}if(this.mode!=="integrated"){const a={},o=new Map(this.series.map(r=>[r.id,r]));for(const{seriesId:r,symbol:{marker:l},label:c}of s.filter(u=>!u.hideInLegend)){if(l.fill==null)continue;const u=o.get(r);if(!u?.hasData)continue;const d=u.type,g=a[d]??(a[d]=new Map);g.has(c.text)?g.get(c.text)!==l.fill&&pt.warnOnce(`legend item '${ce(c.text)}' has multiple fill colours, this may cause unexpected behaviour.`):g.set(c.text,l.fill)}}i.update()}async processLayout(){const e=this.animationRect,{width:i,height:n}=this.ctx.scene,s=this.ctx.layoutManager.createContext(i,n);await this.performLayout(s),e&&!this.animationRect?.equals(e)&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)}getDebugColors(){const e=this.background.fill;if(e)try{const i=se.fromString(e),[n]=se.RGBtoOKLCH(i.r,i.g,i.b);return{background:e,foreground:n>.5?"black":"white"}}catch{return{background:e}}}preSeriesUpdate(){const{_requiredRange:e,seriesRect:i}=this;if(i==null)return;const n=this._requiredRangeDirection===z.X?i.width:i.height,s=e/n||0;this.ctx.updateService.dispatchPreSeriesUpdate(s,this._requiredRangeDirection,e)}async updateSeries(e){const{seriesRect:i}=this;function n(s){return s.update({seriesRect:i})}await Promise.all(e.map(n).filter(s=>s!=null)),this.ctx.seriesLabelLayoutManager.updateLabels(this.series.filter(s=>s.visible&&s.usesPlacedLabels),this.padding,this.seriesRect)}async waitForUpdate(e,i){const n=Ml("agChartsDebugTimeout");n==null?(e??(e=1e4),i??(i=!1)):(e=n,i??(i=!0));const s=performance.now();for(;(this._pendingFactoryUpdatesCount>0||this.performUpdateType!==Ct.NONE||this.runningUpdateType!==Ct.NONE||this.ctx.scene.waitingForUpdate()||this.data.hasPendingTransactions())&&!this.destroyed;){if(this._pendingFactoryUpdatesCount>0&&await this.updateMutex.waitForClearAcquireQueue(),(this.performUpdateType!==Ct.NONE||this.runningUpdateType!==Ct.NONE||this.data.hasPendingTransactions())&&await this._performUpdateNotify.waitForCompletion(),performance.now()-s>e){const a=`Chart.waitForUpdate() timeout of ${e} reached - first chart update taking too long.`;if(i)throw new Error(a);pt.warnOnce(a)}a4()&&await oN(),this.ctx.scene.waitingForUpdate()&&await oN(50)}}filterMiniChartSeries(e){return e?.filter(i=>i.showInMiniChart!==!1)}applyOptions(e){e.seriesWithUserVisibility&&this.refreshSeriesUserVisibility(this.chartOptions,e.seriesWithUserVisibility);const i=Ct.PERFORM_LAYOUT,n=this.firstApply?e.processedOptions:e.diffOptions(this.chartOptions);if(n==null||Object.keys(n).length===0){jo("Chart.applyOptions() - no delta, forcing re-layout",n),this.update(i,{apiUpdate:!0,newAnimationBatch:!0});return}const s=this.firstApply?{}:this.chartOptions.processedOptions,a=e.processedOptions;jo("Chart.applyOptions() - applying delta",n);const o=this.applyModules(),r=["type","data","series","listeners","preset","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","locale.localeText","axes","topology","nodes","initialState","styleContainer","formatter","displayNullData","enableRtl"];"listeners"in n&&this.registerListeners(this,n.listeners),"enableRtl"in n&&this.ctx.domManager.setEnableRtl(n.enableRtl),fb(this,n,{skip:r});let l=!1,c="no-op";n.series!=null&&(c=this.applySeries(this,n.series,s?.series),l=!0),c==="replaced"&&this.resetAnimations(),this.applyAxes(this,a,s,c,[])&&(l=!0);const{userDeltaKeys:u}=e,d=u===void 0||u.has("data");let g=!1;if(n.data&&d){const A=n.data,I=e.userOptions.data,N=Array.isArray(A)&&A!==I?A.slice():A;this.data=this.createDataSet(N),g=!0}if("dataIdKey"in n&&!(n.data&&d)&&this.data.dataIdKey!==this.dataIdKey&&(this.data=this.createDataSet(this.data.data),g=!0),c==="replaced"&&!g&&(this.data=this.createDataSet(this.data.data)),"legend"in n&&n.legend&&"listeners"in n.legend&&this.modulesManager.isEnabled("legend")){const A=n.legend.listeners;A?Object.assign(this.legend.listeners,A):this.legend.listeners.clear()}n.locale?.localeText&&(this.pendingLocaleText=n.locale?.localeText),this.chartOptions=e;const f=this.modulesManager.getModule("navigator");this.hasViewportSupport()||this.ctx.zoomManager.updateZoom({source:"chart-update",sourceDetail:"internal-applyOptions"},{x:{min:0,max:1}});const y=f?.miniChart,x=a.navigator?.miniChart?.series??a.series;y?.enabled===!0&&x!=null?this.applyMiniChartOptions(y,x,a,s):y?.enabled===!1&&(y.series=[],y.axes=[]),this.ctx.annotationManager.setAnnotationStyles(e.annotationThemes),l||(l=this.shouldForceNodeDataRefresh(n,c));const D=l||o?Ct.FULL:i;if(this.maybeResetAnimations(c),this.shouldClearLegendData(a,s,c)&&this.ctx.legendManager.clearData(),this.applyInitialState(a),this.ctx.formatManager.setFormatter(a.formatter),jo("Chart.applyOptions() - update type",Ct[D],{seriesStatus:c,forceNodeDataRefresh:l}),e.optionsProcessingTime!==void 0){this._performUpdateSplits["⚙️"]=e.optionsProcessingTime;const A=performance.now()-e.optionsProcessingTime;this._performUpdateSplits.start=A}this.update(D,{apiUpdate:!0,forceNodeDataRefresh:l,newAnimationBatch:!0,clearCallbackCache:!0}),this.firstApply=!1}applyInitialState(e){const{activeManager:i,annotationManager:n,chartTypeOriginator:s,historyManager:a,stateManager:o,zoomManager:r}=this.ctx,{initialState:l}=e;if("annotations"in e&&e.annotations?.enabled&&l?.annotations!=null){const c=l.annotations.map(u=>{const d=n.getAnnotationTypeStyles(u.type);return Et(u,d)});o.setState(n,c)}l?.chartType!=null&&o.setState(s,l.chartType),this.needsViewportSupport(e)&&l?.zoom!=null&&o.setState(r,l.zoom),l?.active!=null&&o.setState(i,l.active),l?.legend!=null&&this.updateLegends(l.legend),l!=null&&a.clear()}maybeResetAnimations(e){if(this.mode==="standalone")switch(e){case"series-grouping-change":case"replaced":this.resetAnimations();break}}shouldForceNodeDataRefresh(e,i){const n=!!e.data||i==="data-change"||i==="replaced",s=["legend","gradientLegend"].some(o=>e[o]!=null),a=e.title!=null&&e.subtitle!=null||e.formatter!=null;return n||s||a}shouldClearLegendData(e,i,n){const s=n==="replaced"||n==="series-count-changed"||n==="series-grouping-change"||n==="updated"&&(e.series?.length!==i.series?.length||!e.series?.every((o,r)=>o.type===i.series?.[r].type)),a=i.legend!=null&&i.legend.enabled!==!1&&(e.legend==null||e.legend.enabled===!1);return s||a}applyMiniChartOptions(e,i,n,s){const a=s?.navigator?.miniChart?.series??s?.series,o=this.applySeries(e,this.filterMiniChartSeries(i),this.filterMiniChartSeries(a));this.applyAxes(e,n,s,o,["tick","thickness","title","crosshair","gridLine","label"]);const r=e.series;for(const u of r)u.properties.id=void 0;const l=e.axes,c=l.find(u=>u.direction===z.X);for(const u of l)u.nice=!1,u.gridLine.enabled=!1,u.label.enabled=u===c,u.tick.enabled=!1,u.interactionEnabled=!1;if(c!=null){const u=n.navigator?.miniChart,d=u?.label,g=u?.label?.interval;if(c.line.enabled=!1,c.label.set(At(d,["interval","autoRotate","autoRotateAngle","itemStyler","minSpacing","rotation"])),c.type==="grouped-category"){c.label.enabled=!1,c.label.rotation=0;const{depthOptions:f}=c;if(f.length===0)f.set([{label:{enabled:!0}}]);else for(let y=1;ythis.createSeries(g));return this.initSeriesDeclarationOrder(d),e.series=d,"replaced"}jo("Chart.applySeries() - matchResult",s);const a=[];let o=!1,r=!1,l=!1,c=!1;const u=s.changes.toSorted((d,g)=>d.targetIdx-g.targetIdx);for(const d of u)switch(r||(r=d.status==="series-grouping"),o||(o=d.diff?.data!=null),l||(l=d.status!=="no-op"),c||(c=d.status==="add"||d.status==="remove"),d.status){case"add":{const g=this.createSeries(d.opts);a.push(g),jo("Chart.applySeries() - created new series",g);break}case"remove":jo(`Chart.applySeries() - removing series at previous idx ${d.idx}`,d.series);break;case"no-op":a.push(d.series),jo(`Chart.applySeries() - no change to series at previous idx ${d.idx}`,d.series);break;default:{const{series:g,diff:f,idx:y}=d;jo(`Chart.applySeries() - applying series diff previous idx ${y}`,f,g),this.applySeriesValues(g,f),g.markNodeDataDirty(),a.push(g)}}return this.initSeriesDeclarationOrder(a),jo("Chart.applySeries() - final series instances",a),e.series=a,r?"series-grouping-change":c?"series-count-changed":o?"data-change":l?"updated":"no-op"}applyAxes(e,i,n,s,a=[]){if(!("axes"in i)||!i.axes)return!1;a=["type",...a];const o=i.axes;if(!(s==="replaced")&&e.axes.matches(o)&&rJ(n)){for(const c of e.axes){const u=n.axes?.[c.id]??{},d=or(u,o[c.id]);jo(`Chart.applyAxes() - applying axis diff idx ${c.id}`,d),fb(c,d,{skip:a})}return!0}return jo(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${s}`),e.axes=this.createAxes(o,a),!0}createSeries(e){const n=Ut.getSeriesModule(e.type).create(this.getModuleContext());return this.applySeriesOptionModules(n,e),this.applySeriesValues(n,e),n}applySeriesOptionModules(e,i){const n=e.createModuleContext(),s=e.getModuleMap();for(const a of Ut.listModulesByType(Le.SeriesPlugin))a.name in i&&(a.seriesTypes?.includes(e.type)??!0)&&s.addModule(a.name,a.create(n))}applySeriesValues(e,i){const n=e.getModuleMap(),{type:s,data:a,listeners:o,seriesGrouping:r,showInMiniChart:l,...c}=i;for(const u of Ut.listModulesByType(Le.SeriesPlugin))if(u.name in c){const d=n.getModule(u.name);if(d){const g=c[u.name];d.properties.set(g),delete c[u.name]}}c.visible!=null&&(e.visible=c.visible),e.properties.set(c),"data"in i&&e.setOptionsData(a==null?void 0:Sb.wrap(a)),"listeners"in i&&(this.registerListeners(e,o),this.series.includes(e)&&this.addSeriesListeners(e)),"seriesGrouping"in i&&(r==null?e.seriesGrouping=void 0:e.seriesGrouping={...e.seriesGrouping,...r})}createAxes(e,i){const n=this.createChartAxes(),s=this.getModuleContext();for(const[a,o]of Xe(e)){const r=Ut.getAxisModule(o.type).create(s);r.id=a,this.applyAxisModules(r,o),fb(r,o,{skip:i}),n.push(r)}return sJ(n),n}applyAxisModules(e,i){const n=e.createModuleContext(),s=e.getModuleMap();for(const a of Ut.listModulesByType(Le.AxisPlugin)){const o=i[a.name]!=null;o!==s.isEnabled(a.name)&&(o?(s.addModule(a.name,a.create(n)),e[a.name]=s.getModule(a.name)):(s.removeModule(a.name),delete e[a.name]))}}registerListeners(e,i){if(e.clearEventListeners(),i&&typeof i=="object")for(const[n,s]of Xe(i))s!=null&&e.addEventListener(n,s)}async applyTransaction(e){await this.updateMutex.acquire(()=>{this.data.addTransaction(e),this.update(Ct.UPDATE_DATA,{apiUpdate:!0,skipAnimations:!0})}),await this.waitForUpdate()}onSyncActiveClear(){this.seriesAreaManager.onActiveClear()}needsViewportSupport(e){return!!e.navigator?.enabled||!!e.zoom?.enabled||!!e.scrollbar?.enabled}hasViewportSupport(){return this.needsViewportSupport({navigator:this.modulesManager.getModule("navigator"),zoom:this.modulesManager.getModule("zoom"),scrollbar:this.modulesManager.getModule("scrollbar")})}hasPgUpPgDownSupport(){return!0}};vi.className="Chart";vi.chartsInstances=new WeakMap;T([Pe({newValue(t){this.destroyed||(this.ctx.domManager.setContainer(t),vi.chartsInstances.set(t,this))},oldValue(t){vi.chartsInstances.delete(t)}})],vi.prototype,"container",2);T([Pe({newValue(t){this.resize("width option",{inWidth:t})}})],vi.prototype,"width",2);T([Pe({newValue(t){this.resize("height option",{inHeight:t})}})],vi.prototype,"height",2);T([Pe({newValue(t){this.resize("minWidth option",{inMinWidth:t})}})],vi.prototype,"minWidth",2);T([Pe({newValue(t){this.resize("minHeight option",{inMinHeight:t})}})],vi.prototype,"minHeight",2);T([Pe({newValue(t){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:t})}})],vi.prototype,"overrideDevicePixelRatio",2);T([b],vi.prototype,"padding",2);T([b],vi.prototype,"keyboard",2);T([b],vi.prototype,"touch",2);T([b],vi.prototype,"mode",2);T([b],vi.prototype,"withinStudio",2);T([b],vi.prototype,"styleNonce",2);T([qi("chartCaptions.title")],vi.prototype,"title",2);T([qi("chartCaptions.subtitle")],vi.prototype,"subtitle",2);T([qi("chartCaptions.footnote")],vi.prototype,"footnote",2);T([b],vi.prototype,"formatter",2);T([b],vi.prototype,"suppressFieldDotNotation",2);T([b],vi.prototype,"loadGoogleFonts",2);T([b],vi.prototype,"dataIdKey",2);T([Pe({changeValue(t,e){this.onAxisChange(t,e)}})],vi.prototype,"axes",2);T([Pe({changeValue(t,e){this.onSeriesChange(t,e)}})],vi.prototype,"series",2);var QD=vi;function R3(t){return t?.up||t?.down||t?.neutral?"user-full":t?.fills||t?.strokes?"user-indexed":"inbuilt"}var un={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},pc={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},EC="white",ZJ={"radial-gauge":!0,"linear-gauge":!0};function Eg(t){return{$some:[{$and:[{$or:[{$isSeriesType:"line"},{$isSeriesType:"scatter"},{$isSeriesType:"area"},{$isSeriesType:"radar"},{$isSeriesType:"rangeArea"}]},{$isUserOption:[`/series/$index/${t}`,{$lessThan:[{$path:`/series/$index/${t}`},1]},!1]}]},{$path:"/series"}]}}function qJ(t){return ZJ[t]===!0}var so=class Gg{static getDefaultColors(){return{fills:un,fillsFallback:Object.values(un),strokes:pc,sequentialColors:So(un),divergingColors:[un.ORANGE,un.YELLOW,un.GREEN],hierarchyColors:["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"],secondSequentialColors:se.interpolate([se.fromHexString(un.BLUE),se.fromHexString("#cbdef5")],8).map(e=>e.toString()),secondDivergingColors:[un.GREEN,un.YELLOW,un.RED],secondHierarchyColors:["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"],up:{fill:un.GREEN,stroke:pc.GREEN},down:{fill:un.RED,stroke:pc.RED},neutral:{fill:un.GRAY,stroke:pc.GRAY},altUp:{fill:un.BLUE,stroke:pc.BLUE},altDown:{fill:un.ORANGE,stroke:pc.ORANGE},altNeutral:{fill:un.GRAY,stroke:pc.GRAY}}}static getDefaultPublicParameters(){return{accentColor:"#2196f3",axisColor:{$foregroundBackgroundMix:.325},backgroundColor:EC,borderColor:{$foregroundOpacity:.15},borderRadius:4,chartBackgroundColor:{$ref:"backgroundColor"},chartPadding:20,focusShadow:"0 0 0 3px var(--ag-charts-accent-color)",foregroundColor:"#181d1f",fontFamily:"Verdana, sans-serif",fontSize:Wh,fontWeight:400,gridLineColor:{$foregroundBackgroundMix:.1},popupShadow:"0 0 16px rgba(0, 0, 0, 0.15)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.38]},textColor:{$ref:"foregroundColor"},chromeBackgroundColor:{$foregroundBackgroundMix:.02},chromeFontFamily:{$ref:"fontFamily"},chromeFontSize:{$ref:"fontSize"},chromeFontWeight:{$ref:"fontWeight"},chromeTextColor:{$ref:"foregroundColor"},chromeSubtleTextColor:{$mix:[{$ref:"chromeTextColor"},{$ref:"backgroundColor"},.38]},buttonBackgroundColor:{$ref:"backgroundColor"},buttonBorder:!0,buttonFontWeight:400,buttonTextColor:{$ref:"textColor"},inputBackgroundColor:{$ref:"backgroundColor"},inputBorder:!0,inputTextColor:{$ref:"textColor"},menuBackgroundColor:{$ref:"chromeBackgroundColor"},menuBorder:!0,menuTextColor:{$ref:"chromeTextColor"},panelBackgroundColor:{$ref:"chromeBackgroundColor"},panelSubtleTextColor:{$ref:"chromeSubtleTextColor"},tooltipBackgroundColor:{$ref:"chromeBackgroundColor"},tooltipBorder:!0,tooltipTextColor:{$ref:"chromeTextColor"},tooltipSubtleTextColor:{$ref:"chromeSubtleTextColor"},crosshairLabelBackgroundColor:{$ref:"foregroundColor"},crosshairLabelTextColor:{$ref:"chartBackgroundColor"},separationLinesColor:{$foregroundBackgroundMix:.17}}}static getPrivateParameters(){return{focusColor:{$mix:[{$ref:"backgroundColor"},{$ref:"accentColor"},.12]}}}static getAxisDefaults({title:e,time:i},n){return Et(n,e&&{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Cn.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},i&&{parentLevel:{enabled:!1,label:{enabled:{$path:"../../label/enabled"},border:{enabled:{$or:[{$isUserOption:["../border",!0,!1]},{$path:"../../../label/border/enabled"}]},strokeWidth:{$path:"../../../label/border/strokeWidth"},stroke:{$path:"../../../label/border/stroke"}},fill:{$path:"../../label/fill"},fontSize:{$path:"../../label/fontSize"},fontFamily:{$path:"../../label/fontFamily"},fontWeight:"bold",spacing:{$path:"../../label/spacing"},color:{$path:"../../label/color"},cornerRadius:{$path:"../../label/cornerRadius"},padding:{$path:"../../label/padding"},avoidCollisions:{$path:"../../label/avoidCollisions"}},tick:{enabled:{$path:"../../tick/enabled"},width:{$path:"../../tick/width"},size:{$path:"../../tick/size"},stroke:{$path:"../../tick/stroke"}}}},{label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:11,color:{$ref:"textColor"},avoidCollisions:!0,cornerRadius:4,border:{enabled:!1,strokeWidth:1,stroke:{$foregroundOpacity:.08}},padding:{$if:[{$path:"./border/enabled"},{left:12,right:12,top:8,bottom:8},5]}},line:{enabled:!0,width:1,stroke:{$ref:"axisColor"}},tick:{enabled:!1,size:6,width:1,stroke:{$ref:"axisColor"}},gridLine:{enabled:!0,width:1,style:{$apply:[{fillOpacity:1,stroke:{$ref:"gridLineColor"},strokeWidth:{$path:"../../width"},lineDash:[]},[{fillOpacity:1,stroke:{$ref:"gridLineColor"},strokeWidth:{$path:"../../width"},lineDash:[]}]]}},crossLines:{$apply:[{enabled:!0,fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},fillOpacity:.08,strokeWidth:1,label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:{$if:[{$path:"./border/enabled"},{left:12,right:12,top:8,bottom:8},5]},color:{$ref:"textColor"},cornerRadius:4,border:{enabled:!1,stroke:{$foregroundOpacity:.08},strokeOpacity:1,strokeWidth:1}}},void 0,{$pathString:["/common/axes/$axisType/crossLines",{axisType:{$path:["../type"]}}]},{$pathString:["/$seriesType/axes/$axisType/crossLines",{seriesType:{$path:["/series/0/type","line"]},axisType:{$path:["../type"]}}]}]}})}getChartDefaults(){return{minHeight:300,minWidth:300,background:{visible:!0,fill:{$ref:"chartBackgroundColor"}},padding:{top:{$ref:"chartPadding"},right:{$ref:"chartPadding"},bottom:{$ref:"chartPadding"},left:{$ref:"chartPadding"}},seriesArea:{border:{enabled:!1,stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:1},cornerRadius:4,padding:{$if:[{$path:"./border/enabled"},5,0]}},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",spacing:{$if:[{$path:"../subtitle/enabled"},10,20]},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Cn.LARGEST},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:qh,textAlign:Qh},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Cn.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:qh,textAlign:Qh},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:Cn.MEDIUM},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:qh,textAlign:Qh},highlight:{enabled:!0,drawingMode:{$if:[{$or:[Eg("highlight/highlightedItem/opacity"),Eg("highlight/unhighlightedItem/opacity"),Eg("highlight/highlightedSeries/opacity"),Eg("highlight/unhighlightedSeries/opacity"),Eg("fillOpacity"),Eg("marker/fillOpacity")]},"overlap","cutout"]}},tooltip:{enabled:!0,darkTheme:Qd,delay:0,pagination:!1,mode:{$if:[{$or:[{$and:[{$isChartType:"cartesian"},{$not:{$hasSeriesType:"bubble"}},{$not:{$hasSeriesType:"scatter"}},{$greaterThan:[{$size:{$path:"/series"}},1]},{$lessThan:[{$size:{$path:"/series"}},4]}]},{$and:[{$isChartType:"polar"},{$greaterThan:[{$size:{$path:"/series"}},1]},{$lessThan:[{$size:{$path:"/series"}},4]}]}]},"shared","single"]}},overlays:{darkTheme:Qd},listeners:{},series:{tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","exact"]},"area"]},"exact",{$path:["/tooltip/range","exact"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","pointer"]},placement:{$path:["/tooltip/position/placement",void 0]},xOffset:{$path:["/tooltip/position/xOffset",0]},yOffset:{$path:["/tooltip/position/yOffset",0]}}}}}}constructor(e={}){const{overrides:i,palette:n,params:s}=le(e),a=this.createChartConfigPerChartType(this.getDefaults()),o={};i&&this.processOverrides(o,i);const{fills:r,strokes:l,sequentialColors:c,...u}=this.getDefaultColors();this.palette=za(Et(n,{fills:Object.values(r),strokes:Object.values(l),sequentialColors:Object.values(c),...u})),this.paletteType=R3(n),this.params=Et(s,this.getThemeParameters()),this.config=za(le(a)),this.overrides=za(i),this.presets=za(o)}processOverrides(e,i){for(const n of Ut.listModulesByType(Le.Series)){const s=n.name,a=i[s];qJ(s)&&(e[s]=a,delete i[s])}}createChartConfigPerChartType(e){var i;for(const n of Ut.listModulesByType(Le.Chart))for(const s of Ut.listModulesByType(Le.Series))s.chartType===n.name&&(e[i=s.name]??(e[i]=n.themeTemplate));return e}getDefaults(){const e=(s,a)=>{const o={},r=Et({axes:{}},...Array.from(Ut.listModulesByType(Le.Plugin),l=>({[l.name]:l.themeTemplate})),Ut.getChartModule(s)?.themeTemplate,this.getChartDefaults());for(const l of a){o[l]=Et(JJ(l),o[l]??r);const{axes:c}=o[l];for(const u of Ut.listModulesByType(Le.Axis))c[u.name]=Et(c[u.name],!u.chartType||u.chartType===s?QJ(u.name):null,Gg.axisDefault[u.name]);(l==="map-shape-background"||l==="map-line-background")&&delete o[l].series.tooltip}return o},i=[...Ut.listModulesByType(Le.Series)],n=px(i,s=>s.chartType||"unknown");return Et(...Object.keys(n).map(s=>e(s,n[s]?.map(a=>a.name)??[])))}static applyTemplateTheme(e,i,n){if(qt(e))for(let s=0;so.enterprise?"enterprise":"community");if(n.length){const o=Ut.isEnterprise()||a.enterprise?.length?"enterprise":"community";pt.errorOnce(["required modules are not registered. Check if you have registered the modules:","",Ut.isUmd()?"Install and register 'ag-charts-enterprise' before creating the chart.":stt(n.map(itt),o),"",`See ${s} for more details.`].join(` +`))}}function itt(t){return t.moduleId??t.name}function P3(t){return` ${t},`}function ntt(t,e){return t.length?`import { +${t.map(P3).join(` +`)} +} from 'ag-charts-${e}';`:null}function stt(t,e){const i=ntt(["ModuleRegistry"].concat(t),e),n=t.map(P3).join(` +`);return`${i} + +ModuleRegistry.registerModules([ +${n} +]);`}function att(t,e){const i=new Map,n="axes"in e&&Bt(e.axes)?e.axes:{},s=new Set(Object.values(n).map(r=>r?.type).filter(go)),a=new Set(e.series?.map(r=>r.type).filter(go));function o(r){i.set(r.name,r)}for(const r of iu.values())if(!Ut.hasModule(r.name)&&!ttt.has(r.name)&&!(t&&r.chartType&&t!==r.chartType))switch(r.type){case"chart":break;case"axis":if(s.has(r.name)){for(const u of Object.keys(n))n?.[u].type===r.name&&delete n[u];o(r)}break;case"series":a.has(r.name)&&(e.series=e.series.filter(u=>u.type!==r.name),o(r));break;case"plugin":const l=r.name,c=e[l];Bt(c)&&(c.enabled!==!1&&o(r),delete e[l]);break;case"axis:plugin":for(const u of Object.values(n)){const d=r.name;u?.[d]&&(u[d].enabled!==!1&&o(r),delete u[d])}break;case"series:plugin":for(const u of e.series??[])u[r.name]&&(delete u[r.name],o(r));break}for(const r of a){const l=iu.get(r);l?.type===Le.Series&&!Ut.hasModule(l.name)&&!i.has(l.name)&&(e.series=e.series.filter(c=>c.type!==l.name),o(l))}return Array.from(i.values())}function jB(t,e){const i="axes"in e&&Bt(e.axes),n="series"in e&&qt(e.series),s=o=>t==null||!o.chartType||o.chartType===t,a=[];for(const o of Ut.listModules())if(Ut.isModuleType(Le.Plugin,o))s(o)||(delete e[o.name],a.push(o.name));else if(Ut.isModuleType(Le.AxisPlugin,o)){if(i&&!s(o)){for(const r of Object.values(e.axes))delete r[o.name];a.push(o.name)}}else if(Ut.isModuleType(Le.SeriesPlugin,o)&&n&&!s(o)){for(const r of e.series)delete r[o.name];a.push(o.name)}return a}var RC="#192232",us={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},vd={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},sm=class extends Pr{getDefaultColors(){return{fills:us,fillsFallback:Object.values(us),strokes:vd,sequentialColors:So(us),divergingColors:[us.ORANGE,us.YELLOW,us.GREEN],hierarchyColors:["#192834","#253746","#324859","#3f596c","#4d6a80"],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[us.GREEN,us.YELLOW,us.RED],secondHierarchyColors:["#192834","#3b5164","#496275","#577287","#668399"],up:{fill:us.GREEN,stroke:vd.GREEN},down:{fill:us.RED,stroke:vd.RED},neutral:{fill:us.GRAY,stroke:vd.GRAY},altUp:{fill:us.BLUE,stroke:vd.BLUE},altDown:{fill:us.ORANGE,stroke:vd.ORANGE},altNeutral:{fill:us.GRAY,stroke:vd.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),axisColor:{$foregroundBackgroundMix:.737},backgroundColor:RC,borderColor:{$foregroundBackgroundMix:.216},chromeBackgroundColor:{$foregroundBackgroundMix:.07},focusColor:{$mix:[{$ref:"backgroundColor"},{$ref:"accentColor"},.22]},foregroundColor:"#fff",gridLineColor:{$foregroundBackgroundMix:.257},popupShadow:"0 0 16px rgba(0, 0, 0, 0.33)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.57]},separationLinesColor:{$foregroundBackgroundMix:.44},crosshairLabelBackgroundColor:{$foregroundBackgroundMix:.65}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Qd,!0),t.set(xD,RC),t.set(ra,us.BLUE),t.set(SD,"#fff"),t.set(Ws,us.BLUE),t.set(vx,RC),t.set(Sx,"#28313e"),t.set(Mx,"#4b525d"),t.set(Dx,"#fff"),t.set(Ax,"#fff"),t.set(Ix,"#28313e"),t.set(kx,"#4b525d"),t.set(Cx,"#fff"),t}constructor(t){super(t)}},va={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},Sd={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},ott=class extends sm{getDefaultColors(){return{...super.getDefaultColors(),fills:{...va},fillsFallback:Object.values({...va}),strokes:{...Sd},sequentialColors:So(va),divergingColors:[va.GREEN,va.BLUE,va.RED],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],up:{fill:va.GREEN,stroke:Sd.GREEN},down:{fill:va.RED,stroke:Sd.RED},neutral:{fill:va.BLUE,stroke:Sd.BLUE},altUp:{fill:va.GREEN,stroke:Sd.GREEN},altDown:{fill:va.RED,stroke:Sd.RED},altNeutral:{fill:va.GRAY,stroke:Sd.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.12}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(ra,va.BLUE),t.set(Ws,va.BLUE),t.set(qh,"overlay"),t.set(Qh,"left"),t.set(wx,"bottom"),t}},Sa={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},Md={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},rtt=class extends Pr{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Sa},fillsFallback:Object.values({...Sa}),strokes:{...Md},sequentialColors:So(Sa),divergingColors:[Sa.GREEN,Sa.BLUE,Sa.RED],up:{fill:Sa.GREEN,stroke:Md.GREEN},down:{fill:Sa.RED,stroke:Md.RED},neutral:{fill:Sa.BLUE,stroke:Md.BLUE},altUp:{fill:Sa.GREEN,stroke:Md.GREEN},altDown:{fill:Sa.RED,stroke:Md.RED},altNeutral:{fill:Sa.GRAY,stroke:Md.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.06}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(ra,Sa.BLUE),t.set(Ws,Sa.BLUE),t.set(qh,"overlay"),t.set(Qh,"left"),t.set(wx,"bottom"),t}},ds={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Dd={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},ltt=class extends sm{getDefaultColors(){return{...super.getDefaultColors(),fills:ds,fillsFallback:Object.values(ds),strokes:Dd,sequentialColors:So(ds),divergingColors:[ds.ORANGE,ds.YELLOW,ds.GREEN],secondSequentialColors:["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"],secondDivergingColors:[ds.GREEN,ds.YELLOW,ds.RED],up:{fill:ds.GREEN,stroke:Dd.GREEN},down:{fill:ds.RED,stroke:Dd.RED},neutral:{fill:ds.GRAY,stroke:Dd.GRAY},altUp:{fill:ds.BLUE,stroke:Dd.BLUE},altDown:{fill:ds.RED,stroke:Dd.RED},altNeutral:{fill:ds.GRAY,stroke:Dd.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(ra,ds.BLUE),t.set(Ws,ds.BLUE),t}},ps={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Ad={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},ctt=class extends Pr{getDefaultColors(){return{...super.getDefaultColors(),fills:ps,fillsFallback:Object.values(ps),strokes:Ad,sequentialColors:So(ps),divergingColors:[ps.ORANGE,ps.YELLOW,ps.GREEN],secondSequentialColors:["#2196f3","#329EF4","#42a5f5","#53ADF6","#64b5f6","#7AC0F8","#90caf9"],secondDivergingColors:[ps.GREEN,ps.YELLOW,ps.RED],up:{fill:ps.GREEN,stroke:Ad.GREEN},down:{fill:ps.RED,stroke:Ad.RED},neutral:{fill:ps.GRAY,stroke:Ad.GRAY},altUp:{fill:ps.BLUE,stroke:Ad.BLUE},altDown:{fill:ps.RED,stroke:Ad.RED},altNeutral:{fill:ps.GRAY,stroke:Ad.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(ra,ps.BLUE),t.set(Ws,ps.BLUE),t}},Gi={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Id={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},htt=class extends sm{getDefaultColors(){return{fills:Gi,fillsFallback:Object.values(Gi),strokes:Id,sequentialColors:So(Gi),divergingColors:[Gi.BLUE,Gi.RED],hierarchyColors:[],secondSequentialColors:[Gi.BLUE,Gi.PURPLE,Gi.MAGENTA,Gi.PINK,Gi.RED,Gi.ORANGE,Gi.YELLOW,Gi.GREEN],secondDivergingColors:[Gi.BLUE,Gi.RED],secondHierarchyColors:[],up:{fill:Gi.GREEN,stroke:Id.GREEN},down:{fill:Gi.RED,stroke:Id.RED},neutral:{fill:Gi.GRAY,stroke:Id.GRAY},altUp:{fill:Gi.BLUE,stroke:Id.BLUE},altDown:{fill:Gi.RED,stroke:Id.RED},altNeutral:{fill:Gi.GRAY,stroke:Id.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(ra,Gi.BLUE),t.set(Ws,Gi.BLUE),t}},Ui={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},kd={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},utt=class extends Pr{getDefaultColors(){return{...super.getDefaultColors(),fills:Ui,fillsFallback:Object.values(Ui),strokes:kd,sequentialColors:So(Ui),divergingColors:[Ui.BLUE,Ui.RED],hierarchyColors:[],secondSequentialColors:[Ui.BLUE,Ui.PURPLE,Ui.MAGENTA,Ui.PINK,Ui.RED,Ui.ORANGE,Ui.YELLOW,Ui.GREEN],secondDivergingColors:[Ui.BLUE,Ui.RED],secondHierarchyColors:[],up:{fill:Ui.GREEN,stroke:kd.GREEN},down:{fill:Ui.RED,stroke:kd.RED},neutral:{fill:Ui.GRAY,stroke:kd.GRAY},altUp:{fill:Ui.BLUE,stroke:kd.BLUE},altDown:{fill:Ui.RED,stroke:kd.RED},altNeutral:{fill:Ui.GRAY,stroke:kd.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(ra,Ui.BLUE),t.set(Ws,Ui.BLUE),t}},In={BLUE:"#4472C4",ORANGE:"#ED7D31",GRAY:"#A5A5A5",YELLOW:"#FFC000",MODERATE_BLUE:"#5B9BD5",GREEN:"#70AD47",DARK_GRAY:"#7B7B7B",DARK_BLUE:"#264478",VERY_DARK_GRAY:"#636363",DARK_YELLOW:"#997300"},Oh={BLUE:"#6899ee",ORANGE:"#ffa55d",GRAY:"#cdcdcd",YELLOW:"#ffea53",MODERATE_BLUE:"#82c3ff",GREEN:"#96d56f",DARK_GRAY:"#a1a1a1",DARK_BLUE:"#47689f",VERY_DARK_GRAY:"#878787",DARK_YELLOW:"#c0993d"},dtt=class extends sm{getDefaultColors(){return{...super.getDefaultColors(),fills:{...In,RED:In.ORANGE},fillsFallback:Object.values({...In,RED:In.ORANGE}),strokes:{...Oh,RED:Oh.ORANGE},sequentialColors:So({...In,RED:In.ORANGE}),divergingColors:[In.ORANGE,In.YELLOW,In.GREEN],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[In.GREEN,In.YELLOW,In.ORANGE],up:{fill:In.GREEN,stroke:Oh.GREEN},down:{fill:In.ORANGE,stroke:Oh.ORANGE},neutral:{fill:In.GRAY,stroke:Oh.GRAY},altUp:{fill:In.BLUE,stroke:Oh.BLUE},altDown:{fill:In.ORANGE,stroke:Oh.ORANGE},altNeutral:{fill:In.GRAY,stroke:Oh.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(ra,In.BLUE),t.set(Ws,In.BLUE),t}},Vn={BLUE:"#5281d5",ORANGE:"#ff8d44",GRAY:"#b5b5b5",YELLOW:"#ffd02f",MODERATE_BLUE:"#6aabe6",GREEN:"#7fbd57",DARK_GRAY:"#8a8a8a",DARK_BLUE:"#335287",VERY_DARK_GRAY:"#717171",DARK_YELLOW:"#a98220"},hc={BLUE:"#214d9b",ORANGE:"#c25600",GRAY:"#7f7f7f",YELLOW:"#d59800",MODERATE_BLUE:"#3575ac",GREEN:"#4b861a",DARK_GRAY:"#575757",DARK_BLUE:"#062253",VERY_DARK_GRAY:"#414141",DARK_YELLOW:"#734f00"},ptt=class extends Pr{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Vn,RED:Vn.ORANGE},fillsFallback:Object.values({...Vn,RED:Vn.ORANGE}),strokes:{...hc,RED:hc.ORANGE},sequentialColors:So({...Vn,RED:Vn.ORANGE}),divergingColors:[Vn.ORANGE,Vn.YELLOW,Vn.GREEN],secondSequentialColors:["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"],secondDivergingColors:[Vn.GREEN,Vn.YELLOW,Vn.ORANGE],secondHierarchyColors:[],up:{fill:Vn.GREEN,stroke:hc.GREEN},down:{fill:Vn.ORANGE,stroke:hc.ORANGE},neutral:{fill:hc.GRAY,stroke:hc.GRAY},altUp:{fill:Vn.BLUE,stroke:hc.BLUE},altDown:{fill:Vn.ORANGE,stroke:hc.ORANGE},altNeutral:{fill:Vn.GRAY,stroke:hc.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(ra,Vn.BLUE),t.set(Ws,Vn.BLUE),t}},Rf={enabled:J,text:K,padding:Ar,border:Zd,cornerRadius:gt,...De,...wt},Dc=xe({enabled:J,type:ht(dt("line","range")),range:Me(xe((t,{options:e})=>e.type==="range","crossLine type to be 'range'"),Ft(jt),Tu(2,2)),value:Me(xe((t,{options:e})=>e.type==="line","crossLine type to be 'line'"),jt),label:Rf,fill:It,fillOpacity:Ot,...bt,...Lt},"cross-line options"),z3={...Dc,label:{...Rf,position:dt("top","left","right","bottom","top-left","top-right","bottom-left","bottom-right","inside","inside-left","inside-right","inside-top","inside-bottom","inside-top-left","inside-bottom-left","inside-top-right","inside-bottom-right"),rotation:gt}},ju={enabled:J,rotation:gt,avoidCollisions:J,minSpacing:X,spacing:X,formatter:Is(xo),itemStyler:Be({...De,...qo,spacing:gt}),...De,...qo},JD={autoRotate:J,autoRotateAngle:gt,wrapping:dt("never","always","hyphenate","on-space"),truncate:J,...ju},B3={format:_r,...JD},tA={format:Xt(K,Nu),...JD},V3={enabled:J,width:X,size:X,stroke:It},eL={enabled:J,label:tA,tick:V3},_3={values:Ft(jt),minSpacing:X},am={reverse:J,gridLine:{enabled:J,width:X,style:Xi({fill:It,fillOpacity:X,stroke:Xt(It,Fb),strokeWidth:X,lineDash:Ft(X)},"a grid-line style object array")},interval:_3,label:ju,line:{enabled:J,width:X,stroke:It},tick:V3,context:()=>!0};am.layoutConstraints=Mt({stacked:ht(J),align:ht(dt("start","end")),unit:ht(dt("percent","px")),width:ht(X)});var iL={enabled:J,text:xo,spacing:X,maxWidth:X,maxHeight:X,wrapping:dt("never","always","hyphenate","on-space"),truncate:J,formatter:Is(xo),...De},Gu={...am,title:iL,crossAt:{value:ht(Xt(gt,_s,K,Ft(K))),sticky:J},crossLines:Xi(z3,"a cross-line options array"),position:dt("top","right","bottom","left"),thickness:X,maxThicknessRatio:Ot};Gu.title._enabledFromTheme=Mt(J);var eA={enabled:J,...wt,...bt,...Lt};function Tp(t,e){const i={enabled:J,xOffset:gt,yOffset:gt,formatter:Is(K),renderer:Is(Xt(K,Pi({text:K,color:It,backgroundColor:It,opacity:Ot},"crosshair label renderer result object")))};let n;return t&&(n={...i,format:e?Xt(K,Pi({millisecond:K,second:K,hour:K,day:K,month:K,year:K})):K}),{enabled:J,snap:J,label:n??i,...bt,...Lt}}function Yx(t,e){return{min:Me(t,Fs("max")),max:Me(t,Hs("min")),preferredMin:Me(t,Fs("preferredMax"),Fs("max")),preferredMax:Me(t,Hs("preferredMin"),Hs("min")),nice:J,interval:{step:e?Xt(bo,vp,jf):bo,values:Ft(t),minSpacing:Me(X,Fs("maxSpacing")),maxSpacing:Me(X,Hs("minSpacing"))}}}var F3={step:Xt(bo,vp,jf),values:Ft(Xt(gt,_s)),minSpacing:Me(X,Fs("maxSpacing")),maxSpacing:Me(X,Hs("minSpacing")),placement:dt("on","between")},Ug={...Gu,type:Jt("category"),label:JD,paddingInner:Ot,paddingOuter:Ot,groupPaddingInner:Ot,crosshair:Tp(),bandAlignment:dt("justify","start","center","end"),bandHighlight:eA,interval:{..._3,placement:dt("on","between")},skipNullBars:J},Wg={...Gu,type:Jt("grouped-category"),label:JD,crosshair:Tp(),bandHighlight:eA,paddingInner:Ot,groupPaddingInner:Ot,depthOptions:Xi({label:{enabled:J,avoidCollisions:J,wrapping:dt("never","always","hyphenate","on-space"),truncate:J,rotation:gt,spacing:gt,...De,...qo},tick:{enabled:J,stroke:It,width:X}},"depth options objects array")},Kg={...Gu,...Yx(gt),type:Jt("number"),label:B3,crosshair:Tp(!0)},Yg={...Gu,...Yx(gt),type:Jt("log"),base:Me(bo,xe(t=>t!==1,"not equal to 1")),label:B3,crosshair:Tp(!0)},$g={...Gu,...Yx(Xt(gt,_s),!0),type:Jt("time"),label:tA,parentLevel:eL,crosshair:Tp(!0,!0)},Xg={...Gu,type:Jt("unit-time"),unit:Xt(jf,vp),label:tA,parentLevel:eL,paddingInner:Ot,paddingOuter:Ot,groupPaddingInner:Ot,crosshair:Tp(!0,!0),bandAlignment:dt("justify","start","center","end"),bandHighlight:eA,skipNullBars:J,min:Me(Xt(gt,_s),Fs("max")),max:Me(Xt(gt,_s),Hs("min")),preferredMin:Me(Xt(gt,_s),Fs("preferredMax"),Fs("max")),preferredMax:Me(Xt(gt,_s),Hs("preferredMin"),Hs("min")),interval:F3},Zg={...Gu,type:Jt("ordinal-time"),paddingInner:Ot,paddingOuter:Ot,groupPaddingInner:Ot,label:tA,parentLevel:eL,interval:F3,crosshair:Tp(!0,!0),bandHighlight:eA,bandAlignment:dt("justify","start","center","end"),skipNullBars:J},H3={...am,...Yx(gt),type:Jt("angle-number"),crossLines:Xi(Dc),startAngle:gt,endAngle:gt,label:{...ju,orientation:dt("fixed","parallel","perpendicular"),format:_r}},nL={...am,type:Jt("angle-category"),shape:dt("polygon","circle"),crossLines:Xi(Dc),startAngle:gt,endAngle:gt,paddingInner:Ot,groupPaddingInner:Ot,label:{...ju,orientation:dt("fixed","parallel","perpendicular")}};nL.innerRadiusRatio=Ot;var j3={...am,...Yx(gt),type:Jt("radius-number"),shape:dt("polygon","circle"),positionAngle:gt,innerRadiusRatio:Ot,title:iL,crossLines:Xi({...Dc,label:{...Rf,positionAngle:gt}},"cross-line options"),label:{...ju,format:_r}},G3={...am,type:Jt("radius-category"),positionAngle:gt,innerRadiusRatio:Ot,paddingInner:Ot,paddingOuter:Ot,groupPaddingInner:Ot,label:ju,title:iL,crossLines:Xi({...Dc,label:{...Rf,positionAngle:gt}},"cross-line options")},U3=Zi(Si,Si),gtt=Be({...bt,...wt,...Lt,marker:Lu}),W3={showInMiniChart:J,connectMissingData:J,interpolation:cD,label:ei,styler:gtt,marker:Lr,tooltip:_4,shadow:Nl,...Ee,...wt,...bt,...Lt,highlight:U3,segmentation:Pc},sL={...W3,..._e,highlight:U3,type:ht(Jt("area")),xKey:ht(K),yKey:ht(K),xKeyAxis:K,yKeyAxis:K,xName:K,yName:K,legendItemName:K,stacked:J,stackGroup:K,normalizedTo:gt};sL.selectedKey=Mt(K);var K3=Zi(Tr,Tr),GB=Be({...wt,...bt,...Lt,cornerRadius:X}),aL={direction:dt("horizontal","vertical"),showInMiniChart:J,cornerRadius:X,styler:GB,itemStyler:GB,crisp:J,label:{...ei,placement:dt("inside-center","inside-start","inside-end","outside-start","outside-end"),spacing:X},errorBar:mx,shadow:Nl,tooltip:Re,...Ee,highlight:K3,...wt,...bt,...Lt,segmentation:Pc,width:bo,widthRatio:Ot};aL.sparklineMode=Mt(J);var om={...aL,..._e,highlight:K3,type:ht(Jt("bar")),xKey:ht(K),yKey:ht(K),xKeyAxis:K,yKeyAxis:K,xName:K,yName:K,direction:dt("horizontal","vertical"),grouped:J,stacked:J,stackGroup:K,normalizedTo:gt,legendItemName:K,errorBar:lD};om.yFilterKey=Mt(K);om.pickOutsideVisibleMinorAxis=Mt(J);om.focusPriority=Mt(gt);om.simpleItemStyler=Mt(ai);var Y3={title:K,domain:Ft(gt),maxSize:X,showInMiniChart:J,label:{placement:dt("top","right","bottom","left"),...ei},tooltip:Re,styler:Be({...Lr,maxSize:X}),maxRenderedItems:gt,...Ee,...At(Lr,["enabled"]),highlight:Zi(Si,Si)},$3={...Y3,..._e,type:ht(Jt("bubble")),xKey:ht(K),yKey:ht(K),sizeKey:ht(K),labelKey:K,xName:K,yName:K,sizeName:K,labelName:K,legendItemName:K,xKeyAxis:K,yKeyAxis:K,highlight:Zi(Si,Si)};$3.selectedKey=Mt(K);var X3={showInMiniChart:J,cornerRadius:X,label:ei,tooltip:Re,shadow:Nl,...Ee,...wt,...bt,...Lt,highlight:Zi(Si,Si),areaPlot:J,aggregation:dt("count","sum","mean"),bins:Ft(Ft(gt)),binCount:X},ftt={..._e,...X3,type:ht(Jt("histogram")),xKey:ht(K),yKey:K,xKeyAxis:K,yKeyAxis:K,xName:K,yName:K},Z3=Zi(Si,bu),mtt=Be({...bt,...Lt,marker:Lu}),oL={title:K,showInMiniChart:J,connectMissingData:J,interpolation:cD,label:ei,styler:mtt,marker:Lr,tooltip:Re,errorBar:mx,...Ee,...bt,...Lt,highlight:Z3,segmentation:O4};oL.sparklineMode=Mt(J);var $x={...oL,..._e,highlight:Z3,type:ht(Jt("line")),xKey:ht(K),yKey:ht(K),xKeyAxis:K,yKeyAxis:K,xName:K,yName:K,stacked:J,stackGroup:K,normalizedTo:gt,legendItemName:K,errorBar:lD};$x.selectedKey=Mt(K);$x.pickOutsideVisibleMinorAxis=Mt(J);$x.focusPriority=Mt(gt);var q3={title:K,showInMiniChart:J,label:{placement:dt("top","right","bottom","left"),...ei},tooltip:Re,errorBar:mx,styler:Be(Lr),maxRenderedItems:gt,...Ee,...At(Lr,["enabled"]),highlight:Zi(Si,Si)},Q3={...q3,..._e,type:ht(Jt("scatter")),xKey:ht(K),yKey:ht(K),labelKey:K,xName:K,yName:K,labelName:K,legendItemName:K,xKeyAxis:K,yKeyAxis:K,errorBar:lD,highlight:Zi(Si,Si)};Q3.selectedKey=Mt(K);var J3=Zi(Si,Si),rL={...Ee,radiusMin:X,radiusMax:X,rotation:gt,outerRadiusOffset:gt,outerRadiusRatio:Ot,hideZeroValueSectorsInLegend:J,sectorSpacing:X,cornerRadius:X,itemStyler:Be({...wt,...bt,...Lt,cornerRadius:X}),title:{enabled:J,text:K,showInLegend:J,spacing:X,...De},calloutLabel:{enabled:J,offset:gt,minAngle:X,avoidCollisions:J,formatter:Is(xo),format:K,itemStyler:Be({enabled:J,...qo,...De}),...qo,...De},sectorLabel:{enabled:J,positionOffset:gt,positionRatio:Ot,formatter:Is(xo),format:K,itemStyler:Be({enabled:J,...qo,...De}),...qo,...De},calloutLine:{colors:Ft(It),length:X,strokeWidth:X,itemStyler:Be({color:It,length:X,strokeWidth:X})},fills:Ft(Ga),strokes:Ft(It),tooltip:Re,shadow:Nl,highlight:J3,...Lt,...At(wt,["fill"]),...At(bt,["stroke"])},Rl={...rL,..._e,type:ht(Jt("pie")),angleKey:ht(K),radiusKey:K,calloutLabelKey:K,sectorLabelKey:K,legendItemKey:K,angleName:K,radiusName:K,calloutLabelName:K,sectorLabelName:K,highlight:J3};Rl.angleFilterKey=Mt(K);Rl.defaultColorRange=Mt(Ft(Ft(It)));Rl.defaultPatternFills=Mt(Ft(It));Rl.title._enabledFromTheme=Mt(J);Rl.calloutLabel._enabledFromTheme=Mt(J);Rl.sectorLabel._enabledFromTheme=Mt(J);Rl.angleKeyAxis=Mt(K);Rl.radiusKeyAxis=Mt(K);var tU={...rL,innerRadiusOffset:gt,innerRadiusRatio:Ot,innerCircle:{fill:K,fillOpacity:Ot},innerLabels:{spacing:X,...De,...qo}},eU={...tU,...Rl,type:ht(Jt("donut")),innerLabels:Xi({text:ht(K),spacing:X,...De,...qo},"inner label options array")};eU.angleFilterKey=Mt(K);var rm={lineStyle:dt("solid","dashed","dotted"),...Lt},Lp={...wt,...bt,...Lt},Xx={visible:J,locked:J,readOnly:J,handle:Lp,...De},iA={position:dt("top","center","bottom"),alignment:dt("left","center","right"),...De},iU={position:dt("top","inside","bottom"),alignment:dt("left","center","right"),...De},ytt={enabled:J,cornerRadius:X,...De,...wt,...bt,...Lt},btt={visible:J,...rm,...bt},nU={divider:bt,...wt,...bt,...De},UB={handle:Lp,statistics:nU,...rm,...wt,...bt},wM={visible:J,locked:J,readOnly:J,extendStart:J,extendEnd:J,handle:Lp,text:iA,...rm,...bt},BN={visible:J,locked:J,readOnly:J,axisLabel:ytt,handle:Lp,text:iA,...rm,...bt},sU={visible:J,locked:J,readOnly:J,extendStart:J,extendEnd:J,handle:Lp,text:iU,background:wt,...rm,...bt},aU={...sU},oU={...sU,middle:btt},VN={label:De,showFill:J,isMultiColor:J,strokes:Ft(It),rangeStroke:It,bands:dt(4,6,10),...wM},rU={...wt,...bt,...Xx},lU={...wt,...bt,...Xx},cU={...wt,...bt,...Xx,background:{...wt,...bt}},_N={visible:J,locked:J,readOnly:J,handle:Lp,...wt},YS={visible:J,locked:J,readOnly:J,extendStart:J,extendEnd:J,handle:Lp,text:iA,background:wt,statistics:nU,...rm,...bt},hU={visible:J,up:UB,down:UB},lm={enabled:J,axesButtons:{enabled:J,axes:dt("x","y","xy")},toolbar:{enabled:J,padding:X,buttons:Xi({...Zh,value:dt("line-menu","fibonacci-menu","text-menu","shape-menu","measurer-menu","line","horizontal-line","vertical-line","parallel-channel","disjoint-channel","fibonacci-retracement","fibonacci-retracement-trend-based","text","comment","callout","note","clear")},"annotation toolbar buttons array")},optionsToolbar:{enabled:J,buttons:Ft(Xt(Pi({...Zh,value:ht(dt("line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings"))}),Pi({...Zh,value:ht(dt("lock")),checkedOverrides:Zh})))}};lm.data=Mt(wl);lm.xKey=Mt(K);lm.volumeKey=Mt(K);lm.snap=Mt(J);var sl={...wt,...bt,opacity:Ot},uU={...wt,...bt,...Lt,cornerRadius:X,whisker:{...bt,...Lt},cap:{lengthRatio:Ot}},WB={...uU,opacity:Ot},KB=Be({...wt,...bt,...Lt,cornerRadius:X,whisker:{...bt,...Lt},cap:{lengthRatio:Ot}}),dU={direction:dt("horizontal","vertical"),showInMiniChart:J,styler:KB,itemStyler:KB,tooltip:Re,...Ee,...uU,highlight:Zi(WB,WB),segmentation:Pc,width:bo,widthRatio:Ot},FN={cornerRadius:X,wick:{...bt,...Lt},...wt,...bt,...Lt},YB={...FN,opacity:Ot},pU={item:{up:FN,down:FN},itemStyler:Be({...wt,...bt,...Lt,cornerRadius:X,wick:{...bt,...Lt}}),showInMiniChart:J,tooltip:Re,...Ee,highlight:Zi(YB,YB)},gU={fills:Ft(Ga),strokes:Ft(It),label:{spacing:X,maxWidth:X,...ei},link:{tension:Ot,itemStyler:Be({...wt,...bt,...Lt,tension:Ot}),...wt,...bt,...Lt},node:{width:X,spacing:X,itemStyler:Be({...wt,...bt,...Lt}),...wt,...bt,...Lt},tooltip:Re,...Ee},fU={direction:dt("horizontal","vertical"),fills:Ft(Ga),strokes:Ft(It),label:{spacing:X,placement:dt("before","middle","after"),...ei},stageLabel:{placement:dt("before","after"),format:_r,...ju},tooltip:Re,...At(Ee,["showInLegend"]),...At(wt,["fill"]),...At(bt,["stroke"]),...Lt,highlight:T1(bu)},mU={direction:dt("horizontal","vertical"),fills:Ft(Ga),strokes:Ft(It),itemStyler:Be({...wt,...bt,...Lt}),spacingRatio:Ot,crisp:J,dropOff:{enabled:J,...wt,...bt,...Lt},stageLabel:{placement:dt("before","after"),format:_r,...ju},label:ei,tooltip:Re,shadow:Nl,...At(Ee,["showInLegend"]),...At(wt,["fill"]),...At(bt,["stroke"]),...Lt},yU={title:K,textAlign:dt("left","center","right"),verticalAlign:dt("top","middle","bottom"),itemPadding:X,itemStyler:Be({...wt,...bt}),showInMiniChart:J,label:vu,tooltip:Re,...Ee,...bt},bU={showInMiniChart:J,itemStyler:Be({...bt,...Lt}),item:{up:{...bt,...Lt},down:{...bt,...Lt}},tooltip:Re,...Ee,highlight:Zi(bu,bu)},xU={maxStrokeWidth:X,itemStyler:Be({...bt,...Lt}),sizeDomain:Ft(X),label:ei,tooltip:Re,...Ee,...bt,...Lt,highlight:Zi(bu,bu)},vU={...bt,...Lt},SU={colorRange:Ft(It),maxSize:X,sizeDomain:Ft(X),label:{placement:dt("top","bottom","left","right"),...ei},tooltip:Re,...Ee,...At(Lr,["enabled"]),highlight:Zi(Si,Si)},MU={colorRange:Ft(It),padding:X,itemStyler:Be({...wt,...bt,...Lt}),label:vu,tooltip:Re,...Ee,...wt,...bt,...Lt,highlight:Zi(Si,Si)},DU={...Ee,...wt,...bt,...Lt},Pf=Be({...wt,...bt,...Lt,cornerRadius:X}),AU={cornerRadius:X,styler:Pf,itemStyler:Pf,label:ei,tooltip:Re,...Ee,...wt,...bt,...Lt,highlight:Zi(Tr,Tr)},IU={direction:dt("horizontal","vertical"),aspectRatio:X,spacing:X,reverse:J,itemStyler:Be({...wt,...bt,...Lt}),fills:Ft(Ga),strokes:Ft(It),label:ei,stageLabel:{spacing:X,placement:dt("before","after"),...ei},tooltip:Re,shadow:Nl,...Ee,...At(wt,["fill"]),...At(bt,["stroke"]),...Lt},kU={connectMissingData:J,marker:Lr,styler:Be({marker:Lu,...wt,...bt,...Lt}),label:ei,tooltip:Re,...Ee,...wt,...bt,...Lt,highlight:Zi(Si,Si)},CU={connectMissingData:J,marker:Lr,styler:Be({marker:Lu,...bt,...Lt}),label:ei,tooltip:Re,...Ee,...bt,...Lt,highlight:Zi(Si,bu)},wU={cornerRadius:X,styler:Pf,itemStyler:Pf,label:ei,tooltip:Re,...Ee,...wt,...bt,...Lt,highlight:Zi(Tr,Tr)},NU={cornerRadius:X,columnWidthRatio:Ot,maxColumnWidthRatio:Ot,styler:Pf,itemStyler:Pf,label:ei,tooltip:Re,...Ee,...wt,...bt,...Lt,highlight:Zi(Tr,Tr)},xtt={marker:Lr,...bt,...Lt},$B={marker:{enabled:J,...Lu},...bt,...Lt},XB={marker:Lu,...bt,...Lt},TU={showInMiniChart:J,connectMissingData:J,interpolation:cD,label:{...ei,placement:dt("inside","outside"),spacing:X},tooltip:Re,shadow:Nl,...Ee,...wt,...xtt,item:{low:{...$B},high:{...$B}},styler:Be({...wt,item:{low:{...XB},high:{...XB}}}),highlight:Zi(Si,Si),segmentation:Pc,invertedStyle:{enabled:J,...wt}},ZB=Be({...wt,...bt,...Lt,cornerRadius:X}),LU={direction:dt("horizontal","vertical"),grouped:J,showInMiniChart:J,cornerRadius:X,styler:ZB,itemStyler:ZB,label:{...ei,placement:dt("inside","outside"),spacing:X},tooltip:Re,shadow:Nl,...Ee,...wt,...bt,...Lt,highlight:Zi(Tr,Tr),segmentation:Pc,width:bo,widthRatio:Ot},OU={fills:Ft(Ga),strokes:Ft(It),label:{...ei,spacing:X,placement:dt("left","right","center"),edgePlacement:dt("inside","outside")},link:{itemStyler:Be({...wt,...bt,...Lt}),...wt,...bt,...Lt},node:{width:X,spacing:X,minSpacing:Me(X,b4("spacing")),alignment:dt("left","center","right","justify"),verticalAlignment:dt("top","bottom","center"),sort:dt("data","ascending","descending","auto"),itemStyler:Be({...wt,...bt,...Lt}),...wt,...bt,...Lt},tooltip:Re,...Ee},EU={fills:Ft(Ga),strokes:Ft(It),colorRange:Ft(It),sectorSpacing:X,cornerRadius:X,padding:X,itemStyler:Be({...wt,...bt}),label:{spacing:X,...vu},secondaryLabel:vu,tooltip:Re,...At(Ee,["highlight","showInLegend"]),...At(wt,["fill"]),...At(bt,["stroke"]),highlight:{highlightedItem:sl,highlightedBranch:sl,unhighlightedItem:sl,unhighlightedBranch:sl}},RU={fills:Ft(Ga),strokes:Ft(It),colorRange:Ft(It),itemStyler:Be({...wt,...bt}),group:{gap:X,padding:X,cornerRadius:X,textAlign:dt("left","center","right"),interactive:J,highlight:{highlightedItem:sl,unhighlightedItem:sl},label:{...ei,spacing:X},...wt,...bt},tile:{gap:X,padding:X,cornerRadius:X,textAlign:dt("left","center","right"),verticalAlign:dt("top","middle","bottom"),label:{...ei,spacing:X,lineHeight:X,minimumFontSize:X,wrapping:dt("never","always","hyphenate","on-space"),overflowStrategy:dt("ellipsis","hide")},secondaryLabel:{...ei,lineHeight:X,minimumFontSize:X,wrapping:dt("never","always","hyphenate","on-space"),overflowStrategy:dt("ellipsis","hide")},highlight:{highlightedItem:sl,highlightedBranch:sl,unhighlightedItem:sl,unhighlightedBranch:sl},...wt,...bt},tooltip:Re,...At(Ee,["highlight","showInLegend"])},PC={name:K,cornerRadius:X,itemStyler:Be({...wt,...bt,...Lt,cornerRadius:X}),label:{...ei,placement:dt("inside-start","inside-center","inside-end","outside-start","outside-end"),spacing:X},tooltip:Re,shadow:Nl,...wt,...bt,...Lt},PU={direction:dt("horizontal","vertical"),showInMiniChart:J,item:{positive:PC,negative:PC,total:PC},line:{enabled:J,...bt,...Lt},tooltip:Re,width:bo,widthRatio:Ot,...Ee},j0=Pi({__type:ht(Jt("date")),value:Xt(K,gt)},"a serializable date object"),qB={width:X,height:X,grip:J,fill:It,stroke:It,strokeWidth:X,cornerRadius:X},He={enabled:J,height:X,spacing:X,cornerRadius:gt,mask:{fill:It,fillOpacity:Ot,stroke:It,strokeWidth:X},minHandle:qB,maxHandle:qB,miniChart:{enabled:J,padding:{top:X,bottom:X},label:{enabled:J,avoidCollisions:J,spacing:X,format:_r,formatter:Is(xo),interval:{minSpacing:X,maxSpacing:X,values:wl,step:gt},...De},series:jt}},lL={...wt,...bt,...Lt,cornerRadius:X,opacity:Ot},zU={...lL,minSize:X,hoverStyle:{fill:wt.fill,stroke:bt.stroke}},BU={enabled:J,thickness:X,spacing:X,tickSpacing:X,visible:dt("auto","always","never"),placement:dt("outer","inner"),track:lL,thumb:zU},vtt={...BU,position:dt("top","bottom")},Stt={...BU,position:dt("left","right")},Ps={enabled:J,enableAxisScrolling:J,enableSeriesAreaScrolling:J,thickness:X,spacing:X,tickSpacing:X,visible:dt("auto","always","never"),placement:dt("outer","inner"),track:lL,thumb:zU,horizontal:vtt,vertical:Stt},Cd=At(z3,["type","value","range"]),zs={number:{...At(Kg,["type","crossLines"]),top:At(Kg,["type","crossLines","position"]),right:At(Kg,["type","crossLines","position"]),bottom:At(Kg,["type","crossLines","position"]),left:At(Kg,["type","crossLines","position"]),crossLines:Cd},log:{...At(Yg,["type","crossLines"]),top:At(Yg,["type","crossLines","position"]),right:At(Yg,["type","crossLines","position"]),bottom:At(Yg,["type","crossLines","position"]),left:At(Yg,["type","crossLines","position"]),crossLines:Cd},category:{...At(Ug,["type","crossLines"]),top:At(Ug,["type","crossLines","position"]),right:At(Ug,["type","crossLines","position"]),bottom:At(Ug,["type","crossLines","position"]),left:At(Ug,["type","crossLines","position"]),crossLines:Cd},time:{...At($g,["type","crossLines"]),top:At($g,["type","crossLines","position"]),right:At($g,["type","crossLines","position"]),bottom:At($g,["type","crossLines","position"]),left:At($g,["type","crossLines","position"]),crossLines:Cd},"unit-time":{...At(Xg,["type","crossLines"]),top:At(Xg,["type","crossLines","position"]),right:At(Xg,["type","crossLines","position"]),bottom:At(Xg,["type","crossLines","position"]),left:At(Xg,["type","crossLines","position"]),crossLines:Cd},"grouped-category":{...At(Wg,["type"]),top:At(Wg,["type","position"]),right:At(Wg,["type","position"]),bottom:At(Wg,["type","position"]),left:At(Wg,["type","position"]),crossLines:Cd},"ordinal-time":{...At(Zg,["type","crossLines"]),top:At(Zg,["type","crossLines","position"]),right:At(Zg,["type","crossLines","position"]),bottom:At(Zg,["type","crossLines","position"]),left:At(Zg,["type","crossLines","position"]),crossLines:Cd}},Rg={"angle-category":{...At(nL,["type","crossLines"]),crossLines:At(Dc,["type"])},"angle-number":{...At(H3,["type","crossLines"]),crossLines:At(Dc,["type"])},"radius-category":{...At(G3,["type","crossLines"]),crossLines:{...At(Dc,["type"]),label:{...Rf,positionAngle:gt}}},"radius-number":{...At(j3,["type","crossLines"]),crossLines:{...At(Dc,["type"]),label:{...Rf,positionAngle:gt}}}},We={visible:Mt(J)},Mtt={common:{...Zt,navigator:He,scrollbar:Ps,axes:{...zs,...Rg},annotations:{...lm,line:wM,"horizontal-line":BN,"vertical-line":BN,"disjoint-channel":aU,"parallel-channel":oU,"fibonacci-retracement":VN,"fibonacci-retracement-trend-based":VN,callout:rU,comment:lU,note:cU,text:Xx,arrow:wM,"arrow-up":_N,"arrow-down":_N,"date-range":YS,"price-range":YS,"date-price-range":YS,"quick-date-price-range":hU},chartToolbar:{enabled:J},initialState:{legend:Xi({visible:J,seriesId:K,itemId:K,legendItemName:K},"legend state array"),zoom:{rangeX:{start:Xt(gt,j0),end:Xt(gt,j0)},rangeY:{start:Xt(gt,j0),end:Xt(gt,j0)},ratioX:{start:Ot,end:Ot},ratioY:{start:Ot,end:Ot},autoScaledAxes:Ft(Jt("y"))}}},line:{...Zt,axes:zs,series:oL,navigator:He,scrollbar:Ps,...We},scatter:{...Zt,axes:zs,series:q3,navigator:He,scrollbar:Ps,...We,paired:Mt(J)},bubble:{...Zt,axes:zs,series:Y3,navigator:He,scrollbar:Ps,...We},area:{...Zt,axes:zs,series:W3,navigator:He,scrollbar:Ps,...We},bar:{...Zt,axes:zs,series:aL,navigator:He,scrollbar:Ps,...We},"box-plot":{...Zt,axes:zs,series:dU,navigator:He,scrollbar:Ps,...We},candlestick:{...Zt,axes:zs,series:pU,navigator:He,scrollbar:Ps,...We},"cone-funnel":{...Zt,axes:zs,series:fU,navigator:He,scrollbar:Ps,...We},funnel:{...Zt,axes:zs,series:mU,navigator:He,scrollbar:Ps,...We},ohlc:{...Zt,axes:zs,series:bU,navigator:He,scrollbar:Ps,...We},histogram:{...Zt,axes:At(zs,["category","grouped-category","unit-time","ordinal-time"]),series:X3,navigator:He,scrollbar:Ps,...We},heatmap:{...Zt,axes:zs,series:yU,navigator:He,scrollbar:Ps,...We},waterfall:{...Zt,axes:zs,series:PU,navigator:He,scrollbar:Ps,...We},"range-bar":{...Zt,axes:zs,series:LU,navigator:He,scrollbar:Ps,...We},"range-area":{...Zt,axes:zs,series:TU,navigator:He,scrollbar:Ps,...We},donut:{...Zt,series:tU,navigator:He,...We},pie:{...Zt,series:rL,navigator:He,...We},"radar-line":{...Zt,axes:Rg,series:CU,navigator:He,...We},"radar-area":{...Zt,axes:Rg,series:kU,navigator:He,...We},"radial-bar":{...Zt,axes:Rg,series:wU,navigator:He,...We},"radial-column":{...Zt,axes:Rg,series:NU,navigator:He,...We},nightingale:{...Zt,axes:Rg,series:AU,navigator:He,...We},sunburst:{...Zt,series:EU,navigator:He,...We},treemap:{...Zt,series:RU,navigator:He,...We},"map-shape":{...Zt,series:MU,navigator:He,...We},"map-line":{...Zt,series:xU,navigator:He,...We},"map-marker":{...Zt,series:SU,navigator:He,...We},"map-shape-background":{...Zt,series:DU,navigator:He,...We},"map-line-background":{...Zt,series:vU,navigator:He,...We},sankey:{...Zt,series:OU,navigator:He,...We},chord:{...Zt,series:gU,navigator:He,...We},pyramid:{...Zt,series:IU,navigator:He,...We},"radial-gauge":{...Zt,...hM,targets:At(dD,["value"]),tooltip:{...hM.tooltip,...Zt.tooltip}},"linear-gauge":{...Zt,...cM,targets:At(uD,["value"]),tooltip:{...cM.tooltip,...Zt.tooltip}}};function G0(t,e){const i={};for(const n of Reflect.ownKeys(t))i[n]=e(t[n],n,t);return i}var Dtt=G0(Mtt,function t(e,i){if(hb(i))return e;if(Cl(e))return Xt(e,Fb,hb);if(Bt(e))return Xt(Pi(Bb in e?G0(e,n=>Bt(n)?G0(n,t):n):G0(e,t)),Fb,hb);throw new Error(`Invalid theme override value: ${String(e)}`)}),gs={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},wd={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},Att=class extends sm{getDefaultColors(){return{fills:gs,fillsFallback:Object.values(gs),strokes:wd,sequentialColors:So(gs),divergingColors:[gs.ORANGE,gs.YELLOW,gs.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"],secondDivergingColors:[gs.GREEN,gs.YELLOW,gs.RED],secondHierarchyColors:[],up:{fill:gs.GREEN,stroke:wd.GREEN},down:{fill:gs.RED,stroke:wd.RED},neutral:{fill:gs.GRAY,stroke:wd.GRAY},altUp:{fill:gs.BLUE,stroke:wd.BLUE},altDown:{fill:gs.ORANGE,stroke:wd.ORANGE},altNeutral:{fill:gs.GRAY,stroke:wd.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(ra,gs.BLUE),t.set(Ws,gs.BLUE),t}},fs={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Nd={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},Itt=class extends Pr{getDefaultColors(){return{...super.getDefaultColors(),fills:fs,fillsFallback:Object.values(fs),strokes:Nd,sequentialColors:So(fs),divergingColors:[fs.ORANGE,fs.YELLOW,fs.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"],secondDivergingColors:[fs.GREEN,fs.YELLOW,fs.RED],secondHierarchyColors:[],up:{fill:fs.GREEN,stroke:Nd.GREEN},down:{fill:fs.RED,stroke:Nd.RED},neutral:{fill:fs.GRAY,stroke:Nd.GRAY},altUp:{fill:fs.BLUE,stroke:Nd.BLUE},altDown:{fill:fs.ORANGE,stroke:Nd.ORANGE},altNeutral:{fill:fs.GRAY,stroke:Nd.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(ra,fs.BLUE),t.set(Ws,fs.BLUE),t}},HN=xs(()=>new Pr),ktt=Gt.create(!0,"perf"),Mr=(t,e,i)=>{ktt("[CACHE] ChartTheme",t,e.name,i)},cL={"ag-default-dark":xs(()=>new sm),"ag-sheets-dark":xs(()=>new dtt,Mr),"ag-polychroma-dark":xs(()=>new htt,Mr),"ag-vivid-dark":xs(()=>new Att,Mr),"ag-material-dark":xs(()=>new ltt,Mr),"ag-financial-dark":xs(()=>new ott,Mr),"ag-default":HN,"ag-sheets":xs(()=>new ptt,Mr),"ag-polychroma":xs(()=>new utt,Mr),"ag-vivid":xs(()=>new Itt,Mr),"ag-material":xs(()=>new ctt,Mr),"ag-financial":xs(()=>new rtt,Mr)},NM=xs(Ctt,Mr);function Ctt(t){if(t instanceof Pr)return t;if(!Ltt(t))return HN();if(t==null||typeof t=="string"){const s=cL[t??"ag-default"];if(s)return s();throw new Error(`Cannot find theme \`${t}\`.`)}const{cleared:e,invalid:i}=ts(wtt(t),Ntt,"theme");for(const s of i)pt.warnOnce(String(s));const n=e?.baseTheme?NM(e.baseTheme):HN();return e?new n.constructor(e):n}function wtt(t){if(!Bt(t)||!Bt(t.baseTheme))return t;let e=t,i,n;const s=[];for(;typeof e=="object";)i??(i=e.palette),n??(n=e.params),e.overrides&&s.push(e.overrides),e=e.baseTheme;return{baseTheme:e,overrides:Et(...s),params:n,palette:i}}var Ntt={baseTheme:Xt(K,Nu),overrides:Dtt,params:{accentColor:It,axisColor:It,backgroundColor:It,borderColor:It,borderRadius:gt,chartBackgroundColor:It,chartPadding:gt,focusShadow:K,foregroundColor:It,fontFamily:iM,fontSize:gt,fontWeight:ub,gridLineColor:It,popupShadow:K,subtleTextColor:It,textColor:It,separationLinesColor:It,chromeBackgroundColor:It,chromeFontFamily:iM,chromeFontSize:gt,chromeFontWeight:ub,chromeSubtleTextColor:It,chromeTextColor:It,buttonBackgroundColor:It,buttonBorder:J,buttonFontWeight:ub,buttonTextColor:It,inputBackgroundColor:It,inputBorder:J,inputTextColor:It,menuBackgroundColor:It,menuBorder:J,menuTextColor:It,panelBackgroundColor:It,panelSubtleTextColor:It,tooltipBackgroundColor:It,tooltipBorder:J,tooltipTextColor:It,tooltipSubtleTextColor:It,crosshairLabelBackgroundColor:It,crosshairLabelTextColor:It},palette:{fills:Ft(Ga),strokes:Ft(It),up:{fill:Xt(It,RS),stroke:It},down:{fill:Xt(It,RS),stroke:It},neutral:{fill:Xt(It,RS),stroke:It}}},Ttt=dt("ag-default","ag-default-dark","ag-sheets","ag-sheets-dark","ag-polychroma","ag-polychroma-dark","ag-vivid","ag-vivid-dark","ag-material","ag-material-dark","ag-financial","ag-financial-dark");function Ltt(t){const{invalid:e}=ts({theme:t},{theme:Xt(Ttt,Nu)});for(const i of e)pt.warnOnce(String(i));return e.length===0}var ki="path",Go="pathArray",yi="default",ka="override",bs="user",Eh="userPartial",Qr="operation",Jr="operationValue",Qg="dependency",zC="autoEnable",QB="autoEnableValue",JB="prune",tV="childrenSource";function hL(t){return Je(t)&&t>=0&&t<=1}function zy(t,e){let i=t;for(const n of e){if(!(typeof n=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&n in i))return!1;i=i[n]}return!0}function qn(t,e){let i=t;for(const n of e){if(!(typeof n=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&n in i))return;i=i[n]}return i}function Pg(t,e,i){const n=e.length;if(n===0)return;let s=t;const a=n-1,o=e[a];for(let r=0;r=0;n--){const s=t[n];if(Ott.test(s)&&(i++,i>e))return n}return-1}function zf(t,e=0){const i=Ett(t,e);return Number(t[i])}function Op(t,e,i){const n=e.split("/");let s=[...t];e.startsWith("/")&&(s=[],n.shift());let a=!1;for(const o of n){if(o==="..")s.pop(),a||s.pop();else if(o===".")s.pop();else if(o==="$index"){const r=zf(t);if(Number.isNaN(r))return bl;s.push(`${r}`)}else if(o==="$prevIndex"){const r=zf(t);if(Number.isNaN(r)||Number(r)<=0)return bl;s.push(`${Number(r)-1}`)}else if(o.startsWith("$")){const r=i?.[o.slice(1)];if(r==null)return bl;s.push(r)}else o.length!==0&&s.push(o);a=o===".."}return s}var bl=Symbol("unresolvable-path"),Fa=Symbol("resolved-to-branch");function Db(t,e){if(t==null||typeof t!="object"||Array.isArray(t)||(e??(e=Object.keys(t)),e.length===0))return;const i=e[0];if(_U.has(i))return{operation:i,values:Array.isArray(t[i])?t[i]:[t[i]]}}function Rtt(t,e,i){const n=Db(t.getVertexValue(i));switch(n?.operation){case"$path":{const[s]=n.values,a=t.getPathArray(e),o=Op(a,s);return o===bl?void 0:t.findVertexAtPath(o)}case"$value":return e}}var Ptt={$cacheMax:ztt};function ztt(t,e,i){const[n]=i,s=t.getPathArray(e),a=t.getCachedValue(s,"$cacheMax"),o=t.resolveVertexValue(e,n);if(typeof o!="number")return a;if(typeof a!="number")return t.setCachedValue(s,"$cacheMax",o),o;const r=Math.max(a,o);return t.setCachedValue(s,"$cacheMax",r),r}var Btt={$hasSeriesType:{dependencies:BC,resolve:Vtt},$isChartType:{dependencies:BC,resolve:Ftt},$isSeriesType:{dependencies:BC,resolve:_tt}};function BC(t,e,i){const n=t.findVertexAtPath(["series","0","type"]);n&&t.addEdge(e,n,Qg)}function Vtt(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n),a=t.getResolvedPath(["series"]);if(!Array.isArray(a))return!1;for(const o of a)if(o.type===s)return!0;return!1}function _tt(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);return t.getResolvedPath(["series","0","type"])===s}function Ftt(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n),a=t.getResolvedPath(["series","0","type"]);if(typeof a!="string")return!1;const o=Ut.getSeriesModule(a);if(o==null)return!1;switch(s){case"cartesian":return o.chartType==="cartesian";case"polar":return o.chartType==="polar";case"standalone":return o.chartType==="standalone"}return!1}var Htt={$foregroundBackgroundMix:jtt,$foregroundOpacity:Gtt,$interpolate:Utt,$isGradient:Wtt,$isImage:Ktt,$isPattern:Ytt,$mix:$tt};function jtt(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n),a=t.getParamValue("foregroundColor"),o=t.getParamValue("backgroundColor");if(typeof a=="string"&&typeof o=="string"&&hL(s))return se.mix(se.fromString(a),se.fromString(o),1-s).toString();Gt.inDevelopmentMode(()=>pt.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(s)}}}] at [${t.getPathArray(e).join(".")}], expecting a number between 0 and 1.`))}function Gtt(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n),a=t.getParamValue("foregroundColor");if(typeof a=="string"&&hL(s)){const o=se.fromString(a);return new se(o.r,o.g,o.b,s).toString()}Gt.inDevelopmentMode(()=>pt.warnOnce(`\`$foregroundOpacity\` json operation failed on [${String(s)}}}] at [${t.getPathArray(e).join(".")}], expecting a number between 0 and 1.`))}function Utt(t,e,i){const[n,s]=i,a=t.resolveVertexValue(e,n),o=t.resolveVertexValue(e,s);if(!(!qt(a)||!Je(o)))return se.interpolate(a.map(r=>se.fromString(r)),o).map(r=>r.toString())}function Wtt(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);return an(s)}function Ktt(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);return ml(s)}function Ytt(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);return ir(s)}function $tt(t,e,i){const[n,s,a]=i,o=t.resolveVertexValue(e,n),r=t.resolveVertexValue(e,s),l=t.resolveVertexValue(e,a),c=t.getPathArray(e),u=`\`$mix\` json operation failed on [${String(o)}, ${String(r)}, ${String(l)}] at [${c.join(".")}], expecting`,d=`${u} two colors and a number between 0 and 1.`;if(typeof r!="string"||!hL(l)){Gt.inDevelopmentMode(()=>pt.warnOnce(d));return}if(typeof o=="string")try{return se.mix(se.fromString(o),se.fromString(r),l).toString()}catch{Gt.inDevelopmentMode(()=>pt.warnOnce(d));return}if(!an(o)){Gt.inDevelopmentMode(()=>pt.warnOnce(d));return}let g=o.colorStops;try{g=g?.map(f=>{let y;return typeof f.color=="string"&&(y=se.mix(se.fromString(f.color),se.fromString(r),l).toString()),{...f,color:y}})}catch{Gt.inDevelopmentMode(()=>pt.warnOnce(`${u} a gradient, a color and a number between 0 and 1.`));return}return{...o,colorStops:g}}var Xtt={$rem:Ztt};function Ztt(t,e,i){const[n,s]=i,a=t.getVertexValue(n),o=s?t.getVertexValue(s):"fontSize",r=t.getParamValue(o);if(typeof r=="number"&&typeof a=="number")return Math.round(a*r);Gt.inDevelopmentMode(()=>pt.warnOnce(`\`$rem\` json operation failed on [${String(a)}] at [${t.getPathArray(e).join(".")}], expecting a number.`))}var qtt={$and:Qtt,$eq:Jtt,$every:tet,$greaterThan:eet,$if:iet,$lessThan:net,$not:set,$or:aet,$some:oet,$switch:ret};function Qtt(t,e,i){for(const n of i){const s=t.resolveVertexValue(e,n);if(i.length===1&&Array.isArray(s))return s.every(a=>!!a);if(!s)return!1}return!0}function Jtt(t,e,i){let n,s=!0;for(const a of i){const o=t.resolveVertexValue(e,a);if(s)n=o,s=!1;else if(o!==n)return!1}return!0}function tet(t,e,i){const[n,s]=i,a=t.getVertexValue(n),o=t.resolveVertexValue(e,s);if(!Array.isArray(o))return;let r=0;for(const l of o){if(!t.graftAndResolveOrphanValue(e,`${r}`,a,l))return!1;r++}return!0}function eet(t,e,i){const[n,s]=i;return t.resolveVertexValue(e,n)>t.resolveVertexValue(e,s)}function iet(t,e,i){const[n,s,a]=i,r=t.resolveVertexValue(e,n)?s:a,l=t.neighboursWithEdgeValue(r,ki);if(l)for(const c of l)t.addEdge(e,c,ki);return t.resolveVertexValue(e,r)}function net(t,e,i){const[n,s]=i;return t.resolveVertexValue(e,n)!!a);if(s)return!0}return!1}function oet(t,e,i){const[n,s]=i,a=t.getVertexValue(n),o=t.resolveVertexValue(e,s);if(!Array.isArray(o))return;let r=0;for(const l of o){if(t.graftAndResolveOrphanValue(e,`${r}`,a,l))return!0;r++}return!1}function ret(t,e,i){const[n,s,...a]=i,o=t.resolveVertexValue(e,n);for(const r of a){const l=t.getVertexValue(r);if(!Array.isArray(l))continue;const[c,u]=l;if(o===c||Array.isArray(c)&&c.includes(o))return u}return t.resolveVertexValue(e,s)}var cet={$isUserOption:het,$palette:uet,$mapPalette:det,$path:{dependencies:iV,resolve:pet},$pathString:{dependencies:iV,resolve:get},$ref:fet};function het(t,e,i){const[n,s,a]=i,o=t.neighboursWithEdgeValue(n,ki);if(o)for(const r of o){const l=t.findNeighbour(r,yi);if(l&&eV(t,e,l))return t.resolveVertexValue(e,s)}else if(eV(t,e,n))return t.resolveVertexValue(e,s);return t.resolveVertexValue(e,a)}function eV(t,e,i){const n=t.resolveVertexValue(e,i);if(!zi(n))throw new Error(`\`$isUserOption\` json operation failed on [${String(n)}], expecting a string.`);const s=t.getPathArray(e),a=Op(s,n);return a===bl?!1:t.hasUserOption(a)}var VU=new Set(["fill","fillFallback","stroke","gradient","range2"]);function uet(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);if(!zi(s))return;if(VU.has(s)){const o=t.getPathArray(e),r=zf(o);if(Number.isNaN(r))return;switch(s){case"fill":return kr(t.palette.fills,1,r)[0];case"fillFallback":return kr(t.palette.fillsFallback,1,r)[0];case"stroke":return kr(t.palette.strokes,1,r)[0];case"gradient":return kr(t.palette.sequentialColors,1,r)[0];case"range2":return kr(t.palette.fills,2,r)}return}if(s==="gradients")return t.palette.sequentialColors;if(s==="type")return t.paletteType;const a=qn(t.palette,s.split("."));return Array.isArray(a)?[...a]:typeof a=="object"?{...a}:a}function det(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);if(!zi(s))return;if(VU.has(s)){const o=t.getPathArray(e);let r=zf(o),l=0;const c=["series","0","type"];for(let u=0;u1,s=i.length>2,[a,o,r]=i,l=t.resolveVertexValue(e,a),c=s?t.resolveVertexValue(e,r):null;if(!zi(l))throw new Error(`\`$path\` json operation failed on [${String(l)}], expecting a string.`);const u=t.getPathArray(e),d=Op(u,l);if(d===bl)return;const g=c?qn(c,d):t.getResolvedPath(d);if(g!=null)return g;if(n)return t.resolveVertexValue(e,o)}function get(t,e,i){const[n,s]=i,a=t.resolveVertexValue(e,n);if(!zi(a))throw new Error(`\`$path\` json operation failed on [${String(a)}], expecting a string.`);let o;s&&(o=t.graftAndResolveOrphan(e,s));const r=t.getPathArray(e),l=Op(r,a,o);if(l===bl)throw new Error(`Unresolvable path [${a}] at [${r.join(".")}]`);return l}function fet(t,e,i){const[n]=i,s=t.getVertexValue(n);return t.getParamValue(s)}var met={$apply:yet,$applyCycle:bet,$applySwitch:xet,$applyTheme:vet,$clone:Met,$findFirstSiblingNotOperation:Det,$map:Aet,$merge:Iet,$omit:ket,$size:Cet,$shallow:Net,$shallowSimple:wet,$value:Tet};function yet(t,e,i){const[n,s,a,o]=i,r=t.getVertexValue(n);if(!Ie(r))return;const l=s?t.getVertexValue(s):void 0,c=t.neighboursWithEdgeValue(e,ki),u=c&&c.length>0;if(!u&&l==null)return Fa;const d=a?t.resolveVertexValue(e,a):void 0,g=o?t.resolveVertexValue(e,o):void 0;if(!u&&l!=null)if(Db(l)){const f=t.resolveVertexValue(e,s);Ie(f)&&t.graftObject(e,f,[d,g])}else t.graftObject(e,l,[d,g]);if(!u)return Fa;for(const f of c){const y=t.neighboursWithEdgeValue(f,ki);if(!y||y.length===0){const x=t.addVertex({});t.addEdge(f,x,yi)}else t.graftObject(f,r,[d,g])}return Fa}function bet(t,e,i){const[n,s,a]=i,o=t.resolveVertexValue(e,n);if(typeof o!="number")return;const r=t.getPathArray(e),l=t.dangerouslyGetUserOption(r),c=t.hasThemeOverride(r),u=l==null?void 0:bs,d=l??t.resolveVertexValue(e,s);if(!Array.isArray(d))return;const g=a?t.getVertexValue(a):void 0;for(let f=0;f0)return;let l=0;for(const c of o)t.graftValue(e,`${l}`,a,c),l++;return Fa}function Iet(t,e,i){for(const n of i){const s=t.resolveVertexValue(e,n);Ie(s)&&t.graftObject(e,s)}return Fa}function ket(t,e,i){const[n,s]=i;let a=t.getVertexValue(n);if(!Array.isArray(a)){const r=Rtt(t,e,s);if(!r)return;a=t.resolveVertexValue(r,n)}const o=t.resolveVertexValue(e,s);if(!(!Array.isArray(a)||!Ie(o)))return At(o,a)}function Cet(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);return Pb(s)?"length"in s?s.length:Object.keys(s).length:0}function wet(t,e,i){const n=[];for(const s of i)n.push(t.getVertexValue(s));return n}function Net(t,e,i){const n=t.getPathArray(e),s=t.hasUserOption(n);if(!s&&i.length===1)return t.resolveVertexValue(e,i[0]);const a=[];for(const o of i)a.push(t.getVertexValue(o));return s?(t.prune(e,[ka,yi]),Fa):(t.graftObject(e,a),Fa)}function Tet(t,e,i){const[n]=i,s=t.getVertexValue(n),a=t.getPathArray(e);if(s==="$index")return zf(a);if(s==="$parentIndex")return zf(a,1);if(s==="$1")return t.resolveValue$1(a)}var Let={$isEven:Oet};function Oet(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);return Number.isNaN(Number(s))?!1:Number(s)%2===0}var eb={...Ptt,...Btt,...Htt,...Xtt,...cet,...qtt,...Let,...met},_U=new Set(Object.keys(eb));function By(t){return _U.has(t)}var hi=Gt.create("opts","options-graph"),Eet=xs(Ret);function Ret(t,e){return hi.group("OptionsGraph.constructor()",()=>{const i=new FU(t.config,e,t.params,t.palette,t.overrides,t.getTemplateParameters());return{resolve(){return i.resolve()},resolveParams(){return i.resolveParams()},resolveAnnotationThemes(){return i.resolveAnnotationThemes()},resolvePartial(n,s,a){return i.resolvePartial(n,s,a)},clearSafe(){return i.clearSafe()}}})}var Uu=class Zn extends pj{constructor(e={},i={},n=void 0,s={},a=void 0,o=new Map){super(ki,Qr,new Set([Eh,bs])),this.config=e,this.userOptions=i,this.palette=s,this.overrides=a,this.internalParams=o,this.edgePriority=[...Zn.EDGE_PRIORITY],this.graftEdge=Zn.GRAFT_EDGE,this.resolvedParams={},this.resolvedAnnotations={},this.value$1=new Map,this.cachedPathVertices=new Map,this.hasUnsafeClearKeys=!1,this.rollbackVertices=[],this.rollbackEdgesFrom=[],this.rollbackEdgesTo=[],this.rollbackEdgesValue=[],this.isRollingBack=!1,this.resolvedRootAncestorsPaths=new Set,this.EMPTY_PATH_ARRAY_VERTEX=this.addVertex([]),this.root=this.addVertex("root"),this.params=this.addVertex("params"),this.annotations=this.addVertex("annotations"),this.paletteType=Bt(i?.theme)?R3(i.theme?.palette):"inbuilt";const r=i.series?.[0]?.type??"line";hi("build user"),this.buildGraphFromObject(this.root,bs,At(i,["theme"])),hi("build defaults"),this.buildGraphFromObject(this.root,yi,At(e[r],Zn.COMPLEX_KEYS));const l=a?At(a[r],Zn.COMPLEX_KEYS):{};Object.keys(l).length>0&&(hi("build series overrides"),this.buildGraphFromObject(this.root,ka,l));const c=a?At(a.common,Zn.COMPLEX_KEYS):{};Object.keys(c).length>0&&(hi("build common overrides"),this.buildGraphFromObject(this.root,ka,Ut.getSeriesModule(r)?.chartType==="cartesian"?c:At(c,["zoom","navigator"]))),n&&(hi("build params"),this.buildGraphFromObject(this.params,yi,n));const u=this.findNeighbourWithValue(this.root,"axes",ki),d=this.findNeighbourWithValue(this.root,"series",ki);u&&(hi("build axes"),this.buildGraphFromObject(u,yi,{$applyTheme:[["/$seriesType/axes/$axisType/$position","/$seriesType/axes/$axisType"],{seriesType:{$path:["/series/0/type","line"]},axisType:{$path:["./type","category"]},position:{$path:["./position"]}},["top","right","bottom","left"]]})),d&&(hi("build series"),this.buildGraphFromObject(d,yi,{$applyTheme:["/$seriesType/series",{seriesType:{$path:["./type","line"]}}]}));const g=At(e[r]?.annotations??{},Zn.ANNOTATIONS_OPTIONS_KEYS);Object.keys(g).length>0&&(hi("build annotations type config"),this.buildGraphFromObject(this.annotations,yi,g));const f=At(a?.common?.annotations??{},Zn.ANNOTATIONS_OPTIONS_KEYS);Object.keys(f).length>0&&(hi("build annotations type overrides"),this.buildGraphFromObject(this.annotations,ka,f));const y=PS(e[r]?.annotations??{},Zn.ANNOTATIONS_OPTIONS_KEYS);Object.keys(y).length>0&&(hi("build annotations config"),this.buildGraphFromObject(this.root,yi,{annotations:y}));const x=PS(a?.common?.annotations??{},Zn.ANNOTATIONS_OPTIONS_KEYS);Object.keys(x).length>0&&(hi("build annotations overrides"),this.buildGraphFromObject(this.root,ka,{annotations:x})),this.buildDependencyGraph()}static clearValueCache(){Zn.valueCache.clear()}clear(){hi.group("OptionsGraph.clear()",()=>{super.clear(),this.cachedPathVertices.clear(),this.root=void 0,this.params=void 0,this.annotations=void 0,hi("cleared")})}clearSafe(){this.hasUnsafeClearKeys||this.clear()}resolve(){return hi.group("OptionsGraph.resolve()",()=>(this.resolved={},this.resolvedParams={},this.resolvedAnnotations={},hi("resolve params"),this.resolveVertex(this.params,this.resolvedParams),hi("resolve annotations"),this.resolveVertex(this.annotations,this.resolvedAnnotations),hi("resolve root"),this.resolveVertex(this.root),hi("resolved root",this.resolved),hi("vertex count",this.getVertexCount()),hi("edge count",this.getEdgeCount()),this.resolved))}resolveParams(){return this.resolvedParams}resolveAnnotationThemes(){return this.resolvedAnnotations}addVertex(e){const i=super.addVertex(e);return this.isRollingBack&&this.rollbackVertices.push(i),i}addEdge(e,i,n){const s=(this.neighboursWithEdgeValue(e,n)?.indexOf(i)??-1)!==-1;this.isRollingBack&&!s&&(this.rollbackEdgesFrom.push(e),this.rollbackEdgesTo.push(i),this.rollbackEdgesValue.push(n)),super.addEdge(e,i,n)}resolvePartial(e,i,n){if(!i||!this.root)return;const{permissivePath:s,proxyPaths:a}=n??{},o=Object.keys(i);if(hi.check()&&console.groupCollapsed(`OptionsGraph.resolvePartial() - ${e.join(".")} [${o}]`),o.length===0)return{};const r=this.findVertexAtPath(e);if(!r){if(s)return;throw new Error(`Could not find vertex in OptionsGraph at path [${e.join(".")}].`)}const l=this.findNeighbour(r,Go);if(this.userPartialOptions={},Pg(this.userPartialOptions,e,i),a)for(const f of Object.keys(a)){const y=a[f],x=qn(i,[f]);x!=null&&(Pg(i,y,x),Pg(this.userPartialOptions,[...e,...y],x),delete i[f],delete this.userPartialOptions[f])}this.graftEdge=Eh,this.edgePriority=[Eh,...Zn.EDGE_PRIORITY],this.snapshot(),this.buildGraphFromObject(r,Eh,i,l);for(const f of o){const y=a?.[f]?this.findVertexAtPath([...e,...a[f]]):this.findNeighbourWithValue(r,f,ki);y&&this.refreshPendingProcessingEdges(y)}this.buildDependencyGraph();const c={};if(this.resolveVertex(r,c),this.rollback(),this.graftEdge=Zn.GRAFT_EDGE,this.edgePriority=Zn.EDGE_PRIORITY,this.userPartialOptions=void 0,a)for(const f of Object.keys(a)){const y=a[f],x=qn(c,[...e,...y]);Pg(c,[...e,f],x)}const u=qn(c,e),g=n?.pick??!0?PS(qn(c,e),o):u;return hi("vertex count",this.getVertexCount()),hi("edge count",this.getEdgeCount()),hi("resolved partial",g),hi.check()&&console.groupEnd(),g}findVertexAtPath(e){const i=e.join(".");if(this.cachedPathVertices.has(i))return this.cachedPathVertices.get(i);const n=this.findVertexAlongEdge(this.root,e,ki);if(n)return this.cachedPathVertices.set(i,n),n}hasUserOption(e){if(zy(this.userOptions,e))return!0;const n=this.findVertexAtPath(e);if(n){if(this.findNeighbour(n,bs)!=null||this.findNeighbour(n,Eh)!=null)return!0;const s=this.findNeighbourValue(n,tV);return s===bs||s===Eh}return!1}dangerouslyGetUserOption(e){if(this.userPartialOptions){const i=qn(this.userPartialOptions,e);if(i!=null)return i}return qn(this.userOptions,e)}hasThemeOverride(e){if(this.overrides==null)return!1;if(e[0]==="axes"&&e.length>1){const i=this.getResolvedPath(["axes",e[1],"type"]);if(zy(this.overrides,["common","axes",i,...e.slice(2)]))return!0;const n=this.getResolvedPath(["series","0","type"]);return zy(this.overrides,[n,"axes",i,...e.slice(2)])}if(e[0]==="series"&&e.length>1){const i=this.getResolvedPath(["series",e[1],"type"]);return zy(this.overrides,[i,"series",...e.slice(2)])}return zy(this.overrides,e)}getParamValue(e){if(this.resolvedParams[e]!=null)return this.resolvedParams[e];const i=this.findVertexAlongEdge(this.params,[e],ki);if(!i)return;const n=this.findNeighbour(i,yi);if(!n)return;const s=this.resolveVertexValue(i,n);return this.resolvedParams[e]=s,s}getPathArray(e){return this.findNeighbourValue(e,Go)??[]}getResolvedPath(e){return qn(this.resolved,e)}getCachedValue(e,i){const n=[...e,i].join(".");return Zn.valueCache.get(n)}setCachedValue(e,i,n){const s=[...e,i].join(".");Zn.valueCache.set(s,n)}prune(e,i){this.addEdge(e,this.addVertex(i),JB)}resolveVertexValue(e,i){this.resolveVertexDependencies(i);const n=this.findNeighbourValue(i,Qr);if(n&&By(n)){const a=this.neighboursWithEdgeValue(i,Jr),o=eb[n],l=(typeof o=="function"?o:o.resolve)?.(this,e,a??[]);return l===Fa?void 0:l}let s=this.getVertexValue(i);if(Array.isArray(s)){const a={};this.resolveVertexChildren(i,a),s=qn(a,this.getPathArray(e))}return this.resolveValueOrSymbol(s)}resolveValue$1(e){for(let i=e.length;i>=0;i--){const n=e.slice(0,i).join("."),s=this.value$1.get(n);if(s!=null)return s}}graftConfig(e,i,n){const s=qn(this.config,i),a=this.findNeighbour(e,Go);if(Bt(s)&&this.buildGraphFromObject(e,yi,s,a,void 0,n),this.overrides){const o=qn(this.overrides,i);Bt(o)&&this.buildGraphFromObject(e,ka,o,a,void 0,n);const r=qn(this.overrides,["common",...i.slice(1)]);Bt(r)&&this.buildGraphFromObject(e,ka,r,a,void 0,n)}this.buildDependencyGraph()}graftObject(e,i,n,s=this.graftEdge){const a=this.findNeighbour(e,Go);if(this.buildGraphFromObject(e,s,i,a),this.overrides&&n)for(const o of n){if(o==null)continue;const r=qn(this.overrides,o);r&&this.buildGraphFromObject(e,ka,r,a)}this.buildDependencyGraph()}graftValue(e,i,n,s,a=this.graftEdge){const o=[...this.getPathArray(e),i],r=this.findVertexAtPath(o)??this.addVertex(i);this.value$1.set(o.join("."),s),this.buildGraphFromValue(e,r,a,o,n),this.buildDependencyGraph()}graftAndResolveOrphan(e,i){const n={},s=this.addVertex(n),a=this.getPathArray(e);return this.graftAndResolveChildren(i,s,a,[]),this.resolveVertex(s,n),qn(n,a)}graftAndResolveOrphanValue(e,i,n,s,a=this.graftEdge){const o={},r=this.addVertex(o),c=[...this.getPathArray(e),i],u=this.findVertexAtPath(c)??this.addVertex(i);return this.value$1.set(c.join("."),s),this.buildGraphFromValue(r,u,a,c,n),this.resolveVertex(r,o),qn(o,c)}buildGraphFromObject(e,i,n,s,a=Zn.SHALLOW_KEYS,o){const r=Object.keys(n),l=Db(n,r);if(l){const y=this.addVertex(n);this.addEdge(e,y,i),this.buildGraphFromOperation(y,i,l,s);return}if(r.length===0){this.addEdge(e,this.addVertex(Array.isArray(n)?[]:{}),i),this.buildGraphAutoEnable(e,i,n,void 0);return}const c=this.getVertexChildrenByKey(e),u=s?this.getVertexValue(s):[];let d;Array.isArray(n)&&this.addEdge(e,this.addVertex(i),tV);const g=[...u],f=u.length;for(const y of r){if(o?.has(y))continue;const x=c?.get(y)??this.addVertex(y);g[f]=y,a?.has(y)?this.buildShallowGraphFromValue(e,x,i,g,n[y]):this.buildGraphFromValue(e,x,i,g,n[y],a),y==="enabled"&&(d=x)}this.buildGraphAutoEnable(e,i,n,d)}buildGraphAutoEnable(e,i,n,s){if(i===yi&&!s||i===bs&&s||i!==yi&&i!==bs&&i!==Eh&&i!==ka)return;let a=this.findNeighbour(e,zC);a||(a=this.addVertex(zC),this.addEdge(e,a,zC)),s&&this.addEdge(s,a,QB);const{enabled:o,_enabledFromTheme:r}=n;this.addEdge(a,this.addVertex({enabled:o,_enabledFromTheme:r,keys:Object.keys(n).length}),i)}getVertexChildrenByKey(e){const i=this.neighboursWithEdgeValue(e,ki);if(!i)return;const n=new Map;for(const s of i)n.set(this.getVertexValue(s),s);return n}buildGraphFromValue(e,i,n,s,a,o){this.addEdge(e,i,ki);let r=this.findNeighbour(i,Go);r||(r=this.addVertex([...s]),this.addEdge(i,r,Go));const l=Db(a);if(l){const c=this.addVertex(a);this.addEdge(i,c,n),this.addEdge(c,r,Go),this.buildGraphFromOperation(c,n,l,r)}else if(Pb(a))this.buildGraphFromObject(i,n,a,r,o);else{const c=this.findNeighbour(i,n);if(c&&this.getVertexValue(c)===a)return;const u=this.addVertex(a);this.addEdge(i,u,n)}}buildShallowGraphFromValue(e,i,n,s,a){this.addEdge(e,i,ki);let o=this.findNeighbour(i,Go);o||(o=this.addVertex([...s]),this.addEdge(i,o,Go));const r=this.addVertex(a);this.addEdge(i,r,n)}buildGraphFromOperation(e,i,n,s){const a=this.addVertex(n.operation);this.addEdge(e,a,Qr);for(const o of n.values)this.buildGraphFromOperationValue(e,o,i,s)}buildGraphFromOperationValue(e,i,n,s=this.EMPTY_PATH_ARRAY_VERTEX){const a=this.addVertex(i);this.addEdge(e,s,Go),this.addEdge(e,a,Jr);const o=Db(i);o?this.buildGraphFromOperation(a,n,o,s):Pb(i)&&this.buildGraphFromObject(a,n,i,s)}buildDependencyGraph(){for(let e=0;e1&&!this.resolvedRootAncestorsPaths.has(a)){const o=this.findVertexAtPath([a]);if(o){this.resolveVertex(o,i,n);return}}if(this.userPartialOptions==null&&i===this.resolved&&s.length>0){const o=qn(i,s);if(o!=null&&!Ie(o))return}this.resolveVertexInEdgePriority(e,i,s,n),this.resolveVertexAutoEnable(e,i,s),this.resolveVertexChildren(e,i,n)}resolveVertexInEdgePriority(e,i,n,s){const a=this.neighboursWithEdgeValue(e,ki),[o]=this.edgePriority;for(const r of this.edgePriority){const l=this.findNeighbour(e,r);if(l==null)continue;const c=this.resolveVertexValueInternal(e,l);if(!(c==null&&r!==o)&&!(a&&a.length>0&&r!==o)&&!(Array.isArray(s)&&s.includes(r))){if(this.hasUnsafeClearKeys||(this.hasUnsafeClearKeys=c!=null&&Zn.UNSAFE_CLEAR_KEYS.has(n.at(-1))),n.length===0){if(c==null)continue;this.resolved=c}else Pg(i,n,c);break}}}resolveVertexValueInternal(e,i){this.resolveVertexDependencies(i);const n=this.findNeighbourValue(i,Qr);if(n&&By(n)){const s=this.neighboursWithEdgeValue(i,Jr),a=eb[n],r=(typeof a=="function"?a:a.resolve)?.(this,e,s??[]);return r===Fa?void 0:r}return this.resolveValueOrSymbol(this.getVertexValue(i))}resolveVertexAutoEnable(e,i,n){const s=this.neighboursWithEdgeValue(e,QB)?.[0];if(!s)return;const a=this.findVertexAtPath(n),o=this.findNeighbourValue(s,yi),r=this.findNeighbourValue(s,ka),l=this.findNeighbourValue(s,bs),u=a&&this.findNeighbour(a,bs)!=null?void 0:this.findNeighbourValue(s,Eh);(l!=null&&l.enabled==null||u!=null&&u.enabled==null)&&!o?._enabledFromTheme&&!r?._enabledFromTheme&&Pg(i,n,!0)}resolveVertexChildren(e,i,n){const s=this.neighboursWithEdgeValue(e,ki);if(s){n??(n=this.findNeighbourValue(e,JB));for(const a of s){const o=this.getVertexValue(a);s.length>1&&By(o)||o!=="_enabledFromTheme"&&this.resolveVertex(a,i,n)}}}resolveVertexDependencies(e){const i=this.neighboursWithEdgeValue(e,Qg);if(i)for(const n of i)this.resolveVertex(n)}graftAndResolveChildren(e,i,n,s){const a=this.neighboursWithEdgeValue(e,ki);if(a)for(const o of a){const r=this.getVertexValue(o),l=[...n,r],c=[...s,r],u=this.addVertex(r),d=this.findNeighbourValue(o,yi);this.addEdge(i,u,ki);const g=this.addVertex(l);if(this.addEdge(u,g,Go),Bt(d)){this.buildGraphFromObject(u,yi,d,g);const f=this.findNeighbour(u,yi);this.addEdge(f,this.addVertex(l),Go);const y=this.findNeighbourValue(f,Qr);if(By(y)){const x=this.neighboursWithEdgeValue(f,Jr),S=eb[y];(typeof S=="function"?void 0:S.dependencies)?.(this,f,x??[])}}this.graftAndResolveChildren(o,u,l,c)}}resolveValueOrSymbol(e){return typeof e=="symbol"&&this.internalParams?.has(e)?this.internalParams.get(e):e}snapshot(){hi("snapshot"),this.isRollingBack=!0}rollback(){hi(`rollback ${this.rollbackEdgesFrom.length} edges and ${this.rollbackVertices.length} vertices`);for(let e=0;e0?a.join("."):"root";this.diagramNeighbours(e,o,i,n+1,s);let r=this.diagramKeys.get(o);r||(r=this.diagramKey(o),e.push(` ${r}["${i.value}"]`))}diagramNeighbours(e,i,n,s,a){for(const f of this.neighboursWithEdgeValue(n,ki)??[]){const y=this.getPathArray(f),x=y.length>0?y.join("."):"root";s${l} ${this.diagramLabel(a,o,i)}`)}diagramChildWithNeighbours(e,i,n,s,a,o,r,l){this.diagramChild(e,i,n,s,a,o),this.diagramNeighbours(e,a,o,r+1,l)}};Uu.EDGE_PRIORITY=[bs,ka,yi];Uu.GRAFT_EDGE=yi;Uu.SHALLOW_KEYS=new Set(["context","data","topology"]);Uu.COMPLEX_KEYS=["annotations","axes","series"];Uu.ANNOTATIONS_OPTIONS_KEYS=["axesButtons","data","enabled","optionsToolbar","snap","toolbar","xKey","volumeKey"];Uu.UNSAFE_CLEAR_KEYS=new Set(["itemStyler","styler"]);Uu.valueCache=new Map;var FU=Uu,nV=t=>`'${t}'`,VC="__AXIS_ID_",Td={top:z.X,bottom:z.X,left:z.Y,right:z.Y},Ep=class _n{constructor(e,i,n,s,a,o,r=!1,l){this.themeParameters={},this.optionMetadata=a??{},this.processedOverrides=n??{};let c=null;e instanceof _n?(c=e,this.specialOverrides=c.specialOverrides,o&&(this.userDeltaKeys=new Set(Object.keys(o))),o??(o=or(c.userOptions,i,_n.JSON_DIFF_OPTS)),this.userOptions=le(Hb(o,c.userOptions),{..._n.OPTIONS_CLONE_OPTS_SLOW,seen:[]})):(this.userOptions=le(e??i,{..._n.OPTIONS_CLONE_OPTS_SLOW,seen:[]}),this.specialOverrides=this.specialOverridesDefaults({...s})),this.findSeriesWithUserVisiblity(i,o),r&&this.removeLeftoverSymbols(this.userOptions);const u=e instanceof _n&&o?.data!==void 0&&o?.data?.length!==e.userOptions.data?.length;let d,g,f,y,x,S,D;if(!r&&this.seriesWithUserVisibility==null&&o!==void 0&&_n.isFastPathDelta(o)&&c!=null&&!u?({activeTheme:d,processedOptions:g,fastDelta:f}=this.fastSetup(o,c),y=c.themeParameters,x=c.annotationThemes):(_n.perfDebug("ChartOptions.slowSetup()"),{activeTheme:d,processedOptions:g,themeParameters:y,annotationThemes:x,googleFonts:S,optionsGraph:D}=this.slowSetup(n,o,r)),this.activeTheme=d,this.processedOptions=g,this.fastDelta=f??void 0,this.themeParameters=y,this.annotationThemes=x,this.googleFonts=S,this.optionsGraph=D,l!==void 0&&typeof l=="number"&&!Number.isNaN(l)){const A=performance.now();this.optionsProcessingTime=A-l}Gt.inDevelopmentMode(()=>za(this))}static isFastPathDelta(e){for(const i of Object.keys(e??{}))if(!this.FAST_PATH_OPTIONS.has(i))return _n.perfDebug("ChartOptions.isFastPathDelta() - slow path required due to presence of: ",i),!1;return _n.perfDebug("ChartOptions.isFastPathDelta() - fast path possible."),!0}findSeriesWithUserVisiblity(e,i){for(const n of[e,i]){const s=n?.series;if(Array.isArray(s))for(let a=0;afj(n,i.series?.[s]??{}))?delete e.series:e.series=e.series.map((n,s)=>Hb(n,i.series?.[s]??{})))}slowSetup(e,i,n=!1){let s=le(this.userOptions,_n.OPTIONS_CLONE_OPTS_FAST);i&&(s=Et(i,s),n&&this.removeLeftoverSymbols(s));let a=HB(NM(s.theme));const{presetType:o}=this.optionMetadata;if(o!=null){const S=Ut.getPresetModule(o);if(S){const{validate:D=ts}=S,A=s,I=s.type,w=I==null?void 0:a.presets[I],{cleared:N,invalid:O}=D(A,S.options,"");for(const L of O)pt.warn(L);Xd(O,"")?s={}:(_n.debug(">>> AgCharts.createOrUpdate() - applying preset",N),s=S.create(N,w,()=>this.activeTheme),a=HB(NM(s.theme)))}}this.soloSeriesIntegrity(s),o!=null&&a.templateTheme(s,!1),jB(void 0,s);const r=this.validateSeriesOptions(s),l=Mb(s);if(this.chartDef=Ut.getChartModule(l),!this.chartDef.placeholder){const{validate:S=ts}=this.chartDef,{cleared:D,invalid:A}=S(s,this.chartDef.options,"");for(const I of A)pt.warn(I);s=D}this.validateAxesOptions(s),this.removeDisabledOptions(s);let c=this.processFonts(a.params);c=this.processFonts(s,c),this.processSeriesOptions(s);const u=this.processAxesOptions(s,l),d=Eet(a,s),g=d.resolve(),f=d.resolveParams(),y=d.resolveAnnotationThemes();d.clearSafe();const x=Et(e,g);return jB(this.chartDef.name,x),ett(this.chartDef.name,x,r),this.validateSeriesOptions(x),this.validateAxesOptions(x,u),this.validatePluginOptions(x),this.processMiniChartSeriesOptions(x),x.loadGoogleFonts||c.clear(),_n.debug(()=>["ChartOptions.slowSetup() - processed options",le(x)]),{activeTheme:a,processedOptions:x,themeParameters:f,annotationThemes:y,googleFonts:c,optionsGraph:d}}validatePluginOptions(e){for(const i of Ut.listModulesByType(Le.Plugin)){const n=i.name;if(n in e&&i.options!=null&&(!i.chartType||i.chartType===this.chartDef?.name)){const{cleared:s,invalid:a}=ts(e[n],i.options,i.name);for(const o of a)pt.warn(o);e[n]=s}}}validateSeriesOptions(e){const i=this.chartDef?.name,n=[],s=e.series?.length??0,a=[];let o;for(let r=0;rS.type===Le.Series&&(y||!S.enterprise)&&(!i||S.chartType===i)).map(S=>S.name),"or",nV));const x=iu.get(c.type);if(c.type!=null&&x?.type===Le.Series){a.push(x);continue}pt.warn(c.type==null?`Option \`${l}.type\` is required and has not been provided; expecting ${o}, ignoring.`:`Unknown type \`${c.type}\` at \`${l}.type\`; expecting ${o}, ignoring.`);continue}else if(i&&u.chartType!==i){pt.warn(`Series type \`${u.name}\` at \`${l}.type\` is not supported by chart type \`${i}\`, ignoring.`);continue}if(u.options==null){n.push(c);continue}const{validate:d=ts}=u,{cleared:g,invalid:f}=d(c,u.options,l);for(const y of f)pt.warn(y);Xd(f,l)||n.push(g)}return e.series=n,a}validateAxesOptions(e,i){if(!("axes"in e)||!e.axes)return;const n=this.chartDef?.name,s={};let a;for(const[o,r]of Xe(e.axes)){if(!r)continue;if(r.type==null){s[o]=r;continue}const l=`axes.${i?.get(o)??o}`,c=Ut.getAxisModule(r.type);if(c==null){const f=Ut.isEnterprise();a??(a=yu(Array.from(iu.values()).filter(x=>x.type===Le.Axis&&(f||!x.enterprise)&&x.chartType===n).map(x=>x.name),"or",nV)),iu.get(r.type)?.type!==Le.Axis&&pt.warn(`Unknown type \`${r.type}\` at \`${l}.type\`; expecting one of ${a}, ignoring.`);continue}else if(c.chartType!==n){pt.warn(`Axis type \`${c.name}\` at \`${l}.type\` is not supported by chart type \`${n}\`, ignoring.`);break}const{validate:u=ts}=c,{cleared:d,invalid:g}=u(r,c.options,l);for(const f of g)pt.warn(f);Xd(g,l)||(s[o]=d)}e.axes=s}diffOptions(e){return this===e?{}:e==null?this.processedOptions:this.fastDelta??or(e.processedOptions,this.processedOptions,_n.JSON_DIFF_OPTS)}optionsType(e){return e.series?.[0]?.type??"line"}processSeriesOptions(e){const i=e.displayNullData,n=e.series?.map(s=>{const o=!!Ut.getSeriesModule(s.type)?.options?.visible,r={};return o&&(r.visible=!0),i!==void 0&&s.allowNullKeys===void 0&&(r.allowNullKeys=i),Et(this.getSeriesGroupingOptions(s),s,r)});e.series=this.setSeriesGroupingOptions(n??[])}processAxesOptions(e,i){const n=i==="polar"?[z.Angle,z.Radius]:[z.X,z.Y],s="axes"in e&&Object.keys(e.axes??{}).length>0,a=this.countNonDefaultSeriesAxisKeys(e,n),o=a>0,r=o&&a<(e?.series?.length??0),l=e.series?.[0],c=this.optionsType(e),u=this.predictAxes(c,n,l,e.data)??this.cloneDefaultAxes(c),d=Bt(l)&&"direction"in l&&l.direction==="horizontal"&&Ut.getSeriesModule(l.type)?.axisKeysFlipped!=null;if(!s&&!o&&!d){e.axes=u;return}const g="axes"in e?new Set(Object.keys(e.axes??{})):new Set,f=this.getPrimaryAxisKeys(e,n,g,o),y=this.getRemappedAxisKeys(g,f,n,r),x={},S=new Map;for(const[D,A]of y)x[A]="axes"in e?Gd(e.axes?.[D]):void 0,S.set(A,D);return this.remapSeriesAxisKeys(e,n,x,y,u,r),this.predictAxesMissingTypesAndPositions(e,n,x,u),this.alternateSecondaryAxisPositions(e,x,S),e.axes=x,S}getSeriesDirectionAxisKey(e,i){const n=Ut.getSeriesModule(e.type);return n?"direction"in e&&e.direction==="horizontal"&&n.axisKeysFlipped?n.axisKeysFlipped[i]:n.axisKeys?.[i]:void 0}countNonDefaultSeriesAxisKeys(e,i){let n=0;for(const s of e.series??[])for(const a of i){const o=this.getSeriesDirectionAxisKey(s,a);!o||!jd(o,s)||s[o]!==a&&n++}return n}getPrimaryAxisKeys(e,i,n,s){const a=new Map;for(const o of i){let r=!1;if("axes"in e&&e.axes&&!(o in e.axes&&Bt(e.axes[o])&&!("position"in e.axes[o]))){for(const[l,c]of Xe(e.axes))if("position"in c&&c.position&&o===Td[c.position]){a.set(o,l),r=!0;break}}if(!r&&s)for(const l of e.series??[]){const c=this.getSeriesDirectionAxisKey(l,o);if(!c)continue;const u=l[c];if(!n.has(u)){if(!u){a.set(o,o);break}a.set(o,u);break}}}if(n.size===0||!("axes"in e)||!e.axes)return a;if(a.size===0)for(const o of i)o in e.axes&&a.set(o,o);if(a.size===0){for(const o of i)for(const[r,l]of Xe(e.axes))if(l.type?.startsWith(o)){a.set(o,r);break}}if(a.size===0&&(e.series?.length??0)>0)for(const o of i)for(const r of e.series){const l=this.getSeriesDirectionAxisKey(r,o);if(!l)continue;const c=r[l];if(n.has(c)){a.set(o,c);break}}if(a.size<2){const o=new Set(a.values());for(const[r,l]of Xe(e.axes))if(!(o.has(r)||"position"in l)){for(const c of i)if(!a.has(c)){a.set(c,r),o.add(r);break}if(a.size===2)break}}return a}getRemappedAxisKeys(e,i,n,s){const a=new Map;for(const[o,r]of i)a.set(r,o);for(const o of e)a.has(o)||a.set(o,`${VC}${a.size}`);if(s)for(const o of n)a.has(o)||a.set(o,`${VC}${a.size}`);return a}remapSeriesAxisKeys(e,i,n,s,a,o){for(const r of e.series??[])for(const l of i){const c=this.getSeriesDirectionAxisKey(r,l);if(!c)continue;n[l]??(n[l]=Gd(a[l]));let u=l;if(c in r){const d=r[c];s.has(d)?u=s.get(d):(u=`${VC}${s.size}`,s.set(d,u),n[u]=Gd(a[l]))}else s.has(l)&&o&&(u=s.get(l),n[u]??(n[u]=Gd(a[l])));r[c]=u}}predictAxes(e,i,n,s){if(!n)return;const a=n?.data??s;if(!a?.length)return;const o=Ut.getSeriesModule(e)?.predictAxis;if(!o)return;const r=new Map,l=HH(0,a.length-1,5);for(const c of l){const u=a[c];for(const d of i){const g=o(d,u,n);if(!r.has(d)){r.set(d,g);continue}const f=r.get(d);if(!(!g&&!f)){if(!g||!f)return;for(const y of Object.keys(f))if(f[y]!==g[y])return}}}for(const[c,u]of r)u||r.delete(c);if(r.size!==0){if(r.size===1){const[c]=r.values(),u=this.cloneDefaultAxes(e);return"position"in c?af(u,d=>"position"in d&&d.position===c.position?c:d):void 0}return Object.fromEntries(r)}}cloneDefaultAxes(e){const i=Ut.getSeriesModule(e);return i?.defaultAxes?le(i.defaultAxes):{}}predictAxesMissingTypesAndPositions(e,i,n,s){for(const[a,o]of Xe(n)){if(!Ie(o)||"type"in o&&"position"in o)continue;if(a in s){o.type??(o.type=s[a].type),o.position??(o.position=s[a].position);continue}this.predictAxisMissingTypeFromPosition(o,s)||(this.predictAxisMissingTypeAndPositionFromSeries(e,i,a,o,s),"type"in o||delete n[a])}}predictAxisMissingTypeFromPosition(e,i){if(!("position"in e)||!jd(e.position,Td))return!1;for(const n of Object.values(i))if(jd(n.position,Td)&&Td[e.position]===Td[n.position])return e.type=n.type,!0;for(const[n,s]of Xe(Td))if(e.position!==n&&s===Td[e.position])return e.type=i[s].type,!0;return!1}predictAxisMissingTypeAndPositionFromSeries(e,i,n,s,a){for(const o of e.series??[])for(const r of i){const l=this.getSeriesDirectionAxisKey(o,r);if(!(!l||!jd(l,o))&&o[l]===n)return s.type??(s.type=a[r].type),s.position??(s.position=a[r].position),r===z.Y}return!1}alternateSecondaryAxisPositions(e,i,n){let s=0,a=0;for(const[o,r]of Xe(i)){if(!Ie(r)||!("position"in r))continue;const l=n.get(o),c="axes"in e&&e.axes&&l&&l in e.axes?e.axes[l]:void 0,u=c&&"position"in c?c.position:void 0;if(r.position==="top"||r.position==="bottom"?(s+=1,s===2&&u==null&&(r.position="top")):(r.position==="left"||r.position==="right")&&(a+=1,a===2&&u==null&&(r.position="right")),s>1&&a>1)break}}processMiniChartSeriesOptions(e){const i=e.navigator?.miniChart?.series;i!=null&&(e.navigator.miniChart.series=this.setSeriesGroupingOptions(i))}getSeriesGroupingOptions(e){const{groupable:i,stackable:n,stackedByDefault:s=!1}=Ut.getSeriesModule(e.type);e.grouped&&!i&&pt.warnOnce(`unsupported grouping of series type "${e.type}".`),(e.stacked||e.stackGroup)&&!n&&pt.warnOnce(`unsupported stacking of series type "${e.type}".`);let{grouped:a,stacked:o}=e;return o??(o=(s||e.stackGroup!=null)&&!(i&&a)),a??(a=!0),{stacked:n&&o,grouped:i&&a&&!(n&&o)}}setSeriesGroupingOptions(e){const i=this.getSeriesGrouping(e);_n.debug("ChartOptions.setSeriesGroupingOptions() - series grouping: ",i);const n={},s=i.reduce((a,o)=>{var r;return o.groupType==="default"||(a[r=o.seriesType]??(a[r]=0),a[o.seriesType]+=o.groupType==="stack"?1:o.series.length),a},{});return i.flatMap(a=>{var o;switch(n[o=a.seriesType]??(n[o]=0),a.groupType){case"stack":{const r=n[a.seriesType]++;return a.series.map((l,c)=>Object.assign(l,{seriesGrouping:{groupId:a.groupId,groupIndex:r,groupCount:s[a.seriesType],stackIndex:c,stackCount:a.series.length}}))}case"group":return a.series.map(r=>Object.assign(r,{seriesGrouping:{groupId:a.groupId,groupIndex:n[a.seriesType]++,groupCount:s[a.seriesType],stackIndex:0,stackCount:0}}))}return a.series}).map(({stacked:a,grouped:o,...r})=>r)}getSeriesGroupId(e){return[e.type,e.xKey,e.stacked?e.stackGroup??"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(e){const i=new Map;return e.reduce((n,s)=>{const a=s.type;if(!s.stacked&&!s.grouped)n.push({groupType:"default",seriesType:a,series:[s],groupId:"__default__"});else{const o=this.getSeriesGroupId(s);if(!i.has(o)){const l={groupType:s.stacked?"stack":"group",seriesType:a,series:[],groupId:o};i.set(o,l),n.push(l)}i.get(o).series.push(s)}return n},[])}soloSeriesIntegrity(e){if(!qt(e.series))return;const i=s=>Ut.getSeriesModule(s)?.solo??!1,n=e.series;if(n&&n.length>1&&n.some(s=>i(s.type))){const s=this.optionsType(e);if(i(s))pt.warn(`series[0] of type '${s}' is incompatible with other series types. Only processing series[0]`),e.series=n.slice(0,1);else{const{solo:a,nonSolo:o}=px(n,l=>i(l.type)?"solo":"nonSolo"),r=ZM(a.map(l=>l.type)).join(", ");pt.warn(`Unable to mix these series types with the lead series type: ${r}`),e.series=o}}}static processFontOptions(e,i,n,s=new Set){if(typeof e=="object"&&"fontFamily"in e)if(Array.isArray(e.fontFamily)){const a=[];for(const o of e.fontFamily)typeof o=="object"&&"googleFont"in o?(a.push(o.googleFont),s?.add(o.googleFont)):a.push(o);e.fontFamily=a.join(", ")}else typeof e.fontFamily=="object"&&"googleFont"in e.fontFamily&&(e.fontFamily=e.fontFamily.googleFont,s?.add(e.fontFamily));return s}processFonts(e,i=new Set){return Ic(e,_n.processFontOptions,new Set(["data","theme"]),void 0,void 0,i)}static removeDisabledOptionJson(e){if("enabled"in e&&e.enabled===!1)for(const i of Object.keys(e))i!=="enabled"&&delete e[i]}removeDisabledOptions(e){Ic(e,_n.removeDisabledOptionJson,new Set(["data","theme","contextMenu","ranges"]))}static removeLeftoverSymbolsJson(e){if(!(!e||!Bt(e)))for(const i of Object.keys(e)){const n=e[i];hb(n)&&delete e[i]}}removeLeftoverSymbols(e){Ic(e,_n.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(e){if(e.window==null?e.window=Ml():GH(e.window),e.document==null?e.document=bp():jH(e.document),e.window==null)throw new Error("AG Charts - unable to resolve global window");if(e.document==null)throw new Error("AG Charts - unable to resolve global document");return e}};Ep.OPTIONS_CLONE_OPTS_SLOW={shallow:new Set(["data","container"]),assign:new Set(["context","theme"])};Ep.OPTIONS_CLONE_OPTS_FAST={shallow:new Set(["container"]),assign:new Set(["data","context","theme"])};Ep.JSON_DIFF_OPTS=new Set(["data","localeText"]);Ep.perfDebug=Gt.create(!0,"perf");Ep.FAST_PATH_OPTIONS=new Set(["data","width","height","container"]);Ep.debug=Gt.create(!0,"opts");var Ab=Ep,U0=Gt.create(!0,"opts"),Rh="AG Charts - Chart was destroyed, cannot perform request.",Ib=class{constructor(e,i,n){this.factoryApi=i,this.licenseManager=n,this.chart=e}async update(e){if(!this.chart)throw new Error(Rh);return U0.group("AgChartInstance.update()",async()=>{const i=Gt.check("scene:stats","scene:stats:verbose")?performance.now():void 0;this.factoryApi.update(e,this,void 0,i),await this.chart?.waitForUpdate()})}async updateDelta(e){if(!this.chart)throw new Error(Rh);return U0.group("AgChartInstance.updateDelta()",async()=>{const i=Gt.check("scene:stats","scene:stats:verbose")?performance.now():void 0;this.factoryApi.updateUserDelta(this,e,i),await this.chart?.waitForUpdate()})}getOptions(){if(!this.chart)throw new Error(Rh);const e=le(this.chart.getOptions(),Ab.OPTIONS_CLONE_OPTS_FAST);for(const i of Object.keys(e))i.startsWith("_")&&delete e[i];return e}waitForUpdate(){if(!this.chart)throw new Error(Rh);return this.chart.waitForUpdate()}applyTransaction(e){const{chart:i}=this;if(!i)throw new Error(Rh);if(e==null||typeof e!="object")throw new Error("AG Charts - applyTransaction expects a transaction object.");const{add:n,addIndex:s,remove:a,update:o}=e;if(n!=null&&!Array.isArray(n))throw new Error('AG Charts - transaction "add" must be an array.');if(s!=null){if(typeof s!="number"||!Number.isSafeInteger(s)||s<0)throw new Error('AG Charts - transaction "addIndex" must be a safe non-negative integer (0 to 9007199254740991).');if(n==null||n.length===0)throw new Error('AG Charts - transaction "addIndex" requires a non-empty "add" array.')}if(a!=null&&!Array.isArray(a))throw new Error('AG Charts - transaction "remove" must be an array.');if(o!=null&&!Array.isArray(o))throw new Error('AG Charts - transaction "update" must be an array.');return U0.group("AgChartInstance.applyTransaction()",async()=>{if(!i.isDataTransactionSupported()){const r=i.data.deepClone();return r.addTransaction(e),r.commitPendingTransactions(),this.updateDelta({data:r.data})}return U0("transaction",e),this.chart?.applyTransaction(e)})}async download(e){if(!this.chart)throw new Error(Rh);const i=await this.prepareResizedChart(this,this.chart,e);try{i.chart?.download(e?.fileName,e?.fileFormat)}finally{i.destroy()}}async __toSVG(e){if(!this.chart)throw new Error(Rh);const i=await this.prepareResizedChart(this,this.chart,{width:600,height:300,...e});try{return i?.chart?.toSVG()}finally{i?.destroy()}}async getImageDataURL(e){if(!this.chart)throw new Error(Rh);const i=await this.prepareResizedChart(this,this.chart,e);try{return i.chart.getCanvasDataURL(e?.fileFormat)}finally{i.destroy()}}getState(){return this.factoryApi.caretaker.save(...this.getEnabledOriginators())}async setState(e){if(!this.chart)return;const{interactionManager:i,legendManager:n,zoomManager:s}=this.chart.ctx,a=this.getEnabledOriginators(),o=new Set(a);i.isState(2)||(o.has(n)&&o.has(s)?(o.delete(s),await this.setStateOriginators(e,Array.from(o)),await this.setStateOriginators(e,[s])):await this.setStateOriginators(e,a))}resetAnimations(){this.chart?.resetAnimations()}skipAnimations(){this.chart?.skipAnimations()}destroy(){this.releaseChart?(this.releaseChart(),this.releaseChart=void 0):this.chart&&(this.chart.publicApi=void 0,this.chart.destroy()),this.chart=void 0}async prepareResizedChart(e,i,n={}){const s=n.width??i.width??i.ctx.scene.canvas.width,a=n.height??i.height??i.ctx.scene.canvas.height,o=e.getState(),r=i.chartOptions.specialOverrides.document??bp(),l={...i.chartOptions.processedOverrides,container:r.createElement("div"),width:s,height:a};n.width!=null&&n.height!=null&&(l.overrideDevicePixelRatio=1);const c=i.getOptions();if(Ut.isEnterprise()){l.animation={enabled:!1};const S=this.licenseManager?.getWatermarkForegroundConfigForBrowser();S&&(l.foreground=S)}const u={...i.chartOptions.specialOverrides},d={...i.chartOptions.optionMetadata},g=await this.chart?.ctx.dataService.getData(),f=this.factoryApi.create(c,l,u,d,g);o.legend&&this.syncLegend(i,f,o),f.chart?.update(Ct.FULL,{forceNodeDataRefresh:!0}),await f.waitForUpdate(),await f.setState(o);const y={source:"chart-update",sourceDetail:"internal-prepareResizedChart"};f.chart?.ctx.zoomManager.updateZoom(y,i.ctx.zoomManager.getZoom()),f.chart?.update(Ct.FULL,{forceNodeDataRefresh:!0}),await f.waitForUpdate();const x=[];for(const S of i.modulesManager.legends())x.push(S.legend.pagination?.currentPage??0);for(const S of f.chart.modulesManager.legends()){const D=x.shift()??0;S.legend.pagination&&S.legend.pagination.setPage(D)}return f.chart?.update(Ct.FULL,{forceNodeDataRefresh:!0}),await f.waitForUpdate(),f}syncLegend(e,i,n){const s=new Map;for(const[a,o]of e.series.entries()){const r=i.chart?.series[a];r&&s.set(o.id,r.id)}n.legend=n.legend?.map(a=>({...a,seriesId:s.get(a.seriesId??"")??a.seriesId}))}getEnabledOriginators(){if(!this.chart)return[];const{chartOptions:{processedOptions:e,optionMetadata:i},ctx:{annotationManager:n,chartTypeOriginator:s,zoomManager:a,legendManager:o},modulesManager:r}=this.chart,l=[];return"annotations"in e&&e.annotations?.enabled&&l.push(n),i.presetType==="price-volume"&&l.push(s),(e.navigator?.enabled||e.zoom?.enabled)&&l.push(a),r.isEnabled("legend")&&e.legend?.enabled!==!1&&l.push(o),l.push(this.chart.ctx.activeManager),l}async setStateOriginators(e,i){this.factoryApi.caretaker.restore(e,...i),this.chart?.ctx.eventsHub.emit("chart:request-update",{type:Ct.PROCESS_DATA,opts:{forceNodeDataRefresh:!0}}),await this.chart?.waitForUpdate()}};Ib.chartInstances=new WeakMap;T([Pe({oldValue(t){t.destroyed||(t.publicApi=void 0),Ib.chartInstances.delete(t)},newValue(t){t&&(t.publicApi=this,Ib.chartInstances.set(t,this))}})],Ib.prototype,"chart",2);var sV=Ib,Pet=1e3,uL=class jh{constructor(e,i,n,s,a,o=Pet){this.name=e,this.buildItem=i,this.releaseItem=n,this.destroyItem=s,this.maxPoolSize=a,this.cleanupTimeMs=o,this.freePool=[],this.busyPool=new Set}static getPool(e,i,n,s,a){return this.pools.has(e)||this.pools.set(e,new jh(e,i,n,s,a)),this.pools.get(e)}isFull(){return this.freePool.length+this.busyPool.size>=this.maxPoolSize}hasFree(){return this.freePool.length>0}obtain(e){if(!this.hasFree()&&this.isFull())throw new Error("AG Charts - pool exhausted");let i=this.freePool.pop();return i==null?(i=this.buildItem(e),jh.debug(()=>[`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i])):jh.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i]),this.busyPool.add(i),{item:i,release:()=>this.release(i)}}obtainFree(){const e=this.freePool.pop();if(e==null)throw new Error("AG Charts - pool has no free instances");return jh.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,e]),this.busyPool.add(e),{item:e,release:()=>this.release(e)}}release(e){if(!this.busyPool.has(e))throw new Error("AG Charts - cannot free item from pool which is not tracked as busy.");jh.debug(()=>[`Pool[name=${this.name}]: Releasing instance (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,e]),this.releaseItem(e),this.busyPool.delete(e),this.freePool.push(e),jh.debug(()=>[`Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,e]);const i=Date.now(),n=i+this.cleanupTimeMs*.5;this.cleanPoolTimer&&(this.cleanPoolDue??1/0)[`Pool[name=${this.name}]: Cleaned pool of ${e.length} items (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`])}destroy(){this.cleanPool();for(const e of this.busyPool.values())this.destroyItem(e);this.busyPool.clear()}};uL.pools=new Map;uL.debug=Gt.create(!0,"pool");var zet=uL,xc=Gt.create(!0,"opts"),Jo=class{static licenseCheck(e){if(e.withinStudio)return;let i=this.licenseManager;return this.licenseChecked||(i=po.licenseManager?.(e),this.licenseManager=i,i?.validateLicense(),this.licenseChecked=!0),i}static getLicenseDetails(e){return po.licenseManager?.({}).getLicenseDetails(e)}static getInstance(e){return aV.getInstance(e)}static create(e,i){const n=Gt.check("scene:stats","scene:stats:verbose")?performance.now():void 0;return xc.group("AgCharts.create()",()=>{e=Gt.inDevelopmentMode(()=>za(le(e)))??e,this.licenseCheck(e);const s=this.licenseCheck(e),a=aV.createOrUpdate({userOptions:e,licenseManager:s,optionsMetadata:i,apiStartTime:n});return s?.isDisplayWatermark()&&po.injectWatermark?.(a.chart.ctx.domManager,s.getWatermarkMessage()),a})}static createFinancialChart(e){return xc.group("AgCharts.createFinancialChart()",()=>this.create(e,{presetType:"price-volume"}))}static createGauge(e){return xc.group("AgCharts.createGauge()",()=>this.create(e,{presetType:"gauge-preset"}))}static __createSparkline(e){return xc.group("AgCharts.__createSparkline()",()=>{const{pool:i,...n}=e;return this.create(n,{presetType:"sparkline",pool:i??!0,domMode:"minimal",withDragInterpretation:!1})})}};Jo.licenseChecked=!1;var ll=class ib{static getInstance(e){const i=QD.getInstance(e);return i?sV.chartInstances.get(i):void 0}static createOrUpdate(e){let{proxy:i}=e;const{userOptions:n,licenseManager:s,processedOverrides:a=i?.chart?.chartOptions.processedOverrides??{},specialOverrides:o=i?.chart?.chartOptions.specialOverrides??{},optionsMetadata:r=i?.chart?.chartOptions.optionMetadata??{},deltaOptions:l,data:c,stripSymbols:u=!1,apiStartTime:d}=e,g=po.styles==null?[]:[["ag-charts-enterprise",po.styles]];if(Ut.listModules().next().done)throw new Error(["AG Charts - No modules have been registered.","","Call ModuleRegistry.registerModules(...) with the modules you need before using AgCharts.create().","","See https://www.ag-grid.com/charts/r/module-registry/ for more details."].join(` +`));xc(()=>[">>> AgCharts.createOrUpdate() user options",le(n)]);const{presetType:f}=r;let y=n;Jo.optionsMutationFn&&y&&(y=Jo.optionsMutationFn(le(y,Ab.OPTIONS_CLONE_OPTS_FAST),f),xc(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",le(y)]));const x=this.getPool(r);let S=!1,D,A=i?.chart;A==null&&x?.hasFree()&&(D=x.obtainFree(),A=D.item);const{document:I,window:w,styleContainer:N,skipCss:O,...L}=y??{},R=A?.getChartOptions(),P=new Ab(R,L,a,{...o,document:I,window:w,styleContainer:N,skipCss:O},r,l,u,d);(A==null||Mb(P.processedOptions)!==Mb(A.chartOptions.processedOptions))&&(D?.release(),D=this.getPool(P.optionMetadata)?.obtain(P),D?A=D.item:(S=!0,A=ib.createChartInstance(P,A))),P.optionsGraph&&A.ctx.optionsGraphService.updateCallback((B,F,H)=>P.optionsGraph?.resolvePartial(B,F,H));for(const[B,F]of g)A.ctx.domManager.addStyles(B,F);return A.ctx.fontManager.updateFonts(P.googleFonts),c!=null&&A.ctx.dataService.restoreData(c),i==null?(i=new sV(A,ib.callbackApi,s),i.releaseChart=D?.release):(D||S)&&(i.releaseChart?.(),i.chart=A,i.releaseChart=D?.release),xc.check()&&typeof globalThis.window<"u"&&(globalThis.agChartInstances??(globalThis.agChartInstances={}),globalThis.agChartInstances[A.id]=A),A.queuedUserOptions.push(P.userOptions),A.queuedChartOptions.push(P),A.requestFactoryUpdate(B=>{xc.group(">>>> Chart.applyOptions()",()=>{B.applyOptions(P);const F=B.queuedUserOptions.indexOf(P.userOptions)+1;B.queuedUserOptions.splice(0,F),B.queuedChartOptions.splice(0,F)})}),i}static updateUserDelta(e,i,n){i=le(i,Ab.OPTIONS_CLONE_OPTS_FAST);const s=Ic(i,ib.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);xc(()=>[">>> AgCharts.updateUserDelta() user delta",le(i)]),ib.createOrUpdate({proxy:e,deltaOptions:i,stripSymbols:s,apiStartTime:n})}static createChartInstance(e,i){const n=i?.destroy({keepTransferableResources:!0}),s=Mb(e.processedOptions);return Ut.getChartModule(s).create(e,n)}static getPool(e){if(e.pool===!0)return zet.getPool(e.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}};ll.caretaker=new H1(oi);ll.callbackApi={caretaker:ll.caretaker,create(t,e,i,n,s){return ll.createOrUpdate({userOptions:t,processedOverrides:e,specialOverrides:i,optionsMetadata:n,data:s})},update(t,e,i,n){return ll.createOrUpdate({userOptions:t,proxy:e,specialOverrides:i,apiStartTime:n})},updateUserDelta(t,e,i){return ll.updateUserDelta(t,e,i)}};ll.markRemovedProperties=(t,e,i,n)=>{let s=n??!1;if(typeof t!="object"||t==null)return s;for(const a of hl(t))t[a]===void 0&&(Object.assign(t,{[a]:Symbol("UNSET")}),s||(s=!0));return s};ll.detachAndClear=t=>t.detachAndClear();ll.destroy=t=>t.destroy();var aV=ll,j={};Ap(j,{APPROXIMATE_THRESHOLD:()=>Z7,AbstractBarSeries:()=>oW,AbstractBarSeriesProperties:()=>Jx,AggregationManager:()=>dA,AnchoredPopover:()=>PW,ApproximateOrdinalTimeScale:()=>zit,Arc:()=>Bl,Axis:()=>JT,AxisGroupZIndexMap:()=>g3,AxisInterval:()=>wp,AxisLabel:()=>Mi,AxisTick:()=>Np,BBox:()=>Tt,Background:()=>tm,BandScale:()=>Rr,BaseToolbar:()=>TL,Caption:()=>Ri,CartesianAxis:()=>Gx,CartesianCrossLine:()=>Xs,CartesianSeries:()=>Wu,CartesianSeriesNodeEvent:()=>mL,CartesianSeriesProperties:()=>jr,CategoryAxis:()=>qx,CategoryScale:()=>Of,Chart:()=>QD,ChartAxes:()=>zD,ChartOptions:()=>Ab,CollapseMode:()=>dW,ColorScale:()=>qf,ContextMenuRegistry:()=>$G,ContinuousScale:()=>ti,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>hm,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>um,DEFAULT_POLAR_DIRECTION_KEYS:()=>SW,DEFAULT_POLAR_DIRECTION_NAMES:()=>MW,DOMElementProxy:()=>jS,DOMManager:()=>AG,DataController:()=>l3,DataModel:()=>IN,DataModelSeries:()=>fL,DataSet:()=>Sb,DiscreteTimeAxis:()=>IW,DraggablePopover:()=>zW,DropShadow:()=>zl,ExtendedPath2D:()=>Cf,FillGradientDefaults:()=>Fu,FillImageDefaults:()=>jc,FillPatternDefaults:()=>En,FloatingToolbar:()=>jit,FormatManager:()=>Tf,Group:()=>ee,GroupWidget:()=>IG,HierarchyHighlightState:()=>DW,HierarchyNode:()=>Iit,HierarchySeries:()=>kit,HierarchySeriesProperties:()=>Ku,HighlightManager:()=>qG,HighlightProperties:()=>Hc,HighlightState:()=>QG,Image:()=>dm,InteractionManager:()=>NG,InteractionState:()=>wG,LARGEST_KEY_INTERVAL:()=>YG,Label:()=>Do,LabelStyle:()=>Mo,LayoutElement:()=>XT,Line:()=>mo,LinearScale:()=>np,LogScale:()=>pL,Marker:()=>wn,Menu:()=>Bit,MercatorScale:()=>Cit,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>wr,NativeWidget:()=>Nf,NiceMode:()=>p3,Node:()=>Oc,OrdinalTimeScale:()=>du,PHASE_METADATA:()=>Zb,PanToBBoxScalingModeEnum:()=>s3,Path:()=>Tn,PointerEvents:()=>hG,PolarAxis:()=>wL,PolarSeries:()=>CL,QuadtreeNearest:()=>KU,RadialColumnShape:()=>Gr,Range:()=>El,Rect:()=>On,Rotatable:()=>Qf,RotatableText:()=>MG,SMALLEST_KEY_INTERVAL:()=>KG,Scalable:()=>PD,ScalableGroup:()=>gZ,Scene:()=>HD,Sector:()=>Ts,SectorBox:()=>NW,SegmentedPath:()=>gL,Selection:()=>pn,Series:()=>Wx,SeriesItemHighlightStyle:()=>_u,SeriesMarker:()=>la,SeriesNodeEvent:()=>qD,SeriesNodePickMode:()=>C3,SeriesProperties:()=>Fr,SeriesTooltip:()=>Wc,Shape:()=>Ip,SliderWidget:()=>_T,StopProperties:()=>LT,SvgPath:()=>CW,Text:()=>Pa,TimeAxisParentLevel:()=>cm,TimeScale:()=>Ef,Toolbar:()=>Fit,ToolbarButtonWidget:()=>BW,ToolbarWidget:()=>FD,TooltipManager:()=>IM,Transformable:()=>Ti,TransformableGroup:()=>jg,TransformableText:()=>wf,Translatable:()=>Jf,TranslatableGroup:()=>Ds,TranslatableSvgPath:()=>Pit,UnitTimeScale:()=>eu,ZoomManager:()=>r3,accumulativeValueProperty:()=>kN,addHitTestersToQuadtree:()=>aA,adjustLabelPlacement:()=>QU,angleCategoryAxisOptionsDefs:()=>nL,angleNumberAxisOptionsDefs:()=>H3,animationValidation:()=>Hx,annotationCalloutStylesDefs:()=>rU,annotationChannelTextDefs:()=>iU,annotationCommentStylesDefs:()=>lU,annotationCrossLineStyleDefs:()=>BN,annotationDisjointChannelStyleDefs:()=>aU,annotationFibonacciStylesDefs:()=>VN,annotationLineStyleDefs:()=>wM,annotationLineTextDefs:()=>iA,annotationMeasurerStylesDefs:()=>YS,annotationNoteStylesDefs:()=>cU,annotationOptionsDef:()=>lm,annotationParallelChannelStyleDefs:()=>oU,annotationQuickMeasurerStylesDefs:()=>hU,annotationShapeStylesDefs:()=>_N,annotationTextStylesDef:()=>Xx,boxPlotSeriesThemeableOptionsDef:()=>dU,buildResetPathFn:()=>kL,calculateDataDiff:()=>vW,calculateLabelTranslation:()=>Lit,calculateSegments:()=>nA,candlestickSeriesThemeableOptionsDef:()=>pU,checkCrisp:()=>yW,chordSeriesThemeableOptionsDef:()=>gU,clippedRoundRect:()=>FS,collapsedStartingBarPosition:()=>Jb,computeBarFocusBounds:()=>SL,computeMarkerFocusBounds:()=>cA,coneFunnelSeriesThemeableOptionsDef:()=>fU,createDatumId:()=>As,diff:()=>GD,drawCorner:()=>qy,drawMarkerUnitPolygon:()=>tb,findNodeDatumInArray:()=>JG,findQuadtreeMatch:()=>oA,fixNumericExtent:()=>_a,fromToMotion:()=>dn,funnelSeriesThemeableOptionsDef:()=>mU,generateTicks:()=>M3,getColorStops:()=>gG,getCrossLineValue:()=>u3,getItemId:()=>ZD,getItemStyles:()=>YT,getItemStylesPerItemId:()=>G7,getLabelStyles:()=>Rp,getMarkerStyles:()=>hA,getMissCount:()=>VG,getRadialColumnWidth:()=>TW,getShapeFill:()=>k3,getShapeStyle:()=>RN,groupAccumulativeValueProperty:()=>Wd,hasDimmedOpacity:()=>CN,heatmapSeriesThemeableOptionsDef:()=>yU,initialStatePickedOptionsDef:()=>CG,interpolatePoints:()=>Cb,isTooltipValueMissing:()=>dp,keyProperty:()=>uu,makeSeriesTooltip:()=>zp,mapLineBackgroundSeriesThemeableOptionsDef:()=>vU,mapLineSeriesThemeableOptionsDef:()=>xU,mapMarkerSeriesThemeableOptionsDef:()=>SU,mapShapeBackgroundSeriesThemeableOptionsDef:()=>DU,mapShapeSeriesThemeableOptionsDef:()=>MU,markerEnabled:()=>AL,markerFadeInAnimation:()=>ix,markerSwipeScaleInAnimation:()=>DL,midpointStartingBarPosition:()=>vit,minimumTimeAxisDatumGranularity:()=>$U,motion:()=>Uit,nightingaleSeriesThemeableOptionsDef:()=>AU,normaliseGroupTo:()=>jD,ohlcSeriesThemeableOptionsDef:()=>bU,ordinalTimeAxisOptionsDefs:()=>Zg,pairUpSpans:()=>kb,pathFadeInAnimation:()=>WN,pathMotion:()=>EM,pathSwipeInAnimation:()=>IL,plotAreaPathFill:()=>bW,plotInterpolatedLinePathStroke:()=>XS,plotLinePathStroke:()=>xL,predictCartesianFinancialAxis:()=>Bet,predictCartesianNonPrimitiveAxis:()=>Zx,prepareAreaFillAnimationFns:()=>xW,prepareBarAnimationFunctions:()=>tx,prepareLinePathPropertyAnimation:()=>vL,processedDataIsAnimatable:()=>rr,pyramidSeriesThemeableOptionsDef:()=>IU,radarAreaSeriesThemeableOptionsDef:()=>kU,radarLineSeriesThemeableOptionsDef:()=>CU,radialBarSeriesThemeableOptionsDef:()=>wU,radialColumnSeriesThemeableOptionsDef:()=>NU,radiusCategoryAxisOptionsDefs:()=>G3,radiusNumberAxisOptionsDefs:()=>j3,rangeAreaSeriesThemeableOptionsDef:()=>TU,rangeBarSeriesThemeableOptionsDef:()=>LU,resetAxisLabelSelectionFn:()=>CM,resetBarSelectionsDirect:()=>LM,resetBarSelectionsFn:()=>ex,resetLabelFn:()=>Pp,resetMarkerFn:()=>rA,resetMarkerPositionFn:()=>nx,resetMarkerSelectionsDirect:()=>lA,resetMotion:()=>Qn,sankeySeriesThemeableOptionsDef:()=>OU,sectorBox:()=>kW,seriesLabelFadeInAnimation:()=>Wi,seriesLabelFadeOutAnimation:()=>$S,stackCartesianSeries:()=>ZU,standaloneChartOptionsDefs:()=>wq,sunburstSeriesThemeableOptionsDef:()=>EU,toHierarchyHighlightString:()=>sb,toHighlightString:()=>em,topologyChartOptionsDefs:()=>Cq,trailingAccumulatedValueProperty:()=>A7,treemapSeriesThemeableOptionsDef:()=>RU,updateClipPath:()=>OM,updateLabelNode:()=>qU,upsertNodeDatum:()=>ML,userInteraction:()=>sQ,validateCrossLineValue:()=>d3,valueProperty:()=>Ci,visibleRangeIndices:()=>Qb,waterfallSeriesThemeableOptionsDef:()=>PU});function oV(t){return t.isReversed()!==t.range[1]oV(c?e:i)?c?n.width+g:n.height+f:c?-g:-f,x=()=>oV(c?e:i)?c?-g:-f:c?n.width+g:n.height+f;return(D=>{const A=[];let I=-1;for(let w=0;wU.start!=null)?.start;let F=r.convert(O??P)-d,H=r.convert(L??B)+2*d;const $=O!=null&&Number.isNaN(F),Y=L!=null&&Number.isNaN(H);$||Y||(Number.isNaN(F)&&(F=y()),Number.isNaN(H)&&(H=x()),L!=null&&(I=w),A.push({start:F,stop:H,...R}))}return A})(t.segments).map(({stop:D,start:A,...I})=>{const w=c?A:-g,N=c?-f:A,O=c?D+u:n.width+g,L=c?n.height+f:D+u;return{clipRect:{x0:w,y0:N,x1:O,y1:L},...I}})}var HU=new Set(["time","timestamp","date","datetime"]);function dL(t,e,i,{allowPrimitiveTypes:n=!0}={}){if(t!==z.X&&t!==z.Y||!Bt(e))return;const s=jU(t,i);if(s==null||!(s in e))return;const a=e[s],o=GU(t,i),r=Vet(a);if(r)return{type:r,position:o};const l=_et(s,a);if(l)return{type:l,position:o};if(n)return typeof a=="number"?{type:ie.NUMBER,position:o}:{type:ie.CATEGORY,position:o}}function Zx(t,e,i){return dL(t,e,i,{allowPrimitiveTypes:!1})}function Bet(t,e,i){if(t!==z.X||!Bt(e))return;const n=jU(t,i);if(n==null||!(n in e))return;const s=e[n],a=GU(t,i),o=Fet(n,s);if(o)return{type:o,position:a};if(zi(s))return{type:"category",position:a}}function Vet(t){if(qt(t)&&t.every(e=>zi(e)||e===null))return ie.GROUPED_CATEGORY}function _et(t,e){if(aa(e)||HU.has(t)&&Je(e))return ie.TIME}function Fet(t,e){if(aa(e)||HU.has(t)&&Je(e))return ie.ORDINAL_TIME}function jU(t,e){if(t===z.X&&"xKey"in e)return e.xKey;if(t===z.Y&&"yKey"in e)return e.yKey}function GU(t,e){return"direction"in e&&e.direction==="horizontal"?t===z.X?he.LEFT:he.BOTTOM:t===z.X?he.BOTTOM:he.LEFT}var Het={2:(t,e)=>Math.log2(e),[Math.E]:(t,e)=>Math.log(e),10:(t,e)=>Math.log10(e)},jet=(t,e)=>Math.log(e)/Math.log(t);function _C(t,e,i){const n=Math.min(...e),s=Het[t]??jet;return n>=0?s(t,i):-s(t,-i)}var Get={[Math.E]:(t,e)=>Math.exp(e),10:(t,e)=>e>=0?10**e:1/10**-e},Uet=(t,e)=>t**e;function FC(t,e,i){const n=Math.min(...e),s=Get[t]??Uet;return n>=0?s(t,i):-s(t,-i)}var pL=class UU extends ti{constructor(e=[1,10],i=[0,1]){super(e,i),this.type="log",this.defaultClamp=!0,this.base=10,this.log=n=>_C(this.base,this.domain,n),this.pow=n=>FC(this.base,this.domain,n)}static is(e){return e instanceof UU}transform(e){const[i,n]=xi(this.domain);return i>=0!=n>=0?Number.NaN:i>=0?Math.log(e):-Math.log(-e)}transformInvert(e){const[i,n]=xi(this.domain);return i>=0!=n>=0?Number.NaN:i>=0?Math.exp(e):-Math.exp(-e)}toDomain(e){return e}niceDomain(e,i=this.domain){if(i.length<2)return[];const{base:n}=this,[s,a]=i,o=s>a?Math.ceil:Math.floor,r=s>a?Math.floor:Math.ceil,l=FC(n,i,o(_C(n,i,s))),c=FC(n,i,r(_C(n,i,a)));return[e.nice[0]?l:i[0],e.nice[1]?c:i[1]]}ticks({interval:e,tickCount:i=ti.defaultTickCount},n=this.domain,s){if(!n||n.length<2||i<1)return;const a=this.base,[o,r]=n,l=Math.min(o,r),c=Math.max(o,r);let u=this.log(l),d=this.log(c);if(e){const S=O=>O>=l&&O<=c,D=Math.min(Math.abs(e),Math.abs(d-u)),{ticks:A,count:I,firstTickIndex:w}=Df(u,d,D,s),N=A.map(this.pow).filter(S);if(!lp(N.length,this.getPixelRange()))return{ticks:N,count:I,firstTickIndex:w}}if(!S4(a)||d-u>=i){const S=Math.min(d-u,i),{ticks:D,count:A,firstTickIndex:I}=Xf(u,d,S,void 0,void 0,s);return{ticks:D.map(this.pow),count:A,firstTickIndex:I}}const g=[],f=l>0;u=Math.floor(u)-1,d=Math.round(d)+1;const y=Tc(this.range)/i;let x=1/0;for(let S=u;S<=d;S++){const D=this.convert(this.pow(S+1));for(let A=1;A=y&&L>=y;w>=l&&w<=c&&(A===1||R||g.length===0)&&(g.push(w),x=N)}}return dG(g,f,s)}},gL=class extends Tn{constructor(){super(...arguments),this.segmentPath=new Tn}drawPath(t){if(!this.segments||this.segments.length===0){super.drawPath(t);return}t.save();const e=Ob(),i=new e;hf(i,{x0:0,y0:0,x1:t.canvas.width,y1:t.canvas.height},!1);for(const s of this.segments)hf(i,s.clipRect);t.clip(i),super.drawPath(t),t.restore();const{segmentPath:n}=this;n.setProperties({opacity:this.opacity,visible:this.visible,lineCap:this.lineCap,lineJoin:this.lineJoin,pointerEvents:this.pointerEvents});for(const{clipRect:s,fill:a,stroke:o,...r}of this.segments){t.save(),n.path=this.path,n.setProperties(r),n.fill=this.fill==null?"none":a,n.stroke=this.stroke==null?"none":o;const l=new e;hf(l,s),t.clip(l),n.drawPath(t),t.restore()}}};T([TD()],gL.prototype,"segments",2);function hf(t,{x0:e,y0:i,x1:n,y1:s},a=!0){const o=Math.min(e,n),r=Math.min(i,s),l=Math.max(e,n),c=Math.max(i,s);t.moveTo(o,r),a?(t.lineTo(l,r),t.lineTo(l,c),t.lineTo(o,c)):(t.lineTo(o,c),t.lineTo(l,c),t.lineTo(l,r)),t.closePath()}var WU=class extends Ds{constructor(){super(...arguments),this.segments=[],this.scalablePath=new(PD(Tn))}renderInContext(t){if(!this.visible)return;const{ctx:e}=t;if(!this.segments||this.segments?.length===0)return super.renderInContext(t);e.save();const i=Ob(),n=new i;hf(n,{x0:0,y0:0,x1:e.canvas.width,y1:e.canvas.height},!1);for(const a of this.segments)hf(n,a.clipRect);e.clip(n);for(const a of this.children())a.visible&&a.render(t);e.restore();const{scalablePath:s}=this;for(const{clipRect:a,...o}of this.segments){e.save();const r=new i;hf(r,a),e.clip(r),s.setProperties(o);for(const l of this.children())!l.visible||!(l instanceof Tn)||(s.path=l.path,s.setProperties({opacity:l.opacity,lineCap:l.lineCap,lineJoin:l.lineJoin,...pZ(l)&&{scalingX:l.scalingX,scalingY:l.scalingY,scalingCenterX:l.scalingCenterX,scalingCenterY:l.scalingCenterY}}),s.render(t));e.restore()}}};T([TD()],WU.prototype,"segments",2);var KU=class{constructor(t,e,i){this.root=new Yet(t,e,i)}clear(t){this.root.clear(t)}addValue(t,e){const i={hitTester:t,value:e,distanceSquared:(n,s)=>t.distanceSquared(n,s)};this.root.addElem(i)}find(t,e){const i={best:{nearest:void 0,distanceSquared:1/0}};return this.root.find(t,e,i),i.best}},Wet=class{constructor(t,e,i,n){this.nw=t,this.ne=e,this.sw=i,this.se=n}addElem(t){this.nw.addElem(t),this.ne.addElem(t),this.sw.addElem(t),this.se.addElem(t)}find(t,e,i){this.nw.find(t,e,i),this.ne.find(t,e,i),this.sw.find(t,e,i),this.se.find(t,e,i)}},Ket=class{constructor(t,e,i){this.capacity=t,this.maxdepth=e,this.boundary=i??Tt.NaN,this.elems=[],this.subdivisions=void 0}clear(t){this.elems.length=0,this.boundary=t,this.subdivisions=void 0}addElem(t){this.addCondition(t)&&(this.subdivisions===void 0?this.maxdepth===0||this.elems.length1){const o=s>a?Math.ceil:Math.floor,r=s>a?Math.floor:Math.ceil,l=4;for(let c=0;cMath.min(o.minTimeInterval()??1/0,a),1/0);return Number.isFinite(s)?zx(s):XU(t,e,i,n)?.unit}function XU(t,e,i,n){let s=1/0,a=-1/0,o,r=0;const l=[];for(const g of t){if(!g.visible)continue;const{extent:f}=DD(g.getDomain(e));if(f.length===0)continue;const y=f[0].valueOf(),x=f.at(-1).valueOf();l.push(y,x),s=Math.min(s??1/0,y,x),a=Math.max(a??-1/0,y,x);const S=Math.abs(x-y);if(S===0)continue;const D=g.dataCount();if(r=Math.max(r,D),D<=1)continue;const A=S/(D-1);o=Math.min(o??1/0,A)}if(s=Math.min(s,i?.valueOf()??1/0,n?.valueOf()??1/0),a=Math.max(a,i?.valueOf()??-1/0,n?.valueOf()??-1/0),!Number.isFinite(s)||!Number.isFinite(a))return;o??(o=Math.abs(a-s)),o=Math.min(o,$et(l));const c=zx(o);let u=o/Ms(c);r<=2?u=Math.floor(u):u=Math.round(u),u=Math.max(u,1);const d=u===1?void 0:La(c,s);return{unit:c,step:u,epoch:d}}function $et(t){t.sort((i,n)=>i-n);let e=1/0;for(let i=1;i0&&(e=Math.min(e,Math.abs(s-n)))}return e}var fL=class extends Wx{constructor({clipFocusBox:t,categoryKey:e,...i}){super(i),this.categoryKey=e,this.clipFocusBox=t??!0}dataCount(){return this.processedData?.dataSources?.get(this.id)?.data?.length??0}invalidDataCount(){return this.processedData?.invalidDataCount?.get(this.id)??0}missingDataCount(){return this.dataModel?.resolveMissingDataCount(this)??0}get hasData(){return Math.max(0,this.dataCount()-this.invalidDataCount()-this.missingDataCount())>0}getScaleInformation({xScale:t,yScale:e}){const i=ti.is(t),n=ti.is(e);return{isContinuousX:i,isContinuousY:n,xScaleType:t?.type,yScaleType:e?.type}}getModulePropertyDefinitions(){const t=this.axes[z.X]?.scale,e=this.axes[z.Y]?.scale;return this.moduleMap.mapModules(i=>i.getPropertyDefinitions(this.getScaleInformation({xScale:t,yScale:e}))).flat()}async requestDataModel(t,e,i){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:n,processedData:s}=await t.request(this.id,e??Sb.empty(),i);return this.dataModel=n,this.processedData=s,this.events.emit("data-processed",{dataModel:n,processedData:s}),{dataModel:n,processedData:s}}isProcessedDataAnimatable(){const{processedData:t,ctx:e}=this;if(!t)return!1;const i=this.getNodeData();if(i!=null&&i.length>e.animationManager.maxAnimatableItems)return!1;const n=t.reduced?.animationValidation;if(!n)return!0;const{orderedKeys:s,uniqueKeys:a}=n;return s&&a}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}findNodeDatum(t){return JG(t,this.getNodeData(),this.data?.dataIdKey)}pickFocus(t){const e=this.getNodeData();if(e===void 0||e.length===0)return;const i=this.computeFocusDatumIndex(t,e);if(i===void 0)return;const{clipFocusBox:n}=this,s=e[i],a={...t,datumIndex:i},o=this.computeFocusBounds(a);if(o!==void 0)return{bounds:o,clipFocusBox:n,datum:s,datumIndex:i}}pickNodesExactShape(t){const e=super.pickNodesExactShape(t);return e.sort((i,n)=>i.datumIndex-n.datumIndex),e}isDatumEnabled(t,e){const{missing:i=!1,enabled:n=!0,focusable:s=!0}=t[e];return!i&&n&&s}computeFocusDatumIndex(t,e){const i=(o,r)=>{for(;o>=0&&!this.isDatumEnabled(e,o);)o+=r;return o===-1?void 0:o},n=(o,r)=>{for(;o0?s=n(a,t.datumIndexDelta):s=n(a,1)??i(a,-1),s===void 0?t.datumIndexDelta===0?void 0:t.datumIndex-t.datumIndexDelta:s}dataModelPropertyIsKey(t){const{processedData:e}=this;return e?e.defs.keys.some(i=>i.id===t&&i.idsMap?.get(this.id)?.has(t)===!0):!1}keysOrValues(t){const{dataModel:e,processedData:i}=this;return!e||!i?[]:this.dataModelPropertyIsKey(t)?e.resolveKeysById(this,t,i):e.resolveColumnById(this,t,i)}sortOrder(t){const{dataModel:e,processedData:i}=this;if(!(!e||!i))return this.dataModelPropertyIsKey(t)?e.getKeySortOrder(this,t,i):e.getColumnSortOrder(this,t,i)}getCategoryKey(){return this.categoryKey}getCategoryValue(t){const{processedData:e,dataModel:i}=this,n=this.getCategoryKey();return!e||!i||!n||(e.invalidData?.get(this.id)?.[t]??!1)?void 0:this.keysOrValues(n)[t]}datumIndexForCategoryValue(t){const{processedData:e,dataModel:i}=this,n=this.getCategoryKey();if(!e||!i||!n)return;t=t.valueOf();const s=e.invalidData?.get(this.id),a=this.keysOrValues(n);for(let o=0;othis.nodeFactory()),this.highlightLabelSelection=pn.select(this.highlightLabelGroup,Pa),this.annotationSelections=new Set,this.seriesBelowStackContext=void 0,this.debug=Gt.create(),!r||!l)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:t,pathsZIndexSubOrderOffset:e,propertyKeys:r,propertyNames:l,animationResetFns:o,animationAlwaysUpdateSelections:n,animationAlwaysPopulateNodeData:s,datumSelectionGarbageCollection:i,segmentedDataNodes:a},this.paths=t.map(u=>new gL({name:`${this.id}-${u}`})),this.datumSelection=pn.select(this.dataNodeGroup,()=>this.nodeFactory(),i),this.animationState=new Rt("empty",{empty:{update:{target:"ready",action:u=>this.animateEmptyUpdateReady(u)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:u=>this.animateReadyHighlight(u),resize:u=>this.animateReadyResize(u),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:u=>{this.ctx.animationManager.isSkipped()?this.resetAllAnimation(u):this.animateWaitingUpdateReady(u)}},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:u=>this.resetAllAnimation(u),reset:"empty"},clearing:{update:{target:"empty",action:u=>this.animateClearingUpdateEmpty(u)},reset:"empty",skip:"ready"}},this.checkProcessedDataAnimatable.bind(this)),this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",u=>this.onLegendItemClick(u)),this.ctx.eventsHub.on("legend:item-double-click",u=>this.onLegendItemDoubleClick(u)))}get contextNodeData(){return this._contextNodeData}getNodeData(){return this.contextNodeData?.nodeData}getKeyAxis(t){if(this.shouldFlipXY()){if(t===z.X)return this.properties.yKeyAxis;if(t===z.Y)return this.properties.xKeyAxis}if(t===z.X)return this.properties.xKeyAxis;if(t===z.Y)return this.properties.yKeyAxis}attachSeries(t,e,i){super.attachSeries(t,e,i),this.attachPaths(this.paths)}detachSeries(t,e,i){super.detachSeries(t,e,i),this.detachPaths(this.paths)}updatedDomains(){this.animationState.transition("updateData")}attachPaths(t){for(const e of t)this.contentGroup.appendChild(e)}detachPaths(t){for(const e of t)e.remove()}renderToOffscreenCanvas(){const t=this.getNodeData();return t!=null&&t.length>GN}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"?this.animationState.transition("skip"):t==="disabled"&&this.animationState.transition("disable")}destroy(){super.destroy(),this._contextNodeData=void 0}isSeriesHighlighted(t){if(!this.properties.highlight.enabled)return!1;const{series:e,legendItemName:i}=t??{},{legendItemName:n}=this.properties;return e===this||n!=null&&n===i}strokewidthChange(){const t=("strokeWidth"in this.properties&&this.properties.strokeWidth)??0,e=this.properties.highlight.highlightedSeries.strokeWidth??t,i=this.properties.highlight.highlightedItem?.strokeWidth??t;return t>i||e>i}update({seriesRect:t}){const{_contextNodeData:e}=this,i=this.checkResize(t),n=this.updateHighlightSelection(),s=this;this.contentGroup.batchedUpdate(function(){const r=s.updateSelections(),l=s.contextNodeData?.segments;s.opts.segmentedDataNodes?s.dataNodeGroup.segments=l??s.dataNodeGroup.segments:s.dataNodeGroup.segments=void 0,s.updateNodes(n,i||r)});const a=this.getAnimationData(t,e);a&&(i&&this.animationState.transition("resize",a),this.animationState.transition("update",a),this.processedDataUpdated=!1)}createStackContext(){}canIncrementallyUpdateNodes(t=!1){if(this.contextNodeData?.nodeData==null)return!1;const{processedData:i}=this;return i?i.changeDescription!=null||!rr(i)||t:!1}trimIncrementalNodeArray(t,e){e{this.labelSelection=this.updateLabelSelection({labelData:a,labelSelection:e})??e})}getShapeFillBBox(){const{axes:t}=this,e=t[z.X],i=t[z.Y],[n,s]=xi(e?.range??[0,1]),[a,o]=xi(i?.range??[0,1]),r=Lb(this.getSeriesDomain(z.X)),l=[e?.scale.convert(r.at(0)),e?.scale.convert(r.at(-1))],c=Lb(this.getSeriesDomain(z.Y)),u=[i?.scale.convert(c.at(0)),i?.scale.convert(c.at(-1))],[d,g]=xi(l),[f,y]=xi(u);return{axis:new Tt(n,a,s-n,o-a),series:new Tt(d,f,g-d,y-f)}}updateNodes(t,e){const{highlightSelection:i,datumSelection:n}=this,s=!this.ctx.animationManager.isSkipped(),a=this.visible&&this._contextNodeData!=null;this.contentGroup.visible=s||a,this.annotationGroup.visible=s||a,this.highlightGroup.visible=(s||a)&&t,this.updateDatumStyles({datumSelection:i,isHighlight:!0});const o=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateDatumNodes({datumSelection:i,isHighlight:!0,drawingMode:o}),this.highlightLabelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}),this.animationState.transition("highlight",i),this.ctx.eventsHub.emit("highlight:selection-updated",{highlightSelection:i});const{dataNodeGroup:r,labelSelection:l,paths:c,labelGroup:u}=this,{itemId:d}=this.contextNodeData??{};if(this.updatePathNodes({itemId:d,paths:c,visible:a,animationEnabled:s}),r.visible=s||a,u.visible=a,!r.visible)return;this.hasItemStylers()&&this.updateDatumStyles({datumSelection:n,isHighlight:!1});const g=this.strokewidthChange()||this.hasChangesOnHighlight;(e||g)&&(this.updateDatumNodes({datumSelection:n,isHighlight:!1,drawingMode:"overlay"}),this.usesPlacedLabels||this.labelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:l,isHighlight:!1})}))}getHighlightData(t,e){return e?[{...e}]:void 0}getHighlightLabelData(t,e){const i=t.filter(n=>n.datum===e.datum&&n.itemId===e.itemId);return i.length===0?void 0:i}updateHighlightSelection(){const{highlightSelection:t,highlightLabelSelection:e,_contextNodeData:i}=this;if(!i)return!1;const n=this.ctx.highlightManager?.getActiveHighlight(),a=this.isSeriesHighlighted(n)&&n?.datum?n:void 0;if(a==null)return!1;const{nodeData:o,labelData:r}=i,l=this.getHighlightData(o,a);this.highlightSelection=this.updateHighlightSelectionItem({items:l,highlightSelection:t});const c=this.getHighlightLabelData(r,a)??[];return this.highlightLabelSelection=this.updateLabelSelection({labelData:c,labelSelection:e})??e,!0}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:t}of this.datumSelection)t.datum.missing!==!0&&(yield t)}getQuadTree(){if(this.quadtree===void 0){const t=this.ctx.scene?.canvas??{width:0,height:0},e=new Tt(0,0,t.width,t.height);this.quadtree=new KU(100,10,e),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(t){}pickViewportFocus(t){if(this.contextNodeData?.nodeData===void 0)return;const{otherIndex:e,where:i,hoverRect:n}=t;if(i==="data-start")return this.pickFocus({datumIndex:0,datumIndexDelta:0,otherIndex:e,otherIndexDelta:0});if(i==="data-end"){const A=this.contextNodeData.nodeData.length-1;return this.pickFocus({datumIndex:A,datumIndexDelta:0,otherIndex:e,otherIndexDelta:0})}let s,a=0,o,r=this.contextNodeData.nodeData.length-1;const l=this.axes.x?.reverse??!1;function c(A){const I=n.x+n.width;return A.x+A.width<=I}function u(A){return A.x>=n.x}function d(A,I){const w=zN(I);A(w)?(s=I,r=o-1):a=o+1}function g(A,I){const w=zN(I);A(w)?(s=I,a=o+1):r=o-1}const f={"viewport-start + true":{predicate:c,iterator:d},"viewport-start + false":{predicate:u,iterator:d},"viewport-end + true":{predicate:u,iterator:g},"viewport-end + false":{predicate:c,iterator:g}},{predicate:y,iterator:x}=f[`${i} + ${l}`];let S=0;const D=Math.ceil(Math.log2(this.contextNodeData.nodeData.length))+1;for(;a<=r&&S<=D;){o=Math.floor((a+r)/2);const A=this.pickFocus({datumIndex:o,datumIndexDelta:0,otherIndex:e,otherIndexDelta:0});if(A===void 0){pt.error(`pickFocus (datumIndex: ${o}) failed`);return}x(y,A),S++}return s}pickNodeDataExactShape(t){const{x:e,y:i}=t,{dataNodeGroup:n}=this,s=n.pickNodes(e,i).filter(a=>a.datum.missing!==!0);if(s.length!==0)return s.map(o=>o.datum)}pickModulesExactShape(t){for(const e of this.moduleMap.modules()){const{datum:i}=e.pickNodeExact(t)??{};if(i!=null&&i?.missing!==!0)return[i]}}pickNodesExactShape(t){const e=super.pickNodesExactShape(t);return e.length!==0?e:this.pickNodeDataExactShape(t)??this.pickModulesExactShape(t)??[]}pickNodeDataClosestDatum(t){const{x:e,y:i}=t,{axes:n,_contextNodeData:s}=this;if(!s)return;const a=n[z.X],o=n[z.Y],r={x:e,y:i};let l=1/0,c;for(const u of s.nodeData){const{point:{x:d=Number.NaN,y:g=Number.NaN}={}}=u;if(Number.isNaN(d)||Number.isNaN(g)||!(a?.inRange(d)&&o?.inRange(g)))continue;const y=Math.max((r.x-d)**2+(r.y-g)**2,0);yy.isCategoryLike()).map(y=>y.direction);if(e&&c.length===0)return;const[u=z.X]=c,d=[i,n];u!==z.X&&d.reverse();const g=[1/0,1/0];let f;for(const y of a.nodeData){const{x=Number.NaN,y:S=Number.NaN}=y.point??y.midPoint??{};if(Number.isNaN(x)||Number.isNaN(S)||y.missing===!0)continue;const D=[r?.inRange(x,1),l?.inRange(S,1)];if(u!==z.X&&D.reverse(),!D[0]||!o&&!D[1])continue;const A=[x,S];u!==z.X&&A.reverse();let I=!0;for(let w=0;wg[w]){I=!1;break}else N{const u=i?.[c]??c;return this.xCoordinateRange(a[u],o,u)});return rthis.keysOrValues(y));let g=1/0,f=-1/0;for(const[y,x]of c.entries()){const[S,D]=this.xCoordinateRange(x,0,y);if(!(Dl))for(let A=0;Af?[Number.NaN,Number.NaN]:[g,f]}domainForClippedRange(t,e,i){const{processedData:n,dataModel:s,axes:a}=this,o=t===z.X?z.Y:z.X,r=Xet(a[o]);if(!r)return e.flatMap(x=>s.getDomain(this,x,"value",n).domain);const l=this.keysOrValues(i),c=this.sortOrder(i);if(c!=null){const x=Zet(c,l.length,r,S=>l[S]);return s.getDomainBetweenRange(this,e,x,n)}const u=e.map(x=>this.keysOrValues(x)),d=r[0].valueOf(),g=r[1].valueOf();let f=1/0,y=-1/0;for(const[x,S]of l.entries()){const D=S.valueOf();if(!(Dg))for(let A=0;Ay?[Number.NaN,Number.NaN]:[f,y]}zoomFittingVisibleItems(t,e,i,n,s){const{dataModel:a,processedData:o}=this;if(!a||!o)return;const r=this.axes[z.X];if(n!=null)return;const l=this.sortOrder(t);if(l==null)return;const c=this.keysOrValues(t);if(s>c.length)return{x:[0,1],y:void 0};const u=r.scale,d=u.range;u.range=[0,1];let[g,f]=this.visibleRangeIndices(t,i,void 0,{sortOrder:l});f-=1;const y=0;this.xCoordinateRange(c[g],y,g)[0]i[1]&&(f-=1);let x;if(Math.abs(f-g)>=s-1)x=i;else{const S=(i[0]+i[1])/2;for(;Math.abs(f-g)0||fa.resolveColumnById(this,L,o)),c=this.shouldFlipXY(),u=c?this.axes[z.Y]:this.axes[z.X],d=c?this.axes[z.X]:this.axes[z.Y],g=c?n??[0,1]:i,f=c?i:n??[0,1];if(n==null){const L=this.sortOrder(t);if(L!=null){const R=u.scale,P=R.range;R.range=[0,1];const B=this.keysOrValues(t);let[F,H]=this.visibleRangeIndices(t,g,void 0,{sortOrder:L});if(H-=1,Hg[1]&&(H-=1);const Y=Math.abs(H-F)+1;return R.range=P,Y}}const y=(L,R,P)=>L[0]+(P-R[0])/(R[1]-R[0])*(L[1]-L[0]),x=u.range.toSorted(),S=d.range.toSorted(),D=y(x,u.visibleRange,g[0]),A=y(x,u.visibleRange,g[1]),I=y(S,d.visibleRange,Math.min(...f)),w=y(S,d.visibleRange,Math.max(...f)),N=Math.round((g[0]+(g[1]-g[0])/2)*r.length),O=0;return j7(0,r.length-1,N,s,L=>{const[R,P]=this.xCoordinateRange(r[L],O,L),[B,F]=this.yCoordinateRange(l.map(H=>H[L]),O,L);return!Ae(R)||!Ae(P)||!Ae(B)||!Ae(F)?!1:R>=D&&P<=A&&B>=I&&F<=w})}minTimeInterval(){let t;try{t=this.keysOrValues("xValue")}catch{}if(t==null||t.length>1e3)return;let e=1/0,i=t[0],n;for(let s=1;st.convert(n),domain:[i[0],i[1]],range:[e[0],e[1]]}}else if(t instanceof ti){const{range:e,domain:i}=t;return{type:"continuous",domain:[i[0],i[1]],range:[e[0],e[1]]}}else if(t instanceof Rr){if(t instanceof eu){const e=t.getLinearParams(),i=t.getBandCountForUpdate();if(e!=null&&i>0)return{type:"category",variant:"unit-time",firstBandTime:e.firstBandTime,lastBandTime:e.firstBandTime+(i-1)*e.intervalMs,bandCount:i,intervalMs:e.intervalMs,inset:t.inset,step:t.step}}return{type:"category",domain:t.domain,inset:t.inset,step:t.step}}}calculateScaling(){const t={};for(const e of Object.values(z)){const i=this.axes[e];if(!i)continue;const n=this.getScaling(i.scale);n!=null&&(t[e]=n)}return t}};function Xet(t){let e,i;if((t instanceof Ao||t instanceof Pl)&&({min:e,max:i}=t),!(e==null&&i==null))return e??(e=-1/0),i??(i=1/0),[e,i]}function Zet(t,e,i,n){const s=i[0].valueOf(),a=i[1].valueOf();let o=vf(0,e-1,l=>{const c=t===1?l:e-l,u=n(c)?.valueOf();return!Number.isFinite(u)||u>=s}),r=Dr(0,e-1,l=>{const c=t===1?l:e-l,u=n(c)?.valueOf();return!Number.isFinite(u)||u<=a});return o==null||r==null?[0,0]:(t===-1&&([o,r]=[e-r,e-o]),o=Math.max(o,0),r=Math.min(r+1,e),[o,r])}function ZU(t){const e=new Map;for(const i of t){if(!(i instanceof Wu))continue;const s=(i.seriesGrouping?.stackCount??0)>0?i.seriesGrouping?.groupIndex:void 0;if(s==null){i.seriesBelowStackContext=void 0,i.createStackContext();continue}const a=`${i.type}-${s}`;let o=e.get(a);o==null&&(o=[],e.set(a,o)),o.push(i)}for(const i of e.values()){i.sort((s,a)=>(s.seriesGrouping?.stackIndex??0)-(a.seriesGrouping?.stackIndex??0));let n;for(const s of i)s.seriesBelowStackContext=n,n=s.createStackContext()}}function Rp(t,e,i,n,s,a,o=["series",`${t.declarationOrder}`,"label"]){if(t.visible&&n.itemStyler){const r=t.getHighlightStateString(a,s||e!=null&&a?.series===e.series&&a?.datumIndex===e.datumIndex,e?.datumIndex),l=typeof e?.datumIndex=="number"?e.datumIndex:e?.itemId,c={border:n.border,color:n.color,cornerRadius:n.cornerRadius,datum:e?.datum,enabled:n.enabled,fill:n.fill,fillOpacity:n.fillOpacity,fontFamily:n.fontFamily,fontSize:n.fontSize,fontStyle:n.fontStyle,fontWeight:n.fontWeight,itemId:l,itemType:e?.itemType,seriesId:t.id,padding:n.padding,highlightState:r},u=t.ctx.optionsGraphService.resolvePartial(o,t.cachedCallWithContext(n.itemStyler,{...i,...c}),{pick:!1})??{};return Et(u,c)}return n}function qU(t,e,i,n,s,a,o){if(t.visible&&n.enabled&&s){const r=Rp(t,e.datum,i,n,a,o);e.visible=!0,e.x=s.x,e.y=s.y,e.text=s.text,e.fill=r.color,e.setAlign(s),e.setFont(r),e.setBoxing(r)}else e.visible=!1}var qet={"inside-start":{inside:!0,direction:-1,textAlignment:1},"inside-end":{inside:!0,direction:1,textAlignment:-1},"outside-start":{inside:!1,direction:-1,textAlignment:-1},"outside-end":{inside:!1,direction:1,textAlignment:1}};function QU({isUpward:t,isVertical:e,placement:i,spacing:n=0,rect:s}){let a=s.x+s.width/2,o=s.y+s.height/2,r="center",l="middle";if(i!=="inside-center"){const c=(t?1:-1)*(e?-1:1),{direction:u,textAlignment:d}=qet[i],g=(u+1)*.5;if(e){const f=t?s.y+s.height:s.y,y=s.height*c;o=f+y*g+n*d*c,l=d===c?"top":"bottom"}else{const f=t?s.x:s.x+s.width,y=s.width*c;a=f+y*g+n*d*c,r=d===c?"left":"right"}}return{x:a,y:o,textAlign:r,textBaseline:l}}function Wi({id:t},e,i,...n){for(const s of n)s.cleanup();Uc(t,e,i,n,{opacity:0},{opacity:1},{phase:"trailing"})}function $S({id:t},e,i,...n){Uc(t,e,i,n,{opacity:1},{opacity:0},{phase:"remove"})}function Pp(t){return{opacity:1}}var la=class extends Zf{constructor(){super(...arguments),this.enabled=!0,this.shape="circle",this.size=0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{size:e,shape:i,fill:n,fillOpacity:s,stroke:a,strokeWidth:o,strokeOpacity:r,lineDash:l,lineDashOffset:c}=this;return{size:e,shape:i,fill:n,fillOpacity:s,stroke:a,strokeWidth:o,strokeOpacity:r,lineDash:l,lineDashOffset:c}}getDiameter(){return this.size+this.strokeWidth}};T([b,ut()],la.prototype,"enabled",2);T([b,Bu({})],la.prototype,"shape",2);T([b,ut()],la.prototype,"size",2);T([b,Bu({})],la.prototype,"fill",2);T([b,ut()],la.prototype,"fillOpacity",2);T([b,ut()],la.prototype,"stroke",2);T([b,ut()],la.prototype,"strokeWidth",2);T([b,ut()],la.prototype,"strokeOpacity",2);T([b],la.prototype,"lineDash",2);T([b],la.prototype,"lineDashOffset",2);T([b,Bu({})],la.prototype,"itemStyler",2);function Qet(t,e){if(t!=null)return{enabled:t.enabled??!0,stroke:t.stroke??e?.stroke??"transparent",strokeWidth:t.strokeWidth??e?.strokeWidth??1,strokeOpacity:t.strokeOpacity??e?.strokeOpacity??1,lineDash:t.lineDash??e?.lineDash??[]}}var JU=class extends xt{constructor(){super(...arguments),this.enabled=!1}};T([b],JU.prototype,"enabled",2);var Wc=class extends xt{constructor(){super(...arguments),this.interaction=new JU,this.position=new nm,this.range=void 0,this.class=void 0}formatTooltip(t,e,i){const n=this.renderer==null?void 0:js(t,this.renderer,i);if(zi(n)||Je(n)||aa(n))return{type:"raw",rawHtmlString:bi(n)};if(n!=null){const s=Et(n.symbol?.marker,e.symbol?.marker),a=n.symbol?.line??e.symbol?.line?Et(n.symbol?.line,e.symbol?.line):void 0,o=e.symbol||n.symbol?{marker:s,line:Qet(a,s)}:void 0;return{type:"structured",...e,...n,symbol:o}}return{type:"structured",...e}}};T([b],Wc.prototype,"enabled",2);T([b],Wc.prototype,"showArrow",2);T([b],Wc.prototype,"renderer",2);T([b],Wc.prototype,"interaction",2);T([b],Wc.prototype,"position",2);T([b],Wc.prototype,"range",2);T([b],Wc.prototype,"class",2);function zp(){return new Wc}var Kc=class tW extends Gx{constructor(e,i=new Of,n=!0){super(e,i),this.groupPaddingInner=.1,this.includeInvisibleDomains=n,this.nice=!1}static is(e){return e instanceof tW}isCategoryLike(){return!0}hasDefinedDomain(){return!1}normaliseDataDomain(e){return{domain:e.domain,clipped:!1}}getUpdateTypeOnResize(){return this.bandAlignment==null||this.bandAlignment==="justify"?super.getUpdateTypeOnResize():Ct.PROCESS_DOMAIN}updateScale(){super.updateScale();let{paddingInner:e,paddingOuter:i}=this;if(!Ae(e)||!Ae(i)){const n=this.reduceBandScalePadding();e??(e=n.inner),i??(i=n.outer)}this.scale.paddingInner=e??0,this.scale.paddingOuter=i??0}calculateGridLines(e,i,n){const s=super.calculateGridLines(e,i,n);return this.interval.placement==="between"&&e.length>0&&s.push(super.calculateGridLine({index:e.at(-1).index+1,tickId:`after:${e.at(-1).tickId}`,translation:this.range[1]},e.length,i,n,e)),s}calculateGridLine({index:e,tickId:i,translation:n},s,a,o,r){const{gridLine:l,horizontal:c,interval:u,scale:d}=this;if(u.placement!=="between")return super.calculateGridLine({index:e,tickId:i,translation:n},s,a,o,r);const g=na[0]+o.step/2,u=e.at(-1),d=s&&u.translationthis.calculateGridFill(g,f,g.index,i,n,e))),d){const g={tickId:`after:${u.tickId}`,translation:u.translation+o.step};r.push(this.calculateGridFill(g,e.length,u.index+1,i,n,e))}return r}calculateGridFill({tickId:e,translation:i},n,s,a,o,r){const{gridLine:l,horizontal:c,interval:u,scale:d}=this;if(u.placement!=="between")return super.calculateGridFill({tickId:e,translation:i},n,s,a,o,r);const g=i-d.step/2,f=i+d.step/2,[y,x,S,D]=c?[g,Math.max(a,o),f,Math.min(a,o)]:[Math.min(a,o),g,Math.max(a,o),f],{fill:A,fillOpacity:I}=l.style[s%l.style.length]??{};return{tickId:e,x1:y,y1:x,x2:S,y2:D,fill:A,fillOpacity:I}}calculateTickLines(e,i,n=0){const s=super.calculateTickLines(e,i,n);return this.interval.placement==="between"&&e.length>0&&s.push(super.calculateTickLine({isPrimary:!1,tickId:`after:${e.at(-1)?.tickId}`,translation:this.range[1]},e.length,i,e,n)),s}calculateTickLine({isPrimary:e,tickId:i,translation:n},s,a,o,r=0){const{horizontal:l,interval:c,primaryTick:u,scale:d,tick:g}=this;if(c.placement!=="between")return super.calculateTickLine({isPrimary:e,tickId:i,translation:n},s,a,o,r);const f=e&&u?.enabled?u:g,y=-a*this.getTickSize(f),x=n{const n=i.getBandScalePadding?.();return n&&(e.inner>n.inner&&(e.inner=n.inner),e.outertypeof y!="string")&&(e=e.map(String)),{type:"category",value:e,datum:o,seriesId:r,legendItemName:l,key:c,source:u,property:d,domain:g,boundSeries:f}}};Kc.className="CategoryAxis";Kc.type="category";T([b],Kc.prototype,"groupPaddingInner",2);T([b],Kc.prototype,"paddingInner",2);T([b],Kc.prototype,"paddingOuter",2);T([pi("layoutConstraints","align")],Kc.prototype,"bandAlignment",2);T([b],Kc.prototype,"skipNullBars",2);T([Pe({newValue(t){t==null||t<=0?(this.layoutConstraints.width=100,this.layoutConstraints.unit="percent"):(this.layoutConstraints.width=t,this.layoutConstraints.unit="px",this.animationManager.skipCurrentBatch())}})],Kc.prototype,"requiredRange",2);var qx=Kc,Jet=1e3,rV=class eW extends Of{constructor(){super(...arguments),this.previousDomainJson=void 0,this.animatable=!0}static is(e){return e instanceof eW}set domain(e){if(e.length<=Jet){const i=JSON.stringify(e);this.animatable=this.previousDomainJson===void 0||this.previousDomainJson===i,this.previousDomainJson=i}else this.animatable=this.previousDomainJson===void 0,this.previousDomainJson="";super.domain=e}get domain(){return super.domain}normalizeDomains(...e){const{domain:i}=super.normalizeDomains(...e);return{domain:i,animatable:!1}}findIndex(e){return super.findIndex(e)??this.getMatchIndex(e)}getMatchIndex(e){const i=JSON.stringify(e),n=this._domain.find(s=>JSON.stringify(s)===i);if(n!=null)return super.findIndex(n)}},tit=class iW{constructor(e="",i,n){this.label=e,this.parent=i,this.refId=n,this.position=0,this.subtreeLeft=Number.NaN,this.subtreeRight=Number.NaN,this.children=[],this.leafCount=0,this.prelim=0,this.mod=0,this.ancestor=this,this.change=0,this.shift=0,this.index=0,this.separatorDepth=0,this.leftmostLeaf=this,this.screen=0,this.depth=i?i.depth+1:0}insertTick(e,i){let n=this,s;for(let a=0;au.label===o);if(c&&r)n=c,s=c;else{const u=new iW(o,n,i);u.index=l.length,l.push(u),r&&(n=u),s=u}}return s}getLeftSibling(){return this.index>0?this.parent?.children[this.index-1]:void 0}getLeftmostSibling(){return this.index>0?this.parent?.children[0]:void 0}nextLeft(){return this.children[0]}nextRight(){return this.children.at(-1)}getSiblings(){return this.parent?.children.filter((e,i)=>i!==this.index)??[]}};function eit(t){const e=t.reduce((s,a)=>Math.max(s,a.length),0),i=new tit,n=new Map;for(let s=0;s=0;n--){const s=t[n];s.prelim+=e,s.mod+=e,i+=s.change,e+=s.shift+i}}function ait(t,e){const i=t.getLeftSibling();if(i){let n=t,s=t,a=i,o=s.getLeftmostSibling(),r=s.mod,l=n.mod,c=a.mod,u=o.mod;for(;a.nextRight()&&s.nextLeft();){a=a.nextRight(),s=s.nextLeft(),o=o.nextLeft(),n=n.nextRight(),n.ancestor=t;const d=a.prelim+c-(s.prelim+r)+1;d>0&&(iit(nit(a,t,e),t,d),r+=d,l+=d),c+=a.mod,r+=s.mod,u+=o.mod,l+=n.mod}a.nextRight()&&!n.nextRight()?n.mod+=c-l:(s.nextLeft()&&!o.nextLeft()&&(o.mod+=r-u),e=t)}return e}function nW(t){const{children:e}=t;if(e.length){let[i]=e;for(const a of e)nW(a),i=ait(a,i);sit(t);const n=(e[0].prelim+e.at(-1).prelim)/2,s=t.getLeftSibling();s?(t.prelim=s.prelim+1,t.mod=t.prelim-n):t.prelim=n}else{const i=t.getLeftSibling();t.prelim=i?i.prelim+1:0}}function sW(t,e,i){t.position=t.prelim+e,t.separatorDepth=t.index===0?1+(t.parent?.separatorDepth??0):0,i.insertNode(t);for(const n of t.children)sW(n,e+t.mod,i)}function aW(t){const{children:e}=t;let i=0;for(const n of e)aW(n),n.children.length?i+=n.leafCount:i++;t.leafCount=i,e.length?(t.subtreeLeft=e[0].subtreeLeft,t.subtreeRight=e.at(-1).subtreeRight,t.position=(t.subtreeLeft+t.subtreeRight)/2,t.leftmostLeaf=e[0].leftmostLeaf):(t.subtreeLeft=t.position,t.subtreeRight=t.position)}function oit(t){const e=new rit,{root:i,tickNodes:n}=eit(t);return nW(i),sW(i,-i.prelim,e),aW(i),{layout:e,tickNodes:n}}var rit=class{constructor(){this.minPosition=1/0,this.maxPosition=-1/0,this.nodes=[],this.depth=0}insertNode(t){this.depththis.maxPosition&&(this.maxPosition=t.position),this.nodes.push(t)}scaling(t,e){let i=1;return t>0&&this.maxPosition!==this.minPosition&&(i=t/(this.maxPosition-this.minPosition)),e&&(i*=-1),i}resize(t,e,i,n){const s=Math.abs(t[1]-t[0])-e,a=this.scaling(s,t[0]>t[1]),o=i+n/2;let r=0;for(const l of this.nodes){const c=l.position*a;r>c&&(r=c),l.screen=c+o}for(const l of this.nodes)l.screen-=r}},Ld=5,Zs=class extends xt{constructor(){super(...arguments),this.enabled=!0,this.border=new kp}};T([b],Zs.prototype,"enabled",2);T([b],Zs.prototype,"avoidCollisions",2);T([b],Zs.prototype,"border",2);T([b],Zs.prototype,"color",2);T([b],Zs.prototype,"cornerRadius",2);T([b],Zs.prototype,"spacing",2);T([b],Zs.prototype,"rotation",2);T([b],Zs.prototype,"wrapping",2);T([b],Zs.prototype,"truncate",2);T([b],Zs.prototype,"fill",2);T([b],Zs.prototype,"fontStyle",2);T([b],Zs.prototype,"fontWeight",2);T([b],Zs.prototype,"fontSize",2);T([b],Zs.prototype,"fontFamily",2);T([b],Zs.prototype,"padding",2);var sA=class extends xt{constructor(){super(...arguments),this.enabled=!0}};T([b],sA.prototype,"enabled",2);T([b],sA.prototype,"width",2);T([b],sA.prototype,"stroke",2);var yL=class extends xt{constructor(){super(...arguments),this.label=new Zs,this.tick=new sA}};T([b],yL.prototype,"label",2);T([b],yL.prototype,"tick",2);var Qx=class extends qx{constructor(t){super(t,new rV),this.tickScale=new rV,this.computedLayout=void 0,this.tickTreeLayout=void 0,this.tickNodes=void 0,this.leafNodeToKey=void 0,this.ftdPositions=new Map,this.ftdCandidates=new Set,this.ftdKept=new Set,this.ftdByDepth=[],this.ftdStack=[],this.depthOptions=new ss(yL),this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}getDepthOptionsMap(t){const e=[],{depthOptions:i,label:n}=this,s=this.horizontal?0:-90;for(let a=0;a{t.fill=e.color,t.text=e.text,t.textBaseline=e.textBaseline,t.textAlign=e.textAlign??"center",t.pointerEvents=e.textUntruncated==null?1:0,t.setFont(e),t.setBoxing(e)})}updateAxisLine(){this.computedLayout&&(this.lineNode.visible=this.line.enabled,this.lineNode.stroke=this.line.stroke,this.lineNode.strokeWidth=this.line.width)}computeLayout(){this.updateDirection(),this.updateScale();const{step:t}=this.scale,{title:e,label:i,range:n,depthOptions:s,horizontal:a,line:o}=this,r=this.chartLayout?.scrollbars?.[this.id],l=this.getScrollbarThickness(r),c=this.getTickSpacing();if(this.lineNode.datum=a?{x1:n[0],x2:n[1],y1:0,y2:0}:{x1:0,x2:0,y1:n[0],y2:n[1]},this.lineNode.setProperties({stroke:o.stroke,strokeWidth:o.enabled?o.width:0}),this.tickTreeLayout?.resize(this.scale.range,this.scale.step,this.scale.inset,this.scale.bandwidth),!this.tickTreeLayout?.depth)return{bbox:Tt.zero,spacing:0,tickSizeAtDepth:[],tickLabelLayout:[]};const{depth:u,nodes:d}=this.tickTreeLayout,g=a?-i.getSideFlag():i.getSideFlag(),f=[],y=new Map,x=new wf,S=this.getDepthOptionsMap(u),D=g*(S[0].spacing+l+c),A=this.tickFormatter(this.scale.domain,this.scale.domain,!1),I=new Map,w={};for(const[q,nt]of d.entries()){const G=u-nt.depth;if(w[G]??(w[G]=0),!nt.children.length&&tPt){y.delete(q);continue}}const Kt=x.getPlainText(),ae=x.getBoxingProperties();f.push({text:Kt,textUntruncated:G.truncatedText,visible:!0,tickId:B(Kt),range:this.scale.range,border:ae.border,color:x.fill,cornerRadius:ae.cornerRadius,fill:ae.fill,fontFamily:x.fontFamily,fontSize:x.fontSize,fontStyle:x.fontStyle,fontWeight:x.fontWeight,padding:ae.padding,rotation:x.rotation,rotationCenterX:x.rotationCenterX,rotationCenterY:x.rotationCenterY,textAlign:x.textAlign,textBaseline:x.textBaseline,x:x.x,y:x.y}),y.set(q,Ti.toCanvas(x))}const H=(O[u-1]??0)+l+c,$=[this.lineNodeBBox(),Tt.merge(y.values()),new Tt(0,0,H*g,0)],Y=Tt.merge($),U=a?Y.height:Y.width,{spacing:V,scrollbarLayout:Z}=this.applyScrollbarLayout($,U,r);this.layout.labelThickness=U,this.layout.scrollbar=Z,e.enabled&&$.push(this.titleBBox(this.scale.domain,V));const W=Tt.merge($);return this.layoutCrossLines(),{bbox:W,spacing:V,tickSizeAtDepth:O,tickLabelLayout:f}}buildDepthsMap(t){const{tickNodes:e,tickScale:i,tickTreeLayout:n}=this;if(!n||!e)return new Map;const s=n.depth,a=new Map;for(const o of t){const r=e.get(o),l=r==null?s-1:Math.min(r.separatorDepth,s-1);a.set(o,l)}if(i.step1){const o=t.at(-1);if(o&&!e.has(o)){const r=t.at(-2),l=r?a.get(r):void 0;l!=null&&a.set(o,l)}}return a}filterTicksTopDown(t,e){const{tickScale:i,tickTreeLayout:n,tickNodes:s,leafNodeToKey:a}=this;if(!n||s==null||a==null)return{ticks:t,depthsMap:new Map};const o=i.range,r=i.step,l=i.inset,c=i.bandwidth,u=e?.[0]??0,d=e?.[1]??1,g=this.filterTickCache;if(g&&g.range0===o[0]&&g.range1===o[1]&&g.step===r&&g.inset===l&&g.bandwidth===c&&g.vr0===u&&g.vr1===d)return g.result;const f=Y=>(this.filterTickCache={range0:o[0],range1:o[1],step:r,inset:l,bandwidth:c,vr0:u,vr1:d,result:Y},Y);if(i.step>=Ld)return f({ticks:t,depthsMap:this.buildDepthsMap(t)});const y=this.ftdPositions;y.clear();const x=this.ftdCandidates;x.clear();const S=this.ftdKept;S.clear();const D=this.ftdStack;D.length=0;const A=Y=>(y.has(Y)||y.set(Y,i.convert(Y)),y.get(Y)),I=Y=>{let U=0;for(const V of Y)if(Number.isFinite(A(V))&&(U+=1,U>1))break;return U};let w=t;if(e!=null&&(e[0]!==0||e[1]!==1)){const Y=i.domain,U=Y.length;if(U>0){const V=Math.max(0,Math.floor(e[0]*U)-1),Z=Math.min(U-1,Math.ceil(e[1]*U));if(t.length===0)w=Y.slice(V,Z+1);else{const W=Y[V],q=Y[Z],nt=t[0],G=t.at(-1),et=W!=null&&W!==nt,st=q!=null&&q!==G;if(et||st){const lt=et?[W]:[];lt.push(...t),st&<.push(q),w=lt}}}}if(I(w)<=1)return f({ticks:w,positions:y,depthsMap:this.buildDepthsMap(w)});for(const Y of w)x.add(Y);for(const Y of w){let V=s.get(Y)?.parent;for(;V?.parent;){const Z=a.get(V.leftmostLeaf);Z!=null&&x.add(Z),V=V.parent}}const N=Math.max(0,n.depth-1),O=Y=>Math.min(N,n.depth-Y.depth),L=n.nodes[0];if(!L?.children.length)return f({ticks:w,positions:y,depthsMap:this.buildDepthsMap(w)});const R=this.ftdByDepth;for(const Y of R)Y.positions.length=0,Y.ticks.length=0;const P=(Y,U)=>{const V=Y.at(-1);return V!=null&&U-V{for(let V=U+1;V<=N;V++)if(P(R[V].positions,Y))return!1;return!P(R[U].positions,Y)},F=(Y,U,V)=>{const Z=R[V];Z.positions.push(Y),Z.ticks.push(U)},H=(Y,U)=>{if(U!==0)for(let V=0;V0&&Y-Z.positions.at(-1)=0;Y--){const U=L.children[Y],V=a.get(U.leftmostLeaf);V!=null&&x.has(V)&&D.push(U)}for(;D.length;){const Y=D.pop(),U=a.get(Y.leftmostLeaf);if(U==null||!x.has(U))continue;const V=A(U);if(V==null||!Number.isFinite(V))continue;if(S.has(U)){for(let W=Y.children.length-1;W>=0;W--)D.push(Y.children[W]);continue}const Z=O(Y);if(B(V,Z)){S.add(U),F(V,U,Z),H(V,Z);for(let W=Y.children.length-1;W>=0;W--)D.push(Y.children[W])}}for(const Y of w){if(s.has(Y))continue;const U=A(Y);if(U==null||!Number.isFinite(U)||S.has(Y))continue;const V=0;B(U,V)&&(S.add(Y),F(U,Y,V),H(U,V))}const $=w.filter(Y=>S.has(Y));return f({ticks:$,positions:y,depthsMap:this.buildDepthsMap($)})}update(){if(!this.computedLayout)return;this.scale.animatable||this.moduleCtx.animationManager.skipCurrentBatch();const{tickScale:t,tick:e,gridLine:i,gridLength:n,visibleRange:s,tickTreeLayout:a}=this;if(!a)return;const{tickSizeAtDepth:o,spacing:r}=this.computedLayout,{depth:l}=a,c=this.chartLayout?.scrollbars?.[this.id],u=this.getScrollbarThickness(c),d=this.getTickSpacing(),{position:g,horizontal:f,gridPadding:y}=this,x=g==="bottom"||g==="right"?-1:1,S=y,D=x*n-y,A={nice:[!1,!1],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0};let{ticks:I}=t.ticks(A,void 0,s);const w=this.filterTicksTopDown(I,s);I=w.ticks;const{depthsMap:N}=w,O=R=>N.get(R)??l-1,L=I.map((R,P)=>({index:t.findIndex(R),tickId:As(P,...R),translation:Math.round(w.positions?.get(R)??t.convert(R))}));this.gridLineGroupSelection.update(i.enabled&&n?this.calculateGridLines(L,S,D):[]),this.gridFillGroupSelection.update(i.enabled&&n?this.calculateGridFills(L,S,D):[]),this.tickLineGroupSelection.update(e.enabled?I.map((R,P)=>{const{tickId:B,translation:F}=L[P],H=O(R),$=this.depthOptions[H]?.tick,Y=o[H]??0,U=$?.stroke??e.stroke,V=$?.enabled===!1?0:$?.width??e.width,Z=-x*Y,W=-x*(u+d),[q,nt,G,et]=f?[F,W,F,W+Z]:[W,F,W+Z,F];return{tickId:B,offset:F,x1:q,y1:nt,x2:G,y2:et,stroke:U,strokeWidth:V,lineDash:void 0}}):[]),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateGridFills(),this.updateTickLines(),this.updateTitle(this.scale.domain,r),this.updateCrossLines(),this.resetSelectionNodes()}calculateLayout(t,e){this.chartLayout=e;const{tickSizeAtDepth:i,tickLabelLayout:n,spacing:s,bbox:a}=this.computeLayout();return this.computedLayout={tickSizeAtDepth:i,tickLabelLayout:n,spacing:s},{bbox:a,niceDomain:this.scale.domain}}onGridVisibilityChange(){super.onGridVisibilityChange(),this.tickLabelGroupSelection.clear()}updateScale(){super.updateScale(),this.tickScale.range=this.scale.range,this.scale.paddingOuter=this.scale.paddingInner/2}processData(){const{direction:t}=this,e=this.boundSeries.filter(l=>l.visible).flatMap(l=>Lb(l.getDomain(t)));this.dataDomain={domain:Ll(e)??this.filterDuplicateArrays(e),clipped:!1},this.isReversed()&&(this.dataDomain={...this.dataDomain,domain:this.dataDomain.domain.toReversed()});const i=this.dataDomain.domain.map(lV),{layout:n,tickNodes:s}=oit(i);this.tickTreeLayout=n,this.tickNodes=s,this.leafNodeToKey=new Map;for(const[l,c]of s)this.leafNodeToKey.set(c,l);this.filterTickCache=void 0,this.ftdByDepth=Array.from({length:Math.max(0,n.depth-1)+1},()=>({positions:[],ticks:[]}));const a=[];for(const l of this.tickTreeLayout.nodes)l.leafCount||l.refId==null||a.push(this.dataDomain.domain[l.refId]);const o=VH(this.dataDomain.domain,a);this.scale.domain=o;const r=o.map(lV);r.push([""]),this.tickScale.domain=r}filterDuplicateArrays(t){const e=new Set;return t.filter(i=>{const n=qt(i)?JSON.stringify(i):i;return e.has(n)?!1:(e.add(n),!0)})}};Qx.className="GroupedCategoryAxis";Qx.type="grouped-category";T([b],Qx.prototype,"depthOptions",2);function lV(t){return dx(Bt(t)&&"value"in t?t.value:t)}function aA(t,e){for(const i of e){const n=i.datum;n===void 0?pt.error("undefined datum"):t.addValue(i,n)}}function oA(t,e){const{x:i,y:n}=e,{nearest:s,distanceSquared:a}=t.getQuadTree().find(i,n);if(s!==void 0)return{datum:s.value,distance:Math.sqrt(a)}}var Jx=class extends jr{constructor(){super(...arguments),this.direction="vertical",this.width=void 0,this.widthRatio=void 0}};T([b],Jx.prototype,"direction",2);T([b],Jx.prototype,"width",2);T([b],Jx.prototype,"widthRatio",2);var oW=class extends Wu{constructor(){super(...arguments),this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(t,e){const i=typeof e=="boolean"?1:.5,n=Ae(this.smallestDataInterval)?this.smallestDataInterval*i:0,s=Ll(t)??[Number.NaN,Number.NaN];return typeof e=="boolean"?s[e?0:1]-=(e?1:-1)*n:(s[0]-=n,s[1]+=n),_a(s)}getBandScalePadding(){return{inner:.3,outer:.15}}shouldFlipXY(){return!this.isVertical()}isVertical(){return this.properties.direction==="vertical"}getBarDirection(){return this.shouldFlipXY()?z.X:z.Y}getCategoryDirection(){return this.shouldFlipXY()?z.Y:z.X}getValueAxis(){const t=this.getBarDirection();return this.axes[t]}getCategoryAxis(){const t=this.getCategoryDirection();return this.axes[t]}getMinimumRangeSeries(t){const{width:e}=this.properties;if(e==null||!this.getCategoryAxis())return;const{index:n}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);t[n]=Math.max(t[n]??0,e)}getMinimumRangeChart(t){if(t.length===0)return 0;const e=this.getCategoryAxis();if(!(e instanceof Qx||e instanceof qx))return 0;const i=this.data?.netSize()??0;if(i===0)return 0;const n=this.getBandScalePadding(),{paddingInner:s=n.inner,paddingOuter:a=n.outer,groupPaddingInner:o}=e,r=t.reduce((g,f)=>g+f,0),l=r/t.length,{visibleGroupCount:c}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this),u=r+o*l*(c-1),d=(i-s+a*2)/(1-s);return u*d}validateCreateNodeDataPreconditions(){const t=this.getCategoryAxis(),e=this.getValueAxis();if(!(!t||!e||!this.dataModel||!this.processedData))return{xAxis:t,yAxis:e}}getBandwidth(t,e){return ti.is(t.scale)?t.scale.calcBandwidth(this.smallestDataInterval,e):t.scale.bandwidth??0}xCoordinateRange(t){const e=this.axes[this.getCategoryDirection()],i=e.scale,n=this.getBandwidth(e,0),s=ti.is(i)?n*-.5:0,a=i.convert(t)+s;return[a,a+n]}yCoordinateRange(t){const i=this.axes[this.getBarDirection()].scale,n=t.map(s=>i.convert(s));if(n.length===1){const s=i.convert(0);return[Math.min(n[0],s),Math.max(n[0],s)]}return xi(n)}getBarDimensions(){const t=this.getCategoryAxis(),e=this.getBandwidth(t);this.ctx.seriesStateManager.updateGroupScale(this,e,t);const i=this.getBarWidth(),n=this.getBarOffset(i);let s=this.getGroupOffset();if(this.ctx.domManager.isRtl&&this.seriesGrouping!=null){const a=this.ctx.seriesStateManager.getGroupBandWidth(this);s=e-s-a}return{groupOffset:s,barOffset:n,barWidth:i}}getGroupOffset(){return this.ctx.seriesStateManager.getGroupOffset(this)}getBarOffset(t){const e=this.ctx.seriesStateManager.getGroupScale(this),i=this.getCategoryAxis();let n=0;ti.is(i.scale)?n=-t/2:this.seriesGrouping==null&&e?n=(this.getGroupScaleRangeWidth(e)-t)/2:e&&this.properties.widthRatio!=null&&(n=(e.bandwidth-t)/2);const s=this.ctx.seriesStateManager.getStackOffset(this,t);return n+s}getBarWidth(){const{seriesGrouping:t}=this,{width:e}=this.properties;let{widthRatio:i}=this.properties;const n=this.ctx.seriesStateManager.getGroupScale(this),s=n?.bandwidth??0;if(t==null&&(i??(i=1)),i!=null){let a=e;return t==null&&a==null&&n&&(a=this.getGroupScaleRangeWidth(n)),a==null&&s<1&&n?n.rawBandwidth:(a??s)*i}return e??(s<1&&n?n.rawBandwidth:s)}getGroupScaleRangeWidth(t){let e=t.range[1]-t.range[0];return t.round&&e>0&&(e=Math.floor(e)),e}getDatumOffset(t){if(!this.processedData?.invalidData||!this.processedData?.missingData||!this.getCategoryAxis()?.skipNullBars)return 0;const e=this.ctx.seriesStateManager.getDatumOffset(this,this.processedData.invalidData,this.processedData.missingData,t);return this.ctx.domManager.isRtl?-e:e}resolveKeyDirection(t){return this.getBarDirection()===z.X?t===z.X?z.Y:z.X:t}initQuadTree(t){aA(t,this.datumNodesIter())}pickNodeClosestDatum(t){return oA(this,t)}};function kn(t,e,i){return(e-t)*i+t}function cV(t,e){const{x0:i,y0:n,x1:s,y1:a}=t,r=(a-n)/(s-i)*(e-i)+n;return{leftCp1x:i,leftCp1y:n,leftCp2x:e,leftCp2y:r,stepX:e,stepY0:r,stepY1:r,rightCp1x:e,rightCp1y:r,rightCp2x:s,rightCp2y:a}}function lit(t,e){const{cp0x:i,cp0y:n,cp1x:s,cp1y:a,cp2x:o,cp2y:r,cp3x:l,cp3y:c}=t,u=vM(i,s,o,l,e),[d,g]=$b(i,n,s,a,o,r,l,c,u),f=d[3].y;return{leftCp1x:d[1].x,leftCp1y:d[1].y,leftCp2x:d[2].x,leftCp2y:d[2].y,stepX:e,stepY0:f,stepY1:f,rightCp1x:g[1].x,rightCp1y:g[1].y,rightCp2x:g[2].x,rightCp2y:g[2].y}}function cit(t){const{x0:e,y0:i,x1:n,y1:s,stepX:a}=t;return{leftCp1x:(e+a)/2,leftCp1y:i,leftCp2x:(e+a)/2,leftCp2y:i,stepX:a,stepY0:i,stepY1:s,rightCp1x:(a+n)/2,rightCp1y:s,rightCp2x:(a+n)/2,rightCp2y:s}}function hV(t,e){return t.type==="linear"?cV(t,e):t.type==="cubic"?lit(t,e):t.type==="step"?cit(t):cV(t,e)}function rW(t,e,i,n,s,a,o){switch(e){case sa.MoveTo:o?t.moveTo(s,a):t.moveTo(i,n);break;case sa.LineTo:o?t.lineTo(s,a):t.lineTo(i,n);break;case sa.Skip:break}}function lW(t,e,i,n,s,a){a?t.lineTo(e,i):t.lineTo(n,s)}function cW(t,e,i,n,s,a,o,r,l,c){c?t.cubicCurveTo(a,o,n,s,e,i):t.cubicCurveTo(n,s,a,o,r,l)}function hW(t,e,i,n,s,a,o){o?(t.lineTo(a,s),t.lineTo(a,i),t.lineTo(e,i)):(t.lineTo(a,i),t.lineTo(a,s),t.lineTo(n,s))}function hit(t,e,i,n,s,a,o){if(o){for(let r=a.length-1;r>=0;r--){const{x:l,y:c}=a[r];t.lineTo(l,c)}t.lineTo(e,i)}else{for(const{x:r,y:l}of a)t.lineTo(r,l);t.lineTo(n,s)}}function nb(t,e,i,n){const[s,a]=Ks(e);switch(rW(t,i,s.x,s.y,a.x,a.y,n),e.type){case"linear":lW(t,e.x0,e.y0,e.x1,e.y1,n);break;case"cubic":cW(t,e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,n);break;case"step":hW(t,e.x0,e.y0,e.x1,e.y1,e.stepX,n);break;case"multi-line":hit(t,e.x0,e.y0,e.x1,e.y1,e.midPoints,n);break}}function uW(t,e,i){const[n,s]=Ks(t),[a,o]=Ks(e),r=kn(n.x,a.x,i),l=kn(n.y,a.y,i),c=kn(s.x,o.x,i),u=kn(s.y,o.y,i);return[{x:r,y:l},{x:c,y:u}]}function UN(t,e,i,n,s,a){const[{x:o,y:r},{x:l,y:c}]=uW(e,i,n);if(rW(t,s,o,r,l,c,a),e.type==="cubic"&&i.type==="cubic"){const u=kn(e.cp1x,i.cp1x,n),d=kn(e.cp1y,i.cp1y,n),g=kn(e.cp2x,i.cp2x,n),f=kn(e.cp2y,i.cp2y,n);cW(t,o,r,u,d,g,f,l,c,a)}else if(e.type==="step"&&i.type==="step"){const u=kn(e.stepX,i.stepX,n);hW(t,o,r,l,c,u,a)}else if(e.type==="linear"&&i.type==="linear")lW(t,o,r,l,c,a);else{let u;e.type==="step"?u=e.stepX:i.type==="step"?u=i.stepX:u=(o+l)/2;const d=hV(e,u),g=hV(i,u),f=kn(d.leftCp1x,g.leftCp1x,n),y=kn(d.leftCp1y,g.leftCp1y,n),x=kn(d.leftCp2x,g.leftCp2x,n),S=kn(d.leftCp2y,g.leftCp2y,n),D=kn(d.stepX,g.stepX,n),A=kn(d.stepY0,g.stepY0,n),I=kn(d.stepY1,g.stepY1,n),w=kn(d.rightCp1x,g.rightCp1x,n),N=kn(d.rightCp1y,g.rightCp1y,n),O=kn(d.rightCp2x,g.rightCp2x,n),L=kn(d.rightCp2y,g.rightCp2y,n);a?(t.cubicCurveTo(O,L,w,N,D,I),t.lineTo(D,A),t.cubicCurveTo(x,S,f,y,o,r)):(t.cubicCurveTo(f,y,x,S,D,A),t.lineTo(D,I),t.cubicCurveTo(w,N,O,L,l,c))}}var uV=1e3,dW=(t=>(t[t.Zero=0]="Zero",t[t.Split=1]="Split",t))(dW||{});function uit(t,e){return t==null||e==null||typeof t!="object"||typeof e!="object"?!1:"id"in t&&"id"in e?t.id===e.id:t.toString()===e.toString()}function Gs(t){return bM(t).valueOf()}function vs(t,e){if(!e)return Number.NaN;if(t instanceof Date&&(t=t.getTime()),e.type==="continuous"&&typeof t=="number")return(t-e.domain[0])/(e.domain[1]-e.domain[0])*(e.range[1]-e.range[0])+e.range[0];if(e.type==="log"&&typeof t=="number")return e.convert(t);if(e.type!=="category")return Number.NaN;if(Au(e)){if(typeof t=="number"){const{firstBandTime:s,intervalMs:a,bandCount:o,inset:r,step:l}=e,c=Math.round((t-s)/a);if(c>=0&&cGs(s)===i);return n===-1&&(n=e.domain.findIndex(s=>uit(t,s))),n>=0?e.inset+e.step*n:Number.NaN}function dV({data:t},e){return t.map((i,n)=>({xValue0Index:e.indexOf(Gs(i.xValue0)),xValue1Index:e.indexOf(Gs(i.xValue1)),datumIndex:n}))}function pV(t){return Object.values(t.scales).every(e=>e.type==="category"?Au(e)?e.bandCount({axisValue:u,value:d}));n.sort((u,d)=>vs(u.value,t.scales.x)-vs(d.value,t.scales.x));const s=[];for(const{xValue0:u,xValue1:d}of e.data){const g=Gs(u),f=Gs(d);i.has(g)||(i.set(g,u),s.push({axisValue:g,value:u})),i.has(f)||(i.set(f,d),s.push({axisValue:f,value:d}))}s.sort((u,d)=>vs(u.value,e.scales.x)-vs(d.value,e.scales.x));const a=n;let o=0;for(const u of s){for(let d=a.length-1;d>=o;d-=1){const g=vs(u.value,e.scales.x),f=vs(a[d].value,e.scales.x);if(g>f){o=d+1;break}}a.splice(o,0,u),o+=1}if(!pit(a,e))return;const r=a.map(u=>u.axisValue),l=dV(e,r),c=dV(t,r);return{axisValues:r,oldDataAxisIndices:l,newDataAxisIndices:c}}function gV(t,e,i,n,s){if(s.xValue1Index===s.xValue0Index+1)return t;const a=Ks(t);let o,r;if(e.scales.x?.type==="category"){const l=(a[1].x-a[0].x)/(s.xValue1Index-s.xValue0Index);o=a[0].x+(n-s.xValue0Index)*l,r=o+l}else{const l=i[n],c=i[n+1];o=vs(l,e.scales.x),r=vs(c,e.scales.x)}return IT(t,o,r)}function pW(t,e){const[i,n]=Ks(t),s=vs(0,e.scales.y);return If(t,{x:i.x,y:s},{x:n.x,y:s})}function gW(t){const[e,i]=Ks(t);return SM(t,{x:(e.x+i.x)/2,y:(e.y+i.y)/2})}function fW(t,e,i,n,s,a){let o,r;if(s.xValue0Index>=a.xValue1Index){const d=n.findLast(f=>f.xValue1Index<=a.xValue1Index)?.datumIndex,g=d==null?void 0:i.data[d];o=g?.xValue1,r=g?.yValue1}else if(s.xValue0Index<=a.xValue0Index){const d=n.find(f=>f.xValue0Index>=a.xValue0Index)?.datumIndex,g=d==null?void 0:i.data[d];o=g?.xValue0,r=g?.yValue0}if(o==null||r==null)switch(e){case 0:return pW(t,i);case 1:return gW(t)}const l=vs(o,i.scales.x),c=vs(r,i.scales.y),u={x:l,y:c};return If(t,u,u)}function bL(t,e){if(e==null)return;const i=Gs(t.xValue0),n=Gs(t.xValue1);return e.find(s=>Gs(s.xValue0)===i&&Gs(s.xValue1)===n)?.span}function fV(t,e,i,n,s,a,o){const r=t.data[n.datumIndex],l=r.span,c=bL(r,s);if(c==null){const u=fW(l,e,t,i,n,a);o.added.push({from:u,to:l})}else o.removed.push({from:c,to:c}),o.moved.push({from:c,to:l}),o.added.push({from:l,to:l})}function mV(t,e,i,n,s,a,o){const r=t.data[n.datumIndex],l=r.span,c=bL(r,s);if(c==null){const u=fW(l,e,t,i,n,a);o.removed.push({from:l,to:u})}else o.removed.push({from:l,to:l}),o.moved.push({from:l,to:c}),o.added.push({from:c,to:c})}function yV(t,e,i,n,s){const a=n.scales.x,o=e[s.xValue0Index],r=e[s.xValue1Index];let l,c;if(a?.type==="continuous"||a?.type==="log"?(l=i.data.findLast(D=>Gs(D.xValue0)<=o),c=i.data.find(D=>Gs(D.xValue1)>=r)):(l=i.data.find(D=>Gs(D.xValue0)===o),c=i.data.find(D=>Gs(D.xValue1)===r)),l==null||c==null)return;const[{x:u},{x:d}]=Ks(t),g=vs(l.xValue0,i.scales.x),f=vs(l.yValue0,i.scales.y),y=vs(c.xValue1,i.scales.x),x=vs(c.yValue1,i.scales.y);let S=n.data[s.datumIndex].span;return S=If(S,{x:g,y:f},{x:y,y:x}),S=IT(S,u,d),S}function fit(t,e,i,n,s,a,o,r,l){const c=s+1,u=o.find(I=>I.xValue0Index<=s&&I.xValue1Index>=c),d=a.find(I=>I.xValue0Index<=s&&I.xValue1Index>=c),g=e.zeroData,f=t.zeroData;if(u==null&&d!=null){fV(t,i,a,d,g,r,l);return}else if(u!=null&&d==null){mV(e,i,o,u,f,r,l);return}else if(u==null||d==null)return;let y;u.xValue0Index===d.xValue0Index&&u.xValue1Index===d.xValue1Index?y=0:u.xValue0Index<=d.xValue0Index&&u.xValue1Index>=d.xValue1Index?y=-1:u.xValue0Index>=d.xValue0Index&&u.xValue1Index<=d.xValue1Index?y=1:y=0;const x=e.data[u.datumIndex],S=gV(x.span,e,n,s,u),D=t.data[d.datumIndex],A=gV(D.span,t,n,s,d);if(y===1){const I=yV(S,n,e,t,d);I==null?mV(e,i,o,u,f,r,l):(l.removed.push({from:S,to:I}),l.moved.push({from:I,to:A}),l.added.push({from:A,to:A}))}else if(y===-1){const I=yV(A,n,t,e,u);I==null?fV(t,i,a,d,g,r,l):(l.removed.push({from:S,to:S}),l.moved.push({from:S,to:I}),l.added.push({from:I,to:A}))}else l.removed.push({from:S,to:S}),l.moved.push({from:S,to:A}),l.added.push({from:A,to:A})}function mit(t,e,i,n){const s={removed:[],moved:[],added:[]},{axisValues:a,oldDataAxisIndices:o,newDataAxisIndices:r}=t,l={xValue0Index:Math.max(o.at(0)?.xValue0Index??-1/0,r.at(0)?.xValue0Index??-1/0),xValue1Index:Math.min(o.at(-1)?.xValue1Index??1/0,r.at(-1)?.xValue1Index??1/0)};for(let c=0;ct.data.length&&t.data.length>0){const o=t.data.at(-1).span,[,r]=Ks(o),l=SM(o,r);for(let c=a;ce.data.length&&e.data.length>0){const o=e.data.at(-1).span,[,r]=Ks(o),l=SM(o,r);for(let c=a;cs.point);let n=Yj(i);switch(e.type){case"linear":break;case"smooth":n=Xj(i,e.tension);break;case"step":n=$j(i,e.position);break}return n.map(function(a,o){return{span:a,xValue0:t[o].xDatum,yValue0:t[o].yDatum,xValue1:t[o+1].xDatum,yValue1:t[o+1].yDatum}})}function TM(t,e,i=.001){return Math.abs(t.x-e.x)XS(l,c,e.removed),a=(l,c)=>XS(l,c,e.moved),o=(l,c)=>XS(l,c,e.added),r=vL(t,i,n);return{status:t,path:{addPhaseFn:o,updatePhaseFn:a,removePhaseFn:s},pathProperties:r}}function vL(t,e,i=1){const n=e==="none"?"updated":t,s={fromFn(a,o){const r={phase:wr[n]},l=a.previousDatum??o;return l!=null&&(r.segments=l),t==="removed"?r.finish={visible:!1}:t==="added"&&(r.start={visible:!0}),r},toFn(a,o){const r={phase:wr[n]},l=o;return l!=null&&(r.segments=l),r}};return e==="fade"?{fromFn(a,o){const r=t==="added"?0:i,l=t==="removed"?a.previousDatum??o:o;return{...s.fromFn(a,o),opacity:r,segments:l}},toFn(a,o){const r=t==="removed"?0:i,l=t==="removed"?a.previousDatum??o:o;return{...s.toFn(a,o),opacity:r,segments:l}}}:s}function xit(t,e,i,n=1){const s=t.scales.x?.type==="category",a=e.scales.x?.type==="category";if(s!==a||!cp(t.scales.x)||!cp(e.scales.x)||t.strokeData==null||e.strokeData==null)return;let o="updated";e.visible&&!t.visible?o="removed":!e.visible&&t.visible&&(o="added");const r=kb({scales:t.scales,data:t.strokeData.spans},{scales:e.scales,data:e.strokeData.spans},1);if(r==null)return;const l=mW(o,r,"fade",n),c=(i?.changed??!0)||!yl(t.scales.x,e.scales.x)||!yl(t.scales.y,e.scales.y)||o!=="updated";return{status:o,stroke:l,hasMotion:c}}function yW(t,e,i,n){if(e!=null){const[s,a]=e;if(s!==0||a!==1)return!1}if(ti.is(t)){const s=t.calcBandwidth(n)-t.calcBandwidth(i);if(s>0&&s<1)return!1}if(Rr.is(t)){const{bandwidth:s,step:a}=t;if(s>0&&s<1)return!1;const o=a-s;if(o>0&&o<1)return!1}return!0}var HC=t=>sf(t.yValue??0);function Jb(t,e,i){const{startingX:n,startingY:s}=Sit(t,e);return{isVertical:t,calculate:(o,r)=>{let l=t?o.x:n,c=t?s:o.y,u=t?o.width:0,d=t?0:o.height;const{opacity:g=1}=o;r&&(Number.isNaN(l)||Number.isNaN(c))&&({x:l,y:c}=r,u=t?r.width:0,d=t?0:r.height,t&&!HC(r)?c+=r.height:!t&&HC(r)&&(l+=r.width));let f;return o.clipBBox==null?f=void 0:HC(o)?f=t?new Tt(l,c-d,u,d):new Tt(l-u,c,u,d):f=new Tt(l,c,u,d),{x:l,y:c,width:u,height:d,clipBBox:f,opacity:g}},mode:i}}function vit(t,e){return{isVertical:t,calculate:(i,n)=>{let s=t?i.x:i.x+i.width/2,a=t?i.y+i.height/2:i.y,o=t?i.width:0,r=t?0:i.height;return n&&(Number.isNaN(s)||Number.isNaN(a))&&(s=t?n.x:n.x+n.width/2,a=t?n.y+n.height/2:n.y,o=t?n.width:0,r=t?0:n.height),{x:s,y:a,width:o,height:r,clipBBox:i.clipBBox,opacity:i.opacity??1}},mode:e}}function tx(t,e){const i=o=>o==null||Number.isNaN(o.x)||Number.isNaN(o.y);return{toFn:(o,r,l)=>l==="removed"&&o.datum==null&&t.mode==="fade"?{...ex(o,r),opacity:0}:l==="removed"||i(r)?t.calculate(r,o.previousDatum):{x:r.x,y:r.y,width:r.width,height:r.height,clipBBox:r.clipBBox,opacity:r.opacity??1},fromFn:(o,r,l)=>{l==="updated"&&i(r)?l="removed":l==="updated"&&i(o.previousDatum)&&(l="added");let c;l==="unknown"||l==="added"?(o.previousDatum==null&&t.mode==="fade"?c={...ex(o,r),opacity:0}:c=t.calculate(r,o.previousDatum),l==="unknown"&&(l=e)):c={x:o.x,y:o.y,width:o.width,height:o.height,clipBBox:o.clipBBox,opacity:o.opacity??1};const u=wr[l];return{...c,phase:u}},applyFn:(o,r,l)=>{o.resetAnimationProperties(r.x,r.y,r.width,r.height,r.opacity??1,r.clipBBox),o.crisp=l==="end"&&(o.datum?.crisp??!1)}}}function Sit(t,e){const i=e[t?z.Y:z.X];let n=1/0,s=0;return i?(t?s=i.scale.convert(ti.is(i.scale)?0:Math.max(...i.range)):n=i.scale.convert(ti.is(i.scale)?0:Math.min(...i.range)),{startingX:n,startingY:s}):{startingX:n,startingY:s}}function ex(t,{x:e,y:i,width:n,height:s,clipBBox:a,opacity:o=1}){return{x:e,y:i,width:n,height:s,clipBBox:a,opacity:o,crisp:t.datum?.crisp??!1}}function LM(t){for(const e of t){const i=e.nodes();e.batchedUpdate(function(){for(const s of i){const a=s.datum;a!=null&&(s.resetAnimationProperties(a.x,a.y,a.width,a.height,a.opacity??1,a.clipBBox),s.crisp=a.crisp??!1)}e.cleanup()})}}function SL(t,e){if(e===void 0)return;const{x:i,y:n,width:s,height:a}=e;return Ti.toCanvas(t.contentGroup,new Tt(i,n,s,a))}function ML(t,e,i,n){const s=t.canIncrementallyUpdate&&t.nodeIndex=n;f-=1)nb(t,i[f].span,sa.LineTo,!0);t.closePath(),nb(t,r,sa.MoveTo,!1),n=o}s=u,a=g}for(let o=e.length-1;o>=n;o-=1)nb(t,i[o].span,sa.LineTo,!0);t.closePath()}function jC(t,{path:e},i,n){for(let s=0;sjC(l,c,e.removed,i.removed),a=(l,c)=>jC(l,c,e.moved,i.moved),o=(l,c)=>jC(l,c,e.added,i.added),r=vL(t,n);return{status:t,path:{addPhaseFn:o,updatePhaseFn:a,removePhaseFn:s},pathProperties:r}}function Mit(t,e){const i=t.scales.x?.type==="category",n=e.scales.x?.type==="category";if(i!==n||!cp(t.scales.x)||!cp(e.scales.x))return;let s="updated";e.visible&&!t.visible?s="removed":!e.visible&&t.visible&&(s="added");const a=kb({scales:t.scales,data:t.fillData.spans},{scales:e.scales,data:e.fillData.spans},0);if(a==null)return;const o=kb({scales:t.scales,data:t.fillData.phantomSpans},{scales:e.scales,data:e.fillData.phantomSpans},0);if(o==null)return;const r=kb({scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},{scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},0);if(r==null)return;const l="none",c=xW(s,a,o,l),u=mW(s,r,l);return{status:s,fill:c,stroke:u}}function vW(t,e,i,n,s,a,o){let r=a?.reduced?.diff?.[t];if(r?.changed)return r;if(!o)return{changed:!1,added:new Set,updated:new Set,removed:new Set,moved:new Set};const l=Dit(n,s);return r==null&&a?.reduced?.diff!=null?(r={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set},l?r.updated=new Set(Array.from(e,({datum:c})=>i(c))):r.added=new Set(Array.from(e,({datum:c})=>i(c)))):l&&(r={changed:!0,added:new Set,updated:new Set(Array.from(e,({datum:c})=>i(c))),removed:new Set,moved:new Set}),r}function xV(t){return typeof t=="object"&&t!==null&&"groupScale"in t}function Dit(t,e){if(!e)return!1;const i=t.scales,n=e.scales;if(!yl(i.x,n.x)||!yl(i.y,n.y))return!0;if(!xV(t)||!xV(e))return!1;const s=t.groupScale,a=e.groupScale;return!yl(s,a)}function ix({id:t},e,i,n,...s){const a={...n,phase:n?.phase??(i?wr[i]:"trailing")};Uc(t,"markers",e,s,{opacity:0},{opacity:1},a);for(const o of s)o.cleanup()}function Ait({id:t},e,...i){Uc(t,"markers",e,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"});for(const n of i)n.cleanup()}function DL({id:t,nodeDataDependencies:e},i,n,...s){const a=e.seriesRectWidth;dn(t,"markers",i,s,{fromFn:(l,c)=>{const u=c.midPoint?.x??a;let d=Nt(0,nG(u/a),1);return Number.isNaN(d)&&(d=0),{scalingX:0,scalingY:0,delay:n?.delay??d,duration:n?.duration??mN,phase:n?.phase??"initial",start:n?.start,finish:n?.finish}},toFn:()=>({scalingX:1,scalingY:1})})}function rA(t){return{opacity:1,scalingX:1,scalingY:1}}function lA(t){for(const e of t){const i=e.nodes();e.batchedUpdate(function(){for(const s of i){const a=s.datum;if(a?.point==null)continue;const{x:o,y:r}=a.point;!Number.isFinite(o)||!Number.isFinite(r)||s.resetAnimationProperties(o,r,s.size,1,1,1)}e.cleanup()})}}function nx(t,e){return{x:e.point?.x??Number.NaN,y:e.point?.y??Number.NaN,scalingCenterX:e.point?.x??Number.NaN,scalingCenterY:e.point?.y??Number.NaN}}function cA(t,{datumIndex:e}){const i=t.getNodeData();if(i===void 0)return;const n=i[e],{point:s}=n??{};if(n==null||s==null)return;const a=t.getFormattedMarkerStyle(n),o=wn.anchor(a.shape),r=s.focusSize??a.size,l=4+r,c=l/2,u=(o.x-.5)*r,d=(o.y-.5)*r,g=n.point.x-c-u,f=n.point.y-c-d;return Ti.toCanvas(t.contentGroup,new Tt(g,f,l,l))}function AL(t,e,i,n=i){return n.enabled??i.enabled?(e.step??Tc(e.range)/Math.max(1,t))>1:!1}function hA(t,e,i,n){return n??(n={stroke:e.stroke,strokeOpacity:e.strokeOpacity,strokeWidth:e.strokeWidth}),UT.reduce((s,a)=>(s[a]=t.getMarkerStyle(i,{},void 0,{highlightState:a},void 0,n),s),{})}function IL({id:t,visible:e,nodeDataDependencies:i},n,...s){const{seriesRectWidth:a,seriesRectHeight:o}=i;Uc(t,"path_properties",n,s,{clipX:0},{clipX:a},{phase:"initial",start:{clip:!0,clipY:o,visible:e},finish:{clip:!1,visible:e}})}function WN({id:t},e,i,n="add",...s){Uc(t,e,i,s,{opacity:0},{opacity:1},{phase:n})}function kL(t){return e=>({visible:t.getVisible(),opacity:t.getOpacity(),clipScalingX:1,clip:!1})}function OM({nodeDataDependencies:t},e){const i=n=>Number.isFinite(n)?n:0;e.clipX=i(t.seriesRectWidth),e.clipY=i(t.seriesRectHeight)}var SW={[z.Angle]:["angleKey"],[z.Radius]:["radiusKey"]},MW={[z.Angle]:["angleName"],[z.Radius]:["radiusName"]},CL=class extends fL{constructor({categoryKey:t,pickModes:e=[1,0],canHaveAxes:i=!1,animationResetFns:n,...s}){super({...s,categoryKey:t,pickModes:e,canHaveAxes:i}),this.directions=[z.Angle,z.Radius],this.itemGroup=this.contentGroup.appendChild(new ee({name:"items"})),this.nodeData=[],this.itemSelection=pn.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=pn.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=pn.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=pn.select(this.highlightLabelGroup,()=>this.labelFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.maxChartMarkerSize=0,this.animationResetFns=n,this.animationState=new Rt("empty",{empty:{update:{target:"ready",action:a=>this.animateEmptyUpdateReady(a)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:a=>this.animateReadyHighlight(a),highlightMarkers:a=>this.animateReadyHighlightMarkers(a),resize:a=>this.animateReadyResize(a),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:a=>this.animateWaitingUpdateReady(a)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:a=>this.animateClearingUpdateEmpty(a)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable()),this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",a=>this.onLegendItemClick(a)),this.ctx.eventsHub.on("legend:item-double-click",a=>this.onLegendItemDoubleClick(a)))}getItemNodes(){return[...this.itemGroup.children()]}getNodeData(){return this.nodeData}getKeyAxis(t){if(t===z.Angle)return this.properties.angleKeyAxis;if(t===z.Radius)return this.properties.radiusKeyAxis}setZIndex(t){super.setZIndex(t),this.contentGroup.zIndex=[t,gl.FOREGROUND],this.highlightGroup.zIndex=[t,gl.HIGHLIGHT],this.labelGroup.zIndex=[t,gl.LABEL]}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}labelFactory(){const t=new Pa;return t.pointerEvents=1,t}getInnerRadius(){return 0}computeLabelsBBox(t,e){return null}getShapeFillBBox(){const t=this.radius;return{series:new Tt(-t,-t,t*2,t*2),axis:new Tt(-t,-t,t*2,t*2)}}resetAllAnimation(){const{item:t,label:e}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),t&&Qn([this.itemSelection,this.highlightSelection],t),e&&Qn([this.labelSelection,this.highlightLabelSelection],e),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup(),this.highlightLabelSelection.cleanup()}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(t){const{item:e,label:i}=this.animationResetFns??{};e&&Qn([this.highlightSelection],e),i&&Qn([this.highlightLabelSelection],i)}animateReadyHighlightMarkers(t){}animateReadyResize(t){this.resetAllAnimation()}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}computeFocusBounds(t){const e=this.getNodeData()?.[t.datumIndex];if(e!==void 0)return this.itemSelection.select(i=>i instanceof Tn&&i.datum===e)[0]}getSeriesRange(){return[Number.NaN,Number.NaN]}isSeriesHighlighted(t,e){if(!this.properties.highlight.enabled)return!1;const{series:i,legendItemName:n,datumIndex:s}=t??{},a=typeof s=="number"?e?.[s]:void 0;return i===this||a!=null&&a===n}},DW=(t=>(t[t.None=0]="None",t[t.Item=1]="Item",t[t.OtherItem=2]="OtherItem",t[t.Branch=3]="Branch",t[t.OtherBranch=4]="OtherBranch",t))(DW||{});function sb(t){const e=i=>i;switch(t){case 1:return"highlighted-item";case 2:return"unhighlighted-item";case 3:return"highlighted-branch";case 4:return"unhighlighted-branch";case 0:return"none";default:return e(t)}}var Ku=class extends Fr{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(un),this.strokes=Object.values(pc)}};T([b],Ku.prototype,"childrenKey",2);T([b],Ku.prototype,"sizeKey",2);T([b],Ku.prototype,"colorKey",2);T([b],Ku.prototype,"colorName",2);T([b],Ku.prototype,"fills",2);T([b],Ku.prototype,"strokes",2);T([b],Ku.prototype,"colorRange",2);var AW=class ZS{constructor(e,i,n,s,a,o,r,l,c,u,d){this.series=e,this.itemId=i,this.datumIndex=n,this.datum=s,this.sizeValue=a,this.colorValue=o,this.sumSize=r,this.depth=l,this.parent=c,this.children=u,this.style=d,this.midPoint={x:0,y:0}}get hasChildren(){return this.children.length>0}walk(e,i=ZS.Walk.PreOrder){i===ZS.Walk.PreOrder&&e(this);for(const n of this.children)n.walk(e,i);i===ZS.Walk.PostOrder&&e(this)}find(e){if(e(this))return this;for(const i of this.children){const n=i.find(e);if(n!=null)return n}}*[Symbol.iterator](){yield this;for(const e of this.children)yield*e}};AW.Walk={PreOrder:0,PostOrder:1};var Iit=AW,kit=class extends Wx{constructor(t){super({moduleCtx:t,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new qf,this.animationState=new Rt("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}processData(){this.data?.commitPendingTransactions();const{NodeClass:t}=this,{childrenKey:e,sizeKey:i,colorKey:n,colorRange:s}=this.properties;let a=0,o=1/0,r=-1/0;const l=(g,f,y)=>{const x=y.depth==null?0:y.depth+1,S=e==null?void 0:g[e],D=S==null||S.length===0;let A=i==null?void 0:g[i];Number.isFinite(A)?A=Math.max(A,0):A=D?1:0;const I=A;a=Math.max(a,x);const w=n==null?void 0:g[n];typeof w=="number"&&(o=Math.min(o,w),r=Math.max(r,w));const N=this.getItemStyle({datumIndex:f,datum:g,depth:x,colorValue:w},D,!1);return c(new t(this,As(f.join(";")),f,g,A,w,I,x,y,[],N),S)},c=(g,f)=>{const{datumIndex:y}=g;if(f)for(const[x,S]of f.entries()){const D=l(S,y.concat(x),g);g.children.push(D),g.sumSize+=D.sumSize}return g},u=c(new t(this,"root",[],void 0,0,void 0,0,void 0,void 0,[],{}),this.data?.data),d=[o,r];this.colorScale.domain=oe.itemId===t)}dataCount(){return Number.NaN}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getLegendData(t){const{colorKey:e,colorRange:i}=this.properties,{id:n,ctx:{legendManager:s},visible:a}=this;return t==="gradient"&&e!=null&&i!=null?[{legendType:"gradient",enabled:a&&s.getItemEnabled({seriesId:n}),seriesId:n,series:this.getFormatterContext("color"),colorRange:i,colorDomain:this.colorDomain}]:[]}getDatumIdFromData(t){return t.datumIndex.join(":")}getDatumId(t){return this.getDatumIdFromData(t)}removeMeIndexPathForIndex(t){return this.datumSelection.at(t+1)?.datum.datumIndex??[]}removeMeIndexForIndexPath(t){for(const{index:e,datum:i}of this.datumSelection)if(tr(i.datumIndex,t))return e-1;return 0}pickFocus(t){if(!this.rootNode?.children.length)return;const e=Nt(0,t.datumIndex-t.datumIndexDelta,this.datumSelection.length-1),{datumIndexDelta:i,otherIndexDelta:n}=t;let s=this.removeMeIndexPathForIndex(e);const a=s.reduce((l,c)=>l.children[c],this.rootNode);if(n>0&&a.hasChildren)s=[...s,0];else if(n<0&&s.length>1)s=s.slice(0,-1);else if(n===0&&i!==0){const l=a.parent.children.length-1;s=s.slice(),s[s.length-1]=Nt(0,s.at(-1)+i,l)}const o=s.reduce((l,c)=>l.children[c],this.rootNode),r=this.computeFocusBounds(this.datumSelection.at(e+1));if(r!=null)return{datum:o,datumIndex:this.removeMeIndexForIndexPath(s),otherIndex:o.depth,bounds:r,clipFocusBox:!0}}getDatumAriaText(t,e){if(!(t instanceof this.NodeClass)){pt.error(`datum is not HierarchyNode: ${JSON.stringify(t)}`);return}return this.ctx.localeManager.t("ariaAnnounceHierarchyDatum",{level:(t.depth??-1)+1,count:t.children.length,description:e})}getCategoryValue(t){}datumIndexForCategoryValue(t){}getActiveHighlightNode(){if(!this.properties.highlight.enabled)return;const t=this.ctx.highlightManager?.getActiveHighlight();if(t?.series===this)return t}getHierarchyHighlightState(t,e,i){if(t)return 1;if(e==null)return 0;const n=i.datumIndex?.[0],s=e.datumIndex?.[0];return n==null||s==null?0:n===s?3:4}getHierarchyHighlightStyles(t,e){switch(t){case 1:return Et(e.highlightedItem,e.highlightedBranch);case 3:return Et(e.unhighlightedItem,e.highlightedBranch);case 4:return e.unhighlightedBranch;default:return}}getHighlightStateString(t,e,i,n){if(!this.properties.highlight.enabled||i==null)return sb(0);const s=i.reduce((r,l)=>r?.children[l],this.rootNode),a=this.getActiveHighlightNode();if(s==null)return sb(0);const o=this.getHierarchyHighlightState(e??!1,a,s);return sb(o)}},uA=Math.PI/180,GC=t=>t*uA,UC=t=>-Math.log(Math.tan(Math.PI*.25+t*uA*.5)),WC=t=>t/uA,KC=t=>(Math.atan(Math.exp(-t))-Math.PI*.25)/(uA*.5),Cit=class KN extends OD{constructor(e,i){super(),this.domain=e,this.range=i,this.type="mercator",this.defaultTickCount=0,this.bounds=KN.bounds(e)}static bounds(e){const[[i,n],[s,a]]=e,o=GC(i),r=UC(n),l=GC(s),c=UC(a);return new Tt(Math.min(o,l),Math.min(r,c),Math.abs(l-o),Math.abs(c-r))}static fixedScale(){return new KN([[WC(0),KC(0)],[WC(1),KC(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...e){let i=-1/0,n=1/0,s=-1/0,a=1/0;for(const o of e){const r=o.domain;for(const[l,c]of r)i=Math.min(l,i),n=Math.max(l,n),s=Math.min(c,s),a=Math.max(c,a)}return{domain:[[i,s],[n,a]],animatable:!0}}convert([e,i]){const[[n,s],[a,o]]=this.range,r=(a-n)/this.bounds.width,l=(o-s)/this.bounds.height;return[(GC(e)-this.bounds.x)*r+n,(UC(i)-this.bounds.y)*l+s]}invert([e,i]){const[[n,s],[a,o]]=this.range,r=(a-n)/this.bounds.width,l=(o-s)/this.bounds.height;return[WC((e-n)/r+this.bounds.x),KC((i-s)/l+this.bounds.y)]}getDomainMinMax(){return RD(this.domain)}},wit=class{constructor(t){this.minimumDelay=t?.minimumDelay??50,this.timeout=t?.timeout??100}schedule(t,e){this.cancel(),this.pending={computation:t,onComplete:e},this.minimumDelay>0?this.delayTimeoutId=setTimeout(()=>{this.delayTimeoutId=void 0,this.scheduleIdleCallback()},this.minimumDelay):this.scheduleIdleCallback()}demand(){if(this.pending)return this.cancelScheduled(),this.execute()}cancel(){this.cancelScheduled(),this.pending=void 0}isPending(){return this.pending!=null}scheduleIdleCallback(){const t=Math.max(0,this.timeout-this.minimumDelay);typeof requestIdleCallback=="function"?this.idleCallbackId=requestIdleCallback(this.execute.bind(this),{timeout:t}):this.idleCallbackId=setTimeout(()=>this.execute(),t)}cancelScheduled(){this.delayTimeoutId!=null&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=void 0),this.idleCallbackId!=null&&(typeof cancelIdleCallback=="function"?cancelIdleCallback(this.idleCallbackId):clearTimeout(this.idleCallbackId),this.idleCallbackId=void 0)}execute(){const{pending:t}=this;if(!t)return;this.pending=void 0,this.delayTimeoutId=void 0,this.idleCallbackId=void 0;const e=t.computation();return t.onComplete(e),e}},dA=class{constructor(){this._dataLength=0,this.executor=new wit}get filters(){return this._filters}aggregate(e){if(this.executor.cancel(),e.targetRange>1&&e.computePartial){const i=e.computePartial(this._filters);if(i){const{immediate:n,computeRemaining:s}=i;return s&&this.executor.schedule(s,a=>{this.mergeFilters(a)}),this._filters=n,n}}return this._filters=e.computeFull(this._filters),this._filters}ensureLevelForRange(e){if(!this._filters?.some(n=>n.maxRange>e)&&this.executor.isPending()){const n=this.executor.demand();n&&this.mergeFilters(n)}}getFilterForRange(e){return this._filters?.find(i=>i.maxRange>e)}cancel(){this.executor.cancel()}markStale(e){const i=this._dataLength>0?e/this._dataLength:0;if(i>=2||i<=.5||this._dataLength===0)this._filters=void 0;else if(this._filters)for(const n of this._filters)n.stale=!0;this._dataLength=e,this.executor.cancel()}mergeFilters(e){if(!this._filters||e.length===0)return;const i=[...this._filters,...e];i.sort((n,s)=>n.maxRange-s.maxRange),this._filters=i}},wL=class extends JT{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}update(){super.update(),this.tickLineGroup.visible=this.tick.enabled,this.tickLabelGroup.visible=this.label.enabled}layoutCrossLines(){const e=this.label.getSideFlag(),i=this.hasDefinedDomain()||this.hasVisibleSeries(),{rotation:n,parallelFlipRotation:s,regularFlipRotation:a}=this.calculateRotations();for(const o of this.crossLines)o.sideFlag=-e,o.direction=n===-Math.PI/2?z.Angle:z.Radius,o.parallelFlipRotation=s,o.regularFlipRotation=a,o.calculateLayout?.(i,this.reverse)}updatePosition(){super.updatePosition();const e=Math.floor(this.translation.x),i=Math.floor(this.translation.y);this.tickLineGroup.translationX=e,this.tickLineGroup.translationY=i,this.tickLabelGroup.translationX=e,this.tickLabelGroup.translationY=i,this.crossLineRangeGroup.translationX=e,this.crossLineRangeGroup.translationY=i,this.crossLineLineGroup.translationX=e,this.crossLineLineGroup.translationY=i,this.crossLineLabelGroup.translationX=e,this.crossLineLabelGroup.translationY=i,this.tickLabelGroupSelection.each(CM())}computeLabelsBBox(e,i){return null}computeRange(){}getAxisLinePoints(){}};T([b],wL.prototype,"shape",2);T([b],wL.prototype,"innerRadiusRatio",2);var IW=class extends qx{calculateGridLine({index:t,tickId:e,translation:i},n,s,a,o){const{gridLine:r,horizontal:l,interval:c,range:u}=this;if(c.placement!=="between")return super.calculateGridLine({index:t,tickId:e,translation:i},n,s,a,o);const d=o[n-1],g=d?i-(i-d.translation)/2:u[0],[f,y,x,S]=l?[g,Math.max(s,a),g,Math.min(s,a)]:[Math.min(s,a),g,Math.max(s,a),g],{style:D}=r,{stroke:A,strokeWidth:I=0,lineDash:w}=D[t%D.length]??{};return{tickId:e,offset:g,x1:f,y1:y,x2:x,y2:S,stroke:A,strokeWidth:I,lineDash:w}}calculateGridFills(t,e,i){return this.interval.placement!=="between"?super.calculateGridFills(t,e,i):t.map((n,s)=>this.calculateGridFill(n,s,n.index,e,i,t))}calculateGridFill({tickId:t,translation:e},i,n,s,a,o){const{gridLine:r,horizontal:l,interval:c,range:u}=this;if(c.placement!=="between")return super.calculateGridFill({tickId:t,translation:e},i,n,s,a,o);const d=o[i-1],g=o[i+1],f=d?e-(e-d.translation)/2:u[0],y=g?e+(g.translation-e)/2:u[1],[x,S,D,A]=l?[f,Math.max(s,a),y,Math.min(s,a)]:[Math.min(s,a),f,Math.max(s,a),y],{fill:I,fillOpacity:w}=r.style[n%r.style.length]??{};return{tickId:t,x1:x,y1:S,x2:D,y2:A,fill:I,fillOpacity:w}}calculateTickLine({isPrimary:t,tickId:e,translation:i},n,s,a,o=0){const{horizontal:r,interval:l,primaryTick:c,range:u,tick:d}=this;if(l.placement!=="between")return super.calculateTickLine({isPrimary:t,tickId:e,translation:i},n,s,a,o);const g=t&&c?.enabled?c:d,f=-s*this.getTickSize(g),y=a[n-1],x=y?i-(i-y.translation)/2:u[0],S=-s*(o+this.getTickSpacing(g)),[D,A,I,w]=r?[x,S,x,S+f]:[S,x,S+f,x],{stroke:N,width:O}=g;return{tickId:e,offset:x,x1:D,y1:A,x2:I,y2:w,stroke:N,strokeWidth:O,lineDash:void 0}}},Nit={top:{xTranslationDirection:0,yTranslationDirection:-1},bottom:{xTranslationDirection:0,yTranslationDirection:1},left:{xTranslationDirection:-1,yTranslationDirection:0},right:{xTranslationDirection:1,yTranslationDirection:0},"top-left":{xTranslationDirection:1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"bottom-right":{xTranslationDirection:-1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:1,yTranslationDirection:0},"inside-right":{xTranslationDirection:-1,yTranslationDirection:0},"inside-top":{xTranslationDirection:0,yTranslationDirection:1},"inside-bottom":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-right":{xTranslationDirection:-1,yTranslationDirection:-1}},Tit={top:{xTranslationDirection:1,yTranslationDirection:0},bottom:{xTranslationDirection:-1,yTranslationDirection:0},left:{xTranslationDirection:0,yTranslationDirection:-1},right:{xTranslationDirection:0,yTranslationDirection:1},"top-left":{xTranslationDirection:-1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"bottom-right":{xTranslationDirection:1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:0,yTranslationDirection:1},"inside-right":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top":{xTranslationDirection:-1,yTranslationDirection:0},"inside-bottom":{xTranslationDirection:1,yTranslationDirection:0},"inside-top-left":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"inside-bottom-right":{xTranslationDirection:1,yTranslationDirection:-1}};function Lit({yDirection:t,padding:e=0,position:i="top",bbox:n}){const s=t?Nit:Tit,{xTranslationDirection:a,yTranslationDirection:o}=s[i],r=a*(e+n.width/2),l=o*(e+n.height/2);return{xTranslation:r,yTranslation:l}}function EM(t,e,i,n,s){const a=(d,g,f,y)=>{i.animate({id:`${t}_${e}_${g.id}_${d}`,groupId:t,from:f?1:0,to:1,ease:Lc,collapsable:f,onUpdate(x,S){S&&d!=="removed"||(g.path.clear(!0),y(x,g),g.checkPathDirty())},onStop(){d==="added"&&(g.path.clear(!0),y(1,g),g.checkPathDirty())},phase:wr[d]})},o=new Tn,r=d=>(o.resetPathDirty(),d(0,o),o.resetPathDirty(),d(1,o),o.checkPathDirty(),o.isPathDirty()),{addPhaseFn:l,updatePhaseFn:c,removePhaseFn:u}=s;for(const d of n)i.isSkipped()||(a("removed",d,!r(u),u),a("updated",d,!r(c),c)),a("added",d,!r(l),l)}var zl=class extends Zf{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};T([b,ut()],zl.prototype,"enabled",2);T([b,ut()],zl.prototype,"color",2);T([b,ut()],zl.prototype,"xOffset",2);T([b,ut()],zl.prototype,"yOffset",2);T([b,ut()],zl.prototype,"blur",2);function kW({startAngle:t,endAngle:e,innerRadius:i,outerRadius:n}){let s=1/0,a=1/0,o=-1/0,r=-1/0;const l=(c,u)=>{s=Math.min(c,s),a=Math.min(u,a),o=Math.max(c,o),r=Math.max(u,r)};return l(i*Math.cos(t),i*Math.sin(t)),l(i*Math.cos(e),i*Math.sin(e)),l(n*Math.cos(t),n*Math.sin(t)),l(n*Math.cos(e),n*Math.sin(e)),Ba(0,t,e)&&l(n,0),Ba(Math.PI*.5,t,e)&&l(0,n),Ba(Math.PI,t,e)&&l(-n,0),Ba(Math.PI*1.5,t,e)&&l(0,-n),new Tt(s,a,o-s,r-a)}function YN(t,e,i){const n=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),{innerRadius:s,outerRadius:a}=i;if(i.startAngle===i.endAngle||nMath.max(s,a))return!1;const o=uM(i.startAngle),r=uM(i.endAngle),l=Math.atan2(e,t);return o=o:l<=r&&l>=-Math.PI||l>=o&&l<=Math.PI}function Oit(t,e,i,n,s,a,o,r,l,c){if(Number.isNaN(t)||Number.isNaN(e))return 0;[s,n]=[n,s];const u=(c-r)/(l-o),d=r-u*o,g=Math.pow(u,2)+1,f=2*(u*(d-e)-t),y=Math.pow(t,2)+Math.pow(d-e,2)-Math.pow(i,2),x=Math.pow(f,2)-4*g*y;if(x<0)return 0;const S=(-f+Math.sqrt(x))/2/g,D=(-f-Math.sqrt(x))/2/g;let A=0;for(const I of[S,D]){if(!(I>=Math.min(o,l)&&I<=Math.max(o,l)))continue;const N=u*I+d,O=I-t,L=N-e,R=Math.atan2(L,O);Ba(R,n,s)&&A++}return A}function vV(t,e){const{startAngle:i,endAngle:n,innerRadius:s,outerRadius:a}=e,o={x:a*Math.cos(i),y:a*Math.sin(i)},r={x:a*Math.cos(n),y:a*Math.sin(n)},l=s===0?{x:0,y:0}:{x:s*Math.cos(i),y:s*Math.sin(i)},c=s===0?{x:0,y:0}:{x:s*Math.cos(n),y:s*Math.sin(n)};return bb(t.start.x,t.start.y,t.end.x,t.end.y,o.x,o.y,l.x,l.y)||bb(t.start.x,t.start.y,t.end.x,t.end.y,r.x,r.y,c.x,c.y)||Oit(0,0,a,i,n,!0,t.start.x,t.start.y,t.end.x,t.end.y)}function Eit(t,e){const i={x:t.x,y:t.y},n={x:t.x+t.width,y:t.y},s={x:t.x,y:t.y+t.height},a={x:t.x+t.width,y:t.y+t.height};return vV({start:i,end:n},e)||vV({start:s,end:a},e)}function SV(t,e,i,n){if(i===0&&n===0)return 0;if(Math.asin(Math.abs(1*i)/(t+1*i))+Math.asin(Math.abs(1*n)/(t+1*n))-e<0)return 1;let a=0,o=1;for(let r=0;r<8;r+=1){const l=(a+o)/2;Math.asin(Math.abs(l*i)/(t+l*i))+Math.asin(Math.abs(l*n)/(t+l*n))-e<0?a=l:o=l}return a}var Rit=1e-6;function pu(t,e){return fl(t,e)=2*Math.PI?2*Math.PI:ze(e-t);return t=pu(t,i),e=t+s,{startAngle:t,endAngle:e}}function K0(t,e,i,n,s,a){const o=Math.sin(a),r=Math.cos(a),l=t**2+e**2-i**2;let c,u,d,g;if(r>.5){const I=o/r,w=1+I**2,N=-2*(t+e*I),O=N**2-4*w*l;if(O<0)return;const L=(-N+Math.sqrt(O))/(2*w),R=(-N-Math.sqrt(O))/(2*w);c=L,u=L*I,d=R,g=R*I}else{const I=r/o,w=1+I**2,N=-2*(e+t*I),O=N**2-4*w*l;if(O<0)return;const L=(-N+Math.sqrt(O))/(2*w),R=(-N-Math.sqrt(O))/(2*w);c=L*I,u=L,d=R*I,g=R}const f=r,y=o,x=c*f+u*y,S=d*f+g*y,D=x>0?pu(Math.atan2(u-e,c-t),n):Number.NaN,A=S>0?pu(Math.atan2(g-e,d-t),n):Number.NaN;if(D>=n&&D<=s)return D;if(A>=n&&A<=s)return A}function Y0(t,e,i,n,s,a){const o=Math.hypot(t,e),r=(o**2-i**2+a**2)/(2*o),l=o-r,c=Math.atan2(e,t),u=Math.acos(-l/i),d=pu(c+u,n),g=pu(c-u,n);if(d>=n&&d<=s)return d;if(g>=n&&g<=s)return g}var CW=class extends Tn{constructor(e=""){super(),this._d="",this.d=e}get d(){return this._d}set d(e){e!==this._d&&(this._d=e,this.path.clear(),this.path.appendSvg(e),this.checkPathDirty())}},Pit=class extends Jf(CW){isPointInPath(t,e){return super.isPointInPath(t-this.translationX,e-this.translationY)}},zit=class wW extends du{static is(e){return e instanceof wW}setSourceScale(e){this._sourceScale=e;const i=s=>{Object.defineProperty(this,s,{get:()=>e[s],set:a=>{e[s]=a},configurable:!0})};i("domain"),i("range"),i("paddingInner"),i("paddingOuter"),i("round");const n=s=>{Object.defineProperty(this,s,{get:()=>e[s],configurable:!0})};n("bandwidth"),n("step"),n("inset"),n("rawBandwidth")}get bands(){return this._sourceScale?.bands??super.bands}refresh(){this._sourceScale?.refresh?.()}ordinalRange(e){return this._sourceScale?this._sourceScale.ordinalRange(e):super.ordinalRange(e)}convert(e,i){this.refresh();const n=this.findIndex(e,i?.alignment);return n==null||n<0||n>=this.bands.length?Number.NaN:this.ordinalRange(n)}findIndex(e,i=wi.Leading){if(e==null)return;const{bands:n,reversed:s}=this,a=n.length;if(a===0)return;if(a===1)return 0;const o=n[0],r=n[a-1];if(o==null||r==null)return this._sourceScale?.findIndex(e,i);const l=e.valueOf(),c=o.valueOf(),u=r.valueOf(),d=(l-c)/(u-c),g=s?(1-d)*(a-1):d*(a-1);return i===wi.Leading?Math.max(0,Math.min(a-1,Math.floor(g))):Math.max(0,Math.min(a-1,Math.ceil(g)))}},NW=class $N{constructor(e,i,n,s){this.startAngle=e,this.endAngle=i,this.innerRadius=n,this.outerRadius=s}clone(){const{startAngle:e,endAngle:i,innerRadius:n,outerRadius:s}=this;return new $N(e,i,n,s)}equals(e){return this.startAngle===e.startAngle&&this.endAngle===e.endAngle&&this.innerRadius===e.innerRadius&&this.outerRadius===e.outerRadius}[LD](e,i){return new $N(this.startAngle*(1-i)+e.startAngle*i,this.endAngle*(1-i)+e.endAngle*i,this.innerRadius*(1-i)+e.innerRadius*i,this.outerRadius*(1-i)+e.outerRadius*i)}},dm=class extends Oc{constructor(t){super(),this.sourceImage=t,this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1}render(t){const{ctx:e}=t,i=this.sourceImage;i&&(e.globalAlpha=this.opacity,e.drawImage(i,0,0,i.width,i.height,this.x,this.y,this.width,this.height)),super.render(t)}};T([ut()],dm.prototype,"x",2);T([ut()],dm.prototype,"y",2);T([ut()],dm.prototype,"width",2);T([ut()],dm.prototype,"height",2);T([ut()],dm.prototype,"opacity",2);var Bl=class extends Tn{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=Math.PI*2,this.counterClockwise=!1,this.type=0}get fullPie(){return be(ze(this.startAngle),ze(this.endAngle))}updatePath(){const t=this.path;t.clear(),t.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),this.type===1?t.closePath():this.type===2&&!this.fullPie&&(t.lineTo(this.centerX,this.centerY),t.closePath())}computeBBox(){return new Tt(this.centerX-this.radius,this.centerY-this.radius,this.radius*2,this.radius*2)}isPointInPath(t,e){const i=this.getBBox();return this.type!==0&&i.containsPoint(t,e)&&this.path.isPointInPath(t,e)}};Bl.className="Arc";T([ut()],Bl.prototype,"centerX",2);T([ut()],Bl.prototype,"centerY",2);T([ut()],Bl.prototype,"radius",2);T([ut()],Bl.prototype,"startAngle",2);T([ut()],Bl.prototype,"endAngle",2);T([ut()],Bl.prototype,"counterClockwise",2);T([ut()],Bl.prototype,"type",2);function $0(t,e,i){const n=Math.hypot(t,e),a=Math.atan2(e,t)+i;return{x:Math.cos(a)*n,y:Math.sin(a)*n}}var Gr=class extends Tn{constructor(){super(...arguments),this.isBeveled=!0,this.columnWidth=0,this.startAngle=0,this.endAngle=0,this.outerRadius=0,this.innerRadius=0,this.axisInnerRadius=0,this.axisOuterRadius=0}set cornerRadius(e){}computeBBox(){const{columnWidth:e}=this,[i,n]=this.normalizeRadii(this.innerRadius,this.outerRadius),s=this.getRotation(),a=-e/2,o=e/2,r=-n,l=-i;let c=1/0,u=1/0,d=-1/0,g=-1/0;for(let f=0;f<4;f+=1){const{x:y,y:x}=$0(f%2===0?a:o,f<2?r:l,s);c=Math.min(y,c),u=Math.min(x,u),d=Math.max(y,d),g=Math.max(x,g)}return new Tt(c,u,d-c,g-u)}getRotation(){const{startAngle:e,endAngle:i}=this,n=fl(e,i);return ze(e+n/2+Math.PI/2)}normalizeRadii(e,i){return e>i?[i,e]:[e,i]}updatePath(){const{isBeveled:e}=this;e?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:e,path:i}=this,[n,s]=this.normalizeRadii(this.innerRadius,this.outerRadius),a=-e/2,o=e/2,r=-s,l=-n,c=this.getRotation(),u=[[a,l],[a,r],[o,r],[o,l]].map(([d,g])=>$0(d,g,c));i.clear(!0),i.moveTo(u[0].x,u[0].y),i.lineTo(u[1].x,u[1].y),i.lineTo(u[2].x,u[2].y),i.lineTo(u[3].x,u[3].y),i.closePath()}calculateCircleIntersection(e,i){const n=e*e;if(is||Math.hypot(l,c)>s;if(!g&&!f&&!y){this.updateRectangularPath();return}const x=g?this.calculateBothIntersections(r,l,a):null,S=f?this.calculateBothIntersections(r,l,o):null,D=y?this.calculateAxisOuterIntersections(r,l,s):null;if(g&&!x||f&&!S||y&&!D){this.updateRectangularPath();return}i.clear(!0);const A={left:r,right:l,top:c,bottom:u,rotation:d};x?this.moveToRotated(r,x.left.y,d):this.moveToRotated(r,u,d),x?i.arc(0,0,a,d+x.left.angle,d+x.right.angle,!1):this.lineToRotated(l,u,d),S?(this.lineToRotated(l,S.right.y,d),i.arc(0,0,o,d+S.right.angle,d+S.left.angle,!0)):D?this.renderTopWithCornerClipping(s,D,A):(this.lineToRotated(l,c,d),this.lineToRotated(r,c,d)),i.closePath()}};Gr.className="RadialColumnShape";T([ut()],Gr.prototype,"isBeveled",2);T([ut()],Gr.prototype,"columnWidth",2);T([ut()],Gr.prototype,"startAngle",2);T([ut()],Gr.prototype,"endAngle",2);T([ut()],Gr.prototype,"outerRadius",2);T([ut()],Gr.prototype,"innerRadius",2);T([ut()],Gr.prototype,"axisInnerRadius",2);T([ut()],Gr.prototype,"axisOuterRadius",2);function TW(t,e,i,n,s){const a=fl(t,e),o=a*(1-n)/2;if(t+=o,e-=o,a<.001)return 2*i*s;if(a>=2*Math.PI){const f=t+a/2;t=f-Math.PI,e=f+Math.PI}const r=i*Math.cos(t),l=i*Math.sin(t),c=i*Math.cos(e),u=i*Math.sin(e),d=Math.floor(Math.hypot(r-c,l-u)),g=2*i*s;return Math.max(1,Math.min(g,d))}var YC=class{constructor(t,e,i,n,s){this.cx=t,this.cy=e,this.r=i,this.a0=n,this.a1=s,this.a0>=this.a1&&(this.a0=Number.NaN,this.a1=Number.NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(t){return{x:this.cx+this.r*Math.cos(t),y:this.cy+this.r*Math.sin(t)}}clipStart(t){t==null||!this.isValid()||t=this.a1)&&(this.a0=Number.NaN,this.a1=Number.NaN))}clipEnd(t){t==null||!this.isValid()||t>this.a1||(this.a1=t,(Number.isNaN(t)||this.a0>=this.a1)&&(this.a0=Number.NaN,this.a1=Number.NaN))}},Ts=class extends Tn{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=Math.PI*2,this.clipSector=void 0,this.concentricEdgeInset=0,this.radialEdgeInset=0,this.startOuterCornerRadius=0,this.endOuterCornerRadius=0,this.startInnerCornerRadius=0,this.endInnerCornerRadius=0}set inset(e){this.concentricEdgeInset=e,this.radialEdgeInset=e}set cornerRadius(e){this.startOuterCornerRadius=e,this.endOuterCornerRadius=e,this.startInnerCornerRadius=e,this.endInnerCornerRadius=e}computeBBox(){return kW(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:e}=this;let{innerRadius:i,outerRadius:n}=this;return i=i>0?i+e:0,n=Math.max(n-e,0),{innerRadius:i,outerRadius:n}}normalizedClipSector(){const{clipSector:e}=this;if(e==null)return;const{startAngle:i,endAngle:n}=W0(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:a}=this.normalizedRadii(),o=W0(e.startAngle,e.endAngle,i);return new NW(Math.max(i,o.startAngle),Math.min(n,o.endAngle),Math.max(s,e.innerRadius),Math.min(a,e.outerRadius))}getAngleOffset(e){return e>0?this.radialEdgeInset/e:0}arc(e,i,n,s,a,o,r,l){if(e<=0)return;const{startAngle:c,endAngle:u}=W0(this.startAngle,this.endAngle),{innerRadius:d,outerRadius:g}=this.normalizedRadii(),f=this.normalizedClipSector();if(l&&d<=0)return;const y=l?this.getAngleOffset(d+e):this.getAngleOffset(g-e),x=r?c+y+i:u-y-i,S=l?d+e:g-e,D=S*Math.cos(x),A=S*Math.sin(x);if(f!=null&&(!r&&!(x>=c-1e-6&&x<=f.endAngle-1e-6)||r&&!(x>=f.startAngle+1e-6&&x<=u-1e-6)||l&&Sf.outerRadius+1e-6))return;const I=new YC(D,A,e,n,s);if(f!=null){l?(I.clipStart(K0(D,A,e,n,s,f.endAngle)),I.clipEnd(K0(D,A,e,n,s,f.startAngle))):(I.clipStart(K0(D,A,e,n,s,f.startAngle)),I.clipEnd(K0(D,A,e,n,s,f.endAngle)));let R,P;if(r?(R=Y0(D,A,e,n,s,f.innerRadius),P=Y0(D,A,e,n,s,f.outerRadius)):(R=Y0(D,A,e,n,s,f.outerRadius),P=Y0(D,A,e,n,s,f.innerRadius)),I.clipStart(R),I.clipEnd(P),R!=null){const{x:B,y:F}=I.pointAt(R),H=pu(Math.atan2(F,B),c);r?o?.clipStart(H):a.clipEnd(H)}if(P!=null){const{x:B,y:F}=I.pointAt(P),H=pu(Math.atan2(F,B),c);r?a.clipStart(H):o?.clipEnd(H)}}if(f!=null){const{x:R,y:P}=I.pointAt((I.a0+I.a1)/2);if(!YN(R,P,f))return}const{x:w,y:N}=I.pointAt(r===l?I.a0:I.a1),O=pu(Math.atan2(N,w),c),L=l?o:a;return r?L?.clipStart(O):L?.clipEnd(O),I}updatePath(){const{path:i,centerX:n,centerY:s,concentricEdgeInset:a,radialEdgeInset:o}=this;let{startOuterCornerRadius:r,endOuterCornerRadius:l,startInnerCornerRadius:c,endInnerCornerRadius:u}=this;const{startAngle:d,endAngle:g}=W0(this.startAngle,this.endAngle),{innerRadius:f,outerRadius:y}=this.normalizedRadii(),x=this.normalizedClipSector(),S=g-d,D=S>=2*Math.PI-1e-6;i.clear();const A=this.getAngleOffset(f),I=S-2*A,w=y-f,N=f>0&&I>0?2*f*Math.sin(I/2):0,O=y>0&&I>0?2*y*Math.sin(I/2):0;if(r=Math.floor(Math.max(0,Math.min(r,O/2,w/2))),l=Math.floor(Math.max(0,Math.min(l,O/2,w/2))),c=Math.floor(Math.max(0,Math.min(c,N/2,w/2))),u=Math.floor(Math.max(0,Math.min(u,N/2,w/2))),f===0&&y===0||f>y||N<0||O<=0)return;if((x?.startAngle??d)===(x?.endAngle??g))return;if(D&&this.clipSector==null&&r===0&&l===0&&c===0&&u===0){i.moveTo(n+y*Math.cos(d),s+y*Math.sin(d)),i.arc(n,s,y,d,g),f>a&&(i.moveTo(n+f*Math.cos(g),s+f*Math.sin(g)),i.arc(n,s,f,g,d,!0)),i.closePath();return}else if(this.clipSector==null&&Math.abs(f-y)<1e-6){i.arc(n,s,y,d,g,!1),i.arc(n,s,y,g,d,!0),i.closePath();return}const R=this.getAngleOffset(y);if(S<2*R)return;const B=(x?.innerRadius??f)>a,F=f0?Math.min(w/H,1):1;r*=$,l*=$,c*=$,u*=$;const Y=SV(y,S-2*R,-r,-l);if(r*=Y,l*=Y,!F&&B){const zt=SV(f,S-2*A,c,u);c*=zt,u*=zt}else c=0,u=0;const U=Math.max(r+c,l+u),V=U>0?Math.min(w/U,1):1;r*=V,l*=V,c*=V,u*=V;let Z=0,W=0;const q=r/(y-r),nt=l/(y-l);if(q>=0&&q<1-1e-6)Z=Math.asin(q);else{Z=S/2;const zt=y/(1/Math.sin(Z)+1);r=Math.min(zt,r)}if(nt>=0&&nt<1-1e-6)W=Math.asin(nt);else{W=S/2;const zt=y/(1/Math.sin(W)+1);l=Math.min(zt,l)}const G=Math.asin(c/(f+c)),et=Math.asin(u/(f+u)),st=x?.outerRadius??y,lt=this.getAngleOffset(st),mt=new YC(0,0,st,d+lt,g-lt),Dt=x?.innerRadius??f,kt=this.getAngleOffset(Dt),Vt=B?new YC(0,0,Dt,d+kt,g-kt):void 0;x!=null&&(mt.clipStart(x.startAngle),mt.clipEnd(x.endAngle),Vt?.clipStart(x.startAngle),Vt?.clipEnd(x.endAngle));const Kt=this.arc(r,Z,d-Math.PI*.5,d+Z,mt,Vt,!0,!1),ae=this.arc(l,W,g-W,g+Math.PI*.5,mt,Vt,!1,!1),ne=this.arc(u,et,g+Math.PI*.5,g+Math.PI-et,mt,Vt,!1,!0),Qt=this.arc(c,G,d+Math.PI+G,d+Math.PI*1.5,mt,Vt,!0,!0);if(!(F&&B)){if(F){const zt=S0&&zt{n.hasPopup()||this.expandSubMenu(i,void 0)},this.handleMouseMove=(i,n)=>{n.focus({preventScroll:!0})}}destructor(){this.collapse({mode:"2"})}addSeparator(){const e=this.elem.ownerDocument.createElement("div");return ye(e,"role","separator"),this.elem.appendChild(e),e}toggleChildEnabledByIndex(e,i){this.children.at(e)?.setEnabled(i)}onChildAdded(e){super.onChildAdded(e),e.addListener("mouseenter",this.handleMouseEnter),e.addListener("mousemove",this.handleMouseMove)}onChildRemoved(e){super.onChildRemoved(e),e.removeListener("mouseenter",this.handleMouseEnter),e.removeListener("mousemove",this.handleMouseMove)}addSubMenu(){const e=new NL,i=new EW(this.orientation);i.id=lu();const n=()=>{this.collapseExpandedSubMenu(i),e.expandControlled()},s=a=>{const o=ff(this.elem)?"ArrowLeft":"ArrowRight";Nx(a.sourceEvent)&&a.sourceEvent.code===o&&(this.collapseExpandedSubMenu(i),e.expandControlled())};return e.setControlled(i),e.setAriaHasPopup("menu"),e.addListener("click",n),e.addListener("mouseenter",n),e.addListener("keydown",s),this.addChild(e),{subMenuButton:e,subMenu:i}}expandSubMenu(e,i){const{expansionScope:n}=this;n&&(this.collapseExpandedSubMenu(i),i?.expand(e))}collapseExpandedSubMenu(e){const{expansionScope:i}=this;i&&(i.expandedSubMenu?.collapse({mode:"4"}),i.expandedSubMenu=e)}getCloseKeys(){return ff(this.elem)?["Escape","ArrowRight"]:["Escape","ArrowLeft"]}expand(e){if(this.expansionScope!=null)return;this.expansionScope={lastFocus:cT(e.sourceEvent),expandedSubMenu:void 0,abort:()=>this.collapse({mode:"1"}),close:()=>this.collapse({mode:"0"}),removers:new qe};const i=this.expansionScope,n=this.children.map(s=>s.getElement());ye(i.lastFocus,"aria-expanded",!0),i.removers.register(mj(this.elem,i.abort),yj(this.elem,i.abort),...this.children.map(s=>rT(s.getElement(),i.close,()=>this.getCloseKeys())),e?.overrideFocusVisible&&xj(this.elem,n,e.overrideFocusVisible)),this.internalListener?.dispatch("expand-widget",this,{type:"expand-widget"}),this.children[0]?.focus({preventScroll:!0})}collapse(e){const{mode:i="0"}=e??{};if(this.expansionScope===void 0)return;const{lastFocus:n,removers:s,expandedSubMenu:a}=this.expansionScope;this.expansionScope=void 0,a?.collapse({mode:"3"}),ye(n,"aria-expanded",!1),i==="0"&&n?.focus({preventScroll:!0}),s.flush(),this.internalListener?.dispatch("collapse-widget",this,{type:"collapse-widget",mode:i})}},MV="canvas-overlay",RW=class extends Ln{constructor(t,e,i){super(),this.ctx=t,this.hideFns=[],this.setOwnedWidget=(()=>{let n;return s=>{n?.destroy(),n=s}})(),this.moduleId=`popover-${e}`,i?.detached?this.element=$t("div"):this.element=t.domManager.addChild(MV,this.moduleId),this.element.setAttribute("role","presentation"),this.hideFns.push(()=>this.setOwnedWidget(void 0)),this.cleanup.register(()=>t.domManager.removeChild(MV,this.moduleId))}attachTo(t){this.element.parentElement||t.element.append(this.element)}hide(t){const{lastFocus:e=this.lastFocus}=t??{};if(this.element.children.length!==0){for(const i of this.hideFns)i();e?.focus(),this.lastFocus=void 0}}removeChildren(){this.element.replaceChildren()}initPopoverElement(t,e){if(!this.element.parentElement)throw new Error("Can not show popover that has not been attached to a parent.");return t??(t=$t("div","ag-charts-popover")),t.classList.toggle("ag-charts-popover",!0),e.ariaLabel!=null&&t.setAttribute("aria-label",e.ariaLabel),e.class!=null&&t.classList.add(e.class),e.minWidth!=null&&(t.style.minWidth=`${e.minWidth}px`),this.element.replaceChildren(t),t}showWidget(t,e,i){this.setOwnedWidget(e),this.initPopoverElement(e.getElement(),i),e.addListener("collapse-widget",()=>{this.hide(),t.setControlled(void 0),this.setOwnedWidget(void 0)}),t.setControlled(e),t.expandControlled(),i.onHide&&this.hideFns.push(i.onHide)}showWithChildren(t,e){const i=this.initPopoverElement(void 0,e);if(i.replaceChildren(...t),this.hideFns.push(()=>this.removeChildren()),e.onHide&&this.hideFns.push(e.onHide),e.initialFocus&&e.sourceEvent){const n=cT(e.sourceEvent);n!==void 0&&(this.lastFocus=n,this.initialFocus=e.initialFocus)}return i}getPopoverElement(){return this.element.firstElementChild}updatePosition(t){const e=this.getPopoverElement();e&&(e.style.setProperty("right","unset"),e.style.setProperty("bottom","unset"),t.x!=null&&e.style.setProperty("left",`${t.x}px`),t.y!=null&&e.style.setProperty("top",`${t.y}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}},PW=class extends RW{setAnchor(t,e){this.anchor=t,this.fallbackAnchor=e,this.updatePosition(t),this.repositionWithinBounds()}updateAnchor(t){const e=t.anchor??this.anchor,i=t.fallbackAnchor??this.fallbackAnchor;e&&this.setAnchor(e,i)}showWidget(t,e,i){super.showWidget(t,e,i),this.updateAfterShow(i)}showWithChildren(t,e){const i=super.showWithChildren(t,e);return this.updateAfterShow(e),i}repositionWithinBounds(){const{anchor:t,ctx:e,fallbackAnchor:i}=this,n=this.getPopoverElement();if(!t||!n)return;const s=e.domManager.getBoundingClientRect(),{offsetWidth:a,offsetHeight:o}=n,{isRtl:r}=e.domManager,l=r?t.x-a:t.x;let c=Nt(0,l,s.width-a),u=Nt(0,t.y,s.height-o);if(c!==l&&i?.x!=null){const d=r?i.x:i.x-a;c=Nt(0,d,s.width-a)}u!==t.y&&i?.y!=null&&(u=Nt(0,i.y-o,s.height-o)),this.updatePosition({x:c,y:u})}updateAfterShow(t){this.updateAnchor(t),this.ctx.agDocument.requestAnimationFrame(()=>{this.repositionWithinBounds()})}},Bit=class extends PW{show(e,i){const n=new OW("vertical");for(const s of i.items)n.addChild(this.createRow(i,s,n));n.addClass("ag-charts-menu"),this.showWidget(e,n,i)}allocRow(e,i){if(e.menuItemRole==null||e.menuItemRole==="menuitem")return new NL;{e.menuItemRole;const n=new LW;return n.setChecked(e.value===i.value),n}}createRow(e,i,n){const s=i.value===e.value,a=this.allocRow(e,i);if(i.enabled!=null&&a.setEnabled(i.enabled),a.addClass("ag-charts-menu__row"),a.toggleClass("ag-charts-menu__row--active",s),typeof i.value=="string"&&(a.getElement().dataset.popoverId=i.value),i.icon!=null){const r=$t("span",`ag-charts-menu__icon ${mu(i.icon)}`);a.getElement().appendChild(r)}const o=i.strokeWidth!=null;if(o&&(a.toggleClass("ag-charts-menu__row--stroke-width-visible",o),a.setCSSVariable("--strokeWidth",o?`${i.strokeWidth}px`:null)),i.label!=null){const r=$t("span","ag-charts-menu__label");r.textContent=this.ctx.localeManager.t(i.label),a.getElement().appendChild(r)}return"altText"in i&&a.setAriaLabel(this.ctx.localeManager.t(i.altText)),a.addListener("click",({sourceEvent:r})=>{e.onPress?.(i),r.preventDefault(),r.stopPropagation(),n.collapse()}),a}},zW=class extends RW{constructor(){super(...arguments),this.dragged=!1}setDragHandle(e){e.addListener("drag-start",i=>{e.addClass(this.dragHandleDraggingClass),this.onDragStart(i)}),e.addListener("drag-move",this.onDragMove.bind(this)),e.addListener("drag-end",()=>{e.removeClass(this.dragHandleDraggingClass),this.onDragEnd.bind(this)})}onDragStart(e){const i=this.getPopoverElement();i&&(e.sourceEvent.preventDefault(),this.dragged=!0,this.dragStartState={client:at.from(e.clientX,e.clientY),position:at.from(Number(i.style.getPropertyValue("left").replace("px","")),Number(i.style.getPropertyValue("top").replace("px","")))})}onDragMove(e){const{dragStartState:i}=this,n=this.getPopoverElement();if(!i||!n)return;const s=at.sub(at.from(e.clientX,e.clientY),i.client),a=at.add(i.position,s),o=this.ctx.domManager.getBoundingClientRect(),r={};a.x>=0&&a.x+n.offsetWidth<=o.width&&(r.x=a.x),a.y>=0&&a.y+n.offsetHeight<=o.height&&(r.y=a.y),this.updatePosition(r)}onDragEnd(){this.dragStartState=void 0}},Vit={"disjoint-channel":"false","fibonacci-menu":"menu","fibonacci-retracement":"false","fibonacci-retracement-trend-based":"false","fill-color":"dialog","horizontal-line":"false","line-color":"dialog","line-menu":"menu","line-stroke-width":"menu","line-style-type":"menu","measurer-menu":"menu","pan-end":"false","pan-left":"false","pan-right":"false","pan-start":"false","parallel-channel":"false","shape-menu":"menu","text-color":"dialog","text-menu":"menu","text-size":"menu","vertical-line":"false","zoom-in":"false","zoom-out":"false",callout:"false",clear:"false",comment:"false",delete:"false",line:"false",lock:"false",menu:"menu",note:"false",reset:"false",settings:"dialog",text:"false",millisecond:"false",second:"false",minute:"false",hour:"false",day:"false",month:"false",year:"false"};function _it(t){return typeof t!="string"?"false":Vit[t]}var BW=class extends _D{constructor(e){super(),this.localeManager=e}update(e){const{localeManager:i}=this;if(e.tooltip){const a=i.t(e.tooltip);a!==this.lastTooltip&&(this.elem.title=a,this.lastTooltip=a)}let n="";if(e.icon!=null&&e.iconPosition!=="after"&&(n=``),e.label!=null){const a=i.t(e.label);n=`${n}${a}`}e.icon!=null&&e.iconPosition==="after"&&(n=`${n}`);const s=_it(e.value);s=="false"?(this.setAriaHasPopup(void 0),this.setAriaExpanded(void 0)):(this.setAriaHasPopup(s),this.setAriaExpanded(!1)),n!==this.lastInnerHTML&&(this.elem.innerHTML=n,this.lastInnerHTML=n)}setChecked(e){ye(this.elem,"aria-checked",e)}},DV="ag-charts-toolbar__button--active",TL=class extends FD{constructor({eventsHub:t,localeManager:e},i,n){super(n),this.ariaLabelId=i,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new kG,this.hasPrefix=!1,this.buttonWidgets=[],this.updateAriaLabel=()=>this.setAriaLabel(this.localeManager.t(this.ariaLabelId)),this.eventsHub=t,this.localeManager=e,this.addClass("ag-charts-toolbar"),this.toggleClass("ag-charts-toolbar--horizontal",n==="horizontal"),this.toggleClass("ag-charts-toolbar--vertical",n==="vertical"),this.eventsHub.on("locale:change",this.updateAriaLabel),this.updateAriaLabel()}setAriaLabelId(t){this.ariaLabelId=t,this.updateAriaLabel()}addToolbarListener(t,e){return this.events.addListener(t,e)}clearButtons(){this.expanded?.collapse({mode:"2"});for(const t of this.buttonWidgets)t.destroy();this.buttonWidgets.splice(0)}updateButtons(t){const{buttonWidgets:e}=this;for(const[i,n]of t.entries())(this.buttonWidgets.at(i)??this.createButton(i,n)).update(n);for(let i=t.length;ithis.getButtonWidgetBounds(t))}getButtonWidget(t){return this.buttonWidgets.at(t)}setButtonHiddenByIndex(t,e){this.buttonWidgets.at(t)?.setHidden(e)}getButtonWidgetBounds(t){const e=this.getBounds(),i=t.getBounds(),n=t.getBoundingClientRect(),s=n.x-Math.floor(n.x),a=n.y-Math.floor(n.y);return new Tt(i.x+e.x+s,i.y+e.y+a,n.width,n.height)}refreshButtonClasses(){const{buttonWidgets:t,hasPrefix:e}=this;let i,n,s;for(const[a,o]of t.entries())i=!e&&a===0||s!=o.section,n=a===t.length-1||o.section!=t.at(a+1)?.section,o.toggleClass("ag-charts-toolbar__button--first",i),o.toggleClass("ag-charts-toolbar__button--last",n),o.toggleClass("ag-charts-toolbar__button--group-first",a>0&&i),s=o.section}createButton(t,e){const i=this.createButtonWidget();return i.addClass("ag-charts-toolbar__button"),i.addListener("click",n=>{const s={index:t,...e instanceof xt?e.toJson():e},a=this.getButtonWidgetBounds(i),o={event:n,button:s,buttonBounds:a,buttonWidget:i};this.events.dispatch("button-pressed",o)}),i.addListener("focus",()=>{const n={button:{index:t}};this.events.dispatch("button-focused",n)}),i.addListener("expand-controlled-widget",n=>{this.expanded?.collapse({mode:"4"}),this.expanded=n.controlled;const s=this.expanded.addListener("collapse-widget",()=>{this.expanded=void 0,s()})}),e.section&&(i.section=e.section),this.buttonWidgets.push(i),this.addChild(i),i}},Fit=class extends TL{createButtonWidget(){return new BW(this.localeManager)}},Hit=class extends zW{constructor(t,e,i){super(t,e),this.onPopoverMoved=i,this.dragHandleDraggingClass="ag-charts-floating-toolbar__drag-handle--dragging"}show(t,e={}){this.showWithChildren(t,{...e,class:"ag-charts-floating-toolbar"})}hide(){this.dragged=!1,super.hide()}getBounds(){const t=this.getPopoverElement();return new Tt(t?.offsetLeft??0,t?.offsetTop??0,t?.offsetWidth??0,t?.offsetHeight??0)}hasBeenDragged(){return this.dragged}setAnchor(t,e,i){const n=this.getPopoverElement();if(!n)return;const s=t.position??"above",{offsetWidth:a,offsetHeight:o}=n;let r=t.y-o-i,l=t.x-a/2;s==="below"?r=t.y+i:s==="right"?(r=t.y-o/2,l=t.x+e):s==="above-left"&&(l=t.x),this.updatePosition({x:l,y:r})}ignorePointerEvents(){const t=this.getPopoverElement();t&&(t.style.pointerEvents="none")}capturePointerEvents(){const t=this.getPopoverElement();t&&(t.style.pointerEvents="unset")}updatePosition(t){const e=this.getBounds(),i=this.ctx.domManager.getBoundingClientRect();t.x=Math.floor(Nt(0,t.x,i.width-e.width)),t.y=Math.floor(Nt(0,t.y,i.height-e.height)),super.updatePosition(t),this.onPopoverMoved()}},jit=class extends TL{constructor(e,i,n){super(e,i,"horizontal"),this.hasPrefix=!0,this.popover=new Hit(e,n,this.onPopoverMoved.bind(this)),this.dragHandle=new Git(e.localeManager.t("toolbarAnnotationsDragHandle")),this.popover.setDragHandle(this.dragHandle)}destroy(){super.destroy(),this.popover.destroy()}show(e={}){this.popover.show([this.dragHandle.getElement(),this.getElement()],e)}hide(){this.popover.hide()}setAnchor(e){this.popover.setAnchor(e,this.horizontalSpacing,this.verticalSpacing)}hasBeenDragged(){return this.popover.hasBeenDragged()}ignorePointerEvents(){this.popover.ignorePointerEvents()}capturePointerEvents(){this.popover.capturePointerEvents()}onPopoverMoved(){const e=this.popover.getBounds();if(this.popoverBounds?.equals(e))return;this.popoverBounds=e.clone();const i=this.getButtonBounds();this.events.dispatch("toolbar-moved",{popoverBounds:e,buttonBounds:i})}getButtonWidgetBounds(e){const i=this.popover.getBounds(),n=super.getButtonWidgetBounds(e),s=this.dragHandle.getBounds();return new Tt(n.x+i.x-s.width,n.y+i.y,n.width,n.height)}},Git=class extends Nf{constructor(e){super($t("div","ag-charts-floating-toolbar__drag-handle"));const i=new Nf($t("span",`${mu("drag-handle")} ag-charts-toolbar__icon`));i.setAriaHidden(!0),this.addChild(i),this.elem.title=e}},Uit={...c3,...h3},RM={};Ap(RM,{ButtonWidget:()=>_D,MenuItemRadioWidget:()=>LW,MenuItemWidget:()=>NL,MenuWidget:()=>OW,NativeWidget:()=>Nf,SliderWidget:()=>_T,ToolbarWidget:()=>FD,Widget:()=>Vu,WidgetEventUtil:()=>cu});var VW={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:vD,lineDash:[0],label:{enabled:!1}}},$C={...VW,nice:!1},X0={mode:"compact",position:{anchorTo:"node",placement:["right","left"]},showArrow:!1},XC={style:[{stroke:{$ref:"gridLineColor"}}],width:2},Wit={number:{gridLine:XC},time:{gridLine:XC},category:{gridLine:XC}},Kit={overrides:{common:{animation:{enabled:!1},contextMenu:{enabled:!1},keyboard:{enabled:!1},background:{visible:!1},navigator:{enabled:!1},padding:{top:0,right:0,bottom:0,left:0},axes:{number:{...$C,interval:{values:[0]}},log:{...$C},time:{...$C},category:{...VW}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...X0,position:{...X0.position,anchorTo:"pointer"},range:"nearest"},axes:Wit},line:{seriesArea:{padding:{top:2,right:2,bottom:2,left:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3}},tooltip:X0},area:{seriesArea:{padding:{top:1,right:0,bottom:1,left:0}},series:{strokeWidth:1,fillOpacity:.4},tooltip:X0}}},_W=xs(Yit);function Yit(t,e){return typeof t=="string"?{...e,baseTheme:t}:t!=null?{...t,baseTheme:_W(t.baseTheme,e)}:e}function FW(t){if(Array.isArray(t)&&t.length!==0){const e=t.find(i=>i!=null);if(typeof e=="number")return{data:t.map((n,s)=>({x:s,y:n})),series:[{xKey:"x",yKey:"y"}],datumKey:"y"};if(Array.isArray(e))return{data:t.map(n=>({x:n?.[0],y:n?.[1],datum:n})),series:[{xKey:"x",yKey:"y"}],datumKey:"datum"}}else if(t?.length===0)return{data:t,series:[{xKey:"x",yKey:"y"}],datumKey:"y"};return{data:t}}function $it(t){switch(t?.type){case"number":{const{reverse:e,min:i,max:n}=t??{};return{type:"number",reverse:e,min:i,max:n}}case"time":{const{reverse:e,min:i,max:n}=t??{};return{type:"time",reverse:e,min:i,max:n}}default:{if(t==null)return{type:"category"};const{reverse:e,paddingInner:i,paddingOuter:n}=t;return{type:"category",reverse:e,paddingInner:i,paddingOuter:n}}}}function Xit(t,e,i){const n={};return t?.stroke!=null&&(n.style=[{stroke:t?.stroke}],n.enabled??(n.enabled=!0)),t?.strokeWidth!=null&&(n.width=t?.strokeWidth,n.enabled??(n.enabled=!0)),i.type==="bar"&&i.direction!=="horizontal"&&(n.enabled??(n.enabled=!0)),t?.visible!=null&&(n.enabled=t.visible),n.enabled??(n.enabled=e),n}var Zit=xs((t,e,i)=>n=>{const s=n.datum[n.xKey],a=n.datum[n.yKey],o=i==null?n.datum:n.datum[i],r=e?.renderer?.({context:t,datum:o,xValue:s,yValue:a});if(zi(r)||Je(r)||aa(r))return bi(r);const l=r?.content??a.toFixed(2);return r?.title?{heading:void 0,title:void 0,data:[{label:r.title,value:l}]}:{heading:void 0,title:l,data:[]}});function qit(t){const{background:e,container:i,foreground:n,height:s,listeners:a,locale:o,minHeight:r,minWidth:l,overrideDevicePixelRatio:c,padding:u,width:d,theme:g,data:f,crosshair:y,axis:x,min:S,max:D,tooltip:A,context:I,styleNonce:w,...N}=t,O={background:e,container:i,foreground:n,height:s,listeners:a,locale:o,minHeight:r,minWidth:l,overrideDevicePixelRatio:c,padding:u,width:d,styleNonce:w},{data:L,series:[R]=[],datumKey:P}=FW(f),B=N;R!=null&&Object.assign(B,R),B.tooltip={...A,renderer:Zit(I,A,P)},O.theme=_W(g,Kit),O.data=L,O.series=[B];const F=B.type==="bar"&&B.direction==="horizontal",[H,$]=F?["left","bottom"]:["bottom","left"],Y={...$it(x),position:H,...y==null?{}:{crosshair:y}},U={type:"number",gridLine:Xit(x,!1,t),position:$,...S==null?{}:{min:S},...D==null?{}:{max:D}};return O.axes=F?{x:U,y:Y}:{x:Y,y:U},O}var ZC=["showInLegend","showInMiniChart","grouped","stacked","stackGroup","tooltip","listeners","errorBar","xKey","yKey","type"],qC={visible:J,reverse:J,stroke:It,strokeWidth:X},wb={context:()=>!0,tooltip:jt,theme:jt,background:jt,container:jt,width:jt,height:jt,minWidth:jt,minHeight:jt,padding:jt,listeners:jt,locale:jt,data:jt,styleNonce:K,axis:xp({number:{...qC,min:Me(gt,Fs("max")),max:Me(gt,Hs("min"))},category:{...qC,paddingInner:Ot,paddingOuter:Ot},time:{...qC,min:Me(Xt(gt,_s),Fs("max")),max:Me(Xt(gt,_s),Hs("min"))}},"axis options","category"),min:Me(gt,Fs("max")),max:Me(gt,Hs("min")),crosshair:{enabled:J,snap:J,...bt,...Lt},xKey:K,yKey:K};wb.overrideDevicePixelRatio=Mt(gt);wb.foreground=Mt(jt);var Qit={type:"preset",name:"sparkline",version:oi,options:xp({area:{...wb,...At(sL,ZC)},bar:{...wb,...At(om,ZC)},line:{...wb,...At($x,ZC)}},"sparkline options"),create:qit,processData:FW},Jit=["top","right","bottom","left"],tv=class HW extends QD{constructor(e,i){super(e,i),this.paired=!0,this.axes=this.createChartAxes(),this.lastUpdateClipRect=void 0,this.lastLayoutWidth=Number.NaN,this.lastLayoutHeight=Number.NaN}createChartAxes(){return new NZ}onAxisChange(e,i){super.onAxisChange(e,i),this.syncAxisChanges(e,i),this.ctx!=null&&this.ctx.zoomManager.setAxes(e)}destroySeries(e){super.destroySeries(e),this.lastLayoutWidth=Number.NaN,this.lastLayoutHeight=Number.NaN}getChartType(){return"cartesian"}setRootClipRects(e){const{seriesRoot:i,annotationRoot:n}=this;i.setClipRect(e),n.setClipRect(e)}async processData(){await super.processData(),this.syncStatus==="init"&&(this.syncStatus="domains-calculated"),this.ctx.updateService.dispatchProcessData({series:{shouldFlipXY:this.shouldFlipXY()}})}async processDomains(){await super.processDomains();for(const e of this.axes){const i=await this.getSyncedDomain(e);i!=null&&e.setDomains({domain:i})}}performLayout(e){const{seriesRoot:i,annotationRoot:n}=this,{clipSeries:s,seriesRect:a,visible:o}=this.updateAxes(e);this.seriesRoot.visible=o,this.seriesRect=a,this.animationRect=e.layoutBox;const{x:r,y:l}=a;if(e.width!==this.lastLayoutWidth||e.height!==this.lastLayoutHeight)for(const y of[i,n])y.translationX=Math.floor(r),y.translationY=Math.floor(l);else{const{translationX:y,translationY:x}=i;Uc(this.id,"seriesRect",this.ctx.animationManager,[i,n],{translationX:y,translationY:x},{translationX:Math.floor(r),translationY:Math.floor(l)},{phase:"update"})}this.lastLayoutWidth=e.width,this.lastLayoutHeight=e.height;const c=a.clone().grow(this.seriesArea.getPadding()),g=this.series.some(y=>y.alwaysClip)||(this.seriesArea.clip??!1)||s?c:void 0,{lastUpdateClipRect:f}=this;this.lastUpdateClipRect=g,this.ctx.animationManager.isActive()&&f!=null?this.ctx.animationManager.animate({id:this.id,groupId:"clip-rect",phase:"update",from:f,to:c,onUpdate:y=>this.setRootClipRects(y),onStop:()=>this.setRootClipRects(g),onComplete:()=>this.setRootClipRects(g)}):this.setRootClipRects(g),this.ctx.layoutManager.emitLayoutComplete(e,{axes:G4(this.axes.map(y=>[y.id,y.getLayoutState()])),series:{visible:o,rect:a,paddedRect:c},clipSeries:s,layoutBox:e.layoutBox}),ZU(this.series)}updateAxes(e){const{layoutBox:i,scrollbars:n}=e,{clipSeries:s,seriesRect:a,overflows:o}=this.resolveAxesLayout(i,n);for(const r of this.axes)r.update(),r.setCrossLinesVisible(!o),this.clipAxis(r,a,i);return{clipSeries:s,seriesRect:a,visible:!o}}resolveAxesLayout(e,i){let n,s,a=0;const o=10,r=this.axes.filter(l=>l.crossAt?.value!=null);do if(s=n??this.getDefaultState(),n=this.updateAxesPass(new Map(s.axisAreaWidths),e.clone(),r,i),a++>o){pt.warn("Max iterations reached. Unable to stabilize axes layout.");break}while(!this.isLayoutStable(n,s));return this.lastAreaWidths=n.axisAreaWidths,n}updateAxesPass(e,i,n,s){const a=new Map,o={};let r=!1,l=!1;const c=this.seriesArea.getPadding();for(const N of Jit){const O=c[N]??0,L=this.axes.findLast(R=>R.position===N);L?L.seriesAreaPadding=O:i.shrink(O,N)}const u=(e.get("left")??0)+(e.get("right")??0),d=(e.get("top")??0)+(e.get("bottom")??0),g=this.buildCrossLinePadding(e),f=g.left+g.right,y=g.top+g.bottom;i.width<=u+f||i.height<=d+y?r=!0:i.shrink(g);const{scene:x}=this.ctx,S=i.clone().shrink(Object.fromEntries(e));for(const N of this.axes){const{position:O="left",direction:L}=N,R=L===z.Y;let P;this.sizeAxis(N,S,O),N.thickness==null?P=QC(R,x)*(N.maxThicknessRatio??1):P=N.thickness;const B={sizeLimit:P-N.label.spacing,padding:this.padding,scrollbars:s},{primaryTickCount:F,bbox:H}=N.calculateLayout(N.nice?o[L]:void 0,B);o[L]??(o[L]=F),l||(l=N.dataDomain.clipped||N.visibleRange[0]>0||N.visibleRange[1]<1),N.thickness==null&&(P=Math.min(QC(R,H)??0,P)),a.set(N.id,Math.ceil(P))}let D;n.length>0&&(D=this.calculateAxesCrossPositions(a,S,n));const A=px(this.axes,N=>N.position??"left"),I=new Map,w=new Map;for(const[N,O]of Xe(A)){let L=QC(N!=="left"&&N!=="right",x)%x.pixelRatio,R=0;for(const P of O??[]){w.set(P.id,L);const B=a.get(P.id)??0;R=Math.max(R,L+B),P.layoutConstraints.stacked&&(L+=B+HW.AxesPadding)}I.set(N,Math.ceil(R))}for(const[N,O]of Xe(A))this.positionAxes({axes:O??[],position:N,axisWidths:a,axisOffsets:w,axisAreaWidths:I,axisBound:i,seriesRect:S});return D!=null&&this.applyAxisCrossing(S,D),{clipSeries:l,seriesRect:S,axisAreaWidths:I,overflows:r}}calculateAxesCrossPositions(e,i,n){const s=new Map;for(const a of n){const{crossPosition:o,visible:r}=this.calculateAxisCrossPosition(a);a.setAxisVisible(r),this.adjustAxisWidth(a,e,o,i,r),o!=null&&s.set(a.id,o)}return s}calculateAxisCrossPosition(e){const i=this.axes.perpendicular(e),{scale:{domain:n,bandwidth:s},range:a}=i,o=(s??0)/2,r=i.scale.convert(e.crossAt?.value,{clamp:!1})+o;return i.inRange(r)?{crossPosition:r,visible:!0}:e.crossAt?.sticky===!1?{crossPosition:void 0,visible:!1}:{crossPosition:Number.isNaN(r)?a[n[0]]:bf(r,a),visible:!0}}adjustAxisWidth(e,i,n,s,a){if(e.getModuleMap().getModule("crosshair")?.enabled||this.modulesManager.getModule("annotations")?.enabled===!0||this.ctx.annotationManager.createMemento().some(d=>{switch(d.type){case"vertical-line":return e.direction===z.X;case"horizontal-line":return e.direction===z.Y}}))return;const c=i.get(e.id)??0,u=a?this.calculateAxisBleedingWidth(e,c,n,s):0;i.set(e.id,u)}calculateAxisBleedingWidth(e,i,n,s){if(n==null)return i;switch(e.position){case"left":case"top":return Math.max(0,i-n);case"right":return Math.max(0,n+i-s.width);case"bottom":return Math.max(0,n+i-s.height);default:return i}}applyAxisCrossing(e,i){for(const n of this.axes){const s=i.get(n.id);if(s==null){n.crossAxisTranslation.x=0,n.crossAxisTranslation.y=0;continue}const a=n.direction===z.X;n.crossAxisTranslation.x=a?0:e.x+s-n.translation.x,n.crossAxisTranslation.y=a?e.y+s-n.translation.y:0}}buildCrossLinePadding(e){var i;const n={top:0,right:0,bottom:0,left:0};for(const s of this.axes){const{position:a,label:o}=s;if(s.crossLines)for(const r of s.crossLines)r instanceof Xs&&(r.position=a??"top",(i=r.label).parallel??(i.parallel=o.parallel)),r.calculatePadding?.(n)}for(const[s,a=0]of Xe(n))n[s]=Math.max(a-(e.get(s)??0),0);return n}clampToOutsideSeriesRect(e,i,n,s){const a=n==="x"?e.x:e.y,o=n==="x"?e.width:e.height;return s===1?Math.min(i,a+o):Math.max(i,a)}async getSyncedDomain(e){const i=this.modulesManager.getModule("sync");if(i?.enabled)return await i.getSyncedDomain(e)}syncAxisChanges(e,i){const n=this.modulesManager.getModule("sync");if(!n?.enabled)return;const s=new Set(i??[]);for(const a of e)s.delete(a);for(const a of s)n.removeAxis(a)}sizeAxis(e,i,n){const s=e instanceof Ao,a=n==="left"||n==="right",{width:o,height:r}=i,l=a?r:o;let c=0,u=l,{min:d,max:g}=this.ctx.zoomManager.getAxisZoom(e.id);const{width:f,unit:y,align:x}=e.layoutConstraints;y==="px"?u=c+f:u=u*f/100;const S=u-c;if(x==="end")c=l-S,u=l;else if(x==="center"){const D=c+(l-c)/2;c=D-S/2,u=D+S/2}else x==="justify"&&(u=l);a&&(s?[c,u]=[u,c]:[d,g]=[1-g,1-d]),e.range=[c,u],e.visibleRange=[d,g],e.gridLength=a?o:r,e.lineRange=a?[r,0]:[0,o]}positionAxes(e){const{axes:i,axisBound:n,axisWidths:s,axisOffsets:a,axisAreaWidths:o,seriesRect:r,position:l}=e,c=o.get(l)??0;let u="x",d="y",g=1;(l==="top"||l==="bottom")&&(u="y",d="x");let f=n[u];(l==="right"||l==="bottom")&&(g=-1,f+=u==="x"?n.width:n.height);for(const y of i){const x=o.get(d==="x"?"left":"top")??0,S=s.get(y.id)??0,D=a.get(y.id)??0;y.gridPadding=c-D-S,y.translation[d]=n[d]+x,y.translation[u]=this.clampToOutsideSeriesRect(r,f+g*(D+S),u,g)}}shouldFlipXY(){return this.series.every(e=>e instanceof Wu&&e.shouldFlipXY())}getDefaultState(){const e=new Map;if(this.lastAreaWidths)for(const{position:i="left"}of this.axes){const n=this.lastAreaWidths.get(i);n!=null&&e.set(i,n)}return{axisAreaWidths:e,clipSeries:!1,overflows:!1}}isLayoutStable(e,i){if(i.overflows!==e.overflows||i.clipSeries!==e.clipSeries)return!1;for(const n of e.axisAreaWidths.keys())if(!i.axisAreaWidths.has(n))return!1;for(const[n,s]of i.axisAreaWidths.entries()){const a=e.axisAreaWidths.get(n);if((s!=null||a!=null)&&s!==a)return!1}return!0}clipAxis(e,i,n){const s=Math.ceil(e.gridLine?.width??0),a=Math.ceil(e.line?.width??0);let{width:o,height:r}=i;switch(o+=e.direction===z.X?s:a,r+=e.direction===z.Y?s:a,e.clipGrid(i.x,i.y,o,r),e.position){case"left":case"right":e.clipTickLines(n.x,i.y-s,n.width+s,i.height+s*2);break;case"top":case"bottom":e.clipTickLines(i.x-s,n.y,i.width+s*2,n.height+s);break}}};tv.className="CartesianChart";tv.type="cartesian";tv.AxesPadding=15;T([Pe({changeValue(t,e){this.onAxisChange(t,e)}})],tv.prototype,"axes",2);var tnt=tv;function QC(t,e){return t?e?.width:e?.height}var ent=new Set(["number","log","time"]),int=t=>Bt(t)&&t.type!=null&&!ent.has(t.type),hr={type:"chart",name:"cartesian",version:oi,options:Iq,create(t,e){return new tnt(t,e)},validate(t,e,i){const n=[];t?.series?.[0]?.type==="histogram"&&Object.values(t?.axes??{}).some(int)&&(n.push(new ou("invalid","only continuous axis types when histogram series is used",t.axes,i,"axes")),t=At(t,["axes"]));const s=ts(t,e,i);return s.invalid.push(...n),s}},LL=class extends QD{constructor(t,e){super(t,e),this.axes=this.createChartAxes(),this.padding=new zu(40),this.ctx.axisManager.axisGroup.zIndex=pe.AXIS_FOREGROUND}createChartAxes(){return new TZ}getChartType(){return"polar"}isDataTransactionSupported(){return!this.series.some(t=>t.type==="pie"||t.type==="donut")}async performLayout(t){const e=t.layoutBox.clone().shrink(this.seriesArea.getPadding());this.seriesRect=e,this.animationRect=e,this.seriesRoot.translationX=e.x,this.seriesRoot.translationY=e.y,await this.computeCircle(e);for(const n of this.axes)n.update();let i=0;for(const n of this.series)i=Math.max(i,n.properties.marker?.size??0);for(const n of this.series.filter(AV))n.maxChartMarkerSize=i;this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:e,paddedRect:t.layoutBox},layoutBox:t.layoutBox})}updateAxes(t,e,i,n){if(this.axes.length===0)return;const s=this.axes[z.Angle],a=this.axes[z.Radius],o=s.scale,r=a.innerRadiusRatio;s.innerRadiusRatio=r,s.computeRange(),s.gridLength=n,a.gridAngles=o.ticks({nice:[s.nice,s.nice],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>o.convert(l)),a.gridRange=s.range,a.range=[n,n*r];for(const l of[s,a])l.translation.x=t.x+e,l.translation.y=t.y+i,l.calculateLayout()}async computeCircle(t){const e=this.series.filter(AV),i=(l,c,u)=>{this.updateAxes(t,l,c,u);for(const g of e)g.centerX=l,g.centerY=c,g.radius=u;const d=e.filter(g=>g.type==="donut"||g.type==="pie");if(d.length>1){const g=d.map(f=>{const y=f.getInnerRadius();return{series:f,innerRadius:y}}).sort((f,y)=>f.innerRadius-y.innerRadius);g.at(-1).series.surroundingRadius=void 0;for(let f=0;f{const c=[];for(const g of Mu(this.axes,e)){const f=await g.computeLabelsBBox({hideWhenNecessary:l},t);f&&c.push(f)}if(c.length===0){i(n,s,a);return}const u=Tt.merge(c),d=this.refineCircle(u,o,t);i(d.centerX,d.centerY,d.radius),o=d.radius};await r(),await r(),await r(),await r({hideWhenNecessary:!0}),await r({hideWhenNecessary:!0});for(const l of Mu(this.axes,e))await l.computeLabelsBBox({hideWhenNecessary:!0},t);return{radius:o,centerX:n,centerY:s}}refineCircle(t,e,i){const s=-e,a=-e,o=e,r=e;let l=Math.max(0,s-t.x),c=Math.max(0,a-t.y),u=Math.max(0,t.x+t.width-o),d=Math.max(0,t.y+t.height-r);l=u=Math.max(l,u),c=d=Math.max(c,d);const g=i.width-l-u,f=i.height-c-d;let y=Math.min(g,f)/2;const x=.5*i.width/2,S=.5*i.height/2,D=Math.min(x,S);if(yi.height){const O=i.height-2*y;Math.min(c,d)*2>O?(c=O/2,d=O/2):c>d?c=O-d:d=O-c}if(2*y+w>i.width){const O=i.width-2*y;Math.min(l,u)*2>O?(l=O/2,u=O/2):l>u?l=O-u:u=O-l}}const A=l+2*y+u,I=c+2*y+d;return{centerX:(i.width-A)/2+l+y,centerY:(i.height-I)/2+c+y,radius:y}}};LL.className="PolarChart";LL.type="polar";function AV(t){return t instanceof CL}var OL={type:"chart",name:"polar",version:oi,options:kq,create(t,e){return new LL(t,e)},validate(t,e,i){const n=[],s=t?.series?.[0]?.type;(s==="pie"||s==="donut")&&t?.axes&&(n.push(new eD([],t.axes,i,"axes")),t=At(t,["axes"]));const a=ts(t,e,i);return a.invalid.push(...n),a}};function nnt({orientation:t,bboxes:e,maxHeight:i,maxWidth:n,itemPaddingY:s=0,itemPaddingX:a=0,forceResult:o=!1}){const r=t==="horizontal",l={max:r?n:i,fn:r?g=>g.width:g=>g.height,padding:r?a:s},c={max:r?i:n,fn:r?g=>g.height:g=>g.width,padding:r?s:a};let u=0;const d=[];for(;u=1;){const l=ant(t,e,r,i,n,s);if(l==null&&r<=1)return;if(l==null){r--;continue}if(typeof l=="number"){if(l<=1)return;r=l1?l:r,r--;continue}return{processedBBoxCount:l.length*l[0].length,pageIndices:l}}}function ant(t,e,i,n,s,a){const o=[];let r=0,l=0,c=[];const u=[];for(let d=0;d0&&o.push(c),c=[]);const f=n.fn(t[d])+n.padding;u[g]=Math.max(u[g]??0,f),l=Math.max(l,s.fn(t[d])+s.padding);const y=r+l,x=!a||o.length>0;if(y>s.max&&x){c=[];break}if(u.reduce((D,A)=>D+A,0)>n.max&&!a)return u.length0&&o.push(c),o.length>0?o:void 0}function ont(t,e,i,n,s){let a=0,o=0;return{pages:t.map(l=>{e==="horizontal"&&(l=rnt(l));let c=0;const u=l.map(f=>{const y=f.map(D=>(c=Math.max(D,c),i[D]));let x=0,S=0;for(const D of y)x+=D.height+n,S=Math.max(S,D.width+s);return{indices:f,bboxes:y,columnHeight:Math.ceil(x),columnWidth:Math.ceil(S)}});let d=0,g=0;for(const f of u)d+=f.columnWidth,g=Math.max(g,f.columnHeight);return a=Math.max(d,a),o=Math.max(g,o),{columns:u,startIndex:l[0][0],endIndex:c,pageWidth:d,pageHeight:g}}),maxPageWidth:a,maxPageHeight:o}}function rnt(t){const e=[];for(const i of t[0])e.push([]);for(const[i,n]of t.entries())for(const[s,a]of n.entries())e[s][i]=a;return e}function lnt(t,e){const i=t.length;let n=0;for(let s=0;se.max)return i/s<2?Math.ceil(i/2):s;return i}var pm=class extends xt{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=zc.SMALL,this.fontFamily="Verdana, sans-serif"}};T([b],pm.prototype,"color",2);T([b],pm.prototype,"fontStyle",2);T([b],pm.prototype,"fontWeight",2);T([b],pm.prototype,"fontSize",2);T([b],pm.prototype,"fontFamily",2);var wc=class extends xt{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};T([b],wc.prototype,"size",2);T([b],wc.prototype,"fill",2);T([b],wc.prototype,"fillOpacity",2);T([b],wc.prototype,"stroke",2);T([b],wc.prototype,"strokeWidth",2);T([b],wc.prototype,"strokeOpacity",2);var pA=class extends xt{constructor(t){super(),this.parent=t,this.shape="triangle",this.size=15,this.padding=8}};T([Pe({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],pA.prototype,"shape",2);T([b],pA.prototype,"size",2);T([b],pA.prototype,"padding",2);var Yc=class extends xt{constructor(t,e){super(),this.chartUpdateCallback=t,this.pageUpdateCallback=e,this.id=Nn(this),this.marker=new pA(this),this.activeStyle=new wc,this.inactiveStyle=new wc,this.highlightStyle=new wc,this.label=new pm,this.group=new Ds({name:"pagination"}),this.labelNode=new Pa,this.totalPages=0,this.currentPage=0,this.translationX=0,this.translationY=0,this.nextButtonDisabled=!1,this.previousButtonDisabled=!1,this._visible=!0,this._enabled=!0,this.nextButton=new wn,this.previousButton=new wn,this.isRtl=!1,this.orientation="vertical",this.labelNode.setProperties({textBaseline:"middle",textAlign:"left",fontSize:zc.SMALL,fontFamily:"Verdana, sans-serif",fill:"black",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode]),this.update(),this.updateMarkers()}set visible(t){this._visible=t,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(t){this._enabled=t,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}applyRotations(){const{isRtl:t}=this;this.orientation==="horizontal"?(this.previousButton.rotation=t?Math.PI/2:-Math.PI/2,this.nextButton.rotation=t?-Math.PI/2:Math.PI/2):(this.previousButton.rotation=0,this.nextButton.rotation=Math.PI)}update(){this.updateLabel(),this.updatePositions(),this.enableOrDisableButtons()}updatePositions(){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(),this.updateButtonPositions()}updateLabelPosition(){const{size:t,padding:e}=this.marker;this.nextButton.size=t,this.previousButton.size=t,this.labelNode.x=t/2+e}updateButtonPositions(){const e=this.labelNode.getBBox().width+(this.marker.size/2+this.marker.padding)*2;this.isRtl&&this.orientation==="horizontal"?(this.nextButton.translationX=0,this.previousButton.translationX=e):(this.previousButton.translationX=0,this.nextButton.translationX=e)}updateLabel(){const{isRtl:t,labelNode:e,currentPage:i,totalPages:n,label:{color:s,fontStyle:a,fontWeight:o,fontSize:r,fontFamily:l}}=this,c=[i+1,n];t&&c.reverse(),e.text=c.join(" / "),e.fill=s,e.fontStyle=a,e.fontWeight=o,e.fontSize=r,e.fontFamily=l}updateMarkers(){const{nextButton:t,previousButton:e,nextButtonDisabled:i,previousButtonDisabled:n,activeStyle:s,inactiveStyle:a,highlightStyle:o,highlightActive:r}=this,l=(c,u)=>u?a:c===r?o:s;this.updateMarker(t,l("next",i)),this.updateMarker(e,l("previous",n))}updateMarker(t,e){const{shape:i,size:n}=this.marker;t.shape=i,t.size=n,t.fill=e.fill,t.fillOpacity=e.fillOpacity??1,t.stroke=e.stroke,t.strokeWidth=e.strokeWidth,t.strokeOpacity=e.strokeOpacity}enableOrDisableButtons(){const{currentPage:t,totalPages:e}=this,i=e===0,n=t===e-1,s=t===0;this.nextButtonDisabled=n||i,this.previousButtonDisabled=s||i}setPage(t){t=Nt(0,t,Math.max(0,this.totalPages-1)),this.currentPage!==t&&(this.currentPage=t,this.onPaginationChanged())}getCursor(t){return{previous:this.previousButtonDisabled,next:this.nextButtonDisabled}[t]?void 0:"pointer"}onClick(t,e){t.preventDefault(),e==="next"&&!this.nextButtonDisabled?(this.incrementPage(),this.onPaginationChanged()):e==="previous"&&!this.previousButtonDisabled&&(this.decrementPage(),this.onPaginationChanged())}onMouseHover(t){this.highlightActive=t,this.updateMarkers(),this.chartUpdateCallback()}onPaginationChanged(){this.pageUpdateCallback(this.currentPage)}incrementPage(){this.currentPage=Math.min(this.currentPage+1,this.totalPages-1)}decrementPage(){this.currentPage=Math.max(this.currentPage-1,0)}onMarkerShapeChange(){this.updatePositions(),this.updateMarkers(),this.chartUpdateCallback()}attachPagination(t){t.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){const t=Ti.toCanvas(this.previousButton),e=Ti.toCanvas(this.nextButton);return{prev:t,next:e}}};Yc.className="Pagination";T([b],Yc.prototype,"marker",2);T([b],Yc.prototype,"activeStyle",2);T([b],Yc.prototype,"inactiveStyle",2);T([b],Yc.prototype,"highlightStyle",2);T([b],Yc.prototype,"label",2);T([Bi(t=>{t.applyRotations(),t.updatePositions()})],Yc.prototype,"isRtl",2);T([Bi(t=>t.applyRotations())],Yc.prototype,"orientation",2);var cnt=class{constructor(t,e){this.dirty=!0,this.itemList=t.proxyInteractionService.createProxyContainer({type:"list",domManagerId:`${e}-toolbar`,classList:["ag-charts-proxy-legend-toolbar"],ariaLabel:{id:"ariaLabelLegend"}}),this.paginationGroup=t.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`${e}-pagination`,classList:["ag-charts-proxy-legend-pagination"],ariaLabel:{id:"ariaLabelLegendPagination"}}),this.itemDescription=t.agDocument.createElement("p"),this.itemDescription.style.display="none",this.itemDescription.id=lu(),this.itemDescription.textContent=this.getItemAriaDescription(t.localeManager),this.itemList.getElement().append(this.itemDescription)}shouldApplyHoverOnFocus(t){const e=t.getElement();return[":hover",":focus-visible"].some(i=>e.matches(i))}initLegendList(t){if(!this.dirty)return;const{ctx:e,itemSelection:i,datumReader:n,itemListener:s}=t,a=e.localeManager,o=i.length;i.each((r,l,c)=>{r.proxyButton?.destroy(),r.proxyButton=e.proxyInteractionService.createProxyElement({type:"listswitch",textContent:this.getItemAriaText(a,ce(n.getItemLabel(l)),c,o),ariaChecked:!!r.datum.enabled,ariaDescribedBy:this.itemDescription.id,parent:this.itemList});const u=r.proxyButton;u.addListener("click",d=>s.onClick(d.sourceEvent,r.datum,u)),u.addListener("dblclick",d=>s.onDoubleClick(d.sourceEvent,r.datum)),u.addListener("mouseenter",d=>s.onHover(d.sourceEvent,r)),u.addListener("mouseleave",()=>s.onLeave()),u.addListener("contextmenu",d=>s.onContextClick(d,r)),u.addListener("blur",()=>s.onLeave()),u.addListener("focus",d=>this.shouldApplyHoverOnFocus(u)?s.onHover(d.sourceEvent,r):s.onLeave()),u.addListener("drag-start",()=>{})}),this.dirty=!1}update(t){t.visible&&(this.initLegendList(t),this.updateItemProxyButtons(t),this.updatePaginationProxyButtons(t,!0)),this.updateVisibility(t.visible)}updateVisibility(t){this.itemList.setHidden(!t),this.paginationGroup.setHidden(!t)}updateItemProxyButtons({itemSelection:t,group:e,pagination:i,interactive:n}){const s=Ti.toCanvas(e);this.itemList.setBounds(s);const a=Math.max(...t.nodes().map(o=>o.getTextMeasureBBox().height));t.each((o,r)=>{if(o.proxyButton){const l=o.pageIndex===i.currentPage,{x:c,y:u,height:d,width:g}=Ti.toCanvas(o,o.getTextMeasureBBox()),f=(a-d)/2,y={x:c-s.x,y:u-f-s.y,height:a,width:g},x=n&&l;o.proxyButton.setCursor("pointer"),o.proxyButton.setEnabled(x),o.proxyButton.setPointerEvents(x?void 0:"none"),o.proxyButton.setBounds(y)}})}updatePaginationProxyButtons(t,e){const{pagination:i}=t;if(this.paginationGroup.setHidden(!i.visible),e&&"ctx"in t){const{oldPages:n,newPages:s}=t,a=(n?.length??s.length)>1,o=s.length>1;a!==o&&(o?this.createPaginationButtons(t):this.destroyPaginationButtons()),this.paginationGroup.setAriaHidden(o?void 0:!0)}if(this.prevButton&&this.nextButton){const{prev:n,next:s}=i.computeCSSBounds(),a=Tt.merge([n,s]);n.x-=a.x,n.y-=a.y,s.x-=a.x,s.y-=a.y,this.paginationGroup.setBounds(a),this.prevButton.setBounds(n),this.nextButton.setBounds(s),this.prevButton.setEnabled(i.currentPage!==0),this.nextButton.setEnabled(i.currentPage!==i.totalPages-1),this.nextButton.setCursor(i.getCursor("next")),this.prevButton.setCursor(i.getCursor("previous"))}}createPaginationButtons(t){const{ctx:e,pagination:i}=t;this.prevButton||(this.prevButton=e.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPagePrevious"},tabIndex:0,parent:this.paginationGroup}),this.prevButton.addListener("click",n=>this.onPageButton(t,n,"previous")),this.prevButton.addListener("mouseenter",()=>i.onMouseHover("previous")),this.prevButton.addListener("mouseleave",()=>i.onMouseHover(void 0))),this.nextButton||(this.nextButton=e.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPageNext"},tabIndex:0,parent:this.paginationGroup}),this.nextButton.addListener("click",n=>this.onPageButton(t,n,"next")),this.nextButton.addListener("mouseenter",()=>i.onMouseHover("next")),this.nextButton.addListener("mouseleave",()=>i.onMouseHover(void 0)))}destroyPaginationButtons(){this.nextButton?.destroy(),this.prevButton?.destroy(),this.nextButton=void 0,this.prevButton=void 0}onPageButton(t,e,i){t.pagination.onClick(e.sourceEvent,i),this.updatePaginationProxyButtons(t,!1)}onDataUpdate(t,e){this.dirty=t.length!==e.length||t.some((i,n,s)=>{const[a,o]=[e[n],t[n]];return a.id!==o.id})}onLocaleChanged(t,e,i){const n=e.length;e.each(({proxyButton:s},a,o)=>{const r=s?.getElement();if(r!=null){const l=ce(i.getItemLabel(a));r.textContent=this.getItemAriaText(t,l,o,n)}}),this.itemDescription.textContent=this.getItemAriaDescription(t)}onPageChange(t){this.updateItemProxyButtons(t),this.updatePaginationProxyButtons(t,!1)}getItemAriaText(t,e,i,n){return i>=0&&e?(i++,t.t("ariaLabelLegendItem",{label:e,index:i,count:n})):t.t("ariaLabelLegendItemUnknown")}getItemAriaDescription(t){return t.t("ariaDescriptionLegendItem")}};function IV(t,{itemId:e,seriesId:i,label:{text:n}},s){const a={defaultPrevented:!1,apiEvent:{type:t,itemId:e,seriesId:i,event:s,text:ce(n),preventDefault:()=>a.defaultPrevented=!0}};return a}var ur=class extends Ds{constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new ee({name:"legend-markerLabel-symbols",renderToOffscreenCanvas:!0,optimizeForInfrequentRedraws:!0})),this.label=this.appendChild(new Pa),this.enabled=!0,this.pageIndex=Number.NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.isRtl=!1,this.marker=this.symbolsGroup.appendChild(new wn({zIndex:1})),this.line=this.symbolsGroup.appendChild(new mo({zIndex:0})),this.line.visible=!1,this.label.textBaseline="middle",this.label.y=1}destroy(){super.destroy(),this.proxyButton?.destroy()}setEnabled(t){this.enabled=t,this.refreshVisibilities()}getTextMeasureBBox(){return this.layout(),Tt.merge([this.symbolsGroup.getBBox(),this.label.getTextMeasureBBox()])}refreshVisibilities(){const t=this.enabled?1:.5;this.label.opacity=t,this.opacity=t}layout(){const{marker:t,line:e,length:i,isCustomMarker:n}=this;let s=0,a=0;if(t.visible){const{size:o}=t,r=wn.anchor(t.shape);s=(r.x-.5)*o+i/2,a=(r.y-.5)*o,n?(t.x=0,t.y=0,t.translationX=s,t.translationY=a):(t.x=s,t.y=a,t.translationX=0,t.translationY=0)}e.visible&&(e.x1=0,e.x2=i,e.y1=0,e.y2=0)}preRender(t){const e=super.preRender(t);return this.layout(),e}layoutLabel(){const{length:t,spacing:e,isRtl:i}=this;this.label.x=i?-e:t+e,this.label.textAlign=i?"right":"left"}computeBBox(){return this.layout(),super.computeBBox()}};ur.className="MarkerLabel";T([pi("label")],ur.prototype,"text",2);T([pi("label")],ur.prototype,"fontStyle",2);T([pi("label")],ur.prototype,"fontWeight",2);T([pi("label")],ur.prototype,"fontSize",2);T([pi("label")],ur.prototype,"fontFamily",2);T([pi("label","fill")],ur.prototype,"color",2);T([Bi(t=>t.layoutLabel())],ur.prototype,"spacing",2);T([Bi(t=>t.layoutLabel())],ur.prototype,"length",2);T([ut()],ur.prototype,"isCustomMarker",2);T([Bi(t=>t.layoutLabel())],ur.prototype,"isRtl",2);function hnt(t,e){switch(typeof e.itemId){case"number":return{series:t,itemId:void 0,datum:void 0,datumIndex:e.itemId,legendItemName:e.legendItemName};case"string":return{series:t,itemId:e.itemId,datum:void 0,datumIndex:void 0,legendItemName:e.legendItemName};default:return e.itemId}}var Yu=class extends xt{constructor(){super(...arguments),this.maxLength=void 0,this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=zc.SMALL,this.fontFamily="Verdana, sans-serif"}};T([b],Yu.prototype,"maxLength",2);T([b],Yu.prototype,"color",2);T([b],Yu.prototype,"fontStyle",2);T([b],Yu.prototype,"fontWeight",2);T([b],Yu.prototype,"fontSize",2);T([b],Yu.prototype,"fontFamily",2);T([b],Yu.prototype,"formatter",2);var gm=class extends xt{constructor(){super(...arguments),this.shape=void 0,this.size=15,this.padding=8}};T([b],gm.prototype,"shape",2);T([b],gm.prototype,"size",2);T([b],gm.prototype,"padding",2);T([b],gm.prototype,"strokeWidth",2);T([b],gm.prototype,"enabled",2);var EL=class extends xt{};T([b],EL.prototype,"strokeWidth",2);T([b],EL.prototype,"length",2);var $u=class extends xt{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.showSeriesStroke=!1,this.marker=new gm,this.label=new Yu,this.line=new EL}};T([b],$u.prototype,"maxWidth",2);T([b],$u.prototype,"paddingX",2);T([b],$u.prototype,"paddingY",2);T([b],$u.prototype,"showSeriesStroke",2);T([b],$u.prototype,"marker",2);T([b],$u.prototype,"label",2);T([b],$u.prototype,"line",2);var RL=class extends xt{};T([b],RL.prototype,"legendItemClick",2);T([b],RL.prototype,"legendItemDoubleClick",2);var kV={bounds:"item",gradient:"linear",colorStops:[{color:"black"}],rotation:0,reverse:!1,colorSpace:"rgb"},CV={pattern:"forward-slanted-lines",width:8,height:8,padding:1,fill:"black",fillOpacity:1,backgroundFill:"white",backgroundFillOpacity:1,stroke:"black",strokeOpacity:1,strokeWidth:1,rotation:0,scale:1},wV={backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain"},fn=class extends xt{constructor(t){super(),this.ctx=t,this.id=Nn(this),this.group=new Ds({name:"legend",zIndex:pe.LEGEND}),this.itemSelection=pn.select(this.group,ur),this.containerNode=this.group.appendChild(new On({name:"legend-container"})),this.oldSize=[0,0],this.pages=[],this.paginationItemsOffsetX=0,this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this._data=[],this.toggleSeries=!0,this.item=new $u,this.listeners=new RL,this.enabled=!1,this.position="bottom",this.border=new Ru(this.containerNode),this.cornerRadius=0,this.fillOpacity=1,this.padding=4,this.spacing=0,this.cleanup=new qe,this.size=[0,0],this._visible=!0,this.pagination=new Yc(()=>t.eventsHub.emit("chart:request-update",{type:Ct.SCENE_RENDER}),i=>this.updatePageNumber(i)),this.pagination.attachPagination(this.group);const{items:e}=t.contextMenuRegistry.builtins;e["toggle-series-visibility"].action=i=>this.contextToggleVisibility(i),e["toggle-other-series"].action=i=>this.contextToggleOtherSeries(i),this.cleanup.register(t.eventsHub.on("active:load-memento",i=>this.onActiveLoadMemento(i)),t.eventsHub.on("active:update",i=>this.onActiveUpdate(i)),t.eventsHub.on("legend:change",this.onLegendDataChange.bind(this)),t.eventsHub.on("legend:change-partial",this.onLegendDataChangePartial.bind(this)),t.layoutManager.registerElement(1,i=>this.positionLegend(i)),t.eventsHub.on("locale:change",()=>this.onLocaleChanged()),()=>delete e["toggle-series-visibility"].action,()=>delete e["toggle-other-series"].action,()=>this.group.remove()),this.domProxy=new cnt(this.ctx,this.id),this.ctx.historyManager.addMementoOriginator(t.legendManager)}set data(t){ks(t,this._data)||(this.domProxy.onDataUpdate(this._data,t),this._data=t,this.updateGroupVisibility())}get data(){return this._data}onLegendDataChange({legendData:t=[]}){this.data=t.filter(e=>!e.hideInLegend)}onLegendDataChangePartial(t){this.itemSelection.each(({proxyButton:e},{itemId:i})=>{if(e!=null)for(const n of t.legendData)n.itemId===i&&e.setChecked(n.enabled)})}destroy(){this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-toolbar`),this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-pagination`),this.cleanup.flush(),this.itemSelection.clear()}getOrientation(){return this.orientation??"horizontal"}set visible(t){this._visible=t,this.updateGroupVisibility()}get visible(){return this._visible}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible&&this.data.length>0}updateItemSelection(){const t=[...this.data];this.reverseOrder&&t.reverse(),this.itemSelection.update(t)}isInteractive(){const{toggleSeries:t,listeners:{legendItemClick:e,legendItemDoubleClick:i}}=this;return t||i!=null||e!=null}checkInteractionState(){return this.ctx.interactionManager.isState(1)}attachLegend(t){t.appendChild(this.group)}getItemLabel(t){const{formatter:e}=this.item.label;if(e){const i=t.datum;return this.cachedCallWithContext(e,{itemId:t.itemId,value:t.label.text,seriesId:t.seriesId,...i&&{datum:i}})}return t.label.text}calcLayout(t,e){const{paddingX:i,paddingY:n,label:s,maxWidth:a,label:{maxLength:o=1/0,fontStyle:r,fontWeight:l,fontSize:c,fontFamily:u}}=this.item;this.updateItemSelection();const d=[],g=Ve(s),y=a??t*.8,{markerWidth:x,anyLineEnabled:S}=this.calculateMarkerWidth(),{isRtl:D}=this.ctx.domManager;if(this.itemSelection.each((B,F)=>{B.fontStyle=r,B.fontWeight=l,B.fontSize=c,B.fontFamily=u,B.isRtl=D;const H=this.updateMarkerLabel(B,F,x,S),$=F.itemId??F.id,Y=this.getItemLabel(F),U=ce(Y,"").replace(au," ");B.text=this.truncate(U,o,y,H,g,$),d.push(B.getTextMeasureBBox())}),t=Math.max(1,t),e=Math.max(1,e),!Number.isFinite(t))return{};[t,e]=this.updateContainer(t,e);const A=this.size,I=this.oldSize;A[0]=t,A[1]=e,(A[0]!==I[0]||A[1]!==I[1])&&(I[0]=A[0],I[1]=A[1]);const{pages:w,maxPageHeight:N,maxPageWidth:O}=this.updatePagination(d,t,e),L=this.pages;this.pages=w,this.maxPageSize=[O-i,N-n];const R=this.pagination.currentPage,P=this.pages[R];return this.pages.length<1||!P?(this.visible=!1,{oldPages:L}):(this.visible=!0,this.updatePositions(R),this.update(),{oldPages:L})}isCustomMarker(t,e){return t&&e!==void 0&&typeof e!="string"}calcSymbolsEnabled(t){const{showSeriesStroke:e,marker:i}=this.item,n=!!i.enabled||!e||(t.marker.enabled??!0),s=!!(t.line&&e),a=this.isCustomMarker(n,t.marker.shape);return{markerEnabled:n,lineEnabled:s,isCustomMarker:a}}calcSymbolsLengths(t,e,i){const{marker:n,line:s}=this.item;let a;const{shape:o}=t.marker;if(this.isCustomMarker(e,o)){const c=new wn;c.shape=o,c.updatePath();const u=c.getBBox();a=Math.max(u.width,u.height)}const r=e?n.size:0,l=i?s.length??25:0;return{markerLength:r,lineLength:l,customMarkerSize:a}}calculateMarkerWidth(){let t=0,e=!1;return this.itemSelection.each((i,n)=>{const{symbol:s}=n,{lineEnabled:a,markerEnabled:o}=this.calcSymbolsEnabled(s),{markerLength:r,lineLength:l,customMarkerSize:c=-1/0}=this.calcSymbolsLengths(s,o,a);t=Math.max(t,l,c,r),e||(e=a)}),{markerWidth:t,anyLineEnabled:e}}updateMarkerLabel(t,e,i,n){const{marker:s,paddingX:a}=this.item,{symbol:o}=e;let r=a;const{markerEnabled:l,isCustomMarker:c}=this.calcSymbolsEnabled(o),u=s.padding;(l||n)&&(r+=u+i);const{marker:d,line:g}=t;return d.visible=l,d.visible&&(d.shape=s.shape??o.marker.shape??"square",d.size=s.size,d.setStyleProperties(this.getMarkerStyles(le(o)))),g.visible=n,g.visible&&g.setStyleProperties(this.getLineStyles(o)),t.length=i,t.spacing=u,t.isCustomMarker=c,r}updateContainer(t,e){const i=this.getContainerStyles();return this.containerNode.width=0,this.containerNode.height=0,this.containerNode.setStyleProperties(i),this.containerNode.cornerRadius=i.cornerRadius,t-=i.strokeWidth*2+i.padding.left+i.padding.right,e-=i.strokeWidth*2+i.padding.top+i.padding.bottom,[t,e]}truncate(t,e,i,n,s,a){let o=!1;t.length>e&&(t=t.substring(0,e),o=!0);const r=tp(t,s,i-n,o);return wu(r)?this.truncatedItems.add(a):this.truncatedItems.delete(a),r}updatePagination(t,e,i){const n=this.getOrientation(),s=Math.min(this.paginationTrackingIndex,t.length),{isRtl:a}=this.ctx.domManager;this.pagination.orientation=n,this.pagination.isRtl=a,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:o,maxPageHeight:r,maxPageWidth:l,paginationBBox:c,paginationVertical:u}=this.calculatePagination(t,e,i),d=o.findIndex(w=>w.endIndex>=s);this.pagination.currentPage=Nt(0,d,Math.max(0,o.length-1));const{paddingX:g,paddingY:f}=this.item,y=8,x=l-g,S=r-f;let D=0,A=-c.y-this.item.marker.size/2;u?(a&&(D=e-c.width+c.x),A+=S+y):a?(D=-c.x,A+=(S-c.height)/2):(D+=-c.x+x+y,A+=(S-c.height)/2),this.paginationItemsOffsetX=a&&!u&&this.pagination.visible?c.width+y:0,this.pagination.translationX=D,this.pagination.translationY=A,this.pagination.update(),this.pagination.updateMarkers();let I=0;return this.itemSelection.each((w,N,O)=>{O>(o[I]?.endIndex??1/0)&&I++,w.pageIndex=I}),{maxPageHeight:r,maxPageWidth:l,pages:o}}calculatePagination(t,e,i){const{paddingX:n,paddingY:s}=this.item,a=["left","left-top","left-bottom","right","right-top","right-bottom"],{placement:o}=qd(this.position),r=this.getOrientation(),l=a.includes(o);let c=this.pagination.getBBox(),u=new Tt(0,0,0,0),d=[],g=0,f=0,y=0;const x=D=>D.width===c.width&&D.height===c.height,S=this.maxWidth!==void 0&&this.maxHeight!==void 0;do{if(y++>10){pt.warn("unable to find stable legend layout.");break}c=u;const D=e-(l?0:c.width),A=i-(l?c.height:0),I=nnt({orientation:r,bboxes:t,maxHeight:A,maxWidth:D,itemPaddingY:s,itemPaddingX:n,forceResult:S});d=I?.pages??[],g=I?.maxPageWidth??0,f=I?.maxPageHeight??0;const w=d.length;if(this.pagination.visible=w>1,this.pagination.totalPages=w,this.pagination.update(),this.pagination.updateMarkers(),u=this.pagination.getBBox(),!this.pagination.visible)break}while(!x(u));return{maxPageWidth:g,maxPageHeight:f,pages:d,paginationBBox:u,paginationVertical:l}}updatePositions(t=0){const{item:{paddingY:e},itemSelection:i,pages:n}=this;if(n.length<1||!n[t])return;const{columns:s,startIndex:a,endIndex:o}=n[t];let r=0,l=0;const c=s.length,u=s[0].indices.length,d=this.getOrientation()==="horizontal",g=s[0].bboxes[0].height+e,{isRtl:f}=this.ctx.domManager,y=[],x=s.reduce((S,D)=>S+D.columnWidth,0);i.each((S,D,A)=>{if(Ao){S.visible=!1;return}const I=A-a;let w,N;d?(w=I%c,N=Math.floor(I/c)):(w=Math.floor(I/u),N=I%u),S.visible=!0;const O=s[w];O&&(l=Math.floor(g*N),f?r=Math.floor(x-(y[N]??0)):r=Math.floor(y[N]??0),y[N]=(y[N]??0)+O.columnWidth,S.translationX=r+this.paginationItemsOffsetX,S.translationY=l)})}updatePageNumber(t){const{itemSelection:e,group:i,pagination:n,pages:s}=this,a=s[t];if(!a)return;const{startIndex:o,endIndex:r}=a;o===0?this.paginationTrackingIndex=0:t===s.length-1?this.paginationTrackingIndex=r:this.paginationTrackingIndex=Math.floor((o+r)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(t),this.domProxy.onPageChange({itemSelection:e,group:i,pagination:n,interactive:this.isInteractive()}),this.ctx.eventsHub.emit("chart:request-update",{type:Ct.SCENE_RENDER})}update(){const{label:{color:t}}=this.item;this.itemSelection.each((e,i)=>{e.setEnabled(i.enabled),e.color=t}),this.updateContextMenu()}updateContextMenu(){const t=this.toggleSeries?"show":"hide";this.ctx.contextMenuRegistry.toggle("toggle-series-visibility",t),this.ctx.contextMenuRegistry.toggle("toggle-other-series",t)}getLineStyles(t){const{stroke:e,strokeOpacity:i=1,strokeWidth:n,lineDash:s}=t.line??{},a=Math.min(2,n??1);return{stroke:e,strokeOpacity:i,strokeWidth:this.item.line.strokeWidth??a,lineDash:s}}getMarkerStyles({marker:t}){const{fill:e,stroke:i,strokeOpacity:n=1,fillOpacity:s=1,strokeWidth:a,lineDash:o,lineDashOffset:r}=t,l=Math.min(2,a??1);return ir(e)&&(e.width=8,e.height=8,e.padding=1,e.strokeWidth=Math.min(2,e.strokeWidth??2)),ml(e)&&(e.fit="contain",e.width=void 0,e.height=void 0,e.repeat="no-repeat"),RN({fill:e,stroke:i,strokeOpacity:n,fillOpacity:s,strokeWidth:this.item.marker.strokeWidth??l,lineDash:o,lineDashOffset:r},kV,CV,wV)}getContainerStyles(){const{stroke:t,strokeOpacity:e,strokeWidth:i}=this.border,{cornerRadius:n,fill:s,fillOpacity:a,padding:o}=this,r=typeof o=="number";return RN({cornerRadius:n,fill:s,fillOpacity:a,padding:{top:r?o:o.top??0,right:r?o:o.right??0,bottom:r?o:o.bottom??0,left:r?o:o.left??0},stroke:t,strokeOpacity:e,strokeWidth:this.border.enabled?i:0},kV,CV,wV)}computePagedBBox(){const t=ee.computeChildrenBBox(this.group.excludeChildren({name:"legend-container"}));if(this.pages.length>1){const[n,s]=this.maxPageSize;t.height=Math.max(s,t.height),t.width=Math.max(n,t.width)}const{strokeWidth:e,padding:i}=this.getContainerStyles();return t.grow(i).grow(e),t}findNode(t){const{datum:e,proxyButton:i}=this.itemSelection.select(n=>n.datum?.itemId===t.itemId)[0]??{};if(e===void 0||i===void 0)throw new Error(`AG Charts - Missing required properties { datum: ${e}, proxyButton: ${JSON.stringify(i)} }`);return{datum:e,proxyButton:i}}contextToggleVisibility(t){const{datum:e,proxyButton:i}=this.findNode(t);this.doClick(t.event,e,i),this.clearHighlight()}contextToggleOtherSeries(t){this.doDoubleClick(t.event,this.findNode(t).datum),this.clearHighlight()}onContextClick(t,e){if(this.checkInteractionState())return;const{sourceEvent:i}=t,n=e.datum;this.clearHighlight(),this.preventHidingAll&&this.contextMenuDatum?.enabled&&this.getVisibleItemCount()<=1?this.ctx.contextMenuRegistry.builtins.items["toggle-series-visibility"].enabled=!1:this.ctx.contextMenuRegistry.builtins.items["toggle-series-visibility"].enabled=!0;const a=this.ctx.chartService.series.length>1&&this.ctx.chartService.series[0]?.getLegendData("category")[0]?.hideToggleOtherSeries!==!0?"show":"hide";this.ctx.contextMenuRegistry.toggle("toggle-other-series",a);const{offsetX:o,offsetY:r}=i,{x:l,y:c}=Ti.toCanvasPoint(e,o,r);this.ctx.contextMenuRegistry.dispatchContext("legend-item",{widgetEvent:t,canvasX:l,canvasY:c},{legendItem:n})}onClick(t,e,i){this.doClick(t,e,i)&&t.preventDefault()}getVisibleItemCount(){return this.ctx.chartService.series.flatMap(t=>t.getLegendData("category")).filter(t=>t.enabled).length}doClick(t,e,i){const{listeners:{legendItemClick:n},ctx:{chartService:s},preventHidingAll:a,toggleSeries:o}=this;if(!e)return!1;const{legendType:r,seriesId:l,itemId:c,enabled:u,legendItemName:d}=e,g=s.series.find(x=>x.id===l);if(!g)return!1;let f=u;const y=IV("click",e,t);return n&&js([g.properties,this.ctx.chartService],n,y.apiEvent),y.defaultPrevented||(o&&(f=!u,a&&!f&&this.getVisibleItemCount()<2&&(f=!0),i.setChecked(f),this.ctx.eventsHub.emit("legend:item-click",{legendType:r,series:g,itemId:c,enabled:f,legendItemName:d})),this.updateHighlight(f,e,g),this.ctx.legendManager.update(),this.ctx.eventsHub.emit("chart:request-update",{type:Ct.PROCESS_DATA,opts:{forceNodeDataRefresh:!0,skipAnimations:e.skipAnimations??!1}})),!0}onDoubleClick(t,e){this.doDoubleClick(t,e)&&t.preventDefault()}doDoubleClick(t,e){const{listeners:{legendItemDoubleClick:i},ctx:{chartService:n},toggleSeries:s}=this;if(!e)return!1;const{legendType:a,id:o,itemId:r,seriesId:l}=e,c=n.series.find(d=>d.id===o);if(!c)return!1;const u=IV("dblclick",e,t);if(i&&js([c.properties,this.ctx.chartService],i,u.apiEvent),u.defaultPrevented)return!0;if(s){const d=n.series.flatMap(x=>x.getLegendData("category"));let g=0;const f=new Set;for(const x of d)x.enabled&&(g+=1,x.legendItemName!=null&&f.add(x.legendItemName));f.size>0&&(g=f.size);const y=d.find(x=>x.itemId===r&&x.seriesId===l);this.ctx.eventsHub.emit("legend:item-double-click",{legendType:a,series:c,itemId:r,numVisibleItems:g,enabled:y?.enabled??!1,legendItemName:y?.legendItemName})}return this.ctx.legendManager.update(),this.ctx.eventsHub.emit("chart:request-update",{type:Ct.PROCESS_DATA,opts:{forceNodeDataRefresh:!0}}),!0}toTooltipMeta(t,e){let i;return t instanceof FocusEvent?i=Ti.toCanvas(e).computeCenter():(t.preventDefault(),i=Ti.toCanvasPoint(e,t.offsetX,t.offsetY)),{canvasX:i.x,canvasY:i.y,showArrow:!1}}onHover(t,e){if(this.checkInteractionState())return;if(!this.enabled)throw new Error("AG Charts - onHover handler called on disabled legend");this.pagination.setPage(e.pageIndex);const i=e.datum,n=i?this.ctx.chartService.series.find(s=>s.id===i?.id):void 0;if(i&&this.truncatedItems.has(i.itemId??i.id)){const s=this.toTooltipMeta(t,e);this.ctx.tooltipManager.updateTooltip(this.id,s,[{type:"structured",title:this.getItemLabel(i)}])}else this.ctx.tooltipManager.removeTooltip(this.id,void 0,!0);this.updateHighlight(i?.enabled,i,n)}onLeave(){this.checkInteractionState()||(this.ctx.tooltipManager.removeTooltip(this.id,void 0,!0),this.clearHighlight())}clearHighlight(){this.updateHighlight(void 0,void 0,void 0)}updateHighlight(t,e,i,n){if(this.checkInteractionState())return;const s=r=>{if(r===void 0)return this.ctx.activeManager.clear();{const l=r.nodeDatum.series.id,c=r.itemId;return this.ctx.activeManager.update({type:"legend",seriesId:l,itemId:c},void 0)}},a=r=>{s(r)||this.ctx.highlightManager.updateHighlight(this.id,r?.nodeDatum)},o=r=>{this.ctx.interactionManager.isState(64)||n?.initialState?a(r):this.ctx.interactionManager.isState(4)?this.ctx.animationManager.onBatchStop(()=>{a(r)}):r===void 0&&a(r)};if(t===!0&&i!==void 0&&e!==void 0){const r=e.itemId,l=hnt(i,e);o({itemId:r,nodeDatum:l})}else o(void 0)}onActiveUpdate(t){t?.type==="series-node"&&this.ctx.highlightManager.updateHighlight(this.id,void 0)}onActiveLoadMemento(t){const{activeItem:e}=t;if(e?.type!=="legend")return this.ctx.highlightManager.updateHighlight(this.id,void 0);const i=this.data.find(s=>s.seriesId===e.seriesId&&s.itemId===e.itemId),n=this.ctx.chartService.series.find(s=>s.id===e.seriesId);if(n===void 0)pt.warn(`Cannot find seriesId: "${e.seriesId}"`),t.reject();else if(i===void 0){const s=JSON.stringify({seriesId:e.seriesId,itemId:e.itemId});pt.warn(`cannot find legend item: ${s}`),t.reject()}else this.updateHighlight(i.enabled,i,n,t)}onLocaleChanged(){this.updateItemSelection(),this.domProxy.onLocaleChanged(this.ctx.localeManager,this.itemSelection,this)}positionLegend(t){const e=this.positionLegendScene(t);this.positionLegendDOM(e)}positionLegendScene(t){if(!this.enabled||!this.data.length)return;const{placement:e,floating:i,xOffset:n,yOffset:s}=qd(this.position),a=i?new Tt(0,0,t.width,t.height):t.layoutBox,{x:o,y:r,width:l,height:c}=a,[u,d]=this.calculateLegendDimensions(a),{oldPages:g}=this.calcLayout(u,d),f=this.computePagedBBox();if(this.visible){const y=this.spacing;let x,S;switch(e){case"top":x=(l-f.width)/2,S=0;break;case"bottom":x=(l-f.width)/2,S=c-f.height;break;case"right":x=l-f.width,S=(c-f.height)/2;break;case"left":x=0,S=(c-f.height)/2;break;case"top-right":case"right-top":x=l-f.width,S=0;break;case"top-left":case"left-top":x=0,S=0;break;case"bottom-right":case"right-bottom":x=l-f.width,S=c-f.height;break;case"bottom-left":case"left-bottom":x=0,S=c-f.height;break}if(!i){let D,A;switch(e){case"top":case"top-right":case"top-left":D=f.height+y,A="top";break;case"bottom":case"bottom-right":case"bottom-left":D=f.height+y,A="bottom";break;case"left":case"left-top":case"left-bottom":D=f.width+y,A="left";break;case"right":case"right-top":case"right-bottom":D=f.width+y,A="right";break}a.shrink(D,A)}x+=n,S+=s,this.group.translationX=Math.floor(o+x-f.x),this.group.translationY=Math.floor(r+S-f.y),this.containerNode.x=f.x,this.containerNode.y=f.y,this.containerNode.width=f.width,this.containerNode.height=f.height}return g}positionLegendDOM(t){const{ctx:e,itemSelection:i,pagination:n,pages:s,group:a}=this,o=this.visible&&this.enabled,r=this.isInteractive();this.domProxy.update({visible:o,interactive:r,ctx:e,itemSelection:i,group:a,pagination:n,oldPages:t,newPages:s,datumReader:this,itemListener:this})}calculateLegendDimensions(t){const{width:e,height:i}=t,{placement:n}=qd(this.position),s=e/i,a=.5,o=.2,r=.25;let l,c;switch(n){case"top":case"top-left":case"top-right":case"bottom":case"bottom-left":case"bottom-right":{const u=s<1?Math.min(a,o*(1/s)):o;l=this.maxWidth?Math.min(this.maxWidth,e):e,c=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*u);break}case"left":case"left-top":case"left-bottom":case"right":case"right-top":case"right-bottom":{const u=s>1?Math.min(a,r*s):r;l=this.maxWidth?Math.min(this.maxWidth,e):Math.round(e*u),c=this.maxHeight?Math.min(this.maxHeight,i):i;break}}return[l,c]}cachedCallWithContext(t,e){const{callbackCache:i,chartService:n}=this.ctx;return i.call([this,n],t,e)}};fn.className="Legend";T([b],fn.prototype,"toggleSeries",2);T([b],fn.prototype,"pagination",2);T([b],fn.prototype,"item",2);T([b],fn.prototype,"listeners",2);T([Bi((t,e,i)=>{if(t.updateGroupVisibility(),e===i)return;const{ctx:{legendManager:n,stateManager:s}}=t;i===!1&&e===!0&&s.restoreState(n)}),b],fn.prototype,"enabled",2);T([b],fn.prototype,"position",2);T([b],fn.prototype,"maxWidth",2);T([b],fn.prototype,"maxHeight",2);T([b],fn.prototype,"reverseOrder",2);T([b],fn.prototype,"orientation",2);T([b],fn.prototype,"preventHidingAll",2);T([b],fn.prototype,"border",2);T([b],fn.prototype,"cornerRadius",2);T([b],fn.prototype,"fill",2);T([b],fn.prototype,"fillOpacity",2);T([b],fn.prototype,"padding",2);T([b],fn.prototype,"spacing",2);T([b],fn.prototype,"xOffset",2);T([b],fn.prototype,"yOffset",2);var jW={type:"plugin",name:"legend",version:oi,options:{enabled:J,position:nM,orientation:dt("horizontal","vertical"),maxWidth:X,maxHeight:X,spacing:X,border:Zd,cornerRadius:gt,padding:Ar,fill:Ga,fillOpacity:Ot,preventHidingAll:J,reverseOrder:J,toggleSeries:J,item:{marker:{size:X,shape:xu,padding:X,strokeWidth:X},line:{length:X,strokeWidth:X},label:{maxLength:X,formatter:ai,...De},maxWidth:X,paddingX:X,paddingY:X,showSeriesStroke:J},pagination:{marker:{size:X,shape:xu,padding:X},activeStyle:{...wt,...bt},inactiveStyle:{...wt,...bt},highlightStyle:{...wt,...bt},label:De},listeners:{legendItemClick:ai,legendItemDoubleClick:ai}},themeTemplate:{...F1,enabled:{$and:[{$greaterThan:[{$size:{$path:"/series"}},1]},{$or:[{$isChartType:"cartesian"},{$isChartType:"standalone"},{$and:[{$isChartType:"polar"},{$not:{$isSeriesType:"pie"}},{$not:{$isSeriesType:"donut"}}]}]}]},position:he.BOTTOM,orientation:{$if:[{$or:[{$eq:[{$path:"./position"},he.LEFT]},{$eq:[{$path:"./position"},he.LEFT_TOP]},{$eq:[{$path:"./position"},he.LEFT_BOTTOM]},{$eq:[{$path:"./position"},he.RIGHT]},{$eq:[{$path:"./position"},he.RIGHT_TOP]},{$eq:[{$path:"./position"},he.RIGHT_BOTTOM]},{$eq:[{$path:"./position/placement"},he.LEFT]},{$eq:[{$path:"./position/placement"},he.LEFT_TOP]},{$eq:[{$path:"./position/placement"},he.LEFT_BOTTOM]},{$eq:[{$path:"./position/placement"},he.RIGHT]},{$eq:[{$path:"./position/placement"},he.RIGHT_TOP]},{$eq:[{$path:"./position/placement"},he.RIGHT_BOTTOM]}]},"vertical","horizontal"]},spacing:30,listeners:{},toggleSeries:!0,item:{paddingX:16,paddingY:8,marker:{size:15,padding:8},showSeriesStroke:!0,label:{color:{$ref:"textColor"},fontSize:{$rem:Cn.SMALL},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}}},reverseOrder:!1,pagination:{marker:{size:12},activeStyle:{fill:{$ref:"foregroundColor"}},inactiveStyle:{fill:{$ref:"subtleTextColor"}},highlightStyle:{fill:{$ref:"foregroundColor"}},label:{color:{$ref:"textColor"}}},fill:{$if:[{$path:["./position/floating",!1]},{$ref:"chartBackgroundColor"},"transparent"]}},create:t=>{const e=new fn(t);return e.attachLegend(t.scene),e}},fm=class extends Ao{getVisibleDomain(t){const[e,i]=t,[n,s]=this.visibleRange;if(t.length<2)return[e,i];const a=Math.min(e,i),o=Math.max(e,i);if(a>=0){const r=Math.log(e),c=Math.log(i)-r;return[Math.exp(r+n*c),Math.exp(r+s*c)]}if(o<=0){const r=-Math.log(-e),c=-Math.log(-i)-r;return[-Math.exp(-(r+n*c)),-Math.exp(-(r+s*c))]}return[Number.NaN,Number.NaN]}normaliseDataDomain(t){const{min:e,max:i,preferredMin:n,preferredMax:s}=this,{extent:a,clipped:o}=Uf(t.domain,e,i,n,s,void 0,t.sortMetadata?.sortOrder);return a[0]<0&&a[1]>0||t.domain[0]<0&&t.domain[1]>0?(pt.warn("The log axis domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:o}):a[0]===0||a[1]===0||t.domain[0]===0||t.domain[1]===0?(pt.warn("The log axis domain contains a value of 0, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:o}):{domain:a,clipped:o}}set base(t){this.scale.base=t}get base(){return this.scale.base}constructor(t){super(t,new pL)}};fm.className="LogAxis";fm.type="log";var unt=10;function PM(t,e,i,n,s,a,o){const r=t[a];if(r===void 0)return-1;const l=Number.isFinite(e)?ar(r,e,i,o):xf(a,t.length),c=yD(l,s);return a===n[c+Ca]||a===n[c+wa]||a===n[c+Na]||a===n[c+Ta]?c:-1}function GW(t,e,i,n,s,a,o,r,l){let c=0,u=0,d=-1;for(let S=0;SD.maxRange===u);let{indexData:g,valueData:f}=Fc(e,i,i,a,o,u,{xNeedsValueOf:r,yNeedsValueOf:l,reuseIndexData:d?.indexData,reuseValueData:d?.valueData}),{indices:y,metaIndices:x}=GW(e,a,o,g,u,r,s,d?.indices,d?.metaIndices);const S=[{maxRange:u,metaIndices:x,indices:y,indexData:g,valueData:f}];for(;y.length>unt&&u>Ou;){const D=u,A=Math.trunc(D/2),I=c?.find($=>$.maxRange===A),w=ap(g,f,D,{reuseIndexData:I?.indexData,reuseValueData:I?.valueData});u=w.maxRange,g=w.indexData,f=w.valueData;const N=y;let O=0,L=0,R=-1;for(const $ of N){const Y=PM(e,a,o,g,u,$,r);Y!==-1&&(O++,Y!==R&&(L++,R=Y))}L++;const P=I?.indices?.length===O?I.indices:new Uint32Array(O),B=I?.metaIndices?.length===L?I.metaIndices:new Uint32Array(L);let F=0,H=0;R=-1;for(const $ of N){const Y=PM(e,a,o,g,u,$,r);Y!==-1&&(Y!==R&&(B[H++]=F,R=Y),P[F++]=$)}B[H]=O-1,y=P,x=B,S.push({maxRange:u,metaIndices:x,indices:y,indexData:g,valueData:f})}return S.reverse(),S}function dnt(t,e,i,n){const s=e.length;if(sw.maxRange===g),{indexData:y,valueData:x}=Fc(e,i,i,a,o,g,{xNeedsValueOf:r,yNeedsValueOf:l,reuseIndexData:f?.indexData,reuseValueData:f?.valueData}),{indices:S,metaIndices:D}=GW(e,a,o,y,g,r,s,f?.indices,f?.metaIndices),A={maxRange:g,indices:S,metaIndices:D,indexData:y,valueData:x};function I(){return PL([a,o],e,i,{xNeedsValueOf:r,yNeedsValueOf:l,existingFilters:u})?.filter(N=>N.maxRange!==g)??[]}return{immediate:[A],computeRemaining:I}}function pnt(t,e,i,n,s,a){const[o,r]=gn(t,n);return PL([o,r],e,i,{xNeedsValueOf:s,yNeedsValueOf:a})}var gnt=Pu(pnt);function fnt(t,e,i,n,s,a){const o=e.resolveKeysById(s,"xValue",i),r=e.resolveColumnById(s,n,i),l=e.getDomain(s,"xValue","key",i),c=e.resolveColumnNeedsValueOf(s,"xValue",i),u=e.resolveColumnNeedsValueOf(s,n,i);if(a){const[d,g]=gn(t,l);return PL([d,g],o,r,{xNeedsValueOf:c,yNeedsValueOf:u,existingFilters:a})}return gnt(t,o,r,l,c,u)}function mnt(t,e,i,n,s,a,o){const r=e.resolveKeysById(s,"xValue",i),l=e.resolveColumnById(s,n,i),c=e.getDomain(s,"xValue","key",i),u=e.resolveColumnNeedsValueOf(s,"xValue",i),d=e.resolveColumnNeedsValueOf(s,n,i),[g,f]=gn(t,c);return dnt([g,f],r,l,{xNeedsValueOf:u,yNeedsValueOf:d,targetRange:a,existingFilters:o})}var on=class extends jr{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new Mp,this.shadow=new zl,this.marker=new la,this.label=new Do,this.tooltip=zp(),this.connectMissingData=!1}};T([b],on.prototype,"xKey",2);T([b],on.prototype,"xName",2);T([b],on.prototype,"yKey",2);T([b],on.prototype,"yName",2);T([b],on.prototype,"selectedKey",2);T([b],on.prototype,"stackGroup",2);T([b],on.prototype,"normalizedTo",2);T([b],on.prototype,"fill",2);T([b],on.prototype,"fillOpacity",2);T([b],on.prototype,"stroke",2);T([b],on.prototype,"strokeWidth",2);T([b],on.prototype,"strokeOpacity",2);T([b],on.prototype,"lineDash",2);T([b],on.prototype,"lineDashOffset",2);T([b],on.prototype,"interpolation",2);T([b],on.prototype,"styler",2);T([b],on.prototype,"shadow",2);T([b],on.prototype,"marker",2);T([b],on.prototype,"label",2);T([b],on.prototype,"tooltip",2);T([b],on.prototype,"connectMissingData",2);var zL=class extends Wu{constructor(t){super({moduleCtx:t,propertyKeys:hm,propertyNames:um,categoryKey:"xValue",pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],datumSelectionGarbageCollection:!1,segmentedDataNodes:!1,pickModes:[2,0],animationResetFns:{path:kL({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Pp,datum:(e,i)=>({...rA(),...nx(e,i)})},clipFocusBox:!1}),this.properties=new on,this.connectsToYAxis=!0,this.aggregationManager=new dA,this.backgroundGroup=new ee({name:`${this.id}-background`,zIndex:Vs.BACKGROUND}),this._isStacked=void 0,this.fillSpans=[],this.phantomSpans=[],this.strokeSpans=[]}get pickModeAxis(){return"main"}renderToOffscreenCanvas(){const t=(this.contextNodeData?.nodeData?.length??0)>0;return super.renderToOffscreenCanvas()||t&&this.getDrawingMode(!1)==="cutout"||this.contextNodeData!=null&&(this.contextNodeData.fillData.spans.length>GN||this.contextNodeData.strokeData.spans.length>GN)}attachSeries(t,e,i){super.attachSeries(t,e,i),t.appendChild(this.backgroundGroup)}detachSeries(t,e,i){super.detachSeries(t,e,i),this.backgroundGroup.remove()}attachPaths([t,e]){this.backgroundGroup.appendChild(t),this.contentGroup.appendChild(e),e.zIndex=-1}detachPaths([t,e]){t.remove(),e.remove()}isStacked(){return(this.seriesGrouping?.stackCount??1)>1}isNormalized(){return this.properties.normalizedTo!=null}setSeriesIndex(t){const i=this.isStacked()===this._isStacked;return this._isStacked=i,super.setSeriesIndex(t,i)}setZIndex(t){super.setZIndex(t),this.isStacked()?(this.backgroundGroup.zIndex=[Vs.BACKGROUND,t],this.contentGroup.zIndex=[Vs.ANY_CONTENT,t,Mc.FOREGROUND]):(this.backgroundGroup.zIndex=[Vs.ANY_CONTENT,t,Mc.FOREGROUND,0],this.contentGroup.zIndex=[Vs.ANY_CONTENT,t,Mc.FOREGROUND,1])}async processData(t){if(this.data==null)return;const{data:e,visible:i,seriesGrouping:{groupIndex:n=this.id,stackCount:s=1}={}}=this,{xKey:a,yKey:o,selectedKey:r,connectMissingData:l,normalizedTo:c}=this.properties,u=!this.ctx.animationManager.isSkipped(),d=this.axes[z.X]?.scale,g=this.axes[z.Y]?.scale,{xScaleType:f,yScaleType:y}=this.getScaleInformation({xScale:d,yScale:g}),x=s>1||c!=null,S={value:`area-stack-${n}-yValue`,marker:`area-stack-${n}-yValues-marker`},D={invalidValue:null};(go(c)||l)&&s>1&&(D.invalidValue=0),i||(D.forceValue=0);const A=this.properties.allowNullKeys??!1,I=[uu(a,f,{id:"xValue",allowNullKey:A}),Ci(o,y,{id:"yValueRaw",...D}),...r==null?[]:[Ci(r,"category",{id:"selectedRaw"})]];x&&I.push(...Wd(o,"normal",{id:"yValueCumulative",...D,groupId:S.marker},y)),go(c)&&I.push(Ci(o,y,{id:"yValue",...D,groupId:S.value}),jD(Object.values(S),c)),u&&I.push(Hx());const{dataModel:w,processedData:N}=await this.requestDataModel(t,e,{props:I,groupByKeys:x,groupByData:!x});this.aggregateData(w,N),this.animationState.transition("updateData")}xCoordinateRange(t,e){const{marker:i}=this.properties,n=this.axes[z.X].scale.convert(t),s=i.enabled?.5*i.size*e:0;return[n-s,n+s]}yCoordinateRange(t,e){const{marker:i}=this.properties,n=this.axes[z.Y].scale.convert(t[0]),s=i.enabled?.5*i.size*e:0;return[n-s,n+s]}yValueKey(){return this.isNormalized()?"yValue":"yValueRaw"}yCumulativeKey(t){return t.type==="grouped"?"yValueCumulative":this.yValueKey()}getSeriesDomain(t){const{dataModel:e,processedData:i,axes:n}=this;if(!e||!i)return{domain:[]};const s=n[z.Y];if(t===z.X){const o=e.resolveProcessedDataDefById(this,"xValue"),r=e.getDomain(this,"xValue","key",i);return o?.def.type==="key"&&o.def.valueType==="category"?r:{domain:_a(Ll(r.domain))}}const a=this.domainForClippedRange(z.Y,[this.yCumulativeKey(i)],"xValue");if(s instanceof Ao&&!(s instanceof fm)){const o=Number.isFinite(a[1]-a[0])?[Math.min(a[0],0),Math.max(a[1],0)]:[];return{domain:_a(o)}}else return{domain:_a(a)}}getSeriesRange(t,e){const[i,n]=this.domainForVisibleRange(z.Y,[this.yCumulativeKey(this.processedData)],"xValue",e);return[Math.min(i,0),Math.max(n,0)]}getZoomRangeFittingItems(t,e,i){return this.zoomFittingVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],t,e,i)}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],t,e,i)}aggregateData(t,e){if(this.aggregationManager.markStale(e.input.count),rr(e))return;const i=this.axes[z.X];if(i==null)return;const n=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>mnt(i.scale.type,t,e,this.yCumulativeKey(e),this,n,a),computeFull:a=>fnt(i.scale.type,t,e,this.yCumulativeKey(e),this,a),targetRange:n});const s=this.aggregationManager.filters;s&&s.length>0&&Vr.record(`${this.type}:aggregation`,s.map(a=>a.maxRange))}estimateTargetRange(){const t=this.axes[z.X];if(t?.scale?.range){const[e,i]=t.scale.range;return Math.abs(i-e)}return this.ctx.scene?.canvas?.width??800}stackAggregatedData(t){const{indices:e,metaIndices:i}=t,{visible:n,axes:s,dataModel:a,processedData:o,seriesBelowStackContext:r}=this,l=s[z.X],c=s[z.Y];if(!n)return this.phantomSpans=[],this.fillSpans=[],this.strokeSpans=[],r;if(l==null||c==null||a==null||o==null)return;const{scale:u}=l,{scale:d}=c,g=(u.bandwidth??0)/2,f=!this.isStacked()&&this.properties.connectMissingData,y=o.invalidData?.get(this.id),x=a.resolveKeysById(this,"xValue",o),S=a.resolveColumnById(this,this.yCumulativeKey(o),o);let[D,A]=Qb(1,i.length-1,l.range,L=>{const R=i[L],P=i[L+1],B=e[R],F=e[P],H=x[B],$=x[F],{0:Y}=this.xCoordinateRange(H,0),{1:U}=this.xCoordinateRange($,0);return[Y,U]});D=Math.max(D-1,0),A=Math.min(A+1,i.length-1);let I=[];if(r?.fillSpans)I=r?.fillSpans;else for(let L=D;Lnt.point),q={span:{type:"multi-line",moveTo:!1,x0:U.point.x,y0:U.point.y,x1:V.point.x,y1:V.point.y,midPoints:Z},xValue0:U.xDatum,xValue1:V.xDatum,yValue0:U.yDatum,yValue1:V.yDatum};w.push(q),N.push(q)}return this.fillSpans=w,this.strokeSpans=N,{stack:[],fillSpans:w,strokeSpans:N}}hasInvalidDatumsInRange(t,e,i,n){const s=Math.min(i,n),a=Math.max(i,n);for(let o=s;o<=a;o++){if(t?.[o])return!0;const r=e[o];if(!Number.isFinite(r))return!0}return!1}stackYValueData(){const{visible:t,axes:e,dataModel:i,processedData:n,seriesBelowStackContext:s,properties:a}=this,o=e[z.X],r=e[z.Y];if(o==null||r==null||i==null||n==null)return;const{interpolation:l}=a,{scale:c}=o,{scale:u}=r,d=(c.bandwidth??0)/2;let g=i.resolveKeysById(this,"xValue",n),f=i.resolveColumnById(this,this.yValueKey(),n);const y=!this.isStacked()&&this.properties.connectMissingData,x=n.invalidKeys?.get(this.id),D=(y?n.invalidData?.get(this.id):void 0)??x;D!=null&&(g=g.filter((F,H)=>D[H]===!1),f=f.filter((F,H)=>D[H]===!1));let[A,I]=Qb(1,g.length,o.range,F=>this.xCoordinateRange(g[F],0));A=Math.max(A-2,0),I=Math.min(I+2,g.length);let w;if(s?.fillSpans)w=s?.fillSpans;else{const F=[];for(let H=A;H0,crossFiltering:this.properties.selectedKey!=null,styles:hA(this,this.properties,this.properties.marker),segments:void 0}}assembleResult(t,e){return e.segments=nA(this.properties.segmentation,t.xAxis,t.yAxis,this.chart.seriesRect,this.ctx.scene,!1),e}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{paths:[e,i],visible:n,animationEnabled:s}=t,a=this.contextNodeData?.segments,o=Et(this.getHighlightStyle(),this.getStyle()),{strokeWidth:r,stroke:l,strokeOpacity:c,lineDash:u,lineDashOffset:d,fill:g,fillOpacity:f,opacity:y}=o;i.setProperties({segments:a,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:l,strokeWidth:r,strokeOpacity:c,lineDash:u,lineDashOffset:d,opacity:y,visible:n||s}),i.datum=a,e.setStyleProperties({fill:g,stroke:void 0,fillOpacity:f},this.getShapeFillBBox()),e.setProperties({segments:a,lineJoin:"round",pointerEvents:1,fillShadow:this.properties.shadow,opacity:y,visible:n||s}),e.datum=a,OM(this,i),OM(this,e)}updatePaths(t){this.updateAreaPaths(t.paths,t.contextData)}updateAreaPaths(t,e){for(const i of t)i.visible=e.visible;if(e.visible)this.updateFillPath(t,e),this.updateStrokePath(t,e);else for(const i of t)i.path.clear(),i.markDirty("AreaSeries")}updateFillPath(t,e){const[i]=t;i.path.clear(),bW(i,e.fillData),i.markDirty("AreaSeries")}updateStrokePath(t,e){const{spans:i}=e.strokeData,[,n]=t;n.path.clear(),xL(n,i),n.markDirty("AreaSeries")}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,{contextNodeData:n,processedData:s,axes:a,properties:o}=this,{marker:r,styler:l}=o,c=l?this.getStyle().marker:void 0,u=n?.crossFiltering===!0||AL(s.input.count,a[z.X].scale,r,c);r.isDirty()&&(i.clear(),i.cleanup());const d=u?e:[];return rr(this.processedData)?i.update(d,void 0,g=>As(g.xValue)):i.update(d)}updateDatumStyles(t){const{datumSelection:e,isHighlight:i}=t,{marker:n}=this.properties,s=this.ctx.highlightManager.getActiveHighlight();e.each((a,o)=>{if(!e.isGarbage(a)){const r=this.getHighlightState(s,t.isHighlight,o.datumIndex),l=this.getStyle(r),{stroke:c,strokeWidth:u,strokeOpacity:d}=l,g=this.makeItemStylerParams(this.dataModel,this.processedData,o.datumIndex,l.marker);o.style=this.getMarkerStyle(n,o,g,{isHighlight:i,highlightState:r},l.marker,{stroke:c,strokeWidth:u,strokeOpacity:d})}})}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const{datumSelection:i,isHighlight:n}=t,s=this.getShapeFillBBox(),a=this.ctx.highlightManager.getActiveHighlight(),o=this.getDrawingMode(n,t.drawingMode);i.each((r,l)=>{const c=this.getHighlightState(a,n,l.datumIndex),u=l.style??e.styles[c];this.applyMarkerStyle(u,r,l.point,s,{selected:l.selected}),r.drawingMode=this.resolveMarkerDrawingModeForState(o,u)}),n||this.properties.marker.markClean()}updateLabelSelection(t){return t.labelSelection.update(this.isLabelEnabled()?t.labelData:[])}updateLabelNodes(t){const{isHighlight:e=!1}=t,i=this.ctx.highlightManager?.getActiveHighlight(),n=this.makeLabelFormatterParams();t.labelSelection.each((s,a)=>{const o=Rp(this,a,n,this.properties.label,e,i),{enabled:r,fontStyle:l,fontWeight:c,fontSize:u,fontFamily:d,color:g}=o;r&&a?.labelText?(s.fontStyle=l,s.fontWeight=c,s.fontSize=u,s.fontFamily=d,s.textAlign="center",s.textBaseline="bottom",s.text=a.labelText,s.x=a.x,s.y=a.y-10,s.fill=g,s.visible=!0,s.fillOpacity=this.getHighlightStyle(e,a.datumIndex).opacity??1,s.setBoxing(o)):s.visible=!1})}makeStylerParams(t){const{id:e}=this,{marker:i,fill:n,fillOpacity:s,lineDash:a,lineDashOffset:o,stroke:r,strokeOpacity:l,strokeWidth:c,xKey:u,yKey:d}=this.properties,g=em(t??0);return{marker:{fill:i.fill,fillOpacity:i.fillOpacity,size:i.size,shape:i.shape,stroke:i.stroke,strokeOpacity:i.strokeOpacity,strokeWidth:i.strokeWidth,lineDash:i.lineDash,lineDashOffset:i.lineDashOffset},highlightState:g,fill:n,fillOpacity:s,lineDash:a,lineDashOffset:o,seriesId:e,stroke:r,strokeOpacity:l,strokeWidth:c,xKey:u,yKey:d}}makeItemStylerParams(t,e,i,n){const{xKey:s,yKey:a}=this.properties,o=t.resolveKeysById(this,"xValue",e)[i],r=t.resolveColumnById(this,"yValueRaw",e)[i],l=t.getDomain(this,"xValue","key",e).domain,c=t.getDomain(this,this.yCumulativeKey(e),"value",e).domain,u=this.filterItemStylerFillParams(n.fill)??n.fill;return{...WT(o,r,s,a,l,c),xValue:o,yValue:r,...n,fill:u}}makeLabelFormatterParams(){const{xKey:t,xName:e,yKey:i,yName:n,legendItemName:s}=this.properties;return{xKey:t,xName:e,yKey:i,yName:n,legendItemName:s}}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,axes:s,properties:a}=this,{xKey:o,xName:r,yKey:l,yName:c,tooltip:u,legendItemName:d}=a,g=a.allowNullKeys??!1,f=s[z.X],y=s[z.Y];if(!i||!n||!f||!y)return;const x=n.dataSources.get(this.id)?.data?.[t],S=i.resolveKeysById(this,"xValue",n)[t],D=i.resolveColumnById(this,"yValueRaw",n)[t];if(S===void 0&&!g)return;const A=this.getStyle(),I=this.makeItemStylerParams(i,n,t,A.marker),w=this.getMarkerStyle(this.properties.marker,{datumIndex:t,datum:x},I,{isHighlight:!1},A.marker);return this.formatTooltipWithContext(u,{heading:this.getAxisValueText(f,"tooltip",S,x,o,d,g),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(y,"tooltip",D,x,l,d),missing:dp(D)}]},{seriesId:e,datum:x,title:c,xKey:o,xName:r,yKey:l,yName:c,...w,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:n,strokeWidth:s,lineDash:a,marker:o}=this.getStyle(),r=!o.enabled||o.fill==null,l=r?t:o.fill;return{marker:{...this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1},{size:o.size,shape:o.shape,fill:l,fillOpacity:r?i:o.fillOpacity,stroke:o.stroke}),enabled:o.enabled||s<=0},line:{enabled:!0,stroke:e,strokeOpacity:n,strokeWidth:s,lineDash:a}}}getLegendData(t){if(t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:n}=this,{yKey:s,yName:a,legendItemName:o,showInLegend:r}=this.properties;return[{legendType:t,id:e,itemId:s,legendItemName:o,seriesId:e,enabled:n&&i.getItemEnabled({seriesId:e,itemId:s}),label:{text:o??a??s},symbol:this.legendItemSymbol(),hideInLegend:!r}]}resetDatumAnimation(t){lA([t.datumSelection])}animateEmptyUpdateReady(t){const{datumSelection:e,labelSelection:i,contextData:n,paths:s}=t,{animationManager:a}=this.ctx;this.updateAreaPaths(s,n),IL(this,a,...s),Qn([e],nx),DL(this,a,{...this.getAnimationDrawingModes(),phase:"initial"},e),Wi(this,"labels",a,i)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateAreaPaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){const{animationManager:e}=this.ctx,{datumSelection:i,labelSelection:n,contextData:s,paths:a,previousContextData:o}=t,[r,l]=a;if(s.visible===!1&&o?.visible===!1||r==null&&l==null)return;this.resetDatumAnimation(t),this.resetLabelAnimation(t);const c=()=>{this.resetPathAnimation(t),this.updateAreaPaths(a,s)},u=()=>{e.skipCurrentBatch(),c()};if(s==null||o==null){c(),ix(this,e,"added",this.getAnimationDrawingModes(),i),WN(this,"fill_path_properties",e,"add",r),WN(this,"stroke_path_properties",e,"add",l),Wi(this,"labels",e,n);return}if(s.crossFiltering!==o.crossFiltering){u();return}const d=Mit(s,o);if(d===void 0){u();return}else if(d.status==="no-op")return;ix(this,e,void 0,this.getAnimationDrawingModes(),i),dn(this.id,"fill_path_properties",e,[r],d.fill.pathProperties),EM(this.id,"fill_path_update",e,[r],d.fill.path),dn(this.id,"stroke_path_properties",e,[l],d.stroke.pathProperties),EM(this.id,"stroke_path_update",e,[l],d.stroke.path),Wi(this,"labels",e,n),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(a,s)})}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new wn}getStyle(t){const{styler:e,marker:i,fill:n,fillOpacity:s,lineDash:a,lineDashOffset:o,stroke:r,strokeOpacity:l,strokeWidth:c}=this.properties,{size:u,shape:d,fill:g="transparent",fillOpacity:f}=i;let y={};if(e){const x=this.makeStylerParams(t),S=this.cachedCallWithContext(e,x)??{};y=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],S,{pick:!1})??{}}return y.marker??(y.marker={}),{fill:y.fill??n,fillOpacity:y.fillOpacity??s,lineDash:y.lineDash??a,lineDashOffset:y.lineDashOffset??o,stroke:y.stroke??r,strokeOpacity:y.strokeOpacity??l,strokeWidth:y.strokeWidth??c,marker:{enabled:y.marker.enabled??i.enabled,fill:y.marker.fill??g,fillOpacity:y.marker.fillOpacity??f,shape:y.marker.shape??d,size:y.marker.size??u,lineDash:y.marker.lineDash??i.lineDash??a,lineDashOffset:y.marker.lineDashOffset??i.lineDashOffset??o,stroke:y.marker.stroke??i.stroke??r,strokeOpacity:y.marker.strokeOpacity??i.strokeOpacity??l,strokeWidth:y.marker.strokeWidth??i.strokeWidth??c}}}getFormattedMarkerStyle(t){const e=this.getStyle(),i=this.makeItemStylerParams(this.dataModel,this.processedData,t.datumIndex,e.marker);return this.getMarkerStyle(this.properties.marker,t,i,{isHighlight:!0},void 0,e)}isPointInArea(t,e){let i;for(const n of this.backgroundGroup.children())if(n instanceof Tn){i=n;break}return i?.getBBox().containsPoint(t,e)?i.isPointInPath(t,e):!1}computeFocusBounds(t){return cA(this,t)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};zL.className="AreaSeries";zL.type="area";var ynt={series:{nodeClickRange:"nearest",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Tl],["image",$s],["pattern",Cs]]},stroke:{$palette:"stroke"},fillOpacity:.8,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:Dp,xOffset:3,yOffset:3,blur:5},interpolation:{type:"linear"},marker:{enabled:!1,shape:"circle",size:7,strokeWidth:{$isUserOption:["./stroke",1,0]},fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Sp],["pattern",Cs]]},stroke:{$palette:"stroke"}},label:{...Oe,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$path:["/tooltip/range","nearest"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:fD,segmentation:mD}},UW={type:"series",name:"area",chartType:"cartesian",stackable:!0,version:oi,dependencies:[hr],options:sL,predictAxis:Zx,defaultAxes:{y:{type:ie.NUMBER,position:he.LEFT},x:{type:ie.CATEGORY,position:he.BOTTOM}},axisKeys:{[z.X]:"xKeyAxis",[z.Y]:"yKeyAxis"},themeTemplate:ynt,create:t=>new zL(t)},bnt=.001,BL=class extends On{constructor(){super(...arguments),this.direction="x",this.featherRatio=0}setStaticProperties(t,e,i,n,s,a,o,r,l,c){this.__direction=l??"x",this.__featherRatio=c??0,super.setStaticProperties(t,e,i,n,s,a,o,r)}get feathered(){return Math.abs(this.featherRatio)>bnt}isPointInPath(t,e){return this.feathered?this.getBBox().containsPoint(t,e):super.isPointInPath(t,e)}updatePath(){if(!this.feathered){super.updatePath();return}const{path:t,borderPath:e,__direction:i,__featherRatio:n,__x:s,__y:a,__width:o,__height:r}=this;if(t.clear(),e.clear(),i==="x"){const l=Math.abs(n)*o;n>0?(t.moveTo(s,a),t.lineTo(s+o-l,a),t.lineTo(s+o,a+r/2),t.lineTo(s+o-l,a+r),t.lineTo(s,a+r),t.closePath()):(t.moveTo(s+l,a),t.lineTo(s+o,a),t.lineTo(s+o,a+r),t.lineTo(s+l,a+r),t.lineTo(s,a+r/2),t.closePath())}else{const l=Math.abs(n)*r;n>0?(t.moveTo(s,a+l),t.lineTo(s+o/2,a),t.lineTo(s+o,a+l),t.lineTo(s+o,a+r),t.lineTo(s,a+r),t.closePath()):(t.moveTo(s,a),t.lineTo(s+o,a),t.lineTo(s+o,a+r-l),t.lineTo(s+o/2,a+r),t.lineTo(s,a+r-l),t.closePath())}}renderStroke(t){if(!this.feathered){super.renderStroke(t);return}const{__stroke:e,__strokeWidth:i,__lineDash:n,__lineDashOffset:s,__lineCap:a,__lineJoin:o,path:r}=this;if(e&&i){const{globalAlpha:l}=t;this.applyStrokeAndAlpha(t),t.lineWidth=i,n&&t.setLineDash(n),s&&(t.lineDashOffset=s),a&&(t.lineCap=a),o&&(t.lineJoin=o),t.stroke(r.getPath2D()),t.globalAlpha=l}}};T([fe()],BL.prototype,"direction",2);T([fe()],BL.prototype,"featherRatio",2);function VL(t,e,i,n,s){if(e.lengthw.maxRange===d);let{indexData:f,valueData:y,negativeIndexData:x,negativeValueData:S}=Fc(e,n,i??n,a,o,d,{split:!0,xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:g?.positiveIndexData,reuseValueData:g?.positiveValueData,reuseNegativeIndexData:g?.negativeIndexData,reuseNegativeValueData:g?.negativeValueData});if(!x||!S)throw new Error("Negative aggregation data missing in split mode");let D=ul(d,f,g?.positiveIndices),A=ul(d,x,g?.negativeIndices);const I=[{maxRange:d,positiveIndices:D,positiveIndexData:f,positiveValueData:y,negativeIndices:A,negativeIndexData:x,negativeValueData:S}];for(;d>64;){const w=d,N=Math.trunc(w/2),O=u?.find(P=>P.maxRange===N),L=ap(f,y,w,{reuseIndexData:O?.positiveIndexData,reuseValueData:O?.positiveValueData}),R=ap(x,S,w,{reuseIndexData:O?.negativeIndexData,reuseValueData:O?.negativeValueData});d=L.maxRange,f=L.indexData,y=L.valueData,D=L.midpointData??ul(d,f,O?.positiveIndices),x=R.indexData,S=R.valueData,A=R.midpointData??ul(d,x,O?.negativeIndices),I.push({maxRange:d,positiveIndices:D,positiveIndexData:f,positiveValueData:y,negativeIndices:A,negativeIndexData:x,negativeValueData:S})}return I.reverse(),I}function xnt(t,e,i,n,s){if(e.lengthN.maxRange===f),{indexData:x,valueData:S,negativeIndexData:D,negativeValueData:A}=Fc(e,n,i??n,a,o,f,{split:!0,xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:y?.positiveIndexData,reuseValueData:y?.positiveValueData,reuseNegativeIndexData:y?.negativeIndexData,reuseNegativeValueData:y?.negativeValueData});if(!D||!A)throw new Error("Negative aggregation data missing in split mode");const I={maxRange:f,positiveIndices:ul(f,x,y?.positiveIndices),positiveIndexData:x,positiveValueData:S,negativeIndices:ul(f,D,y?.negativeIndices),negativeIndexData:D,negativeValueData:A};function w(){return VL([a,o],e,i,n,{smallestKeyInterval:r,xNeedsValueOf:l,yNeedsValueOf:c,existingFilters:d})?.filter(O=>O.maxRange!==f)??[]}return{immediate:[I],computeRemaining:w}}function vnt(t,e,i,n,s,a,o,r){const[l,c]=gn(t,s);return VL([l,c],e,i,n,{smallestKeyInterval:a,xNeedsValueOf:o,yNeedsValueOf:r})}var Snt=Pu(vnt);function Mnt(t,e,i,n,s){const a=e.resolveKeysById(n,"xValue",i),o=e.hasColumnById(n,"yValue-start"),r=o?e.resolveColumnById(n,"yValue-start",i):void 0,l=o?e.resolveColumnById(n,"yValue-end",i):e.resolveColumnById(n,"yValue-raw",i),c=e.getDomain(n,"xValue","key",i),u=e.resolveColumnNeedsValueOf(n,"xValue",i),d=e.resolveColumnNeedsValueOf(n,o?"yValue-end":"yValue-raw",i);if(s){const[g,f]=gn(t,c);return VL([g,f],a,r,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:u,yNeedsValueOf:d,existingFilters:s})}return Snt(t,a,r,l,c,i.reduced?.smallestKeyInterval,u,d)}function Dnt(t,e,i,n,s,a){const o=e.resolveKeysById(n,"xValue",i),r=e.hasColumnById(n,"yValue-start"),l=r?e.resolveColumnById(n,"yValue-start",i):void 0,c=r?e.resolveColumnById(n,"yValue-end",i):e.resolveColumnById(n,"yValue-raw",i),u=e.getDomain(n,"xValue","key",i),d=e.resolveColumnNeedsValueOf(n,"xValue",i),g=e.resolveColumnNeedsValueOf(n,r?"yValue-end":"yValue-raw",i),[f,y]=gn(t,u);return xnt([f,y],o,l,c,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:d,yNeedsValueOf:g,targetRange:s,existingFilters:a})}var _L=class extends Do{constructor(){super(...arguments),this.placement="inside-center",this.spacing=0}};T([b],_L.prototype,"placement",2);T([b],_L.prototype,"spacing",2);var Vi=class extends Jx{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.crisp=void 0,this.shadow=new zl,this.label=new _L,this.tooltip=zp(),this.sparklineMode=!1}};T([b],Vi.prototype,"xKey",2);T([b],Vi.prototype,"xName",2);T([b],Vi.prototype,"yKey",2);T([b],Vi.prototype,"yName",2);T([b],Vi.prototype,"yFilterKey",2);T([b],Vi.prototype,"stackGroup",2);T([b],Vi.prototype,"normalizedTo",2);T([b],Vi.prototype,"fill",2);T([b],Vi.prototype,"fillOpacity",2);T([b],Vi.prototype,"stroke",2);T([b],Vi.prototype,"strokeWidth",2);T([b],Vi.prototype,"strokeOpacity",2);T([b],Vi.prototype,"lineDash",2);T([b],Vi.prototype,"lineDashOffset",2);T([b],Vi.prototype,"cornerRadius",2);T([b],Vi.prototype,"crisp",2);T([b],Vi.prototype,"styler",2);T([b],Vi.prototype,"itemStyler",2);T([b],Vi.prototype,"simpleItemStyler",2);T([b],Vi.prototype,"shadow",2);T([b],Vi.prototype,"label",2);T([b],Vi.prototype,"tooltip",2);T([b],Vi.prototype,"sparklineMode",2);var FL=class extends oW{constructor(t){super({moduleCtx:t,propertyKeys:hm,propertyNames:um,categoryKey:"xValue",pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:ex,label:Pp}}),this.properties=new Vi,this.connectsToYAxis=!0,this.aggregationManager=new dA,this.phantomGroup=this.contentGroup.appendChild(new ee({name:"phantom",zIndex:-1})),this.phantomSelection=pn.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.phantomHighlightGroup=this.highlightGroup.appendChild(new ee({name:`${this.internalId}-highlight-node`})),this.phantomHighlightSelection=pn.select(this.phantomHighlightGroup,()=>this.nodeFactory(),!1),this.phantomGroup.opacity=.2,this.phantomHighlightGroup.opacity=.2}get pickModeAxis(){return this.properties.sparklineMode?"main":void 0}async processData(t){if(!this.data)return;const{xKey:e,yKey:i,yFilterKey:n,normalizedTo:s}=this.properties,{seriesGrouping:{groupIndex:a=this.id}={},data:o}=this,l=(this.seriesGrouping?.stackCount??0)>1||s!=null,c=l,u=!this.ctx.animationManager.isSkipped(),d=this.getCategoryAxis()?.scale,g=this.getValueAxis()?.scale,{isContinuousX:f,xScaleType:y,yScaleType:x}=this.getScaleInformation({xScale:d,yScale:g}),S=this.visible?{}:{forceValue:0},D=this.properties.allowNullKeys??!1,A=[uu(e,y,{id:"xValue",allowNullKey:D}),Ci(i,x,{id:"yValue-raw",invalidValue:null,...S})],I=[];if(l){const O=`bar-stack-${a}-yValues`,L=`${O}-trailing`;I.push(O,L),A.push(...Wd(i,"normal",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:O,separateNegative:!0,...S},x),...Wd(i,"trailing",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:L,separateNegative:!0,...S},x))}if(n!=null&&(A.push(Ci(n,x,{id:"yFilterValue-raw",invalidValue:null,...S})),l)){const O=`bar-stack-${a}-yFilterValues`,L=`${O}-trailing`;I.push(O,L),A.push(...Wd(n,"normal",{id:"yFilterValue-end",rangeId:"yFilterValue-range",invalidValue:null,missingValue:0,groupId:O,separateNegative:!0,...S},x),...Wd(n,"trailing",{id:"yFilterValue-start",invalidValue:null,missingValue:0,groupId:L,separateNegative:!0,...S},x),T7(this.id,"yValue-raw","yFilterValue-raw"))}f&&A.push(KG,YG),Ae(s)&&A.push(jD(I,Math.abs(s))),this.needsDataModelDiff()&&this.processedData&&A.push(GD(this.id,this.processedData)),(u||!c)&&A.push(Hx());const{dataModel:w,processedData:N}=await this.requestDataModel(t,o,{props:A,groupByKeys:c,groupByData:!c});this.aggregateData(w,N),this.smallestDataInterval=N.reduced?.smallestKeyInterval,this.largestDataInterval=N.reduced?.largestKeyInterval,this.animationState.transition("updateData")}yCumulativeKey(t){return t.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw"}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(i==null||e==null)return{domain:[]};if(t===this.getCategoryDirection()){const a=i.resolveProcessedDataDefById(this,"xValue"),o=i.getDomain(this,"xValue","key",e);return a?.def.type==="key"&&a.def.valueType==="category"?o:{domain:this.padBandExtent(o.domain)}}let n;if(e.reduced?.filteredValueExceedUnfiltered===!0)n=this.domainForClippedRange(t,["yFilterValue-end"],"xValue");else{const a=this.yCumulativeKey(i);n=this.domainForClippedRange(t,[a],"xValue");const o=i.hasColumnById(this,"yFilterValue-raw")?i.getDomain(this,"yFilterValue-raw","value",e).domain:void 0;o!=null&&(n=[Math.min(n[0],o[0]),Math.max(n[1],o[1])])}const s=this.getValueAxis();if(s instanceof Ao&&!(s instanceof fm)){const a=Number.isFinite(n[1]-n[0])?[Math.min(0,n[0]),Math.max(0,n[1])]:[];return{domain:_a(a)}}else return{domain:_a(n)}}getSeriesRange(t,e){if((this.properties.direction==="horizontal"?z.X:z.Y)!==t)return[];const n=this.yCumulativeKey(this.dataModel),[s,a]=this.domainForVisibleRange(z.Y,[n],"xValue",e);return[Math.min(s,0),Math.max(a,0)]}getZoomRangeFittingItems(t,e,i){const n=this.yCumulativeKey(this.dataModel);return this.zoomFittingVisibleItems("xValue",[n],t,e,i)}getVisibleItems(t,e,i){const n=this.yCumulativeKey(this.dataModel);return this.countVisibleItems("xValue",[n],t,e,i)}aggregateData(t,e){if(this.aggregationManager.markStale(e.input.count),rr(e))return;const i=this.axes[z.X];if(i==null)return;const n=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>Dnt(i.scale.type,t,e,this,n,a),computeFull:a=>Mnt(i.scale.type,t,e,this,a),targetRange:n});const s=this.aggregationManager.filters;s&&s.length>0&&Vr.record(`${this.type}:aggregation`,s.map(a=>a.maxRange))}estimateTargetRange(){const t=this.axes[z.X];if(t?.scale?.range){const[e,i]=t.scale.range;return Math.abs(i-e)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(t,e){const{dataModel:i,processedData:n}=this;if(!i||!n)return;const s=n.dataSources?.get(this.id);if(s==null)return;const a=t.scale,o=e.scale,r=Math.abs(a.range[1]-a.range[0]);this.aggregationManager.ensureLevelForRange(r);const l=this.aggregationManager.getFilterForRange(r),c=n.reduced?.filteredValueExceedUnfiltered??!1,u=i.hasColumnById(this,"yValue-start"),{label:d}=this.properties,g=this.canIncrementallyUpdateNodes(l!=null),{groupOffset:f,barOffset:y,barWidth:x}=this.getBarDimensions();let S,D,A;if(c)S=i.resolveColumnById(this,"yFilterValue-start",n),D=i.resolveColumnById(this,"yFilterValue-end",n),A=void 0;else{const I=i.hasColumnById(this,"yFilterValue-raw");S=u?i.resolveColumnById(this,"yValue-start",n):void 0,D=u?i.resolveColumnById(this,"yValue-end",n):void 0,A=I?i.resolveColumnById(this,"yFilterValue-raw",n):void 0}return{dataSource:s,rawData:s.data,xValues:i.resolveKeysById(this,"xValue",n),yRawValues:i.resolveColumnById(this,"yValue-raw",n),yStartValues:S,yEndValues:D,yFilterValues:A,xScale:a,yScale:o,xAxis:t,yAxis:e,groupOffset:f,barOffset:y,barWidth:x,range:r,yReversed:e.isReversed(),bboxBottom:o.convert(0),labelSpacing:d.spacing+(typeof d.padding=="number"?d.padding:0),crisp:l==null&&(this.properties.crisp??yW(t?.scale,t?.visibleRange,this.smallestDataInterval,this.largestDataInterval)),isStacked:u,filteredValueExceedUnfiltered:c,animationEnabled:!this.ctx.animationManager.isSkipped(),dataAggregationFilter:l,canIncrementallyUpdate:g,phantomNodes:g?this.contextNodeData.phantomNodeData??[]:[],nodes:g?this.contextNodeData.nodeData:[],labels:g?this.contextNodeData.labelData:[],nodeIndex:0,phantomIndex:0,barAlongX:this.getBarDirection()===z.X,shouldFlipXY:this.shouldFlipXY(),xKey:this.properties.xKey,yKey:this.properties.yKey,xName:this.properties.xName,yName:this.properties.yName,legendItemName:this.properties.legendItemName,label:d,yDomain:this.getSeriesDomain(z.Y).domain}}computeXPosition(t,e){const i=t.xScale.convert(t.xValues[e]);return Number.isFinite(i)?i+t.groupOffset+t.barOffset+this.getDatumOffset(e):Number.NaN}prepareNodeDatumState(t,e,i,n,s){if(!Number.isFinite(s))return;const a=t.xValues[i];if(a===void 0&&!this.properties.allowNullKeys)return;const o=t.dataSource?.data[i],r=t.yRawValues[i],l=t.yFilterValues==null?void 0:Number(t.yFilterValues[i]);if(l!=null&&!Number.isFinite(l))return;const c=t.label.enabled&&r!=null?this.getLabelText(l??r,o,t.yKey,"y",t.yDomain,t.label,{datum:o,value:l??r,xKey:t.xKey,yKey:t.yKey,xName:t.xName,yName:t.yName,legendItemName:t.legendItemName}):void 0,u=r>=0&&!Object.is(r,-0);return e.datum=o,e.xValue=a,e.yRawValue=r,e.yFilterValue=l,e.labelText=c,e.inset=l!=null&&l>r,e.isPositive=u,e.precomputedBottomY=l==null?void 0:t.yScale.convert(n),e.precomputedIsUpward=l==null?void 0:u!==t.yReversed,e}createSkeletonNodeDatum(t,e,i){const n=e.nodeDatumScratch;return{series:this,datum:n.datum,datumIndex:e.datumIndex,cumulativeValue:0,phantom:i,xValue:n.xValue??"",yValue:0,yKey:t.yKey,xKey:t.xKey,capDefaults:{lengthRatioMultiplier:0,lengthMax:0},x:0,y:0,width:0,height:0,midPoint:{x:0,y:0},opacity:e.opacity,featherRatio:e.featherRatio,topLeftCornerRadius:!1,topRightCornerRadius:!1,bottomRightCornerRadius:!1,bottomLeftCornerRadius:!1,clipBBox:void 0,crisp:t.crisp,label:void 0,missing:!1,focusable:!i}}createNodeDatum(t,e){const i=this.prepareNodeDatumState(t,e.nodeDatumScratch,e.datumIndex,e.yStart,e.yEnd);if(!i)return{nodeData:void 0,phantomNodeData:void 0};const n=this.createSkeletonNodeDatum(t,e,!1);this.updateNodeDatum(t,n,e,i);let s;return i.yFilterValue!=null&&(s=this.createSkeletonNodeDatum(t,e,!0),this.updateNodeDatum(t,s,e)),{nodeData:n,phantomNodeData:s}}updateNodeDatum(t,e,i,n){if(n??(n=this.prepareNodeDatumState(t,i.nodeDatumScratch,i.datumIndex,i.yStart,i.yEnd)),!n)return;const s=e,a=e.phantom,o=i.yStart,r=a?n.yFilterValue:n.yFilterValue??n.yRawValue,l=a?n.yFilterValue:n.yFilterValue??i.yEnd,c=a?void 0:n.labelText;let u;a||n.yFilterValue==null?u=i.yEnd:u=i.yStart+n.yFilterValue;let d;a?d=i.yRange:d=Math.max(i.yStart+(n.yFilterValue??-1/0),i.yRange);let g;a?g=void 0:n.inset?g=.6:g=void 0;const f=n.precomputedIsUpward??n.isPositive!==t.yReversed,y=t.yScale.convert(u),x=n.precomputedBottomY??t.yScale.convert(o),S=t.yScale.convert(d),D=i.width*.5*(1-(g??1)),A=t.barAlongX?Math.min(y,x):i.x+D,I=t.barAlongX?i.x+D:Math.min(y,x),w=t.barAlongX?Math.abs(x-y):i.width*(g??1),N=t.barAlongX?i.width*(g??1):Math.abs(x-y),O=t.barAlongX?Math.min(t.bboxBottom,S):i.x+D,L=t.barAlongX?i.x+D:Math.min(t.bboxBottom,S),R=t.barAlongX?Math.abs(t.bboxBottom-S):i.width*(g??1),P=t.barAlongX?i.width*(g??1):Math.abs(t.bboxBottom-S);s.datum=n.datum,s.datumIndex=i.datumIndex,s.cumulativeValue=l,s.xValue=n.xValue,s.yValue=r,s.x=O,s.y=L,s.width=R,s.height=P;const B=s.midPoint;B.x=A+w/2,B.y=I+N/2;const F=t.shouldFlipXY?N:w;s.capDefaults.lengthRatioMultiplier=F,s.capDefaults.lengthMax=F,s.opacity=i.opacity,s.featherRatio=i.featherRatio,s.topLeftCornerRadius=t.barAlongX!==f,s.topRightCornerRadius=f,s.bottomRightCornerRadius=t.barAlongX===f,s.bottomLeftCornerRadius=!f;const H=s.clipBBox;if(H?(H.x=A,H.y=I,H.width=w,H.height=N):s.clipBBox=new Tt(A,I,w,N),s.crisp=t.crisp,c==null)s.label=void 0;else{const $=QU({isUpward:f,isVertical:!t.barAlongX,placement:t.label.placement,spacing:t.labelSpacing,rect:{x:A,y:I,width:w,height:N}}),Y=s.label;Y?(Y.text=c,Y.x=$.x,Y.y=$.y,Y.textAlign=$.textAlign,Y.textBaseline=$.textBaseline):s.label={text:c,...$}}s.missing=dp(r)}createNodeDataWithAggregation(t,e,i){const n=t.yReversed?-1:1;for(let s=0;s<2;s+=1){const a=s===0,o=a?t.dataAggregationFilter.positiveIndices:t.dataAggregationFilter.negativeIndices,r=a?t.dataAggregationFilter.positiveIndexData:t.dataAggregationFilter.negativeIndexData,l=a?Na:Ta,c=a?Ta:Na,u=this.visibleRangeIndices("xValue",t.xAxis.range,o),d=u[0],g=u[1];for(let f=d;ft.range)continue;const N=Math.abs(S-x)+1,O=Rr.is(t.xScale)?Math.min(t.xScale.bandwidth*Math.max(N-1,1)/(t.xScale.step*N),1):1;if(i.datumIndex=A,i.x=I,i.width=w,i.opacity=O,t.isStacked)i.yStart=Number(t.yStartValues[D]),i.yEnd=Number(t.yEndValues[A]),i.featherRatio=0;else{const L=Number(t.yRawValues[A]),R=Number(t.yRawValues[D]);i.yStart=0,i.yEnd=L,i.featherRatio=(a?1:-1)*n*(1-R/L)}i.yRange=i.yEnd,this.upsertNodeDatum(t,i)}}}createNodeDataGrouped(t,e,i){const n=this.processedData,s=n.invalidData?.get(this.id),a=t.barWidth;let o;t.filteredValueExceedUnfiltered?o=this.dataModel.resolveProcessedDataIndexById(this,"yFilterValue-range"):t.isStacked?o=this.dataModel.resolveProcessedDataIndexById(this,"yValue-range"):o=-1;const r=n.columnScopes.findIndex(g=>g.has(this.id)),l=n.groups,c=Qb(1,l.length,t.xAxis.range,g=>{const y=l[g].keys[0];return this.xCoordinateRange(y)}),u=c[0],d=c[1];for(let g=u;g=0&&!Object.is(I,-0),N=t.isStacked?Number(t.yStartValues?.[D]):0,O=t.isStacked?Number(t.yEndValues?.[D]):I;let L=O;t.isStacked&&(L=y[o][w?1:0]),i.datumIndex=D,i.x=A,i.width=a,i.yStart=N,i.yEnd=O,i.yRange=L,i.featherRatio=0,i.opacity=1,this.upsertNodeDatum(t,i)}}}createNodeDataSimple(t,e,i){const n=this.processedData.invalidData?.get(this.id),s=t.barWidth,a=this.visibleRangeIndices("xValue",t.xAxis.range);let o=a[0],r=a[1];this.processedData.input.count<1e3&&(o=0,r=this.processedData.input.count);for(let l=o;l=t.labels.length&&t.labels.push(a);else{const r=this.createNodeDatum(t,e);r.nodeData&&(t.nodes.push(r.nodeData),t.labels.push(r.nodeData)),o=r.phantomNodeData}if(t.nodeIndex++,!n)return{nodeData:t.nodes[t.nodeIndex]};if(s)o=t.phantomNodes[t.phantomIndex],this.updateNodeDatum(t,o,e);else if(o)t.phantomNodes.push(o);else{const r=this.createNodeDatum(t,e);r.phantomNodeData&&t.phantomNodes.push(r.phantomNodeData)}return t.phantomIndex++,{nodeData:a,phantomNodeData:o}}populateNodeData(t){const e=n=>this.computeXPosition(t,n),i={nodeDatumScratch:{datum:void 0,xValue:void 0,yRawValue:0,yFilterValue:void 0,labelText:void 0,inset:!1,isPositive:!1,precomputedBottomY:void 0,precomputedIsUpward:void 0},datumIndex:0,x:0,width:0,yStart:0,yEnd:0,yRange:0,featherRatio:0,opacity:1};t.dataAggregationFilter!=null?this.createNodeDataWithAggregation(t,e,i):this.processedData.type==="grouped"?this.createNodeDataGrouped(t,e,i):this.createNodeDataSimple(t,e,i)}initializeResult(t){return{itemId:this.properties.yKey,nodeData:t.nodes,phantomNodeData:t.phantomNodes,labelData:t.labels,scales:this.calculateScaling(),visible:this.visible||t.animationEnabled,groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),styles:YT(this.getItemStyle.bind(this)),segments:void 0}}finalizeNodeData(t){t.canIncrementallyUpdate&&(this.trimIncrementalNodeArray(t.nodes,t.nodeIndex),this.trimIncrementalNodeArray(t.phantomNodes,t.phantomIndex),this.trimIncrementalNodeArray(t.labels,t.nodes.length))}assembleResult(t,e){return e.segments=nA(this.properties.segmentation,t.xAxis,t.yAxis,this.chart.seriesRect,this.ctx.scene),e}nodeFactory(){return new BL}updateSeriesSelections(){super.updateSeriesSelections(),this.phantomSelection=this.updateDatumSelection({nodeData:this.contextNodeData?.phantomNodeData??[],datumSelection:this.phantomSelection})}updateHighlightSelectionItem(t){const e=super.updateHighlightSelectionItem(t),i=this.ctx.highlightManager?.getActiveHighlight(),s=this.isSeriesHighlighted(i)&&i?.datum?i:void 0;return this.phantomHighlightSelection=this.updateDatumSelection({nodeData:s?this.getHighlightData(this.contextNodeData?.phantomNodeData??[],s)??[]:[],datumSelection:this.phantomHighlightSelection}),e}updateNodes(t,e){super.updateNodes(t,e),this.updateDatumNodes({datumSelection:this.phantomSelection,isHighlight:!1,drawingMode:"overlay"}),this.updateDatumNodes({datumSelection:this.phantomHighlightSelection,isHighlight:!0,drawingMode:"overlay"})}getHighlightData(t,e){const i=t.find(n=>n.datum===e.datum);return i==null?void 0:[{...i}]}updateDatumSelection(t){return rr(this.processedData)?t.datumSelection.update(t.nodeData,void 0,this.getDatumId.bind(this)):t.datumSelection.update(t.nodeData)}makeStylerParams(t){const{id:e}=this,{cornerRadius:i,fill:n,fillOpacity:s,lineDash:a,lineDashOffset:o,stackGroup:r,stroke:l,strokeOpacity:c,strokeWidth:u,xKey:d,yKey:g}=this.properties,f=em(t??0);return{cornerRadius:i,fill:n,fillOpacity:s,highlightState:f,lineDash:a,lineDashOffset:o,seriesId:e,stackGroup:r,stroke:l,strokeOpacity:c,strokeWidth:u,xKey:d,yKey:g}}makeItemStylerParams(t,e,i,n,s,a){const{id:o}=this,{xKey:r,yKey:l,stackGroup:c}=this.properties,u=e.dataSources.get(o)?.data?.[i],d=t.resolveColumnById(this,"yValue-raw",e)[i],g=t.getDomain(this,"xValue","key",e).domain,f=t.getDomain(this,this.yCumulativeKey(t),"value",e).domain,y=this.ctx.highlightManager?.getActiveHighlight(),x=this.getHighlightStateString(y,s,i),S=this.filterItemStylerFillParams(a.fill)??a.fill;return{seriesId:o,...WT(n,d,r,l,g,f),datum:u,xValue:n,yValue:d,stackGroup:c,highlightState:x,...a,fill:S}}getStyle(t,e){const{cornerRadius:i,fill:n,fillOpacity:s,lineDash:a,lineDashOffset:o,stroke:r,strokeOpacity:l,strokeWidth:c,styler:u}=this.properties;let d={};if(!t&&u){const g=this.makeStylerParams(e);d=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(u,g)??{},{pick:!1})??{}}return{cornerRadius:d.cornerRadius??i,fill:d.fill??n,fillOpacity:d.fillOpacity??s,lineDash:d.lineDash??a,lineDashOffset:d.lineDashOffset??o,opacity:1,stroke:d.stroke??r,strokeOpacity:d.strokeOpacity??l,strokeWidth:d.strokeWidth??c}}getItemStyle(t,e,i){const{properties:n,dataModel:s,processedData:a}=this,{itemStyler:o,simpleItemStyler:r}=n,l=this.getHighlightStyle(e,t,i);if(r&&a!=null&&t!=null){const u=a.dataSources.get(this.id)?.data?.[t],d=r(u);return Et(d,l,this.getStyle(!1,i))}let c=Et(l,this.getStyle(t===void 0,i));if(o&&s!=null&&a!=null&&t!=null){const u=s.resolveKeysById(this,"xValue",a)[t],d=this.cachedDatumCallback(As(this.getDatumId({xValue:u,phantom:!1}),e?"highlight":"node"),()=>{const g=this.makeItemStylerParams(s,a,t,u,e,c);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(o,g))});d&&(c=Et(d,c))}return c}updateDatumStyles(t){const e=this.ctx.highlightManager.getActiveHighlight(),i=this;function n(s,a){if(!t.datumSelection.isGarbage(s)){const o=i.getHighlightState(e,t.isHighlight,a.datumIndex);a.style=i.getItemStyle(a.datumIndex,t.isHighlight,o)}}t.datumSelection.each(n)}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const i=this.ctx.highlightManager.getActiveHighlight(),{shadow:n}=this.properties,s=this.getCategoryDirection()===z.X,a=this.getShapeFillBBox(),o=this.getBarDirection(),{drawingMode:r,isHighlight:l}=t,c=this,u=e.styles;function d(g,f){const y=f.style??u[c.getHighlightState(i,l,f.datumIndex)];g.setStyleProperties(y,a);const x=y.cornerRadius??0,S=s?(f.clipBBox?.width??f.width)>0:(f.clipBBox?.height??f.height)>0;g.setStaticProperties(r,f.topLeftCornerRadius?x:0,f.topRightCornerRadius?x:0,f.bottomRightCornerRadius?x:0,f.bottomLeftCornerRadius?x:0,S,f.crisp,n,o,f.featherRatio)}t.datumSelection.each(d)}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e,i=>{i.pointerEvents=1})}updateLabelNodes(t){const{isHighlight:e=!1}=t,i={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yKey:this.properties.yKey,yName:this.properties.yName??this.properties.yKey,legendItemName:this.properties.legendItemName??this.properties.xName??this.properties.xKey},n=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((s,a)=>{s.fillOpacity=this.getHighlightStyle(e,a?.datumIndex).opacity??1,qU(this,s,i,this.properties.label,a.label,e,n)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,properties:s}=this,{xKey:a,xName:o,yKey:r,yName:l,legendItemName:c,stackGroup:u,tooltip:d}=s,g=s.allowNullKeys??!1,f=this.getCategoryAxis(),y=this.getValueAxis();if(!i||!n||!f||!y)return;const x=n.dataSources.get(this.id)?.data?.[t],S=i.resolveKeysById(this,"xValue",n)[t],D=i.resolveColumnById(this,"yValue-raw",n)[t];if(S===void 0&&!g)return;const A=this.getItemStyle(t,!1);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(f,"tooltip",S,x,a,c,g),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:r,value:this.getAxisValueText(y,"tooltip",D,x,r,c),missing:dp(D)}]},{seriesId:e,datum:x,title:l,xKey:a,xName:o,yKey:r,yName:l,legendItemName:c,stackGroup:u,...A,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,fillOpacity:n,strokeOpacity:s,lineDash:a,lineDashOffset:o}=this.getStyle(!1,0);return{marker:{fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:n,strokeOpacity:s,strokeWidth:i,lineDash:a,lineDashOffset:o}}}getLegendData(t){const{showInLegend:e}=this.properties;if(t!=="category")return[];const{id:i,ctx:{legendManager:n},visible:s}=this,{yKey:a,yName:o,legendItemName:r}=this.properties;return[{legendType:"category",id:i,itemId:a,seriesId:i,enabled:s&&n.getItemEnabled({seriesId:i,itemId:a}),label:{text:r??o??a},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!e}]}resetDatumAnimation(t){LM([t.datumSelection,this.phantomSelection])}animateReadyHighlight(t){LM([t,this.phantomHighlightSelection])}animateEmptyUpdateReady({datumSelection:t,labelSelection:e,annotationSelections:i}){const{phantomSelection:n}=this,s=tx(Jb(this.isVertical(),this.axes,"normal"),"unknown");dn(this.id,"nodes",this.ctx.animationManager,[t,n],s),Wi(this,"labels",this.ctx.animationManager,e),Wi(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(t){const{phantomSelection:e}=this,{datumSelection:i,labelSelection:n,annotationSelections:s,contextData:a,previousContextData:o}=t;this.ctx.animationManager.stopByAnimationGroupId(this.id);const r=vW(this.id,i,this.getDatumId.bind(this),t.contextData,o,this.processedData,this.processedDataUpdated),l=o==null?"fade":"normal",c=tx(Jb(this.isVertical(),this.axes,l),"added");dn(this.id,"nodes",this.ctx.animationManager,[i,e],c,(u,d)=>this.getDatumId(d),r),(!r||r?.changed||!yl(a.groupScale,o?.groupScale))&&(Wi(this,"labels",this.ctx.animationManager,n),Wi(this,"annotations",this.ctx.animationManager,...s))}getDatumId(t){return As(t.xValue,t.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){const e=this.contextNodeData?.nodeData[t].clipBBox;return SL(this,e)}hasItemStylers(){return this.properties.styler!=null||this.properties.itemStyler!=null||this.properties.simpleItemStyler!=null||this.properties.label.itemStyler!=null}};FL.className="BarSeries";FL.type="bar";var Ant={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Tl],["image",$s],["pattern",Cs]]},stroke:{$palette:"stroke"},fillOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,label:{...Oe,padding:{$isUserOption:["./spacing",0,8]},enabled:!1,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$if:[{$or:[{$eq:[{$path:"./placement"},"outside-start"]},{$eq:[{$path:"./placement"},"outside-end"]}]},{$ref:"textColor"},{$ref:"chartBackgroundColor"}]},placement:"inside-center"},shadow:{enabled:!1,color:Dp,xOffset:3,yOffset:3,blur:5},highlight:Bc,segmentation:mD}},WW={type:"series",name:"bar",chartType:"cartesian",stackable:!0,groupable:!0,version:oi,dependencies:[hr],options:om,predictAxis:Zx,defaultAxes:Y4,axisKeys:{[z.X]:"xKeyAxis",[z.Y]:"yKeyAxis"},axisKeysFlipped:{[z.X]:"yKeyAxis",[z.Y]:"xKeyAxis"},themeTemplate:Ant,create:t=>new FL(t)},Z0=3,Int=5,NV=.05;function knt(t,e,i){const{xValues:n,yValues:s,xDomain:a,yDomain:o,xNeedsValueOf:r,yNeedsValueOf:l}=t,{x0:c,y0:u,x1:d,y1:g}=i;let f=0,y=1/0;const x=(c+d)/2,S=(u+g)/2;for(const D of e){const A=n[D],I=s[D];if(A==null||I==null)continue;const w=ar(A,a.min,a.max,r),N=ar(I,o.min,o.max,l),O=(w-x)**2+(N-S)**2;O=c&&D<=d&&A>=u&&A<=g&&(f+=1)}return f}function wnt(t,e,i){const{xValues:n,yValues:s,xDomain:a,yDomain:o,xNeedsValueOf:r,yNeedsValueOf:l}=t,{x0:c,y0:u,x1:d,y1:g}=i,f=[{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]}],y=(c+d)/2,x=(u+g)/2;for(const D of e){const A=n[D],I=s[D];if(A==null||I==null)continue;const w=ar(A,a.min,a.max,r),N=ar(I,o.min,o.max,l),O=(w>y?1:0)+(N>x?2:0),L=f[O];L.indices.push(D),L.x0=Math.min(L.x0,w),L.y0=Math.min(L.y0,N),L.x1=Math.max(L.x1,w),L.y1=Math.max(L.y1,N)}const S=[];for(const D of f){const{indices:A,x0:I,x1:w,y0:N,y1:O}=D;if(A.length===0)continue;const L=XN(t,A,{x0:I,y0:N,x1:w,y1:O});S.push(L)}return S}function XN(t,e,i){const{x0:n,y0:s,x1:a,y1:o}=i;let l=e.lengthd){const D=Array.from({length:Z0},()=>[]);for(let A=0;A=0&&Nw),A=XN(x,D,{x0:0,y0:0,x1:1,y1:1});A!=null&&S.push({sizeRatio:0,node:A})}return S.length>0?{xValues:i,yValues:n,xd0:r,xd1:l,yd0:c,yd1:u,filters:S,xNeedsValueOf:f,yNeedsValueOf:y}:void 0}function Tnt(t,e,i,n,s,a,o,r,l,c){const[u,d]=gn(t,a),[g,f]=gn(e,o);return Nnt([u,d],[g,f],i,n,s,[r[0],r[1]],{xNeedsValueOf:l,yNeedsValueOf:c})}function Lnt(t,e,i,n,s,a,o){const r=i.resolveColumnById(o,"xValue",n),l=i.resolveColumnById(o,"yValue",n),c=a?i.resolveColumnById(o,"sizeValue",n):void 0,u=i.getDomain(o,"xValue","value",n),d=i.getDomain(o,"yValue","value",n),g=a?s.domain:[0,0],f=i.resolveColumnNeedsValueOf(o,"xValue",n),y=i.resolveColumnNeedsValueOf(o,"yValue",n);return Tnt(t,e,r,l,c,u,d,g,f,y)}function KW(t,e,i,n,s,a){const{xRange:o,yRange:r,xVisibleRange:[l,c],yVisibleRange:[u,d],minSize:g,maxSize:f}=i,{xValues:y,yValues:x,xd0:S,xd1:D,yd0:A,yd1:I,xNeedsValueOf:w,yNeedsValueOf:N}=e,O=1/Math.min(o/(c-l),r/(d-u)),L={xValues:y,yValues:x,xDomain:{min:S,max:D},yDomain:{min:A,max:I},xNeedsValueOf:w,yNeedsValueOf:N};for(const{sizeRatio:R,node:P}of e.filters){const B=.5*(g+R*(f-g)),F=B*O,H=t*F,$=l-B/o,Y=c+B/o,U=u-B/r,V=d+B/r,Z=[P];for(;Z.length>0;){const W=Z.pop();if(!(W.x1<$||W.x0>Y||W.y1V))if(t!==1&&W.scale<=H)n!=null&&(n.count+=1),s?.push({datumIndex:W.primaryDatumIndex,count:W.indices.length,area:(W.x1-W.x0)*(W.y1-W.y0),dilation:Nt(1,W.scale/F,t)});else if(W.children==null){const{indices:q}=W;if(n!=null){const G=W.x0>=l&&W.x1<=c&&W.y0>=u&&W.y1<=d?q.length:Cnt(L,q,{x0:l,y0:u,x1:c,y1:d});n.count+=G}a?.push(...q)}else Z.push(...W.children)}}}function qS(t,e,i){const n={count:0};return KW(t,e,i,n,void 0,void 0),n.count}var Ont=100,Ent=12;function Rnt(t,e,i){if(qS(1,t,e)<=i)return 1;let n=1,s=2;for(;qS(s,t,e)>i&&si?n=o:s=o}return(n+s)/2}function Pnt(t,e,i){const n=[],s=[];return KW(t,e,i,void 0,n,s),{groupedAggregation:n,singleDatumIndices:s}}var HL=class extends la{constructor(){super(...arguments),this.maxSize=30}};T([b,ut()],HL.prototype,"maxSize",2);T([b,Vx()],HL.prototype,"domain",2);var YW=class extends Do{constructor(){super(...arguments),this.placement="top"}};T([b],YW.prototype,"placement",2);var gi=class extends jr{constructor(){super(...arguments),this.label=new YW,this.tooltip=zp(),this.maxRenderedItems=1/0,this.marker=new HL}};T([b],gi.prototype,"xKey",2);T([b],gi.prototype,"yKey",2);T([b],gi.prototype,"sizeKey",2);T([b],gi.prototype,"labelKey",2);T([b],gi.prototype,"selectedKey",2);T([b],gi.prototype,"xName",2);T([b],gi.prototype,"yName",2);T([b],gi.prototype,"sizeName",2);T([b],gi.prototype,"labelName",2);T([b],gi.prototype,"title",2);T([qi("marker.shape")],gi.prototype,"shape",2);T([qi("marker.size")],gi.prototype,"size",2);T([qi("marker.maxSize")],gi.prototype,"maxSize",2);T([qi("marker.domain")],gi.prototype,"domain",2);T([qi("marker.fill")],gi.prototype,"fill",2);T([qi("marker.fillOpacity")],gi.prototype,"fillOpacity",2);T([qi("marker.stroke")],gi.prototype,"stroke",2);T([qi("marker.strokeWidth")],gi.prototype,"strokeWidth",2);T([qi("marker.strokeOpacity")],gi.prototype,"strokeOpacity",2);T([qi("marker.lineDash")],gi.prototype,"lineDash",2);T([qi("marker.lineDashOffset")],gi.prototype,"lineDashOffset",2);T([qi("marker.itemStyler")],gi.prototype,"itemStyler",2);T([b],gi.prototype,"styler",2);T([b],gi.prototype,"label",2);T([b],gi.prototype,"tooltip",2);T([b],gi.prototype,"maxRenderedItems",2);var znt=class extends mL{constructor(t,e,i,n){super(t,e,i,n),this.sizeKey=n.properties.sizeKey}},gA=class extends Wu{constructor(t){super({moduleCtx:t,propertyKeys:{...hm,label:["labelKey"],size:["sizeKey"]},propertyNames:{...um,label:["labelName"],size:["sizeName"]},categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationResetFns:{label:Pp,datum:rA},usesPlacedLabels:!0,clipFocusBox:!1}),this.NodeEvent=znt,this.properties=new gi,this.dataAggregation=void 0,this.sizeScale=new np,this.placedLabelData=[]}get pickModeAxis(){return"main-category"}get type(){return super.type}async processData(t){if(this.data==null||!this.visible)return;const e=this.axes[z.X]?.scale,i=this.axes[z.Y]?.scale,{xScaleType:n,yScaleType:s}=this.getScaleInformation({xScale:e,yScale:i}),a=this.sizeScale.type,{xKey:o,yKey:r,sizeKey:l,selectedKey:c,labelKey:u,marker:d}=this.properties,g=this.properties.allowNullKeys??!1,{dataModel:f,processedData:y}=await this.requestDataModel(t,this.data,{props:[Ci(o,n,{id:"xValue",allowNullKey:g}),Ci(r,s,{id:"yValue",allowNullKey:g}),...c==null?[]:[Ci(c,"category",{id:"selectedValue"})],...l?[Ci(l,a,{id:"sizeValue"})]:[],...u?[Ci(u,"category",{id:"labelValue"})]:[]]}),x=l?f.resolveProcessedDataIndexById(this,"sizeValue"):void 0,S=d.domain?[d.domain[0],d.domain[1]]:void 0;this.sizeScale.domain=S??(x==null?void 0:y.domain.values[x])??[],this.dataAggregation=this.aggregateData(f,y),this.animationState.transition("updateData")}xCoordinateRange(t,e,i){const{properties:n,sizeScale:s}=this,{size:a,sizeKey:o}=n,r=this.axes[z.X].scale.convert(t),l=o==null?void 0:this.dataModel.resolveColumnById(this,"sizeValue",this.processedData),u=.5*(l==null?a:s.convert(l[i]))*e;return[r-u,r+u]}yCoordinateRange(t,e,i){const{properties:n,sizeScale:s}=this,{size:a,sizeKey:o}=n,r=this.axes[z.Y].scale.convert(t[0]),l=o==null?void 0:this.dataModel.resolveColumnById(this,"sizeValue",this.processedData),u=.5*(l==null?a:s.convert(l[i]))*e;return[r-u,r+u]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return{domain:[]};const n={[z.X]:"xValue",[z.Y]:"yValue"},s=n[t],a=e.resolveProcessedDataDefById(this,s),o=e.getDomain(this,s,"value",i);if(a?.def.type==="value"&&a?.def.valueType==="category")return{domain:o.domain};const r=t===z.X?z.Y:z.X,l=n[r],c=this.domainForClippedRange(t,[s],l);return{domain:_a(Ll(c))}}getSeriesRange(t,e){return this.domainForVisibleRange(z.Y,["yValue"],"xValue",e)}getVisibleItems(t,e,i){const{dataAggregation:n,axes:s}=this,a=s[z.X],o=s[z.Y];if(n==null||a==null||o==null)return this.countVisibleItems("xValue",["yValue"],t,e,i);const r=this.aggregationOptions(a,o,t,e??[0,1]);return qS(0,n,r)}aggregateData(t,e){if(e.type==="grouped"||e.input.count<=this.properties.maxRenderedItems)return;const i=this.axes[z.X],n=this.axes[z.Y];if(i==null||n==null)return;const s=i.scale,a=n.scale;if(!(!ti.is(s)||!ti.is(a)))return Lnt(s.type,a.type,t,e,this.sizeScale,this.properties.sizeKey!=null,this)}aggregationOptions(t,e,i=t.visibleRange,n=e.visibleRange){const{processedData:s,dataModel:a}=this,{sizeKey:o}=this.properties,[r,l]=this.getSizeRange(),c=Math.abs(t.range[1]-t.range[0]),u=Math.abs(e.range[1]-e.range[0]),d=Math.max(r,1),g=o?Math.max(l,1):d,f=t.scale,y=e.scale;return s!=null&&a!=null&&(ti.is(f)&&(i=pM(i,f.domain.map(Ss),a.getDomain(this,"xValue","value",s).domain.map(Ss))),ti.is(y)&&(n=pM(n,y.domain.map(Ss),a.getDomain(this,"yValue","value",s).domain.map(Ss)))),{xRange:c,yRange:u,minSize:d,maxSize:g,xVisibleRange:i,yVisibleRange:n}}createNodeDatumContext(t,e){const{dataModel:i,processedData:n,sizeScale:s,visible:a}=this;if(!i||!n)return;const o=n.dataSources.get(this.id)?.data;if(o==null)return;const{xKey:r,yKey:l,sizeKey:c,selectedKey:u,labelKey:d,xName:g,yName:f,sizeName:y,labelName:x,label:S,legendItemName:D,marker:A}=this.properties,I=t.scale,w=e.scale,N=n.changeDescription!=null&&this.contextNodeData?.nodeData!=null;let O;d?O=[]:c?O=i.getDomain(this,"sizeValue","value",n).domain:O=[];const L=i.resolveColumnById(this,"xValue",n);return{xAxis:t,yAxis:e,rawData:o,xValues:L,xDataValues:L,yDataValues:i.resolveColumnById(this,"yValue",n),sizeDataValues:c==null?void 0:i.resolveColumnById(this,"sizeValue",n),labelDataValues:d==null?void 0:i.resolveColumnById(this,"labelValue",n),selectedDataValues:u==null?void 0:i.resolveColumnById(this,"selectedValue",n),xScale:I,yScale:w,sizeScale:s,xOffset:(I.bandwidth??0)/2,yOffset:(w.bandwidth??0)/2,xKey:r,yKey:l,sizeKey:c,labelKey:d,xName:g,yName:f,sizeName:y,labelName:x,legendItemName:D,labelsEnabled:S.enabled,labelPlacement:S.placement,labelAnchor:wn.anchor(A.shape),labelTextDomain:O,labelPadding:Lf(S),labelTextMeasurer:Ve(S),label:S,animationEnabled:!this.ctx.animationManager.isSkipped(),visible:a,canIncrementallyUpdate:N,nodes:N?this.contextNodeData.nodeData:[],nodeIndex:0}}populateNodeData(t){this.sizeScale.range=this.getSizeRange();const e={datum:void 0,xDatum:void 0,yDatum:void 0,sizeValue:void 0,x:0,y:0,selected:void 0,nodeLabel:{text:"",width:0,height:0},markerSize:0,count:1,dilation:1,area:0},{dataAggregation:i}=this;i==null?this.createNodeDataSimple(t,e):this.createNodeDataWithAggregation(t,e,t.xAxis,t.yAxis,i)}initializeResult(t){const{marker:e}=this.properties;return{itemId:t.yKey,nodeData:t.nodes,labelData:t.labelsEnabled?t.nodes:[],scales:this.calculateScaling(),visible:this.visible||t.animationEnabled,styles:hA(this,this.properties,e)}}upsertBubbleNodeDatum(t,e,i){this.prepareNodeDatumState(t,e,i)&&ML(t,{scratch:e,datumIndex:i},(n,s)=>{const a=this.createSkeletonNodeDatum(n,s.scratch,s.datumIndex);return this.updateNodeDatum(n,a,s.scratch,s.datumIndex),a},(n,s,a)=>this.updateNodeDatum(n,s,a.scratch,a.datumIndex))}createNodeDataSimple(t,e){const i=t.rawData.length;for(let n=0;nAs(a.xValue,a.yValue,a.sizeValue,ce(a.label.text))),i.update(e,void 0,s)}updateDatumStyles(t){const{datumSelection:e,isHighlight:i}=t,{xKey:n,yKey:s,sizeKey:a,labelKey:o,marker:r}=this.properties,l={xKey:n,yKey:s,sizeKey:a,labelKey:o},c=this.ctx.highlightManager.getActiveHighlight();e.each((u,d)=>{if(!e.isGarbage(u)){const g=this.getHighlightState(c,t.isHighlight,d.datumIndex),f=this.getStyle(g);d.style=this.getMarkerStyle(r,d,l,{isHighlight:i,highlightState:g,resolveMarkerSubPath:[]},f)}})}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const{datumSelection:i,isHighlight:n,drawingMode:s}=t;this.sizeScale.range=this.getSizeRange();const a=this.getShapeFillBBox(),o=this.dataAggregation!=null,r=this.ctx.highlightManager.getActiveHighlight();i.each((l,c,u)=>{const{point:{size:d},count:g,area:f,dilation:y}=c,x=this.getHighlightState(r,n,c.datumIndex),S={...c.style??e.styles[x]};if(S.size=d,y>1){const D=S.fillOpacity??0,A=.269669+683e-6*g+-37.534348*f+.004449*g*f+-0*g**2+44.428603*f**2;S.fillOpacity=Nt(D/y,D/.1*A,1)}this.applyMarkerStyle(S,l,c.point,a,{selected:c.selected}),l.drawingMode=this.resolveMarkerDrawingModeForState(s,S),l.zIndex=o?[-g,u]:0}),n||this.properties.marker.markClean()}updatePlacedLabelData(t){this.placedLabelData=t,this.labelSelection.update(t.map(e=>({...e.datum,point:{x:e.x,y:e.y,size:e.datum.point.size}})),e=>{e.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.updateHighlightLabelSelection()}updateHighlightLabelSelection(){const t=this.ctx.highlightManager?.getActiveHighlight(),e=this.isSeriesHighlighted(t)&&t?.datum?t:void 0,i=e==null?[]:this.placedLabelData.filter(n=>n.datum.datumIndex===e.datumIndex).map(n=>({...n.datum,point:{x:n.x,y:n.y,size:n.datum.point.size}}));this.highlightLabelSelection=this.updateLabelSelection({labelData:i,labelSelection:this.highlightLabelSelection})??this.highlightLabelSelection,this.highlightLabelGroup.visible=i.length>0,this.highlightLabelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})})}updateLabelNodes(t){const{isHighlight:e=!1}=t,i=this.ctx.highlightManager?.getActiveHighlight(),n=this.makeLabelFormatterParams();t.labelSelection.each((s,a)=>{const o=Rp(this,a,n,this.properties.label,e,i);s.text=a.label.text,s.fill=o.color,s.x=a.point?.x??0,s.y=a.point?.y??0,s.fontStyle=o.fontStyle,s.fontWeight=o.fontWeight,s.fontSize=o.fontSize,s.fontFamily=o.fontFamily,s.textBaseline="top",s.fillOpacity=this.getHighlightStyle(e,a.datumIndex).opacity??1,s.setBoxing(o)})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e,n=>{n.pointerEvents=1})}makeStylerParams(t){const{id:e,properties:{size:i,maxSize:n,shape:s,fill:a,fillOpacity:o,lineDash:r,lineDashOffset:l,stroke:c,strokeOpacity:u,strokeWidth:d,xKey:g,yKey:f,sizeKey:y,labelKey:x}}=this,S=em(t??0);return this.type==="bubble"?{highlightState:S,size:i,maxSize:n,shape:s,fill:a,fillOpacity:o,lineDash:r,lineDashOffset:l,seriesId:e,sizeKey:y,stroke:c,strokeOpacity:u,strokeWidth:d,xKey:g,yKey:f,labelKey:x}:this.type==="scatter"?{highlightState:S,size:i,shape:s,fill:a,fillOpacity:o,lineDash:r,lineDashOffset:l,seriesId:e,stroke:c,strokeOpacity:u,strokeWidth:d,xKey:g,yKey:f,labelKey:x}:this.type}makeLabelFormatterParams(){const{xKey:t,xName:e,yKey:i,yName:n,sizeKey:s,sizeName:a,labelKey:o,labelName:r,legendItemName:l}=this.properties;return{xKey:t,xName:e,yKey:i,yName:n,sizeKey:s,sizeName:a,labelKey:o,labelName:r,legendItemName:l}}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,axes:s,properties:a,ctx:o}=this,{formatManager:r}=o,{xKey:l,xName:c,yKey:u,yName:d,sizeKey:g,sizeName:f,labelKey:y,labelName:x,title:S,tooltip:D,marker:A,legendItemName:I}=a,w=s[z.X],N=s[z.Y];if(!i||!n||!w||!N)return;const O=n.dataSources.get(this.id)?.data?.[t],L=i.resolveColumnById(this,"xValue",n)[t],R=i.resolveColumnById(this,"yValue",n)[t],P=this.properties.allowNullKeys??!1;if(L===void 0&&!P)return;const B=[];if(this.isLabelEnabled()&&y!=null){const H=i.resolveColumnById(this,"labelValue",n)[t],$=r.format(this.callWithContext.bind(this),{type:"category",value:H,datum:O,seriesId:e,legendItemName:I,key:y,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});B.push({label:x,fallbackLabel:y,value:$??Or(H)})}if(B.push({label:c,fallbackLabel:l,value:this.getAxisValueText(w,"tooltip",L,O,l,I,P),missing:dp(L,P)},{label:d,fallbackLabel:u,value:this.getAxisValueText(N,"tooltip",R,O,u,I,P),missing:dp(R,P)}),g!=null){const H=i.resolveColumnById(this,"sizeValue",n)[t];if(H!=null){const $=i.getDomain(this,"sizeValue","value",n).domain,Y=r.format(this.callWithContext.bind(this),{type:"number",value:H,datum:O,seriesId:e,legendItemName:I,key:g,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:$,fractionDigits:void 0,visibleDomain:void 0});B.push({label:f,fallbackLabel:g,value:Y??Or(H)})}}const F=this.getMarkerStyle(A,{datum:O,datumIndex:t},{xKey:l,yKey:u,sizeKey:g,labelKey:y},{resolveMarkerSubPath:[]});return this.formatTooltipWithContext(D,{title:S,symbol:this.legendItemSymbol(),data:B},{seriesId:e,datum:O,title:u,xKey:l,xName:c,yKey:u,yName:d,sizeKey:g,sizeName:f,labelKey:y,labelName:x,legendItemName:I,...F,...this.getModuleTooltipParams()})}legendItemSymbol(){const t=this.getStyle();return{marker:this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1,resolveMarkerSubPath:[]},t)}}getLegendData(){const{id:t,ctx:{legendManager:e},visible:i}=this,{yKey:n,yName:s,legendItemName:a,title:o,showInLegend:r}=this.properties;return[{legendType:"category",id:t,itemId:n,seriesId:t,enabled:i&&e.getItemEnabled({seriesId:t,itemId:n}),label:{text:a??o??s??n},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!r}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){Ait(this,this.ctx.animationManager,t),Wi(this,"labels",this.ctx.animationManager,e)}resetDatumAnimation(t){lA([t.datumSelection])}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new wn}getStyle(t){const{properties:e}=this;let i={};if(e.styler){const n=this.makeStylerParams(t),s=this.cachedCallWithContext(e.styler,n)??{};i=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],s,{pick:!1})??{}}return{fill:i.fill??e.fill,fillOpacity:i.fillOpacity??e.fillOpacity,lineDash:i.lineDash??e.lineDash,lineDashOffset:i.lineDashOffset??e.lineDashOffset,shape:i.shape??e.shape,size:i.size??e.size,maxSize:i.maxSize??e.maxSize,stroke:i.stroke??e.stroke,strokeOpacity:i.strokeOpacity??e.strokeOpacity,strokeWidth:i.strokeWidth??e.strokeWidth}}getSizeRange(){const{size:t,maxSize:e}=this.getStyle();return[t,e]}getFormattedMarkerStyle(t){const{xKey:e,yKey:i,sizeKey:n,labelKey:s,marker:a}=this.properties;return this.getMarkerStyle(a,t,{xKey:e,yKey:i,sizeKey:n,labelKey:s},{resolveMarkerSubPath:[]})}computeFocusBounds(t){return cA(this,t)}hasItemStylers(){const{styler:t,itemStyler:e,marker:i,label:n}=this.properties;return!!(t??e??i.itemStyler??n.itemStyler)}initQuadTree(t){aA(t,this.datumNodesIter())}pickNodeDataClosestDatum(t){return oA(this,t)}};gA.className="BubbleSeries";gA.type="bubble";var Bnt={series:{shape:"circle",size:7,maxSize:30,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Sp],["image",$s],["pattern",Cs]]},stroke:{$palette:"stroke"},fillOpacity:.8,maxRenderedItems:2e3,label:{...Oe,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:Bc}},$W={type:"series",name:"bubble",chartType:"cartesian",version:oi,dependencies:[hr],options:$3,predictAxis:dL,defaultAxes:{x:{type:ie.NUMBER,position:he.BOTTOM},y:{type:ie.NUMBER,position:he.LEFT}},axisKeys:{[z.X]:"xKeyAxis",[z.Y]:"yKeyAxis"},themeTemplate:Bnt,create:t=>new gA(t)},Rn=class extends jr{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.areaPlot=!1,this.aggregation="sum",this.shadow=new zl,this.label=new Do,this.tooltip=zp()}getStyle(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,cornerRadius:r}=this;return{fill:t,fillOpacity:e,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,cornerRadius:r,opacity:1}}};T([b],Rn.prototype,"xKey",2);T([b],Rn.prototype,"yKey",2);T([b],Rn.prototype,"xName",2);T([b],Rn.prototype,"yName",2);T([b],Rn.prototype,"fill",2);T([b],Rn.prototype,"fillOpacity",2);T([b],Rn.prototype,"stroke",2);T([b],Rn.prototype,"strokeWidth",2);T([b],Rn.prototype,"strokeOpacity",2);T([b],Rn.prototype,"lineDash",2);T([b],Rn.prototype,"lineDashOffset",2);T([b],Rn.prototype,"cornerRadius",2);T([b],Rn.prototype,"areaPlot",2);T([b],Rn.prototype,"bins",2);T([b],Rn.prototype,"aggregation",2);T([b],Rn.prototype,"binCount",2);T([b],Rn.prototype,"shadow",2);T([b],Rn.prototype,"label",2);T([b],Rn.prototype,"tooltip",2);var TV=10,jL=class extends Wu{constructor(t){super({moduleCtx:t,propertyKeys:hm,propertyNames:um,categoryKey:void 0,pickModes:[1,0],datumSelectionGarbageCollection:!0,animationAlwaysPopulateNodeData:!0,alwaysClip:!0,animationResetFns:{datum:ex,label:Pp}}),this.properties=new Rn,this.calculatedBins=[]}get hasData(){return this.calculatedBins.length>0}deriveBins(t){const e=Xf(t[0],t[1],TV).ticks,i=Mf(t[0],t[1],TV),[n]=e,s=a=>[a,a+i];return[[n-i,n],...e.map(s)]}calculateNiceBins(t,e){const i=Math.floor(t[0]),n=t[1],s=e||1,{start:a,binSize:o}=this.calculateNiceStart(i,n,s);return this.getBins(a,n,o,s)}getBins(t,e,i,n){const s=[],a=this.calculatePrecision(i);for(let o=0;o0)for(;t<1;)e*=10,t*=10;return e}calculateNiceStart(t,e,i){const n=Math.abs(e-t)/i,s=Math.floor(Math.log10(n)),a=Math.pow(10,s);return{start:Math.floor(t/a)*a,binSize:n}}async processData(t){const{visible:e}=this,{xKey:i,yKey:n,areaPlot:s,aggregation:a}=this.properties,o=this.axes[z.X]?.scale,r=this.axes[z.Y]?.scale,{xScaleType:l,yScaleType:c}=this.getScaleInformation({yScale:r,xScale:o}),u=e?{}:{forceValue:0},d=[uu(i,l),I7];if(n){let A=eB("groupAgg",{visible:e});a==="count"||(a==="sum"?A=jq("groupAgg",{visible:e}):a==="mean"&&(A=Uq("groupAgg",{visible:e}))),s&&(A=iB("groupAgg",A)),d.push(Ci(n,c,{invalidValue:void 0,...u}),A)}else{d.push(S7("count"));let A=eB("groupAgg",{visible:e});s&&(A=iB("groupAgg",A)),d.push(A)}let g=[];const f=A=>{const I=_a(A.domain.keys[0]);if(I.length===0)return A.domain.groups=[],()=>[];const w=Je(this.properties.binCount)?this.calculateNiceBins(I,this.properties.binCount):this.properties.bins??this.deriveBins(I),N=w.length;return g=[...w],O=>{let L=O[0];if(aa(L)&&(L=L.getTime()),!Je(L))return[];for(let R=0;R=P[0]&&L{const I=D.get(As(...A));if(I){const{group:w,groupIndex:N}=I,[[O,L]=[0,0]]=w.aggregation,R=[...y.forEachDatum(this,S,w,N)],P=this.frequency(w),B=O+L;return{domain:A,datum:R,groupIndex:N,frequency:P,total:B}}else return{domain:A,datum:[],groupIndex:-1,frequency:0,total:0}}),this.animationState.transition("updateData")}xCoordinateRange(){return[Number.NaN,Number.NaN]}yCoordinateRange(){return[Number.NaN,Number.NaN]}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i||!this.calculatedBins.length)return{domain:[]};const n=i.getDomain(this,"groupAgg","aggregate",e).domain,s=this.calculatedBins[0].domain[0],a=this.calculatedBins[(this.calculatedBins?.length??0)-1].domain[1];return t===z.X?{domain:_a([s,a])}:{domain:_a(n)}}getSeriesRange(t,[e,i]){const{dataModel:n,processedData:s}=this;if(!n||s?.type!=="grouped")return[Number.NaN,Number.NaN];const a=this.axes[z.X].scale,o=0;let r=-1/0;for(const{keys:l,aggregation:c}of s.groups){const[[u,d]=[0,0]]=c,[g,f]=l,[y,x]=xi([a.convert(g),a.convert(f)]);if(x>=e&&y<=i){const S=u+d;r=Math.max(r,S)}}return o>r?[Number.NaN,Number.NaN]:[o,r]}frequency(t){return t.datumIndices.reduce((e,i)=>e+i.length,0)}createNodeDatumContext(t,e){const{xKey:i,yKey:n,xName:s,yName:a,label:o}=this.properties,{contextNodeData:r,processedData:l}=this,c=r?.nodeData!=null&&l?.changeDescription!=null;return{xAxis:t,yAxis:e,xScale:t.scale,yScale:e.scale,yAxisReversed:e.isReversed(),rawData:[],xValues:[],xKey:i,yKey:n,xName:s,yName:a,label:o,animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:c,nodes:c?r.nodeData:[],nodeIndex:0}}createLabelData(t,e,i,n,s,a){const{label:o,yKey:r,xKey:l,xName:c,yName:u}=t,{total:d,datum:g}=e;if(!(!o.enabled||d===0))return{x:i+s/2,y:n+a/2,text:this.getLabelText(d,g,r,"y",[],o,{value:d,datum:g,xKey:l,yKey:r,xName:c,yName:u})}}createSkeletonNodeDatum(t,e){const{xKey:i,yKey:n}=t,{domain:s,datum:a,groupIndex:o,frequency:r,total:l}=e;return{series:this,datumIndex:o,datum:a,aggregatedValue:l,frequency:r,domain:s,yKey:n,xKey:i,x:0,y:0,xValue:0,yValue:0,width:0,height:0,midPoint:{x:0,y:0},topLeftCornerRadius:!1,topRightCornerRadius:!1,bottomRightCornerRadius:!1,bottomLeftCornerRadius:!1,label:void 0,crisp:!0}}updateNodeDatum(t,e,i){const{xScale:n,yScale:s,yAxisReversed:a}=t,{domain:o,datum:r,groupIndex:l,frequency:c,total:u}=i,d=e,[g,f]=o,y=n.convert(g),x=n.convert(f),S=s.convert(0),D=s.convert(u),A=Math.abs(x-y),I=Math.abs(D-S),w=Math.min(y,x),N=Math.min(S,D);d.datumIndex=l,d.datum=r,d.aggregatedValue=u,d.frequency=c,d.domain=o,d.x=w,d.y=N,d.xValue=y,d.yValue=D,d.width=A,d.height=I,d.midPoint?(d.midPoint.x=w+A/2,d.midPoint.y=N+I/2):d.midPoint={x:w+A/2,y:N+I/2},d.topLeftCornerRadius=!a,d.topRightCornerRadius=!a,d.bottomRightCornerRadius=a,d.bottomLeftCornerRadius=a,d.label=this.createLabelData(t,i,w,N,A,I)}createNodeDatum(t,e){const i=this.createSkeletonNodeDatum(t,e);return this.updateNodeDatum(t,i,e),i}populateNodeData(t){const{processedData:e}=this;if(e?.type==="grouped")for(const i of this.calculatedBins)ML(t,i,(n,s)=>this.createNodeDatum(n,s),(n,s,a)=>this.updateNodeDatum(n,s,a))}initializeResult(t){return{itemId:this.properties.yKey??this.id,nodeData:t.nodes,labelData:t.nodes,scales:this.calculateScaling(),animationValid:!0,visible:this.visible||t.animationEnabled,styles:YT(this.getItemStyle.bind(this))}}finalizeNodeData(t){super.finalizeNodeData(t),t.nodes.sort((e,i)=>e.x-i.x)}nodeFactory(){return new On}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t;return rr(this.processedData)?i.update(e,void 0,n=>As(...n.domain)):i.update(e)}getItemStyle(t,e,i){const{properties:n}=this,s=this.getHighlightStyle(e,t,i);return Et(s,n.getStyle())}updateDatumStyles(t){const{datumSelection:e,isHighlight:i}=t;e.each((n,s)=>{e.isGarbage(n)||(s.style=this.getItemStyle(s.datumIndex,i))})}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const i=this.ctx.highlightManager.getActiveHighlight(),{shadow:n}=this.properties,s=this.getShapeFillBBox();t.datumSelection.each((a,o)=>{const r=o.style??e.styles[this.getHighlightState(i,t.isHighlight,o.datumIndex)],{cornerRadius:l=0}=r,{topLeftCornerRadius:c,topRightCornerRadius:u,bottomRightCornerRadius:d,bottomLeftCornerRadius:g}=o;a.setStyleProperties(r,s),a.topLeftCornerRadius=c?l:0,a.topRightCornerRadius=u?l:0,a.bottomRightCornerRadius=d?l:0,a.bottomLeftCornerRadius=g?l:0,a.crisp=o.crisp,a.fillShadow=n})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e,n=>{n.pointerEvents=1,n.textAlign="center",n.textBaseline="middle"})}updateLabelNodes(t){const e=this.isLabelEnabled(),{isHighlight:i=!1}=t,n=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((s,a)=>{const o=Rp(this,a,this.properties,this.properties.label,i,n),{enabled:r,fontStyle:l,fontWeight:c,fontSize:u,fontFamily:d,color:g}=o;r&&e&&a?.label?(s.text=a.label.text,s.x=a.label.x,s.y=a.label.y,s.fontStyle=l,s.fontWeight=c,s.fontFamily=d,s.fontSize=u,s.fill=g,s.visible=!0,s.fillOpacity=this.getHighlightStyle(i,a.datumIndex).opacity??1,s.setBoxing(o)):s.visible=!1})}initQuadTree(t){const{value:e}=this.contentGroup.children().next();e instanceof ee&&aA(t,e.children())}pickNodeClosestDatum(t){return oA(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,axes:s,properties:a,ctx:{localeManager:o}}=this,{xKey:r,xName:l,yKey:c,yName:u,tooltip:d,legendItemName:g}=a,f=s[z.X],y=s[z.Y];if(!i||n?.type!=="grouped"||!f||!y)return;const x=n.groups[t],{aggregation:S,keys:D}=x,[[A,I]=[0,0]]=S,w=this.frequency(x),N=D,[O,L]=N,R=A+I,P={data:[...i.forEachDatum(this,n,x,t)],aggregatedValue:R,frequency:w,domain:N},B=[{label:l,fallbackLabel:r,value:`${this.getAxisValueText(f,"tooltip",O,P,r,g)} - ${this.getAxisValueText(f,"tooltip",L,P,r,g)}`},{label:o.t("seriesHistogramTooltipFrequency"),value:this.getAxisValueText(y,"tooltip",w,P,c,g)}];if(c!=null){let F;switch(a.aggregation){case"sum":F=o.t("seriesHistogramTooltipSum",{yName:u??c});break;case"mean":F=o.t("seriesHistogramTooltipMean",{yName:u??c});break;case"count":F=o.t("seriesHistogramTooltipCount",{yName:u??c});break}B.push({label:F,value:this.getAxisValueText(y,"tooltip",R,P,c,g)})}return this.formatTooltipWithContext(d,{symbol:this.legendItemSymbol(),data:B},{seriesId:e,datum:P,title:u,xKey:r,xName:l,yKey:c,yName:u,xRange:[O,L],frequency:w,...this.getItemStyle(t,!1)})}legendItemSymbol(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o}=this.properties;return{marker:{fill:le(t)??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:e,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:o}}}getLegendData(t){if(t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:n}=this,{xKey:s,yName:a,showInLegend:o}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:n&&i.getItemEnabled({seriesId:e,itemId:s}),label:{text:a??s??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!o}]}resetDatumAnimation(t){LM([t.datumSelection])}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){const i=tx(Jb(!0,this.axes,"normal"),"unknown");dn(this.id,"datums",this.ctx.animationManager,[t],i),Wi(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(t){const e=tx(Jb(!0,this.axes,"normal"),"added"),i={changed:!0,added:new Set,removed:new Set};dn(this.id,"datums",this.ctx.animationManager,[t.datumSelection],e,(n,s)=>As(...s.domain),i),i?.changed&&Wi(this,"labels",this.ctx.animationManager,t.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){return SL(this,this.contextNodeData?.nodeData[t])}hasItemStylers(){return this.properties.label.itemStyler!=null}};jL.className="HistogramSeries";jL.type="histogram";var Vnt={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Tl],["image",$s],["pattern",Cs]]},stroke:{$palette:"stroke"},strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{...Oe,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},shadow:{enabled:!1,color:Dp,xOffset:3,yOffset:3,blur:5},highlight:Bc}},XW={type:"series",name:"histogram",chartType:"cartesian",version:oi,dependencies:[hr],options:ftt,predictAxis:Zx,defaultAxes:{x:{type:ie.NUMBER,position:he.BOTTOM},y:{type:ie.NUMBER,position:he.LEFT}},axisKeys:{[z.X]:"xKeyAxis",[z.Y]:"yKeyAxis"},themeTemplate:Vnt,create:t=>new jL(t)},_nt=10;function zM(t,e,i,n,s,a,o,r){const l=t[a];if(l===void 0)return!1;const c=Number.isFinite(e)?ar(l,e,i,o):xf(a,r),u=yD(c,s);return a===n[u+Ca]||a===n[u+wa]||a===n[u+Na]||a===n[u+Ta]}function ZW(t,e,i,n,s,a,o,r){let l=0;for(let d=0;dS.maxRange===u);let{indexData:g,valueData:f}=Fc(e,i,i,a,o,u,{xNeedsValueOf:r,yNeedsValueOf:l,reuseIndexData:d?.indexData,reuseValueData:d?.valueData}),y=ZW(e,a,o,g,u,r,s,d?.indices);const x=[{maxRange:u,indices:y,indexData:g,valueData:f}];for(;y.length>_nt&&u>64;){const S=u,D=Math.trunc(S/2),A=c?.find(w=>w.maxRange===D),I=ap(g,f,S,{reuseIndexData:A?.indexData,reuseValueData:A?.valueData});u=I.maxRange,g=I.indexData,f=I.valueData,y=Fnt(y,e,a,o,g,u,r,s,A?.indices),x.push({maxRange:u,indices:y,indexData:g,valueData:f})}return x.reverse(),x}function Hnt(t,e,i,n){const s=e.length;if(sI.maxRange===g),{indexData:y,valueData:x}=Fc(e,i,i,a,o,g,{xNeedsValueOf:r,yNeedsValueOf:l,reuseIndexData:f?.indexData,reuseValueData:f?.valueData}),S=ZW(e,a,o,y,g,r,s,f?.indices),D={maxRange:g,indices:S,indexData:y,valueData:x};function A(){return GL([a,o],e,i,{xNeedsValueOf:r,yNeedsValueOf:l,existingFilters:u})?.filter(w=>w.maxRange!==g)??[]}return{immediate:[D],computeRemaining:A}}function jnt(t,e,i,n,s,a){const[o,r]=gn(t,n);return GL([o,r],e,i,{xNeedsValueOf:s,yNeedsValueOf:a})}var Gnt=Pu(jnt);function Unt(t,e,i,n,s,a){const o=e.resolveColumnById(s,"xValue",i),r=e.resolveColumnById(s,n,i),l=e.getDomain(s,"xValue","value",i),c=e.resolveColumnNeedsValueOf(s,"xValue",i),u=e.resolveColumnNeedsValueOf(s,n,i);if(a){const[d,g]=gn(t,l);return GL([d,g],o,r,{xNeedsValueOf:c,yNeedsValueOf:u,existingFilters:a})}return Gnt(t,o,r,l,c,u)}function Wnt(t,e,i,n,s,a,o){const r=e.resolveColumnById(s,"xValue",i),l=e.resolveColumnById(s,n,i),c=e.getDomain(s,"xValue","value",i),u=e.resolveColumnNeedsValueOf(s,"xValue",i),d=e.resolveColumnNeedsValueOf(s,n,i),[g,f]=gn(t,c);return Hnt([g,f],r,l,{xNeedsValueOf:u,yNeedsValueOf:d,targetRange:a,existingFilters:o})}var mn=class extends jr{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new Mp,this.marker=new la,this.label=new Do,this.tooltip=zp(),this.connectMissingData=!1,this.sparklineMode=!1}};T([b],mn.prototype,"xKey",2);T([b],mn.prototype,"yKey",2);T([b],mn.prototype,"xName",2);T([b],mn.prototype,"yName",2);T([b],mn.prototype,"selectedKey",2);T([b],mn.prototype,"stackGroup",2);T([b],mn.prototype,"normalizedTo",2);T([b],mn.prototype,"title",2);T([b],mn.prototype,"stroke",2);T([b],mn.prototype,"strokeWidth",2);T([b],mn.prototype,"strokeOpacity",2);T([b],mn.prototype,"lineDash",2);T([b],mn.prototype,"lineDashOffset",2);T([b],mn.prototype,"interpolation",2);T([b],mn.prototype,"styler",2);T([b],mn.prototype,"marker",2);T([b],mn.prototype,"label",2);T([b],mn.prototype,"tooltip",2);T([b],mn.prototype,"connectMissingData",2);T([b],mn.prototype,"sparklineMode",2);var UL=class extends Wu{constructor(t){super({moduleCtx:t,propertyKeys:hm,propertyNames:um,categoryKey:"xValue",pickModes:[2,1,0],datumSelectionGarbageCollection:!1,segmentedDataNodes:!1,animationResetFns:{path:kL({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Pp,datum:(e,i)=>({...rA(),...nx(e,i)})},clipFocusBox:!1}),this.properties=new mn,this.aggregationManager=new dA}get pickModeAxis(){return this.properties.sparklineMode?"main":"main-category"}isNormalized(){return this.properties.normalizedTo!=null}renderToOffscreenCanvas(){return(this.contextNodeData?.nodeData?.length??0)>0&&this.getDrawingMode(!1)==="cutout"||super.renderToOffscreenCanvas()}async processData(t){if(this.data==null)return;const{data:e,visible:i,seriesGrouping:{groupIndex:n=this.id,stackCount:s=0}={}}=this,{xKey:a,yKey:o,selectedKey:r,connectMissingData:l,normalizedTo:c}=this.properties,u=this.axes[z.X]?.scale,d=this.axes[z.Y]?.scale,{isContinuousX:g,xScaleType:f,yScaleType:y}=this.getScaleInformation({xScale:u,yScale:d}),x=s>1||c!=null,S={invalidValue:null};l&&x&&(S.invalidValue=0),x&&!i&&(S.forceValue=0);const D={value:`area-stack-${n}-yValue`,marker:`area-stack-${n}-yValues-marker`},A=[],I=this.properties.allowNullKeys??!1;(!g||x)&&A.push(uu(a,f,{id:"xKey",allowNullKey:I})),A.push(Ci(a,f,{id:"xValue",allowNullKey:I}),Ci(o,y,{id:"yValueRaw",...S,invalidValue:void 0})),r!=null&&A.push(Ci(r,"category",{id:"selectedRaw"})),x&&A.push(...Wd(o,"normal",{id:"yValueCumulative",...S,groupId:D.marker},y)),go(c)&&A.push(Ci(o,y,{id:"yValue",...S,groupId:D.value}),jD(Object.values(D),c)),this.needsDataModelDiff()&&(A.push(Hx(g?["xValue"]:void 0)),this.processedData&&A.push(GD(this.id,this.processedData)));const{dataModel:w,processedData:N}=await this.requestDataModel(t,e,{props:A,groupByKeys:x,groupByData:!x});this.aggregateData(w,N),this.animationState.transition("updateData")}yValueKey(){return this.isNormalized()?"yValue":"yValueRaw"}yCumulativeKey(t){return t.type==="grouped"?"yValueCumulative":this.yValueKey()}xCoordinateRange(t,e){const{marker:i}=this.properties,n=this.axes[z.X].scale.convert(t),s=i.enabled?.5*i.size*e:0;return[n-s,n+s]}yCoordinateRange(t,e){const{marker:i}=this.properties,n=this.axes[z.Y].scale.convert(t[0]),s=i.enabled?.5*i.size*e:0;return[n-s,n+s]}getSeriesDomain(t){const{dataModel:e,processedData:i,axes:n}=this;if(!e||!i)return{domain:[]};const s=n[z.Y];if(t===z.X){const o=e.resolveProcessedDataDefById(this,"xValue"),r=e.getDomain(this,"xValue","value",i);if(o?.def.type==="value"&&o.def.valueType==="category"){const l=e.getKeySortMetadata(this,"xValue",i);return{domain:r.domain,sortMetadata:l}}return{domain:_a(Ll(r.domain))}}const a=this.domainForClippedRange(z.Y,[this.yCumulativeKey(i)],"xValue");if(this.isNormalized()&&s instanceof Ao&&!(s instanceof fm)){const o=Number.isFinite(a[1]-a[0])?[Math.min(a[0],0),Math.max(a[1],0)]:[];return{domain:_a(o)}}else return{domain:_a(a)}}getSeriesRange(t,e){return this.domainForVisibleRange(z.Y,[this.yCumulativeKey(this.processedData)],"xValue",e)}getZoomRangeFittingItems(t,e,i){return this.zoomFittingVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],t,e,i)}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],t,e,i)}aggregateData(t,e){if(this.aggregationManager.markStale(e.input.count),e.type!=="ungrouped"||rr(e))return;const i=this.axes[z.X];if(i==null)return;const n=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>Wnt(i.scale.type,t,e,this.yCumulativeKey(e),this,n,a),computeFull:a=>Unt(i.scale.type,t,e,this.yCumulativeKey(e),this,a),targetRange:n});const s=this.aggregationManager.filters;s&&s.length>0&&Vr.record(`${this.type}:aggregation`,s.map(a=>a.maxRange))}estimateTargetRange(){const t=this.axes[z.X];if(t?.scale?.range){const[e,i]=t.scale.range;return Math.abs(i-e)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(t,e){const{dataModel:i,processedData:n}=this;if(!i||!n)return;const s=t.scale,a=e.scale,o=n.dataSources.get(this.id)?.data??[],[r,l]=s.range,c=Math.abs(l-r);this.aggregationManager.ensureLevelForRange(c);const u=this.aggregationManager.getFilterForRange(c),d=this.canIncrementallyUpdateNodes(u!=null);return{xAxis:t,yAxis:e,rawData:o,xValues:i.resolveColumnById(this,"xValue",n),yRawValues:i.resolveColumnById(this,"yValueRaw",n),yCumulativeValues:i.resolveColumnById(this,this.yCumulativeKey(n),n),selectionValues:this.properties.selectedKey?i.resolveColumnById(this,"selectedRaw",n):void 0,xScale:s,yScale:a,xOffset:(s.bandwidth??0)/2,yOffset:(a.bandwidth??0)/2,size:this.properties.marker.enabled?this.properties.marker.size:0,yDomain:this.getSeriesDomain(z.Y).domain,labelsEnabled:this.properties.label.enabled,animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:d,dataAggregationFilter:u,range:c,xKey:this.properties.xKey,yKey:this.properties.yKey,xName:this.properties.xName,yName:this.properties.yName,legendItemName:this.properties.legendItemName,connectMissingData:this.properties.connectMissingData,capDefaults:{lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},nodes:d?this.contextNodeData.nodeData:[],spanPoints:[],nodeIndex:0}}handleDatum(t,e,i){if(e.datum=t.rawData[i],e.xDatum=t.xValues[i],e.yDatum=t.yRawValues[i],e.yCumulative=t.yCumulativeValues[i],e.selected=t.selectionValues?.[i],e.x=t.xScale.convert(e.xDatum)+t.xOffset,e.y=t.yScale.convert(e.yCumulative)+t.yOffset,!!Number.isFinite(e.x)){if(e.yDatum!=null){const n=t.labelsEnabled?this.getLabelText(e.yDatum,e.datum,t.yKey,"y",t.yDomain,this.properties.label,{value:e.yDatum,datum:e.datum,xKey:t.xKey,yKey:t.yKey,xName:t.xName,yName:t.yName,legendItemName:t.legendItemName}):void 0;if(t.canIncrementallyUpdate&&t.nodeIndexArray.isArray(n)?Cb(n,this.properties.interpolation):[]);return e.strokeData={itemId:t.yKey,spans:i},e.crossFiltering=this.properties.selectedKey!=null,e.segments=nA(this.properties.segmentation,t.xAxis,t.yAxis,this.chart.seriesRect,this.ctx.scene,!1),e}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{paths:[e],visible:i,animationEnabled:n}=t,s=Et(this.getHighlightStyle(),this.getStyle()),{strokeWidth:a,stroke:o,strokeOpacity:r,lineDash:l,lineDashOffset:c,opacity:u}=s,d=this.contextNodeData?.segments;e.setProperties({segments:d,fill:void 0,lineJoin:"round",pointerEvents:1,opacity:u,stroke:o,strokeWidth:a,strokeOpacity:r,lineDash:l,lineDashOffset:c}),e.datum=d,n||(e.visible=i),OM(this,e)}updateDatumSelection(t){let{nodeData:e}=t;const{datumSelection:i}=t,{contextNodeData:n,processedData:s,axes:a,properties:o}=this,{marker:r}=o;return e=n?.crossFiltering===!0||AL(s.input.count,a[z.X].scale,r)?e:[],r.isDirty()&&(i.clear(),i.cleanup()),rr(this.processedData)?i.update(e,void 0,c=>As(c.xValue)):i.update(e)}updateDatumStyles(t){const{datumSelection:e,isHighlight:i}=t,{marker:n}=this.properties,s=this.ctx.highlightManager.getActiveHighlight();e.each((a,o)=>{if(!e.isGarbage(a)){const r=this.getHighlightState(s,t.isHighlight,o.datumIndex),l=this.getStyle(r),{stroke:c,strokeWidth:u,strokeOpacity:d}=l,g=this.makeItemStylerParams(this.dataModel,this.processedData,o.datumIndex,l.marker);o.style=this.getMarkerStyle(n,o,g,{isHighlight:i,highlightState:r},l.marker,{stroke:c,strokeWidth:u,strokeOpacity:d})}})}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const{datumSelection:i,isHighlight:n}=t,s=this.ctx.animationManager.isSkipped(),a=this.getShapeFillBBox(),o=this.ctx.highlightManager.getActiveHighlight(),r=this.getDrawingMode(n,t.drawingMode);i.each((l,c)=>{const u=this.getHighlightState(o,n,c.datumIndex),d=c.style??e.styles[u];this.applyMarkerStyle(d,l,c.point,a,{applyTranslation:s,selected:c.selected}),l.drawingMode=this.resolveMarkerDrawingModeForState(r,d)}),n||this.properties.marker.markClean()}updateLabelSelection(t){return t.labelSelection.update(this.isLabelEnabled()?t.labelData:[])}updateLabelNodes(t){const{isHighlight:e=!1}=t,i=this.ctx.highlightManager?.getActiveHighlight(),n=this.makeLabelFormatterParams();t.labelSelection.each((s,a)=>{const o=Rp(this,a,n,this.properties.label,e,i),{enabled:r,fontStyle:l,fontWeight:c,fontSize:u,fontFamily:d,color:g}=o;r&&a?.labelText?(s.fontStyle=l,s.fontWeight=c,s.fontSize=u,s.fontFamily=d,s.textAlign="center",s.textBaseline="bottom",s.text=a.labelText,s.x=a.point.x,s.y=a.point.y-10,s.fill=g,s.visible=!0,s.fillOpacity=this.getHighlightStyle(e,a.datumIndex).opacity??1,s.setBoxing(o)):s.visible=!1})}makeStylerParams(t){const{id:e}=this,{marker:i,lineDash:n,lineDashOffset:s,stroke:a,strokeOpacity:o,strokeWidth:r,xKey:l,yKey:c}=this.properties,u=em(t??0);return{marker:{fill:i.fill,fillOpacity:i.fillOpacity,size:i.size,shape:i.shape,stroke:i.stroke,strokeOpacity:i.strokeOpacity,strokeWidth:i.strokeWidth,lineDash:i.lineDash,lineDashOffset:i.lineDashOffset},highlightState:u,lineDash:n,lineDashOffset:s,seriesId:e,stroke:a,strokeOpacity:o,strokeWidth:r,xKey:l,yKey:c}}makeItemStylerParams(t,e,i,n){const{xKey:s,yKey:a}=this.properties,o=t.resolveColumnById(this,"xValue",e)[i],r=t.resolveColumnById(this,"yValueRaw",e)[i],l=t.getDomain(this,"xValue","key",e).domain,c=t.getDomain(this,this.yCumulativeKey(e),"value",e).domain,u=this.filterItemStylerFillParams(n.fill)??n.fill;return{...WT(o,r,s,a,l,c),xValue:o,yValue:r,...n,fill:u}}makeLabelFormatterParams(){const{xKey:t,xName:e,yKey:i,yName:n,legendItemName:s}=this.properties;return{xKey:t,xName:e,yKey:i,yName:n,legendItemName:s}}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,axes:s,properties:a}=this,{xKey:o,xName:r,yKey:l,yName:c,tooltip:u,legendItemName:d}=a,g=a.allowNullKeys??!1,f=s[z.X],y=s[z.Y];if(!i||!n||!f||!y)return;const x=n.dataSources.get(this.id)?.data?.[t],S=i.resolveColumnById(this,"xValue",n)[t],D=i.resolveColumnById(this,"yValueRaw",n)[t];if(S===void 0&&!g)return;const A=this.getStyle(),I=this.makeItemStylerParams(i,n,t,A.marker),w=this.getMarkerStyle(this.properties.marker,{datumIndex:t,datum:x},I,{isHighlight:!1},A.marker);return this.formatTooltipWithContext(u,{heading:this.getAxisValueText(f,"tooltip",S,x,o,d,g),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(y,"tooltip",D,x,l,d),missing:dp(D)}]},{seriesId:e,datum:x,title:c,xKey:o,xName:r,yKey:l,yName:c,...w,...this.getModuleTooltipParams()})}legendItemSymbol(){const{stroke:t,strokeOpacity:e,strokeWidth:i,lineDash:n,marker:s}=this.getStyle();return{marker:{...this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1},{size:s.size,shape:s.shape,fill:s.fill,fillOpacity:s.fillOpacity,stroke:s.stroke,strokeOpacity:s.strokeOpacity,strokeWidth:s.strokeWidth,lineDash:s.lineDash,lineDashOffset:s.lineDashOffset}),enabled:this.properties.marker.enabled},line:{enabled:!0,stroke:t,strokeOpacity:e,strokeWidth:i,lineDash:n}}}getLegendData(t){if(t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:n}=this,{yKey:s,yName:a,title:o,legendItemName:r,showInLegend:l}=this.properties;return[{legendType:t,id:e,itemId:s,legendItemName:r,seriesId:e,enabled:n&&i.getItemEnabled({seriesId:e,itemId:s}),label:{text:r??o??a??s},symbol:this.legendItemSymbol(),hideInLegend:!l}]}updatePaths(t){this.updateLinePaths(t.paths,t.contextData)}updateLinePaths(t,e){const i=e.strokeData.spans,[n]=t;n.path.clear(),xL(n,i),n.markDirty("LineSeries")}resetDatumAnimation(t){lA([t.datumSelection])}animateEmptyUpdateReady(t){const{datumSelection:e,labelSelection:i,annotationSelections:n,contextData:s,paths:a}=t,{animationManager:o}=this.ctx;this.updateLinePaths(a,s),IL(this,o,...a),Qn([e],nx),DL(this,o,{...this.getAnimationDrawingModes(),phase:"initial"},e),Wi(this,"labels",o,i),Wi(this,"annotations",o,...n)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateLinePaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){const{animationManager:e}=this.ctx,{datumSelection:i,labelSelection:n,annotationSelections:s,contextData:a,paths:o,previousContextData:r}=t,[l]=o;if(a.visible===!1&&r?.visible===!1)return;this.resetDatumAnimation(t),this.resetLabelAnimation(t);const c=()=>{this.resetPathAnimation(t),this.updateLinePaths(o,a)},u=()=>{e.skipCurrentBatch(),c()};if(a==null||r==null){c(),ix(this,e,"added",this.getAnimationDrawingModes(),i),Uc(this.id,"path_properties",e,[l],{opacity:0},{opacity:this.getOpacity()},{phase:"add"}),Wi(this,"labels",e,n),Wi(this,"annotations",e,...s);return}if(a.crossFiltering!==r.crossFiltering){u();return}const d=xit(a,r,this.processedData?.reduced?.diff?.[this.id],this.getOpacity());if(d===void 0){u();return}else if(d.status==="no-op")return;dn(this.id,"path_properties",e,[l],d.stroke.pathProperties),d.status==="added"?this.updateLinePaths(o,a):d.status==="removed"?this.updateLinePaths(o,r):EM(this.id,"path_update",e,[l],d.stroke.path),d.hasMotion&&(ix(this,e,void 0,this.getAnimationDrawingModes(),i),Wi(this,"labels",e,n),Wi(this,"annotations",e,...s)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateLinePaths(o,a)})}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new wn}getStyle(t){const{styler:e,marker:i,lineDash:n,lineDashOffset:s,stroke:a,strokeOpacity:o,strokeWidth:r}=this.properties,{size:l,shape:c,fill:u="transparent",fillOpacity:d}=i;let g={};if(e){const f=this.makeStylerParams(t),y=this.cachedCallWithContext(e,f)??{};g=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],y,{pick:!1})??{}}return g.marker??(g.marker={}),{lineDash:g.lineDash??n,lineDashOffset:g.lineDashOffset??s,stroke:g.stroke??a,strokeOpacity:g.strokeOpacity??o,strokeWidth:g.strokeWidth??r,marker:{fill:g.marker.fill??u,fillOpacity:g.marker.fillOpacity??d,shape:g.marker.shape??c,size:g.marker.size??l,lineDash:g.marker.lineDash??i.lineDash??n,lineDashOffset:g.marker.lineDashOffset??i.lineDashOffset??s,stroke:g.marker.stroke??i.stroke??a,strokeOpacity:g.marker.strokeOpacity??i.strokeOpacity??o,strokeWidth:g.marker.strokeWidth??i.strokeWidth??r}}}getFormattedMarkerStyle(t){const e=this.getStyle(),i=this.makeItemStylerParams(this.dataModel,this.processedData,t.datumIndex,e.marker);return this.getMarkerStyle(this.properties.marker,t,i,{isHighlight:!0},void 0,e)}computeFocusBounds(t){return cA(this,t)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};UL.className="LineSeries";UL.type="line";var Knt={series:{stroke:bx,strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,interpolation:{type:"linear"},marker:{shape:"circle",size:7,strokeWidth:{$isUserOption:["./stroke",1,0]},fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Sp],["image",$s],["pattern",Cs]]},stroke:{$palette:"stroke"}},label:{...Oe,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:fD,segmentation:mD}},qW={type:"series",name:"line",chartType:"cartesian",stackable:!0,version:oi,dependencies:[hr],options:$x,predictAxis:Zx,defaultAxes:{y:{type:ie.NUMBER,position:he.LEFT},x:{type:ie.CATEGORY,position:he.BOTTOM}},axisKeys:{[z.X]:"xKeyAxis",[z.Y]:"yKeyAxis"},themeTemplate:Knt,create:t=>new UL(t)},WL=class extends gA{};WL.className="ScatterSeries";WL.type="scatter";var Ynt={series:{shape:"circle",size:7,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Sp],["image",$s],["pattern",Cs]]},stroke:{$palette:"stroke"},fillOpacity:.8,maxRenderedItems:2e3,label:{...Oe,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:Bc}},QW={type:"series",name:"scatter",chartType:"cartesian",version:oi,dependencies:[hr],options:Q3,predictAxis:dL,defaultAxes:{x:{type:ie.NUMBER,position:he.BOTTOM},y:{type:ie.NUMBER,position:he.LEFT}},axisKeys:{[z.X]:"xKeyAxis",[z.Y]:"yKeyAxis"},themeTemplate:Ynt,create:t=>new WL(t)},JW=class extends Ri{constructor(){super(...arguments),this.showInLegend=!1}};T([b],JW.prototype,"showInLegend",2);var KL=class extends Do{constructor(){super(...arguments),this.spacing=2}set(t,e){return super.set(t)}};T([b],KL.prototype,"text",2);T([b],KL.prototype,"spacing",2);var YL=class extends xt{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};T([b],YL.prototype,"fill",2);T([b],YL.prototype,"fillOpacity",2);var mm=class extends Do{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};T([b],mm.prototype,"offset",2);T([b],mm.prototype,"minAngle",2);T([b],mm.prototype,"minSpacing",2);T([b],mm.prototype,"maxCollisionOffset",2);T([b],mm.prototype,"avoidCollisions",2);var $L=class extends Do{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};T([b],$L.prototype,"positionOffset",2);T([b],$L.prototype,"positionRatio",2);var ev=class extends xt{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};T([b],ev.prototype,"colors",2);T([b],ev.prototype,"length",2);T([b],ev.prototype,"strokeWidth",2);T([b],ev.prototype,"itemStyler",2);var me=class extends Fr{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(un),this.strokes=Object.values(pc),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=0,this.hideZeroValueSectorsInLegend=!1,this.innerLabels=new ss(KL),this.title=new JW,this.innerCircle=new YL,this.shadow=new zl,this.calloutLabel=new mm,this.sectorLabel=new $L,this.calloutLine=new ev,this.tooltip=zp()}};T([b],me.prototype,"angleKey",2);T([b],me.prototype,"angleName",2);T([b],me.prototype,"angleFilterKey",2);T([b],me.prototype,"radiusKey",2);T([b],me.prototype,"radiusName",2);T([b],me.prototype,"radiusMin",2);T([b],me.prototype,"radiusMax",2);T([b],me.prototype,"calloutLabelKey",2);T([b],me.prototype,"calloutLabelName",2);T([b],me.prototype,"sectorLabelKey",2);T([b],me.prototype,"sectorLabelName",2);T([b],me.prototype,"legendItemKey",2);T([b],me.prototype,"defaultColorRange",2);T([b],me.prototype,"defaultPatternFills",2);T([b],me.prototype,"fills",2);T([b],me.prototype,"strokes",2);T([b],me.prototype,"fillOpacity",2);T([b],me.prototype,"strokeOpacity",2);T([b],me.prototype,"lineDash",2);T([b],me.prototype,"lineDashOffset",2);T([b],me.prototype,"cornerRadius",2);T([b],me.prototype,"itemStyler",2);T([b],me.prototype,"rotation",2);T([b],me.prototype,"outerRadiusOffset",2);T([b],me.prototype,"outerRadiusRatio",2);T([b],me.prototype,"innerRadiusOffset",2);T([b],me.prototype,"innerRadiusRatio",2);T([b],me.prototype,"strokeWidth",2);T([b],me.prototype,"sectorSpacing",2);T([b],me.prototype,"hideZeroValueSectorsInLegend",2);T([b],me.prototype,"innerLabels",2);T([b],me.prototype,"title",2);T([b],me.prototype,"innerCircle",2);T([b],me.prototype,"shadow",2);T([b],me.prototype,"calloutLabel",2);T([b],me.prototype,"sectorLabel",2);T([b],me.prototype,"calloutLine",2);T([b],me.prototype,"tooltip",2);function JC(t,e,i,n){const s=[i.convert(0),i.convert(1)],a=[n.convert(0),n.convert(1)],o=Math.PI/-2+Ze(e),r=t?"initial":"update",l=({radius:y})=>({innerRadius:s[0],outerRadius:s[0]+(s[1]-s[0])*y}),c=({radius:y})=>({innerRadius:a[0],outerRadius:a[0]+(a[1]-a[0])*y});return{nodes:{toFn:(y,x,S,{prevLive:D})=>{let{startAngle:A,endAngle:I,innerRadius:w,outerRadius:N}=x;const{stroke:O,fill:L}=x.sectorFormat;if(S==="removed"&&D?(A=D.datum?.endAngle,I=D.datum?.endAngle):S==="removed"&&!D&&(A=o,I=o),S==="removed"){const P=l(x);w=P.innerRadius,N=P.outerRadius}return{startAngle:A,endAngle:I,outerRadius:N,innerRadius:w,stroke:O,...typeof L=="string"?{fill:L}:{}}},fromFn:(y,x,S,{prevFromProps:D})=>{let{startAngle:A,endAngle:I,innerRadius:w,outerRadius:N}=y,{fill:O,stroke:L}=x.sectorFormat;if(S==="updated"&&y.previousDatum==null&&(S="added"),S==="unknown"||S==="added"&&!D?(A=o,I=o,w=x.innerRadius,N=x.outerRadius):S==="added"&&D&&(A=D.endAngle??o,I=D.endAngle??o,w=D.innerRadius??x.innerRadius,N=D.outerRadius??x.outerRadius),S==="added"&&!t){const P=c(x);w=P.innerRadius,N=P.outerRadius}return S==="updated"&&(O=y.fill??O,L=(typeof y.stroke=="string"?y.stroke:void 0)??L),{startAngle:A,endAngle:I,innerRadius:w,outerRadius:N,stroke:L,phase:r,...typeof O=="string"?{fill:O}:{}}}},innerCircle:{fromFn:(y,x)=>({size:y.previousDatum?.radius??y.size??0,phase:r}),toFn:(y,x)=>({size:x.radius??0})}}}function $nt(t,e){return{startAngle:e.startAngle,endAngle:e.endAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,stroke:e.sectorFormat.stroke}}function Xnt(t,e){const i=e.y-t.centerY,n=e.x-t.centerX,s=Math.atan2(i,n),a=t.getItemNodes();for(const o of a)if(o.datum.missing!==!0&&Ba(s,o.startAngle,o.endAngle)){const r=Math.hypot(n,i);let l=0;return ro.outerRadius&&(l=r-o.outerRadius),{datum:o.datum,distance:l}}}var Znt=class extends qD{constructor(t,e,i,n){super(t,e,i,n),this.angleKey=n.properties.angleKey,this.radiusKey=n.properties.radiusKey,this.calloutLabelKey=n.properties.calloutLabelKey,this.sectorLabelKey=n.properties.sectorLabelKey}},fA=class extends CL{constructor(t){super({moduleCtx:t,categoryKey:void 0,propertyKeys:{...SW,sectorLabel:["sectorLabelKey"],calloutLabel:["calloutLabelKey"]},propertyNames:{...MW,sectorLabel:["sectorLabelName"],calloutLabel:["calloutLabelName"]},pickModes:[1,0],animationResetFns:{item:$nt,label:Pp}}),this.properties=new me,this.phantomNodeData=void 0,this.backgroundGroup=new Ds({name:`${this.id}-background`,zIndex:gl.BACKGROUND}),this.noVisibleData=!1,this.previousRadiusScale=new np,this.radiusScale=new np,this.phantomGroup=this.contentGroup.appendChild(new ee({name:"phantom",zIndex:-1})),this.phantomSelection=pn.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.phantomHighlightGroup=this.highlightGroup.appendChild(new ee({name:"phantom",zIndex:-1})),this.phantomHighlightSelection=pn.select(this.phantomHighlightGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new ee({name:"pieCalloutLabels"})),this.calloutLabelSelection=new pn(this.calloutLabelGroup,ee),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new ee({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new wn({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new wn({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new ee({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new ee({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=pn.select(this.innerLabelsGroup,Pa),this.innerCircleSelection=pn.select(this.innerCircleGroup,()=>new wn({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=Znt,this.angleScale=new np,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2),this.phantomGroup.opacity=.2,this.phantomHighlightGroup.opacity=.2,this.innerLabelsGroup.pointerEvents=1}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(t,e,i){super.attachSeries(t,e,i),t?.appendChild(this.backgroundGroup)}detachSeries(t,e,i){super.detachSeries(t,e,i),this.backgroundGroup.remove()}setZIndex(t){super.setZIndex(t),this.backgroundGroup.zIndex=[gl.BACKGROUND,t]}nodeFactory(){const t=new Ts;return t.miterLimit=1e9,t}getSeriesDomain(t){return t===z.Angle?{domain:this.angleScale.domain}:{domain:this.radiusScale.domain}}async processData(t){if(this.data==null)return;const{visible:e,id:i,ctx:{legendManager:n}}=this,{angleKey:s,angleFilterKey:a,radiusKey:o,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:c}=this.properties,u=()=>(D,A)=>e&&n.getItemEnabled({seriesId:i,itemId:A})?D:0,d=!this.ctx.animationManager.isSkipped(),g=this.properties.allowNullKeys??!1,f=[],y=[];c?f.push(uu(c,"category",{id:"legendItemKey",allowNullKey:g})):r?f.push(uu(r,"category",{id:"calloutLabelKey",allowNullKey:g})):l&&f.push(uu(l,"category",{id:"sectorLabelKey",allowNullKey:g}));const x=this.radiusScale.type,S=this.angleScale.type;o&&y.push(D7(o,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:u}),Ci(o,x,{id:"radiusRaw",processor:u}),wC("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),r&&y.push(Ci(r,"category",{id:"calloutLabelValue",allowNullKey:g})),l&&y.push(Ci(l,"category",{id:"sectorLabelValue",allowNullKey:g})),c&&y.push(Ci(c,"category",{id:"legendItemValue",allowNullKey:g})),a&&y.push(kN(a,S,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:u}),Ci(a,S,{id:"angleFilterRaw"}),wC("angleFilterValue",[0,1],0,0)),d&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&f.length>0&&y.push(GD(this.id,this.processedData)),y.push(Hx()),await this.requestDataModel(t,this.data,{props:[...f,kN(s,S,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:u}),Ci(s,S,{id:"angleRaw"}),wC("angleValue",[0,1],0,0),...y]});for(const D of this.processedData?.defs?.values??[]){const{id:A,missing:I,property:w}=D,N=VG(this,I);A!=="angleRaw"&&N>0&&pt.warnOnce(`no value was found for the key '${String(w)}' on ${N} data element${N>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:t=[],phantomNodeData:e}=this.createNodeData()??{};this.nodeData=t,this.phantomNodeData=e,t.length>0&&Vr.record(`${this.type}:nodeData`,t.length),this.nodeDataRefresh=!1}getProcessedDataValues(t,e){const i=t.resolveColumnById(this,"angleValue",e),n=t.resolveColumnById(this,"angleRaw",e),s=this.properties.angleFilterKey==null?void 0:t.resolveColumnById(this,"angleFilterValue",e),a=this.properties.angleFilterKey==null?void 0:t.resolveColumnById(this,"angleFilterRaw",e),o=this.properties.radiusKey?t.resolveColumnById(this,"radiusValue",e):void 0,r=this.properties.radiusKey?t.resolveColumnById(this,"radiusRaw",e):void 0,l=this.properties.calloutLabelKey?t.resolveColumnById(this,"calloutLabelValue",e):void 0,c=this.properties.sectorLabelKey?t.resolveColumnById(this,"sectorLabelValue",e):void 0,u=this.properties.legendItemKey?t.resolveColumnById(this,"legendItemValue",e):void 0;return{angleValues:i,angleRawValues:n,angleFilterValues:s,angleFilterRawValues:a,radiusValues:o,radiusRawValues:r,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:u}}createNodeData(){const{id:t,processedData:e,dataModel:i,angleScale:n,ctx:{legendManager:s},visible:a}=this,{rotation:o,innerRadiusRatio:r}=this.properties;if(!i||e?.type!=="ungrouped")return;const l=this.getProcessedDataValues(i,e),{angleValues:c,angleRawValues:u,angleFilterValues:d,angleFilterRawValues:g,radiusValues:f,radiusRawValues:y,legendItemValues:x}=l,S=g?.some((L,R)=>L>u[R])??!1;let D=0,A=0;const I=[],w=g==null?void 0:[],N=e.dataSources.get(this.id)?.data??[],O=e.invalidData?.get(this.id);for(const[L,R]of N.entries()){if(O?.[L]===!0)continue;const P=S?d[L]:c[L],B=g!=null&&!S?Math.sqrt(g[L]/u[L]):1,F=n.convert(D)+Ze(o);D=P,A+=P;const H=n.convert(D)+Ze(o),$=Math.abs(H-F),Y=F+$/2,U=u[L],Z=(f?.[L]??1)*B,W=y?.[L],q=x?.[L],nt=this.getLabels(L,R,Y,$,l),G=this.getItemStyle({datum:R,datumIndex:L},!1),et={series:this,datum:R,datumIndex:L,angleValue:U,midAngle:Y,midCos:Math.cos(Y),midSin:Math.sin(Y),startAngle:F,endAngle:H,radius:Z,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(Z),0),sectorFormat:G,radiusValue:W,legendItemValue:q,enabled:a&&s.getItemEnabled({seriesId:t,itemId:L}),focusable:!0,...nt};I.push(et),w?.push({...et,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}return this.zerosumOuterRing.visible=A===0,this.zerosumInnerRing.visible=A===0&&r!=null&&r!==1&&r>0,{itemId:t,nodeData:I,labelData:I,phantomNodeData:w}}getLabelContent(t,e,i){const{id:n,ctx:s,properties:a}=this,{formatManager:o}=s,{calloutLabel:r,sectorLabel:l,calloutLabelKey:c,sectorLabelKey:u,legendItemKey:d}=a,g=a.allowNullKeys??!1,f=i.calloutLabelValues?.[t],y=i.sectorLabelValues?.[t],x=i.legendItemValues?.[t],S={datum:e,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},D={callout:void 0,sector:void 0,legendItem:void 0};if(c&&(D.callout=this.getLabelText(f,e,c,"calloutLabel",[],r,{...S,value:f},g)),u&&(D.sector=this.getLabelText(y,e,u,"sectorLabel",[],l,{...S,value:y},g)),d!=null&&(x!=null||g)){const A=x??"";D.legendItem=o.format(this.callWithContext.bind(this),{type:"category",value:g?x:A,datum:e,seriesId:n,legendItemName:void 0,key:d,source:"legend-label",property:"legendItem",domain:[],boundSeries:this.getFormatterContext("legendItem")})??A}return D}getLabels(t,e,i,n,s){const{properties:a}=this,{calloutLabel:o,sectorLabel:r,legendItemKey:l}=a,c=this.getLabelContent(t,e,s),u={};return o.enabled&&c.callout&&n>=Ze(o.minAngle)&&(u.calloutLabel={...this.getTextAlignment(i),text:c.callout,hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),r.enabled&&c.sector&&(u.sectorLabel={text:c.sector}),l&&c.legendItem&&(u.legendItem={key:l,text:c.legendItem}),u}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"top"},{textAlign:"right",textBaseline:"middle"}],i=uM(t),n=-.75*Math.PI,s=i-n,a=Math.floor(s/(Math.PI/2)),o=D4(a,e.length);return e[o]}getFillParams(t,e,i){if(!(!an(t)||t.bounds==="item"))return{centerX:0,centerY:0,innerRadius:e,outerRadius:i}}getItemStyle({datum:t,datumIndex:e},i,n,s){const{fills:a,strokes:o,itemStyler:r}=this.properties,l=o[e],c=a[e],{fill:u,fillOpacity:d,stroke:g,strokeWidth:f,strokeOpacity:y,lineDash:x,lineDashOffset:S,cornerRadius:D,opacity:A}=Et(this.getHighlightStyle(i,e,n,s),{fill:c,stroke:l},this.properties);let I;return r&&(I=this.cachedDatumCallback(this.getDatumId(e)+(i?"-highlight":"-hide"),()=>{const w=this.makeItemStylerParams(t,e,i,{fill:u,fillOpacity:d,stroke:g,strokeWidth:f,strokeOpacity:y,lineDash:x,lineDashOffset:S,cornerRadius:D});return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(r,w),{proxyPaths:{fill:["fills",`${e}`],stroke:["strokes",`${e}`]}})})),{fill:I?.fill??u,fillOpacity:I?.fillOpacity??d,stroke:I?.stroke??g,strokeWidth:I?.strokeWidth??f,strokeOpacity:I?.strokeOpacity??y,lineDash:I?.lineDash??x,lineDashOffset:I?.lineDashOffset??S,cornerRadius:I?.cornerRadius??D,opacity:A}}makeItemStylerParams(t,e,i,n){const{angleKey:s,radiusKey:a,calloutLabelKey:o,sectorLabelKey:r,legendItemKey:l}=this.properties,c=this.filterItemStylerFillParams(n.fill)??n.fill;return{datum:t,angleKey:s,radiusKey:a,calloutLabelKey:o,sectorLabelKey:r,legendItemKey:l,...n,fill:c,highlightState:this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),i,e),seriesId:this.id}}getCalloutLineStyle(t,e){const{properties:i}=this;let n={};if(i.calloutLine.itemStyler){const s=this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),e,t.datumIndex),a={angleKey:i.angleKey,angleName:i.angleName??i.angleKey,calloutLabelKey:i.calloutLabelKey,calloutLabelName:i.calloutLabelName??i.calloutLabelKey,datum:t.datum,highlightState:s,legendItemKey:i.legendItemKey,radiusKey:i.radiusKey,radiusName:i.radiusName??i.radiusKey,sectorLabelKey:i.sectorLabelKey,sectorLabelName:i.sectorLabelName??i.sectorLabelKey,seriesId:this.id};n=this.cachedCallWithContext(i.calloutLine.itemStyler,a)??{}}return{length:n.length??i.calloutLine.length,strokeWidth:n.strokeWidth??i.calloutLine.strokeWidth,color:n.color,colors:i.calloutLine.colors}}getInnerRadius(){const{radius:t}=this,{innerRadiusRatio:e=1,innerRadiusOffset:i=0}=this.properties,n=t*e+i;return n===t||n<0?0:n}getOuterRadius(){const{outerRadiusRatio:t,outerRadiusOffset:e}=this.properties;return Math.max(this.radius*t+e,0)}updateRadiusScale(t){const e=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=e,t&&(this.previousRadiusScale.range=e);const i=n=>({...n,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(n.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const t=Math.max(0,this.radiusScale.range[1]);if(t===0)return Number.NaN;const i=2+(this.properties.title?.spacing??0),n=Math.max(0,-t);return-t-i-n}update({seriesRect:t}){const{title:e}=this.properties,i={seriesRectWidth:t?.width,seriesRectHeight:t?.height},n=or(this.nodeDataDependencies,i)!=null;if(n&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(n),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),e){const s=this.getTitleTranslationY();e.node.y=Number.isFinite(s)?s:0;const a=e.node.getBBox();e.node.visible=e.enabled&&Number.isFinite(s)&&!this.bboxIntersectsSurroundingSeries(a)}for(const s of[this.zerosumInnerRing,this.zerosumOuterRing])s.fillOpacity=0,s.stroke=this.properties.calloutLabel.color,s.strokeWidth=1,s.strokeOpacity=1;this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(t)}updateTitleNodes(){const{oldTitle:t}=this,{title:e}=this.properties;t!==e&&(t&&t.node.remove(),e&&(e.node.textBaseline="bottom",this.labelGroup?.appendChild(e.node)),this.oldTitle=e)}updateNodeMidPoint(){const t=e=>{const i=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,i),y:e.midSin*Math.max(0,i)}};for(const e of this.nodeData)t(e);if(this.phantomNodeData)for(const e of this.phantomNodeData)t(e)}updateSelections(){this.updateGroupSelection(),this.updateInnerCircleSelection()}updateGroupSelection(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,phantomHighlightSelection:n,calloutLabelSelection:s,labelSelection:a,highlightLabelSelection:o,innerLabelsSelection:r}=this,l=this.nodeData.map(d=>({...d,sectorFormat:{...d.sectorFormat}})),c=this.phantomNodeData?.map(d=>({...d,sectorFormat:{...d.sectorFormat}})),u=(d,g)=>{d.update(g,void 0,f=>this.getDatumId(f.datumIndex)),this.ctx.animationManager.isSkipped()&&d.cleanup()};u(t,this.nodeData),u(e,l),u(i,this.phantomNodeData??[]),u(n,c??[]),s.update(this.calloutNodeData,d=>{const g=new mo;g.tag=0,g.pointerEvents=1,d.appendChild(g);const f=new Pa;f.tag=1,f.pointerEvents=1,d.appendChild(f)}),a.update(this.nodeData),o.update(l),r.update(this.properties.innerLabels,d=>{d.pointerEvents=1})}updateInnerCircleSelection(){const{innerCircle:t}=this.properties;let e=0;const i=this.getInnerRadius();if(i>0){const s=Math.min(i,this.getOuterRadius());e=Math.ceil(s*2+1)}const n=t?[{radius:e}]:[];this.innerCircleSelection.update(n)}updateNodes(t){const e=this.ctx.highlightManager.getActiveHighlight(),{visible:i,dataModel:n,processedData:s}=this;if(this.backgroundGroup.visible=i,this.contentGroup.visible=i,!n||!s)return;const{legendItemValues:a}=this.getProcessedDataValues(n,s),o=this.isSeriesHighlighted(e,a),r=this.ctx.chartService.highlight?.drawingMode??"overlay";this.highlightGroup.visible=i&&o,this.labelGroup.visible=i,this.innerCircleSelection.each((f,{radius:y})=>{f.setProperties({fill:this.properties.innerCircle?.fill,opacity:this.properties.innerCircle?.fillOpacity,size:y})});const l=this.radiusScale.range[0],c=this.radiusScale.range[1],u=this.getShapeFillBBox(),d=this.ctx.animationManager.isSkipped(),g=(f,y,x,S,D)=>{const A=this.getItemStyle(y,S,void 0,a);y.sectorFormat.fill=A.fill,y.sectorFormat.stroke=A.stroke,d&&(f.startAngle=y.startAngle,f.endAngle=y.endAngle,f.innerRadius=y.innerRadius,f.outerRadius=y.outerRadius),(S||d)&&(f.fill=A.fill,f.stroke=A.stroke);const I=this.getFillParams(A.fill,l,c);f.setStyleProperties(A,u,I),f.drawingMode=D,f.cornerRadius=A.cornerRadius,f.fillShadow=this.properties.shadow;const w=Math.max((this.properties.sectorSpacing+(A.stroke==null?0:A.strokeWidth))/2,0);f.inset=w,f.lineJoin=this.properties.sectorSpacing>=0||w>0?"miter":"round"};this.itemSelection.each((f,y,x)=>g(f,y,x,!1,"overlay")),this.phantomSelection.each((f,y,x)=>g(f,y,x,!1,"overlay")),this.highlightSelection.each((f,y,x)=>{g(f,y,x,!0,r),f.visible=y.datumIndex===e?.datumIndex}),this.phantomHighlightSelection.each((f,y,x)=>{g(f,y,x,!0,r),f.visible=y.datumIndex===e?.datumIndex}),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(t),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{strokes:t}=this.properties,{offset:e}=this.properties.calloutLabel,i=this.ctx.highlightManager?.getActiveHighlight(),n=this.isSeriesHighlighted(i);for(const s of this.calloutLabelSelection.selectByTag(0)){const a=s.closestDatum(),o=n&&this.isItemHighlighted(i,a.datumIndex)===!0,{length:r,strokeWidth:l,color:c,colors:u}=this.getCalloutLineStyle(a,!1),d=l,g=jj(u)?u:t,{calloutLabel:f,outerRadius:y,datumIndex:x}=a;if(f?.text&&!f.hidden&&y!==0){s.visible=!0,s.strokeWidth=d,s.stroke=c??g[x%g.length],s.strokeOpacity=this.getHighlightStyle(o,a.datumIndex).opacity??1,s.fill=void 0;const S=a.midCos*y,D=a.midSin*y;let A=a.midCos*(y+r),I=a.midSin*(y+r);if((f.collisionTextAlign??f.collisionOffsetY!==0)&&f.box!=null){const N=f.box;let O=A,L=I;AN.x+N.width&&(O=N.x+N.width),IN.y+N.height&&(L=N.y+N.height);const R=O-A,P=L-I,B=Math.sqrt(Math.pow(R,2)+Math.pow(P,2)),F=B-e;F>0&&(A=A+R*F/B,I=I+P*F/B)}s.x1=S,s.y1=D,s.x2=A,s.y2=I}else s.visible=!1}}getLabelOverflow(t,e){const i=-this.centerX,n=i+e.width,s=-this.centerY,a=s+e.height,o=1;let r=t.width;t.x+on&&(r=(n-t.x)/t.width);const l=t.y+oa,c=this.bboxIntersectsSurroundingSeries(t);return{maxWidth:r,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:c}}bboxIntersectsSurroundingSeries(t){const{surroundingRadius:e}=this;if(e==null)return!1;const i=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],n=e**2;return i.some(s=>s.x**2+s.y**2>n)}computeCalloutLabelCollisionOffsets(){const{radiusScale:t}=this,{calloutLabel:e}=this.properties,{offset:i,minSpacing:n}=e,s=t.convert(0),a=S=>!S.calloutLabel||S.outerRadius===0,o=this.calloutNodeData,r=o.filter(S=>!a(S));for(const S of r){const D=S.calloutLabel;D!=null&&(D.hidden=!1,D.collisionTextAlign=void 0,D.collisionOffsetY=0)}if(r.length<=1)return;const l=r.filter(S=>S.midCos<0).sort((S,D)=>S.midSin-D.midSin),c=r.filter(S=>S.midCos>=0).sort((S,D)=>S.midSin-D.midSin),u=r.filter(S=>S.midSin<0&&S.calloutLabel?.textAlign==="center").sort((S,D)=>S.midCos-D.midCos),d=r.filter(S=>S.midSin>=0&&S.calloutLabel?.textAlign==="center").sort((S,D)=>S.midCos-D.midCos),g=S=>{const D=S.calloutLabel;if(D==null)return Tt.zero.clone();const A=this.getLabelStyle(S,e,"calloutLabel"),I=Lf(A),w=this.getCalloutLineStyle(S,!1).length,N=S.outerRadius+w+i,O=S.midCos*N,L=S.midSin*N+D.collisionOffsetY,R=D.collisionTextAlign??D.textAlign,P=D.textBaseline;return Pa.measureBBox(D.text,O,L,{font:this.properties.calloutLabel,textAlign:R,textBaseline:P}).grow(I)},f=(S,D,A)=>{const I=g(S).grow(n/2),w=g(D).grow(n/2);I.xw.x&&(A==="to-top"?I.yw.y)&&(D.calloutLabel.collisionOffsetY=A==="to-top"?I.y-w.y-w.height:I.y+I.height-w.y)},y=S=>{const D=S.slice().sort((I,w)=>Math.abs(I.midSin)-Math.abs(w.midSin))[0],A=S.indexOf(D);for(let I=A-1;I>=0;I--){const w=S[I+1],N=S[I];f(w,N,"to-top")}for(let I=A+1;I{const D=r.some(L=>L.calloutLabel.collisionOffsetY!==0),A=S.map(L=>g(L)),I=A.map(L=>L.clone().grow(n/2));let w=!1;for(let L=0;L{const{startAngle:R,endAngle:P,outerRadius:B}=L;return{startAngle:R,endAngle:P,innerRadius:s,outerRadius:B}}),O=A.some(L=>N.some(R=>Eit(L,R)));if(!(!w&&!D&&!O))for(const L of S){if(L.calloutLabel.textAlign!=="center")continue;const R=L.calloutLabel;L.midCos<0?R.collisionTextAlign="right":L.midCos>0?R.collisionTextAlign="left":R.collisionTextAlign="center"}};y(l),y(c),x(u),x(d)}getLabelStyle(t,e,i,n=!1){const s=this.ctx.highlightManager?.getActiveHighlight();return Rp(this,t,this.properties,e,n,s,["series",`${this.declarationOrder}`,i])}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i}=this.properties,n=new Pa,s=this.ctx.highlightManager?.getActiveHighlight(),a=this.isSeriesHighlighted(s);for(const o of this.calloutLabelSelection.selectByTag(1)){const r=o.closestDatum(),l=r.calloutLabel,c=e.convert(r.radius),u=Math.max(0,c);if(!l?.text||u===0||l.hidden){o.visible=!1;continue}const d=a&&this.isItemHighlighted(s,r.datumIndex)===!0,g=this.getLabelStyle(r,i,"calloutLabel",d),f=this.getCalloutLineStyle(r,!1).length,y=u+f+i.offset,x=r.midCos*y,S=r.midSin*y+l.collisionOffsetY,D={textAlign:l.collisionTextAlign??l.textAlign,textBaseline:l.textBaseline};n.text=l.text,n.x=x,n.y=S,n.setFont(g),n.setAlign(D),n.setBoxing(g);const A=n.getBBox();let I=l.text,w=!0;if(i.avoidCollisions){const{maxWidth:N,hasVerticalOverflow:O}=this.getLabelOverflow(A,t);if(A.width>N){const L={font:this.properties.calloutLabel,textWrap:"on-space",overflow:"hide",maxWidth:N};I=Lx(l.text,L)}w=!O}o.text=I,o.x=x,o.y=S,o.setFont(g),o.setAlign(D),o.setBoxing(g),o.fill=g.color,o.fillOpacity=this.getHighlightStyle(d,r.datumIndex).opacity??1,o.visible=w}}computeLabelsBBox(t,e){const{calloutLabel:i}=this.properties,{offset:n,maxCollisionOffset:s,minSpacing:a}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const o=[],r=new Pa;let l;const{title:c}=this.properties;if(c?.text&&c.enabled){const u=this.getTitleTranslationY();Number.isFinite(u)&&(r.text=c.text,r.x=0,r.y=u,r.setFont(c),r.setAlign({textBaseline:"bottom",textAlign:"center"}),l=r.getBBox(),o.push(l))}for(const u of this.calloutNodeData){const d=u.calloutLabel;if(!d||u.outerRadius===0)continue;const g=this.getLabelStyle(u,i,"calloutLabel"),f=this.getCalloutLineStyle(u,!1).length,y=u.outerRadius+f+n,x=u.midCos*y,S=u.midSin*y+d.collisionOffsetY;r.text=d.text,r.x=x,r.y=S,r.setFont(g),r.setAlign({textAlign:d.collisionTextAlign??d.textAlign,textBaseline:d.textBaseline}),r.setBoxing(g);const D=r.getBBox();if(d.box=D,Math.abs(d.collisionOffsetY)>s){d.hidden=!0;continue}if(l){const A=-this.centerY,I=new Tt(l.x-a,A,l.width+2*a,l.y+l.height+a-A);if(D.collidesBBox(I)){d.hidden=!0;continue}}if(t.hideWhenNecessary){const{maxWidth:A,hasVerticalOverflow:I,hasSurroundingSeriesOverflow:w}=this.getLabelOverflow(D,e),N=D.width>A;if(I||N||w){d.hidden=!0;continue}}d.hidden=!1,o.push(D)}return o.length===0?null:Tt.merge(o)}updateSectorLabelNodes(){const{properties:t}=this,{positionOffset:e,positionRatio:i}=this.properties.sectorLabel,n=this.ctx.highlightManager?.getActiveHighlight(),s=this.isSeriesHighlighted(n),a=this.radiusScale.convert(0),o=a<=0&&this.ctx.legendManager.getData(this.id)?.filter(c=>c.enabled).length===1,r={textAlign:"center",textBaseline:"middle"},l=c=>c.each((u,d)=>{const{outerRadius:g,startAngle:f,endAngle:y}=d,x=s&&this.isItemHighlighted(n,d.datumIndex)===!0;let S=!1;if(d.sectorLabel&&g!==0){const D=this.getLabelStyle(d,t.sectorLabel,"sectorLabel",x),A=a*(1-i)+g*i+e;u.fill=D.color,u.fillOpacity=this.getHighlightStyle(x,d.datumIndex).opacity??1,u.text=d.sectorLabel.text,o?(u.x=0,u.y=0):(u.x=d.midCos*A,u.y=d.midSin*A),u.setFont(D),u.setAlign(r),u.setBoxing(D);const I=u.getBBox(),w=[[I.x,I.y],[I.x+I.width,I.y],[I.x+I.width,I.y+I.height],[I.x,I.y+I.height]],N={startAngle:f,endAngle:y,innerRadius:a,outerRadius:g};w.every(([O,L])=>YN(O,L,N))&&(S=!0)}u.visible=S});l(this.labelSelection),l(this.highlightLabelSelection)}updateInnerLabelNodes(){const t=[],e=[];this.innerLabelsSelection.each((u,d)=>{const{fontStyle:g,fontWeight:f,fontSize:y,fontFamily:x,color:S}=d;u.fontStyle=g,u.fontWeight=f,u.fontSize=y,u.fontFamily=x,u.text=d.text,u.x=0,u.y=0,u.fill=S,u.textAlign="center",t.push(u.getBBox()),e.push(d.spacing)});const i=u=>u===0?0:e[u],n=u=>u===e.length-1?0:e[u],s=t.reduce((u,d)=>Math.max(u,d.width),0),a=t.reduce((u,d,g)=>u+d.height+i(g)+n(g),0),o=this.getInnerRadius(),l=Math.sqrt(Math.pow(s/2,2)+Math.pow(a/2,2))<=(o>0?o:this.getOuterRadius()),c=[];for(let u=0,d=-a/2;u{u.visible=l,Array.isArray(u.text)?u.y=c[g]-t[g].height:u.y=c[g]})}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2,this.zerosumInnerRing.size=this.getInnerRadius()*2}pickNodeClosestDatum(t){return Xnt(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,properties:s,ctx:{formatManager:a}}=this,{legendItemKey:o,calloutLabelKey:r,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:u,angleKey:d,angleName:g,radiusKey:f,radiusName:y,tooltip:x}=s,S=this.properties.title.node.getPlainText();if(!i||!n)return;const D=n.dataSources.get(this.id)?.data?.[t],A=this.getProcessedDataValues(i,n),{angleRawValues:I}=A,w=I[t],N=this.getLabelContent(t,D,A),O=N.legendItem??N.callout??N.sector??g,L=Lb(i.getDomain(this,"angleRaw","value",n)),R=a.format(this.callWithContext.bind(this),{type:"number",value:w,datum:D,seriesId:e,legendItemName:void 0,key:d,source:"tooltip",property:"angle",domain:L,boundSeries:this.getFormatterContext("angle"),fractionDigits:void 0,visibleDomain:void 0})??Or(w,3);return this.formatTooltipWithContext(x,{title:S,symbol:this.legendItemSymbol(t),data:[{label:ce(O),fallbackLabel:d,value:R}]},{seriesId:e,datum:D,title:g,legendItemKey:o,calloutLabelKey:r,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:u,angleKey:d,angleName:g,radiusKey:f,radiusName:y,...this.getItemStyle({datum:D,datumIndex:t},!1)})}legendItemSymbol(t){const e=this.processedData?.dataSources.get(this.id)?.data?.[t],i=this.getItemStyle({datum:e,datumIndex:t},!1),{fillOpacity:n,strokeOpacity:s,strokeWidth:a,lineDash:o,lineDashOffset:r}=this.properties;let{fill:l}=i;const{stroke:c}=i;return an(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:n,strokeOpacity:s,strokeWidth:a,lineDash:o,lineDashOffset:r}}}getLegendData(t){const{visible:e,processedData:i,dataModel:n,id:s,ctx:{legendManager:a}}=this;if(!n||!i||t!=="category")return[];const{angleKey:o,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:c,showInLegend:u}=this.properties;if(!c&&(!r||r===o)&&(!l||l===o))return[];const d=this.getProcessedDataValues(n,i),{angleRawValues:g}=d,f=this.properties.title?.showInLegend&&this.properties.title.text,y=[],x=this.properties.hideZeroValueSectorsInLegend,S=i.dataSources.get(this.id)?.data,D=i.invalidData?.get(this.id);for(let A=0;Ace(L)).join(" - ")},symbol:this.legendItemSymbol(A),legendItemName:c==null?void 0:I[c],hideInLegend:!u})}return y}setLegendState(t){const{id:e,ctx:{legendManager:i,eventsHub:n}}=this;for(const[s,a]of t.entries())i.toggleItem(a,e,s);i.update(),n.emit("chart:request-update",{type:Ct.SERIES_UPDATE})}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=JC(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);dn(this.id,"nodes",e,[this.itemSelection,this.highlightSelection,this.phantomSelection,this.phantomHighlightSelection],i.nodes,(n,s)=>this.getDatumId(s.datumIndex)),dn(this.id,"innerCircle",e,[this.innerCircleSelection],i.innerCircle),Wi(this,"callout",e,this.calloutLabelSelection),Wi(this,"sector",e,this.labelSelection,this.highlightLabelSelection),Wi(this,"inner",e,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,phantomHighlightSelection:n,processedData:s,radiusScale:a,previousRadiusScale:o}=this,{animationManager:r}=this.ctx,l=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const c=(l?.moved.size??0)===0,u=(s?.defs.keys.length??0)>0,d=s?.reduced?.animationValidation?.uniqueKeys??!0;(!c||!u||!d)&&this.ctx.animationManager.skipCurrentBatch();const g=!this.nodeData.some(y=>y.enabled),f=JC(!1,this.properties.rotation,a,o);dn(this.id,"nodes",r,[t,e,i,n],f.nodes,(y,x)=>this.getDatumId(x.datumIndex),l),dn(this.id,"innerCircle",r,[this.innerCircleSelection],f.innerCircle),Wi(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Wi(this,"sector",this.ctx.animationManager,this.labelSelection,this.highlightLabelSelection),this.noVisibleData!==g&&(this.noVisibleData=g,Wi(this,"inner",this.ctx.animationManager,this.innerLabelsSelection)),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,phantomHighlightSelection:n,radiusScale:s,previousRadiusScale:a}=this,{animationManager:o}=this.ctx,r=JC(!1,this.properties.rotation,s,a);dn(this.id,"nodes",o,[t,e,i,n],r.nodes,(l,c)=>this.getDatumId(c.datumIndex)),dn(this.id,"innerCircle",o,[this.innerCircleSelection],r.innerCircle),$S(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),$S(this,"sector",this.ctx.animationManager,this.labelSelection,this.highlightLabelSelection),$S(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(t){const{dataModel:e,processedData:i}=this;if(!e||!i)return`${t}`;const{calloutLabelKey:n,sectorLabelKey:s,legendItemKey:a}=this.properties;if(!i.reduced?.animationValidation?.uniqueKeys)return`${t}`;if(a){const o=e.resolveKeysById(this,"legendItemKey",i);return As(o[t])}else if(n){const o=e.resolveKeysById(this,"calloutLabelKey",i);return As(o[t])}else if(s){const o=e.resolveKeysById(this,"sectorLabelKey",i);return As(o[t])}return`${t}`}hasItemStylers(){return!(this.properties.itemStyler==null&&this.properties.calloutLabel.itemStyler==null&&this.properties.sectorLabel.itemStyler==null&&this.properties.innerLabels.every(t=>t.itemStyler==null))}};fA.className="DonutSeries";fA.type="donut";var ZN={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Cn.LARGE},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{...Oe,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{...Oe,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"chartBackgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2,colors:{$map:[{$if:[{$or:[{$isGradient:{$value:"$1"}},{$isPattern:{$value:"$1"}},{$isImage:{$value:"$1"}}]},{$path:["../../strokes/$index",{$ref:"foregroundColor"}]},{$value:"$1"}]},{$if:[{$eq:[{$path:"../strokeWidth"},0]},{$path:"../fills"},{$path:"../strokes"}]}]}},fills:{$applyCycle:[{$cacheMax:{$size:{$path:["./data",{$path:"/data"}]}}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",X4],["pattern",Cs],["image",$s]]}]},strokes:{$applyCycle:[{$cacheMax:{$size:{$path:["./data",{$path:"/data"}]}}},{$palette:"strokes"}]},fillOpacity:1,strokeOpacity:1,strokeWidth:{$isUserOption:["./strokes/0",2,0]},lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:Dp,xOffset:3,yOffset:3,blur:5},highlight:_1},legend:{enabled:!0}},qnt={...ZN,series:{...ZN.series,innerRadiusRatio:{$if:[{$eq:[{$path:["./innerRadiusOffset",void 0]},void 0]},.7,void 0]},innerLabels:{$apply:{...Oe,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},highlight:_1}},Qnt={type:"series",name:"donut",chartType:"polar",version:oi,dependencies:[OL],options:eU,themeTemplate:qnt,create:t=>new fA(t)},XL=class extends fA{};XL.className="PieSeries";XL.type="pie";var Jnt={type:"series",name:"pie",chartType:"polar",version:oi,dependencies:[OL],options:Rl,themeTemplate:ZN,create:t=>new XL(t)},ZL=class extends Ln{constructor(t){super(),this.ctx=t,this.localeText=void 0}};T([Bi(t=>{t.ctx.localeManager.setLocaleText(t.localeText)}),b],ZL.prototype,"localeText",2);T([Bi(t=>{t.ctx.localeManager.setLocaleTextFormatter(t.getLocaleText)}),b],ZL.prototype,"getLocaleText",2);var tK={type:"plugin",name:"locale",version:oi,options:{localeText:Nu,getLocaleText:Is(K)},create:t=>new ZL(t)},tst={type:"axis",name:"number",chartType:"cartesian",version:oi,dependencies:[hr],options:Kg,themeTemplate:{line:{enabled:!1}},create:t=>new Ao(t)},est={type:"axis",name:"log",chartType:"cartesian",version:oi,dependencies:[hr],options:Yg,themeTemplate:{base:10,line:{enabled:!1}},create:t=>new fm(t)},ist={type:"axis",name:"time",chartType:"cartesian",version:oi,dependencies:[hr],options:$g,themeTemplate:{gridLine:{enabled:!1}},create:t=>new Pl(t)},nst={type:"axis",name:"category",chartType:"cartesian",version:oi,dependencies:[hr],options:Ug,themeTemplate:{groupPaddingInner:.1,label:{autoRotate:!0,wrapping:"on-space"},gridLine:{enabled:!1},interval:{placement:"between"}},create:t=>new qx(t)},sst={type:"axis",name:"grouped-category",chartType:"cartesian",version:oi,dependencies:[hr],options:Wg,themeTemplate:{tick:{enabled:!0,stroke:{$ref:"separationLinesColor"}},label:{spacing:10,rotation:270,wrapping:"on-space"},maxThicknessRatio:.5,paddingInner:.4,groupPaddingInner:.2},create:t=>new Qx(t)},$c=class extends IW{constructor(t){super(t,new eu,!1),this.defaultTickMinSpacing=20,this.parentLevel=new cm,this.min=void 0,this.max=void 0,this.preferredMin=void 0,this.preferredMax=void 0,this.unit=void 0,this.defaultUnit=void 0}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}hasDefinedDomain(){const{min:t,max:e}=this;return t!=null&&e!=null&&tnew $c(t)},ost=[tst,est,ist,nst,sst,ast],rst=[UW,WW,$W,XW,qW,QW],lst=[ost,rst,jW,tK].flat(),cst=[OL,Qnt,Jnt,jW,tK],hst=[lst,cst,Qit].flat(),ust={};Ap(ust,{Arc:()=>Bl,BBox:()=>Tt,Caption:()=>Ri,CategoryScale:()=>Of,Group:()=>ee,Line:()=>mo,LinearScale:()=>np,Marker:()=>wn,Path:()=>Tn,RadialColumnShape:()=>Gr,Rect:()=>On,Scene:()=>HD,Sector:()=>Ts,Shape:()=>Ip,TranslatableGroup:()=>Ds,getRadialColumnWidth:()=>TW,toRadians:()=>Ze});var eK={};Ap(eK,{ChartTheme:()=>Pr,getChartTheme:()=>NM,resolveOperation:()=>gst,themeNames:()=>pst,themeSymbols:()=>dst,themes:()=>cL});G9(eK,_9);var dst={DEFAULT_ANNOTATION_HANDLE_FILL:vx,DEFAULT_ANNOTATION_STATISTICS_COLOR:Dx,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:Ax,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:Gb,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:Ub,DEFAULT_ANNOTATION_STATISTICS_FILL:Sx,DEFAULT_ANNOTATION_STATISTICS_STROKE:Mx,DEFAULT_CAPTION_ALIGNMENT:Qh,DEFAULT_CAPTION_LAYOUT_STYLE:qh,DEFAULT_FIBONACCI_STROKES:jb,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:Ws,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:ra,DEFAULT_POLAR_SERIES_STROKE:xD,DEFAULT_SHADOW_COLOUR:Dp,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:vD,DEFAULT_TEXTBOX_COLOR:Cx,DEFAULT_TEXTBOX_FILL:Ix,DEFAULT_TEXTBOX_STROKE:kx,DEFAULT_TEXT_ANNOTATION_COLOR:SD,DEFAULT_TOOLBAR_POSITION:wx,IS_DARK_THEME:Qd,PALETTE_ALT_DOWN_FILL:q1,PALETTE_ALT_DOWN_STROKE:X1,PALETTE_ALT_NEUTRAL_FILL:Q1,PALETTE_ALT_NEUTRAL_STROKE:J1,PALETTE_ALT_UP_FILL:Z1,PALETTE_ALT_UP_STROKE:$1,PALETTE_DOWN_FILL:W1,PALETTE_DOWN_STROKE:G1,PALETTE_NEUTRAL_FILL:Y1,PALETTE_NEUTRAL_STROKE:K1,PALETTE_UP_FILL:U1,PALETTE_UP_STROKE:j1},pst=Object.keys(cL);function gst(t){const e=Pr.getDefaultPublicParameters(),i=Pr.getDefaultColors();return new FU({line:{operation:t}},{series:[{type:"line"}]},e,i).resolve().operation}var fst={};Ap(fst,{Color:()=>se,interpolateColor:()=>TG});Jo.create.bind(Jo),Jo.__createSparkline.bind(Jo);function LV(t,e){return{...t,container:e.current}}function mst(t,e){const i=Ei.forwardRef(function(s,a){const{options:o,style:r,className:l}=s,c=Ei.useRef(null),u=Ei.useRef();Ei.useLayoutEffect(()=>{const g=t(LV(o,c));return u.current=g,()=>{g.destroy()}},[]);const d=u.current===void 0;return Ei.useEffect(()=>{d||u.current?.update(LV(o,c)).catch(g=>console.error(g))},[o]),Ei.useImperativeHandle(a,()=>u.current,[]),Ei.useMemo(()=>Ei.createElement("div",{ref:c,style:r,className:l}),[r,l])});return i.displayName=e,i}var yst=mst(t=>Jo.create(t),"AgCharts"),bst=Object.defineProperty,M=(t,e,i,n)=>{for(var s=void 0,a=t.length-1,o;a>=0;a--)(o=t[a])&&(s=o(e,i,s)||s);return s&&bst(e,i,s),s},Vl=class extends xt{constructor(){super(),this.opacity=1,this.loadedSynchronously=!0,this.containerWidth=0,this.containerHeight=0,this.onLoad=void 0,this.onImageLoad=()=>{this.loadedSynchronously||(this.node.visible=!1,this.performLayout(this.containerWidth,this.containerHeight),this.onLoad?.())},this.imageElement=$t("img"),this.imageElement.onload=this.onImageLoad,this.node=new j.Image(this.imageElement)}get complete(){return this.imageElement.width>0&&this.imageElement.height>0}performLayout(t,e){this.containerWidth=t,this.containerHeight=e;const i={width:t,height:e},n=uT(this.imageElement.width,this.imageElement.height,i,this);return this.node.setProperties(this.complete?{visible:!0,opacity:this.opacity,...n}:{visible:!1}),n}};M([b],Vl.prototype,"top");M([b],Vl.prototype,"right");M([b],Vl.prototype,"bottom");M([b],Vl.prototype,"left");M([b],Vl.prototype,"width");M([b],Vl.prototype,"height");M([b],Vl.prototype,"opacity");M([qi("imageElement.src"),Bi(t=>t.loadedSynchronously=t.complete)],Vl.prototype,"url");var iK=class extends j.Background{constructor(){super(...arguments),this.image=new Vl}onLayoutComplete(t){if(super.onLayoutComplete(t),this.image){const{width:e,height:i}=t.chart;this.image.performLayout(e,i)}}onImageLoad(){this.ctx.eventsHub.emit("chart:request-update",{type:Ct.SCENE_RENDER})}};M([b,Pe({newValue(t){this.node.appendChild(t.node),t.onLoad=()=>this.onImageLoad()},oldValue(t){t.node.remove(),t.onLoad=void 0}})],iK.prototype,"image");var mA=class extends j.Background{constructor(){super(...arguments),this.image=new Vl,this.fill="transparent",this.fillOpacity=void 0}createNode(){return new j.Group({name:"foreground",zIndex:pe.FOREGROUND})}onLayoutComplete(t){super.onLayoutComplete(t);const{width:e,height:i}=t.chart,n=this.image.performLayout(e,i);this.text&&this.updateTextNode(n)}onImageLoad(){this.ctx.eventsHub.emit("chart:request-update",{type:Ct.SCENE_RENDER})}updateTextNode(t){const{textNode:e}=this;e.fontWeight="bold",e.fontFamily="Impact, sans-serif",e.fontSize=19,e.opacity=.7,e.fill="#9b9b9b",e.textBaseline="top";const{width:i}=e.getBBox(),n=10;e.x=t.x+t.width/2-i/2,e.y=t.y+t.height+n}};M([b,Pe({newValue(t){this.node.appendChild(t.node),t.onLoad=()=>this.onImageLoad()},oldValue(t){t.node.remove(),t.onLoad=void 0}})],mA.prototype,"image");M([b,pi("rectNode","fill")],mA.prototype,"fill");M([b,pi("rectNode","fillOpacity")],mA.prototype,"fillOpacity");var xst=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(t,e){let i=t[0],n=t[1],s=t[2],a=t[3];i=this.ff(i,n,s,a,e[0],7,-680876936),a=this.ff(a,i,n,s,e[1],12,-389564586),s=this.ff(s,a,i,n,e[2],17,606105819),n=this.ff(n,s,a,i,e[3],22,-1044525330),i=this.ff(i,n,s,a,e[4],7,-176418897),a=this.ff(a,i,n,s,e[5],12,1200080426),s=this.ff(s,a,i,n,e[6],17,-1473231341),n=this.ff(n,s,a,i,e[7],22,-45705983),i=this.ff(i,n,s,a,e[8],7,1770035416),a=this.ff(a,i,n,s,e[9],12,-1958414417),s=this.ff(s,a,i,n,e[10],17,-42063),n=this.ff(n,s,a,i,e[11],22,-1990404162),i=this.ff(i,n,s,a,e[12],7,1804603682),a=this.ff(a,i,n,s,e[13],12,-40341101),s=this.ff(s,a,i,n,e[14],17,-1502002290),n=this.ff(n,s,a,i,e[15],22,1236535329),i=this.gg(i,n,s,a,e[1],5,-165796510),a=this.gg(a,i,n,s,e[6],9,-1069501632),s=this.gg(s,a,i,n,e[11],14,643717713),n=this.gg(n,s,a,i,e[0],20,-373897302),i=this.gg(i,n,s,a,e[5],5,-701558691),a=this.gg(a,i,n,s,e[10],9,38016083),s=this.gg(s,a,i,n,e[15],14,-660478335),n=this.gg(n,s,a,i,e[4],20,-405537848),i=this.gg(i,n,s,a,e[9],5,568446438),a=this.gg(a,i,n,s,e[14],9,-1019803690),s=this.gg(s,a,i,n,e[3],14,-187363961),n=this.gg(n,s,a,i,e[8],20,1163531501),i=this.gg(i,n,s,a,e[13],5,-1444681467),a=this.gg(a,i,n,s,e[2],9,-51403784),s=this.gg(s,a,i,n,e[7],14,1735328473),n=this.gg(n,s,a,i,e[12],20,-1926607734),i=this.hh(i,n,s,a,e[5],4,-378558),a=this.hh(a,i,n,s,e[8],11,-2022574463),s=this.hh(s,a,i,n,e[11],16,1839030562),n=this.hh(n,s,a,i,e[14],23,-35309556),i=this.hh(i,n,s,a,e[1],4,-1530992060),a=this.hh(a,i,n,s,e[4],11,1272893353),s=this.hh(s,a,i,n,e[7],16,-155497632),n=this.hh(n,s,a,i,e[10],23,-1094730640),i=this.hh(i,n,s,a,e[13],4,681279174),a=this.hh(a,i,n,s,e[0],11,-358537222),s=this.hh(s,a,i,n,e[3],16,-722521979),n=this.hh(n,s,a,i,e[6],23,76029189),i=this.hh(i,n,s,a,e[9],4,-640364487),a=this.hh(a,i,n,s,e[12],11,-421815835),s=this.hh(s,a,i,n,e[15],16,530742520),n=this.hh(n,s,a,i,e[2],23,-995338651),i=this.ii(i,n,s,a,e[0],6,-198630844),a=this.ii(a,i,n,s,e[7],10,1126891415),s=this.ii(s,a,i,n,e[14],15,-1416354905),n=this.ii(n,s,a,i,e[5],21,-57434055),i=this.ii(i,n,s,a,e[12],6,1700485571),a=this.ii(a,i,n,s,e[3],10,-1894986606),s=this.ii(s,a,i,n,e[10],15,-1051523),n=this.ii(n,s,a,i,e[1],21,-2054922799),i=this.ii(i,n,s,a,e[8],6,1873313359),a=this.ii(a,i,n,s,e[15],10,-30611744),s=this.ii(s,a,i,n,e[6],15,-1560198380),n=this.ii(n,s,a,i,e[13],21,1309151649),i=this.ii(i,n,s,a,e[4],6,-145523070),a=this.ii(a,i,n,s,e[11],10,-1120210379),s=this.ii(s,a,i,n,e[2],15,718787259),n=this.ii(n,s,a,i,e[9],21,-343485551),t[0]=this.add32(i,t[0]),t[1]=this.add32(n,t[1]),t[2]=this.add32(s,t[2]),t[3]=this.add32(a,t[3])}cmn(t,e,i,n,s,a){return e=this.add32(this.add32(e,t),this.add32(n,a)),this.add32(e<>>32-s,i)}ff(t,e,i,n,s,a,o){return this.cmn(e&i|~e&n,t,e,s,a,o)}gg(t,e,i,n,s,a,o){return this.cmn(e&n|i&~n,t,e,s,a,o)}hh(t,e,i,n,s,a,o){return this.cmn(e^i^n,t,e,s,a,o)}ii(t,e,i,n,s,a,o){return this.cmn(i^(e|~n),t,e,s,a,o)}md51(t){const e=t.length,i=[1732584193,-271733879,-1732584194,271733878];let n;for(n=64;n<=t.length;n+=64)this.md5cycle(i,this.md5blk(t.substring(n-64,n)));t=t.substring(n-64);const s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(n=0;n>2]|=t.charCodeAt(n)<<(n%4<<3);if(s[n>>2]|=128<<(n%4<<3),n>55)for(this.md5cycle(i,s),n=0;n<16;n++)s[n]=0;return s[14]=e*8,this.md5cycle(i,s),i}md5blk(t){const e=[];for(let i=0;i<64;i+=4)e[i>>2]=t.charCodeAt(i)+(t.charCodeAt(i+1)<<8)+(t.charCodeAt(i+2)<<16)+(t.charCodeAt(i+3)<<24);return e}rhex(t){const e="0123456789abcdef".split("");let i="",n=0;for(;n<4;n++)i+=e[t>>n*8+4&15]+e[t>>n*8&15];return i}hex(t){for(let e=0;e>16)+(e>>16)+(i>>16)<<16|i&65535}};function tw(t){return t==null||t.length===0}var vst="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=",q0={"01":"GRID","02":"CHARTS","0102":"BOTH"},OV="https://www.ag-grid.com/charts/licensing/",yA=class Oi{constructor(e){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=e,this.md5=new xst,this.md5.init()}validateLicense(){const e=this.getLicenseDetails(Oi.licenseKey,Oi.gridContext),i=`AG ${e.currentLicenseType==="BOTH"?"Grid and ":""}Charts Enterprise`;let n="";if(e.suppliedLicenseType==="BOTH"?n="AG Grid and AG Charts Enterprise":e.suppliedLicenseType==="GRID"?n="AG Grid Enterprise":e.suppliedLicenseType!==void 0&&(n="AG Charts Enterprise"),e.missing)(!this.isWebsiteUrl()||this.isForceWatermark())&&this.outputMissingLicenseKey(i);else if(e.expired){const s=Oi.getChartsReleaseDate(),a=Oi.formatDate(s);this.outputExpiredKey(e.expiry,a,n)}else e.valid?e.isTrial&&e.trialExpired&&this.outputExpiredTrialKey(e.expiry,i,n):this.outputInvalidLicenseKey(!!e.incorrectLicenseType,i,n);Oi.licenseOutputLogged=!0}static extractExpiry(e){const i=e.substring(e.lastIndexOf("_")+1,e.length);return new Date(Number.parseInt(Oi.decode(i),10))}static extractLicenseComponents(e){let i=e.replaceAll(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replaceAll(/\r?\n|\r/g,""),e.length<=32)return{md5:null,license:e,version:null,isTrial:null};const n=i.length-32,s=i.substring(n),a=i.substring(0,n),[o,r,l]=Oi.extractBracketedInformation(i);return{md5:s,license:a,version:o,isTrial:r,type:l}}getLicenseDetails(e,i=!1){const n="CHARTS";if(tw(e))return{licenseKey:e,valid:!1,missing:!0,currentLicenseType:n};const s=Oi.getChartsReleaseDate(),{md5:a,license:o,version:r,isTrial:l,type:c}=Oi.extractLicenseComponents(e);let u=a===this.md5.md5(o)&&!e.includes("For_Trialing_ag-Grid_Only"),d,g,f=null,y=!1,x;function S(){d=ff,r){case"legacy":case"2":{u=!1;break}case"3":tw(c)?u=!1:(x=c,c!==q0["02"]&&c!==q0["0102"]?(u=!1,y=!0):l&&S())}return u?{licenseKey:e,valid:u,expiry:Oi.formatDate(f),expired:g,version:r,isTrial:l,trialExpired:d,invalidLicenseTypeForCombo:i?x!=="BOTH":void 0,incorrectLicenseType:y,currentLicenseType:n,suppliedLicenseType:x}:{licenseKey:e,valid:u,incorrectLicenseType:y,currentLicenseType:n,suppliedLicenseType:x}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isE2ETest()&&!this.isWebsiteUrl()&&!tw(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage??""}getWatermarkForegroundConfig(){const e=this.getWatermarkMessage();if(e)return this.buildWatermarkConfig(e)}getWatermarkForegroundConfigForBrowser(){if(!this.isDisplayWatermark())return;const e=this.getWatermarkMessage();if(e)return this.buildWatermarkConfig(e)}buildWatermarkConfig(e){return{text:e,image:{url:vst,width:170,height:25,right:25,bottom:50,opacity:.7}}}getHostname(){if(!this.document)return"localhost";const e=this.document.defaultView??globalThis;if(!e)return"localhost";try{return(e.location?.hostname??"")||"localhost"}catch{return"localhost"}}isForceWatermark(){if(!this.document)return!1;const e=this.document?.defaultView??globalThis.window!=null?globalThis:void 0;if(!e)return!1;const i=e.location?.pathname;return i?i.includes("forceWatermark"):!1}isWebsiteUrl(){const e=this.getHostname();return/^((?:[\w-]+\.)?ag-grid\.com)$/.exec(e)!==null||/^((?:[\w-]+\.)?bryntum\.com)$/.exec(e)!==null}isLocalhost(){const e=this.getHostname();return/^(?:127\.0\.0\.1|localhost)$/.exec(e)!==null}isE2ETest(){const e=this.getHostname();return/^(?:172\.17\.0\.1|host\.docker\.internal)$/.exec(e)!==null}static formatDate(e){const i=["January","February","March","April","May","June","July","August","September","October","November","December"],n=e.getDate(),s=e.getMonth(),a=e.getFullYear();return n+" "+i[s]+" "+a}static getChartsReleaseDate(){return new Date(Number.parseInt(Oi.decode(Oi.RELEASE_INFORMATION),10))}static decode(e){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let n="",s,a,o,r,l,c,u,d=0;const g=e.replaceAll(/[^A-Za-z0-9+/=]/g,"");for(;d>4,a=(l&15)<<4|c>>2,o=(c&3)<<6|u,n=n+String.fromCodePoint(s),c!=64&&(n=n+String.fromCodePoint(a)),u!=64&&(n=n+String.fromCodePoint(o));return n=Oi.utf8_decode(n),n}static utf8_decode(e){e=e.replaceAll("rn","n");let i="";for(let n=0;n127&&s<2048?(i+=String.fromCodePoint(s>>6|192),i+=String.fromCodePoint(s&63|128)):(i+=String.fromCodePoint(s>>12|224),i+=String.fromCodePoint(s>>6&63|128),i+=String.fromCodePoint(s&63|128))}return i}static setGridContext(e=!1){Oi.gridContext=e}static setLicenseKey(e){this.licenseKey&&this.licenseKey!==e&&console.warn("License Key being set multiple times with different values. This can result in an incorrect license key being used."),this.licenseKey!==e&&(Oi.licenseOutputLogged=!1),Oi.licenseKey=e}static extractBracketedInformation(e){if(!e.includes("["))return["legacy",!1,void 0];const i=e.match(/\[(.*?)\]/g).map(r=>r.replace("[","").replace("]",""));if(!i||i.length===0)return["legacy",!1,void 0];const n=i.filter(r=>r==="TRIAL").length===1,s=i.find(r=>r.startsWith("v")),a=s?s.replace("v",""):"legacy",o=q0[i.find(r=>q0[r])];return[a,n,o]}centerPadAndOutput(e){if(Oi.licenseOutputLogged)return;const i=this.totalMessageLength-e.length;console.error(e.padStart(i/2+e.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(e,i="*",n=""){Oi.licenseOutputLogged||console.error(e.padEnd(this.totalMessageLength-n.length,i)+n)}outputInvalidLicenseKey(e,i,n){Oi.gridContext||(e?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${n} only and does not cover you for ${i}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${OV}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid."," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${OV}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""))),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(e,i,n){Oi.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${n} expired on ${e}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(e){Oi.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${e} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${e} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(e,i,n){Oi.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${n} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${n} released before ${e}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${i}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="License Expired"}};yA.RELEASE_INFORMATION="MTc3NTU0ODM5NDIwNA==";yA.gridContext=!1;yA.licenseOutputLogged=!1;var Jg=yA;function Sst(t,e){const i=t.addChild("canvas-overlay","watermark"),n=$t("span");n.innerText=e,i.addEventListener("animationend",()=>{t.removeChild("canvas-overlay","watermark"),t.removeStyles("watermark")}),i.classList.add("ag-watermark"),i.appendChild(n)}var Mst=`.ag-watermark{position:absolute;bottom:20px;right:25px;font-weight:700;font-family:Impact,sans-serif;font-size:19px;opacity:.7;animation:1s ease-out 3s ag-watermark-fadeout;color:#9b9b9b;pointer-events:none;&:before{content:"";display:block;height:40px;width:170px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=);background-repeat:no-repeat;background-size:170px 40px}>span{padding-left:.7rem}}@keyframes ag-watermark-fadeout{0%{opacity:.5}to{opacity:0}}.ag-charts-dialog{display:flex;flex-direction:column;font-size:var(--ag-charts-chrome-font-size-large)}.ag-charts-dialog__tabs{display:flex;flex-direction:column}.ag-charts-dialog__header{border-bottom:1px solid var(--ag-charts-border-color);display:flex}.ag-charts-dialog__tab-list{display:flex;gap:calc(var(--ag-charts-spacing) * 2)}.ag-charts-dialog__drag-handle{align-items:center;color:inherit;cursor:grab;display:flex;padding:1px 6px;text-align:center}.ag-charts-dialog__drag-handle--dragging{cursor:grabbing}.ag-charts-dialog__tab-button{background:none;border:0;border-bottom:2px solid transparent;border-radius:0;color:var(--ag-charts-panel-subtle-text-color);margin-bottom:-1px;padding:var(--input-padding) calc(var(--input-padding) / 2)}.ag-charts-dialog__tab-button:hover{background:none}.ag-charts-dialog__tab-button--active{border-color:var(--ag-charts-accent-color);color:inherit}.ag-charts-dialog__drag-handle+.ag-charts-dialog__tab-button{margin-inline-start:calc(var(--ag-charts-spacing) * -2)}.ag-charts-button.ag-charts-dialog__close-button{background:none;border:0;margin-inline-start:auto;padding:1px 6px}.ag-charts-dialog__close-button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-dialog__tab-panel{display:none;flex-direction:column;gap:calc(var(--ag-charts-spacing) * 4);margin:0 calc(var(--ag-charts-spacing) * 4);padding:calc(var(--ag-charts-spacing) * 4) 0}.ag-charts-dialog__tab-panel--active{display:flex}.ag-charts-dialog__input-group-line{display:flex;gap:16px 18px;flex-wrap:wrap}.ag-charts-dialog__input-group{align-items:center;display:flex;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-dialog__input-group-label{color:var(--ag-charts-panel-subtle-text-color);margin-inline-end:5px}.ag-charts-dialog__input-group-label[for]{cursor:pointer}.ag-charts-dialog__button{border-radius:0;margin-inline-end:-1px}.ag-charts-dialog__button.ag-charts-dialog__button--active{background:var(--ag-charts-button-focus-background-color);border-color:var(--ag-charts-input-focus-border-color);color:var(--ag-charts-input-focus-text-color);z-index:var(--input-layer-active)}.ag-charts-dialog__button:first-child,.ag-charts-dialog__input-group-label+.ag-charts-dialog__button{border-start-start-radius:var(--ag-charts-input-border-radius);border-end-start-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__button:last-child{border-start-end-radius:var(--ag-charts-input-border-radius);border-end-end-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__color-picker-button{--color: #000;background:var(--color);border:none;color:transparent;height:26px;width:26px}.ag-charts-dialog__color-picker-button:hover{background:var(--color)}.ag-charts-dialog__color-picker-button--multi-color,.ag-charts-dialog__color-picker-button--multi-color:hover{background:linear-gradient(135deg,red 0%,#ff0 calc(100% * 1 / 6),#0f0 calc(100% * 2 / 6),#0ff 50%,#00f calc(100% * 4 / 6),#f0f calc(100% * 5 / 6),red 100%)}.ag-charts-color-picker{width:190px;padding:8px;direction:ltr;cursor:default;--h: 0;--s: 0;--v: 0;--a: 0;--color: #000;--color-a: #000;--thumb-size: 18px;--inner-width: 172px;--track-height: 12px;--palette-height: 136px;--checker: url('data:image/svg+xml;utf8,');--multi-color: linear-gradient( 135deg, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-color-picker__content{display:flex;flex-direction:column}.ag-charts-color-picker__palette{position:relative;width:100%;height:var(--palette-height);margin-bottom:8px;background:linear-gradient(to bottom,#0000,#000),linear-gradient(to right,#fff,#fff0) hsl(var(--h),100%,50%);border-radius:calc(var(--ag-charts-border-radius) * 1.5);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__palette:after{content:"";position:absolute;display:block;top:calc(var(--thumb-size) * -.5 + (1 - var(--v)) * 100%);left:calc(var(--thumb-size) * -.5 + var(--s) * 100%);background:var(--color);width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__palette:focus-visible:after{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),0 0 0 2px #fff8,var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-row{display:flex;gap:8px;align-items:center;margin-bottom:4px;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input,.ag-charts-color-picker__alpha-input{-webkit-appearance:none;display:block;position:relative;padding:0;margin:0 calc(var(--inset) * -1);border:0;height:var(--thumb-size);width:auto;background:transparent;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input::-moz-range-thumb,.ag-charts-color-picker__alpha-input::-moz-range-thumb{appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__hue-input::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{-webkit-appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038;transform:translateZ(0)}.ag-charts-color-picker__hue-input::-moz-range-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__hue-input::-webkit-slider-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__alpha-input::-moz-range-thumb{background:transparent}.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{background:transparent}.ag-charts-color-picker__alpha-input--opaque::-moz-range-thumb{background:var(--color)}.ag-charts-color-picker__alpha-input--opaque::-webkit-slider-thumb{background:var(--color)}.ag-charts-color-picker__hue-input:focus-visible::-moz-range-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-moz-range-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input:focus-visible::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-webkit-slider-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input::-moz-range-track,.ag-charts-color-picker__alpha-input::-moz-range-track{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__hue-input:before,.ag-charts-color-picker__alpha-input:before{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button{width:36px;margin-left:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);border:0;background:var(--multi-color);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button--hidden{display:none}.ag-charts-color-picker__multi-color-button--active{box-shadow:inset 0 0 0 1px #0003;outline-offset:1px;outline:2px solid #2196f3}.ag-charts-color-picker__hue-input{flex:1 0 0}.ag-charts-color-picker__hue-input::-moz-range-track{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__hue-input:before{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__alpha-input{margin-bottom:7px}.ag-charts-color-picker__alpha-input::-moz-range-track{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__alpha-input:before{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__color-field{display:flex;border:var(--ag-charts-border);background:var(--ag-charts-background-color);border-radius:var(--ag-charts-border-radius);overflow:hidden}.ag-charts-color-picker__color-field:has(:focus-visible){border-color:var(--ag-charts-accent-color);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-label{width:16px;height:16px;margin:7px 0;margin-inline-start:7px;color:transparent;background:linear-gradient(to right,var(--color-a),var(--color-a)),var(--checker) top left / 4px 4px;border-radius:calc(var(--ag-charts-border-radius) / 2);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__color-label--multi-color{background:var(--multi-color)}.ag-charts-color-picker__color-input{flex:1;min-width:0;padding:7px 7px 7px 8px;border:0;margin:0;color:inherit;background:transparent;font-variant:tabular-nums}.ag-charts-color-picker__color-input:focus-visible{border:none;outline:none}.ag-charts-annotations__line-stroke-width-menu,.ag-charts-annotations__line-style-type-menu,.ag-charts-annotations__text-size-menu{border-top-left-radius:0;border-top-right-radius:0;.ag-charts-menu__row:first-child{border-radius:0}}.ag-charts-annotations__text-size-menu{--item-padding: 4px 8px;min-width:34px;text-align:center}.ag-charts-annotations__line-stroke-width-menu{--item-padding: 6px;column-gap:6px}.ag-charts-annotations__line-style-type-menu{--item-padding: 6px;column-gap:0}.ag-charts-annotations__stroke-width-button:before{background:var(--ag-charts-foreground-color);content:"";margin-inline-end:var(--toolbar-button-padding);height:min(var(--stroke-width),20px);width:12px}.ag-charts-annotations__stroke-width-button[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-annotations__color-picker-button{--emblem: var(--color)}.ag-charts-annotations__color-picker-button--multi-color{--emblem: linear-gradient( to right, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-annotations__color-picker-button:after{content:"";display:block;position:absolute;bottom:3px;left:5px;right:5px;height:4px;border-radius:99px;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ag-charts-foreground-color) 10%,transparent);background:var(--emblem)}.ag-charts-annotations__color-picker-button[aria-disabled=true]:after{filter:grayscale(1);opacity:.5}.ag-charts-annotations__toolbar-menu{min-width:200px}.ag-charts-annotations__axis-button--hidden{display:none}.ag-charts-annotations__axis-button{background-color:var(--ag-charts-crosshair-label-background-color);border-radius:calc(var(--ag-charts-border-radius) / 2);border:none;box-sizing:border-box;color:var(--ag-charts-crosshair-label-text-color);cursor:pointer;font-family:var(--ag-charts-button-font-family);font-size:var(--ag-charts-button-font-size);font-weight:var(--ag-charts-button-font-weight);left:0;line-height:16px;overflow:hidden;padding:0;position:absolute;top:0;user-select:none;white-space:nowrap;z-index:var(--ag-charts-layer-annotations)}.ag-charts-annotations__axis-button:hover{opacity:.8;color:var(--ag-charts-background-color)}.ag-charts-dialog--annotation-settings{min-height:233px;width:289px}.ag-charts-dialog--annotation-settings .ag-charts-textarea{height:calc(10px * 2 + var(--textarea-line-height) * 1em * 3 + 2px);overflow-y:auto;resize:vertical}.ag-charts-context-menu{font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-context-menu__cover{position:fixed;left:0;top:0}.ag-charts-context-menu__menu{background:var(--ag-charts-menu-background-color);border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-border-radius);border-style:solid;border-width:var(--ag-charts-menu-border-width);box-shadow:var(--ag-charts-popup-shadow);color:var(--ag-charts-menu-text-color);display:flex;flex-direction:column;padding:.5em 0;transition:transform .1s ease;white-space:nowrap}.ag-charts-context-menu__menu:focus{outline:none}.ag-charts-context-menu__item{align-items:center;background:none;border:none;box-sizing:border-box;color:inherit;cursor:pointer;display:flex;font:inherit;justify-content:space-between;text-align:start;width:100%;-webkit-appearance:none;-moz-appearance:none}.ag-charts-context-menu__icon>img{width:var(--ag-charts-icon-size);height:var(--ag-charts-icon-size)}.ag-charts-context-menu__icon,.ag-charts-context-menu__cell{display:flex;align-items:center;flex-shrink:0}.ag-charts-context-menu__cell{flex-grow:1}.ag-charts-context-menu__cellpadding{padding:.5em 1em}.ag-charts-context-menu__icon{padding-inline-end:0}.ag-charts-context-menu__item[data-focus-override=true],.ag-charts-context-menu__item:focus,.ag-charts-context-menu__item:active{background:var(--ag-charts-focus-color)}.ag-charts-context-menu__item[data-focus-override=false]{background:inherit}.ag-charts-context-menu__item[data-focus-visible-override=true]:focus,.ag-charts-context-menu__item:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-context-menu__item[data-focus-visible-override=false]{outline:inherit;box-shadow:inherit;z-index:inherit}.ag-charts-context-menu__item[aria-disabled=true]{border:none;color:color-mix(in srgb,var(--ag-charts-input-text-color) 50%,transparent)}.ag-charts-context-menu__item[aria-disabled=true]:focus{background:inherit;cursor:inherit}.ag-charts-wrapper[dir=rtl] .ag-charts-context-menu__item .ag-charts-icon-chevron-right{transform:scaleX(-1)}.ag-charts-context-menu__divider{padding:5px 0}.ag-charts-context-menu__divider:after{content:"";display:block;border-top:1px solid var(--ag-charts-border-color)}.ag-charts-crosshair-label{position:absolute;left:0;top:0;user-select:none;pointer-events:none;font-family:var(--ag-charts-font-family);font-size:var(--ag-charts-font-size);font-weight:var(--ag-charts-font-weight);overflow:hidden;white-space:nowrap;z-index:var(--ag-charts-layer-crosshair);box-sizing:border-box}.ag-charts-crosshair-label-content{padding:0 8px;border-radius:calc(var(--ag-charts-border-radius) / 2);line-height:calc(var(--ag-charts-font-size) + 8px);background-color:var(--ag-charts-crosshair-label-background-color);color:var(--ag-charts-crosshair-label-text-color)}.ag-charts-crosshair-label--hidden{visibility:hidden!important}.ag-charts-text-input{position:absolute}.ag-charts-text-input__textarea{--placeholder-text-color: var(--ag-charts-input-placeholder-text-color);display:block;height:100%;width:100%;border:0;background:none;line-height:1.38;outline:none;transform:translateY(.09em)}.ag-charts-text-input__textarea[placeholder]:empty:before{content:attr(placeholder);color:var(--placeholder-text-color);font-weight:400}.ag-charts-text-input__textarea[placeholder]:not(:empty):before{content:""}.ag-charts-chart-toolbar__menu{min-width:200px}.ag-charts-range-buttons{--toolbar-size: var(--ag-charts-ranges-min-size);--toolbar-border-radius: var(--ag-charts-ranges__button-corner-radius);--toolbar-button-background-color: var(--ag-charts-ranges__button-fill);--toolbar-button-border-color: var(--ag-charts-ranges__button-stroke);--toolbar-button-border-width: var(--ag-charts-ranges__button-stroke-width);--toolbar-button-gap: var(--ag-charts-ranges-gap);--toolbar-button-text-color: var(--ag-charts-ranges__button-text-color);--toolbar-button-background-color--active: var(--ag-charts-ranges__button-fill--active);--toolbar-button-border-color--active: var(--ag-charts-ranges__button-stroke--active);--toolbar-button-text-color--active: var(--ag-charts-ranges__button-text-color--active);--toolbar-button-background-color--disabled: var(--ag-charts-ranges__button-fill--disabled);--toolbar-button-border-color--disabled: var(--ag-charts-ranges__button-stroke--disabled);--toolbar-button-text-color--disabled: var(--ag-charts-ranges__button-text-color--disabled);--toolbar-button-background-color--hover: var(--ag-charts-ranges__button-fill--hover);--toolbar-button-border-color--hover: var(--ag-charts-ranges__button-stroke--hover);--toolbar-button-text-color--hover: var(--ag-charts-ranges__button-text-color--hover)}.ag-charts-range-buttons--dropdown{--toolbar-border-radius: var(--ag-charts-ranges__dropdown-corner-radius);--toolbar-button-background-color: var(--ag-charts-ranges__dropdown-fill);--toolbar-button-border-color: var(--ag-charts-ranges__dropdown-stroke);--toolbar-button-border-width: var(--ag-charts-ranges__dropdown-stroke-width);--toolbar-button-text-color: var(--ag-charts-ranges__dropdown-text-color);--toolbar-button-background-color--active: var(--ag-charts-ranges__dropdown-fill--active);--toolbar-button-border-color--active: var(--ag-charts-ranges__dropdown-stroke--active);--toolbar-button-text-color--active: var(--ag-charts-ranges__dropdown-text-color--active);--toolbar-button-background-color--disabled: var(--ag-charts-ranges__dropdown-fill--disabled);--toolbar-button-border-color--disabled: var(--ag-charts-ranges__dropdown-stroke--disabled);--toolbar-button-text-color--disabled: var(--ag-charts-ranges__dropdown-text-color--disabled);--toolbar-button-background-color--hover: var(--ag-charts-ranges__dropdown-fill--hover);--toolbar-button-border-color--hover: var(--ag-charts-ranges__dropdown-stroke--hover);--toolbar-button-text-color--hover: var(--ag-charts-ranges__dropdown-text-color--hover)}.ag-charts-range-buttons .ag-charts-toolbar__button{font-size:var(--ag-charts-ranges__button-font-size);font-family:var(--ag-charts-ranges__button-font-family);font-weight:var(--ag-charts-ranges__button-font-weight);padding-top:var(--ag-charts-ranges__button-padding-top);padding-right:var(--ag-charts-ranges__button-padding-right);padding-bottom:var(--ag-charts-ranges__button-padding-bottom);padding-left:var(--ag-charts-ranges__button-padding-left)}.ag-charts-range-buttons--dropdown .ag-charts-toolbar__button{flex:1;justify-content:space-between;font-size:var(--ag-charts-ranges__dropdown-font-size);font-family:var(--ag-charts-ranges__dropdown-font-family);font-weight:var(--ag-charts-ranges__dropdown-font-weight);padding-top:var(--ag-charts-ranges__dropdown-padding-top);padding-right:var(--ag-charts-ranges__dropdown-padding-right);padding-bottom:var(--ag-charts-ranges__dropdown-padding-bottom);padding-left:var(--ag-charts-ranges__dropdown-padding-left);.ag-charts-toolbar__icon{margin-top:calc(var(--ag-charts-ranges__dropdown-font-size) - 15px);margin-bottom:calc(var(--ag-charts-ranges__dropdown-font-size) - 15px);height:calc(var(--ag-charts-ranges__dropdown-font-size) + 8px);width:calc(var(--ag-charts-ranges__dropdown-font-size) + 8px)}}.ag-charts-range-buttons--gapped{.ag-charts-toolbar__button{border-radius:var(--toolbar-border-radius);border-width:var(--toolbar-button-border-width)}.ag-charts-toolbar__button--active,.ag-charts-toolbar__button--active:hover{+.ag-charts-toolbar__button{border-inline-start-color:var(--toolbar-button-border-color)}}}.ag-charts-range-buttons-menu{background:var(--ag-charts-ranges__dropdown-fill);border-color:var(--ag-charts-ranges__dropdown-stroke);border-radius:var(--ag-charts-ranges__dropdown-corner-radius);border-width:var(--ag-charts-ranges__dropdown-stroke-width);color:var(--ag-charts-ranges__dropdown-text-color);.ag-charts-menu__row{font-size:var(--ag-charts-ranges__dropdown-font-size);font-family:var(--ag-charts-ranges__dropdown-font-family);font-weight:var(--ag-charts-ranges__dropdown-font-weight);padding-top:var(--ag-charts-ranges__dropdown-padding-top);padding-right:var(--ag-charts-ranges__dropdown-padding-right);padding-bottom:var(--ag-charts-ranges__dropdown-padding-bottom);padding-left:var(--ag-charts-ranges__dropdown-padding-left)}.ag-charts-menu__row:focus{background:var(--ag-charts-ranges__dropdown-fill--hover)}.ag-charts-menu__row[aria-disabled=true]{background:var(--ag-charts-ranges__dropdown-fill--disabled);color:var(--ag-charts-ranges__dropdown-text-color--disabled)}}.ag-charts-zoom-buttons{direction:ltr;align-items:center;display:flex;height:44px;justify-content:center;overflow:hidden;padding-bottom:10px;pointer-events:none;width:100%;.ag-charts-toolbar{--toolbar-size: 24px;--toolbar-button-padding: 1px;display:flex;font-size:var(--ag-charts-chrome-font-size);height:var(--toolbar-size);justify-content:center;opacity:1;pointer-events:auto;transition:opacity .2s ease-in-out,transform .4s ease-in-out;.ag-charts-toolbar__button--first{border-end-start-radius:var(--ag-charts-border-radius);border-start-start-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__button--last{border-end-end-radius:var(--ag-charts-border-radius);border-start-end-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__label{padding-inline-start:var(--ag-charts-spacing);padding-inline-end:var(--ag-charts-spacing)}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{padding-inline-start:0}.ag-charts-toolbar__button--group-first{margin-inline-start:calc(var(--ag-charts-spacing) * 2)}&.ag-charts-zoom-buttons__toolbar--hidden{opacity:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out}}}.ag-charts-shared-toolbar{--toolbar-button-gap: calc(var(--ag-charts-spacing) * 2);.ag-charts-toolbar__button{border-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--active+.ag-charts-toolbar__button{border-inline-start-color:var(--ag-charts-border-color)}} +`;function ew(t,e,i){const n=Math.floor(t.length/2);return EV(t,e,n,e,i)||EV(t,t.length-e,n,-e,i)}function EV(t,e,i,n,s){let a=t[0];for(let o=e;n>0?o<=i:o>i;o+=n){const r=t[o];if(s(a,r))return!0;a=r}return!1}var{AxisInterval:Dst}=j,qL=class extends Dst{};M([b],qL.prototype,"minSpacing");var{Group:iw,LabelStyle:Ast}=j,ym=class extends Ast{constructor(){super(...arguments),this.padding=5}};M([b],ym.prototype,"enabled");M([b],ym.prototype,"padding");M([b],ym.prototype,"text");M([b],ym.prototype,"parallel");var qs=class extends xt{constructor(){super(...arguments),this.id=Nn(this),this.defaultColorRange=[],this.shape="polygon",this.label=new ym,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.gridPadding=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction=z.Angle,this.axisInnerRadius=0,this.axisOuterRadius=0,this.lineGroup=new iw({name:this.id}),this.rangeGroup=new iw({name:this.id}),this.labelGroup=new iw({name:this.id}),this._isRange=void 0}assignCrossLineGroup(t,e){t!==this._isRange&&(t?this.rangeGroup.appendChild(e):this.lineGroup.appendChild(e)),this._isRange=t}setSectorNodeProps(t){t.fill=this.fill,t.fillOpacity=this.fillOpacity??1,t.stroke=this.stroke,t.strokeOpacity=this.strokeOpacity??1,t.strokeWidth=this.strokeWidth??1,t.lineDash=this.lineDash}setLabelNodeProps(t,e,i,n,s){const{label:a}=this;t.x=e,t.y=i,t.text=a.text,t.textAlign="center",t.textBaseline=n,t.rotation=s,t.rotationCenterX=e,t.rotationCenterY=i,t.fill=a.color,t.setFont(a),t.setBoxing(a),t.visible=!0}};qs.className="PolarCrossLine";M([b],qs.prototype,"enabled");M([b],qs.prototype,"type");M([b],qs.prototype,"range");M([b],qs.prototype,"value");M([b],qs.prototype,"defaultColorRange");M([b],qs.prototype,"fill");M([b],qs.prototype,"fillOpacity");M([b],qs.prototype,"stroke");M([b],qs.prototype,"strokeWidth");M([b],qs.prototype,"strokeOpacity");M([b],qs.prototype,"lineDash");M([b],qs.prototype,"shape");M([b],qs.prototype,"label");var{getCrossLineValue:Ist,validateCrossLineValue:kst,Group:Cst,Path:RV,Sector:wst,RotatableText:Nst,ContinuousScale:Tst}=j,QL=class extends qs{constructor(){super(),this.direction=z.Angle,this.polygonNode=new RV,this.sectorNode=new wst,this.lineNode=new RV,this.crossLineRange=new Cst,this.labelNode=new Nst,this.ticks=[],this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}visibilityCheck(){if(!Tst.is(this.scale))return!0;const[t,e]=this.scale.domain,i=Ist(this);if(this.type==="range"){const[n,s]=i;return n>=t&&n<=e&&s>=n&&s<=e}else return i>=t&&i<=e}update(t){const{scale:e}=this;if(!e||!kst(this,e)||!this.visibilityCheck()){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,this.updateLineNode(t),this.updatePolygonNode(t),this.updateSectorNode(t),this.updateLabelNode(t)}updateLineNode(t){const{scale:e,type:i,value:n,lineNode:s}=this;if(!t||i!=="line"||!e){s.visible=!1;return}const a=e.convert(n);if(Number.isNaN(a)){s.visible=!1;return}const{axisInnerRadius:o,axisOuterRadius:r}=this;s.visible=!0,s.stroke=this.stroke,s.strokeOpacity=this.strokeOpacity??1,s.strokeWidth=this.strokeWidth??1,s.fill=void 0,s.lineDash=this.lineDash;const l=r*Math.cos(a),c=r*Math.sin(a),u=o*Math.cos(a),d=o*Math.sin(a);s.path.clear(!0),s.path.moveTo(u,d),s.path.lineTo(l,c),this.assignCrossLineGroup(!1,this.crossLineRange)}updatePolygonNode(t){const{polygonNode:e,range:i,scale:n,shape:s,type:a,ticks:o}=this;if(!t||a!=="range"||s!=="polygon"||!n||!i){e.visible=!1;return}const{axisInnerRadius:r,axisOuterRadius:l}=this,c=o.indexOf(i[0]),u=o.indexOf(i[1]),g=(c<=u?o.slice(c,u+1):o.slice(c).concat(o.slice(0,u+1))).map(y=>n.convert(y));e.visible=!0,this.setSectorNodeProps(e);const{path:f}=e;f.clear(!0);for(const[y,x]of g.entries()){const S=l*Math.cos(x),D=l*Math.sin(x);y===0?f.moveTo(S,D):f.lineTo(S,D)}if(r===0)f.lineTo(0,0);else{const y=g.slice().reverse();for(const x of y){const S=r*Math.cos(x),D=r*Math.sin(x);f.lineTo(S,D)}}e.path.closePath(),this.assignCrossLineGroup(!0,this.crossLineRange)}updateSectorNode(t){const{sectorNode:e,range:i,scale:n,shape:s,type:a}=this;if(!t||a!=="range"||s!=="circle"||!n||!i){e.visible=!1;return}const{axisInnerRadius:o,axisOuterRadius:r}=this,l=i.map(d=>n.convert(d)),c=n.step??0,u=n instanceof j.BandScale?c/2:0;e.visible=!0,this.setSectorNodeProps(e),e.centerX=0,e.centerY=0,e.innerRadius=o,e.outerRadius=r,e.startAngle=l[0]-u,e.endAngle=l[1]+u,this.assignCrossLineGroup(!0,this.crossLineRange)}updateLabelNode(t){const{label:e,labelNode:i,range:n,scale:s,type:a,ticks:o}=this;if(!t||e.enabled===!1||!e.text||!s||a==="range"&&!n){i.visible=!1;return}i.visible=!0;const{axisInnerRadius:r,axisOuterRadius:l}=this;let c,u,d,g;if(a==="line"){const f=ze(s.convert(this.value)),y=1.5*Math.PI,x=be(f,y)||f>y||fze(s.convert(A)));let x=(f+y)/2;f>y&&(x-=Math.PI),x=ze(x);const S=(be(x,0)||x>0)&&xl.value),r=o.reduce((l,c)=>Math.max(typeof c=="number"?Hf(c):0,l),0);return{niceDomain:s,tickDomain:s,ticks:o,rawTickCount:void 0,fractionDigits:r,timeInterval:void 0,bbox:this.getBBox()}}update(){super.update(),this.updateRadiusLine(),this.updateGridLines(),this.updateTickLines()}normalizedAngles(){const t=ze(-Math.PI/2+Ze(this.startAngle)),e=this.endAngle==null?2*Math.PI:Wb(Ze(this.endAngle)-Ze(this.startAngle)),i=t+e;return[t,i]}computeRange(){this.range=this.normalizedAngles()}updateSelections(){const t=this.tickData;this.gridLineGroupSelection.update(this.gridLength&&this.gridLine.enabled?t:[]),this.tickLineGroupSelection.update(this.tick.enabled?t:[]),this.tickLabelGroupSelection.update(this.label.enabled?t:[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup()}updatePosition(){super.updatePosition();const{translation:t,radiusLineGroup:e}=this,i=Math.floor(t.x),n=Math.floor(t.y);e.translationX=i,e.translationY=n}updateRadiusLine(){const t=this.radiusLine,{path:e}=t;e.clear(!0);const{points:i,closePath:n}=this.getAxisLinePoints();for(const{x:s,y:a,moveTo:o,arc:r,radius:l=0,startAngle:c=0,endAngle:u=0}of i)r?e.arc(s,a,l,c,u):o?e.moveTo(s,a):e.lineTo(s,a);n&&e.closePath(),t.visible=this.line.enabled,t.stroke=this.line.stroke,t.strokeWidth=this.line.width,t.fill=void 0}getAxisLinePoints(){const{scale:t,shape:e,gridLength:i}=this,[n,s]=this.range,a=be(s-n,2*Math.PI),o=[];if(e==="circle")a?o.push({x:i,y:0,moveTo:!0},{x:0,y:0,radius:i,startAngle:0,endAngle:2*Math.PI,arc:!0,moveTo:!1}):o.push({x:i*Math.cos(n),y:i*Math.sin(n),moveTo:!0},{x:0,y:0,radius:i,startAngle:ze(n),endAngle:ze(s),arc:!0,moveTo:!1});else if(e==="polygon"){const r=t.ticks({nice:[this.nice,this.nice],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>t.convert(l));if(r&&r.length>2)for(const[l,c]of r.entries()){const u=i*Math.cos(c),d=i*Math.sin(c),g=l===0;o.push({x:u,y:d,moveTo:g})}}return{points:o,closePath:a}}updateGridLines(){const{scale:t,gridLength:e,gridLine:{style:i,width:n},innerRadiusRatio:s}=this;if(!(i&&e>0))return;const a=e*s,o=i.length;this.gridLineGroupSelection.each((r,l,c)=>{const{value:u}=l,{stroke:d,lineDash:g}=i[c%o],f=t.convert(u);r.x1=a*Math.cos(f),r.y1=a*Math.sin(f),r.x2=e*Math.cos(f),r.y2=e*Math.sin(f),r.stroke=d,r.strokeWidth=n,r.lineDash=g,r.fill=void 0}),this.gridLineGroupSelection.cleanup()}updateLabels(){const{label:t,tickLabelGroupSelection:e}=this;e.each((i,n,s)=>{const a=this.labelData[s];if(!a||a.hidden){i.visible=!1;return}i.text=a.text,i.setFont(t),i.fill=t.color,i.x=a.x,i.y=a.y,i.setAlign(a),i.setBoxing(t),i.visible=!0,a.rotation?(i.rotation=a.rotation,i.rotationCenterX=a.x,i.rotationCenterY=a.y):i.rotation=0})}updateTickLines(){const{scale:t,gridLength:e,tick:i,tickLineGroupSelection:n}=this;n.each((s,a)=>{const{value:o}=a,r=t.convert(o),l=Math.cos(r),c=Math.sin(r);s.x1=e*l,s.y1=e*c,s.x2=(e+i.size)*l,s.y2=(e+i.size)*c,s.stroke=i.stroke,s.strokeWidth=i.width})}createLabelNodeData(t,e,i){const{label:n,gridLength:s,scale:a,tick:o}=this;if(!n.enabled)return[];const r=new Ost,l=i.x-this.translation.x,c=i.x+i.width-this.translation.x,{fractionDigits:u}=this.layout.label,d=this.tickFormatter(this.scale.domain,this.tickData,!1,u),g=t.map((f,y)=>{const{value:x}=f,S=s+n.spacing+o.size,D=a.convert(x),A=Math.cos(D),I=Math.sin(D),w=S*A,N=S*I,{textAlign:O,textBaseline:L}=this.getLabelAlign(D),R=y===t.length-1&&x!==t[0]&&be(ze(D),ze(a.convert(t[0]))),P=this.getLabelRotation(D);let B=d(x,y);r.text=B,r.x=w,r.y=N,r.setFont(n),r.textAlign=O,r.textBaseline=L,r.rotation=P,P&&(r.rotationCenterX=w,r.rotationCenterY=N);let F=P?Est.toCanvas(r):r.getBBox();if(F&&e.hideWhenNecessary&&!P){const H=l-F.x,$=F.x+F.width-c,Y=1;if(H>Y||$>Y){const V={maxWidth:F.width-Math.max(H,$),font:n,textWrap:"never"};B=Lx(B,V),r.text=B,F=r.getBBox()}}return{text:B,x:w,y:N,textAlign:O,textBaseline:L,hidden:B===""||(f.hidden??R),rotation:P,box:F}});return n.avoidCollisions&&this.avoidLabelCollisions(g),g}computeLabelsBBox(t,e){this.labelData=this.createLabelNodeData(this.tickData,t,e);const i=this.labelData.map(({box:n})=>n).filter(n=>n!=null);return!this.label.enabled||i.length===0?null:Rst.merge(i)}getLabelOrientation(){const{label:t}=this;return t instanceof qN?t.orientation:"fixed"}getLabelRotation(t){let e=Ze(this.label.rotation??0);t=ze(t);const i=this.getLabelOrientation();return i==="parallel"?(e+=t,t>=0&&t=Math.PI/2&&t<1.5*Math.PI&&(e+=Math.PI)),e}getLabelAlign(t){const e=Math.cos(t),i=Math.sin(t);let n,s;const a=this.getLabelOrientation(),o=be(e,0),r=be(i,0),l=be(e,1),c=be(i,-1),u=e>0&&!o,d=i>0&&!r;return a==="parallel"?(n="center",s=l&&r||d?"top":"bottom"):a==="perpendicular"?(n=c||u?"left":"right",s="middle"):(n="right",o?n="center":u&&(n="left"),s="bottom",r?s="middle":d&&(s="top")),{textAlign:n,textBaseline:s}}updateCrossLines(){const{shape:t,gridLength:e,innerRadiusRatio:i}=this;for(const n of this.crossLines)n instanceof QL&&(n.ticks=this.tickData.map(s=>s.value),n.shape=t,n.axisOuterRadius=e,n.axisInnerRadius=e*i);super.updateCrossLines()}};iv.CrossLineConstructor=QL;M([b],iv.prototype,"startAngle");M([b],iv.prototype,"endAngle");var{CategoryScale:Pst}=j,bm=class extends iv{constructor(t){super(t,new Pst),this.groupPaddingInner=0,this.paddingInner=0,this.interval=new qL}hasDefinedDomain(){return!1}generateAngleTicks(t){const{scale:e,gridLength:i}=this,{values:n,minSpacing:s}=this.interval,a={nice:[this.nice,this.nice],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},o=n??e.ticks(a,t)?.ticks??[];if(o.length<2||s==null)return o.map(d=>({value:d,visible:!0}));const r=o[0],l=e.convert(r),c=i*Math.cos(l),u=i*Math.sin(l);for(let d=1;dMath.PI)break;const y=i*Math.cos(f),x=i*Math.sin(f);if(Math.hypot(y-c,x-u)>s){const D=new Set([r]);return ew(o,d,(A,I)=>{D.add(I)}),o.map(A=>{const I=D.has(A);return{value:A,visible:I}})}}return[{value:r,visible:!0}]}avoidLabelCollisions(t){const{minSpacing:e}=this.label;if(t.length<3)return;const i=(l,c)=>{if(l.hidden||c.hidden)return!1;if(e==null)return l.box.collidesBBox(c.box);const u=l.box.clone().grow(e/2),d=c.box.clone().grow(e/2);return u.collidesBBox(d)},n=t[0],s=t.at(-1),a=new Set([n]),o=be(n.x,s.x)&&be(n.y,s.y),r=Math.floor(t.length/2);for(let l=1;l<=r;l++){const c=o?t.slice(0,-1):t;if(!ew(c,l,i)){ew(c,l,(d,g)=>{a.add(g)});break}}for(const l of t)a.has(l)||(l.hidden=!0,l.box=void 0)}tickFormatParams(){return{type:"category"}}datumFormatParams(t,e){const{datum:i,seriesId:n,legendItemName:s,key:a,source:o,property:r,domain:l,boundSeries:c}=e;return{type:"category",value:t,datum:i,seriesId:n,legendItemName:s,key:a,source:o,property:r,domain:l,boundSeries:c}}};bm.className="AngleCategoryAxis";bm.type="angle-category";M([b],bm.prototype,"groupPaddingInner");M([b],bm.prototype,"paddingInner");M([b],bm.prototype,"interval");j.angleCategoryAxisOptionsDefs;var{LinearScale:nw}=j,nK=class QN extends nw{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(e,i){const[n,s]=i;let a=nw.getTickStep(n,s,e);const o=Number.isNaN(e.maxTickCount)?1/0:e.maxTickCount,r=Math.abs(s-n)/a;let l=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));return l>o&&(l/=2,a*=2),{count:l,step:a}}ticks(e,i=this.domain){const{arcLength:n}=this;if(!i||i.length<2||i.some(u=>!Number.isFinite(u))||n<=0)return{ticks:[],count:0};const{nice:s,interval:a}=e,[o,r]=i;if(a){const u=Math.abs(a),d=this.getPixelRange();if(!lp((r-o)/u,d)){const g=Df(o,r,u);return{ticks:g.ticks,count:g.count}}}let l;if(s&&this.hasNiceRange()){const u=super.niceDomain(e,i);l=QN.getNiceStepAndTickCount(e,u).step}else l=nw.getTickStep(o,r,e);const c=Df(o,r,l);return{ticks:c.ticks,count:c.count}}hasNiceRange(){const e=this.range.slice().sort((n,s)=>n-s);return[Math.PI,2*Math.PI].some(n=>be(n,e[1]-e[0]))}niceDomain(e,i=this.domain){const n=super.niceDomain(e,i);if(!this.hasNiceRange())return n;const s=n[0]>n[1],a=s?n[1]:n[0],{step:o,count:r}=QN.getNiceStepAndTickCount(e,n),l=1/o,c=o>=1?Math.ceil(a/o+r)*o:Math.ceil((a+r*o)*l)/l;return s?[c,a]:[a,c]}getPixelRange(){return this.arcLength}},Bp=class extends iv{constructor(t){super(t,new nK),this.shape="circle",this.interval=new qL}hasDefinedDomain(){const{min:t,max:e}=this;return t!=null&&e!=null&&td>=c&&d<=u).sort((d,g)=>d-g)}return l.map(c=>({value:c,visible:!0}))}avoidLabelCollisions(t){const{minSpacing:e}=this.label,i=(a,o)=>{if(a.hidden||o.hidden)return!1;if(e==null)return a.box.collidesBBox(o.box);const r=a.box.clone().grow(e/2),l=o.box.clone().grow(e/2);return r.collidesBBox(l)},n=t[0],s=t.at(-1);n!==s&&be(n.x,s.x)&&be(n.y,s.y)&&(s.hidden=!0);for(let a=1;a0&&(l.hidden=!0,l.box=void 0);return}}for(const[a,o]of t.entries())a>0&&(o.hidden=!0,o.box=void 0)}tickFormatParams(t,e,i){return{type:"number",visibleDomain:void 0,fractionDigits:i}}datumFormatParams(t,e,i){const{datum:n,seriesId:s,legendItemName:a,key:o,source:r,property:l,domain:c,boundSeries:u}=e;return{type:"number",value:t,datum:n,seriesId:s,legendItemName:a,key:o,source:r,property:l,domain:c,boundSeries:u,fractionDigits:i,visibleDomain:void 0}}};Bp.className="AngleNumberAxis";Bp.type="angle-number";M([b],Bp.prototype,"min");M([b],Bp.prototype,"max");M([b],Bp.prototype,"preferredMin");M([b],Bp.prototype,"preferredMax");M([b],Bp.prototype,"interval");j.angleNumberAxisOptionsDefs;var{OrdinalTimeScale:zst,ApproximateOrdinalTimeScale:Bst,APPROXIMATE_THRESHOLD:Vst,TimeAxisParentLevel:_st,minimumTimeAxisDatumGranularity:Fst}=j,JL=class extends j.DiscreteTimeAxis{constructor(t){const e=new zst;super(t,e),this.parentLevel=new _st,this.accurateScale=e,this.approximateScale=new Bst,this.approximateScale.setSourceScale(e),Object.defineProperty(this,"scale",{get:()=>this.getActiveScale(),configurable:!0})}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}getActiveScale(){const t=this.accurateScale.bandCount(this.visibleRange);return(this.accurateScale.getUniformityCache(this.visibleRange)?.isUniform??!1)&&t>=Vst?this.approximateScale:this.accurateScale}processData(){super.processData();const{boundSeries:t,direction:e}=this;this.minimumTimeGranularity=Fst(t,e,void 0,void 0)}tickFormatParams(t,e,i,n){n??(n=ID(e));const s=kD(t),a=Er(n),o=Al(n),r=rp(n);return{type:"date",unit:a,step:o,epoch:r,truncateDate:s}}datumFormatParams(t,e,i,n,s){if(typeof t=="number"&&(t=new Date(t)),n==null){const{minimumTimeGranularity:S}=this,D=Bx(t);S!=null&&Ms(S)=this.axisInnerRadius&&n<=this.axisOuterRadius),this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,this.updatePolygonNode(t),this.updateSectorNode(t),this.updateLabelNode(t),this.assignCrossLineGroup(this.type==="range",this.crossLineRange)}updateRadii(){const{range:t,scale:e,type:i,axisInnerRadius:n,axisOuterRadius:s}=this;if(!e)return{innerRadius:0,outerRadius:0};const a=l=>s+n-l;let o,r;if(i==="line")o=a(e.convert(this.value)),r=o;else{const l=Math.abs(e?.bandwidth??0),c=t.map(u=>e.convert(u));o=a(Math.max(...c)),r=a(Math.min(...c))+l}this.outerRadius=o,this.innerRadius=r}drawPolygon(t,e,i){for(const[n,s]of e.entries()){const a=t*Math.cos(s),o=t*Math.sin(s);n===0?i.path.moveTo(a,o):i.path.lineTo(a,o)}i.path.closePath()}updatePolygonNode(t){const{gridAngles:e,polygonNode:i,scale:n,shape:s,type:a,innerRadius:o,outerRadius:r}=this;if(!t||s!=="polygon"||!n||!e){i.visible=!1;return}i.visible=!0;const l=this.getPadding();i.path.clear(!0),this.drawPolygon(r-l,e,i);const c=e.slice().reverse(),u=a==="line"?r-l:o+l;this.drawPolygon(u,c,i),this.setSectorNodeProps(i)}updateSectorNode(t){const{axisInnerRadius:e,axisOuterRadius:i,scale:n,sectorNode:s,shape:a,innerRadius:o,outerRadius:r}=this;if(!t||a!=="circle"||!n){s.visible=!1;return}s.visible=!0,s.startAngle=0,s.endAngle=2*Math.PI;const l=this.getPadding(),c=Nt(e,o+l,i),u=Nt(e,r-l,i);s.innerRadius=Math.min(c,u),s.outerRadius=Math.max(c,u),this.setSectorNodeProps(s)}updateLabelNode(t){const{innerRadius:e,label:i,labelNode:n,scale:s,shape:a,type:o}=this;if(!t||i.enabled===!1||!i.text||!s){n.visible=!1;return}const r=Dl((i.positionAngle??0)-90),l=(be(r,0)||r>0)&&rthis.tickFormatter(...A),domain:t,range:o,reverse:r,niceMode:e,visibleRange:n,defaultTickMinSpacing:l,labelOffset:a,sideFlag:s,axisRotation:0,sizeLimit:void 0,primaryTickCount:void 0}),{tickData:u}=c,{ticks:d,rawTicks:g,rawTickCount:f,tickDomain:y,fractionDigits:x,niceDomain:S=t}=u,D=d.map(A=>this.getTickLabelProps(A,c));return this.generatedTicks={ticks:d,labels:D},{ticks:g,tickDomain:y,niceDomain:S,rawTickCount:f,fractionDigits:x,timeInterval:void 0}}updateSelections(){const{generatedTicks:t}=this;if(!t)return;const{ticks:e,labels:i}=t;this.gridLineGroupSelection.update(this.gridLength?e:[]),this.tickLabelGroupSelection.update(i),this.gridPathSelection.update(this.gridLine.enabled?this.prepareGridPathTickData(e):[]),this.gridLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup(),this.gridPathSelection.cleanup()}updateLabels(){if(!this.label.enabled)return;const t=j.resetAxisLabelSelectionFn();this.tickLabelGroupSelection.each((e,i)=>{e.fill=i.color,e.text=i.text,e.textBaseline=i.textBaseline,e.textAlign=i.textAlign??"center",e.setFont(i),e.setBoxing(i),e.setProperties(t(e,i))})}updateGridLines(){const{gridLine:{style:t,width:e},shape:i,generatedTicks:n}=this;if(!t||!n)return;const s=t.length,a=(g,f)=>{const{stroke:y,lineDash:x}=t[f%s];g.stroke=y,g.strokeWidth=e,g.lineDash=x,g.fill=void 0},[o,r]=this.gridRange??[0,2*Math.PI],l=be(r-o,2*Math.PI),d=i==="circle"?(g,f)=>{const{path:y}=g;y.clear(!0);const x=this.getTickRadius(f);l?(y.moveTo(x,0),y.arc(0,0,x,0,2*Math.PI)):(y.moveTo(x*Math.cos(o),x*Math.sin(o)),y.arc(0,0,x,ze(o),ze(r))),l&&y.closePath()}:(g,f)=>{const{path:y}=g,x=this.gridAngles;if(y.clear(!0),!x||x.length<3)return;const S=this.getTickRadius(f);for(const[D,A]of x.entries()){const I=S*Math.cos(A),w=S*Math.sin(A);D===0?y.moveTo(I,w):y.lineTo(I,w);for(const[N,O]of x.entries()){const L=S*Math.cos(O),R=S*Math.sin(O);N===0?y.moveTo(L,R):y.lineTo(L,R)}y.closePath()}y.closePath()};this.gridPathSelection.each((g,f,y)=>{a(g,y),d(g,f)})}updateTitle(){const t=o=>o.defaultValue,{title:e,range:i}=this,{formatter:n=t}=this.title;e.caption.enabled=e.enabled,e.caption.fontFamily=e.fontFamily,e.caption.fontSize=e.fontSize,e.caption.fontStyle=e.fontStyle,e.caption.fontWeight=e.fontWeight,e.caption.color=e.color,e.caption.wrapping=e.wrapping,e.caption.truncate=e.truncate,e.caption.maxWidth=e.maxWidth,e.caption.maxHeight=e.maxHeight;let s=!1;const a=e.caption.node;if(e.enabled){const o=Math.abs(i[1]-i[0]);s=!0,a.rotation=Math.PI/2,a.x=Math.floor((i[0]+i[1])/2),a.y=-e.spacing,a.textAlign="center",a.textBaseline="bottom",a.text=this.cachedCallWithContext(n,this.getTitleFormatterParams(this.scale.domain)),e.caption.text=a.text,e.caption.computeTextWrap(o,1/0)}a.visible=s}updateCrossLines(){for(const t of this.crossLines)if(t instanceof tO){const{shape:e,gridAngles:i,range:n,innerRadiusRatio:s}=this,a=n[0];t.shape=e,t.gridAngles=i,t.axisOuterRadius=a,t.axisInnerRadius=a*s}super.updateCrossLines()}createLabel(){return new eO}getTickLabelProps(t,e){const{label:i}=this,{rotation:n,textBaseline:s,textAlign:a}=e,o=this.scale.range,r=t.tickLabel??"",c=i.getSideFlag()*(this.getTickSize()+i.spacing+this.seriesAreaPadding),u=r!=="";return{...this.getLabelStyles({value:t.tick,formattedValue:t.tickLabel}),tickId:t.tickId,rotation:n,text:r,textAlign:a,textBaseline:s,visible:u,x:c,y:t.translation,rotationCenterX:c,rotationCenterY:t.translation,range:o}}};bA.CrossLineConstructor=tO;M([b],bA.prototype,"positionAngle");var{CategoryScale:FV}=j,xm=class extends bA{constructor(t){super(t,new FV),this.shape="circle",this.groupPaddingInner=0,this.paddingInner=0,this.paddingOuter=0}hasDefinedDomain(){return!1}normaliseDataDomain(t){return{domain:t.domain,clipped:!1}}prepareGridPathTickData(t){return t.slice().reverse()}getTickRadius(t){const{scale:e,innerRadiusRatio:i}=this,n=e.range[0],s=n*i;if(FV.is(e)){const a=e.domain,o=a.length-1-a.indexOf(t.tick);return o===0?s:e.inset+e.step*(o-.5)+e.bandwidth/2}else{const a=(n-s)/e.domain.length;return n-t.translation+s-a/2}}tickFormatParams(){return{type:"category"}}datumFormatParams(t,e){const{datum:i,seriesId:n,legendItemName:s,key:a,source:o,property:r,domain:l,boundSeries:c}=e;return{type:"category",value:t,datum:i,seriesId:n,legendItemName:s,key:a,source:o,property:r,domain:l,boundSeries:c}}};xm.className="RadiusCategoryAxis";xm.type="radius-category";M([b],xm.prototype,"groupPaddingInner");M([pi("scale","paddingInner"),b],xm.prototype,"paddingInner");M([pi("scale","paddingOuter"),b],xm.prototype,"paddingOuter");j.radiusCategoryAxisOptionsDefs;var{LinearScale:Zst}=j,vm=class extends bA{constructor(t){super(t,new Zst),this.shape="polygon"}hasDefinedDomain(){const{min:t,max:e}=this;return t!=null&&e!=null&&tn!==i).sort((n,s)=>s.tick-n.tick)}getTickRadius(t){const{scale:e}=this,i=e.range[0],n=i*this.innerRadiusRatio;return i-t.translation+n}normaliseDataDomain(t){const{min:e,max:i,preferredMin:n,preferredMax:s}=this,{extent:a,clipped:o}=Uf(t.domain,e,i,n,s,void 0,t.sortMetadata?.sortOrder);return{domain:a,clipped:o}}getDomainExtentsNice(){return[this.min==null&&this.nice,this.max==null&&this.nice]}tickFormatParams(t,e,i){return{type:"number",visibleDomain:void 0,fractionDigits:i}}datumFormatParams(t,e,i){const{datum:n,seriesId:s,legendItemName:a,key:o,source:r,property:l,domain:c,boundSeries:u}=e;return{type:"number",value:t,datum:n,seriesId:s,legendItemName:a,key:o,source:r,property:l,domain:c,boundSeries:u,fractionDigits:i,visibleDomain:void 0}}};vm.className="RadiusNumberAxis";vm.type="radius-number";M([b],vm.prototype,"min");M([b],vm.prototype,"max");M([b],vm.prototype,"preferredMin");M([b],vm.prototype,"preferredMax");j.radiusNumberAxisOptionsDefs;var iO=class extends Ln{constructor(t){super(),this.ctx=t,this.enabled=!0,t.animationManager.skip(!1),this.cleanup.register(()=>t.animationManager.skip(!0))}};M([Bi((t,e)=>{t.ctx.animationManager.skip(!e)}),b],iO.prototype,"enabled");M([Bi((t,e)=>{e!=null&&(t.ctx.animationManager.defaultDuration=e)}),b],iO.prototype,"duration");M([Bi((t,e)=>{t.ctx.animationManager.maxAnimatableItems=e??1/0}),b],iO.prototype,"maxAnimatableItems");var qst={options:{}};qst.options.maxAnimatableItems=Mt(X);var aK=class ab extends Ln{constructor(e){super(),this.ctx=e,this.activeSections=new Set,this.sectionButtons={annotations:[],chartToolbar:[]},this.container=this.ctx.domManager.addChild("canvas-overlay","shared-toolbar"),this.container.role="presentation"}getSharedToolbar(e){return this.sharedToolbar||this.createSharedToolbar(),e==="chartToolbar"&&this.sharedToolbar&&this.sharedToolbar.setAriaLabelId("ariaLabelFinancialCharts"),this.toolbarWithSection(e)}createSharedToolbar(){this.sharedToolbar=new j.Toolbar(this.ctx,"ariaLabelAnnotationsToolbar","vertical"),this.sharedToolbar.addClass("ag-charts-shared-toolbar"),this.container.append(this.sharedToolbar.getElement()),this.cleanup.register(()=>{this.sharedToolbar&&(this.sharedToolbar.getElement().remove(),this.sharedToolbar.destroy(),this.sharedToolbar=void 0)})}toolbarWithSection(e){const i=this.sharedToolbar,n={layout:(s,a=0)=>{if(this.firstLayoutSection!=null&&this.firstLayoutSection!==e&&this.activeSections.has(this.firstLayoutSection))return;this.firstLayoutSection=e;const o=i.getBounds().width,{isRtl:r}=this.ctx.domManager;i.setBounds({x:r?s.x+s.width-o:s.x,y:s.y,width:o}),s.shrink(o+i.horizontalSpacing+a,r?"right":"left")},addToolbarListener:(s,a)=>i.addToolbarListener(s,o=>{const r=this.getSectionIndex(e,o.button.index);if(r<0)return;const l={...o,button:this.sectionButtons[e][r]};a(l)}),updateButtons:s=>{this.sectionButtons[e]=s;const a=ab.SECTION_ORDER.flatMap(o=>this.sectionButtons[o]);i.updateButtons(a)},updateButtonByIndex:(s,a)=>{i.updateButtonByIndex(this.getIndex(e,s),a)},toggleActiveButtonByIndex:s=>{i.toggleActiveButtonByIndex(this.getIndex(e,s))},toggleButtonEnabledByIndex:(s,a)=>{i.toggleButtonEnabledByIndex(this.getIndex(e,s),a)},setHidden:s=>{s?this.activeSections.delete(e):this.activeSections.add(e);let a=0;for(const o of ab.SECTION_ORDER){if(o!==e){a+=this.sectionButtons[o].length;continue}for(const r of this.sectionButtons[e].keys())i.setButtonHiddenByIndex(a+r,s)}},destroy:()=>{n.setHidden(!0),this.activeSections.size===0&&this.destroy()},clearActiveButton:i.clearActiveButton.bind(i),addListener:i.addListener.bind(i),removeListener:i.removeListener.bind(i)};return n.setHidden(!1),n}getIndex(e,i){let n=0;for(const s of ab.SECTION_ORDER){if(s===e)return n+i;n+=this.sectionButtons[s].length}return-1}getSectionIndex(e,i){let n=0;for(const s of ab.SECTION_ORDER){if(s===e)return i>=n+this.sectionButtons[e].length?-1:i-n;n+=this.sectionButtons[s].length}return-1}};aK.SECTION_ORDER=["chartToolbar","annotations"];var Qst=aK,Jst='
',HV="text-input",jV="canvas-overlay",tat=class{constructor(t){this.ctx=t,this.cleanup=new qe,this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1,this.element=t.domManager.addChild(jV,HV),this.element.classList.add("ag-charts-text-input"),this.cleanup.register(()=>t.domManager.removeChild(jV,HV))}setKeyDownHandler(t){this.cleanup.register(Qe(this.element,"keydown",t))}show(t){this.element.innerHTML=Jst;const e=this.element.firstElementChild;Nr(e,{role:"textbox","data-preventdefault":!1}),e.setAttribute("placeholder",this.ctx.localeManager.t(t.placeholderText??"inputTextareaPlaceholder")),t.styles?.placeholderColor&&e.style.setProperty("--placeholder-text-color",t.styles?.placeholderColor),e.innerText=t.text??"",e.style.color=t.styles?.color??"inherit",e.style.fontFamily=t.styles?.fontFamily??"inherit",e.style.fontSize=t.styles?.fontSize?`${t.styles.fontSize}px`:"inherit",e.style.fontStyle=t.styles?.fontStyle??"inherit",e.style.fontWeight=typeof t.styles?.fontWeight=="number"?`${t.styles.fontWeight}`:t.styles?.fontWeight??"inherit",b1(e),e.addEventListener("input",()=>{this.updatePosition(),t.onChange?.(this.getValue(),this.getBBox())}),e.addEventListener("click",i=>{i.stopPropagation()}),t.layout&&(this.layout=t.layout,this.updatePosition()),t.onChange?.(this.getValue(),this.getBBox()),this.visible=!0}hide(){this.element.innerHTML="",this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1}isVisible(){return this.visible}updateColor(t){this.element.firstElementChild&&(this.element.firstElementChild.style.color=t)}updateFontSize(t){if(this.element.firstElementChild)return this.element.firstElementChild.style.fontSize=`${t}px`,this.updatePosition(),this.getBBox()}getValue(){if(this.element.firstElementChild)return this.element.firstElementChild.innerText.trim()}updatePosition(){const{element:t}=this,e=t.firstElementChild;if(!e)return;const i=this.ctx.domManager.getBoundingClientRect(),{width:n,getTextInputCoords:s,getTextPosition:a,alignment:o,textAlign:r}=this.layout;t.style.setProperty("width",n?`${n}px`:"unset");const l=e.getBoundingClientRect(),c=s(l.height);let u=c.x;o==="center"?u-=(n??l.width)/2:o==="right"&&(u-=n??l.width);const d=a();let g=c.y;d==="center"?g-=l.height/2:d==="bottom"&&(g-=l.height),t.style.setProperty("top",`${g}px`),t.style.setProperty("left",`${u}px`),t.style.setProperty("max-width",`${i.width-u}px`),t.style.setProperty("text-align",o),e.style.setProperty("text-align",r)}getBBox(){const{left:t,top:e,width:i,height:n}=this.element.getBoundingClientRect();return new j.BBox(t,e,M4(i,2),n)}destroy(){this.cleanup.flush()}},nO=class extends xt{constructor(){super(...arguments),this.enabled=!1,this.axes="y"}};M([b],nO.prototype,"enabled");M([b],nO.prototype,"axes");var sO=(t=>(t.Line="line",t.HorizontalLine="horizontal-line",t.VerticalLine="vertical-line",t.DisjointChannel="disjoint-channel",t.ParallelChannel="parallel-channel",t.FibonacciRetracement="fibonacci-retracement",t.FibonacciRetracementTrendBased="fibonacci-retracement-trend-based",t.Callout="callout",t.Comment="comment",t.Note="note",t.Text="text",t.Arrow="arrow",t.ArrowUp="arrow-up",t.ArrowDown="arrow-down",t.DateRange="date-range",t.PriceRange="price-range",t.DatePriceRange="date-price-range",t.QuickDatePriceRange="quick-date-price-range",t))(sO||{}),eat=Object.values(sO);function iat(t){for(const e of eat)if(e===t)return e}var sx=class extends xt{};M([b],sx.prototype,"x");M([b],sx.prototype,"y");var nat=class extends Qs(Xc(cK(xt))){},aO=class extends Qs(Xc(_l(lO(Fp(xt))))){constructor(){super(...arguments),this.cornerRadius=2}};M([b],aO.prototype,"enabled");M([b],aO.prototype,"cornerRadius");var sat=class extends _l(xt){},aat=class extends Qs(Xc(_l(xt))){},Vp=class extends Fp(xt){constructor(){super(...arguments),this.label="",this.position="top",this.alignment="left"}};M([b],Vp.prototype,"label");M([b],Vp.prototype,"position");M([b],Vp.prototype,"alignment");var oat=class extends Fp(xt){},nv=class extends Fp(xt){constructor(){super(...arguments),this.label=""}};M([b],nv.prototype,"label");M([b],nv.prototype,"position");M([b],nv.prototype,"alignment");function _p(t){class e extends lat(cK(t)){constructor(){super(...arguments),this.id=yb()}}return e}function oO(t){class e extends t{constructor(){super(...arguments),this.start=new sx,this.end=new sx}}return M([b],e.prototype,"start"),M([b],e.prototype,"end"),e}function oK(t){class e extends t{}return M([b],e.prototype,"x"),M([b],e.prototype,"y"),e}function rK(t){class e extends t{}return M([b],e.prototype,"value"),e}function rO(t){class e extends t{constructor(){super(...arguments),this.background=new sat}}return M([b],e.prototype,"background"),e}function Xu(t){class e extends t{constructor(){super(...arguments),this.handle=new aat}}return M([b],e.prototype,"handle"),e}function lK(t){class e extends t{constructor(){super(...arguments),this.axisLabel=new aO}}return M([b],e.prototype,"axisLabel"),e}function lO(t){class e extends t{constructor(){super(...arguments),this.padding=void 0,this.textAlign="center",this.formatter=void 0}}return M([b],e.prototype,"padding"),M([b],e.prototype,"textAlign"),M([b],e.prototype,"formatter"),e}function rat(t){class e extends t{}return e}function cO(t){class e extends t{}return M([b],e.prototype,"extendStart"),M([b],e.prototype,"extendEnd"),e}function lat(t){class e extends t{isWriteable(){return!this.locked&&!this.readOnly}isHoverable(){return!this.readOnly}}return M([b],e.prototype,"locked"),M([b],e.prototype,"readOnly"),e}function hO(t){class e extends t{setLocaleManager(n){this.localeManager??(this.localeManager=n)}}return e}function cK(t){class e extends t{}return M([b],e.prototype,"visible"),e}function _l(t){class e extends t{}return M([b],e.prototype,"fill"),M([b],e.prototype,"fillOpacity"),e}function Qs(t){class e extends t{}return M([b],e.prototype,"stroke"),M([b],e.prototype,"strokeOpacity"),M([b],e.prototype,"strokeWidth"),e}function Xc(t){class e extends t{constructor(){super(...arguments),this.lineCap=void 0,this.computedLineDash=void 0}}return M([b],e.prototype,"lineDash"),M([b],e.prototype,"lineDashOffset"),M([b],e.prototype,"lineStyle"),e}function Fp(t){class e extends t{constructor(){super(...arguments),this.fontSize=zc.SMALL,this.fontFamily="Verdana, sans-serif"}}return M([b],e.prototype,"fontStyle"),M([b],e.prototype,"fontWeight"),M([b],e.prototype,"fontSize"),M([b],e.prototype,"fontFamily"),M([b],e.prototype,"color"),e}function hK(t){return Je(t)||zi(t)||aa(t)?{value:t,groupPercentage:0}:t??{value:void 0,groupPercentage:0}}function Jn(t){return hK(t)?.value}function oa(t,e){if(t.start==null||t.end==null)return;const i=Ki(t.start,e),n=Ki(t.end,e);if(!(i==null||n==null))return{x1:i.x,y1:i.y,x2:n.x,y2:n.y}}function Ki(t,e){const i=vc(t.x,e.xAxis),n=vc(t.y,e.yAxis);return{x:i,y:n}}function vc(t,e){if(t==null)return 0;const{value:i,groupPercentage:n}=hK(t),{scale:s,snapToGroup:a}=e,o=s.bandwidth===0?s.step??0:s.bandwidth??0,r=a?o/2:o*n;return s.convert(i)+r}function na(t,e){const i=BM(t.x,e.xAxis),n=BM(t.y,e.yAxis);return{x:i,y:n}}function BM(t,e){const{scale:i}=e;if(e.continuous&&i.step==null)return e.scaleInvert(t);const n=e.scaleInvertNearest(t),s=i.bandwidth===0?i.step:i.bandwidth??0,a=i.convert(n),o=a+s,r=a===o?0:(t-a)/(o-a);return{value:n,groupPercentage:r}}var uO=class extends _p(oO(Xu(xt))){constructor(){super(...arguments),this.snapToAngle=45}getDefaultColor(t){}getDefaultOpacity(t){}},uK=class extends hO(lO(Fp(uO))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(t){return this.color}getDefaultOpacity(t){}getPlaceholderColor(){}getPadding(){const{padding:t=0}=this;return{top:t,right:t,bottom:t,left:t}}getText(){const t=this.text.length==0;let e=this.text;return t&&(e=this.placeholderText??"",this.localeManager&&(e=this.localeManager.t(e))),{text:e,isPlaceholder:t}}getTextInputCoords(t,e){return Ki(this.end,t)}getTextPosition(){return this.position}};M([b],uK.prototype,"text");var cat={top:6,right:12,bottom:9,left:12},Ir=class extends _l(Qs(uK)){constructor(){super(...arguments),this.type="callout",this.position="bottom",this.alignment="left"}static is(t){return Bt(t)&&t.type==="callout"}getDefaultColor(t){switch(t){case"fill-color":return this.fill;case"line-color":return this.stroke;default:return this.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;default:return}}getPlaceholderColor(){const{r:t,g:e,b:i}=se.fromString(this.color??"#888888");return new se(t,e,i,.66).toString()}getPadding(){const{padding:t}=this;return t==null?{...cat}:{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const i=super.getTextInputCoords(t,e),n=this.getPadding(),s=n.left??0,a=n.bottom??0;return{x:i.x+s,y:i.y-a}}};M([b],Ir.prototype,"type");var xA=class extends _p(oK(Xu(lO(Fp(xt))))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(t){return this.color}getDefaultOpacity(t){}getPlaceholderColor(){}getPadding(){const{padding:t=0}=this;return{top:t,right:t,bottom:t,left:t}}getText(){const t=this.text.length==0;return{text:t?this.placeholderText??"":this.text,isPlaceholder:t}}getTextInputCoords(t,e){return Ki(this,t)}getTextPosition(){return this.position}};M([b],xA.prototype,"text");var Q0={top:8,right:14,bottom:8,left:14},al=class extends _l(Qs(xA)){constructor(){super(...arguments),this.type="comment",this.position="bottom",this.alignment="left"}static is(t){return Bt(t)&&t.type==="comment"}getDefaultColor(t){switch(t){case"fill-color":return this.fill;case"line-color":return this.stroke;default:return this.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;default:return}}getPlaceholderColor(){const{r:t,g:e,b:i}=se.fromString(this.color??"#888888");return new se(t,e,i,.66).toString()}getPadding(){const{padding:t,fontSize:e}=this;return t==null?{top:Math.max(e*.4,Q0.top),bottom:Math.max(e*.4,Q0.bottom),left:Math.max(e*.8,Q0.left),right:Math.max(e*.8,Q0.right)}:{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const i=super.getTextInputCoords(t,e),n=this.getPadding();return{x:i.x+n.left,y:i.y-n.bottom}}};M([b],al.prototype,"type");function ax(t,e){return t?"dashed":e??"solid"}function dK(t,e){switch(e){case"solid":return[];case"dashed":return[t*4,t*2];case"dotted":return[0,t*2]}}function Sm(t,e,i,n){const s=ax(t,i);return e??t??dK(n??1,s)}function Mm(t,e,i){const n=ax(e,i);return t??n==="dotted"?"round":void 0}function hat(t,e){const[i,n]=at.from(t),s=e.height,a=at.gradient(n,i,s),o=at.intercept(n,a,s),r=[{x:i.x,y:s??0},{x:i.x,y:s==null?e.height:s-e.height}];if(a===1/0)return r;let l=[at.intersectAtY(a,o,0,s),at.intersectAtY(a,o,e.height,s),at.intersectAtX(a,o,0,s),at.intersectAtX(a,o,e.width,s)];return l=l.filter(c=>c.x>=e.x&&c.x<=e.width&&c.y>=e.y&&c.y<=e.height).sort((c,u)=>c.x===u.x?0:c.x{},this.text=new Vp}getDefaultColor(t){switch(t){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Sm(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Mm(this.lineCap,this.lineDash,this.lineStyle)}};M([b],Dm.prototype,"statistics");M([b],Dm.prototype,"text");function pO(t){class e extends t{constructor(){super(...arguments),this.hasDateRange=!0}}return e}function gO(t){class e extends t{constructor(){super(...arguments),this.hasPriceRange=!0}}return e}var Yo=class extends pO(Dm){constructor(){super(...arguments),this.type="date-range",this.direction="horizontal"}static is(t){return Bt(t)&&t.type==="date-range"}};M([b],Yo.prototype,"type");M([b],Yo.prototype,"extendAbove");M([b],Yo.prototype,"extendBelow");var $o=class extends gO(Dm){constructor(){super(...arguments),this.type="price-range",this.direction="vertical"}static is(t){return Bt(t)&&t.type==="price-range"}};M([b],$o.prototype,"type");M([b],$o.prototype,"extendLeft");M([b],$o.prototype,"extendRight");var gc=class extends pO(gO(Dm)){constructor(){super(...arguments),this.type="date-price-range",this.direction="both"}static is(t){return Bt(t)&&t.type==="date-price-range"}};M([b],gc.prototype,"type");var ro=class extends pO(gO(Dm)){constructor(){super(...arguments),this.type="quick-date-price-range",this.up=new JN,this.down=new JN,this.direction="both"}static is(t){return Bt(t)&&t.type==="quick-date-price-range"}};M([b],ro.prototype,"type");M([b],ro.prototype,"up");M([b],ro.prototype,"down");var{BBox:dat}=j,vA=1.38;function SA(t,e,i){return i?kc(e,{maxWidth:i,font:t,textWrap:"always",avoidOrphans:!1}):e}function pat(t,e){const{lineMetrics:i,width:n}=Ve(t).measureLines(e),s=i.length*nr(t.fontSize,vA);return{width:n,height:s}}function fO(t,e,i,n){let s=n?.width??0,a=n?.height??0;if(!n){const o=t.width==null?e:SA(t,e,t.width);({width:s,height:a}=pat(t,o))}return new dat(i.x,i.y,s,a)}function pK(t,e,i,n,{x:s,y:a},o){const{visible:r=!0,fontFamily:l,fontSize:c=14,fontStyle:u,fontWeight:d,textAlign:g}=n,f=nr(c,vA);o??(o=n.position=="center"?"middle":n.position);const y=i?n.getPlaceholderColor():n.color;t.setProperties({x:s,y:a,visible:r,text:e,fill:y,fontFamily:l,fontSize:c,fontStyle:u,fontWeight:d,textAlign:g,lineHeight:f,textBaseline:o})}var gat=10,fat=11,gK=20,mat=22,yat=10,fK=gK+yat,mK=34,bat=class extends _l(Qs(xt)){},Oa=class extends _l(Qs(xA)){constructor(){super(...arguments),this.type="note",this.background=new bat,this.position="bottom",this.alignment="center",this.width=200}static is(t){return Bt(t)&&t.type==="note"}getDefaultColor(t){switch(t){case"line-color":return this.fill;case"text-color":return this.color}}getDefaultOpacity(t){switch(t){case"line-color":return this.fillOpacity;case"text-color":return}}getPadding(){const t=this.padding??gat;return{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const{width:i,text:n}=this,s=super.getTextInputCoords(t,e),a=this.getPadding().top,o=fO(this,n,s);o.x=Nt(i/2,o.x,t.seriesRect.width-i/2);const r=o.y-fK-a*2,l=o.y+fat+a*2,c=Math.max(o.height,e);return r-c-mK<0?(o.y=l,this.position="top"):(o.y=r+a,this.position="bottom"),{x:o.x,y:o.y}}isHoverable(){return!0}};M([b],Oa.prototype,"type");M([b],Oa.prototype,"background");var xat=class extends _p(oK(Xu(xt))){getDefaultColor(t){}getDefaultOpacity(t){}},mO=class yK extends _l(xat){constructor(){super(...arguments),this.size=32}static is(e){return e instanceof yK}getDefaultColor(e){return e==="fill-color"?this.fill:void 0}getDefaultOpacity(e){return e==="fill-color"?this.fillOpacity:void 0}},Bs=class extends _p(rK(Xu(lK(Qs(Xc(xt)))))){constructor(){super(...arguments),this.direction="horizontal",this.type="horizontal-line",this.text=new Vp}static is(t){return Bt(t)&&t.type==="horizontal-line"}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Sm(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Mm(this.lineCap,this.lineDash,this.lineStyle)}};M([b],Bs.prototype,"type");M([b],Bs.prototype,"text");var ol=class extends _p(rK(Xu(lK(Qs(Xc(xt)))))){constructor(){super(...arguments),this.direction="vertical",this.type="vertical-line",this.text=new Vp}static is(t){return Bt(t)&&t.type==="vertical-line"}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Sm(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Mm(this.lineCap,this.lineDash,this.lineStyle)}};M([b],ol.prototype,"type");M([b],ol.prototype,"text");var Xo=class extends _p(rO(oO(Xu(cO(Qs(Xc(xt))))))){constructor(){super(...arguments),this.type="disjoint-channel",this.text=new nv,this.snapToAngle=45}static is(t){return Bt(t)&&t.type==="disjoint-channel"}get bottom(){const t={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof t.start.y=="number"&&typeof t.end.y=="number"?(t.start.y-=this.startHeight,t.end.y-=this.endHeight):pt.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),t}getDefaultColor(t){switch(t){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Sm(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Mm(this.lineCap,this.lineDash,this.lineStyle)}};M([b],Xo.prototype,"type");M([b],Xo.prototype,"startHeight");M([b],Xo.prototype,"endHeight");M([b],Xo.prototype,"text");var MA=class extends hO(rat(cO(Qs(Xc(uO))))){constructor(){super(...arguments),this.text=new Vp}getDefaultColor(t){switch(t){case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Sm(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Mm(this.lineCap,this.lineDash,this.lineStyle)}};M([b],MA.prototype,"text");var fc=class extends MA{constructor(){super(...arguments),this.type="arrow",this.endCap="arrow"}static is(t){return Bt(t)&&t.type==="arrow"}};M([b],fc.prototype,"type");var mc=class extends MA{constructor(){super(...arguments),this.type="line"}static is(t){return Bt(t)&&t.type==="line"}};M([b],mc.prototype,"type");var Zc=class extends MA{constructor(){super(...arguments),this.label=new oat,this.reverse=!1,this.showFill=!0,this.isMultiColor=!0,this.strokes=[],this.bands=10}getDefaultColor(t){switch(t){case"line-color":return this.rangeStroke??this.stroke;case"text-color":return this.text.color}}};M([b],Zc.prototype,"label");M([b],Zc.prototype,"reverse");M([b],Zc.prototype,"showFill");M([b],Zc.prototype,"isMultiColor");M([b],Zc.prototype,"strokes");M([b],Zc.prototype,"rangeStroke");M([b],Zc.prototype,"bands");var rl=class extends Zc{constructor(){super(...arguments),this.type="fibonacci-retracement-trend-based",this.endRetracement=new sx}static is(t){return Bt(t)&&t.type==="fibonacci-retracement-trend-based"}};M([b],rl.prototype,"type");M([b],rl.prototype,"endRetracement");var yc=class extends Zc{constructor(){super(...arguments),this.type="fibonacci-retracement"}static is(t){return Bt(t)&&t.type==="fibonacci-retracement"}};M([b],yc.prototype,"type");var Zo=class extends _p(rO(oO(Xu(cO(Qs(Xc(xt))))))){constructor(){super(...arguments),this.type="parallel-channel",this.middle=new nat,this.text=new nv,this.snapToAngle=45}static is(t){return Bt(t)&&t.type==="parallel-channel"}get bottom(){const t={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof t.start.y=="number"&&typeof t.end.y=="number"?(t.start.y-=this.height,t.end.y-=this.height):pt.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),t}getDefaultColor(t){switch(t){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Sm(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Mm(this.lineCap,this.lineDash,this.lineStyle)}};M([b],Zo.prototype,"type");M([b],Zo.prototype,"height");M([b],Zo.prototype,"middle");M([b],Zo.prototype,"text");var bc=class extends xA{constructor(){super(...arguments),this.type="text",this.position="bottom"}static is(t){return Bt(t)&&t.type==="text"}};M([b],bc.prototype,"type");function Xh(t){return ro.is(t)}function DA(t){return mc.is(t)||Bs.is(t)||ol.is(t)||fc.is(t)||bK(t)}function Nc(t){return Xo.is(t)||Zo.is(t)}function bK(t){return yc.is(t)||rl.is(t)}function xl(t){return Ir.is(t)||al.is(t)||Oa.is(t)||bc.is(t)}function sv(t){return Yo.is(t)||$o.is(t)||gc.is(t)||ro.is(t)}function sw(t){return xl(t)&&!Oa.is(t)}function Gh(t){return DA(t)||Nc(t)||sv(t)&&!ro.is(t)}function vat(t){return DA(t)||Nc(t)||sv(t)||Ir.is(t)||Oa.is(t)}function Sat(t){return Oa.is(t)}function Mat(t){return Nc(t)||sv(t)||Ir.is(t)||al.is(t)||mO.is(t)}function Dat(t){return xl(t)&&!Oa.is(t)}function uf(t){return(DA(t)||Nc(t)||sv(t))&&!Xh(t)&&Bt(t.text)}function Aat(t,e){"fontSize"in t&&(t.fontSize=e),uf(t)&&(t.text.fontSize=e)}function xK(t,e){const i=e?.strokeWidth??t.strokeWidth??1,n=e?.type??t.lineStyle,s=n??ax(t.lineDash,n),a=dK(i,s);t.strokeWidth=i,t.computedLineDash=a,t.lineStyle=s,t.lineCap=s==="dotted"?"round":void 0}function AA(t,e,i,n,s,a){switch(e){case"fill-color":{"fill"in t&&(t.fill=n),"fillOpacity"in t&&(t.fillOpacity=s),"background"in t&&(t.background.fill=n,t.background.fillOpacity=s);break}case"line-color":{"axisLabel"in t&&(t.axisLabel.fill=n,t.axisLabel.fillOpacity=s,t.axisLabel.stroke=n,t.axisLabel.strokeOpacity=s),"fill"in t&&"fillOpacity"in t&&Sat(t)?(t.fill=n,t.fillOpacity=s):("strokeOpacity"in t&&(t.strokeOpacity=s),"isMultiColor"in t&&"rangeStroke"in t?(t.isMultiColor=a,t.rangeStroke=n):"stroke"in t&&(t.stroke=n));break}case"text-color":{"color"in t&&(t.color=i),uf(t)&&(t.text.color=n);break}}}var Iat=class{constructor(){this.mementoOriginatorKey="annotation-defaults",this.colors=new Map(Object.values(sO).map(t=>[t,new Map([["line-color",void 0],["fill-color",void 0],["text-color",void 0]])])),this.fontSizes=new Map([["callout",void 0],["comment",void 0],["text",void 0],["arrow",void 0],["line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineStyles=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextAlignments=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextPositions=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.fibonacciOptions=new Map([["fibonacci-retracement",{bands:void 0,reverse:void 0,showFill:void 0}],["fibonacci-retracement-trend-based",{bands:void 0,reverse:void 0,showFill:void 0}]])}createMemento(){return{colors:le(this.colors),fontSizes:le(this.fontSizes),lineStyles:le(this.lineStyles),lineTextAlignments:le(this.lineTextAlignments),lineTextPositions:le(this.lineTextPositions),fibonacciOptions:le(this.fibonacciOptions)}}guardMemento(t){return!0}restoreMemento(t,e,i){this.colors=le(i.colors),this.fontSizes=le(i.fontSizes),this.lineStyles=le(i.lineStyles),this.lineTextAlignments=le(i.lineTextAlignments),this.lineTextPositions=le(i.lineTextPositions),this.fibonacciOptions=le(i.fibonacciOptions)}setDefaultColor(t,e,i,n,s,a){this.colors.get(t)?.set(e,[i,n,s,a])}setDefaultFontSize(t,e){this.fontSizes.set(t,e)}setDefaultLineStyleType(t,e){const i=this.lineStyles.get(t);i?i.type=e:this.lineStyles.set(t,{type:e})}setDefaultLineStyleWidth(t,e){const i=this.lineStyles.get(t);i?i.strokeWidth=e:this.lineStyles.set(t,{strokeWidth:e})}setDefaultLineTextAlignment(t,e){this.lineTextAlignments.set(t,e)}setDefaultLineTextPosition(t,e){this.lineTextPositions.set(t,e)}setDefaultFibonacciOptions(t,e,i){if(t!="fibonacci-retracement"&&t!="fibonacci-retracement-trend-based")return;const n=this.fibonacciOptions.get(t);n[e]=i,this.fibonacciOptions.set(t,n)}applyDefaults(t){for(const[e,i]of this.colors)if(t.type===e)for(const[n,[s,a,o,r]=[]]of i)s&&a&&o!=null&&r!=null&&AA(t,n,s,a,o,r);for(const[e,i]of this.fontSizes)t.type!==e||i==null||Aat(t,i);for(const[e,i]of this.lineStyles)t.type!==e||i==null||xK(t,i);for(const[e,i]of this.lineTextPositions)t.type!==e||i==null||(t.text.position=i);for(const[e,i]of this.lineTextAlignments)t.type!==e||i==null||(t.text.alignment=i);for(const[e,i]of this.fibonacciOptions)if(!(t.type!==e||i==null))for(const n of Object.keys(i)){const s=i[n];s!=null&&t.set({[n]:s})}}},kat='
',GV=t=>{try{const e=se.fromString(t),[i,n,s]=e.toHSB();return[i,n,s,e.a]}catch{return}},vK=class extends j.AnchoredPopover{constructor(t,e){super(t,"color-picker",e),this.hasChanged=!1,this.hideFns.push(()=>{this.i18nUpdater=void 0,this.hasChanged&&this.onChangeHide?.()}),this.cleanup.register(this.ctx.eventsHub.on("locale:change",()=>this.i18nUpdater?.()))}show(t){this.hasChanged=!1,this.onChangeHide=t.onChangeHide;const{element:e,initialFocus:i}=this.createColorPicker(t),n=this.showWithChildren([e],{initialFocus:i,...t});n.classList.add("ag-charts-color-picker"),n.setAttribute("role","dialog")}createColorPicker(t){const{localeManager:e}=this.ctx;let i=t.isMultiColor??!1,[n,s,a,o]=GV(t.color??"#f00")??[0,1,.5,1];o=t.opacity??o;const r=this.ctx.agDocument,l=r.createElement("div","ag-charts-color-picker__content");l.innerHTML=kat,l.ariaLabel=this.ctx.localeManager.t("ariaLabelColorPicker");const c=l.querySelector(".ag-charts-color-picker__palette"),u=l.querySelector(".ag-charts-color-picker__hue-input"),d=l.querySelector(".ag-charts-color-picker__multi-color-button"),g=l.querySelector(".ag-charts-color-picker__alpha-input"),f=l.querySelector(".ag-charts-color-picker__color-input"),y=l.querySelector(".ag-charts-color-picker__color-label"),x=w=>{const N={s:"ariaValueColorPalette",v:"ariaValueColorPaletteFirstV"}[w];c.ariaValueText=e.t(N,{s,v:a})};this.i18nUpdater=()=>{c.ariaRoleDescription=e.t("ariaRoleDescription2DSlider"),c.ariaLabel=e.t("ariaLabelColorPickerPalette"),u.ariaLabel=e.t("ariaLabelColorPickerHue"),d.ariaLabel=e.t("ariaLabelColorPickerMultiColor"),g.ariaLabel=e.t("ariaLabelColorPickerAlpha"),f.ariaLabel=e.t("ariaLabelColor"),x("s")},this.i18nUpdater(),d.classList.toggle("ag-charts-color-picker__multi-color-button--hidden",!t.hasMultiColorOption);const S=(w=!0)=>{const O=se.fromHSB(n,s,a,o).toHexString();if(l.style.setProperty("--h",`${n}`),l.style.setProperty("--s",`${s}`),l.style.setProperty("--v",`${a}`),l.style.setProperty("--a",`${o}`),l.style.setProperty("--color",O.slice(0,7)),l.style.setProperty("--color-a",O),u.value=`${n}`,g.value=`${o}`,g.classList.toggle("ag-charts-color-picker__alpha-input--opaque",o===1),d.classList.toggle("ag-charts-color-picker__multi-color-button--active",i),y.classList.toggle("ag-charts-color-picker__color-label--multi-color",i),document.activeElement!==f&&(d.ariaChecked=i.toString(),f.value=i?e.t("ariaLabelColorPickerMultiColor"):O.toUpperCase()),w||t.color==null){const L=se.fromHSB(n,s,a,1).toHexString();t.onChange?.(O,L,o,i)}w&&(this.hasChanged=!0)};S(!1);const D=w=>w.preventDefault(),A=w=>w.stopPropagation(),I=w=>{w.preventDefault();const N=w.currentTarget;N.focus();const O=N.getBoundingClientRect(),L=({clientX:P,clientY:B})=>{i=!1,s=Math.min(Math.max((P-O.left)/O.width,0),1),a=1-Math.min(Math.max((B-O.top)/O.height,0),1),S(),x("s")};L(w);const R=r.attachListener("pointermove",L);r.attachListener("pointerup",()=>R(),{once:!0})};return l.addEventListener("mousedown",A),l.addEventListener("touchstart",A),l.addEventListener("touchmove",A),l.addEventListener("keydown",w=>{switch(w.stopPropagation(),w.key){case"Enter":case"Escape":this.hide();break;default:return}w.preventDefault()}),c.addEventListener("pointerdown",I),c.addEventListener("touchstart",D,{passive:!1}),c.addEventListener("touchmove",D,{passive:!1}),c.addEventListener("keydown",w=>{if(w.key==="ArrowLeft")s=Nt(0,s-.01,1),x("s");else if(w.key==="ArrowRight")s=Nt(0,s+.01,1),x("s");else if(w.key==="ArrowUp")a=Nt(0,a+.01,1),x("v");else if(w.key==="ArrowDown")a=Nt(0,a-.01,1),x("v");else return;w.preventDefault(),S()}),c.addEventListener("focus",()=>{x("s")}),d.addEventListener("click",()=>{i=!i,S()}),u.addEventListener("input",w=>{i=!1,n=w.currentTarget.valueAsNumber??0,S()}),g.addEventListener("input",w=>{i=!1,o=w.currentTarget.valueAsNumber??0,S()}),f.addEventListener("input",w=>{i=!1;const N=GV(w.currentTarget.value);N!=null&&([n,s,a,o]=N,S())}),f.addEventListener("blur",()=>S()),f.addEventListener("keydown",w=>{w.key==="Enter"&&(w.currentTarget.blur(),S())}),{element:l,initialFocus:c}}},Il=class extends xt{};M([b],Il.prototype,"icon");M([b],Il.prototype,"iconPosition");M([b],Il.prototype,"label");M([b],Il.prototype,"ariaLabel");M([b],Il.prototype,"tooltip");function UV(t){return!(t instanceof j.LogScale)&&!(t instanceof j.BandScale)}var Cat=[{label:"toolbarAnnotationsTrendLine",icon:"trend-line-drawing",value:"line"},{label:"toolbarAnnotationsHorizontalLine",icon:"horizontal-line-drawing",value:"horizontal-line"},{label:"toolbarAnnotationsVerticalLine",icon:"vertical-line-drawing",value:"vertical-line"},{label:"toolbarAnnotationsParallelChannel",icon:"parallel-channel-drawing",value:"parallel-channel",visible:UV},{label:"toolbarAnnotationsDisjointChannel",icon:"disjoint-channel-drawing",value:"disjoint-channel",visible:UV}],wat=[{label:"toolbarAnnotationsFibonacciRetracement",icon:"fibonacci-retracement-drawing",value:"fibonacci-retracement"},{label:"toolbarAnnotationsFibonacciRetracementTrendBased",icon:"fibonacci-retracement-trend-based-drawing",value:"fibonacci-retracement-trend-based"}],Nat=[{label:"Fibonacci - Extended",value:10},{label:"Fibonacci - 6 Band",value:6},{label:"Fibonacci - 4 Band",value:4}],Tat=[{label:"toolbarAnnotationsText",icon:"text-annotation",value:"text"},{label:"toolbarAnnotationsComment",icon:"comment-annotation",value:"comment"},{label:"toolbarAnnotationsCallout",icon:"callout-annotation",value:"callout"},{label:"toolbarAnnotationsNote",icon:"note-annotation",value:"note"}],Lat=[{label:"toolbarAnnotationsArrow",icon:"arrow-drawing",value:"arrow"},{label:"toolbarAnnotationsArrowUp",icon:"arrow-up-drawing",value:"arrow-up"},{label:"toolbarAnnotationsArrowDown",icon:"arrow-down-drawing",value:"arrow-down"}],Oat=[{label:"toolbarAnnotationsQuickDatePriceRange",icon:"measurer-drawing",value:"quick-date-price-range"},{label:"toolbarAnnotationsDateRange",icon:"date-range-drawing",value:"date-range"},{label:"toolbarAnnotationsPriceRange",icon:"price-range-drawing",value:"price-range"},{label:"toolbarAnnotationsDatePriceRange",icon:"date-price-range-drawing",value:"date-price-range"}],SK=[{strokeWidth:1,label:"1",value:1},{strokeWidth:2,label:"2",value:2},{strokeWidth:3,label:"3",value:3},{strokeWidth:4,label:"4",value:4},{strokeWidth:8,label:"8",value:8}],Nb=[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],MK=[{label:"10",value:10},{label:"12",value:12},{label:"14",value:14},{label:"16",value:16},{label:"18",value:18},{label:"22",value:22},{label:"28",value:28},{label:"36",value:36},{label:"46",value:46}],{FloatingToolbar:Eat,Menu:aw,ToolbarButtonWidget:Rat}=j,Am=class extends Il{constructor(){super(...arguments),this.checkedOverrides=new Il}};M([b],Am.prototype,"value");M([b],Am.prototype,"checkedOverrides");M([b],Am.prototype,"color");M([b],Am.prototype,"strokeWidth");M([b],Am.prototype,"isMultiColor");var Pat=class extends Rat{update(t){super.update(t),t.value==="line-stroke-width"&&this.updateLineStrokeWidth(t),(t.value==="fill-color"||t.value==="line-color"||t.value==="text-color")&&this.updateFillColor(t)}updateFillColor(t){const e=this.getElement();e.classList.add("ag-charts-annotations__color-picker-button"),e.classList.toggle("ag-charts-annotations__color-picker-button--multi-color",t.isMultiColor),e.style.setProperty("--color",t.color??null)}updateLineStrokeWidth(t){const e=this.getElement();e.classList.add("ag-charts-annotations__stroke-width-button"),e.style.setProperty("--stroke-width",`${t.strokeWidth}px`)}},zat=class extends Eat{createButtonWidget(){return new Pat(this.localeManager)}},yO=class extends xt{constructor(t,e){super(),this.ctx=t,this.getActiveDatum=e,this.enabled=!0,this.buttons=new ss(Am),this.cleanup=new qe,this.events=new cr,this.visibleButtons=[],this.toolbar=new zat(this.ctx,"ariaLabelAnnotationOptionsToolbar","annotation-options"),this.colorPicker=new vK(this.ctx),this.textSizeMenu=new aw(this.ctx,"text-size"),this.lineStyleTypeMenu=new aw(this.ctx,"annotations-line-style-type"),this.lineStrokeWidthMenu=new aw(this.ctx,"annotations-line-stroke-width"),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("toolbar-moved",this.onToolbarMoved.bind(this)),t.widgets.seriesWidget.addListener("drag-start",this.onDragStart.bind(this)),t.widgets.seriesWidget.addListener("drag-end",this.onDragEnd.bind(this)),()=>{this.colorPicker.destroy(),this.toolbar.destroy()})}onDragStart(){this.toolbar.ignorePointerEvents()}onDragEnd(){this.toolbar.capturePointerEvents()}destroy(){this.cleanup.flush()}show(){this.enabled&&this.toolbar.show()}hide(){this.toolbar.hide()}updateButtons(t){if(!this.enabled)return;const e={"line-style-type":Gh(t),"line-stroke-width":Gh(t),"line-color":vat(t),"text-color":Dat(t),"fill-color":Mat(t),"text-size":sw(t),settings:uf(t),lock:!0,delete:!0};this.visibleButtons=this.buttons.filter(i=>e[i.value]),this.toolbar.clearButtons(),this.toolbar.updateButtons(this.visibleButtons),this.refreshButtons(t)}setAnchorScene(t){this.toolbar.hasBeenDragged()||this.toolbar.setAnchor(t.getAnchor())}hideOverlays(){this.toolbar.clearActiveButton(),this.colorPicker.hide({lastFocus:null}),this.textSizeMenu.hide(),this.lineStyleTypeMenu.hide(),this.lineStrokeWidthMenu.hide(),this.events.emit("hid-overlays",null)}clearActiveButton(){this.toolbar.clearActiveButton()}updateColors(t){this.updateColorPickerColor("line-color",t.getDefaultColor("line-color"),t.getDefaultOpacity("line-color"),"isMultiColor"in t&&t?.isMultiColor),this.updateColorPickerColor("fill-color",t.getDefaultColor("fill-color"),t.getDefaultOpacity("fill-color"),"isMultiColor"in t&&t?.isMultiColor),this.updateColorPickerColor("text-color",t.getDefaultColor("text-color"),t.getDefaultOpacity("text-color"),"isMultiColor"in t&&t?.isMultiColor)}updateColorPickerColor(t,e,i,n){if(e!=null&&i!=null){const{r:s,g:a,b:o}=se.fromString(e);e=se.fromArray([s,a,o,i]).toHexString()}this.updateButtonByValue(t,{color:e,isMultiColor:n})}updateFontSize(t){this.updateButtonByValue("text-size",{label:t==null?void 0:String(t)})}updateLineStyleType(t){this.updateButtonByValue("line-style-type",{icon:t.icon})}updateStrokeWidth(t){this.updateButtonByValue("line-stroke-width",{label:t.label,strokeWidth:t.value})}onButtonPress({event:t,button:e,buttonWidget:i}){const n=this.getActiveDatum();if(n)switch(this.hideOverlays(),e.value){case"line-style-type":{const s=Gh(n)?ax(n.lineDash,n.lineStyle):void 0;this.lineStyleTypeMenu.show(i,{items:Nb,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStyle"),value:s,minWidth:this.lineStyleTypeMenuMinWidth,onPress:a=>this.onLineStyleTypeMenuPress(a,n),class:"ag-charts-annotations__line-style-type-menu"});break}case"line-stroke-width":{const s=Gh(n)?n.strokeWidth:void 0;this.lineStrokeWidthMenu.show(i,{items:SK,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStrokeWidth"),value:s,minWidth:this.lineStrokeWidthMenuMinWidth,onPress:a=>this.onLineStrokeWidthMenuPress(a,n),class:"ag-charts-annotations__line-stroke-width-menu"});break}case"line-color":case"fill-color":case"text-color":{this.toolbar.toggleActiveButtonByIndex(e.index),this.colorPicker.show({color:n?.getDefaultColor(e.value),opacity:n?.getDefaultOpacity(e.value),sourceEvent:t.sourceEvent,hasMultiColorOption:"isMultiColor"in n,isMultiColor:"isMultiColor"in n&&n?.isMultiColor,onChange:n==null?void 0:this.onColorPickerChange.bind(this,e.value,n),onChangeHide:(s=>{this.events.emit("saved-color",{type:n.type,colorPickerType:e.value,color:n.getDefaultColor(s)})}).bind(this,e.value)});break}case"text-size":{const s=xl(n)?n.fontSize:void 0;this.textSizeMenu.show(i,{items:MK,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsTextSize"),value:s,minWidth:this.textSizeMenuMinWidth,onPress:a=>this.onTextSizeMenuPress(a,n),class:"ag-charts-annotations__text-size-menu"});break}case"delete":{this.events.emit("pressed-delete",null);break}case"lock":{n.locked=!n.locked,this.refreshButtons(n),this.events.emit("pressed-lock",{locked:n.locked});break}case"settings":{this.toolbar.toggleActiveButtonByIndex(e.index),this.events.emit("pressed-settings",t);break}}}onToolbarMoved(t){const{buttonBounds:e,popoverBounds:i}=t,n={x:i.x,y:i.y+i.height+4},s={y:i.y-4};this.colorPicker.setAnchor(n,s);for(const[a,o]of e.entries()){const r=this.visibleButtons.at(a);if(!r)continue;const l={x:o.x,y:o.y+o.height-1},c={y:o.y};switch(r.value){case"line-stroke-width":{this.lineStrokeWidthMenuMinWidth=o.width+1,this.lineStrokeWidthMenu.setAnchor(l,c);break}case"line-style-type":{this.lineStyleTypeMenuMinWidth=o.width+1,this.lineStyleTypeMenu.setAnchor(l,c);break}case"text-size":{this.textSizeMenuMinWidth=o.width+1,this.textSizeMenu.setAnchor(l,c);break}}}}onColorPickerChange(t,e,i,n,s,a){this.events.emit("updated-color",{type:e.type,colorPickerType:t,colorOpacity:i,color:n,opacity:s,isMultiColor:a}),this.updateColorPickerColor(t,i,s,a)}onTextSizeMenuPress(t,e){if(!sw(e))return;const i=t.value;this.events.emit("updated-font-size",{type:e.type,fontSize:i}),this.textSizeMenu.hide(),this.updateFontSize(i)}onLineStyleTypeMenuPress(t,e){if(!Gh(e))return;const i=t.value;this.events.emit("updated-line-style",{type:e.type,lineStyleType:i}),this.lineStyleTypeMenu.hide(),this.updateLineStyleType(t)}onLineStrokeWidthMenuPress(t,e){if(!Gh(e))return;const i=t.value;this.events.emit("updated-line-width",{type:e.type,strokeWidth:i}),this.lineStrokeWidthMenu.hide(),this.updateStrokeWidth(t)}refreshButtons(t){const e=t.locked??!1;for(const[i,n]of this.visibleButtons.entries())n&&(n.value==="lock"?(this.toolbar.toggleSwitchCheckedByIndex(i,e),this.updateButtonByIndex(i,e?n.checkedOverrides.toJson():n.toJson())):this.toolbar.toggleButtonEnabledByIndex(i,!e));sw(t)&&this.updateFontSize(t.fontSize),this.updateColors(t),this.updateLineStyles(t)}updateLineStyles(t){if(!Gh(t))return;const e=t.strokeWidth??1,i=ax(t.lineDash,t.lineStyle);this.updateStrokeWidth({strokeWidth:e,value:e,label:String(e)}),this.updateLineStyleType(Nb.find(n=>n.value===i)??Nb[0])}updateButtonByValue(t,e){const i=this.visibleButtons.findIndex(n=>n.value===t);i!==-1&&this.updateButtonByIndex(i,e)}updateButtonByIndex(t,e){const i=this.visibleButtons.at(t);i&&this.toolbar.updateButtonByIndex(t,{...i.toJson(),...e,value:e.value??i.value})}};M([b],yO.prototype,"enabled");M([b],yO.prototype,"buttons");var yn=class extends Rt{constructor(t){const e=({context:i})=>{this.node?.drag(this.datum,this.offset,i,this.snapping),t.update()};super("idle",{idle:{dragStart:{target:"dragging",action:({offset:i,context:n})=>{this.hasMoved=!1,this.dragStart=i,this.offset=i,this.node?.dragStart(this.datum,i,n)}}},dragging:{keyDown:e,keyUp:e,drag:({offset:i,context:n})=>{this.hasMoved=at.lengthSquared(at.sub(i,this.dragStart))>0,this.offset=i,this.node?.drag(this.datum,i,n,this.snapping),t.update()},dragEnd:{target:Rt.parent,action:()=>{this.node?.stopDragging(),this.hasMoved&&t.recordAction("Move annotation"),t.update()}}}}),this.debug=Gt.create(!0,"annotations"),this.hasMoved=!1,this.snapping=!1}};M([Fe()],yn.prototype,"snapping");M([Fe()],yn.prototype,"datum");M([Fe()],yn.prototype,"node");var Kh=class extends mO{constructor(){super(...arguments),this.type="arrow-down"}static is(t){return Bt(t)&&t.type==="arrow-down"}};M([b],Kh.prototype,"type");var Bf=class extends j.Marker{isPointInPath(t,e){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(t,e)}},DK=class AK extends j.Group{constructor(){super(...arguments),this.active=!1,this.locked=!1,this.visible=!1,this.zIndex=1}drag(e){const{handle:i,locked:n}=this;return n?{point:{x:i.x,y:i.y},offset:{x:0,y:0}}:{point:e,offset:{x:e.x-i.x,y:e.y-i.y}}}toggleActive(e){this.active=e,e||(this.handle.strokeWidth=AK.INACTIVE_STROKE_WIDTH)}toggleHovered(e){this.glow.visible=!this.locked&&e,this.glow.dirtyPath=!0}toggleDragging(e){this.locked||(this.handle.visible=!e,this.glow.visible=this.glow.visible&&!e,this.handle.dirtyPath=!0,this.glow.dirtyPath=!0)}toggleLocked(e){this.locked=e}getCursor(){}containsPoint(e,i){return this.handle.containsPoint(e,i)}};DK.INACTIVE_STROKE_WIDTH=2;var gu=DK,bO=class IK extends gu{constructor(){super(),this.handle=new Bf({shape:"circle"}),this.glow=new Bf({shape:"circle"}),this.append([this.handle]),this.handle.size=IK.HANDLE_SIZE,this.handle.strokeWidth=gu.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2}update(e){this.handle.setProperties({...e,strokeWidth:gu.INACTIVE_STROKE_WIDTH})}drag(e){return{point:e,offset:{x:0,y:0}}}};bO.HANDLE_SIZE=7;bO.GLOW_SIZE=9;var Yh=bO,IA=class Ia extends gu{constructor(){super(),this.handle=new j.Rect,this.glow=new j.Rect,this.gradient="horizontal",this.append([this.glow,this.handle]),this.handle.cornerRadius=Ia.CORNER_RADIUS,this.handle.width=Ia.HANDLE_SIZE,this.handle.height=Ia.HANDLE_SIZE,this.handle.strokeWidth=gu.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.cornerRadius=Ia.CORNER_RADIUS,this.glow.width=Ia.GLOW_SIZE,this.glow.height=Ia.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(e){if(super.toggleLocked(e),e){const i=(Ia.HANDLE_SIZE-Yh.HANDLE_SIZE)/2;this.handle.cornerRadius=1,this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.x+=i,this.handle.y+=i,this.handle.width=Yh.HANDLE_SIZE,this.handle.height=Yh.HANDLE_SIZE,this.glow.width=Yh.GLOW_SIZE,this.glow.height=Yh.GLOW_SIZE}else this.handle.cornerRadius=Ia.CORNER_RADIUS,this.handle.width=Ia.HANDLE_SIZE,this.handle.height=Ia.HANDLE_SIZE,this.glow.width=Ia.GLOW_SIZE,this.glow.height=Ia.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles)}update(e){if(this.cachedStyles={...e},this.active||delete e.strokeWidth,this.locked){delete e.fill,delete e.strokeWidth;const i=(Ia.HANDLE_SIZE-Yh.HANDLE_SIZE)/2;e.x-=i,e.y-=i,this.cachedStyles.x-=i,this.cachedStyles.y-=i}this.handle.setProperties(e),this.glow.setProperties({...e,x:(e.x??this.glow.x)-2,y:(e.y??this.glow.y)-2,strokeWidth:0,fill:e.stroke})}drag(e){return this.locked?{point:e,offset:{x:0,y:0}}:this.gradient==="vertical"?{point:{x:e.x,y:this.handle.y},offset:{x:e.x-this.handle.x,y:0}}:{point:{x:this.handle.x,y:e.y},offset:{x:0,y:e.y-this.handle.y}}}getCursor(){if(!this.locked)return this.gradient==="vertical"?"col-resize":"row-resize"}};IA.HANDLE_SIZE=12;IA.GLOW_SIZE=16;IA.CORNER_RADIUS=4;var tf=IA,xO=class ob extends gu{constructor(){super(),this.handle=new Bf({shape:"circle"}),this.glow=new Bf({shape:"circle"}),this.append([this.glow,this.handle]),this.handle.size=ob.HANDLE_SIZE,this.handle.strokeWidth=gu.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.size=ob.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(e){super.toggleLocked(e),e?(this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.size=Yh.HANDLE_SIZE,this.glow.size=Yh.GLOW_SIZE):(this.handle.size=ob.HANDLE_SIZE,this.glow.size=ob.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles))}update(e){this.cachedStyles={...e},this.active||delete e.strokeWidth,this.locked&&(delete e.fill,delete e.strokeWidth),this.handle.setProperties(e),this.glow.setProperties({...e,strokeWidth:0,fill:e.stroke})}getCursor(){return"pointer"}};xO.HANDLE_SIZE=11;xO.GLOW_SIZE=17;var Yi=xO,ns=class extends j.Group{constructor(){super(...arguments),this.name="AnnotationScene",this.zIndex=pe.CHART_ANNOTATION}static isCheck(t,e){return Bt(t)&&Object.hasOwn(t,"type")&&t.type===e}toggleHovered(t,e,i){i!==!0&&this.toggleHandles(t||e)}computeBBoxWithoutHandles(){return j.Transformable.toCanvas(this,j.Group.computeChildrenBBox(this.excludeChildren({instance:gu})))}updateNode(t,e,i){if(!i&&e){e.remove();return}return i&&e==null&&(e=new t,this.appendChild(e)),e}},{ContinuousScale:Bat}=j;function ox(t,e,i=!1,n,s=1){if(!i)return na(t,e);const a=n?Ki(n,e):at.origin();return na(kA(t,a,s),e)}function kA(t,e,i){const n=at.sub(t,e),s=Ze(i),a=Math.round(at.angle(n)/s)*s;return at.rotate(n,a,e)}function CA(t,e){const i={};for(const[n,s]of Xe(t))i[n]=Ki(s,e);return i}function Ec(t,e,i,n={overflowContinuous:0,translateVectors:void 0,invertYVectors:void 0,snap:void 0}){const{xAxis:s,yAxis:a}=i,o=Object.keys(t),r=[],l=[],c=new Set(n.translateVectors??o),u=new Set(n.invertYVectors??[]),d=new Set([...c,...u]),g=at.multiply(e,at.from(1,-1));for(const D of o)d.has(D)&&(t[D]=at.add(t[D],u.has(D)?g:e),n.snap&&(t[D]=kA(t[D],n.snap.vectors[D],n.snap.angle))),r.push(s.getRangeOverflow(t[D].x)),l.push(a.getRangeOverflow(t[D].y));const f=(D,A)=>Math.abs(D)-Math.abs(A),y=(D,A,I)=>n.overflowContinuous===0||!Bat.is(D)?I.toSorted(f).at(-1)??0:o.length===d.size?I.toSorted(f).at(-n.overflowContinuous-1)??0:I.filter(N=>N!==0).length<=n.overflowContinuous?0:I.filter((N,O)=>N!==0&&Math.abs(N)<=Math.abs(A)&&d.has(o[O])).toSorted(f).at(-1)??0,x=at.from(y(s.scale,e.x,r),y(a.scale,e.y,l));if(!at.equal(x,at.origin()))for(const D of o)d.has(D)&&(t[D]=at.round(at.sub(t[D],x),4));const S={};for(const D of o)S[D]=na(t[D],i);return S}var kK=class extends ns{constructor(){super(...arguments),this.handle=new Yi,this.anchor={x:0,y:0,position:"above"}}update(t,e){const i=Ki(t,e);this.updateHandle(t,i),this.anchor=this.updateAnchor(t,i,e)}dragStart(t,e,i){this.dragState={offset:e,...CA({handle:t},i)}}drag(t,e,i){const{dragState:n}=this;if(!t.isWriteable()||!n)return;const{point:s}=Ec({point:n.handle},at.sub(e,n.offset),i);t.x=s.x,t.y=s.y}translate(t,e,i){if(!t.isWriteable())return;const{point:n}=Ec({point:Ki(t,i)},e,i);t.x=n.x,t.y=n.y}toggleHandles(t){this.handle.visible=!!t,this.handle.toggleHovered(this.activeHandle==="handle")}toggleActive(t){this.toggleHandles(t),this.handle.toggleActive(t)}stopDragging(){this.handle.toggleDragging(!1)}copy(t,e,i){const n=Ki(t,i),s=na({x:n.x-30,y:n.y-30},i);return e.x=s.x,e.y=s.y,e}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(t,e){const{handle:i}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="handle",!0):!1}getNodeAtCoords(t,e){if(this.handle.containsPoint(t,e))return"handle"}updateHandle(t,e,i){const{x:n,y:s}=this.getHandleCoords(t,e,i),a=this.getHandleStyles(t);this.handle.update({...a,x:n,y:s}),this.handle.toggleLocked(t.locked??!1)}updateAnchor(t,e,i){const n=this.getHandleCoords(t,e);return{x:n.x+i.seriesRect.x,y:n.y+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(t,e,i){return{x:e.x,y:e.y}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}},CK=class extends kK{constructor(){super(),this.append([this.handle])}update(t,e){super.update(t,e);const i=Ki(t,e);this.updateShape(t,i)}updateShape(t,e){this.updateShapeStyles(t),this.updateShapePath(t,e)}updateShapeStyles(t){const{shape:e}=this;e.fill=t.fill,e.fillOpacity=t.fillOpacity??1}updateShapePath(t,e){const{shape:i}=this;i.x=e.x,i.y=e.y,i.size=t.size}containsPoint(t,e){return super.containsPoint(t,e)||this.shape.containsPoint(t,e)}getNodeAtCoords(t,e){return this.shape.containsPoint(t,e)?"shape":super.getNodeAtCoords(t,e)}},wK=[[.5,0],[1,.5],[.75,.5],[.75,1],[.25,1],[.25,.5],[0,.5]];function NK(t){j.drawMarkerUnitPolygon(t,wK)}NK.anchor={x:.5,y:0};var J0=class extends CK{constructor(){super(),this.type="arrow-up",this.shape=new Bf({shape:NK}),this.append([this.shape])}static is(t){return ns.isCheck(t,"arrow-up")}getHandleCoords(t,e){const i=Yi.HANDLE_SIZE/2,n=super.getHandleCoords(t,e);return n.y-=i,n}},Vat=wK.map(([t,e])=>[t,1-e]);function TK(t){j.drawMarkerUnitPolygon(t,Vat)}TK.anchor={x:.5,y:1};var tS=class extends CK{constructor(){super(),this.type="arrow-down",this.shape=new Bf({shape:TK}),this.append([this.shape])}static is(t){return ns.isCheck(t,"arrow-down")}updateAnchor(t,e,i){const n=super.updateAnchor(t,e,i);return n.y-=t.size,n}getHandleCoords(t,e){const i=Yi.HANDLE_SIZE/2,n=super.getHandleCoords(t,e);return n.y+=i,n}},vO=class extends Rt{constructor(t){const e=({point:n})=>{const s=this.createDatum();s.set({x:n.x,y:n.y}),t.create(s)},i=()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()};super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},cancel:Rt.parent,reset:Rt.parent},"waiting-first-render":{render:{target:Rt.parent,action:i}}}),this.debug=Gt.create(!0,"annotations")}};M([Fe()],vO.prototype,"node");var _at=class extends vO{createDatum(){return new Kh}},WV={type:"arrow-down",datum:Kh,scene:tS,isDatum:Kh.is,translate:(t,e,i,n)=>{Kh.is(e)&&tS.is(t)&&t.translate(e,i,n)},copy:(t,e,i,n)=>{if(Kh.is(e)&&Kh.is(i)&&tS.is(t))return t.copy(e,i,n)},update:(t,e,i)=>{Kh.is(e)&&tS.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new _at({...t,create:e("arrow-down")}),dragState:t=>new yn(t)},$h=class extends mO{constructor(){super(...arguments),this.type="arrow-up"}static is(t){return Bt(t)&&t.type==="arrow-up"}};M([b],$h.prototype,"type");var Fat=class extends vO{createDatum(){return new $h}},KV={type:"arrow-up",datum:$h,scene:J0,isDatum:$h.is,translate:(t,e,i,n)=>{$h.is(e)&&J0.is(t)&&t.translate(e,i,n)},copy:(t,e,i,n)=>{if($h.is(e)&&$h.is(i)&&J0.is(t))return t.copy(e,i,n)},update:(t,e,i)=>{$h.is(e)&&J0.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Fat({...t,create:e("arrow-up")}),dragState:t=>new yn(t)},LK=class extends ns{constructor(){super(...arguments),this.overflowContinuous=0}extendLine({x1:t,y1:e,x2:i,y2:n},s,a){const o={x1:t,y1:e,x2:i,y2:n};if(!s.extendStart&&!s.extendEnd)return o;const[r,l]=hat(o,a.yAxis.bounds),c=o.x2=o.y2,d=o.x2===o.x1;return s.extendEnd&&(d?o.y2=u?l.y:r.y:(o.x2=c?r.x:l.x,o.y2=c?r.y:l.y)),s.extendStart&&(d?o.y1=u?r.y:l.y:(o.x1=c?l.x:r.x,o.y1=c?l.y:r.y)),o}dragStart(t,e,i){this.dragState={offset:e,...CA({start:t.start,end:t.end},i)}}drag(t,e,i,n){t.isWriteable()&&(this.activeHandle?this.dragHandle(t,e,i,n):this.dragAll(t,e,i))}dragAll(t,e,i){const{dragState:n}=this;n&&this.translatePoints(t,n.start,n.end,at.sub(e,n.offset),i)}translate(t,e,i){t.isWriteable()&&this.translatePoints(t,Ki(t.start,i),Ki(t.end,i),e,i)}copy(t,e,i){const n=oa(t,i);if(!n)return;const s=this.computeBBoxWithoutHandles(),a={x:-s.width/2,y:-s.height/2};return this.translatePoints(e,Wt.start(n),Wt.end(n),a,i),e}translatePoints(t,e,i,n,s){const a=this.getTranslatePointsVectors(e,i),o=Ec(a,n,s,{overflowContinuous:this.overflowContinuous});t.start.x=o.start.x,t.end.x=o.end.x,t.start.y=o.start.y,t.end.y=o.end.y}getTranslatePointsVectors(t,e){return{start:t,end:e}}},SO=class extends LK{constructor(){super(...arguments),this.start=new Yi,this.end=new Yi,this.anchor={x:0,y:0,position:"above"}}update(t,e){const i=oa(t,e);i!=null&&(this.updateHandles(t,i),this.updateAnchor(t,i,e))}toggleHandles(t){if(typeof t=="boolean")this.start.visible=t,this.end.visible=t;else for(const[e,i]of Xe(t))this[e].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(t){this.toggleHandles(t),this.start.toggleActive(t),this.end.toggleActive(t)}dragHandle(t,e,i,n){const{activeHandle:s,dragState:a}=this;if(!s||!a)return;this[s].toggleDragging(!0);const o=s==="start"?"end":"start",r=n?{vectors:{[s]:Ki(t[o],i)},angle:t.snapToAngle}:void 0,{[s]:l}=Ec({[s]:a[s]},at.sub(e,a.offset),i,{overflowContinuous:0,snap:r});t[s].x=l.x,t[s].y=l.y}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(t,e){const{start:i,end:n}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):n.containsPoint(t,e)?(this.activeHandle="end",!0):!1}getNodeAtCoords(t,e){if(this.start.containsPoint(t,e)||this.end.containsPoint(t,e))return"handle"}updateHandles(t,e,i){this.start.update({...this.getHandleStyles(t,"start"),...this.getHandleCoords(t,e,"start")}),this.end.update({...this.getHandleStyles(t,"end"),...this.getHandleCoords(t,e,"end",i)}),this.start.toggleLocked(t.locked??!1),this.end.toggleLocked(t.locked??!1)}updateAnchor(t,e,i,n){this.anchor={x:e.x1+i.seriesRect.x,y:e.y1+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(t,e,i,n){return i==="start"?Wt.start(e):Wt.end(e)}getHandleStyles(t,e){return{fill:t.handle.fill,stroke:t.handle.stroke,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}},Hat=class extends SO{constructor(){super(...arguments),this.label=new j.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(t){this.textInputBBox=t,this.markDirty("TextualStartEndScene")}update(t,e){const i=oa(t,e);if(i==null)return;const n=this.getTextBBox(t,i);this.updateLabel(t,n,i,e),this.updateHandles(t,i,n),this.updateShape(t,n,i),this.updateAnchor(t,i,e,n)}containsPoint(t,e){return super.containsPoint(t,e)||this.label.containsPoint(t,e)}getNodeAtCoords(t,e){return this.label.containsPoint(t,e)?"text":super.getNodeAtCoords(t,e)}getTextBBox(t,e){const{text:i}=t.getText();return fO(t,i,Wt.end(e),this.textInputBBox)}updateLabel(t,e,i,n){const{text:s,isPlaceholder:a}=t.getText(),o=this.getLabelCoords(t,e,i);n.isRtl&&(o.x+=e.width),pK(this.label,s,a,t,o)}updateShape(t,e,i){}getLabelCoords(t,e,i){return Wt.end(i)}getHandleStyles(t,e){return{...super.getHandleStyles(t,e),stroke:t.handle.stroke??t.color}}},{drawCorner:jat,Path:Gat}=j,eS=class extends Hat{constructor(){super(),this.type="callout",this.shape=new Gat,this.append([this.shape,this.label,this.start,this.end])}static is(t){return ns.isCheck(t,"callout")}drag(t,e,i,n){t.isWriteable()&&(this.activeHandle==="end"?this.dragHandle(t,e,i,n):this.dragAll(t,e,i))}getLabelCoords(t,e,i){const n=t.getPadding(),{bodyBounds:s={x:0,y:0,width:0,height:0}}=this.getDimensions(t,e,i)??{};return{x:s.x+n.left,y:s.y-n.bottom}}getHandleStyles(t,e){return e==="start"?{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}:{fill:void 0,strokeWidth:0}}updateAnchor(t,e,i,n){const{bodyBounds:s}=this.getDimensions(t,n,e)??{},a=s??n;this.anchor={x:a.x+i.seriesRect.x,y:a.y+i.seriesRect.y-a.height,position:this.anchor.position}}updateShape(t,e,i){const{shape:n}=this;n.fill=t.fill,n.fillOpacity=t.fillOpacity??1,n.stroke=t.stroke,n.strokeWidth=t.strokeWidth??1,n.strokeOpacity=t.strokeOpacity??1;const{tailPoint:s,bodyBounds:a}=this.getDimensions(t,e,i)??{};!s||!a||this.updatePath(s,a)}updatePath(t,e){const{x:i,y:n}=t,{x:s,y:a,width:o,height:r}=e,l=a-r,c=s+o,u=this.calculateCalloutPlacement({x:i,y:n},e),d=8,g=[{coordinates:{x0:s,x1:s+d,y0:l+d,y1:l,cx:u==="topLeft"?i:s+d,cy:u==="topLeft"?n:l+d},type:u==="topLeft"?"calloutCorner":"corner"},{coordinates:{x0:s+d,x1:c-d,y0:l,y1:l,cx:i,cy:n},type:u==="top"?"calloutSide":"side"},{coordinates:{x0:c-d,x1:c,y0:l,y1:l+d,cx:u==="topRight"?i:c-d,cy:u==="topRight"?n:l+d},type:u==="topRight"?"calloutCorner":"corner"},{coordinates:{x0:c,x1:c,y0:l+d,y1:a-d,cx:i,cy:n},type:u==="right"?"calloutSide":"side"},{coordinates:{x0:c,x1:c-d,y0:a-d,y1:a,cx:u==="bottomRight"?i:c-d,cy:u==="bottomRight"?n:a-d},type:u==="bottomRight"?"calloutCorner":"corner"},{coordinates:{x0:c-d,x1:s+d,y0:a,y1:a,cx:i,cy:n},type:u==="bottom"?"calloutSide":"side"},{coordinates:{x0:s+d,x1:s,y0:a,y1:a-d,cx:u==="bottomLeft"?i:s+d,cy:u==="bottomLeft"?n:a-d},type:u==="bottomLeft"?"calloutCorner":"corner"},{coordinates:{x0:s,x1:s,y0:a-d,y1:l+d,cx:i,cy:n},type:u==="left"?"calloutSide":"side"}],{path:f}=this.shape;f.clear(),f.moveTo(s,l+d);for(const{coordinates:y,type:x}of g)this.drawPath(f,y,d,x);f.closePath()}drawPath(t,{x0:e,y0:i,x1:n,y1:s,cx:a,cy:o},r,l){switch(l){case"calloutCorner":{t.lineTo(a,o),t.lineTo(n,s);break}case"corner":{jat(t,{x0:e,x1:n,y0:i,y1:s,cx:a,cy:o},r,!1);break}case"calloutSide":{if(e===n){const u=i>s?-1:1,d=Math.min(i,s)+Math.abs(i-s)/2;t.lineTo(e,d-6*u),t.lineTo(a,o),t.lineTo(e,d+6*u),t.lineTo(n,s)}else{const u=e>n?-1:1,d=Math.min(e,n)+Math.abs(n-e)/2;t.lineTo(d-6*u,i),t.lineTo(a,o),t.lineTo(d+6*u,i),t.lineTo(n,s)}break}default:{t.lineTo(n,s);break}}}calculateCalloutPlacement(t,e){const i=e.x+e.width,n=e.y-e.height;let s,a;return t.x>i?s="right":t.xe.y?a="bottom":t.y{const f=this.createDatum();f.set({start:g,end:g,visible:!0}),t.create(f)},i=()=>{const{node:g}=this;g?.toggleActive(!0),g?.toggleHandles({start:!0})},n=()=>{t.showTextInput(),this.datum&&(this.datum.visible=!1)},s=()=>{t.hideTextInput(),this.node?.setTextInputBBox(),this.datum&&(this.datum.visible=!0),t.deselect()},a=g=>{this.node?.setTextInputBBox(g),t.update()},o=({point:g})=>{const{datum:f,node:y}=this;f?.set({end:g}),y?.toggleActive(!0),y?.toggleHandles({end:!1}),t.update()},r=()=>{t.showAnnotationOptions(),this.node?.toggleHandles({end:!0})},l=({colorPickerType:g,colorOpacity:f,color:y,opacity:x,isMultiColor:S})=>{const{datum:D}=this;D&&(g==="text-color"&&t.updateTextInputColor(y),AA(D,g,f,y,x,S),t.update())},c=g=>{const{datum:f,node:y}=this;!f||!y||!xl(f)||(f.fontSize=g,t.updateTextInputFontSize(g),t.update())},u=()=>{t.delete()},d=({textInputValue:g,bbox:f})=>{const{datum:y}=this;if(f!=null&&g!=null&&g.length>0){if(!xl(y))return;const x=SA(y,g,f.width);y?.set({text:x}),t.update(),t.recordAction(`Create ${y?.type} annotation`)}else t.delete()};super("start",{start:{click:{target:"waiting-first-render",action:e},dragStart:{target:"waiting-first-render",action:e},cancel:Rt.parent,reset:Rt.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:o,drag:o,click:{target:"edit",action:r},dragEnd:{target:"edit",action:r},reset:{target:Rt.parent,action:u},cancel:{target:Rt.parent,action:u}},edit:{onEnter:n,updateTextInputBBox:a,color:l,fontSize:c,textInput:[{guard:MO,target:Rt.parent,action:u},{guard:DO,target:Rt.parent,action:d}],click:{target:Rt.parent,action:d},dragStart:{target:Rt.parent,action:d},resize:{target:Rt.parent,action:d},onExit:s,cancel:{target:Rt.parent,action:u}}}),this.debug=Gt.create(!0,"annotations")}};M([Fe()],AO.prototype,"datum");M([Fe()],AO.prototype,"node");var Uat=class extends AO{createDatum(){return new Ir}},YV={type:"callout",datum:Ir,scene:eS,isDatum:Ir.is,translate:(t,e,i,n)=>{if(Ir.is(e)&&eS.is(t))return t.translate(e,i,n)},copy:(t,e,i,n)=>{if(Ir.is(e)&&Ir.is(i)&&eS.is(t))return t.copy(e,i,n)},update:(t,e,i)=>{Ir.is(e)&&eS.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Uat({...t,create:e("callout")}),dragState:t=>new yn(t)},IO=class extends kK{constructor(){super(...arguments),this.label=new j.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(t){this.textInputBBox=t,this.markDirty("TextualPointScene")}update(t,e){const i=Ki(t,e),n=this.getTextBBox(t,i,e);this.updateLabel(t,n,e),this.updateHandle(t,i,n),this.updateShape(t,n),this.anchor=this.updateAnchor(t,n,e)}copy(t,e,i){const n=Ki(t,i),s=this.getTextBBox(t,n,i),a=t.getPadding(),o=a.left+a.right,r=a.top+a.bottom,l=(s.width+o)/2,c=s.height+r,u=na({x:n.x-l,y:n.y-c},i);return e.x=u.x,e.y=u.y,e}containsPoint(t,e){const{label:i}=this;return super.containsPoint(t,e)||i.visible&&i.containsPoint(t,e)}getNodeAtCoords(t,e){return this.label.visible&&this.label.containsPoint(t,e)?"text":super.getNodeAtCoords(t,e)}getTextBBox(t,e,i){const{text:n}=t.getText();return fO(t,n,{x:e.x,y:e.y},this.textInputBBox)}updateLabel(t,e,i){const{text:n,isPlaceholder:s}=t.getText(),a=this.getLabelCoords(t,e);i.isRtl&&(a.x+=e.width),pK(this.label,n,s,t,a,this.getTextBaseline(t))}updateShape(t,e){}updateAnchor(t,e,i){return{x:i.isRtl?e.x-e.width+i.seriesRect.x:e.x+i.seriesRect.x,y:e.y+i.seriesRect.y-e.height,position:this.anchor.position}}getLabelCoords(t,e){return e}getTextBaseline(t){return t.position=="center"?"middle":t.position}getHandleCoords(t,e,i){return i}getHandleStyles(t){const e=super.getHandleStyles(t);return e.stroke=t.handle.stroke??t.color,e}},{drawCorner:ow}=j,iS=class extends IO{constructor(){super(),this.type="comment",this.shape=new j.Path,this.append([this.shape,this.label,this.handle])}static is(t){return ns.isCheck(t,"comment")}updateShape(t,e){const{shape:i}=this;i.fill=t.fill,i.fillOpacity=t.fillOpacity??1,i.stroke=t.stroke??"transparent",i.strokeWidth=t.strokeWidth??1,i.strokeOpacity=t.strokeOpacity??1,this.updatePath(t,e)}getLabelCoords(t,e){const i=t.getPadding();return{x:e.x+i.left,y:e.y-i.bottom}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke??t.fill,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}updateAnchor(t,e,i){const n=super.updateAnchor(t,e,i),s=t.getPadding();return n.y-=s.bottom+s.top,n}updatePath(t,e){const i=t.getPadding(),{x:n,y:s}=e;let{width:a,height:o}=e;const{fontSize:r}=t,l=i.left+i.right,c=i.top+i.bottom;a=a+l,o=Math.max(o+c,r+c);const u=s-o,d=n+a,g=(nr(r,vA)+c)/2,{path:f}=this.shape;f.clear(),f.moveTo(n,s),f.lineTo(n,u+g),ow(f,{x0:n,x1:n+g,y0:u+g,y1:u,cx:n+g,cy:u+g},g,!1),f.lineTo(d-g,u),ow(f,{x0:d-g,x1:d,y0:u,y1:u+g,cx:d-g,cy:u+g},g,!1),f.lineTo(d,s-g),ow(f,{x0:d,x1:d-g,y0:s-g,y1:s,cx:d-g,cy:s-g},g,!1),f.closePath()}containsPoint(t,e){return super.containsPoint(t,e)||this.shape.containsPoint(t,e)}},av=class extends Rt{constructor(t){const e=({point:u})=>{const d=this.createDatum();d.set({x:u.x,y:u.y}),t.create(d)},i=()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()},n=()=>{t.showTextInput(),this.datum&&(this.datum.visible=!1)},s=()=>{t.hideTextInput(),this.node?.setTextInputBBox(),this.datum&&(this.datum.visible=!0),t.deselect()},a=u=>{this.node?.setTextInputBBox(u),t.update()},o=({colorPickerType:u,colorOpacity:d,color:g,opacity:f,isMultiColor:y})=>{this.datum&&(u==="text-color"&&t.updateTextInputColor(g),AA(this.datum,u,d,g,f,y),t.update())},r=u=>{const{datum:d,node:g}=this;!d||!g||!xl(d)||(d.fontSize=u,t.updateTextInputFontSize(u),t.update())},l=()=>{t.delete()},c=({textInputValue:u,bbox:d})=>{if(d!=null&&u!=null&&u.length>0){const{datum:g}=this;if(!xl(g))return;const f=SA(g,u,d.width);g?.set({text:f}),t.update(),t.recordAction(`Create ${g?.type} annotation`)}else t.delete()};super("start",{start:{click:{target:"waiting-first-render",action:e},dragStart:{target:"waiting-first-render",action:e},cancel:Rt.parent,reset:Rt.parent},"waiting-first-render":{render:{target:"edit",action:i}},edit:{onEnter:n,updateTextInputBBox:a,color:o,fontSize:r,textInput:[{guard:MO,target:Rt.parent,action:l},{guard:DO,target:Rt.parent,action:c}],click:{target:Rt.parent,action:c},dragStart:{target:Rt.parent,action:c},resize:{target:Rt.parent,action:c},onExit:s,cancel:{target:Rt.parent,action:l}}}),this.debug=Gt.create(!0,"annotations")}};M([Fe()],av.prototype,"datum");M([Fe()],av.prototype,"node");var Wat=class extends av{createDatum(){return new al}},$V={type:"comment",datum:al,scene:iS,isDatum:al.is,translate:(t,e,i,n)=>{al.is(e)&&iS.is(t)&&t.translate(e,i,n)},copy:(t,e,i,n)=>{if(al.is(e)&&al.is(i)&&iS.is(t))return t.copy(e,i,n)},update:(t,e,i)=>{al.is(e)&&iS.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Wat({...t,create:e("comment")}),dragState:t=>new yn(t)},{calculateLabelTranslation:Kat}=j,OK=class extends j.Group{constructor(){super({name:"AnnotationAxisLabelGroup"}),this.label=new j.Text({zIndex:1}),this.rect=new j.Rect;const{label:t}=this;t.fontSize=12,t.fontFamily="Verdana, sans-serif",t.fill="black",t.textBaseline="middle",t.textAlign="center",this.append([this.rect,this.label])}update(t){this.updateLabel(t),this.updateRect(t),this.updatePosition(t)}updateLabel({value:t,styles:e,context:i}){const{fontWeight:n,fontSize:s,fontStyle:a,fontFamily:o,textAlign:r,color:l="white",formatter:c}=e,u=c?c({value:t}):i.formatScaleValue(t,"annotation-label");this.label.setProperties({fontWeight:n,fontSize:s,fontStyle:a,fontFamily:o,textAlign:r,fill:l,text:u})}updateRect({styles:t}){const{rect:e}=this,{cornerRadius:i,fill:n,fillOpacity:s,stroke:a,strokeOpacity:o}=t;e.fill=n,e.fillOpacity=s??1,e.stroke=a,e.strokeOpacity=o??1,e.cornerRadius=i??0}updatePosition({x:t,y:e,context:i,styles:{padding:n}}){const{label:s,rect:a}=this,o=s.getBBox()?.clone(),r=n??8,l=n??4,{xTranslation:c,yTranslation:u}=Kat({yDirection:!0,padding:i.labelPadding,position:i.position??"left",bbox:o});o.grow(r,"horizontal"),o.grow(l,"vertical");const d=t+c,g=e+u;s.x=d,s.y=g,a.y=g-Math.round(o.height/2),a.x=d-Math.round(o.width/2),a.height=o.height,a.width=o.width}};OK.className="AxisLabel";var Ea=class extends j.Line{constructor(){super(...arguments),this.growCollisionBox=9,this.clipMask=new Map}setProperties(t){return super.setProperties(t),this.updateCollisionBBox(),this}updateCollisionBBox(){const{growCollisionBox:t,strokeWidth:e,x1:i,y1:n,x2:s,y2:a}=this;let o=e+t;o%2===0&&(o+=1);const r=at.from(i,n-Math.floor(o/2)),l=at.from(s,a),c=at.distance(r,l);this.collisionBBox=new j.BBox(r.x,r.y,c,o)}isPointInPath(t,e){const{collisionBBox:i,x1:n,y1:s,x2:a,y2:o}=this;if(!i)return!1;const r=at.from(n,s),l=at.from(a,o),c=at.sub(at.from(t,e),r),u=at.sub(l,r),d=at.rotate(c,at.angle(c,u),r);return i.containsPoint(d.x,d.y)??!1}render(t){const{clipMask:e}=this,{ctx:i}=t;if(e.size===0){super.render(t);return}i.save();try{for(const n of this.clipMask.values()){const{x:s,y:a,radius:o}=n;i.beginPath(),i.rect(0,0,i.canvas.width,i.canvas.height),i.ellipse(s,a,o,o,0,Math.PI*2,0,!0),i.clip()}super.render(t)}finally{i.restore()}}setClipMask(t,e){const i=this.clipMask.get(t);or(i,e)!=null&&this.markDirty("CollidableLine"),e?this.clipMask.set(t,e):this.clipMask.delete(t)}},pp=class extends j.TransformableText{constructor(){super(...arguments),this.growCollisionBox={top:4,right:4,bottom:4,left:4}}isPointInPath(t,e){const i=this.fromParentPoint(t,e),n=this.computeBBoxWithoutTransforms();return n?n.grow(this.growCollisionBox).containsPoint(i.x,i.y):!1}};function df(t,e,i,n,s,a,o){if(!a||!s||!n){e.setClipMask(t);return}const{alignment:r,position:l}=n,c=RK(i,n.fontSize,o),{point:u,textBaseline:d}=PK(c,l,r);zK(s,a,n,u,c.angle,d);const{x:g,y:f,width:y,height:x}=s.getBBox(),S=at.length(at.from(y,x)),D={x:g+y/2,y:f+x/2,radius:S/2+at.length(c.offset)};return l==="center"?e.setClipMask(t,D):e.setClipMask(t),{clipMask:D,numbers:c}}function EK(t,e,i,n,s,a,o){if(!o||!a)return;const{alignment:r,position:l}=n,[c,u]=e.y1<=i.y1?[e,i]:[i,e];let d=c;l==="bottom"?d=u:l==="inside"&&(d={x1:(c.x1+u.x1)/2,y1:(c.y1+u.y1)/2,x2:(c.x2+u.x2)/2,y2:(c.y2+u.y2)/2});const g=RK(d,n.fontSize,s),{point:f,textBaseline:y}=PK(g,l==="inside"?"center":l,r,t);zK(a,o,n,f,g.angle,y)}function RK(t,e,i){let[n,s]=at.from(t);n.x>s.x&&([n,s]=[s,n]);const a=at.normalized(at.sub(s,n)),o=at.angle(a),r=at.multiply(a,Yi.HANDLE_SIZE/2+(e??14)/2),l=at.multiply(a,(i??2)/2+(e??14)/3);return{left:n,right:s,normal:a,angle:o,inset:r,offset:l}}function PK({left:t,right:e,normal:i,angle:n,inset:s,offset:a},o,r,l){let c;r==="right"?c=at.sub(e,s):r==="center"?c=at.add(t,at.multiply(i,at.distance(t,e)/2)):c=at.add(t,s);let u="bottom";return o==="bottom"?(c=at.rotate(a,n+Math.PI/2,c),u="top"):o==="center"&&!l?u="middle":c=at.rotate(a,n-Math.PI/2,c),{point:c,textBaseline:u}}function zK(t,e,i,n,s,a){t.setProperties({text:e,x:n.x,y:n.y,rotation:s,rotationCenterX:n.x,rotationCenterY:n.y,fill:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,textAlign:i.alignment,textBaseline:a})}var nu=class extends ns{constructor(){super(),this.type="cross-line",this.line=new Ea,this.middle=new tf,this.isHorizontal=!1,this.append([this.line,this.middle])}static is(t){return ns.isCheck(t,"cross-line")}update(t,e){const{seriesRect:i}=e;this.seriesRect=i,this.isHorizontal=Bs.is(t);const n=this.isHorizontal?e.yAxis:e.xAxis,s=this.convertCrossLine(t,n);if(s==null){this.visible=!1;return}this.visible=t.visible??!0,this.visible&&(this.updateLine(t,s),this.updateHandle(t,s),this.updateText(t,s),this.updateAxisLabel(t,n,s))}updateLine(t,e){const{line:i}=this,{lineDashOffset:n,stroke:s,strokeWidth:a,strokeOpacity:o}=t,{x1:r,y1:l,x2:c,y2:u}=e;i.setProperties({x1:r,y1:l,x2:c,y2:u,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:n,stroke:s,strokeWidth:a,strokeOpacity:o,fillOpacity:0})}updateHandle(t,e){const{middle:i}=this,{locked:n,stroke:s,strokeWidth:a,strokeOpacity:o}=t,r={fill:t.handle.fill,stroke:t.handle.stroke??s,strokeOpacity:t.handle.strokeOpacity??o,strokeWidth:t.handle.strokeWidth??a},l=at.sub(Wt.center(e),at.from(i.handle.width/2,i.handle.height/2));i.gradient=this.isHorizontal?"horizontal":"vertical",i.update({...r,...l}),i.toggleLocked(n??!1)}updateText(t,e){this.text=this.updateNode(pp,this.text,!!t.text.label),df(this.line.id,this.line,e,t.text,this.text,t.text.label,t.strokeWidth)}createAxisLabel(t){const e=new OK;return t.attachLabel(e),e}updateAxisLabel(t,e,i){this.axisLabel??(this.axisLabel=this.createAxisLabel(e));const{axisLabel:n,seriesRect:s}=this,{direction:a,position:o}=e;if(t.axisLabel.enabled){n.visible=this.visible;const r=o==="left"||o==="top"?Wt.start(i):Wt.end(i),l=a===z.X?r.x:r.y;if(!e.inRange(l)){n.visible=!1;return}const c=Jn(t.value);n.update({...at.add(r,at.required(s)),value:c,styles:t.axisLabel,context:e})}else n.visible=!1}setAxisLabelOpacity(t){this.axisLabel&&(this.axisLabel.opacity=t)}setAxisLabelVisible(t){this.axisLabel&&(this.axisLabel.visible=t)}toggleHandles(t){this.middle.visible=t,this.middle.toggleHovered(this.activeHandle==="middle")}destroy(){super.destroy(),this.axisLabel?.destroy()}toggleActive(t){this.toggleHandles(t),this.middle.toggleActive(t)}dragStart(t,e,i){const n=Bs.is(t)?{x:e.x,y:vc(t.value,i.yAxis)}:{x:vc(t.value,i.xAxis),y:e.y};this.dragState={offset:e,middle:n}}drag(t,e,i){const{activeHandle:n,dragState:s}=this;!t.isWriteable()||!s||(n&&this[n].toggleDragging(!0),this.translatePoint(t,s.middle,at.sub(e,s.offset),i))}translate(t,e,i){if(!t.isWriteable())return;const n=Bs.is(t)?at.from(0,vc(t.value,i.yAxis)):at.from(vc(t.value,i.xAxis),0);this.translatePoint(t,n,e,i)}translatePoint(t,e,i,n){const s=Bs.is(t);s?i.x=0:i.y=0;const{point:a}=Ec({point:e},i,n);t.value=s?a.y:a.x}stopDragging(){this.middle.toggleDragging(!1)}copy(t,e,i){const n=Bs.is(t),s=this.isHorizontal?i.yAxis:i.xAxis,a=this.convertCrossLine(t,s);if(!a)return;const o=n?-30:0,r=n?0:-30,l=na({x:a.x1+r,y:a.y1+o},i);return e.set({value:n?l.y:l.x}),e}getCursor(){return this.activeHandle==null?"pointer":this[this.activeHandle].getCursor()}containsPoint(t,e){const{middle:i,line:n,text:s}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="middle",!0):n.isPointInPath(t,e)||!!s?.containsPoint(t,e)}getNodeAtCoords(t,e){if(this.text?.containsPoint(t,e))return"text";if(this.line.isPointInPath(t,e))return"line";if(this.middle.containsPoint(t,e))return"handle"}getAnchor(){const t=this.computeBBoxWithoutHandles();return this.isHorizontal?{x:t.x+t.width/2,y:t.y}:{x:t.x+t.width,y:t.y+t.height/2,position:"right"}}convertCrossLine(t,e){if(t.value==null)return;let i=0,n=0,s,a;const{bounds:o}=e,r=vc(t.value,e);return Bs.is(t)?(s=o.width,n=r,a=r):(i=r,s=r,a=o.height),{x1:i,y1:n,x2:s,y2:a}}},kO=class extends Rt{constructor(t,e){const i=({point:s})=>{const a=t==="horizontal",o=a?new Bs:new ol;o.set({value:a?s.y:s.x}),e.create(o),e.recordAction(`Create ${a?"horizontal-line":"vertical-line"} annotation`)},n=()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()};super("start",{start:{click:{target:"waiting-first-render",action:i},drag:{target:"waiting-first-render",action:i},reset:Rt.parent,cancel:Rt.parent},"waiting-first-render":{render:{target:Rt.parent,action:n}}}),this.debug=Gt.create(!0,"annotations")}};M([Fe()],kO.prototype,"node");var XV={type:"horizontal-line",datum:Bs,scene:nu,isDatum:Bs.is,translate:(t,e,i,n)=>{Bs.is(e)&&nu.is(t)&&t.translate(e,i,n)},copy:(t,e,i,n)=>{if(Bs.is(e)&&Bs.is(i)&&nu.is(t))return t.copy(e,i,n)},update:(t,e,i)=>{Bs.is(e)&&nu.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new kO("horizontal",{...t,create:e("horizontal-line")}),dragState:t=>new yn(t)},ZV={type:"vertical-line",datum:ol,scene:nu,isDatum:ol.is,translate:(t,e,i,n)=>{ol.is(e)&&nu.is(t)&&t.translate(e,i,n)},copy:(t,e,i,n)=>{if(ol.is(e)&&ol.is(i)&&nu.is(t))return t.copy(e,i,n)},update:(t,e,i)=>{ol.is(e)&&nu.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new kO("vertical",{...t,create:e("vertical-line")}),dragState:t=>new yn(t)},BK=class{static updateBackground(t,e,i,n){const{background:s}=this,{seriesRect:a}=n;s.path.clear(!0);const o=Wt.from(0,0,a.width,a.height),r=this.getBackgroundPoints(t,e,i,o);for(let c=0;ce.x2,a=e.y1>e.y2,o=a?n.y2:n.y1,r=a?n.y1:n.y2,l=at.from(e);return t.extendEnd&&e.y2===r&&l.push(at.from(s?n.x1:n.x2,a?n.y1:n.y2)),t.extendEnd&&i.y2===o&&l.push(at.from(s?n.x1:n.x2,a?n.y2:n.y1)),l.push(...at.from(i).reverse()),t.extendStart&&i.y1===r&&l.push(at.from(s?n.x2:n.x1,a?n.y1:n.y2)),t.extendStart&&e.y1===o&&l.push(at.from(s?n.x2:n.x1,a?n.y2:n.y1)),l}},wA=class extends Rt{constructor(t){const e=({point:l})=>{const c=new Xo;c.set({start:l,end:l,startHeight:0,endHeight:0}),t.create(c)},i=()=>{const{node:l}=this;l?.toggleActive(!0),l?.toggleHandles({topLeft:!0,topRight:!1,bottomLeft:!1,bottomRight:!1})},n=({offset:l,context:c})=>{const{datum:u,snapping:d}=this;u&&(u.set({end:ox(l,c,d,u.start,u.snapToAngle)}),t.update())},s=()=>{this.node?.toggleHandles({topRight:!0}),t.update()},a=({point:l})=>{const{datum:c,node:u}=this,d=Jn(c?.end.y),g=Jn(c?.start.y),{y:f}=l;if(c==null||!Je(g)||!Je(d)||!Je(f))return;const y=d-(f??0),x=(g-d)*2+y,S={x:c?.start.x,y:g-x},D={x:c?.end.x,y:l.y};u?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!t.validatePoint(S,{overflowContinuous:!0})||!t.validatePoint(D,{overflowContinuous:!0}))&&(c.set({startHeight:x,endHeight:y}),t.update())},o=({point:l})=>{const{datum:c,node:u}=this,d=Jn(c?.end.y),g=Jn(c?.start.y),{y:f}=l;if(c==null||!Je(g)||!Je(d)||!Je(f))return;const y=d-(f??0),x=(g-d)*2+y,S={x:c.start.x,y:g-y},D={x:c.end.x,y:l.y};u?.toggleHandles(!0),!(!t.validatePoint(S,{overflowContinuous:!0})||!t.validatePoint(D,{overflowContinuous:!0}))&&(c.set({startHeight:x,endHeight:y}),t.recordAction("Create disjoint-channel annotation"),t.showAnnotationOptions(),t.update())},r=()=>t.delete();super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:Rt.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:n,drag:n,click:{target:"height",action:s},dragEnd:{target:"height",action:s},reset:{target:Rt.parent,action:r},cancel:{target:Rt.parent,action:r}},height:{hover:a,click:{target:Rt.parent,action:o},drag:{target:Rt.parent,action:o},reset:{target:Rt.parent,action:r},cancel:{target:Rt.parent,action:r}}}),this.debug=Gt.create(!0,"annotations"),this.snapping=!1}};M([Fe()],wA.prototype,"datum");M([Fe()],wA.prototype,"node");M([Fe()],wA.prototype,"snapping");var qV={type:"disjoint-channel",datum:Xo,scene:nS,isDatum:Xo.is,translate:(t,e,i,n)=>{Xo.is(e)&&nS.is(t)&&t.translate(e,i,n)},copy:(t,e,i,n)=>{if(Xo.is(e)&&Xo.is(i)&&nS.is(t))return t.copy(e,i,n)},update:(t,e,i)=>{Xo.is(e)&&nS.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new wA({...t,create:e("disjoint-channel")}),dragState:t=>new yn(t)},t1=[0,23.6,38.2,50,61.8,78.6,100],Yat=[161.8,261.8,361.8,423.6],$at=[...t1,...Yat],Xat={10:$at,6:t1,4:t1.filter(t=>t!==78.6&&t!==23.6)},QV=10;function Zat(t,e){const{x2:i,y1:n,y2:s}=t,a=n-s;return e==null?{x1:i,x2:i,y1:s-a,y2:s}:{x1:e.x1,x2:e.x2,y1:e.y2-a,y2:e.y2}}function _K({x1:t,y1:e,x2:i,y2:n},s,a,o,r=10){const l=e-n,c=a?-1:1,u=[],{yAxis:d,isRtl:g}=s;let f=o;for(const[y,x]of Xat[r].entries()){const S=o+l*(x/100)*c,D=d.scaleInvert(S);u.push({id:y,x1:t,x2:i,y1:f,y2:S,tag:x==100?0:1,label:{x1:g?Math.max(t,i)+QV:Math.min(t,i)-QV,x2:i,y1:S,y2:S,text:g?`(${D.toFixed(2)}) ${(x/100).toFixed(3)}`:`${(x/100).toFixed(3)} (${D.toFixed(2)})`}}),f=S}return u}var FK=class extends ns{constructor(){super(),this.trendLine=new Ea,this.rangeFillsGroup=new j.Group({name:`${this.id}-range-fills`}),this.rangeFillsGroupSelection=j.Selection.select(this.rangeFillsGroup,j.Range),this.rangeStrokesGroup=new j.Group({name:`${this.id}-range-strokes`}),this.rangeStrokesGroupSelection=j.Selection.select(this.rangeStrokesGroup,Ea),this.labelsGroup=new j.Group({name:`${this.id}-ranges-labels`}),this.labelsGroupSelection=j.Selection.select(this.labelsGroup,pp),this.anchor={x:0,y:0,position:"above"},this.append([this.trendLine,this.rangeFillsGroup,this.rangeStrokesGroup,this.labelsGroup])}update(t,e){let i=oa(t,e);if(i==null){this.visible=!1;return}if(i=Wt.round(i),this.visible=t.visible??!0,!this.visible)return;this.updateLine(t,i,this.trendLine),this.updateHandles(t,i),this.updateAnchor(t,i,e);const{reverse:n}=t,s=this.extendLine(i,t,e),a=n?s.y1:s.y2,o=n?s.y2:s.y1,r=_K(s,e,t.reverse,a,t.bands);this.updateRanges(t,r,e);const l={...s,y1:o,y2:o};this.updateText(t,l)}extendLine({x1:t,y1:e,x2:i,y2:n},s,a){const o={x1:t,y1:e,x2:i,y2:n};if(!s.extendStart&&!s.extendEnd)return o;const{x:r,width:l}=a.xAxis.bounds;return s.extendEnd&&(o[t>i?"x1":"x2"]=r+l),s.extendStart&&(o[t>i?"x2":"x1"]=r),o}updateLine(t,e,i){if(!e||!i)return;const{lineDashOffset:n,strokeWidth:s,strokeOpacity:a,stroke:o}=t;i.setProperties({...e,lineCap:t.getLineCap(),lineDash:[3,4],lineDashOffset:n,strokeWidth:s,strokeOpacity:a,fillOpacity:0,stroke:o})}updateRangeStrokes(t){const{lineDashOffset:e,strokeWidth:i,strokeOpacity:n,strokes:s,rangeStroke:a,isMultiColor:o}=t;this.rangeStrokesGroupSelection.each((r,{x1:l,x2:c,y2:u,tag:d},g)=>{const f=u,y=o?s[g%s.length]:a;r.setProperties({x1:l,x2:c,y1:f,y2:f,stroke:y,strokeOpacity:n,strokeWidth:i,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,tag:d})})}updateRanges(t,e,i){const n=s=>s.id;this.rangeFillsGroupSelection.update(e,void 0,n),this.rangeStrokesGroupSelection.update(e,void 0,n),this.labelsGroupSelection.update(e,void 0,n),this.updateRangeFills(t),this.updateRangeStrokes(t),this.updateRangeLabels(t,i)}updateRangeFills(t){const{lineDashOffset:e,strokeWidth:i,strokeOpacity:n,strokes:s,rangeStroke:a,showFill:o,isMultiColor:r}=t;this.rangeFillsGroupSelection.each((l,{x1:c,x2:u,y1:d,y2:g},f)=>{const y=r?s[f%s.length]:a;if(!o){l.visible=!1;return}l.setProperties({x1:c,x2:u,y1:d,y2:g,startLine:!1,endLine:!1,stroke:y,strokeOpacity:n,fill:y,fillOpacity:(n??1)*.15,strokeWidth:i,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,visible:!0})})}updateRangeLabels(t,{xAxis:e,isRtl:i}){const{rangeStrokesGroupSelection:n}=this,{strokes:s,strokeWidth:a,rangeStroke:o,isMultiColor:r,label:{fontFamily:l,fontSize:c,fontStyle:u,fontWeight:d,color:g}}=t,f={fontFamily:l,fontSize:c,fontStyle:u,fontWeight:d},y=this.checkWithinBounds(e,f,i,this.labelsGroupSelection.at(0));this.labelsGroupSelection.each((x,S,D)=>{const A=g??(r?s[D%s.length]:o),I=n.at(D);if(!I)return;const{text:w,...N}=S.label;if(y)x.setProperties({...f,text:w,x:N.x1,y:N.y1,textBaseline:"middle",textAlign:i?"left":"end",fill:A}),df(x.id,I,N);else{const O={...f,position:"center",alignment:i?"right":"left",color:A};df(x.id,I,N,O,x,w,a)}})}checkWithinBounds(t,e,i,n){if(!n)return!1;const{text:s,...a}=n.datum.label;n.setProperties({...e,text:s,x:a.x1,y:a.y1,textBaseline:"middle",textAlign:i?"left":"end"});const o=n.getBBox(),r=o.x,l=o.x+o.width,c=t.bounds.x,u=t.bounds.x+t.bounds.width;return r>=c&&l<=u}updateText(t,e){const i=this.rangeStrokesGroupSelection.selectByTag(0)[0];if(!i)return;const{text:n,strokeWidth:s}=t;this.text=this.updateNode(pp,this.text,!!n.label),df(i.id,i,e,n,this.text,n.label,s)}updateAnchor(t,e,i,n){const s=Wt.topCenter(e);at.apply(this.anchor,j.Transformable.toCanvasPoint(this.trendLine,s.x,s.y))}containsPoint(t,e){const{trendLine:i,rangeStrokesGroupSelection:n,text:s}=this;let a=!1;return n.each(o=>a||(a=o.isPointInPath(t,e))),a||i.isPointInPath(t,e)||!!s?.containsPoint(t,e)}getNodeAtCoords(t,e){if(this.text?.containsPoint(t,e))return"text";if(this.trendLine.isPointInPath(t,e))return"line"}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}drag(t,e,i,n){t.isWriteable()&&(this.activeHandle?this.dragHandle(t,e,i,n):this.dragAll(t,e,i))}getAnchor(){return this.anchor}getCursor(){return"pointer"}},{ContinuousScale:JV}=j;function VM(t,e,i={overflowContinuous:!1},n){if(e.x==null||e.y==null)return!1;const{xAxis:s,yAxis:a}=t,o=i.overflowContinuous&&JV.is(s.scale),r=i.overflowContinuous&&JV.is(a.scale),l=o||t_(e.x,s),c=r||t_(e.y,a);return!!(l&&c)}function t_(t,e){const{domain:i}=e.scale,n=Jn(t);return i&&n!=null&&e.continuous?n>=i[0]&&n<=i.at(-1):!0}var sS=class extends FK{constructor(){super(),this.type="fibonacci-retracement-trend-based",this.endRetracementLine=new Ea,this.start=new Yi,this.end=new Yi,this.endRetracement=new Yi,this.append([this.endRetracementLine,this.start,this.end,this.endRetracement])}static is(t){return ns.isCheck(t,"fibonacci-retracement-trend-based")}update(t,e){let{coords1:i,coords2:n}=this.getCoords(t,e);if(i==null||n==null){this.visible=!1;return}if(i=Wt.round(i),n=Wt.round(n),this.visible=t.visible??!0,!this.visible)return;(t.endRetracement.x==null||t.endRetracement.y==null)&&(n=void 0),this.updateLine(t,i,this.trendLine),this.updateLine(t,n,this.endRetracementLine),this.updateHandles(t,i,n),this.updateAnchor(t,n??i,e);const{reverse:s,bands:a}=t,o=Zat(i,n),r=this.extendLine(o,t,e),l=r.y2,c=r.y1,u=n?_K(r,e,s,l,a):[];this.updateRanges(t,u,e);const d={...r,y1:c,y2:c};this.updateText(t,d)}containsPoint(t,e){const{start:i,end:n,endRetracement:s,endRetracementLine:a}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):n.containsPoint(t,e)?(this.activeHandle="end",!0):s.containsPoint(t,e)?(this.activeHandle="endRetracement",!0):a.isPointInPath(t,e)||super.containsPoint(t,e)}getNodeAtCoords(t,e){return this.start.containsPoint(t,e)||this.end.containsPoint(t,e)||this.endRetracement.containsPoint(t,e)?"handle":this.endRetracementLine.isPointInPath(t,e)?"line":super.getNodeAtCoords(t,e)}dragStart(t,e,i){this.dragState={offset:e,...CA({start:t.start,end:t.end,endRetracement:t.endRetracement},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1),this.endRetracement.toggleDragging(!1)}dragAll(t,e,i){const{dragState:n}=this;n&&this.translatePoints({datum:t,start:n.start,end:n.end,endRetracement:n.endRetracement,translation:at.sub(e,n.offset),context:i})}dragHandle(t,e,i,n){const{activeHandle:s,dragState:a}=this;if(!s||!a)return;this[s].toggleDragging(!0);const o=n?this.snapToAngle(t,e,i):na(this[s].drag(e).point,i);!o||!VM(i,o)||(t[s].x=o.x,t[s].y=o.y)}snapToAngle(t,e,i){const{activeHandle:n}=this,s=["start","end","endRetracement"];if(!n)return;const a=(s.indexOf(n)+1)%s.length,o=s[a];this[n].toggleDragging(!0);const r=Ki(t[o],i);return na(kA(e,r,t.snapToAngle),i)}translatePoints({datum:t,start:e,end:i,endRetracement:n,translation:s,context:a}){const o=Ec({start:e,end:i,endRetracement:n},s,a,{overflowContinuous:2});t.start.x=o.start.x,t.end.x=o.end.x,t.endRetracement.x=o.endRetracement.x,t.start.y=o.start.y,t.end.y=o.end.y,t.endRetracement.y=o.endRetracement.y}translate(t,e,i){this.translatePoints({datum:t,start:Ki(t.start,i),end:Ki(t.end,i),endRetracement:Ki(t.endRetracement,i),translation:e,context:i})}copy(t,e,i){const{coords1:n,coords2:s}=this.getCoords(t,i);if(!n||!s)return;const a=this.computeBBoxWithoutHandles();return this.translatePoints({datum:e,start:Wt.start(n),end:Wt.end(n),endRetracement:Wt.end(s),translation:{x:-a.width/2,y:-a.height/2},context:i}),e}getCoords(t,e){return{coords1:oa(t,e),coords2:oa({start:t.end,end:t.endRetracement},e)}}toggleHandles(t){if(typeof t=="boolean")this.start.visible=t,this.end.visible=t,this.endRetracement.visible=t;else for(const[e,i]of Xe(t))this[e].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end"),this.endRetracement.toggleHovered(this.activeHandle==="endRetracement")}toggleActive(t){this.toggleHandles(t),this.start.toggleActive(t),this.end.toggleActive(t),this.endRetracement.toggleActive(t)}updateHandles(t,e,i,n){this.start.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"start")}),this.end.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"end",n)}),i&&this.endRetracement.update({...this.getHandleStyles(t),...this.getHandleCoords(t,i,"endRetracement",n)}),this.start.toggleLocked(t.locked??!1),this.end.toggleLocked(t.locked??!1),this.endRetracement.toggleLocked(t.locked??!1)}getHandleCoords(t,e,i,n){return i==="start"?Wt.start(e):Wt.end(e)}},NA=class extends Rt{constructor(t){const e=({point:c})=>{const u=this.createDatum();u.set({start:c,end:c}),t.create(u)},i=()=>{const{node:c}=this;c?.toggleActive(!0),c?.toggleHandles({start:!0,end:!1,endRetracement:!1})},n=({offset:c,context:u})=>{const{datum:d,snapping:g}=this;d&&(d.set({end:ox(c,u,g,d.start,d.snapToAngle)}),t.update())},s=()=>{const{datum:c}=this;c&&(c.endRetracement.x=c.end.x,c.endRetracement.y=c.end.y,this.node?.toggleHandles({end:!0}),t.update())},a=({offset:c,context:u})=>{const{datum:d,snapping:g}=this;d&&(d.set({endRetracement:ox(c,u,g,d.end,d.snapToAngle)}),t.update())},o=()=>{this.node?.toggleHandles({endRetracement:!0}),t.update()},r=()=>t.delete(),l=()=>{t.showAnnotationOptions(),t.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:Rt.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:n,click:{target:"endRetracement",action:s},drag:n,dragEnd:{target:"endRetracement",action:s},reset:{target:Rt.parent,action:r},cancel:{target:Rt.parent,action:r},onExit:l},endRetracement:{hover:a,click:{target:Rt.parent,action:o},drag:{target:Rt.parent,action:o},reset:{target:Rt.parent,action:r},cancel:{target:Rt.parent,action:r}}}),this.debug=Gt.create(!0,"annotations"),this.snapping=!1}createDatum(){return new rl}};M([Fe()],NA.prototype,"datum");M([Fe()],NA.prototype,"node");M([Fe()],NA.prototype,"snapping");var e_={type:"fibonacci-retracement-trend-based",datum:rl,scene:sS,isDatum:rl.is,translate:(t,e,i,n)=>{rl.is(e)&&sS.is(t)&&t.translate(e,i,n)},copy:(t,e,i,n)=>{if(rl.is(e)&&rl.is(i)&&sS.is(t))return t.copy(e,i,n)},update:(t,e,i)=>{rl.is(e)&&sS.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new NA({...t,create:e("fibonacci-retracement-trend-based")}),dragState:t=>new yn(t)},aS=class extends FK{constructor(){super(),this.type="fibonacci-retracement",this.start=new Yi,this.end=new Yi,this.append([this.start,this.end])}static is(t){return ns.isCheck(t,"fibonacci-retracement")}containsPoint(t,e){const{start:i,end:n}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):n.containsPoint(t,e)?(this.activeHandle="end",!0):super.containsPoint(t,e)}getNodeAtCoords(t,e){return this.start.containsPoint(t,e)||this.end.containsPoint(t,e)?"handle":super.getNodeAtCoords(t,e)}dragStart(t,e,i){this.dragState={offset:e,...CA({start:t.start,end:t.end},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}dragAll(t,e,i){const{dragState:n}=this;n&&this.translatePoints({datum:t,start:n.start,end:n.end,translation:at.sub(e,n.offset),context:i})}dragHandle(t,e,i,n){const{activeHandle:s,dragState:a}=this;if(!s||!a)return;this[s].toggleDragging(!0);const o=n?this.snapToAngle(t,e,i):na(this[s].drag(e).point,i);!o||!VM(i,o)||(t[s].x=o.x,t[s].y=o.y)}snapToAngle(t,e,i){const{activeHandle:n}=this,a=["start","end"].find(r=>r!==n);if(!n||!a)return;this[n].toggleDragging(!0);const o=Ki(t[a],i);return na(kA(e,o,t.snapToAngle),i)}translatePoints({datum:t,start:e,end:i,translation:n,context:s}){const a=Ec({start:e,end:i},n,s,{overflowContinuous:1});t.start.x=a.start.x,t.end.x=a.end.x,t.start.y=a.start.y,t.end.y=a.end.y}translate(t,e,i){this.translatePoints({datum:t,start:Ki(t.start,i),end:Ki(t.end,i),translation:e,context:i})}copy(t,e,i){const n=oa(t,i);if(!n)return;const s=this.computeBBoxWithoutHandles();return this.translatePoints({datum:e,start:{x:n.x1,y:n.y1},end:{x:n.x2,y:n.y2},translation:{x:-s.width/2,y:-s.height/2},context:i}),e}toggleHandles(t){if(typeof t=="boolean")this.start.visible=t,this.end.visible=t;else for(const[e,i]of Xe(t))this[e].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(t){this.toggleHandles(t),this.start.toggleActive(t),this.end.toggleActive(t)}updateHandles(t,e,i,n){this.start.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"start")}),this.end.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"end",n)}),this.start.toggleLocked(t.locked??!1),this.end.toggleLocked(t.locked??!1)}getHandleCoords(t,e,i,n){return i==="start"?Wt.start(e):Wt.end(e)}},Im=class extends Rt{constructor(t){const e=({point:r})=>{const l=this.createDatum();l.set({start:r,end:r}),t.create(l)},i=()=>{const{node:r}=this;r?.toggleActive(!0),r?.toggleHandles({start:!0,end:!1})},n=({offset:r,context:l})=>{const{datum:c,snapping:u}=this;c&&(c.set({end:ox(r,l,u,c.start,c.snapToAngle)}),t.update())},s=()=>{this.node?.toggleHandles({end:!0}),t.update()},a=()=>t.delete(),o=()=>{t.showAnnotationOptions(),t.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:Rt.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:n,click:{target:Rt.parent,action:s},drag:n,dragEnd:{target:Rt.parent,action:s},reset:{target:Rt.parent,action:a},cancel:{target:Rt.parent,action:a},onExit:o}}),this.debug=Gt.create(!0,"annotations"),this.snapping=!1}};M([Fe()],Im.prototype,"datum");M([Fe()],Im.prototype,"node");M([Fe()],Im.prototype,"snapping");var qat=class extends Im{createDatum(){return new fc}},Qat=class extends Im{createDatum(){return new mc}},Jat=class extends Im{createDatum(){return new yc}},i_={type:"fibonacci-retracement",datum:yc,scene:aS,isDatum:yc.is,translate:(t,e,i,n)=>{yc.is(e)&&aS.is(t)&&t.translate(e,i,n)},copy:(t,e,i,n)=>{if(yc.is(e)&&yc.is(i)&&aS.is(t))return t.copy(e,i,n)},update:(t,e,i)=>{yc.is(e)&&aS.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Jat({...t,create:e("fibonacci-retracement")}),dragState:t=>new yn(t)},tot=class extends j.Group{},_M=class extends tot{constructor(){super(),this.type="arrow",this.path=new j.Path,this.armLength=6,this.append([this.path])}update(t){const{path:e}=this,{x:i,y:n,angle:s,...a}=t,o=at.from(i,n),r=3*Math.PI/4,l=this.armLength+(t.strokeWidth??0)*2,c=at.rotate(at.from(0,l),s+r,o),u=at.rotate(at.from(l,0),s-r,o);e.setProperties(a),e.fillOpacity=0,e.path.clear(),e.path.moveTo(c.x,c.y),e.path.lineTo(o.x,o.y),e.path.lineTo(u.x,u.y)}},{Transformable:eot}=j,su=class extends SO{constructor(){super(),this.type="line",this.line=new Ea,this.append([this.line,this.start,this.end])}static is(t){return ns.isCheck(t,"line")}update(t,e){let i=oa(t,e);if(i==null){this.visible=!1;return}i=Wt.round(i),this.visible=t.visible??!0,this.visible&&(this.updateLine(t,i,e),this.updateHandles(t,i),this.updateText(t,i),this.updateCaps(t,i),this.updateAnchor(t,i,e))}updateLine(t,e,i){const{line:n}=this,{lineDashOffset:s,stroke:a,strokeWidth:o,strokeOpacity:r}=t,l=this.extendLine(e,t,i);n.setProperties({...l,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:s,stroke:a,strokeWidth:o,strokeOpacity:r,fillOpacity:0})}updateText(t,e){this.text=this.updateNode(pp,this.text,!!t.text.label),df(this.line.id,this.line,e,t.text,this.text,t.text.label,t.strokeWidth)}updateCaps(t,e){if(!t.startCap&&this.startCap&&(this.startCap.remove(),this.startCap=void 0),!t.endCap&&this.endCap&&(this.endCap.remove(),this.endCap=void 0),!t.startCap&&!t.endCap)return;const{stroke:i,strokeWidth:n,strokeOpacity:s}=t,[a,o]=at.from(e),r=at.angle(at.sub(o,a));t.startCap&&(this.startCap&&this.startCap.type!==t.startCap&&(this.startCap.remove(),this.startCap=void 0),this.startCap==null&&(this.startCap=new _M,this.append([this.startCap])),this.startCap.update({x:a.x,y:a.y,angle:r-Math.PI,stroke:i,strokeWidth:n,strokeOpacity:s})),t.endCap&&(this.endCap&&this.endCap.type!==t.endCap&&(this.endCap.remove(),this.endCap=void 0),this.endCap==null&&(this.endCap=new _M,this.append([this.endCap])),this.endCap.update({x:o.x,y:o.y,angle:r,stroke:i,strokeWidth:n,strokeOpacity:s}))}updateAnchor(t,e,i,n){const s=Wt.topCenter(e);at.apply(this.anchor,eot.toCanvasPoint(this.line,s.x,s.y))}containsPoint(t,e){const{line:i,text:n}=this;return super.containsPoint(t,e)||i.isPointInPath(t,e)||!!n?.containsPoint(t,e)}getNodeAtCoords(t,e){return this.text?.containsPoint(t,e)?"text":this.line.isPointInPath(t,e)?"line":super.getNodeAtCoords(t,e)}getHandleCoords(t,e,i,n){const{startCap:s,endCap:a}=this;let[o,r]=at.from(e);const l=at.angle(at.sub(r,o));return s&&(o=at.rotate(at.from(0,-Yi.HANDLE_SIZE/2),l,o)),a&&(r=at.rotate(at.from(0,Yi.HANDLE_SIZE/2),l,r)),i==="start"?o:r}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}},n_={type:"line",datum:mc,scene:su,isDatum:mc.is,translate:(t,e,i,n)=>{mc.is(e)&&su.is(t)&&t.translate(e,i,n)},copy:(t,e,i,n)=>{if(mc.is(e)&&mc.is(i)&&su.is(t))return t.copy(e,i,n)},update:(t,e,i)=>{mc.is(e)&&su.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Qat({...t,create:e("line")}),dragState:t=>new yn(t)},s_={type:"arrow",datum:fc,scene:su,isDatum:fc.is,translate:(t,e,i,n)=>{fc.is(e)&&su.is(t)&&t.translate(e,i,n)},copy:(t,e,i,n)=>{if(fc.is(e)&&fc.is(i)&&su.is(t))return t.copy(e,i,n)},update:(t,e,i)=>{fc.is(e)&&su.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new qat({...t,create:e("arrow")}),dragState:t=>new yn(t)};function a_(t,e=0,i=0){let n=e;for(const s of t)if(Array.isArray(s)){for(const a of s)o_(a,n);n+=j.Group.computeChildrenBBox(s).width+i}else o_(s,n),n+=s.getBBox().width+i}function iot(t,e=0,i=0){let n=e;for(const s of t)if(Array.isArray(s)){for(const a of s)r_(a,n);n+=j.Group.computeChildrenBBox(s).height+i}else r_(s,n),n+=s.getBBox().height+i}function o_(t,e){"x1"in t?(t.x2=e+(t.x2-t.x1),t.x1=e):t.x=e}function r_(t,e){"y1"in t?(t.y2=e+(t.y2-t.y1),t.y1=e):t.y=e}function l_(t,e){"x1"in t?(t.x1+=e,t.x2+=e):t.x+=e}function c_(t,e){"y1"in t?(t.y1+=e,t.y2+=e):t.y+=e}var HK=class extends j.Group{constructor(){super(),this.name="MeasurerStatisticsScene",this.background=new j.Rect,this.dateRangeBarsText=new j.Text,this.dateRangeDivider=new j.Line,this.dateRangeValueText=new j.Text,this.priceRangeValueText=new j.Text,this.priceRangeDivider=new j.Line,this.priceRangePercentageText=new j.Text,this.volumeText=new j.Text,this.volumeFormatter=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2}),this.append([this.background,this.dateRangeBarsText,this.dateRangeDivider,this.dateRangeValueText,this.priceRangeValueText,this.priceRangeDivider,this.priceRangePercentageText,this.volumeText])}update(t,e,i,n,s,a,o){this.verticalDirection=a;const r=this.updateStatistics(t,e,i,o),l=j.Group.computeChildrenBBox(r.flat()),c=10;l.grow(c),this.updateBackground(t,l,c),this.reposition(r,c,s),this.checkVisibility(t,s,n)}checkVisibility(t,e,i){const n=Wt.from(e.seriesRect);this.visible=Wt.collides(i,n)&&(t.visible??!0)}updateStatistics(t,e,i,n){const{dateRangeBarsText:s,dateRangeDivider:a,dateRangeValueText:o,priceRangeValueText:r,priceRangeDivider:l,priceRangePercentageText:c,volumeText:u}=this,d=8,g=6,f=t.statistics.fontSize+3,y=-2,x=this.getTextStyles(t),S={...this.getDividerStyles(t),x1:0,y1:0,x2:0,y2:f},D=[s,a,o],A=[r,l,c],I=[];return e.priceRange&&(r.setProperties({...x,text:this.formatPriceRangeValue(e.priceRange.value,n)}),l.setProperties(S),c.setProperties({...x,text:this.formatPriceRangePercentage(e.priceRange.percentage,n)}),a_(A,i.x,d),I.push(A)),e.dateRange&&(s.setProperties({...x,text:this.formatDateRangeBars(e.dateRange.bars,n)}),a.setProperties(S),o.setProperties({...x,text:this.formatDateRangeValue(e.dateRange.value)}),a_(D,i.x,d),I.push(D)),e.volume==null?u.visible=!1:(u.setProperties({...x,x:i.x,text:this.formatVolume(e.volume,n),visible:!0}),I.push(u)),iot(I,i.y,g),l.y1+=y,l.y2+=y,a.y1+=y,a.y2+=y,I}updateBackground(t,e,i){const n=this.getBackgroundStyles(t);this.background.setProperties({...n,...e,x:e.x-e.width/2+i,y:e.y})}reposition(t,e,i){const{width:n,height:s}=i.seriesRect,a=Wt.from(this.background.getBBox());let o=0;a.x1<0&&(o=-a.x1),a.x2>n&&(o=n-a.x2);const r=Math.min(e,s-a.y2);for(const l of t)if(Array.isArray(l)){const c=j.Group.computeChildrenBBox(l).width;for(const u of l)l_(u,o-c/2),c_(u,r)}else l_(l,o-l.getBBox().width/2),c_(l,r);this.background.x+=o,this.background.y+=r}getTextStyles(t){return{fill:t.statistics.color,fontFamily:t.statistics.fontFamily,fontSize:t.statistics.fontSize,fontStyle:t.statistics.fontStyle,fontWeight:t.statistics.fontWeight,textAlign:"left",textBaseline:"top"}}getDividerStyles(t){return{stroke:t.statistics.divider.stroke,strokeOpacity:t.statistics.divider.strokeOpacity,strokeWidth:t.statistics.divider.strokeWidth}}getBackgroundStyles(t){return{fill:t.statistics.fill,stroke:t.statistics.stroke,strokeOpacity:t.statistics.strokeOpacity,strokeWidth:t.statistics.strokeWidth,cornerRadius:4}}formatDateRangeBars(t,e){return e?.t("measurerDateRangeBars",{value:t})??`${t}`}formatDateRangeValue(t){const e=[],i=t>=0?"":"-";t=Math.abs(t);const n=1e3*60,s=n*60,a=s*24,o=Math.floor(t/n),r=Math.floor(t/s),l=Math.floor(t/a),c=r%(a/s),u=o%(s/n);return l>=1&&e.push(`${l}d`),r>=1&&(t=n.x-u.x&&(l={x:n.x,y:r.clipMask.y,radius:this.text.getBBox().height/2+at.length(u)})}this.verticalLine.setClipMask(o,l)}updateCaps(t,e){const{horizontalEndCap:i,verticalEndCap:n}=this,{direction:s}=t,{x1:a,y1:o,x2:r,y2:l}=e,c=at.round(Wt.center(e),0),{stroke:u,strokeWidth:d,strokeOpacity:g}=this.getLineStyles(t),f={stroke:u,strokeWidth:d,strokeOpacity:g};if(s!=="vertical"){const y=a<=r?0:Math.PI;let x=r;s==="horizontal"&&(x+=a<=r?-2:2),i.update({...f,x,y:c.y,angle:y})}if(s!=="horizontal"){const y=o<=l?Math.PI/2:Math.PI/-2;let x=l;s==="vertical"&&(x+=o<=l?-2:2),n.update({...f,x:c.x,y:x,angle:y})}}updateBoundingLines(t,e){const{verticalStartLine:i,verticalEndLine:n,horizontalStartLine:s,horizontalEndLine:a}=this,{direction:o}=t,{x1:r,y1:l,x2:c,y2:u}=e,d=this.getLineStyles(t);o==="horizontal"&&(i.setProperties({...d,x1:r,y1:l,x2:r,y2:u}),n.setProperties({...d,x1:c,y1:l,x2:c,y2:u})),o==="vertical"&&(s.setProperties({...d,x1:r,y1:l,x2:c,y2:l}),a.setProperties({...d,x1:r,y1:u,x2:c,y2:u}))}updateStatistics(t,e,i){const n=at.add(Wt.bottomCenter(e),at.from(0,10)),s={volume:this.getVolume(t)};t.hasPriceRange&&(s.priceRange={percentage:this.getPriceRangePercentage(t),value:this.getPriceRangeValue(t)}),t.hasDateRange&&(s.dateRange={bars:this.getDateRangeBars(e,i),value:this.getDateRangeValue(t)}),this.statistics.update(t,s,n,e,i,this.verticalDirection,t.localeManager)}updateAnchor(t,e,i,n){const s=Wt.topCenter(e);at.apply(this.anchor,j.Transformable.toCanvasPoint(this.horizontalLine,s.x,s.y))}getBackgroundPoints(t,e,i,n){const[s,a]=at.from(e),[o,r]=at.from(i);return[s,a,r,o]}getLineStyles(t){const{lineDashOffset:e,stroke:i,strokeWidth:n,strokeOpacity:s}=t;return{lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,stroke:i,strokeWidth:n,strokeOpacity:s,fillOpacity:0}}getBackgroundStyles(t){const{background:e}=t;return{fill:e.fill,fillOpacity:e.fillOpacity}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}containsPoint(t,e){const{horizontalLine:i,text:n,verticalLine:s,horizontalStartLine:a,horizontalEndLine:o,verticalStartLine:r,verticalEndLine:l}=this;return super.containsPoint(t,e)||i.isPointInPath(t,e)||s.isPointInPath(t,e)||a.visible&&a.isPointInPath(t,e)||o.visible&&o.isPointInPath(t,e)||r.visible&&r.isPointInPath(t,e)||l.visible&&l.isPointInPath(t,e)||!!n?.containsPoint(t,e)}getNodeAtCoords(t,e){return this.text?.containsPoint(t,e)?"text":this.start.containsPoint(t,e)||this.end.containsPoint(t,e)?"handle":"line"}getDateRangeBars(t,e){const{step:i}=e.xAxis.scale,n=t.x1<=t.x2?1:-1;return i?Math.round(Wt.width(t)/i)*n:0}getDateRangeValue(t){const e=Jn(t.start.x),i=Jn(t.end.x);if(!aa(e)||!aa(i))throw new Error("Can not create a date range measurement of non-date x-axis.");return i.getTime()-e.getTime()}getPriceRangePercentage(t){if(t.start.y==null||t.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const e=Jn(t.end.y),i=Jn(t.start.y);if(!Je(e)||!Je(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return(e-i)/i}getPriceRangeValue(t){if(t.start.y==null||t.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const e=Jn(t.end.y),i=Jn(t.start.y);if(!Je(e)||!Je(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return e-i}getVolume(t){return t.getVolume(t.start.x,t.end.x)}},oS=class extends ho{constructor(){super(...arguments),this.type="quick-measurer"}static is(t){return ns.isCheck(t,"quick-measurer")}createStatisticsScene(){return new not}getDirectionStyles(t){return this.verticalDirection==="down"?t.down:t.up}getLineStyles(t){const e=this.getDirectionStyles(t);return{...super.getLineStyles(t),stroke:e.stroke,strokeWidth:e.strokeWidth,strokeOpacity:e.strokeOpacity}}getBackgroundStyles(t){const e=this.getDirectionStyles(t);return{fill:e.fill,fillOpacity:e.fillOpacity}}getHandleStyles(t){const e=this.getDirectionStyles(t);return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}},km=class extends Rt{constructor(t){const e=({point:o})=>{const r=this.createDatum();r.set({start:o,end:o}),t.create(r)},i=({point:o})=>{const{datum:r,node:l}=this;r?.set({end:o}),l?.toggleActive(!0),l?.toggleHandles({end:!1}),t.update()},n=()=>{this.node?.toggleHandles({end:!0})},s=()=>t.delete(),a=()=>{t.showAnnotationOptions(),t.recordAction(`Create ${this.node?.type} annotation`)};super("start",{start:{reset:Rt.parent,click:{target:"end",action:e},drag:{target:"end",action:e}},end:{hover:i,drag:i,click:{target:Rt.parent,action:n},dragEnd:{target:Rt.parent,action:n},reset:{target:Rt.parent,action:s},cancel:{target:Rt.parent,action:s},onExit:a}}),this.debug=Gt.create(!0,"annotations")}};M([Fe()],km.prototype,"datum");M([Fe()],km.prototype,"node");var sot=class extends km{createDatum(){return new Yo}},aot=class extends km{createDatum(){return new $o}},oot=class extends km{createDatum(){return new gc}},rot=class extends km{createDatum(){return new ro}},h_={type:"date-range",datum:Yo,scene:ho,isDatum:Yo.is,translate:(t,e,i,n)=>{Yo.is(e)&&ho.is(t)&&t.translate(e,i,n)},copy:(t,e,i,n)=>{if(Yo.is(e)&&Yo.is(i)&&ho.is(t))return t.copy(e,i,n)},update:(t,e,i)=>{Yo.is(e)&&ho.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new sot({...t,create:e("date-range")}),dragState:t=>new yn(t)},u_={type:"price-range",datum:$o,scene:ho,isDatum:$o.is,translate:(t,e,i,n)=>{$o.is(e)&&ho.is(t)&&t.translate(e,i,n)},copy:(t,e,i,n)=>{if($o.is(e)&&$o.is(i)&&ho.is(t))return t.copy(e,i,n)},update:(t,e,i)=>{$o.is(e)&&ho.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new aot({...t,create:e("date-range")}),dragState:t=>new yn(t)},d_={type:"date-price-range",datum:gc,scene:ho,isDatum:gc.is,translate:(t,e,i,n)=>{gc.is(e)&&ho.is(t)&&t.translate(e,i,n)},copy:(t,e,i,n)=>{if(gc.is(e)&&gc.is(i)&&ho.is(t))return t.copy(e,i,n)},update:(t,e,i)=>{gc.is(e)&&ho.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new oot({...t,create:e("date-range")}),dragState:t=>new yn(t)},p_={type:"quick-date-price-range",datum:ro,scene:oS,isDatum:ro.is,translate:(t,e,i,n)=>{ro.is(e)&&oS.is(t)&&t.translate(e,i,n)},copy:(t,e,i,n)=>{if(ro.is(e)&&ro.is(i)&&oS.is(t))return t.copy(e,i,n)},update:(t,e,i)=>{ro.is(e)&&oS.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new rot({...t,create:e("quick-date-price-range")}),dragState:t=>new yn(t)},rS=class extends IO{constructor(){super(),this.type="note",this.shape=new j.Rect,this.iconBackground=new j.TranslatableSvgPath("M22 1.83333C22 0.820811 21.1792 0 20.1667 0H1.83333C0.820811 0 0 0.82081 0 1.83333V13.9868C0 14.9994 0.820811 15.8202 1.83333 15.8202L5.88971 15.8202C6.44575 15.8202 6.97175 16.0725 7.31971 16.5062L9.57006 19.3112C10.304 20.2259 11.6962 20.2259 12.4301 19.3112L14.6804 16.5062C15.0284 16.0725 15.5544 15.8202 16.1104 15.8202L20.1667 15.8202C21.1792 15.8202 22 14.9994 22 13.9868V1.83333Z"),this.iconLines=new j.TranslatableSvgPath("M17.1114 5.75C17.1114 6.16421 16.7756 6.5 16.3614 6.5H5.63916C5.22495 6.5 4.88916 6.16421 4.88916 5.75V5.75C4.88916 5.33579 5.22495 5 5.63916 5H16.3614C16.7756 5 17.1114 5.33579 17.1114 5.75V5.75ZM17.1114 9.25C17.1114 9.66421 16.7756 10 16.3614 10H5.63916C5.22495 10 4.88916 9.66421 4.88916 9.25V9.25C4.88916 8.83579 5.22495 8.5 5.63916 8.5H16.3614C16.7756 8.5 17.1114 8.83579 17.1114 9.25V9.25Z"),this.active=!1,this.shape.visible=!1,this.label.visible=!1,this.iconBackground.fillShadow=new j.DropShadow,this.append([this.shape,this.label,this.iconBackground,this.iconLines,this.handle])}static is(t){return ns.isCheck(t,"note")}update(t,e){this.updateIcon(t,e),super.update(t,e)}getTextBBox(t,e,i){const n=super.getTextBBox(t,e,i);n.x-=t.width/2,n.x=Nt(0,n.x,i.seriesRect.width-t.width);const s=t.getPadding().top,a=n.y-fK-s*2,o=n.y+Yi.HANDLE_SIZE+s*2;return a-n.height-mK<0?(n.y=o,t.position="top"):(n.y=a+s,t.position="bottom"),n}updateLabel(t,e,i){const n=t.visible===!1?!1:this.label.visible;super.updateLabel(t,e,i),i.isRtl&&(this.label.x+=t.width-e.width),this.label.visible=n,this.label.text=kc(t.text,{maxWidth:200,font:t,textWrap:"always",avoidOrphans:!1})}updateShape(t,e){const{shape:i}=this;i.fill=t.background.fill,i.fillOpacity=t.background.fillOpacity??1,i.stroke=t.background.stroke,i.strokeOpacity=t.background.strokeOpacity??1,i.strokeWidth=t.background.strokeWidth??1,i.cornerRadius=4;const n=t.getPadding().top,s=t.position==="top";i.x=e.x-n,i.width=t.width+n*2,i.height=e.height+n*2,i.y=e.y+(s?0:-e.height)-n}updateIcon(t,e){const{active:i,iconBackground:n,iconLines:s}=this,{x:a,y:o}=Ki(t,e);n.translationX=a-mat/2,n.translationY=o-gK,s.translationX=n.translationX,s.translationY=n.translationY,n.fill=t.fill,n.fillOpacity=t.fillOpacity??1,n.stroke=t.stroke,n.strokeOpacity=t.strokeOpacity??1,n.strokeWidth=t.strokeWidth??1,s.fill=t.stroke,i?n.fillShadow.color=t.fill??"rgba(0, 0, 0, 0.22)":n.fillShadow.color="rgba(0, 0, 0, 0.22)"}updateAnchor(t,e,i){const n=t.getPadding().top,s=t.position==="top",a=s?1:-1;return{x:e.x+i.seriesRect.x+t.width/2,y:e.y+i.seriesRect.y+a*(e.height+n),position:s?"below":"above"}}getLabelCoords(t,e){const i=t.position==="top",n=t.getPadding().top+nr(t.fontSize,vA)/2;return{x:e.x,y:e.y+(i?n/2:0)}}getTextBaseline(t){return t.position==="top"?"middle":t.position}getHandleCoords(t,e,i){return{x:e.x,y:e.y+Yi.HANDLE_SIZE/2+4}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.fill,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}toggleHovered(t,e,i){super.toggleHovered(t,e,i);const n=t||e&&!i;this.label.visible=n,this.shape.visible=n,this.zIndex=n?pe.CHART_ANNOTATION_FOCUSED:pe.CHART_ANNOTATION}toggleActive(t){super.toggleActive(t),this.label.visible=t,this.shape.visible=t,this.active=t}containsPoint(t,e){return this.shape.visible&&this.shape.containsPoint(t,e)||this.iconBackground.containsPoint(t,e)?!0:super.containsPoint(t,e)}},lot=class extends av{createDatum(){return new Oa}},g_={type:"note",datum:Oa,scene:rS,isDatum:Oa.is,translate:(t,e,i,n)=>{Oa.is(e)&&rS.is(t)&&t.translate(e,i,n)},copy:(t,e,i,n)=>{if(Oa.is(e)&&Oa.is(i)&&rS.is(t))return t.copy(e,i,n)},update:(t,e,i)=>{Oa.is(e)&&rS.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new lot({...t,create:e("note")}),dragState:t=>new yn(t)},lS=class extends VK{constructor(){super(),this.type="parallel-channel",this.handles={topLeft:new Yi,topMiddle:new tf,topRight:new Yi,bottomLeft:new Yi,bottomMiddle:new tf,bottomRight:new Yi},this.middleLine=new Ea,this.append([this.background,this.topLine,this.middleLine,this.bottomLine,...Object.values(this.handles)])}static is(t){return ns.isCheck(t,"parallel-channel")}dragHandle(t,e,i,n){const{activeHandle:s,handles:a}=this;if(s==null)return;const{offset:o}=a[s].drag(e);a[s].toggleDragging(!0),(s==="topMiddle"||s==="bottomMiddle")&&(o.x=0);let r=[],l=n;switch(s){case"topLeft":case"bottomLeft":r=["topLeft","bottomLeft"];break;case"topMiddle":r=["topLeft","topRight"],o.y-=tf.HANDLE_SIZE/2,l=!1;break;case"topRight":case"bottomRight":r=["topRight","bottomRight"];break;case"bottomMiddle":r=["bottomLeft","bottomRight"],o.y-=tf.HANDLE_SIZE/2,l=!1;break}const c=oa(t,i),u=oa(t.bottom,i);if(!c||!u)return;const d={topLeft:Wt.start(c),topRight:Wt.end(c),bottomLeft:Wt.start(u),bottomRight:Wt.end(u)},g={vectors:{topLeft:d.topRight,bottomLeft:d.bottomRight,topRight:d.topLeft,bottomRight:d.bottomLeft},angle:t.snapToAngle},f=Ec(d,o,i,{overflowContinuous:this.overflowContinuous,translateVectors:r,snap:l?g:void 0});t.start.x=f.topLeft.x,t.start.y=f.topLeft.y,t.end.x=f.topRight.x,t.end.y=f.topRight.y,t.height=f.topLeft.y-f.bottomLeft.y}getTranslatePointsVectors(t,e){const{bottomLeft:i,topLeft:n}=this.handles,s=i.getBBox().y-n.getBBox().y,a=at.add(t,at.from(0,s)),o=at.add(e,at.from(0,s));return{start:t,end:e,bottomStart:a,bottomEnd:o}}containsPoint(t,e){return super.containsPoint(t,e)||this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(t,e)}getNodeAtCoords(t,e){return this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(t,e)?"line":super.getNodeAtCoords(t,e)}updateLines(t,e,i,n,s,a){const{topLine:o,middleLine:r,bottomLine:l}=this,{lineDashOffset:c,stroke:u,strokeOpacity:d,strokeWidth:g}=t,f=t.getLineDash(),y={lineCap:t.getLineCap(),lineDash:f,lineDashOffset:c,stroke:u,strokeOpacity:d,strokeWidth:g};o.setProperties({...e,...y}),l.setProperties({...i,...y});const x=this.extendLine({x1:s.x1,y1:a.y1+(s.y1-a.y1)/2,x2:s.x2,y2:a.y2+(s.y2-a.y2)/2},t,n);r.setProperties({...x,lineDash:t.middle.lineDash??f,lineDashOffset:t.middle.lineDashOffset??c,stroke:t.middle.stroke??u,strokeOpacity:t.middle.strokeOpacity??d,strokeWidth:t.middle.strokeWidth??g,visible:t.middle.visible??!0})}updateHandles(t,e,i){const{handles:{topLeft:n,topMiddle:s,topRight:a,bottomLeft:o,bottomMiddle:r,bottomRight:l}}=this,c={fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth};n.update({...c,...Wt.start(e)}),a.update({...c,...Wt.end(e)}),o.update({...c,...Wt.start(i)}),l.update({...c,...Wt.end(i)}),s.update({...c,...at.sub(Wt.center(e),at.from(s.handle.width/2,s.handle.height/2))}),r.update({...c,...at.sub(Wt.center(i),at.from(r.handle.width/2,r.handle.height/2))})}updateText(t,e,i){this.text=this.updateNode(pp,this.text,!!t.text.label),EK(!0,e,i,t.text,t.strokeWidth,this.text,t.text.label)}getBackgroundPoints(t,e,i,n){const s=e.x1>e.x2,a=e.y1>e.y2,o=e.x1!==i.x1&&e.y1!==i.y1,r=e.x2!==i.x2&&e.y2!==i.y2,l=at.from(e);return t.extendEnd&&r&&l.push(at.from(s?n.x1:n.x2,a?n.y1:n.y2)),l.push(...at.from(i).reverse()),t.extendStart&&o&&l.push(at.from(s?n.x2:n.x1,a?n.y2:n.y1)),l}},TA=class extends Rt{constructor(t){const e=({point:l})=>{const c=new Zo;c.set({start:l,end:l,height:0}),t.create(c)},i=()=>{const{node:l}=this;l?.toggleActive(!0),l?.toggleHandles({topLeft:!0,topMiddle:!1,topRight:!1,bottomLeft:!1,bottomMiddle:!1,bottomRight:!1})},n=({offset:l,context:c})=>{const{datum:u,snapping:d}=this;u&&(u.set({end:ox(l,c,d,u.start,u.snapToAngle)}),t.update())},s=()=>{this.node?.toggleHandles({topRight:!0}),t.update()},a=({point:l})=>{const{datum:c,node:u}=this,d=Jn(c?.end.y),g=Jn(c?.start.y),{y:f}=l;if(c==null||!Je(g)||!Je(d)||!Je(f))return;const y=d-(f??0),x=g-y;u?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!t.validatePoint({x:c.start.x,y:x},{overflowContinuous:!0})||!t.validatePoint({x:c.end.x,y:l.y},{overflowContinuous:!0}))&&(c.set({height:y}),t.update())},o=({point:l})=>{const{datum:c,node:u}=this,d=Jn(c?.end.y),g=Jn(c?.start.y),{y:f}=l;if(c==null||!Je(g)||!Je(d)||!Je(f))return;const y=d-(f??0),x=g-y;u?.toggleHandles(!0),!(!t.validatePoint({x:c.start.x,y:x},{overflowContinuous:!0})||!t.validatePoint({x:c.end.x,y:l.y},{overflowContinuous:!0}))&&(c.set({height:y}),t.recordAction("Create parallel-channel annotation"),t.showAnnotationOptions(),t.update())},r=()=>t.delete();super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:Rt.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:n,drag:n,click:{target:"height",action:s},dragEnd:{target:"height",action:s},reset:{target:Rt.parent,action:r},cancel:{target:Rt.parent,action:r}},height:{hover:a,click:{target:Rt.parent,action:o},drag:{target:Rt.parent,action:o},reset:{target:Rt.parent,action:r},cancel:{target:Rt.parent,action:r}}}),this.debug=Gt.create(!0,"annotations"),this.snapping=!1}};M([Fe()],TA.prototype,"datum");M([Fe()],TA.prototype,"node");M([Fe()],TA.prototype,"snapping");var f_={type:"parallel-channel",datum:Zo,scene:lS,isDatum:Zo.is,translate:(t,e,i,n)=>{Zo.is(e)&&lS.is(t)&&t.translate(e,i,n)},copy:(t,e,i,n)=>{if(Zo.is(e)&&Zo.is(i)&&lS.is(t))return t.copy(e,i,n)},update:(t,e,i)=>{Zo.is(e)&&lS.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new TA({...t,create:e("parallel-channel")}),dragState:t=>new yn(t)},cS=class extends IO{constructor(){super(),this.type="text",this.append([this.label,this.handle])}static is(t){return ns.isCheck(t,"text")}getHandleCoords(t,e){const i=Yi.HANDLE_SIZE/2;return{x:e.x+i,y:e.y+2+i}}},cot=class extends av{createDatum(){return new bc}},m_={type:"text",datum:bc,scene:cS,isDatum:bc.is,translate:(t,e,i,n)=>{bc.is(e)&&cS.is(t)&&t.translate(e,i,n)},copy:(t,e,i,n)=>{if(bc.is(e)&&bc.is(i)&&cS.is(t))return t.copy(e,i,n)},update:(t,e,i)=>{bc.is(e)&&cS.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new cot({...t,create:e("text")}),dragState:t=>new yn(t)},ao={[n_.type]:n_,[XV.type]:XV,[ZV.type]:ZV,[f_.type]:f_,[qV.type]:qV,[i_.type]:i_,[e_.type]:e_,[YV.type]:YV,[$V.type]:$V,[g_.type]:g_,[m_.type]:m_,[s_.type]:s_,[KV.type]:KV,[WV.type]:WV,[h_.type]:h_,[u_.type]:u_,[d_.type]:d_,[p_.type]:p_};function Yd(t){for(const{isDatum:e}of Object.values(ao))if(e(t))return t}var LA=class extends Aj{constructor(t){super(new hot(e=>{this.snapping=e}),new uot(()=>{this.node=this.active==null?void 0:t.node(this.active)}),new Zu(t,e=>{this.active=e,this.datum=this.active==null?void 0:t.datum(this.active),this.node=this.active==null?void 0:t.node(this.active)})),this.snapping=!1}getActive(){return this.active}isActive(t){return t===this.active}};M([Fe()],LA.prototype,"snapping");M([Fe()],LA.prototype,"datum");M([Fe()],LA.prototype,"node");var hot=class extends Rt{constructor(t){super("idle",{idle:{hover:({shiftKey:e})=>t(e),keyDown:({shiftKey:e})=>t(e),keyUp:({shiftKey:e})=>t(e),click:({shiftKey:e})=>t(e),drag:({shiftKey:e})=>t(e)},dragging:{},translating:{},"text-input":{}})}},uot=class extends Rt{constructor(t){super("idle",{idle:{onEnter:t,render:t},dragging:{onEnter:t,render:t},translating:{onEnter:t,render:t},"text-input":{render:t}})}},Zu=class extends Rt{constructor(t,e){const i=I=>w=>{t.create(I,w),this.active=t.selectLast()},n=()=>{this.active!=null&&t.delete(this.active),this.active=void 0,t.select()},s={createDatum:i},a={...t,delete:n,showTextInput:()=>{this.active!=null&&t.showTextInput(this.active)},deselect:()=>{const I=this.active;this.active=void 0,this.hovered=void 0,t.select(this.active,I)},showAnnotationOptions:()=>{this.active!=null&&t.showAnnotationOptions(this.active)}},o=Object.fromEntries(Object.entries(ao).map(([I,w])=>[I,w.createState(a,s)])),r=Object.fromEntries(Object.entries(ao).map(([I,w])=>[I,w.dragState(t,s)])),l=({colorPickerType:I,colorOpacity:w,color:N,opacity:O,isMultiColor:L})=>{this.datum&&(I==="text-color"&&t.updateTextInputColor(N),AA(this.datum,I,w,N,O,L),t.update())},c=I=>{const{datum:w,node:N}=this;!w||!N||(xl(w)?(w.fontSize=I,t.updateTextInputFontSize(I)):uf(w)&&(w.text.fontSize=I),t.update())},u=I=>{const{datum:w,node:N}=this;!w||!N||!Gh(w)||(xK(w,I),t.update())},d=I=>{const{node:w}=this;!w||!("setTextInputBBox"in w)||(w.setTextInputBBox(I),t.update())},g=({textInputValue:I,bbox:w})=>{const{datum:N}=this;if(w!=null&&I!=null&&I.length>0){if(!xl(N))return;const O=SA(N,I,w.width);N.set({text:O}),t.update(),t.recordAction(`Change ${N.type} annotation text`)}else t.delete(this.active),t.recordAction(`Delete ${N?.type} annotation`)},f=()=>{t.updateTextInputBBox(void 0)},y=()=>this.active!=null,x=()=>this.copied!=null,S=()=>{const{active:I,datum:w}=this;return I==null||!w?!1:uf(w)&&w.isWriteable()},D=()=>this.active!=null&&!Xh(this.datum),A=()=>this.hovered!=null;super("idle",{idle:{onEnter:()=>{t.select(this.active,this.active),this.hoverCoords&&(this.hovered=t.hoverAtCoords(this.hoverCoords,this.active,this.hovered))},hover:({offset:I})=>{this.hovered=t.hoverAtCoords(I,this.active,this.hovered),this.hoverCoords=I},translate:{guard:y,target:"translating",action:({translation:I})=>{t.startInteracting(),t.translate(this.active,I),t.update()}},copy:{guard:D,action:()=>{this.copied=t.copy(this.active)}},cut:{guard:D,action:()=>{this.copied=t.copy(this.active),n()}},paste:{guard:x,action:()=>{t.paste(this.copied)}},selectLast:()=>{const I=this.active;this.active=t.selectLast(),t.select(this.active,I)},click:[{guard:()=>{const{active:I,hovered:w,datum:N}=this;return I==null||w!==I||!N?!1:xl(N)&&N.isWriteable()},target:"text-input"},{action:()=>{const I=this.active;this.active=this.hovered,t.select(this.active,I)}}],dblclick:{guard:S,action:({offset:I})=>{const w=t.getNodeAtCoords(I,this.active)==="text"?"text":"line";t.showAnnotationSettings(this.active,void 0,w)}},dragStart:[{guard:A,target:"dragging",action:()=>{const I=this.active;this.active=this.hovered,t.select(this.active,I),t.startInteracting()}},{action:()=>{const I=this.active;this.active=this.hovered,t.select(this.active,I)}}],color:{guard:y,action:l},fontSize:{guard:y,action:c},lineProps:{guard:y,action:I=>{const w=Yd(this.datum);w?.set(I),t.update(),t.recordAction(`Change ${w?.type} ${Object.entries(I).map(([N,O])=>`${N} to ${O}`).join(", ")}`)}},lineStyle:{guard:y,action:u},lineText:{guard:y,action:I=>{const w=Yd(this.datum);uf(w)&&(Nc(w)&&I.position==="center"&&(I.position="inside"),w.text.set(I),t.update())}},updateTextInputBBox:{guard:y,action:d},toolbarPressSettings:{guard:S,action:I=>{t.showAnnotationSettings(this.active,I)}},reset:()=>{this.active!=null&&this.node?.toggleActive(!1),this.hovered=void 0,this.active=void 0,t.select(),t.resetToIdle()},delete:()=>{this.active!=null&&(t.delete(this.active),!Xh(this.datum)&&t.recordAction(`Delete ${this.datum?.type} annotation`))},deleteAll:()=>{t.deleteAll()},...o},dragging:{onEnter:(I,w)=>{if(this.active==null)return;const N=t.getAnnotationType(this.active);N&&(this.transitionRoot(N),this.transitionRoot("dragStart",w))},...r},translating:{onEnter:()=>{},translate:{guard:y,target:"translating",action:({translation:I})=>{t.startInteracting(),t.translate(this.active,I),t.update()}},translateEnd:{guard:y,target:"idle"},onExit:()=>{t.stopInteracting(),t.update(),t.recordAction("Translate annotation")}},"text-input":{onEnter:()=>{if(this.active==null)return;const I=Yd(this.datum);!I||!("getTextInputCoords"in I)||(t.startInteracting(),t.showTextInput(this.active),I.visible=!1,t.update())},updateTextInputBBox:{guard:y,action:d},resize:{target:"idle",action:g},click:{target:"idle",action:g},drag:{target:"idle",action:g},textInput:[{guard:MO,target:"idle",action:f},{guard:DO,target:"idle",action:g}],color:{guard:y,action:l},fontSize:{guard:y,action:c},cancel:{target:"idle",action:f},onExit:()=>{t.stopInteracting(),t.hideTextInput();const I=this.active;if(this.active=this.hovered=void 0,t.select(this.active,I),I==null)return;const w=t.datum(I),N=t.node(I);!w||!N||("setTextInputBBox"in N&&N.setTextInputBBox(),w.visible=!0)}}}),this.setActive=e,this.debug=Gt.create(!0,"annotations"),this.snapping=!1}};M([Pe({changeValue(t){this.setActive(t)}}),Fe()],Zu.prototype,"active");M([Fe()],Zu.prototype,"hovered");M([Fe()],Zu.prototype,"hoverCoords");M([Fe()],Zu.prototype,"copied");M([Fe()],Zu.prototype,"snapping");M([Fe()],Zu.prototype,"datum");M([Fe()],Zu.prototype,"node");var{LayoutElement:dot,Menu:pot}=j,jK=class extends Il{};M([b],jK.prototype,"value");var OA=class extends xt{constructor(t){super(),this.ctx=t,this.enabled=!0,this.padding=20,this.buttons=new ss(jK),this.events=new cr,this.annotationMenu=new pot(this.ctx,"annotations"),this.cleanup=new qe,this.menuMargin=6,this.toolbar=t.sharedToolbar.getSharedToolbar("annotations");const e=this.onKeyDown.bind(this);this.toolbar.addListener("keydown",e),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onToolbarButtonPress.bind(this)),t.layoutManager.registerElement(dot.ToolbarLeft,this.onLayoutStart.bind(this)),()=>{this.toolbar.removeListener("keydown",e),this.toolbar.destroy()})}destroy(){this.cleanup.flush()}toggleClearButtonEnabled(t){const e=this.buttons.findIndex(i=>i.value==="clear");this.toolbar.toggleButtonEnabledByIndex(e,t)}resetButtonIcons(){for(const[t,e]of this.buttons.entries())switch(e.value){case"line-menu":this.updateButtonByIndex(t,{icon:"trend-line-drawing",value:"line-menu"});break;case"fibonacci-menu":this.updateButtonByIndex(t,{icon:"fibonacci-retracement-drawing",value:"fibonacci-menu"});break;case"text-menu":this.updateButtonByIndex(t,{icon:"text-annotation",value:"text-menu"});break;case"shape-menu":this.updateButtonByIndex(t,{icon:"arrow-drawing",value:"shape-menu"});break;case"measurer-menu":this.updateButtonByIndex(t,{icon:"measurer-drawing",value:"measurer-menu"});break}}hideOverlays(){this.annotationMenu.hide()}clearActiveButton(){this.toolbar.clearActiveButton()}onLayoutStart(t){this.enabled&&(this.toolbar.updateButtons(this.buttons),this.toolbar.layout(t.layoutBox,this.padding))}refreshButtonsEnabled(t){for(const[e,i]of this.buttons.entries())i&&this.toolbar.toggleButtonEnabledByIndex(e,t)}onToolbarButtonPress({event:t,button:e,buttonBounds:i,buttonWidget:n}){const s=this.ctx.axisManager.getAxisContext(z.Y)[0].scale;switch(e.value){case"clear":this.events.emit("pressed-clear",null);break;case"line-menu":this.onToolbarButtonPressShowMenu(t,i,n,e.value,"toolbarAnnotationsLineAnnotations",Cat.filter(a=>a.visible?a.visible(s):!0));break;case"fibonacci-menu":this.onToolbarButtonPressShowMenu(t,i,n,e.value,"toolbarAnnotationsFibonacciAnnotations",wat);break;case"text-menu":this.onToolbarButtonPressShowMenu(t,i,n,e.value,"toolbarAnnotationsTextAnnotations",Tat);break;case"shape-menu":this.onToolbarButtonPressShowMenu(t,i,n,e.value,"toolbarAnnotationsShapeAnnotations",Lat);break;case"measurer-menu":this.onToolbarButtonPressShowMenu(t,i,n,e.value,"toolbarAnnotationsMeasurerAnnotations",Oat);break}}onToolbarButtonPressShowMenu(t,e,i,n,s,a){this.events.emit("pressed-show-menu",null);const o=this.buttons.findIndex(l=>l.value===n);this.toolbar.toggleActiveButtonByIndex(o);const r=this.ctx.domManager.isRtl?e.x-this.menuMargin:e.x+e.width+this.menuMargin;this.annotationMenu.setAnchor({x:r,y:e.y}),this.annotationMenu.show(i,{items:a,ariaLabel:this.ctx.localeManager.t(s),class:"ag-charts-annotations__toolbar-menu",sourceEvent:t.sourceEvent,onPress:this.onButtonPressMenuCreateAnnotation.bind(this,n)})}onButtonPressMenuCreateAnnotation(t,e){const i=this.buttons.findIndex(n=>n.value===t);this.updateButtonByIndex(i,{icon:e.icon}),this.events.emit("pressed-create-annotation",{annotation:e.value}),this.annotationMenu.hide()}onKeyDown({sourceEvent:t}){t.key==="Escape"&&this.events.emit("cancel-create-annotation",null)}updateButtonByIndex(t,e){const i=this.buttons.at(t);i&&(i.set({...i.toJson(),...e,value:e.value??i.value}),this.toolbar.updateButtonByIndex(t,{...i.toJson()}))}};M([b,Pe({changeValue(t){this.toolbar?.setHidden(!t)}})],OA.prototype,"enabled");M([b],OA.prototype,"padding");M([b],OA.prototype,"buttons");var{InteractionState:Vy}=j,rb="ag-charts-annotations__axis-button",GK=class extends Ln{constructor(t,e,i,n){super(),this.ctx=t,this.axisCtx=e,this.onButtonClick=i,this.seriesRect=n,this.enabled=!0,this.snap=!1,this.padding=0,this.button=this.setup(),this.toggleVisibility(!1),this.updateButtonElement(),this.snap=!!e.scale.bandwidth,t.domManager.addEventListener("focusin",({target:s})=>{const a=s instanceof HTMLElement?s:void 0;!(a&&t.domManager.contains(a,"series-area"))&&a!==this.button.getElement()&&this.hide()}),this.cleanup.register(t.widgets.seriesWidget.addListener("drag-move",s=>this.onMouseDrag(s)),t.widgets.seriesWidget.addListener("mousemove",s=>this.onMouseMove(s)),t.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseLeave()),t.widgets.seriesDragInterpreter?.events.on("click",s=>this.onClick(s)),t.eventsHub.on("series:focus-change",()=>this.onKeyPress()),t.eventsHub.on("zoom:pan-start",()=>this.hide()),t.eventsHub.on("zoom:change-complete",()=>this.hide()),()=>this.destroyElements(),()=>this.button.destroy())}update(t,e){this.seriesRect=t,this.padding=e}setup(){const t=new RM.ButtonWidget;return t.addClass(rb),t.setTabIndex(-1),t.setAriaLabel(this.ctx.localeManager.t("ariaLabelAddHorizontalLine")),this.ctx.widgets.seriesWidget.getElement().appendChild(t.getElement()),t}destroyElements(){this.ctx.domManager.removeChild("canvas-overlay",rb)}onMouseMove(t){this.ctx.interactionManager.isState(Vy.Hoverable)&&this.show(t)}onMouseDrag(t){this.ctx.interactionManager.isState(Vy.AnnotationsMoveable)&&this.show(t)}onMouseLeave(){this.ctx.interactionManager.isState(Vy.Hoverable)&&this.hide()}onClick(t){this.ctx.interactionManager.isState(Vy.Clickable)&&t.device==="touch"&&this.show(t)}show(t){const{sourceEvent:e,currentX:i,currentY:n}=t;if(!(this.enabled&&this.ctx.widgets.seriesWidget.getElement().contains(e.target))){this.hide();return}this.toggleVisibility(!0);const s=this.getButtonCoordinates({x:i,y:n});this.coords={x:s.x+this.button.clientWidth/2,y:s.y+this.button.clientHeight/2},this.updatePosition(s)}hide(){this.toggleVisibility(!1)}onKeyPress(){this.snap&&this.ctx.interactionManager.isState(Vy.Default)||this.hide()}getButtonCoordinates({x:t,y:e}){const{axisCtx:{direction:i,position:n},seriesRect:s,snap:a,axisCtx:o,padding:r}=this,{clientWidth:l,clientHeight:c}=this.button,[u,d]=[0,s.height],[g,f]=[0,s.width];if(a&&(t=vc(BM(t-s.x,o),o)+s.x,e=vc(BM(e-s.y,o),o)+s.y),i===z.X){const x=c-Math.max(0,r-5);t=t-l/2,e=n==="top"?u-c+x:d-x}else{const x=l-Math.max(0,r-9);t=n==="left"?g-l+x:f-x,e=e-c/2}return{x:t,y:e}}toggleVisibility(t){const{button:e}=this;if(e==null)return;const i=this.enabled&&t;this.toggleClass("-hidden",!i)}toggleClass(t,e){this.button.toggleClass(`${rb}-${t}`,e)}updatePosition({x:t,y:e}){this.button.getElement().style.transform=`translate(${Math.round(t)}px, ${Math.round(e)}px)`}updateButtonElement(){const{button:t}=this;t.addListener("click",()=>this.onButtonClick(this.coords)),t.addListener("touchend",()=>this.onButtonClick(this.coords)),t.addListener("drag-start",()=>{}),t.setInnerHTML(``)}};M([b],GK.prototype,"enabled");var{DraggablePopover:got,NativeWidget:e1}=j,UK=class i1 extends got{constructor(e,i){super(e,i),this.dragHandleDraggingClass="ag-charts-dialog__drag-handle--dragging",this.colorPicker=new vK(this.ctx,{detached:!0}),this.cleanup.register(e.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)))}showWithChildren(e,i){const n=super.showWithChildren(e,i);return n.classList.add("ag-charts-dialog"),n.setAttribute("role","dialog"),n.addEventListener("mousedown",s=>{s.target.classList?.contains("ag-charts-dialog__color-picker-button")||this.colorPicker.hide()}),n.addEventListener("keydown",this.onKeyDown.bind(this)),this.ctx.agDocument.requestAnimationFrame(()=>this.reposition()),this.colorPicker.attachTo(this),n}updatePosition(e){super.updatePosition(e);const{anchor:i,fallbackAnchor:n}=this.getColorPickerAnchors()??{};i&&this.colorPicker.setAnchor(i,n)}createTabs(e,i,n){const s=$t("div","ag-charts-dialog__tabs"),a=af(n,()=>lu()),o=af(n,()=>lu());for(const[f,y]of Xe(n))Nr(y.panel,{id:o[f],role:"tabpanel","aria-labelledby":a[f]});const r=f=>{for(const[y,x]of Xe(n))x.panel.classList.toggle("ag-charts-dialog__tab-panel--active",y===f),u[y].classList.toggle("ag-charts-dialog__tab-button--active",y===f),ye(u[y],"aria-selected",y===f),y===f&&x.onShow?.()},l=new e1($t("div","ag-charts-dialog__header"));l.addListener("drag-start",f=>{const{sourceEvent:y}=f;y.target instanceof Element&&y.target.classList.contains("ag-charts-dialog__header")&&this.onDragStart(f)}),l.addListener("drag-move",f=>this.onDragMove(f)),l.addListener("drag-end",()=>this.onDragEnd());const c=new mot;this.setDragHandle(c);const u=af(n,(f,y)=>Xy({label:this.ctx.localeManager.t(f.label),onPress:()=>r(y)},{id:a[y],class:"ag-charts-dialog__tab-button",role:"tab","aria-controls":o[y]})),d=$t("div","ag-charts-dialog__tab-list");Nr(d,{role:"tablist","aria-label":this.ctx.localeManager.t(e)}),d.append(...Object.values(u));const g=this.createHeaderCloseButton();return l.getElement().append(c.getElement(),d,g),s.append(l.getElement(),...Object.values(n).map(f=>f.panel)),r(i),cN({orientation:"horizontal",buttons:Object.values(u)}),{tabs:s,initialFocus:u[i]}}createTabPanel(){return $t("div","ag-charts-dialog__tab-panel")}createInputGroupLine(){return $t("div","ag-charts-dialog__input-group-line")}createRadioGroup({label:e,options:i,value:n,onChange:s}){const a=this.createInputGroup(e);Nr(a,{role:"radiogroup",tabindex:-1,"aria-label":this.ctx.localeManager.t(e)});const o="ag-charts-dialog__button--active",r=[];for(const l of i){const{icon:c,altText:u}=l,d=this.ctx.localeManager.t(u),g=Xy({icon:c,altText:d,onPress:()=>{for(const f of Array.from(a.children))f.classList.remove(o),f.ariaChecked="false";g.classList.add(o),g.ariaChecked="true",s(l.value)}},{"aria-checked":l.value===n,class:"ag-charts-dialog__button",role:"radio",title:d});l.value===n&&g.classList.add(o),a.appendChild(g),r.push(g)}return cN({orientation:"horizontal",buttons:r}),a}createSelect({altText:e,label:i,options:n,value:s,onChange:a}){const o=this.createInputGroup(i),r=this.ctx.localeManager.t(e),l=Jj({value:s,options:n,onChange:a},{class:"ag-charts-dialog__select","aria-label":r,title:r});return o.append(l),o}createTextArea({placeholder:e,value:i,onChange:n}){const s=e?this.ctx.localeManager.t(e):void 0;return tG({value:i,onChange:n},{placeholder:s})}createCheckbox({label:e,checked:i,onChange:n}){const s=lu(),a=this.createInputGroup(e,{for:s}),o=Qj({checked:i,onChange:n},{class:"ag-charts-dialog__checkbox",role:"switch",id:s});return a.append(o),a}createColorPicker({color:e,opacity:i,label:n,altText:s,onChange:a,onChangeHide:o,isMultiColor:r,hasMultiColorOption:l}){const c=this.createInputGroup(n),u=this.ctx.localeManager.t(s),d=Xy({label:u,onPress:g=>{const{anchor:f,fallbackAnchor:y}=this.getColorPickerAnchors(d)??{};this.colorPicker.show({anchor:f,fallbackAnchor:y,color:e,opacity:i,isMultiColor:r,hasMultiColorOption:l,sourceEvent:g,onChange:(x,S,D,A)=>{d.style.setProperty("--color",x),d.classList.toggle("ag-charts-dialog__color-picker-button--multi-color",A),a(x,S,D,A)},onChangeHide:o})}},{"aria-label":u,tabindex:0,class:"ag-charts-dialog__color-picker-button",title:u});if(r)d.classList.toggle("ag-charts-dialog__color-picker-button--multi-color");else if(e){const g=se.fromString(e),f=new se(g.r,g.g,g.b,i);d.style.setProperty("--color",f.toHexString())}return c.append(d),this.hideFns.push(()=>{this.colorPicker.hide()}),c}createHeaderCloseButton(){return Xy({icon:"close",altText:this.ctx.localeManager.t("iconAltTextClose"),onPress:()=>this.hide()},{class:"ag-charts-dialog__close-button"})}createInputGroup(e,i){const n=$t("div","ag-charts-dialog__input-group"),s=$t("label","ag-charts-dialog__input-group-label");return s.innerText=this.ctx.localeManager.t(e),ye(s,"for",i?.for),n.appendChild(s),n}onLayoutComplete(e){this.seriesRect=e.series.paddedRect,this.reposition()}onKeyDown(e){e.altKey||e.ctrlKey||e.metaKey||e.isComposing||e.key!=="Escape"||this.hide()}reposition(){const{seriesRect:e,ctx:i}=this,n=this.getPopoverElement();if(!e||!n)return;const s=i.domManager.getBoundingClientRect(),a=at.from(0,e.y),o=at.from(s.width,e.height),r=at.from(n),l=at.from(.5,1);let c;if(e.width>1e3){const u=at.sub(at.add(a,at.multiply(o,l)),at.multiply(r,l));c=at.sub(u,at.from(0,i1.offset))}else{const u=at.sub(at.add(a,o),r);c=at.sub(u,i1.offset)}this.updatePosition(c)}getColorPickerAnchors(e){if(e&&(this.colorPickerAnchorElement=e),!this.colorPickerAnchorElement)return;const i=this.colorPickerAnchorElement.getBoundingClientRect(),n=this.ctx.domManager.getBoundingClientRect(),s=at.sub(at.from(i.x,i.y),at.from(n.left,n.top)),a=at.add(s,at.from(0,i.height+5)),o=at.sub(s,at.from(0,5));return{anchor:a,fallbackAnchor:o}}};UK.offset=60;var fot=UK,mot=class extends e1{constructor(){super($t("div","ag-charts-dialog__drag-handle"));const t=new e1($t("span",mu("drag-handle")));t.setAriaHidden(!0),this.addChild(t)}},yot=class extends fot{constructor(t){super(t,"settings"),this.events=new cr,this.hideFns.push(()=>this.events.emit("hidden",null))}show(t,e){const i=this.createLinearLineTab(t,e),n=this.createLinearTextTab(t,e);let s="dialogHeaderLine";Nc(t)?s="dialogHeaderChannel":bK(t)?s="dialogHeaderFibonacciRange":t.type==="date-range"?s="dialogHeaderDateRange":t.type==="price-range"?s="dialogHeaderPriceRange":t.type==="date-price-range"&&(s="dialogHeaderDatePriceRange");const{tabs:a,initialFocus:o}=this.createTabs("ariaLabelSettingsTabBar",e.initialSelectedTab,{line:{label:s,panel:i},text:{label:"dialogHeaderText",panel:n.panel,onShow:n.onShow}});e.initialFocus=o,this.showWithChildren([a],e).classList.add("ag-charts-dialog--annotation-settings")}createLinearLineTab(t,e){const i=this.createTabPanel(),n=this.createInputGroupLine(),s=this.createInputGroupLine(),a="isMultiColor"in t,o=this.createColorPickerInput("line-color",t.getDefaultColor("line-color"),t.getDefaultOpacity("line-color"),a?t.isMultiColor:!1,a,e.onChangeLineColor,e.onChangeHideLineColor),r=this.createStrokeWidthSelect(t.strokeWidth??2,e.onChangeLineStyleWidth),l=this.createLineStyleRadioGroup(t.lineStyle??"solid",e.onChangeLineStyleType);if(n.append(o),"background"in t){const c=this.createColorPickerInput("fill-color",t.getDefaultColor("fill-color"),t.getDefaultOpacity("fill-color"),!1,!1,e.onChangeFillColor,e.onChangeHideFillColor);n.append(c),s.append(r)}else"showFill"in t?(n.append(this.createCheckbox({label:"dialogInputShowFill",checked:t.showFill??!0,onChange:c=>e.onChangeLine({showFill:c})})),s.append(r)):n.append(r);return s.append(l),i.append(n,s),"bands"in t&&i.append(this.createFibonacciRatioSelect(t.bands??10,c=>e.onChangeLine({bands:c}))),"extendStart"in t&&"extendEnd"in t&&i.append(this.createCheckbox({label:Nc(t)?"dialogInputExtendChannelStart":"dialogInputExtendLineStart",checked:t.extendStart??!1,onChange:c=>e.onChangeLine({extendStart:c})}),this.createCheckbox({label:Nc(t)?"dialogInputExtendChannelEnd":"dialogInputExtendLineEnd",checked:t.extendEnd??!1,onChange:c=>e.onChangeLine({extendEnd:c})})),"extendAbove"in t&&"extendBelow"in t&&i.append(this.createCheckbox({label:"dialogInputExtendAbove",checked:t.extendAbove??!1,onChange:c=>e.onChangeLine({extendAbove:c})}),this.createCheckbox({label:"dialogInputExtendBelow",checked:t.extendBelow??!1,onChange:c=>e.onChangeLine({extendBelow:c})})),"extendLeft"in t&&"extendRight"in t&&i.append(this.createCheckbox({label:"dialogInputExtendLeft",checked:t.extendLeft??!1,onChange:c=>e.onChangeLine({extendLeft:c})}),this.createCheckbox({label:"dialogInputExtendRight",checked:t.extendRight??!1,onChange:c=>e.onChangeLine({extendRight:c})})),"reverse"in t&&"showFill"in t&&i.append(this.createCheckbox({label:"dialogInputReverse",checked:t.reverse??!1,onChange:c=>e.onChangeLine({reverse:c})})),i}createLinearTextTab(t,e){const i=this.createTabPanel(),n=this.createTextArea({placeholder:"inputTextareaPlaceholder",value:t.text.label,onChange:u=>e.onChangeText({label:u})}),s=this.createFontSizeSelect(t.text.fontSize,e.onChangeTextFontSize),a=this.createColorPickerInput("text-color",t.text.color,1,!1,!1,e.onChangeTextColor,e.onChangeHideTextColor),o=t.text.position==="inside"?"center":t.text.position,r=this.createPositionRadioGroup(o??"top",u=>e.onChangeText({position:u})),l=this.createAlignmentRadioGroup(t.text.alignment??"center",u=>e.onChangeText({alignment:u})),c=this.createInputGroupLine();return c.append(s,a,r,l),i.append(n,c),{panel:i,onShow:()=>b1(n)}}createColorPickerInput(t,e,i,n,s,a,o){const r=t==="fill-color"?"dialogInputFillColorPicker":"dialogInputColorPicker",l=t==="fill-color"?"dialogInputFillColorPickerAltText":"dialogInputColorPickerAltText";return this.createColorPicker({label:r,altText:l,color:e,opacity:i,isMultiColor:n,hasMultiColorOption:s,onChange:a,onChangeHide:o})}createStrokeWidthSelect(t,e){return this.createSelect({label:"dialogInputStrokeWidth",altText:"dialogInputStrokeWidthAltText",options:SK.map(({label:i,value:n})=>({label:i,value:`${n}`})),value:String(t),onChange:i=>e(Number(i))})}createFibonacciRatioSelect(t,e){return this.createSelect({label:"dialogInputFibonacciBands",altText:"dialogInputFibonacciBandsAltText",options:Nat.map(({label:i,value:n})=>({label:i,value:`${n}`})),value:String(t),onChange:i=>e(Number(i))})}createLineStyleRadioGroup(t,e){return this.createRadioGroup({label:"dialogInputLineStyle",options:[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],value:t,onChange:e})}createFontSizeSelect(t,e){return this.createSelect({label:"dialogInputFontSize",altText:"dialogInputFontSizeAltText",options:MK.map(({label:i,value:n})=>({label:i,value:String(n)})),value:String(t),onChange:i=>e(Number(i))})}createPositionRadioGroup(t,e){return this.createRadioGroup({label:"dialogInputPosition",options:[{icon:"position-top",altText:"iconAltTextPositionTop",value:"top"},{icon:"position-center",altText:"iconAltTextPositionCenter",value:"center"},{icon:"position-bottom",altText:"iconAltTextPositionBottom",value:"bottom"}],value:t,onChange:e})}createAlignmentRadioGroup(t,e){const i=[["iconAltTextAlignLeft","left"],["iconAltTextAlignRight","right"]];this.ctx.domManager.isRtl&&i.reverse();const[[n,s],[a,o]]=i;return this.createRadioGroup({label:"dialogInputAlign",options:[{icon:"align-left",altText:n,value:s},{icon:"align-center",altText:"iconAltTextAlignCenter",value:"center"},{icon:"align-right",altText:a,value:o}],value:t,onChange:e})}};function rw(t){return t.gridPadding+t.seriesAreaPadding+t.tickSize+t.label.spacing}function bot(t,e,i){for(const{update:n}of Object.values(ao))n(t,e,i)}var{InteractionState:Ma,keyProperty:xot,valueProperty:vot,Selection:Sot,BBox:Mot}=j,Cm=class WK extends Ln{constructor(e){super(),this.ctx=e,this.toolbar=new OA(this.ctx),this.optionsToolbar=new yO(this.ctx,()=>{const i=this.state.getActive();if(i!=null)return Yd(this.annotationData.at(i))}),this.axesButtons=new nO,this.enabled=!0,this.snap=!1,this.data=void 0,this.xKey=void 0,this.volumeKey=void 0,this.annotationData=new ss(WK.createAnnotationDatum),this.defaults=new Iat,this.container=new j.Group({name:"static-annotations"}),this.annotations=new Sot(this.container,this.createAnnotationScene.bind(this)),this.settingsDialog=new yot(this.ctx),this.textInput=new tat(this.ctx),this.postUpdateFns=[],this.state=this.setupStateMachine(),this.setupListeners(),this.setupDOM(),this.ctx.historyManager.addMementoOriginator(e.annotationManager),this.ctx.historyManager.addMementoOriginator(this.defaults),this.textInput.setKeyDownHandler(this.onTextInput.bind(this)),this.cleanup.register(()=>{this.clear(),this.xAxis?.button?.destroy(),this.yAxis?.button?.destroy(),this.textInput.destroy()})}setupStateMachine(){const{ctx:e}=this;return new LA({resetToIdle:()=>{e.domManager.updateCursor("annotations"),this.popAnnotationState(Ma.Annotations),this.hideOverlays(),this.optionsToolbar.hide(),this.deleteEphemeralAnnotations(),this.update()},hoverAtCoords:(i,n,s)=>{let a;return this.annotations.each((o,r,l)=>{if(!r.isHoverable())return;const c=o.containsPoint(i.x,i.y);c&&(a??(a=l)),o.toggleHovered(c,n===l,r.readOnly)}),a!=null?e.tooltipManager.suppressTooltip("annotations"):this.isAnnotationState()||e.tooltipManager.unsuppressTooltip("annotations"),(a==null||!this.annotationData.at(a)?.readOnly)&&this.ctx.domManager.updateCursor("annotations",a==null?void 0:this.annotations.at(a)?.getCursor()),a!==s&&this.update(),a},getNodeAtCoords:(i,n)=>this.annotations.at(n)?.getNodeAtCoords(i.x,i.y),translate:(i,n)=>{const s=this.annotations.at(i),a=Yd(this.annotationData.at(i));if(!(!s||!a))return this.translateNode(s,a,n)},copy:i=>{const n=this.annotations.at(i),s=Yd(this.annotationData.at(i));if(!(!n||!s))return this.createAnnotationDatumCopy(n,s)},paste:i=>{this.createAnnotation(i.type,i,!1),this.postUpdateFns.push(()=>{this.state.transitionAsync("selectLast"),this.state.transitionAsync("copy")})},select:(i,n)=>{const{annotations:s,optionsToolbar:a}=this;this.hideOverlays(),this.textInput.isVisible()||(this.toolbar.clearActiveButton(),this.toolbar.resetButtonIcons());const o=i==null?null:s.at(i),r=n==null?null:s.at(n),l=i==null?null:this.annotationData.at(i);r===o&&o!=null||(r?.toggleActive(!1),a.hide(),o&&!l?.readOnly?(this.pushAnnotationState(Ma.AnnotationsSelected),o.toggleActive(!0),Xh(l)||(a.updateButtons(this.annotationData.at(i)),this.postUpdateFns.push(()=>{a.show(),a.setAnchorScene(o)}))):(this.popAnnotationState(Ma.AnnotationsSelected),this.popAnnotationState(Ma.Annotations)),Xh(l)||this.deleteEphemeralAnnotations(),this.update())},selectLast:()=>(this.pushAnnotationState(Ma.AnnotationsSelected),this.annotationData.length-1),startInteracting:()=>{this.pushAnnotationState(Ma.Annotations)},stopInteracting:()=>{this.popAnnotationState(Ma.Annotations)},create:(i,n)=>{this.createAnnotation(i,n)},delete:i=>{this.annotationData.splice(i,1)},deleteAll:()=>{const i=this.annotationData.filter(n=>n.readOnly?n:!1);this.annotationData.splice(0,this.annotationData.length,...i)},validatePoint:(i,n)=>{const s=this.getAnnotationContext();return s?VM(s,i,n):!0},getAnnotationType:i=>iat(this.annotationData[i].type),datum:i=>this.annotationData.at(i),node:i=>this.annotations.at(i),recordAction:i=>{this.recordActionAfterNextUpdate(i)},update:()=>{this.postUpdateFns.push(()=>{const i=this.state.getActive(),n=i==null?null:this.annotations.at(i);n!=null&&this.optionsToolbar.setAnchorScene(n)}),this.update()},showTextInput:i=>{const n=Yd(this.annotationData.at(i));if(!this.annotations.at(i)||!n||!("getTextInputCoords"in n)||!("getTextPosition"in n))return;const a={color:n.color,fontFamily:n.fontFamily,fontSize:n.fontSize,fontStyle:n.fontStyle,fontWeight:n.fontWeight,placeholderColor:n.getPlaceholderColor()},o=this.getAnnotationContext(),r=c=>at.add(n.getTextInputCoords(o,c),at.required(this.seriesRect)),l=()=>n.getTextPosition();this.textInput.show({styles:a,layout:{getTextInputCoords:r,getTextPosition:l,alignment:n.alignment,textAlign:n.textAlign,width:n.width},text:n.text,placeholderText:n.placeholderText,onChange:(c,u)=>{this.state.transition("updateTextInputBBox",u)}}),this.ctx.domManager.updateCursor("annotations")},hideTextInput:()=>{this.textInput.hide()},updateTextInputColor:i=>{this.textInput.updateColor(i)},updateTextInputFontSize:i=>{const n=this.textInput.updateFontSize(i);this.state.transition("updateTextInputBBox",n)},updateTextInputBBox:i=>{this.state.transition("updateTextInputBBox",i)},showAnnotationOptions:i=>{const n=this.annotations.at(i);!n||Xh(this.annotationData.at(i))||(this.optionsToolbar.updateButtons(this.annotationData.at(i)),this.optionsToolbar.show(),this.optionsToolbar.setAnchorScene(n))},showAnnotationSettings:(i,n,s="line")=>{const a=this.annotationData.at(i);if(!DA(a)&&!Nc(a)&&!sv(a)||Xh(a))return;const o=c=>(u,d,g,f)=>{this.setColorAndDefault(a.type,c,u,d,g,f),this.optionsToolbar.updateColorPickerColor(c,d,g,f)},r=c=>()=>{this.recordActionAfterNextUpdate(`Change ${a.type} ${c} to ${a.getDefaultColor(c)}`,["annotations","defaults"]),this.update()},l={initialSelectedTab:s,ariaLabel:this.ctx.localeManager.t("ariaLabelAnnotationSettingsDialog"),sourceEvent:n,onChangeLine:c=>{this.state.transition("lineProps",c),c.bands!=null&&this.defaults.setDefaultFibonacciOptions(a.type,"bands",c.bands),c.reverse!=null&&this.defaults.setDefaultFibonacciOptions(a.type,"reverse",c.reverse),c.showFill!=null&&this.defaults.setDefaultFibonacciOptions(a.type,"showFill",c.showFill)},onChangeText:c=>{this.state.transition("lineText",c),c.alignment&&this.defaults.setDefaultLineTextAlignment(a.type,c.alignment),c.position&&this.defaults.setDefaultLineTextPosition(a.type,c.position),this.recordActionAfterNextUpdate(`Change ${a.type} text ${Object.keys(c).map(u=>`${u} to ${c[u]}`).join(", ")}`)},onChangeFillColor:o("fill-color"),onChangeHideFillColor:r("fill-color"),onChangeLineColor:o("line-color"),onChangeHideLineColor:r("line-color"),onChangeLineStyleType:c=>{this.setLineStyleTypeAndDefault(a.type,c),this.optionsToolbar.updateLineStyleType(Nb.find(u=>u.value===c)??Nb[0])},onChangeLineStyleWidth:c=>{this.setLineStyleWidthAndDefault(a.type,c),this.optionsToolbar.updateStrokeWidth({strokeWidth:c,value:c,label:String(c)})},onChangeTextColor:o("text-color"),onChangeHideTextColor:r("text-color"),onChangeTextFontSize:c=>{this.setFontSizeAndDefault(a.type,c)}};this.settingsDialog.show(a,l)}})}setupListeners(){const{ctx:e,optionsToolbar:i,settingsDialog:n,toolbar:s}=this,{seriesWidget:a,seriesDragInterpreter:o,chartWidget:r}=e.widgets;o&&this.cleanup.register(o.events.on("click",this.hoverTouchPreHandler.bind(this)),o.events.on("drag-start",this.hoverTouchPreHandler.bind(this)),o.events.on("drag-move",this.dragMoveTouchPreHandler.bind(this)),o.events.on("mousemove",this.onHover.bind(this)),o.events.on("click",this.onClick.bind(this)),o.events.on("dblclick",this.onDoubleClick.bind(this)),o.events.on("drag-start",this.onDragStart.bind(this)),o.events.on("drag-move",this.onDrag.bind(this)),o.events.on("drag-end",this.onDragEnd.bind(this))),this.cleanup.register(a.addListener("keydown",this.onKeyDown.bind(this)),a.addListener("keyup",this.onKeyUp.bind(this)),r.addListener("click",this.onCancel.bind(this)),e.eventsHub.on("annotations:restore",this.onRestoreAnnotations.bind(this)),e.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)),e.updateService.addListener("pre-scene-render",this.onPreRender.bind(this)),e.eventsHub.on("zoom:change-complete",()=>this.onResize()),e.eventsHub.on("dom:resize",()=>this.onResize()),s.events.on("cancel-create-annotation",()=>{this.cancel(),this.reset(),this.update()}),s.events.on("pressed-create-annotation",({annotation:l})=>{this.cancel(),this.pushAnnotationState(Ma.Annotations),this.state.transition(l),this.update()}),s.events.on("pressed-clear",()=>{this.clear(),this.recordActionAfterNextUpdate("Clear all")}),s.events.on("pressed-show-menu",()=>{this.cancel(),this.reset()}),s.events.on("pressed-unrelated",()=>{this.reset()}),i.events.on("pressed-delete",()=>{this.cancel(),this.delete(),this.reset()}),i.events.on("pressed-settings",({sourceEvent:l})=>{this.state.transition("toolbarPressSettings",l)}),i.events.on("pressed-lock",({locked:l})=>{this.recordActionAfterNextUpdate(l?"Locked":"Unlocked"),this.update()}),i.events.on("hid-overlays",()=>{this.settingsDialog.hide()}),i.events.on("saved-color",({type:l,colorPickerType:c,color:u})=>{this.recordActionAfterNextUpdate(`Change ${l} ${c} to ${u}`,["annotations","defaults"])}),i.events.on("updated-color",({type:l,colorPickerType:c,colorOpacity:u,color:d,opacity:g,isMultiColor:f})=>{this.setColorAndDefault(l,c,u,d,g,f)}),i.events.on("updated-font-size",({type:l,fontSize:c})=>{this.setFontSizeAndDefault(l,c)}),i.events.on("updated-line-style",({type:l,lineStyleType:c})=>{this.setLineStyleTypeAndDefault(l,c)}),i.events.on("updated-line-width",({type:l,strokeWidth:c})=>{this.setLineStyleWidthAndDefault(l,c)}),n.events.on("hidden",()=>{this.optionsToolbar.clearActiveButton()}))}setupDOM(){const{ctx:e,toolbar:i,optionsToolbar:n}=this;this.cleanup.register(e.annotationManager.attachNode(this.container),()=>{e.domManager.removeStyles(rb),i.destroy(),n.destroy()})}async processData(e){if(!this.enabled||this.data==null||this.xKey==null||this.volumeKey==null)return;const i=[xot(this.xKey,void 0,{id:"date"}),vot(this.volumeKey,"number",{id:"volume"})],n=j.DataSet.wrap(this.data)??j.DataSet.empty(),{dataModel:s,processedData:a}=await e.request("annotations",n,{props:i});this.dataModel=s,this.processedData=a}createAnnotationScene(e){if(e.type in ao)return new ao[e.type].scene;throw new Error(`AG Charts - Cannot create annotation scene of type [${e.type}], expected one of [${Object.keys(ao)}], ignoring.`)}static createAnnotationDatum(e){if(e.type in ao)return new ao[e.type].datum().set(e);throw new Error(`AG Charts - Cannot create annotation datum of unknown type [${e.type}], expected one of [${Object.keys(ao)}], ignoring.`)}createAnnotation(e,i,n=!0){if(this.annotationData.push(i),n){const s=this.ctx.annotationManager.getAnnotationTypeStyles(e);s&&i.set(s),this.defaults.applyDefaults(i)}this.injectDatumDependencies(i),this.update()}injectDatumDependencies(e){"setLocaleManager"in e&&e.setLocaleManager(this.ctx.localeManager),"getVolume"in e&&(e.getVolume=this.getDatumRangeVolume.bind(this))}getDatumRangeVolume(e,i){const{dataModel:n,processedData:s}=this;let a=Jn(e),o=Jn(i);if(!Ac(a)||!Ac(o)||!n||!s||this.volumeKey==null)return;a>o&&([a,o]=[o,a]);const r=n.resolveKeysById({id:"annotations"},"date",s),l=n.resolveColumnById({id:"annotations"},"volume",s);let c=0;for(let u=0;u=a&&d<=o&&(c+=l[u])}return c}translateNode(e,i,n){const s=this.getAnnotationConfig(i),a=this.getAnnotationContext();a&&s.translate(e,i,n,a)}createAnnotationDatumCopy(e,i){const n=this.getAnnotationConfig(i),s=new n.datum;s.set(i.toJson());const a=this.getAnnotationContext();if(a)return n.copy(e,i,s,a)}getAnnotationConfig(e){if(e.type in ao)return ao[e.type];throw new Error(`AG Charts - Cannot get annotation config of unknown type [${e.type}], expected one of [${Object.keys(ao)}], ignoring.`)}onRestoreAnnotations(e){if(!this.enabled)return;const{annotations:i}=e;if(this.annotationData.length===i.length&&i.every((s,a)=>{const o=this.annotationData.at(a);return o!=null&&o.type===s.type}))for(let s=0;s{this.ctx.annotationManager.fireChangedEvent()}),this.update()}onLayoutComplete(e){if(!this.enabled)return;const i=e.series.paddedRect;this.seriesRect=i,this.container.setClipRect(i),this.xAxis=this.getAxis(e.axes[z.X],i,this.xAxis?.button),this.yAxis=this.getAxis(e.axes[z.Y],i,this.yAxis?.button),this.showAnnotations()?this.animateAnnotations({from:0,to:1,phase:"trailing"}):this.animateAnnotations({from:1,to:0,phase:"remove"})}showAnnotations(){if(!this.yAxis||!this.xAxis)return!1;const e=this.ctx.chartService.series.some(s=>s.hasData),n=this.yAxis.context.seriesIds().some(s=>this.ctx.chartService.series.find(o=>o.id===s)?.visible);return e&&n}animateAnnotations({from:e,to:i,phase:n}){const{annotations:s}=this;this.ctx.animationManager?.animate({from:e,to:i,id:"chart-annotations",phase:n,groupId:"opacity",onUpdate(a){s.each(o=>{o.opacity=a,"setAxisLabelOpacity"in o&&o.setAxisLabelOpacity(a)})},onStop(){s.each(a=>{a.opacity=i,"setAxisLabelOpacity"in a&&a.setAxisLabelOpacity(i)})}})}onPreRender(){this.enabled&&(this.updateAnnotations(),this.state.transition("render"))}getAxis(e,i,n){const s=this.ctx.axisManager.getAxisContext(e.direction)[0],{position:a="bottom",direction:o}=s,r=e.gridPadding+e.seriesAreaPadding,l=new Mot(0,0,i.width,i.height).grow(r,a),c=o===z.X?"vertical":"horizontal",{axesButtons:u,snap:d}=this;if(this.enabled&&u.enabled&&(u.axes==="xy"||u.axes===o)){n??(n=new GK(this.ctx,{...s,snapToGroup:d},y=>this.onAxisButtonClick(y,c),i));const f=rw(e);n.update(i,f)}else n?.destroy(),n=void 0;return{layout:e,context:s,bounds:l,button:n}}recordActionAfterNextUpdate(e,i=["annotations"]){const{defaults:n,ctx:{annotationManager:s,historyManager:a}}=this,o=i.map(r=>r==="defaults"?n:s);this.postUpdateFns.push(()=>{a.record(e,...o),s.fireChangedEvent()})}setColorAndDefault(e,i,n,s,a,o){this.state.transition("color",{colorPickerType:i,colorOpacity:n,color:s,opacity:a,isMultiColor:o}),this.defaults.setDefaultColor(e,i,n,s,a,o)}setFontSizeAndDefault(e,i){this.state.transition("fontSize",i),this.defaults.setDefaultFontSize(e,i),this.recordActionAfterNextUpdate(`Change ${e} font size to ${i}`,["annotations","defaults"])}setLineStyleTypeAndDefault(e,i){this.state.transition("lineStyle",{type:i}),this.defaults.setDefaultLineStyleType(e,i),this.recordActionAfterNextUpdate(`Change ${e} line style to ${i}`,["annotations","defaults"])}setLineStyleWidthAndDefault(e,i){this.state.transition("lineStyle",{strokeWidth:i}),this.defaults.setDefaultLineStyleWidth(e,i),this.recordActionAfterNextUpdate(`Change ${e} stroke width to ${i}`,["annotations","defaults"])}updateAnnotations(){const{annotationData:e,annotations:i,seriesRect:n,ctx:{annotationManager:s}}=this,a=this.getAnnotationContext();if(!n||!a)return;s.updateData(e.toJson());const o=this.showAnnotations();this.toolbar.refreshButtonsEnabled(o),this.toolbar.toggleClearButtonEnabled(e.length>0&&o),i.update(e??[],void 0,r=>r.id).each((r,l)=>{if(!o){r.visible=!1,"setAxisLabelVisible"in r&&r.setAxisLabelVisible(!1);return}"setAxisLabelVisible"in r&&r.setAxisLabelVisible(!0),this.injectDatumDependencies(l),bot(r,l,a)});for(const r of this.postUpdateFns)r();this.postUpdateFns=[]}getAnnotationContext(){const{seriesRect:e,xAxis:i,yAxis:n,snap:s,ctx:a}=this;if(!(!e||!i||!n))return{seriesRect:e,isRtl:a.domManager.isRtl,xAxis:{...i.context,bounds:i.bounds,labelPadding:rw(i.layout),snapToGroup:s},yAxis:{...n.context,bounds:n.bounds,labelPadding:rw(i.layout),snapToGroup:s}}}onHover(e){const{state:i}=this,n=this.getAnnotationContext();if(!n)return;const s=e.sourceEvent.shiftKey,a=at.from(e),o=na(a,n);i.transition("hover",{offset:a,point:o,shiftKey:s,context:n})}onClick(e){const{state:i}=this,n=this.getAnnotationContext();if(!n)return;const s=e.sourceEvent.shiftKey,a=na(at.from(e),n),o=this.textInput.getValue(),r=this.textInput.getBBox();i.transition("click",{point:a,shiftKey:s,textInputValue:o,bbox:r})}onDoubleClick(e){const{state:i}=this;if(!this.getAnnotationContext())return;const s=at.from(e);i.transition("dblclick",{offset:s})}onAxisButtonClick(e,i){this.cancel(),this.reset();const n=this.getAnnotationContext();if(!this.annotationData||!n)return;const{state:s}=this;this.pushAnnotationState(Ma.Annotations);const a=i==="horizontal";if(s.transition(a?"horizontal-line":"vertical-line"),this.optionsToolbar.hide(),!e)return;const o=na(e,n);VM(n,o)&&(s.transition("click",{point:o,shiftKey:!1}),this.update())}onResize(){const e=this.textInput.getValue(),i=this.textInput.getBBox();this.state.transition("resize",{textInputValue:e,bbox:i})}hoverTouchPreHandler(e){e.device==="touch"&&this.onHover(e)}dragMoveTouchPreHandler(e){e.device==="touch"&&this.ctx.interactionManager.isState(Ma.AnnotationsSelected)&&e.sourceEvent.preventDefault()}onDragStart(e){if(!this.ctx.interactionManager.isState(Ma.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const n=at.from(e),s=na(n,i),a=this.textInput.getValue(),o=this.textInput.getBBox();this.state.transition("dragStart",{context:i,offset:n,point:s,textInputValue:a,bbox:o})}onDrag(e){if(!this.ctx.interactionManager.isState(Ma.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const n=at.from(e),s=na(n,i),a=e.sourceEvent.shiftKey,o=this.textInput.getValue(),r=this.textInput.getBBox();this.state.transition("drag",{context:i,offset:n,point:s,shiftKey:a,textInputValue:o,bbox:r})}onDragEnd(){this.state.transition("dragEnd")}onCancel(e){const{sourceEvent:i}=e??{};i?.currentTarget===i?.target&&(this.cancel(),this.reset())}onDelete(){this.textInput.isVisible()||(this.cancel(),this.delete(),this.reset(),this.update())}onTextInput(e){const{state:i}=this,n=this.getAnnotationContext();if(!n)return;const{key:s,shiftKey:a}=e,o=this.textInput.getValue(),r=this.textInput.getBBox();i.transition("textInput",{key:s,shiftKey:a,textInputValue:o,bbox:r,context:n})}onKeyDown(e){const{state:i}=this,n=this.getAnnotationContext();if(!n)return;const{sourceEvent:s}=e,{shiftKey:a,ctrlKey:o,metaKey:r}=s,l=o||r,c=o||a;i.transition("keyDown",{shiftKey:a,context:n});const u={x:0,y:0},d=Math.max(n?.xAxis.scale.bandwidth??0,c?10:1),g=Math.max(n?.yAxis.scale.bandwidth??0,c?10:1);switch(s.key){case"ArrowDown":u.y=g;break;case"ArrowUp":u.y=-g;break;case"ArrowLeft":u.x=-d;break;case"ArrowRight":u.x=d;break;case"Escape":this.onCancel();return;case"Backspace":case"Delete":this.onDelete();return}if((u.x||u.y)&&(i.transition("translate",{translation:u}),s.stopPropagation(),s.preventDefault()),!!l)switch(s.key){case"c":i.transition("copy");return;case"x":i.transition("cut"),this.recordActionAfterNextUpdate("Cut annotation");return;case"v":i.transition("paste"),this.recordActionAfterNextUpdate("Paste annotation");return}}onKeyUp(e){const{shiftKey:i}=e.sourceEvent,n=this.getAnnotationContext();n&&(this.state.transition("keyUp",{shiftKey:i,context:n}),this.state.transition("translateEnd"))}clear(){this.cancel(),this.deleteAll(),this.reset()}reset(){this.state.transition("reset")}cancel(){this.state.transition("cancel")}delete(){this.state.transition("delete")}deleteAll(){this.state.transition("deleteAll")}deleteEphemeralAnnotations(){let e=!1;for(const[i,n]of this.annotationData.entries())Xh(n)&&(this.annotationData.splice(i,1),e=!0);e&&this.recordActionAfterNextUpdate("Delete ephemeral annotations")}hideOverlays(){this.settingsDialog.hide(),this.toolbar.hideOverlays(),this.optionsToolbar.hideOverlays()}pushAnnotationState(e){this.ctx.interactionManager.pushState(e),this.ctx.tooltipManager.suppressTooltip("annotations")}popAnnotationState(e){this.ctx.interactionManager.popState(e),this.ctx.tooltipManager.unsuppressTooltip("annotations")}isAnnotationState(){return this.ctx.interactionManager.isState(Ma.Annotations)||this.ctx.interactionManager.isState(Ma.AnnotationsSelected)}update(e=Ct.PRE_SCENE_RENDER){this.ctx.eventsHub.emit("chart:request-update",{type:e})}};M([b],Cm.prototype,"toolbar");M([b],Cm.prototype,"optionsToolbar");M([b],Cm.prototype,"axesButtons");M([b,Bi((t,e)=>{const i=e??!0;t.toolbar.enabled=i,t.optionsToolbar.enabled=i,t.axesButtons.enabled=i})],Cm.prototype,"enabled");M([b],Cm.prototype,"snap");var Dot=Cm,Wo={stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:2},ms={fill:vx,strokeOpacity:1,strokeWidth:2},gp={color:{$ref:"chartBackgroundColor"},fontSize:{$rem:Cn.LARGE},fontFamily:{$ref:"fontFamily"}},y_={...gp,enabled:!0,fill:{$ref:"foregroundColor"},fontSize:{$ref:"fontSize"}},hS={...gp,textAlign:"start"},_d={...gp,position:"top",alignment:"center",color:{$ref:"textColor"}},b_={...gp,position:"top",alignment:"center",color:{$ref:"textColor"}},n1={...gp,fontSize:{$ref:"fontSize"},color:Dx,fill:Sx,stroke:Mx,strokeWidth:1,divider:{stroke:Ax,strokeWidth:1,strokeOpacity:.5}},lw={...Wo,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...ms},text:{..._d},statistics:{...n1}},Aot={buttons:{$shallowSimple:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}]},padding:{$ref:"chartPadding"}},Iot={buttons:{$shallowSimple:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextColor",value:"text-color"},{icon:"line-color",tooltip:"toolbarAnnotationsLineColor",value:"line-color"},{icon:"fill-color",tooltip:"toolbarAnnotationsFillColor",value:"fill-color"},{tooltip:"toolbarAnnotationsTextSize",value:"text-size"},{tooltip:"toolbarAnnotationsLineStrokeWidth",value:"line-stroke-width"},{icon:"line-style-solid",tooltip:"toolbarAnnotationsLineStyle",value:"line-style-type"},{icon:"settings",tooltip:"toolbarAnnotationsSettings",value:"settings"},{icon:"unlocked",tooltip:"toolbarAnnotationsLock",ariaLabel:"toolbarAnnotationsLock",checkedOverrides:{icon:"locked",tooltip:"toolbarAnnotationsUnlock"},value:"lock"},{icon:"delete",tooltip:"toolbarAnnotationsDelete",value:"delete"}]}},kot={enabled:!1,line:{...Wo,handle:{...ms},text:{..._d}},"horizontal-line":{...Wo,handle:{...ms},axisLabel:{...y_},text:{..._d}},"vertical-line":{...Wo,handle:{...ms},axisLabel:{...y_},text:{..._d}},"disjoint-channel":{...Wo,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...ms},text:{...b_}},"parallel-channel":{...Wo,middle:{lineDash:[6,5],strokeWidth:1},background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...ms},text:{...b_}},"fibonacci-retracement":{...Wo,strokes:jb,rangeStroke:{$ref:"foregroundColor"},handle:{...ms},text:{..._d,position:"center"},label:{...gp,color:void 0,fontSize:{$rem:Cn.SMALLER}}},"fibonacci-retracement-trend-based":{...Wo,strokes:jb,rangeStroke:{$ref:"foregroundColor"},handle:{...ms},text:{..._d,position:"center"},label:{...gp,color:void 0,fontSize:{$rem:Cn.SMALLER}}},callout:{...Wo,...hS,color:{$ref:"textColor"},handle:{...ms},fill:{$ref:"foregroundColor"},fillOpacity:.075},comment:{...hS,fontWeight:700,handle:{...ms},fill:{$ref:"foregroundColor"}},note:{...hS,color:Cx,fill:ra,stroke:{$ref:"chartBackgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...ms},background:{fill:Ix,stroke:kx,strokeWidth:1}},text:{...hS,color:{$ref:"textColor"},handle:{...ms}},arrow:{...Wo,handle:{...ms},text:{..._d}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...ms,stroke:{$ref:"foregroundColor"}}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...ms,stroke:{$ref:"foregroundColor"}}},"date-range":{...lw},"price-range":{...lw},"date-price-range":{...lw},"quick-date-price-range":{up:{...Wo,fill:Ws,fillOpacity:.2,handle:{...ms},statistics:{...n1,color:"#fff",fill:Ws,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...Wo,stroke:Ub,fill:Gb,fillOpacity:.2,handle:{...ms,stroke:Ub},statistics:{...n1,color:"#fff",fill:Gb,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{},toolbar:Aot,optionsToolbar:Iot},Cot={type:"plugin",name:"annotations",chartType:"cartesian",enterprise:!0,version:oi,options:j.annotationOptionsDef,themeTemplate:kot,create:t=>new Dot(t),patchContext:t=>{t.sharedToolbar||(t.sharedToolbar=new Qst(t),t.cleanup.register(()=>t.sharedToolbar.destroy()))}},{Range:wot,TranslatableGroup:Not,BBox:Tot,FillGradientDefaults:Lot,FillImageDefaults:Oot,FillPatternDefaults:Eot,getShapeFill:Rot,InteractionState:uS}=j,dr=class extends Ln{constructor(t){super(),this.ctx=t,this.id=Nn(this),this.enabled=!1,this.stroke="rgb(195, 195, 195)",this.lineDash=[6,3],this.lineDashOffset=0,this.strokeWidth=1,this.strokeOpacity=1,this.fill="#c16068",this.fillOpacity=1,this.fillGradientDefaults=new Lot,this.fillPatternDefaults=new Eot,this.fillImageDefaults=new Oot,this.bounds=new Tot(0,0,0,0),this.bandHighlightGroup=new Not({name:"bandHighlight",zIndex:pe.AXIS_BAND_HIGHLIGHT}),this.rangeNode=this.bandHighlightGroup.appendChild(new wot),this.activeAxisHighlight=void 0,this.axisCtx=t.parent,this.hideBand(),t.domManager.addEventListener("focusin",({target:a})=>{const o=a instanceof HTMLElement&&t.domManager.contains(a,"series-area");this.bandHighlightGroup.visible&&!o&&(this.hideBand(),this.ctx.eventsHub.emit("chart:request-update",{type:Ct.SCENE_RENDER}))});const{widgets:{seriesWidget:e,seriesDragInterpreter:i},animationManager:n,eventsHub:s}=t;this.cleanup.register(t.scene.attachNode(this.bandHighlightGroup),e.addListener("mousemove",a=>this.onHoverLikeEvent(a)),e.addListener("mouseleave",()=>this.clearAllHighlight()),n.addListener("animation-start",()=>this.clearAllHighlight()),s.on("layout:complete",a=>this.layout(a)),s.on("series:focus-change",()=>this.onKeyPress()),s.on("zoom:pan-start",()=>this.clearAllHighlight()),s.on("zoom:change-complete",()=>this.clearAllHighlight()),s.on("dom:resize",()=>this.clearAllHighlight()),s.on("axis:change",()=>this.axisChange())),i&&this.cleanup.register(i.events.on("drag-move",a=>this.onHoverLikeEvent(a)),i.events.on("click",a=>this.onClick(a)))}axisChange(){this.onHighlightChange()}isHover(t){return t.type==="mousemove"||t.type==="click"||t.device==="touch"&&this.ctx.chartService.touch.dragAction==="hover"}onClick(t){t.device==="touch"&&this.onHoverLikeEvent(t)}clearAllHighlight(){this.ctx.interactionManager.isState(uS.Hoverable)&&this.onHighlightChange()}onKeyPress(){this.ctx.interactionManager.isState(uS.Default)&&this.onHighlightChange()}onHoverLikeEvent(t){const e=this.isHover(t)?uS.Hoverable:uS.AnnotationsMoveable;this.ctx.interactionManager.isState(e)&&this.handleHoverHighlight(t)}handleHoverHighlight(t){if(!t)return;const{currentX:e,currentY:i}=t;this.onHighlightChange(this.axisCtx.pickBand({x:e,y:i}))}layout({series:{rect:t,visible:e},axes:i}){if(!e||!i||!this.enabled)return;const{position:n="left",axisId:s}=this.axisCtx,a=i[s];if(!a)return;this.axisLayout=a,this.bounds=t.clone().grow(a.gridPadding,n);const{bandHighlightGroup:o,bounds:r}=this;o.translationX=Math.round(r.x),o.translationY=Math.round(r.y),this.updateBand()}updateBand(){const{rangeNode:t,stroke:e,strokeWidth:i,strokeOpacity:n,lineDash:s,fill:a,fillOpacity:o,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:c,lineDashOffset:u,axisLayout:d}=this;d&&(t.stroke=e,t.strokeWidth=i,t.strokeOpacity=n,t.lineDash=s,t.lineDashOffset=u,t.fill=Rot(a,r,l,c),t.fillOpacity=o,t.startLine=!0,t.endLine=!0)}isVertical(){return this.axisCtx.direction===z.X}onHighlightChange(t){this.enabled&&(this.activeAxisHighlight=t,this.activeAxisHighlight?this.showBand():this.hideBand(),this.ctx.eventsHub.emit("chart:request-update",{type:Ct.SCENE_RENDER}))}updateBandPosition(){const{rangeNode:t,bounds:e}=this,{band:i}=this.activeAxisHighlight??{};if(i==null){this.hideBand();return}let n=Math.min(...i),s=Math.max(...i);if(s-n<1){const a=(n+s)/2;n=a-.5,s=a+.5}this.isVertical()?(t.y1=0,t.y2=e.height,t.x1=n,t.x2=s,t.horizontal=!0):(t.y1=n,t.y2=s,t.x1=0,t.x2=e.width,t.horizontal=!1)}showBand(){this.updateBandPosition(),this.bandHighlightGroup.visible=!0}hideBand(){this.bandHighlightGroup.visible=!1}};dr.className="BandHighlight";M([b],dr.prototype,"enabled");M([b],dr.prototype,"stroke");M([b],dr.prototype,"lineDash");M([b],dr.prototype,"lineDashOffset");M([b],dr.prototype,"strokeWidth");M([b],dr.prototype,"strokeOpacity");M([b],dr.prototype,"fill");M([b],dr.prototype,"fillOpacity");M([b],dr.prototype,"fillGradientDefaults");M([b],dr.prototype,"fillPatternDefaults");M([b],dr.prototype,"fillImageDefaults");var{LayoutElement:Pot,Menu:zot}=j,cw=[{label:"toolbarSeriesTypeOHLC",icon:"ohlc-series",value:"ohlc"},{label:"toolbarSeriesTypeCandles",icon:"candlestick-series",value:"candlestick"},{label:"toolbarSeriesTypeHollowCandles",icon:"hollow-candlestick-series",value:"hollow-candlestick"},{label:"toolbarSeriesTypeLine",icon:"line-series",value:"line"},{label:"toolbarSeriesTypeStepLine",icon:"step-line-series",value:"step-line"},{label:"toolbarSeriesTypeHLC",icon:"hlc-series",value:"hlc"},{label:"toolbarSeriesTypeHighLow",icon:"high-low-series",value:"high-low"}],Bot=class extends Ln{constructor(t){super(),this.ctx=t,this.enabled=!1,this.menuMargin=6,this.menu=new zot(this.ctx,"chart-toolbar"),this.menuShowing=!1,this.toolbar=t.sharedToolbar.getSharedToolbar("chartToolbar"),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPressed.bind(this)),t.layoutManager.registerElement(Pot.ToolbarLeft,this.onLayoutStart.bind(this)),t.eventsHub.on("series-area:click",()=>this.hidePopover()),()=>this.toolbar.destroy())}onLayoutStart(t){this.enabled&&(this.updateButton(),this.toolbar.layout(t.layoutBox))}onButtonPressed({event:t,buttonBounds:e,buttonWidget:i}){const n=this.ctx.domManager.isRtl?e.x-this.menuMargin:e.x+e.width+this.menuMargin;this.menu.setAnchor({x:n,y:e.y}),this.menu.show(i,{items:cw,menuItemRole:"menuitemradio",ariaLabel:this.ctx.localeManager.t("toolbarSeriesTypeDropdown"),class:"ag-charts-chart-toolbar__menu",value:this.getChartType(),sourceEvent:t.sourceEvent,onPress:s=>{this.setChartType(s.value),this.hidePopover()},onHide:()=>{this.toolbar.clearActiveButton(),this.menuShowing=!1}}),this.menuShowing=!0,this.toolbar.toggleActiveButtonByIndex(0)}updateButton(){const t=this.getChartType(),e=cw.find(i=>i.value===t)?.icon;e!=null&&this.toolbar.updateButtons([{icon:e,tooltip:"toolbarSeriesTypeDropdown",value:"menu"}])}hidePopover(){this.menuShowing&&(this.menuShowing=!1,this.toolbar.clearActiveButton()),this.menu.hide()}setChartType(t){const e={chartType:t};this.ctx.chartService.publicApi?.updateDelta(e).catch(i=>pt.error(i))}getChartType(){const t=this.ctx.chartService.publicApi?.getOptions()?.chartType;return t==null||!cw.some(e=>e.value===t)?"candlestick":t}};M([b,Pe({changeValue(t){this.toolbar?.setHidden(!t)}})],Bot.prototype,"enabled");function s1(t,e){return t==="always"?!0:t==="series-area"?e==="series-area"||e==="series-node":t===e}function KK(t,e,i){let n=!0;if(e.type==="separator"){const s=i.at(-1);n=s!==void 0&&s.type!=="separator"}if(n&&(n=s1(e.showOn??"always",t)),n){const s=new Fot(e);return i.push(s),s}}function x_(t,e,i,n){e.isVisible(i)&&KK(t,e.builtins.items[i],n)}function Vot(t,e,i,n){const{builtins:s}=e;if(jd(i,s.lists))for(const a of s.lists[i])x_(t,e,a,n);else x_(t,e,i,n)}function _ot(t,e,i){const n=[],{builtins:s}=i;for(const a of e)if(typeof a=="string"&&jd(a,s.lists))for(const o of s.lists[a])n.push(o);else n.push(a);return n.filter(a=>{if(typeof a=="string"){const o=i.builtins.items[a].showOn??"always";return i.isVisible(a)&&s1(o,t)}else return s1(a.showOn??"always",t)})}function YK(t,e,i,n){for(const s of i)if(typeof s=="string")Vot(t,e,s,n);else{const a=KK(t,s,n);s.items&&a&&s.items.length>0&&YK(t,e,s.items,a.items)}n.at(-1)?.type==="separator"&&n.pop()}var Fot=class{constructor(t){this.type="action",this.showOn="always",this.label="",this.iconUrl=void 0,this.enabled=!0,this.items=[],this.action=void 0,t&&this.setOptions(t),this.items=[]}setField(t,e,i){e[t]=i}setOptions(t){let e;for(e in t)t[e]!==void 0&&this.setField(e,this,t[e])}},uc="ag-charts-context-menu",{getItemId:Hot,ContextMenuRegistry:_y}=j,hw="context-menu",jot=["angleKey","calloutLabelKey","colorKey","labelKey","radiusKey","sectorLabelKey","sizeKey","xKey","yKey"],ov=class extends Ln{constructor(t){if(super(),this.ctx=t,this.enabled=!0,this.darkTheme=!1,this.items=["defaults"],this.pickedNode=void 0,this.showEvent=void 0,this.x=0,this.y=0,this.collapsingSubMenus=0,this.menuWidget=new RM.MenuWidget,this.interactionManager=t.interactionManager,this.element=t.domManager.addChild("canvas-overlay",hw),this.element.classList.add(uc),this.element.style.display="none",this.element.addEventListener("contextmenu",e=>e.preventDefault()),this.element.addEventListener("focusout",({relatedTarget:e})=>{this.collapsingSubMenus>0||(e==null||e instanceof Node&&!this.element.contains(e))&&this.hide()}),this.cleanup.register(()=>this.element.remove(),()=>this.menuWidget.destroy(),t.eventsHub.on("dom:hidden",()=>this.hide()),this.menuWidget.addListener("collapse-widget",()=>this.onCollapse())),this.menuWidget.addClass(`${uc}__menu`),typeof MutationObserver<"u"){const e=new MutationObserver(()=>{this.element.contains(this.menuWidget.getElement())&&this.reposition()});e.observe(this.element,{childList:!0}),this.mutationObserver=e,this.cleanup.register(()=>e.disconnect())}this.ctx.contextMenuRegistry.builtins.items.download.action=()=>{const e=t.chartService.title;let i="image";e?.enabled&&(i=e.node.getPlainText().replace(/\.+/,"")),this.ctx.chartService.publicApi?.download({fileName:i}).catch(n=>{pt.error("Unable to download chart",n)})},this.cleanup.register(this.ctx.eventsHub.on("context-menu:complete",e=>this.onContext(e)))}makeGetItemsParams(t){const{showOn:e}=t,{context:i}=this.ctx.chartService,n=_ot(e,this.items,this.ctx.contextMenuRegistry);switch(e){case"always":case"series-area":return{showOn:e,context:i,defaultItems:n};case"series-node":{if(this.pickedNode==null)throw new Error("this.pickedNode is null");const c={showOn:e,context:i,seriesId:this.pickedNode.series.id,itemId:Hot(this.pickedNode,this.pickedNode.series.data?.dataIdKey),datum:this.pickedNode.datum,defaultItems:n};for(const u of jot)this.pickedNode[u]!==void 0&&(c[u]=this.pickedNode[u]);return c}case"legend-item":if(this.pickedLegendItem==null)throw new Error("this.pickedLegendItem is null");const{itemId:s,seriesId:a,label:o,enabled:r}=this.pickedLegendItem,l=ce(o.text);return{showOn:e,context:i,itemId:s,seriesId:a,text:l,visible:r,defaultItems:n};default:return e}}expandItemsOptions(t){const e=[];let i;if(this.getItems){const n=this.makeGetItemsParams(t);i=this.getItems(n)}return i??(i=this.items),YK(t.showOn,this.ctx.contextMenuRegistry,i,e),e}onContext(t){if(!this.enabled)return;t.widgetEvent.sourceEvent.preventDefault(),this.showEvent=t.widgetEvent.sourceEvent,this.x=t.x,this.y=t.y,this.pickedNode=void 0,this.pickedLegendItem=void 0,_y.check("series-node",t)?this.pickedNode=t.context.pickedNode:_y.check("legend-item",t)&&(this.pickedLegendItem=t.context.legendItem);const e=this.expandItemsOptions(t);e.length!==0&&this.show(t.widgetEvent,e)}show(t,e){const{sourceEvent:i}=t;this.interactionManager.pushState(j.InteractionState.ContextMenu),this.element.style.display="block";const n=i.pointerType==="touch"?!1:void 0;n!==void 0&&this.ctx.chartService.overrideFocusVisible(n),this.createMenu(e),this.element.appendChild(this.menuWidget.getElement()),this.menuWidget.expand({sourceEvent:i,overrideFocusVisible:n})}hide(){this.menuWidget.collapse()}onCollapse(){this.interactionManager.popState(j.InteractionState.ContextMenu),this.menuWidget.getElement().remove(),this.element.style.display="none"}onSubMenuExpand(t,e){const i=t.getBounds();t.setFocusOverride(!0),t.getElement().insertAdjacentElement("afterend",e.getElement()),e.getElement().style.position="absolute";const{isRtl:n}=this.ctx.domManager,s=this.ctx.domManager.getBoundingClientRect(),a=t.getBoundingClientRect(),o=s.right-a.right,r=a.left-s.left,{offsetWidth:l,offsetHeight:c}=e.getElement();let u=i.y;if(s.height>c){const f=s.bottom-a.top;f=l){const f=d==="right"?i.x+i.width:i.x-l;e.setBounds({x:f,y:u})}else{const f=d==="right"?i.x-l:i.x+i.width,y=(d==="right"?r:o)-l;y>=0?e.setBounds({x:f,y:u}):e.setBounds({x:f+(d==="right"?-y:y),y:u})}}onSubMenuCollapse(t,e){t.setFocusOverride(void 0),this.collapsingSubMenus++,e.remove(),this.collapsingSubMenus--}createMenu(t){const{menuWidget:e}=this;e.clear(),e.setTabIndex(-1),this.createMenuItems(e,t)}createMenuItems(t,e){for(const i of e)switch(i.type){case"separator":{t.addSeparator().classList.add(`${uc}__divider`);break}case"action":{if(i.items.length===0){const n=new RM.MenuItemWidget;this.initButtonElement(n,i),t.addChild(n)}else{const{subMenuButton:n,subMenu:s}=t.addSubMenu();s.addClass(`${uc}__menu`),s.addListener("expand-widget",()=>this.onSubMenuExpand(n,s)),s.addListener("collapse-widget",()=>this.onSubMenuCollapse(n,s)),this.initButtonElement(n,i),this.createMenuItems(s,i.items)}break}default:throw new Error("unhandled case")}}createButtonOnClick(t,e){return _y.checkCallback("legend-item",t,e)?i=>{const n=i.sourceEvent;if(this.pickedLegendItem){const{seriesId:s,itemId:a,label:o}=this.pickedLegendItem,{chartService:r}=this.ctx,c=[r.series.find(d=>d.id===s)?.properties,r],u={type:"contextmenu",seriesId:s,itemId:a,text:ce(o.text),event:n};js(c,e,u),this.hide()}else pt.error("legend item not found")}:_y.checkCallback("series-area",t,e)?()=>{const i=this.ctx.chartService,n={type:"seriesContextMenuAction",event:this.showEvent};js(i,e,n),this.hide()}:_y.checkCallback("series-node",t,e)?()=>{const{showEvent:i}=this,{chartService:n}=this.ctx,s=this.pickedNode,a=[s?.series.properties,n],o=s?.series.createNodeContextMenuActionEvent(i,s);o?js(a,e,o):pt.error("series node not found"),this.hide()}:()=>{const i=this.ctx.chartService,n={type:"contextMenuEvent",event:this.showEvent};js(i,e,n),this.hide()}}initTableCells(t){const e=$t("div"),i=$t("div"),n=$t("div");return e.classList.toggle(`${uc}__icon`,!0),i.classList.toggle(`${uc}__cell`,!0),n.classList.toggle(`${uc}__cell`,!0),e.ariaHidden="true",i.role="presentation",n.ariaHidden="true",t.append(e,i,n),{cellIcon:e,cellLabel:i,cellArrow:n}}initButtonElement(t,e){t.addClass(`${uc}__item`),t.setEnabled(e.enabled);const i=this.ctx.localeManager.t(e.label),n=`${uc}__cellpadding`,{cellIcon:s,cellLabel:a,cellArrow:o}=this.initTableCells(t.getElement());if(a.textContent=i,a.classList.add(n),e.iconUrl!=null){const c=$t("img");c.src=e.iconUrl,s.append(c),s.classList.add(n)}if(e.items.length>0){const c=$t("span",mu("chevron-right"));o.append(c),o.classList.add(n)}const{showOn:r,action:l}=e;l!=null&&t.addListener("click",this.createButtonOnClick(r,l)),e.items.length===0&&(t.addListener("mouseleave",()=>t.setFocusOverride(!1)),t.addListener("mouseenter",()=>t.setFocusOverride(void 0)))}reposition(){const{isRtl:t}=this.ctx.domManager;let{x:e,y:i}=this;this.element.style.top="unset",this.element.style.bottom="unset";const n=this.ctx.domManager.getBoundingClientRect(),{offsetWidth:s,offsetHeight:a}=this.element;e=Nt(0,t?e-s:e,n.width-s),i=Nt(0,i,n.height-a),this.element.style.left=`${e}px`,this.element.style.top=`calc(${i}px - 0.5em)`}destroy(){super.destroy(),this.mutationObserver?.disconnect(),this.ctx.domManager.removeStyles(hw),this.ctx.domManager.removeChild("canvas-overlay",hw)}};M([b],ov.prototype,"enabled");M([b],ov.prototype,"darkTheme");M([b],ov.prototype,"items");M([b],ov.prototype,"getItems");var $K={type:"plugin",name:"contextMenu",enterprise:!0,version:oi,options:{enabled:J,items:aM,getItems:Is(aM,"a menu items array")},themeTemplate:{enabled:!0,darkTheme:Qd},create:t=>new ov(t)};$K.options.darkTheme=Mt(J);function FM(t){return typeof t?.datum=="object"?t.datum:null}var{FormatManager:Got}=j,Uot="ag-charts-crosshair-label",qu=class extends xt{constructor(){super(...arguments),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.format=void 0,this.renderer=void 0,this._cachedFormatter=void 0}formatValue(t,e,i,n){const{formatter:s,format:a}=this,{domain:o,boundSeries:r}=n;let l;if(s!=null){const c=n.type==="number"?n.fractionDigits:void 0,u=n.type==="date"?n.unit:void 0,d=n.type==="date"?n.step:void 0;l=t(s,{value:i,domain:o,fractionDigits:c,unit:u,step:d,boundSeries:r})}if(a!=null){let c=this._cachedFormatter;(c?.type!==e||c?.format!==a)&&(c={type:e,format:a,formatter:Got.getFormatter(e,a)},this._cachedFormatter=c),l??(l=c.formatter?.(i))}return l==null?void 0:String(l)}};M([b],qu.prototype,"enabled");M([b],qu.prototype,"xOffset");M([b],qu.prototype,"yOffset");M([b],qu.prototype,"formatter");M([b],qu.prototype,"format");M([b],qu.prototype,"renderer");var XK=class extends qu{constructor(t,e,i){super(),this.domManager=t,this.id=Nn(this),this.elementProxy=t.addDeferredProxyChild("canvas-overlay",`crosshair-label-${this.id}`),this.elementProxy.toggleClass(Uot,!0),this.elementProxy.setAttr("aria-hidden","true"),this.elementProxy.setAttr("data-key",e),this.elementProxy.setAttr("data-axis-id",i)}show(t){const e=Math.round(t.x+this.xOffset),i=Math.round(t.y+this.yOffset);this.elementProxy.setProperty("left",`${e}px`),this.elementProxy.setProperty("top",`${i}px`);const n=t.translateX||t.translateY?`${t.translateX??"0"} ${t.translateY??"0"}`:"";this.elementProxy.setProperty("translate",n),this.toggle(!0)}setLabelHtml({html:t,styles:e}){t!==void 0&&this.elementProxy.setInnerHTML(t),e!==void 0&&this.elementProxy.setContentStyles(e)}toggle(t){this.elementProxy.toggleClass("ag-charts-crosshair-label--hidden",!t)}destroy(){this.domManager.removeChild("canvas-overlay",`crosshair-label-${this.id}`)}toLabelHtml(t,e){if(typeof t=="string")return{html:t,styles:{}};e=e??{};const{text:i=e.text??"",color:n=e.color,backgroundColor:s=e.backgroundColor,opacity:a=e.opacity??1}=t,o={opacity:a,"background-color":s?.toLowerCase(),color:n};return{html:`
+ ${i} +
`,styles:o}}};XK.className="CrosshairLabel";var{Group:Wot,TranslatableGroup:Kot,Line:Yot,BBox:v_,InteractionState:Ph}=j,Fl=class extends Ln{constructor(t){super(),this.ctx=t,this.id=Nn(this),this.enabled=!1,this.stroke="rgb(195, 195, 195)",this.lineDash=[6,3],this.lineDashOffset=0,this.strokeWidth=1,this.strokeOpacity=1,this.snap=!0,this.label=new qu,this.seriesRect=new v_(0,0,0,0),this.bounds=new v_(0,0,0,0),this.crosshairGroup=new Kot({name:"crosshairs",zIndex:pe.SERIES_CROSSHAIR}),this.lineGroup=this.crosshairGroup.appendChild(new Wot({name:`${this.id}-crosshair-lines`,zIndex:pe.SERIES_CROSSHAIR})),this.lineGroupSelection=j.Selection.select(this.lineGroup,Yot,!1),this.activeHighlight=void 0,this.activeHighlightInViewport=!1,this.axisCtx=t.parent,this.labels={},this.hideCrosshairs(),t.domManager.addEventListener("focusin",({target:i})=>{if(this.checkInteractionState())return;const n=i instanceof HTMLElement&&t.domManager.contains(i,"series-area");this.crosshairGroup.visible&&!n&&(this.hideCrosshairs(),this.ctx.eventsHub.emit("chart:request-update",{type:Ct.SCENE_RENDER}))});const{seriesDragInterpreter:e}=t.widgets;this.cleanup.register(t.scene.attachNode(this.crosshairGroup),t.widgets.seriesWidget.addListener("mousemove",i=>this.onMouseHoverLike(i)),t.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseOut()),t.eventsHub.on("series:focus-change",()=>this.onKeyPress()),t.eventsHub.on("zoom:pan-start",()=>this.onMouseOut()),t.eventsHub.on("zoom:change-complete",()=>this.onMouseOut()),t.eventsHub.on("highlight:change",i=>this.onHighlightChange(i)),t.eventsHub.on("layout:complete",i=>this.layout(i)),()=>{for(const i of Object.values(this.labels))i.destroy()}),e&&this.cleanup.register(e.events.on("drag-move",i=>this.onMouseHoverLike(i)),e.events.on("click",i=>this.onClick(i)))}checkInteractionState(){return this.ctx.interactionManager.isState(Ph.Frozen)}layout({series:{rect:t,visible:e},axes:i}){if(!e||!i||!this.enabled)return;this.seriesRect=t;const{position:n="left",axisId:s}=this.axisCtx,a=i[s];if(!a)return;this.axisLayout=a,this.bounds=t.clone().grow(a.gridPadding+a.seriesAreaPadding,n);const{crosshairGroup:o,bounds:r}=this;o.translationX=Math.round(r.x),o.translationY=Math.round(r.y);const l=["pointer",...this.axisCtx.seriesKeyProperties()];this.updateSelections(l),!(!this.snap&&this.activeHighlight)&&(this.updateLines(),this.updateLabels(l),!(this.snap&&!this.activeHighlightInViewport)&&this.refreshPositions())}updateSelections(t){this.lineGroupSelection.update(t,void 0,e=>e)}updateLabels(t){const{labels:e,ctx:i}=this;for(const n of t)this.label.enabled&&(e[n]??(e[n]=new XK(i.domManager,n,this.axisCtx.axisId))),e[n]&&this.updateLabel(e[n])}updateLabel(t){const{enabled:e,xOffset:i,yOffset:n,format:s,renderer:a}=this.label;t.enabled=e,t.xOffset=i,t.yOffset=n,t.format=s,t.renderer=a}updateLines(){const{lineGroupSelection:t,bounds:e,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,axisLayout:r}=this;if(!r)return;const l=this.isVertical();t.each(c=>{c.stroke=i,c.strokeWidth=n,c.strokeOpacity=s,c.lineDash=a,c.lineDashOffset=o,c.y1=0,c.y2=l?e.height:0,c.x1=0,c.x2=l?0:e.width})}isVertical(){return this.axisCtx.direction===z.X}isHover(t){return t.type==="mousemove"||t.type==="click"||t.device==="touch"&&this.ctx.chartService.touch.dragAction==="hover"}formatValue(t){return ce(this.axisCtx.formatScaleValue(t,"crosshair",this.label))}onClick(t){t.device==="touch"&&this.onMouseHoverLike(t)}onMouseHoverLike(t){if(!this.enabled||this.snap)return;const e=this.isHover(t)?Ph.Hoverable|Ph.Frozen:Ph.AnnotationsMoveable;this.ctx.interactionManager.isState(e)&&(this.updatePositions(this.getData(t)),this.crosshairGroup.visible=!0,this.ctx.eventsHub.emit("chart:request-update",{type:Ct.SCENE_RENDER}))}onMouseOut(){const t=this.snap?Ph.Hoverable:Ph.Hoverable|Ph.Frozen;this.ctx.interactionManager.isState(t)&&(this.hideCrosshairs(),this.ctx.eventsHub.emit("chart:request-update",{type:Ct.SCENE_RENDER}))}onKeyPress(){this.enabled&&!this.snap&&this.ctx.interactionManager.isState(Ph.Default)&&this.hideCrosshairs()}onHighlightChange(t){if(!this.enabled)return;const{crosshairGroup:e,axisCtx:i}=this,{datum:n,series:s}=t.currentHighlight??{},a=n&&(s?.axes.x?.id===i.axisId||s?.axes.y?.id===i.axisId);if(this.activeHighlight=a?t.currentHighlight:void 0,this.activeHighlightInViewport=t.highlightInViewport,!this.activeHighlight)this.hideCrosshairs();else if(this.snap)if(t.highlightInViewport){const o=this.getActiveHighlightData(this.activeHighlight);this.updatePositions(o),e.visible=!0}else this.hideCrosshairs();this.ctx.eventsHub.emit("chart:request-update",{type:Ct.SCENE_RENDER})}isInRange(t){return this.axisCtx.inRange(t)}refreshPositions(){this.activeHighlight&&this.updatePositions(this.getActiveHighlightData(this.activeHighlight))}updatePositions(t){const{seriesRect:e,lineGroupSelection:i}=this;i.each((n,s)=>{const a=t[s];if(!a){n.visible=!1,this.hideLabel(s);return}n.visible=!0;const{value:o,position:r}=a;let l=0,c=0;this.isVertical()?(l=r,n.x=Math.round(l)):(c=r,n.y=Math.round(c)),this.label.enabled?this.showLabel(l+e.x,c+e.y,o,s):this.hideLabel(s)})}getData(t){const{axisCtx:e}=this,i="pointer",{xKey:n="",yKey:s=""}=this.activeHighlight??{},{currentX:a,currentY:o}=t,r=FM(this.activeHighlight),l=this.isVertical(),c=l?a:o;let u=r?.[l?n:s]??"";return e.continuous&&(u=e.scaleInvert(c)),{[i]:{position:c,value:u}}}getActiveHighlightData(t){const{axisCtx:e}=this,{series:i,xKey:n="",aggregatedValue:s,cumulativeValue:a,midPoint:o}=t,r=FM(t),l=i.getKeyProperties(e.direction),c=(e.scale.bandwidth??0)/2,u=i.axes[e.direction]?.id===e.axisId,d=l.includes("yKey")&&u,g=l.includes("xKey")&&u,f=s??a;if(d&&f!==void 0){const x=e.scale.convert(f)+c;return this.isInRange(x)?{yKey:{value:f,position:x}}:{}}if(g){const x=(this.isVertical()?o?.x:o?.y)??0,S=e.continuous?e.scaleInvert(x):r?.[n];return this.isInRange(x)?{xKey:{value:S,position:x}}:{}}const y={};for(const x of l){const S=i.properties[x],D=r?.[S],A=e.scale.convert(D)+c;this.isInRange(A)&&(y[x]={value:D,position:A})}return y}getLabelHtml(t,e){const i=this.axisLayout?.label?.fractionDigits??0,n={text:this.formatValue(t)};return this.label.renderer?e.toLabelHtml(this.label.renderer({value:t,fractionDigits:i}),n):e.toLabelHtml(n)}showLabel(t,e,i,n){if(!this.axisLayout)return;const{bounds:s}=this,a=this.labels[n],o=this.getLabelHtml(i,a);a.setLabelHtml(o);const r=this.axisCtx.position;let l=this.axisLayout.label.spacing+this.axisLayout.tickSize;if(this.axisCtx.direction===z.X){l-=4;const c=r==="bottom";a.show({x:t,y:c?s.y+s.height+l:s.y-l,translateX:"-50%",translateY:c?"0":"-100%"})}else{l-=8;const c=r==="right";a.show({x:c?s.x+s.width+l:s.x-l,y:e,translateX:c?"0":"-100%",translateY:"-50%"})}}hideCrosshairs(){this.crosshairGroup.visible=!1;for(const t of Object.keys(this.labels))this.hideLabel(t)}hideLabel(t){this.labels[t]?.toggle(!1)}};Fl.className="Crosshair";M([b],Fl.prototype,"enabled");M([b],Fl.prototype,"stroke");M([b],Fl.prototype,"lineDash");M([b],Fl.prototype,"lineDashOffset");M([b],Fl.prototype,"strokeWidth");M([b],Fl.prototype,"strokeOpacity");M([b],Fl.prototype,"snap");M([b],Fl.prototype,"label");var $ot={type:"axis:plugin",name:"crosshair",chartType:"cartesian",enterprise:!0,version:oi,themeTemplate:{enabled:{$if:[{$or:[{$eq:[{$path:"../type"},"number"]},{$eq:[{$path:"../type"},"log"]},{$eq:[{$path:"../type"},"time"]},{$eq:[{$path:"../type"},"unit-time"]},{$eq:[{$path:"../type"},"ordinal-time"]}]},!0,!1]},snap:!0,stroke:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1,lineDash:[5,6],lineDashOffset:0,label:{enabled:!0}},create:t=>new Fl(t)},rv=class extends Ln{constructor(t){super(),this.enabled=!0,this.getData=()=>Promise.resolve(),this.dataService=t.dataService;let e=!1;this.cleanup.register(t.eventsHub.on("data:load",()=>{e=!0}),t.eventsHub.on("layout:complete",()=>{e&&t.zoomManager.updateZoom({source:"data-update",sourceDetail:"dataSource"})}))}updateCallback(t,e){this.dataService&&(t&&e!=null?this.dataService.updateCallback(e):this.dataService.clearCallback())}};M([Pe({newValue(t){this.updateCallback(t,this.getData)}}),b],rv.prototype,"enabled");M([Pe({newValue(t){this.updateCallback(this.enabled,t)}}),b],rv.prototype,"getData");M([Pe({newValue(t){this.dataService.requestThrottle=t}})],rv.prototype,"requestThrottle");M([Pe({newValue(t){this.dataService.dispatchThrottle=t}})],rv.prototype,"updateThrottle");M([Pe({newValue(t){this.dataService.dispatchOnlyLatest=!t}})],rv.prototype,"updateDuringInteraction");Mt(X),Mt(X),Mt(J);var{BBox:Uh}=j,Xot=class{constructor(t){this.components=t,this.union=Uh.merge(t)}containsPoint(t,e){if(!this.union.containsPoint(t,e))return!1;for(const i of this.components)if(i.containsPoint(t,e))return!0;return!1}};(class extends j.Group{constructor(){super(),this.capLength=Number.NaN,this._datum=void 0,this.whiskerPath=new j.Path,this.capsPath=new j.Path,this.bboxes=new Xot([]),this.append([this.whiskerPath,this.capsPath])}get datum(){return this._datum}set datum(t){this._datum=t}calculateCapLength(t,e){const{lengthRatio:i=1,length:n}=t,{lengthRatioMultiplier:s,lengthMax:a}=e,o=n??i*s;return Math.min(o,a)}getItemStylerParams(t,e,i,n){const{datum:s}=this;if(s==null||t.itemStyler==null)return;const{xLowerKey:a,xUpperKey:o,yLowerKey:r,yUpperKey:l}=t;return{...e,datum:s.datum,seriesId:s.series.id,xKey:s.xKey,yKey:s.yKey,xLowerKey:a,xUpperKey:o,yLowerKey:r,yUpperKey:l,highlighted:i,highlightState:n}}formatStyles(t,e,i,n,s){let{cap:a,...o}=t;const r=this.getItemStylerParams(e,t,n,s);if(r!=null&&e.itemStyler!=null){const l=i.callWithContext(e.itemStyler,r);o=Et(l,o),a=Et(l?.cap,l,a)}return{whiskerStyle:o,capsStyle:a}}applyStyling(t,e){rM(["visible","stroke","strokeWidth","strokeOpacity","lineDash","lineDashOffset"],t,e)}update(t,e,i,n,s){if(this.datum===void 0)return;const{whiskerStyle:a,capsStyle:o}=this.formatStyles(t,e,i,n,s),{xBar:r,yBar:l,capDefaults:c}=this.datum,u=this.whiskerPath;this.applyStyling(u,a),u.path.clear(!0),l!==void 0&&(u.path.moveTo(l.lowerPoint.x,l.lowerPoint.y),u.path.lineTo(l.upperPoint.x,l.upperPoint.y)),r!==void 0&&(u.path.moveTo(r.lowerPoint.x,r.lowerPoint.y),u.path.lineTo(r.upperPoint.x,r.upperPoint.y)),u.path.closePath(),this.capLength=this.calculateCapLength(o??{},c);const d=this.capLength/2,g=this.capsPath;this.applyStyling(g,o),g.path.clear(!0),l!==void 0&&(g.path.moveTo(l.lowerPoint.x-d,l.lowerPoint.y),g.path.lineTo(l.lowerPoint.x+d,l.lowerPoint.y),g.path.moveTo(l.upperPoint.x-d,l.upperPoint.y),g.path.lineTo(l.upperPoint.x+d,l.upperPoint.y)),r!==void 0&&(g.path.moveTo(r.lowerPoint.x,r.lowerPoint.y-d),g.path.lineTo(r.lowerPoint.x,r.lowerPoint.y+d),g.path.moveTo(r.upperPoint.x,r.upperPoint.y-d),g.path.lineTo(r.upperPoint.x,r.upperPoint.y+d)),g.path.closePath()}updateBBoxes(){const{capLength:t,whiskerPath:e,capsPath:i}=this,{yBar:n,xBar:s}=this.datum??{},a=t/2,o=[];if(n!==void 0){const r=n.lowerPoint.y-n.upperPoint.y;o.push(new Uh(n.lowerPoint.x,n.upperPoint.y,e.strokeWidth,r),new Uh(n.lowerPoint.x-a,n.lowerPoint.y,t,i.strokeWidth),new Uh(n.upperPoint.x-a,n.upperPoint.y,t,i.strokeWidth))}if(s!==void 0){const r=s.upperPoint.x-s.lowerPoint.x;o.push(new Uh(s.lowerPoint.x,s.upperPoint.y,r,e.strokeWidth),new Uh(s.lowerPoint.x,s.lowerPoint.y-a,i.strokeWidth,t),new Uh(s.upperPoint.x,s.upperPoint.y-a,i.strokeWidth,t))}this.bboxes.components=o,this.bboxes.union=Uh.merge(o)}containsPoint(t,e){return this.bboxes.containsPoint(t,e)}pickNode(t,e){return this.containsPoint(t,e)?this:void 0}nearestSquared(t,e,i){const{bboxes:n}=this;if(n.union.distanceSquared(t,e)>i)return{nearest:void 0,distanceSquared:1/0};const{distanceSquared:s}=Tx(t,e,n.components);return{nearest:this,distanceSquared:s}}});(class extends j.Group{nearestSquared(t,e){const{nearest:i,distanceSquared:n}=Mj(t,e,{children:this.children()});if(i!==void 0&&!Number.isNaN(n))return{datum:i.datum,distanceSquared:n}}});var qc=class extends xt{};M([b],qc.prototype,"visible");M([b],qc.prototype,"stroke");M([b],qc.prototype,"strokeWidth");M([b],qc.prototype,"strokeOpacity");M([b],qc.prototype,"lineDash");M([b],qc.prototype,"lineDashOffset");M([b],qc.prototype,"length");M([b],qc.prototype,"lengthRatio");var Js=class extends xt{constructor(){super(...arguments),this.visible=!0,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.cap=new qc}};M([b],Js.prototype,"yLowerKey");M([b],Js.prototype,"yLowerName");M([b],Js.prototype,"yUpperKey");M([b],Js.prototype,"yUpperName");M([b],Js.prototype,"xLowerKey");M([b],Js.prototype,"xLowerName");M([b],Js.prototype,"xUpperKey");M([b],Js.prototype,"xUpperName");M([b],Js.prototype,"visible");M([b],Js.prototype,"stroke");M([b],Js.prototype,"strokeWidth");M([b],Js.prototype,"strokeOpacity");M([b],Js.prototype,"lineDash");M([b],Js.prototype,"lineDashOffset");M([b],Js.prototype,"itemStyler");M([b],Js.prototype,"cap");var{fixNumericExtent:fbt,groupAccumulativeValueProperty:mbt,valueProperty:ybt}=j,{Group:Zot,Rect:S_,Selection:qot,TranslatableGroup:Qot}=j,M_=2,D_=1,Jot=2,trt=1e-6,A_={remove:0,update:1,add:2};function ert(t,e,i,n){for(const s of e)!t.has(s)&&!n?.has(s)&&t.set(s,i)}function irt(t,e){const i=new Map;for(const n of t.flatMap(s=>Object.values(s))){const s=e?n.moved:void 0;ert(i,n.updated,"update",s);for(const a of n.removed)i.set(a,"remove");for(const a of n.added)i.set(a,"add")}return i}function nrt(t){for(const e of[z.X,z.Y])for(const i of t.axisManager.getAxisContext(e))if(j.BandScale.is(i.scale))return i}function srt(t,e){return e>0&&t>0&&e/t{const u=A_[l.phase]-A_[c.phase];return u==0?l.bounds[n]-c.bounds[n]:u}),o=[a[0]];let r=o[0];for(let l=1;lnew S_({name:"flash-on-update-band"})),this.cleanup.register(this.ctx.scene.attachNode(this.flashGroup),this.ctx.eventsHub.on("layout:complete",e=>this.onLayoutComplete(e)),this.ctx.eventsHub.on("datamodel:diff",e=>this.onDataModelDiff(e)),this.ctx.updateService.addListener("pre-scene-render",e=>this.onPreSceneRender(e)))}destroy(){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.cleanup.flush()}onLayoutComplete({chart:t,series:e}){this.enabled&&(this.chartFlashRect.x=0,this.chartFlashRect.y=0,this.chartFlashRect.width=t.width,this.chartFlashRect.height=t.height,this.seriesRect=e.rect.clone(),this.bandGroup.translationX=Math.round(this.seriesRect.x),this.bandGroup.translationY=Math.round(this.seriesRect.y),this.bandGroup.setClipRect(this.seriesRect),this.axisCtx=nrt(this.ctx))}resolveDomainValue(t){const e=this.axisCtx?.scale.domain;if(!e?.length||!Array.isArray(e[0]))return t;for(const i of e)if(String(i)===t)return i;return t}onDataModelDiff({diff:t}){this.enabled&&(this.pendingDiffs.push(t),this.item==="category"&&this.cachePreviousBounds(t))}onPreSceneRender({apiUpdate:t}){const e=this.pendingDiffs.length>0;if(!this.enabled||!t){this.pendingDiffs.length=0;return}if(!e)return;const i=this.pendingDiffs.some(o=>Object.values(o).some(r=>r.changed)),n=this.ctx.animationManager.isSkipped(),s=i?irt(this.pendingDiffs,n):void 0;if(this.pendingDiffs.length=0,!i)return;this.stopFlash();const a=s!=null&&s.size>0;this.item==="category"&&a?this.flashCategoryBands(s):this.flashChart()}flashChart(){!this.chartFlashRect.width||!this.chartFlashRect.height||(this.chartFlashRect.fill=this.fill,this.chartFlashRect.fillOpacity=0,this.animate([this.chartFlashRect],"update"))}cacheBounds(t){const e=this.measureBandBounds(t);e&&(this.previousBoundsCache??(this.previousBoundsCache=new Map),this.previousBoundsCache.set(t,e))}cachePreviousBounds(t){let e=!1;for(const i of Object.values(t)){(i.added.size>0||i.removed.size>0)&&(e=!0);for(const n of[...i.removed,...i.updated,...i.moved])this.cacheBounds(n)}if(e)for(const i of this.axisCtx?.scale.domain??[])this.previousBoundsCache?.has(String(i))||this.cacheBounds(String(i))}measureBandBounds(t){if(!this.axisCtx||!this.seriesRect)return;const e=this.axisCtx.measureBand(this.resolveDomainValue(t))?.band;if(!e)return;const[i,n]=e,s=Math.max(n-i,D_);return this.axisCtx.direction===z.X?{x:i,y:0,width:s,height:this.seriesRect.height}:{x:0,y:i,width:this.seriesRect.width,height:s}}flashCategoryBands(t){const e=this.ctx.animationManager.isSkipped();if(e)for(const[n,s]of t)s==="remove"&&t.delete(n);if(!e&&this.hasScaleChange(t)){const n=this.axisCtx?.scale.domain??[];for(const s of n){const a=String(s);t.has(a)||t.set(a,"update")}}const i=this.createBandFlashData(t);i&&(this.updateSelection(i,e),this.animateBands())}hasScaleChange(t){for(const e of t.values())if(e==="add"||e==="remove")return!0;return!1}createBandFlashData(t){if(!this.axisCtx||!this.seriesRect){pt.warnOnce("flashOnUpdate item 'category' requires a cartesian category based axis such as 'category', 'ordinal-time', 'unit-time'");return}const{direction:e}=this.axisCtx,i=this.axisCtx.scale,n=e===z.X,s=n?this.seriesRect.width:this.seriesRect.height,a=this.measureBandsBatch(i,t,n);if(this.previousBoundsCache=void 0,a.length!==0)return art(a,n,s)}measureBandsBatch(t,e,i){const n=t.bandwidth??0,a=((t.step??0)-n)/2,[o,r]=t.range,l=Math.min(o,r),c=Math.max(o,r),u=(i?this.seriesRect?.height:this.seriesRect?.width)??0,d=[];for(const[g,f]of e){if(f==="remove"){const w=this.previousBoundsCache?.get(g);w&&d.push({firstKey:g,lastKey:g,bounds:w,phase:f});continue}const y=t.convert(this.resolveDomainValue(g)),x=Math.max(y-a,l),S=Math.min(y+n+a,c),D=Math.max(S-x,D_),A=i?{x,y:0,width:D,height:u}:{x:0,y:x,width:u,height:D},I=this.previousBoundsCache?.get(g);d.push({firstKey:g,lastKey:g,bounds:A,prevBounds:I,phase:f})}return d}updateSelection(t,e){this.bandSelection.update(t),this.bandSelection.each((i,n)=>{const s=e?n.bounds:n.prevBounds??n.bounds;i.fill=this.fill,i.fillOpacity=0,i.x=s.x,i.y=s.y,i.width=s.width,i.height=s.height})}animateBands(){const t=Array.from(this.bandSelection.nodes());if(this.ctx.animationManager.isSkipped()){this.animate(t,"update");return}const e=[],i=[],n=[];for(const s of t)s.datum.phase==="remove"?e.push(s):s.datum.phase==="add"?n.push(s):i.push(s);this.animate(e,"remove"),this.animate(i,"update"),this.animate(n,"add")}stopFlash(){this.ctx.animationManager.stopByAnimationGroupId(this.id)}animate(t,e){if(t.length===0)return;const{animationManager:i}=this.ctx,n=this.getCustomTiming(e),s=n?.duration,a=n?.ease;i.animate({id:`${this.id}_${e}`,groupId:this.id,forceAnimation:!0,phase:e,duration:s,ease:a,from:{fillOpacity:this.fillOpacity},to:{fillOpacity:0},onUpdate:({fillOpacity:o},r)=>{if(!r)for(const l of t)l.fillOpacity=o},onStop:()=>{for(const o of t)o.fillOpacity=0}}),e==="update"&&!i.isSkipped()&&i.animate({id:`${this.id}_${e}_position`,groupId:this.id,forceAnimation:!0,phase:e,ease:Lc,from:{t:0},to:{t:1},onUpdate:({t:o},r)=>{if(!r)for(const l of t){const c=l.datum?.prevBounds;if(c){const u=l.datum.bounds;l.x=c.x+(u.x-c.x)*o,l.y=c.y+(u.y-c.y)*o,l.width=c.width+(u.width-c.width)*o,l.height=c.height+(u.height-c.height)*o}}}})}getCustomTiming(t){const{flashDuration:e,fadeOutDuration:i}=this;if(e==null&&i==null)return;const{animationManager:n}=this.ctx,{defaultDuration:s}=n,a=e??0,r=a+(i??0);if(r<=0)return;let l;if(n.isSkipped())l=Math.min(r,M_*s)/s;else{const u=j.PHASE_METADATA[t].animationDuration;l=Math.min(r/s,M_)*u}const c=a/r;return{duration:l,ease:c>=1?()=>0:u=>u<=c?0:(u-c)/(1-c)}}};Hp.className="FlashOnUpdate";M([b],Hp.prototype,"enabled");M([b],Hp.prototype,"item");M([b],Hp.prototype,"fill");M([b],Hp.prototype,"fillOpacity");M([b],Hp.prototype,"flashDuration");M([b],Hp.prototype,"fadeOutDuration");fx()("chart","category");var{TranslatableGroup:ort}=j,CO=class extends ort{constructor(){super(...arguments),this.inset=0,this.cornerRadius=0}applyClip(t,e){const{cornerRadius:i,inset:n}=this,{x:s,y:a,width:o,height:r}=e;t.beginPath(),t.roundRect(s+n,a+n,o-2*n,r-2*n,i),t.clip()}};M([ut()],CO.prototype,"inset");M([ut()],CO.prototype,"cornerRadius");var{CategoryAxis:rrt,Group:Od,BBox:k_,stackCartesianSeries:lrt}=j,wO=class{constructor(){this.top=0,this.bottom=0}};M([b],wO.prototype,"top");M([b],wO.prototype,"bottom");var wm=class extends Ln{constructor(t){super(),this.ctx=t,this.enabled=!1,this.padding=new wO,this.root=new Od({name:"root"}),this.seriesRoot=this.root.appendChild(new CO({name:"Series-root",zIndex:pe.SERIES_LAYER,renderToOffscreenCanvas:!0})),this.axisGridGroup=this.root.appendChild(new Od({name:"Axes-Grids",zIndex:pe.AXIS_GRID})),this.axisGroup=this.root.appendChild(new Od({name:"Axes-Grids",zIndex:pe.AXIS_GRID})),this.axisLabelGroup=this.root.appendChild(new Od({name:"Axes-Labels",zIndex:pe.SERIES_LABEL})),this.axisCrosslineRangeGroup=this.root.appendChild(new Od({name:"Axes-Crosslines-Range",zIndex:pe.SERIES_CROSSLINE_RANGE})),this.axisCrosslineLineGroup=this.root.appendChild(new Od({name:"Axes-Crosslines-Line",zIndex:pe.SERIES_CROSSLINE_LINE})),this.axisCrosslineLabelGroup=this.root.appendChild(new Od({name:"Axes-Crosslines-Label",zIndex:pe.SERIES_LABEL})),this.data=[],this._destroyed=!1,this.miniChartAnimationPhase="initial",this.seriesRect=void 0,this.axes=new j.ChartAxes,this.series=[],this.cleanup.register(this.ctx.eventsHub.on("data:update",e=>this.updateData(e)))}destroy(){this._destroyed||(super.destroy(),this.destroySeries(this.series),this.axes.destroy(),this._destroyed=!0)}onSeriesChange(t,e){const i=e?.filter(n=>!t.includes(n))??[];this.destroySeries(i);for(const n of t)e?.includes(n)||(n.attachSeries(this.seriesRoot,this.seriesRoot,void 0),n.chart={},Object.defineProperty(n.chart,"mode",{get:()=>"standalone"}),Object.defineProperty(n.chart,"isMiniChart",{get:()=>!0}),Object.defineProperty(n.chart,"flashOnUpdateEnabled",{get:()=>!1}),Object.defineProperty(n.chart,"seriesRect",{get:()=>this.seriesRect}),n.resetAnimation(this.miniChartAnimationPhase==="initial"?"initial":"disabled"));this.seriesRect=void 0}destroySeries(t){if(t)for(const e of t)e.destroy(),e.detachSeries(this.seriesRoot,this.seriesRoot,void 0),e.chart=void 0}assignSeriesToAxes(){for(const t of this.axes)t.boundSeries=this.series.filter(e=>e.axes[t.direction]===t)}assignAxesToSeries(){const t={};for(const e of this.axes){const i=e.direction;(t[i]??(t[i]=[])).push(e)}for(const e of this.series)for(const i of e.directions){const n=e.getKeyAxis(i)??i,s=this.axes.findById(n);if(!s){pt.warnOnce(`no matching axis for direction [${i}] and id [${n}]; check series and axes configuration.`);return}e.axes[i]=s}}updateData(t){for(const e of this.series)e.setChartData(t);this.miniChartAnimationPhase==="initial"&&this.ctx.animationManager.onBatchStop(()=>{this.miniChartAnimationPhase="ready";for(const e of this.series)e.resetAnimation("disabled")})}async processData(t){this.series.some(e=>e.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes()),await Promise.all(this.series.map(async e=>(e.resetDatumCallbackCache(),e.processData(t))));for(const e of this.axes)e.processData()}computeAxisPadding(){const t=new zu;if(!this.enabled)return t;for(const{position:e,thickness:i,line:n,label:s}of this.axes){if(e==null)continue;let a;i?a=i:a=(n.enabled?n.width:0)+(s.enabled?nr(s.fontSize??0)+s.spacing:0),t[e]=Math.ceil(a)}return t}async layout(t,e){var i;const{padding:n}=this,s=this.seriesRect!=null,a=new k_(0,0,t,e-(n.top+n.bottom)),o=this.seriesRect?.width!==t||this.seriesRect?.height!==e;this.seriesRect=a,this.seriesRoot.translationY=n.top,this.seriesRoot.setClipRectCanvasSpace(new k_(0,-n.top,t,e));for(const r of this.axes){const{position:l="left"}=r;switch(l){case"top":case"bottom":r.range=[0,a.width],r.gridLength=a.height;break;case"right":case"left":{const c=r instanceof rrt;r.range=c?[0,a.height]:[a.height,0],r.gridLength=a.width;break}}if(r.gridPadding=0,r.translation.x=0,r.translation.y=0,l==="right"?r.translation.x=t:l==="bottom"&&(r.translation.y=e),s||r.resetAnimation("initial"),r.crossLines)for(const c of r.crossLines)c instanceof j.CartesianCrossLine&&(c.position=r.position??"top",(i=c.label).parallel??(i.parallel=r.label?.parallel));r.calculateLayout(),r.update()}o&&lrt(this.series),await Promise.all(this.series.map(async r=>r.update({seriesRect:a})))}};M([b],wm.prototype,"enabled");M([qi(["seriesRoot","inset"])],wm.prototype,"inset");M([qi(["seriesRoot","cornerRadius"])],wm.prototype,"cornerRadius");M([Pe({changeValue(t,e=new j.ChartAxes){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const n of e)t.includes(n)||(n.detachAxis(),n.destroy());for(const n of t)e?.includes(n)||n.attachAxis(i)}})],wm.prototype,"axes");M([Pe({changeValue(t,e){this.onSeriesChange(t,e)}})],wm.prototype,"series");var{SliderWidget:C_}=j,crt=class{constructor(t,e){this.ctx=t,this.sliderHandlers=e,this._min=0,this._max=1,this.minRange=.001,this.dragStartX=0,this.ctx=t,this.toolbar=t.proxyInteractionService.createProxyContainer({type:"toolbar",domManagerId:"navigator-toolbar",classList:["ag-charts-proxy-navigator-toolbar"],orientation:"vertical",ariaLabel:{id:"ariaLabelNavigator"}}),this.sliders=[t.proxyInteractionService.createProxyElement({type:"slider",domIndex:1,ariaLabel:{id:"ariaLabelNavigatorMinimum"},parent:this.toolbar,cursor:"ew-resize"}),t.proxyInteractionService.createProxyElement({type:"slider",domIndex:-1/0,ariaLabel:{id:"ariaLabelNavigatorRange"},parent:this.toolbar,cursor:"grab"}),t.proxyInteractionService.createProxyElement({type:"slider",domIndex:2,ariaLabel:{id:"ariaLabelNavigatorMaximum"},parent:this.toolbar,cursor:"ew-resize"})];for(const[i,n]of["min","pan","max"].entries()){const s=this.sliders[i];s.step=C_.STEP_HUNDRETH,s.keyboardStep=C_.STEP_ONE,s.orientation="horizontal",s.setPreventsDefault(!1),s.addListener("focus",()=>this.clearFocusOverride(s)),s.addListener("keydown",()=>this.clearFocusOverride(s)),s.addListener("drag-start",a=>this.onDragStart(i,a,n)),s.addListener("drag-move",a=>this.onDrag(s,a,n)),s.addListener("drag-end",()=>this.updateSliderRatios()),s.addListener("contextmenu",a=>this.onContextMenu(s,a))}this.sliders[0].addListener("change",()=>this.onMinSliderChange()),this.sliders[1].addListener("change",()=>this.onPanSliderChange()),this.sliders[2].addListener("change",()=>this.onMaxSliderChange()),this.updateSliderRatios(),this.updateVisibility(!1)}destroy(){this.toolbar.destroy()}updateVisibility(t){this.toolbar.setHidden(!t)}updateZoom(){const{_min:t,_max:e}=this;t==null||e==null||this.ctx.zoomManager.updateZoom({source:"user-interaction",sourceDetail:"navigatorDOM"},{x:{min:t,max:e}})}updateBounds(t){this.toolbar.setBounds(t)}updateSliderBounds(t,e){this.sliders[t].setBounds(e)}updateMinMax(t,e){this._min=t,this._max=e,this.updateSliderRatios()}updateSliderRatios(){let{_min:t,_max:e}=this;t=Math.round(t*100)/100,e=Math.round(e*100)/100;const i=this.ctx.localeManager.t("ariaValuePanRange",{min:t,max:e});this.sliders[0].setValueRatio(t),this.sliders[1].setValueRatio(t,{ariaValueText:i}),this.sliders[2].setValueRatio(e)}toCanvasOffsets(t){return{offsetX:this.dragStartX+t.originDeltaX}}moveToFront(t){if(t===1)return;const e=this.sliders[t],i=this.sliders[2-t];this.toolbar.moveChild(i,e.domIndex-1)}clearFocusOverride(t){t.setFocusOverride(void 0)}onDragStart(t,e,i){const n=this.sliders[t],s=this.toolbar.cssLeft(),a=n.cssLeft();this.dragStartX=s+a+e.offsetX,this.moveToFront(t),e.sourceEvent.preventDefault(),n.focus(),n.setFocusOverride(!1),this.sliderHandlers.onDragStart(i,this.toCanvasOffsets(e))}onDrag(t,e,i){e.sourceEvent.preventDefault(),this.sliderHandlers.onDrag(i,this.toCanvasOffsets(e))}onContextMenu(t,e){const{offsetX:i,offsetY:n}=e,{x:s,y:a}=this.toolbar.getBounds(),{x:o,y:r}=t.getBounds(),l=i+s+o,c=n+a+r;this.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:e,canvasX:l,canvasY:c},void 0)}onPanSliderChange(){const t=this.sliders[1].getValueRatio(),e=this._max-this._min;this._min=Nt(0,t,1-e),this._max=this._min+e,this.updateZoom()}onMinSliderChange(){this._min=this.sliders[0].clampValueRatio(0,this._max-this.minRange),this.updateZoom()}onMaxSliderChange(){this._max=this.sliders[2].clampValueRatio(this._min+this.minRange,1),this.updateZoom()}},{BBox:hrt,ExtendedPath2D:urt}=j,fu=class extends j.Path{constructor(){super(...arguments),this.zIndex=3,this.centerX=0,this.centerY=0,this.width=8,this.height=16,this.cornerRadius=4,this.grip=!0,this.gripPath=new urt}setCenter(t,e){this.dirtyPath=!0,(this.centerX!==t||this.centerY!==e)&&(this.centerX=t,this.centerY=e,this.markDirty("center"))}static align(t,e,i,n,s,a,o,r,l){const c=t.align(i+s*o)+l,u=c+t.align(i+s*o,s*(r-o))-2*l,d=t.align(n+a/2);t.setCenter(c,d),e.setCenter(u,d)}computeBBox(){const{centerX:t,centerY:e,width:i,height:n}=this,s=t-i/2,a=e-n/2;return new hrt(s,a,i,n)}isPointInPath(t,e){return this.getBBox().containsPoint(t,e)}updatePath(){const{centerX:t,centerY:e,path:i,gripPath:n,strokeWidth:s,cornerRadius:a,grip:o}=this,r=s/2,l=this.layerManager?.canvas?.pixelRatio??1;i.clear(),n.clear();const c=Math.floor(this.width/2*l)/l,u=Math.floor(this.height/2*l)/l;i.roundRect(t-c+r,e-u+r,2*(c-r),2*(u-r),a);const d=3;if(o)for(let g=-.5;g<=.5;g+=1)for(let f=-1;f<=1;f+=1)n.arc(t+g*d,e+f*d,1,0,2*Math.PI),n.closePath()}renderFill(t,e){const{stroke:i}=this;super.renderFill(t,e),t.fillStyle=typeof i=="string"?i:"black",t.fill(this.gripPath.getPath2D())}};fu.className="RangeHandle";M([b,ut()],fu.prototype,"width");M([b,ut()],fu.prototype,"height");M([b,ut()],fu.prototype,"cornerRadius");M([b,ut()],fu.prototype,"grip");var{Path:drt,BBox:uw,ExtendedPath2D:prt,clippedRoundRect:grt}=j,NO=class extends drt{constructor(){super(...arguments),this.cornerRadius=4,this.zIndex=2,this.x=0,this.y=0,this.width=200,this.height=30,this.min=0,this.max=1,this.visiblePath=new prt}layout(t,e,i,n,s,a){s=Number.isNaN(s)?this.min:s,a=Number.isNaN(a)?this.max:a,(t!==this.x||e!==this.y||i!==this.width||this.height!==n||s!==this.min||a!==this.max)&&(this.x=t,this.y=e,this.width=i,this.height=n,this.min=s,this.max=a,this.dirtyPath=!0,this.markDirty("RangeMask.layout"))}computeBBox(){const{x:t,y:e,width:i,height:n}=this;return new uw(t,e,i,n)}computeVisibleRangeBBox(){const{x:t,y:e,width:i,height:n,min:s,max:a}=this,o=t+i*s,r=t+i*a;return new uw(o,e,r-o,n)}updatePath(){const{path:t,visiblePath:e,x:i,y:n,width:s,height:a,min:o,max:r,strokeWidth:l,cornerRadius:c}=this,u=l/2;t.clear(),e.clear();const d=this.align(i)+u,g=this.align(n)+u,f=this.align(i,s)-2*u,y=this.align(n,a)-2*u,x=this.align(i+s*o)+u,S=x+this.align(i+s*o,s*(r-o))-2*u,D={topLeft:c,topRight:c,bottomRight:c,bottomLeft:c},A=(I,w,N)=>{if(N-w<1)return;const O=new uw(w,g,N-w,y);grt(I,d,g,f,y,D,O)};A(t,d,x),A(t,S,f+d),A(e,x,S)}renderStroke(t,e){super.renderStroke(t,e),super.renderStroke(t,this.visiblePath.getPath2D())}};NO.className="RangeMask";M([b,ut()],NO.prototype,"cornerRadius");var frt=class extends j.Group{constructor(t){super({name:"rangeSelectorGroup",zIndex:pe.NAVIGATOR}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.background=this.appendChild(new j.TranslatableGroup({name:"navigator-background",zIndex:1})),this.append(t)}layout(t,e,i,n,s,a){this.x=t,this.y=e,this.width=i,this.height=n,this.lOffset=s,this.rOffset=a,this.background.translationX=t,this.background.translationY=e,this.markDirty("RangeSelector")}updateBackground(t,e){t?.remove(),e!=null&&this.background.appendChild(e),this.markDirty("RangeSelector")}computeBBox(){const{x:t,y:e,width:i,height:n,lOffset:s,rOffset:a}=this;return new j.BBox(t-s,e,i+(s+a),n)}},lv=class extends Ln{constructor(t){super(),this.ctx=t,this.enabled=!1,this.mask=new NO,this.minHandle=new fu,this.maxHandle=new fu,this.maskVisibleRange={id:"navigator-mask-visible-range",getBBox:()=>this.mask.computeVisibleRangeBBox(),toCanvasBBox:()=>this.mask.computeVisibleRangeBBox(),fromCanvasPoint:(e,i)=>({x:e,y:i})},this.height=30,this.cornerRadius=0,this.spacing=10,this.x=0,this.y=0,this.width=0,this.rangeSelector=new frt([this.mask,this.minHandle,this.maxHandle]),this.cleanup.register(t.scene.attachNode(this.rangeSelector),t.eventsHub.on("locale:change",()=>this.updateZoom()),t.layoutManager.registerElement(j.LayoutElement.Navigator,e=>this.onLayoutStart(e)),t.eventsHub.on("layout:complete",e=>this.onLayoutComplete(e)),t.eventsHub.on("zoom:change-complete",e=>this.onZoomChange(e))),this.domProxy=new crt(t,this),this.updateGroupVisibility(),this.miniChart=new wm(t)}updateBackground(t,e){this.rangeSelector?.updateBackground(t,e)}updateGroupVisibility(){const{enabled:t}=this;this.rangeSelector==null||t===this.rangeSelector.visible||(this.rangeSelector.visible=t,this.domProxy.updateVisibility(t),t?this.updateZoom():this.ctx.zoomManager.updateZoom({source:"chart-update",sourceDetail:"navigator"},{x:{min:0,max:1}}))}onLayoutStart({layoutBox:t}){if(this.enabled){const e=this.height+this.spacing;t.shrink(e,"bottom"),this.y=t.y+t.height+this.spacing}else this.y=0;if(this.enabled&&this.miniChart){const{top:e,bottom:i}=this.miniChart.computeAxisPadding();t.shrink(e+i,"bottom"),this.y-=i,this.miniChart.inset=this.mask.strokeWidth/2,this.miniChart.cornerRadius=this.mask.cornerRadius}}onLayoutComplete(t){const{x:e,width:i}=t.series.rect,{y:n,height:s}=this;if(this.domProxy.updateVisibility(this.enabled),this.enabled){const{_min:a,_max:o}=this.domProxy;this.layoutNodes(e,n,i,s,a,o),this.domProxy.updateBounds({x:e,y:n,width:i,height:s})}this.x=e,this.width=i,this.miniChart?.layout(i,s).catch(a=>pt.error(a))}canDrag(){return this.enabled&&this.ctx.interactionManager.isState(j.InteractionState.ZoomDraggable)}onDragStart(t,{offsetX:e}){this.canDrag()&&(t==="pan"&&(this.panStart=(e-this.x)/this.width-this.domProxy._min),this.ctx.zoomManager.fireZoomPanStartEvent("navigator"))}onDrag(t,{offsetX:e}){if(!this.canDrag())return;const{panStart:i,x:n,width:s}=this,{minRange:a}=this.domProxy;let{_min:o,_max:r}=this.domProxy;const l=(e-n)/s;if(t==="min")o=Nt(0,l,r-a);else if(t==="max")r=Nt(o+a,l,1);else if(t==="pan"&&i!=null){const c=r-o;o=Nt(0,l-i,1-c),r=o+c}this.domProxy._min=o,this.domProxy._max=r,this.updateZoom()}onZoomChange(t){const{x:e}=t;if(!e)return;const{x:i,y:n,width:s,height:a}=this,{min:o,max:r}=e;this.domProxy.updateMinMax(o,r),this.layoutNodes(i,n,s,a,o,r)}layoutNodes(t,e,i,n,s,a){const{rangeSelector:o,mask:r,minHandle:l,maxHandle:c}=this;r.layout(t,e,i,n,s,a),o.layout(t,e,i,n,l.width/2,c.width/2),fu.align(l,c,t,e,i,n,s,a,r.strokeWidth/2),s+(a-s)/2<.5?(l.zIndex=3,c.zIndex=4):(l.zIndex=4,c.zIndex=3);for(const[u,d]of[l,this.maskVisibleRange,c].entries()){const g=d.getBBox(),f={x:g.x-t,y:g.y-e,height:g.height,width:g.width};this.domProxy.updateSliderBounds(u,f)}}updateZoom(){this.enabled&&this.domProxy.updateZoom()}async processData(t){return this.miniChart?.processData(t)}};M([Bi((t,e,i)=>{t.updateBackground(i?.root,e?.root)})],lv.prototype,"miniChart");M([b,Bi((t,e)=>{t.ctx.zoomManager.setNavigatorEnabled(!!e),t.updateGroupVisibility()})],lv.prototype,"enabled");M([b],lv.prototype,"height");M([b,Bi((t,e)=>{t.mask.cornerRadius=e})],lv.prototype,"cornerRadius");M([b],lv.prototype,"spacing");function mrt(t){return{from:t?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}function yrt(t){return(e,i)=>t?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}var{Path:brt,Scalable:xrt,ExtendedPath2D:vrt,BBox:Fd,clippedRoundRect:w_}=j,Gn=class extends xrt(brt){constructor(){super(...arguments),this.wickPath=new vrt,this.horizontal=!1,this.center=0,this.thickness=0,this.min=0,this.q1=0,this.median=0,this.q3=0,this.max=0,this.cornerRadius=0,this.crisp=!1,this.strokeAlignment=0,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0,this.capLengthRatio=1,this.wickStrokeAlignment=0}computeBBox(){const{horizontal:t,center:e,thickness:i,min:n,max:s}=this;return t?new Fd(Math.min(n,s),e-i/2,Math.abs(s-n),i):new Fd(e-i/2,Math.min(n,s),i,Math.abs(s-n))}computeDefaultGradientFillBBox(){const{horizontal:t,center:e,thickness:i,q1:n,q3:s}=this;return t?new Fd(Math.min(n,s),e-i/2,Math.abs(s-n),i):new Fd(e-i/2,Math.min(n,s),i,Math.abs(s-n))}isPointInPath(t,e){return this.getBBox().containsPoint(t,e)}distanceSquared(t,e){return this.getBBox().distanceSquared(t,e)}get midPoint(){return this.horizontal?{x:(this.min+this.max)/2,y:this.center}:{x:this.center,y:(this.min+this.max)/2}}alignedCoordinates(){const{thickness:t,crisp:e}=this;let{center:i,min:n,q1:s,median:a,q3:o,max:r}=this,l=i-t/2,c=i+t/2;if(e&&t>1){n=this.align(n),s=this.align(s),a=this.align(a),o=this.align(o),r=n+this.align(n,r-n);const u=this.align(t/2);i=this.align(i),l=i-u,c=i+u}return{center:i,x0:l,x1:c,min:n,max:r,q1:s,median:a,q3:o}}updatePath(){const{path:t,stroke:e,strokeWidth:i,strokeOpacity:n,lineDash:s,lineDashOffset:a,wickStroke:o,wickStrokeWidth:r,wickStrokeOpacity:l,wickLineDash:c,wickLineDashOffset:u,strokeAlignment:d,cornerRadius:g,capLengthRatio:f,horizontal:y}=this,{center:x,x0:S,x1:D,min:A,max:I,q1:w,median:N,q3:O}=this.alignedCoordinates(),L=this.layerManager?.canvas.pixelRatio??1,R=this.wickStrokeAlignment>0?L/this.wickStrokeAlignment/2%1:0;this.path.clear(),this.wickPath.clear();const B=o!=null&&o!==e||r!=null&&r!==i||l!=null&&l!==n||c!=null&&c!==s||u!=null&&u!==a?this.wickPath:t;if(Math.abs(D-S)<=3){zg(B,y,x,A),Bg(B,y,x,I);return}const F=Math.min(A,I),H=Math.max(A,I),$=Math.min(w,O),Y=Math.max(w,O),U=x-Math.abs((D-S)*f)/2,V=x+Math.abs((D-S)*f)/2;zg(B,y,U,F-R),Bg(B,y,V,F-R),zg(B,y,x-R,F-R),Bg(B,y,x-R,$+i/2),zg(B,y,x-R,H+R),Bg(B,y,x-R,Y-i/2),zg(B,y,U,H+R),Bg(B,y,V,H+R);const Z=i/2+d,W=i/2-d,q=Y-$-2*W;if(q>0){const nt=S+Z,G=$+W,et=D-S-2*Z,st={topLeft:g,topRight:g,bottomRight:g,bottomLeft:g};N_(t,y,nt,G,et,q,st,new Fd(nt,G,et,N-G)),N_(t,y,nt,G,et,q,st,new Fd(nt,N,et,G+q-N))}else{const nt=($+Y)/2;zg(t,y,S,nt),Bg(t,y,D,nt)}}drawPath(t){super.drawPath(t);const{wickPath:e}=this;if(e.isEmpty())return;const{stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,wickStroke:r=i,wickStrokeWidth:l=n,wickStrokeOpacity:c=s,wickLineDash:u=a,wickLineDashOffset:d=o}=this;l!==0&&(t.globalAlpha*=c,typeof r=="string"&&(t.strokeStyle=r),t.lineWidth=l,u!=null&&t.setLineDash([...u]),t.lineDashOffset=d,t.stroke(e.getPath2D()))}};M([ut()],Gn.prototype,"horizontal");M([ut()],Gn.prototype,"center");M([ut()],Gn.prototype,"thickness");M([ut()],Gn.prototype,"min");M([ut()],Gn.prototype,"q1");M([ut()],Gn.prototype,"median");M([ut()],Gn.prototype,"q3");M([ut()],Gn.prototype,"max");M([ut()],Gn.prototype,"cornerRadius");M([ut()],Gn.prototype,"crisp");M([ut()],Gn.prototype,"strokeAlignment");M([ut()],Gn.prototype,"wickStroke");M([ut()],Gn.prototype,"wickStrokeWidth");M([ut()],Gn.prototype,"wickStrokeOpacity");M([Vx()],Gn.prototype,"wickLineDash");M([ut()],Gn.prototype,"wickLineDashOffset");M([ut()],Gn.prototype,"capLengthRatio");M([ut()],Gn.prototype,"wickStrokeAlignment");function zg(t,e,i,n){e?t.moveTo(n,i):t.moveTo(i,n)}function Bg(t,e,i,n){e?t.lineTo(n,i):t.lineTo(i,n)}function N_(t,e,i,n,s,a,o,r){e?w_(t,n,i,a,s,o,r==null?void 0:new Fd(r.y,r.x,r.height,r.width)):w_(t,i,n,s,a,o,r)}var{AbstractBarSeriesProperties:Srt,makeSeriesTooltip:Mrt}=j,ZK=class extends xt{constructor(){super(...arguments),this.lengthRatio=.5}};M([b],ZK.prototype,"lengthRatio");var Nm=class extends xt{};M([b],Nm.prototype,"stroke");M([b],Nm.prototype,"strokeWidth");M([b],Nm.prototype,"strokeOpacity");M([b],Nm.prototype,"lineDash");M([b],Nm.prototype,"lineDashOffset");var fi=class extends Srt{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.cap=new ZK,this.whisker=new Nm,this.tooltip=Mrt()}toJson(){const{stroke:t,strokeWidth:e,strokeOpacity:i,lineDash:n,lineDashOffset:s}=this,a=super.toJson();return a.whisker=Et(a.whisker,{stroke:t,strokeWidth:e,strokeOpacity:i,lineDash:n,lineDashOffset:s}),a}};M([b],fi.prototype,"xKey");M([b],fi.prototype,"minKey");M([b],fi.prototype,"q1Key");M([b],fi.prototype,"medianKey");M([b],fi.prototype,"q3Key");M([b],fi.prototype,"maxKey");M([b],fi.prototype,"xName");M([b],fi.prototype,"yName");M([b],fi.prototype,"minName");M([b],fi.prototype,"q1Name");M([b],fi.prototype,"medianName");M([b],fi.prototype,"q3Name");M([b],fi.prototype,"maxName");M([b],fi.prototype,"fill");M([b],fi.prototype,"fillOpacity");M([b],fi.prototype,"stroke");M([b],fi.prototype,"strokeWidth");M([b],fi.prototype,"strokeOpacity");M([b],fi.prototype,"lineDash");M([b],fi.prototype,"lineDashOffset");M([b],fi.prototype,"cornerRadius");M([b],fi.prototype,"styler");M([b],fi.prototype,"itemStyler");M([b],fi.prototype,"cap");M([b],fi.prototype,"whisker");M([b],fi.prototype,"tooltip");var{fixNumericExtent:Drt,keyProperty:Art,SeriesNodePickMode:T_,SMALLEST_KEY_INTERVAL:Irt,valueProperty:Fy,diff:krt,animationValidation:Crt,computeBarFocusBounds:wrt,createDatumId:L_,HighlightState:dw,motion:O_,getItemStyles:Nrt,calculateSegments:Trt,toHighlightString:Lrt,processedDataIsAnimatable:Ort,upsertNodeDatum:Ert}=j,Rrt=class extends j.SeriesNodeEvent{constructor(t,e,i,n){super(t,e,i,n),this.xKey=n.properties.xKey,this.minKey=n.properties.minKey,this.q1Key=n.properties.q1Key,this.medianKey=n.properties.medianKey,this.q3Key=n.properties.q3Key,this.maxKey=n.properties.maxKey}},qK=class extends j.AbstractBarSeries{constructor(t){super({moduleCtx:t,pickModes:[T_.NEAREST_NODE,T_.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["medianKey","q1Key","q3Key","minKey","maxKey"]},propertyNames:{x:["xName"],y:["medianName","q1Name","q3Name","minName","maxName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.properties=new fi,this.NodeEvent=Rrt}async processData(t){if(!this.visible)return;const{xKey:e,minKey:i,q1Key:n,medianKey:s,q3Key:a,maxKey:o}=this.properties,r=!this.ctx.animationManager.isSkipped(),l=this.getCategoryAxis()?.scale,c=this.getValueAxis()?.scale,{isContinuousX:u,xScaleType:d,yScaleType:g}=this.getScaleInformation({xScale:l,yScale:c}),f=[];this.needsDataModelDiff()&&this.processedData&&f.push(krt(this.id,this.processedData)),r&&f.push(Crt());const y=this.properties.allowNullKeys??!1,{processedData:x}=await this.requestDataModel(t,this.data,{props:[Art(e,d,{id:"xValue",allowNullKey:y}),Fy(i,g,{id:"minValue"}),Fy(n,g,{id:"q1Value"}),Fy(s,g,{id:"medianValue"}),Fy(a,g,{id:"q3Value"}),Fy(o,g,{id:"maxValue"}),...u?[Irt]:[],...f]});this.smallestDataInterval=x.reduced?.smallestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!(e&&i))return{domain:[]};if(t!==this.getBarDirection()){const{index:s,def:a}=i.resolveProcessedDataDefById(this,"xValue"),o=e.domain.keys[s];if(a.type==="key"&&a.valueType==="category"){const r=i.getKeySortMetadata(this,"xValue",e);return{domain:o,sortMetadata:r}}return{domain:this.padBandExtent(o)}}const n=this.domainForClippedRange(t,["minValue","maxValue"],"xValue");return{domain:Drt(n)}}getSeriesRange(t,e){return this.domainForVisibleRange(z.Y,["maxValue","minValue"],"xValue",e)}createNodeDatumContext(t,e){const{dataModel:i,processedData:n,contextNodeData:s}=this;if(!i||!n)return;const a=s?.nodeData!=null&&n.changeDescription!=null,o=!this.ctx.animationManager.isSkipped(),{groupOffset:r,barOffset:l,barWidth:c}=this.getBarDimensions();return{xAxis:t,yAxis:e,rawData:n.dataSources.get(this.id)?.data??[],xValues:i.resolveKeysById(this,"xValue",n),minValues:i.resolveColumnById(this,"minValue",n),q1Values:i.resolveColumnById(this,"q1Value",n),medianValues:i.resolveColumnById(this,"medianValue",n),q3Values:i.resolveColumnById(this,"q3Value",n),maxValues:i.resolveColumnById(this,"maxValue",n),xScale:t.scale,yScale:e.scale,groupOffset:r,barOffset:l,barWidth:c,isVertical:this.isVertical(),xKey:this.properties.xKey,animationEnabled:o,canIncrementallyUpdate:a,nodes:a?s.nodeData:[],nodeIndex:0}}validateBoxPlotValues(t,e,i,n,s){return[t,e,i,n,s].every(a=>typeof a=="number")&&t<=e&&e<=i&&i<=n&&n<=s}computeScaledValues(t,e,i){const n=t.xScale.convert(t.xValues[i]);return Number.isFinite(n)?(e.xValue=n+t.groupOffset+t.barOffset+t.barWidth/2,e.minValue=t.yScale.convert(t.minValues[i]),e.q1Value=t.yScale.convert(t.q1Values[i]),e.medianValue=t.yScale.convert(t.medianValues[i]),e.q3Value=t.yScale.convert(t.q3Values[i]),e.maxValue=t.yScale.convert(t.maxValues[i]),!0):!1}createSkeletonNodeDatum(t,e){return{series:this,datum:e.datum,datumIndex:e.datumIndex,xKey:t.xKey,bandwidth:t.barWidth,scaledValues:{xValue:0,minValue:0,q1Value:0,medianValue:0,q3Value:0,maxValue:0},midPoint:{x:0,y:0},focusRect:{x:0,y:0,width:0,height:0}}}updateNodeDatum(t,e,i){const{isVertical:n,barWidth:s}=t,a=i.scaledValues,o=e;o.datum=i.datum,o.datumIndex=i.datumIndex,o.bandwidth=s;const r=o.scaledValues;r.xValue=a.xValue,r.minValue=a.minValue,r.q1Value=a.q1Value,r.medianValue=a.medianValue,r.q3Value=a.q3Value,r.maxValue=a.maxValue;const l=Math.abs(a.q3Value-a.q1Value),c=a.xValue,u=Math.min(a.q3Value,a.q1Value)+l/2,d=n?c:u,g=n?u:c;o.midPoint?(o.midPoint.x=d,o.midPoint.y=g):o.midPoint={x:d,y:g};const f=o.focusRect;n?(f.x=d-s/2,f.y=a.minValue,f.width=s,f.height=a.maxValue-a.minValue):(f.x=a.minValue,f.y=g-s/2,f.width=a.maxValue-a.minValue,f.height=s)}createNodeDatum(t,e){const i=this.createSkeletonNodeDatum(t,e);return this.updateNodeDatum(t,i,e),i}initializeResult(t){return{itemId:this.properties.xKey,nodeData:t.nodes,labelData:[],scales:this.calculateScaling(),visible:this.visible,groupScale:void 0,styles:void 0,segments:void 0}}populateNodeData(t){const e={xValue:0,minValue:0,q1Value:0,medianValue:0,q3Value:0,maxValue:0},i={datumIndex:0,datum:void 0,scaledValues:e};for(let n=0;nthis.createNodeDatum(d,g),(d,g,f)=>this.updateNodeDatum(d,g,f)))}}finalizeNodeData(t){t.canIncrementallyUpdate&&t.nodeIndexL_(i.datumIndex)):t.datumSelection.update(e)}makeStylerParams(t){const{id:e}=this,{cornerRadius:i,cap:{lengthRatio:n},fill:s,fillOpacity:a,lineDash:o,lineDashOffset:r,stroke:l,strokeOpacity:c,strokeWidth:u,maxKey:d,maxName:g,medianKey:f,medianName:y,minKey:x,minName:S,q1Key:D,q1Name:A,q3Key:I,q3Name:w,whisker:{lineDash:N,lineDashOffset:O,stroke:L,strokeOpacity:R,strokeWidth:P},xKey:B,xName:F,yName:H}=this.properties,$=Lrt(t??dw.None);return{cap:{lengthRatio:n},cornerRadius:i,fill:s,fillOpacity:a,highlightState:$,lineDash:o,lineDashOffset:r,maxKey:d,maxName:g??d,medianKey:f,medianName:y??f,minKey:x,minName:S??x,q1Key:D,q1Name:A??D,q3Key:I,q3Name:w??I,seriesId:e,stroke:l,strokeOpacity:c,strokeWidth:u,whisker:{lineDash:N??o,lineDashOffset:O??r,stroke:L??l,strokeOpacity:R??c,strokeWidth:P??u},xKey:B,xName:F??B,yName:H}}getStyle(t,e){const{cap:i,cornerRadius:n,fill:s,fillOpacity:a,lineDash:o,lineDashOffset:r,stroke:l,strokeOpacity:c,strokeWidth:u,styler:d,whisker:g}=this.properties;let f={};if(!t&&d){const y=this.makeStylerParams(e);f=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(d,y)??{},{pick:!1})??{}}return{cornerRadius:f.cornerRadius??n,fill:f.fill??s,fillOpacity:f.fillOpacity??a,lineDash:f.lineDash??o,lineDashOffset:f.lineDashOffset??r,opacity:1,stroke:f.stroke??l,strokeOpacity:f.strokeOpacity??c,strokeWidth:f.strokeWidth??u,cap:{lengthRatio:f.cap?.lengthRatio??i.lengthRatio},whisker:{lineDash:f.whisker?.lineDash??g.lineDash,lineDashOffset:f.whisker?.lineDashOffset??g.lineDashOffset,stroke:f.whisker?.stroke??g.stroke,strokeOpacity:f.whisker?.strokeOpacity??g.strokeOpacity,strokeWidth:f.whisker?.strokeWidth??g.strokeWidth}}}getItemStyle(t,e,i){const{properties:n}=this,{itemStyler:s}=n,a=this.getHighlightStyle(e,t,i);let o=Et(a,this.getStyle(t===void 0,i));if(s!=null&&t!=null){const g=this.cachedDatumCallback(L_(t,e?"highlight":"node"),()=>{const f=this.makeItemStylerParams(t,e,o);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(s,f))});g&&(o=Et(g,o))}const{stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:u,lineDashOffset:d}=o;return o.whisker=Et(o.whisker,{stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:u,lineDashOffset:d}),o}makeItemStylerParams(t,e,i){const{id:n}=this,{xKey:s,minKey:a,q1Key:o,medianKey:r,q3Key:l,maxKey:c}=this.properties,u=this.processedData?.dataSources.get(n)?.data[t],d=this.ctx.highlightManager?.getActiveHighlight(),g=this.getHighlightStateString(d,e,t),f=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:n,datum:u,xKey:s,minKey:a,q1Key:o,medianKey:r,q3Key:l,maxKey:c,highlightState:g,...i,fill:f}}updateDatumStyles({datumSelection:t,isHighlight:e}){const i=this.ctx.highlightManager.getActiveHighlight();t.each((n,s)=>{const a=this.getHighlightState(i,e,s.datumIndex);s.style=this.getItemStyle(s.datumIndex,e,a)})}updateDatumNodes({datumSelection:t,isHighlight:e}){const{contextNodeData:i,properties:n}=this;if(!i)return;const s=this.isVertical(),a=this.ctx.highlightManager.getActiveHighlight(),o=this.getShapeFillBBox(),r=this.getStyle(!1,dw.None).strokeWidth/2,l=n.whisker.strokeWidth??n.strokeWidth;t.each((c,u)=>{const d=u.style??i.styles[this.getHighlightState(a,e,u.datumIndex)];c.setFillProperties(d.fill,o);const g=d.opacity??1,f=d.whisker?.strokeOpacity??d.strokeOpacity;c.fill=d.fill,c.fillOpacity=d.fillOpacity*g,c.stroke=d.stroke,c.strokeWidth=d.strokeWidth,c.strokeOpacity=d.strokeOpacity*g,c.lineDash=d.lineDash,c.lineDashOffset=d.lineDashOffset,c.wickStroke=d.whisker.stroke,c.wickStrokeWidth=d.whisker.strokeWidth,c.wickStrokeOpacity=f*g,c.wickLineDash=d.whisker.lineDash,c.wickLineDashOffset=d.whisker.lineDashOffset,c.cornerRadius=d.cornerRadius,c.crisp=!0,c.horizontal=!s,c.center=u.scaledValues.xValue,c.thickness=u.bandwidth,c.min=u.scaledValues.minValue,c.q1=u.scaledValues.q1Value,c.median=u.scaledValues.medianValue,c.q3=u.scaledValues.q3Value,c.max=u.scaledValues.maxValue,c.capLengthRatio=d.cap.lengthRatio,c.strokeAlignment=r,c.wickStrokeAlignment=l})}updateLabelNodes(){}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e)}nodeFactory(){return new Gn}computeFocusBounds({datumIndex:t}){return wrt(this,this.contextNodeData?.nodeData[t].focusRect)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null}};qK.className="BoxPlotSeries";qK.type="box-plot";var{boxPlotSeriesThemeableOptionsDef:Prt}=j,zrt={..._e,...Prt,type:ht(Jt("box-plot")),xKey:ht(K),minKey:ht(K),q1Key:ht(K),medianKey:ht(K),q3Key:ht(K),maxKey:ht(K),xKeyAxis:K,yKeyAxis:K,xName:K,yName:K,minName:K,q1Name:K,medianName:K,q3Name:K,maxName:K,grouped:J,legendItemName:K,segmentation:Pc,width:bo,widthRatio:Ot};ie.NUMBER+"",ie.CATEGORY+"";var{predictCartesianNonPrimitiveAxis:bbt}=j,Brt={options:zrt,axisKeys:{[z.X]:"xKeyAxis",[z.Y]:"yKeyAxis"},axisKeysFlipped:{[z.X]:"yKeyAxis",[z.Y]:"xKeyAxis"}};function Vrt(t,e,i,n,s,a,o,r){const[l,c]=gn(t,s);return Eu([l,c],e,i,n,{smallestKeyInterval:a,xNeedsValueOf:o,yNeedsValueOf:r})}var _rt=Pu(Vrt);function Frt(t,e,i,n,s){const a=e.resolveKeysById(n,"xValue",i),o=e.resolveColumnById(n,"highValue",i),r=e.resolveColumnById(n,"lowValue",i),l=e.getDomain(n,"xValue","key",i),c=e.resolveColumnNeedsValueOf(n,"xValue",i),u=e.resolveColumnNeedsValueOf(n,"highValue",i)??e.resolveColumnNeedsValueOf(n,"lowValue",i);if(s){const[d,g]=gn(t,l);return Eu([d,g],a,o,r,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:c,yNeedsValueOf:u,existingFilters:s})}return _rt(t,a,o,r,l,i.reduced?.smallestKeyInterval,c,u)}function Hrt(t,e,i,n,s,a){const o=e.resolveKeysById(n,"xValue",i),r=e.resolveColumnById(n,"highValue",i),l=e.resolveColumnById(n,"lowValue",i),c=e.getDomain(n,"xValue","key",i),u=e.resolveColumnNeedsValueOf(n,"xValue",i),d=e.resolveColumnNeedsValueOf(n,"highValue",i)??e.resolveColumnNeedsValueOf(n,"lowValue",i),[g,f]=gn(t,c);return bD([g,f],o,r,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,targetRange:s,xNeedsValueOf:u,yNeedsValueOf:d,existingFilters:a})}var{Path:jrt,BBox:Grt}=j,Qc=class extends jrt{constructor(){super(...arguments),this.centerX=0,this.y=0,this.width=0,this.height=0,this.yOpen=0,this.yClose=0,this.crisp=!1}setStaticProperties(t,e,i,n,s,a,o){this.__centerX=t,this.__width=e,this.__y=i,this.__height=n,this.__yOpen=s,this.__yClose=a,this.__crisp=o,this.dirtyPath=!0,this.markDirty()}computeBBox(){const{__centerX:t,__y:e,__width:i,__height:n}=this;return new Grt(t-i/2,e,i,n)}isPointInPath(t,e){return this.getBBox().containsPoint(t,e)}distanceSquared(t,e){return this.getBBox().distanceSquared(t,e)}get midPoint(){return{x:this.__centerX,y:this.__y+this.__height/2}}alignedCoordinates(){const{__y:t,__width:e,__height:i,__crisp:n}=this;let{__centerX:s,__yOpen:a,__yClose:o}=this,r=s-e/2,l=s+e/2,c=t,u=t+i;if(n&&e>1){if(s=this.align(s),a<=o){const g=this.align(a,o-a);a=this.align(a),o=a+g}else{const g=this.align(o,a-o);o=this.align(o),a=o+g}const d=this.align(e/2);r=s-d,l=s+d,c=this.align(t),u=c+this.align(c,i)}return{centerX:s,x0:r,x1:l,y0:c,y1:u,yOpen:a,yClose:o}}executeStroke(t,e){const{__width:i,strokeWidth:n}=this;i0?l/this.__strokeAlignment/2%1:0;t.clear(),t.moveTo(e-c,s),t.lineTo(e-c,a),Math.abs(n-i)>1&&(t.moveTo(i,o-c),t.lineTo(e-c,o-c),t.moveTo(e-c,r-c),t.lineTo(n,r-c))}};M([fe()],QK.prototype,"strokeAlignment");var Urt=Ca,Wrt=Ta,Krt=Na,E_=wa,R_=er,{AggregationManager:Yrt,fixNumericExtent:$rt,keyProperty:Xrt,createDatumId:pw,SeriesNodePickMode:P_,SMALLEST_KEY_INTERVAL:Zrt,valueProperty:dS,diff:qrt,animationValidation:Qrt,computeBarFocusBounds:Jrt,visibleRangeIndices:z_,BandScale:tlt,processedDataIsAnimatable:gw,getItemStylesPerItemId:elt}=j,ilt=class extends j.SeriesNodeEvent{constructor(t,e,i,n){super(t,e,i,n),this.xKey=n.properties.xKey,this.openKey=n.properties.openKey,this.closeKey=n.properties.closeKey,this.highKey=n.properties.highKey,this.lowKey=n.properties.lowKey}};function nlt(t){for(const e of t){const i=e.nodes();e.batchedUpdate(function(){for(const s of i){const a=s.datum;a!=null&&s.setStaticProperties(a.centerX,a.width,a.y,a.height,a.yOpen,a.yClose,a.crisp)}e.cleanup()})}}var JK=class extends j.AbstractBarSeries{constructor(t){super({moduleCtx:t,pickModes:[P_.AXIS_ALIGNED,P_.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["lowKey","highKey","openKey","closeKey"]},propertyNames:{x:["xName"],y:["lowName","highName","openName","closeName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.NodeEvent=ilt,this.aggregationManager=new Yrt}async processData(t){if(!this.visible)return;const{xKey:e,openKey:i,closeKey:n,highKey:s,lowKey:a}=this.properties,o=!this.ctx.animationManager.isSkipped(),r=this.getCategoryAxis()?.scale,l=this.getValueAxis()?.scale,{isContinuousX:c,xScaleType:u,yScaleType:d}=this.getScaleInformation({xScale:r,yScale:l}),g=[];this.needsDataModelDiff()&&this.processedData&&g.push(qrt(this.id,this.processedData)),o&&g.push(Qrt()),i&&g.push(dS(i,d,{id:"openValue",invalidValue:void 0,missingValue:void 0}));const f=this.properties.allowNullKeys??!1,{dataModel:y,processedData:x}=await this.requestDataModel(t,this.data,{props:[Xrt(e,u,{id:"xValue",allowNullKey:f}),dS(n,d,{id:"closeValue"}),dS(s,d,{id:"highValue"}),dS(a,d,{id:"lowValue"}),...c?[Zrt]:[],...g]});this.smallestDataInterval=x.reduced?.smallestKeyInterval,this.aggregateData(y,x),this.animationState.transition("updateData")}aggregateData(t,e){if(this.aggregationManager.markStale(e.input.count),e.type!=="ungrouped"||gw(e))return;const i=this.axes[z.X];if(i==null)return;const n=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>Hrt(i.scale.type,t,e,this,n,a),computeFull:a=>Frt(i.scale.type,t,e,this,a),targetRange:n});const s=this.aggregationManager.filters;s&&s.length>0&&Vr.record(`${this.type}:aggregation`,s.map(a=>a.maxRange))}estimateTargetRange(){const t=this.axes[z.X];if(!t)return-1;const[e,i]=t.scale.range;return Math.abs(i-e)}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!(e&&i))return{domain:[]};if(t!==this.getBarDirection()){const{def:s}=i.resolveProcessedDataDefById(this,"xValue"),a=i.getDomain(this,"xValue","key",e);return s.type==="key"&&s.valueType==="category"?a:{domain:this.padBandExtent(a.domain)}}const n=this.domainForClippedRange(t,["highValue","lowValue"],"xValue");return{domain:$rt(n)}}getSeriesRange(t,e){return this.domainForVisibleRange(z.Y,["highValue","lowValue"],"xValue",e)}getZoomRangeFittingItems(t,e,i){return this.zoomFittingVisibleItems("xValue",["highValue","lowValue"],t,e,i)}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",["highValue","lowValue"],t,e,i)}buildDatumContext(t,e){const{dataModel:i,processedData:n}=this;if(!i||!n)return;const s=n.dataSources.get(this.id)?.data??[];if(s.length===0)return;const a=t.scale,o=e.scale,r=tlt.is(a),[l,c]=a.range,u=Math.abs(c-l);this.aggregationManager.ensureLevelForRange(u);const d=this.aggregationManager.getFilterForRange(u),g=d==null,f=this.contextNodeData?.nodeData!=null&&(n.changeDescription!=null||!gw(n)||d!=null),{groupOffset:y,barOffset:x,barWidth:S}=this.getBarDimensions();return{rawData:s,xValues:i.resolveKeysById(this,"xValue",n),openValues:i.resolveColumnById(this,"openValue",n),closeValues:i.resolveColumnById(this,"closeValue",n),highValues:i.resolveColumnById(this,"highValue",n),lowValues:i.resolveColumnById(this,"lowValue",n),xScale:a,yScale:o,xAxis:t,yAxis:e,groupOffset:y,barOffset:x,barWidth:S,applyWidthOffset:r,crisp:g,xKey:this.properties.xKey,openKey:this.properties.openKey,closeKey:this.properties.closeKey,highKey:this.properties.highKey,lowKey:this.properties.lowKey,dataAggregationFilter:d,range:u,nodeDatumStateScratch:{datum:void 0,xValue:void 0,openValue:0,closeValue:0,highValue:0,lowValue:0,isRising:!0,itemType:"up"},canIncrementallyUpdate:f,nodeIndex:0,nodeData:f?this.contextNodeData.nodeData:[]}}prepareOhlcNodeDatumState(t,e){const i=t.xValues[e];if(i===void 0&&!this.properties.allowNullKeys)return;const n=t.openValues[e],s=t.closeValues[e],a=t.highValues[e],o=t.lowValues[e],r=o!=null&&o<=n&&o<=s,l=a!=null&&a>=n&&a>=s;if(!r){pt.warnOnce(`invalid low value for key [${t.lowKey}] in data element, low value cannot be higher than datum open or close values`);return}if(!l){pt.warnOnce(`invalid high value for key [${t.highKey}] in data element, high value cannot be lower than datum open or close values.`);return}const c=t.rawData[e],u=s>n,d=u?"up":"down",g=t.nodeDatumStateScratch;return g.datum=c,g.xValue=i,g.openValue=n,g.closeValue=s,g.highValue=a,g.lowValue=o,g.isRising=u,g.itemType=d,g}createSkeletonNodeDatum(t,e,i,n,s,a){const o=t.applyWidthOffset?s/2:0,r=n+o,l=t.yScale.convert(e.openValue),c=t.yScale.convert(e.closeValue),u=t.yScale.convert(e.highValue),d=t.yScale.convert(e.lowValue),g=Math.min(u,d),f=Math.max(u,d)-g;return{series:this,itemType:e.itemType,datum:e.datum,datumIndex:i,xKey:t.xKey,xValue:e.xValue,openValue:e.openValue,closeValue:e.closeValue,highValue:e.highValue,lowValue:e.lowValue,midPoint:{x:r,y:g+f/2},aggregatedValue:e.closeValue,isRising:e.isRising,centerX:r,width:s,y:g,height:f,yOpen:l,yClose:c,crisp:a}}updateNodeDatum(t,e,i,n,s,a,o){const r=e,l=t.applyWidthOffset?a/2:0,c=s+l,u=t.yScale.convert(i.openValue),d=t.yScale.convert(i.closeValue),g=t.yScale.convert(i.highValue),f=t.yScale.convert(i.lowValue),y=Math.min(g,f),x=Math.max(g,f)-y;r.datum=i.datum,r.datumIndex=n,r.itemType=i.itemType,r.xValue=i.xValue,r.openValue=i.openValue,r.closeValue=i.closeValue,r.highValue=i.highValue,r.lowValue=i.lowValue,r.aggregatedValue=i.closeValue,r.isRising=i.isRising,r.centerX=c,r.width=a,r.y=y,r.height=x,r.yOpen=u,r.yClose=d,r.crisp=o;const S=r.midPoint;S.x=c,S.y=y+x/2}upsertNodeDatum(t,e,i,n,s){const a=this.prepareOhlcNodeDatumState(t,e);if(!a)return;if(t.canIncrementallyUpdate&&t.nodeIndex{const r=n.xScale.convert(n.xValues[o]);return Number.isFinite(r)?r+n.groupOffset+(n.applyWidthOffset?n.barOffset:0):Number.NaN};if(n.dataAggregationFilter==null){const o=this.processedData.invalidData?.get(this.id);let[r,l]=z_(1,n.rawData.length,n.xAxis.range,c=>{const u=n.applyWidthOffset?0:-n.barWidth/2,d=a(c)+u;return[d,d+n.barWidth]});this.processedData.input.count<1e3&&(r=0,l=this.processedData.input.count);for(let c=r;c{const g=d*R_,f=r[g+E_],y=l[d];if(y===-1)return;const x=n.applyWidthOffset?0:-n.barWidth/2;return[a(y)+x,a(f)+x+n.barWidth]});for(let d=c;dA.openValue,A.itemType=A.isRising?"up":"down";const I=a(D),w=Math.abs(a(y)-a(f))+n.barWidth;if(n.canIncrementallyUpdate&&n.nodeIndexpw(i.xValue)):t.datumSelection.update(e)}updateLabelNodes(t){}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e)}getItemStyle(t,e,i,n="up"){const{properties:s,dataModel:a,processedData:o}=this,{itemStyler:r}=s,l=this.getHighlightStyle(e,t,i);let u=Et(l,s.getStyle(n));if(r&&a!=null&&o!=null&&t!=null){const d=a.resolveKeysById(this,"xValue",o)[t],g=this.cachedDatumCallback(pw(pw(d),e?"highlight":"node"),()=>{const f=this.makeItemStylerParams(n,t,e,u);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`,"item",n],this.callWithContext(r,f))});g&&(u=Et(g,u))}return u}makeItemStylerParams(t,e,i,n){const{id:s,properties:a,processedData:o}=this,{xKey:r,openKey:l,closeKey:c,highKey:u,lowKey:d}=a,g=o.dataSources.get(s)?.data[e],f=this.ctx.highlightManager?.getActiveHighlight(),y=this.getHighlightStateString(f,i,e),x={seriesId:s,datum:g,itemType:t,xKey:r,openKey:l,closeKey:c,highKey:u,lowKey:d,highlightState:y,...n};return"fill"in x&&"fill"in n&&(x.fill=this.filterItemStylerFillParams(n.fill)??n.fill),x}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,properties:s}=this,{xKey:a,xName:o,yName:r,openKey:l,openName:c,highKey:u,highName:d,lowKey:g,lowName:f,closeKey:y,closeName:x,legendItemName:S,tooltip:D}=s,A=this.getCategoryAxis(),I=this.getValueAxis();if(!i||!n||!A||!I)return;const w=n.dataSources.get(this.id)?.data[t],N=i.resolveKeysById(this,"xValue",n)[t],O=i.resolveColumnById(this,"openValue",n)[t],L=i.resolveColumnById(this,"highValue",n)[t],R=i.resolveColumnById(this,"lowValue",n)[t],P=i.resolveColumnById(this,"closeValue",n)[t],B=this.properties.allowNullKeys??!1;if(N===void 0&&!B)return;const F=P>=O?"up":"down",H=this.properties.item[F],$=this.getItemStyle(t,!1),Y={fill:H.fill??H.stroke,fillOpacity:H.fillOpacity??H.strokeOpacity??1,stroke:H.stroke,strokeWidth:H.strokeWidth??1,strokeOpacity:H.strokeOpacity??1,lineDash:H.lineDash??[0],lineDashOffset:H.lineDashOffset??0};return this.formatTooltipWithContext(D,{heading:this.getAxisValueText(A,"tooltip",N,w,a,S),title:S,symbol:{marker:Y},data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(I,"tooltip",O,w,l,S),missing:j.isTooltipValueMissing(O)},{label:d,fallbackLabel:u,value:this.getAxisValueText(I,"tooltip",L,w,u,S),missing:j.isTooltipValueMissing(L)},{label:f,fallbackLabel:g,value:this.getAxisValueText(I,"tooltip",R,w,g,S),missing:j.isTooltipValueMissing(R)},{label:x,fallbackLabel:y,value:this.getAxisValueText(I,"tooltip",P,w,y,S),missing:j.isTooltipValueMissing(P)}]},{seriesId:e,datum:w,title:r,itemType:F,xKey:a,xName:o,yName:r,openKey:l,openName:c,highKey:u,highName:d,lowKey:g,lowName:f,closeKey:y,closeName:x,...$})}computeFocusBounds(t){const e=this.getNodeData()?.at(t.datumIndex);if(e==null)return;const{centerX:i,y:n,width:s,height:a}=e,o={x:i-s/2,y:n,width:s,height:a};return Jrt(this,o)}},{ExtendedPath2D:slt,BBox:alt}=j,jp=class extends Qc{constructor(){super(...arguments),this.wickPath=new slt,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0,this.wickStrokeAlignment=0}setWickProperties(t,e,i,n,s){this.__wickStroke=t,this.__wickStrokeWidth=e,this.__wickStrokeOpacity=i,this.wickLineDash=n,this.__wickLineDashOffset=s,this.dirtyPath=!0,this.markDirty()}computeDefaultGradientFillBBox(){const{__width:t,__centerX:e,__yOpen:i,__yClose:n}=this,s=Math.min(i,n),o=Math.max(i,n)-s,r=e-t/2,l=e+t/2;return new alt(r,s,l-r,o)}updatePath(){const{path:t,stroke:e,strokeWidth:i,strokeOpacity:n,lineDash:s,lineDashOffset:a,__wickStroke:o,__wickStrokeWidth:r,__wickStrokeOpacity:l,wickLineDash:c,__wickLineDashOffset:u}=this,{centerX:d,x0:g,x1:f,y0:y,y1:x,yOpen:S,yClose:D}=this.alignedCoordinates(),A=this.layerManager?.canvas.pixelRatio??1,I=this.__wickStrokeAlignment>0?A/this.__wickStrokeAlignment/2%1:0;this.path.clear(),this.wickPath.clear();const N=o!=null&&o!==e||r!=null&&r!==i||l!=null&&l!==n||c!=null&&c!==s||u!=null&&u!==a?this.wickPath:t;if(Math.abs(f-g)<=3){N.moveTo(d-I,y),N.lineTo(d-I,x);return}const O=Math.min(S,D),L=Math.max(S,D),R=i/2;N.moveTo(d-I,y),N.lineTo(d-I,O+R),N.moveTo(d-I,x),N.lineTo(d-I,L-R);const P=L-O-2*R;if(P>0)t.rect(g+R,O+R,f-g-2*R,P);else{const B=(O+L)/2;t.moveTo(g,B),t.lineTo(f,B)}}drawPath(t){super.drawPath(t);const{wickPath:e}=this;if(e.isEmpty())return;const{stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,__wickStroke:r=i,__wickStrokeWidth:l=n,__wickStrokeOpacity:c=s,wickLineDash:u=a,__wickLineDashOffset:d=o}=this;l!==0&&(t.globalAlpha*=c,typeof r=="string"&&(t.strokeStyle=r),t.lineWidth=l,u!=null&&t.setLineDash([...u]),t.lineDashOffset=d,t.stroke(e.getPath2D()))}};M([fe()],jp.prototype,"wickStroke");M([fe()],jp.prototype,"wickStrokeWidth");M([fe()],jp.prototype,"wickStrokeOpacity");M([Vx()],jp.prototype,"wickLineDash");M([fe()],jp.prototype,"wickLineDashOffset");M([fe()],jp.prototype,"wickStrokeAlignment");var{AbstractBarSeriesProperties:olt,makeSeriesTooltip:rlt}=j,fp=class extends xt{constructor(){super(...arguments),this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};M([b],fp.prototype,"stroke");M([b],fp.prototype,"strokeWidth");M([b],fp.prototype,"strokeOpacity");M([b],fp.prototype,"lineDash");M([b],fp.prototype,"lineDashOffset");var TO=class extends xt{constructor(){super(...arguments),this.up=new fp,this.down=new fp}};M([b],TO.prototype,"up");M([b],TO.prototype,"down");var Io=class extends olt{};M([b],Io.prototype,"xKey");M([b],Io.prototype,"openKey");M([b],Io.prototype,"closeKey");M([b],Io.prototype,"highKey");M([b],Io.prototype,"lowKey");M([b],Io.prototype,"xName");M([b],Io.prototype,"yName");M([b],Io.prototype,"openName");M([b],Io.prototype,"closeName");M([b],Io.prototype,"highName");M([b],Io.prototype,"lowName");var EA=class extends Io{constructor(){super(...arguments),this.tooltip=rlt(),this.item=new TO}getStyle(t){const{strokeWidth:e,strokeOpacity:i,stroke:n,lineDash:s,lineDashOffset:a}=this.item[t];return{stroke:n,strokeWidth:e,strokeOpacity:i,lineDash:s,lineDashOffset:a,opacity:1}}};M([b],EA.prototype,"tooltip");M([b],EA.prototype,"item");M([b],EA.prototype,"itemStyler");var{makeSeriesTooltip:llt}=j,Tm=class extends xt{};M([b],Tm.prototype,"stroke");M([b],Tm.prototype,"strokeWidth");M([b],Tm.prototype,"strokeOpacity");M([b],Tm.prototype,"lineDash");M([b],Tm.prototype,"lineDashOffset");var zr=class extends xt{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.wick=new Tm}};M([b],zr.prototype,"fill");M([b],zr.prototype,"fillOpacity");M([b],zr.prototype,"stroke");M([b],zr.prototype,"strokeWidth");M([b],zr.prototype,"strokeOpacity");M([b],zr.prototype,"lineDash");M([b],zr.prototype,"lineDashOffset");M([b],zr.prototype,"cornerRadius");M([b],zr.prototype,"wick");var LO=class extends xt{constructor(){super(...arguments),this.up=new zr,this.down=new zr}};M([b],LO.prototype,"up");M([b],LO.prototype,"down");var RA=class extends Io{constructor(){super(...arguments),this.item=new LO,this.tooltip=llt()}getStyle(t){const{fill:e,fillOpacity:i,strokeWidth:n,strokeOpacity:s,stroke:a,lineDash:o,lineDashOffset:r,cornerRadius:l,wick:c}=this.item[t];return{fill:e,fillOpacity:i,stroke:a,strokeWidth:n,strokeOpacity:s,lineDash:o,lineDashOffset:r,cornerRadius:l,opacity:1,wick:c}}};M([b],RA.prototype,"item");M([b],RA.prototype,"tooltip");M([b],RA.prototype,"itemStyler");var t5=class extends JK{constructor(){super(...arguments),this.properties=new RA}nodeFactory(){const t=new jp;return t.lineCap="butt",t}updateDatumStyles({datumSelection:t,isHighlight:e}){t.each((i,n)=>{n.style=this.getItemStyle(n.datumIndex,e,void 0,n.itemType)})}updateDatumNodes({datumSelection:t,isHighlight:e}){const{contextNodeData:i,properties:n}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight(),{up:a,down:o}=n.item,r=this.getShapeFillBBox(),l=this;t.each(function(u,d){const{centerX:g,width:f,y,height:x,yOpen:S,yClose:D,crisp:A}=d,I=d.isRising?a:o,w=l.getHighlightState(s,e,d.datumIndex),N=d.style??i.styles[d.itemType][w];u.setStaticProperties(g,f,y,x,S,D,A),u.setStyleProperties(N,r);const O=N?.wick;u.setWickProperties(O?.stroke,O?.strokeWidth,O?.strokeOpacity,O?.lineDash,O?.lineDashOffset),u.wickStrokeAlignment=I.wick.strokeWidth??I.strokeWidth})}legendItemSymbol(){const{up:t,down:e}=this.properties.item,i=an(t.fill)?t.fill.colorStops.map(o=>typeof o=="string"?o:{color:o.color,stop:o.stop==null?void 0:o.stop*.5}):[{color:ir(t.fill)||ml(t.fill)?t.stroke:t.fill,stop:0},{color:ir(t.fill)||ml(t.fill)?t.stroke:t.fill,stop:.5}],n=an(e.fill)?e.fill.colorStops.map(o=>typeof o=="string"?o:{color:o.color,stop:o.stop==null?void 0:o.stop*.5}):[{color:ir(e.fill)||ml(e.fill)?e.stroke:e.fill,stop:.5}],s={type:"gradient",gradient:"linear",rotation:90,colorStops:[...i,...n],reverse:!1},a={type:"gradient",gradient:"linear",rotation:90,colorStops:[{color:t.stroke,stop:0},{color:t.stroke,stop:.5},{color:e.stroke,stop:.5}],reverse:!1};return{marker:{fill:s,fillOpacity:t.fillOpacity,stroke:a,strokeWidth:t.strokeWidth??1,strokeOpacity:t.strokeOpacity??1,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset}}}getLegendData(t){const{id:e,data:i,visible:n,ctx:{legendManager:s}}=this,{xKey:a,yName:o,showInLegend:r,legendItemName:l}=this.properties;return!i?.data.length||!a||t!=="category"?[]:[{legendType:"category",id:e,itemId:e,seriesId:e,enabled:n&&s.getItemEnabled({seriesId:e,itemId:e}),label:{text:l??o??e},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!r}]}hasItemStylers(){return this.properties.itemStyler!=null}};t5.className="CandleStickSeries";t5.type="candlestick";var{candlestickSeriesThemeableOptionsDef:clt}=j,OO={..._e,...clt,type:ht(Jt("candlestick")),xKey:ht(K),openKey:ht(K),highKey:ht(K),lowKey:ht(K),closeKey:ht(K),xName:K,yName:K,openName:K,highName:K,lowName:K,closeName:K,xKeyAxis:K,yKeyAxis:K};OO.pickOutsideVisibleMinorAxis=Mt(J);OO.focusPriority=Mt(gt);function B_(t){return{fill:{$applySwitch:[{$path:"type"},{$if:[{$eq:[{$palette:"type"},"user-indexed"]},t==="up"?"transparent":{$palette:"fill"},{$palette:`${t}.fill`}]},["gradient",B1(t)],["image",$s],["pattern",V1(t)]]},stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:`${t}.stroke`}]}}}B_("up"),B_("down"),ie.NUMBER+"",ie.ORDINAL_TIME+"";var{predictCartesianFinancialAxis:xbt}=j,hlt={options:OO,defaultAxes:{y:{type:ie.NUMBER,position:he.LEFT},x:{type:ie.ORDINAL_TIME,position:he.BOTTOM}},axisKeys:{[z.X]:"xKeyAxis",[z.Y]:"yKeyAxis"}};function ult(t,e){const{fontSize:i,minimumFontSize:n=i}=t,{fontSize:s,minimumFontSize:a=s}=e,o=i-n,r=s-a;let l=t.fontSize,c=e.fontSize;const u=[{labelFontSize:i,secondaryLabelFontSize:s}];for(;l>n||c>a;){const d=o>0?(l-n)/o:-1,g=r>0?(c-a)/r:-1;d>g?l--:c--,u.push({labelFontSize:l,secondaryLabelFontSize:c})}return u.reverse(),u}function e5(t,e,i,n,{padding:s},a){const{spacing:o=0}=e,r=2*s,l=2*s+o,c=(e.minimumFontSize??e.fontSize)+(n.minimumFontSize??n.fontSize);if(c>a(c+l,!1).height-l)return;const u=ult(e,n),d={fontFamily:e.fontFamily,fontStyle:e.fontStyle,fontWeight:e.fontWeight},g={fontFamily:n.fontFamily,fontStyle:n.fontStyle,fontWeight:n.fontWeight};let f,y;return nT(0,u.length-1,x=>{const{labelFontSize:S,secondaryLabelFontSize:D}=u[x],A=x===0,I={...d,fontSize:S},w={...g,fontSize:D},N=Ve(I).lineHeight(),O=Ve(w).lineHeight(),L=a(N+O+l,A),R=L.width-r,P=L.height-l;if(N+O>P||(f?.fontSize!==S&&(f=__(e,t,R,P,I,e.wrapping,A?e.overflowStrategy:"hide")),f==null||f.width>R||f.height>P)||(y?.fontSize!==D&&(y=__(n,i,R,P,w,n.wrapping,A?n.overflowStrategy:"hide")),y==null))return;const B=f.height+y.height;if(!(y.width>R||B>P))return{width:Math.max(f.width,y.width),height:B+o,meta:L.meta,label:f,secondaryLabel:y}})}function rx(t,e,{padding:i},n){const s=2*i,a=Math.min(e.minimumFontSize??e.fontSize,e.fontSize),o={fontFamily:e.fontFamily,fontStyle:e.fontStyle,fontWeight:e.fontWeight};return nT(a,e.fontSize,r=>{const l={...o,fontSize:r},c=Ve(l),u=r===a,d=e.lineHeight??c.lineHeight(),g=n(d+s,u),f=g.width-s,y=g.height-s;if(d>y||f<0)return;const x=Ox(t,{maxWidth:f,maxHeight:y,font:l,textWrap:e.wrapping,overflow:(u?e.overflowStrategy:null)??"hide"});if(!x.length)return;const{width:S,height:D}=c.measureLines(x),A=x.join(` +`);return[{width:S,height:D,text:A,fontSize:r,lineHeight:d},g.meta]})}function V_(t){return t?.minimumFontSize!=null&&t?.fontSize!=null&&t?.minimumFontSize>t?.fontSize}function EO(t,e,i,n,s,a){const o=e.enabled?t:void 0,r=n.enabled?i:void 0;(V_(e)||V_(n))&&pt.warnOnce("minimumFontSize should be set to a value less than or equal to the font size");let l;o!=null&&r!=null&&(l=e5(o,e,r,n,s,a));let c;if(l==null&&o!=null&&(c=rx(o,e,s,a)),c!=null){const[d,g]=c;l={width:d.width,height:d.height,meta:g,label:d,secondaryLabel:void 0}}let u;if(l==null&&o==null&&r!=null&&(u=rx(r,n,s,a)),u!=null){const[d,g]=u;l={width:d.width,height:d.height,meta:g,label:void 0,secondaryLabel:d}}return l}function __(t,e,i,n,s,a,o){const r=Ox(e,{maxWidth:i,maxHeight:n,font:s,textWrap:a,overflow:o});if(!r.length)return;const l=Ve(s),c=t.lineHeight??l.lineHeight(),{width:u}=l.measureLines(r);return{width:u,lineHeight:c,text:r.join(` +`),height:r.length*c,fontSize:s.fontSize}}var Lm=class extends j.Label{constructor(){super(...arguments),this.wrapping="on-space",this.overflowStrategy="ellipsis"}};M([b],Lm.prototype,"wrapping");M([b],Lm.prototype,"overflowStrategy");M([b],Lm.prototype,"lineHeight");M([b],Lm.prototype,"minimumFontSize");var Om=class extends Lm{constructor(){super(...arguments),this.spacing=0}};M([b],Om.prototype,"spacing");var PA=class extends Lm{},{CartesianSeriesProperties:dlt,makeSeriesTooltip:plt}=j,as=class extends dlt{constructor(){super(...arguments),this.colorRange=["black","black"],this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.textAlign="center",this.verticalAlign="middle",this.itemPadding=0,this.label=new Om,this.tooltip=plt()}};M([b],as.prototype,"title");M([b],as.prototype,"xKey");M([b],as.prototype,"yKey");M([b],as.prototype,"colorKey");M([b],as.prototype,"xName");M([b],as.prototype,"yName");M([b],as.prototype,"colorName");M([b],as.prototype,"colorRange");M([b],as.prototype,"stroke");M([b],as.prototype,"strokeOpacity");M([b],as.prototype,"strokeWidth");M([b],as.prototype,"textAlign");M([b],as.prototype,"verticalAlign");M([b],as.prototype,"itemPadding");M([b],as.prototype,"itemStyler");M([b],as.prototype,"label");M([b],as.prototype,"tooltip");var{SeriesNodePickMode:F_,computeBarFocusBounds:glt,getMissCount:flt,valueProperty:fw,DEFAULT_CARTESIAN_DIRECTION_KEYS:mlt,DEFAULT_CARTESIAN_DIRECTION_NAMES:ylt,createDatumId:blt,ColorScale:xlt,Rect:vlt,PointerEvents:Slt,addHitTestersToQuadtree:Mlt,findQuadtreeMatch:H_,updateLabelNode:Dlt,upsertNodeDatum:Alt}=j,Ilt=class extends j.CartesianSeriesNodeEvent{constructor(t,e,i,n){super(t,e,i,n),this.colorKey=n.properties.colorKey}},klt={left:-.5,center:0,right:-.5},Clt={top:-.5,middle:0,bottom:-.5},i5=class extends j.CartesianSeries{constructor(t){super({moduleCtx:t,propertyKeys:{...mlt,color:["colorKey"]},propertyNames:{...ylt,color:["colorName"]},categoryKey:void 0,pickModes:[F_.NEAREST_NODE,F_.EXACT_SHAPE_MATCH],pathsPerSeries:[]}),this.properties=new as,this.NodeEvent=Ilt,this.colorScale=new xlt}async processData(t){const e=this.axes[z.X],i=this.axes[z.Y];if(!e||!i)return;const{xKey:n,yKey:s,colorRange:a,colorKey:o}=this.properties,r=this.axes[z.X]?.scale,l=this.axes[z.Y]?.scale,{xScaleType:c,yScaleType:u}=this.getScaleInformation({xScale:r,yScale:l}),d=this.colorScale.type,g=this.properties.allowNullKeys??!1,{dataModel:f,processedData:y}=await this.requestDataModel(t,this.data,{props:[fw(n,c,{id:"xValue",allowNullKey:g}),fw(s,u,{id:"yValue",allowNullKey:g}),...o?[fw(o,d,{id:"colorValue",invalidValue:void 0})]:[]]});if(this.isColorScaleValid()){const x=f.resolveProcessedDataIndexById(this,"colorValue"),S=y.domain.values[x].filter(A=>A!=null),D=Ll(S);if(this.colorScale.domain=D??[],D?.length&&D[0]===D[1]){const A=Math.floor(a.length/2);this.colorScale.range=[a[A],a[A]]}else this.colorScale.range=a;this.colorScale.update()}}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const n=e.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,a=flt(this,i.defs.values[n].missing),o=e.resolveProcessedDataIndexById(this,"colorValue"),r=i.domain.values[o].filter(c=>c!=null).length;return!(s===0||s===a||r===0)}xCoordinateRange(t,e){const i=this.axes[z.X].scale,n=e*(i.bandwidth??0)/2,s=i.convert(t)+n,a=e*(i.bandwidth??10);return[s,s+a]}yCoordinateRange(t,e){const i=this.axes[z.Y].scale,n=e*(i.bandwidth??0)/2,s=i.convert(t[0])+n,a=e*(i.bandwidth??10);return[s,s+a]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;return!e||!i?{domain:[]}:t===z.X?{domain:e.getDomain(this,"xValue","value",i).domain}:{domain:e.getDomain(this,"yValue","value",i).domain}}getSeriesRange(){return[Number.NaN,Number.NaN]}validateCreateNodeDataPreconditions(){const t=super.validateCreateNodeDataPreconditions();if(!t)return;const{xAxis:e,yAxis:i}=t;if(e.type!=="category"||i.type!=="category"){pt.warnOnce(`Heatmap series expected axes to have "category" type, but received "${e.type}" and "${i.type}" instead.`);return}return t}populateNodeData(t){for(const[e,i]of t.rawData.entries()){const n=Alt(t,{datumIndex:e,datum:i},(s,a)=>this.createNodeDatum(s,a.datumIndex,a.datum),(s,a,o)=>this.updateNodeDatum(s,a,o.datumIndex,o.datum));if(n){const s=this.createLabelDatum(t,e,i,n);s&&t.labels.push(s)}}}initializeResult(t){return{itemId:this.properties.yKey??this.id,nodeData:t.nodes,labelData:t.labels,scales:this.calculateScaling(),visible:this.visible}}createNodeDatumContext(t,e){const{dataModel:i,processedData:n,contextNodeData:s}=this;if(!i||!n)return;const{xKey:a,xName:o,yKey:r,yName:l,colorKey:c,colorName:u,textAlign:d,verticalAlign:g,itemPadding:f}=this.properties,y=t.scale,x=e.scale,S=i.resolveColumnById(this,"xValue",n),D=i.resolveColumnById(this,"yValue",n),A=c?i.resolveColumnById(this,"colorValue",n):void 0,I=c?i.getDomain(this,"colorValue","value",n).domain:[],w=y.bandwidth??10,N=x.bandwidth??10,O=n.dataSources.get(this.id)?.data??[],L=s?.nodeData!=null&&n.changeDescription!=null;return{xAxis:t,yAxis:e,xScale:y,yScale:x,rawData:O,xValues:S,xKey:a,yKey:r,xName:o,yName:l,animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:L,nodes:L?s.nodeData:[],nodeIndex:0,xOffset:(y.bandwidth??0)/2,yOffset:(x.bandwidth??0)/2,width:w,height:N,textAlignFactor:(w-2*f)*klt[d],verticalAlignFactor:(N-2*f)*Clt[g],yValues:D,colorKey:c,colorName:u,colorValues:A,colorDomain:I,itemPadding:f,labels:[],labelIndex:0}}createSkeletonNodeDatum(t,e,i){const{xKey:n,yKey:s,width:a,height:o,colorValues:r}=t,l=t.xValues[e],c=t.yValues[e],u=r?.[e];return{series:this,datumIndex:e,yKey:s,xKey:n,xValue:l,yValue:c,colorValue:u,datum:i,point:{x:0,y:0,size:0},width:a,height:o,midPoint:{x:0,y:0},missing:r!=null&&u==null,style:{}}}updateNodeDatum(t,e,i,n){const{xScale:s,yScale:a,xOffset:o,yOffset:r,width:l,height:c,xKey:u,yKey:d,colorValues:g}=t,f=e,y=t.xValues[i],x=t.yValues[i],S=s.convert(y)+o,D=a.convert(x)+r;if(!Number.isFinite(S)||!Number.isFinite(D))return;const A=g?.[i];f.datumIndex=i,f.datum=n,f.yKey=d,f.xKey=u,f.xValue=y,f.yValue=x,f.colorValue=A,f.width=l,f.height=c,f.missing=g!=null&&A==null;const I=f.point;I.x=S,I.y=D,I.size=0,f.midPoint.x=S,f.midPoint.y=D,f.style=this.getItemStyle({datumIndex:i,datum:n,colorValue:A},!1)}createNodeDatum(t,e,i){const{xScale:n,yScale:s,xOffset:a,yOffset:o}=t,r=t.xValues[e],l=t.yValues[e],c=n.convert(r)+a,u=s.convert(l)+o;if(!Number.isFinite(c)||!Number.isFinite(u))return;const d=this.createSkeletonNodeDatum(t,e,i);return this.updateNodeDatum(t,d,e,i),d}createLabelDatum(t,e,i,n){const{label:s}=this.properties,{width:a,height:o,textAlignFactor:r,verticalAlignFactor:l,itemPadding:c,colorKey:u,colorName:d,colorDomain:g,xKey:f,yKey:y,xName:x,yName:S}=t,D=t.colorValues?.[e],A=s.enabled&&D!=null?this.getLabelText(D,i,u,"color",g,s,{value:D,datum:i,colorKey:u,colorName:d,xKey:f,yKey:y,xName:x,yName:S}):void 0,I=()=>({width:a,height:o,meta:null}),w=EO(ce(A),this.properties.label,void 0,this.properties.label,{padding:c},I);if(w?.label==null)return;const{text:N,fontSize:O,lineHeight:L,height:R}=w.label,{fontStyle:P,fontFamily:B,fontWeight:F,color:H}=this.properties.label,{textAlign:$,verticalAlign:Y}=this.properties,U=n.point.x+r*(a-2*c),V=n.point.y+l*(o-2*c)-(w.height-R)*.5;return{series:this,datum:i,datumIndex:e,text:N,fontSize:O,lineHeight:L,fontStyle:P,fontFamily:B,fontWeight:F,color:H,textAlign:$,textBaseline:Y,x:U,y:V,style:n.style}}nodeFactory(){return new vlt}update(t){return this.ctx.animationManager.skipCurrentBatch(),super.update(t)}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,n=e??[];return i.update(n)}getItemStyle({datumIndex:t,datum:e,colorValue:i},n,s){const{properties:a}=this,{itemStyler:o,stroke:r,strokeWidth:l,strokeOpacity:c}=a,u=this.getHighlightStyle(n,t,s),d=Et(u,{fill:this.isColorScaleValid()&&i!=null?this.colorScale.convert(i):"transparent",fillOpacity:1,stroke:r,strokeWidth:l,strokeOpacity:c,opacity:1});let g;return o!=null&&t!=null&&(g=this.cachedDatumCallback(blt(t,n?"highlight":"node"),()=>{const f=this.makeItemStylerParams(e,t,n,d);return this.callWithContext(o,f)})),g?Et(g,d):d}makeItemStylerParams(t,e,i,n){const{id:s,properties:a}=this,{xKey:o,yKey:r}=a,l=this.ctx.highlightManager?.getActiveHighlight(),c=this.getHighlightStateString(l,i,e),u=this.filterItemStylerFillParams(n.fill)??n.fill;return{seriesId:s,datum:t,xKey:o,yKey:r,highlightState:c,...n,fill:u}}updateDatumStyles({datumSelection:t,isHighlight:e}){const i=this.ctx.highlightManager?.getActiveHighlight();t.each((n,s)=>{const a=this.getHighlightState(i,e,s.datumIndex);s.style=this.getItemStyle(s,e,a)})}updateDatumNodes({datumSelection:t}){const e=this.axes[z.X],[i,n]=e?.visibleRange??[],a=!(i!==0||n!==1);t.each((o,r)=>{const{point:l,width:c,height:u,style:d}=r;o.setStyleProperties(d),o.crisp=a,o.x=l.x-c/2,o.y=l.y-u/2,o.width=c,o.height=u})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t,{enabled:n}=this.properties.label,s=n?e:[];return i.update(s)}updateLabelNodes(t){const{isHighlight:e=!1}=t,i=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((n,s)=>{n.pointerEvents=Slt.None,n.text=s.text,n.fillOpacity=this.getHighlightStyle(e,s.datumIndex)?.opacity??1,Dlt(this,n,this.properties,this.properties.label,s,e,i)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,axes:s,properties:a,colorScale:o,ctx:r}=this,{formatManager:l}=r,{xKey:c,xName:u,yKey:d,yName:g,colorKey:f,colorName:y,colorRange:x,title:S,legendItemName:D,tooltip:A}=a,I=s[z.X],w=s[z.Y];if(!i||!n||!I||!w)return;const N=n.dataSources.get(this.id)?.data[t],O=i.resolveColumnById(this,"xValue",n)[t],L=i.resolveColumnById(this,"yValue",n)[t],R=f!=null&&this.isColorScaleValid()?i.resolveColumnById(this,"colorValue",n)[t]:void 0,P=this.properties.allowNullKeys??!1;if(O===void 0&&!P)return;const B=[];let F;if(R==null)F=x[0];else{F=o.convert(R);const Y=i.getDomain(this,"colorValue","value",n).domain,U=l.format(this.callWithContext.bind(this),{type:"number",value:R,datum:N,seriesId:e,legendItemName:D,key:f,source:"tooltip",property:"color",domain:Y,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0,visibleDomain:void 0});B.push({label:y,fallbackLabel:f,value:U??Or(R)})}B.push({label:u,fallbackLabel:c,value:this.getAxisValueText(I,"tooltip",O,N,c,D)},{label:g,fallbackLabel:d,value:this.getAxisValueText(w,"tooltip",L,N,d,D)});const H=this.getItemStyle({datumIndex:t,datum:N,colorValue:R},!1);H.fill!=null&&(F=H.fill);const $=F==null?void 0:{marker:{shape:"square",fill:F,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}};return this.formatTooltipWithContext(A,{title:S??D,symbol:$,data:B},{seriesId:e,datum:N,title:S,xKey:c,xName:u,yKey:d,yName:g,colorKey:f,colorName:y,...H})}getLegendData(t){return t!=="gradient"||!this.isColorScaleValid()||!this.dataModel?[]:[{legendType:"gradient",enabled:this.visible,seriesId:this.id,series:this.getFormatterContext("color"),colorDomain:this.colorScale.domain,colorRange:this.colorScale.range}]}isLabelEnabled(){return this.properties.label.enabled&&!!this.properties.colorKey}getBandScalePadding(){return{inner:0,outer:0}}computeFocusBounds({datumIndex:t}){const e=this.contextNodeData?.nodeData[t];if(e===void 0)return;const{width:i,height:n,midPoint:s}=e,a={x:s.x-i/2,y:s.y-n/2,width:i,height:n};return glt(this,a)}initQuadTree(t){Mlt(t,this.datumNodesIter())}pickNodesExactShape(t){const e=H_(this,t);return e!=null&&e.distance<=0?[e.datum]:[]}pickNodeClosestDatum(t){return H_(this,t)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null||this.isColorScaleValid()}};i5.className="HeatmapSeries";i5.type="heatmap";var{heatmapSeriesThemeableOptionsDef:wlt}=j,Nlt={...At(wlt,["showInLegend"]),...At(_e,["showInLegend"]),type:ht(Jt("heatmap")),xKey:ht(K),yKey:ht(K),xKeyAxis:K,yKeyAxis:K,colorKey:K,xName:K,yName:K,colorName:K,colorRange:Ft(It)},Tlt={series:{label:{...Oe}}};Tlt.series.colorRange={$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},xx]};var Llt={options:Nlt,defaultAxes:{y:{type:ie.CATEGORY,position:he.LEFT},x:{type:ie.CATEGORY,position:he.BOTTOM}},axisKeys:{[z.X]:"xKeyAxis",[z.Y]:"yKeyAxis"}},n5=class extends JK{constructor(){super(...arguments),this.properties=new EA}nodeFactory(){const t=new QK;return t.lineCap="square",t}updateDatumStyles({datumSelection:t,isHighlight:e}){t.each((i,n)=>{n.style=this.getItemStyle(n.datumIndex,e,void 0,n.itemType)})}updateDatumNodes({datumSelection:t,isHighlight:e}){const{contextNodeData:i,properties:n}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight(),{up:a,down:o}=n.item,r=this;t.each(function(c,u){const{centerX:d,width:g,y:f,height:y,yOpen:x,yClose:S,crisp:D}=u,A=u.isRising?a:o;c.setStaticProperties(d,g,f,y,x,S,D);const I=u.style??i.styles[u.itemType][r.getHighlightState(s,e,u.datumIndex)];c.setStyleProperties(I),c.strokeAlignment=A.strokeWidth})}getLegendData(t){const{id:e,data:i,ctx:{legendManager:n},visible:s}=this,{xKey:a,yName:o,item:{up:r,down:l},showInLegend:c,legendItemName:u}=this.properties;if(!i?.data.length||!a||t!=="category")return[];const d={type:"gradient",gradient:"linear",colorSpace:"rgb",colorStops:[{color:r.stroke,stop:0},{color:r.stroke,stop:.5},{color:l.stroke,stop:.5}],rotation:90};return[{legendType:"category",id:e,itemId:e,seriesId:e,enabled:s&&n.getItemEnabled({seriesId:e,itemId:e}),label:{text:u??o??e},symbol:{marker:{fill:d,fillOpacity:r.strokeOpacity,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}},legendItemName:u,hideInLegend:!c}]}hasItemStylers(){return this.properties.itemStyler!=null}};n5.className="ohlc";n5.type="ohlc";var{ohlcSeriesThemeableOptionsDef:Olt}=j,RO={..._e,...Olt,type:ht(Jt("ohlc")),xKey:ht(K),openKey:ht(K),highKey:ht(K),lowKey:ht(K),closeKey:ht(K),xKeyAxis:K,yKeyAxis:K,xName:K,yName:K,openName:K,highName:K,lowName:K,closeName:K};RO.pickOutsideVisibleMinorAxis=Mt(J);RO.focusPriority=Mt(gt);var{predictCartesianFinancialAxis:vbt}=j;ie.NUMBER+"",ie.ORDINAL_TIME+"";var Elt={options:RO,defaultAxes:{y:{type:ie.NUMBER,position:he.LEFT},x:{type:ie.ORDINAL_TIME,position:he.BOTTOM}},axisKeys:{[z.X]:"xKeyAxis",[z.Y]:"yKeyAxis"}};function Rlt(t,e,i,n,s,a,o,r){const[l,c]=gn(t,s);return Eu([l,c],e,i,n,{smallestKeyInterval:a,xNeedsValueOf:o,yNeedsValueOf:r})}var Plt=Pu(Rlt);function zlt(t,e,i,n,s){const a=e.resolveKeysById(n,"xValue",i),o=e.resolveColumnById(n,"yHighValue",i),r=e.resolveColumnById(n,"yLowValue",i),l=e.getDomain(n,"xValue","key",i),c=e.resolveColumnNeedsValueOf(n,"xValue",i),u=e.resolveColumnNeedsValueOf(n,"yHighValue",i)??e.resolveColumnNeedsValueOf(n,"yLowValue",i);if(s){const[d,g]=gn(t,l);return Eu([d,g],a,o,r,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:c,yNeedsValueOf:u,existingFilters:s})}return Plt(t,a,o,r,l,i.reduced?.smallestKeyInterval,c,u)}function Blt(t,e,i,n,s,a){const o=e.resolveKeysById(n,"xValue",i),r=e.resolveColumnById(n,"yHighValue",i),l=e.resolveColumnById(n,"yLowValue",i),c=e.getDomain(n,"xValue","key",i),u=e.resolveColumnNeedsValueOf(n,"xValue",i),d=e.resolveColumnNeedsValueOf(n,"yHighValue",i)??e.resolveColumnNeedsValueOf(n,"yLowValue",i),[g,f]=gn(t,c);return bD([g,f],o,r,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,targetRange:s,xNeedsValueOf:u,yNeedsValueOf:d,existingFilters:a})}function j_({span:t},e){switch(t.type){case"linear":case"step":case"multi-line":{const i=(e-t.x0)/(t.x1-t.x0);return t.y0+i*(t.y1-t.y0)}case"cubic":{const{cp0x:i,cp0y:n,cp1x:s,cp1y:a,cp2x:o,cp2y:r,cp3x:l,cp3y:c}=t;let u=.5;const d=1e-6;for(let f=0;f<10;f++){const y=1-u,S=y*y*y*i+3*y*y*u*s+3*y*u*u*o+u*u*u*l-e;if(Math.abs(S)=a.x&&e<=o.x)return{span:s,index:n};if(el;return{intersection:n===c?null:{x:i,y:r},spanIndex:a.index,isInverted:c}}function _lt(t,e,i,n,s=!1){if(t.length===0||e.length===0)return[];const a=[];let o=s,r=0;for(let l=i;l<=n;l+=.5){const c=Vlt(t,e,l,o,r);c.intersection&&a.push(c.intersection.x),r=c.spanIndex,o=c.isInverted}return a}function Flt(t,e,i,n,s={}){const a=Math.max(e.x,i.width-(e.x+e.width)),o=Math.max(e.y,i.height-(e.y+e.height)),r=[],l=(u,d)=>({x0:u,y0:-o,x1:d,y1:e.height+o});n&&r.push({clipRect:l(-a,t[0]??e.width+a),...s});const c=n?1:0;for(let u=c;u{Vg(l,c,e.removed),Vg(l,c,i.removed)},a=(l,c)=>{Vg(l,c,e.moved),Vg(l,c,i.moved)},o=(l,c)=>{Vg(l,c,e.added),Vg(l,c,i.added)},r=Ylt(t,n);return{status:t,path:{addPhaseFn:o,updatePhaseFn:a,removePhaseFn:s},pathProperties:r}}function Xlt(t,e,i){const n=t.scales.x?.type==="category",s=e.scales.x?.type==="category";if(n!==s||!cp(t.scales.x)||!cp(e.scales.x))return;let a="updated";e.visible&&!t.visible?a="removed":!e.visible&&t.visible&&(a="added");const o=gS({scales:t.scales,data:t.fillData.spans},{scales:e.scales,data:e.fillData.spans},pS.Split);if(o==null)return;const r=gS({scales:t.scales,data:t.fillData.phantomSpans},{scales:e.scales,data:e.fillData.phantomSpans},pS.Split);if(r==null)return;const l=gS({scales:t.scales,data:t.highStrokeData.spans},{scales:e.scales,data:e.highStrokeData.spans},pS.Split);if(l==null)return;const c=gS({scales:t.scales,data:t.lowStrokeData.spans},{scales:e.scales,data:e.lowStrokeData.spans},pS.Split);if(c==null)return;const u="fade",d=Klt(a,o,r,u),g=$lt(a,l,c,u),f=(i?.changed??!0)||!yl(t.scales.x,e.scales.x)||!yl(t.scales.y,e.scales.y)||a!=="updated";return{status:a,fill:d,stroke:g,hasMotion:f}}var Zlt=Ta,qlt=Na,Qlt=er,{valueProperty:U_,keyProperty:Jlt,updateLabelNode:tct,fixNumericExtent:W_,buildResetPathFn:ect,resetLabelFn:ict,resetMarkerFn:nct,resetMarkerPositionFn:K_,pathSwipeInAnimation:sct,resetMotion:act,markerSwipeScaleInAnimation:oct,seriesLabelFadeInAnimation:mw,animationValidation:rct,diff:lct,updateClipPath:yw,computeMarkerFocusBounds:Y_,plotAreaPathFill:cct,plotLinePathStroke:$_,interpolatePoints:X_,pathFadeInAnimation:bw,markerFadeInAnimation:Z_,fromToMotion:xw,pathMotion:vw,PointerEvents:fS,Marker:hct,BBox:uct,processedDataIsAnimatable:Sw,markerEnabled:dct,getMarkerStyles:pct,calculateSegments:gct,toHighlightString:fct,HighlightState:mct,AggregationManager:yct,resetMarkerSelectionsDirect:bct,createDatumId:xct,visibleRangeIndices:q_}=j,vct=class extends j.SeriesNodeEvent{constructor(t,e,i,n){super(t,e,i,n),this.xKey=n.properties.xKey,this.yLowKey=n.properties.yLowKey,this.yHighKey=n.properties.yHighKey}},s5=class extends j.CartesianSeries{constructor(t){super({moduleCtx:t,pathsPerSeries:["fill","lowStroke","highStroke"],pickModes:[j.SeriesNodePickMode.AXIS_ALIGNED],propertyKeys:{[z.X]:["xKey"],[z.Y]:["yLowKey","yHighKey"]},propertyNames:{[z.X]:["xName"],[z.Y]:["yLowName","yHighName","yName"]},categoryKey:"xValue",animationResetFns:{path:ect({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:ict,datum:(e,i)=>({...nct(e),...K_(e,i)})},clipFocusBox:!1}),this.properties=new _i,this.NodeEvent=vct,this.aggregationManager=new yct}renderToOffscreenCanvas(){return(this.contextNodeData?.nodeData?.length??0)>0&&this.getDrawingMode(!1)==="cutout"||super.renderToOffscreenCanvas()}async processData(t){const{xKey:e,yLowKey:i,yHighKey:n}=this.properties,s=this.axes[z.X]?.scale,a=this.axes[z.Y]?.scale,{xScaleType:o,yScaleType:r}=this.getScaleInformation({xScale:s,yScale:a}),l=[],c=!this.ctx.animationManager.isSkipped();this.needsDataModelDiff()&&this.processedData&&l.push(lct(this.id,this.processedData)),c&&l.push(rct());const u=this.properties.allowNullKeys??!1,{dataModel:d,processedData:g}=await this.requestDataModel(t,this.data,{props:[Jlt(e,o,{id:"xValue",allowNullKey:u}),U_(i,r,{id:"yLowValue"}),U_(n,r,{id:"yHighValue"}),...l]});this.aggregateData(d,g),this.animationState.transition("updateData")}aggregateData(t,e){if(this.aggregationManager.markStale(e.input.count),e.type!=="ungrouped"||Sw(e))return;const i=this.axes[z.X];if(i==null)return;const n=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>Blt(i.scale.type,t,e,this,n,a),computeFull:a=>zlt(i.scale.type,t,e,this,a),targetRange:n});const s=this.aggregationManager.filters;s&&s.length>0&&Vr.record(`${this.type}:aggregation`,s.map(a=>a.maxRange))}estimateTargetRange(){const t=this.axes[z.X];if(t?.scale?.range){const[e,i]=t.scale.range;return Math.abs(i-e)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(t,e){const{dataModel:i,processedData:n}=this;if(!i||!n)return;const s=n.dataSources.get(this.id)?.data??[],a=t.scale,o=e.scale,r=t.range,[l,c]=a.range,u=Math.abs(c-l);this.aggregationManager.ensureLevelForRange(u);const d=this.aggregationManager.getFilterForRange(u),g=this.contextNodeData?.nodeData,f=!this.ctx.animationManager.isSkipped(),y=g!=null&&(n.changeDescription!=null||!Sw(n)||d!=null);return{xAxis:t,yAxis:e,rawData:s,xValues:i.resolveKeysById(this,"xValue",n),yHighValues:i.resolveColumnById(this,"yHighValue",n),yLowValues:i.resolveColumnById(this,"yLowValue",n),xScale:a,yScale:o,xAxisRange:r,xOffset:(a.bandwidth??0)/2,dataAggregationFilter:d,range:u,labelsEnabled:this.properties.label.enabled,animationEnabled:f,canIncrementallyUpdate:y,xKey:this.properties.xKey,yLowKey:this.properties.yLowKey,yHighKey:this.properties.yHighKey,item:this.properties.item,yDomain:this.getSeriesDomain(z.Y).domain,connectMissingData:this.properties.connectMissingData,interpolation:this.properties.interpolation,nodes:y?g:[],labelData:[],spanPoints:[],nodeIndex:0}}xCoordinateRange(t){const e=this.axes[z.X].scale.convert(t);return[e,e]}yCoordinateRange(t){const e=this.axes[z.Y].scale.convert(t[0]);return[e,e]}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!(e&&i))return{domain:[]};const{domain:{keys:[n]}}=e;if(t===z.X){const s=i.resolveProcessedDataDefById(this,"xValue");if(s?.def.type==="key"&&s.def.valueType==="category"){const a=i.getKeySortMetadata(this,"xValue",e);return{domain:n,sortMetadata:a}}return{domain:W_(Ll(n))}}else{const s=this.domainForClippedRange(z.Y,["yHighValue","yLowValue"],"xValue"),a=xi(s);return{domain:W_(a)}}}getSeriesRange(t,e){return this.domainForVisibleRange(z.Y,["yHighValue","yLowValue"],"xValue",e)}handleDatumPoint(t,e,i,n,s){if(e.xValue=t.xValues[i],e.xValue===void 0&&!this.properties.allowNullKeys)return;e.datum=t.rawData[i],e.yHighValue=n??t.yHighValues[i],e.yLowValue=s??t.yLowValues[i];const a=t.spanPoints.at(-1);if(Number.isFinite(e.yHighValue)&&Number.isFinite(e.yLowValue)){if(e.inverted=e.yLowValue>e.yHighValue,e.x=t.xScale.convert(e.xValue)+t.xOffset,!Number.isFinite(e.x))return;e.yHighCoordinate=t.yScale.convert(e.yHighValue),e.yLowCoordinate=t.yScale.convert(e.yLowValue),this.upsertMarkerDatum(t,e,i,"high",e.yHighValue,e.yHighCoordinate),this.upsertMarkerDatum(t,e,i,"low",e.yLowValue,e.yLowCoordinate);const o={high:{point:{x:e.x,y:e.yHighCoordinate},xDatum:e.xValue,yDatum:e.yHighValue},low:{point:{x:e.x,y:e.yLowCoordinate},xDatum:e.xValue,yDatum:e.yLowValue}};Array.isArray(a)?a.push(o):a==null?t.spanPoints.push([o]):(a.skip+=1,t.spanPoints.push([o]))}else t.connectMissingData||(Array.isArray(a)||a==null?t.spanPoints.push({skip:0}):a.skip+=1)}upsertMarkerDatum(t,e,i,n,s,a){const{size:o}=t.item[n].marker;if(t.canIncrementallyUpdate&&t.nodeIndext.xScale.convert(t.xValues[s])+t.xOffset;if(e.input.count<1e3||t.dataAggregationFilter==null){let[s,a]=q_(1,t.xValues.length,t.xAxisRange,o=>{const r=n(o);return[r,r]});e.input.count<1e3&&(s=0,a=e.input.count),s=Math.max(s-1,0),a=Math.min(a+1,t.xValues.length);for(let o=s;o{const u=o[c];if(u!==sp)return[n(u),n(u)]});for(let c=r;c{if(!Array.isArray(l))return[];const c=l.map(u=>u.high);return X_(c,t.interpolation)}),a=t.spanPoints.flatMap(l=>{if(!Array.isArray(l))return[];const c=l.map(u=>u.low);return X_(c,t.interpolation)}),o=gct(this.properties.segmentation,i,n,this.chart.seriesRect,this.ctx.scene,!1);let r;if(this.properties.invertedStyle.enabled){const l=t.yHighValues[0]{const i=this.properties.item[e].strokeWidth??0,n=this.properties.highlight.highlightedSeries.item?.[e]?.strokeWidth??i,s=this.properties.highlight.highlightedItem.item?.[e]?.strokeWidth??i;return i>s||n>s};return t("low")||t("high")}updatePathNodes(t){const{visible:e}=t,[i,n,s]=t.paths,a=this.contextNodeData?.segments,o=this.ctx.highlightManager?.getActiveHighlight(),r=this.getHighlightState(o,!1),l=this.getHighlightStyle(),{item:c,fill:u,fillOpacity:d,opacity:g}=Et(l,this.getStyle(r));n.setProperties({datum:a,segments:a,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:fS.None,stroke:c.low.stroke,strokeWidth:c.low.strokeWidth,strokeOpacity:c.low.strokeOpacity,lineDash:c.low.lineDash,lineDashOffset:c.low.lineDashOffset,opacity:g,visible:e}),s.setProperties({segments:a,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:fS.None,stroke:c.high.stroke,strokeWidth:c.high.strokeWidth,strokeOpacity:c.high.strokeOpacity,lineDash:c.high.lineDash,lineDashOffset:c.high.lineDashOffset,opacity:g,visible:e});const f=this.getShapeFillBBox();i.setFillProperties(u,f),i.setStyleProperties({stroke:void 0,fill:u,fillOpacity:d,opacity:g},f);const y=this.contextNodeData?.intersectionSegments??a;i.setProperties({segments:y,pointerEvents:fS.None,lineJoin:"round",fillShadow:this.properties.shadow,opacity:g,visible:e}),i.datum=y,yw(this,i),yw(this,n),yw(this,s)}updatePaths(t){this.updateAreaPaths(t.paths,t.contextData)}updateAreaPaths(t,e){for(const i of t)i.visible=e.visible;if(e.visible)this.updateFillPath(t,e),this.updateStrokePath(t,e);else for(const i of t)i.path.clear(),i.markDirty("RangeArea")}updateFillPath(t,e){const[i]=t;i.path.clear(),cct(i,e.fillData),i.markDirty("RangeArea")}updateStrokePath(t,e){const[,i,n]=t;i.path.clear(),n.path.clear(),$_(i,e.lowStrokeData.spans),$_(n,e.highStrokeData.spans),i.markDirty("RangeArea"),n.markDirty("RangeArea")}resetDatumAnimation(t){bct([t.datumSelection])}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,{processedData:n,axes:s,properties:a}=this,o=a.styler?this.getStylerMarkerOptions().item:a.item,{low:r,high:l}=o,c=dct(n.input.count,s[z.X].scale,{enabled:r.marker.enabled||l.marker.enabled});(a.item.low.marker.isDirty()||a.item.high.marker.isDirty())&&(i.clear(),i.cleanup());let u;if(c)if(r.marker.enabled&&l.marker.enabled)u=e;else{u=[];for(const d of e)o[d.itemType].marker.enabled&&u.push(d)}else u=[];return Sw(this.processedData)?i.update(u,void 0,d=>xct(d.xValue,d.itemType)):i.update(u)}updateDatumStyles({datumSelection:t,isHighlight:e}){const i=this.ctx.highlightManager.getActiveHighlight();t.each((n,s)=>{const a=this.getHighlightState(i,e,s.datumIndex),o=this.getStyle(a),{fill:r,fillOpacity:l,item:c}=o,{stroke:u,strokeWidth:d,strokeOpacity:g}=c[s.itemType],{marker:f}=this.properties.item[s.itemType],y=this.makeItemStylerParams(s.itemType);s.style=this.getMarkerStyle(f,s,y,{isHighlight:e,highlightState:a,resolveMarkerSubPath:["item",s.itemType,"marker"]},o.item[s.itemType].marker,{fill:r,fillOpacity:l,stroke:u,strokeWidth:d,strokeOpacity:g})})}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const{datumSelection:i,isHighlight:n}=t,s=this.getShapeFillBBox(),a=this.ctx.highlightManager.getActiveHighlight(),o=this.getDrawingMode(n,t.drawingMode);i.each((r,l)=>{const{itemType:c}=l,u=l.style??e.styles[c][this.getHighlightState(a,n,l.datumIndex)];this.applyMarkerStyle(u,r,l.point,s),r.drawingMode=o}),n||(this.properties.item.low.marker.markClean(),this.properties.item.high.marker.markClean())}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e,n=>{n.pointerEvents=fS.None})}updateLabelNodes(t){const e={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yName:this.properties.yName,yLowKey:this.properties.yLowKey,yLowName:this.properties.yLowName??this.properties.yLowKey,yHighKey:this.properties.yHighKey,yHighName:this.properties.yHighName??this.properties.yHighKey,legendItemName:this.properties.legendItemName},i=this.ctx.highlightManager?.getActiveHighlight(),{isHighlight:n=!1,labelSelection:s}=t;s.each((a,o)=>{a.fillOpacity=this.getHighlightStyle(n,o.datumIndex).opacity??1,tct(this,a,e,this.properties.label,o,n,i)})}getHighlightLabelData(t,e){return t?.length?t.filter(i=>i.datum===e.datum):[]}getHighlightData(t,e){const i=t.filter(n=>n.datum===e.datum).map(n=>({...n}));return i.length>0?i:void 0}getStyle(t){return this.getStylerCouple(t)[0]}getStylerMarkerOptions(){return this.getStylerCouple()[1]}getStylerCouple(t){const{fill:e,fillOpacity:i,item:n,styler:s}=this.properties;let a={};if(s){const c=this.makeStylerParams(t);a=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(s,c)??{},{pick:!1})??{}}const o={item:{low:{marker:{enabled:!1}},high:{marker:{enabled:!1}}}},r=c=>{const u=a.item?.[c],{lineDash:d,lineDashOffset:g,marker:f,stroke:y,strokeOpacity:x,strokeWidth:S}=n[c];return o.item[c].marker.enabled=u?.marker?.enabled??f.enabled,{marker:{fill:u?.marker?.fill??f.fill??e,fillOpacity:u?.marker?.fillOpacity??f.fillOpacity,shape:u?.marker?.shape??f.shape,size:u?.marker?.size??f.size,lineDash:u?.marker?.lineDash??f.lineDash,lineDashOffset:u?.marker?.lineDashOffset??f.lineDashOffset,stroke:u?.marker?.stroke??f.stroke??y,strokeOpacity:u?.marker?.strokeOpacity??f.strokeOpacity,strokeWidth:u?.marker?.strokeWidth??f.strokeWidth},lineDash:u?.lineDash??d,lineDashOffset:u?.lineDashOffset??g,stroke:u?.stroke??y,strokeOpacity:u?.strokeOpacity??x,strokeWidth:u?.strokeWidth??S}};return[{fill:a.fill??e,fillOpacity:a.fillOpacity??i,opacity:1,topLevel:{lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,marker:this.properties.marker,stroke:this.properties.stroke,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth},item:{low:r("low"),high:r("high")}},o]}makeStylerParams(t){const{id:e}=this,{fill:i,fillOpacity:n,item:s,xKey:a,yHighKey:o,yLowKey:r}=this.properties,l=fct(t??mct.None),c=u=>{const{lineDash:d,lineDashOffset:g,marker:f,stroke:y,strokeOpacity:x,strokeWidth:S}=s[u];return{marker:{fill:f.fill??i,fillOpacity:f.fillOpacity,size:f.size,shape:f.shape,stroke:f.stroke??y,strokeOpacity:f.strokeOpacity,strokeWidth:f.strokeWidth,lineDash:f.lineDash,lineDashOffset:f.lineDashOffset},lineDash:d,lineDashOffset:g,stroke:y,strokeOpacity:x,strokeWidth:S}};return{item:{low:c("low"),high:c("high")},fill:i,fillOpacity:n,highlightState:l,seriesId:e,xKey:a,yLowKey:r,yHighKey:o}}makeItemStylerParams(t){const{xKey:e,yLowKey:i,yHighKey:n}=this.properties;return{xKey:e,yLowKey:i,yHighKey:n,itemType:t}}getTooltipContent(t,e){const i=e?.itemType??"high",{id:n,dataModel:s,processedData:a,axes:o,properties:r}=this,{xName:l,yName:c,yLowKey:u,yLowName:d,xKey:g,yHighKey:f,yHighName:y,tooltip:x,legendItemName:S}=r,D=o[z.X],A=o[z.Y];if(!s||!a||!D||!A)return;const I=a.dataSources.get(this.id)?.data[t],w=s.resolveKeysById(this,"xValue",a)[t],N=s.resolveColumnById(this,"yHighValue",a)[t],O=s.resolveColumnById(this,"yLowValue",a)[t],L=this.properties.allowNullKeys??!1;if(w===void 0&&!L)return;const R=this.getStyle(),P=this.makeItemStylerParams(i),B=this.getMarkerStyle(this.properties.item[i].marker,{datumIndex:t,datum:I},P,{isHighlight:!1,resolveMarkerSubPath:["item",i,"marker"]},R.item[i].marker),F=`${this.getAxisValueText(A,"tooltip",O,I,u,S)} - ${this.getAxisValueText(A,"tooltip",N,I,f,S)}`;return this.formatTooltipWithContext(x,{heading:this.getAxisValueText(D,"tooltip",w,I,g,S),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:`${d??u} - ${y??f}`,value:F,missing:j.isTooltipValueMissing(N)&&j.isTooltipValueMissing(O)}]},{seriesId:n,datum:I,title:c,itemType:i,xName:l,yName:c,yLowKey:u,yLowName:d,xKey:g,yHighKey:f,yHighName:y,legendItemName:S,...B})}legendItemSymbol(){const{fill:t,topLevel:e}=this.getStyle(),{stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,marker:o}=e;return{marker:{shape:o.shape,fill:o.fill??t,stroke:o.stroke??i,fillOpacity:o.fillOpacity,strokeOpacity:o.strokeOpacity,strokeWidth:o.strokeWidth,lineDash:o.lineDash,lineDashOffset:o.lineDashOffset},line:{enabled:!0,stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:a}}}getLegendData(t){if(t!=="category")return[];const{id:e,visible:i}=this,{yLowKey:n,yHighKey:s,yName:a,yLowName:o,yHighName:r,legendItemName:l,showInLegend:c}=this.properties,u=l??a??`${o??n} - ${r??s}`,d=`${n}-${s}`;return[{legendType:"category",id:e,itemId:d,seriesId:e,enabled:i,label:{text:`${u}`},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!c}]}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new hct}animateEmptyUpdateReady(t){const{datumSelection:e,labelSelection:i,contextData:n,paths:s}=t,{animationManager:a}=this.ctx;this.updateAreaPaths(s,n),sct(this,a,...s),act([e],K_),oct(this,a,{...this.getAnimationDrawingModes(),phase:"initial"},e),mw(this,"labels",a,i,this.highlightLabelSelection)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateAreaPaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){const{animationManager:e}=this.ctx,{datumSelection:i,labelSelection:n,contextData:s,paths:a,previousContextData:o}=t,[r,l,c]=a;if(r==null&&l==null&&c==null)return;this.resetDatumAnimation(t),this.resetLabelAnimation(t);const u=()=>{this.resetPathAnimation(t),this.updateAreaPaths(a,s)},d=()=>{e.skipCurrentBatch(),u()};if(s==null||o==null){u(),Z_(this,e,"added",this.getAnimationDrawingModes(),i),bw(this,"fill_path_properties",e,"add",r),bw(this,"low_stroke_path_properties",e,"add",l),bw(this,"high_stroke_path_properties",e,"add",c),mw(this,"labels",e,n,this.highlightLabelSelection);return}const g=Xlt(s,o,this.processedData?.reduced?.diff?.[this.id]);if(g===void 0){d();return}else if(g.status==="no-op")return;xw(this.id,"fill_path_properties",e,[r],g.fill.pathProperties),xw(this.id,"low_stroke_path_properties",e,[l],g.stroke.pathProperties),xw(this.id,"high_stroke_path_properties",e,[c],g.stroke.pathProperties),g.status==="added"?this.updateAreaPaths(a,s):g.status==="removed"?this.updateAreaPaths(a,o):(vw(this.id,"fill_path_update",e,[r],g.fill.path),vw(this.id,"low_stroke_path_update",e,[l],g.stroke.path),vw(this.id,"high_stroke_path_update",e,[c],g.stroke.path)),g.hasMotion&&(Z_(this,e,void 0,this.getAnimationDrawingModes(),i),mw(this,"labels",e,n,this.highlightLabelSelection)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(a,s)})}getFormattedMarkerStyle(t){const e=this.getStyle(),i=this.makeItemStylerParams(t.itemType);return this.getMarkerStyle(this.properties.item[t.itemType].marker,t,i,{isHighlight:!0,resolveMarkerSubPath:["item",t.itemType,"marker"]},void 0,e)}getMarkerStyle(t,e,i,n,s,a){return t.itemStyler=this.properties.marker.itemStyler,super.getMarkerStyle(t,e,i,n,s,a)}computeFocusBounds(t){const e=Y_(this,t),i=Y_(this,{...t,datumIndex:t.datumIndex+1});if(e&&i)return uct.merge([e,i])}isDatumEnabled(t,e){return e%2===0&&super.isDatumEnabled(t,e)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};s5.className="RangeAreaSeries";s5.type="range-area";var{rangeAreaSeriesThemeableOptionsDef:Sct}=j,BO={..._e,...Sct,type:ht(Jt("range-area")),xKey:ht(K),yLowKey:ht(K),yHighKey:ht(K),xKeyAxis:K,yKeyAxis:K,xName:K,yName:K,yLowName:K,yHighName:K,legendItemName:K,segmentation:Pc,invertedStyle:{enabled:J,...wt}};BO.pickOutsideVisibleMinorAxis=Mt(J);BO.focusPriority=Mt(gt);({...Oe},ie.NUMBER+"");var{predictCartesianNonPrimitiveAxis:Sbt}=j,Mct={options:BO,defaultAxes:{y:{type:ie.NUMBER,position:he.LEFT},x:{type:ie.CATEGORY,position:he.BOTTOM}},axisKeys:{[z.X]:"xKeyAxis",[z.Y]:"yKeyAxis"}};function Dct(t,e,i,n,s,a,o,r){const[l,c]=gn(t,s);return Eu([l,c],e,i,n,{smallestKeyInterval:a,xNeedsValueOf:o,yNeedsValueOf:r})}var Act=Pu(Dct);function Ict(t,e,i,n,s){const a=e.resolveKeysById(n,"xValue",i),o=e.resolveColumnById(n,"yHighValue",i),r=e.resolveColumnById(n,"yLowValue",i),l=e.getDomain(n,"xValue","key",i),c=e.resolveColumnNeedsValueOf(n,"xValue",i),u=e.resolveColumnNeedsValueOf(n,"yHighValue",i)??e.resolveColumnNeedsValueOf(n,"yLowValue",i);if(s){const[d,g]=gn(t,l);return Eu([d,g],a,o,r,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:c,yNeedsValueOf:u,existingFilters:s})}return Act(t,a,o,r,l,i.reduced?.smallestKeyInterval,c,u)}function kct(t,e,i,n,s,a){const o=e.resolveKeysById(n,"xValue",i),r=e.resolveColumnById(n,"yHighValue",i),l=e.resolveColumnById(n,"yLowValue",i),c=e.getDomain(n,"xValue","key",i),u=e.resolveColumnNeedsValueOf(n,"xValue",i),d=e.resolveColumnNeedsValueOf(n,"yHighValue",i)??e.resolveColumnNeedsValueOf(n,"yLowValue",i),[g,f]=gn(t,c);return bD([g,f],o,r,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,targetRange:s,xNeedsValueOf:u,yNeedsValueOf:d,existingFilters:a})}var{AbstractBarSeriesProperties:Cct,makeSeriesTooltip:wct,DropShadow:Nct,Label:Tct}=j,VO=class extends Tct{constructor(){super(...arguments),this.placement="inside",this.spacing=0}};M([b],VO.prototype,"placement");M([b],VO.prototype,"spacing");var bn=class extends Cct{constructor(){super(...arguments),this.fill="#99CCFF",this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.shadow=new Nct().set({enabled:!1}),this.label=new VO,this.tooltip=wct()}};M([b],bn.prototype,"xKey");M([b],bn.prototype,"yLowKey");M([b],bn.prototype,"yHighKey");M([b],bn.prototype,"xName");M([b],bn.prototype,"yName");M([b],bn.prototype,"yLowName");M([b],bn.prototype,"yHighName");M([b],bn.prototype,"fill");M([b],bn.prototype,"fillOpacity");M([b],bn.prototype,"stroke");M([b],bn.prototype,"strokeWidth");M([b],bn.prototype,"strokeOpacity");M([b],bn.prototype,"lineDash");M([b],bn.prototype,"lineDashOffset");M([b],bn.prototype,"cornerRadius");M([b],bn.prototype,"styler");M([b],bn.prototype,"itemStyler");M([b],bn.prototype,"shadow");M([b],bn.prototype,"label");M([b],bn.prototype,"tooltip");var{SeriesNodePickMode:Q_,valueProperty:J_,keyProperty:Lct,checkCrisp:Oct,updateLabelNode:Ect,SMALLEST_KEY_INTERVAL:Rct,LARGEST_KEY_INTERVAL:Pct,diff:zct,prepareBarAnimationFunctions:tF,midpointStartingBarPosition:eF,resetBarSelectionsFn:Bct,resetBarSelectionsDirect:Vct,fixNumericExtent:_ct,seriesLabelFadeInAnimation:iF,resetLabelFn:Fct,animationValidation:Hct,computeBarFocusBounds:jct,visibleRangeIndices:Gct,createDatumId:Uct,Rect:Wct,PointerEvents:Kct,motion:nF,processedDataIsAnimatable:Mw,getItemStyles:Yct,calculateSegments:$ct,toHighlightString:Xct,HighlightState:sF,AggregationManager:Zct,upsertNodeDatum:Dw}=j,qct=class extends j.SeriesNodeEvent{constructor(t,e,i,n){super(t,e,i,n),this.xKey=n.properties.xKey,this.yLowKey=n.properties.yLowKey,this.yHighKey=n.properties.yHighKey}},a5=class extends j.AbstractBarSeries{constructor(t){super({moduleCtx:t,pickModes:[Q_.AXIS_ALIGNED,Q_.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["yLowKey","yHighKey"]},propertyNames:{x:["xName"],y:["yLowName","yHighName","yName"]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:Bct,label:Fct}}),this.properties=new bn,this.aggregationManager=new Zct,this.NodeEvent=qct}async processData(t){const{xKey:e,yLowKey:i,yHighKey:n}=this.properties,s=this.getCategoryAxis()?.scale,a=this.getValueAxis()?.scale,{isContinuousX:o,xScaleType:r,yScaleType:l}=this.getScaleInformation({xScale:s,yScale:a}),c=[];this.needsDataModelDiff()&&this.processedData&&c.push(zct(this.id,this.processedData)),this.ctx.animationManager.isSkipped()||c.push(Hct());const u=this.visible?{}:{forceValue:Number.NaN},d=this.properties.allowNullKeys??!1,{dataModel:g,processedData:f}=await this.requestDataModel(t,this.data,{props:[Lct(e,r,{id:"xValue",allowNullKey:d}),J_(i,l,{id:"yLowValue",invalidValue:null,...u}),J_(n,l,{id:"yHighValue",invalidValue:null,...u}),...o?[Rct,Pct]:[],...c],groupByKeys:!1});this.smallestDataInterval=f.reduced?.smallestKeyInterval,this.largestDataInterval=f.reduced?.largestKeyInterval,this.aggregateData(g,f),this.animationState.transition("updateData")}aggregateData(t,e){if(this.aggregationManager.markStale(e.input.count),e.type!=="ungrouped"||Mw(e))return;const i=this.axes[z.X];if(i==null)return;const n=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>kct(i.scale.type,t,e,this,n,a),computeFull:a=>Ict(i.scale.type,t,e,this,a),targetRange:n});const s=this.aggregationManager.filters;s&&s.length>0&&Vr.record(`${this.type}:aggregation`,s.map(a=>a.maxRange))}estimateTargetRange(){const t=this.axes[z.X];if(t?.scale==null)return 0;const[e,i]=t.scale.range;return Math.abs(i-e)}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i)return{domain:[]};const{keys:[n]}=e.domain;if(t===this.getCategoryDirection()){const s=i.resolveProcessedDataDefById(this,"xValue");if(s?.def.type==="key"&&s?.def.valueType==="category"){const a=i.getKeySortMetadata(this,"xValue",e);return{domain:n,sortMetadata:a}}return{domain:this.padBandExtent(n)}}else{const s=this.domainForClippedRange(t,["yHighValue","yLowValue"],"xValue"),a=xi(s);return{domain:_ct(a)}}}getSeriesRange(t,e){return this.domainForVisibleRange(z.Y,["yHighValue","yLowValue"],"xValue",e)}createNodeDatumContext(t,e){const{dataModel:i,processedData:n}=this;if(!i||!n)return;const s=n.dataSources?.get(this.id)?.data;if(s==null)return;const a=t.scale,o=e.scale,r=this.getBarDirection()===z.X,l=Oct(t?.scale,t?.visibleRange,this.smallestDataInterval,this.largestDataInterval),[c,u]=a.range,d=Math.abs(u-c);this.aggregationManager.ensureLevelForRange(d);const g=this.aggregationManager.getFilterForRange(d),f=!this.ctx.animationManager.isSkipped(),y=this.contextNodeData?.nodeData!=null&&(n.changeDescription!=null||!Mw(n)||g!=null),{groupOffset:x,barOffset:S,barWidth:D}=this.getBarDimensions();return{xAxis:t,yAxis:e,rawData:s,xValues:i.resolveKeysById(this,"xValue",n),yLowValues:i.resolveColumnById(this,"yLowValue",n),yHighValues:i.resolveColumnById(this,"yHighValue",n),xScale:a,yScale:o,groupOffset:x,barOffset:S,barWidth:D,barAlongX:r,crisp:l,dataAggregationFilter:g,animationEnabled:f,xKey:this.properties.xKey,yLowKey:this.properties.yLowKey,yHighKey:this.properties.yHighKey,labelEnabled:this.properties.label.enabled,labelPlacement:this.properties.label.placement,labelPadding:(this.properties.label.spacing+(typeof this.properties.label.padding=="number"?this.properties.label.padding:0))*(this.properties.label.placement==="outside"?1:-1),canIncrementallyUpdate:y,nodes:y?this.contextNodeData.nodeData:[],nodeIndex:0}}prepareNodeDatumState(t,e,i){const n=t.rawData[i],s=t.xValues[i];if(s===void 0&&!this.properties.allowNullKeys)return;const a=t.yLowValues[i],o=t.yHighValues[i];if(!Number.isFinite(a?.valueOf())||!Number.isFinite(o?.valueOf()))return;const[r,l]=a{const g=d*er,f=r[g+wa],y=l[d];if(y!==-1)return[e(y),e(f)+t.barWidth]});for(let d=c;dthis.createNodeDatum(I,w,n,s),(I,w,N)=>this.updateNodeDatum(I,w,N,s)))}}createNodeDataSimple(t,e,i,n,s,a){const o=a.invalidData?.get(this.id);let[r,l]=this.visibleRangeIndices("xValue",t.xAxis.range);a.input.count<1e3&&(r=0,l=a.input.count);for(let c=r;cthis.createNodeDatum(u,d,n,s),(u,d,g)=>this.updateNodeDatum(u,d,g,s)))}createNodeDataGrouped(t,e,i,n,s){const a=this.processedData;for(const{datumIndex:o,groupIndex:r}of this.dataModel.forEachGroupDatum(this,a))i.datumIndex=o,i.groupedDataIndex=r,i.x=e(o),i.width=t.barWidth,i.yLow=t.yLowValues[o],i.yHigh=t.yHighValues[o],i.crisp=t.crisp,Dw(t,i,(l,c)=>this.createNodeDatum(l,c,n,s),(l,c,u)=>this.updateNodeDatum(l,c,u,s))}populateNodeData(t){const{processedData:e}=this;if(!e)return;const{yLowKey:i,yHighKey:n,strokeWidth:s}=this.properties,a=`${i}-${n}`,o=l=>{const c=t.xScale.convert(t.xValues[l]);return Number.isFinite(c)?Math.round(c)+t.groupOffset+t.barOffset:Number.NaN},r={nodeDatumScratch:{datum:void 0,xValue:void 0,yLowValue:0,yHighValue:0,rawLowValue:void 0,rawHighValue:void 0},labelParamsScratch:{labels:[],datumIndex:0,rectX:0,rectY:0,rectWidth:0,rectHeight:0,yLowValue:0,yHighValue:0,datum:void 0},datumIndex:0,groupedDataIndex:0,x:0,width:0,yLow:0,yHigh:0,crisp:!1};t.dataAggregationFilter!=null?this.createNodeDataWithAggregation(t,o,r,a,s,t.dataAggregationFilter):e.type==="ungrouped"?this.createNodeDataSimple(t,o,r,a,s,e):this.createNodeDataGrouped(t,o,r,a,s)}finalizeNodeData(t){t.canIncrementallyUpdate&&t.nodeIndex0&&(i.length=0);return}const{xKey:n,yLowKey:s,yHighKey:a,xName:o,yLowName:r,yHighName:l,yName:c,legendItemName:u,label:d}=this.properties,g=t.barAlongX,f=t.labelPlacement,y=t.labelPadding,x=e.rectX,S=e.rectY,D=e.rectWidth,A=e.rectHeight,I=x+(g?-y:D/2),w=S+(g?A/2:A+y);let N;f==="outside"?N=g?"right":"center":N=g?"left":"center";let O;f==="outside"?O=g?"middle":"top":O=g?"middle":"bottom";const L=x+(g?D+y:D/2),R=S+(g?A/2:-y);let P;f==="outside"?P=g?"left":"center":P=g?"right":"center";let B;f==="outside"?B=g?"middle":"bottom":B=g?"middle":"top";const F=e.datum,H=e.yLowValue,$=e.yHighValue,Y=e.datumIndex,U={datum:F,xKey:n,yLowKey:s,yHighKey:a,xName:o,yLowName:r,yHighName:l,yName:c,legendItemName:u},V=this.getSeriesDomain(z.Y).domain,Z=this.getLabelText(H,F,s,"y",V,d,{itemType:"low",value:H,...U}),W=this.getLabelText($,F,a,"y",V,d,{itemType:"high",value:$,...U});if(i.length>0&&i[0].itemType==="low"){const q=i[0];q.datumIndex=Y,q.x=I,q.y=w,q.textAlign=N,q.textBaseline=O,q.text=Z,q.datum=F}else i[0]={datumIndex:Y,x:I,y:w,textAlign:N,textBaseline:O,text:Z,itemType:"low",datum:F,series:this};if(i.length>1&&i[1].itemType==="high"){const q=i[1];q.datumIndex=Y,q.x=L,q.y=R,q.textAlign=P,q.textBaseline=B,q.text=W,q.datum=F}else i[1]={datumIndex:Y,x:L,y:R,textAlign:P,textBaseline:B,text:W,itemType:"high",datum:F,series:this};i.length=2}nodeFactory(){return new Wct}getStyle(t,e){const{cornerRadius:i,fill:n,fillOpacity:s,lineDash:a,lineDashOffset:o,stroke:r,strokeOpacity:l,strokeWidth:c,styler:u}=this.properties;let d={};if(!t&&u){const g=this.makeStylerParams(e);d=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(u,g)??{},{pick:!1})??{}}return{cornerRadius:d.cornerRadius??i,fill:d.fill??n,fillOpacity:d.fillOpacity??s,lineDash:d.lineDash??a,lineDashOffset:d.lineDashOffset??o,opacity:1,stroke:d.stroke??r,strokeOpacity:d.strokeOpacity??l,strokeWidth:d.strokeWidth??c}}makeStylerParams(t){const{id:e}=this,{cornerRadius:i,fill:n,fillOpacity:s,lineDash:a,lineDashOffset:o,stroke:r,strokeOpacity:l,strokeWidth:c,xKey:u,yLowKey:d,yHighKey:g}=this.properties,f=Xct(t??sF.None);return{cornerRadius:i,fill:n,fillOpacity:s,highlightState:f,lineDash:a,lineDashOffset:o,seriesId:e,stroke:r,strokeOpacity:l,strokeWidth:c,xKey:u,yLowKey:d,yHighKey:g}}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,n=e??[];return Mw(this.processedData)?i.update(n,void 0,s=>this.getDatumId(s)):i.update(n)}getItemStyle(t,e,i){const{properties:n,dataModel:s,processedData:a}=this,{itemStyler:o}=n,r=this.getHighlightStyle(e,t,i);let l=Et(r,this.getStyle(t===void 0,i));if(o&&s!=null&&a!=null&&t!=null){const c=s.resolveKeysById(this,"xValue",a)[t],u=this.cachedDatumCallback(Uct(this.getDatumId({xValue:c}),e?"highlight":"node"),()=>{const d=this.makeItemStylerParams(t,e,l);return this.callWithContext(o,d)});u&&(l=Et(u,l))}return l}makeItemStylerParams(t,e,i){const{id:n,properties:s,processedData:a}=this,{xKey:o,yHighKey:r,yLowKey:l}=s,c=a.dataSources.get(n)?.data[t],u=this.ctx.highlightManager?.getActiveHighlight(),d=this.getHighlightStateString(u,e,t),g=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:n,datum:c,xKey:o,yHighKey:r,yLowKey:l,highlightState:d,...i,fill:g}}updateDatumStyles(t){const e=this.ctx.highlightManager.getActiveHighlight();t.datumSelection.each((i,n)=>{if(!t.datumSelection.isGarbage(i)){const s=this.getHighlightState(e,t.isHighlight,n.datumIndex);n.style=this.getItemStyle(n.datumIndex,t.isHighlight,s)}})}updateDatumNodes({datumSelection:t,isHighlight:e}){const{contextNodeData:i}=this;if(!i)return;const n=this.ctx.highlightManager.getActiveHighlight(),s=this.getCategoryDirection()===z.X,a=this.getShapeFillBBox(),o=this;t.each(function(l,c){const u=c.style??i.styles[o.getHighlightState(n,e,c.datumIndex)];l.setStyleProperties(u,a),l.setStaticProperties("overlay",u.cornerRadius??0,u.cornerRadius??0,u.cornerRadius??0,u.cornerRadius??0,s?c.width>0:c.height>0,c.crisp,void 0)})}updateLabelSelection(t){const e=this.properties.label.enabled?t.labelData:[];return t.labelSelection.update(e,i=>{i.pointerEvents=Kct.None})}updateLabelNodes(t){const{isHighlight:e=!1}=t,i={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yName:this.properties.yName,yLowKey:this.properties.yLowKey,yLowName:this.properties.yLowName??this.properties.yLowKey,yHighKey:this.properties.yHighKey,yHighName:this.properties.yHighName??this.properties.yHighKey,legendItemName:this.properties.legendItemName},n=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((s,a)=>{s.fillOpacity=this.getHighlightStyle(e,a?.datumIndex).opacity??1,Ect(this,s,i,this.properties.label,a,e,n)})}getHighlightLabelData(t,e){return e.labels?.length?e.labels:super.getHighlightLabelData(t,e)}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,properties:s}=this,{xKey:a,xName:o,yName:r,yLowKey:l,yHighKey:c,yLowName:u,yHighName:d,tooltip:g,legendItemName:f}=s,y=this.getCategoryAxis(),x=this.getValueAxis();if(!i||!n||!y||!x)return;const S=n.dataSources.get(this.id)?.data[t],D=i.resolveKeysById(this,"xValue",n)[t],A=i.resolveColumnById(this,"yHighValue",n)[t],I=i.resolveColumnById(this,"yLowValue",n)[t],w=this.properties.allowNullKeys??!1;if(D===void 0&&!w)return;const N=this.getItemStyle(t,!1),O=`${this.getAxisValueText(x,"tooltip",I,S,l,f)} - ${this.getAxisValueText(x,"tooltip",A,S,c,f)}`;return this.formatTooltipWithContext(g,{heading:this.getAxisValueText(y,"tooltip",D,S,a,f),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:`${u??l} - ${d??c}`,value:O,missing:j.isTooltipValueMissing(A)&&j.isTooltipValueMissing(I)}]},{seriesId:e,datum:S,title:r,xKey:a,xName:o,yName:r,yLowKey:l,yHighKey:c,yLowName:u,yHighName:d,legendItemName:f,...N})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,fillOpacity:n,strokeOpacity:s,lineDash:a,lineDashOffset:o}=this.getStyle(!1,sF.None);return{marker:{fill:t,stroke:e,fillOpacity:n,strokeOpacity:s,strokeWidth:i,lineDash:a,lineDashOffset:o}}}getLegendData(t){if(t!=="category")return[];const{id:e,visible:i}=this,{yName:n,yLowName:s,yHighName:a,yLowKey:o,yHighKey:r,legendItemName:l,showInLegend:c}=this.properties,u=l??n??`${s??o} - ${a??r}`,d=`${o}-${r}`;return[{legendType:"category",id:e,itemId:d,seriesId:e,enabled:i,label:{text:`${u}`},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!c}]}resetDatumAnimation(t){Vct([t.datumSelection])}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){const i=tF(eF(this.isVertical(),"normal"),"unknown");nF.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],i),iF(this,"labels",this.ctx.animationManager,e,this.highlightLabelSelection)}animateWaitingUpdateReady(t){const{datumSelection:e,labelSelection:i,contextData:n,previousContextData:s}=t,a=j.calculateDataDiff(this.id,e,this.getDatumId.bind(this),n,s,this.processedData,this.processedDataUpdated);this.ctx.animationManager.stopByAnimationGroupId(this.id);const o=s==null?"fade":"normal",r=tF(eF(this.isVertical(),o),"added");nF.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],r,(l,c)=>this.getDatumId(c),a),(a?.changed||!yl(n.groupScale,s?.groupScale))&&iF(this,"labels",this.ctx.animationManager,i,this.highlightLabelSelection)}getDatumId(t){return`${t.xValue}`}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){return jct(this,this.contextNodeData?.nodeData[t])}hasItemStylers(){return this.properties.styler!=null||this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};a5.className="RangeBarSeries";a5.type="range-bar";var{rangeBarSeriesThemeableOptionsDef:Qct}=j,_O={..._e,...Qct,type:ht(Jt("range-bar")),xKey:ht(K),yLowKey:ht(K),yHighKey:ht(K),xKeyAxis:K,yKeyAxis:K,xName:K,yName:K,yLowName:K,yHighName:K,legendItemName:K,segmentation:Pc,width:bo,widthRatio:Ot};_O.pickOutsideVisibleMinorAxis=Mt(J);_O.focusPriority=Mt(gt);({...Oe},ie.NUMBER+"");var{predictCartesianNonPrimitiveAxis:Mbt}=j,Jct={options:_O,axisKeys:{[z.X]:"xKeyAxis",[z.Y]:"yKeyAxis"},axisKeysFlipped:{[z.X]:"yKeyAxis",[z.Y]:"xKeyAxis"}},{AbstractBarSeriesProperties:tht,makeSeriesTooltip:eht,DropShadow:iht,Label:nht}=j,BA=class extends xt{};M([b],BA.prototype,"totalType");M([b],BA.prototype,"index");M([b],BA.prototype,"axisLabel");var o5=class extends xt{};M([b],o5.prototype,"renderer");var FO=class extends nht{constructor(){super(...arguments),this.placement="outside-end",this.spacing=0}};M([b],FO.prototype,"placement");M([b],FO.prototype,"spacing");var Us=class extends xt{constructor(){super(...arguments),this.fill="#c16068",this.stroke="#c16068",this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=1,this.cornerRadius=0,this.shadow=new iht().set({enabled:!1}),this.label=new FO,this.tooltip=new o5}};M([b],Us.prototype,"name");M([b],Us.prototype,"fill");M([b],Us.prototype,"stroke");M([b],Us.prototype,"fillOpacity");M([b],Us.prototype,"strokeOpacity");M([b],Us.prototype,"lineDash");M([b],Us.prototype,"lineDashOffset");M([b],Us.prototype,"strokeWidth");M([b],Us.prototype,"cornerRadius");M([b],Us.prototype,"itemStyler");M([b],Us.prototype,"shadow");M([b],Us.prototype,"label");M([b],Us.prototype,"tooltip");var Gp=class extends xt{constructor(){super(...arguments),this.enabled=!0,this.stroke="black",this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=2}};M([b],Gp.prototype,"enabled");M([b],Gp.prototype,"stroke");M([b],Gp.prototype,"strokeOpacity");M([b],Gp.prototype,"lineDash");M([b],Gp.prototype,"lineDashOffset");M([b],Gp.prototype,"strokeWidth");var VA=class extends xt{constructor(){super(...arguments),this.positive=new Us,this.negative=new Us,this.total=new Us}};M([b],VA.prototype,"positive");M([b],VA.prototype,"negative");M([b],VA.prototype,"total");var Jc=class extends tht{constructor(){super(...arguments),this.item=new VA,this.totals=new ss(BA),this.line=new Gp,this.tooltip=eht()}getStyle(t){const{fillOpacity:e,strokeWidth:i,strokeOpacity:n,fill:s,stroke:a,lineDash:o,lineDashOffset:r,cornerRadius:l}=this.item[t==="subtotal"?"total":t];return{fill:s,fillOpacity:e,stroke:a,strokeWidth:i,strokeOpacity:n,lineDash:o,lineDashOffset:r,cornerRadius:l,opacity:1}}};M([b],Jc.prototype,"xKey");M([b],Jc.prototype,"yKey");M([b],Jc.prototype,"xName");M([b],Jc.prototype,"yName");M([b],Jc.prototype,"item");M([b],Jc.prototype,"totals");M([b],Jc.prototype,"line");M([b],Jc.prototype,"tooltip");var{adjustLabelPlacement:sht,SeriesNodePickMode:aF,fixNumericExtent:aht,valueProperty:oF,keyProperty:oht,accumulativeValueProperty:mS,trailingAccumulatedValueProperty:rht,createDatumId:Aw,checkCrisp:lht,updateLabelNode:cht,prepareBarAnimationFunctions:hht,collapsedStartingBarPosition:uht,resetBarSelectionsDirect:dht,resetBarSelectionsFn:pht,seriesLabelFadeInAnimation:ght,resetLabelFn:fht,animationValidation:mht,DEFAULT_CARTESIAN_DIRECTION_KEYS:yht,DEFAULT_CARTESIAN_DIRECTION_NAMES:bht,computeBarFocusBounds:xht,Rect:vht,motion:Sht,getItemStylesPerItemId:Mht,DataSet:Dht,processedDataIsAnimatable:Aht,upsertNodeDatum:Iht}=j,r5=class extends j.AbstractBarSeries{constructor(t){super({moduleCtx:t,propertyKeys:yht,propertyNames:bht,categoryKey:void 0,pickModes:[aF.NEAREST_NODE,aF.EXACT_SHAPE_MATCH],pathsPerSeries:["connector"],pathsZIndexSubOrderOffset:[-1,-1],animationResetFns:{datum:pht,label:fht}}),this.properties=new Jc,this.seriesItemTypes=new Set(["positive","negative","total"])}async processData(t){const{xKey:e,yKey:i,totals:n}=this.properties,{data:s}=this;if(!this.visible)return;const a=I=>Af(I)&&Number(I)>=0,o=I=>Af(I)&&Number(I)>=0,r=I=>I==="total"||I==="subtotal",l={missingValue:void 0,invalidValue:void 0},c=[],u=n.reduce((I,w)=>{const N=I.get(w.index);return N?N.push(w):I.set(w.index,[w]),I},new Map);for(const[I,w]of s?.data.entries()??[]){c.push(w);const N=u.get(I);if(N)for(const O of N)c.push({...O.toJson(),[e]:O.axisLabel})}const d=[];this.ctx.animationManager.isSkipped()||d.push(mht());const g=this.getCategoryAxis()?.scale,f=this.getValueAxis()?.scale,{isContinuousX:y,xScaleType:x,yScaleType:S}=this.getScaleInformation({xScale:g,yScale:f}),D=this.properties.allowNullKeys??!1,{processedData:A}=await this.requestDataModel(t,Dht.wrap(c),{props:[oht(e,x,{id:"xValue",allowNullKey:D}),mS(i,S,{...l,id:"yCurrent"}),mS(i,S,{...l,missingValue:0,id:"yCurrentTotal"}),mS(i,S,{...l,id:"yCurrentPositive",validation:a}),mS(i,S,{...l,id:"yCurrentNegative",validation:o}),rht(i,S,{...l,id:"yPrevious"}),oF(i,S,{id:"yRaw"}),oF("totalType","category",{id:"totalTypeValue",missingValue:void 0,validation:r}),...y?[j.SMALLEST_KEY_INTERVAL,j.LARGEST_KEY_INTERVAL]:[],...d]});this.smallestDataInterval=A.reduced?.smallestKeyInterval,this.largestDataInterval=A.reduced?.largestKeyInterval,this.updateSeriesItemTypes(),this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i)return{domain:[]};const{keys:[n],values:s}=e.domain;if(t===this.getCategoryDirection()){const a=i.resolveProcessedDataDefById(this,"xValue");if(a?.def.type==="key"&&a?.def.valueType==="category"){const l=i.getKeySortMetadata(this,"xValue",e);return{domain:n,sortMetadata:l}}const o=t===z.Y,r=this.getCategoryAxis().isReversed();return{domain:this.padBandExtent(n,r!==o)}}else{const a=i.resolveProcessedDataIndexById(this,"yCurrent"),o=s[a],r=[Math.min(0,o[0]),Math.max(0,o[1])];return{domain:aht(r)}}}getSeriesRange(){return[Number.NaN,Number.NaN]}populateNodeData(t){let e=0;const i={datumIndex:0,datum:void 0,xDatum:void 0,value:void 0,cumulativeValue:void 0,trailingValue:void 0,datumType:void 0};for(const[n,s]of t.rawData.entries()){const a=t.totalTypeValues[n],o=this.isSubtotal(a),r=this.isTotal(a),l=r||o,c=t.xValues[n];if(c===void 0&&!this.properties.allowNullKeys)continue;const u=t.yRawValues[n],{cumulativeValue:d,trailingValue:g}=this.computeWaterfallValues(t,n,r,o,e);l&&(e=d??0);const f=this.computeDisplayValue(r,o,u,d,g);i.datumIndex=n,i.datum=s,i.xDatum=c,i.value=f,i.cumulativeValue=d,i.trailingValue=g,i.datumType=a;const y=Iht(t,i,(x,S)=>this.createNodeDatum(x,S),(x,S,D)=>this.updateNodeDatum(x,S,D));if(y){const x=this.createPointDatum(t,y,d,g,l);t.pointData.push(x)}}}finalizeNodeData(t){t.nodeIndex=0,g=this.getSeriesItemType(d,u);return{index:a,series:this,itemType:g,datum:o,datumIndex:a,cumulativeValue:c??0,xValue:r,yValue:l,yKey:n,xKey:i,x:0,y:0,width:0,height:0,midPoint:{x:0,y:0},crisp:s,label:{text:"",x:0,y:0,textAlign:"center",textBaseline:"middle"}}}updateNodeDatum(t,e,i){const{xScale:n,yScale:s,barAlongX:a,barWidth:o,valueAxisReversed:r,xKey:l,yKey:c,xName:u,yName:d,yDomain:g,crisp:f}=t,{datumIndex:y,datum:x,xDatum:S,value:D,cumulativeValue:A,trailingValue:I,datumType:w}=i,N=e,O=Math.round(n.convert(S));if(!Number.isFinite(O))return;const L=(D??0)>=0,R=this.getSeriesItemType(L,w),{strokeWidth:P,label:B}=this.getItemConfig(R),F=Math.round(s.convert(A)),H=Math.round(s.convert(I)),$=L?F:H,Y=L?H:F,U=Math.max(P,Math.abs(Y-$)),V=a?Math.min($,Y):O,Z=a?O:Math.min($,Y),W=a?U:o,q=a?o:U;if(N.index=y,N.itemType=R,N.datum=x,N.datumIndex=y,N.cumulativeValue=A??0,N.xValue=S,N.yValue=D,N.x=V,N.y=Z,N.width=W,N.height=q,N.crisp=f,N.midPoint?(N.midPoint.x=V+W/2,N.midPoint.y=Z+q/2):N.midPoint={x:V+W/2,y:Z+q/2},B.enabled){const nt=R==="subtotal"?"total":R,G=this.getLabelText(D,x,c,"y",g,B,{itemType:nt,value:D,datum:x,xKey:l,yKey:c,xName:u,yName:d}),et=B.spacing+(typeof B.padding=="number"?B.padding:0),st=sht({isUpward:(D??-1)>=0!==r,isVertical:!a,placement:B.placement,spacing:et,rect:{x:V,y:Z,width:W,height:q}});N.label.text=G,N.label.x=st.x,N.label.y=st.y,N.label.textAlign=st.textAlign,N.label.textBaseline=st.textBaseline}else N.label.text=""}createNodeDatum(t,e){const i=this.createSkeletonNodeDatum(t,e);return this.updateNodeDatum(t,i,e),i}createPointDatum(t,e,i,n,s){const{yScale:a,barAlongX:o,categoryAxisReversed:r,lineStrokeWidth:l}=t,c=Math.round(a.convert(i)),u=Math.round(a.convert(n)),d=s?c:u,g=Math.floor(l)%2/2,f=r?c:d,y=r?d:c,x={x:e.x,y:e.y,width:e.width,height:e.height};let S,D;return o?(S={x:f+g,y:x.y},D={x:y+g,y:x.y+x.height}):(S={x:x.x,y:f+g},D={x:x.x+x.width,y:y+g}),{x:r?D.x:S.x,y:r?D.y:S.y,x2:r?S.x:D.x,y2:r?S.y:D.y,size:0}}updateSeriesItemTypes(){const{dataModel:t,seriesItemTypes:e,processedData:i}=this;if(!t||!i)return;e.clear();const n=t.resolveProcessedDataIndexById(this,"yCurrentPositive"),s=t.resolveProcessedDataIndexById(this,"yCurrentNegative"),a=t.resolveProcessedDataIndexById(this,"totalTypeValue"),o=i.domain.values[n]??[],r=i.domain.values[s]??[];o.length>0&&e.add("positive"),r.length>0&&e.add("negative");const l=i?.domain.values[a];if(l)for(const c of l)(c==="total"||c==="subtotal")&&e.add("total")}isSubtotal(t){return t==="subtotal"}isTotal(t){return t==="total"}nodeFactory(){return new vht}getSeriesItemType(t,e){return e??(t?"positive":"negative")}getItemConfig(t){switch(t){case"positive":return this.properties.item.positive;case"negative":return this.properties.item.negative;case"subtotal":case"total":return this.properties.item.total}}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,n=e??[];return Aht(this.processedData)?i.update(n,void 0,s=>Aw(s.datumIndex)):i.update(n)}getItemStyle(t,e,i,n="total"){const{properties:s}=this,{datumIndex:a=0,datum:o}=t??{},r=n==="subtotal"?"total":n,l=s.item[r],c=this.getHighlightStyle(e,a,i),u=Et(c,s.getStyle(n)),{itemStyler:d}=l;let g=u;if(d!=null&&t!=null){const f=this.cachedDatumCallback(Aw(a,e?"highlight":"node"),()=>{const y=this.makeItemStylerParams(n,a,o,e,g);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`,"item",r],this.callWithContext(d,y))});f&&(g=Et(f,g))}return g}makeItemStylerParams(t,e,i,n,s){const{id:a,properties:o}=this,{xKey:r,yKey:l}=o,c=this.ctx.highlightManager?.getActiveHighlight(),u=this.getHighlightStateString(c,n,e),d=this.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:a,itemType:t,datum:i,xKey:r,yKey:l,highlightState:u,...s,fill:d}}updateDatumStyles({datumSelection:t,isHighlight:e}){t.each((i,n)=>{n.style=this.getItemStyle(n,e,void 0,n.itemType)})}updateDatumNodes({datumSelection:t,isHighlight:e}){const{contextNodeData:i}=this;if(!i)return;const n=this.ctx.highlightManager.getActiveHighlight(),s=this.getCategoryDirection()===z.X,a=this.getShapeFillBBox();t.each((o,r)=>{const l=r.style??i.styles[r.itemType][this.getHighlightState(n,e,r.datumIndex)];o.setStyleProperties(l,a),o.cornerRadius=l.cornerRadius??0,o.visible=s?r.width>0:r.height>0,o.crisp=r.crisp})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;if(e.length===0)return i.update([]);const n=e.filter(s=>{const{label:a}=this.getItemConfig(s.itemType);return a.enabled});return i.update(n)}updateLabelNodes({labelSelection:t,isHighlight:e}){const i={itemType:"positive",xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xName,yKey:this.properties.yKey,yName:this.properties.yName??this.properties.yName},n=this.ctx.highlightManager?.getActiveHighlight();t.each((s,a)=>{i.itemType=a.itemType;const o=this.getHighlightStyle(e,a.datumIndex)?.opacity??1;s.visible=!0,s.fillOpacity=o;const r=this.getItemConfig(a.itemType).label;cht(this,s,i,r,a.label,e,n)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,properties:s}=this,{xKey:a,xName:o,yKey:r,yName:l,tooltip:c,legendItemName:u}=s,d=this.getCategoryAxis(),g=this.getValueAxis();if(!i||!n||!d||!g)return;const f=n.dataSources.get(this.id)?.data[t],y=i.resolveKeysById(this,"xValue",n)[t],x=i.resolveColumnById(this,"yRaw",n)[t],S=i.resolveColumnById(this,"yCurrentTotal",n),D=i.resolveColumnById(this,"totalTypeValue",n),A=this.properties.allowNullKeys??!1;if(y===void 0&&!A)return;const I=D[t],w=(x??0)>=0,N=this.getSeriesItemType(w,I);let O;if(this.isTotal(I))O=S[t];else if(this.isSubtotal(I)){O=S[t];for(let P=t-1;P>=0;P-=1)if(this.isSubtotal(D[P])){O=O-S[P];break}}else O=x;const L=this.contextNodeData?.nodeData?.[t],R=this.getItemStyle(L,!1,void 0,L?.itemType);return this.formatTooltipWithContext(c,{heading:this.getAxisValueText(d,"tooltip",y,f,a,u),symbol:this.legendItemSymbol(N),data:[{label:l,fallbackLabel:r,value:this.getAxisValueText(g,"tooltip",O,f,r,u),missing:j.isTooltipValueMissing(O)}]},{seriesId:e,datum:f,title:l,itemType:N,xKey:a,xName:o,yKey:r,yName:l,...R})}legendItemSymbol(t){const{fill:e,stroke:i,fillOpacity:n,strokeOpacity:s,strokeWidth:a,lineDash:o,lineDashOffset:r}=this.getItemConfig(t);return{marker:{fill:e,stroke:i,fillOpacity:n,strokeOpacity:s,strokeWidth:a,lineDash:o,lineDashOffset:r}}}getLegendData(t){if(t!=="category")return[];const{id:e,seriesItemTypes:i}=this,n=[],s=o=>o.charAt(0).toUpperCase()+o.substring(1),{showInLegend:a}=this.properties;for(const o of i){const{name:r}=this.getItemConfig(o);n.push({legendType:"category",id:e,itemId:Aw(o),seriesId:e,enabled:!0,label:{text:r??s(o)},symbol:this.legendItemSymbol(o),hideInLegend:!a,isFixed:!0})}return n}toggleSeriesItem(){}resetDatumAnimation(t){dht([t.datumSelection])}animateEmptyUpdateReady(t){const{datumSelection:e,labelSelection:i,contextData:n}=t,s=hht(uht(this.isVertical(),this.axes,"normal"),"unknown");Sht.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],s),ght(this,"labels",this.ctx.animationManager,i);const{pointData:a}=n;a&&(this.isVertical()?this.animateConnectorLinesVertical(t):this.animateConnectorLinesHorizontal(t))}animateConnectorLinesHorizontal(t){const{pointData:e=[]}=t.contextData,[i]=t.paths,{path:n}=i;this.updateLineNode(i);const s=this.getValueAxis(),a=s?.isReversed(),o=a?(u,d)=>uu>d,r=s?.scale.convert(0),l=e.reduce((u,d)=>(o(d.x,u)&&(u=d.x),u),a?1/0:0),c=(u,d,g,f,y)=>(u-d)/(g-d)*(y-f)+f;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:r,to:l,ease:Lc,collapsable:!1,onUpdate(u){n.clear(!0);for(const[d,g]of e.entries()){const f=c(u,r,l,r,g.x),y=c(u,r,l,r,g.x2);d!==0&&n.lineTo(f,g.y),n.moveTo(y,g.y2)}i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(t)})}animateConnectorLinesVertical(t){const{pointData:e=[]}=t.contextData,[i]=t.paths,{path:n}=i;this.updateLineNode(i);const s=this.getValueAxis(),a=s?.isReversed(),o=a?(u,d)=>u>d:(u,d)=>u(o(d.y,u)&&(u=d.y),u),a?0:1/0),c=(u,d,g,f,y)=>(u-d)/(g-d)*(y-f)+f;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:r,to:l,ease:Lc,collapsable:!1,onUpdate(u){n.clear(!0);for(const[d,g]of e.entries()){const f=c(u,r,l,r,g.y),y=c(u,r,l,r,g.y2);d!==0&&n.lineTo(g.x,f),n.moveTo(g.x2,y)}i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(t)})}animateReadyResize(t){super.animateReadyResize(t),this.resetConnectorLinesPath(t)}updatePaths(t){this.resetConnectorLinesPath({contextData:t.contextData,paths:t.paths})}resetConnectorLinesPath({contextData:t,paths:e}){if(e.length===0)return;const[i]=e;this.updateLineNode(i);const{path:n}=i;n.clear(!0);const{pointData:s}=t;if(s){for(const[a,o]of s.entries())a!==0&&n.lineTo(o.x,o.y),n.moveTo(o.x2,o.y2);i.checkPathDirty()}}updateLineNode(t){const{stroke:e,strokeWidth:i,strokeOpacity:n,lineDash:s,lineDashOffset:a}=this.properties.line;t.setProperties({fill:void 0,stroke:e,strokeWidth:i,strokeOpacity:n,lineDash:s,lineDashOffset:a,lineJoin:"round",pointerEvents:j.PointerEvents.None})}isLabelEnabled(){const{positive:t,negative:e,total:i}=this.properties.item;return t.label.enabled||e.label.enabled||i.label.enabled}computeFocusBounds({datumIndex:t}){return xht(this,this.contextNodeData?.nodeData[t])}hasItemStylers(){const{positive:t,negative:e,total:i}=this.properties.item;return t.itemStyler!=null||t.label.itemStyler!=null||e.itemStyler!=null||e.label.itemStyler!=null||i.itemStyler!=null||i.label.itemStyler!=null}};r5.className="WaterfallSeries";r5.type="waterfall";var{waterfallSeriesThemeableOptionsDef:kht}=j,Cht={...kht,..._e,type:ht(Jt("waterfall")),xKey:ht(K),yKey:ht(K),xKeyAxis:K,yKeyAxis:K,xName:K,yName:K,totals:Xi({totalType:ht(dt("total","subtotal")),index:ht(X),axisLabel:ht(K)},"a total definition options array"),width:bo};function Iw(t,e){return{fill:{$applySwitch:[{$path:"type"},{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$path:[`/${e}`,{$palette:"fill"},{$palette:"fills"}]},{$palette:`${t}.fill`}]},["gradient",B1(t)],["image",$s],["pattern",V1(t)]]},stroke:{$palette:`${t}.stroke`},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{...Oe,enabled:!1,fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},formatter:void 0,placement:"outside-end",padding:{$isUserOption:["./spacing",0,6]}}}}Iw("altUp",0),Iw("altDown",1),Iw("neutral",2);var wht={options:Cht,axisKeys:{[z.X]:"xKeyAxis",[z.Y]:"yKeyAxis"},axisKeysFlipped:{[z.X]:"yKeyAxis",[z.Y]:"xKeyAxis"}},yo=["cursor","highlightStyle","listeners","nodeClickRange","showInLegend","showInMiniChart","tooltip","visible","xName","yName"],Nht=[...yo,"errorBar","label","legendItemName"],Tht=[...yo,"direction","legendItemName","minName","q1Name","medianName","q3Name","maxName"],Lht=[...yo,"title","label","labelKey","labelName","sizeName"],Oht=[...yo,"title","label","colorName","textAlign","verticalAlign","itemPadding","colorRange"],Eht=[...yo,"label"],Rht=[...yo,"errorBar","title","label"],Pht=[...yo,"label","yLowName","yHighName"],zht=[...yo,"direction","label","yLowName","yHighName"],Bht=[...yo,"errorBar","title","label","labelKey","labelName"],Vht=[...yo,"direction"];({formatter:Is(xo),...De},Xi(xp({area:At(UW.options,[...yo,"type"]),bar:At(WW.options,[...Nht,"type"]),"box-plot":At(Brt.options,[...Tht,"type"]),bubble:At($W.options,[...Lht,"type"]),candlestick:At(hlt.options,[...yo,"type"]),heatmap:At(Llt.options,[...Oht,"type"]),histogram:At(XW.options,[...Eht,"type"]),line:At(qW.options,[...Rht,"type"]),ohlc:At(Elt.options,[...yo,"type"]),"range-area":At(Mct.options,[...Pht,"type"]),"range-bar":At(Jct.options,[...zht,"type"]),scatter:At(QW.options,[...Bht,"type"]),waterfall:At(wht.options,[...Vht,"type"])},"miniChart series options")));Cn.SMALLER;var _ht=class extends Ln{constructor(t){super(),this.ctx=t,this.enabled=new Map,this.enableDoubleClick=new Map,this.enableDragging=new Map,this.enableScrolling=new Map,this.axes=[],this.overlappingAxisIds=new Set,t.widgets.seriesDragInterpreter&&this.cleanup.register(t.widgets.seriesDragInterpreter.events.on("dblclick",e=>this.onSeriesAreaDoubleClick(e)),t.widgets.seriesDragInterpreter.events.on("drag-start",e=>this.onSeriesAreaDragStart(e)),t.widgets.seriesDragInterpreter.events.on("drag-move",e=>this.onSeriesAreaDragMove(e)),t.widgets.seriesDragInterpreter.events.on("drag-end",e=>this.onSeriesAreaDragEnd(e))),this.cleanup.register(t.eventsHub.on("layout:complete",e=>this.onLayoutComplete(e)),t.eventsHub.on("axis-dom-proxy:update",e=>this.onUpdate(e)),t.eventsHub.on("series-area:hover",e=>this.onSeriesAreaHover(e)),t.eventsHub.on("series-area:click",e=>this.onSeriesAreaClick(e)),()=>this.teardown())}teardown(){for(const t of this.axes)t.div.destroy()}onLayoutComplete(t){this.seriesRect=t.series.rect}onUpdate(t){const{enabled:e,enableDoubleClick:i,enableDragging:n,enableScrolling:s,source:a}=t;this.enabled.set(a,e),this.enableDoubleClick.set(a,i),this.enableDragging.set(a,n),this.enableScrolling.set(a,s);const o=this.isEnabled()&&(this.isEnabledDoubleClick()||this.isEnabledDragging()||this.isEnabledScrolling());for(const r of this.axes)r.div.setHidden(!o);o&&(this.processAxisDiff(),this.updateOverlappingAxisPointerEvents())}processAxisDiff(){const{ctx:{axisManager:t}}=this,e=[...t.getAxisContext(z.X),...t.getAxisContext(z.Y)],{removed:i,added:n}=this.diffAxisIds(e);i.length>0&&(this.axes=this.axes.filter(s=>i.includes(s.axisId)?(s.div.destroy(),this.overlappingAxisIds.delete(s.axisId),this.hoveredAxisId===s.axisId&&(this.hoveredAxisId=void 0),this.draggingAxisId===s.axisId&&(this.draggingAxisId=void 0),!1):!0));for(const s of n){const{axisId:a,direction:o}=s,r=this.createAxisDOMProxy(a,o);this.axes.push(r)}for(const s of this.axes){const o=e.find(r=>r.axisId===s.axisId).getCanvasBounds();s.div.setHidden(nj(o)),o==null?s.bounds=void 0:(s.div.setBounds(o),s.bounds=new j.BBox(o.x,o.y,o.width,o.height))}}onSeriesAreaHover(t){if(t.consumed){this.hoveredAxisId&&(this.hoveredAxisId=void 0,this.ctx.eventsHub.emit("axis-dom-proxy:mouseleave",{event:t}));return}if(!this.hasOverlappingAxes())return;const e=this.pickAxisAtPoint(t);e?(this.hoveredAxisId=e.axisId,this.ctx.eventsHub.emit("axis-dom-proxy:mouseenter",{axisId:e.axisId,direction:e.direction,event:t})):(this.hoveredAxisId&&this.ctx.eventsHub.emit("axis-dom-proxy:mouseleave",{event:t}),this.hoveredAxisId=void 0)}onSeriesAreaClick(t){if(t.sourceEvent.type!=="dblclick"||t.consumed||!this.hasOverlappingAxes())return;const e=this.getAxis(this.hoveredAxisId);e&&this.ctx.eventsHub.emit("axis-dom-proxy:dblclick",{event:t,axisId:e.axisId,direction:e.direction})}onSeriesAreaDoubleClick(t){if(!this.isEnabled()||!this.isEnabledDoubleClick()||!this.hasOverlappingAxes())return;const e=this.getAxis(this.hoveredAxisId);e&&this.ctx.eventsHub.emit("axis-dom-proxy:dblclick",{event:t,axisId:e.axisId,direction:e.direction})}onSeriesAreaDragStart(t){if(!this.isEnabled()||!this.isEnabledDragging())return;const e=this.getAxis(this.hoveredAxisId);e&&this.overlappingAxisIds.has(e.axisId)&&(this.draggingAxisId=e.axisId,this.ctx.eventsHub.emit("axis-dom-proxy:drag-start",{axisId:e.axisId,direction:e.direction,event:t}),t.device==="touch"&&t.sourceEvent.preventDefault())}onSeriesAreaDragMove(t){if(!this.isEnabled()||!this.isEnabledDragging()||!this.draggingAxisId||!this.overlappingAxisIds.has(this.draggingAxisId))return;const e=this.getAxis(this.draggingAxisId);e&&this.ctx.eventsHub.emit("axis-dom-proxy:drag-move",{axisId:e.axisId,direction:e.direction,event:t})}onSeriesAreaDragEnd(t){if(!this.draggingAxisId||!this.overlappingAxisIds.has(this.draggingAxisId))return;const e=this.getAxis(this.draggingAxisId);e&&(this.draggingAxisId=void 0,this.ctx.eventsHub.emit("axis-dom-proxy:drag-end",{axisId:e.axisId,direction:e.direction,event:t}))}pickAxisAtPoint(t){for(const e of this.axes)if(this.overlappingAxisIds.has(e.axisId)&&e.bounds?.containsPoint(t.canvasX,t.canvasY))return{axisId:e.axisId,direction:e.direction}}hasOverlappingAxes(){return this.overlappingAxisIds.size>0}getAxis(t){if(!t)return;const e=this.axes.find(i=>i.axisId===t);return e?{axisId:e.axisId,direction:e.direction}:void 0}updateOverlappingAxisPointerEvents(){this.overlappingAxisIds.clear();const t=(this.isEnabledDragging()||this.isEnabledScrolling())&&this.seriesRect;for(const e of this.axes){if(!t){e.div.setPointerEvents(void 0);continue}!!e.bounds?.clone().shrink(1).collidesBBox(this.seriesRect)?(this.overlappingAxisIds.add(e.axisId),e.div.setPointerEvents("none")):e.div.setPointerEvents(void 0)}this.cleanupAxisState()}cleanupAxisState(){this.hoveredAxisId&&!this.overlappingAxisIds.has(this.hoveredAxisId)&&(this.hoveredAxisId=void 0),this.draggingAxisId&&!this.overlappingAxisIds.has(this.draggingAxisId)&&(this.draggingAxisId=void 0)}createAxisDOMProxy(t,e){const{ctx:{proxyInteractionService:i}}=this,s=i.createProxyElement({type:"region",domManagerId:t,where:"afterend"});return s.addListener("drag-start",a=>{!this.isEnabled()||!this.isEnabledDragging()||(a.device==="touch"&&a.sourceEvent.preventDefault(),this.draggingAxisId=t,this.ctx.eventsHub.emit("axis-dom-proxy:drag-start",{axisId:t,direction:e,event:a}))}),s.addListener("drag-move",a=>{!this.isEnabled()||!this.isEnabledDragging()||this.ctx.eventsHub.emit("axis-dom-proxy:drag-move",{axisId:t,direction:e,event:a})}),s.addListener("drag-end",a=>{!this.isEnabled()||!this.isEnabledDragging()||(this.draggingAxisId=void 0,this.ctx.eventsHub.emit("axis-dom-proxy:drag-end",{axisId:t,direction:e,event:a}))}),s.addListener("dblclick",a=>{!this.isEnabled()||!this.isEnabledDoubleClick()||this.ctx.eventsHub.emit("axis-dom-proxy:dblclick",{axisId:t,direction:e,event:a})}),s.addListener("mouseenter",a=>{this.isEnabled()&&(this.hoveredAxisId=t,this.ctx.eventsHub.emit("axis-dom-proxy:mouseenter",{axisId:t,direction:e,event:a}))}),s.addListener("mouseleave",a=>{this.isEnabled()&&(this.hoveredAxisId=void 0,this.ctx.eventsHub.emit("axis-dom-proxy:mouseleave",{event:a}))}),s.addListener("wheel",a=>{!this.isEnabled()||!this.isEnabledScrolling()||this.ctx.eventsHub.emit("axis-dom-proxy:wheel",{axisId:t,direction:e,event:a})}),{axisId:t,div:s,direction:e}}diffAxisIds(t){const e=this.axes.map(a=>a.axisId),i=t.map(a=>a.axisId),n=e.filter(a=>!i.includes(a)),s=t.filter(a=>!e.includes(a.axisId));return{removed:n,added:s}}isEnabled(){return this.isBooleanMap(this.enabled)}isEnabledDoubleClick(){return this.isBooleanMap(this.enableDoubleClick)}isEnabledDragging(){return this.isBooleanMap(this.enableDragging)}isEnabledScrolling(){return this.isBooleanMap(this.enableScrolling)}isBooleanMap(t){for(const e of t.values())if(e)return!0;return!1}},Fht={type:"plugin",name:"axis-dom-proxy",version:oi,create:t=>new _ht(t)},Hht=class{constructor(){this.isFirstWheelEvent=!0,this.debouncedWheelReset=M1(()=>{this.isFirstWheelEvent=!0,this.wasFirstWheelEventZoomCapped=void 0},100)}onWheel(t,e){if(t.sourceEvent.cancelable===!1)return;const i=e();if(i==="abort")return;const n=i==="capped";this.firstWheelEventDirection!=null&&this.firstWheelEventDirection!==t.deltaY<0&&(this.isFirstWheelEvent=!0),this.isFirstWheelEvent?(this.wasFirstWheelEventZoomCapped=n,this.firstWheelEventDirection=t.deltaY<0,n||t.sourceEvent.preventDefault()):this.wasFirstWheelEventZoomCapped===!1&&t.sourceEvent.preventDefault(),this.isFirstWheelEvent=!1,this.debouncedWheelReset()}},rF=["zoom","scrollbar"],jht=class extends Ln{constructor(t){super(),this.ctx=t,this.wheelSequencer=new Hht,this.cleanup.register(t.eventsHub.on("axis-dom-proxy:mouseenter",e=>this.onAxisMouseEnter(e)),t.eventsHub.on("axis-dom-proxy:mouseleave",e=>this.onAxisMouseLeave(e)),t.eventsHub.on("axis-dom-proxy:drag-start",e=>this.onAxisDragStart(e)),t.eventsHub.on("axis-dom-proxy:drag-move",e=>this.onAxisDragMove(e)),t.eventsHub.on("axis-dom-proxy:drag-end",e=>this.onAxisDragEnd(e)),t.eventsHub.on("axis-dom-proxy:dblclick",e=>this.onAxisDoubleClick(e)),t.eventsHub.on("axis-dom-proxy:wheel",e=>this.onAxisWheel(e)),t.eventsHub.on("scrollbar:wheel",e=>this.onScrollbarWheel(e)),t.widgets.seriesWidget.addListener("wheel",e=>this.onSeriesAreaWheel(e)))}onAxisMouseEnter(t){this.processEvent("axis-mouseenter",t)}onAxisMouseLeave(t){this.processEvent("axis-mouseleave",t)}onAxisDragStart(t){this.processEvent("axis-drag-start",t)}onAxisDragMove(t){this.processEvent("axis-drag-move",t)}onAxisDragEnd(t){this.processEvent("axis-drag-end",t)}onAxisDoubleClick(t){this.processEvent("axis-dblclick",t)}onSeriesAreaWheel(t){this.wheelSequencer.onWheel(t,()=>this.handleWheelSequencer("wheel",{event:t}))}onAxisWheel({event:t,direction:e}){this.wheelSequencer.onWheel(t,()=>this.handleWheelSequencer("axis-wheel",{event:t,direction:e}))}onScrollbarWheel({event:t,orientation:e}){this.wheelSequencer.onWheel(t,()=>this.handleWheelSequencer("scrollbar-wheel",{event:t,direction:e==="horizontal"?z.X:z.Y}))}handleWheelSequencer(t,e){let i=!1,n="abort";for(const s of rF){const a={...e,abort(){n="abort"},capped(){n="capped"},uncapped(){n="uncapped"},stopProcessing(){i=!0}};if(this.ctx.eventsHub.emit(`zoom-interaction:${s}:${t}`,a),i)return n}return"abort"}processEvent(t,e){let i=!1;for(const n of rF){const s={...e,stopProcessing(){i=!0}};if(this.ctx.eventsHub.emit(`zoom-interaction:${n}:${t}`,s),i)return}}},Ght={type:"plugin",name:"zoom-base",version:oi,dependencies:[Fht],create:t=>new jht(t)},$d=Hn-vo,l5="end",c5="middle",Uht=300,yS=(t,e=vo,i=Hn)=>Nt(e,t,i);function jn(t){return t.x.max-t.x.min}function Ha(t){return t.y.max-t.y.min}function lF(t,e){return be(t.min,e.min)&&be(t.max,e.max)}function h5(t,e){return lF(t.x,e.x)&&lF(t.y,e.y)}function pf(t){return h5(t,Ni())}function Rc(t,e,i){if(!t)return{x:0,y:0};const n=yS(e-t.x,0,t.x+t.width),s=yS(i-t.y,0,t.y+t.height),a=1/t.width*n,o=1-1/t.height*s;return{x:yS(a),y:yS(o)}}function mp(t,e,i){return{x:{min:t.x.min+e,max:t.x.max+e},y:{min:t.y.min+i,max:t.y.max+i}}}function HM(t,e,i){return{x:{min:t.x.min,max:t.x.min+jn(t)*e},y:{min:t.y.min,max:t.y.min+Ha(t)*i}}}function cF(t,e,i){const n=jn(t),s=Ha(t),a=t.x.min+n/2,o=t.y.min+s/2;return{x:{min:a-n*e/2,max:a+n*e/2},y:{min:o-s*i/2,max:o+s*i/2}}}function lo(t,e,i,n){const{min:s,max:a}=e,o=s+(a-s)/2,r=t.max-t.min;switch(i){case"start":return{min:s,max:e.min+r};case"end":return{min:e.max-r,max:a};case"middle":return{min:o-r/2,max:o+r/2};case"pointer":return Wht(t,e,n??o);default:return{min:s,max:a}}}function Wht(t,e,i){const n=t.max-t.min,s=e.max-e.min,a=i*(1-(s-n)),o=i-a,r=t.min+o,l=t.max+o;return{min:r,max:l}}function Kht(t,e,i){return{x:{min:t.x.min*e,max:t.x.max*e},y:{min:t.y.min*i,max:t.y.max*i}}}function lr(t){return{x:lx(t.x),y:lx(t.y)}}function lx(t){const e=t.max-t.min;let i=t.max>Hn?Hn-e:t.min,n=t.min{this.timer=void 0,this.run(Yht)},t))}clearTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=void 0)}isActive(){return this.timer!=null}},Xht=class{constructor(){this.min=0,this.span=1,this.thumbSpan=1}update(t,e,i=this.thumbSpan){const n=Nt(0,e-t,1);this.span=n,this.thumbSpan=Nt(0,i,1),this.min=this.clampMin(t,n)}clampMin(t,e=this.span){return Nt(0,t,1-e)}getThumbBounds(t=this.min,e=this.thumbSpan){const i=this.clampMin(t,e);return{start:i,end:i+e}}isWithinThumb(t){const{start:e,end:i}=this.getThumbBounds();return t>=e&&t<=i}getJumpRange(t){if(!this.canScroll())return;let e=this.clampMin(t-this.thumbSpan/2,this.thumbSpan);return e=this.clampMin(e),{min:e,max:e+this.span}}getStepRange(t){if(!this.canScroll())return;const e=Nt(0,t,1),{start:i,end:n}=this.getThumbBounds();if(e>=i&&e<=n)return;const s=e0&&this.span<1}},Zht=class{constructor(t,e,i,n){this.ctx=t,this.orientation=e,this.onChange=i,this.onHoverChange=n,this.dragStartRatio=0,this.interactionMode="none",this.state=new Xht,this.repeater=new $ht(o=>this.applyStepToward(o)),this.container=t.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`scrollbar-${e}`,classList:["ag-charts-proxy-scrollbar",`ag-charts-proxy-scrollbar-${e}`],ariaLabel:void 0,role:"presentation"});const s=e==="horizontal"?"ariaLabelScrollbarHorizontal":"ariaLabelScrollbarVertical";this.slider=t.proxyInteractionService.createProxyElement({type:"slider",domIndex:0,tabIndex:0,ariaLabel:{id:s},role:"slider",parent:this.container,classList:["ag-charts-proxy-scrollbar-slider"]});const a=this.slider.getElement();a.ariaValueMin="0",a.ariaValueMax="100",this.slider.step=uF.STEP_HUNDRETH,this.slider.keyboardStep=uF.STEP_ONE,this.slider.orientation=e,this.slider.setPreventsDefault(!1),this.slider.addListener("change",()=>this.onSliderChange()),this.slider.addListener("keydown",o=>this.onSliderKeyDown(o)),this.slider.addListener("drag-start",o=>this.onDragStart(o)),this.slider.addListener("drag-move",o=>this.onDragMove(o)),this.slider.addListener("drag-end",o=>this.onDragEnd(o)),this.slider.addListener("mouseenter",o=>this.handleHoverEvent(o)),this.slider.addListener("mousemove",o=>this.handleHoverEvent(o)),this.slider.addListener("mouseleave",()=>this.onMouseLeave()),this.slider.addListener("wheel",o=>t.eventsHub.emit("scrollbar:wheel",{event:o,orientation:e})),this.thumbFocus=t.proxyInteractionService.createProxyElement({type:"region",parent:this.container,classList:["ag-charts-proxy-scrollbar-thumb-focus"],role:"presentation"}),this.thumbFocus.setAriaHidden(!0),this.thumbFocus.setPointerEvents("none")}destroy(){this.interactionBounds=void 0,this.repeater.stop(),this.container.destroy()}updateBounds(t){this.interactionBounds=void 0,this.container.setBounds(t),this.slider.setBounds({x:0,y:0,width:t.width,height:t.height})}updateVisibility(t){this.container.setHidden(!t)}updateMinMax(t,e,i=this.state.thumbSpan,n){this.state.update(t,e,i);const s=this.ctx.localeManager.t("ariaValuePanRange",{min:Math.round(t*100)/100,max:Math.round(e*100)/100}),a=this.slider.getElement();a.ariaValueText=s,(!n?.skipSliderUpdate||Math.abs(this.slider.getValueRatio()-t)>1e-9)&&this.slider.setValueRatio(t,{ariaValueText:s})}updateThumbBounds(t,e,i){const n=Math.max(0,i??0);this.thumbFocus.getElement().style.borderRadius=`${n}px`,this.thumbFocus.setBounds({x:t.x-e.x,y:t.y-e.y,width:t.width,height:t.height})}update(t,e,i){this.onChange(t,e),this.updateMinMax(t,e,void 0,i)}onSliderChange(){const t=this.state.clampMin(this.slider.getValueRatio()),e=t+this.state.span;this.update(t,e,{skipSliderUpdate:!0})}onSliderKeyDown(t){const{code:e}=t.sourceEvent,i=this.orientation==="vertical",n=i&&e==="ArrowUp"||!i&&e==="ArrowLeft",s=i&&e==="ArrowDown"||!i&&e==="ArrowRight";if(!n&&!s)return;t.sourceEvent.preventDefault();const a=this.slider.getElement();a.step=this.slider.keyboardStep?.attributeValue??"1",n?a.stepDown():s&&a.stepUp(),this.onSliderChange()}onDragMove(t){if(t.sourceEvent.preventDefault(),this.interactionMode==="drag"){const{isHorizontal:s,size:a,start:o}=this.getInteractionBounds()??{};if(o==null||a==null)return;const r=(s?t.originDeltaX:t.originDeltaY)/a,l=this.state.clampMin(this.dragStartRatio+r),c=l+this.state.span;this.update(l,c);return}if(this.interactionMode!=="step")return;const e=this.getPointerInfo(t);if(e==null||!Number.isFinite(e.ratio))return;const{ratio:i,inCrossBounds:n}=e;if(!n){this.repeater.stop();return}this.repeater.updateTarget(i)}onDragEnd(t){t.sourceEvent.preventDefault(),this.interactionBounds=void 0,this.setInteraction("none"),this.onHoverChange(!1)}onDragStart(t){t.sourceEvent.preventDefault(),this.interactionBounds=void 0;const e=this.getClickInfo(t);if(e?.inBounds){if(e.inThumb){this.dragStartRatio=this.slider.getValueRatio(),this.setInteraction("drag");return}if(t.sourceEvent.shiftKey){this.jumpTo(e.ratio),this.setInteraction("none");return}this.beginStepRepeat(e.ratio)}}onMouseLeave(){this.onHoverChange(!1)}getClickInfo(t){const e=this.getPointerRatio(t);return e==null?void 0:e>=0&&e<=1?{ratio:e,inBounds:!0,inThumb:this.isWithinThumb(e)}:{ratio:0,inBounds:!1,inThumb:!1}}getPointerRatio(t){return this.getPointerInfo(t)?.ratio}getPointerInfo(t){if(t.device==="keyboard")return;const{isHorizontal:e,size:i,start:n,crossStart:s,crossSize:a}=this.getInteractionBounds(),o=e?t.clientX:t.clientY,r=e?t.clientY:t.clientX,l=(o-n)/i,c=r>=s&&r<=s+a;return{ratio:l,inCrossBounds:c}}jumpTo(t){const e=this.state.getJumpRange(t);e&&this.update(e.min,e.max)}applyStepToward(t){const e=this.state.getStepRange(t);return e?(this.update(e.min,e.max),!1):!0}beginStepRepeat(t){this.setInteraction("step"),this.repeater.start(t)}setInteraction(t){this.interactionMode=t,t!=="step"&&this.repeater.stop()}getInteractionBounds(){if(this.interactionBounds)return this.interactionBounds;const{width:t,height:e,left:i,top:n}=this.container.getBoundingClientRect(),s=this.orientation==="horizontal",a=s?t:e,o=s?i:n,r=s?n:i,l=s?e:t;return this.interactionBounds={isHorizontal:s,size:a,start:o,crossStart:r,crossSize:l},this.interactionBounds}isWithinThumb(t){return this.state.isWithinThumb(t)}handleHoverEvent(t){if(this.interactionMode==="drag")return;const e=this.getPointerInfo(t);if(!e){this.onHoverChange(!1);return}const i=this.isWithinThumb(e.ratio);this.onHoverChange(i)}},ko=class extends Zf{constructor(){super(...arguments),this.enabled=!1,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.opacity=1}};M([b,ut()],ko.prototype,"enabled");M([b,ut()],ko.prototype,"fill");M([b,ut()],ko.prototype,"fillOpacity");M([b,ut()],ko.prototype,"stroke");M([b,ut()],ko.prototype,"strokeWidth");M([b,ut()],ko.prototype,"strokeOpacity");M([b],ko.prototype,"lineDash");M([b],ko.prototype,"lineDashOffset");M([b],ko.prototype,"cornerRadius");M([b],ko.prototype,"opacity");var HO=class extends Zf{};M([b,ut()],HO.prototype,"fill");M([b,ut()],HO.prototype,"stroke");var _A=class extends ko{constructor(){super(...arguments),this.minSize=20,this.hoverStyle=new HO}};M([b,ut()],_A.prototype,"minSize");M([b],_A.prototype,"hoverStyle");var Hl=class extends Zf{constructor(){super(...arguments),this.enabled=!1,this.thickness=12,this.spacing=4,this.tickSpacing=0,this.placement="outer",this.visible="auto",this.track=new ko,this.thumb=new _A}};M([b,ut()],Hl.prototype,"enabled");M([b,ut()],Hl.prototype,"thickness");M([b,ut()],Hl.prototype,"spacing");M([b,ut()],Hl.prototype,"tickSpacing");M([b,ut()],Hl.prototype,"placement");M([b,ut()],Hl.prototype,"visible");M([b],Hl.prototype,"track");M([b],Hl.prototype,"thumb");var p5=class extends Hl{};M([b,ut()],p5.prototype,"position");var g5=class extends Hl{};M([b,ut()],g5.prototype,"position");var{BBox:_g,Group:qht,Rect:pF,LayoutElement:Qht,InteractionState:Jht}=j,tut=.1,eut="pan",gr=class extends Ln{constructor(t){super(),this.ctx=t,this.enabled=!1,this.enableAxisScrolling=!1,this.enableSeriesAreaScrolling=!1,this.track=new ko,this.thumb=new _A,this.horizontal=new p5,this.vertical=new g5,this.scrollPanner=new d5,this.state={horizontal:this.createOrientationState("horizontal"),vertical:this.createOrientationState("vertical")},this.cleanup.register(t.scene.attachNode(this.state.horizontal.group),t.scene.attachNode(this.state.vertical.group),t.layoutManager.registerElement(Qht.Scrollbar,e=>this.onLayoutStart(e)),t.eventsHub.on("layout:complete",e=>this.onLayoutComplete(e)),t.eventsHub.on("zoom:change-complete",()=>this.updateThumbs()),t.eventsHub.on("zoom-interaction:scrollbar:wheel",e=>this.onWheel(e)),t.eventsHub.on("zoom-interaction:scrollbar:axis-wheel",e=>this.onAxisWheel(e)),t.eventsHub.on("zoom-interaction:scrollbar:scrollbar-wheel",e=>this.onScrollbarWheel(e)))}createOrientationState(t){const e=new qht({name:`scrollbar-${t}`,zIndex:pe.NAVIGATOR}),i=new pF,n=new pF;e.append(i),e.append(n);const s=new Zht(this.ctx,t,(o,r)=>this.handleUserChange(t,o,r),o=>this.handleHoverChange(t,o)),a=this.resolveProperties(t);return{orientation:t,group:e,track:i,thumb:n,dom:s,properties:a,position:this.getDefaultPosition(t),positionHasAxis:!1,hovered:!1}}resolveProperties(t){return t==="horizontal"?this.horizontal:this.vertical}getDefaultPosition(t){return t==="horizontal"?"bottom":"left"}resolveAxis(t,e){const i=t==="horizontal"?z.X:z.Y,n=this.ctx.axisManager.getAxisContext(i);if(n.length===0)return{position:this.getDefaultPosition(t),positionHasAxis:!1};if(e==null){const a=n[0];return{axis:a,position:a.position??this.getDefaultPosition(t),positionHasAxis:!0}}const s=n.find(a=>a.position===e);return s?{axis:s,position:e,positionHasAxis:!0}:{axis:n[0],position:e,positionHasAxis:!1}}onLayoutStart({scrollbars:t,layoutBox:e}){for(const i of["horizontal","vertical"]){const n=this.state[i],s=this.resolveProperties(i),{min:a,max:o}=this.getZoomRange(n.orientation),r=Nt(0,o-a,1),{axis:{axisId:l}={},position:c,positionHasAxis:u}=this.resolveAxis(i,s.position);n.properties=s,n.axisId=l,n.position=c,n.positionHasAxis=u;const d=this.updateVisibility(n,r);if(!d||l==null)continue;const{thickness:g,spacing:f,placement:y,tickSpacing:x}=s;u?t[l]={enabled:d,thickness:g,spacing:f,tickSpacing:x,placement:y}:e.shrink(f+g,c),this.updateStyles(n)}}onLayoutComplete(t){this.ctx.eventsHub.emit("axis-dom-proxy:update",{source:"scrollbar",enabled:this.enabled,enableDoubleClick:!1,enableDragging:!1,enableScrolling:this.enableAxisScrolling}),this.seriesRect=t.series.rect;for(const e of["horizontal","vertical"]){const i=this.state[e],{properties:{enabled:n,visible:s}}=i;if(!n||s==="never")continue;const a=this.getLayoutRect(i,e,t);i.layoutRect=a,a&&(this.updateTrack(i,a),this.updateThumb(i,a))}}getLayoutRect(t,e,i){const{properties:{thickness:n,spacing:s},position:a,positionHasAxis:o}=t,r=t.axisId?i.axes[t.axisId]:void 0;if(!r)return;const{x:l,y:c,width:u,height:d}=i.series.rect,g=e==="horizontal";if(!o)if(g){const S=a==="bottom"?c+d+s:c-s-n;return new _g(l,S,u,n)}else{const S=a==="right"?l+u+s:l-s-n;return new _g(S,c,n,d)}const{scrollbar:f,translation:y}=r;if(!f?.enabled)return;const x=g?y.y+f.offset:y.x+f.offset;return g?new _g(l,x,u,n):new _g(x,c,n,d)}updateStyles({track:t,thumb:e,properties:i,hovered:n}){t.setStyleProperties(i.track),t.cornerRadius=i.track.cornerRadius??0,t.opacity=i.track.opacity??1,e.setStyleProperties(i.thumb),e.cornerRadius=i.thumb.cornerRadius??0,e.opacity=i.thumb.opacity??1;const s=i.thumb.hoverStyle;e.fill=n?s?.fill??i.thumb.fill:i.thumb.fill,e.stroke=n?s?.stroke??i.thumb.stroke:i.thumb.stroke}updateTrack(t,e){t.track.x=e.x,t.track.y=e.y,t.track.width=e.width,t.track.height=e.height,t.dom.updateBounds(e)}updateThumb(t,e){const{min:i,max:n}=this.getZoomRange(t.orientation),s=Nt(0,n-i,1);if(!this.updateVisibility(t,s)||e.width<=0||e.height<=0)return;const o=t.properties.thumb.minSize??0;let r;if(t.orientation==="horizontal"){const l=Math.min(Math.max(o,e.width*s),e.width),c=Nt(e.x,e.x+e.width*i,e.x+e.width-l);t.thumb.x=c,t.thumb.y=e.y,t.thumb.width=l,t.thumb.height=e.height,r=Nt(0,l/e.width,1)}else{const l=Math.min(Math.max(o,e.height*s),e.height),c=Nt(e.y,e.y+e.height*i,e.y+e.height-l);t.thumb.x=e.x,t.thumb.y=c,t.thumb.width=e.width,t.thumb.height=l,r=Nt(0,l/e.height,1)}t.dom.updateThumbBounds(t.thumb,e,t.properties.thumb.cornerRadius),t.dom.updateMinMax(i,n,r)}updateThumbs(){if(this.seriesRect)for(const t of["horizontal","vertical"]){const e=this.state[t],i=e.layoutRect;if(!i||!e.properties.enabled||e.properties.visible==="never")continue;const n=t==="horizontal"?new _g(this.seriesRect.x,i.y,this.seriesRect.width,e.properties.thickness):new _g(i.x,this.seriesRect.y,e.properties.thickness,this.seriesRect.height);this.updateThumb(e,n)}}updateVisibility(t,e){const i=t.properties.enabled&&t.axisId!=null&&t.properties.visible!=="never"&&(t.properties.visible==="always"||e<1);return t.group.visible=i,t.track.visible=i,t.thumb.visible=i,t.dom.updateVisibility(i),i}getZoomRange(t){const e=this.ctx.zoomManager.getZoom(),i=t==="horizontal",n=i?e?.x:e?.y;return!i&&n!=null?{min:1-(n.max??1),max:1-(n.min??0)}:{min:n?.min??0,max:n?.max??1}}handleUserChange(t,e,i){if(!this.ctx.interactionManager.isState(Jht.ZoomDraggable))return;const n=t==="horizontal";n||([e,i]=[1-i,1-e]);const s=n?{x:{min:e,max:i}}:{y:{min:e,max:i}};this.ctx.zoomManager.updateZoom({source:"user-interaction",sourceDetail:"scrollbar"},s)}handleHoverChange(t,e){const i=this.state[t],n=e&&i.group.visible;i.hovered!==n&&(i.hovered=n,this.updateStyles(i),this.ctx.eventsHub.emit("chart:request-update",{type:Ct.SCENE_RENDER}))}onWheel(t){if(this.enableSeriesAreaScrolling)return this.handleWheel(t)}onAxisWheel(t){if(this.enableAxisScrolling)return this.handleWheel(t)}onScrollbarWheel(t){return this.handleWheel(t)}handleWheel(t){const{seriesRect:e,ctx:{zoomManager:i}}=this,{event:n}=t,s=Math.abs(n.deltaX)>Math.abs(n.deltaY);if(s&&!this.horizontal.enabled||!s&&!this.vertical.enabled)return;t.stopProcessing();const a=s?z.X:z.Y,o=this.ctx.zoomManager.getPrimaryAxisId(a);if(!e||!o){t.abort();return}const r=this.scrollPanner.update(n,tut,eut,e,i.getAxisZooms()),l={[a]:{min:r[o].min,max:r[o].max}};i.updateZoom({source:"user-interaction",sourceDetail:"scrollbar"},l);const c=this.getZoom();n.deltaY>0&&c.y.min===vo||n.deltaY<0&&c.y.max===Hn?t.capped():t.uncapped()}getZoom(){return Ni(this.ctx.zoomManager.getZoom())}destroy(){super.destroy(),this.state.horizontal.dom.destroy(),this.state.vertical.dom.destroy()}};M([b],gr.prototype,"enabled");M([b],gr.prototype,"enableAxisScrolling");M([b],gr.prototype,"enableSeriesAreaScrolling");M([b],gr.prototype,"thickness");M([b],gr.prototype,"spacing");M([b],gr.prototype,"tickSpacing");M([b],gr.prototype,"placement");M([b],gr.prototype,"visible");M([b],gr.prototype,"track");M([b],gr.prototype,"thumb");M([b],gr.prototype,"horizontal");M([b],gr.prototype,"vertical");var iut={...wt,...bt,...Lt,cornerRadius:X,opacity:Ot};({...iut,hoverStyle:(wt.fill,bt.stroke)});dt("auto","always","never"),dt("outer","inner");dt("top","bottom");dt("left","right");dt("auto","always","never"),dt("outer","inner");var jO=class extends Il{};M([b],jO.prototype,"enabled");M([b],jO.prototype,"value");var vl=class extends xt{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1,this.stroke="black",this.textColor="black"}};M([b],vl.prototype,"fill");M([b],vl.prototype,"fillOpacity");M([b],vl.prototype,"stroke");M([b],vl.prototype,"textColor");var ca=class extends xt{constructor(){super(...arguments),this.active=new vl,this.disabled=new vl,this.hover=new vl,this.cornerRadius=0,this.fill="black",this.fillOpacity=1,this.fontSize=12,this.fontFamily="sans-serif",this.fontWeight="normal",this.stroke="black",this.strokeWidth=1,this.textColor="black",this.padding=0}};M([b],ca.prototype,"active");M([b],ca.prototype,"disabled");M([b],ca.prototype,"hover");M([b],ca.prototype,"cornerRadius");M([b],ca.prototype,"fill");M([b],ca.prototype,"fillOpacity");M([b],ca.prototype,"fontSize");M([b],ca.prototype,"fontFamily");M([b],ca.prototype,"fontWeight");M([b],ca.prototype,"stroke");M([b],ca.prototype,"strokeWidth");M([b],ca.prototype,"textColor");M([b],ca.prototype,"padding");var f5=class extends ca{constructor(){super(...arguments),this.visible="auto"}};M([b],f5.prototype,"visible");var{userInteraction:nut,LayoutElement:sut,Toolbar:gF}=j,kw="toolbarRangeSelectRange",rn=class extends xt{constructor(t){super(),this.ctx=t,this.enabled=!1,this.buttons=new ss(jO),this.button=new ca,this.dropdown=new f5,this.active=new vl,this.disabled=new vl,this.hover=new vl,this.enableOutOfRange=!1,this.gap=0,this.cornerRadius=0,this.fill="black",this.fillOpacity=1,this.fontSize=12,this.fontFamily="sans-serif",this.fontWeight="normal",this.stroke="black",this.strokeWidth=1,this.textColor="black",this.padding=0,this.position="top-right",this.spacing=0,this.minSize=0,this.cleanup=new qe,this.dropdownLabel=kw,this.cleanup.register(t.layoutManager.registerElement(sut.ToolbarBottom,this.onLayoutStart.bind(this)),t.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)),t.widgets.chartWidget.addListener("click",this.onChartWidgetClick.bind(this)),t.eventsHub.on("zoom:change-complete",this.onZoomChanged.bind(this)),this.teardown.bind(this))}destroy(){this.cleanup.flush()}setup(){this.container==null&&(this.container=this.ctx.domManager.addChild("canvas-overlay","range-buttons"),this.container.role="presentation",this.buttonsToolbar=new gF(this.ctx,"ariaLabelRangesToolbar","horizontal"),this.buttonsToolbar.addClass("ag-charts-range-buttons","ag-charts-range-buttons--buttons"),this.container.append(this.buttonsToolbar.getElement()),this.dropdownToolbar=new gF(this.ctx,"ariaLabelRangesToolbar","horizontal"),this.dropdownToolbar.addClass("ag-charts-range-buttons","ag-charts-range-buttons--dropdown"),this.container.append(this.dropdownToolbar.getElement()),this.dropdownMenu=new j.Menu(this.ctx,"ranges-dropdown"),this.cleanup.register(this.buttonsToolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.dropdownToolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this))))}teardown(){this.buttonsToolbar?.getElement().remove(),this.buttonsToolbar?.destroy(),this.dropdownToolbar?.getElement().remove(),this.dropdownToolbar?.destroy()}onLayoutStart({layoutBox:t}){const{dropdown:e,enabled:i,position:n,spacing:s}=this;if(!i){this.buttonsToolbar?.setHidden(!0),this.dropdownToolbar?.setHidden(!0);return}this.setup();const{buttonsToolbar:a,dropdownToolbar:o}=this;if(!a||!o)return;a.updateButtons(this.buttons),o.updateButtons([this.getDropdownButtonOptions(this.dropdownLabel)]),this.updateCSSVariables(),e.visible==="always"?this.swapDropdownIn():this.swapDropdownOut();const{height:r}=this.isDropdown?o.getBounds():a.getBounds(),l={x:t.x,y:t.y};n==="top"||n==="top-left"||n==="top-right"?t.shrink({top:r+s}):(l.y=t.y+t.height-r,t.shrink({bottom:r+s})),a.setBounds(l),o.setBounds(l)}onLayoutComplete({series:{rect:t},layoutBox:e}){const{buttons:i,buttonsToolbar:n,ctx:s,dropdown:a,dropdownMenu:o,dropdownToolbar:r,enabled:l}=this;if(!l||!n||!r||!o)return;let c;if(a.visible==="auto"&&(c=n.getBounds(),c.width>t.width?this.swapDropdownIn():this.swapDropdownOut()),this.isDropdown)c=r.getBounds(),this.dropdownMinWidth??(this.dropdownMinWidth=c.width),c.width=Math.max(c.width,this.dropdownMinWidth),c=this.updateToolbarBounds(r,t,e,c);else{c=this.updateToolbarBounds(n,t,e,c);let g=0;for(const f of i)n.toggleButtonEnabledByIndex(g,this.getButtonEnabled(f)),g++}const u={x:s.domManager.isRtl?c.x+c.width:c.x,y:c.y+c.height+1},d={x:c.x+c.width,y:c.y-1};o.setAnchor(u,d)}onChartWidgetClick(){this.dropdownMenu?.hide()}updateToolbarBounds(t,e,i,n){const{position:s}=this,a=n??t.getBounds();return s==="top-right"||s==="bottom-right"?a.x=i.x+i.width-a.width:(s==="top"||s==="bottom")&&(a.x=i.x+i.width/2-a.width/2),a.x=Nt(e.x,a.x,e.x+e.width-a.width),t.setBounds({x:a.x,y:a.y,width:a.width}),a}updateCSSVariables(){this.gap>0?this.buttonsToolbar?.addClass("ag-charts-range-buttons--gapped"):this.buttonsToolbar?.removeClass("ag-charts-range-buttons--gapped");const t=["paddingTop","paddingRight","paddingBottom","paddingLeft","strokeWidth"];this.ctx.domManager.setModuleCSSVariables("ranges",void 0,void 0,{gap:this.gap,minSize:this.minSize},["gap","minSize"]),this.ctx.domManager.setModuleCSSVariables("ranges","button",void 0,this.getComponentVariables(this.button),t),this.ctx.domManager.setModuleCSSVariables("ranges","button","active",this.getComponentStateVariables(this.button,"active"),t),this.ctx.domManager.setModuleCSSVariables("ranges","button","disabled",this.getComponentStateVariables(this.button,"disabled"),t),this.ctx.domManager.setModuleCSSVariables("ranges","button","hover",this.getComponentStateVariables(this.button,"hover"),t),this.ctx.domManager.setModuleCSSVariables("ranges","dropdown",void 0,this.getComponentVariables(this.dropdown),t),this.ctx.domManager.setModuleCSSVariables("ranges","dropdown","active",this.getComponentStateVariables(this.dropdown,"active"),t),this.ctx.domManager.setModuleCSSVariables("ranges","dropdown","disabled",this.getComponentStateVariables(this.dropdown,"disabled"),t),this.ctx.domManager.setModuleCSSVariables("ranges","dropdown","hover",this.getComponentStateVariables(this.dropdown,"hover"),t)}getComponentVariables(t){return{cornerRadius:t.cornerRadius,fill:this.getComponentFill(t.fill,t.fillOpacity),fontSize:t.fontSize,fontFamily:t.fontFamily,fontWeight:t.fontWeight,stroke:t.stroke,strokeWidth:t.strokeWidth,textColor:t.textColor,paddingTop:typeof t.padding=="number"?t.padding:t.padding.top??0,paddingRight:typeof t.padding=="number"?t.padding:t.padding.right??0,paddingBottom:typeof t.padding=="number"?t.padding:t.padding.bottom??0,paddingLeft:typeof t.padding=="number"?t.padding:t.padding.left??0}}getComponentStateVariables(t,e){return{fill:this.getComponentFill(t[e].fill,t[e].fillOpacity),fillOpacity:t[e].fillOpacity,stroke:t[e].stroke,textColor:t[e].textColor}}getComponentFill(t,e){if(e>=1)return t;const i=se.fromString(t);return new se(i.r,i.g,i.b,e).toString()}onZoomChanged(){this.buttonsToolbar?.clearActiveButton(),this.isDropdown&&this.resetDropdownButton()}onButtonPress({button:{index:t}}){this.isDropdown?this.showDropdownMenu():this.updateZoomWithButtonIndex(t)}swapDropdownIn(){this.isDropdown||(this.isDropdown=!0,this.buttonsToolbar?.setHidden(!0),this.dropdownToolbar?.setHidden(!1))}swapDropdownOut(){this.isDropdown!==!1&&(this.isDropdown=!1,this.buttonsToolbar?.setHidden(!1),this.dropdownToolbar?.setHidden(!0),this.buttonsToolbar?.clearActiveButton(),this.dropdownMenu?.hide())}resetDropdownButton(){this.dropdownToolbar?.updateButtonByIndex(0,this.getDropdownButtonOptions(kw))}getDropdownButtonOptions(t){return this.dropdownLabel=t,{label:t,value:1/0,icon:"chevron-filled-down",iconPosition:"after"}}showDropdownMenu(){const t=this.dropdownToolbar?.getButtonWidget(0);if(!this.dropdownToolbar||!this.dropdownMenu||!t)return;this.dropdownToolbar.toggleActiveButtonByIndex(0);const e=this.buttons.map((i,n)=>({ariaLabel:i.ariaLabel,enabled:this.getButtonEnabled(i),label:i.label??`${n}`,value:`${n}`,icon:i.icon}));this.dropdownMenu.show(t,{class:"ag-charts-range-buttons-menu",items:e,minWidth:this.dropdownMinWidth,onPress:i=>{const n=Number(i.value);this.updateZoomWithButtonIndex(n),this.dropdownToolbar?.updateButtonByIndex(0,this.getDropdownButtonOptions(i.label??kw))},onHide:()=>{this.dropdownToolbar?.clearActiveButton()}})}updateZoomWithButtonIndex(t){const{zoomManager:e}=this.ctx,i=this.buttons.at(t);if(!i)return;const{value:n}=i,s=nut(`zoom-range-button-${t}`),a=this.getUpdateWithFn(n);a.valid===!1||a.fn==null?e.resetZoom(s):e.updateWith(s,z.X,a.fn),this.buttonsToolbar?.toggleActiveButtonByIndex(t)}getUpdateWithFn(t){if(t==null)return{valid:!0};if(typeof t=="number")return{fn:(e,i)=>[Number(i)-t,void 0],valid:!0};if(Array.isArray(t))return{fn:()=>t,valid:!0};if(typeof t=="function")return{fn:t,valid:!0};if(Rj(t)||Pj(t)){const[,e]=this.ctx.axisManager.getAxisContext(z.X).at(0)?.scale.getDomainMinMax()??[];if(Ac(e)){const i=Oj(t,e);return{fn:n=>[i??n,void 0],valid:!0}}return{valid:!1}}return{valid:!0}}getButtonEnabled(t){const{enableOutOfRange:e,ctx:{zoomManager:i}}=this;let n=t.enabled??e;if(t.enabled==null&&e===!1){const s=this.getUpdateWithFn(t.value);if(s.valid===!1)return!1;n=s.fn==null?!0:i.isValidUpdateWith(z.X,s.fn,"range-check")}return n}};M([Pe({newValue(t){t||(this.isDropdown=void 0)}}),b],rn.prototype,"enabled");M([b],rn.prototype,"buttons");M([b],rn.prototype,"button");M([b],rn.prototype,"dropdown");M([b],rn.prototype,"active");M([b],rn.prototype,"disabled");M([b],rn.prototype,"hover");M([b],rn.prototype,"enableOutOfRange");M([b],rn.prototype,"gap");M([b],rn.prototype,"cornerRadius");M([b],rn.prototype,"fill");M([b],rn.prototype,"fillOpacity");M([b],rn.prototype,"fontSize");M([b],rn.prototype,"fontFamily");M([b],rn.prototype,"fontWeight");M([b],rn.prototype,"stroke");M([b],rn.prototype,"strokeWidth");M([b],rn.prototype,"textColor");M([b],rn.prototype,"padding");M([b],rn.prototype,"position");M([b],rn.prototype,"spacing");M([b],rn.prototype,"minSize");var Cw={...ia,stroke:bt.stroke,textColor:It},aut={...ia,...bt,...De,textColor:It,cornerRadius:X,padding:Ar,active:Cw,disabled:Cw,hover:Cw};dt("auto","always","never");var out={position:dt("top-left","top","top-right","bottom-left","bottom","bottom-right"),...aut,buttons:Xi({...Zh,enabled:J,value:Xt(gt,Me(Ft(Xt(gt,_s)),Tu(2,2)),jf,vp,ai)},"range button options array")};out.minSize=Mt(X);Cn.SMALL;var{LayoutElement:rut,Group:lut,Label:Hy,Rect:cut,Text:Xn}=j,fF={ohlc:62,candlestick:62,"hollow-candlestick":62,line:96,"step-line":96,hlc:184,"high-low":800},hut={up:"positive",down:"negative"},uut={hlc:"altNeutral"},GO=class extends xt{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};M([b],GO.prototype,"fill");M([b],GO.prototype,"fillOpacity");var Co=class extends Ln{constructor(t){super(),this.ctx=t,this.enabled=!1,this.openKey=void 0,this.highKey=void 0,this.lowKey=void 0,this.closeKey=void 0,this.volumeKey=void 0,this.title=new Hy,this.positive=new Hy,this.negative=new Hy,this.neutral=new Hy,this.altNeutral=new Hy,this.background=new GO,this.layoutStyle="block",this.id="status-bar",this.layer=new lut({name:"StatusBar",zIndex:pe.STATUS_BAR}),this.labelGroup=this.layer.appendChild(new j.TranslatableGroup),this.backgroundNode=this.labelGroup.appendChild(new cut),this.labels=[{label:"O",configuration:2,title:this.labelGroup.appendChild(new Xn),value:this.labelGroup.appendChild(new Xn),id:"openValue",key:"openKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:16,title:this.labelGroup.appendChild(new Xn),value:this.labelGroup.appendChild(new Xn),id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:256,title:this.labelGroup.appendChild(new Xn),value:this.labelGroup.appendChild(new Xn),style:"neutral",id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:8,title:this.labelGroup.appendChild(new Xn),value:this.labelGroup.appendChild(new Xn),id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:512,title:this.labelGroup.appendChild(new Xn),value:this.labelGroup.appendChild(new Xn),style:"neutral",id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:4,title:this.labelGroup.appendChild(new Xn),value:this.labelGroup.appendChild(new Xn),id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:128,title:this.labelGroup.appendChild(new Xn),value:this.labelGroup.appendChild(new Xn),id:"closeValue",key:"closeKey",style:"neutral",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"",configuration:64,title:this.labelGroup.appendChild(new Xn),value:this.labelGroup.appendChild(new Xn),style:"neutral",id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})},{label:"Vol",configuration:32,title:this.labelGroup.appendChild(new Xn),value:this.labelGroup.appendChild(new Xn),id:"volumeValue",key:"volumeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})}],this.highlightManager=t.highlightManager,this.labelGroup.visible=!1,this.cleanup.register(t.scene.attachNode(this.layer),t.layoutManager.registerElement(rut.Overlay,e=>this.startPerformLayout(e)),t.eventsHub.on("layout:complete",e=>this.onLayoutComplete(e)),t.eventsHub.on("highlight:change",()=>this.updateHighlight()),t.eventsHub.on("data:update",e=>{this.chartData=e}))}updateDomainsFromSeries(){if(!this.enabled)return;const t=this.ctx.chartService.series;if(t.length===0)return;let e,i;for(const n of t){const a=n.getDomain(z.Y)?.domain;!Array.isArray(a)||a.length<2||(n.type==="bar"?i=[a[0],a.at(-1)]:e=[a[0],a.at(-1)])}for(const n of this.labels){if(this[n.key]==null){n.domain=void 0;continue}n.domain=n.key==="volumeKey"?i:e}}startPerformLayout({layoutBox:t}){if(this.labelGroup.translationX=0,this.labelGroup.translationY=0,!this.enabled){this.labelGroup.visible=!1;return}this.updateDomainsFromSeries();const e=4,i=12,n=0,s=8;this.labelGroup.translationY=t.y+n;const a=Math.max(this.title.fontSize,this.positive.fontSize,this.negative.fontSize),o=nr(a),r=fF[this.getChartType()]??0;let l=0,c,u="alphabetic";if(this.layoutStyle==="block")t.shrink(n+o+s,"top"),c=a+(o-a)/2;else{const{title:d}=this.ctx.chartService;if(u="top",c=n+d.padding,d.enabled){const g=d.node.getBBox();l=g.x+g.width+i}else l=d.padding}for(const{label:d,configuration:g,title:f,value:y,domain:x,formatter:S}of this.labels){if(x==null||(r&g)===0){f.visible=!1,y.visible=!1;continue}const D=Ve(this.positive),A=Ve(this.negative),I=Math.max(D.textWidth(S.format(x[0])),D.textWidth(S.format(x[1])),A.textWidth(S.format(x[0])),A.textWidth(S.format(x[1])));f.visible=!0,y.visible=!0;const w=Ve(this.title).measureLines(d);f.setFont(this.title),f.fill=this.title.color,f.text=d,f.textAlign="left",f.textBaseline=u,f.y=c,f.x=l,l+=w.width+e,y.textAlign="left",y.textBaseline=u,y.y=c,y.x=l,l+=I+i}this.backgroundNode.x=0,this.backgroundNode.y=0,this.backgroundNode.width=l-i,this.backgroundNode.height=o+n+s,this.backgroundNode.fill=this.background.fill,this.backgroundNode.fillOpacity=this.background.fillOpacity}onLayoutComplete(t){this.labelGroup.translationX=t.series.rect.x,this.updateHighlight()}updateHighlight(){if(!this.enabled)return;const t=this.highlightManager.getActiveHighlight(),e=t?.datum??this.chartData?.data?.at(-1);if(e==null){this.labelGroup.visible=!1;return}this.labelGroup.visible=!0;const i=t?.itemId;let n=i==null?void 0:hut[i];n==null&&this.openKey!=null&&this.closeKey!=null&&(e[this.openKey]n?.valueOf()),i.map(n=>n?.valueOf())):!tr(e,i)}var Up=class extends xt{constructor(t){super(),this.moduleContext=t,this.enabled=!1,this.axes="x",this.nodeInteraction=!0,this.zoom=!0,this.domainMode="id",this.domainSync=new dM}updateSiblings(t){const{syncManager:e}=this.moduleContext;for(const i of e.getGroupSiblings(t??this.groupId))tl("ChartSync.updateSiblings()",i.id,i),this.updateChart(i)}updateChart(t,e=Ct.PROCESS_DOMAIN){tl("ChartSync.updateChart()",t.id,Ct[e],t),e===Ct.PROCESS_DOMAIN?t.ctx.eventsHub.emit("chart:request-update",{type:e,opts:{forceNodeDataRefresh:!0}}):t.ctx.eventsHub.emit("chart:request-update",{type:e})}enabledZoomSync(){const{eventsHub:t}=this.moduleContext;this.disableZoomSync?.(),this.disableZoomSync=t.on("zoom:change-complete",e=>this.onZoom(e))}onZoom(t){const{syncManager:e}=this.moduleContext;for(const i of e.getGroupSiblings(this.groupId)){if(!i.modulesManager.getModule("sync")?.zoom)continue;const s=i.modulesManager.getModule("zoom");if(!s)continue;const a=this.prepareZoomUpdate();t.source!=="sync"&&(tl("ChartsSyncManager.enabledZoomSync()",i.id,a),s.updateSyncZoom(a))}}enabledNodeInteractionSync(){this.disableNodeInteractionSync?.();const t=this.moduleContext.eventsHub.on("highlight:change",this.onHighlightChange.bind(this)),e=this.moduleContext.eventsHub.on("active:load-memento",this.onActiveLoadMemento.bind(this));this.disableNodeInteractionSync=()=>{t(),e()}}onHighlightChange(t){const{syncManager:e}=this.moduleContext;if(t.callerId.endsWith("-sync"))return;tl("ChartSync.onHighlightChange()",t);const i=t.currentHighlight?.series,[n]=Nw(this.axes),s=n===z.X?z.Y:z.X,[a,o]=i?yF(i,n,s):[],r=FM(t.currentHighlight);let l=a?.[0]?r?.[a[0]]:void 0,c=!1;if(aa(l)&&(c=!0,l=l.getTime()),!t.currentHighlight?.datum){for(const d of e.getGroupSiblings(this.groupId))d.modulesManager.getModule("sync")?.nodeInteraction&&(d.ctx.highlightManager.updateHighlight(`${d.id}-sync`,void 0,!0),d.ctx.tooltipManager.removeTooltip(`${d.id}-sync`,void 0,!0));return}const u=e.getGroupSyncMode(this.groupId)==="multi-series";this.findMatchingHighlightNodes(n,s,u?o:[],c,l,t)}onActiveLoadMemento(t){const{activeItem:e,chartId:i}=t;if(e===void 0){this.moduleContext.highlightManager.updateHighlight(`${i}-sync`,void 0,!1),this.moduleContext.tooltipManager.removeTooltip(`${i}-sync`,void 0,!1);for(const n of this.moduleContext.syncManager.getGroupSiblings(this.groupId))n.onSyncActiveClear()}}findMatchingHighlightNodes(t,e,i,n,s,a){const{syncManager:o}=this.moduleContext;tl("ChartSync.findMatchingHighlightNodes()",{mainDirection:t,secondaryKeys:i});for(const r of o.getGroupSiblings(this.groupId)){if(!r.modulesManager.getModule("sync")?.nodeInteraction)continue;let c=!1;for(const u of r.axes){if(!ww.is(u)||u.direction!==t)continue;const d=r.series.filter(g=>{if(!g.visible)return!1;if(i.length>0){const[,f]=yF(g,t,e);return i.every(y=>f.includes(y))}return!0}).map(this.findMatchingNodes(u,t,n,s)).filter(go);if(d.length===1&&d[0]?.nodeDatum!==r.ctx.highlightManager.getActiveHighlight()){this.dispatchHighlightUpdate(r,d[0].nodeDatum),c=!0;break}}c||(tl("ChartSync.findMatchingHighlightNodes() - no matching nodes",r.id,a),this.dispatchHighlightUpdate(r))}}findMatchingNodes(t,e,i,n){return s=>{if(s.getKeyAxis(t.direction)!==t.id)return;const o=s.contextNodeData?.nodeData??[];if(!o?.length)return;const r=o[0],l=`${e}Key`;if(!W4(r,l))return;const c=r[l],u=o.find(d=>{const g=d.datum[c];return i?g.getTime()===n:g===n});return u?{series:s,nodeDatum:u}:null}}dispatchHighlightUpdate(t,e){tl("ChartSync.dispatchHighlightUpdate()",t.id,e);const i=e==null;t.ctx.highlightManager.updateHighlight(`${t.id}-sync`,e,i);const n=e?.series.tooltipEnabled??t.tooltip.enabled;if(e&&n){const s=t.seriesAreaBoundingBox,a=s.x+(e.midPoint?.x??e.point?.x??0),o=s.y+(e.midPoint?.y??e.point?.y??0),r=gut.makeTooltipMeta({type:"pointermove",canvasX:a,canvasY:o},e.series,e,void 0);t.ctx.tooltipManager.updateTooltip(`${t.id}-sync`,r,t.getTooltipContent(e.series,e.datumIndex,e,"tooltip"))}else t.ctx.tooltipManager.removeTooltip(`${t.id}-sync`,void 0,!0);this.updateChart(t,Ct.SERIES_UPDATE)}async getSyncedDomain(t){if(!ww.is(t)||this.axes!=="xy"&&this.axes!==t.direction)return;const{groupState:e,directionDomains:i,idDomains:n,positionDomains:s}=this.updateDomainState(t);return this.validateAxis(t,e),await this.waitForDomainsToBeReady(),this.domainMode==="position"?this.calculateDerivedDomain(t,s):this.domainMode==="direction"?this.calculateDerivedDomain(t,i):this.calculateDerivedDomain(t,n)}updateDomainState(t){var e,i,n,s,a;const{syncManager:o}=this.moduleContext,r=o.getChart().id,l=t.id,c=o.getGroupState(this.groupId);if(!c)throw new Error("AG Charts - no GroupState for groupId: "+this.groupId);const u=c.domains??(c.domains={}),d=u[e=t.direction]??(u[e]={derived:[],sources:{},dirty:!0}),g=(i=d.sources)[r]??(i[r]={});g[l]=t.dataDomain.domain,d.dirty=!0;const f=c.domainsById??(c.domainsById={}),y=f[l]??(f[l]={derived:[],sources:{},dirty:!0}),x=(n=y.sources)[r]??(n[r]={});x[l]=t.dataDomain.domain,y.dirty=!0;const S=c.domainsByPosition??(c.domainsByPosition={}),D=S[s=t.position]??(S[s]={derived:[],sources:{},dirty:!0}),A=(a=D.sources)[r]??(a[r]={});return A[l]=t.dataDomain.domain,D.dirty=!0,{groupState:c,directionDomains:d,idDomains:y,positionDomains:D}}validateAxis(t,e){const i=this.moduleContext.syncManager.getGroupSyncMode(this.groupId)==="multi-series";Nw(this.axes).includes(t.direction)&&(i?this.validateMultiSeries(t,e):this.validateSingleSeries(t,e))}validateMultiSeries(t,e){const{min:i,max:n,nice:s,reverse:a}=t,o=new Set(t.boundSeries.flatMap(r=>r.getKeys(t.direction)));for(const r of e.members){const{axes:l,modulesManager:c}=r,u=c.getModule("sync"),d=Nw(u?.axes),g=l.filter(y=>d.includes(y.direction)).filter(y=>y.boundSeries.some(x=>x.getKeys(y.direction).some(S=>o.has(S))));if(g.length===0)continue;const[f]=g;if(f.min!==i||f.max!==n||f.nice!==s||f.reverse!==a){pt.warnOnce("To allow synchronization, ensure that all synchronized axes with matching keys have matching min, max, nice, and reverse properties."),this.enabled=!1;return}}}validateSingleSeries(t,e){const i=e.members,[{axes:n}]=i,{direction:s,min:a,max:o,nice:r,reverse:l}=t;for(const c of n)if(s===c.direction&&(r!==c.nice||l!==c.reverse||a!==c.min&&(Ae(a)||Ae(c.min))||o!==c.max&&(Ae(o)||Ae(c.max)))){pt.warnOnce("To allow synchronization, ensure that all charts have matching min, max, nice, and reverse properties on the synchronized axes."),this.enabled=!1;return}}calculateDerivedDomain(t,e){if(!e.dirty)return e.derived;let i=e.derived;const n=Object.values(e.sources).map(a=>Object.values(a));let s;return mF.is(t.scale)?s=n.flat(2):s=n.flat().toSorted((a,o)=>a.length>o.length?-1:1).flat(),e.derived=ZM(s),mF.is(t.scale)&&(i=xi(i),e.derived=xi(e.derived)),e.dirty=!1,fut(t.scale,i,e.derived)&&(tl(t.id,"updated",{before:i,after:e.derived}),this.updateSiblings()),e.derived}removeAxis(t){if(!ww.is(t)||this.axes!=="xy"&&this.axes!==t.direction)return;const{syncManager:e}=this.moduleContext,i=e.getGroupState(this.groupId),n=e.getChart().id,s=t.id;delete i?.domains?.[t.direction]?.sources?.[n]?.[s],delete i?.domainsByPosition?.[t.position]?.sources?.[n]?.[s],delete i?.domainsById?.[s]?.sources?.[n]?.[s]}async waitForDomainsToBeReady(){const{syncManager:t}=this.moduleContext;let e=0;for(;t.getGroupMembers(this.groupId).some(i=>i.syncStatus==="init");)tl("ChartSync.waitForDomainsToBeReady() - waiting for all domains to be calculated",this.groupId),await this.domainSync.waitForCompletion(),e++;e>0&&tl("ChartSync.waitForDomainsToBeReady() - waited for",e,"iterations"),this.domainSync.notify()}prepareZoomUpdate(){const{zoomManager:t}=this.moduleContext,e=t.getZoom();return this.axes==="x"?delete e?.y:this.axes==="y"&&delete e?.x,Ni(e)}onEnabledChange(){const{syncManager:t,highlightManager:e}=this.moduleContext;this.enabled?(t.subscribe(this.groupId),e.unhighlightDelay=0):(t.unsubscribe(this.groupId),e.unhighlightDelay=100),this.updateSiblings(),this.onNodeInteractionChange(),this.onZoomChange()}onGroupIdChange(t,e){if(!this.enabled||t===e)return;const{syncManager:i}=this.moduleContext;i.unsubscribe(e),i.subscribe(t),this.updateSiblings(e),this.updateSiblings(t)}onAxesChange(){if(!this.enabled)return;const{syncManager:t}=this.moduleContext;this.updateChart(t.getChart())}onNodeInteractionChange(){this.enabled&&this.nodeInteraction?this.enabledNodeInteractionSync():this.disableNodeInteractionSync?.()}onZoomChange(){this.enabled&&this.zoom?this.enabledZoomSync():this.disableZoomSync?.()}destroy(){const{syncManager:t}=this.moduleContext;t.unsubscribe(this.groupId),this.updateSiblings(),this.disableZoomSync?.()}};Up.className="Sync";M([b,Bi(t=>t.onEnabledChange())],Up.prototype,"enabled");M([b,Bi((t,e,i)=>t.onGroupIdChange(e,i))],Up.prototype,"groupId");M([b,Bi(t=>t.onAxesChange())],Up.prototype,"axes");M([b,Bi(t=>t.onNodeInteractionChange())],Up.prototype,"nodeInteraction");M([b,Bi(t=>t.onZoomChange())],Up.prototype,"zoom");M([b,Bi(t=>t.onAxesChange())],Up.prototype,"domainMode");dt("x","y","xy");var bF="#2196f3",mut="#8a8a8a",m5=class extends j.Rect{constructor(){super(),this.fill=bF,this.fillOpacity=.2,this.zIndex=pe.ZOOM_SELECTION}updateValid(){this.fill=bF}updateInvalid(){this.fill=mut}};m5.className="ZoomRect";var UO=class extends xt{constructor(){super(),this.enabled=!1,this.padding=0}};M([b],UO.prototype,"enabled");M([b],UO.prototype,"padding");var yut=class{constructor(t,e,i,n,s){this.properties=t,this.zoomManager=e,this.deps=i,this.manuallyAdjusted=!1,s.register(n.on("zoom:save-memento",a=>this.onSaveMemento(a)),n.on("zoom:load-memento",a=>this.onLoadMemento(a)),n.on("zoom:change-request",a=>this.onChangeRequest(a)))}get enabled(){return this.deps.enabled&&this.properties.enabled&&!this.manuallyAdjusted}onManualAdjustment(t){t===z.Y&&(this.manuallyAdjusted=!0)}onChangeRequest(t){const e=this.hasYAxisChange(t);if(t.sourceDetail==="scrollbar"&&e&&(this.manuallyAdjusted=!0),t.isReset&&e&&(this.manuallyAdjusted=!1),this.enabled){const i=this.autoScaleYZoom(t.state);i&&t.constrainChanges(i)}}hasYAxisChange(t){for(const e of t.changedAxes)if(t.state[e]?.direction===z.Y)return!0;return!1}onSaveMemento(t){t.memento.autoScaledAxes=this.enabled?["y"]:void 0}onLoadMemento(t){const{zoom:e,memento:i,navigatorModule:n,zoomModule:s}=t;if(!n||s){let a=i?.autoScaledAxes?.includes("y");if(i?.rangeY)a??(a=!1),e.y=this.zoomManager.rangeToRatioDirection(z.Y,i.rangeY)??{min:0,max:1};else if(i?.ratioY)a??(a=!1),e.y={min:i.ratioY.start??0,max:i.ratioY.end??1};else{a??(a=!0);const o=a?this.getAutoScaleYZoom(e.x):void 0;e.y=o??{min:0,max:1}}a!=null&&(this.manuallyAdjusted=!a)}}getAutoScaleYZoom(t){if(!this.enabled)return;const{padding:e}=this.properties;let i;return this.deps.enableIndependentAxes?i=this.primaryAxisZoom(z.Y,t,{padding:e}):i=this.combinedAxisZoom(z.Y,t,{padding:e}),t.min===0&&t.max===1?i==null?void 0:{min:0,max:1}:i}autoScaleYZoom(t){const e=this.zoomManager.getZoom();if(e&&t){const n=this.zoomManager.getAxisZooms();for(const s of[z.X,z.Y])for(const a of hl(t))if(n[a]?.direction===s){e[s]=t[a];break}}if(e?.x==null)return;const i=this.getAutoScaleYZoom(e.x);if(!(i==null||ks(e.y,i)))return this.zoomManager.toCoreZoomState({x:e.x,y:i})}zoomBounds(t,e,i,n){const s=t.scale,a=s.range;s.range=[0,1];const o=e.scale,r=o.range;o.range=[0,1];let l=1,c=!1,u=0,d=!1;for(const y of e.boundSeries){if(!y.visible)continue;const{connectsToYAxis:x}=y,S=y.getRange(z.Y,[i.min,i.max]);for(const D of S){const A=o.convert(D);Number.isFinite(A)&&(Au&&(u=A,d=!x||D>0))}}if(Ae(e.min)&&(l=0),Ae(e.max)&&(u=1),s.range=a,o.range=r,l>=u)return;const g=(c?n:0)+(d?n:0),f=Math.min((u-l)*(1+g),1);if(!(f<=0)){if(c&&d){const y=(u+l)/2;l=y-f/2,u=y+f/2}else!c&&d?u=l+f:c&&!d&&(l=u-f);return l<0?(u+=-l,l=0):u>1&&(l-=u-1,u=1),{min:l,max:u}}}primaryAxisZoom(t,e,{padding:i=0}={}){const n=t===z.X?z.Y:z.X,s=this.zoomManager.getPrimaryAxis(n),a=this.zoomManager.getPrimaryAxis(t);if(!(s==null||a==null))return this.zoomBounds(s,a,e,i)}combinedAxisZoom(t,e,{padding:i=0}={}){const n=this.zoomManager.getAxes(),s=t===z.X?z.Y:z.X,a=new Map;for(const c of n)if(c.direction===s)for(const u of c.boundSeries)a.set(u,c);let o=1,r=0;for(const c of n)if(c.direction===t)for(const u of c.boundSeries){const d=a.get(u);if(d==null)continue;const g=this.zoomBounds(d,c,e,i);if(g==null)return;o=Math.min(o,g.min),r=Math.max(r,g.max)}const l=1e-6;if(o1-l&&(r=1),!(o>r))return{min:o,max:r}}},but=class{update(t,e,i,n,s,a){return this.oldZoom??(this.oldZoom=Ni(e===z.X?{...s,x:a}:{...s,y:a})),this.updateCoords(t.offsetX,t.offsetY),this.updateZoom(e,i,n)}stop(){this.coords=void 0,this.oldZoom=void 0}updateCoords(t,e){this.coords?(this.coords.x2=t,this.coords.y2=e):this.coords={x1:t,y1:e,x2:t,y2:e}}updateZoom(t,e,i){const{coords:n,oldZoom:s}=this;let a=Ni(s);if(!n||!s)return t===z.X?a.x:a.y;const o=Rc(i,n.x1,n.y1),r=Rc(i,n.x2,n.y2);if(t===z.X){const c=(r.x-o.x)*jn(s);return a.x.max+=c,a.x=lo(a.x,s.x,e,o.x),a=lr(a),a.x}const l=(r.y-o.y)*Ha(s);return a.y.max-=l,a.y=lo(a.y,s.y,e,o.y),a=lr(a),a.y}},{userInteraction:Tw}=j,xut=class{constructor(t,e,i,n,s,a,o){this.eventsHub=t,this.contextMenuRegistry=e,this.zoomManager=i,this.getModuleProperties=n,this.getRect=s,this.updateZoom=a,this.isZoomValid=o}registerActions(t){const{contextMenuRegistry:e}=this,i=t?"show":"hide";if(e.toggle("zoom-to-cursor",i),e.toggle("pan-to-cursor",i),e.toggle("reset-zoom",i),!t)return;e.builtins.items["zoom-to-cursor"].action=this.onZoomToHere.bind(this),e.builtins.items["pan-to-cursor"].action=this.onPanToHere.bind(this),e.builtins.items["reset-zoom"].action=this.onResetZoom.bind(this);const n=o=>{const r=this.getRect();if(!r)return!0;const l=Rc(r,o.x,o.y);return this.iterateFindNextZoomAtPoint(l)!=null},s=()=>!pf(Ni(this.zoomManager.getZoom())),a=this.eventsHub.on("context-menu:setup",o=>{e.builtins.items["zoom-to-cursor"].enabled=n(o),e.builtins.items["pan-to-cursor"].enabled=s(),e.builtins.items["reset-zoom"].enabled=u5(this.zoomManager)});return()=>{a(),e.toggle("zoom-to-cursor","hide"),e.toggle("pan-to-cursor","hide"),e.toggle("reset-zoom","hide")}}computeOrigin(t){const e=this.getRect(),{enabled:i}=this.getModuleProperties();if(!i||!e||!t?.target||!(t instanceof MouseEvent))return;const n={x:0,y:0,width:e.width,height:e.height};return Rc(n,t.offsetX,t.offsetY)}onZoomToHere({event:t}){const e=this.computeOrigin(t);if(!e)return;const i=this.iterateFindNextZoomAtPoint(e);i!=null&&this.updateZoom(Tw("contextmenu-zoom-to-cursor"),i)}onPanToHere({event:t}){const e=this.computeOrigin(t);if(!e)return;const i=Ni(this.zoomManager.getZoom()),n=jn(i),s=Ha(i),a=e.x*n,o=e.y*s,r=$d/2;let l={x:{min:e.x-r,max:e.x+r},y:{min:e.y-r,max:e.y+r}};l=cF(l,n,s),l=mp(l,i.x.min-e.x+a,i.y.min-e.y+o),this.updateZoom(Tw("contextmenu-pan-to-cursor"),lr(l))}onResetZoom(t){this.zoomManager.resetZoom(Tw("contextmenu-reset"))}iterateFindNextZoomAtPoint(t){const{scrollingStep:e}=this.getModuleProperties();for(let i=e;i<=1-e;i+=e){const n=this.getNextZoomAtPoint(t,i);if(this.isZoomValid(n))return n}}getNextZoomAtPoint(t,e){const{isScalingX:i,isScalingY:n}=this.getModuleProperties(),s=Ni(this.zoomManager.getZoom()),a=t.x*jn(s),o=t.y*Ha(s),r=$d/2;let l={x:{min:t.x-r,max:t.x+r},y:{min:t.y-r,max:t.y+r}};return l=cF(l,i?jn(s)*e:$d,n?Ha(s)*e:$d),l=mp(l,s.x.min-t.x+a,s.y.min-t.y+o),lr(l)}},{userInteraction:vut}=j;function Sut(t){return t.x.min===0&&t.x.max===1&&t.y.min===0&&t.y.max===1}function Mut(t,e){return t.stickToEnd&&e.x.max===1}function xF(t,e,i){const{domainMin:n,domainMax:s}=e,a=s-n;return{axisId:t,visibleMin:n+a*i.min,visibleMax:n+a*i.max}}function vF(t,e){const{domainMin:i,domainMax:n}=t,{visibleMin:s,visibleMax:a}=e,o=n-i;return{direction:"x",min:Nt(0,(s-i)/o,1),max:Nt(0,(a-i)/o,1)}}var WO=class extends xt{constructor(){super(...arguments),this.strategy="preserveDomain",this.stickToEnd=!1}};M([b],WO.prototype,"strategy");M([b],WO.prototype,"stickToEnd");var Dut=class{constructor(t,e,i,n){this.onConstrainChangesCallback=t,this.properties=e,this.ctx=i;const s=()=>{i.eventsHub.off("layout:complete",s),n.register(i.eventsHub.on("data:load",a=>this.onDataLoad(a)),i.eventsHub.on("data:update",a=>this.onDataUpdate(a)))};n.register(i.eventsHub.on("layout:complete",s),i.eventsHub.on("zoom:change-request",a=>this.onZoomChangeRequest(a)))}destroy(){}onDataLoad(t){this.performUpdateStrategy()}onDataUpdate(t){this.performUpdateStrategy()}onZoomChangeRequest(t){t.sourceDetail==="internal-requiredWidth"&&(this.desiredChanges=void 0);const e=this.popDesiredChanges();e&&(t.constrainChanges(e),this.onConstrainChangesCallback(t))}computeDomainMinMax(t){const e=this.ctx.axisManager.getAxisIdContext(t);if(!e?.continuous||e.scale.domain.length===0)return;const[i,n]=e.scale.getDomainMinMax();if(typeof i=="number"&&typeof n=="number")return{domainMin:i,domainMax:n};if(i instanceof Date&&n instanceof Date)return{domainMin:i.getTime(),domainMax:n.getTime()};pt.error(`Unexpected range types: start (${typeof i}), end (${typeof n})`)}popDesiredChanges(){const{desiredChanges:t}=this;if(t)switch(this.desiredChanges=void 0,t.type){case"domain":{const i={};for(const n of t.domains){const s=this.computeDomainMinMax(n.axisId);s&&(i[n.axisId]=vF(s,n))}return i}case"stickToEnd":{const{axisId:i,difference:n}=t,s=this.computeDomainMinMax(i);if(s){const a={visibleMin:s.domainMax-n,visibleMax:s.domainMax};return{[i]:vF(s,a)}}break}default:return(i=>i)(t)}}performUpdateStrategy(){const t=Ni(this.ctx.zoomManager.getZoom());if(!Sut(t)){if(Mut(this.properties,t))return this.performStickToEnd();switch(this.properties.strategy){case"reset":return this.ctx.zoomManager.resetZoom(vut("onDataChange-reset"));case"preserveRatios":return;case"preserveDomain":return this.performPreserveDomain();default:return(i=>i)(this.properties.strategy)}}}performPreserveDomain(){this.desiredChanges={type:"domain",domains:[]};const t=this.ctx.zoomManager.getAxes().filter(e=>e.direction===z.X);for(const{id:e}of t){const i=this.computeDomainMinMax(e);if(i){const n=this.ctx.zoomManager.getAxisZoom(e),s=xF(e,i,n);this.desiredChanges.domains.push(s)}}}performStickToEnd(){const t=this.ctx.zoomManager.getPrimaryAxisId(z.X);if(!t)return;const e=this.computeDomainMinMax(t);if(!e)return;const i=this.ctx.zoomManager.getAxisZoom(t);if(!i)return;const{visibleMin:n,visibleMax:s}=xF(t,e,i),a=s-n;this.desiredChanges={type:"stickToEnd",axisId:t,difference:a}}},SF=16,Aut={off:1,short:.01,long:.002},Iut=class{constructor(t){this.ctx=t,this.deceleration=1,this.zoomCoordsHistoryIndex=0,this.coordsHistory=[]}get decelerationValue(){const{deceleration:t}=this;return Math.max(typeof t=="number"?t:Aut[t]??1,1e-4)}addListener(t,e){return this.onUpdate=e,()=>{this.onUpdate=void 0}}stopInteractions(){this.inertiaHandle!=null&&(this.ctx.agDocument.cancelAnimationFrame(this.inertiaHandle),this.inertiaHandle=void 0)}update(t){this.updateCoords(t.currentX,t.currentY);const{x1:e=0,y1:i=0,x2:n=0,y2:s=0}=this.coords??{};this.onUpdate?.({type:"update",deltaX:this.isPanningX()?e-n:0,deltaY:this.isPanningY()?i-s:0})}start(t){this.direction=t,this.coordsMonitorTimeout=setInterval(this.recordCurrentZoomCoords.bind(this),16)}stop(){const{coordsHistory:t}=this;let e=0,i=0,n=0;if(t.length>0){const s=this.zoomCoordsHistoryIndex%SF;let a=s-1;a<0&&(a=t.length-1);let o=s;o>=t.length&&(o=0);const r=t[a],l=t[o];e=this.isPanningX()?r.x-l.x:0,i=this.isPanningY()?r.y-l.y:0,n=r.t-l.t}if(this.coords=void 0,this.direction=void 0,clearInterval(this.coordsMonitorTimeout),this.coordsMonitorTimeout=void 0,this.zoomCoordsHistoryIndex=0,this.coordsHistory.length=0,n>0&&this.decelerationValue<1){const s=e/n,a=i/n,o=Math.hypot(s,a),r=Math.atan2(a,s),l=performance.now();this.inertiaHandle=this.ctx.agDocument.requestAnimationFrame(c=>{this.animateInertia(c,c,l,o,r)})}}recordCurrentZoomCoords(){const{coords:t,coordsHistory:e,zoomCoordsHistoryIndex:i}=this;if(!t)return;const{x2:n,y2:s}=t,a=Date.now();e[i%SF]={x:n,y:s,t:a},this.zoomCoordsHistoryIndex+=1}animateInertia(t,e,i,n,s){const a=1-this.decelerationValue,o=-n/Math.log(a),r=n*(a**(e-i)-1)/Math.log(a),l=n*(a**(t-i)-1)/Math.log(a);this.onUpdate?.({type:"update",deltaX:this.isPanningX()?-Math.cos(s)*(l-r):0,deltaY:this.isPanningY()?-Math.sin(s)*(l-r):0}),!(l>=o-1)&&(this.inertiaHandle=this.ctx.agDocument.requestAnimationFrame(c=>{this.animateInertia(c,t,i,n,s)}))}updateCoords(t,e){this.coords?this.coords={x1:this.coords.x2,y1:this.coords.y2,x2:t,y2:e}:this.coords={x1:t,y1:e,x2:t,y2:e}}isPanningX(){return this.direction==null||this.direction===z.X}isPanningY(){return this.direction==null||this.direction===z.Y}translateZooms(t,e,i,n){const s=Rc(t,t.x+Math.abs(i),t.y+t.height-Math.abs(n)),a=Math.sign(i)*s.x,o=-Math.sign(n)*s.y,r={};for(const[l,c]of Xe(e)){if(c==null||c.min===vo&&c.max===Hn)continue;const{direction:u}=c;let d=Ni({[u]:c});d=lr(mp(d,a*jn(d),o*Ha(d)));const{min:g,max:f}=d[u];r[l]={direction:u,min:g,max:f}}return r}},kut=class{updateAxes(t,e,i,n){const s=t.sourceEvent,a={},{anchorPointX:o,anchorPointY:r,isScalingX:l,isScalingY:c,scrollingStep:u}=e,d=Rc(i,s.offsetX??s.clientX,s.offsetY??s.clientY);for(const[g,f]of Xe(n)){if(f==null)continue;const{direction:y,min:x,max:S}=f;let D={min:x,max:S};const A=u*t.deltaY*(S-x);if(y===z.X&&l)D.max+=A,D=lo(D,f,o,d.x);else if(y===z.Y&&c)D.max+=A,D=lo(D,f,r,d.y);else continue;if(D.max0&&this.rect.height>0}updateCoords(t,e,i,n){if(!this.coords){this.coords={x1:t,y1:e,x2:t,y2:e};return}const{coords:s}=this;if(s.x2=t,s.y2=e,!n)return;const{isScalingX:a,isScalingY:o,keepAspectRatio:r}=i,l=this.getNormalisedDimensions();if(r&&a&&o){const c=n.width/n.height;s.y2r&&svo;break;case"pan-end":n=t.x.maxvo;break;case"pan-right":n=t.x.maxi.find(A=>A.identifier===r[D].identifier)),c=r[0].normalX,u=r[1].normalX,d=l[0].clientX,g=l[1].clientX,f=r[0].normalY,y=r[1].normalY,x=s+o-l[0].clientY,S=s+o-l[1].clientY;return this.twitchTolerantZoomPan4(c,u,d,g,f,y,x,S,n,s,a,o)}end(t){const e=Array.from(t.sourceEvent.targetTouches).map(i=>i.identifier);return!e.includes(this.touchStart.origins[0].identifier)||!e.includes(this.touchStart.origins[1].identifier)}twitchTolerantZoomPan4(t,e,i,n,s,a,o,r,l,c,u,d){const{initialZoom:g,previous:f}=this,y=AF(t,e,i,n,f,"a1","a2",l,u,g.x),x=AF(s,a,o,r,f,"b1","b2",c,d,g.y);return{x:y,y:x}}};function AF(t,e,i,n,s,a,o,r,l,c){if(t==e){const u=jM(c,i,r,l),d=jM(c,n,r,l),g=(u+d)/2,f=(t-g)/Hd;return{min:c.min+f,max:c.max+f}}else{const u=s[a],d=s[o];return Math.abs(i-u)+Math.abs(n-d)<=1?(i=u,n=d):(s[a]=i,s[o]=n),Tut(t,e,i,n,r,l)}}var{userInteraction:zh,InteractionState:jy}=j,bS=t=>_b(t,10),Bh="zoom-cursor",Gy="zoom-tooltip",Qi=class extends Ln{constructor(t){super(),this.ctx=t,this.enabled=!1,this.enableAxisDragging=!0,this.enableAxisScrolling=!0,this.enableDoubleClickToReset=!0,this.enablePanning=!0,this.enableScrolling=!0,this.enableSelecting=!1,this.enableTwoFingerZoom=!0,this.panKey="alt",this.axes="x",this.scrollingMode="zoom",this.scrollingStep=$d/10,this.keepAspectRatio=!1,this.minVisibleItems=2,this.anchorPointX=l5,this.anchorPointY=c5,this.autoScaling=new UO,this.axisDraggingMode="zoom",this.buttons=new Em(this.ctx,this.getModuleProperties.bind(this),this.updateZoom.bind(this),this.updateAxisZoom.bind(this),this.resetZoom.bind(this),this.isZoomValid.bind(this)),this.onDataChange=new WO,this.axisDragger=new but,this.panner=new Iut(this.ctx),this.scroller=new kut,this.scrollPanner=new d5,this.twoFingers=new Lut,this.deceleration="short",this.dragState=0,this.isState=n=>this.ctx.interactionManager.isState(n),this.destroyContextMenuActions=void 0,this.previousZoomValid=!0,this.previousAxisZoomValid={[z.X]:!0,[z.Y]:!0};const e=new m5;this.selector=new Cut(e,this.getZoom.bind(this),this.isZoomValid.bind(this)),this.contextMenu=new xut(t.eventsHub,t.contextMenuRegistry,t.zoomManager,this.getModuleProperties.bind(this),()=>this.paddedRect,this.updateZoom.bind(this),this.isZoomValid.bind(this));const i=n=>{if(this.minVisibleItems>0){const s=n.stateAsDefinedZoom();n.constrainZoom(this.constrainZoom(s))}};this.dataChangeHandler=new Dut(i,this.onDataChange,this.ctx,this.cleanup),t.widgets.seriesDragInterpreter&&this.cleanup.register(t.widgets.seriesDragInterpreter.events.on("dblclick",n=>this.onSeriesAreaDoubleClick(n)),t.widgets.seriesDragInterpreter.events.on("drag-start",n=>this.onSeriesAreaDragStart(n)),t.widgets.seriesDragInterpreter.events.on("drag-move",n=>this.onSeriesAreaDragMove(n)),t.widgets.seriesDragInterpreter.events.on("drag-end",()=>this.onSeriesAreaDragEnd())),this.cleanup.register(t.scene.attachNode(e),t.eventsHub.on("series:keynav-zoom",n=>this.onNavZoom(n)),t.eventsHub.on("series:keynav-panx",n=>this.onNavPanX(n)),t.eventsHub.on("zoom-interaction:zoom:wheel",n=>this.onWheel(n)),t.eventsHub.on("zoom-interaction:zoom:axis-mouseenter",n=>this.onAxisMouseEnter(n)),t.eventsHub.on("zoom-interaction:zoom:axis-mouseleave",()=>this.onAxisMouseLeave()),t.eventsHub.on("zoom-interaction:zoom:axis-drag-start",n=>this.onAxisDragStart(n.direction)),t.eventsHub.on("zoom-interaction:zoom:axis-drag-move",n=>this.onAxisDragMove(n.axisId,n.direction,n.event)),t.eventsHub.on("zoom-interaction:zoom:axis-drag-end",()=>this.onAxisDragEnd()),t.eventsHub.on("zoom-interaction:zoom:axis-dblclick",n=>this.onAxisDoubleClick(n.axisId)),t.eventsHub.on("zoom-interaction:zoom:axis-wheel",n=>this.onAxisWheel(n)),t.widgets.seriesWidget.addListener("touchstart",(n,s)=>this.onTouchStart(n,s)),t.widgets.seriesWidget.addListener("touchmove",(n,s)=>this.onTouchMove(n,s)),t.widgets.seriesWidget.addListener("touchend",n=>this.onTouchEnd(n)),t.widgets.seriesWidget.addListener("touchcancel",n=>this.onTouchEnd(n)),t.updateService.addListener("process-data",n=>this.onProcessData(n)),t.eventsHub.on("layout:complete",n=>this.onLayoutComplete(n)),t.eventsHub.on("zoom:change-request",n=>this.onZoomChangeRequested(n)),t.eventsHub.on("zoom:pan-start",n=>this.onZoomPanStart(n)),this.panner.addListener("update",n=>this.onPanUpdate(n)),()=>this.teardown()),this.autoScaler=new yut(this.autoScaling,t.zoomManager,this,t.eventsHub,this.cleanup)}teardown(){this.ctx.zoomManager.setZoomModuleEnabled(!1),this.buttons.destroy(),this.destroyContextMenuActions?.(),this.dataChangeHandler.destroy()}onEnabledChange(t){this.ctx.zoomManager.setZoomModuleEnabled(t),this.contextMenu&&(this.destroyContextMenuActions?.(),this.destroyContextMenuActions=this.contextMenu.registerActions(t))}isIgnoredTouch(t){return t?.device!=="touch"?!1:this.ctx.chartService.touch.dragAction!=="drag"?!0:this.enableSelecting?!1:this.enablePanning?pf(this.getZoom()):!0}onSeriesAreaDoubleClick(t){const{enabled:e,enableDoubleClickToReset:i}=this;!e||!i||t?.preventZoomDblClick||!this.isState(jy.ZoomClickable)||this.resetZoom("zoom-seriesarea-dblclick")}onSeriesAreaDragStart(t){const{enabled:e,enablePanning:i,enableSelecting:n,ctx:{domManager:s,zoomManager:a}}=this;if(!e||!this.isState(jy.ZoomDraggable)||this.dragState!==0||this.isIgnoredTouch(t)||(this.panner.stopInteractions(),this.hoveredAxisId))return;let o=0;const r=this.isPanningKeyPressed(t.sourceEvent);i&&(!n||r)?(s.updateCursor(Bh,"grabbing"),o=2,this.panner.start()):n&&!r&&(o=3),(this.dragState=o)!==0&&a.fireZoomPanStartEvent("zoom")}onSeriesAreaDragMove(t){const{dragState:e,enabled:i,paddedRect:n,panner:s,selector:a,ctx:{interactionManager:o,tooltipManager:r,eventsHub:l}}=this;if(!this.hoveredAxisId&&!(!i||!n||!this.isState(jy.ZoomDraggable)||this.isIgnoredTouch(t))){switch(o.pushState(j.InteractionState.ZoomDrag),t.device==="touch"&&t.sourceEvent.preventDefault(),e){case 2:s.update(t);break;case 3:a.update(t,this.getModuleProperties(),n);break;case 0:return}o.isState(j.InteractionState.Frozen)||r.updateTooltip(Gy),l.emit("chart:request-update",{type:Ct.PERFORM_LAYOUT,opts:{skipAnimations:!0}})}}onSeriesAreaDragEnd(){const{ctx:{interactionManager:t}}=this;this.hoveredAxisId||(t.popState(j.InteractionState.ZoomDrag),!(!this.enabled||this.dragState===0)&&(this.handleRegularDragEnd(),this.resetDragState()))}handleRegularDragEnd(){const{panner:t,selector:e}=this;switch(this.dragState){case 2:t.stop();break;case 3:if(e.didUpdate()){const i=e.stop(this.seriesRect,this.paddedRect,this.getZoom());i?this.updateZoom(zh("zoom-seriesarea-selector"),i):this.ctx.eventsHub.emit("chart:request-update",{type:Ct.SCENE_RENDER})}break}}resetDragState(){this.dragState=0,this.ctx.domManager.updateCursor(Bh),this.ctx.tooltipManager.removeTooltip(Gy)}onAxisMouseEnter(t){const{anchorPointX:e,anchorPointY:i,axisDraggingMode:n,enabled:s,enableAxisDragging:a}=this;if(this.hoveredAxisId=t.axisId,!s||!a){this.ctx.domManager.updateCursor(Bh);return}const o=this.getZoom();let r,l=!1;if(t.direction===z.X){if(r="ew-resize",l=!be(jn(o),$d),!l){const c=HM(o,.999,1);c.x=lo(c.x,o.x,e),l=this.isZoomValid(c,{includeYVisibleRange:!0})}}else if(r="ns-resize",l=!be(Ha(o),$d),!l){const c=HM(o,1,.999);c.y=lo(c.y,o.y,i),l=this.isZoomValid(c,{includeYVisibleRange:!0})}n==="pan"&&(r="grab"),l?(t.stopProcessing(),this.ctx.domManager.updateCursor(Bh,r)):this.ctx.domManager.updateCursor(Bh)}onAxisMouseLeave(){this.hoveredAxisId=void 0,this.ctx.domManager.updateCursor(Bh),!this.enabled||this.enableAxisDragging}onAxisDoubleClick(t){const{enabled:e,enableDoubleClickToReset:i,ctx:{zoomManager:n}}=this;!e||!i||!this.isState(jy.ZoomClickable)||(this.previousAxisZoomValid={[z.X]:!0,[z.Y]:!0},n.resetAxisZoom({source:"user-interaction",sourceDetail:"zoom-axis-dblclick"},t))}onAxisDragStart(t){const{axisDraggingMode:e,enabled:i,enableAxisDragging:n,panner:s,ctx:{zoomManager:a}}=this;!i||!n||(s.stopInteractions(),e==="pan"?(this.ctx.domManager.updateCursor(Bh,"grabbing"),this.dragState=2,this.panner.start(t),a.fireZoomPanStartEvent("zoom")):this.dragState=1)}onAxisDragMove(t,e,i){const{anchorPointX:n,anchorPointY:s,axisDragger:a,dragState:o,enabled:r,enableAxisDragging:l,seriesRect:c,shouldFlipXY:u,ctx:{interactionManager:d,tooltipManager:g,eventsHub:f,zoomManager:y}}=this;if(!r||!l||!c)return;d.pushState(j.InteractionState.ZoomDrag),i.device==="touch"&&i.sourceEvent.preventDefault();const x=this.getZoom();if(o===2)this.panner.update({currentX:i.offsetX,currentY:i.offsetY});else{let S=e===z.X?n:s;u&&(S=e===z.X?s:n);const D=y.getAxisZoom(t),A=a.update(i,e,S,c,x,D);this.autoScaler.onManualAdjustment(e),this.updateAxisZoom(zh("zoom-axis-drag"),t,e,A,{directional:!0})}g.updateTooltip(Gy),f.emit("chart:request-update",{type:Ct.PERFORM_LAYOUT,opts:{skipAnimations:!0}})}onAxisDragEnd(){const{axisDraggingMode:t,axisDragger:e,dragState:i,enabled:n,enableAxisDragging:s,ctx:{domManager:a,interactionManager:o,tooltipManager:r}}=this;o.popState(j.InteractionState.ZoomDrag),!(!n||!s||i===0)&&(this.dragState=0,t==="pan"&&this.panner.stop(),e.stop(),a.updateCursor(Bh),r.removeTooltip(Gy))}onNavZoom(t){const{enabled:e,enableScrolling:i,scroller:n}=this;!this.ctx.interactionManager.isState(j.InteractionState.Focusable)||!e||!i||(t.widgetEvent.sourceEvent.preventDefault(),this.updateZoom(zh(`keyboard(${t.delta})`),n.updateDelta(t.delta,this.getModuleProperties(),this.getZoom())))}onNavPanX(t){const{enabled:e}=this;if(!this.ctx.interactionManager.isState(j.InteractionState.Focusable)||!e)return;t.widgetEvent.sourceEvent.preventDefault();const n=t.reverse?{[-1]:1,1:-1,home:"end",end:"home"}[t.delta]:t.delta,s=this.getZoom(),a=jn(s);if(n==="home")s.x.min=0,s.x.max=a;else if(n==="end")s.x.min=1-a,s.x.max=1;else{const o=n*a;s.x.min+=o,s.x.max+=o,s.x=lx(s.x)}this.updateZoom(zh(`keyboard-page(${t.delta})`),s)}onWheel(t){const{enabled:e,enablePanning:i,enableScrolling:n,paddedRect:s,scrollingMode:a}=this;if(!e||!n||!s||!this.isState(jy.ZoomWheelable))return;t.stopProcessing();const{deltaX:o,deltaY:r}=t.event,l=o!=null&&r!=null&&Math.abs(o)>Math.abs(r);i&&(a==="pan"||l)?this.onWheelPanning(t):this.onWheelScrolling(t)}onWheelPanning(t){const{scrollingStep:e,scrollPanner:i,seriesRect:n,scrollingMode:s,ctx:{zoomManager:a}}=this;if(!n){t.abort();return}const{event:o}=t,r=this.getZoom(),l=o.deltaY>0&&r.y.min===vo||o.deltaY<0&&r.y.max===Hn,c=i.update(o,e,s,n,a.getAxisZooms());this.updateChanges(zh("zoom-seriesarea-wheel"),c),l?t.capped():t.uncapped()}onWheelScrolling(t){const e=this.getZoom(),i=t.event.deltaY>0&&pf(e);this.handleWheelScrolling(t,i)}onAxisWheel(t){if(!this.enabled||!this.enableAxisScrolling)return;t.stopProcessing();const{event:e,direction:i}=t;if(i!==z.X&&i!==z.Y)return;const n=i===z.X,s=!n,a=this.getModuleProperties({isScalingX:n,isScalingY:s}),o=this.getZoom(),r=e.deltaY>0&&o[i].min===vo&&o[i].max===Hn;this.autoScaler.onManualAdjustment(i),this.handleWheelScrolling(t,r,a)}handleWheelScrolling(t,e,i=this.getModuleProperties()){const{enableIndependentAxes:n,scroller:s,seriesRect:a,ctx:{zoomManager:o}}=this;if(!a){t.abort();return}const{event:r}=t;let l=!0;const c=zh("zoom-axis-wheel");if(n===!0){const u=s.updateAxes(r,i,a,o.getAxisZooms());for(const[d,{direction:g,min:f,max:y}]of Xe(u)){const x=g===z.X?this.constrainZoom({x:{min:f,max:y},y:{min:Hn,max:Hn}}).x:{min:f,max:y};l&&(l=this.updateAxisZoom(c,d,g,x))}}else{const u=s.update(r,i,a,this.getZoom());if(u==null)return"abort";l=this.updateUnifiedZoom(c,u,{directional:!0})}e||r.deltaY<0&&!l?t.capped():t.uncapped()}onTouchStart(t,e){!this.enableTwoFingerZoom||this.dragState!==0||this.twoFingers.start(t,e,this.getZoom())&&(this.dragState=4)}onTouchMove(t,e){if(!this.enableTwoFingerZoom||this.dragState!==4)return;const i=this.twoFingers.update(t,e);this.updateZoom(zh("zoom-seriesarea-twofingers"),lr(i))}onTouchEnd(t){!this.enableTwoFingerZoom||this.dragState!==4||(t.sourceEvent.preventDefault(),this.twoFingers.end(t)&&(this.dragState=0))}onProcessData(t){this.shouldFlipXY=t.series.shouldFlipXY}onLayoutComplete(t){this.ctx.eventsHub.emit("axis-dom-proxy:update",{source:"zoom",enabled:this.enabled,enableDoubleClick:this.enableDoubleClickToReset,enableDragging:this.enableAxisDragging,enableScrolling:this.enableAxisScrolling}),this.enabled&&(this.seriesRect=t.series.rect,this.paddedRect=t.series.paddedRect)}onZoomChangeRequested(t){t.sourceDetail!=="zoom-seriesarea-panner"&&this.panner.stopInteractions();const e=this.getZoom();this.buttons.toggleVisibleZoomed(pf(e))}onZoomPanStart(t){t.callerId==="zoom"&&this.panner.stopInteractions()}onPanUpdate(t){const{panner:e,seriesRect:i,ctx:{tooltipManager:n,zoomManager:s,interactionManager:a}}=this;if(!i)return;const o=e.translateZooms(i,s.getAxisZooms(),t.deltaX,t.deltaY);this.updateChanges(zh("zoom-seriesarea-panner"),o),a.isState(j.InteractionState.Frozen)||n.updateTooltip(Gy)}isPanningKeyPressed(t){switch(this.panKey){case"alt":return t.altKey;case"ctrl":return t.ctrlKey;case"shift":return t.shiftKey;case"meta":return t.metaKey}}isScalingX(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="y":this.axes==="x"}isScalingY(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="x":this.axes==="y"}getAnchorPointX(){return this.shouldFlipXY?this.anchorPointY:this.anchorPointX}getAnchorPointY(){return this.shouldFlipXY?this.anchorPointX:this.anchorPointY}constrainZoom(t){return this.ctx.zoomManager.constrainZoomToItemCount(t,this.minVisibleItems,this.autoScaler.enabled)}isZoomValid(t,e){const{minVisibleItems:i,ctx:{zoomManager:n}}=this;if(i===0)return this.previousZoomValid=!0,!0;const s=this.getZoom(),a=bS(jn(t))=r)return this.previousAxisZoomValid[t]=!0,!0;if(!this.previousAxisZoomValid[t]&&i?.directional)return!1;const c={includeYVisibleRange:!1,autoScaleYAxis:this.autoScaler.enabled},u=s.isVisibleItemsCountAtLeast(l,n,c);return this.previousAxisZoomValid[t]=i?.directional?u:!0,u}resetZoom(t){this.previousZoomValid=!0,this.previousAxisZoomValid={[z.X]:!0,[z.Y]:!0},this.ctx.zoomManager.resetZoom({source:"user-interaction",sourceDetail:t})}updateSyncZoom(t){this.updateZoom({source:"sync",sourceDetail:"internal-updateSyncZoom"},t)}updateChanges(t,e){const i=this.ctx.zoomManager.toZoomState(e)??{},n=Ni(this.ctx.zoomManager.getZoom());this.updateZoom(t,{x:i.x??n.x,y:i.y??n.y})}updateZoom(t,e){this.enableIndependentAxes?this.updatePrimaryAxisZooms(t,e):this.updateUnifiedZoom(t,e)}updateUnifiedZoom(t,e,i){return e=this.constrainZoom(e),this.isZoomValid(e,i)?(this.ctx.zoomManager.updateZoom(t,e),!0):(this.ctx.eventsHub.emit("chart:request-update",{type:Ct.SCENE_RENDER,opts:{skipAnimations:!0}}),!1)}updatePrimaryAxisZooms(t,e){this.updatePrimaryAxisZoom(t,e,z.X),this.updatePrimaryAxisZoom(t,e,z.Y)}updatePrimaryAxisZoom(t,e,i){const n=this.ctx.zoomManager.getPrimaryAxisId(i);n!=null&&this.updateAxisZoom(t,n,i,e[i])}updateAxisZoom(t,e,i,n,s){const{enableIndependentAxes:a,ctx:{zoomManager:o}}=this;if(!n)return!1;const r=this.getZoom();if(a!==!0)return r[i]=n,this.updateUnifiedZoom(t,r,s);if(!this.isAxisZoomValid(i,n,s))return!1;const{source:l,sourceDetail:c}=t;return o.updateChanges({source:l,sourceDetail:c,changes:{[e]:n},isReset:!1}),!0}getZoom(){return Ni(this.ctx.zoomManager.getZoom())}getModuleProperties(t){return{anchorPointX:t?.anchorPointX??this.getAnchorPointX(),anchorPointY:t?.anchorPointY??this.getAnchorPointY(),enabled:t?.enabled??this.enabled,independentAxes:t?.independentAxes??this.enableIndependentAxes===!0,isScalingX:t?.isScalingX??this.isScalingX(),isScalingY:t?.isScalingY??this.isScalingY(),keepAspectRatio:t?.keepAspectRatio??this.keepAspectRatio,scrollingStep:t?.scrollingStep??this.scrollingStep}}};M([Pe({newValue(t){this.onEnabledChange(t)}}),b],Qi.prototype,"enabled");M([b],Qi.prototype,"enableAxisDragging");M([b],Qi.prototype,"enableAxisScrolling");M([b],Qi.prototype,"enableDoubleClickToReset");M([Pe({changeValue(t){this.ctx.zoomManager.setIndependentAxes(!!t)}}),b],Qi.prototype,"enableIndependentAxes");M([b],Qi.prototype,"enablePanning");M([b],Qi.prototype,"enableScrolling");M([b],Qi.prototype,"enableSelecting");M([b],Qi.prototype,"enableTwoFingerZoom");M([b],Qi.prototype,"panKey");M([b],Qi.prototype,"axes");M([b],Qi.prototype,"scrollingMode");M([b],Qi.prototype,"scrollingStep");M([b],Qi.prototype,"keepAspectRatio");M([b],Qi.prototype,"minVisibleItems");M([b],Qi.prototype,"anchorPointX");M([b],Qi.prototype,"anchorPointY");M([b],Qi.prototype,"autoScaling");M([b],Qi.prototype,"axisDraggingMode");M([b],Qi.prototype,"buttons");M([b],Qi.prototype,"onDataChange");M([qi("panner.deceleration"),b],Qi.prototype,"deceleration");var GM=dt("pointer","start","middle","end"),FA={type:"plugin",name:"zoom",enterprise:!0,version:oi,dependencies:[Ght],options:{enabled:J,enableAxisDragging:J,enableAxisScrolling:J,enableDoubleClickToReset:J,enablePanning:J,enableScrolling:J,enableSelecting:J,enableTwoFingerZoom:J,keepAspectRatio:J,anchorPointX:GM,anchorPointY:GM,axisDraggingMode:dt("pan","zoom"),axes:dt("x","y","xy"),deceleration:Xt(dt("off","short","long"),Ot),minVisibleItems:X,panKey:dt("alt","ctrl","meta","shift"),scrollingMode:dt("pan","zoom"),scrollingStep:Ot,autoScaling:{enabled:J,padding:Ot},onDataChange:{strategy:fx()("reset","preserveDomain","preserveRatios"),stickToEnd:J},buttons:{enabled:J,buttons:Xi({...Zh,value:dt("reset","zoom-in","zoom-out","pan-left","pan-right","pan-start","pan-end"),section:K},"zoom button options array"),visible:dt("always","zoomed","hover")}},themeTemplate:{enabled:!1,enableAxisDragging:!0,enableAxisScrolling:!0,enableDoubleClickToReset:!0,enablePanning:!0,enableScrolling:!0,enableSelecting:!1,enableTwoFingerZoom:!0,deceleration:"short",minVisibleItems:2,panKey:"alt",scrollingStep:.1,autoScaling:{enabled:{$and:[{$eq:[{$path:"../axes"},"x"]},{$not:{$eq:[{$path:"/series/0/direction"},"horizontal"]}}]},padding:.05},onDataChange:{strategy:"preserveDomain",stickToEnd:!1},anchorPointX:"end",anchorPointY:"middle",axes:"x",buttons:{enabled:{$path:"../enabled"},visible:"hover",buttons:{$shallowSimple:[{icon:"zoom-out",value:"zoom-out",section:"scale"},{icon:"zoom-in",value:"zoom-in",section:"scale"},{icon:"pan-left",value:"pan-left",section:"pan"},{icon:"pan-right",value:"pan-right",section:"pan"},{icon:"reset",value:"reset",section:"reset"}]}}},create:t=>new Qi(t)};FA.options.enableIndependentAxes=Mt(J);FA.options.buttons.anchorPointX=Mt(GM);FA.options.buttons.anchorPointY=Mt(GM);function cx(t,e,i){return js(t.chartService,e,i)}var{AxisInterval:Out,AxisLabel:Eut,LinearScale:Rut,BBox:Put,TranslatableGroup:zut,Selection:But,Text:Vut}=j,HA=class a1{constructor(e,i){this.ctx=e,this.dataProvider=i,this.id=Nn(this),this.axisGroup=new zut({name:`${this.id}-AxisTicks`,zIndex:pe.AXIS}),this.labelSelection=But.select(this.axisGroup,Vut),this.interval=new Out,this.label=new Eut,this.scale=new Rut,this.placement="bottom",this.translationX=0,this.translationY=0,this.padding=0}get horizontal(){return this.placement.startsWith("top")||this.placement.startsWith("bottom")}attachAxis(e){e.appendChild(this.axisGroup)}calculateLayout(){const{placement:e,translationX:i,translationY:n,horizontal:s,label:a}=this;let o,r;switch(e){case"top":case"top-right":case"top-left":o="bottom",r="center",a.mirrored=!1,a.parallel=!0;break;case"bottom":case"bottom-right":case"bottom-left":o="top",r="center",a.mirrored=!1,a.parallel=!0;break;case"right":case"right-top":case"right-bottom":case"left":case"left-top":case"left-bottom":o="middle",r="left",a.mirrored=!0,a.parallel=!1;break}const l=[],c=this.generateTicks(),{ticks:u}=c;return this.labelSelection.update(u,void 0,d=>d.tickId),this.axisGroup.setProperties({translationX:i,translationY:n}),this.labelSelection.each((d,g)=>{d.fontFamily=a.fontFamily,d.fontSize=a.fontSize,d.fontStyle=a.fontStyle,d.fontWeight=a.fontWeight,d.fill=a.color,d.textBaseline=o,d.textAlign=r,d.text=g.tickLabel,d.x=s?g.translation:0,d.y=s?0:g.translation,l.push(d.getBBox())}),l.length>0?Put.merge(l).translate(i,n):void 0}tickFormatter(e,i,n,s){const{ctx:a}=this,{formatManager:o}=a,r=this.dataProvider.data.flatMap(l=>l.series);return(l,c)=>{const u={type:"number",value:l,datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"gradient-legend",property:"color",domain:e,boundSeries:r,fractionDigits:s,visibleDomain:void 0};return this.label.formatValue((d,g)=>cx(a,d,g),u,c)??o.format((d,g)=>cx(a,d,g),u)??o.defaultFormat(u)}}inRange(e,i=.001){const[n,s]=xi(this.scale.range);return e>=n-i&&e<=s+i}generateTicks(){const{minSpacing:e,maxSpacing:i}=this.interval,{maxTickCount:n,minTickCount:s,tickCount:a}=MT(Tc(this.scale.range),1,e,i,a1.DefaultTickCount,a1.DefaultMinSpacing),o=this.getTicksData({nice:[!0,!0],interval:this.interval.step,tickCount:a,minTickCount:s,maxTickCount:n});if(this.placement==="bottom"||this.placement==="top"){const r=Ve(this.label),{domain:l}=this.scale,u=l[0]>l[1]?-1:1;let d=-1/0*u;o.ticks=o.ticks.filter(g=>{if(Math.sign(g.translation-d)!==u)return!1;const{width:f}=qt(g.tickLabel)?Va(g.tickLabel,this.label):r.measureLines(bi(g.tickLabel));return d=g.translation+f*u,!0})}return o}getTicksData(e){const i=[],n=e.nice?this.scale.niceDomain(e):this.scale.domain,s=this.scale.ticks(e,n)?.ticks??[],a=s.reduce((l,c)=>Math.max(l,Hf(c)),0),o=CD(),r=this.tickFormatter(n,s,!1,a);for(let l=0;lthis.onChartHoverChange()),t.layoutManager.registerElement(Fut.Legend,e=>this.onStartLayout(e)),()=>this.legendGroup.remove())}isVertical(){const{placement:t}=qd(this.position);return t.startsWith("right")||t.startsWith("left")}destroy(){this.cleanup.flush()}attachLegend(t){t.appendChild(this.legendGroup)}onStartLayout({layoutBox:t}){const[e]=this.data;if(!this.enabled||!e?.enabled||e.legendType!=="gradient"){this.legendGroup.visible=!1;return}const{colorRange:i}=this.normalizeColorArrays(e),{strokeWidth:n,padding:s}=this.getContainerStyles(),a=this.updateGradientRect(t,i),o=this.updateAxis(e,a)??new Lw(0,0,0,0),r=Lw.merge([a,o]);r.grow(s).grow(n);const{left:l,top:c}=this.getMeasurements(t,r);this.updateContainer(r),this.updateArrow(),this.legendGroup.visible=!0,this.legendGroup.translationX=l,this.legendGroup.translationY=c}normalizeColorArrays(t){let e=t.colorDomain.slice();const i=t.colorRange.slice();if(e.length===i.length)return{colorDomain:e,colorRange:i};e.length>i.length&&i.splice(e.length);const[n,s]=e,a=i.length;return e=i.map((o,r)=>r===0?n:r===a-1?s:n+(s-n)*r/(a-1)),{colorDomain:e,colorRange:i}}updateGradientRect(t,e){const{gradientRect:i,gradient:n}=this,{preferredLength:s,thickness:a}=n,o=new Lw(0,0,0,0),r=Math.max(e.length-1,1);let l;return this.isVertical()?(l=0,o.width=a,o.height=Math.min(t.height,s)):(l=90,o.width=Math.min(t.width,s),o.height=a),i.x=o.x,i.y=o.y,i.width=o.width,i.height=o.height,i.fill={type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:e.map((c,u)=>({stop:u/r,color:c})),rotation:l},o}updateAxis(t,e){const{axisTicks:i,gradient:n,scale:s}=this,{placement:a}=qd(this.position),o=this.isVertical(),r=this.reverseOrder!==o;i.placement=a;const l=n.thickness+(s.padding??0);return i.translationX=o?l:e.x,i.translationY=o?e.y:l,i.scale.domain=r?t.colorDomain.slice().reverse():t.colorDomain,i.scale.range=o?[e.x,e.height]:[e.y,e.width],i.calculateLayout()}updateContainer(t){const e=this.getContainerStyles();this.containerNode.setStyleProperties(e),this.containerNode.cornerRadius=e.cornerRadius,this.containerNode.x=t.x,this.containerNode.y=t.y,this.containerNode.width=t.width,this.containerNode.height=t.height}updateArrow(){const t=this.highlightManager.getActiveHighlight(),{arrow:e}=this;if(t?.colorValue==null||t.series?.isHighlightEnabled()===!1){e.visible=!1;return}const{scale:i,label:n}=this.axisTicks,s=n.fontSize??0,a=i.convert(t.colorValue);let{x:o,y:r}=this.gradientRect,l=Math.PI;this.isVertical()?(o-=s/2,r+=a,l/=2):(o+=a,r-=s/2),e.visible=!0,e.fill=n.color,e.rotation=l,e.size=s,e.translationX=o,e.translationY=r}getMeasurements(t,e){let{x:i,y:n}=t;const{width:s,height:a}=e,{placement:o,floating:r,xOffset:l,yOffset:c}=qd(this.position),u=this.getContainerStyles();switch(i+=u.strokeWidth+u.padding.left,n+=u.strokeWidth+u.padding.top,o){case"left":n+=t.height/2-a/2;break;case"right":i+=t.width-s,n+=t.height/2-a/2;break;case"top":i+=t.width/2-s/2;break;case"bottom":i+=t.width/2-s/2,n+=t.height-a;break;case"right-top":case"top-right":i+=t.width-s;break;case"right-bottom":case"bottom-right":i+=t.width-s,n+=t.height-a;break;case"left-bottom":case"bottom-left":n+=t.height-a;break}if(!r)switch(o){case"left":case"left-top":case"left-bottom":t.shrink(s+this.spacing,"left");break;case"right":case"right-top":case"right-bottom":t.shrink(s+this.spacing,"right");break;case"top":case"top-left":case"top-right":t.shrink(a+this.spacing,"top");break;case"bottom":case"bottom-left":case"bottom-right":t.shrink(a+this.spacing,"bottom");break}return i+=l,n+=c,{top:n,left:i}}getContainerStyles(){const{stroke:t,strokeOpacity:e,strokeWidth:i}=this.border,{cornerRadius:n,fill:s,fillOpacity:a,padding:o}=this,r=typeof o=="number";return{cornerRadius:n,fill:s,fillOpacity:a,padding:{top:r?o:o.top??0,right:r?o:o.right??0,bottom:r?o:o.bottom??0,left:r?o:o.left??0},stroke:t,strokeOpacity:e,strokeWidth:this.border.enabled?i:0}}onChartHoverChange(){this.enabled&&this.updateArrow()}};fr.className="GradientLegend";M([b],fr.prototype,"enabled");M([b],fr.prototype,"position");M([b],fr.prototype,"reverseOrder");M([b],fr.prototype,"gradient");M([b],fr.prototype,"spacing");M([b],fr.prototype,"border");M([b],fr.prototype,"cornerRadius");M([b],fr.prototype,"fill");M([b],fr.prototype,"fillOpacity");M([b],fr.prototype,"padding");M([b],fr.prototype,"scale");({...De},Me(X,Fs("maxSpacing")),Me(X,Hs("minSpacing"))),{...F1};var{DataSet:Uut}=j,Wut=class extends Uut{constructor(t,e,i){super(t,e),this.childrenKey=i}commitPendingTransactions(){const t=super.commitPendingTransactions();return t&&this.dataIdKey&&(this.removeNestedDuplicatesFromRoot(),this.idToIndexCache=void 0),t}removeNestedDuplicatesFromRoot(){const t=new Set;for(const i of this.data)this.collectNestedIds(i,t);if(t.size===0)return;let e=0;for(;e0&&pt.warnOnce(`dataIdKey '${this.dataIdKey}' was not found on any data item.`)}return this.idToIndexCache}indexItemRecursively(t,e){const i=this.getIdValue(t);i!==void 0&&(this.idToIndexCache.has(i)||this.idToIndexCache.set(i,e));const n=t?.[this.childrenKey];if(Array.isArray(n))for(const s of n)this.indexItemRecursively(s,e)}collectUpdatedOriginalIndicesById(t,e){const i=this.getIdToIndexMap();for(const[n,s]of t){const a=i.get(n);if(a!==void 0&&!e.removedOriginalIndices.has(a)){const o=this.data[a];this.getIdValue(o)===n?(e.updatedOriginalIndices.add(a),e.pendingReplacements??(e.pendingReplacements=new Map),e.pendingReplacements.set(n,s)):this.replaceNestedItem(o,n,s)&&e.updatedOriginalIndices.add(a),t.delete(n)}}}applyRemovalsById(t,e){const i=new Set;for(const n of t){const s=this.getIdValue(n);s===void 0?pt.warnOnce(`applyTransaction() remove item is missing '${this.dataIdKey}' field; ignoring.`):i.add(s)}if(i.size!==0&&(this.removeFromGroupsByIdForHierarchy(e.prependsList,i),i.size>0&&this.removeFromGroupsByIdForHierarchy(e.insertionsList,i),e.trackedInsertions.length>0&&this.removeFromTrackedInsertionsById(t,e),i.size>0&&this.removeFromGroupsByIdForHierarchy(e.appendsList,i),i.size>0)){const n=this.getIdToIndexMap();for(const s of i){const a=n.get(s);if(a!==void 0){const o=this.data[a];this.getIdValue(o)===s?(e.removedOriginalIndices.add(a),e.virtualLength--):this.removeNestedItem(o,s)&&e.updatedOriginalIndices.add(a),i.delete(s)}}}}replaceNestedItem(t,e,i){const n=t?.[this.childrenKey];if(!Array.isArray(n))return!1;for(let s=0;s0;){const s=this.getIdValue(i[n]);s!==void 0&&e.has(s)?(e.delete(s),i.splice(n,1)):n++}if(e.size===0)break}}},{Chart:Kut}=j,y5=class extends Kut{getChartType(){return"standalone"}createDataSet(t){for(const e of this.series)if("childrenKey"in e.properties)return new Wut(t,this.dataIdKey,e.properties.childrenKey);return super.createDataSet(t)}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,n=t.layoutBox.clone().shrink(this.seriesArea.getPadding());this.seriesRect=n,this.animationRect=n;for(const s of[e,i])s.translationX=Math.floor(n.x),s.translationY=Math.floor(n.y);e.visible=this.series[0].visible,this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:n,paddedRect:t.layoutBox},layoutBox:t.layoutBox})}getAriaLabel(){const t=this.series[0]?.type;if(t==null)return"";const e=this.getCaptionText();switch(t){case"radial-gauge":case"linear-gauge":{const i=[];e.length!==0&&i.push(e);for(const n of this.series)i.push(n.getCaptionText());return this.ctx.localeManager.t("ariaAnnounceGaugeChart",{caption:i.join(". ")})}case"treemap":case"sunburst":return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:e});default:return this.ctx.localeManager.t("ariaAnnounceStandaloneChart",{caption:e})}}};y5.className="StandaloneChart";y5.type="standalone";var{standaloneChartOptionsDefs:Dbt}=j;function kF(t,e,i){i||(e=Yut(e));const n=new Map;for(const a of t){const o=a.datumIndex.type===0?`link-${a.datumIndex.index}`:`node-${a.datumIndex.index}`;n.set(a.id,{itemId:o,datum:a,linksBefore:[],linksAfter:[],maxPathLengthBefore:-1,maxPathLengthAfter:-1})}let s=0;for(const[a,o]of n.entries())s=Math.max(s,o1(n,e,o,a,-1,[])+o1(n,e,o,a,1,[])+1);return{links:e,nodeGraph:n,maxPathLength:s}}function b5(t,e,i,n){const s=n.indexOf(e);if(s!==-1){for(let o=s;o!e.has(i))}function o1(t,e,i,n,s,a){if(a.includes(n))return 1/0;let o=s===-1?i.maxPathLengthBefore:i.maxPathLengthAfter;if(o===-1){o=0;const r=s===-1?i.linksBefore:i.linksAfter;for(const l of e){const{fromNode:c,toNode:u}=l,d=s===-1?u.id:c.id,g=s===-1?c.id:u.id,f=n===d?t.get(g):void 0;f!=null&&(r.push({node:f,link:l}),a?.push(n),o=Math.max(o,o1(t,e,f,g,s,a)+1),a?.pop())}s===-1?i.maxPathLengthBefore=o:i.maxPathLengthAfter=o}return o}var{findNodeDatumInArray:$ut,keyProperty:Xut,valueProperty:xS,DataController:Zut,Group:Uy,HighlightState:CF,Selection:Ed,Series:qut,TransformableText:Qut}=j,Jut=class extends j.SeriesNodeEvent{constructor(t,e,i,n){super(t,e,i,n);const{datumIndex:s}=i,a=n.contextNodeData?.nodeData.find(o=>o.datumIndex.type===s.type&&o.datumIndex.index===s.index);this.size=a?.size,this.label=a?.type===1?a?.label:void 0}},x5=class extends qut{constructor(){super(...arguments),this.NodeEvent=Jut,this.nodeCount=0,this.linkCount=0,this.linksDataModel=void 0,this.linksProcessedData=void 0,this.nodesDataModel=void 0,this.nodesProcessedData=void 0,this.processedNodes=new Map,this.linkGroup=this.contentGroup.appendChild(new Uy({name:"linkGroup"})),this.nodeGroup=this.contentGroup.appendChild(new Uy({name:"nodeGroup"})),this.focusLinkGroup=this.highlightGroup.appendChild(new Uy({name:"linkGroup"})),this.focusNodeGroup=this.highlightGroup.appendChild(new Uy({name:"nodeGroup"})),this.highlightLinkGroup=this.highlightGroup.appendChild(new Uy({name:"linkGroup"})),this.labelSelection=Ed.select(this.labelGroup,Qut),this.linkSelection=Ed.select(this.linkGroup,()=>this.linkFactory()),this.nodeSelection=Ed.select(this.nodeGroup,()=>this.nodeFactory()),this.focusLinkSelection=Ed.select(this.focusLinkGroup,()=>this.linkFactory()),this.focusNodeSelection=Ed.select(this.focusNodeGroup,()=>this.nodeFactory()),this.highlightLinkSelection=Ed.select(this.highlightLinkGroup,()=>this.linkFactory()),this.highlightNodeSelection=Ed.select(this.highlightNodeGroup,()=>this.nodeFactory())}get nodes(){return this.properties.nodes}async processData(t){const{data:e,nodes:i}=this;if(e==null)return;const{fromKey:n,toKey:s,sizeKey:a,idKey:o,labelKey:r}=this.properties,l=new Zut("standalone",t.suppressFieldDotNotation,this.ctx.eventsHub),c=i==null?null:l.request(this.id,j.DataSet.wrap(i)??j.DataSet.empty(),{props:[Xut(o,void 0,{id:"idValue",includeProperty:!1}),...r==null?[]:[xS(r,void 0,{id:"labelValue",includeProperty:!1})]],groupByKeys:!0}),u=t.request(this.id,e,{props:[xS(n,void 0,{id:"fromValue",includeProperty:!1}),xS(s,void 0,{id:"toValue",includeProperty:!1}),...a==null?[]:[xS(a,void 0,{id:"sizeValue",includeProperty:!1,missingValue:0})]],groupByKeys:!1});i!=null&&l.execute();const[d,g]=await Promise.all([c??Promise.resolve(null),u]);this.nodesDataModel=d?.dataModel,this.nodesProcessedData=d?.processedData,this.linksDataModel=g?.dataModel,this.linksProcessedData=g?.processedData;const f=new Map;if(d==null){const y=g.dataModel.resolveColumnById(this,"fromValue",g.processedData),x=g.dataModel.resolveColumnById(this,"toValue",g.processedData),S=A=>{const I=f.size,w=A;return{series:this,itemId:`node-${I}`,datum:{},datumIndex:{type:1,index:I},type:1,index:I,linksBefore:[],linksAfter:[],id:A,size:0,label:w,style:this.getNodeStyle({datumIndex:{type:1,index:I},datum:{},size:0,label:w},I,!1)}},D=g.processedData.dataSources.get(this.id)?.data;if(D)for(const[A]of D.entries()){const I=y[A],w=x[A];I==null||w==null||(f.has(I)||f.set(I,S(I)),f.has(w)||f.set(w,S(w)))}}else{const y=d.dataModel.resolveColumnById(this,"idValue",d.processedData),x=r==null?void 0:d.dataModel.resolveColumnById(this,"labelValue",d.processedData),S=this.data?.dataIdKey,D=d.processedData.dataSources.get(this.id)?.data;if(D)for(const[A,I]of D.entries()){const w=y[A],N=x?.[A],O={type:1,index:A},L=S==null?void 0:I[S];f.set(w,{series:this,itemId:L==null?`node-${A}`:String(L),datum:I,datumIndex:O,type:1,index:A,linksBefore:[],linksAfter:[],id:w,size:0,label:N,style:this.getNodeStyle({datumIndex:O,datum:I,size:0,label:N},A,!1)})}}this.processedNodes=f}findNodeDatum(t){return $ut(t,this.contextNodeData?.nodeData,this.data?.dataIdKey)}getNodeGraph(t,e,{includeCircularReferences:i}){const{linksDataModel:n,linksProcessedData:s}=this;if(n==null||s==null){const{links:S,nodeGraph:D,maxPathLength:A}=kF(new Map().values(),[],i);return this.nodeCount=0,this.linkCount=0,{nodeGraph:D,links:S,maxPathLength:A}}const{sizeKey:a}=this.properties,o=n.resolveColumnById(this,"fromValue",s),r=n.resolveColumnById(this,"toValue",s),l=a==null?void 0:n.resolveColumnById(this,"sizeValue",s),c=new Map;for(const S of this.processedNodes.values()){const D=t(S);c.set(S.id,D)}const u=[],d=this.data?.dataIdKey,g=s.dataSources.get(this.id)?.data;if(g)for(const[S,D]of g.entries()){const A=o[S],I=r[S],w=l==null?1:l[S],N=c.get(A),O=c.get(I);if(w<=0||N==null||O==null)continue;const L={type:0,index:S},R=d==null?void 0:D[d],P=e({series:this,itemId:R==null?`link-${S}`:String(R),datum:D,datumIndex:L,type:0,index:S,fromNode:N,toNode:O,size:w,style:this.getLinkStyle({datum:D,datumIndex:L},N.datumIndex,!1)});u.push(P)}const{links:f,nodeGraph:y,maxPathLength:x}=kF(c.values(),u,i);for(const S of y.values())S.datum.linksBefore=S.linksBefore.map(D=>D.link),S.datum.linksAfter=S.linksAfter.map(D=>D.link);return this.nodeCount=y.size,this.linkCount=f.length,{nodeGraph:y,links:f,maxPathLength:x}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(t){const{seriesRect:e}=t,i={seriesRectWidth:e?.width??0,seriesRectHeight:e?.height??0};(this._nodeDataDependencies==null||this._nodeDataDependencies.seriesRectWidth!==i.seriesRectWidth||this._nodeDataDependencies.seriesRectHeight!==i.seriesRectHeight)&&(this._nodeDataDependencies=i),this.updateSelections();const n=this.contextNodeData?.nodeData??[],s=this.contextNodeData?.labelData??[],a=this.getHighlightedDatum();this.contentGroup.visible=this.visible;const o=a==null?CF.None:CF.OtherItem;this.contentGroup.opacity=this.properties.highlight.getStyle(o).opacity??1,this.labelSelection=this.updateLabelSelection({labelData:s,labelSelection:this.labelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.linkSelection=this.updateLinkSelection({nodeData:n.filter(d=>d.type===0),datumSelection:this.linkSelection}),this.updateLinkNodes({datumSelection:this.linkSelection,isHighlight:!1}),this.nodeSelection=this.updateNodeSelection({nodeData:n.filter(d=>d.type===1),datumSelection:this.nodeSelection}),this.updateNodeNodes({datumSelection:this.nodeSelection,isHighlight:!1});let r,l,c,u;a?.type===1?(r=n.filter(d=>d.type===0&&(d.toNode===a||d.fromNode===a)),l=r.map(d=>d.fromNode===a?d.toNode:d.fromNode),l.push(a),c=[],u=[a]):a?.type===0?(r=[a],l=[a.fromNode,a.toNode],c=[a],u=[]):(r=[],l=[],c=[],u=[]),this.focusLinkSelection=this.updateLinkSelection({nodeData:r,datumSelection:this.focusLinkSelection}),this.updateLinkNodes({datumSelection:this.focusLinkSelection,isHighlight:!1}),this.focusNodeSelection=this.updateNodeSelection({nodeData:l,datumSelection:this.focusNodeSelection}),this.updateNodeNodes({datumSelection:this.focusNodeSelection,isHighlight:!1}),this.highlightLinkSelection=this.updateLinkSelection({nodeData:c,datumSelection:this.highlightLinkSelection}),this.updateLinkNodes({datumSelection:this.highlightLinkSelection,isHighlight:!0}),this.highlightNodeSelection=this.updateNodeSelection({nodeData:u,datumSelection:this.highlightNodeSelection}),this.updateNodeNodes({datumSelection:this.highlightNodeSelection,isHighlight:!0})}getHighlightedDatum(){let t=this.ctx.highlightManager?.getActiveHighlight();if(t?.series===this&&t.type==null){const{itemId:e}=t,i=this.contextNodeData?.nodeData??[];t=e==null?void 0:i.find(n=>n.type===1&&n.id===e)}else t?.series!==this&&(t=void 0);return t}isLabelHighlighted(t,e){return e==null?!1:e.type===1?e===t:e.type===0?e.fromNode===t||e.toNode===t:!1}resetAnimation(t){}dataCount(){return Number.NaN}getSeriesDomain(t){return{domain:[]}}getSeriesRange(t,e){return[Number.NaN,Number.NaN]}legendItemSymbol(t,e,i={}){const{fills:n,strokes:s}=this.properties,{fill:a=n[e%n.length],fillOpacity:o=1,stroke:r=s[e%s.length],strokeWidth:l=0,strokeOpacity:c=1,lineDash:u=[0],lineDashOffset:d=0}=i;return{marker:{fill:a,fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:u,lineDashOffset:d}}}getLegendData(t){if(t!=="category")return[];const{showInLegend:e}=this.properties;return Array.from(this.processedNodes.values(),({id:i,label:n},s)=>({legendType:"category",id:this.id,itemId:i,seriesId:this.id,enabled:!0,label:{text:n??i},symbol:this.legendItemSymbol(1,s),hideInLegend:!e,isFixed:!0}))}pickNodeClosestDatum({x:t,y:e}){let i=1/0,n;return this.linkSelection.each((s,a)=>{const o=s.distanceSquared(t,e);o{const o=s.distanceSquared(t,e);ou.datum),c=r.indexOf(n)+e;c>=0&&c0?s=r.at(-1):s=Array.from(this.nodeSelection,d=>d.datum).at(-1)}else if(n?.type===1){const r=Array.from(this.nodeSelection,u=>u.datum),c=r.indexOf(n)+e;c>=0&&cd.datum)[0]}if(s==null)return;const a=s.type===1?Array.from(this.nodeSelection).find(r=>r.datum===s):Array.from(this.linkSelection).find(r=>r.datum===s);if(a==null)return;const o=this.computeFocusBounds(a.node);if(o!=null)return{datum:a.datum,datumIndex:this.contextNodeData?.nodeData.indexOf(a.datum)??0,otherIndex:0,bounds:o,clipFocusBox:!0}}getCategoryValue(t){}datumIndexForCategoryValue(t){}},{Path:tdt}=j;function wF({radius:t,startAngle:e,endAngle:i,tension:n}){const s=t*Math.cos(e),a=t*Math.sin(e),o=t*Math.cos(i),r=t*Math.sin(i),l=s*n,c=a*n,u=o*n,d=r*n;return{x:[s,l,u,o],y:[a,c,d,r]}}var th=class extends tdt{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=0,this.startAngle1=0,this.endAngle1=0,this.startAngle2=0,this.endAngle2=0,this.tension=1}tensionedCurveTo(t,e,i,n,s,a,o,r){const{path:l,tension:c}=this,u=1-c;l.cubicCurveTo((i-t)*u+t,(n-e)*u+e,(s-o)*u+o,(a-r)*u+r,o,r)}updatePath(){const{path:t,centerX:e,centerY:i,radius:n}=this;let{startAngle1:s,endAngle1:a,startAngle2:o,endAngle2:r}=this;s>o&&([s,o]=[o,s],[a,r]=[r,a]),t.clear();const l=e+n*Math.cos(s),c=i+n*Math.sin(s);t.moveTo(l,c),this.tensionedCurveTo(l,c,e,i,e,i,e+n*Math.cos(r),i+n*Math.sin(r)),t.arc(e,i,n,r,o,!0),this.tensionedCurveTo(e+n*Math.cos(o),i+n*Math.sin(o),e,i,e,i,e+n*Math.cos(a),i+n*Math.sin(a)),t.arc(e,i,n,a,s,!0),t.closePath()}};M([ut()],th.prototype,"centerX");M([ut()],th.prototype,"centerY");M([ut()],th.prototype,"radius");M([ut()],th.prototype,"startAngle1");M([ut()],th.prototype,"endAngle1");M([ut()],th.prototype,"startAngle2");M([ut()],th.prototype,"endAngle2");M([ut()],th.prototype,"tension");var{FillGradientDefaults:edt,FillPatternDefaults:idt,FillImageDefaults:ndt,makeSeriesTooltip:sdt,SeriesProperties:adt,Label:odt}=j,$O=class extends odt{constructor(){super(...arguments),this.spacing=1,this.maxWidth=1}};M([b],$O.prototype,"spacing");M([b],$O.prototype,"maxWidth");var jl=class extends xt{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0,this.tension=0}getStyle(t,e,i){const{fillOpacity:n,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,tension:l}=this,c=this.fill??t[i%t.length],u=this.stroke??e[i%t.length];return{fill:c,fillOpacity:n,stroke:u,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,tension:l}}};M([b],jl.prototype,"fill");M([b],jl.prototype,"fillOpacity");M([b],jl.prototype,"stroke");M([b],jl.prototype,"strokeOpacity");M([b],jl.prototype,"strokeWidth");M([b],jl.prototype,"lineDash");M([b],jl.prototype,"lineDashOffset");M([b],jl.prototype,"tension");M([b],jl.prototype,"itemStyler");var Ur=class extends xt{constructor(){super(...arguments),this.spacing=1,this.width=1,this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(t,e,i){const{fillOpacity:n,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r}=this,l=this.fill??t[i%t.length],c=this.stroke??e[i%t.length];return{fill:l,fillOpacity:n,stroke:c,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r}}};M([b],Ur.prototype,"spacing");M([b],Ur.prototype,"width");M([b],Ur.prototype,"fill");M([b],Ur.prototype,"fillOpacity");M([b],Ur.prototype,"stroke");M([b],Ur.prototype,"strokeOpacity");M([b],Ur.prototype,"strokeWidth");M([b],Ur.prototype,"lineDash");M([b],Ur.prototype,"lineDashOffset");M([b],Ur.prototype,"itemStyler");var Un=class extends adt{constructor(){super(...arguments),this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.nodes=void 0,this.fillGradientDefaults=new edt,this.fillPatternDefaults=new idt,this.fillImageDefaults=new ndt,this.fills=[],this.strokes=[],this.label=new $O,this.link=new jl,this.node=new Ur,this.tooltip=sdt()}};M([b],Un.prototype,"fromKey");M([b],Un.prototype,"toKey");M([b],Un.prototype,"idKey");M([b],Un.prototype,"idName");M([b],Un.prototype,"labelKey");M([b],Un.prototype,"labelName");M([b],Un.prototype,"sizeKey");M([b],Un.prototype,"sizeName");M([b],Un.prototype,"nodes");M([b],Un.prototype,"fillGradientDefaults");M([b],Un.prototype,"fillPatternDefaults");M([b],Un.prototype,"fillImageDefaults");M([b],Un.prototype,"fills");M([b],Un.prototype,"strokes");M([b],Un.prototype,"label");M([b],Un.prototype,"link");M([b],Un.prototype,"node");M([b],Un.prototype,"tooltip");var{SeriesNodePickMode:NF,createDatumId:vS,Sector:rdt,getShapeStyle:SS,getLabelStyles:ldt,BBox:cdt}=j,MS=t=>t.startAngle+fl(t.startAngle,t.endAngle)/2,v5=class extends x5{constructor(t){super({moduleCtx:t,pickModes:[NF.NEAREST_NODE,NF.EXACT_SHAPE_MATCH]}),this.properties=new Un}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new th}nodeFactory(){return new rdt}createNodeData(){const{id:t,_nodeDataDependencies:{seriesRectWidth:e,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0},properties:n}=this,{fromKey:s,toKey:a,sizeKey:o,labelKey:r,label:{spacing:l,maxWidth:c,fontSize:u},node:{width:d,spacing:g}}=n,f=e/2,y=i/2;let x=[];const{nodeGraph:S,links:D}=this.getNodeGraph(U=>({...U,centerX:f,centerY:y,innerRadius:Number.NaN,outerRadius:Number.NaN,startAngle:Number.NaN,endAngle:Number.NaN}),U=>({...U,centerX:f,centerY:y,radius:Number.NaN,startAngle1:Number.NaN,endAngle1:Number.NaN,startAngle2:Number.NaN,endAngle2:Number.NaN}),{includeCircularReferences:!0});let A=0;for(const[U,{datum:V,linksBefore:Z,linksAfter:W}]of S.entries()){const q=Z.reduce((nt,{link:G})=>nt+G.size,0)+W.reduce((nt,{link:G})=>nt+G.size,0);if(q===0)S.delete(U);else{const{label:nt}=n;V.size=q,A+=V.size;const G=nt.enabled?this.getLabelText(V.label,V.datum,r,"label",[],nt,{datum:V.datum,value:V.label,fromKey:s,toKey:a,sizeKey:o,size:V.size}):void 0;V.label=ce(G)}}let I=0;if(this.isLabelEnabled()){const U=Ve(this.properties.label);let V=0;for(const{datum:Z}of S.values()){const{id:W,label:q}=Z;if(q==null)continue;const nt=kc(q,{maxWidth:c,font:this.properties.label,textWrap:"never"}),{width:G}=U.measureLines(nt);V=Math.max(G,V),x.push({id:W,text:nt,centerX:f,centerY:y,angle:Number.NaN,radius:Number.NaN,size:Z.size,datumIndex:Z.datumIndex,nodeDatum:Z})}I=V+l}const w=S.size;let N=Math.min(e,i)/2-d-I,O=g/N;if(I!==0&&(w*O>=1.5*Math.PI||N<=0)&&(x=[],N=Math.min(e,i)/2-d,O=g/N),w*O>=2*Math.PI||N<=0){pt.warnOnce("There was insufficient space to display the Chord Series.");return}const L=N,R=N+d,P=Math.max((2*Math.PI-w*O)/A,0);let B=0;for(const{datum:U}of S.values()){U.innerRadius=L,U.outerRadius=R,U.startAngle=B,U.endAngle=B+U.size*P,B=U.endAngle+O;const V=(U.innerRadius+U.outerRadius)/2,Z=MS(U);U.midPoint={x:U.centerX+V*Math.cos(Z),y:U.centerY+V*Math.sin(Z)}}const F=[];for(const{datum:U,linksBefore:V,linksAfter:Z}of S.values()){const W=MS(U),q=[...V.map(G=>({link:G.link,distance:fl(MS(G.node.datum),W),after:!1})),...Z.map(G=>({link:G.link,distance:fl(MS(G.node.datum),W),after:!0}))];let nt=U.startAngle;for(const{link:G,after:et}of q.toSorted((st,lt)=>st.distance-lt.distance)){const st=G.size*P;et?(G.startAngle1=nt,G.endAngle1=nt+st):(G.startAngle2=nt,G.endAngle2=nt+st),nt+=G.size*P}F.push(U)}const{tension:H}=this.properties.link;for(const U of D){U.radius=N;const V=wF({radius:N,startAngle:U.startAngle1,endAngle:U.endAngle2,tension:H}),Z=wF({radius:N,startAngle:U.startAngle2,endAngle:U.endAngle1,tension:H}),W=dl(...V.x,.5),q=dl(...V.y,.5),nt=dl(...Z.x,.5),G=dl(...Z.y,.5);U.midPoint={x:U.centerX+(W+nt)/2,y:U.centerY+(q+G)/2},F.push(U)}for(const U of x){const V=S.get(U.id)?.datum;V!=null&&(U.radius=R+l,U.angle=ze(V.startAngle+fl(V.startAngle,V.endAngle)/2),U.datumIndex=V.datumIndex,U.nodeDatum=V)}x.sort((U,V)=>U.angle-V.angle);let $=1/0,Y=-1/0;return x=x.filter(U=>{const V=nr(u),Z=Math.atan2(V/2,U.radius),W=U.angle-Z,q=U.angle+Z;return Ba($,W,q)||Ba(Y,W,q)?!1:($=Math.min(W,$),Y=Math.max(q,Y),!0)}),{itemId:t,nodeData:F,labelData:x}}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes(t){const e={toKey:this.properties.toKey,fromKey:this.properties.fromKey,sizeKey:this.properties.sizeKey,size:Number.NaN},i=this.getHighlightedDatum();t.labelSelection.each((n,s)=>{const{size:a,text:o,centerX:r,centerY:l,radius:c,angle:u,datumIndex:d,nodeDatum:g}=s;e.size=a;const f=this.isLabelHighlighted(g,i),y=this.getHighlightStyle(f,d),x=ldt(this,void 0,e,this.properties.label,f,i),{fontStyle:S,fontWeight:D,fontSize:A,fontFamily:I,color:w}=x;n.visible=!0,n.translationX=r+c*Math.cos(u),n.translationY=l+c*Math.sin(u),n.text=o,n.fill=w,n.fontStyle=S,n.fontWeight=D,n.fontSize=A,n.fontFamily=I,n.textBaseline="middle",Math.cos(u)>=0?(n.textAlign="left",n.rotation=u):(n.textAlign="right",n.rotation=u-Math.PI);const N=y.opacity??1;n.opacity=N,n.fillOpacity=N,n.setBoxing(x)})}updateNodeSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>vS(e.type,e.id))}getNodeStyle(t,e,i){const{properties:n}=this,{fills:s,strokes:a,fillGradientDefaults:o,fillPatternDefaults:r,fillImageDefaults:l}=n,{itemStyler:c}=n.node,u=this.getHighlightStyle(i,t.datumIndex),d=Et(u,n.node.getStyle(s,a,e));let g=SS(d,o,r,l);if(c!=null&&t.datumIndex!=null){const f=this.cachedDatumCallback(vS(t.datumIndex.index,"node",i?"highlight":"node"),()=>{const y=this.makeItemStylerParams(t,i,g);return this.callWithContext(c,y)});f&&(g=SS(Et(f,g),o,r,l))}return g.opacity=1,g}makeItemStylerParams({datum:t,datumIndex:e,size:i=0,label:n},s,a){const{id:o}=this,r=this.ctx.highlightManager?.getActiveHighlight(),l=this.getHighlightStateString(r,s,e),c=this.filterItemStylerFillParams(a.fill)??a.fill;return{seriesId:o,datum:t,highlightState:l,...a,size:i,label:n,fill:c}}updateNodeNodes(t){const{datumSelection:e,isHighlight:i}=t,n=this.getShapeFillBBox();e.each((s,a)=>{const{datumIndex:o}=a,r=this.getNodeStyle(a,o.index,i);s.setStyleProperties(r,n),s.centerX=a.centerX,s.centerY=a.centerY,s.innerRadius=a.innerRadius,s.outerRadius=a.outerRadius,s.startAngle=a.startAngle,s.endAngle=a.endAngle,s.inset=s.strokeWidth/2})}updateLinkSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>vS(e.type,e.index,e.fromNode.id,e.toNode.id))}getLinkStyle({datumIndex:t,datum:e},i,n){const{id:s,properties:a}=this,{fills:o,strokes:r,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:u}=a,{itemStyler:d}=a.link,g=this.getHighlightStyle(n,t),f=Et(g,a.link.getStyle(o,r,i.index));let y=SS(f,l,c,u);if(d!=null&&t!=null){const x=this.ctx.highlightManager?.getActiveHighlight(),S=this.cachedDatumCallback(vS(t.index,"link",n?"highlight":"node"),()=>{const D=this.getHighlightStateString(x,n,i);return this.callWithContext(d,{seriesId:s,datum:e,highlightState:D,...y})});S&&(y=SS(Et(S,y),l,c,u))}return y.opacity=1,y}updateLinkNodes(t){const{datumSelection:e,isHighlight:i}=t,n=this.getShapeFillBBox();e.each((s,a)=>{const o=a.fromNode.datumIndex,r=this.getLinkStyle(a,o,i);s.centerX=a.centerX,s.centerY=a.centerY,s.radius=a.radius,s.startAngle1=a.startAngle1,s.endAngle1=a.endAngle1,s.startAngle2=a.startAngle2,s.endAngle2=a.endAngle2,s.tension=r.tension,s.setStyleProperties(r,n)})}getShapeFillBBox(){const t=this._nodeDataDependencies?.seriesRectWidth??0,e=this._nodeDataDependencies?.seriesRectHeight??0,i=Math.min(t,e),n=(t-i)/2,s=(e-i)/2,a=new cdt(n,s,t,e);return{series:a,axis:a}}getTooltipContent(t){const{id:e,linksProcessedData:i,nodesProcessedData:n,properties:s,ctx:{formatManager:a}}=this,{fromKey:o,toKey:r,sizeKey:l,sizeName:c,tooltip:u}=s,d=this.contextNodeData?.nodeData.find(A=>A.datumIndex.type===t.type&&A.datumIndex.index===t.index);if(d==null)return;const g=d.type===0?d.fromNode.index:d.index,f=d.type===0?`${d.fromNode.label} - ${d.toNode.label}`:d.label,y=t.type===0?i?.dataSources.get(this.id)?.data[t.index]:n?.dataSources.get(this.id)?.data[t.index],x=d.size;let S;if(d.type===0){const A=d.fromNode.datumIndex;S=this.getLinkStyle({datumIndex:t,datum:y},A,!1)}else{const A=d.label;S=this.getNodeStyle({datumIndex:t,datum:y,size:x,label:A},t.index,!1)}const D=[];if(l!=null){const A=a.format(this.callWithContext.bind(this),{type:"number",value:x,datum:y,seriesId:e,legendItemName:void 0,key:l,source:"tooltip",property:"size",domain:[],boundSeries:this.getFormatterContext("size"),fractionDigits:void 0,visibleDomain:void 0});D.push({label:c,fallbackLabel:l,value:A??String(x)})}return this.formatTooltipWithContext(u,{title:f,symbol:this.legendItemSymbol(d.type,g,S),data:D},{seriesId:e,datum:y,title:f,fromKey:o,toKey:r,sizeKey:l,sizeName:c,size:x,...S})}computeFocusBounds(t){return t}hasItemStylers(){return this.properties.node.itemStyler!=null||this.properties.link.itemStyler!=null||this.properties.label.itemStyler!=null}};v5.className="ChordSeries";v5.type="chord";var{chordSeriesThemeableOptionsDef:hdt}=j,XO={...hdt,..._e,type:ht(Jt("chord")),fromKey:ht(K),toKey:ht(K)};XO.fillGradientDefaults=Mt(sD);XO.fillPatternDefaults=Mt(aD);XO.fillImageDefaults=Mt(oD);({...Oe});var DS={$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]};ie.NUMBER,ie.CATEGORY,he.LEFT,he.RIGHT,he.LEFT,ie.CATEGORY,ie.NUMBER,he.TOP,he.BOTTOM,he.BOTTOM;({...Oe},ie.NUMBER+"",ie.CATEGORY+"");var{BBox:udt,Path:ddt}=j,TF=1e-6;function LF([t,e],[i,n]){return Math.abs(t-i)<=TF&&Math.abs(e-n)<=TF}var Gl=class extends ddt{constructor(){super(...arguments),this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0}get midPoint(){const{x0:t,y0:e,x1:i,y1:n,x2:s,y2:a,x3:o,y3:r}=this;return{x:(t+i+s+o)/4,y:(e+n+a+r)/4}}distanceSquared(t,e){if(this.containsPoint(t,e))return 0;const{x0:i,y0:n,x1:s,y1:a,x2:o,y2:r,x3:l,y3:c}=this;return Math.min(Jh(t,e,i,n,s,a,1/0),Jh(t,e,s,a,o,r,1/0),Jh(t,e,o,r,l,c,1/0),Jh(t,e,l,c,i,n,1/0))}computeBBox(){const{x0:t,y0:e,x1:i,y1:n,x2:s,y2:a,x3:o,y3:r}=this,l=Math.min(t,i,s,o),c=Math.max(t,i,s,o)-l,u=Math.min(e,n,a,r),d=Math.max(e,n,a,r)-u;return new udt(l,u,c,d)}updatePath(){const{path:t,x0:e,y0:i,x1:n,y1:s,x2:a,y2:o,x3:r,y3:l}=this,c=[[e,i],[n,s],[a,o],[r,l]];t.clear();let u,d;for(const g of c){if(u!=null&&LF(u,g)||d!=null&&LF(d,g))continue;const[f,y]=g;u==null?t.moveTo(f,y):t.lineTo(f,y),u??(u=g),d=g}t.closePath()}};M([ut()],Gl.prototype,"x0");M([ut()],Gl.prototype,"y0");M([ut()],Gl.prototype,"x1");M([ut()],Gl.prototype,"y1");M([ut()],Gl.prototype,"x2");M([ut()],Gl.prototype,"y2");M([ut()],Gl.prototype,"x3");M([ut()],Gl.prototype,"y3");var{NODE_UPDATE_STATE_TO_PHASE_MAPPING:pdt}=j;function OF(t,e,i,n){const{x0:s,y0:a,x1:o,y1:r,x2:l,y2:c,x3:u,y3:d,opacity:g}=t;return i?{x0:(s+u)/2,y0:(a+d)/2,x1:(o+l)/2,y1:(r+c)/2,x2:(o+l)/2,y2:(r+c)/2,x3:(s+u)/2,y3:(a+d)/2,opacity:g}:{x0:(s+o)/2,y0:(a+r)/2,x1:(s+o)/2,y1:(a+r)/2,x2:(l+u)/2,y2:(c+d)/2,x3:(l+u)/2,y3:(c+d)/2,opacity:g}}function gdt(t,e){const i=a=>a==null;return{fromFn:(a,o,r)=>{r==="updated"&&i(o)?r="removed":r==="updated"&&i(a.previousDatum)&&(r="added");let l;r==="added"&&a.previousDatum==null&&e==="fade"||(r==="unknown"||r==="added"?l=OF(o,a.previousDatum,t):l={x0:a.x0,y0:a.y0,x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2,x3:a.x3,y3:a.y3,opacity:a.opacity});const c=pdt[r];return{...l,phase:c}},toFn:(a,o,r)=>{let l;return r==="removed"&&a.datum==null&&e==="fade"||(r==="removed"||i(o)?l=OF(o,a.previousDatum,t):l=r1(a,o)),l}}}function r1(t,e){const{x0:i,y0:n,x1:s,y1:a,x2:o,y2:r,x3:l,y3:c,opacity:u}=e;return{x0:i,y0:n,x1:s,y1:a,x2:o,y2:r,x3:l,y3:c,opacity:u}}var{SeriesNodePickMode:EF,valueProperty:fdt,keyProperty:mdt,updateLabelNode:ydt,SMALLEST_KEY_INTERVAL:bdt,LARGEST_KEY_INTERVAL:xdt,diff:vdt,fixNumericExtent:Sdt,seriesLabelFadeInAnimation:RF,resetMotion:Mdt,resetLabelFn:Ddt,animationValidation:Adt,computeBarFocusBounds:Idt,Group:kdt,Selection:Cdt,PointerEvents:PF,motion:wdt,checkCrisp:Ndt,createDatumId:Tdt}=j,Ldt=class extends j.SeriesNodeEvent{constructor(t,e,i,n){super(t,e,i,n),this.xKey=n.properties.stageKey,this.yKey=n.properties.valueKey}},S5=class extends j.AbstractBarSeries{constructor({moduleCtx:t,animationResetFns:e}){super({moduleCtx:t,pickModes:[EF.AXIS_ALIGNED,EF.EXACT_SHAPE_MATCH],propertyKeys:{x:["stageKey"],y:["valueKey"]},propertyNames:{x:[],y:[]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:e.datum,label:Ddt}}),this.NodeEvent=Ldt,this.connectorNodeGroup=this.contentGroup.appendChild(new kdt({name:`${this.id}-series-connectorNodes`,zIndex:Vs.BACKGROUND})),this.connectorSelection=Cdt.select(this.connectorNodeGroup,()=>this.connectionFactory()),this.connectorNodeGroup.pointerEvents=PF.None}get pickModeAxis(){return"main-category"}setZIndex(t){return super.setZIndex(t),this.connectorNodeGroup.zIndex=[Vs.BACKGROUND,t],!0}isVertical(){return!super.isVertical()}connectionFactory(){return new Gl}getKeyAxis(t){if(t===z.X)return this.properties.xKeyAxis;if(t===z.Y)return this.properties.yKeyAxis}async processData(t){const{stageKey:e,valueKey:i}=this.properties,{visible:n,id:s}=this,a=(x,S,D)=>n&&this.ctx.legendManager.getItemEnabled({seriesId:s,itemId:D}),o=this.getCategoryAxis()?.scale,r=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:u}=this.getScaleInformation({xScale:o,yScale:r}),d=[];this.needsDataModelDiff()&&this.processedData&&d.push(vdt(this.id,this.processedData)),this.ctx.animationManager.isSkipped()||d.push(Adt());const g=this.visible?{}:{forceValue:0},f=this.properties.allowNullKeys??!1,{processedData:y}=await this.requestDataModel(t,this.data,{props:[mdt(e,c,{id:"xValue",allowNullKey:f}),fdt(i,u,{id:"yValue",...g,validation:a,invalidValue:0}),...l?[bdt,xdt]:[],...d],groupByKeys:!1});this.smallestDataInterval=y.reduced?.smallestKeyInterval,this.largestDataInterval=y.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i,id:n,ctx:{legendManager:s}}=this;if(!e||!i)return{domain:[]};const{keys:[a]}=e.domain;if(t===this.getCategoryDirection()){const o=i.resolveProcessedDataDefById(this,"xValue");if(o?.def.type==="key"&&o?.def.valueType==="category"){if(!this.hasData)return{domain:[]};const r=a.filter((c,u)=>s.getItemEnabled({seriesId:n,itemId:u})),l=i.getKeySortMetadata(this,"xValue",e);return{domain:r,sortMetadata:l}}return{domain:this.padBandExtent(a)}}else{const o=this.domainForClippedRange(t,["yValue"],"xValue"),r=Math.max(...o),l=[-r,r];return{domain:Sdt(l)}}}getSeriesRange(t,e){return[Number.NaN,Number.NaN]}createNodeData(){const{hasData:t,data:e,dataModel:i,processedData:n,id:s,ctx:{legendManager:a}}=this,o=this.getCategoryAxis(),r=this.getValueAxis();if(!(t&&e&&o&&r&&i&&n?.type==="ungrouped"))return;const l=o.scale,c=r.scale,u=this.getBarDirection()===z.X,{stageKey:d,valueKey:g}=this.properties,f=`${g}`,y={itemId:f,nodeData:[],labelData:[],connectorData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),visible:this.visible},x=this.visible;if(!x)return y;const S=i.resolveKeysById(this,"xValue",n),D=i.resolveColumnById(this,"yValue",n),{groupOffset:A,barOffset:I,barWidth:w}=this.getBarDimensions(),N=Ndt(o?.scale,o?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let O;const L=n.dataSources.get(this.id)?.data??[];for(const[R,P]of L.entries()){const B=x&&a.getItemEnabled({seriesId:s,itemId:R}),F=S[R];if(F===void 0&&!this.properties.allowNullKeys)continue;const H=l.convert(F);if(!Number.isFinite(H))continue;const $=Math.round(H)+A+I,Y=D[R],U=Math.round(c.convert(-Y)),V=Math.round(c.convert(Y)),Z=this.getItemStyle({datum:P,datumIndex:R},!1),W=Math.max(Z.strokeWidth??0,Math.abs(V-U)),q={x:u?Math.min(V,U):$,y:u?$:Math.min(V,U),width:u?W:w,height:u?w:W},nt={x:q.x+q.width/2,y:q.y+q.height/2},G=this.createLabelData({datumIndex:R,rect:q,barAlongX:u,yDatum:Y,datum:P,visible:B}),et={index:R,series:this,datum:P,datumIndex:R,xValue:F,yValue:Y,xKey:d,yKey:g,x:q.x,y:q.y,width:q.width,height:q.height,midPoint:nt,crisp:N,label:G,visible:B};if(y.nodeData.push(et),G!=null&&y.labelData.push(G),O!=null){const st=O.rect,lt=O.nodeDatum,mt=O.datumIndex;u?y.connectorData.push({datum:lt,datumIndex:mt,x0:st.x,y0:st.y+st.height,x1:st.x+st.width,y1:st.y+st.height,x2:q.x+q.width,y2:q.y,x3:q.x,y3:q.y,opacity:1}):y.connectorData.push({datum:lt,datumIndex:mt,x0:st.x+st.width,y0:st.y,x1:q.x,y1:q.y,x2:q.x,y2:q.y+q.height,x3:st.x+st.width,y3:st.y+st.height,opacity:1})}B&&(O={itemId:f,rect:q,nodeDatum:et,datumIndex:R})}return y}updateNodes(t,e){super.updateNodes(t,e);const{connectorSelection:i}=this,n=this.contextNodeData?.connectorData??[];this.connectorSelection=this.updateConnectorSelection({connectorSelection:i,connectorData:n}),this.updateConnectorNodes({connectorSelection:i})}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,n=e??[];return i.update(n,void 0,s=>this.getDatumId(s))}updateConnectorSelection(t){const{connectorData:e,connectorSelection:i}=t;return i.update(this.connectorEnabled()?e:[],void 0,n=>this.getDatumId(n.datum))}updateConnectorNodes(t){const e=this.getShapeFillBBox();t.connectorSelection.each((i,n)=>{const{fill:s,fillOpacity:a,stroke:o,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:u}=this.connectorStyle(n.datumIndex);i.setProperties(r1(i,n)),i.setStyleProperties({fill:s,stroke:o,fillOpacity:a,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:u},e)})}updateLabelSelection(t){const e=this.properties.label.enabled?t.labelData:[];return t.labelSelection.update(e,i=>{i.pointerEvents=PF.None})}updateLabelNodes(t){const e={stageKey:this.properties.stageKey,valueKey:this.properties.valueKey},i=this.ctx.highlightManager?.getActiveHighlight(),{isHighlight:n=!1,labelSelection:s}=t;s.each((a,o)=>{const r=this.getHighlightStyle(n,o.datumIndex);a.visible=o.visible||n,a.fillOpacity=r.opacity??1,a.opacity=r.opacity??1,ydt(this,a,e,this.properties.label,o,n,i)})}getHighlightLabelData(t,e){if(e.label)return[{...e.label}]}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,properties:s}=this,{stageKey:a,valueKey:o,tooltip:r,legendItemName:l}=s,c=this.getCategoryAxis(),u=this.getValueAxis();if(!i||!n||!c||!u)return;const d=n.dataSources.get(this.id)?.data[t],g=i.resolveKeysById(this,"xValue",n)[t],f=i.resolveColumnById(this,"yValue",n)[t],y=this.properties.allowNullKeys??!1;if(!(g===void 0&&!y))return this.formatTooltipWithContext(r,{symbol:this.legendItemSymbol(t),data:[{label:this.getAxisValueText(c,"tooltip",g,d,a,l),value:this.getAxisValueText(u,"tooltip",f,d,o,l)}]},{seriesId:e,datum:d,title:a,stageKey:a,valueKey:o,...this.tooltipStyle(d,t)})}resetAllAnimation(t){super.resetAllAnimation(t),Mdt([this.connectorSelection],r1)}animateEmptyUpdateReady({labelSelection:t}){const{connectorSelection:e}=this,i=this.isVertical(),s=gdt(i,"normal");wdt.fromToMotion(this.id,"connectors",this.ctx.animationManager,[e],s),RF(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(t){const{labelSelection:e}=t;this.ctx.animationManager.stopByAnimationGroupId(this.id),RF(this,"labels",this.ctx.animationManager,e)}getDatumId(t){return Tdt(t.xValue)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){return Idt(this,this.contextNodeData?.nodeData[t])}legendItemSymbol(t){const{strokeWidth:e,fillOpacity:i,strokeOpacity:n,lineDash:s,lineDashOffset:a,fill:o,stroke:r}=this.properties.getStyle(t);return{marker:{fill:o,fillOpacity:i,stroke:r,strokeWidth:e,strokeOpacity:n,lineDash:s,lineDashOffset:a}}}getLegendData(t){const{id:e,processedData:i,dataModel:n,ctx:{legendManager:s},visible:a}=this;if(!n||!i||t!=="category")return[];const{showInLegend:o}=this.properties,r=n.resolveKeysById(this,"xValue",i);return(i.dataSources.get(this.id)?.data??[]).map((l,c)=>{const u=r[c],d=this.properties.allowNullKeys??!1;if(!(u==null&&!d))return{legendType:"category",id:e,datum:l,itemId:c,seriesId:e,enabled:a&&s.getItemEnabled({seriesId:e,itemId:c}),label:{text:String(u)},symbol:this.legendItemSymbol(c),skipAnimations:!0,hideInLegend:!o}}).filter(l=>l!=null)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}},{Label:Odt,AbstractBarSeriesProperties:Edt,makeSeriesTooltip:Rdt,AxisLabel:Pdt}=j,ZO=class extends Odt{constructor(){super(...arguments),this.spacing=0}};M([b],ZO.prototype,"placement");M([b],ZO.prototype,"spacing");var M5=class extends Pdt{};M([b],M5.prototype,"placement");var wo=class extends Edt{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new ZO,this.stageLabel=new M5,this.tooltip=Rdt()}getStyle(t){const{fills:e,strokes:i,fillOpacity:n,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r}=this;return{fill:e[t],fillOpacity:n,stroke:i[t],strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,opacity:1}}};M([b],wo.prototype,"stageKey");M([b],wo.prototype,"valueKey");M([b],wo.prototype,"fills");M([b],wo.prototype,"fillOpacity");M([b],wo.prototype,"strokes");M([b],wo.prototype,"strokeWidth");M([b],wo.prototype,"strokeOpacity");M([b],wo.prototype,"lineDash");M([b],wo.prototype,"lineDashOffset");M([b],wo.prototype,"label");M([b],wo.prototype,"stageLabel");M([b],wo.prototype,"tooltip");function zF(t,{x:e,y:i,width:n,height:s,opacity:a}){return{x1:e,y1:i,x2:e+n,y2:i+s,opacity:a??1}}var{Line:zdt}=j,D5=class extends S5{constructor(t){super({moduleCtx:t,animationResetFns:{datum:zF}}),this.properties=new wo}get hasData(){const{id:t,ctx:{legendManager:e}}=this,i=this.data?.data.reduce((n,s,a)=>n+(e.getItemEnabled({seriesId:t,itemId:a})?1:0),0);return i!=null&&i>1}getBandScalePadding(){return{inner:1,outer:0}}connectorEnabled(){return!0}getItemStyle({datumIndex:t},e){return this.properties.getStyle(t)}connectorStyle(t){return this.properties.getStyle(t)}nodeFactory(){return new zdt}createLabelData({datumIndex:t,rect:e,barAlongX:i,yDatum:n,datum:s,visible:a}){const{stageKey:o,valueKey:r,label:l}=this.properties,{spacing:c,placement:u}=l;if(!l.enabled)return;let d,g,f,y;if(i)switch(d=e.x+e.width/2,f="center",u){case"before":g=e.y-c,y="bottom";break;case"after":g=e.y+e.height+c,y="top";break;default:g=e.y+e.height/2,y="middle"}else switch(g=e.y+e.height/2,y="middle",u){case"before":d=e.x-c,f="right";break;case"after":d=e.x+e.width+c,f="left";break;default:d=e.x+e.width/2,f="center"}const x=this.getSeriesDomain(z.Y).domain,S=this.getLabelText(n,s,r,"y",x,l,{itemId:r,value:n,datum:s,stageKey:o,valueKey:r});return{x:d,y:g,textAlign:f,textBaseline:y,text:S,itemId:r,datum:s,datumIndex:t,series:this,visible:a}}updateDatumNodes(t){const e=this.getHighlightStyle(t.isHighlight);t.datumSelection.each((i,n)=>{i.setProperties(zF(i,n)),i.stroke=e?.stroke,i.strokeWidth=e?.strokeWidth??0,i.strokeOpacity=e?.strokeOpacity??1,i.lineDash=e?.lineDash,i.lineDashOffset=e?.lineDashOffset??0,i.opacity=e?.opacity??1})}tooltipStyle(t,e){const{fill:i,stroke:n,fillOpacity:s,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l}=this.properties.getStyle(e);return{fill:i,fillOpacity:s,stroke:n,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l}}hasItemStylers(){return this.properties.label.itemStyler!=null}};D5.className="ConeFunnelSeries";D5.type="cone-funnel";var{coneFunnelSeriesThemeableOptionsDef:Bdt}=j;({...At(_e,["showInLegend"]),...Bdt,type:ht(Jt("cone-funnel")),stageKey:ht(K),valueKey:ht(K)});({...Oe},ie.NUMBER+"",ie.CATEGORY+"");var{Label:Vdt,DropShadow:_dt,AbstractBarSeriesProperties:Fdt,makeSeriesTooltip:Hdt,AxisLabel:jdt}=j,Gdt=class extends Vdt{},A5=class extends jdt{};M([b],A5.prototype,"placement");var eh=class extends xt{constructor(){super(...arguments),this.enabled=!0,this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{fill:t,stroke:e,fillOpacity:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o}=this;return{fill:t,fillOpacity:i,stroke:e,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,opacity:1}}};M([b],eh.prototype,"enabled");M([b],eh.prototype,"fill");M([b],eh.prototype,"fillOpacity");M([b],eh.prototype,"stroke");M([b],eh.prototype,"strokeWidth");M([b],eh.prototype,"strokeOpacity");M([b],eh.prototype,"lineDash");M([b],eh.prototype,"lineDashOffset");var Ls=class extends Fdt{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.spacingRatio=0,this.dropOff=new eh,this.shadow=new _dt().set({enabled:!1}),this.label=new Gdt,this.stageLabel=new A5,this.tooltip=Hdt()}getStyle(t){const{fills:e,strokes:i,fillOpacity:n,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r}=this;return{fill:e[t],fillOpacity:n,stroke:i[t],strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,opacity:1}}};M([b],Ls.prototype,"stageKey");M([b],Ls.prototype,"valueKey");M([b],Ls.prototype,"fills");M([b],Ls.prototype,"fillOpacity");M([b],Ls.prototype,"strokes");M([b],Ls.prototype,"strokeWidth");M([b],Ls.prototype,"strokeOpacity");M([b],Ls.prototype,"lineDash");M([b],Ls.prototype,"lineDashOffset");M([b],Ls.prototype,"spacingRatio");M([b],Ls.prototype,"itemStyler");M([b],Ls.prototype,"dropOff");M([b],Ls.prototype,"shadow");M([b],Ls.prototype,"label");M([b],Ls.prototype,"stageLabel");M([b],Ls.prototype,"tooltip");var{resetBarSelectionsFn:Udt,prepareBarAnimationFunctions:BF,midpointStartingBarPosition:VF,createDatumId:Wdt,Rect:Kdt,motion:_F}=j,I5=class extends S5{constructor(t){super({moduleCtx:t,animationResetFns:{datum:Udt}}),this.properties=new Ls}getBandScalePadding(){return{inner:this.properties.spacingRatio,outer:0}}connectorEnabled(){return this.properties.dropOff.enabled}connectorStyle(t){return Et(this.properties.dropOff.getStyle(),this.properties.getStyle(t))}nodeFactory(){return new Kdt}createLabelData({datumIndex:t,rect:e,yDatum:i,datum:n,visible:s}){const{valueKey:a,stageKey:o,label:r}=this.properties;if(!r.enabled)return;const l=this.getSeriesDomain(z.Y).domain,c=this.getLabelText(i,n,a,"y",l,r,{itemId:a,value:i,datum:n,stageKey:o,valueKey:a});return{x:e.x+e.width/2,y:e.y+e.height/2,textAlign:"center",textBaseline:"middle",text:c,itemId:o,datum:n,datumIndex:t,series:this,visible:s}}getItemStyle({datum:t,datumIndex:e},i){const{id:n,properties:s}=this,{stageKey:a,valueKey:o,itemStyler:r}=s,l=this.getHighlightStyle(i,e);let u=Et(l,s.getStyle(e));if(r!=null){const d=this.ctx.highlightManager?.getActiveHighlight(),g=this.cachedDatumCallback(Wdt(e,i?"highlight":"node"),()=>{const f=this.getHighlightStateString(d,i,e);return this.callWithContext(r,{seriesId:n,datum:t,highlightState:f,stageKey:a,valueKey:o,...u})});g&&(u=Et(g,u))}return u}updateDatumNodes({datumSelection:t,isHighlight:e}){const{contextNodeData:i}=this;if(!i)return;const{shadow:n}=this.properties,s=this.getCategoryDirection()===z.X,a=this.getShapeFillBBox();t.each((o,r)=>{const l=this.getItemStyle(r,e);o.setStyleProperties(l,a),o.visible=s?r.width>0:r.height>0,o.crisp=r.crisp,o.fillShadow=n})}tooltipStyle(t,e){return this.getItemStyle({datum:t,datumIndex:e},!1)}animateEmptyUpdateReady(t){super.animateEmptyUpdateReady(t);const{datumSelection:e}=t,i=this.isVertical(),s=BF(VF(i,"normal"),"unknown");_F.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],s)}animateWaitingUpdateReady(t){super.animateWaitingUpdateReady(t);const{datumSelection:e}=t,{processedData:i}=this,n=i?.reduced?.diff?.[this.id],s=BF(VF(this.isVertical(),"fade"),"added");_F.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],s,(a,o)=>o.xValue,n)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};I5.className="FunnelSeries";I5.type="funnel";var{funnelSeriesThemeableOptionsDef:Ydt}=j;({...Ydt,...At(_e,["showInLegend"]),type:ht(Jt("funnel")),stageKey:ht(K),valueKey:ht(K)});var hx={theme:jt,container:jt,animation:jt,background:jt,contextMenu:jt,context:()=>!0,listeners:jt,locale:jt,width:jt,height:jt,minWidth:jt,minHeight:jt,title:jt,subtitle:jt,footnote:jt,padding:jt,tooltip:{...Re,...Zt.tooltip}};hx.overrideDevicePixelRatio=Mt(X);hx.foreground=Mt(jt);hx.withinStudio=Mt(J);xp({"linear-gauge":{...At(Du,["type"]),...hx},"radial-gauge":{...At(yx,["type"]),...hx}},"gauge options");var k5=class{*[Symbol.iterator](){const{node:t,datum:e}=this;t&&e&&(yield{node:t,datum:e})}nodes(){return this.node?[this.node]:[]}update(t,e,i,n){const s=t.nodes();if(s.length===0)this.node?.remove(),this.node=void 0;else{this.node===void 0&&(this.node=new i,this.node.fillOpacity=0,this.node.strokeOpacity=0,e.appendChild(this.node));const a=s[0],o=s.toReversed().find(r=>r.datum.datum.value>r.datum.datum.segmentStart)??s.at(-1);this.node.datum=this.datum=a.datum,n(this.node,a,o)}}},C5={fromFn:()=>({opacity:0,phase:"initial"}),toFn:()=>({opacity:1})};function w5(t,e){if(t==null)return"";const{min:i,max:n}=e,s=i===0?0:Math.ceil(Math.log10(Math.abs(i))),a=n===0?0:Math.ceil(Math.log10(Math.abs(n))),o=Math.max(2-Math.max(s,a),0);return t.toFixed(o)}function ux(t,e,i,n){if(i.text!=null)return i.text;const s=n??i.value;let a;return i?.formatter!=null&&(a=cx(e,i.formatter,{seriesId:t,datum:void 0,value:s})),a==null||qt(a)?a:String(a)}function N5({path:t,x:e,y:i,size:n}){t.moveTo(e,i-n/2),t.lineTo(e,i+n/2)}function T5(t,e){const i=Mu(t.datumUnion.nodes(),t.targetSelection.nodes());return t.pickNodeNearestDistantObject(e,i)}function L5(t,e){const i=[{data:t.contextNodeData?.nodeData,selection:t.datumUnion},{data:t.contextNodeData?.targetData,selection:t.targetSelection}].filter(l=>l.data&&l.data.length>0),n=Nt(0,e.otherIndex+e.otherIndexDelta,i.length-1);if(i.length===0)return;const{data:s,selection:a}=i[n];if(s==null||s.length===0)return;const o=Nt(0,e.datumIndex,s.length-1),r=s[o];for(const l of a)if(l.datum===r)return{bounds:l.node,clipFocusBox:!0,datum:r,datumIndex:o,otherIndex:n}}function O5(t,e){const i=t.data?.dataIdKey;return j.findNodeDatumInArray(e,t.contextNodeData?.nodeData,i)??j.findNodeDatumInArray(e,t.contextNodeData?.targetData,i)}var GA=class extends xt{getSegments(t,e){const{values:i,step:n,count:s}=this,a=Math.min(...t.domain),o=Math.max(...t.domain);let r;if(i!=null){const l=i.filter(c=>c>a&&cc-u);r=[a,...l,o]}else if(n!=null){const l=[];for(let c=a;cc>a&&cu/l*(o-a)+a)}return r!=null&&r.length>e&&(pt.warnOnce("the configured segmentation results in more than 1 item per pixel, ignoring. Supply a segmentation configuration that results in larger segments or omit this configuration"),r=void 0),r??(r=[a,o]),r}};M([b],GA.prototype,"values");M([b],GA.prototype,"step");M([b],GA.prototype,"count");var cv=class extends xt{constructor(){super(...arguments),this.enabled=!1,this.interval=new GA,this.spacing=0}};M([b],cv.prototype,"enabled");M([b],cv.prototype,"interval");M([b],cv.prototype,"spacing");var{makeSeriesTooltip:$dt,SeriesProperties:Xdt,Label:Zdt,AxisLabel:qdt,getColorStops:Qdt}=j,E5=class extends Zdt{};M([b],E5.prototype,"spacing");var ws=class extends xt{constructor(){super(...arguments),this.value=0,this.label=new E5}getStyle(t){const{fill:e=t.fill??"black",fillOpacity:i=t.fillOpacity??1,stroke:n=t.stroke??"black",strokeWidth:s=t.strokeWidth??0,strokeOpacity:a=t.strokeOpacity??1,lineDash:o=t.lineDash??[0],lineDashOffset:r=t.lineDashOffset??0}=this;return{fill:e,fillOpacity:i,stroke:n,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r}}};M([b],ws.prototype,"text");M([b],ws.prototype,"value");M([b],ws.prototype,"shape");M([b],ws.prototype,"placement");M([b],ws.prototype,"spacing");M([b],ws.prototype,"size");M([b],ws.prototype,"rotation");M([b],ws.prototype,"fill");M([b],ws.prototype,"fillOpacity");M([b],ws.prototype,"stroke");M([b],ws.prototype,"strokeWidth");M([b],ws.prototype,"strokeOpacity");M([b],ws.prototype,"lineDash");M([b],ws.prototype,"lineDashOffset");M([b],ws.prototype,"label");var No=class extends xt{constructor(){super(...arguments),this.enabled=!0,this.thicknessRatio=1,this.fills=new ss(j.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(t,e,i){const{fill:n,fills:s,fillMode:a,fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:u,lineDashOffset:d}=this;return{fill:n??P5(s,a,t,i,e),fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:u,lineDashOffset:d}}};M([b],No.prototype,"enabled");M([b],No.prototype,"thickness");M([b],No.prototype,"thicknessRatio");M([b],No.prototype,"fills");M([b],No.prototype,"fillMode");M([b],No.prototype,"fill");M([b],No.prototype,"fillOpacity");M([b],No.prototype,"stroke");M([b],No.prototype,"strokeWidth");M([b],No.prototype,"strokeOpacity");M([b],No.prototype,"lineDash");M([b],No.prototype,"lineDashOffset");var hv=class extends xt{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};M([b],hv.prototype,"values");M([b],hv.prototype,"step");M([b],hv.prototype,"minSpacing");M([b],hv.prototype,"maxSpacing");var R5=class extends qdt{constructor(){super(...arguments),this.placement=void 0}};M([b],R5.prototype,"placement");var Ys=class extends xt{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new ss(j.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new hv,this.label=new R5}getStyle(t,e,i,n){const{fill:s,fills:a,defaultFill:o,fillMode:r,fillOpacity:l,stroke:c,strokeWidth:u,strokeOpacity:d,lineDash:g,lineDashOffset:f}=this;return{fill:s??(t&&a.length===0?o:void 0)??P5(a,r,e,n,i),fillOpacity:l,stroke:c,strokeWidth:u,strokeOpacity:d,lineDash:g,lineDashOffset:f}}};M([b],Ys.prototype,"min");M([b],Ys.prototype,"max");M([b],Ys.prototype,"fills");M([b],Ys.prototype,"fillMode");M([b],Ys.prototype,"fill");M([b],Ys.prototype,"fillOpacity");M([b],Ys.prototype,"stroke");M([b],Ys.prototype,"strokeWidth");M([b],Ys.prototype,"strokeOpacity");M([b],Ys.prototype,"lineDash");M([b],Ys.prototype,"lineDashOffset");M([b],Ys.prototype,"defaultFill");M([b],Ys.prototype,"interval");M([b],Ys.prototype,"label");var UA=class extends Om{constructor(){super(...arguments),this.placement="inside-center",this.avoidCollisions=!0}};M([b],UA.prototype,"text");M([b],UA.prototype,"placement");M([b],UA.prototype,"avoidCollisions");var ta=class extends Xdt{constructor(){super(...arguments),this.value=0,this.segmentation=new cv,this.defaultColorRange=[],this.targets=new ss(ws),this.defaultTarget=new ws,this.defaultScale=new Ys,this.direction="vertical",this.thickness=1,this.cornerRadius=0,this.cornerMode="container",this.margin=0,this.scale=new Ys,this.bar=new No,this.label=new UA,this.tooltip=$dt()}};M([b],ta.prototype,"value");M([b],ta.prototype,"segmentation");M([b],ta.prototype,"defaultColorRange");M([b],ta.prototype,"targets");M([b],ta.prototype,"defaultTarget");M([b],ta.prototype,"defaultScale");M([b],ta.prototype,"direction");M([b],ta.prototype,"thickness");M([b],ta.prototype,"cornerRadius");M([b],ta.prototype,"cornerMode");M([b],ta.prototype,"margin");M([b],ta.prototype,"scale");M([b],ta.prototype,"bar");M([b],ta.prototype,"label");M([b],ta.prototype,"tooltip");function P5(t,e,i,n,s){return{type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:Qdt(t,i,n.domain,e),rotation:s?90:0,bounds:"series"}}var{BBox:Jdt}=j;function qO(t){const{x0:e,y0:i,x1:n,y1:s,horizontalInset:a,verticalInset:o}=t,r=Math.min(e,n)+a,l=Math.min(i,s)+o,c=Math.max(Math.abs(n-e)-2*a,0),u=Math.max(Math.abs(s-i)-2*o,0);return{x:r,y:l,width:c,height:u}}function tpt(t,e){if(e==null)return!0;const i=qO(t),n=1e-6,s=i.x+n,a=i.y+n,o=i.x+i.width-n,r=i.y+i.height-n,l=e.x,c=e.x+e.width,u=e.y,d=e.y+e.height;return Math.max(s,l)<=Math.min(o,c)&&Math.max(a,u)<=Math.min(r,d)}function l1(t){const{clipX0:e,clipX1:i,clipY0:n,clipY1:s}=t;return e!=null&&i!=null||n!=null&&s!=null}function ept(t){if(!l1(t))return;const{x0:e,y0:i,x1:n,y1:s}=t,{x:a,y:o,width:r,height:l}=qO(t);let{clipX0:c,clipX1:u,clipY0:d,clipY1:g}=t;(c==null||u==null)&&(c=e,u=n),(d==null||g==null)&&(d=i,g=s);const f=Math.min(c,u),y=Math.min(d,g),x=Math.abs(u-c),S=Math.abs(g-d);return c=Math.max(a,f),d=Math.max(o,y),u=Math.min(a+r,f+x),g=Math.min(o+l,y+S),new Jdt(Math.min(c,u),Math.min(d,g),Math.abs(u-c),Math.abs(g-d))}function FF(t,e){const i=t?"initial":"update";return{node:{fromFn(s,a){const o=s.previousDatum;let{x0:r,y0:l,x1:c,y1:u,clipX0:d,clipY0:g,clipX1:f,clipY1:y}=o??a;const{horizontalInset:x,verticalInset:S}=a,D=o!=null&&l1(o),A=l1(a);return D&&A||(!D&&A?({x0:r,y0:l,x1:c,y1:u,clipX0:d,clipY0:g,clipX1:f,clipY1:y}=a,t&&(e?f=a.clipX0:y=a.clipY0)):D&&!A?({x0:r,y0:l,x1:c,y1:u}=a,d=void 0,g=void 0,f=void 0,y=void 0):t&&(e?c=r:u=l)),{x0:r,y0:l,x1:c,y1:u,clipX0:d,clipY0:g,clipX1:f,clipY1:y,horizontalInset:x,verticalInset:S,phase:i}},toFn(s,a){const{x0:o,y0:r,x1:l,y1:c,clipX0:u,clipY0:d,clipX1:g,clipY1:f,horizontalInset:y,verticalInset:x}=a;return{x0:o,y0:r,x1:l,y1:c,clipX0:u,clipY0:d,clipX1:g,clipY1:f,horizontalInset:y,verticalInset:x}},applyFn(s,a){s.setProperties(lb(s,a))}}}}function lb(t,e){const{x:i,y:n,width:s,height:a}=qO(e),o=ept(e),r=tpt(e,o);return{x:i,y:n,width:s,height:a,clipBBox:o,visible:r}}var ipt={Before:"right",Center:"center",After:"left"},npt={Before:"top",Center:"middle",After:"bottom"},spt={Before:-1,Center:-.5,After:0},apt={Before:0,Center:-.5,After:-1};function opt(t,e,i,n,s,a){const{seriesRect:o,gaugeRect:r,barRect:l}=s,{padding:c,horizontal:u}=n;i.each((d,g)=>{const f=ux(t.id,e,g,a?.label);let y,x;g.placement==="outside-start"?u?(y=r.x,x=o.height):(y=o.width,x=o.height-(r.y+r.height)):g.placement==="outside-end"?u?(y=o.width-(r.x+r.width),x=o.height):(y=o.width,x=r.y):g.avoidCollisions&&(y=r.width,x=r.height);let S;if(f==null)return;if(y!=null&&x!=null){const U=()=>({width:y,height:x,meta:null});S=rx(ce(f),g,{padding:c},U)?.[0]}else{const U=Ve(g),{width:V,height:Z}=qt(f)?Va(f,g):U.measureLines(bi(f));S={text:f,fontSize:g.fontSize,lineHeight:g.lineHeight??U.lineHeight(),width:V,height:Z}}if(S==null){d.visible=!1;return}const D=u?r.x:r.y+r.height,A=u?r.x+r.width:r.y,I=u?l.x:l.y+l.height,w=u?l.x+l.width:l.y,N=g.spacing*(u?1:-1);let O,L,R,P;switch(g.placement){case"outside-start":O=-1/0,L=1/0,R=D-N,P="Before";break;case"outside-end":O=-1/0,L=1/0,R=A+N,P="After";break;case"inside-start":O=D,L=w,R=D+N,P="After";break;case"inside-end":O=w,L=A,R=A-N,P="Before";break;case"inside-center":O=D,L=A,R=(D+A)/2,P="Center";break;case"bar-inside":O=I,L=w,R=(I+w)/2,P="Center";break;case"bar-inside-end":O=I,L=w,R=w-N,P="Before";break;case"bar-outside-end":O=w,L=A,R=w+N,P="After";break;case"bar-end":O=-1/0,L=1/0,R=w,P="Center";break}const B=u?R:r.x+r.width/2,F=u?r.y+r.height/2:R;let H,$;u?(H=B+spt[P]*S.width,$=H+S.width):(H=F+apt[P]*S.height,$=H+S.height);const Y=Math.min(H,$)>=Math.min(O,L)&&Math.max(H,$)<=Math.max(O,L);if(g.avoidCollisions&&!Y){d.visible=!1;return}d.visible=!0,d.text=S.text,d.fontSize=S.fontSize,d.lineHeight=S.lineHeight,d.textAlign=u?ipt[P]:"center",d.textBaseline=u?"middle":npt[P],d.x=B,d.y=F})}var{fromToMotion:Ow,resetMotion:rpt,SeriesNodePickMode:HF,createDatumId:jF,BBox:el,Group:Rd,PointerEvents:GF,Selection:Pd,Rect:lpt,Text:UF,TransformableText:cpt,Marker:hpt,LinearScale:upt,generateTicks:dpt,NiceMode:WF}=j,ppt={before:180,middle:0,after:0},gpt={before:90,middle:0,after:-90},z5=class extends j.Series{constructor(t){super({moduleCtx:t,pickModes:[HF.EXACT_SHAPE_MATCH,HF.NEAREST_NODE]}),this.properties=new ta,this.seriesRect=el.NaN,this.gaugeRect=el.NaN,this.scale=new upt,this.originX=0,this.originY=0,this.scaleGroup=this.contentGroup.appendChild(new Rd({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new Rd({name:"itemGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new Rd({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new Rd({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Rd({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new Rd({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new Rd({name:"tickGroup"})),this.scaleSelection=Pd.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=Pd.select(this.itemGroup,()=>this.nodeFactory()),this.targetSelection=Pd.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=Pd.select(this.itemTargetLabelGroup,UF),this.labelSelection=Pd.select(this.itemLabelGroup,UF),this.highlightTargetSelection=Pd.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=Pd.select(this.tickGroup,cpt),this.datumUnion=new k5,this.animationState=new Rt("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=GF.None,this.tickGroup.pointerEvents=GF.None}get range(){return this.horizontal?[0,this.gaugeRect.width]:[0,this.gaugeRect.height]}get horizontal(){return this.properties.direction==="horizontal"}get hasData(){return!0}nodeFactory(){const t=new lpt;return t.crisp=!0,t}markerFactory(){return new hpt}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(t){return w5(t,this.properties.scale)}getShapeFillBBox(){const{properties:t,originX:e,originY:i,horizontal:n,scale:s}=this,{thickness:a}=t,o=Tc(s.range),r=new el(e,i,n?o:a,n?a:o);return{axis:r,series:r}}getTargets(){const{properties:t}=this,e=t.defaultTarget;return Array.from(t.targets).map(i=>{const{text:n=e.text,value:s=e.value??0,shape:a=e.shape??"triangle",rotation:o=e.rotation??0,placement:r=e.placement??"middle",spacing:l=e.spacing??0,size:c=e.size??0}=i,{enabled:u=e.label.enabled,color:d=e.label.color??"black",fontStyle:g=e.label.fontStyle??"normal",fontWeight:f=e.label.fontWeight??"normal",fontSize:y=e.label.fontSize,fontFamily:x=e.label.fontFamily,spacing:S=e.label.spacing??0}=i.label;return{text:n,value:s,shape:a,placement:r,spacing:l,size:c,rotation:o,label:{enabled:u,color:d,fontStyle:g,fontWeight:f,fontSize:y,fontFamily:x,spacing:S},style:i.getStyle(e)}})}getTargetPoint(t){const{properties:e,originX:i,originY:n,horizontal:s,scale:a,gaugeRect:o}=this,{thickness:r}=e,{value:l,placement:c,spacing:u,size:d}=t,g=a.convert(l);let f;switch(c){case"before":f=-(u+d/2);break;case"after":f=r+u+d/2;break;default:f=r/2;break}return{x:i+o.x+(s?g:f),y:n+o.y+(s?f:g)}}getTargetLabel(t){const{size:e,placement:i,label:n}=t,{spacing:s,color:a,fontStyle:o,fontWeight:r,fontSize:l,fontFamily:c}=n,u=void 0,d=e/2+s;let g,f,y=0,x=0;return this.horizontal?(g="center",i==="after"?(f="top",x=d):(f="bottom",x=-d)):(f="middle",i==="before"?(g="right",y=-d):(g="left",y=d)),{offsetX:y,offsetY:x,fill:a,textAlign:g,textBaseline:f,fontStyle:o,fontWeight:r,fontSize:l,fontFamily:c,lineHeight:u}}labelDatum(t,e){const{placement:i,avoidCollisions:n,spacing:s,text:a,color:o,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:u,fontFamily:d,lineHeight:g,wrapping:f,overflowStrategy:y,formatter:x=S=>this.formatLabel(S.value)}=t;return{series:this,datum:void 0,datumIndex:{type:0},placement:i,avoidCollisions:n,spacing:s,text:a,value:e,fill:o,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:u,fontFamily:d,lineHeight:g,wrapping:f,overflowStrategy:y,formatter:x}}verticalLabelInset(){const{label:t}=this.properties,e=Ve(t),i=t.text?.split(` +`),n=(t.lineHeight??e.lineHeight())*(i?.length??1);return t.spacing+n}horizontalLabelInset(){const{scale:t,properties:e}=this,{scale:i,label:n}=e,s=n.text?.split(` +`),a=Ve(n),o=i.interval.values??t.ticks({nice:[!1,!1],interval:i.interval.step,minTickCount:0,maxTickCount:6,tickCount:5})?.ticks??[],l=(s??o?.map(c=>ux(this.id,this.ctx,this.labelDatum(n,c))??"")).reduce((c,u)=>{const{width:d}=qt(u)?Va(u,n):a.measureLines(bi(u));return Math.max(c,d)},0);return n.spacing+l}tickFormatter(t,e){const{format:i,formatter:n}=this.properties.scale.label;let s;return i!=null&&(s=vT(e,typeof i=="string"?i:void 0)),(a,o)=>{let r;return n&&(r??(r=cx(this.ctx,n,{value:a,index:o,domain:t,boundSeries:void 0}))),r??(r=s?.(a)),r??this.formatLabel(a)}}createNodeData(){const{id:t,properties:e,horizontal:i,scale:n,seriesRect:s}=this,{value:a,segmentation:o,thickness:r,cornerRadius:l,cornerMode:c,bar:u,scale:d,label:g,defaultColorRange:f,defaultScale:y}=e;n.domain=[d.min,d.max],n.range=i?[0,s.width]:[s.height,0];let x,S;i?(S=1,x=Math.PI/-2):d.label.placement==="before"?(S=1,x=0):(S=-1,x=0);let D,A,I,w;i?(D=0,A=s.width,I=(s.height-r)/2,w=I+r,g.placement==="outside-start"?D+=this.horizontalLabelInset():g.placement==="outside-end"&&(A-=this.horizontalLabelInset())):(D=(s.width-r)/2,A=D+r,w=0,I=s.height,g.placement==="outside-start"?I-=this.verticalLabelInset():g.placement==="outside-end"&&(w+=this.verticalLabelInset())),this.gaugeRect=new el(Math.min(D,A),Math.min(I,w),Math.abs(A-D),Math.abs(w-I));const N=0,O=0;n.domain=[d.min,d.max],n.range=i?[D,A]:[I,w];const L=Et({parallel:i},d.label,y.label),{tickData:{ticks:R}}=dpt({scale:n,label:L,interval:d.interval,tickFormatter:(Qt,zt)=>this.tickFormatter(Qt,zt),domain:n.domain,range:this.range,reverse:!1,primaryTickCount:void 0,defaultTickMinSpacing:0,visibleRange:[0,1],niceMode:[WF.Off,WF.Off],labelOffset:0,axisRotation:x,sideFlag:S}),P=this.getTargets(),B=[],F=[],H=[],$=[],[Y,U]=n.range,V=Math.abs(U-Y),Z=i?n.convert(a):A,W=i?w:n.convert(a),q=o.enabled?o.spacing/2:0,nt=i?q:0,G=i?0:q,et=Math.min(u.thickness??Math.round(u.thicknessRatio*r),r),st=-(r-et)/2,lt=i?0:st,mt=i?st:0,Dt=c==="item",kt=Math.ceil(V);let Vt=o.enabled?o.interval.getSegments(n,kt):void 0;const Kt=u.getStyle(f,i,n),ae=d.getStyle(u.enabled,f,i,n);if(Vt==null&&Dt){const Qt=Math.min(...n.domain),zt=Math.max(...n.domain),Pt={value:a,segmentStart:Qt,segmentEnd:zt};if(u.enabled){const Di=Math.min(l,et/2,V/2)*1,zn=i?Di:0,Kn=i?0:Di;B.push({series:this,itemId:"value",datum:Pt,datumIndex:{type:0},type:0,x0:N+D-zn-lt,y0:O+I-Kn-mt,x1:N+Z+zn+lt,y1:O+W+Kn+mt,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,horizontalInset:nt,verticalInset:G,style:Kt})}const oe=Math.min(l,r/2,V/2)*1,ke=i?oe:0,Ye=i?0:oe;$.push({series:this,itemId:"scale",datum:Pt,datumIndex:{type:0},type:0,x0:N+D-ke,y0:O+I-Ye,x1:N+A+ke,y1:O+w+Ye,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,horizontalInset:nt,verticalInset:G,style:ae})}else{Vt??(Vt=n.domain);const Qt=N+D-lt,zt=O+I-mt,Pt=N+Z+lt,ue=O+W+mt;for(let oe=0;oejF(t.nodeData.length,e.itemId))}updateDatumNodes(t){const{datumSelection:e}=t,{ctx:i}=this,n=i.animationManager.isSkipped(),s=this.getShapeFillBBox();e.each((o,r)=>{const{topLeftCornerRadius:l,topRightCornerRadius:c,bottomRightCornerRadius:u,bottomLeftCornerRadius:d}=r;o.setStyleProperties(r.style,s),o.topLeftCornerRadius=l,o.topRightCornerRadius=c,o.bottomRightCornerRadius=u,o.bottomLeftCornerRadius=d,o.pointerEvents=this.properties.bar.enabled?j.PointerEvents.All:j.PointerEvents.None,(n||o.previousDatum==null)&&o.setProperties(lb(o,r))});const{horizontal:a}=this;this.datumUnion.update(e,this.itemGroup,j.Rect,(o,r,l)=>{const c=Math.min(r.x,l.x),u=Math.max(r.x+r.width,l.x+l.width),d=Math.min(r.y,l.y),g=Math.max(r.y+r.height,l.y+l.height),f=u-c,y=g-d;o.pointerEvents=j.PointerEvents.None,o.x=c,o.y=d,o.width=f,o.height=y,o.topLeftCornerRadius=a?r.topLeftCornerRadius:l.topLeftCornerRadius,o.topRightCornerRadius=l.topRightCornerRadius,o.bottomRightCornerRadius=a?l.bottomRightCornerRadius:r.bottomRightCornerRadius,o.bottomLeftCornerRadius=r.bottomLeftCornerRadius;const x=r.clipBBox,S=l.clipBBox??x;x&&S?o.clipBBox=el.merge([x,S]).intersection(a?new el(c,-1/0,f,1/0):new el(-1/0,d,1/0,y)):o.clipBBox=void 0})}updateScaleSelection(t){return t.scaleSelection.update(t.scaleData,void 0,e=>jF(t.scaleData.length,e.itemId))}updateScaleNodes(t){const{scaleSelection:e}=t,i=this.getShapeFillBBox();e.each((n,s)=>{const{topLeftCornerRadius:a,topRightCornerRadius:o,bottomRightCornerRadius:r,bottomLeftCornerRadius:l}=s;n.setStyleProperties(s.style,i),n.setProperties(lb(n,s)),n.topLeftCornerRadius=a,n.topRightCornerRadius=o,n.bottomRightCornerRadius=r,n.bottomLeftCornerRadius=l,n.setProperties(lb(n,s))})}updateTargetSelection(t){return t.targetSelection.update(t.targetData,void 0,e=>e.itemId)}updateTargetNodes(t){const{targetSelection:e,isHighlight:i}=t;e.each((n,s)=>{const{x:a,y:o,shape:r,size:l,rotation:c}=s,u=this.getTargetStyle(i,s);n.setStyleProperties(u),n.size=l,n.shape=r==="line"?N5:r,n.translationX=a,n.translationY=o,n.rotation=c})}getTargetStyle(t,{datumIndex:e,style:i}){const n=this.getHighlightStyle(t,e);return Et(n,{...i,opacity:1})}updateTargetLabelSelection(t){return t.targetLabelSelection.update(t.targetData)}updateTargetLabelNodes(t){const{targetLabelSelection:e}=t;e.each((i,n)=>{const{x:s,y:a,text:o}=n,{offsetX:r,offsetY:l,fill:c,fontStyle:u,fontWeight:d,fontSize:g,fontFamily:f,textAlign:y,textBaseline:x}=n.label;i.visible=!0,i.x=s+r,i.y=a+l,i.text=o,i.fill=c,i.fontStyle=u,i.fontWeight=d,i.fontSize=g,i.fontFamily=f,i.textAlign=y,i.textBaseline=x})}updateTickSelection(t){return t.tickSelection.update(t.tickData,void 0,e=>e.tickId)}updateTickNodes(t){const{gaugeRect:e,properties:i}=this,n=i.defaultScale,{enabled:s,color:a=n.label.color,fontFamily:o=n.label.fontFamily,fontSize:r=n.label.fontSize,fontStyle:l,fontWeight:c=n.label.fontWeight,spacing:u}=i.scale.label;let{placement:d}=i.scale.label;const g=Ze(i.scale.label.rotation??0);let f,y,x,S;this.horizontal?(d??(d="after"),f="center",y=d==="before"?"bottom":"top",S=this.originY+e.y+(d==="before"?-u:e.height+u)):(d??(d="before"),f=d==="before"?"end":"start",y="middle",x=this.originX+e.x+(d==="before"?-u:e.width+u)),t.tickSelection.each((D,A)=>{if(!s){D.visible=!1;return}const I=x??A.translation,w=S??A.translation;D.visible=!0,D.text=A.tickLabel,D.fill=a,D.fontFamily=o,D.fontSize=r,D.fontStyle=l,D.fontWeight=c,D.textBaseline=y,D.textAlign=f,D.x=I,D.y=w,D.rotationCenterX=I,D.rotationCenterY=w,D.rotation=g})}updateLabelSelection(t){return t.labelSelection.update(t.labelData,void 0,e=>"primary")}updateLabelNodes(t){const{labelSelection:e}=t,i=this.ctx.animationManager.isSkipped();e.each((n,s)=>{n.fill=s.fill,n.fontStyle=s.fontStyle,n.fontWeight=s.fontWeight,n.fontFamily=s.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}labelsHaveExplicitText(){for(const{datum:t}of this.labelSelection)if(t.text==null)return!1;return!0}formatLabelText(t){const{labelSelection:e,horizontal:i,scale:n,seriesRect:s,gaugeRect:a}=this,{x:o,y:r,width:l,height:c}=a,u=t?.label??this.properties.value;let d;if(i){const y=n.convert(u);d=new el(o,r,y-o,c)}else{const y=n.convert(u);d=new el(o,y,l,c-y)}const g={seriesRect:s,gaugeRect:a,barRect:d},{margin:f}=this.properties;opt(this,this.ctx,e,{padding:f,horizontal:i},g,t)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),rpt([this.datumSelection],lb),this.formatLabelText()}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}animateLabelText(t={}){const{animationManager:e}=this.ctx;let i=0,n=0;if(this.labelSelection.each((s,a)=>{s.opacity=1,i=s.previousDatum?.value??t.from??a.value,n=a.value}),!this.labelsHaveExplicitText())if(i===n)this.formatLabelText({label:n});else{const s=`${this.id}_labels`;e.animate({id:s,groupId:"label",from:{label:i},to:{label:n},phase:t.phase??"update",ease:Lc,onUpdate:a=>this.formatLabelText(a),onStop:()=>this.formatLabelText({label:n})})}}animateEmptyUpdateReady(){const{animationManager:t}=this.ctx,{node:e}=FF(!0,this.horizontal);Ow(this.id,"node",t,[this.datumSelection],e,(i,n)=>n.itemId),Ow(this.id,"label",t,[this.labelSelection],C5,()=>"primary"),this.animateLabelText({from:0,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:t}=this.ctx,{node:e}=FF(!1,this.horizontal);Ow(this.id,"node",t,[this.datumSelection],e,(i,n)=>n.itemId),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return{domain:[0,1]}}dataCount(){return Number.NaN}getSeriesRange(){return[Number.NaN,Number.NaN]}getLegendData(){return[]}getTooltipContent(t){const{id:e,properties:i}=this,{tooltip:n}=i;if(t==null)return;let s,a,o;if(t.type===0?(s=i.value,a=i.label.text,o=this.ctx.localeManager.t("ariaLabelGaugeValue")):({value:s,text:a}=i.targets[t.index],o=this.ctx.localeManager.t("ariaLabelGaugeTarget")),s!=null)return this.formatTooltipWithContext(n,{data:[{label:a,fallbackLabel:o,value:this.formatLabel(s)}]},{seriesId:e,title:void 0,datum:void 0,value:s})}pickNodeClosestDatum(t){return T5(this,t)}pickFocus(t){return L5(this,t)}getCaptionText(){return this.formatLabel(this.properties.value)}getCategoryValue(t){}datumIndexForCategoryValue(t){}hasItemStylers(){return this.properties.label.itemStyler!=null}};z5.className="LinearGaugeSeries";z5.type="linear-gauge";({...Oe,minimumFontSize:zc.SMALL});var{Chart:fpt,MercatorScale:KF}=j;function mpt(t){return t.type==="map-shape"||t.type==="map-line"||t.type==="map-marker"||t.type==="map-shape-background"||t.type==="map-line-background"}var QO=class extends fpt{constructor(t,e){super(t,e),this.xAxis={id:Nn(j.Axis),direction:z.X},this.yAxis={id:Nn(j.Axis),direction:z.Y},this.ctx.zoomManager.setAxes([this.xAxis,this.yAxis]),this.ctx.zoomManager.panToBBoxScalingMode=j.PanToBBoxScalingModeEnum.WhenViewportTooSmallScaleXYProportionally}getChartType(){return"topology"}updateData(){super.updateData();const t=this.getOptions();this.topology!==t.topology&&(this.topology=t.topology);const{topology:e}=this;for(const i of this.series)mpt(i)&&i.setChartTopology(e)}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,n=t.layoutBox.clone().shrink(this.seriesArea.getPadding());this.seriesRect=n,this.animationRect=n;const s=this.series,a=s.reduce((l,c)=>{if(!c.visible)return l;const u=c.topologyBounds;return u==null?l:l==null?u:l.merge(u)},void 0);let o;if(a!=null){const{lon0:l,lat0:c,lon1:u,lat1:d}=a,g=[[l,c],[u,d]],f=KF.bounds(g),{width:y,height:x}=n,S=Math.min(y/f.width,x/f.height),D=f.width*S,A=f.height*S,I=(y-D)/2,w=(x-A)/2,N=I,O=w,L=I+D,R=w+A,P=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),B=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),F=(L-N)/(P.max-P.min),H=N-F*P.min,$=(R-O)/(1-B.min-(1-B.max)),Y=O-$*(1-B.max);o=new KF(g,[[H,Y],[H+F,Y+$]])}for(const l of s)l.scale=o;const r=this.series.some(l=>l.visible);e.visible=r;for(const l of[e,i])l.translationX=Math.floor(n.x),l.translationY=Math.floor(n.y),l.setClipRect(n.clone());this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:r,rect:n,paddedRect:t.layoutBox},layoutBox:t.layoutBox})}hasPgUpPgDownSupport(){return!1}};QO.className="TopologyChart";QO.type="topology";M([b],QO.prototype,"topology");var{topologyChartOptionsDefs:Abt}=j;function Sl(t){const e=le(t);return Ic(e,i=>{typeof i=="object"&&"$palette"in i&&(i.$mapPalette=i.$palette,delete i.$palette)}),e}var ypt=1e-9;function B5(t,e,i,n){const[s,a]=t,[o,r]=e,l=o-s,c=r-a,u=l*l+c*c;let d,g;if(Math.abs(u)e){const u=(e-s)/l,d=[i+(o-i)*u,n+(r-n)*u],g=Math.atan2(r-n,o-i);return{point:d,angle:g}}s=c,i=o,n=r}}var Tb=class V5{constructor(e,i,n,s){this.lon0=e,this.lat0=i,this.lon1=n,this.lat1=s}extend(e,i,n,s){return this.lon0=Math.min(this.lon0,e),this.lat0=Math.min(this.lat0,i),this.lon1=Math.max(this.lon1,n),this.lat1=Math.max(this.lat1,s),this}merge(e){return this.extend(e.lon0,e.lat0,e.lon1,e.lat1)}static extend(e,i,n,s,a){return e?e.extend(i,n,s,a):new V5(i,n,s,a)}};function ef(t,e){for(const i of t){const[n,s]=i;e=Tb.extend(e,n,s,n,s)}return e}function bpt(t){if(t.length===0)return;let e=0,i=0,n=0,[s,a]=t.at(-1);for(const[o,r]of t){const l=s*r-o*a;n+=l,e+=(s+o)*l,i+=(a+r)*l,s=o,a=r}return n*=3,[e/n,i/n]}function WM(t,e,i){let n=!1,s=1/0;for(const a of t){let o=a.at(-1),[r,l]=o;for(const c of a){const[u,d]=c;d>i!=l>i&&e<(r-u)*(i-d)/(l-d)+u&&(n=!n),s=Math.min(s,B5(o,c,e,i)),o=c,r=u,l=d}}return(n?-1:1)*Math.sqrt(s)}var{Path:xpt,ExtendedPath2D:vpt,BBox:Spt}=j,Rm=class extends xpt{constructor(){super(...arguments),this.projectedGeometry=void 0,this.renderMode=3,this.strokePath=new vpt}computeBBox(){return(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),this.bbox?.clone()}updatePath(){const{projectedGeometry:t}=this;this.strokePath.clear(),this.path.clear(),this.bbox=t==null?void 0:this.drawGeometry(t,void 0)}drawPath(t){super.drawPath(t),this.renderStroke(t,this.strokePath.getPath2D())}containsPoint(t,e){const{projectedGeometry:i}=this;return i==null||!this.getBBox().containsPoint(t,e)?!1:this.geometryDistance(i,t,e)<=0}distanceSquared(t,e){const{projectedGeometry:i}=this;if(i==null)return 1/0;const n=this.geometryDistance(i,t,e);return n>0?n*n:0}geometryDistance(t,e,i){const{renderMode:n,strokeWidth:s}=this,a=(n&1)!==0,o=(n&2)!==0,r=Math.max(s/2,1)+1;switch(t.type){case"GeometryCollection":return t.geometries.reduce((l,c)=>Math.min(l,this.geometryDistance(c,e,i)),1/0);case"MultiPolygon":return a?t.coordinates.reduce((l,c)=>Math.min(l,Math.max(WM(c,e,i),0)),1/0):1/0;case"Polygon":return a?Math.max(WM(t.coordinates,e,i),0):1/0;case"MultiLineString":return o?t.coordinates.reduce((l,c)=>Math.min(l,Math.max(YF(c,e,i)-r,0)),1/0):1/0;case"LineString":return o?Math.max(YF(t.coordinates,e,i)-r,0):1/0;default:return 1/0}}shouldDrawPolygons(){return(this.renderMode&1)!==0}shouldDrawLines(){return(this.renderMode&2)!==0}drawGeometryCollection(t,e){for(const i of t)e=this.drawGeometry(i,e);return e}drawMultiPolygon(t,e){if(!this.shouldDrawPolygons())return e;for(const i of t)e=this.drawPolygon(this.path,i,e);return e}drawSinglePolygon(t,e){return this.shouldDrawPolygons()?this.drawPolygon(this.path,t,e):e}drawMultiLineString(t,e){if(!this.shouldDrawLines())return e;for(const i of t)e=this.drawLineString(this.strokePath,i,e,!1);return e}drawSingleLineString(t,e){return this.shouldDrawLines()?this.drawLineString(this.strokePath,t,e,!1):e}drawGeometry(t,e){switch(t.type){case"GeometryCollection":return this.drawGeometryCollection(t.geometries,e);case"MultiPolygon":return this.drawMultiPolygon(t.coordinates,e);case"Polygon":return this.drawSinglePolygon(t.coordinates,e);case"MultiLineString":return this.drawMultiLineString(t.coordinates,e);case"LineString":return this.drawSingleLineString(t.coordinates,e);case"Point":case"MultiPoint":return e}}drawPolygon(t,e,i){if(e.length<1)return i;i=this.drawLineString(t,e[0],i,!0);for(let n=1;ni)&&(i=a,n=s)}return n}function Pm(t,e){if(t.bbox!=null){const[i,n,s,a]=t.bbox;return e=Tb.extend(e,i,n,s,a),e}switch(t.type){case"GeometryCollection":for(const i of t.geometries)e=Pm(i,e);break;case"MultiPolygon":for(const i of t.coordinates)i.length>0&&(e=ef(i[0],e));break;case"Polygon":t.coordinates.length>0&&(e=ef(t.coordinates[0],e));break;case"MultiLineString":for(const i of t.coordinates)e=ef(i,e);break;case"LineString":e=ef(t.coordinates,e);break;case"MultiPoint":for(const i of t.coordinates){const[n,s]=i;e=Tb.extend(e,n,s,n,s)}break;case"Point":{const[i,n]=t.coordinates;e=Tb.extend(e,i,n,i,n);break}}return e}function YM(t){switch(t.type){case"Polygon":return t.coordinates;case"MultiPolygon":return KM(t.coordinates,$F);case"GeometryCollection":{const e=t.geometries.map(YM).filter(i=>i!=null);return KM(e,$F)}case"MultiLineString":case"LineString":case"MultiPoint":case"Point":return}}function $M(t){switch(t.type){case"LineString":return t.coordinates;case"MultiLineString":return KM(t.coordinates,c1);case"GeometryCollection":{const e=t.geometries.map($M).filter(i=>i!=null);return KM(e,c1)}case"MultiPolygon":case"Polygon":case"MultiPoint":case"Point":return}}function JO(t,e){if(t==null)return!1;switch(t.type){case"GeometryCollection":return t.geometries.some(i=>JO(i,e));case"MultiPolygon":case"Polygon":return(e&1)!==0;case"MultiLineString":case"LineString":return(e&2)!==0;case"MultiPoint":case"Point":return(e&4)!==0}}function yp(t,e){switch(t.type){case"GeometryCollection":return{type:"GeometryCollection",geometries:t.geometries.map(i=>yp(i,e))};case"Polygon":return{type:"Polygon",coordinates:h1(t.coordinates,e)};case"MultiPolygon":return{type:"MultiPolygon",coordinates:Mpt(t.coordinates,e)};case"MultiLineString":return{type:"MultiLineString",coordinates:h1(t.coordinates,e)};case"LineString":return{type:"LineString",coordinates:u1(t.coordinates,e)};case"MultiPoint":return{type:"MultiPoint",coordinates:u1(t.coordinates,e)};case"Point":return{type:"Point",coordinates:e.convert(t.coordinates)}}}function Mpt(t,e){return t.map(i=>h1(i,e))}function h1(t,e){return t.map(i=>u1(i,e))}function u1(t,e){return t.map(i=>e.convert(i))}function Dpt(){return{fromFn:(i,n,s)=>s==="removed"?{scalingX:1,scalingY:1}:i.previousDatum==null?{scalingX:0,scalingY:0}:{scalingX:i.scalingX,scalingY:i.scalingY},toFn:(i,n,s)=>s==="removed"?{scalingX:0,scalingY:0}:{scalingX:1,scalingY:1}}}function _5(t,e){const i=t.contextNodeData?.nodeData[e.datumIndex];if(i!==void 0){for(const n of t.datumSelection.nodes())if(n.datum===i)return n}}(class extends j.SeriesProperties{});var uv=class extends j.DataModelSeries{constructor(t){super(t),this.cleanup.register(this.ctx.eventsHub.on("data:update",()=>{}),this.ctx.eventsHub.on("legend:item-click",e=>{this.onLegendItemClick(e)}),this.ctx.eventsHub.on("legend:item-double-click",e=>{this.onLegendItemDoubleClick(e)}))}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getHighlightedDatum(){let t=this.ctx.highlightManager?.getActiveHighlight();const{legendItemName:e}=this.properties,i=e!=null&&t?.datum==null&&e===t?.legendItemName;return t!=null&&(t.series!==this&&!i||t.datum==null)&&(t=void 0),t}isSeriesHighlighted(t){if(!this.properties.highlight.enabled)return!1;const{series:e,legendItemName:i}=t??{},{legendItemName:n}=this.properties;return e===this||n!=null&&n===i}},{SeriesProperties:Apt,makeSeriesTooltip:Ipt,Label:kpt}=j,Fi=class extends Apt{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.topologyIdKey="name",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.maxStrokeWidth=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.label=new kpt,this.tooltip=Ipt()}getStyle(){const{stroke:t,strokeOpacity:e,strokeWidth:i,lineDash:n,lineDashOffset:s}=this;return{stroke:t,strokeOpacity:e,strokeWidth:i,lineDash:n,lineDashOffset:s,opacity:1}}};M([b],Fi.prototype,"topology");M([b],Fi.prototype,"title");M([b],Fi.prototype,"legendItemName");M([b],Fi.prototype,"idKey");M([b],Fi.prototype,"topologyIdKey");M([b],Fi.prototype,"idName");M([b],Fi.prototype,"labelKey");M([b],Fi.prototype,"labelName");M([b],Fi.prototype,"sizeKey");M([b],Fi.prototype,"sizeName");M([b],Fi.prototype,"colorKey");M([b],Fi.prototype,"colorName");M([b],Fi.prototype,"sizeDomain");M([b],Fi.prototype,"colorRange");M([b],Fi.prototype,"maxStrokeWidth");M([b],Fi.prototype,"stroke");M([b],Fi.prototype,"strokeOpacity");M([b],Fi.prototype,"strokeWidth");M([b],Fi.prototype,"lineDash");M([b],Fi.prototype,"lineDashOffset");M([b],Fi.prototype,"itemStyler");M([b],Fi.prototype,"label");M([b],Fi.prototype,"tooltip");var{getMissCount:Cpt,getLabelStyles:wpt,createDatumId:XF,SeriesNodePickMode:ZF,valueProperty:Wy,ColorScale:Npt,LinearScale:Tpt,Selection:AS,Text:qF,Transformable:Lpt}=j,F5=class extends uv{constructor(t){super({moduleCtx:t,categoryKey:void 0,propertyKeys:{size:["colorKey"],color:["colorKey"],label:["labelKey"]},propertyNames:{size:["sizeName"],color:["colorName"],label:["labelName"]},pickModes:[ZF.EXACT_SHAPE_MATCH,ZF.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new Fi,this._chartTopology=void 0,this.colorScale=new Npt,this.sizeScale=new Tpt,this.datumSelection=AS.select(this.contentGroup,()=>this.nodeFactory()),this.labelSelection=AS.select(this.labelGroup,qF),this.highlightDatumSelection=AS.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=AS.select(this.highlightLabelGroup,qF),this.placedLabelData=[],this._previousDatumMidPoint=void 0}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&this.topology!=null}renderToOffscreenCanvas(){return!0}setZIndex(t){return super.setZIndex(t),this.contentGroup.zIndex=[1,t],this.highlightGroup.zIndex=[4,t],!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const t=new Rm;return t.renderMode=2,t.lineJoin="round",t.lineCap="round",t}async processData(t){if(this.data==null)return;const{data:e,topology:i,sizeScale:n,colorScale:s}=this,{topologyIdKey:a,idKey:o,sizeKey:r,colorKey:l,labelKey:c,sizeDomain:u,colorRange:d}=this.properties,g=new Map;for(const I of i?.features.values()??[]){const w=I.properties?.[a];w==null||!JO(I.geometry,2)||g.set(w,I)}const f=this.sizeScale.type,y=this.colorScale.type,x=this.scale?.type,{dataModel:S,processedData:D}=await this.requestDataModel(t,e,{props:[Wy(o,x,{id:"idValue",includeProperty:!1}),Wy(o,x,{id:"featureValue",includeProperty:!1,processor:()=>I=>g.get(I)}),...c==null?[]:[Wy(c,"category",{id:"labelValue"})],...r==null?[]:[Wy(r,f,{id:"sizeValue"})],...l==null?[]:[Wy(l,y,{id:"colorValue"})]]}),A=S.resolveColumnById(this,"featureValue",D);if(this.topologyBounds=A.reduce((I,w)=>{const N=w?.geometry;return N==null?I:Pm(N,I)},void 0),r!=null){const I=S.resolveProcessedDataIndexById(this,"sizeValue"),w=D.domain.values[I]??[];n.domain=u??w}if(d!=null&&this.isColorScaleValid()){const I=S.resolveProcessedDataIndexById(this,"colorValue");s.domain=D.domain.values[I],s.range=d,s.update()}i==null&&pt.warnOnce("no topology was provided for [MapLineSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const n=e.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,a=Cpt(this,i.defs.values[n].missing);return!(s===0||s===a)}getLabelDatum(t,e,i,n,s,a){if(n==null||s==null||i==null)return;const o=$M(s);if(o==null)return;const{idKey:r,idName:l,sizeKey:c,sizeName:u,colorKey:d,colorName:g,labelKey:f,labelName:y,label:x}=this.properties;if(f==null||!x.enabled)return;const S=this.getLabelText(n,t,f,"label",[],x,{value:n,datum:t,idKey:r,idName:l,sizeKey:c,sizeName:u,colorKey:d,colorName:g,labelKey:f,labelName:y});if(S==null)return;const D=a.measureLines(String(S)),A=UM(o);if(A==null)return;const[I,w]=A.point,{width:N,height:O}=D;return{point:{x:I,y:w,size:0},label:{width:N,height:O,text:S},anchor:void 0,placement:void 0,datumIndex:e,idValue:i}}resolveColumn(t,e,i){if(!(t==null||this.dataModel==null))return this.dataModel.resolveColumnById(this,e,i)}resolveLineDataColumns(t){const{sizeKey:e,colorKey:i,labelKey:n}=this.properties;return{idValues:this.dataModel.resolveColumnById(this,"idValue",t),featureValues:this.dataModel.resolveColumnById(this,"featureValue",t),labelValues:this.resolveColumn(n,"labelValue",t),sizeValues:this.resolveColumn(e,"sizeValue",t),colorValues:this.resolveColumn(i,"colorValue",t)}}prepareProjectedLineGeometries(t,e,i){const n=new Map;for(const[s]of i.dataSources.get(this.id)?.data.entries()??[]){const a=t[s],o=e[s]?.geometry,r=o!=null&&this.scale!=null?yp(o,this.scale):void 0;a!=null&&r!=null&&n.set(a,r)}return n}warnMissingGeometries(t){if(t.length===0)return;const e=10;if(t.length>e){const i=t.length-e;t.length=e,t.push(`(+${i} more)`)}pt.warnOnce("some data items do not have matches in the provided topology",t)}createNodeData(){const{id:t,dataModel:e,processedData:i,sizeScale:n,properties:s}=this,{label:a,legendItemName:o,colorKey:r}=s;if(e==null||i==null)return;if(!this.visible)return{itemId:t,nodeData:[],labelData:[]};const l=this.resolveLineDataColumns(i),c=s.maxStrokeWidth??s.strokeWidth;n.range=[Math.min(s.strokeWidth,c),c];const u=Ve(a),d=this.prepareProjectedLineGeometries(l.idValues,l.featureValues,i),g=[],f=[],y=[],x=i.dataSources.get(this.id)?.data??[];for(const[S,D]of x.entries()){const A={idValue:l.idValues[S],colorValue:l.colorValues?.[S],sizeValue:l.sizeValues?.[S],labelValue:l.labelValues?.[S]},I=d.get(A.idValue);if(I==null&&y.push(A.idValue),r!=null&&A.colorValue==null)continue;const w=this.getLabelDatum(D,S,A.idValue,A.labelValue,I,u);w!=null&&f.push(w),g.push({series:this,datum:D,datumIndex:S,...A,projectedGeometry:I,legendItemName:o,style:this.getItemStyle({datumIndex:S,datum:D,colorValue:A.colorValue,sizeValue:A.sizeValue},!1)})}return this.warnMissingGeometries(y),{itemId:t,nodeData:g,labelData:f}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t,highlightDatumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const i=this.ctx.chartService.highlight?.drawingMode??"overlay",n=this.getHighlightedDatum(),s=this.contextNodeData?.nodeData??[];this.datumSelection=this.updateDatumSelection({nodeData:s,datumSelection:t}),this.updateDatumStyles({datumSelection:t,isHighlight:!1}),this.updateDatumNodes({datumSelection:t,isHighlight:!1,drawingMode:"overlay"}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:n==null?[]:[n],datumSelection:e}),this.updateDatumStyles({datumSelection:e,isHighlight:!0}),this.updateDatumNodes({datumSelection:e,isHighlight:!0,drawingMode:i}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection(n)}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>XF(e.idValue))}getItemStyle({datumIndex:t=0,datum:e,colorValue:i,sizeValue:n},s){const{properties:a,colorScale:o,sizeScale:r}=this,{colorRange:l,itemStyler:c}=a,u=a.getStyle();i!=null&&(u.stroke=this.isColorScaleValid()?o.convert(i):l?.[0]??a.stroke);const d=this.getHighlightStyle(s,t),g=Et(d,u);n!=null&&(g.strokeWidth=r.convert(n,{clamp:!0}));let f;return c!=null&&(f=this.cachedDatumCallback(XF(t,s?"highlight":"node"),()=>{const y=this.makeItemStylerParams(e,t,s,g);return this.callWithContext(c,y)})),f?Et(g,f):g}makeItemStylerParams(t,e,i,n){const{id:s}=this,a=this.ctx.highlightManager?.getActiveHighlight(),o=this.getHighlightStateString(a,i,e);return{seriesId:s,datum:t,highlightState:o,...n}}updateDatumStyles({datumSelection:t,isHighlight:e}){t.each((i,n)=>{n.style=this.getItemStyle(n,e)})}updateDatumNodes({datumSelection:t,drawingMode:e}){t.each((i,n)=>{const{projectedGeometry:s,style:a}=n;if(s==null){i.visible=!1,i.projectedGeometry=void 0;return}i.visible=!0,i.projectedGeometry=s,i.setProperties(a),i.drawingMode=e})}updatePlacedLabelData(t){this.placedLabelData=t,this.labelSelection=this.labelSelection.update(t,e=>{e.pointerEvents=j.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection()}updateLabelNodes({isHighlight:t,labelSelection:e}){const{properties:i}=this,n=this.getHighlightedDatum();e.each((s,a)=>{const{x:o,y:r,width:l,height:c,text:u,datum:d}=a,g=wpt(this,void 0,i,i.label,t,n),{color:f,fontStyle:y,fontWeight:x,fontSize:S,fontFamily:D}=g;s.visible=!0,s.x=o+l/2,s.y=r+c/2,s.text=u,s.fill=f,s.fontStyle=y,s.fontWeight=x,s.fontSize=S,s.fontFamily=D,s.textAlign="center",s.textBaseline="middle";const A=d?.datumIndex;s.fillOpacity=this.getHighlightStyle(t,A).opacity??1,s.setBoxing(g)})}updateHighlightLabelSelection(t=this.getHighlightedDatum()){const e=t?.idValue,i=e==null||!this.isLabelEnabled()?[]:this.placedLabelData.filter(n=>n.datum.idValue===e);this.highlightLabelSelection=this.highlightLabelSelection.update(i),i.length===0&&this.highlightLabelSelection.cleanup(),this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}resetAnimation(){}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum({x:t,y:e}){let i=1/0,n;return this.datumSelection.each((s,a)=>{const o=s.distanceSquared(t,e);othis.nodeFactory()),this.itemGroup.pointerEvents=QF.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setZIndex(t){return super.setZIndex(t),this.contentGroup.zIndex=[0,t,0],this.highlightGroup.zIndex=[0,t,1],!0}nodeFactory(){const t=new Rm;return t.renderMode=2,t.lineJoin="round",t.lineCap="round",t.pointerEvents=QF.None,t}processData(){const{topology:t}=this;this.topologyBounds=t?.features.reduce((e,i)=>{const n=i.geometry;return n==null?e:Pm(n,e)},void 0),t==null&&pt.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:t,topology:e,scale:i,properties:n}=this;if(e==null)return;const{stroke:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,strokeWidth:l}=n,c=[],u=[];for(const[d,g]of e.features.entries()){const{geometry:f}=g,y=f!=null&&i!=null?yp(f,i):void 0;y!=null&&c.push({series:this,datum:g,datumIndex:0,index:d,projectedGeometry:y,style:{stroke:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,strokeWidth:l}})}return{itemId:t,nodeData:c,labelData:u}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const{nodeData:e=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:e,datumSelection:t}),this.updateDatumNodes({datumSelection:t})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>zpt(e.index))}updateDatumNodes(t){const{datumSelection:e}=t;e.each((i,n)=>{const{projectedGeometry:s}=n;if(s==null){i.visible=!1,i.projectedGeometry=void 0;return}i.visible=!0,i.projectedGeometry=s,i.setProperties(n.style)})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(t){}computeFocusBounds(t){}hasItemStylers(){return!1}};H5.className="MapLineBackgroundSeries";H5.type="map-line-background";var{mapLineBackgroundSeriesThemeableOptionsDef:_pt}=j;({..._pt,type:ht(Jt("map-line-background"))});function j5(t,e,i){const n=ef(t[0],void 0);if(n==null)return;const s=(n.lon0+n.lon1)/2,a=(n.lat0+n.lat1)/2,o=Math.abs(n.lon1-n.lon0),r=Math.abs(n.lat1-n.lat0),l=bpt(t[0]),[c,u]=l,d=-WM(t,c,u);let g;const f=(N,O)=>{const R=Math.max(O-d,0);return N-.5*R},y=(N,O,L)=>{const{distance:R,maxDistance:P}=i(t,N,O,L),B=Math.hypot(c-N,u-O),F=Math.min(Math.max(c,N-L/2),N+L/2),H=Math.min(Math.max(u,O-L/2),O+L/2),$=Math.hypot(c-F,u-H),Y=f(R,B),U=f(P,$);return{distance:R,maxDistance:P,value:Y,maxValue:U,x:N,y:O,stride:L}},x=(N,O,L,R)=>{const P=y(O,L,R);P.maxDistance>=0&&N.push(P)},S=Math.min(o,r)/2;let D={value:y(s,a,S),next:null};for(;D!=null;){const N=D.value,{distance:O,value:L,maxValue:R,x:P,y:B,stride:F}=N;if(D=D.next,O>0&&(g==null||L>g.value)&&(g=N),g!=null&&R-g.value<=e)continue;const H=F/2,$=[];x($,P-H,B-H,H),x($,P+H,B-H,H),x($,P-H,B+H,H),x($,P+H,B+H,H),$.sort(JF),D=hT(D,$,JF)}if(g==null)return;const{distance:A,x:I,y:w}=g;return{x:I,y:w,distance:A}}var JF=(t,e)=>e.maxValue-t.maxValue;function d1(t,e){const i=j5(t,e,(a,o,r,l)=>{const c=-WM(a,o,r),u=c+l*Math.SQRT2;return{distance:c,maxDistance:u}});if(i==null)return;const{x:n,y:s}=i;return[n,s]}function G5(t,e){let i;switch(t.type){case"GeometryCollection":return t.geometries.flatMap(n=>G5(n,e));case"MultiPoint":return t.coordinates;case"Point":return[t.coordinates];case"MultiPolygon":{const n=YM(t);i=n==null?void 0:d1(n,e);break}case"Polygon":{const n=t.coordinates;i=n==null?void 0:d1(n,e);break}case"MultiLineString":{const n=$M(t);i=n==null?void 0:UM(n)?.point;break}case"LineString":{const n=t.coordinates;i=UM(n)?.point;break}}return i==null?[]:[i]}var{BBox:Fpt}=j;function U5(t){if(!t)return;const{range:e}=t,i=e[0][0],n=e[0][1],s=e[1][0]-i,a=e[1][1]-n,o=new Fpt(i,n,s,a);return{series:o,axis:o}}var{SeriesProperties:Hpt,makeSeriesTooltip:jpt,Label:Gpt}=j,W5=class extends Gpt{constructor(){super(...arguments),this.placement="bottom"}};M([b],W5.prototype,"placement");var Ke=class extends Hpt{constructor(){super(...arguments),this.topology=void 0,this.idKey=void 0,this.topologyIdKey="name",this.idName=void 0,this.latitudeKey=void 0,this.latitudeName=void 0,this.longitudeKey=void 0,this.longitudeName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.shape="circle",this.size=6,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new W5,this.tooltip=jpt()}getStyle(){const{size:t,shape:e,fill:i,fillOpacity:n,stroke:s,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l}=this;return{size:t,shape:e,fill:i,fillOpacity:n,opacity:1,stroke:s,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l}}};M([b],Ke.prototype,"topology");M([b],Ke.prototype,"title");M([b],Ke.prototype,"legendItemName");M([b],Ke.prototype,"idKey");M([b],Ke.prototype,"topologyIdKey");M([b],Ke.prototype,"idName");M([b],Ke.prototype,"latitudeKey");M([b],Ke.prototype,"latitudeName");M([b],Ke.prototype,"longitudeKey");M([b],Ke.prototype,"longitudeName");M([b],Ke.prototype,"labelKey");M([b],Ke.prototype,"labelName");M([b],Ke.prototype,"sizeKey");M([b],Ke.prototype,"sizeName");M([b],Ke.prototype,"colorKey");M([b],Ke.prototype,"colorName");M([b],Ke.prototype,"colorRange");M([b],Ke.prototype,"shape");M([b],Ke.prototype,"size");M([b],Ke.prototype,"maxSize");M([b],Ke.prototype,"sizeDomain");M([b],Ke.prototype,"fill");M([b],Ke.prototype,"fillOpacity");M([b],Ke.prototype,"stroke");M([b],Ke.prototype,"strokeWidth");M([b],Ke.prototype,"strokeOpacity");M([b],Ke.prototype,"lineDash");M([b],Ke.prototype,"lineDashOffset");M([b],Ke.prototype,"itemStyler");M([b],Ke.prototype,"label");M([b],Ke.prototype,"tooltip");var{fromToMotion:Upt,getMissCount:Wpt,createDatumId:IS,SeriesNodePickMode:tH,valueProperty:zd,computeMarkerFocusBounds:Kpt,ColorScale:Ypt,LinearScale:$pt,Group:Xpt,Selection:kS,Text:eH,Marker:Ew,getLabelStyles:Zpt}=j,K5=class extends uv{constructor(t){super({moduleCtx:t,categoryKey:void 0,propertyKeys:{size:["colorKey"],color:["colorKey"],label:["labelKey"]},propertyNames:{size:["sizeName"],color:["colorName"],label:["labelName"]},pickModes:[tH.EXACT_SHAPE_MATCH,tH.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new Ke,this._chartTopology=void 0,this.colorScale=new Ypt,this.sizeScale=new $pt,this.markerGroup=this.contentGroup.appendChild(new Xpt({name:"markerGroup"})),this.labelSelection=kS.select(this.labelGroup,eH,!1),this.highlightLabelSelection=kS.select(this.highlightLabelGroup,eH,!1),this.markerSelection=kS.select(this.markerGroup,Ew,!1),this.highlightMarkerSelection=kS.select(this.highlightNodeGroup,Ew),this.placedLabelData=[],this.animationState=new Rt("empty",{empty:{update:{target:"ready",action:()=>this.animateMarkers()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.resetAllAnimation(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateMarkers()},resize:{target:"ready",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){const t=this.properties.latitudeKey!=null&&this.properties.longitudeKey!=null;return super.hasData&&(this.topology!=null||t)}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setZIndex(t){return super.setZIndex(t),this.contentGroup.zIndex=[2,t],this.highlightGroup.zIndex=[3,t],!0}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}async processData(t){if(this.data==null)return;const{data:e,sizeScale:i,colorScale:n}=this,{topologyIdKey:s,idKey:a,latitudeKey:o,longitudeKey:r,sizeKey:l,colorKey:c,labelKey:u,sizeDomain:d,colorRange:g}=this.properties,f=this.buildFeatureMap(s),y=this.sizeScale.type,x=this.colorScale.type,S=this.scale?.type,D=o!=null&&r!=null,{dataModel:A,processedData:I}=await this.requestDataModel(t,e,{props:[...a==null?[]:[zd(a,S,{id:"idValue",includeProperty:!1}),zd(a,S,{id:"featureValue",includeProperty:!1,processor:()=>L=>f.get(L)})],...D?[zd(o,S,{id:"latValue"}),zd(r,S,{id:"lonValue"})]:[],...u?[zd(u,"category",{id:"labelValue"})]:[],...l?[zd(l,y,{id:"sizeValue"})]:[],...c?[zd(c,x,{id:"colorValue"})]:[]]}),w=a==null?void 0:A.resolveColumnById(this,"featureValue",I),N=D?A.resolveColumnById(this,"latValue",I):void 0,O=D?A.resolveColumnById(this,"lonValue",I):void 0;if(this.topologyBounds=I.dataSources.get(this.id)?.data.reduce((L,R,P)=>{const F=w?.[P]?.geometry;if(F!=null&&(L=Pm(F,L)),N!=null&&O!=null){const H=O[P],$=N[P];L=Tb.extend(L,H,$,H,$)}return L},void 0),l!=null){const L=A.resolveProcessedDataIndexById(this,"sizeValue"),R=I.domain.values[L]??[];i.domain=d??R}if(g!=null&&this.isColorScaleValid()){const L=A.resolveProcessedDataIndexById(this,"colorValue");n.domain=I.domain.values[L],n.range=g,n.update()}this.animationState.transition("updateData")}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const n=e.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,a=Wpt(this,i.defs.values[n].missing);return!(s===0||s===a)}getLabelDatum(t,e,i){if(e==null)return;const{idKey:n,idName:s,latitudeKey:a,latitudeName:o,longitudeKey:r,longitudeName:l,sizeKey:c,sizeName:u,colorKey:d,colorName:g,labelKey:f,labelName:y,label:x,shape:S}=this.properties;if(f==null||!x.enabled)return;const{datum:D,datumIndex:A,index:I,idValue:w,lonValue:N,latValue:O,point:L}=t,{placement:R}=x,P=this.getLabelText(e,D,f,"label",[],x,{value:e,datum:D,idKey:n,idName:s,latitudeKey:a,latitudeName:o,longitudeKey:r,longitudeName:l,sizeKey:c,sizeName:u,colorKey:d,colorName:g,labelKey:f,labelName:y});if(P==null)return;const{width:B,height:F}=i.measureLines(String(P)),H=Ew.anchor(S);return{point:{x:L.x,y:L.y,size:L.size},label:{width:B,height:F,text:P},anchor:H,placement:R,datumIndex:A,datumId:IS(I,w,N,O)}}resolveColumn(t,e,i){if(!(t==null||this.dataModel==null))return this.dataModel.resolveColumnById(this,e,i)}resolveDataColumns(t){const{idKey:e,latitudeKey:i,longitudeKey:n,sizeKey:s,colorKey:a,labelKey:o}=this.properties,r=i!=null&&n!=null;return{idValues:this.resolveColumn(e,"idValue",t),featureValues:this.resolveColumn(e,"featureValue",t),latValues:r?this.resolveColumn(i,"latValue",t):void 0,lonValues:r?this.resolveColumn(n,"lonValue",t):void 0,labelValues:this.resolveColumn(o,"labelValue",t),sizeValues:this.resolveColumn(s,"sizeValue",t),colorValues:this.resolveColumn(a,"colorValue",t)}}prepareProjectedGeometries(t,e,i){if(t==null||e==null||this.scale==null)return;const n=new Map;for(const[s]of i.dataSources.get(this.id)?.data.entries()??[]){const a=t[s],o=e[s]?.geometry,r=o==null?void 0:yp(o,this.scale);a!=null&&r!=null&&n.set(a,r)}return n}calculateMarkerSize(t){return t==null?this.properties.size:this.sizeScale.convert(t,{clamp:!0})}buildNodeDatum(t,e,i,n,s){return{series:this,datum:t,datumIndex:e,index:i,...s,point:n,midPoint:{x:n.x,y:n.y},legendItemName:this.properties.legendItemName,style:this.getMarkerItemStyle({datumIndex:e,datum:t,colorValue:s.colorValue,sizeValue:s.sizeValue},!1)}}createNodeFromLatLon(t,e,i,n,s,a,o){if(this.scale==null)throw new Error("Scale is required for createNodeFromLatLon");const[r,l]=this.scale.convert([i,n]),c={x:r,y:l,size:a},u=this.buildNodeDatum(t,e,-1,c,s),d=this.getLabelDatum(u,s.labelValue,o)??void 0;return{node:u,label:d}}createNodesFromGeometry(t,e,i,n,s,a){const o=[],r=[];for(const[l,[c,u]]of G5(i,1).entries()){const d={x:c,y:u,size:s},g=this.buildNodeDatum(t,e,l,d,n);o.push(g);const f=this.getLabelDatum(g,n.labelValue,a);f&&r.push(f)}return{nodes:o,labels:r}}warnMissingGeometries(t){if(t.length===0)return;const e=10;if(t.length>e){const i=t.length-e;t.length=e,t.push(`(+${i} more)`)}pt.warnOnce("some data items do not have matches in the provided topology",t)}buildFeatureMap(t){const e=new Map;for(const i of this.topology?.features.values()??[]){const n=i.properties?.[t];n!=null&&e.set(n,i)}return e}createNodeData(){const{id:t,dataModel:e,processedData:i,sizeScale:n,properties:s,scale:a}=this,{label:o}=s;if(e==null||i==null||a==null)return;if(!this.visible)return{itemId:t,nodeData:[],labelData:[]};const r=this.resolveDataColumns(i),l=s.maxSize??s.size;n.range=[Math.min(s.size,l),l];const c=Ve(o),u=this.prepareProjectedGeometries(r.idValues,r.featureValues,i),d=[],g=[],f=[],y=i.dataSources.get(this.id)?.data??[];for(const[x,S]of y.entries()){const D={idValue:r.idValues?.[x],lonValue:r.lonValues?.[x],latValue:r.latValues?.[x],colorValue:r.colorValues?.[x],sizeValue:r.sizeValues?.[x],labelValue:r.labelValues?.[x]},A=this.calculateMarkerSize(D.sizeValue),I=D.idValue==null?void 0:u?.get(D.idValue);if(D.idValue!=null&&u!=null&&I==null&&f.push(D.idValue),D.lonValue!=null&&D.latValue!=null){const w=this.createNodeFromLatLon(S,x,D.lonValue,D.latValue,D,A,c);d.push(w.node),w.label&&g.push(w.label)}else if(I!=null){const w=this.createNodesFromGeometry(S,x,I,D,A,c);d.push(...w.nodes),g.push(...w.labels)}}return this.warnMissingGeometries(f),{itemId:t,nodeData:d,labelData:g}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}checkScaleChange(){return this.previousScale===this.scale?!1:(this.previousScale=this.scale,!0)}update({seriesRect:t}){const e=this.checkResize(t),i=this.checkScaleChange(),{markerSelection:n,highlightMarkerSelection:s}=this,a=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const o=this.getHighlightedDatum(),r=this.contextNodeData?.nodeData??[];this.markerSelection=this.updateMarkerSelection({markerData:r,markerSelection:n}),this.updateMarkerNodes({markerSelection:n,isHighlight:!1,highlightedDatum:o,drawingMode:"overlay"}),this.highlightMarkerSelection=this.updateMarkerSelection({markerData:o==null?[]:[o],markerSelection:s}),this.updateMarkerNodes({markerSelection:s,isHighlight:!0,highlightedDatum:o,drawingMode:a}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection(o),(i||e)&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePlacedLabelData(t){this.placedLabelData=t,this.labelSelection=this.labelSelection.update(t,e=>{e.pointerEvents=j.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection()}updateLabelNodes({isHighlight:t,labelSelection:e}){const{properties:i}=this,n=this.ctx.highlightManager?.getActiveHighlight();e.each((s,a)=>{const{x:o,y:r,width:l,height:c,text:u,datum:d}=a,g=Zpt(this,void 0,i,i.label,t,n),{color:f,fontStyle:y,fontWeight:x,fontSize:S,fontFamily:D}=g;s.visible=!0,s.x=o+l/2,s.y=r+c/2,s.text=u,s.fill=f,s.fontStyle=y,s.fontWeight=x,s.fontSize=S,s.fontFamily=D,s.textAlign="center",s.textBaseline="middle";const A=d?.datumIndex;s.fillOpacity=this.getHighlightStyle(t,A).opacity??1,s.setBoxing(g)})}getHighlightedLabelId(t=this.getHighlightedDatum()){if(t!=null)return IS(t.index,t.idValue,t.lonValue,t.latValue)}updateHighlightLabelSelection(t=this.getHighlightedDatum()){const e=this.getHighlightedLabelId(t),i=e==null||!this.isLabelEnabled()?[]:this.placedLabelData.filter(n=>n.datum.datumId===e);if(this.highlightLabelSelection=this.highlightLabelSelection.update(i),i.length===0){this.highlightLabelSelection.cleanup(),this.highlightLabelGroup.visible=!1;return}this.highlightLabelGroup.visible=!0,this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}updateMarkerSelection(t){const{markerData:e,markerSelection:i}=t;return i.update(e,void 0,n=>IS(n.index,n.idValue,n.lonValue,n.latValue))}getMarkerItemStyle({datumIndex:t,datum:e,colorValue:i,sizeValue:n},s){const{properties:a,colorScale:o,sizeScale:r}=this,{colorRange:l,itemStyler:c}=a,u=this.getHighlightStyle(s,t),d=Et(u,a.getStyle());!s&&i!=null&&(d.fill=this.isColorScaleValid()?o.convert(i):l?.[0]??d.fill),n!=null&&(d.size=r.convert(n,{clamp:!0}));let g=d;if(c!=null&&t!=null){const f=this.cachedDatumCallback(IS(t,s?"highlight":"node"),()=>{const y=this.makeItemStylerParams(e,t,s,g);return this.callWithContext(c,y)});f&&(g=Et(f,d))}return g}makeItemStylerParams(t,e,i,n){const{id:s}=this,a=this.ctx.highlightManager?.getActiveHighlight(),o=this.getHighlightStateString(a,i,e),r=this.filterItemStylerFillParams(n.fill)??n.fill;return{seriesId:s,datum:t,highlightState:o,...n,fill:r}}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i,highlightedDatum:n,drawingMode:s}=t,a=U5(this.scale);e.each((o,r)=>{const{datum:l,point:c}=r,u=this.getMarkerItemStyle(r,i);o.shape=u.shape,o.size=u.size,o.setStyleProperties(u,a),o.x=c.x,o.y=c.y,o.scalingCenterX=c.x,o.scalingCenterY=c.y,o.zIndex=!i&&n!=null&&l===n.datum?1:0,o.drawingMode=s})}isProcessedDataAnimatable(){return!0}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.ctx.animationManager.skipCurrentBatch(),this.labelSelection.cleanup(),this.markerSelection.cleanup(),this.highlightMarkerSelection.cleanup(),this.highlightLabelSelection.cleanup(),this.highlightLabelGroup.visible=!1,this.placedLabelData=[]}animateMarkers(){const{animationManager:t}=this.ctx,e=Dpt();Upt(this.id,"markers",t,[this.markerSelection,this.highlightMarkerSelection],e)}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum(t){const{x:e,y:i}=t;let n=1/0,s;for(const a of this.contextNodeData?.nodeData??[]){const{x:o,y:r,size:l}=a.point,c=Math.max(Math.abs(o-e)-l,0),u=Math.max(Math.abs(r-i)-l,0),d=c*c+u*u;d=0?"N":"S"}, ${Math.abs(H).toFixed(4)}° ${H>=0?"W":"E"}`}const B=this.getMarkerItemStyle({datumIndex:t,datum:N,colorValue:L,sizeValue:O},!1);return this.formatTooltipWithContext(w,{heading:P,title:A??I,symbol:this.legendItemSymbol(t),data:R},{seriesId:e,datum:N,title:A,idKey:o,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:u,longitudeName:d,colorKey:g,colorName:f,sizeKey:y,sizeName:x,labelKey:S,labelName:D,...B})}getFormattedMarkerStyle(t){const e=this.getMarkerItemStyle(t,!1);return{size:e.size,shape:e.shape}}computeFocusBounds(t){return Kpt(this,t)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};K5.className="MapMarkerSeries";K5.type="map-marker";var{mapMarkerSeriesThemeableOptionsDef:qpt}=j;({...At(_e,["highlightStyle","highlight"]),...qpt,type:ht(Jt("map-marker"))});Sl({$applySwitch:[{$path:"type"},{$mapPalette:"fill"},["gradient",Sp],["image",$s],["pattern",Cs]]}),Sl(xx),{...Oe},Sl(Bc);function Qpt(t,{aspectRatio:e,precision:i}){const n=j5(t,i,(l,c,u,d)=>{const g=tgt(l,c,u,e),f=g+2*d*e,y=g*Math.SQRT2,x=f*Math.SQRT2;return{distance:y,maxDistance:x}});if(n==null)return;const{x:s,y:a,distance:o}=n,r=o/Math.SQRT2;return{x:s,y:a,maxWidth:r}}function Jpt(t,e,i,n,s){const[a,o]=t,[r,l]=e,c=1/s,u=r-a,d=l-o,[g,f]=o<=l?t:e,[y,x]=a<=r?t:e,[S,D]=o<=l?e:t,[A,I]=a<=r?e:t;let w=1/0;if(u===0)for(let B=0;B<=1;B+=1){const H=(B===0?c:-c)*(a-i)+n;if(H>=f&&H<=D){const Y=Math.abs(n-H)*2*s;w=Math.min(w,Y)}}else{const B=d/u;for(let F=0;F<=1;F+=1){const H=F===0?c:-c,$=(B*a-o-H*i+n)/(B-H);if($>=y&&$<=A){const Y=Math.abs(i-$)*2;w=Math.min(w,Y)}}}const N=s,O=Math.abs((g-i)/(f-n)),L=Math.abs((S-i)/(D-n));if(Dn&&Oi&&Ri!=c>i&&e<(l-d)*(i-g)/(c-g)+d&&(s=!s);const f=Jpt(r,u,e,i,n);a=Math.min(a,f),r=u,l=d,c=g}}return(s?1:-1)*a}function CS(t,e,i){i>=e&&(t.maxX=Math.min(t.maxX,i-e)),i<=e&&(t.minX=Math.max(t.minX,i-e))}function egt(t,e,i,n,s,a){const o=s-a/2,r=s+a/2,[l,c]=e,[u,d]=i,g=u-l,f=d-c,[y,x]=l<=u?e:i,[S,D]=l<=u?i:e;if(g!==0){const A=f/g;for(let I=0;I<=1;I+=1){const N=((I===0?o:r)-c)/A+l;N>=y&&N<=S&&CS(t,n,N)}}else Math.max(o,Math.min(c,d))<=Math.min(r,Math.max(c,d))&&CS(t,n,l);return S=o&&D<=r?CS(t,n,S):y>n&&x>=o&&x<=r&&CS(t,n,y),t}function igt(t,e,i,n){const s={minX:-1/0,maxX:1/0};for(const r of t){let l=r.at(-1);for(const c of r)egt(s,l,c,e,i,n),l=c}const{minX:a,maxX:o}=s;return Number.isFinite(a)&&Number.isFinite(o)?{x:e+(a+o)/2,width:o-a}:{x:e,width:0}}var{SeriesProperties:ngt,makeSeriesTooltip:sgt}=j,Ji=class extends ngt{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.idName=void 0,this.topologyIdKey="name",this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.padding=0,this.label=new PA,this.tooltip=sgt()}getStyle(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o}=this;return{fill:t,fillOpacity:e,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,opacity:1}}};M([b],Ji.prototype,"topology");M([b],Ji.prototype,"title");M([b],Ji.prototype,"legendItemName");M([b],Ji.prototype,"idKey");M([b],Ji.prototype,"idName");M([b],Ji.prototype,"topologyIdKey");M([b],Ji.prototype,"labelKey");M([b],Ji.prototype,"labelName");M([b],Ji.prototype,"colorKey");M([b],Ji.prototype,"colorName");M([b],Ji.prototype,"colorRange");M([b],Ji.prototype,"fill");M([b],Ji.prototype,"fillOpacity");M([b],Ji.prototype,"stroke");M([b],Ji.prototype,"strokeOpacity");M([b],Ji.prototype,"strokeWidth");M([b],Ji.prototype,"lineDash");M([b],Ji.prototype,"lineDashOffset");M([b],Ji.prototype,"padding");M([b],Ji.prototype,"itemStyler");M([b],Ji.prototype,"label");M([b],Ji.prototype,"tooltip");var{getMissCount:agt,createDatumId:wS,SeriesNodePickMode:iH,valueProperty:NS,ColorScale:ogt,Group:nH,Selection:TS,Text:sH,PointerEvents:rgt,getLabelStyles:lgt}=j,aH=j.MercatorScale.fixedScale(),Y5=class extends uv{constructor(t){super({moduleCtx:t,categoryKey:void 0,propertyKeys:{color:["colorKey"],label:["labelKey"]},propertyNames:{color:["colorName"],label:["labelName"]},pickModes:[iH.EXACT_SHAPE_MATCH,iH.NEAREST_NODE]}),this.properties=new Ji,this._chartTopology=void 0,this.colorScale=new ogt,this.itemGroup=this.contentGroup.appendChild(new nH({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new nH({name:"itemLabelGroup"})),this.datumSelection=TS.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=TS.select(this.itemLabelGroup,sH),this.highlightDatumSelection=TS.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=TS.select(this.highlightLabelGroup,sH),this.previousLabelLayouts=void 0,this._previousDatumMidPoint=void 0,this.itemLabelGroup.pointerEvents=rgt.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&this.topology!=null}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setZIndex(t){return super.setZIndex(t),this.contentGroup.zIndex=[1,t],this.highlightGroup.zIndex=[4,t],!0}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const t=new Rm;return t.renderMode=1,t.lineJoin="round",t}async processData(t){if(this.data==null)return;const{data:e,topology:i,colorScale:n}=this,{topologyIdKey:s,idKey:a,colorKey:o,labelKey:r,colorRange:l}=this.properties,c=new Map;for(const x of i?.features.values()??[]){const S=x.properties?.[s];S==null||!JO(x.geometry,1)||c.set(S,x)}const u=this.colorScale.type,d=this.scale?.type,{dataModel:g,processedData:f}=await this.requestDataModel(t,e,{props:[NS(a,d,{id:"idValue",includeProperty:!1}),NS(a,d,{id:"featureValue",includeProperty:!1,processor:()=>x=>c.get(x)}),...r?[NS(r,"category",{id:"labelValue"})]:[],...o?[NS(o,u,{id:"colorValue"})]:[]]}),y=g.resolveColumnById(this,"featureValue",f);if(this.topologyBounds=y.reduce((x,S)=>{const D=S?.geometry;return D==null?x:Pm(D,x)},void 0),l!=null&&this.isColorScaleValid()){const x=g.resolveProcessedDataIndexById(this,"colorValue");n.domain=f.domain.values[x],n.range=l,n.update()}i==null&&pt.warnOnce("no topology was provided for [MapShapeSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const n=e.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,a=agt(this,i.defs.values[n].missing);return!(s===0||s===a)}getLabelLayout(t,e,i,n,s){if(e==null||n==null)return;const{idKey:a,idName:o,colorKey:r,colorName:l,labelKey:c,labelName:u,padding:d,label:g}=this.properties;if(c==null||!g.enabled)return;const f=this.getLabelText(e,t,c,"label",[],g,{value:e,datum:t,idKey:a,idName:o,colorKey:r,colorName:l,labelKey:c,labelName:u});if(f==null)return;const y=qt(f)?Va(f,g):i.measureLines(String(f)),x=(y.width+2*d)/(y.height+2*d);if(s?.geometry===n&&s?.labelText===f&&s?.aspectRatio===x)return s;const S=yp(n,aH),D=YM(S);if(D==null)return;const A=Qpt(D,{aspectRatio:x,precision:.001});if(A==null)return;const{x:I,y:w,maxWidth:N}=A;return{geometry:n,labelText:f,aspectRatio:x,x:I,y:w,maxWidth:N,fixedPolygon:D}}getLabelDatum(t,e,i,n){const{scale:s}=this;if(s==null)return;const{padding:a,label:o}=this.properties,{labelText:r,aspectRatio:l,x:c,y:u,maxWidth:d,fixedPolygon:g}=t,f={width:Math.ceil(d*e),height:Math.ceil(d*e/l),meta:c},y=rx(ce(r),o,{padding:a},(O,L)=>{if(!L)return f;const R=igt(g,c,u,O/e);return{width:R.width*e,height:O,meta:R.x}});if(y==null)return;const[{text:x,fontSize:S,lineHeight:D,width:A},I]=y,w=Ae){const i=t.length-e;t.length=e,t.push(`(+${i} more)`)}pt.warnOnce("some data items do not have matches in the provided topology",t)}createNodeData(){const{id:t,dataModel:e,processedData:i,properties:n,scale:s,previousLabelLayouts:a}=this,{label:o,legendItemName:r,colorKey:l}=n;if(e==null||i==null)return;if(!this.visible)return{itemId:t,nodeData:[],labelData:[]};const c=s==null?Number.NaN:(s.range[1][0]-s.range[0][0])/s.bounds.width,u=this.resolveShapeDataColumns(i),d=Ve(o),g=new Map;this.previousLabelLayouts=g;const f=[],y=[],x=[],S=i.dataSources.get(this.id)?.data??[];for(const[D,A]of S.entries()){const I={idValue:u.idValues[D],colorValue:u.colorValues?.[D],labelValue:u.labelValues?.[D]},w=u.featureValues[D]?.geometry??void 0;if(w==null&&x.push(I.idValue),l!=null&&I.colorValue==null)continue;const N=this.getLabelLayout(A,I.labelValue,d,w,a?.get(I.idValue));N!=null&&g.set(I.idValue,N);const O=N!=null&&s!=null?this.getLabelDatum(N,c,D,I.idValue):void 0;O!=null&&y.push(O);const L=w!=null&&s!=null?yp(w,s):void 0;f.push({series:this,datum:A,datumIndex:D,...I,projectedGeometry:L,legendItemName:r,style:this.getItemStyle({datum:A,datumIndex:D,colorValue:I.colorValue},!1)})}return this.warnMissingGeometries(x),{itemId:t,nodeData:f,labelData:y}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t,labelSelection:e,highlightDatumSelection:i}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const n=this.ctx.chartService.highlight?.drawingMode??"overlay",s=this.getHighlightedDatum(),a=this.contextNodeData?.nodeData??[],o=this.contextNodeData?.labelData??[];this.datumSelection=this.updateDatumSelection({nodeData:a,datumSelection:t}),this.updateDatumStyles({datumSelection:t,isHighlight:!1}),this.updateDatumNodes({datumSelection:t,drawingMode:"overlay"}),this.labelSelection=this.updateLabelSelection({labelData:o,labelSelection:e});const r=this.getHighlightLabelData(o,s);this.highlightLabelSelection=this.updateLabelSelection({labelData:r,labelSelection:this.highlightLabelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:s==null?[]:[s],datumSelection:i}),this.updateDatumStyles({datumSelection:i,isHighlight:!0}),this.updateDatumNodes({datumSelection:i,drawingMode:n})}getHighlightLabelData(t,e){if(t.length===0)return[];const i=wS(e?.idValue);return t.filter(n=>n.datumId===i&&n.datumIndex===e?.datumIndex)}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>wS(e.idValue))}getItemStyle({datumIndex:t,datum:e,colorValue:i},n){const{properties:s,colorScale:a}=this,{colorRange:o,itemStyler:r}=s,l=s.getStyle();if(i!=null){const d=this.isColorScaleValid()?a.convert(i):o?.[0];d!=null&&(l.fill=d)}const c=this.getHighlightStyle(n,t);let u=Et(c,l);if(r!=null&&t!=null){const d=this.cachedDatumCallback(wS(t,n?"highlight":"node"),()=>{const g=this.makeItemStylerParams(e,t,n,u);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(r,g))});d&&(u=Et(d,u))}return u}makeItemStylerParams(t,e,i,n){const{id:s}=this,a=this.ctx.highlightManager?.getActiveHighlight(),o=this.getHighlightStateString(a,i,e),r=this.filterItemStylerFillParams(n.fill)??n.fill;return{seriesId:s,datum:t,highlightState:o,...n,fill:r}}updateDatumStyles({datumSelection:t,isHighlight:e}){t.each((i,n)=>{n.style=this.getItemStyle(n,e)})}updateDatumNodes({datumSelection:t,drawingMode:e}){const i=U5(this.scale);t.each((n,s)=>{const{projectedGeometry:a}=s;if(a==null){n.visible=!1,n.projectedGeometry=void 0;return}n.visible=!0,n.projectedGeometry=a,n.setStyleProperties(s.style,i),n.drawingMode=e})}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes({isHighlight:t,labelSelection:e}){const{properties:i}=this,n=this.ctx.highlightManager?.getActiveHighlight();e.each((s,a)=>{const{x:o,y:r,text:l,fontSize:c,lineHeight:u,datumIndex:d}=a,g=lgt(this,void 0,i,i.label,t,n),{color:f,fontStyle:y,fontWeight:x,fontFamily:S}=g;s.visible=!0,s.x=o,s.y=r,s.text=l,s.fill=f,s.fontStyle=y,s.fontWeight=x,s.fontSize=c,s.lineHeight=u,s.fontFamily=S,s.textAlign="center",s.textBaseline="middle",s.fillOpacity=this.getHighlightStyle(t,d).opacity??1,s.setBoxing(g)})}resetAnimation(){}pickNodeClosestDatum({x:t,y:e}){let i=1/0,n;return this.datumSelection.each((s,a)=>{const o=s.distanceSquared(t,e);othis.nodeFactory()),this.itemGroup.pointerEvents=oH.None}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}getNodeData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setZIndex(t){return super.setZIndex(t),this.contentGroup.zIndex=[0,t,0],this.highlightGroup.zIndex=[0,t,1],!0}nodeFactory(){const t=new Rm;return t.renderMode=1,t.lineJoin="round",t.pointerEvents=oH.None,t}processData(){const{topology:t}=this;this.topologyBounds=t?.features.reduce((e,i)=>{const n=i.geometry;return n==null?e:Pm(n,e)},void 0),t==null&&pt.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:t,topology:e,scale:i,properties:n}=this;if(e==null)return;const{fill:s,fillOpacity:a,stroke:o,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:u}=n,d=[],g=[];for(const[f,y]of e.features.entries()){const{geometry:x}=y,S=x!=null&&i!=null?yp(x,i):void 0;S!=null&&d.push({series:this,datum:y,datumIndex:0,index:f,projectedGeometry:S,style:{fill:s,fillOpacity:a,stroke:o,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:u}})}return{itemId:t,nodeData:d,labelData:g}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const{nodeData:e=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:e,datumSelection:t}),this.updateDatumNodes({datumSelection:t})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>dgt(e.index))}updateDatumNodes(t){const{datumSelection:e}=t;e.each((i,n)=>{const{projectedGeometry:s}=n;if(s==null){i.visible=!1,i.projectedGeometry=void 0;return}i.visible=!0,i.projectedGeometry=s,i.setProperties(n.style)})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(t){}pickFocus(){}computeFocusBounds(t){}hasItemStylers(){return!1}};$5.className="MapShapeBackgroundSeries";$5.type="map-shape-background";var{mapShapeBackgroundSeriesThemeableOptionsDef:fgt}=j;({...fgt,..._e,type:ht(Jt("map-shape-background"))});Sl({$applySwitch:[{$path:"type"},{$path:["/1",{$mapPalette:"fill"},{$mapPalette:"hierarchyColors"}]},["gradient",$4],["image",$s],["pattern",Z4]]});var{createDatumId:mgt,toHighlightString:ygt}=j;function bgt(t,e){const{id:i}=t,{angleKey:n,cornerRadius:s,fill:a,fillOpacity:o,lineDash:r,lineDashOffset:l,radiusKey:c,stackGroup:u,stroke:d,strokeOpacity:g,strokeWidth:f}=t.properties,y=ygt(e??j.HighlightState.None);return{angleKey:n,cornerRadius:s,fill:a,fillOpacity:o,highlightState:y,lineDash:r,lineDashOffset:l,radiusKey:c,seriesId:i,stackGroup:u,stroke:d,strokeOpacity:g,strokeWidth:f}}function tE(t,e,i){const{styler:n}=t.properties;let s={};if(!e&&n){const a=bgt(t,i);s=t.ctx.optionsGraphService.resolvePartial(["series",`${t.declarationOrder}`],t.cachedCallWithContext(n,a)??{},{pick:!1})??{}}return{cornerRadius:s.cornerRadius??t.properties.cornerRadius,fill:s.fill??t.properties.fill,fillOpacity:s.fillOpacity??t.properties.fillOpacity,lineDash:s.lineDash??t.properties.lineDash,lineDashOffset:s.lineDashOffset??t.properties.lineDashOffset,stroke:s.stroke??t.properties.stroke,strokeOpacity:s.strokeOpacity??t.properties.strokeOpacity,strokeWidth:s.strokeWidth??t.properties.strokeWidth,opacity:1}}function xgt(t,e,i,n){const{id:s,properties:a}=t,{angleKey:o,radiusKey:r}=a,l=t.ctx.highlightManager?.getActiveHighlight(),c=t.getHighlightStateString(l,i,e.datumIndex),u=t.filterItemStylerFillParams(n.fill)??n.fill;return{seriesId:s,datum:e.datum,highlightState:c,angleKey:o,radiusKey:r,...n,fill:u}}function gf(t,e,i,n){const{properties:s}=t,{itemStyler:a}=s,o=t.getHighlightStyle(i,e?.datumIndex,n);let l=Et(o,tE(t,e===void 0,n));if(a!=null&&e!=null){const c=t.cachedDatumCallback(mgt(t.getDatumId(e),i?"highlight":"node"),()=>{const u=xgt(t,e,i,l);return t.callWithContext(a,u)});c&&(l=Et(c,l))}return l}var{DEFAULT_POLAR_DIRECTION_KEYS:vgt,DEFAULT_POLAR_DIRECTION_NAMES:Sgt,PolarAxis:Mgt,diff:Dgt,fixNumericExtent:Agt,groupAccumulativeValueProperty:rH,keyProperty:Igt,normaliseGroupTo:kgt,resetLabelFn:Cgt,seriesLabelFadeInAnimation:wgt,seriesLabelFadeOutAnimation:Ngt,valueProperty:Tgt,animationValidation:Lgt,createDatumId:Ogt,SeriesNodePickMode:lH,CategoryScale:Egt,motion:cH,updateLabelNode:hH,getItemStyles:Rgt}=j,Pgt=class extends j.SeriesNodeEvent{constructor(t,e,i,n){super(t,e,i,n),this.angleKey=n.properties.angleKey,this.radiusKey=n.properties.radiusKey}},X5=class extends j.PolarSeries{constructor(t,{animationResetFns:e}){super({moduleCtx:t,categoryKey:"angleValue",propertyKeys:vgt,propertyNames:Sgt,canHaveAxes:!0,pickModes:[lH.NEAREST_NODE,lH.EXACT_SHAPE_MATCH],animationResetFns:{...e,label:Cgt}}),this.NodeEvent=Pgt,this.groupScale=new Egt,this.circleCache={r:0,cx:0,cy:0}}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return{domain:[]};if(t===z.Angle)return e.getDomain(this,"angleValue","key",i);{const n=e.getDomain(this,"radiusValue-end","value",i).domain,s=Number.isFinite(n[1]-n[0])?[Math.min(n[0],0),Math.max(n[1],0)]:[];return{domain:Agt(s)}}}async processData(t){const{angleKey:e,radiusKey:i,normalizedTo:n}=this.properties,s=!this.ctx.animationManager.isSkipped(),a=this.getStackId(),o=`${a}-trailing`,r=[];go(n)&&r.push(kgt([a,o],Math.abs(n))),this.needsDataModelDiff()&&this.processedData&&r.push(Dgt(this.id,this.processedData)),s&&r.push(Lgt());const l=this.visible?{}:{forceValue:0},c=this.axes[z.Radius]?.scale.type,u=this.axes[z.Angle]?.scale.type,d=this.properties.allowNullKeys??!1;await this.requestDataModel(t,this.data,{props:[Igt(e,u,{id:"angleValue",allowNullKey:d}),Tgt(i,c,{id:"radiusValue-raw",invalidValue:null,...l}),...rH(i,"normal",{id:"radiusValue-end",rangeId:"radiusValue-range",invalidValue:null,groupId:a,separateNegative:!0,...l},c),...rH(i,"trailing",{id:"radiusValue-start",invalidValue:null,groupId:o,separateNegative:!0,...l},c),...r],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,n=this.circleCache;return t!==n.r||e!==n.cx||i!==n.cy?(this.circleCache={r:t,cx:e,cy:i},!0):!1}isRadiusAxisReversed(){return this.axes[z.Radius]?.isReversed()}maybeRefreshNodeData(){!this.didCircleChange()&&!this.nodeDataRefresh||(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}getAxisInnerRadius(){const t=this.axes[z.Radius];return t instanceof Mgt?this.radius*t.innerRadiusRatio:0}createNodeData(){const{processedData:t,dataModel:e,groupScale:i}=this;if(!e||t?.type!=="grouped")return;const n=this.axes[z.Angle],s=this.axes[z.Radius],a=n?.scale,o=s?.scale;if(!a||!o)return;const r=e.resolveKeysById(this,"angleValue",t),l=e.resolveColumnById(this,"radiusValue-start",t),c=e.resolveColumnById(this,"radiusValue-end",t),u=e.resolveColumnById(this,"radiusValue-raw",t);let d=0,g=0;n instanceof bm&&(d=n.groupPaddingInner,g=n.paddingInner);const y=(a.bandwidth??0)*(1-g),{index:x,visibleGroupCount:S}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);i.domain=Array.from({length:S}).map((W,q)=>String(q)),i.range=[-y/2,y/2],i.paddingInner=S>1?d:0;const D=this.isRadiusAxisReversed(),A=this.getAxisInnerRadius(),I=this.radius,w=I+A,{angleKey:N,radiusKey:O,angleName:L,radiusName:R,legendItemName:P,label:B}=this.properties,F=this.getSeriesDomain(z.Radius).domain,H=(W,q,nt,G)=>{const et=this.getLabelText(q,W,O,"radius",F,B,{value:q,datum:W,angleKey:N,radiusKey:O,angleName:L,radiusName:R,legendItemName:P});if(et)return{x:nt,y:G,text:et,textAlign:"center",textBaseline:"middle"}},$=[],Y=Rgt((W,q,nt)=>gf(this,W,q,nt)),U={itemId:O,nodeData:$,labelData:$,styles:Y};if(!this.visible)return U;const{dataSources:V}=t,Z=V.get(this.id)?.data??[];for(const{datumIndex:W}of e.forEachGroupDatum(this,t)){const q=Z[W],nt=r[W];if(nt===void 0&&!this.properties.allowNullKeys)return;const G=u[W],et=G>=0&&!Object.is(G,-0),st=l[W],lt=c[W],mt=et===D;if(st===void 0||lt===void 0)return;let Dt,kt,Vt;if(Z.length===1)Dt=-.5*Math.PI,kt=1.5*Math.PI,Vt=Dt;else{const oe=a.convert(nt);Dt=ze(oe+i.convert(String(x))),kt=ze(Dt+i.bandwidth),Vt=Dt+i.bandwidth/2}const Kt=w-o.convert(st),ae=w-o.convert(lt),ne=(Kt+ae)/2,Qt=Math.cos(Vt)*ne,zt=Math.sin(Vt)*ne,Pt=this.properties.label.enabled?H(q,G,Qt,zt):void 0,ue=this.getColumnWidth(Dt,kt);$.push({series:this,datum:q,datumIndex:W,point:{x:Qt,y:zt,size:0},midPoint:{x:Qt,y:zt},label:Pt,angleValue:nt,radiusValue:G,negative:mt,innerRadius:Kt,outerRadius:ae,stackInnerRadius:Kt,stackOuterRadius:ae,startAngle:Dt,endAngle:kt,midAngle:Vt,axisInnerRadius:A,axisOuterRadius:I,columnWidth:ue,index:W})}return{itemId:O,nodeData:$,labelData:$,styles:Y}}getColumnWidth(t,e){return Number.NaN}update({seriesRect:t}){const e=this.checkResize(t);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),e&&this.animationState.transition("resize"),this.animationState.transition("update")}updateSectorSelection(t,e){const{contextNodeData:i}=this;if(!i)return;const n=this.ctx.highlightManager.getActiveHighlight();let s=[];const a=this.ctx.highlightManager?.getActiveHighlight();e?a?.datum&&a.series===this&&s.push(a):s=this.nodeData;const o=this.isRadiusAxisReversed(),r=o?this.radius:this.getAxisInnerRadius(),l=o?this.getAxisInnerRadius():this.radius,c=this.getShapeFillBBox(),u=this.hasItemStylers();t.update(s,void 0,d=>this.getDatumId(d)).each((d,g)=>{const{midPoint:f}=g;if(u){const A=this.getHighlightState(a,e,g.datumIndex);g.style=gf(this,g,e,A)}const y=g.style??i.styles[this.getHighlightState(n,e,g.datumIndex)],x=y.fill,D=an(x)&&x.bounds==="item"?{centerX:f?.x??0,centerY:f?.y??0}:{centerX:0,centerY:0,innerRadius:r,outerRadius:l};this.updateItemPath(d,g,e),d.setStyleProperties(y,c,D),d.cornerRadius=y.cornerRadius??0,d.lineJoin="round"})}updateLabels(){const t=this.ctx.highlightManager?.getActiveHighlight(),e=t?.series===this&&t?.datum?t:void 0,i=e?[e]:[];this.labelSelection.update(this.nodeData).each((n,s)=>{hH(this,n,this.properties,this.properties.label,s.label,!1,t),n.fillOpacity=this.getHighlightStyle(!1,s.datumIndex).opacity??1}),this.highlightLabelSelection.update(i,void 0,n=>this.getDatumId(n)).each((n,s)=>{hH(this,n,this.properties,this.properties.label,s.label,!0,t),n.fillOpacity=this.getHighlightStyle(!0,s.datumIndex).opacity??1})}animateEmptyUpdateReady(){const{labelSelection:t}=this,e=this.getColumnTransitionFunctions();cH.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],e),wgt(this,"labels",this.ctx.animationManager,t,this.highlightLabelSelection)}animateClearingUpdateEmpty(){const{itemSelection:t}=this,{animationManager:e}=this.ctx,i=this.getColumnTransitionFunctions();cH.fromToMotion(this.id,"datums",e,[t],i),Ngt(this,"labels",e,this.labelSelection,this.highlightLabelSelection)}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,axes:s,properties:a}=this,{angleKey:o,angleName:r,radiusKey:l,radiusName:c,legendItemName:u,tooltip:d}=a,g=s[z.Angle],f=s[z.Radius],y=this.nodeData?.[t];if(!i||!n||!g||!f||!y)return;const x=n.dataSources.get(this.id)?.data[t],S=i.resolveKeysById(this,"angleValue",n)[t],D=i.resolveColumnById(this,"radiusValue-raw",n)[t];if(S===void 0&&!this.properties.allowNullKeys)return;const A=gf(this,y,!1);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(g,"tooltip",S,x,o,void 0),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(f,"tooltip",D,x,l,void 0),missing:j.isTooltipValueMissing(D)}]},{seriesId:e,datum:x,title:r,angleKey:o,angleName:r,radiusKey:l,radiusName:c,legendItemName:u,...A})}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.itemSelection.nodes())}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:n,strokeWidth:s,lineDash:a,lineDashOffset:o}=tE(this,!1,j.HighlightState.None),r={fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:n,strokeWidth:s,lineDash:a,lineDashOffset:o};return an(r.fill)&&(r.fill={...r.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:r}}getLegendData(t){if(t!=="category")return[];const{id:e,visible:i}=this,{radiusKey:n,radiusName:s,legendItemName:a,showInLegend:o}=this.properties;return[{legendType:"category",id:e,itemId:n,seriesId:e,enabled:i,label:{text:a??s??n},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!o}]}getDatumId(t){return Ogt(t.angleValue)}computeLabelsBBox(){return null}},{SeriesProperties:zgt,makeSeriesTooltip:Bgt,Label:Vgt}=j,Hi=class extends zgt{constructor(){super(...arguments),this.angleKeyAxis="angle",this.radiusKeyAxis="radius",this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new Vgt,this.tooltip=Bgt()}getStyle(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,cornerRadius:r}=this;return{fill:t,fillOpacity:e,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,cornerRadius:r,opacity:1}}};M([b],Hi.prototype,"angleKey");M([b],Hi.prototype,"angleName");M([b],Hi.prototype,"radiusKey");M([b],Hi.prototype,"radiusName");M([b],Hi.prototype,"angleKeyAxis");M([b],Hi.prototype,"radiusKeyAxis");M([b],Hi.prototype,"legendItemName");M([b],Hi.prototype,"fill");M([b],Hi.prototype,"fillOpacity");M([b],Hi.prototype,"stroke");M([b],Hi.prototype,"strokeWidth");M([b],Hi.prototype,"strokeOpacity");M([b],Hi.prototype,"lineDash");M([b],Hi.prototype,"lineDashOffset");M([b],Hi.prototype,"cornerRadius");M([b],Hi.prototype,"styler");M([b],Hi.prototype,"itemStyler");M([b],Hi.prototype,"rotation");M([b],Hi.prototype,"stackGroup");M([b],Hi.prototype,"normalizedTo");M([b],Hi.prototype,"label");M([b],Hi.prototype,"tooltip");var{motion:_gt}=j;function Z5(){const t={startAngle:new Map,endAngle:new Map},e=["startAngle","endAngle"],i=(o,r,l)=>{for(const c of e){const u=t[c];let d=(l==="removed"||l==="updated"?o:r)[c],g=(l==="removed"?o:r)[c];Number.isNaN(g)&&(g=o.previousDatum?.[c]??Number.NaN);const f=d-g;Math.abs(f)>Math.PI&&(d-=Math.sign(f)*2*Math.PI),u.set(r,{from:d,to:g})}},n=(o,r)=>({startAngle:t.startAngle.get(o)[r],endAngle:t.endAngle.get(o)[r]});return{calculate:i,from:o=>n(o,"from"),to:o=>n(o,"to")}}function q5(t,e,i){if(i==="updated"){if(t.previousDatum==null||Number.isNaN(t.previousDatum.startAngle)||Number.isNaN(t.previousDatum.endAngle))return"added";if(Number.isNaN(e.startAngle)||Number.isNaN(e.endAngle))return"removed"}return i==="added"&&t.previousDatum!=null?"updated":i}function Fgt(t){const e=Z5();return{toFn:(s,a,o)=>{const{startAngle:r,endAngle:l}=e.to(a);let c,u,d,g,f;return o==="removed"?(c=s.innerRadius,u=s.innerRadius,d=s.columnWidth,g=s.axisInnerRadius,f=s.axisOuterRadius):(c=Number.isNaN(a.innerRadius)?t:a.innerRadius,u=Number.isNaN(a.outerRadius)?t:a.outerRadius,d=Number.isNaN(a.columnWidth)?s.columnWidth:a.columnWidth,g=a.axisInnerRadius,f=a.axisOuterRadius),{innerRadius:c,outerRadius:u,columnWidth:d,axisInnerRadius:g,axisOuterRadius:f,startAngle:r,endAngle:l}},fromFn:(s,a,o)=>{o=q5(s,a,o),e.calculate(s,a,o);const{startAngle:r,endAngle:l}=e.from(a);let c,u,d,g,f;o==="removed"||o==="updated"?(c=s.innerRadius,u=s.outerRadius,d=s.columnWidth,g=s.axisInnerRadius,f=s.axisOuterRadius):(c=t,u=t,d=a.columnWidth,g=a.axisInnerRadius,f=a.axisOuterRadius);const y=_gt.NODE_UPDATE_STATE_TO_PHASE_MAPPING[o];return{innerRadius:c,outerRadius:u,columnWidth:d,axisInnerRadius:g,axisOuterRadius:f,startAngle:r,endAngle:l,phase:y}}}}function Hgt(t,{innerRadius:e,outerRadius:i,columnWidth:n,axisInnerRadius:s,axisOuterRadius:a,startAngle:o,endAngle:r}){return{innerRadius:e,outerRadius:i,columnWidth:n,axisInnerRadius:s,axisOuterRadius:a,startAngle:o,endAngle:r}}var{SectorBox:QS,motion:jgt}=j;function eE(t){const{negative:e,innerRadius:i,outerRadius:n,stackInnerRadius:s,stackOuterRadius:a}=t;return{innerRadius:e?a:s,outerRadius:e?s:a,clipInnerRadius:e?n:i,clipOuterRadius:e?i:n}}function Ggt(t){const e=Z5();return{toFn:(s,a,o)=>{const{startAngle:r,endAngle:l}=e.to(a);let c,u,d;if(o==="removed")c=t,u=t,d=new QS(r,l,c,u);else{let g,f;({innerRadius:c,outerRadius:u,clipInnerRadius:g,clipOuterRadius:f}=eE(a)),Number.isNaN(c)&&(c=t),Number.isNaN(u)&&(u=t),Number.isNaN(g)&&(g=t),Number.isNaN(f)&&(f=t),d=new QS(r,l,g,f)}return{innerRadius:c,outerRadius:u,startAngle:r,endAngle:l,clipSector:d}},fromFn:(s,a,o)=>{o=q5(s,a,o),e.calculate(s,a,o);const{startAngle:r,endAngle:l}=e.from(a);let c,u,d;o==="removed"||o==="updated"?(c=s.innerRadius,u=s.outerRadius,d=s.clipSector):(c=t,u=t),d??(d=new QS(r,l,c,u));const g=jgt.NODE_UPDATE_STATE_TO_PHASE_MAPPING[o];return{innerRadius:c,outerRadius:u,startAngle:r,endAngle:l,clipSector:d,phase:g}}}}function Ugt(t,e){const{startAngle:i,endAngle:n}=e,{innerRadius:s,outerRadius:a,clipInnerRadius:o,clipOuterRadius:r}=eE(e),l=new QS(i,n,o,r);return{innerRadius:s,outerRadius:a,startAngle:i,endAngle:n,clipSector:l}}var{Sector:Wgt,SectorBox:Kgt}=j,Q5=class extends X5{constructor(t){super(t,{animationResetFns:{item:Ugt}}),this.properties=new Hi}setZIndex(t){return super.setZIndex(t),this.contentGroup.zIndex=[0,gl.FOREGROUND,t],this.highlightGroup.zIndex=[0,gl.HIGHLIGHT,t],this.labelGroup.zIndex=[0,gl.LABEL,t],!0}getStackId(){return`nightingale-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new Wgt}updateItemPath(t,e,i){const{negative:n}=e;if(t.centerX=0,t.centerY=0,t.startOuterCornerRadius=n?0:this.properties.cornerRadius,t.endOuterCornerRadius=n?0:this.properties.cornerRadius,t.startInnerCornerRadius=n?this.properties.cornerRadius:0,t.endInnerCornerRadius=n?this.properties.cornerRadius:0,i){const{startAngle:s,endAngle:a}=e,{innerRadius:o,outerRadius:r,clipInnerRadius:l,clipOuterRadius:c}=eE(e);t.innerRadius=o,t.outerRadius=r,t.startAngle=s,t.endAngle=a,t.clipSector=new Kgt(s,a,l,c)}}getColumnTransitionFunctions(){const t=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return Ggt(t)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null||this.properties.label.itemStyler!=null}};Q5.className="NightingaleSeries";Q5.type="nightingale";var{nightingaleSeriesThemeableOptionsDef:Ygt}=j,J5={..._e,...Ygt,type:ht(Jt("nightingale")),angleKey:ht(K),radiusKey:ht(K)};J5.angleKeyAxis=Mt(K);J5.radiusKeyAxis=Mt(K);({...Oe},{...Bc}),sn.ANGLE_CATEGORY+"",yf.CIRCLE,sn.RADIUS_NUMBER+"",yf.CIRCLE;sn.ANGLE_CATEGORY,sn.RADIUS_NUMBER,z.X+"",z.Y+"";var{SeriesProperties:$gt,makeSeriesTooltip:Xgt,Label:tY,DropShadow:Zgt}=j,qgt=class extends tY{},iE=class extends tY{constructor(){super(...arguments),this.spacing=0}};M([b],iE.prototype,"spacing");M([b],iE.prototype,"placement");var Wn=class extends $gt{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.direction="vertical",this.reverse=void 0,this.spacing=0,this.aspectRatio=void 0,this.shadow=new Zgt().set({enabled:!1}),this.label=new qgt,this.stageLabel=new iE,this.tooltip=Xgt()}getStyle(t=0){const{fills:e,strokes:i,fillOpacity:n,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r}=this;return{fill:e[t%e.length],fillOpacity:n,stroke:i[t%i.length],strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,opacity:1}}};M([b],Wn.prototype,"stageKey");M([b],Wn.prototype,"valueKey");M([b],Wn.prototype,"fills");M([b],Wn.prototype,"fillOpacity");M([b],Wn.prototype,"strokes");M([b],Wn.prototype,"strokeWidth");M([b],Wn.prototype,"strokeOpacity");M([b],Wn.prototype,"lineDash");M([b],Wn.prototype,"lineDashOffset");M([b],Wn.prototype,"direction");M([b],Wn.prototype,"reverse");M([b],Wn.prototype,"spacing");M([b],Wn.prototype,"aspectRatio");M([b],Wn.prototype,"itemStyler");M([b],Wn.prototype,"shadow");M([b],Wn.prototype,"label");M([b],Wn.prototype,"stageLabel");M([b],Wn.prototype,"tooltip");function eY(t,{x:e,y:i,top:n,right:s,bottom:a,left:o}){t.x0=e-n/2,t.x1=e+n/2,t.x2=e+a/2,t.x3=e-a/2,t.y0=i-o/2,t.y1=i-s/2,t.y2=i+s/2,t.y3=i+o/2}function Qgt(t){return{fromFn:(s,a)=>{const{x:o,y:r}=a;let{top:l,right:c,bottom:u,left:d}=a;return t==="vertical"?(l=0,u=0):(d=0,c=0),{x:o,y:r,top:l,right:c,bottom:u,left:d}},toFn:(s,a)=>{const{x:o,y:r,top:l,right:c,bottom:u,left:d}=a;return{x:o,y:r,top:l,right:c,bottom:u,left:d}},applyFn:eY}}var{valueProperty:uH,SeriesNodePickMode:dH,createDatumId:Jgt,BBox:Rw,Group:Pw,Selection:Ky,Text:zw,PointerEvents:pH,fromToMotion:tft,seriesLabelFadeInAnimation:eft,getLabelStyles:ift}=j,iY=class extends j.DataModelSeries{constructor(t){super({moduleCtx:t,categoryKey:void 0,pickModes:[dH.EXACT_SHAPE_MATCH,dH.NEAREST_NODE]}),this.properties=new Wn,this.itemGroup=this.contentGroup.appendChild(new Pw({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Pw({name:"itemLabelGroup"})),this.stageLabelGroup=this.contentGroup.appendChild(new Pw({name:"stageLabelGroup"})),this.datumSelection=Ky.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=Ky.select(this.itemLabelGroup,zw),this.stageLabelSelection=Ky.select(this.stageLabelGroup,zw),this.highlightLabelSelection=Ky.select(this.highlightLabelGroup,zw),this.highlightDatumSelection=Ky.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.animationState=new Rt("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{clear:"empty",reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable()),this.itemLabelGroup.pointerEvents=pH.None,this.stageLabelGroup.pointerEvents=pH.None,this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",e=>this.onLegendItemClick(e)))}nodeFactory(){return new Gl}getNodeData(){return this.contextNodeData?.nodeData}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}async processData(t){if(this.data==null)return;const{id:e,visible:i,ctx:{legendManager:n}}=this,{stageKey:s,valueKey:a}=this.properties,o="category",r="number",l=(d,g,f)=>i&&n.getItemEnabled({seriesId:e,itemId:f}),c=this.visible?{}:{forceValue:0},u=this.properties.allowNullKeys??!1;await this.requestDataModel(t,this.data,{props:[uH(s,o,{id:"xValue",allowNullKey:u}),uH(a,r,{id:"yValue",...c,validation:l,invalidValue:0})]})}createNodeData(){const{id:t,dataModel:e,processedData:i,properties:n,visible:s,ctx:{legendManager:a}}=this,{stageKey:o,valueKey:r,direction:l,reverse:c=l==="horizontal",spacing:u,aspectRatio:d,label:g,stageLabel:f}=n;if(e==null||i==null)return;const y=l==="horizontal",x=e.resolveColumnById(this,"xValue",i),S=e.resolveColumnById(this,"yValue",i),D=e.getDomain(this,"xValue","value",i).domain,A=e.getDomain(this,"yValue","value",i).domain,I=this.ctx.domManager.isRtl,w=Ve(f),N=f.placement==="after"===I;let O,L;y?(O="center",L=f.placement==="before"?"bottom":"top"):(O=N?"right":"left",L="middle");const R=f.enabled?[]:void 0;let P=0,B=0,F=0;const H=i.dataSources.get(this.id)?.data??[];for(const[mt,Dt]of H.entries()){const kt=x[mt];if(kt===void 0&&!this.properties.allowNullKeys)continue;const Vt=S[mt],Kt=s&&a.getItemEnabled({seriesId:t,itemId:mt});if(F+=Vt,R==null)continue;const ae=this.getLabelText(kt,Dt,o,"x",D,this.properties.stageLabel,{datum:Dt,value:Vt,stageKey:o,valueKey:r},this.properties.allowNullKeys??!1),{width:ne,height:Qt}=qt(ae)?Va(ae,g):w.measureLines(bi(ae));P=Math.max(P,ne),B=Math.max(B,Qt),R.push({x:Number.NaN,y:Number.NaN,text:ae,textAlign:O,textBaseline:L,visible:Kt})}const $=this._nodeDataDependencies?.seriesRectWidth??0,Y=this._nodeDataDependencies?.seriesRectHeight??0,U=u*(i.input.count-1);let V;if(y){const mt=B+f.spacing;V=new Rw(0,f.placement==="before"?mt:0,$,Y-mt)}else{const mt=P+f.spacing;V=new Rw(N?mt:0,0,$-mt,Y)}if(d!=null&&d!==0){const mt=l==="horizontal"?1/d:d,Dt=Math.min(V.width,V.height*mt),kt=Dt/mt;V=new Rw(V.x+(V.width-Dt)/2,V.y+(V.height-kt)/2,Dt,kt)}let Z,W;y?W=f.placement==="before"?V.y-f.spacing:V.y+V.height+f.spacing:Z=N?V.x-f.spacing:V.x+V.width+f.spacing;const q=V.width-(y?U:0),nt=V.height-(y?0:U);if(q<0||nt<0)return;const G=[],et=[];let st=0,lt=0;for(const[mt,Dt]of H.entries()){const kt=x[mt];if(kt===void 0&&!this.properties.allowNullKeys)continue;const Vt=S[mt],Kt=s&&a.getItemEnabled({seriesId:t,itemId:mt}),ae=st+Vt,ne=(st+ae)/(2*F),Qt=(ae-st)/F,zt=y?q*ne+u*mt:q*.5,Pt=y?nt*.5:nt*ne+u*mt,ue=V.x+zt,oe=V.y+Pt;if(R!=null){const ln=R[lt++];ln.x=Z??ue,ln.y=W??oe}let ke,Ye,Ce,Di;if(y){const ln=q*Qt;ke=ln,Ce=ln;const mi=(zt+ln/2)*(nt/V.width),Ya=(zt-ln/2)*(nt/V.width);Ye=c?V.height-mi:mi,Di=c?V.height-Ya:Ya}else{const ln=nt*Qt;Ye=ln,Di=ln;const mi=(Pt-ln/2)*(q/V.height),Ya=(Pt+ln/2)*(q/V.height);ke=c?V.width-mi:mi,Ce=c?V.width-Ya:Ya}const zn=this.getLabelText(Vt,Dt,r,"y",A,g,{datum:Dt,value:Vt,stageKey:o,valueKey:r}),Kn={x:ue,y:oe,text:zn,textAlign:"center",textBaseline:"middle",visible:Kt};et.push(Kn),G.push({series:this,datum:Dt,datumIndex:mt,index:mt,xValue:kt,yValue:Vt,x:ue,y:oe,top:ke,right:Ye,bottom:Ce,left:Di,label:Kn,enabled:Kt,midPoint:{x:ue,y:oe},style:this.getItemStyle({datumIndex:mt,datum:Dt},!1)}),st=ae}return{itemId:t,nodeData:G,labelData:et,stageLabelData:R,bounds:V}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update({seriesRect:t}){this.checkResize(t);const{datumSelection:e,labelSelection:i,stageLabelSelection:n,highlightDatumSelection:s,highlightLabelSelection:a}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let o=this.ctx.highlightManager?.getActiveHighlight();o!=null&&(o.series!==this||o.datum==null)&&(o=void 0);const r=this.contextNodeData?.nodeData??[],l=this.contextNodeData?.labelData??[],c=this.contextNodeData?.stageLabelData??[];this.datumSelection=this.updateDatumSelection({nodeData:r,datumSelection:e}),this.updateDatumStyles({datumSelection:e,isHighlight:!1}),this.updateDatumNodes({datumSelection:e,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:l,labelSelection:i}),this.updateLabelNodes({labelSelection:i,labelProperties:this.properties.label}),this.stageLabelSelection=this.updateStageLabelSelection({stageLabelData:c,stageLabelSelection:n}),this.updateLabelNodes({labelSelection:n,labelProperties:this.properties.stageLabel,checkActiveHighlight:!0});const u=this.getHighlightLabelData(l,o)??[];this.highlightLabelSelection=a.update(u),this.updateLabelNodes({labelSelection:this.highlightLabelSelection,labelProperties:this.properties.label,isHighlight:!0}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:o==null?[]:[o],datumSelection:s}),this.updateDatumStyles({datumSelection:s,isHighlight:!0}),this.updateDatumNodes({datumSelection:s,isHighlight:!0}),this.animationState.transition("update")}updateDatumSelection(t){return t.datumSelection.update(t.nodeData)}getItemStyle({datumIndex:t,datum:e},i){const{properties:n}=this,{itemStyler:s}=n,a=this.getHighlightStyle(i,t);let r=Et(a,n.getStyle(t));if(s!=null&&t!=null){const l=this.cachedDatumCallback(Jgt(t,i?"highlight":"node"),()=>{const c=this.makeItemStylerParams(e,t,i,r);return this.callWithContext(s,c)});l&&(r=Et(l,r))}return r}makeItemStylerParams(t,e,i,n){const{id:s,properties:a}=this,{stageKey:o,valueKey:r}=a,l=this.ctx.highlightManager?.getActiveHighlight(),c=this.getHighlightStateString(l,i,e),u=this.filterItemStylerFillParams(n.fill)??n.fill;return{seriesId:s,datum:t,stageKey:o,valueKey:r,highlightState:c,...n,fill:u}}updateDatumStyles({datumSelection:t,isHighlight:e}){t.each((i,n)=>{n.style=this.getItemStyle(n,e)})}updateDatumNodes({datumSelection:t}){const{properties:e}=this,{shadow:i}=e,n=this.contextNodeData?.bounds,s=n?{series:n,axis:n}:void 0;t.each((a,o)=>{a.setStyleProperties(o.style,s),eY(a,o),a.fillShadow=i})}updateLabelSelection(t){return t.labelSelection.update(this.properties.label.enabled?t.labelData:[])}updateStageLabelSelection(t){return t.stageLabelSelection.update(t.stageLabelData)}updateLabelNodes(t){const e=this.ctx.highlightManager?.getActiveHighlight(),{labelSelection:i,labelProperties:n,isHighlight:s=!1,checkActiveHighlight:a=!1}=t;i.each((o,r,l)=>{const{visible:c,x:u,y:d,text:g,textAlign:f,textBaseline:y}=r,x=s||a&&e?.datumIndex===l,S=this.getHighlightStyle(x,l),D=ift(this,void 0,this.properties,n,x,e),{color:A,fontSize:I,fontStyle:w,fontWeight:N,fontFamily:O}=D;o.visible=c,o.x=u,o.y=d,o.text=g,o.fill=A,o.opacity=(S.opacity??1)*(D.fillOpacity??1),o.fillOpacity=(S.opacity??1)*(D.fillOpacity??1),o.fontStyle=w,o.fontWeight=N,o.fontSize=I,o.fontFamily=O,o.textAlign=f,o.textBaseline=y,o.setBoxing(D)})}getHighlightLabelData(t,e){if(e?.label)return[{...e.label}]}computeFocusBounds(t){const e=this.getNodeData()?.[t.datumIndex];if(e!==void 0){for(const i of this.datumSelection)if(i.datum===e)return i.node}}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,properties:s}=this,{stageKey:a,valueKey:o,tooltip:r}=s;if(!i||!n)return;const l=n.dataSources.get(this.id)?.data[t],c=i.resolveColumnById(this,"xValue",n)[t],u=i.resolveColumnById(this,"yValue",n)[t],d=this.properties.allowNullKeys??!1;if(c===void 0&&!d)return;const g=this.getLabelText(c,l,a,"x",i.getDomain(this,"xValue","value",n).domain,this.properties.stageLabel,{datum:l,value:c,stageKey:a,valueKey:o}),f=this.getItemStyle({datumIndex:t,datum:l},!1);return this.formatTooltipWithContext(r,{symbol:this.legendItemSymbol(t),data:[{label:ce(g),value:ce(u)}]},{seriesId:e,datum:l,title:void 0,stageKey:a,valueKey:o,...f})}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}pickNodeClosestDatum({x:t,y:e}){let i=1/0,n;return this.datumSelection.each((s,a)=>{const o=s.distanceSquared(t,e);o{const u=r[c],d=this.properties.allowNullKeys??!1;if(!(u==null&&!d))return{legendType:"category",id:n,datum:l,itemId:c,seriesId:n,enabled:a&&s.getItemEnabled({seriesId:n,itemId:c}),label:{text:String(u)},symbol:this.legendItemSymbol(c),hideInLegend:!o}}).filter(l=>l!=null)}animateReset(){this.ctx.animationManager.skipCurrentBatch(),this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(){const{datumSelection:t,labelSelection:e,properties:i}=this,n=Qgt(i.direction);tft(this.id,"nodes",this.ctx.animationManager,[t],n),eft(this,"labels",this.ctx.animationManager,e)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};iY.className="PyramidSeries";iY.type="pyramid";var{pyramidSeriesThemeableOptionsDef:nft}=j;({...nft,..._e,type:ht(Jt("pyramid")),stageKey:ht(K),valueKey:ht(K)});({...Oe},{...Oe});var nY={series:{stroke:{$palette:"stroke"},label:{...Oe,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},marker:{enabled:!0,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Sp],["image",$s],["pattern",Cs]]},stroke:{$palette:"stroke"},fillOpacity:1,shape:"circle",size:6,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",1,0]}},highlight:fD,tooltip:{range:{$path:["/tooltip/range","nearest"]}}},axes:{[sn.ANGLE_CATEGORY]:{label:{spacing:10}}}};Et({series:{stroke:bx,strokeWidth:2}},nY);Et({series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Tl],["image",$s],["pattern",Cs]]},fillOpacity:.8,strokeWidth:2,marker:{enabled:!1}}},nY);var{Label:sft,SeriesMarker:aft,SeriesProperties:oft,makeSeriesTooltip:rft}=j,Pn=class extends oft{constructor(){super(...arguments),this.angleKeyAxis="angle",this.radiusKeyAxis="radius",this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.rotation=0,this.marker=new aft,this.label=new sft,this.tooltip=rft(),this.connectMissingData=!1}};M([b],Pn.prototype,"angleKey");M([b],Pn.prototype,"radiusKey");M([b],Pn.prototype,"angleName");M([b],Pn.prototype,"radiusName");M([b],Pn.prototype,"angleKeyAxis");M([b],Pn.prototype,"radiusKeyAxis");M([b],Pn.prototype,"legendItemName");M([b],Pn.prototype,"stroke");M([b],Pn.prototype,"strokeWidth");M([b],Pn.prototype,"strokeOpacity");M([b],Pn.prototype,"lineDash");M([b],Pn.prototype,"lineDashOffset");M([b],Pn.prototype,"rotation");M([b],Pn.prototype,"styler");M([b],Pn.prototype,"marker");M([b],Pn.prototype,"label");M([b],Pn.prototype,"tooltip");M([b],Pn.prototype,"connectMissingData");var{DEFAULT_POLAR_DIRECTION_KEYS:lft,DEFAULT_POLAR_DIRECTION_NAMES:cft,PolarAxis:hft,SeriesNodePickMode:gH,keyProperty:uft,valueProperty:dft,fixNumericExtent:pft,seriesLabelFadeInAnimation:gft,markerFadeInAnimation:fft,resetMarkerFn:mft,resetLabelFn:yft,animationValidation:bft,computeMarkerFocusBounds:xft,BBox:vft,Group:Sft,Path:Mft,Selection:Bw,Text:Dft,Marker:Aft,updateLabelNode:fH,getMarkerStyles:Ift}=j,kft=class extends j.SeriesNodeEvent{constructor(t,e,i,n){super(t,e,i,n),this.angleKey=n.properties.angleKey,this.radiusKey=n.properties.radiusKey}},nE=class extends j.PolarSeries{constructor(t){super({moduleCtx:t,categoryKey:"angleValue",propertyKeys:lft,propertyNames:cft,pickModes:[gH.NEAREST_NODE,gH.EXACT_SHAPE_MATCH],canHaveAxes:!0,animationResetFns:{item:mft,label:yft},clipFocusBox:!1}),this.NodeEvent=kft,this.lineGroup=this.contentGroup.appendChild(new Sft({name:"radar-line"})),this.lineSelection=Bw.select(this.lineGroup,Mft),this.resetInvalidToZero=!1,this.circleCache={r:0,cx:0,cy:0},this.lineGroup.zIndex=0,this.itemGroup.zIndex=1}renderToOffscreenCanvas(){return(this.nodeData?.length??0)>0&&this.getDrawingMode(!1)==="cutout"||super.renderToOffscreenCanvas()}nodeFactory(){return new Aft}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return{domain:[]};if(t===z.Angle){const n=e.getDomain(this,"angleValue","key",i).domain,s=e.getKeySortMetadata(this,"angleValue",i);return{domain:n,sortMetadata:s}}else{const n=e.getDomain(this,"radiusValue","value",i).domain,s=Ll(n.length===0?n:[0].concat(n));return{domain:pft(s)}}}async processData(t){const{angleKey:e,radiusKey:i}=this.properties,n=[];this.ctx.animationManager.isSkipped()||n.push(bft());const s=this.axes[z.Radius]?.scale.type,a=this.axes[z.Angle]?.scale.type,o=this.properties.allowNullKeys??!1;await this.requestDataModel(t,this.data,{props:[uft(e,a,{id:"angleValue",allowNullKey:o}),dft(i,s,{id:"radiusValue",invalidValue:void 0}),...n]}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,n=this.circleCache;return t===n.r&&e===n.cx&&i===n.cy?!1:(this.circleCache={r:t,cx:e,cy:i},!0)}getAxisInnerRadius(){const t=this.axes[z.Radius];return t instanceof hft?this.radius*t.innerRadiusRatio:0}maybeRefreshNodeData(){!this.didCircleChange()&&!this.nodeDataRefresh||(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}createNodeData(){const{processedData:t,dataModel:e}=this;if(!t||!e)return;const{angleKey:i,radiusKey:n,angleName:s,radiusName:a,legendItemName:o,marker:r,label:l}=this.properties,c=this.axes[z.Angle]?.scale,u=this.axes[z.Radius]?.scale;if(!c||!u)return;const d=e.resolveKeysById(this,"angleValue",t),g=e.resolveColumnById(this,"radiusValue",t),f=this.getAxisInnerRadius(),y=this.getSeriesDomain(z.Radius).domain,x=t.dataSources.get(this.id)?.data??[],S=this.properties.allowNullKeys??!1,D=[];for(let A=0;A0&&(Y="left");let U="bottom";be(P,0)?U="middle":P>0&&(U="top"),H={x:B+R*r.size,y:F+P*r.size,text:$,textAlign:Y,textBaseline:U}}}D.push({series:this,datum:I,datumIndex:A,index:A,point:{x:B,y:F,size:r.size},midPoint:{x:B,y:F},label:H,angleValue:w,radiusValue:N,missing:!Ae(O)||!Ae(L)})}return{itemId:n,nodeData:D,labelData:D,styles:Ift(this,this.properties,r)}}update({seriesRect:t}){const e=this.checkResize(t),i=!this.ctx.animationManager.isSkipped(),{series:n}=this.ctx.highlightManager?.getActiveHighlight()??{};this.highlightGroup.visible=(i||this.visible)&&n===this,this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updatePathSelections(),this.updateMarkerSelection(),this.updateHighlightSelection(),this.updatePathNodes(),this.hasItemStylers()&&(this.updateDatumStyles(this.itemSelection,!1),this.updateDatumStyles(this.highlightSelection,!0));const s=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateMarkers(this.itemSelection,!1,"overlay"),this.updateMarkers(this.highlightSelection,!0,s),this.updateLabels(),e&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePathSelections(){const t=this.visible?[!0]:[];this.lineSelection.update(t)}updateMarkerSelection(){const{marker:t,styler:e}=this.properties;t.isDirty()&&(this.itemSelection.clear(),this.itemSelection.cleanup(),this.itemSelection=Bw.select(this.itemGroup,()=>this.nodeFactory(),!1));const i=e==null?t.enabled:this.getStyle().marker.enabled,n=this.visible&&t.shape&&i?this.nodeData:[];this.itemSelection.update(n)}updateHighlightSelection(){const{marker:t,styler:e}=this.properties;t.isDirty()&&(this.highlightSelection.clear(),this.highlightSelection.cleanup(),this.highlightSelection=Bw.select(this.highlightGroup,()=>this.nodeFactory(),!1));const i=e==null?t.enabled:this.getStyle().marker.enabled,n=this.ctx.highlightManager?.getActiveHighlight(),s=this.visible&&t.shape&&i&&n?.datum?[{...n}]:[];this.highlightSelection.update(s)}getMarkerFill(t){return t?.fill??this.getStyle().marker.fill}getDatumStylerProperties(t){const{id:e,properties:i}=this,{angleKey:n,radiusKey:s}=i;return{seriesId:e,datum:t,angleKey:n,radiusKey:s}}updateDatumStyles(t,e){const i=this.ctx.highlightManager.getActiveHighlight();t.each((n,s)=>{const a=this.getHighlightState(i,e,s.datumIndex),o=this.getStyle(a),{stroke:r,strokeWidth:l,strokeOpacity:c}=o;s.style=this.getMarkerStyle(this.properties.marker,s,this.getDatumStylerProperties(s.datum),{isHighlight:e,highlightState:a},o.marker,{stroke:r,strokeWidth:l,strokeOpacity:c})})}updateMarkers(t,e,i){const n=this.getShapeFillBBox(),{contextNodeData:s}=this;if(!s)return;const a=this.ctx.highlightManager.getActiveHighlight();i=this.getDrawingMode(e,i),t.each((o,r)=>{const l=r.style??s.styles[this.getHighlightState(a,e,r.datumIndex)];this.applyMarkerStyle(l,o,r.point,n),o.drawingMode=i})}updateLabels(){const{properties:t}=this,e=this.ctx.highlightManager?.getActiveHighlight(),i=e?.series===this&&e?.datum?[{...e}]:[];this.labelSelection.update(this.nodeData).each((n,s)=>{s.label&&(n.fillOpacity=this.getHighlightStyle(!1,s.datumIndex).opacity??1,fH(this,n,t,t.label,s.label,!1,e))}),this.highlightLabelSelection.update(i).each((n,s)=>{s.label&&(n.fillOpacity=this.getHighlightStyle(!0,s.datumIndex).opacity??1,fH(this,n,t,t.label,s.label,!0,e))})}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,axes:s,properties:a}=this,{angleKey:o,angleName:r,radiusKey:l,radiusName:c,legendItemName:u,tooltip:d,marker:g}=a,f=s[z.Angle],y=s[z.Radius];if(!i||!n||!f||!y)return;const x=n.dataSources.get(this.id)?.data[t],S=i.resolveKeysById(this,"angleValue",n)[t],D=i.resolveColumnById(this,"radiusValue",n)[t],A=this.properties.allowNullKeys??!1;if(S===void 0&&!A)return;const I=this.getMarkerStyle(g,{datum:x,datumIndex:t},this.getDatumStylerProperties(x),{isHighlight:!1});return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(f,"tooltip",S,x,o,void 0,A),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(y,"tooltip",D,x,l,void 0),missing:j.isTooltipValueMissing(D)}]},{seriesId:e,datum:x,title:r,angleKey:o,radiusKey:l,angleName:r,radiusName:c,legendItemName:u,...I})}legendItemSymbol(){const{stroke:t,strokeWidth:e,strokeOpacity:i,lineDash:n,marker:s}=this.getStyle();return{marker:{shape:s.shape,enabled:s.enabled||e<=0,fill:this.getMarkerFill()??s.stroke??t??"rgba(0, 0, 0, 0)",stroke:s.stroke??t??"rgba(0, 0, 0, 0)",fillOpacity:s.fillOpacity,strokeOpacity:s.strokeOpacity,strokeWidth:s.strokeWidth,lineDash:s.lineDash,lineDashOffset:s.lineDashOffset},line:{enabled:!0,stroke:t,strokeOpacity:i,strokeWidth:e,lineDash:n}}}getLegendData(t){if(t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:n}=this,{radiusKey:s,radiusName:a,legendItemName:o,showInLegend:r}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:n&&i.getItemEnabled({seriesId:e,itemId:s}),label:{text:o??a??s},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!r}]}pickNodeClosestDatum(t){const{nodeData:e,centerX:i,centerY:n}=this,{x:s,y:a}=t,o=this.radius;if(Math.hypot(s-i,a-n)>o+this.maxChartMarkerSize)return;let l=1/0,c;for(const u of e){const{point:{x:d=Number.NaN,y:g=Number.NaN}={}}=u;if(Number.isNaN(d)||Number.isNaN(g))continue;const f=Math.hypot(t.x-d-i,t.y-g-n);fthis.animatePaths(n),onStop:()=>this.animatePaths(1)}),fft(this,i,"added",this.getAnimationDrawingModes(),t),gft(this,"labels",i,e,this.highlightLabelSelection)}animateWaitingUpdateReady(t){super.animateWaitingUpdateReady(t),this.resetPaths()}animateReadyResize(t){super.animateReadyResize(t),this.resetPaths()}resetPaths(){const t=this.getLineNode();if(t){const{path:e}=t,i=this.getLinePoints(),n=this.getStyle();t.fill=void 0,t.stroke=n.stroke,t.strokeWidth=n.strokeWidth,t.strokeOpacity=n.strokeOpacity,t.lineDash=n.lineDash,t.lineDashOffset=n.lineDashOffset,e.clear(!0);for(const{x:s,y:a,moveTo:o}of i)o?e.moveTo(s,a):e.lineTo(s,a);return t.checkPathDirty(),n}}getStylerResult(t,e){const{styler:i}=this.properties;if(i){const n=this.makeStylerParams(e),s=this.cachedCallWithContext(i,n)??{},a=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],s,{pick:!1});a&&(t=a)}return t}getFormattedMarkerStyle(t){const{angleKey:e,radiusKey:i}=this.properties;return this.getMarkerStyle(this.properties.marker,t,{angleKey:e,radiusKey:i},{isHighlight:!0})}computeFocusBounds(t){return xft(this,t)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};nE.className="RadarSeries";var sE=class extends Pn{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};M([b],sE.prototype,"fill");M([b],sE.prototype,"fillOpacity");var{Group:Cft,HighlightState:wft,Path:Nft,PointerEvents:mH,Selection:Tft,toHighlightString:Lft}=j,sY=class extends nE{constructor(t){super(t),this.properties=new sE,this.areaGroup=this.contentGroup.appendChild(new Cft({name:"radar-area"})),this.areaSelection=Tft.select(this.areaGroup,Nft),this.resetInvalidToZero=!0,this.areaGroup.zIndex=-1}updatePathSelections(){const t=this.visible?[!0]:[];this.areaSelection.update(t),super.updatePathSelections()}getAreaNode(){return this.areaSelection.at(0)}getMarkerFill(t){if(t?.fill!=null)return t.fill;const e=this.getStyle();return e.marker.fill??e.fill}updatePathNodes(){const t=this.getPathNodesStyle(),{fill:e,fillOpacity:i,strokeWidth:n,stroke:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,opacity:l}=t,c=this.getLineNode();c&&c.setProperties({fill:void 0,lineJoin:"round",lineCap:"round",pointerEvents:mH.None,opacity:l,stroke:s,strokeWidth:n,strokeOpacity:a,lineDash:o,lineDashOffset:r});const u=this.getAreaNode();u&&(u.setStyleProperties({fill:e,fillOpacity:i,stroke:void 0},this.getShapeFillBBox()),u.setProperties({lineJoin:"round",pointerEvents:mH.None,opacity:l}))}animatePaths(t){super.animatePaths(t);const e=this.getAreaNode();e&&this.animateSinglePath(e,this.getAreaPoints(),t)}getAreaPoints(){const t=this.getLinePoints(),e=o=>{const r=this.axes[o];return r instanceof j.PolarAxis?r:void 0},i=e(z.Radius),n=e(z.Angle);if(!i?.isReversed())return t;const a=n?.getAxisLinePoints()?.points??[];return t.concat(...a)}resetPaths(){const t=super.resetPaths(),e=this.getAreaNode();if(e){const{path:i}=e,n=this.getAreaPoints(),s=t??this.getStyle(),a=this.getShapeFillBBox();e.setStyleProperties({fill:s.fill,stroke:void 0,fillOpacity:s.fillOpacity,lineDash:s.lineDash,lineDashOffset:s.lineDashOffset},a),e.lineJoin=e.lineCap="round",i.clear(!0);for(const{x:o,y:r,moveTo:l,arc:c,radius:u=0,startAngle:d=0,endAngle:g=0}of n)c?i.arc(o,r,u,d,g):l?i.moveTo(o,r):i.lineTo(o,r);return i.closePath(),e.checkPathDirty(),s}}makeStylerParams(t){const{properties:e}=this,i=Lft(t??wft.None);return{marker:{fill:e.marker.fill,fillOpacity:e.marker.fillOpacity,size:e.marker.size,shape:e.marker.shape,stroke:e.marker.stroke,strokeOpacity:e.marker.strokeOpacity,strokeWidth:e.marker.strokeWidth,lineDash:e.marker.lineDash,lineDashOffset:e.marker.lineDashOffset},highlightState:i,fill:e.fill,fillOpacity:e.fillOpacity,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset,seriesId:this.id,stroke:e.stroke,strokeOpacity:e.strokeOpacity,strokeWidth:e.strokeWidth,angleKey:e.angleKey,radiusKey:e.radiusKey}}getStyle(t){const{marker:e,fill:i,fillOpacity:n,lineDash:s,lineDashOffset:a,stroke:o,strokeOpacity:r,strokeWidth:l}=this.properties,{size:c,shape:u,fill:d="transparent",fillOpacity:g}=e,f=this.getStylerResult({},t);return f.marker??(f.marker={}),{fill:f.fill??i,fillOpacity:f.fillOpacity??n,lineDash:f.lineDash??s,lineDashOffset:f.lineDashOffset??a,stroke:f.stroke??o,strokeOpacity:f.strokeOpacity??r,strokeWidth:f.strokeWidth??l,marker:{enabled:f.marker.enabled??e.enabled,fill:f.marker.fill??d,fillOpacity:f.marker.fillOpacity??g,shape:f.marker.shape??u,size:f.marker.size??c,lineDash:f.marker.lineDash??e.lineDash??s,lineDashOffset:f.marker.lineDashOffset??e.lineDashOffset??a,stroke:f.marker.stroke??e.stroke??o,strokeOpacity:f.marker.strokeOpacity??e.strokeOpacity??r,strokeWidth:f.marker.strokeWidth??e.strokeWidth??l}}}};sY.className="RadarAreaSeries";sY.type="radar-area";var{radarAreaSeriesThemeableOptionsDef:Oft}=j,aY={..._e,...Oft,type:ht(Jt("radar-area")),angleKey:ht(K),radiusKey:ht(K)};aY.angleKeyAxis=Mt(K);aY.radiusKeyAxis=Mt(K);sn.ANGLE_CATEGORY,sn.RADIUS_NUMBER,z.Angle+"",z.Radius+"";var{HighlightState:Eft,PointerEvents:Rft,toHighlightString:Pft}=j,oY=class extends nE{constructor(){super(...arguments),this.properties=new Pn}updatePathSelections(){this.lineSelection.update(this.visible?[!0]:[])}updatePathNodes(){const t=this.getLineNode();if(!t)return;const e=this.getPathNodesStyle(),{strokeWidth:i,stroke:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,opacity:r}=e;t.setProperties({fill:void 0,lineJoin:"round",lineCap:"round",pointerEvents:Rft.None,opacity:r,stroke:n,strokeWidth:i,strokeOpacity:s,lineDash:a,lineDashOffset:o})}makeStylerParams(t){const{properties:e}=this,i=Pft(t??Eft.None);return{marker:{fill:e.marker.fill,fillOpacity:e.marker.fillOpacity,size:e.marker.size,shape:e.marker.shape,stroke:e.marker.stroke,strokeOpacity:e.marker.strokeOpacity,strokeWidth:e.marker.strokeWidth,lineDash:e.marker.lineDash,lineDashOffset:e.marker.lineDashOffset},highlightState:i,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset,seriesId:this.id,stroke:e.stroke,strokeOpacity:e.strokeOpacity,strokeWidth:e.strokeWidth,angleKey:e.angleKey,radiusKey:e.radiusKey}}getStyle(t){const{marker:e,lineDash:i,lineDashOffset:n,stroke:s,strokeOpacity:a,strokeWidth:o}=this.properties,{size:r,shape:l,fill:c="transparent",fillOpacity:u}=e,d=this.getStylerResult({},t);return d.marker??(d.marker={}),{lineDash:d.lineDash??i,lineDashOffset:d.lineDashOffset??n,stroke:d.stroke??s,strokeOpacity:d.strokeOpacity??a,strokeWidth:d.strokeWidth??o,marker:{enabled:d.marker.enabled??e.enabled,fill:d.marker.fill??c,fillOpacity:d.marker.fillOpacity??u,shape:d.marker.shape??l,size:d.marker.size??r,lineDash:d.marker.lineDash??e.lineDash??i,lineDashOffset:d.marker.lineDashOffset??e.lineDashOffset??n,stroke:d.marker.stroke??e.stroke??s,strokeOpacity:d.marker.strokeOpacity??e.strokeOpacity??a,strokeWidth:d.marker.strokeWidth??e.strokeWidth??o}}}};oY.className="RadarLineSeries";oY.type="radar-line";var{radarLineSeriesThemeableOptionsDef:zft}=j,rY={..._e,...zft,type:ht(Jt("radar-line")),angleKey:ht(K),radiusKey:ht(K)};rY.angleKeyAxis=Mt(K);rY.radiusKeyAxis=Mt(K);sn.ANGLE_CATEGORY,sn.RADIUS_NUMBER,z.Angle+"",z.Radius+"";var{SeriesProperties:Bft,makeSeriesTooltip:Vft,Label:_ft}=j,tn=class extends Bft{constructor(){super(...arguments),this.angleKeyAxis="angle",this.radiusKeyAxis="radius",this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new _ft,this.tooltip=Vft()}getStyle(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,cornerRadius:r}=this;return{fill:t,fillOpacity:e,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,cornerRadius:r,opacity:1}}};M([b],tn.prototype,"angleKey");M([b],tn.prototype,"radiusKey");M([b],tn.prototype,"angleName");M([b],tn.prototype,"radiusName");M([b],tn.prototype,"angleKeyAxis");M([b],tn.prototype,"radiusKeyAxis");M([b],tn.prototype,"legendItemName");M([b],tn.prototype,"fill");M([b],tn.prototype,"fillOpacity");M([b],tn.prototype,"stroke");M([b],tn.prototype,"strokeWidth");M([b],tn.prototype,"strokeOpacity");M([b],tn.prototype,"lineDash");M([b],tn.prototype,"lineDashOffset");M([b],tn.prototype,"cornerRadius");M([b],tn.prototype,"styler");M([b],tn.prototype,"itemStyler");M([b],tn.prototype,"rotation");M([b],tn.prototype,"stackGroup");M([b],tn.prototype,"normalizedTo");M([b],tn.prototype,"label");M([b],tn.prototype,"tooltip");var{SectorBox:yH,motion:Fft}=j;function Hft(t,e,i){if(i==="updated"){if(t.previousDatum==null||Number.isNaN(t.previousDatum.innerRadius)||Number.isNaN(t.previousDatum.outerRadius))return"added";if(Number.isNaN(e.innerRadius)||Number.isNaN(e.outerRadius))return"removed"}return i==="added"&&t.previousDatum!=null?"updated":i}function bH(t){return{toFn:(n,s,a)=>{let o,r,l,c,u;return a==="removed"?(o=t,r=t,l=s.innerRadius,c=s.outerRadius,u=new yH(o,r,l,c)):(o=s.startAngle,r=s.endAngle,l=Number.isNaN(s.innerRadius)?n.innerRadius:s.innerRadius,c=Number.isNaN(s.outerRadius)?n.outerRadius:s.outerRadius,u=s.clipSector),{startAngle:o,endAngle:r,innerRadius:l,outerRadius:c,clipSector:u}},fromFn:(n,s,a)=>{a=Hft(n,s,a);let o,r,l,c,u;a==="removed"||a==="updated"?(o=n.startAngle,r=n.endAngle,l=n.innerRadius,c=n.outerRadius,u=n.clipSector):(o=t,r=t,l=s.innerRadius,c=s.outerRadius),u??(u=new yH(o,r,l,c));const d=Fft.NODE_UPDATE_STATE_TO_PHASE_MAPPING[a];return{startAngle:o,endAngle:r,innerRadius:l,outerRadius:c,clipSector:u,phase:d}}}}function jft(t,e){return{centerX:0,centerY:0,innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,clipSector:e.clipSector}}var{DEFAULT_POLAR_DIRECTION_KEYS:Gft,DEFAULT_POLAR_DIRECTION_NAMES:Uft,PolarAxis:Wft,diff:Kft,groupAccumulativeValueProperty:xH,keyProperty:Yft,normaliseGroupTo:$ft,valueProperty:Xft,fixNumericExtent:Zft,resetLabelFn:qft,seriesLabelFadeInAnimation:Qft,seriesLabelFadeOutAnimation:Jft,animationValidation:tmt,createDatumId:emt,CategoryScale:imt,Sector:nmt,SectorBox:smt,motion:vH,updateLabelNode:SH,getItemStyles:amt}=j,omt=class extends j.SeriesNodeEvent{constructor(t,e,i,n){super(t,e,i,n),this.angleKey=n.properties.angleKey,this.radiusKey=n.properties.radiusKey}},lY=class extends j.PolarSeries{constructor(t){super({moduleCtx:t,categoryKey:"radiusValue",propertyKeys:Gft,propertyNames:Uft,canHaveAxes:!0,animationResetFns:{item:jft,label:qft}}),this.properties=new tn,this.NodeEvent=omt,this.groupScale=new imt,this.circleCache={r:0,cx:0,cy:0}}nodeFactory(){return new nmt}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return{domain:[]};if(t===z.Angle){const n=e.getDomain(this,"angleValue-end","value",i).domain,s=[Math.min(n[0],0),Math.max(n[1],0)];return{domain:Zft(s)}}else return e.getDomain(this,"radiusValue","key",i)}async processData(t){const{angleKey:e,radiusKey:i,normalizedTo:n}=this.properties,s=!this.ctx.animationManager.isSkipped(),a=this.getStackId(),o=`${a}-trailing`,r=[];go(n)&&r.push($ft([a,o],Math.abs(n))),this.needsDataModelDiff()&&this.processedData&&r.push(Kft(this.id,this.processedData)),s&&r.push(tmt());const l=this.visible?{}:{forceValue:0},c=this.axes[z.Radius]?.scale.type,u=this.axes[z.Angle]?.scale.type,d=this.properties.allowNullKeys??!1;await this.requestDataModel(t,this.data,{props:[Yft(i,c,{id:"radiusValue",allowNullKey:d}),Xft(e,u,{id:"angleValue-raw",invalidValue:null,...l}),...xH(e,"normal",{id:"angleValue-end",rangeId:"angleValue-range",invalidValue:null,groupId:a,separateNegative:!0,...l},u),...xH(e,"trailing",{id:"angleValue-start",invalidValue:null,groupId:o,separateNegative:!0,...l},u),...r],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,n=this.circleCache;return t===n.r&&e===n.cx&&i===n.cy?!1:(this.circleCache={r:t,cx:e,cy:i},!0)}maybeRefreshNodeData(){!this.didCircleChange()&&!this.nodeDataRefresh||(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}getAxisInnerRadius(){const t=this.axes[z.Radius];return t instanceof Wft?this.radius*t.innerRadiusRatio:0}createNodeData(){const{processedData:t,dataModel:e}=this;if(!e||t?.type!=="grouped")return;const i=this.axes[z.Angle],n=this.axes[z.Radius],s=i?.scale,a=n?.scale;if(!s||!a)return;const o=e.resolveKeysById(this,"radiusValue",t),r=e.resolveColumnById(this,"angleValue-start",t),l=e.resolveColumnById(this,"angleValue-end",t),c=e.resolveColumnById(this,"angleValue-raw",t),u=e.resolveProcessedDataIndexById(this,"angleValue-range");let d=0;n instanceof xm&&(d=n.groupPaddingInner);const{groupScale:g}=this,{index:f,visibleGroupCount:y}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);g.domain=Array.from({length:y}).map((W,q)=>String(q)),g.range=[0,Math.abs(a.bandwidth??0)],g.paddingInner=y>1?d:0;const x=g.bandwidth>=1?g.bandwidth:g.rawBandwidth,S=i.isReversed(),D=n.isReversed(),A=D?this.radius:this.getAxisInnerRadius(),w=(D?this.getAxisInnerRadius():this.radius)+A,N=this.getSeriesDomain(z.Angle).domain,{angleKey:O,radiusKey:L,angleName:R,radiusName:P,legendItemName:B,label:F}=this.properties,H=(W,q,nt,G)=>{const et=this.getLabelText(q,W,O,"angle",N,F,{value:q,datum:W,angleKey:O,radiusKey:L,angleName:R,radiusName:P,legendItemName:B});if(et)return{x:nt,y:G,text:et,textAlign:"center",textBaseline:"middle"}},$=[],Y=amt((W,q,nt)=>gf(this,W,q,nt)),U={itemId:L,nodeData:$,labelData:$,styles:Y};if(!this.visible)return U;const{dataSources:V}=t,Z=V.get(this.id)?.data??[];for(const{datumIndex:W,group:q}of e.forEachGroupDatum(this,t)){const nt=Z[W],G=o[W];if(G===void 0&&!this.properties.allowNullKeys)return;const et=c[W],st=r[W],lt=l[W],mt=et>=0&&!Object.is(et,-0),Dt=q.aggregation[u][mt?1:0],kt=mt===S;let Vt=s.convert(st,{clamp:!0}),Kt=s.convert(lt,{clamp:!0}),ae=s.convert(0,{clamp:!0}),ne=s.convert(Dt,{clamp:!0});kt&&([ae,ne]=[ne,ae],[Vt,Kt]=[Kt,Vt]);const zt=w-a.convert(G)+g.convert(String(f)),Pt=zt+x,ue=(zt+Pt)/2,oe=Vt+fl(Vt,Kt)/2,ke=Math.cos(oe)*ue,Ye=Math.sin(oe)*ue,Ce=this.properties.label.enabled?H(nt,et,ke,Ye):void 0,Di=new smt(Vt,Kt,zt,Pt);$.push({series:this,datum:nt,datumIndex:W,point:{x:ke,y:Ye,size:0},midPoint:{x:ke,y:Ye},label:Ce,angleValue:et,radiusValue:G,innerRadius:zt,outerRadius:Pt,startAngle:ae,endAngle:ne,clipSector:Di,reversed:kt,index:W})}return U}update({seriesRect:t}){const e=this.checkResize(t);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),e&&this.animationState.transition("resize"),this.animationState.transition("update")}updateSectorSelection(t,e){let i=[];const n=this.ctx.highlightManager?.getActiveHighlight();e?n?.datum&&n.series===this&&i.push(n):i=this.nodeData;const{contextNodeData:s}=this;if(!s)return;const a=this.ctx.highlightManager.getActiveHighlight(),o=this.getShapeFillBBox(),r=this.hasItemStylers();t.update(i,void 0,l=>this.getDatumId(l)).each((l,c)=>{const u=FM(c);if(u==null)return;if(r){const x=this.getHighlightState(n,e,c.datumIndex);c.style=gf(this,c,e,x)}const d=c.style??s.styles[this.getHighlightState(a,e,c.datumIndex)],g=d.cornerRadius,f=d.fill,y=an(f)&&f.bounds!=="item"?{centerX:0,centerY:0}:void 0;l.setStyleProperties(d,o,y),l.lineJoin="round",l.inset=l.stroke==null?0:l.strokeWidth/2,l.startInnerCornerRadius=u.reversed?g:0,l.startOuterCornerRadius=u.reversed?g:0,l.endInnerCornerRadius=u.reversed?0:g,l.endOuterCornerRadius=u.reversed?0:g,e&&(l.startAngle=c.startAngle,l.endAngle=c.endAngle,l.clipSector=c.clipSector,l.innerRadius=c.innerRadius,l.outerRadius=c.outerRadius)})}updateLabels(){const{properties:t}=this,e=this.ctx.highlightManager?.getActiveHighlight(),i=e?.series===this&&e?.datum?e:void 0,n=i?[i]:[];this.labelSelection.update(this.nodeData).each((s,a)=>{SH(this,s,t,t.label,a.label,!1,e),s.fillOpacity=this.getHighlightStyle(!1,a.datumIndex).opacity??1}),this.highlightLabelSelection.update(n,void 0,s=>this.getDatumId(s)).each((s,a)=>{SH(this,s,t,t.label,a.label,!0,e),s.fillOpacity=this.getHighlightStyle(!0,a.datumIndex).opacity??1})}getBarTransitionFunctions(){const t=this.axes[z.Angle]?.scale;let e=0;if(!t)return bH(e);const i=Math.min(t.domain[0],t.domain[1]),n=Math.max(t.domain[0],t.domain[1]);return i<=0&&n>=0&&(e=t.convert(0)),bH(e)}animateEmptyUpdateReady(){const{labelSelection:t}=this,e=this.getBarTransitionFunctions();vH.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],e),Qft(this,"labels",this.ctx.animationManager,t,this.highlightLabelSelection)}animateClearingUpdateEmpty(){const{itemSelection:t}=this,{animationManager:e}=this.ctx,i=this.getBarTransitionFunctions();vH.fromToMotion(this.id,"datums",e,[t],i),Jft(this,"labels",e,this.labelSelection,this.highlightLabelSelection)}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,axes:s,properties:a}=this,{angleKey:o,angleName:r,radiusKey:l,radiusName:c,legendItemName:u,tooltip:d}=a,g=s[z.Angle],f=s[z.Radius],y=this.nodeData?.[t];if(!i||!n||!g||!f||!y)return;const x=n.dataSources.get(this.id)?.data[t],S=i.resolveKeysById(this,"radiusValue",n)[t],D=i.resolveColumnById(this,"angleValue-raw",n)[t];if(S===void 0&&!this.properties.allowNullKeys)return;const A=gf(this,y,!1);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(f,"tooltip",S,x,l,void 0),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:o,value:this.getAxisValueText(g,"tooltip",D,x,o,void 0),missing:j.isTooltipValueMissing(D)}]},{seriesId:e,datum:x,title:r,angleKey:o,angleName:r,radiusKey:l,radiusName:c,legendItemName:u,...A})}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.itemSelection.nodes())}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:n,strokeWidth:s,lineDash:a,lineDashOffset:o}=tE(this,!1,j.HighlightState.None),r={fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:n,strokeWidth:s,lineDash:a,lineDashOffset:o};return an(r.fill)&&(r.fill={...r.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:r}}getLegendData(t){if(t!=="category")return[];const{id:e,visible:i}=this,{angleKey:n,angleName:s,legendItemName:a,showInLegend:o}=this.properties;return[{legendType:"category",id:e,itemId:n,seriesId:e,enabled:i,label:{text:a??s??n},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!o}]}getDatumId(t){return emt(t.radiusValue)}computeLabelsBBox(){return null}getStackId(){return`radialBar-stack-${this.seriesGrouping?.groupIndex??this.id}-xValues`}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null||this.properties.label.itemStyler!=null}};lY.className="RadialBarSeries";lY.type="radial-bar";var{radialBarSeriesThemeableOptionsDef:rmt}=j,cY={..._e,...rmt,type:ht(Jt("radial-bar")),angleKey:ht(K),radiusKey:ht(K)};cY.angleKeyAxis=Mt(K);cY.radiusKeyAxis=Mt(K);({...Oe},sn.RADIUS_CATEGORY+"");sn.ANGLE_NUMBER,sn.RADIUS_CATEGORY,z.Angle+"",z.Radius+"";var aE=class extends Hi{};M([b],aE.prototype,"columnWidthRatio");M([b],aE.prototype,"maxColumnWidthRatio");var{PolarAxis:lmt,RadialColumnShape:cmt,getRadialColumnWidth:hmt}=j,hY=class extends X5{constructor(t){super(t,{animationResetFns:{item:Hgt}}),this.properties=new aE}getStackId(){return`radarColumn-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new cmt}getColumnTransitionFunctions(){const t=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return Fgt(t)}isRadiusAxisCircle(){const t=this.axes[z.Radius];return t instanceof lmt?t.shape==="circle":!1}updateItemPath(t,e,i){t.isBeveled=this.isRadiusAxisCircle(),i&&(t.innerRadius=e.innerRadius,t.outerRadius=e.outerRadius,t.startAngle=e.startAngle,t.endAngle=e.endAngle,t.columnWidth=e.columnWidth,t.axisInnerRadius=e.axisInnerRadius,t.axisOuterRadius=e.axisOuterRadius)}getColumnWidth(t,e){const{columnWidthRatio:i=.5,maxColumnWidthRatio:n=.5}=this.properties;return hmt(t,e,this.radius,i,n)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null||this.properties.label.itemStyler!=null}};hY.className="RadialColumnSeries";hY.type="radial-column";var{radialColumnSeriesThemeableOptionsDef:umt}=j,uY={..._e,...umt,type:ht(Jt("radial-column")),angleKey:ht(K),radiusKey:ht(K)};uY.angleKeyAxis=Mt(K);uY.radiusKeyAxis=Mt(K);({...Oe},sn.ANGLE_CATEGORY+"",yf.CIRCLE,sn.RADIUS_NUMBER+"",yf.CIRCLE);sn.ANGLE_CATEGORY,sn.RADIUS_NUMBER,z.Angle+"",z.Radius+"";var{SvgPath:dmt,Rotatable:pmt,Translatable:gmt,Scalable:fmt}=j,p1=class extends pmt(fmt(gmt(dmt))){constructor(){super(...arguments),this.scalingCenterX=.5,this.scalingCenterY=.5,this.rotationCenterX=.5,this.rotationCenterY=.5}};p1.defaultPathData="M0.50245 0.53745C0.481767 0.53745 0.465 0.520683 0.465 0.5C0.465 0.479317 0.481767 0.46255 0.50245 0.46255L1 0.500012L0.50245 0.53745Z";var{getColorStops:mmt}=j,{makeSeriesTooltip:ymt,SeriesProperties:bmt,AxisLabel:xmt,Label:vmt}=j,dY=class extends vmt{};M([b],dY.prototype,"spacing");var Ns=class extends xt{constructor(){super(...arguments),this.label=new dY}getStyle(){const{fill:t="black",fillOpacity:e=1,stroke:i="black",strokeWidth:n=0,strokeOpacity:s=1,lineDash:a=[0],lineDashOffset:o=0}=this;return{fill:t,fillOpacity:e,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o}}};M([b],Ns.prototype,"text");M([b],Ns.prototype,"value");M([b],Ns.prototype,"shape");M([b],Ns.prototype,"placement");M([b],Ns.prototype,"spacing");M([b],Ns.prototype,"size");M([b],Ns.prototype,"rotation");M([b],Ns.prototype,"fill");M([b],Ns.prototype,"fillOpacity");M([b],Ns.prototype,"stroke");M([b],Ns.prototype,"strokeWidth");M([b],Ns.prototype,"strokeOpacity");M([b],Ns.prototype,"lineDash");M([b],Ns.prototype,"lineDashOffset");M([b],Ns.prototype,"label");var Wr=class extends xt{constructor(){super(...arguments),this.enabled=!0,this.fills=new ss(j.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(t,e){const{enabled:i,fill:n,fills:s,fillMode:a,fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:u,lineDashOffset:d}=this;return{fill:i?n??fY(s,a,t,e):"none",fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:u,lineDashOffset:d}}};M([b],Wr.prototype,"enabled");M([b],Wr.prototype,"fills");M([b],Wr.prototype,"fillMode");M([b],Wr.prototype,"fill");M([b],Wr.prototype,"fillOpacity");M([b],Wr.prototype,"stroke");M([b],Wr.prototype,"strokeWidth");M([b],Wr.prototype,"strokeOpacity");M([b],Wr.prototype,"lineDash");M([b],Wr.prototype,"lineDashOffset");var dv=class extends xt{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};M([b],dv.prototype,"values");M([b],dv.prototype,"step");M([b],dv.prototype,"minSpacing");M([b],dv.prototype,"maxSpacing");var Smt=class extends xmt{},ha=class extends xt{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new ss(j.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new dv,this.label=new Smt}getStyle(t,e,i){const{fill:n,fills:s,defaultFill:a,fillMode:o,fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:u,lineDash:d,lineDashOffset:g}=this;return{fill:n??(t&&s.length===0?a:void 0)??fY(s,o,e,i),fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:u,lineDash:d,lineDashOffset:g}}};M([b],ha.prototype,"min");M([b],ha.prototype,"max");M([b],ha.prototype,"fills");M([b],ha.prototype,"fillMode");M([b],ha.prototype,"fill");M([b],ha.prototype,"fillOpacity");M([b],ha.prototype,"stroke");M([b],ha.prototype,"strokeWidth");M([b],ha.prototype,"strokeOpacity");M([b],ha.prototype,"lineDash");M([b],ha.prototype,"lineDashOffset");M([b],ha.prototype,"defaultFill");M([b],ha.prototype,"interval");M([b],ha.prototype,"label");var Kr=class extends xt{constructor(){super(...arguments),this.enabled=!0,this.spacing=0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};M([b],Kr.prototype,"enabled");M([b],Kr.prototype,"radiusRatio");M([b],Kr.prototype,"spacing");M([b],Kr.prototype,"fill");M([b],Kr.prototype,"fillOpacity");M([b],Kr.prototype,"stroke");M([b],Kr.prototype,"strokeWidth");M([b],Kr.prototype,"strokeOpacity");M([b],Kr.prototype,"lineDash");M([b],Kr.prototype,"lineDashOffset");var pY=class extends Om{};M([b],pY.prototype,"text");var gY=class extends PA{};M([b],gY.prototype,"text");var xn=class extends bmt{constructor(){super(...arguments),this.startAngle=0,this.endAngle=0,this.segmentation=new cv,this.defaultColorRange=[],this.targets=new ss(Ns),this.defaultTarget=new Ns,this.outerRadiusRatio=1,this.innerRadiusRatio=1,this.cornerRadius=0,this.cornerMode="container",this.spacing=0,this.scale=new ha,this.bar=new Wr,this.needle=new Kr,this.label=new pY,this.secondaryLabel=new gY,this.tooltip=ymt()}};M([b],xn.prototype,"value");M([b],xn.prototype,"startAngle");M([b],xn.prototype,"endAngle");M([b],xn.prototype,"segmentation");M([b],xn.prototype,"defaultColorRange");M([b],xn.prototype,"targets");M([b],xn.prototype,"defaultTarget");M([b],xn.prototype,"outerRadiusRatio");M([b],xn.prototype,"innerRadiusRatio");M([b],xn.prototype,"outerRadius");M([b],xn.prototype,"innerRadius");M([b],xn.prototype,"cornerRadius");M([b],xn.prototype,"cornerMode");M([b],xn.prototype,"spacing");M([b],xn.prototype,"scale");M([b],xn.prototype,"bar");M([b],xn.prototype,"needle");M([b],xn.prototype,"label");M([b],xn.prototype,"secondaryLabel");M([b],xn.prototype,"tooltip");function fY(t,e,i,n){const{domain:s,range:a}=n,[o,r]=a,l=ze((o+r)/2+Math.PI),c=Wb(r-o);return{type:"gradient",gradient:"conic",colorSpace:"oklch",colorStops:mmt(t,i,s,e).map(({color:d,stop:g})=>(g=Math.min(Math.max(g,0),1),g=(o+c*g-l)/(2*Math.PI),g=(g%1+1)%1,{stop:g,color:d})),bounds:"series",rotation:tj(l)+90}}var{SectorBox:oE}=j;function Mmt(t){const{startAngle:e,endAngle:i,clipStartAngle:n,clipEndAngle:s,innerRadius:a,outerRadius:o}=t;if(!(n==null||s==null))return new oE(Math.max(n,e),Math.min(s,i),a,o)}function mY(t,e,i){return Math.max(t,i.startAngle)<=Math.min(e,i.endAngle)}function Vw(t){return t.clipStartAngle!=null&&t.clipEndAngle!=null}function _w(t,e){const{clipStartAngle:i,clipEndAngle:n,innerRadius:s,outerRadius:a}=t;return new oE(i,e?i:n,s,a)}function MH(t,e){const i=t?"initial":"update";return{node:{fromFn(a,o){const r=a.previousDatum;let{startAngle:l,endAngle:c}=r??o;const u=r!=null&&Vw(r)?_w(r,t):void 0,d=Vw(o)?_w(o,t):void 0;let g;return u!=null&&d!=null?g=u:u==null&&d!=null?(g=d,l=o.startAngle,c=o.endAngle):u!=null&&d==null?(g=void 0,l=o.startAngle,c=o.endAngle):t&&(c=l),{startAngle:l,endAngle:c,clipSector:g,phase:i}},toFn(a,o){const{startAngle:r,endAngle:l}=o;let c;return Vw(o)&&(c=_w(o,!1)),{startAngle:r,endAngle:l,clipSector:c}},applyFn(a,o){const{startAngle:r,endAngle:l}=o;let{clipSector:c}=o;c!=null&&(c=new oE(Math.max(r,c.startAngle),Math.min(l,c.endAngle),c.innerRadius,c.outerRadius));const u=c==null||mY(r,l,c);a.startAngle=r,a.endAngle=l,a.clipSector=c,a.visible=u}},needle:{fromFn(a){let{angle:o}=a.previousDatum??a.datum;return t&&(o=e),{rotation:o,phase:i}},toFn(a,o){const{angle:r}=o;return{rotation:r}}}}}function Fw(t,e){const{startAngle:i,endAngle:n}=e,s=Mmt(e),a=s==null||mY(i,n,s);return{startAngle:i,endAngle:n,clipSector:s,visible:a}}function DH(t,e){const{angle:i}=e;return{rotation:i}}var Dmt={top:0,middle:.5,bottom:1};function Amt(t,e,i,n,s,a){const{padding:o,textAlign:r,verticalAlign:l}=n;let c,u;if(i.each((N,O)=>{O.label==="primary"?c=O:O.label==="secondary"&&(u=O)}),c==null)return;const d=ux(t.id,e,c,a?.label);if(d==null)return;const g=u==null?void 0:ux(t.id,e,u,a?.secondaryLabel),f={padding:o},y=r==="center"?2:1,x=l==="middle"?2:1,S=N=>({width:Math.sqrt(Math.max(s**2-(N/x)**2,0))*y,height:Math.min(N,x*s),meta:null});let D,A,I;if(u!=null&&g!=null){const N=e5(ce(d),c,ce(g),u,f,S);D=N?.label,A=N?.secondaryLabel,I=N?.height??0}else{const N=rx(ce(d),c,f,S);D=N?.[0],A=void 0,I=N?.[0].height??0}const w=I*Dmt[l];i.each((N,O)=>{let L;if(O.label==="primary"?L=D:O.label==="secondary"&&(L=A),L==null){N.visible=!1;return}N.visible=!0,N.text=L.text,N.fontSize=L.fontSize,N.lineHeight=L.lineHeight,N.textAlign=r,N.textBaseline="middle";const R=O.label==="primary"?L.height/2:I-L.height/2;N.y=O.centerY+R-w,N.x=O.centerX})}var{fromToMotion:Yy,resetMotion:AH,SeriesNodePickMode:IH,createDatumId:Hw,sectorBox:Imt,BBox:kmt,Group:Vh,PointerEvents:LS,Selection:_h,Sector:Cmt,SectorBox:wmt,Transformable:Nmt,TransformableText:Tmt,Text:kH,Marker:Lmt}=j,Omt={inside:90,middle:0,outside:-90},Emt=[{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"},{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"}],Rmt=[{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"},{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"}],yY=class extends j.Series{constructor(t){super({moduleCtx:t,pickModes:[IH.EXACT_SHAPE_MATCH,IH.NEAREST_NODE]}),this.centerX=0,this.centerY=0,this.radius=0,this.textAlign="center",this.verticalAlign="middle",this.properties=new xn,this.scale=new nK,this.scaleGroup=this.contentGroup.appendChild(new Vh({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new Vh({name:"itemGroup"})),this.itemNeedleGroup=this.contentGroup.appendChild(new Vh({name:"itemNeedleGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new Vh({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new Vh({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Vh({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new Vh({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new Vh({name:"tickGroup"})),this.scaleSelection=_h.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=_h.select(this.itemGroup,()=>this.nodeFactory()),this.needleSelection=_h.select(this.itemNeedleGroup,p1),this.targetSelection=_h.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=_h.select(this.itemTargetLabelGroup,kH),this.labelSelection=_h.select(this.itemLabelGroup,kH),this.highlightTargetSelection=_h.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=_h.select(this.tickGroup,j.TransformableText),this.datumUnion=new k5,this.animationState=new Rt("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=LS.None,this.tickGroup.pointerEvents=LS.None,this.itemNeedleGroup.pointerEvents=LS.None,this.itemLabelGroup.pointerEvents=LS.None}get hasData(){return this.properties.value!=null}nodeFactory(){return new Cmt}markerFactory(){const t=new Lmt;return t.size=1,t}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(t){const{min:e,max:i}=this.properties.scale;return w5(t,{min:e,max:i})}layoutScale(){const{scale:t,properties:e}=this,{seriesRectWidth:i,seriesRectHeight:n}=this.nodeDataDependencies,{scale:s,outerRadius:a}=this.properties,{min:o,max:r,label:l,interval:c}=s,u=Ze(e.startAngle-90),d=Ze(e.endAngle-90),f=Wb(d-u)>Math.PI,y=f||Ba(1.5*Math.PI,u,d),x=f||Ba(0*Math.PI,u,d),S=f||Ba(.5*Math.PI,u,d),D=f||Ba(1*Math.PI,u,d);let A;D&&!x?A="right":!D&&x?A="left":A="center";let I;y&&!S?I="bottom":!y&&S?I="top":I="middle";const w=Imt({startAngle:u,endAngle:d,innerRadius:0,outerRadius:.5}),N=-(w.x+w.width/2)*2,O=-(w.y+w.height/2)*2,L=Math.min(i/w.width,n/w.height);t.domain=[o,r],t.range=[u,d],t.arcLength=L/2;const{maxSpacing:R,minSpacing:P}=c,{arcLength:B}=t,F=R?Math.floor(B/R):1,H=P?Math.floor(B/P):1/0,$=Math.floor(4/Math.PI*Math.abs(t.range[0]-t.range[1])),Y=Math.max(F,Math.min(H,$)),U=c.values??t.ticks({nice:[!1,!1],interval:c.step,minTickCount:F,maxTickCount:H,tickCount:Y})?.ticks??[],V=vT(U,typeof l.format=="string"?l.format:void 0),Z=[];for(const[et,st]of U.entries()){let lt;l.formatter&&(lt=cx(this.ctx,l.formatter,{value:st,index:et,domain:t.domain,boundSeries:void 0})),lt??(lt=V?.(st)),lt!=null&&Z.push({index:et,value:st,text:lt})}const W=.5*L,q=l.enabled&&a==null&&Z.length>0?this.getTickLabelInset({tickData:Z,radius:W,centerXOffset:N,centerYOffset:O,seriesRectWidth:i,seriesRectHeight:n,spacing:l.spacing,rotation:Ze(l.rotation??0)}):0,nt=Math.max(W-q,0),G=a??nt;return this.centerX=i/2+N*G,this.centerY=n/2+O*G,this.radius=G,this.textAlign=A,this.verticalAlign=I,Z}getShapeFillBBox(){const{centerX:t,centerY:e,radius:i}=this,n=new kmt(t-i,e-i,2*i,2*i);return{series:n,axis:n}}getTargets(){const{properties:t}=this,e=t.defaultTarget;return t.targets.map(i=>{const{text:n=e.text,value:s=e.value??0,shape:a=e.shape??"triangle",rotation:o=e.rotation??0,placement:r=e.placement??"middle",spacing:l=e.spacing??0,size:c=e.size??0}=i,{enabled:u=e.label.enabled,color:d=e.label.color??"black",fontStyle:g=e.label.fontStyle??"normal",fontWeight:f=e.label.fontWeight??"normal",fontSize:y=e.label.fontSize,fontFamily:x=e.label.fontFamily,spacing:S=e.label.spacing??0}=i.label;return{text:n,value:s,shape:a,placement:r,spacing:l,size:c,rotation:o,label:{enabled:u,color:d,fontStyle:g,fontWeight:f,fontSize:y,fontFamily:x,spacing:S},style:i.getStyle()}})}getTargetRadius(t){const{radius:e,properties:i}=this,{innerRadiusRatio:n,outerRadiusRatio:s}=i,{placement:a,spacing:o,size:r}=t,l=e*s,c=e*n;switch(a){case"inside":return Math.max(c-o-r/2,0);case"outside":return l+o+r/2;default:return(c+l)/2}}getTargetLabel(t){const{scale:e}=this,{value:i,size:n,placement:s,label:a}=t,{spacing:o,color:r,fontStyle:l,fontWeight:c,fontSize:u,fontFamily:d}=a,g=e.convert(i),f=Math.trunc(ze(g)/(Math.PI/2)),y=n/2+o;let x,S,D,A;switch(s){case"outside":({textAlign:x,textBaseline:S}=Emt[f]),D=y*Math.cos(g),A=y*Math.sin(g);break;case"inside":({textAlign:x,textBaseline:S}=Rmt[f]),D=-y*Math.cos(g),A=-y*Math.sin(g);break;default:x="center",S="bottom",D=0,A=-y;break}return{offsetX:D,offsetY:A,fill:r,textAlign:x,textBaseline:S,fontStyle:l,fontWeight:c,fontSize:u,fontFamily:d,lineHeight:void 0}}createNodeData(){const t=this.layoutScale(),{id:e,scale:i,properties:n,radius:s,centerX:a,centerY:o}=this,{value:r,innerRadiusRatio:l,outerRadiusRatio:c,segmentation:u,cornerRadius:d,cornerMode:g,needle:f,bar:y,scale:x,label:S,secondaryLabel:D}=n,{outerRadius:A=s*c,innerRadius:I=s*l,defaultColorRange:w}=n,N=this.getTargets(),O=[],L=[],R=[],P=[],B=[],F=g==="item",H=i.convert(i.domain[0]),$=i.convert(r),Y=Math.ceil(Wb($-H)*s);let U=u.enabled?u.interval.getSegments(i,Y):void 0;const V=y.getStyle(w,i),Z=x.getStyle(y.enabled,w,i);if(U==null&&F){const W=Math.min(...i.domain),q=Math.max(...i.domain),nt={value:r,segmentStart:W,segmentEnd:q},et=Math.min(d,(A-I)/2)/((I+A)/2);O.push({series:this,itemId:"value",datum:nt,datumIndex:{type:0},type:0,centerX:a,centerY:o,outerRadius:A,innerRadius:I,startAngle:H-et,endAngle:$+et,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,style:V}),B.push({series:this,itemId:"scale",datum:nt,datumIndex:{type:0},type:0,centerX:a,centerY:o,outerRadius:A,innerRadius:I,startAngle:i.range[0]-et,endAngle:i.range[1]+et,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,style:Z})}else{U??(U=i.domain);for(let W=0;Wthis.formatLabel(kt.value)}=S;P.push({label:"primary",centerX:a,centerY:o,text:W,value:r,fill:q,fontSize:nt,minimumFontSize:G,fontStyle:et,fontWeight:st,fontFamily:lt,lineHeight:mt,formatter:Dt})}if(!f.enabled&&D.enabled){const{text:W,color:q,fontSize:nt,minimumFontSize:G,fontStyle:et,fontWeight:st,fontFamily:lt,lineHeight:mt,formatter:Dt}=D;P.push({label:"secondary",centerX:a,centerY:o,text:W,value:r,fill:q,fontSize:nt,minimumFontSize:G,fontStyle:et,fontWeight:st,fontFamily:lt,lineHeight:mt,formatter:Dt})}if(f.enabled){let W=f.radiusRatio==null?I:s*f.radiusRatio;W=Math.max(W-f.spacing,0);const q=i.convert(r);R.push({centerX:a,centerY:o,radius:W,angle:q,series:this})}for(let W=0;WMath.max(...i.domain))continue;const mt=this.getTargetRadius(q),Dt=i.convert(nt),kt=Ze(q.rotation+Omt[q.placement]);L.push({series:this,itemId:`target-${W}`,midPoint:{x:mt*Math.cos(Dt)+a,y:mt*Math.sin(Dt)+o},datum:{value:nt},datumIndex:{type:1,index:W},type:1,value:nt,text:G,centerX:a,centerY:o,shape:st,radius:mt,angle:Dt,rotation:kt,size:et,label:this.getTargetLabel(q),style:lt})}return{itemId:e,nodeData:O,needleData:R,targetData:L,labelData:P,scaleData:B,tickData:t}}findNodeDatum(t){return O5(this,t)}updateSelections(t){(this.nodeDataRefresh||t)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(t){if(t?.series===this&&t.type===1)return t}update({seriesRect:t}){const{datumSelection:e,labelSelection:i,needleSelection:n,targetSelection:s,targetLabelSelection:a,scaleSelection:o,highlightTargetSelection:r,tickSelection:l}=this,c=this.checkResize(t);this.updateSelections(c),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const u=this.contextNodeData?.nodeData??[],d=this.contextNodeData?.labelData??[],g=this.contextNodeData?.needleData??[],f=this.contextNodeData?.targetData??[],y=this.contextNodeData?.scaleData??[],x=this.contextNodeData?.tickData??[],S=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:y,scaleSelection:o}),this.updateScaleNodes({scaleSelection:o}),this.needleSelection=this.updateNeedleSelection({needleData:g,needleSelection:n}),this.updateNeedleNodes({needleSelection:n}),this.targetSelection=this.updateTargetSelection({targetData:f,targetSelection:s}),this.updateTargetStyles({targetSelection:s,isHighlight:!1}),this.updateTargetNodes({targetSelection:s}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:f,targetLabelSelection:a}),this.updateTargetLabelNodes({targetLabelSelection:a}),this.datumSelection=this.updateDatumSelection({nodeData:u,datumSelection:e}),this.updateDatumNodes({datumSelection:e}),this.labelSelection=this.updateLabelSelection({labelData:d,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:S==null?[]:[S],targetSelection:r}),this.updateTargetStyles({targetSelection:r,isHighlight:!0}),this.updateTargetNodes({targetSelection:r}),this.tickSelection=this.updateTickSelection({tickData:x,tickSelection:l}),this.updateTickNodes({tickSelection:l}),c&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>Hw(t.nodeData.length,e.itemId))}updateDatumNodes(t){const{datumSelection:e}=t,{ctx:i,properties:n}=this,{segmentation:s}=n,a=s.spacing??0,o=i.animationManager.isSkipped(),r=this.getShapeFillBBox();e.each((l,c)=>{const{centerX:u,centerY:d,innerRadius:g,outerRadius:f,startCornerRadius:y,endCornerRadius:x}=c;l.centerX=u,l.centerY=d,l.innerRadius=g,l.outerRadius=f,l.pointerEvents=this.properties.bar.enabled?j.PointerEvents.All:j.PointerEvents.None,l.setStyleProperties(c.style,r),l.startOuterCornerRadius=y,l.startInnerCornerRadius=y,l.endOuterCornerRadius=x,l.endInnerCornerRadius=x,l.radialEdgeInset=(a+l.strokeWidth)/2,l.concentricEdgeInset=l.strokeWidth/2,c.midPoint=l.getBBox().computeCenter(),(o||l.previousDatum==null)&&l.setProperties(Fw(l,c))}),this.datumUnion.update(e,this.itemGroup,j.Sector,(l,c,u)=>{l.clipSector??(l.clipSector=new wmt(Number.NaN,Number.NaN,Number.NaN,Number.NaN)),l.centerX=c.centerX,l.centerY=c.centerY,l.outerRadius=l.clipSector.outerRadius=c.outerRadius,l.innerRadius=l.clipSector.innerRadius=c.innerRadius,l.startAngle=l.clipSector.startAngle=c.startAngle,l.startInnerCornerRadius=c.startInnerCornerRadius,l.startOuterCornerRadius=c.startOuterCornerRadius,l.endAngle=u.endAngle,l.clipSector.endAngle=u.clipSector?.endAngle??u.endAngle,l.endInnerCornerRadius=u.endInnerCornerRadius,l.endOuterCornerRadius=u.endOuterCornerRadius,l.pointerEvents=j.PointerEvents.None})}updateScaleSelection(t){return t.scaleSelection.update(t.scaleData,void 0,e=>Hw(t.scaleData.length,e.itemId))}updateScaleNodes(t){const{scaleSelection:e}=t,{segmentation:i}=this.properties,n=i.spacing??0,s=this.getShapeFillBBox();e.each((a,o)=>{const{centerX:r,centerY:l,innerRadius:c,outerRadius:u,startCornerRadius:d,endCornerRadius:g}=o;a.centerX=r,a.centerY=l,a.innerRadius=c,a.outerRadius=u,a.setStyleProperties(o.style,s),a.startOuterCornerRadius=d,a.startInnerCornerRadius=d,a.endOuterCornerRadius=g,a.endInnerCornerRadius=g,a.radialEdgeInset=(n+a.strokeWidth)/2,a.concentricEdgeInset=a.strokeWidth/2,a.setProperties(Fw(a,o))})}updateNeedleSelection(t){return t.needleSelection.update(t.needleData,void 0,()=>Hw(0))}updateNeedleNodes(t){const{needleSelection:e}=t,{fill:i,fillOpacity:n,stroke:s,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l}=this.properties.needle,c=this.ctx.animationManager.isSkipped();e.each((u,d)=>{const{centerX:g,centerY:f,radius:y}=d,x=y*2;u.d=p1.defaultPathData,u.setStyleProperties({fill:i,fillOpacity:n,stroke:s,strokeOpacity:a,strokeWidth:o/x,lineDash:r.map(S=>S/x),lineDashOffset:l/x}),u.translationX=g,u.translationY=f,u.scalingX=x,u.scalingY=x,c&&u.setProperties(DH(u,d))})}updateTargetSelection(t){return t.targetSelection.update(t.targetData,void 0,e=>e.itemId)}updateTargetStyles({targetSelection:t,isHighlight:e}){t.each((i,n)=>{n.style=this.getTargetStyle(e,n)})}updateTargetNodes({targetSelection:t}){t.each((e,i)=>{const{centerX:n,centerY:s,angle:a,radius:o,shape:r,size:l,rotation:c}=i;e.setStyleProperties(i.style),e.size=l,e.shape=r==="line"?N5:r,e.translationX=n+o*Math.cos(a),e.translationY=s+o*Math.sin(a),e.rotation=a+c})}getTargetStyle(t,{datumIndex:e,style:i}){const n=this.getHighlightStyle(t,e);return Et(n,{...i,opacity:1})}updateTargetLabelSelection(t){return t.targetLabelSelection.update(t.targetData,void 0,e=>e.itemId)}updateTargetLabelNodes(t){const{targetLabelSelection:e}=t;e.each((i,n)=>{const{centerX:s,centerY:a,radius:o,angle:r,text:l}=n,{offsetX:c,offsetY:u,fill:d,fontStyle:g,fontWeight:f,fontSize:y,fontFamily:x,textAlign:S,textBaseline:D}=n.label;if(l==null){i.visible=!1;return}i.visible=!0,i.x=s+o*Math.cos(r)+c,i.y=a+o*Math.sin(r)+u,i.text=l,i.fill=d,i.fontStyle=g,i.fontWeight=f,i.fontSize=y,i.fontFamily=x,i.textAlign=S,i.textBaseline=D})}updateLabelSelection(t){return t.labelSelection.update(t.labelData,void 0,e=>e.label)}updateLabelNodes(t){const{labelSelection:e}=t,i=this.ctx.animationManager.isSkipped();e.each((n,s)=>{n.fill=s.fill,n.fontStyle=s.fontStyle,n.fontWeight=s.fontWeight,n.fontFamily=s.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}updateTickSelection(t){return t.tickSelection.update(t.tickData,void 0,e=>e.index)}updateTickNodes(t){const{scale:e,radius:i,centerX:n,centerY:s,properties:a}=this,{enabled:o,color:r,fontFamily:l,fontSize:c,fontStyle:u,fontWeight:d,spacing:g}=a.scale.label,f=Ze(a.scale.label.rotation??0);t.tickSelection.each((y,x)=>{if(!o){y.visible=!1;return}y.visible=!0,y.text=x.text,y.fill=r,y.fontFamily=l,y.fontSize=c,y.fontStyle=u,y.fontWeight=d;const S=e.convert(x.value),{textAlign:D,textBaseline:A}=this.getTickLabelAlign(S),I=n+(i+g)*Math.cos(S),w=s+(i+g)*Math.sin(S);y.textAlign=D,y.textBaseline=A,y.x=I,y.y=w,y.rotationCenterX=I,y.rotationCenterY=w,y.rotation=f})}getTickLabelAlign(t){const e=Math.cos(t),i=Math.sin(t);let n,s;const a=be(e,0),o=be(i,0),r=e>0&&!a,l=i>0&&!o;return n="right",a?n="center":r&&(n="left"),s="bottom",o?s="middle":l&&(s="top"),{textAlign:n,textBaseline:s}}getTickLabelInset(t){const{tickData:e,radius:i,centerXOffset:n,centerYOffset:s,seriesRectWidth:a,seriesRectHeight:o,spacing:r,rotation:l}=t,{label:c}=this.properties.scale,u=a/2+n*i,d=o/2+s*i,g=new Tmt;g.fontFamily=c.fontFamily,g.fontSize=c.fontSize,g.fontStyle=c.fontStyle,g.fontWeight=c.fontWeight,g.rotation=l;const f=1e-6;let y=0;for(const x of e){const S=this.scale.convert(x.value),D=Math.cos(S),A=Math.sin(S),I=u+(i+r)*D,w=d+(i+r)*A,{textAlign:N,textBaseline:O}=this.getTickLabelAlign(S);g.text=x.text,g.x=I,g.y=w,g.textAlign=N,g.textBaseline=O,g.rotationCenterX=I,g.rotationCenterY=w;const L=l?Nmt.toCanvas(g):g.getBBox();if(L==null)continue;const R=L.x,P=L.x+L.width,B=L.y,F=L.y+L.height,H=Math.max(0,-R),$=Math.max(0,P-a),Y=Math.max(0,-B),U=Math.max(0,F-o),V=n+D;Math.abs(V)>f&&($>0&&V>0?y=Math.max(y,$/V):H>0&&V<0&&(y=Math.max(y,H/-V)));const Z=s+A;Math.abs(Z)>f&&(U>0&&Z>0?y=Math.max(y,U/Z):Y>0&&Z<0&&(y=Math.max(y,Y/-Z)))}return y}labelsHaveExplicitText(){for(const{datum:t}of this.labelSelection)if(t.text==null)return!1;return!0}formatLabelText(t){const{labelSelection:e,radius:i,textAlign:n,verticalAlign:s}=this,{spacing:a,innerRadiusRatio:o}=this.properties;Amt(this,this.ctx,e,{padding:a,textAlign:n,verticalAlign:s},i*o,t)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),AH([this.datumSelection],Fw),AH([this.needleSelection],DH),this.formatLabelText()}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}animateLabelText(t={}){const{animationManager:e}=this.ctx;let i,n,s,a;if(this.labelSelection.each((o,r)=>{o.opacity=1,r.label==="primary"?(i=o.previousDatum?.value??t.from??r.value,n=r.value):r.label==="secondary"&&(s=o.previousDatum?.value??t.from??r.value,a=r.value)}),!this.labelsHaveExplicitText())if(n==null||a==null)this.formatLabelText();else if(i===n&&s===a)this.formatLabelText({label:n,secondaryLabel:a});else{const o=`${this.id}_labels`;e.animate({id:o,groupId:"label",from:{label:i,secondaryLabel:s},to:{label:n,secondaryLabel:a},phase:t.phase??"update",onUpdate:r=>this.formatLabelText(r),onStop:()=>this.formatLabelText({label:n,secondaryLabel:a})})}}animateEmptyUpdateReady(){const{animationManager:t}=this.ctx,{node:e,needle:i}=MH(!0,this.scale.range[0]);Yy(this.id,"node",t,[this.datumSelection],e,(n,s)=>s.itemId),Yy(this.id,"needle",t,[this.needleSelection],i,()=>"needle"),Yy(this.id,"label",t,[this.labelSelection],C5,(n,s)=>s.label),this.animateLabelText({from:this.properties.scale.min,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:t}=this.ctx,{node:e,needle:i}=MH(!1,this.scale.range[0]);Yy(this.id,"node",t,[this.datumSelection],e,(n,s)=>s.itemId),Yy(this.id,"needle",t,[this.needleSelection],i,()=>"needle"),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}dataCount(){return Number.NaN}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getLegendData(){return[]}getTooltipContent(t){const{id:e,properties:i}=this,{tooltip:n}=i;let s,a,o;if(t.type===0?(s=i.value,a=i.label.text,o=this.ctx.localeManager.t("ariaLabelGaugeValue")):({value:s,text:a}=i.targets[t.index],o=this.ctx.localeManager.t("ariaLabelGaugeTarget")),s!=null)return this.formatTooltipWithContext(n,{data:[{label:a,fallbackLabel:o,value:this.formatLabel(s)}]},{seriesId:e,title:void 0,datum:void 0,value:s})}pickNodeClosestDatum(t){return T5(this,t)}pickFocus(t){return L5(this,t)}getCaptionText(){const{value:t}=this.properties,e=[];return e.push(this.formatLabel(t)),this.labelSelection.each((i,n)=>{const s=ux(this.id,this.ctx,n);s!=null&&e.push(ce(s))}),e.join(". ")}getCategoryValue(t){}datumIndexForCategoryValue(t){}hasItemStylers(){return this.properties.label.itemStyler!=null}};yY.className="RadialGaugeSeries";yY.type="radial-gauge";({...Oe},{...Oe,fontSize:Cn.LARGE});var{BBox:Pmt,Path:zmt}=j,Wp=class extends zmt{constructor(){super(...arguments),this.x1=0,this.x2=0,this.y1=0,this.y2=0,this.height=0,this.inset=0,this.elbows=[]}computeBBox(){const t=Math.min(this.x1,this.x2),e=Math.max(this.x1,this.x2)-t,i=Math.min(this.y1,this.y2),n=Math.max(this.y1,this.y2)-i+this.height;return new Pmt(t,i,e,n)}updatePath(){const{path:t,inset:e}=this;t.clear();const i=this.height-2*this.inset,n=i/2;let s=this.x1+e,a=this.y1+e;t.moveTo(s,a);for(const l of this.elbows)this.updatePathSection(s,a,l.x,l.y,i,-n),s=l.x,a=l.y;const o=this.x2-e,r=this.y2+e;this.updatePathSection(s,a,o,r,i,-n),t.lineTo(o,r+i),s=o,a=r;for(const l of this.elbows.toReversed())this.updatePathSection(s,a,l.x,l.y,i,n),s=l.x,a=l.y;this.updatePathSection(s,a,this.x1+e,this.y1+e,i,n),t.closePath()}updatePathSection(t,e,i,n,s,a){const{path:o}=this,r=at.from(t,e+a+s/2),l=at.from(i,n+a+s/2);if(Math.abs(l.y-r.y)<2){o.lineTo(l.x,l.y);return}let c=at.angle(at.sub(l,r));c<0&&(c=2*Math.PI+c);const u=0,d=Math.PI/2,g=Math.PI,f=Math.PI*1.5,y=CH(r,l,0),x=CH(r,l,s);if(y.radius=f?(o.arc(r.x,e-y.radius,y.radius,d,d+x.angle,!0),o.arc(l.x,n+x.radius,x.radius,f+x.angle,f),o.lineTo(l.x,l.y)):c>u&&c<=d?(o.arc(r.x,e+x.radius,x.radius,f,f+x.angle),o.arc(l.x,n-y.radius,y.radius,d+y.angle,d,!0),o.lineTo(l.x,l.y)):c>d&&c<=g?(o.arc(r.x,e+x.radius,x.radius-s,f,f+x.angle,!0),o.arc(l.x,n-y.radius,y.radius+s,d+y.angle,d),o.lineTo(l.x,l.y)):(o.arc(r.x,e-y.radius,y.radius+s,d,d+y.angle),o.arc(l.x,n+x.radius,x.radius-s,f+x.angle,f,!0),o.lineTo(l.x,l.y))}};M([ut()],Wp.prototype,"x1");M([ut()],Wp.prototype,"x2");M([ut()],Wp.prototype,"y1");M([ut()],Wp.prototype,"y2");M([ut()],Wp.prototype,"height");M([ut()],Wp.prototype,"inset");function CH(t,e,i){const n=at.angle(at.sub(e,t)),s=at.distance(t,e),a=at.add(t,at.rotate(at.from(s/2,0),n)),o=-1/at.gradient(t,e),r=at.intercept(a,o),l=Bmt(.1,.5,Math.PI/2-Math.abs(at.gradient(t,e))),c=at.intersectAtX(o,r,t.x),u=Math.max(i,at.distance(t,c)*l);return{angle:at.angle(at.sub(c,t),at.sub(c,a))/-(1.1-l),radius:u}}function Bmt(t,e,i){return Nt(t,(e-t)*i+t,e)}var{FillGradientDefaults:Vmt,FillPatternDefaults:_mt,FillImageDefaults:Fmt,makeSeriesTooltip:Hmt,SeriesProperties:jmt,Label:Gmt}=j,WA=class extends Gmt{constructor(){super(...arguments),this.spacing=1,this.placement=void 0,this.edgePlacement=void 0}};M([b],WA.prototype,"spacing");M([b],WA.prototype,"placement");M([b],WA.prototype,"edgePlacement");var ih=class extends xt{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};M([b],ih.prototype,"fill");M([b],ih.prototype,"fillOpacity");M([b],ih.prototype,"stroke");M([b],ih.prototype,"strokeOpacity");M([b],ih.prototype,"strokeWidth");M([b],ih.prototype,"lineDash");M([b],ih.prototype,"lineDashOffset");M([b],ih.prototype,"itemStyler");var ua=class extends xt{constructor(){super(...arguments),this.spacing=1,this.minSpacing=0,this.width=1,this.alignment="justify",this.verticalAlignment="center",this.sort="auto",this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};M([b],ua.prototype,"spacing");M([b],ua.prototype,"minSpacing");M([b],ua.prototype,"width");M([b],ua.prototype,"alignment");M([b],ua.prototype,"verticalAlignment");M([b],ua.prototype,"sort");M([b],ua.prototype,"fill");M([b],ua.prototype,"fillOpacity");M([b],ua.prototype,"stroke");M([b],ua.prototype,"strokeOpacity");M([b],ua.prototype,"strokeWidth");M([b],ua.prototype,"lineDash");M([b],ua.prototype,"lineDashOffset");M([b],ua.prototype,"itemStyler");var vn=class extends jmt{constructor(){super(...arguments),this.nodes=void 0,this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.fillGradientDefaults=new Vmt,this.fillPatternDefaults=new _mt,this.fillImageDefaults=new Fmt,this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=[],this.strokes=[],this.label=new WA,this.link=new ih,this.node=new ua,this.tooltip=Hmt()}getStyle(t,e,i,n){const{fillOpacity:s,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l,fill:c=e[n%e.length],stroke:u=i[n%e.length]}=t?this.link:this.node;return{fill:c,fillOpacity:s,stroke:u,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l}}};M([b],vn.prototype,"nodes");M([b],vn.prototype,"fromKey");M([b],vn.prototype,"toKey");M([b],vn.prototype,"idKey");M([b],vn.prototype,"idName");M([b],vn.prototype,"labelKey");M([b],vn.prototype,"labelName");M([b],vn.prototype,"sizeKey");M([b],vn.prototype,"sizeName");M([b],vn.prototype,"fillGradientDefaults");M([b],vn.prototype,"fillPatternDefaults");M([b],vn.prototype,"fillImageDefaults");M([b],vn.prototype,"defaultColorRange");M([b],vn.prototype,"defaultPatternFills");M([b],vn.prototype,"fills");M([b],vn.prototype,"strokes");M([b],vn.prototype,"label");M([b],vn.prototype,"link");M([b],vn.prototype,"node");M([b],vn.prototype,"tooltip");var{Transformable:Umt,SeriesNodePickMode:wH,createDatumId:OS,getShapeStyle:NH,getLabelStyles:Wmt,Rect:TH,BBox:LH}=j,bY=class extends x5{constructor(t){super({moduleCtx:t,pickModes:[wH.NEAREST_NODE,wH.EXACT_SHAPE_MATCH]}),this.properties=new vn}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new Wp}nodeFactory(){return new TH}createNodeData(){const t=this._nodeDataDependencies?.seriesRectWidth??0,e=this.properties.node.width,{nodeGraph:i,links:n,maxPathLength:s}=this.getNodeGraph(this.createNode.bind(this,e),this.createLink,{includeCircularReferences:!1}),a=i;if(a.size===0)return;const o=this.initialiseColumns(s);this.assignNodesToColumns(a,o,s);const r=Ve(this.properties.label),{columnLabelInsetBefore:l,columnLabelInsetAfter:c}=this.getColumnLabelInsets(o,r,s),u=(t-e-l-c)/(s-1);this.positionNodesInColumnsX(o,u,l),this.createGhostNodesAndColumnDiffs(a,o),this.weightNodes(o);const d=1,{sizeScale:g,nodeSpacing:f}=this.getScaleAndSpacing(o,d);if(g<0){pt.warnOnce("There was insufficient space to display the Sankey Series. Reduce [node.spacing], [node.minSpacing], or provide a larger container.");return}this.positionNodesInColumnsY(o,d,g,f),this.sortAndPositionLinks(a,g);const y=[],x=[];return this.createNodesNodeData(y,a,o,u,r,x),this.createLinksNodeData(y,n,d,g),{itemId:this.id,nodeData:y,labelData:x}}createNode(t,e){return{...e,x:Number.NaN,y:Number.NaN,width:t,height:Number.NaN}}createLink(t){return{...t,x1:Number.NaN,x2:Number.NaN,y1:Number.NaN,y2:Number.NaN,height:Number.NaN,elbows:[]}}initialiseColumns(t){const e=[];for(let i=0;ix+S.size,0),u.reduce((x,{link:S})=>x+S.size,0));if(c.length===0&&u.length===0||d===0){r.columnIndex=-1;continue}const g=this.getNodeColumn(e,r,i);l.size=d;const{label:f}=this.properties,y=f.enabled?this.getLabelText(l.label,l.datum,o,"label",[],this.properties.label,{datum:l.datum,value:l.label,fromKey:n,toKey:s,sizeKey:a,size:d}):void 0;l.label=ce(y),g.nodes.push(r),g.size+=d,r.columnIndex=g.index}}getNodeColumn(t,e,i){const{node:{alignment:n}}=this.properties,{linksBefore:s,linksAfter:a,maxPathLengthBefore:o,maxPathLengthAfter:r}=e;let l;switch(n){case"left":l=t[o];break;case"right":l=t[i-1-r];break;case"center":{if(s.length!==0)l=t[o];else if(a.length===0)l=t[0];else{const c=a.reduce((u,d)=>Math.min(u,d.node.maxPathLengthBefore),i)-1;l=t[c]}break}case"justify":{l=a.length===0?t[i-1]:t[o];break}}return l}getColumnLabelInsets(t,e,i){const{label:{spacing:n,placement:s,edgePlacement:a},node:{width:o}}=this.properties,r=this._nodeDataDependencies?.seriesRectWidth??0;let l=0,c=0;if(this.isLabelEnabled()&&(a==="outside"||a==null)){const u=(d,g)=>{const f=g;if(f.datum.label==null||f.datum.label==="")return d;let y=(r-o)/(i-1)-n;s==="center"&&a==null&&(y/=2);const x=kc(f.datum.label,{maxWidth:y,maxHeight:f.datum.height,font:this.properties.label,textWrap:"never"});let{width:S}=e.measureLines(x);return s==="center"&&a==null&&(S/=2),Math.max(d,S)};(s!=="right"||a==="outside")&&(l=o+t[0].nodes.reduce(u,0)),(s!=="left"||a==="outside")&&(c=o+t.at(-1).nodes.reduce(u,0))}return{columnLabelInsetBefore:l,columnLabelInsetAfter:c}}positionNodesInColumnsX(t,e,i){for(let n=0;nt.columnIndex;a--){const o=n.link.size,r={ghost:!0,datum:{...t.datum,size:o,y:0,height:0},weight:0,linksBefore:[{node:{columnIndex:a-1,datum:{size:o}}}],linksAfter:[{node:{columnIndex:a+1,datum:{size:o}}}],link:n.link,columnIndex:t.columnIndex,size:t.datum.size,closestColumnDiff:i,fromNode:{y:s.datum.y},toNode:{y:0}};e[a].size+=o,e[a].nodes.push(r)}}}weightNodes(t){const{properties:e}=this;if(e.node.sort==="data")return;if(e.node.sort!=="auto"){for(const s of t)s.nodes.sort((a,o)=>this.sortNodes(a,o));return}const i=t.toSorted((s,a)=>{const o=s.nodes.reduce((l,c)=>Math.max(l,c.datum.size),0);return a.nodes.reduce((l,c)=>Math.max(l,c.datum.size),0)-o}),n={};for(let s=0;sa.weight-o.weight)}for(const s of t){for(const a of s.nodes)"ghost"in a&&a.ghost||(a.weight+=a.linksBefore.reduce((o,r)=>{if(r.node.columnIndex!==s.index-1)return o;const l=t[r.node.columnIndex].nodes.indexOf(r.node)*n[r.node.columnIndex];return Math.max(o,l)},0),a.weight+=a.linksAfter.reduce((o,r)=>{if(r.node.columnIndex!==s.index+1)return o;const l=t[r.node.columnIndex].nodes.indexOf(r.node)*n[r.node.columnIndex];return Math.max(o,l)},0));s.nodes.sort((a,o)=>this.sortNodes(a,o))}}getScaleAndSpacing(t,e){const i=this._nodeDataDependencies?.seriesRectHeight??0,n=o=>t.reduce((r,{size:l,nodes:c})=>{const u=i-c.length*e,g=(1-(c.length-1)*o/u)/l;return Math.min(r,g)},1/0);let s=this.properties.node.spacing,a=n(s);for(;a<0&&s>this.properties.node.minSpacing;)s-=1,a=n(s);return{nodeSpacing:s,sizeScale:a}}positionNodesInColumnsY(t,e,i,n){const s=this._nodeDataDependencies?.seriesRectHeight??0;for(const a of t){let o=0;for(const c of a.nodes){const u=s*c.datum.size*i;c.datum.height=Math.max(e,u),o+=u}const r=n*(a.nodes.length-1);let l=0;this.properties.node.verticalAlignment==="bottom"?l=s-o-r:this.properties.node.verticalAlignment==="center"&&(l=(s-o-r)/2);for(const c of a.nodes)c.datum.y=l,l+=s*c.datum.size*i+n,"ghost"in c&&c.ghost&&c.link.elbows.push({x:a.x,y:c.datum.y})}}sortAndPositionLinks(t,e){const i=this._nodeDataDependencies?.seriesRectHeight??0;for(const{datum:n,linksBefore:s,linksAfter:a}of t.values()){let o=n.y;s.sort((l,c)=>this.sortNodes(l.node,c.node));for(const{link:l}of s)l.y2=o,o+=l.size*i*e;let r=n.y;a.sort((l,c)=>this.sortNodes(l.node,c.node,{invertColumnSort:!0}));for(const{link:l}of a)l.y1=r,r+=l.size*i*e}}createNodesNodeData(t,e,i,n,s,a){for(const[o,r]of i.entries()){const l=o===0,c=o===i.length-1;let u=-1/0;r.nodes.sort((d,g)=>d.datum.y-g.datum.y);for(const d of r.nodes){if("ghost"in d&&d.ghost)continue;const{datum:g}=d;g.midPoint={x:g.x+g.width/2,y:g.y+g.height/2},t.push(g),u=this.createNodeLabelData(e,n,s,a,g,l,c,u)}}}createNodeLabelData(t,e,i,n,s,a,o,r){if(s.label==null)return r;const{label:{spacing:l,edgePlacement:c,fontSize:u}}=this.properties,d=this._nodeDataDependencies?.seriesRectWidth??0,g=s.y+s.height/2;let f;if(!a&&!o){const I=nr(u),w=g-I,N=g+I;let O=d;for(const{datum:R}of t.values())R.x>s.x&&Math.max(R.y,w)<=Math.min(R.y+R.height,N)&&(O=Math.min(O,R.x-l));const L=O-s.x-2*l;f=kc(s.label,{maxWidth:L,maxHeight:s.height,font:this.properties.label,textWrap:"never",overflow:"hide"})}if(f==null||f===""){const I=c==null&&(a||o)?l:l*2;f=kc(s.label,{maxWidth:e-I,maxHeight:s.height,font:this.properties.label,textWrap:"never"})}if(f==="")return r;const{height:y}=i.measureLines(f),x=g-y/2,S=g+y/2,{x:D,textAlign:A}=this.getNodeLabelPlacement(s,a,o);return x>=r&&(n.push({x:D,y:g,textAlign:A,text:f,size:s.size,nodeDatum:s,datumIndex:s.datumIndex}),r=S),r}getNodeLabelPlacement(t,e,i){const{label:{spacing:n,placement:s,edgePlacement:a}}=this.properties;let o=t.x+t.width+n,r="left",l=s;return e&&a==null&&s==null&&(l="left"),a==="outside"?(e&&(l="left"),i&&(l="right")):a==="inside"&&(e&&(l="right"),i&&(l="left")),l==="left"?(o=t.x-n,r="right"):l==="center"&&(o=t.x+t.width/2,r="center"),{x:o,textAlign:r}}createLinksNodeData(t,e,i,n){const s=this._nodeDataDependencies?.seriesRectHeight??0,a=this.properties.node.width;for(const o of e){const{fromNode:r,toNode:l,size:c}=o;o.height=Math.max(i,s*c*n),o.x1=r.x+a,o.x2=l.x,o.midPoint={x:(o.x1+o.x2)/2,y:(o.y1+o.y2)/2+o.height/2},t.push(o)}}sortNodes(t,e,i){const{properties:n}=this;return n.node.sort==="ascending"?(t.datum.label??"").localeCompare(e.datum.label??""):n.node.sort==="descending"?(e.datum.label??"").localeCompare(t.datum.label??""):n.node.sort==="data"?0:t.columnIndexe.columnIndex?i?.invertColumnSort?-1:1:t.weight===e.weight?t.datum.size-e.datum.size:t.closestColumnDiffe.closestColumnDiff?-1:t.weight-e.weight}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes(t){const e=this.getHighlightedDatum();t.labelSelection.each((i,n)=>{const{x:s,y:a,textAlign:o,text:r,datumIndex:l,nodeDatum:c}=n,u={fromKey:this.properties.fromKey,size:n.size,sizeKey:this.properties.sizeKey,toKey:this.properties.toKey},d=this.isLabelHighlighted(c,e),g=this.getHighlightStyle(d,l),f=Wmt(this,void 0,u,this.properties.label,d,e),{color:y,fontStyle:x,fontWeight:S,fontSize:D,fontFamily:A}=f;i.visible=!0,i.x=s,i.y=a,i.text=r,i.fill=y,i.fontStyle=x,i.fontWeight=S,i.fontSize=D,i.fontFamily=A,i.textAlign=o,i.textBaseline="middle";const I=g.opacity??1;i.opacity=I,i.fillOpacity=I,i.setBoxing(f)})}updateNodeSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>OS(e.type,e.id))}getNodeStyle(t,e,i){const{properties:n}=this,{fills:s,strokes:a,defaultColorRange:o,defaultPatternFills:r,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:u}=n,{itemStyler:d}=n.node,g=o[e%o.length].map(A=>({color:A})),f=r[e%r.length],y=this.getHighlightStyle(i,t.datumIndex),x=Et(y,n.getStyle(!1,s,a,e)),S=n.node.fill!=null;let D=NH(x,S?l:{...l.toJson(),colorStops:g},S?c:{...c.toJson(),fill:f,stroke:f},u);if(d!=null&&t.datumIndex!=null){const A=this.cachedDatumCallback(OS(t.datumIndex.index,"node",i?"highlight":"node"),()=>{const I=this.makeItemStylerParams(t,i,D);return this.callWithContext(d,I)});A&&(D=Et(A,D,{...l.toJson(),colorStops:g},{...c.toJson(),fill:f,stroke:f},u))}return D.opacity=1,D}makeItemStylerParams({datum:t,datumIndex:e,size:i=0,label:n},s,a){const{id:o}=this,r=this.ctx.highlightManager?.getActiveHighlight(),l=this.getHighlightStateString(r,s,e),c=this.filterItemStylerFillParams(a.fill)??a.fill;return{seriesId:o,datum:t,highlightState:l,...a,size:i,label:n,fill:c}}updateNodeNodes(t){const{datumSelection:e,isHighlight:i}=t,n=this.getShapeFillBBox();e.each((s,a)=>{const{datumIndex:o}=a,r=this.getNodeStyle(a,o.index,i);s.x=a.x,s.y=a.y,s.width=Math.max(a.width,0),s.height=Math.max(a.height,0),s.setStyleProperties(r,n)})}getShapeFillBBox(){const t=this._nodeDataDependencies?.seriesRectWidth??0,e=this._nodeDataDependencies?.seriesRectHeight??0,i=new LH(0,0,t,e);return{series:i,axis:i}}updateLinkSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>OS(e.type,e.index,e.fromNode.id,e.toNode.id))}getLinkStyle({datumIndex:t,datum:e},i,n){const{id:s,properties:a}=this,{fills:o,strokes:r,defaultColorRange:l,defaultPatternFills:c,fillGradientDefaults:u,fillPatternDefaults:d,fillImageDefaults:g}=a,{itemStyler:f}=a.link,y=l[i.index%l.length].map(w=>({color:w})),x=c[i.index%c.length],S=this.getHighlightStyle(n,t),D=Et(S,a.getStyle(!0,o,r,i.index)),A=a.link.fill!=null;let I=NH(D,A?u:{...u.toJson(),colorStops:y},A?d:{...d.toJson(),fill:x,stroke:x},g);if(f!=null&&t!=null){const w=this.cachedDatumCallback(OS(t.index,"link",n?"highlight":"node"),()=>{const N=this.ctx.highlightManager?.getActiveHighlight(),O=this.getHighlightStateString(N,n,t);return this.callWithContext(f,{seriesId:s,datum:e,highlightState:O,...I})});w&&(I=Et(w,I,{...u.toJson(),colorStops:y},{...d.toJson(),fill:x,stroke:x},g))}return I.opacity=1,I}updateLinkNodes(t){const{datumSelection:e,isHighlight:i}=t,n=this.getShapeFillBBox();e.each((s,a)=>{const o=a.fromNode.datumIndex,r=this.getLinkStyle(a,o,i);s.x1=a.x1,s.y1=a.y1,s.x2=a.x2,s.y2=a.y2,s.height=a.height,s.elbows=a.elbows,s.setStyleProperties(r,n),s.inset=s.strokeWidth/2})}getTooltipContent(t){const{id:e,linksProcessedData:i,nodesProcessedData:n,properties:s,ctx:{formatManager:a}}=this,{fromKey:o,toKey:r,sizeKey:l,sizeName:c,tooltip:u}=s,d=this.contextNodeData?.nodeData.find(A=>A.datumIndex.type===t.type&&A.datumIndex.index===t.index);if(d==null)return;const g=d.type===0?d.fromNode.index:d.index,f=d.type===0?`${d.fromNode.label} - ${d.toNode.label}`:d.label,y=t.type===0?i?.dataSources.get(this.id)?.data[t.index]:n?.dataSources.get(this.id)?.data[t.index],x=d.size;let S;if(d.type===0){const A=d.fromNode.datumIndex;S=this.getLinkStyle({datumIndex:t,datum:y},A,!1)}else S=this.getNodeStyle({datumIndex:t,datum:y},t.index,!1);const D=[];if(l!=null){const A=a.format(this.callWithContext.bind(this),{type:"number",value:x,datum:y,seriesId:e,legendItemName:void 0,key:l,source:"tooltip",property:"size",domain:[],boundSeries:this.getFormatterContext("size"),fractionDigits:void 0,visibleDomain:void 0});D.push({label:c,fallbackLabel:l,value:A??String(x)})}return this.formatTooltipWithContext(u,{title:f,symbol:this.legendItemSymbol(d.type,g,S),data:D},{seriesId:e,datum:y,title:f,fromKey:o,toKey:r,sizeKey:l,sizeName:c,size:x,...S})}computeFocusBounds(t){if(t instanceof TH){const{x:e,y:i,width:n,height:s}=t,a=new LH(e,i,n,s);return Umt.toCanvas(this.contentGroup,a)}return t}hasItemStylers(){return this.properties.node.itemStyler!=null||this.properties.link.itemStyler!=null||this.properties.label.itemStyler!=null}};bY.className="SankeySeries";bY.type="sankey";var{sankeySeriesThemeableOptionsDef:Kmt}=j,pv={...Kmt,..._e,type:ht(Jt("sankey")),fromKey:ht(K),toKey:ht(K)};pv.fillGradientDefaults=Mt(sD);pv.fillPatternDefaults=Mt(aD);pv.fillImageDefaults=Mt(oD);pv.defaultColorRange=Mt(Ft(Ft(It)));pv.defaultPatternFills=Mt(Ft(It));({...Oe});var{HierarchySeriesProperties:Ymt,makeSeriesTooltip:$mt,HighlightProperties:Xmt}=j,ku=class extends xt{};M([b],ku.prototype,"fill");M([b],ku.prototype,"fillOpacity");M([b],ku.prototype,"stroke");M([b],ku.prototype,"strokeWidth");M([b],ku.prototype,"strokeOpacity");M([b],ku.prototype,"opacity");var rE=class extends Xmt{constructor(){super(...arguments),this.highlightedBranch=new ku,this.unhighlightedBranch=new ku}};M([b],rE.prototype,"highlightedBranch");M([b],rE.prototype,"unhighlightedBranch");var da=class extends Ymt{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=0,this.strokeOpacity=1,this.cornerRadius=0,this.highlight=new rE,this.label=new Om,this.secondaryLabel=new PA,this.tooltip=$mt()}getStyle(t){const{fills:e,strokes:i,fillOpacity:n,strokeWidth:s,strokeOpacity:a}=this;return{fill:e[t%e.length],fillOpacity:n,stroke:i[t%i.length],strokeWidth:s,strokeOpacity:a,opacity:1}}};M([b],da.prototype,"sizeName");M([b],da.prototype,"labelKey");M([b],da.prototype,"secondaryLabelKey");M([b],da.prototype,"fillOpacity");M([b],da.prototype,"strokeWidth");M([b],da.prototype,"strokeOpacity");M([b],da.prototype,"cornerRadius");M([b],da.prototype,"sectorSpacing");M([b],da.prototype,"padding");M([b],da.prototype,"itemStyler");M([b],da.prototype,"highlight");M([b],da.prototype,"label");M([b],da.prototype,"secondaryLabel");M([b],da.prototype,"tooltip");var{fromToMotion:Zmt,createDatumId:qmt,PointerEvents:Qmt,Sector:OH,Group:ES,ScalableGroup:Jmt,Selection:jw,TransformableText:Gw,BBox:EH,getLabelStyles:tyt,toHierarchyHighlightString:eyt}=j,iyt=class extends j.HierarchyNode{constructor(){super(...arguments),this.label=void 0,this.secondaryLabel=void 0,this.contentHeight=0,this.bbox=void 0,this.startAngle=0,this.endAngle=0}};function xY(t,e=0,i=2*Math.PI/t.sumSize){for(const n of t.children){const s=e+n.sumSize*i;n.startAngle=e,n.endAngle=s,xY(n,e,i),e=s}}var vY=class extends j.HierarchySeries{constructor(t){super(t),this.NodeClass=iyt,this.properties=new da,this.scalingGroup=this.contentGroup.appendChild(new Jmt),this.sectorGroup=this.scalingGroup.appendChild(new ES),this.highlightSectorGroup=this.scalingGroup.appendChild(new ES),this.sectorLabelGroup=this.scalingGroup.appendChild(new ES),this.datumSelection=jw.select(this.sectorGroup,OH),this.labelSelection=jw.select(this.sectorLabelGroup,ES),this.highlightSelection=jw.select(this.highlightSectorGroup,OH),this.sectorLabelGroup.pointerEvents=Qmt.None}processData(){super.processData(),xY(this.rootNode)}updateSelections(){const t=this.getActiveHighlightNode();if(this.highlightSelection.update(t==null?[]:[t],void 0,a=>this.getDatumId(a)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{chart:e}=this;if(e==null||e.seriesRect==null)return;const n=Array.from(this.rootNode),s=a=>{a.append([new Gw({tag:0}),new Gw({tag:1})])};this.datumSelection.update(n,void 0,a=>this.getDatumId(a)),this.labelSelection.update(n,s,a=>this.getDatumId(a))}getItemStyle(t,e){const{properties:i,colorScale:n}=this,{itemStyler:s}=i,a=t.datumIndex?.[0]??0,o=this.getActiveHighlightNode(),r=this.getHierarchyHighlightState(e,o,t),l=this.getHierarchyHighlightStyles(r,this.properties.highlight),c=Et(l,i.getStyle(a));t.colorValue!=null&&l?.fill==null&&(c.fill=n.convert(t.colorValue));let u=c;if(s!=null&&t!=null){const d=this.cachedDatumCallback(qmt(this.getDatumId(t),e?"highlight":"node"),()=>{const g=this.makeItemStylerParams(t,u,eyt(r));return this.callWithContext(s,g)});d&&(u=Et(d,u))}return u}makeItemStylerParams(t,e,i){const{id:n}=this,s=this.filterItemStylerFillParams(e.fill)??e.fill;return{seriesId:n,datum:t.datum,depth:t.depth??0,highlightState:i,...e,fill:s}}updateNodes(){const{chart:t,data:e,maxDepth:i}=this;if(t==null||e==null)return;const{width:n,height:s}=t.seriesRect,{sectorSpacing:a=0,padding:o=0,cornerRadius:r,childrenKey:l,colorKey:c,colorName:u,labelKey:d,secondaryLabelKey:g,sizeKey:f,sizeName:y}=this.properties;this.contentGroup.translationX=n/2,this.contentGroup.translationY=s/2;const x=a*.5,S=Math.min(n,s)/2,D=S/(i+1),A=-Math.PI/2,I={series:new EH(-S,-S,2*S,2*S),axis:new EH(-S,-S,2*S,2*S)};this.rootNode?.walk(R=>{const{startAngle:P,endAngle:B}=R;if(R.depth!=null){const F=(P+B)/2+A,H=(R.depth+.5)*D;R.midPoint.x=Math.cos(F)*H,R.midPoint.y=Math.sin(F)*H}}),this.rootNode?.walk(R=>{const{datum:P,depth:B,startAngle:F,endAngle:H,parent:$,sumSize:Y}=R;R.label=void 0,R.secondaryLabel=void 0,R.contentHeight=0;let U;if(P!=null&&B!=null&&d!=null){const Ce=P[d];U=this.getLabelText(Ce,P,d,"label",[],this.properties.label,{depth:B,datum:P,childrenKey:l,colorKey:c,colorName:u,labelKey:d,secondaryLabelKey:g,sizeKey:f,sizeName:y,value:Ce})}U===""&&(U=void 0);let V;if(P!=null&&B!=null&&g!=null){const Ce=P[g];V=this.getLabelText(Ce,P,g,"secondaryLabel",[],this.properties.secondaryLabel,{depth:B,datum:P,childrenKey:l,colorKey:c,colorName:u,labelKey:d,secondaryLabelKey:g,sizeKey:f,sizeName:y,value:Ce})}if(V===""&&(V=void 0),B==null)return;const Z=B*D+x,W=(B+1)*D-x,q=Z>x?x/Z:x,nt=W>x?x/W:x,G=F+q,st=H+q-G,lt=F+nt,Dt=H+nt-lt,kt=Ce=>{if(B===0&&$?.sumSize===Y)return{width:2*Math.sqrt(W**2-(Ce*.5)**2),height:Ce,meta:0};const zn=Ce,Kn=2*Math.sqrt(W**2-(Z+zn)**2),ln=st=mr?{width:mi,height:zn,meta:1}:{width:mr,height:Lo,meta:2}},Vt=EO(ce(U),this.properties.label,ce(V),this.properties.secondaryLabel,{padding:o},kt);if(Vt==null)return;const{width:Kt,height:ae,meta:ne,label:Qt,secondaryLabel:zt}=Vt,Pt=A+(F+H)/2,ue=Math.sin(Pt)>=0,oe=Math.cos(Pt)>=0,ke=(ue?3:12)&(oe?6:9);let Ye;switch(ne){case 0:Ye=0;break;case 1:{const Di=W-(D-ae)*.58,zn=Math.sqrt((W-o)**2-(Kt/2)**2);Ye=Math.min(Di,zn);break}case 2:if(B===0){const Ce=ae/(2*Math.tan(st*.5))+Kt*.5,Di=Math.sqrt(W**2-(ae*.5)**2)-Kt*.5;Ye=(Ce+Di)*.5}else Ye=(Z+W)*.5;break}if(Qt!=null){const{fontStyle:Ce="normal",fontFamily:Di,fontWeight:zn="normal",color:Kn="black"}=this.properties.label;R.label={...Qt,fontStyle:Ce,fontFamily:Di,fontWeight:zn,color:Kn,labelPlacement:ne,circleQuarter:ke,radius:Ye,theta:Pt}}if(zt!=null){const{fontStyle:Ce="normal",fontFamily:Di,fontWeight:zn="normal",color:Kn="black"}=this.properties.secondaryLabel;R.secondaryLabel={...zt,fontStyle:Ce,fontFamily:Di,fontWeight:zn,color:Kn,labelPlacement:ne,circleQuarter:ke,radius:Ye,theta:Pt}}R.contentHeight=Vt.height});const w=(R,P,B)=>{const{depth:F,startAngle:H,endAngle:$}=R;if(F==null){P.visible=!1;return}P.visible=!0;const Y=this.getItemStyle(R,B),U=Y.fill,V=Y.strokeWidth,Z=an(U)&&U.bounds!=="item"?I:void 0;P.setStyleProperties(Y,Z),P.centerX=0,P.centerY=0,P.innerRadius=F*D,P.outerRadius=(F+1)*D,P.startAngle=H+A,P.endAngle=$+A,P.inset=x+V*.5,P.cornerRadius=r};this.datumSelection.each((R,P)=>{w(P,R,!1)}),this.highlightSelection.each((R,P)=>{w(P,R,!0)});const N=this.getActiveHighlightNode(),O=(R,P,B,F)=>{const{depth:H,contentHeight:$}=R,Y=B===0,U=Y?R.label:R.secondaryLabel;if(H==null||U==null){P.visible=!1;return}const{labelPlacement:V,circleQuarter:Z,radius:W,theta:q}=U,nt=this.getHierarchyHighlightState(F,N,R),{opacity:G}=this.getHierarchyHighlightStyles(nt,this.properties.highlight)??{},et={childrenKey:this.properties.childrenKey,colorKey:this.properties.colorKey,colorName:this.properties.colorName??this.properties.colorKey,depth:R.depth??Number.NaN,labelKey:this.properties.labelKey,secondaryLabelKey:this.properties.secondaryLabelKey,sizeKey:this.properties.sizeKey,sizeName:this.properties.sizeName??this.properties.sizeKey},st=Y?this.properties.label:this.properties.secondaryLabel,lt=this.ctx.highlightManager?.getActiveHighlight(),mt=tyt(this,R,et,st,F,lt);switch(P.text=U.text,P.fontSize=U.fontSize,P.lineHeight=U.lineHeight,P.fontStyle=U.fontStyle,P.fontFamily=U.fontFamily,P.fontWeight=U.fontWeight,P.fillOpacity=G??1,P.fill=mt.color,P.setBoxing(mt),V){case 0:P.textAlign="center",P.textBaseline="top",P.translationX=0,P.translationY=(Y?0:$-U.height)-$*.5,P.rotation=0;break;case 1:{const Dt=(Z&3)!==0,kt=Y===!Dt?W:W-($-U.height);P.textAlign="center",P.textBaseline=Dt?"bottom":"top",P.translationX=Math.cos(q)*kt,P.translationY=Math.sin(q)*kt,P.rotation=Dt?q-Math.PI*.5:q+Math.PI*.5;break}case 2:{const Dt=(Z&6)!==0,kt=Y===!Dt?($-U.height)*.5:(U.height-$)*.5;P.textAlign="center",P.textBaseline="middle",P.translationX=Math.cos(q)*W+Math.cos(q+Math.PI/2)*kt,P.translationY=Math.sin(q)*W+Math.sin(q+Math.PI/2)*kt,P.rotation=Dt?q:q+Math.PI;break}}P.visible=!0},L=this.getActiveHighlightNode();for(const R of this.labelSelection.selectByClass(Gw)){const P=R.closestDatum();O(P,R,R.tag,P===L)}}getTooltipContent(t){const{id:e,properties:i,ctx:n}=this,{labelKey:s,secondaryLabelKey:a,childrenKey:o,sizeKey:r,sizeName:l,colorKey:c,colorName:u,tooltip:d}=i,{formatManager:g}=n,f=t.reduce((O,L)=>O?.children[L],this.rootNode);if(f==null)return;const{datum:y,depth:x}=f;if(y==null||x==null)return;const S=[],D=r==null?void 0:y[r];if(D!=null){const O=[0,this.rootNode?.sumSize??0],L=g.format(this.callWithContext.bind(this),{type:"number",value:D,datum:y,seriesId:e,legendItemName:void 0,key:r,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:O,fractionDigits:void 0,visibleDomain:void 0});S.push({label:l,fallbackLabel:r,value:L??Or(D)})}const A=c==null?void 0:y[c];if(A!=null){const{colorDomain:O}=this,L=g.format(this.callWithContext.bind(this),{type:"number",value:A,datum:y,seriesId:e,legendItemName:void 0,key:c,source:"tooltip",property:"color",boundSeries:this.getFormatterContext("color"),domain:O,fractionDigits:void 0,visibleDomain:void 0});S.push({label:u,fallbackLabel:c,value:L??Or(A)})}const I=this.getItemStyle({...f,colorValue:A??f.colorValue},!1),N={shape:"square",fill:I.fill,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0};return an(N.fill)&&(N.fill={...N.fill,gradient:"linear",rotation:0,reverse:!1}),this.formatTooltipWithContext(d,{title:s==null?void 0:y[s],symbol:{marker:N},data:S},{seriesId:e,datum:y,title:void 0,depth:x,labelKey:s,secondaryLabelKey:a,childrenKey:o,sizeKey:r,sizeName:l,colorKey:c,colorName:u,...I})}createNodeData(){}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.datumSelection.nodes())}animateEmptyUpdateReady(){Zmt(this.id,"nodes",this.ctx.animationManager,[this.scalingGroup],{toFn(){return{scalingX:1,scalingY:1}},fromFn(){return{scalingX:0,scalingY:0}}})}computeFocusBounds(t){return t}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};vY.className="SunburstSeries";vY.type="sunburst";var{sunburstSeriesThemeableOptionsDef:nyt}=j;({...nyt,...At(_e,["highlightStyle","highlight","showInLegend"]),type:ht(Jt("sunburst"))});({...Oe,fontSize:Cn.LARGE},{...Oe,fontSize:Cn.SMALLEST});var{HierarchySeriesProperties:syt,makeSeriesTooltip:ayt,Label:oyt}=j,SY=class extends oyt{constructor(){super(...arguments),this.spacing=0}};M([b],SY.prototype,"spacing");var Cu=class extends xt{};M([b],Cu.prototype,"fill");M([b],Cu.prototype,"fillOpacity");M([b],Cu.prototype,"stroke");M([b],Cu.prototype,"strokeWidth");M([b],Cu.prototype,"strokeOpacity");M([b],Cu.prototype,"opacity");var lE=class extends xt{constructor(){super(...arguments),this.highlightedItem=new Cu,this.unhighlightedItem=new Cu}};M([b],lE.prototype,"highlightedItem");M([b],lE.prototype,"unhighlightedItem");var pl=class extends xt{};M([b],pl.prototype,"fill");M([b],pl.prototype,"fillOpacity");M([b],pl.prototype,"stroke");M([b],pl.prototype,"strokeWidth");M([b],pl.prototype,"strokeOpacity");M([b],pl.prototype,"opacity");var gv=class extends xt{constructor(){super(...arguments),this.highlightedBranch=new pl,this.highlightedItem=new pl,this.unhighlightedItem=new pl,this.unhighlightedBranch=new pl}};M([b],gv.prototype,"highlightedBranch");M([b],gv.prototype,"highlightedItem");M([b],gv.prototype,"unhighlightedItem");M([b],gv.prototype,"unhighlightedBranch");var To=class extends xt{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.gap=0,this.padding=0,this.interactive=!0,this.label=new SY,this.highlight=new lE}};M([b],To.prototype,"fill");M([b],To.prototype,"fillOpacity");M([b],To.prototype,"stroke");M([b],To.prototype,"strokeWidth");M([b],To.prototype,"strokeOpacity");M([b],To.prototype,"cornerRadius");M([b],To.prototype,"textAlign");M([b],To.prototype,"gap");M([b],To.prototype,"padding");M([b],To.prototype,"interactive");M([b],To.prototype,"label");M([b],To.prototype,"highlight");var Ka=class extends xt{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.verticalAlign="middle",this.gap=0,this.padding=0,this.label=new Om,this.secondaryLabel=new PA,this.highlight=new gv}};M([b],Ka.prototype,"fill");M([b],Ka.prototype,"fillOpacity");M([b],Ka.prototype,"stroke");M([b],Ka.prototype,"strokeWidth");M([b],Ka.prototype,"strokeOpacity");M([b],Ka.prototype,"cornerRadius");M([b],Ka.prototype,"textAlign");M([b],Ka.prototype,"verticalAlign");M([b],Ka.prototype,"gap");M([b],Ka.prototype,"padding");M([b],Ka.prototype,"label");M([b],Ka.prototype,"secondaryLabel");M([b],Ka.prototype,"highlight");var Wl=class extends syt{constructor(){super(...arguments),this.tooltip=ayt(),this.group=new To,this.tile=new Ka,this.undocumentedGroupFills=[],this.undocumentedGroupStrokes=[]}getStyle(t,e,i,n){const{fillOpacity:s,strokeWidth:a,strokeOpacity:o,fill:r=t?e[n%e.length]:e[Math.min(n,e.length)],stroke:l=t?i[n%e.length]:i[Math.min(n,i.length)]}=t?this.tile:this.group;return{fill:r,fillOpacity:s,stroke:l,strokeWidth:a,strokeOpacity:o,opacity:1}}};M([b],Wl.prototype,"sizeName");M([b],Wl.prototype,"labelKey");M([b],Wl.prototype,"secondaryLabelKey");M([b],Wl.prototype,"itemStyler");M([b],Wl.prototype,"tooltip");M([b],Wl.prototype,"group");M([b],Wl.prototype,"tile");M([b],Wl.prototype,"undocumentedGroupFills");M([b],Wl.prototype,"undocumentedGroupStrokes");var{createDatumId:ryt,Rect:RH,Group:PH,BBox:Fg,Selection:Uw,Text:Ww,Transformable:lyt,getLabelStyles:cyt,HierarchyHighlightState:Sr,toHierarchyHighlightString:$y}=j,hyt=class extends j.HierarchyNode{constructor(){super(...arguments),this.labelValue=void 0,this.secondaryLabelValue=void 0,this.label=void 0,this.secondaryLabel=void 0,this.bbox=void 0,this.padding=void 0}};function Fh(t){return t.children.length>0?t.sumSize-t.sizeValue:t.sizeValue}var zH={left:0,center:.5,right:1},uyt={top:0,middle:.5,bottom:1};(class extends j.Group{distanceSquared(t,e){return this.getBBox().distanceSquared(t,e)}});var MY=class extends j.HierarchySeries{constructor(){super(...arguments),this.NodeClass=hyt,this.properties=new Wl,this.rectGroup=this.contentGroup.appendChild(new PH),this.datumSelection=Uw.select(this.rectGroup,RH),this.labelSelection=Uw.select(this.labelGroup,PH),this.highlightSelection=Uw.select(this.rectGroup,RH)}groupTitleHeight(t,e){const{label:n}=this.properties.group,{labelValue:s}=t,{fontSize:a}=n;if(n.enabled&&s!=null&&a<=e.width/3&&a<=e.height/3){const{height:o}=Ve(n).measureLines(s);return Math.max(o,a)}}getNodePadding(t,e){if(t.parent==null)return{top:0,right:0,bottom:0,left:0};if(t.children.length===0){const{padding:o}=this.properties.tile;return{top:o,right:o,bottom:o,left:o}}const{padding:i,label:{spacing:n}}=this.properties.group,s=this.groupTitleHeight(t,e),a=s==null?0:s+n;return{top:i+a,right:i,bottom:i,left:i}}sortChildren({children:t}){const e=Array.from(t,(n,s)=>s).filter(n=>Fh(t[n])>0).sort((n,s)=>Fh(t[s])-Fh(t[n]));return{sortedChildrenIndices:e,childAt:n=>{const s=e[n];return t[s]}}}squarify(t,e){const{datum:i,children:n}=t;if(e.width<=0||e.height<=0){t.bbox=void 0,t.padding=void 0,t.midPoint.x=Number.NaN,t.midPoint.y=Number.NaN;return}const s=i==null?{top:0,right:0,bottom:0,left:0}:this.getNodePadding(t,e);t.parent==null?(t.bbox=void 0,t.padding=void 0,t.midPoint.x=Number.NaN,t.midPoint.y=Number.NaN):(t.bbox=e,t.padding=s,t.midPoint.x=e.x+e.width/2,t.midPoint.y=e.y);const{sortedChildrenIndices:a,childAt:o}=this.sortChildren(t),r=a.every(N=>n[N].children.length===0),l=1,c=e.width-s.left-s.right,u=e.height-s.top-s.bottom;if(c<=0||u<=0)return;const d=a.length;let g=0,f=0,y=1/0,x=a.reduce((N,O)=>N+Fh(n[O]),0);const S=new Fg(e.x+s.left,e.y+s.top,c,u),D=S.clone();let A=0;for(;A({left:l.x,top:l.y,right:l.x+l.width,bottom:l.y+l.height}),a=s(t),o=s(e),r=["top","right","bottom","left"];for(const l of r)be(a[l],o[l])||e.shrink(n,l)}createNodeData(){}getItemStyle(t,e,i){const{properties:n,colorScale:s}=this,{itemStyler:a}=n,o=t.datumIndex?.[0]??0,r=e?n.fills:n.undocumentedGroupFills,l=e?n.strokes:n.undocumentedGroupStrokes,c=e?o:t.depth??-1,u=this.getActiveHighlightNode(),d=this.getHierarchyHighlightState(i,u,t),g=this.getGroupHighlightState(i,u,t),f=e?d:g,y=e?this.getTileHighlightStyle(d,g,u):this.getGroupHighlightStyle(g),x=Et(y,n.getStyle(e,r,l,c));e&&t.colorValue!=null&&y?.fill==null&&(x.fill=s.convert(t.colorValue));let S=x;if(a!=null&&t!=null){const D=this.cachedDatumCallback(ryt(this.getDatumId(t),i?"highlight":"node"),()=>{const A=this.makeItemStylerParams(t,S,$y(f));return this.callWithContext(a,A)});D&&(S=Et(D,S))}return S}makeItemStylerParams(t,e,i){const{id:n}=this,s=this.filterItemStylerFillParams(e.fill)??e.fill;return{seriesId:n,datum:t.datum,depth:t.depth??-1,highlightState:i,...e,fill:s}}updateSelections(){const t=this.getActiveHighlightNode();if(this.highlightSelection.update(t==null?[]:[t],void 0,s=>this.getDatumId(s)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{seriesRect:e}=this.chart??{};if(!e)return;const i=Array.from(this.rootNode),n=s=>{s.append([new Ww({tag:0}),new Ww({tag:1})])};this.datumSelection.update(i,void 0,s=>this.getDatumId(s)),this.labelSelection.update(i,n,s=>this.getDatumId(s))}getActiveHighlightNode(){const t=super.getActiveHighlightNode();if(!(t?.children.length&&!this.properties.group.interactive))return t}updateNodes(){const{rootNode:t,data:e}=this,{childrenKey:i,colorKey:n,colorName:s,labelKey:a,secondaryLabelKey:o,sizeKey:r,sizeName:l,tile:c,group:u}=this.properties,{seriesRect:d}=this.chart??{};if(!d||!e)return;this.rootNode?.walk(A=>{const{datum:I,depth:w,children:N}=A,O=N.length===0,L=O?c.label:u.label;let R;if(L.enabled&&I!=null&&w!=null&&a!=null){const B=I[a];R=this.getLabelText(B,I,a,"label",[],L,{depth:w,datum:I,childrenKey:i,colorKey:n,colorName:s,labelKey:a,secondaryLabelKey:o,sizeKey:r,sizeName:l,value:B})}R===""&&(R=void 0);let P;if(c.secondaryLabel.enabled&&O&&I!=null&&w!=null&&o!=null){const B=I[o];P=this.getLabelText(B,I,o,"secondaryLabel",[],c.secondaryLabel,{depth:w,datum:I,childrenKey:i,colorKey:n,colorName:s,labelKey:a,secondaryLabelKey:o,sizeKey:r,sizeName:l,value:B})}P===""&&(P=void 0),A.labelValue=ce(R),A.secondaryLabelValue=ce(P)});const{width:g,height:f}=d;this.squarify(t,new Fg(0,0,g,f)),this.rootNode?.walk(A=>{const{bbox:I,children:w,labelValue:N,secondaryLabelValue:O}=A;if(A.label=void 0,A.secondaryLabel=void 0,I!=null)if(w.length===0){const L={width:I.width,height:I.height,meta:null},R=EO(N,this.properties.tile.label,O,this.properties.tile.secondaryLabel,{padding:c.padding},()=>L);if(R==null)return;const{height:P,label:B,secondaryLabel:F}=R,{textAlign:H,verticalAlign:$,padding:Y}=c,U=zH[H]??.5,V=I.x+Y+(I.width-2*Y)*U,Z=uyt[$]??.5,W=I.y+Y+P*.5+(I.height-2*Y-P)*Z;if(B!=null){const{fontStyle:q="normal",fontFamily:nt,fontWeight:G="normal",color:et="black"}=this.properties.tile.label;A.label={text:B.text,fontSize:B.fontSize,lineHeight:B.lineHeight,fontStyle:q,fontFamily:nt,fontWeight:G,color:et,textAlign:H,verticalAlign:"middle",x:V,y:W-(P-B.height)*.5}}if(F!=null){const{fontStyle:q="normal",fontFamily:nt,fontWeight:G="normal",color:et="black"}=this.properties.tile.secondaryLabel;A.secondaryLabel={text:F.text,fontSize:F.fontSize,lineHeight:F.fontSize,fontStyle:q,fontFamily:nt,fontWeight:G,color:et,textAlign:H,verticalAlign:"middle",x:V,y:W+(P-F.height)*.5}}}else{if(N==null)return;{const{padding:L,textAlign:R}=u,P=this.groupTitleHeight(A,I);if(P==null)return;const B=I.width-2*L,F=kc(N,{maxWidth:I.width-2*L,font:u.label,textWrap:"never"}),H=zH[R]??.5,{fontStyle:$="normal",fontFamily:Y,fontWeight:U="normal",color:V="black"}=this.properties.group.label;A.label={text:F,fontSize:u.label.fontSize,lineHeight:nr(u.label.fontSize),fontStyle:$,fontFamily:Y,fontWeight:U,color:V,textAlign:R,verticalAlign:"middle",x:I.x+L+B*H,y:I.y+L+P*.5}}}});const y={series:new Fg(0,0,g,f),axis:new Fg(0,0,g,f)},x=(A,I,w)=>{const{bbox:N}=A;if(N==null){I.visible=!1;return}const{depth:O=-1}=A,L=A.children.length===0,R=this.getItemStyle(A,L,w);I.crisp=!0,I.setStyleProperties(R,y),I.cornerRadius=L?c.cornerRadius:u.cornerRadius,I.zIndex=[0,O,w?1:0];const P=A.parent?.children.every(H=>H.children.length===0),B=A.parent==null?void 0:A.parent.bbox,F=A.parent==null?void 0:A.parent.padding;P===!0&&B!=null&&F!=null?(I.clipBBox=N,I.x=B.x+F.left,I.y=B.y+F.top,I.width=B.width-(F.left+F.right),I.height=B.height-(F.top+F.bottom)):(I.clipBBox=void 0,I.x=N.x,I.y=N.y,I.width=N.width,I.height=N.height),I.visible=!0};this.datumSelection.each((A,I)=>x(I,A,!1)),this.highlightSelection.each((A,I)=>{x(I,A,!0)});const S=(A,I,w,N)=>{const O=A.children.length===0,L=w===0?A.label:A.secondaryLabel;if(L==null){I.visible=!1;return}let R,P;w===0?(R=O?c.label:u.label,P=["series",`${this.declarationOrder}`,O?"tile":"group","label"]):(R=c.secondaryLabel,P=["series",`${this.declarationOrder}`,"tile","secondaryLabel"]);const{opacity:B}=this.getItemStyle(A,O,N)??{},F={childrenKey:this.properties.childrenKey,colorKey:this.properties.colorKey,colorName:this.properties.colorName??this.properties.colorKey,depth:A.depth??Number.NaN,labelKey:this.properties.labelKey,secondaryLabelKey:this.properties.secondaryLabelKey,sizeKey:this.properties.sizeKey,sizeName:this.properties.sizeName??this.properties.sizeKey},H=this.ctx.highlightManager?.getActiveHighlight(),$=cyt(this,A,F,R,N,H,P);I.text=L.text,I.fontSize=L.fontSize,I.lineHeight=L.lineHeight,I.fontStyle=L.fontStyle,I.fontFamily=L.fontFamily,I.fontWeight=L.fontWeight,I.fillOpacity=B??1,I.fill=$.color,I.setBoxing($),I.textAlign=L.textAlign,I.textBaseline=L.verticalAlign,I.x=L.x,I.y=L.y,I.visible=!0,I.zIndex=1},D=this.getActiveHighlightNode();for(const A of this.labelSelection.selectByClass(Ww)){const I=A.closestDatum();S(I,A,A.tag,I===D)}}getGroupHighlightState(t,e,i){const n=i.datumIndex,s=e?.datumIndex,a=this.isDescendantDatumIndex(n,s);if(i.children?.length===0)return n==null||e==null||e.children?.length===0?Sr.None:a?Sr.Item:Sr.OtherItem;if(e==null||e.children?.length===0)return Sr.None;const o=i.depth!=null&&e.depth!=null&&i.depth===e.depth;return a&&!o?Sr.None:t?Sr.Item:Sr.OtherItem}getTileHighlightStyle(t,e,i){if(i?.children&&i.children.length>0){const s=this.getGroupHighlightStyle(e);return s?.fillOpacity==null&&s?.strokeOpacity==null?void 0:{fillOpacity:s.fillOpacity,strokeOpacity:s.strokeOpacity}}return this.getHierarchyHighlightStyles(t,this.properties.tile.highlight)}getGroupHighlightStyle(t){const{highlight:e}=this.properties.group;switch(t){case Sr.Item:return e.highlightedItem;case Sr.OtherItem:return e.unhighlightedItem;default:return}}getHighlightStateString(t,e,i){if(i==null)return $y(Sr.None);const n=i.reduce((r,l)=>r?.children[l],this.rootNode),s=this.getActiveHighlightNode();if(n==null)return $y(Sr.None);if((n.children?.length??0)===0){const r=this.getHierarchyHighlightState(e??!1,s,n);return $y(r)}const o=this.getGroupHighlightState(e??!1,s,n);return $y(o)}isDescendantDatumIndex(t,e){if(e==null||e.length===0)return!0;if(t==null||t.lengthn.datumIndex.length-i.datumIndex.length),e}pickNodeClosestDatum(t){const e=this.pickNodesExactShape(t);return e.length!==0?{datum:e[0],distance:0}:this.pickNodeNearestDistantObject(t,this.datumSelection.nodes())}getTooltipContent(t){const{id:e,properties:i,ctx:n}=this,{formatManager:s}=n,{labelKey:a,secondaryLabelKey:o,childrenKey:r,sizeKey:l,sizeName:c,colorKey:u,colorName:d,tooltip:g}=i,f=t.reduce((P,B)=>P?.children[B],this.rootNode);if(f==null)return;const{datum:y,depth:x,children:S}=f;if(y==null||x==null)return;const D=S.length===0,A=[],I=l==null?void 0:y[l];if(I!=null){const P=[0,this.rootNode?.sumSize??0],B=s.format(this.callWithContext.bind(this),{type:"number",value:I,datum:y,seriesId:e,legendItemName:void 0,key:l,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:P,fractionDigits:void 0,visibleDomain:void 0});A.push({label:c,fallbackLabel:l,value:B??Or(I)})}const w=u==null?void 0:y[u];if(w!=null){const{colorDomain:P}=this,B=s.format(this.callWithContext.bind(this),{type:"number",value:w,datum:y,seriesId:e,legendItemName:void 0,key:u,source:"tooltip",property:"color",boundSeries:this.getFormatterContext("color"),domain:P,fractionDigits:void 0,visibleDomain:void 0});A.push({label:d,fallbackLabel:u,value:B??Or(w)})}const N=this.getItemStyle({...f,colorValue:w??f.colorValue},D,!1),L={shape:"square",fill:N.fill,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0};an(L.fill)&&(L.fill={...L.fill,gradient:"linear",rotation:0,reverse:!1});const R=D?{marker:L}:void 0;return this.formatTooltipWithContext(g,{title:a==null?void 0:y[a],symbol:R,data:A},{seriesId:e,datum:y,title:void 0,depth:x,labelKey:a,secondaryLabelKey:o,childrenKey:r,sizeKey:l,sizeName:c,colorKey:u,colorName:d,...N})}computeFocusBounds(t){return lyt.toCanvas(this.contentGroup,t.getBBox())}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.tile.label.itemStyler!=null||this.properties.group.label.itemStyler!=null}};MY.className="TreemapSeries";MY.type="treemap";var{treemapSeriesThemeableOptionsDef:dyt}=j,DY={...dyt,...At(_e,["highlightStyle","highlight","showInLegend"]),type:ht(Jt("treemap"))};DY.undocumentedGroupFills=Mt(Ft(It));DY.undocumentedGroupStrokes=Mt(Ft(It));({...Oe},{...Oe,minimumFontSize:Cn.SMALLER},{...Oe,minimumFontSize:Cn.SMALLER});Cn.LARGE;Cn.SMALLER,Cn.SMALLER;var AY={chartType:dt("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low")};({...Re,...Zt.tooltip});Mt(X);AY.overrideDevicePixelRatio=Mt(X);AY.foreground=Mt(jt);var pyt={setLicenseKey(t){Jg.setLicenseKey(t)}};Jo.create.bind(Jo),Jo.__createSparkline.bind(Jo),Jg.setGridContext.bind(Jg),Jg.setLicenseKey.bind(Jg);Ut.setRegistryMode(Ut.RegistryMode.Enterprise);po.styles=Mst;po.licenseManager=t=>new Jg(t.container?.ownerDocument??(typeof document>"u"?void 0:document));po.injectWatermark=Sst;po.createBackground=t=>new iK(t);po.createForeground=t=>new mA(t);var gyt={ariaAnnounceChart:"图表,共有${seriesCount}[number]个系列",ariaAnnounceFlowProportionLink:"链接 ${index} 总共 ${count},从 ${from} 到 ${to}, ${sizeName} ${size}",ariaAnnounceFlowProportionNode:"节点 ${index} 之 ${count}, ${description}",ariaAnnounceGaugeChart:"仪表盘图表, ${caption}",ariaAnnounceHierarchyChart:"层次图表, ${caption}",ariaAnnounceHierarchyDatum:"级别 ${level}[number], ${count}[number] 子项, ${description}",ariaAnnounceHoverDatum:"${datum}",ariaAnnounceStandaloneChart:"图表, ${caption}",ariaDescriptionLegendItem:"按空格键或回车键切换可见性",ariaInitSeriesArea:"互动图表",ariaLabelAddHorizontalLine:"添加水平线",ariaLabelAnnotationOptionsToolbar:"注释选项",ariaLabelAnnotationSettingsDialog:"注释设置",ariaLabelAnnotationsToolbar:"标注",ariaLabelColor:"颜色",ariaLabelColorPicker:"颜色选择器",ariaLabelColorPickerAlpha:"透明度",ariaLabelColorPickerHue:"色相",ariaLabelColorPickerMultiColor:"多色",ariaLabelColorPickerPalette:"调色板",ariaLabelFinancialCharts:"财务图表",ariaLabelGaugeTarget:"目标",ariaLabelGaugeValue:"“值”",ariaLabelLegend:"图例",ariaLabelLegendItem:"${label}, 图例项 ${index}[number] / ${count}[number]",ariaLabelLegendItemUnknown:"未知图例项目",ariaLabelLegendPageNext:"下一页图例",ariaLabelLegendPagePrevious:"上一传奇页面",ariaLabelLegendPagination:"图例分页",ariaLabelNavigator:"导航器",ariaLabelNavigatorMaximum:"最大值",ariaLabelNavigatorMinimum:"最小值",ariaLabelNavigatorRange:"范围",ariaLabelRangesToolbar:"范围",ariaLabelScrollbarHorizontal:"X轴滚动条",ariaLabelScrollbarVertical:"Y轴滚动条",ariaLabelSettingsTabBar:"设置",ariaLabelZoomToolbar:"缩放",ariaRoleDescription2DSlider:"2D 滑块",ariaValueColorPalette:"s ${s}[percent0to2dp], v ${v}[percent0to2dp]",ariaValueColorPaletteFirstV:"“v ${v}[percent0to2dp], s ${s}[percent0to2dp]”",ariaValuePanRange:"${min}[percent0to2dp] 到 ${max}[percent0to2dp]",contextMenuDownload:"下载",contextMenuPanToCursor:"平移到此处",contextMenuResetZoom:"重置缩放",contextMenuToggleOtherSeries:"切换其他系列",contextMenuToggleSeriesVisibility:"切换可见性",contextMenuZoomToCursor:"缩放到此处",dialogHeaderChannel:"频道",dialogHeaderDatePriceRange:"日期和价格",dialogHeaderDateRange:"日期范围",dialogHeaderFibonacciRange:"斐波那契回撤",dialogHeaderLine:"线",dialogHeaderPriceRange:"价格范围",dialogHeaderText:"文字",dialogInputAlign:"对齐",dialogInputColorPicker:"颜色",dialogInputColorPickerAltText:"文字颜色",dialogInputExtendAbove:"扩展以上",dialogInputExtendBelow:"向下扩展",dialogInputExtendChannelEnd:"扩展通道终点",dialogInputExtendChannelStart:"延长通道开始",dialogInputExtendLeft:"向左延伸",dialogInputExtendLineEnd:"延长线端",dialogInputExtendLineStart:"延长线起点",dialogInputExtendRight:"向右延伸",dialogInputFibonacciBands:"波段",dialogInputFibonacciBandsAltText:"斐波那契波段",dialogInputFillColorPicker:"填充",dialogInputFillColorPickerAltText:"填充颜色",dialogInputFontSize:"大小",dialogInputFontSizeAltText:"字体大小",dialogInputLineStyle:"虚线",dialogInputPosition:"位置",dialogInputReverse:"反转",dialogInputShowFill:"显示填充",dialogInputStrokeWidth:"‘粗细’",dialogInputStrokeWidthAltText:"‘线条粗细’",iconAltTextAlignCenter:"居中",iconAltTextAlignLeft:"居左",iconAltTextAlignRight:"右对齐",iconAltTextClose:"‘关闭’",iconAltTextLineStyleDashed:"长虚线",iconAltTextLineStyleDotted:"短虚线",iconAltTextLineStyleSolid:"实线",iconAltTextPositionBottom:"底部",iconAltTextPositionCenter:"居中",iconAltTextPositionTop:"顶部",inputTextareaPlaceholder:"添加文字",measurerDateRangeBars:"${value}[number] 条",measurerPriceRangePercent:"${value}[percent]",measurerPriceRangeValue:"${value}[number]",measurerVolume:"体积 ${value}",overlayLoadingData:"正在加载数据...",overlayNoData:"没有数据显示",overlayNoVisibleSeries:"没有可见的系列",overlayUnsupportedBrowser:"不兼容的浏览器版本。请升级您的浏览器。",seriesHistogramTooltipCount:"${yName} (计数)",seriesHistogramTooltipFrequency:"频率",seriesHistogramTooltipMean:"${yName} (平均值)",seriesHistogramTooltipSum:"${yName} (总和)",toolbarAnnotationsArrow:"箭头",toolbarAnnotationsArrowDown:"箭头向下",toolbarAnnotationsArrowUp:"向上箭头",toolbarAnnotationsCallout:"标注",toolbarAnnotationsClearAll:"清除所有",toolbarAnnotationsComment:"评论",toolbarAnnotationsDatePriceRange:"日期和价格",toolbarAnnotationsDateRange:"日期范围",toolbarAnnotationsDelete:"删除",toolbarAnnotationsDisjointChannel:"独立通道",toolbarAnnotationsDragHandle:"“拖动工具栏”",toolbarAnnotationsFibonacciAnnotations:"斐波那契",toolbarAnnotationsFibonacciRetracement:"斐波那契回撤",toolbarAnnotationsFibonacciRetracementTrendBased:"基于趋势的斐波纳契",toolbarAnnotationsFillColor:"填充颜色",toolbarAnnotationsHorizontalLine:"水平线",toolbarAnnotationsLineAnnotations:"趋势线",toolbarAnnotationsLineColor:"线条颜色",toolbarAnnotationsLineStrokeWidth:"线条宽度",toolbarAnnotationsLineStyle:"线条样式",toolbarAnnotationsLock:"锁定",toolbarAnnotationsMeasurerAnnotations:"测量工具",toolbarAnnotationsNote:"注释",toolbarAnnotationsParallelChannel:"平行通道",toolbarAnnotationsPriceRange:"价格范围",toolbarAnnotationsQuickDatePriceRange:"测量",toolbarAnnotationsSettings:"设置",toolbarAnnotationsShapeAnnotations:"箭头",toolbarAnnotationsText:"文本",toolbarAnnotationsTextAnnotations:"文本标注",toolbarAnnotationsTextColor:"字体颜色",toolbarAnnotationsTextSize:"文字大小",toolbarAnnotationsTrendLine:"趋势线",toolbarAnnotationsUnlock:"解锁",toolbarAnnotationsVerticalLine:"垂直线",toolbarRange1Month:"1个月",toolbarRange1MonthAria:"1个月",toolbarRange1Year:"1年",toolbarRange1YearAria:"1年",toolbarRange3Months:"3个月",toolbarRange3MonthsAria:"3个月",toolbarRange6Months:"6月",toolbarRange6MonthsAria:"6个月",toolbarRangeAll:"全部",toolbarRangeAllAria:"全部",toolbarRangeSelectRange:"选择范围",toolbarRangeSelectRangeAria:"选择范围",toolbarRangeYearToDate:"年初至今",toolbarRangeYearToDateAria:"年初至今",toolbarSeriesTypeCandles:"蜡烛图",toolbarSeriesTypeDropdown:"图表类型",toolbarSeriesTypeHighLow:"高低",toolbarSeriesTypeHLC:"HLC",toolbarSeriesTypeHollowCandles:"空心蜡烛",toolbarSeriesTypeLine:"线",toolbarSeriesTypeLineWithMarkers:"带标记的折线图",toolbarSeriesTypeOHLC:"OHLC",toolbarSeriesTypeStepLine:"阶梯线",toolbarZoomPanEnd:"移至结尾",toolbarZoomPanLeft:"向左移动",toolbarZoomPanRight:"向右平移",toolbarZoomPanStart:"平移到开始位置",toolbarZoomReset:"重置缩放",toolbarZoomZoomIn:"放大",toolbarZoomZoomOut:"缩小",tooltipPaginationStatus:"${index}[number] / ${count}[number]"};pyt.setLicenseKey("[v3][RELEASE][0102]_NDg2Njc4MzY3MDgzNw==16d78ca762fb5d2ff740aed081e2af7b");Ut.registerModules([Cot,$K,FA,$ot]);const fyt="http://127.0.0.1:9089/api/v1",Kw=[{key:"minValue",label:"最低值",shortLabel:"低"},{key:"maxValue",label:"最高值",shortLabel:"高"},{key:"avgValue",label:"平均值",shortLabel:"均"},{key:"medianValue",label:"中位数",shortLabel:"中"},{key:"dataCount",label:"数据量",shortLabel:"量"}],Yw=[{key:"cost",label:"造价(元)"},{key:"buildingArea",label:"建筑面积指标(元/m²)"},{key:"builtArea",label:"建造面积指标(元/m²)"},{key:"usableArea",label:"使用面积指标(元/m²)"}],$w=[{key:"geoLocation",label:"自然地理区位"},{key:"facilityType",label:"设施类别"},{key:"constructionStage",label:"建设阶段"},{key:"planningForm",label:"规划形式"}];function myt(t){const e=t/1e4,i=Math.abs(e)<1?4:2;return`${e.toLocaleString("zh-CN",{minimumFractionDigits:0,maximumFractionDigits:i})}万`}function yyt(t){return{groupName:t.group_name||String(t.group_key??"未命名"),minValue:t.min_value??null,maxValue:t.max_value??null,avgValue:t.avg_value??null,medianValue:t.median_value??null,dataCount:t.data_count??null}}function IY(t,e,i){return t.map(n=>n.id===e?i(n):{...n,children:IY(n.children,e,i)})}function kY(t,e,i=0){return si.jsx("ul",{className:"content-tree-list",role:i===0?"tree":"group",children:t.map(n=>si.jsxs("li",{className:"content-tree-node",role:"treeitem","aria-expanded":n.hasChildren?n.expanded:void 0,children:[si.jsxs("button",{className:"content-tree-row",type:"button",style:{paddingLeft:8+i*18},onClick:()=>e(n.id),children:[si.jsx("span",{className:`content-tree-caret${n.hasChildren?"":" is-leaf"}`,children:n.hasChildren?n.expanded?"▾":"▸":""}),si.jsx("span",{className:"content-tree-label",children:n.label})]}),n.expanded&&n.children.length>0?kY(n.children,e,i+1):null]},n.id))})}function byt(){const t=Ei.useRef(null),e=Ei.useRef(null),[i,n]=Ei.useState("avgValue"),[s,a]=Ei.useState("cost"),[o,r]=Ei.useState("year"),[l,c]=Ei.useState(!1),[u,d]=Ei.useState(!1),[g,f]=Ei.useState("geoLocation"),[y,x]=Ei.useState({geoLocation:[],facilityType:[],constructionStage:[],planningForm:[]}),[S,D]=Ei.useState([]),[A,I]=Ei.useState(!0),[w,N]=Ei.useState(null),O=Kw.find(H=>H.key===i)??Kw[0],L=Yw.find(H=>H.key===s)??Yw[0],R=$w.find(H=>H.key===g)??$w[0],P=y[g],B=H=>{x($=>({...$,[g]:IY($[g],H,Y=>({...Y,expanded:Y.hasChildren?!Y.expanded:Y.expanded}))}))};Ei.useEffect(()=>{const H=new AbortController;async function $(){I(!0),N(null);try{const Y=new URLSearchParams({groupBy:o,metric:s}),U=await fetch(`${fyt}/zw/getBuildingFunctionCostStats?${Y.toString()}`,{signal:H.signal});if(!U.ok)throw new Error(`HTTP ${U.status}`);const V=await U.json();D((V.data??[]).map(yyt).slice(0,36))}catch(Y){if(H.signal.aborted)return;N(Y instanceof Error?Y.message:"接口请求失败"),D([])}finally{H.signal.aborted||I(!1)}}return $(),()=>{H.abort()}},[o,s]),Ei.useEffect(()=>{const H=e.current,$=t.current;if(!H||!$)return;const Y=()=>H.querySelector(".chart-fullscreen-button"),U=()=>H.querySelector(".ag-charts-myButton-statistic")?.closest(".ag-charts-toolbar__button"),V=()=>{const lt=Y();if(lt){let Dt=lt.querySelector(".ag-charts-myButton-fullScreen");Dt||(lt.innerHTML='',Dt=lt.querySelector(".ag-charts-myButton-fullScreen"));const kt=document.fullscreenElement===$;lt.classList.toggle("ag-charts-toolbar__button--active",kt),Dt?.classList.toggle("anticon-arrow-salt",!kt),Dt?.classList.toggle("anticon-shrink",kt)}const mt=U();mt&&mt.classList.add("chart-statistic-button")},Z=()=>{document.fullscreenElement===$?document.exitFullscreen():$.requestFullscreen()},W=lt=>{lt.key==="F11"&&(lt.preventDefault(),lt.stopPropagation(),Z())},q=()=>{V()},nt=lt=>{const Dt=lt.target?.closest(".chart-fullscreen-button, .chart-statistic-button");!Dt||!H.contains(Dt)||(lt.preventDefault(),lt.stopPropagation(),Dt.classList.contains("chart-statistic-button")?(d(!1),c(kt=>!kt)):Z())},G=lt=>{if(lt.key!==" "&<.key!=="Enter")return;const Dt=lt.target?.closest(".chart-fullscreen-button, .chart-statistic-button");!Dt||!H.contains(Dt)||(lt.preventDefault(),lt.stopPropagation(),Dt.classList.contains("chart-statistic-button")?(d(!1),c(kt=>!kt)):Z())},et=lt=>{lt.preventDefault()},st=new MutationObserver(V);return document.addEventListener("keydown",W,!0),document.addEventListener("fullscreenchange",q),document.addEventListener("contextmenu",et),H.addEventListener("contextmenu",et),H.addEventListener("click",nt,!0),H.addEventListener("keydown",G,!0),st.observe(H,{childList:!0,subtree:!0}),V(),()=>{document.removeEventListener("keydown",W,!0),document.removeEventListener("fullscreenchange",q),document.removeEventListener("contextmenu",et),H.removeEventListener("contextmenu",et),H.removeEventListener("click",nt,!0),H.removeEventListener("keydown",G,!0),st.disconnect()}},[]);const F=Ei.useMemo(()=>{const H=i==="dataCount",$=S.map(Y=>({groupName:Y.groupName,amount:Y[i]}));return{theme:{palette:{fills:["#006f9b","#ff7faa","#00994d","#ff8833","#00a0dd"],strokes:["#003f58","#934962","#004a25","#914d1d","#006288"]},params:{foregroundColor:"#262a33",backgroundColor:"#fff1e5",accentColor:"#0d7680",fontFamily:'"Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif',fontSize:14,tooltipBackgroundColor:"#fff7ef",tooltipTextColor:"#262a33"}},locale:{localeText:gyt},background:{fill:"transparent"},padding:{top:16,right:16,bottom:18,left:24},data:$,zoom:{enabled:!0,anchorPointX:"pointer",anchorPointY:"pointer",buttons:{enabled:!0,visible:"hover",buttons:[{icon:"zoom-out",value:"zoom-out",section:"zoom",tooltip:"缩小"},{icon:"zoom-in",value:"zoom-in",section:"zoom",tooltip:"放大"},{icon:"pan-left",value:"pan-left",section:"pan",tooltip:"左移"},{icon:"pan-right",value:"pan-right",section:"pan",tooltip:"右移"},{icon:"reset",value:"reset",section:"reset",tooltip:"重置"}]}},contextMenu:{enabled:!0,items:["defaults"]},annotations:{enabled:!0,toolbar:{buttons:[{value:"statistic-select",tooltip:"切换统计指标",label:`${O.shortLabel}`},{icon:"trend-line-drawing",value:"line-menu",tooltip:"Line Tool"},{icon:"text-annotation",value:"text-menu",tooltip:"Text Tool"},{icon:"arrow-drawing",value:"shape-menu",tooltip:"Shape Tool"},{icon:"fibonacci-retracement-drawing",value:"fibonacci-menu",tooltip:"Fibonacci Tool"},{icon:"delete",value:"clear",tooltip:"Clear annotations"}]}},series:[{type:"line",xKey:"groupName",yKey:"amount",yName:`${L.label} ${O.label}`,stroke:"#0078a8",strokeWidth:2,marker:{enabled:!0,fill:"#0078a8",stroke:"#0078a8",size:5},interpolation:{type:"smooth"}}],axes:{x:{type:"category",position:"bottom",line:{enabled:!0,stroke:"#c8b9a7"},tick:{enabled:!1},label:{color:"#1f2933",fontSize:12},crosshair:{snap:!1}},y:{type:"number",position:"left",title:{text:""},label:{color:"#1f2933",fontSize:12,formatter:({value:Y})=>H?Number(Y).toLocaleString("zh-CN",{minimumFractionDigits:0,maximumFractionDigits:0}):myt(Number(Y))},line:{enabled:!1},tick:{enabled:!1},gridLine:{enabled:!0,style:[{stroke:"#e5d9ca",lineDash:[0]}]},crosshair:{snap:!1}}},legend:{enabled:!1},tooltip:{enabled:!0}}},[S,L.label,O.label,i]);return si.jsxs("main",{className:"dashboard-shell",children:[si.jsx("div",{className:"watermark-layer","aria-hidden":"true",children:Array.from({length:18}).map((H,$)=>si.jsx("span",{children:"众为数字化管理平台"},$))}),si.jsxs("section",{className:"workspace","aria-label":"年度费用模板",ref:t,children:[si.jsx("section",{className:"chart-area","aria-label":"年度总费用图表",children:si.jsxs("div",{className:"chart-frame",ref:e,children:[l?si.jsx("div",{className:"statistic-switcher-menu",role:"menu","aria-label":"切换统计指标",children:Kw.map(H=>si.jsx("button",{className:"statistic-switcher-menu-item",type:"button",role:"menuitem","aria-current":H.key===i,onClick:()=>{n(H.key),c(!1)},children:H.label},H.key))}):null,si.jsxs("div",{className:"metric-switcher",children:[si.jsx("button",{className:"metric-switcher-button",type:"button",title:"切换纵坐标指标","aria-expanded":u,"aria-haspopup":"menu","aria-label":`纵坐标:${L.label}`,onClick:()=>{c(!1),d(H=>!H)},children:L.label}),u?si.jsx("div",{className:"metric-switcher-menu",role:"menu","aria-label":"切换纵坐标指标",children:Yw.map(H=>si.jsx("button",{className:"metric-switcher-menu-item",type:"button",role:"menuitem","aria-current":H.key===s,onClick:()=>{a(H.key),d(!1)},children:H.label},H.key))}):null]}),A||w?si.jsx("div",{className:"chart-status",children:A?"加载中":w}):null,si.jsx("button",{className:"chart-fullscreen-button ag-charts-toolbar__button",type:"button",title:"全屏(F11)",children:si.jsx("i",{className:"anticon anticon-arrow-salt ag-charts-myButton-fullScreen ag-charts-diy-button"})}),si.jsx(yst,{options:F})]})}),si.jsxs("aside",{className:"right-panel","aria-label":"选择内容",children:[si.jsx("div",{className:"content-tabs",role:"tablist","aria-label":"选择内容切换项",children:$w.map(H=>si.jsx("button",{className:"content-tab",type:"button",role:"tab","aria-selected":H.key===g,onClick:()=>f(H.key),children:H.label},H.key))}),si.jsxs("div",{className:"content-tree-panel",children:[si.jsx("div",{className:"content-tree-title",children:R.label}),P.length>0?kY(P,B):si.jsx("div",{className:"content-tree-empty",children:"接口待接入"})]})]})]})]})}Ut.registerModules([hst]);tX.createRoot(document.getElementById("root")).render(si.jsx(Ei.StrictMode,{children:si.jsx(byt,{})})); diff --git a/zbChart/assets/index-hvfQ0T_3.css b/zbChart/assets/index-hvfQ0T_3.css new file mode 100644 index 0000000..ea43996 --- /dev/null +++ b/zbChart/assets/index-hvfQ0T_3.css @@ -0,0 +1 @@ +:root{color:#161616;background:#f5e8d8;font-family:Microsoft YaHei,PingFang SC,Segoe UI,Arial,sans-serif;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}*{box-sizing:border-box}body{min-width:320px;min-height:100vh;margin:0;overflow:hidden}button{font:inherit}.wea-right-menu-show,.wea-right-menu{display:none!important}.dashboard-shell{position:relative;min-height:100vh;background:#f5e8d8;overflow:hidden}.watermark-layer{position:absolute;inset:-30px;z-index:0;display:grid;grid-template-columns:repeat(4,minmax(260px,1fr));grid-auto-rows:128px;align-items:center;pointer-events:none;color:#968c8033;font-size:16px;letter-spacing:0;transform:rotate(-18deg)}.watermark-layer span{display:block;white-space:nowrap}.workspace{position:relative;z-index:1;display:grid;grid-template-columns:minmax(540px,52vw) 1fr;gap:28px;height:100vh;padding:8px 28px 18px 64px}.chart-area{display:grid;grid-template-rows:minmax(0,1fr);min-width:0}.chart-title{display:flex;align-items:center;justify-content:center;gap:6px}.chart-title h1{margin:0;font-size:16px;font-weight:500;letter-spacing:0;line-height:1}.chart-title button{display:grid;width:18px;height:18px;place-items:center;padding:0;border:1px solid rgba(95,88,80,.18);border-radius:2px;color:#6d6258;background:#fff9f15c;cursor:pointer;transition:background-color .12s ease,border-color .12s ease,color .12s ease,transform .12s ease,box-shadow .12s ease}.chart-title button:hover{border-color:#0078a85c;color:#0078a8;background:#fffcf8f0;box-shadow:0 1px 5px #4536241f}.chart-title button:active{transform:translateY(1px)}.chart-title button:focus-visible{outline:2px solid rgba(0,120,168,.34);outline-offset:2px}.chart-title button span{position:relative;width:11px;height:11px}.chart-title button span:before{position:absolute;top:5px;left:1px;width:10px;height:1px;background:currentColor;transform:rotate(-35deg);content:""}.chart-title button span:after{position:absolute;right:1px;bottom:1px;width:4px;height:1px;background:currentColor;content:""}.chart-frame{position:relative;min-width:0;min-height:0;padding:26px 0 0}.workspace:fullscreen{position:relative;z-index:10;display:grid;grid-template-columns:minmax(540px,52vw) 1fr;gap:28px;width:100vw;height:100vh;padding:8px 28px 18px 64px;background:#f5e8d8}.workspace:fullscreen .chart-area{height:calc(100vh - 26px)}.workspace:fullscreen .right-panel{display:block;min-width:0;height:100%}.chart-frame>div{height:100%}.chart-frame>.statistic-switcher-menu,.chart-frame>.chart-status{height:auto}.chart-frame .ag-charts-wrapper{--ag-charts-accent-color: #0078a8;--ag-charts-button-background-color: rgba(255, 249, 241, .72);--ag-charts-button-border-radius: 3px;--ag-charts-border-color: rgba(90, 82, 72, .22);--ag-charts-chrome-background-color: rgba(255, 249, 241, .84)}.chart-frame .ag-charts-toolbar{gap:8px;padding:0;background:transparent;border:0;box-shadow:none}.chart-frame .ag-charts-annotations__toolbar{left:-46px;top:24px;overflow:visible!important}.chart-frame .ag-charts-annotations__toolbar .ag-charts-toolbar{overflow:visible!important}.statistic-switcher-menu{position:absolute;left:70px;top:24px;z-index:14;width:max-content;min-width:86px;padding:4px 0;border:1px solid rgba(90,82,72,.22);border-radius:3px;background:#fbede1;box-shadow:0 4px 14px #45362424}.statistic-switcher-menu-item{display:block;width:100%;min-height:30px;padding:0 12px;border:0;color:#262a33;background:transparent;font-size:13px;line-height:30px;text-align:left;white-space:nowrap;cursor:pointer}.statistic-switcher-menu-item:hover,.statistic-switcher-menu-item[aria-current=true]{color:#0078a8;background:#fffcf8f0}.metric-switcher{position:absolute;left:74px;top:272px;z-index:12}.metric-switcher-button{display:block;width:22px;min-height:112px;padding:8px 2px;border:1px solid rgba(90,82,72,.16);border-radius:3px;color:#111827;background:#fff1e5ad;font-size:12px;letter-spacing:2px;line-height:1.25;text-align:center;cursor:pointer;transition:background-color .12s ease,border-color .12s ease,color .12s ease,box-shadow .12s ease;writing-mode:vertical-rl;text-orientation:upright}.metric-switcher-button:hover,.metric-switcher-button[aria-expanded=true]{color:#0078a8;border-color:#0078a85c;background:#fffcf8f0;box-shadow:0 1px 5px #4536241f}.metric-switcher-menu{position:absolute;left:30px;top:8px;width:max-content;min-width:196px;padding:4px 0;border:1px solid rgba(90,82,72,.22);border-radius:3px;background:#fbede1;box-shadow:0 4px 14px #45362424}.metric-switcher-menu-item{display:block;width:100%;min-height:30px;padding:0 12px;border:0;color:#262a33;background:transparent;font-size:13px;line-height:30px;text-align:left;white-space:nowrap;cursor:pointer}.metric-switcher-menu-item:hover,.metric-switcher-menu-item[aria-current=true]{color:#0078a8;background:#fffcf8f0}.chart-status{position:absolute;top:62px;left:74px;z-index:11;padding:4px 8px;border:1px solid rgba(90,82,72,.16);border-radius:3px;color:#262a33;background:#fffcf8f0;font-size:12px;line-height:18px}.chart-frame .chart-fullscreen-button{position:absolute;left:24px;top:252px;z-index:9;display:grid;width:34px;height:34px;min-width:34px;min-height:34px;place-items:center;padding:0;border:1px solid rgba(90,82,72,.22);border-radius:3px;color:#46413b;background:#fff9f1b8;box-shadow:none}.chart-frame .ag-charts-toolbar__button[title="Clear annotations"]{transform:translateY(42px)}.chart-frame .ag-charts-zoom-buttons{inset:auto 24px 34px auto!important;width:auto!important;height:auto!important;z-index:8;opacity:0;pointer-events:none;transform:translateY(4px);transition:opacity .14s ease,transform .14s ease}.chart-frame:hover .ag-charts-zoom-buttons,.chart-frame:focus-within .ag-charts-zoom-buttons,.chart-frame .ag-charts-zoom-buttons:focus-within{opacity:1;pointer-events:auto;transform:translateY(0)}.chart-frame .ag-charts-zoom-buttons .ag-charts-toolbar{position:relative!important;z-index:9;gap:0;padding:0;border:0;border-radius:3px;background:transparent;box-shadow:none}.chart-frame .ag-charts-toolbar__button{width:26px;height:26px;color:#46413b;border-color:#5a524838;background:#fff9f1b8;cursor:pointer}.chart-frame .ag-charts-zoom-buttons .ag-charts-toolbar__button{width:26px;height:26px;min-width:26px;min-height:26px;padding:3px;background:#fff9f1b8}.chart-frame .ag-charts-toolbar__button:hover,.chart-frame .ag-charts-toolbar__button--active{color:#0078a8;border-color:#0078a85c;background:#fffcf8f0;box-shadow:0 1px 5px #4536241f}.chart-frame .ag-charts-myButton-fullScreen{position:relative;display:block;width:16px;height:16px}.chart-frame .ag-charts-myButton-fullScreen:before,.chart-frame .ag-charts-myButton-fullScreen:after{position:absolute;inset:0;display:block;width:16px;height:16px;content:""}.chart-frame .anticon-arrow-salt:before{border-top:1px solid currentColor;border-right:1px solid currentColor;clip-path:polygon(54% 0,100% 0,100% 46%,86% 46%,86% 14%,54% 14%)}.chart-frame .anticon-arrow-salt:after{border-bottom:1px solid currentColor;border-left:1px solid currentColor;clip-path:polygon(0 54%,14% 54%,14% 86%,46% 86%,46% 100%,0 100%)}.chart-frame .anticon-shrink:before{top:2px;left:2px;width:6px;height:6px;border-right:1px solid currentColor;border-bottom:1px solid currentColor}.chart-frame .anticon-shrink:after{inset:auto 2px 2px auto;width:6px;height:6px;border-top:1px solid currentColor;border-left:1px solid currentColor}.chart-frame .ag-charts-toolbar__button:disabled{cursor:not-allowed;opacity:.38}.chart-frame .ag-charts-toolbar__button[aria-disabled=true]{cursor:not-allowed;opacity:.38}.right-panel{display:grid;grid-template-rows:auto minmax(0,1fr);min-width:0;height:100%;padding-top:24px}.content-tabs{display:flex;align-items:center;gap:6px;min-width:0;padding-bottom:12px}.content-tab{height:28px;padding:0 10px;border:1px solid rgba(90,82,72,.18);border-radius:3px;color:#46413b;background:#fff9f19e;font-size:12px;line-height:26px;white-space:nowrap;cursor:pointer}.content-tab:hover,.content-tab[aria-selected=true]{color:#0078a8;border-color:#0078a85c;background:#fffcf8f0;box-shadow:0 1px 5px #4536241f}.content-tree-panel{min-width:0;min-height:0;overflow:auto;padding:10px 0;border-top:1px solid rgba(90,82,72,.14)}.content-tree-title{margin-bottom:8px;color:#262a33;font-size:13px;font-weight:600;line-height:20px}.content-tree-list{margin:0;padding:0;list-style:none}.content-tree-node{margin:0;padding:0}.content-tree-row{display:flex;align-items:center;width:100%;min-height:30px;border:0;border-radius:3px;color:#262a33;background:transparent;font-size:13px;line-height:30px;text-align:left;cursor:pointer}.content-tree-row:hover{color:#0078a8;background:#fffcf8bd}.content-tree-caret{display:inline-grid;width:18px;height:18px;place-items:center;flex:0 0 18px;color:#6f665e;font-size:12px}.content-tree-caret.is-leaf{color:transparent}.content-tree-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content-tree-empty{padding:16px 0;color:#7a7067;font-size:13px;line-height:20px}@media(max-width:900px){body{overflow:auto}.workspace{grid-template-columns:1fr;height:auto;min-height:100vh;padding:8px 18px 18px 56px}.chart-area{min-height:520px}.right-panel{min-height:280px}.content-tabs{flex-wrap:wrap}} diff --git a/zbChart/index.html b/zbChart/index.html new file mode 100644 index 0000000..4c874a9 --- /dev/null +++ b/zbChart/index.html @@ -0,0 +1,13 @@ + + + + + + AG Chart Service + + + + +
+ +