@ngrok/mantle 0.91.1 → 0.92.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/dist/accordion.js +1 -1
  2. package/dist/agent.json +5 -2
  3. package/dist/{alert-BV0VWU2o.d.ts → alert-BcSBNR3S.d.ts} +2 -2
  4. package/dist/alert-P9lwn25X.js +1 -0
  5. package/dist/alert-center.d.ts +1 -1
  6. package/dist/alert-center.js +1 -1
  7. package/dist/alert-dialog.d.ts +19 -1
  8. package/dist/alert-dialog.js +1 -1
  9. package/dist/alert.d.ts +1 -1
  10. package/dist/alert.js +1 -1
  11. package/dist/app-layout.d.ts +1 -1
  12. package/dist/app-layout.js +1 -1
  13. package/dist/area-chart.d.ts +10 -3
  14. package/dist/area-chart.js +1 -1
  15. package/dist/bar-chart.d.ts +9 -3
  16. package/dist/bar-chart.js +1 -1
  17. package/dist/breadcrumb.js +1 -1
  18. package/dist/browser-only-BTSrYWLj.js +1 -0
  19. package/dist/browser-only.js +1 -1
  20. package/dist/{button-Cwrv2Mwv.js → button-B8k98Pby.js} +1 -1
  21. package/dist/button-BQZ6eoD3.js +1 -0
  22. package/dist/{button-Dt9LZMT5.d.ts → button-BX-4lYUn.d.ts} +3 -3
  23. package/dist/{button-BOCRKR5v.d.ts → button-CPsKGDK0.d.ts} +52 -1
  24. package/dist/button-Dge0D5bl.js +1 -0
  25. package/dist/{button-BFAvonp1.d.ts → button-Yxyu1XMd.d.ts} +1 -1
  26. package/dist/button.d.ts +3 -3
  27. package/dist/button.js +1 -1
  28. package/dist/calendar.js +1 -1
  29. package/dist/card.d.ts +1 -1
  30. package/dist/chart-BpWfQAwf.js +2 -0
  31. package/dist/{chart-ynMysD16.d.ts → chart-BpfbtOUN.d.ts} +14 -0
  32. package/dist/{checkbox-BpW9TmW6.js → checkbox-DmSQXs26.js} +1 -1
  33. package/dist/checkbox.js +1 -1
  34. package/dist/{choice-U6_8mOOO.js → choice-2Lrv8_nl.js} +1 -1
  35. package/dist/choice.js +1 -1
  36. package/dist/code-block.js +6 -6
  37. package/dist/combobox.d.ts +79 -1
  38. package/dist/combobox.js +1 -1
  39. package/dist/command.d.ts +5 -1
  40. package/dist/command.js +1 -1
  41. package/dist/{copy-to-clipboard-Cza2OT47.js → copy-to-clipboard-DInu78k_.js} +1 -1
  42. package/dist/data-table.d.ts +2 -2
  43. package/dist/data-table.js +1 -1
  44. package/dist/description-list.d.ts +1 -1
  45. package/dist/{dialog-DedsCsnk.d.ts → dialog-2fRO4ca4.d.ts} +19 -1
  46. package/dist/{dialog-eL61O8eg.js → dialog-qordIos1.js} +1 -1
  47. package/dist/dialog.d.ts +1 -1
  48. package/dist/dialog.js +1 -1
  49. package/dist/{dropdown-menu-C4C1x-7W.js → dropdown-menu-CLHkKzhe.js} +1 -1
  50. package/dist/{dropdown-menu-ByQQIsQE.d.ts → dropdown-menu-CpjRwMWe.d.ts} +1 -1
  51. package/dist/dropdown-menu.d.ts +1 -1
  52. package/dist/dropdown-menu.js +1 -1
  53. package/dist/field.d.ts +1 -1
  54. package/dist/field.js +1 -1
  55. package/dist/hooks.d.ts +15 -1
  56. package/dist/hooks.js +1 -1
  57. package/dist/hover-card.js +1 -1
  58. package/dist/{icons-exKDODyp.js → icons-DGL0d2Il.js} +1 -1
  59. package/dist/icons.js +1 -1
  60. package/dist/{index-C6s5cGCr.d.ts → index-BhfgyurF.d.ts} +9 -9
  61. package/dist/input.js +1 -1
  62. package/dist/line-chart.d.ts +10 -3
  63. package/dist/line-chart.js +1 -1
  64. package/dist/list-RFRIQxU2.js +1 -0
  65. package/dist/list.js +1 -1
  66. package/dist/llms.txt +2 -2
  67. package/dist/mantle.css +409 -12
  68. package/dist/migrations/0012-single-stylesheet.yml +1971 -0
  69. package/dist/multi-select.d.ts +1 -1
  70. package/dist/multi-select.js +1 -1
  71. package/dist/pagination.d.ts +2 -2
  72. package/dist/pagination.js +1 -1
  73. package/dist/popover-BCGCpwkK.js +1 -0
  74. package/dist/popover.js +1 -1
  75. package/dist/radio-group.js +1 -1
  76. package/dist/sandbar.d.ts +1 -1
  77. package/dist/sandbar.js +1 -1
  78. package/dist/scatter-plot.d.ts +10 -4
  79. package/dist/scatter-plot.js +1 -1
  80. package/dist/{select-CRp_ndSJ.d.ts → select-BkhBxtOT.d.ts} +1 -1
  81. package/dist/{select-BdF_CnfJ.js → select-MjJMGqwP.js} +1 -1
  82. package/dist/select.d.ts +1 -1
  83. package/dist/select.js +1 -1
  84. package/dist/selectable-list.js +1 -1
  85. package/dist/{separator-DNovVsrx.d.ts → separator-D9AWEkcJ.d.ts} +4 -0
  86. package/dist/{separator-BPE-A8tw.js → separator-DfzxVutO.js} +1 -1
  87. package/dist/separator.d.ts +1 -1
  88. package/dist/separator.js +1 -1
  89. package/dist/{shake-u3qyeThI.js → shake-DL6WhMXM.js} +1 -1
  90. package/dist/{sheet-BIyuxMmF.js → sheet-C0QytOsE.js} +1 -1
  91. package/dist/sheet.d.ts +20 -2
  92. package/dist/sheet.js +1 -1
  93. package/dist/sidebar.d.ts +6 -2
  94. package/dist/sidebar.js +1 -1
  95. package/dist/slider.js +1 -1
  96. package/dist/split-button.d.ts +3 -3
  97. package/dist/split-button.js +1 -1
  98. package/dist/table-CFHiDBW8.js +1 -0
  99. package/dist/table.js +1 -1
  100. package/dist/tabs.d.ts +1 -1
  101. package/dist/tabs.js +1 -1
  102. package/dist/text-area.js +1 -1
  103. package/dist/theme-CwtpudOH.js +1 -0
  104. package/dist/theme-switcher.d.ts +1 -1
  105. package/dist/theme-switcher.js +1 -1
  106. package/dist/theme.d.ts +15 -69
  107. package/dist/theme.js +1 -1
  108. package/dist/toast.js +1 -1
  109. package/dist/truncated-text.js +1 -1
  110. package/dist/types.d.ts +1 -1
  111. package/dist/use-copy-to-clipboard-Dy_0Qzb7.js +1 -0
  112. package/dist/use-is-apple-platform-D4nifHMx.js +1 -0
  113. package/dist/use-isomorphic-layout-effect-CLSmHzo4.js +1 -0
  114. package/dist/use-prefers-reduced-motion-CU6mWmOe.js +1 -0
  115. package/dist/use-swipe-to-dismiss-DceYk1Id.js +1 -0
  116. package/dist/utils.js +1 -1
  117. package/dist/well.d.ts +1 -1
  118. package/package.json +1 -5
  119. package/dist/alert-QXHRO9ji.js +0 -1
  120. package/dist/browser-only-Crr3sgA0.js +0 -1
  121. package/dist/button-CZ-q7fYv.js +0 -1
  122. package/dist/button-DTpsT864.js +0 -1
  123. package/dist/chart-D2LtDZtV.js +0 -2
  124. package/dist/list-DOVZoz9t.js +0 -1
  125. package/dist/mantle-dark.css +0 -385
  126. package/dist/popover-q2-rCY1q.js +0 -1
  127. package/dist/table-DBbKqOVq.js +0 -1
  128. package/dist/theme-CBGxDNFc.js +0 -1
  129. package/dist/use-copy-to-clipboard-ByLT8veV.js +0 -1
  130. package/dist/use-is-apple-platform-CMPzIYjz.js +0 -1
  131. package/dist/use-is-hydrated-DDCqXmju.js +0 -1
  132. package/dist/use-isomorphic-layout-effect-DdTRtMY-.js +0 -1
  133. package/dist/use-prefers-reduced-motion-DimzRx-M.js +0 -1
  134. package/dist/use-swipe-to-dismiss-Cj-AayFd.js +0 -1
@@ -0,0 +1 @@
1
+ import{t as e}from"./alert-DO00UiQe.js";import{c as t}from"react/compiler-runtime";import{useEffect as n,useLayoutEffect as r,useRef as i}from"react";function a({tabStops:e,current:t,backwards:n}){let r=e[0],i=e[e.length-1];if(r==null||i==null)return null;let a=e.findIndex(e=>e===t);if(a!==-1)return n?a===0?i:null:a===e.length-1?r:null;if(t==null)return n?i:r;if(n){let n=e.filter(e=>(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)!==0);return n[n.length-1]??i}return e.find(e=>(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING)!==0)??r}function o(r,i){let o=t(6),s;o[0]===i?s=o[1]:(s=i===void 0?{}:i,o[0]=i,o[1]=s);let{active:c}=s,l=c===void 0||c,u,d;o[2]!==l||o[3]!==r?(u=()=>{let t=r.current;if(!l||t==null)return;let n=!t.hasAttribute(`tabindex`);n&&(t.tabIndex=-1);let i=0,o=60,s=()=>{if(t.contains(document.activeElement))return;let[n]=e(t);(n??t).focus(),--o,!t.contains(document.activeElement)&&o>0&&(i=requestAnimationFrame(s))};s();let c=n=>{if(n.key!==`Tab`||n.defaultPrevented||!(n.target instanceof Node)||!t.contains(n.target))return;let r=e(t);if(r.length===0){n.preventDefault();return}let i=a({tabStops:r,current:document.activeElement,backwards:n.shiftKey});i!=null&&(n.preventDefault(),i.focus())};return document.addEventListener(`keydown`,c),()=>{cancelAnimationFrame(i),document.removeEventListener(`keydown`,c),n&&t.removeAttribute(`tabindex`)}},d=[l,r],o[2]=l,o[3]=r,o[4]=u,o[5]=d):(u=o[4],d=o[5]),n(u,d)}function s(e,n){let i=t(6),a;i[0]===n?a=i[1]:(a=n===void 0?{}:n,i[0]=n,i[1]=a);let{active:o}=a,s=o===void 0||o,l,u;i[2]!==s||i[3]!==e?(l=()=>{let t=e.current;if(s&&t!=null)return c(t)},u=[s,e],i[2]=s,i[3]=e,i[4]=l,i[5]=u):(l=i[4],u=i[5]),r(l,u)}function c(e){let t=e.parentElement;if(t==null)return;let n=/* @__PURE__ */ new Set,r=()=>{for(let r of t.children)r!==e&&r instanceof HTMLElement&&!r.inert&&(r.inert=!0,n.add(r))};r();let i=new MutationObserver(r);return i.observe(t,{childList:!0}),()=>{i.disconnect();for(let e of n)e.inert=!1}}function l({offset:e,size:t,velocity:n,threshold:r,flickVelocity:i}){return e>0&&(e>=t*r||n>=i)}function u(e,t){return t<=0?0:(1-1/(.55*e/t+1))*t}function d(e,t){switch(t){case`right`:return e.clientX;case`left`:return-e.clientX;case`down`:return e.clientY;case`up`:return-e.clientY}}function f(e,t){return t===`left`||t===`right`?e.clientY:e.clientX}function p(e,t){switch(t){case`right`:return`${e}px`;case`left`:return`${-e}px`;case`down`:return`0 ${e}px`;case`up`:return`0 ${-e}px`}}function m(e,t,n){e.property===`flex-basis`?e.target.style.flexBasis=`${e.size-t}px`:e.target.style.translate=p(t,n)}function h(e){e.target.style.removeProperty(`transition`),e.target.style.removeProperty(e.property===`flex-basis`?`flex-basis`:`translate`)}function g(e,a){let o=t(6),s=i(a),c;o[0]===a?c=o[1]:(c=()=>{s.current=a},o[0]=a,o[1]=c),r(c);let p;o[2]===e.current?p=o[3]:(p=()=>{let t=e.current;if(t==null)return;let n=null,r=!1,i=()=>{document.removeEventListener(`pointermove`,a),document.removeEventListener(`pointerup`,o),document.removeEventListener(`pointercancel`,o),n=null},a=e=>{let{direction:t}=s.current,r=t===void 0?`right`:t;if(n==null||e.pointerId!==n.pointerId)return;let a=d(e,r),o=a-n.start;if(!n.dragging){let t=Math.abs(f(e,r)-n.crossStart);if(t>=8&&t>Math.abs(o)){i();return}if(Math.abs(o)<8)return;n.dragging=!0,n.target.style.transition=`none`}let c=e.timeStamp-n.lastTime;c>0&&(n.velocity=(a-n.last)/c),n.last=a,n.lastTime=e.timeStamp,n.offset=Math.max(0,o);let l=o>=0?o:-u(-o,n.size);m(n,l,r)},o=e=>{let{onDismiss:t,threshold:a,flickVelocity:o}=s.current,c=a===void 0?.25:a,u=o===void 0?.4:o;if(n==null||e.pointerId!==n.pointerId)return;let d=n;if(i(),!d.dragging||(r=!0,window.setTimeout(()=>{r=!1},0),h(d),e.type===`pointercancel`))return;let f=e.timeStamp-d.lastTime>100?0:d.velocity;l({...d,velocity:f,threshold:c,flickVelocity:u})&&t()},c=e=>{let{active:r,direction:i,property:c,target:l}=s.current,u=r===void 0||r,p=i===void 0?`right`:i,m=c===void 0?`translate`:c;if(!(typeof u==`function`?u():u)||!e.isPrimary||e.button!==0||n!=null)return;let h=l?.current??t,g=h.getBoundingClientRect(),_=d(e,p);n={target:h,property:typeof m==`function`?m():m,pointerId:e.pointerId,start:_,crossStart:f(e,p),size:p===`left`||p===`right`?g.width:g.height,dragging:!1,last:_,lastTime:e.timeStamp,velocity:0,offset:0},document.addEventListener(`pointermove`,a),document.addEventListener(`pointerup`,o),document.addEventListener(`pointercancel`,o)},p=e=>{r&&(r=!1,e.preventDefault(),e.stopPropagation())};return t.addEventListener(`pointerdown`,c),t.addEventListener(`click`,p,!0),()=>{n?.dragging&&h(n),i(),t.removeEventListener(`pointerdown`,c),t.removeEventListener(`click`,p,!0)}},o[2]=e.current,o[3]=p);let g;o[4]===e?g=o[5]:(g=[e],o[4]=e,o[5]=g),n(p,g)}export{s as n,o as r,g as t};
package/dist/utils.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./compose-refs-sFdxsL7k.js";import{t}from"./copy-to-clipboard-Cza2OT47.js";import{a as n,c as r,d as i,f as a,i as o,l as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./direction-CvDpql3O.js";import{t as h}from"./in-view-Dxv_GrUU.js";function g(e,t){return Math.sign(t.getTime()-e.getTime())}function _(e,t){return Math.sign(e.getTime()-t.getTime())}export{p as $alphanumericSortingDirection,c as $sortingDirection,d as $sortingMode,o as $timeSortingDirection,n as alphanumericSortingDirections,g as compareDatesNewestToOldest,_ as compareDatesOldestToNewest,e as composeRefs,t as copyToClipboard,h as inView,l as isAlphanumericSortingDirection,f as isSortingDirection,r as isSortingMode,s as isTimeSortingDirection,m as sortingDirections,i as sortingModes,a as timeSortingByDirection,u as timeSortingDirections};
1
+ import{t as e}from"./compose-refs-sFdxsL7k.js";import{t}from"./copy-to-clipboard-DInu78k_.js";import{a as n,c as r,d as i,f as a,i as o,l as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./direction-CvDpql3O.js";import{t as h}from"./in-view-Dxv_GrUU.js";function g(e,t){return Math.sign(t.getTime()-e.getTime())}function _(e,t){return Math.sign(e.getTime()-t.getTime())}export{p as $alphanumericSortingDirection,c as $sortingDirection,d as $sortingMode,o as $timeSortingDirection,n as alphanumericSortingDirections,g as compareDatesNewestToOldest,_ as compareDatesOldestToNewest,e as composeRefs,t as copyToClipboard,h as inView,l as isAlphanumericSortingDirection,f as isSortingDirection,r as isSortingMode,s as isTimeSortingDirection,m as sortingDirections,i as sortingModes,a as timeSortingByDirection,u as timeSortingDirections};
package/dist/well.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
2
2
  import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
3
- import "./index-C6s5cGCr.js";
3
+ import "./index-BhfgyurF.js";
4
4
  import { ComponentProps } from "react";
5
5
  type WellProps = ComponentProps<"div"> & WithAsChild & WithDataSlot;
6
6
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngrok/mantle",
3
- "version": "0.91.1",
3
+ "version": "0.92.1",
4
4
  "description": "mantle is ngrok's UI library and design system.",
5
5
  "homepage": "https://mantle.ngrok.com",
6
6
  "license": "MIT",
@@ -22,10 +22,6 @@
22
22
  "style": "./dist/mantle.css",
23
23
  "default": "./dist/mantle.css"
24
24
  },
25
- "./mantle-dark.css": {
26
- "style": "./dist/mantle-dark.css",
27
- "default": "./dist/mantle-dark.css"
28
- },
29
25
  "./source-all.css": {
30
26
  "style": "./dist/source-all.css",
31
27
  "default": "./dist/source-all.css"
@@ -1 +0,0 @@
1
- import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./cx-CK7o_rVv.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{t as i}from"./icon-BudQMD2S.js";import{t as a}from"./slot-DdYN1L1C.js";import{t as o}from"./css-properties-D85fCNV3.js";import{t as s}from"./button-CZ-q7fYv.js";import{t as c}from"./button-Cwrv2Mwv.js";import{n as l,r as u}from"./alert-DO00UiQe.js";import{c as d}from"react/compiler-runtime";import{CaretDownIcon as f}from"@phosphor-icons/react/CaretDown";import{createContext as p,useContext as m,useEffect as h,useRef as g}from"react";import _ from"tiny-invariant";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{CheckCircleIcon as b}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as x}from"@phosphor-icons/react/Info";import{MegaphoneIcon as S}from"@phosphor-icons/react/Megaphone";import{WarningIcon as C}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as w}from"@phosphor-icons/react/WarningDiamond";import{XIcon as T}from"@phosphor-icons/react/X";import{cva as E}from"class-variance-authority";const D=p(null),O=/* @__PURE__ */ v(T,{});function k(){let e=m(D);return _(e,`useAlertContext hook used outside of Alert parent!`),e}const A=e=>{let t=d(6),{children:n,intent:r,redirectDismissFocus:i}=e,a=i===void 0||i,o;t[0]!==r||t[1]!==a?(o={intent:r,redirectDismissFocus:a},t[0]=r,t[1]=a,t[2]=o):o=t[2];let s=o,c;return t[3]!==n||t[4]!==s?(c=/* @__PURE__ */ v(D.Provider,{value:s,children:n}),t[3]=n,t[4]=s,t[5]=c):c=t[5],c},j=E(`relative flex w-full gap-1.5 rounded-md border p-2.5 text-sm font-sans`,{variants:{intent:{danger:`border-danger-500/50 bg-danger-500/10 text-danger-700 [&_code]:bg-danger-500/10 [&_code]:border-danger-500/20 [&_code]:text-danger-900 [&_a:not([data-slot~=button])]:text-danger-700 [&_a:not([data-slot~=button])]:underline`,important:`border-important-500/50 bg-important-500/10 text-important-700 [&_code]:bg-important-500/10 [&_code]:border-important-500/20 [&_code]:text-important-900 [&_a:not([data-slot~=button])]:text-important-700 [&_a:not([data-slot~=button])]:underline`,info:`border-info-500/50 bg-info-500/10 text-info-700 [&_code]:bg-info-500/10 [&_code]:border-info-500/20 [&_code]:text-info-900 [&_a:not([data-slot~=button])]:text-info-700 [&_a:not([data-slot~=button])]:underline`,success:`border-success-500/50 bg-success-500/10 text-success-700 [&_code]:bg-success-500/10 [&_code]:border-success-500/20 [&_code]:text-success-900 [&_a:not([data-slot~=button])]:text-success-700 [&_a:not([data-slot~=button])]:underline`,warning:`border-warning-500/50 bg-warning-500/10 text-warning-700 [&_code]:bg-warning-500/10 [&_code]:border-warning-500/20 [&_code]:text-warning-900 [&_a:not([data-slot~=button])]:text-warning-700 [&_a:not([data-slot~=button])]:underline`},appearance:{banner:`border-x-0 border-t-0 rounded-none z-50 sticky`,default:``}}}),M=e=>{let t=d(26),i,a,s,c,l,u,f;t[0]===e?(i=t[1],a=t[2],s=t[3],c=t[4],l=t[5],u=t[6],f=t[7]):({"data-slot":a,appearance:f,className:i,intent:s,ref:l,style:u,...c}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=f);let p=f===void 0?`default`:f,m;t[8]===a?m=t[9]:(m=r(a,`alert`),t[8]=a,t[9]=m);let h;t[10]!==p||t[11]!==i||t[12]!==s?(h=n(j({appearance:p,intent:s}),`has-data-alert-dismiss:pr-10`,`has-data-alert-expand:[&_[data-slot~=alert-dismiss-icon-button]]:right-16`,`md:has-data-alert-expand:[&_[data-slot~=alert-dismiss-icon-button]]:right-24`,`has-data-alert-expand:[&_[data-slot~=alert-content]]:pr-12`,`md:has-data-alert-expand:[&_[data-slot~=alert-content]]:pr-[5.5rem]`,i),t[10]=p,t[11]=i,t[12]=s,t[13]=h):h=t[13];let g;t[14]!==s||t[15]!==u?(g=o({"--alert-control-color":R(s),"--alert-control-hover-color":z(s),"--alert-control-hover-bg":B(s),...u}),t[14]=s,t[15]=u,t[16]=g):g=t[16];let _;t[17]!==c||t[18]!==l||t[19]!==m||t[20]!==h||t[21]!==g?(_=/* @__PURE__ */ v(`div`,{ref:l,"data-slot":m,className:h,style:g,...c}),t[17]=c,t[18]=l,t[19]=m,t[20]=h,t[21]=g,t[22]=_):_=t[22];let y;return t[23]!==s||t[24]!==_?(y=/* @__PURE__ */ v(A,{intent:s,children:_}),t[23]=s,t[24]=_,t[25]=y):y=t[25],y},N={danger:/* @__PURE__ */ v(C,{}),important:/* @__PURE__ */ v(S,{mirrored:!0}),info:/* @__PURE__ */ v(x,{}),success:/* @__PURE__ */ v(b,{}),warning:/* @__PURE__ */ v(w,{})},P=e=>{let t=d(16),a,o,s,c,l;t[0]===e?(a=t[1],o=t[2],s=t[3],c=t[4],l=t[5]):({"data-slot":o,className:a,ref:c,svg:l,...s}=e,t[0]=e,t[1]=a,t[2]=o,t[3]=s,t[4]=c,t[5]=l);let u=k(),f=N[u.intent],p;t[6]===o?p=t[7]:(p=r(o,`alert-icon`),t[6]=o,t[7]=p);let m;t[8]===a?m=t[9]:(m=n(`size-5`,a),t[8]=a,t[9]=m);let h=l??f,g;return t[10]!==s||t[11]!==c||t[12]!==p||t[13]!==m||t[14]!==h?(g=/* @__PURE__ */ v(i,{ref:c,"data-slot":p,className:m,svg:h,...s}),t[10]=s,t[11]=c,t[12]=p,t[13]=m,t[14]=h,t[15]=g):g=t[15],g},F=e=>{let t=d(14),i,a,o,s;t[0]===e?(i=t[1],a=t[2],o=t[3],s=t[4]):({"data-slot":a,className:i,ref:s,...o}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=o,t[4]=s);let c;t[5]===a?c=t[6]:(c=r(a,`alert-content`),t[5]=a,t[6]=c);let l;t[7]===i?l=t[8]:(l=n(`min-w-0 flex-1 has-data-alert-dismiss:pr-6`,i),t[7]=i,t[8]=l);let u;return t[9]!==o||t[10]!==s||t[11]!==c||t[12]!==l?(u=/* @__PURE__ */ v(`div`,{ref:s,"data-slot":c,className:l,...o}),t[9]=o,t[10]=s,t[11]=c,t[12]=l,t[13]=u):u=t[13],u},I=e=>{let t=d(16),i,o,s,c,l;t[0]===e?(i=t[1],o=t[2],s=t[3],c=t[4],l=t[5]):({"data-slot":o,asChild:l,className:i,ref:c,...s}=e,t[0]=e,t[1]=i,t[2]=o,t[3]=s,t[4]=c,t[5]=l);let u=l!==void 0&&l?a:`h5`,f;t[6]===o?f=t[7]:(f=r(o,`alert-title`),t[6]=o,t[7]=f);let p;t[8]===i?p=t[9]:(p=n(`font-medium`,i),t[8]=i,t[9]=p);let m;return t[10]!==u||t[11]!==s||t[12]!==c||t[13]!==f||t[14]!==p?(m=/* @__PURE__ */ v(u,{ref:c,"data-slot":f,className:p,...s}),t[10]=u,t[11]=s,t[12]=c,t[13]=f,t[14]=p,t[15]=m):m=t[15],m},L=e=>{let t=d(16),i,o,s,c,l;t[0]===e?(i=t[1],o=t[2],s=t[3],c=t[4],l=t[5]):({"data-slot":o,asChild:l,className:i,ref:c,...s}=e,t[0]=e,t[1]=i,t[2]=o,t[3]=s,t[4]=c,t[5]=l);let u=l!==void 0&&l?a:`div`,f;t[6]===o?f=t[7]:(f=r(o,`alert-description`),t[6]=o,t[7]=f);let p;t[8]===i?p=t[9]:(p=n(`text-sm`,i),t[8]=i,t[9]=p);let m;return t[10]!==u||t[11]!==s||t[12]!==c||t[13]!==f||t[14]!==p?(m=/* @__PURE__ */ v(u,{ref:c,"data-slot":f,className:p,...s}),t[10]=u,t[11]=s,t[12]=c,t[13]=f,t[14]=p,t[15]=m):m=t[15],m},R=e=>`var(--color-${e}-700)`,z=e=>`var(--color-${e}-800)`,B=e=>`color-mix(in oklab, var(--color-${e}-500) 10%, transparent)`;function V(t){let n=d(8),{buttonRef:r,enabled:i}=t,a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=[],n[0]=a):a=n[0];let o=g(a),s,c;n[1]!==r||n[2]!==i?(s=()=>{if(i)return()=>{let e=r.current;if(e==null||document.activeElement!==e)return;let t=e.closest(`[data-slot~="alert"]`)??e;o.current=l(t)}},c=[r,i],n[1]=r,n[2]=i,n[3]=s,n[4]=c):(s=n[3],c=n[4]),e(s,c);let f,p;n[5]===i?(f=n[6],p=n[7]):(f=()=>{if(i)return()=>{let e=o.current;if(o.current=[],e.length===0)return;let{activeElement:t}=document;if(t==null||t===document.body){for(let t of e)if(t.isConnected&&u(t)&&(t.focus(),document.activeElement===t))return}}},p=[i],n[5]=i,n[6]=f,n[7]=p),h(f,p)}const H={Root:M,Content:F,ExpandButton:e=>{let t=d(25),i,a,o,c,l;t[0]===e?(i=t[1],a=t[2],o=t[3],c=t[4],l=t[5]):({"data-slot":o,count:a,expanded:c,className:i,...l}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=o,t[4]=c,t[5]=l);let u=c?`Collapse additional alerts`:`Show ${a} more ${a===1?`alert`:`alerts`}`,p;t[6]===o?p=t[7]:(p=r(o,`alert-expand-button`),t[6]=o,t[7]=p);let m=c&&`-rotate-180`,h;t[8]===m?h=t[9]:(h=n(`size-4 transition-transform duration-200 ease-out-strong motion-reduce:transition-none`,m),t[8]=m,t[9]=h);let g;t[10]===h?g=t[11]:(g=/* @__PURE__ */ v(f,{weight:`bold`,className:h}),t[10]=h,t[11]=g);let _;t[12]===i?_=t[13]:(_=n(`right-1.5 top-1.5 absolute gap-1 ps-1.5 pe-1`,`text-[var(--alert-control-color,currentColor)]`,`not-disabled:hover:bg-[var(--alert-control-hover-bg,transparent)] not-disabled:hover:text-[var(--alert-control-hover-color,currentColor)]`,i),t[12]=i,t[13]=_);let b;t[14]===a?b=t[15]:(b=/* @__PURE__ */ y(`span`,{className:`min-w-[2ch] text-center tabular-nums`,children:[`+`,a]}),t[14]=a,t[15]=b);let x;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(x=/* @__PURE__ */ v(`span`,{className:`hidden md:inline`,children:`more`}),t[16]=x):x=t[16];let S;return t[17]!==c||t[18]!==l||t[19]!==u||t[20]!==p||t[21]!==g||t[22]!==_||t[23]!==b?(S=/* @__PURE__ */ y(s,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,"aria-expanded":c,"aria-label":u,"data-slot":p,"data-alert-expand":!0,icon:g,iconPlacement:`end`,className:_,...l,children:[b,x]}),t[17]=c,t[18]=l,t[19]=u,t[20]=p,t[21]=g,t[22]=_,t[23]=b,t[24]=S):S=t[24],S},Description:L,DismissIconButton:e=>{let i=d(26),a,o,s,l,u,f,p,h,_;i[0]===e?(a=i[1],o=i[2],s=i[3],l=i[4],u=i[5],f=i[6],p=i[7],h=i[8],_=i[9]):({"data-slot":o,size:u,type:f,label:p,appearance:h,className:a,icon:_,ref:l,...s}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=l,i[5]=u,i[6]=f,i[7]=p,i[8]=h,i[9]=_);let y=u===void 0?`sm`:u,b=f===void 0?`button`:f,x=p===void 0?`Dismiss Alert`:p,S=h===void 0?`ghost`:h,C=_===void 0?O:_,w=m(D),T=g(null),E=t(T,l),k=w?.redirectDismissFocus??!0,A;i[10]===k?A=i[11]:(A={buttonRef:T,enabled:k},i[10]=k,i[11]=A),V(A);let j;i[12]===o?j=i[13]:(j=r(o,`alert-dismiss-icon-button`),i[12]=o,i[13]=j);let M;i[14]===a?M=i[15]:(M=n(`right-1.5 top-1.5 absolute`,`text-[var(--alert-control-color,currentColor)]`,`not-disabled:hover:bg-[var(--alert-control-hover-bg,transparent)] not-disabled:hover:text-[var(--alert-control-hover-color,currentColor)]`,a),i[14]=a,i[15]=M);let N;return i[16]!==S||i[17]!==E||i[18]!==C||i[19]!==x||i[20]!==s||i[21]!==y||i[22]!==j||i[23]!==M||i[24]!==b?(N=/* @__PURE__ */ v(c,{ref:E,appearance:S,icon:C,intent:`neutral`,label:x,size:y,"data-slot":j,"data-alert-dismiss":!0,className:M,type:b,...s}),i[16]=S,i[17]=E,i[18]=C,i[19]=x,i[20]=s,i[21]=y,i[22]=j,i[23]=M,i[24]=b,i[25]=N):N=i[25],N},Icon:P,Title:I};export{A as n,H as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./use-is-hydrated-DDCqXmju.js";function t(t){let{children:n,fallback:r}=t,i=r===void 0?null:r;return e()?n():i}function n(){return typeof window<`u`&&typeof document<`u`}export{n,t};
@@ -1 +0,0 @@
1
- import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-kK0c-POG.js";import{t as r}from"./slot-DdYN1L1C.js";import{t as i}from"./booleanish-BfvnW6vy.js";import{t as a}from"./clsx-DUGZgXfJ.js";import{c as o}from"react/compiler-runtime";import{Children as s,cloneElement as c,isValidElement as l}from"react";import u from"tiny-invariant";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";import{cva as m}from"class-variance-authority";import{CircleNotchIcon as h}from"@phosphor-icons/react/CircleNotch";const g=r=>{let i=o(20),a,s,c,l,u;i[0]===r?(a=i[1],s=i[2],c=i[3],l=i[4],u=i[5]):({"data-slot":c,active:a,className:s,icons:l,...u}=r,i[0]=r,i[1]=a,i[2]=s,i[3]=c,i[4]=l,i[5]=u);let d;i[6]===c?d=i[7]:(d=t(c,`icon-swap`),i[6]=c,i[7]=d);let p;i[8]===s?p=i[9]:(p=e(`inline-grid shrink-0 place-items-center`,s),i[8]=s,i[9]=p);let m;i[10]===l?m=i[11]:(m=Object.entries(l),i[10]=l,i[11]=m);let h;i[12]!==a||i[13]!==m?(h=m.map(t=>{let[r,i]=t,o=r===a;return/* @__PURE__ */ f(`span`,{"data-slot":`icon-swap-item`,"data-state":o?`active`:`inactive`,"aria-hidden":!o||void 0,className:e(`col-start-1 row-start-1 grid place-items-center`,`motion-safe:transition-[opacity,scale,filter] motion-safe:duration-200 motion-safe:ease-out-strong`,`data-state-inactive:opacity-0 motion-safe:data-state-inactive:scale-50 motion-safe:data-state-inactive:blur-[2px] motion-safe:data-state-inactive:duration-150`,`data-state-inactive:*:[animation-play-state:paused]`),children:/* @__PURE__ */ f(n,{svg:i})},r)}),i[12]=a,i[13]=m,i[14]=h):h=i[14];let g;return i[15]!==u||i[16]!==d||i[17]!==p||i[18]!==h?(g=/* @__PURE__ */ f(`span`,{"data-slot":d,className:p,...u,children:h}),i[15]=u,i[16]=d,i[17]=p,i[18]=h,i[19]=g):g=i[19],g},ee=m(``,{variants:{appearance:{filled:`bg-filled-accent text-white focus-visible:ring-focus-accent not-disabled:hover:bg-filled-accent-hover border border-transparent text-sm font-medium`,ghost:`text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 border border-transparent text-sm font-medium`,outlined:`border-accent-600 bg-form text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-accent-700 not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 border text-sm font-medium`,link:`text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:underline group/button-link border-transparent`},isLoading:{false:``,true:`opacity-50`},intent:{accent:``,danger:``,neutral:``},size:{xs:``,sm:``,md:``,lg:``,xl:``}},defaultVariants:{isLoading:!1,size:`md`},compoundVariants:[{appearance:[`filled`,`ghost`,`outlined`],size:`xs`,class:`h-6 px-2`},{appearance:[`filled`,`ghost`,`outlined`],size:`sm`,class:`h-7 px-2.5`},{appearance:[`filled`,`ghost`,`outlined`],size:`md`,class:`h-9 px-3`},{appearance:[`filled`,`ghost`,`outlined`],size:`lg`,class:`h-10 px-3.5`},{appearance:[`filled`,`ghost`,`outlined`],size:`xl`,class:`h-12 px-4`},{appearance:`ghost`,intent:`danger`,class:`text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700 border-transparent`},{appearance:`outlined`,intent:`danger`,class:`border-danger-600 bg-form text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:border-danger-700 not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700`},{appearance:`filled`,intent:`danger`,class:`bg-filled-danger focus-visible:ring-focus-danger not-disabled:hover:bg-filled-danger-hover border-transparent`},{appearance:`link`,intent:`danger`,class:`text-danger-600 focus-visible:ring-focus-danger`},{appearance:`ghost`,intent:`neutral`,class:`text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong border-transparent`},{appearance:`outlined`,intent:`neutral`,class:`border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong focus-visible:not-disabled:hover:border-accent-600 focus-visible:not-disabled:active:border-accent-600`},{appearance:`filled`,intent:`neutral`,class:`bg-filled-neutral not-disabled:hover:bg-filled-neutral-hover border-transparent focus-visible:border-transparent text-neutral-50`},{appearance:`link`,intent:`neutral`,class:`text-strong focus-visible:ring-focus-accent`}]}),te={xs:`ps-1.5`,sm:`ps-2`,md:`ps-2.5`,lg:`ps-3`,xl:`ps-3.5`},ne={xs:`pe-1.5`,sm:`pe-2`,md:`pe-2.5`,lg:`pe-3`,xl:`pe-3.5`},_=m=>{let _=o(68),v,y,b,x,S,C,w,T,E,D,O,k,A,j,M;_[0]===m?(v=_[1],y=_[2],b=_[3],x=_[4],S=_[5],C=_[6],w=_[7],T=_[8],E=_[9],D=_[10],O=_[11],k=_[12],A=_[13],j=_[14],M=_[15]):({"aria-disabled":v,"data-slot":w,appearance:b,asChild:x,children:S,className:C,disabled:y,icon:E,iconPlacement:k,intent:T,isLoading:A,ref:O,size:j,type:M,...D}=m,_[0]=m,_[1]=v,_[2]=y,_[3]=b,_[4]=x,_[5]=S,_[6]=C,_[7]=w,_[8]=T,_[9]=E,_[10]=D,_[11]=O,_[12]=k,_[13]=A,_[14]=j,_[15]=M);let N=k===void 0?`start`:k,P=A!==void 0&&A,F=j===void 0?`md`:j,I;_[16]!==v||_[17]!==y||_[18]!==P?(I=i(y??P)||i(v),_[16]=v,_[17]=y,_[18]=P,_[19]=I):I=_[19];let L=I,R;_[20]===Symbol.for(`react.memo_cache_sentinel`)?(R=/* @__PURE__ */ f(h,{className:`animate-spin`}),_[20]=R):R=_[20];let ie=R,z=N===`end`&&`order-last`,B;_[21]===z?B=_[22]:(B=a(z),_[21]=z,_[22]=B);let V=B,H;_[23]!==V||_[24]!==P||_[25]!==E?(H=E?/* @__PURE__ */ f(g,{active:P?`loading`:`idle`,icons:{idle:E,loading:ie},className:V}):P&&/* @__PURE__ */ f(n,{svg:ie,className:V}),_[23]=V,_[24]=P,_[25]=E,_[26]=H):H=_[26];let U=H,W=U&&b!==`link`,G;_[27]===w?G=_[28]:(G=t(w,`button`),_[27]=w,_[28]=G);let K;_[29]!==b||_[30]!==C||_[31]!==W||_[32]!==N||_[33]!==T||_[34]!==P||_[35]!==F?(K=e(`inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md`,`focus:outline-hidden focus-visible:ring-4`,`disabled:cursor-default disabled:opacity-50`,`aria-disabled:cursor-default aria-disabled:opacity-50`,`not-disabled:active:scale-97 ease-out transition-transform duration-150`,ee({appearance:b,intent:T,isLoading:P,size:F}),b!==`link`&&`font-sans`,W&&N===`start`&&te[F],W&&N===`end`&&ne[F],C),_[29]=b,_[30]=C,_[31]=W,_[32]=N,_[33]=T,_[34]=P,_[35]=F,_[36]=K):K=_[36];let q=L?``:void 0,J=P?``:void 0,Y=b===`link`?void 0:F,X;_[37]!==b||_[38]!==L||_[39]!==T||_[40]!==D||_[41]!==O||_[42]!==K||_[43]!==q||_[44]!==J||_[45]!==Y||_[46]!==G?(X={"aria-disabled":L,"data-slot":G,className:K,"data-appearance":b,"data-disabled":q,"data-intent":T,"data-loading":J,"data-size":Y,ref:O,...D},_[37]=b,_[38]=L,_[39]=T,_[40]=D,_[41]=O,_[42]=K,_[43]=q,_[44]=J,_[45]=Y,_[46]=G,_[47]=X):X=_[47];let Z=X;if(x){u(l(S)&&s.only(S),"When using `asChild`, Button must be passed a single child as a JSX tag.");let e;if(_[48]!==S||_[49]!==L||_[50]!==U){let t;_[52]===S.props.children?t=_[53]:(t=/* @__PURE__ */ f(`span`,{"data-slot":`button-label`,className:`contents`,children:S.props.children}),_[52]=S.props.children,_[53]=t);let n;_[54]!==U||_[55]!==t?(n=/* @__PURE__ */ p(d,{children:[U,t]}),_[54]=U,_[55]=t,_[56]=n):n=_[56],e=c(S,L?re:{},n),_[48]=S,_[49]=L,_[50]=U,_[51]=e}else e=_[51];let t;return _[57]!==Z||_[58]!==e?(t=/* @__PURE__ */ f(r,{...Z,children:e}),_[57]=Z,_[58]=e,_[59]=t):t=_[59],t}let ae=M??`button`,Q;_[60]===S?Q=_[61]:(Q=/* @__PURE__ */ f(`span`,{"data-slot":`button-label`,className:`contents`,children:S}),_[60]=S,_[61]=Q);let $;return _[62]!==Z||_[63]!==L||_[64]!==U||_[65]!==ae||_[66]!==Q?($=/* @__PURE__ */ p(`button`,{...Z,disabled:L,type:ae,children:[U,Q]}),_[62]=Z,_[63]=L,_[64]=U,_[65]=ae,_[66]=Q,_[67]=$):$=_[67],$},re={tabIndex:-1,onClickCapture:e=>{e.preventDefault(),e.stopPropagation()}};export{re as n,g as r,_ as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./cx-CK7o_rVv.js";import{cva as t}from"class-variance-authority";const n=e(`icon-button`,`inline-flex shrink-0 items-center justify-center rounded-[var(--icon-button-border-radius,0.375rem)] border`,`focus:outline-hidden focus-visible:ring-4`,`disabled:cursor-default disabled:opacity-50`,`aria-disabled:cursor-default aria-disabled:opacity-50`,`not-disabled:active:scale-97 ease-out transition-transform duration-150`),r=t(n,{variants:{appearance:{filled:`bg-filled-neutral text-neutral-50 focus-visible:ring-focus-accent focus-visible:border-transparent not-disabled:hover:bg-filled-neutral-hover border-transparent`,ghost:`text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong border-transparent`,outlined:`border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong focus-visible:not-disabled:hover:border-accent-600 focus-visible:not-disabled:active:border-accent-600`},intent:{neutral:``},isLoading:{false:``,true:`opacity-50`},size:{"2xs":`size-5 [&_svg]:size-4`,xs:`size-6`,sm:`size-7`,md:`size-9`,lg:`size-10`,xl:`size-12`}},defaultVariants:{intent:`neutral`,size:`md`}});export{r as t};
@@ -1,2 +0,0 @@
1
- import{n as e,t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./cx-CK7o_rVv.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{r as i}from"./button-CZ-q7fYv.js";import{t as a}from"./button-Cwrv2Mwv.js";import{t as o}from"./use-is-hydrated-DDCqXmju.js";import{t as s}from"./use-copy-to-clipboard-ByLT8veV.js";import{t as c}from"./alternate-announcement-BkH4bOKp.js";import{t as l}from"./live-region-DQ1QLv3L.js";import{c as u}from"react/compiler-runtime";import{createContext as d,useContext as f,useEffect as p,useId as m,useLayoutEffect as h,useRef as g,useState as _,useSyncExternalStore as v}from"react";import y from"tiny-invariant";import{Fragment as b,jsx as x,jsxs as S}from"react/jsx-runtime";import{CheckIcon as C}from"@phosphor-icons/react/Check";import{CopyIcon as w}from"@phosphor-icons/react/Copy";import{scaleTime as T}from"d3-scale";import{area as E,curveLinear as D,curveMonotoneX as O,curveStep as k,line as A}from"d3-shape";const j=(e,t)=>Reflect.get(e,t),M=(e,t)=>e instanceof Date?e.getTime():typeof e==`number`?e:t&&typeof e==`string`?new Date(e).getTime():NaN,N=(e,t,n,r)=>{let i=/* @__PURE__ */ new Set;for(let e of r)for(let t of Object.keys(e))i.add(t);return`${e} ${t} "${n}" does not match any key in the provided data. Available keys: ${[...i].join(`, `)}.`},ee=(e,t,n)=>`${e} could not read any "${t}" values as ${n===`time`?`dates`:`numbers`} for the "${n}" x scale — check the xScale and the data types.`,P=(e,t)=>e.some(e=>j(e,t)!==void 0),te=({rootName:e,partName:t,rows:n,xKey:r,xScale:i,dataKeys:a,zKey:o})=>{if(n.length===0)return;if(!P(n,r))throw Error(N(e,`xKey`,r,n));let s=n;if(i===`linear`||i===`time`){let t=!1;if(s=n.filter(e=>{let n=j(e,r);return n!=null&&(t=!0),Number.isFinite(M(n,i===`time`))}),t&&s.length===0)throw Error(ee(e,r,i))}if(s.length!==0){for(let e of a)if(!P(s,e))throw Error(N(t,`dataKey`,e,n));if(o!=null&&!P(s,o))throw Error(N(e,`zKey`,o,n))}},F=/* @__PURE__ */ new Map;let I=!1;const L=e=>typeof e==`object`&&!!e&&`yield`in e&&typeof Reflect.get(e,`yield`)==`function`,R=()=>{let e=Reflect.get(globalThis,`scheduler`);return L(e)?e.yield():new Promise(e=>{if(typeof MessageChannel<`u`){let t=new MessageChannel;t.port1.addEventListener(`message`,()=>{t.port1.close(),e()},{once:!0}),t.port1.start(),t.port2.postMessage(null)}else setTimeout(e,0)})},z=(e,t)=>{let n=e.ownerDocument.defaultView;return t==null||n==null||t.bottom>0&&t.top<n.innerHeight&&t.right>0&&t.left<n.innerWidth},ne=()=>{let e=performance.now(),t=[...F.entries()].toSorted(([,e],[,t])=>Number(t.onScreen)-Number(e.onScreen)||e.top-t.top);for(let[n,r]of t)if(F.get(n)===r&&(F.delete(n),r.run(r.rect),F.size>0&&performance.now()-e>=4))break;F.size>0&&!I&&(I=!0,B())},B=async()=>{await R(),I=!1,ne()},re=(e,t)=>{F.set(e,{run:t.run,rect:t.rect,onScreen:z(e,t.rect),top:t.rect?.top??0})},ie=e=>{let t=F.get(e);t!=null&&(t.onScreen=!0)},ae=e=>{F.delete(e)},V=()=>{F.size!==0&&ne()};let oe=null;const H=()=>oe??=new Intl.NumberFormat;let U=null;const se=()=>U??=new Intl.NumberFormat(void 0,{maximumSignificantDigits:4}),ce=/* @__PURE__ */ new Map,W=(e,t)=>{let n=Object.is(e,-0)?0:e,r=t?.maximumFractionDigits;if(r!=null){let e=ce.get(r);return e??(e=new Intl.NumberFormat(void 0,{maximumFractionDigits:r}),ce.set(r,e)),e.format(n)}return n!==0&&Math.abs(n)<1?se().format(n):H().format(n)},G=e=>!Number.isFinite(e)||e<=0?0:Math.min(20,Math.max(0,-Math.floor(Math.log10(e))));let K=null;const q=()=>K??=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`});let le=null;const ue=()=>le??=new Intl.DateTimeFormat(void 0,{year:`numeric`,month:`short`,day:`numeric`}),J=e=>e.getHours()!==0||e.getMinutes()!==0||e.getSeconds()!==0||e.getMilliseconds()!==0,de=(e,t)=>typeof e==`string`?e:typeof e==`number`?W(e):Number.isNaN(e.getTime())?`—`:t?.datasetHasTimeOfDay??J(e)?q().format(e):ue().format(e),fe=e=>typeof e==`string`||typeof e==`number`||e instanceof Date?e:String(e),pe=({raw:e,epoch:t,isTime:n})=>e instanceof Date?e:n?new Date(t):null,me=(e,t,n)=>{let r=!1;if(n===`band`||n===`point`){let n=null,i=null;for(let a of e){let e=fe(j(a,t));e instanceof Date&&J(e)&&(r=!0),n??=e,i=e}return{count:e.length,first:n,last:i,hasTimeOfDay:r}}let i=n===`time`,a=0,o=1/0,s=-1/0;for(let n of e){let e=j(n,t),c=M(e,i);if(Number.isFinite(c)){if(!r){let t=pe({raw:e,epoch:c,isTime:i});t!=null&&J(t)&&(r=!0)}a+=1,o=Math.min(o,c),s=Math.max(s,c)}}return a===0?{count:a,first:null,last:null,hasTimeOfDay:r}:{count:a,first:i?new Date(o):o,last:i?new Date(s):s,hasTimeOfDay:r}},he={line:`Line chart`,bar:`Bar chart`,area:`Area chart`,scatter:`Scatter plot`},ge=(e,t)=>e===`bar`?t?`category`:`categories`:t?`data point`:`data points`,_e=e=>e.length>0?` Series: ${e.join(`, `)}.`:``,ve=({kind:e,summary:t,hydrated:n})=>{let r;if(t.count===0)r=`${he[e]} with no data.`;else{let i=t.count===1,a=ge(e,i),o=n?W(t.count):String(t.count),s=``;if(n&&t.first!=null&&t.last!=null){let e={datasetHasTimeOfDay:t.hasTimeOfDay};s=i?` at ${de(t.first,e)}`:` from ${de(t.first,e)} to ${de(t.last,e)}`}r=`${he[e]} with ${o} ${a}${s}.`}return{sentence:r,instructions:` Use the left and right arrow keys to move between data points, Page Up and Page Down to jump by a tenth of the data, Home and End to jump to the first and last, Enter or Space to activate the current point, and Escape to dismiss the readout.`}},ye=e=>{let{step:t,slot:n}=e,r=Math.min(64,Math.max(24,t*.6));return Math.min(n,r)},be=.5,xe=(e,t)=>e<0?e:t,Se=e=>{let{lower:t,upper:n,toPixel:r,reveal:i,gap:a}=e,o=r(t<0?n:t),s=o+(r(xe(t,n))-o)*i;if(Math.abs(o-r(0))<be)return{baseline:o,value:s};let c=Math.min(a,Math.abs(o-s)/2);return{baseline:o-Math.sign(o-s)*c,value:s}},Ce=e=>{let{lower:t,upper:n,pileOuter:r,toPixel:i}=e;if(Number.isNaN(r))return!1;let a=i(xe(t,n));return Math.abs(a-i(r))<be},we=[`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`,`chart-6`,`chart-7`,`chart-8`,`chart-other`],Te=e=>we.includes(e),Ee=e=>`--color-${e}`,De=`var(--color-chart-decorative)`,Oe=[`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`,`chart-6`,`chart-7`,`chart-8`],ke=/* @__PURE__ */ new WeakMap,Ae=e=>{let t=ke.get(e);return(t==null||t.parentNode!==e)&&(t=e.ownerDocument.createElement(`span`),t.style.display=`none`,t.setAttribute(`aria-hidden`,`true`),e.appendChild(t),ke.set(e,t)),t},je=(e,t)=>{let n=Ae(e);return n.style.color=t,e.ownerDocument.defaultView?.getComputedStyle(n).color??``},Me=/* @__PURE__ */ new WeakMap,Y=e=>{let t=Me.get(e);if(t!==void 0)return t;let n=e.createElement(`canvas`);n.width=1,n.height=1;let r=n.getContext(`2d`);return Me.set(e,r),r},X=[`#010203`,`#030201`],Z=/* @__PURE__ */ new WeakMap,Ne=(e,t)=>{let n=Z.get(e);n??(n=/* @__PURE__ */ new Map,Z.set(e,n));let r=n.get(t);if(r!=null)return r;let i=!1;for(let n of X)if(e.fillStyle=n,e.fillStyle=t,e.fillStyle!==n){i=!0;break}return n.set(t,i),i},Pe=/^var\(\s*(--[\w-]+)\s*\)$/i,Fe=/var\(|currentcolor|light-dark\(/i,Ie=(e,t)=>{let{computed:n,parseContext:r}=t,i=/* @__PURE__ */ new Map;return{resolve:t=>{let a=i.get(t);if(a!=null)return a;let o=t.trim(),s=Pe.exec(o),c;c=s?.[1]==null?o.toLowerCase()===`currentcolor`?n.color:o:n.getPropertyValue(s[1]).trim();let l;return l=c===``||Fe.test(c)?je(e,o):r==null||Ne(r,c)?c:je(e,o),i.set(t,l),l},fontFamily:n.fontFamily||`sans-serif`}},Le=(e,t)=>Te(t)?e.resolve(`var(${Ee(t)})`):e.resolve(t),Re=e=>({grid:e.resolve(`var(--border-color-card-muted)`),baseline:e.resolve(`var(--border-color-card)`),tickText:e.resolve(`var(--text-color-muted)`),reference:e.resolve(`var(--color-neutral-500)`),surface:e.resolve(`var(--background-color-card)`)}),ze=e=>`${e.className}|${e.getAttribute(`data-applied-theme`)??``}|${e.getAttribute(`data-theme`)??``}`,Be=/* @__PURE__ */ new WeakMap,Ve=(e,t)=>{let n=Be.get(e);if(n==null){let t=/* @__PURE__ */ new Set,r={observer:new MutationObserver(()=>{let n=ze(e);if(n!==r.signature){r.signature=n;for(let e of t)e()}}),listeners:t,signature:ze(e)};r.observer.observe(e,{attributes:!0,attributeFilter:[`class`,`data-applied-theme`,`data-theme`]}),Be.set(e,r),n=r}return n.listeners.add(t),()=>{n.listeners.delete(t),n.listeners.size===0&&(n.observer.disconnect(),Be.delete(e))}},He=1.5,Ue=1.1,We=1.6,Ge=e=>`oklch(from ${e} calc(l - 0.18) c h)`,Ke=(e,t,n)=>{let r=He;n===`up`?(e.moveTo(-1.5,t+r),e.lineTo(t+r,-1.5),e.moveTo(-1.5,r),e.lineTo(r,-1.5),e.moveTo(t-r,t+r),e.lineTo(t+r,t-r)):(e.moveTo(-1.5,-1.5),e.lineTo(t+r,t+r),e.moveTo(t-r,-1.5),e.lineTo(t+r,r),e.moveTo(-1.5,t-r),e.lineTo(r,t+r))},qe=(e,t)=>{let{size:n,width:r}=t;e.fillRect(0,n/2-r/2,n,r)},Je=(e,t)=>{let{size:n,width:r}=t;e.fillRect(n/2-r/2,0,r,n)},Ye={hatch:(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=He,e.beginPath(),Ke(e,t,`up`),e.stroke()},"hatch-reverse":(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=He,e.beginPath(),Ke(e,t,`down`),e.stroke()},crosshatch:(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=1,e.beginPath(),Ke(e,t,`up`),Ke(e,t,`down`),e.stroke()},perpendicular:(e,{size:t,ink:n,orientation:r})=>{e.fillStyle=n,r===`horizontal`?Je(e,{size:t,width:2}):qe(e,{size:t,width:2})},parallel:(e,{size:t,ink:n,orientation:r})=>{e.fillStyle=n,r===`horizontal`?qe(e,{size:t,width:2}):Je(e,{size:t,width:2})},grid:(e,{size:t,ink:n})=>{e.fillStyle=n,qe(e,{size:t,width:Ue}),Je(e,{size:t,width:Ue})},dots:(e,{size:t,ink:n})=>{e.fillStyle=n,e.beginPath(),e.arc(t/4,t/4,We,0,Math.PI*2),e.moveTo(3*t/4+We,3*t/4),e.arc(3*t/4,3*t/4,We,0,Math.PI*2),e.fill()}},Xe=(e,t)=>{let{texture:n,color:r,ink:i,devicePixelRatio:a,orientation:o}=t,s=e.canvas.ownerDocument.createElement(`canvas`);s.width=Math.max(1,Math.round(8*a)),s.height=s.width;let c=s.getContext(`2d`);if(c==null)return null;let l=s.width/8;c.scale(l,l),c.fillStyle=r,c.fillRect(0,0,8,8),Ye[n](c,{size:8,ink:i,orientation:o});let u=e.createPattern(s,`repeat`);return u?.setTransform({a:1/l,b:0,c:0,d:1/l,e:0,f:0}),u},Ze=/* @__PURE__ */ new WeakMap,Qe=e=>{if(typeof e.matchMedia!=`function`)return!1;let t=e.matchMedia,n=Ze.get(t);return n??(n=e.matchMedia(`(prefers-reduced-motion: reduce)`),Ze.set(t,n)),n.matches},$e=/* @__PURE__ */ new WeakMap,et=(e,t)=>{let n=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),r=()=>{if(n.removeEventListener(`change`,r),t.listeners.size!==0){et(e,t);for(let e of t.listeners)e()}};n.addEventListener(`change`,r),t.disarm=()=>n.removeEventListener(`change`,r)},tt=(e,t)=>{if(typeof e.matchMedia!=`function`)return()=>{};let n=$e.get(e);if(n==null){let t={listeners:/* @__PURE__ */ new Set,disarm:()=>{}};et(e,t),$e.set(e,t),n=t}return n.listeners.add(t),()=>{n.listeners.delete(t),n.listeners.size===0&&(n.disarm(),$e.delete(e))}},nt=/* @__PURE__ */ new WeakMap,rt=(e,t)=>{let n=nt.get(e);if(n==null){let t={listeners:/* @__PURE__ */ new Set,onBefore:()=>{for(let e of t.listeners)e.before()},onAfter:()=>{for(let e of t.listeners)e.after()}};e.addEventListener(`beforeprint`,t.onBefore),e.addEventListener(`afterprint`,t.onAfter),nt.set(e,t),n=t}return n.listeners.add(t),()=>{n.listeners.delete(t),n.listeners.size===0&&(e.removeEventListener(`beforeprint`,n.onBefore),e.removeEventListener(`afterprint`,n.onAfter),nt.delete(e))}},it=/* @__PURE__ */ new WeakMap,at=(e,t)=>{let n=e.fonts;if(n==null||typeof n.addEventListener!=`function`)return()=>{};let r=it.get(n);if(r==null){let e={listeners:/* @__PURE__ */ new Set,onLoad:()=>{for(let t of e.listeners)t()}};n.addEventListener(`loadingdone`,e.onLoad),it.set(n,e),r=e}return r.listeners.add(t),()=>{r.listeners.delete(t),r.listeners.size===0&&(n.removeEventListener(`loadingdone`,r.onLoad),it.delete(n))}},ot=/* @__PURE__ */ new WeakMap,st=(e,t)=>{if(typeof ResizeObserver>`u`)return()=>{};let n=e.ownerDocument,r=ot.get(n);if(r==null){let e=/* @__PURE__ */ new Map;r={handlers:e,observer:new ResizeObserver(t=>{for(let n of t)e.get(n.target)?.(n)})},ot.set(n,r)}let i=r;return i.handlers.set(e,t),i.observer.observe(e),()=>{i.handlers.get(e)===t&&(i.handlers.delete(e),i.observer.unobserve(e),i.handlers.size===0&&(i.observer.disconnect(),ot.get(n)===i&&ot.delete(n)))}},ct=e=>{let{pointCount:t,columnCount:n,wasDecimated:r}=e;return n<=0?!1:r?t>=n*3:t>=n*4},lt=e=>{let{xs:t,values:n,startIndex:r,endIndex:i,positionK:a,positionB:o,columnCount:s}=e,c=new Uint8Array(s),l=new Float64Array(s),u=new Float64Array(s),d=new Float64Array(s),f=new Float64Array(s);for(let e=r;e<=i;e++){let r=n[e]??NaN;if(Number.isNaN(r))continue;let i=t[e]??NaN,p=Math.floor(i*a+o);p===s&&(p=s-1),!(p<0||p>=s)&&(c[p]===0?(c[p]=1,l[p]=r,u[p]=r,d[p]=r,f[p]=r):(r<(l[p]??1/0)&&(l[p]=r),r>(u[p]??-1/0)&&(u[p]=r),f[p]=r))}return{columnCount:s,hasData:c,minValue:l,maxValue:u,inValue:d,outValue:f}},ut=(e,t,n)=>{if(t<=0)return null;let r=0,i=t-1,a=e[0]??0,o=e[i]??0;if(n<=a)return 0;if(n>=o)return i;for(;i-r>1;){let t=r+i>>1;(e[t]??0)<=n?r=t:i=t}let s=n-(e[r]??0);return(e[i]??0)-n<s?i:r},dt=Math.PI/2-.05,ft=e=>({cosYaw:Math.cos(e.yaw),sinYaw:Math.sin(e.yaw),cosPitch:Math.cos(e.pitch),sinPitch:Math.sin(e.pitch)}),pt=(e,t,n,r)=>{let i=e*r.cosYaw+n*r.sinYaw,a=-e*r.sinYaw+n*r.cosYaw,o=t*r.cosPitch-a*r.sinPitch,s=t*r.sinPitch+a*r.cosPitch,c=4/(4+s);return{x:i*c,y:o*c,depth:s,scale:c}},mt=e=>Math.min(dt,Math.max(-dt,e)),ht=(e,t)=>{let n=t[1]-t[0];return n===0?0:(e-t[0])/n*2-1},gt=[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1],[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],_t=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[1,5],[2,6],[3,7]],vt=Math.sqrt(50),yt=Math.sqrt(10),bt=Math.sqrt(2),xt=e=>e>=vt?10:e>=yt?5:e>=bt?2:1,St=(e,t,n,r)=>{let i=(t-e)/Math.max(0,n),a=r?.integer?Math.max(1,i):i,o=Math.floor(Math.log10(a)),s=a/10**o,c=xt(s),l,u,d;return o<0?(d=10**-o/c,l=Math.round(e*d),u=Math.round(t*d),l/d<e&&(l+=1),u/d>t&&--u,d=-d):(d=10**o*c,l=Math.round(e/d),u=Math.round(t/d),l*d<e&&(l+=1),u*d>t&&--u),u<l&&.5<=n&&n<2?St(e,t,n*2,r):[l,u,d]},Ct=(e,t,n,r)=>{if(!(n>0))return[];if(e===t)return r?.integer&&!Number.isInteger(e)?[]:[e];let i=t<e,[a,o,s]=i?St(t,e,n,r):St(e,t,n,r);if(!(o>=a))return[];let c=o-a+1,l=[];for(let e=0;e<c;e+=1){let t=i?o-e:a+e;l.push(s<0?t/-s:t*s)}return l},wt=(e,t,n,r)=>{if(!(n>0))return 0;if(e===t)return r?.integer&&!Number.isInteger(e)?0:1;let[i,a]=t<e?St(t,e,n,r):St(e,t,n,r);return a>=i?a-i+1:0},Tt=(e,t,n)=>St(e,t,n)[2],Et=(e,t)=>{let n=e[1]-e[0];if(n===0)return{k:0,b:(t[0]+t[1])/2};let r=(t[1]-t[0])/n;return{k:r,b:t[0]-e[0]*r}},Dt=e=>{let{count:t,rangeStart:n,rangeEnd:r,paddingInner:i,paddingOuter:a}=e,o=r-n;if(t<=0||o<=0)return{count:Math.max(0,t),rangeStart:n,step:0,bandwidth:0,offset:0};let s=o/Math.max(1,t-i+a*2);return{count:t,rangeStart:n,step:s,bandwidth:s*(1-i),offset:s*a}},Q=(e,t)=>e.rangeStart+e.offset+t*e.step,Ot=(e,t)=>Q(e,t)+e.bandwidth/2,kt=(e,t)=>({start:Q(e,t)-(e.step-e.bandwidth)/2,size:e.step}),At=(e,t)=>{if(e.count===0||e.step===0)return null;let n=Math.floor((t-e.rangeStart-e.offset+e.step/2-e.bandwidth/2)/e.step);return Math.min(e.count-1,Math.max(0,n))},jt=(e,t,n)=>Ct(e[0],e[1],t,n),Mt=(e,t,n)=>{let r=Math.floor(Math.min(n?.count??t,t));for(;r>1&&wt(e[0],e[1],r,n)>t;)--r;return jt(e,r,n).slice(0,Math.max(0,Math.floor(t)))};let Nt=null,Pt=null;const Ft=e=>{if(Pt!=null&&Nt!=null&&Nt[0]===e[0]&&Nt[1]===e[1])return Pt;let t=T().domain([new Date(e[0]),new Date(e[1])]);return Nt=[e[0],e[1]],Pt=t,t},It=(e,t)=>Ft(e).ticks(t).map(e=>e.getTime()),Lt=e=>{let t=Ft(e).tickFormat();return e=>t(new Date(e))},Rt=(e,t)=>{if(e[0]>e[1])return Rt([e[1],e[0]],t);if(e[0]===e[1]){let n=e[0],r=n===0?1:Math.abs(n)*.5;return Rt([n-r,n+r],t)}let n=e[0],r=e[1],i=NaN;for(let e=0;e<10;e++){let e=Tt(n,r,t);if(e===i||e===0||!Number.isFinite(e))break;if(e>0)n=Math.floor(n/e)*e,r=Math.ceil(r/e)*e;else{let t=-e;n=Math.floor(n*t)/t,r=Math.ceil(r*t)/t}i=e}return[n,r]},zt=(e,t)=>{let n=Rt(e,t);return e[0]===0?[0,n[1]]:n},Bt=e=>e===`monotone`?O:e===`step`?k:D,$=e=>Math.round(e)+.5,Vt=(e,t)=>{let{plot:n,color:r,xLines:i,yLines:a}=t;e.save(),e.strokeStyle=r,e.lineWidth=1,Ht(e,i,t=>{e.moveTo($(t),n.top),e.lineTo($(t),n.top+n.height)}),Ht(e,a,t=>{e.moveTo(n.left,$(t)),e.lineTo(n.left+n.width,$(t))}),e.restore()},Ht=(e,t,n)=>{let r=NaN;for(let i of t)i.alpha!==r&&(Number.isNaN(r)||e.stroke(),r=i.alpha,e.globalAlpha=r,e.beginPath()),n(i.position);Number.isNaN(r)||e.stroke()},Ut=(e,t)=>{let{plot:n,color:r,y:i}=t;e.strokeStyle=r,e.lineWidth=1,e.beginPath(),e.moveTo(n.left,$(i)),e.lineTo(n.left+n.width,$(i)),e.stroke()},Wt=(e,t)=>{let{plot:n,color:r,x:i}=t;e.strokeStyle=r,e.lineWidth=1,e.beginPath(),e.moveTo($(i),n.top),e.lineTo($(i),n.top+n.height),e.stroke()},Gt=(e,t)=>{let{fill:n,rects:r,count:i=r.length}=t;e.fillStyle=n,e.beginPath();for(let t=0;t<i;t++){let n=r[t];if(n==null)continue;let i=Math.max(.5,n.width),a=Math.min(n.valueY,n.baselineY),o=Math.abs(n.baselineY-n.valueY);if(o===0)continue;let s=n.rounded&&i>=8?Math.min(4,i/2,o):0;s===0?e.rect(n.x,a,i,o):n.valueY<=n.baselineY?e.roundRect(n.x,a,i,o,[s,s,0,0]):e.roundRect(n.x,a,i,o,[0,0,s,s])}e.fill()},Kt=(e,t)=>{let{fill:n,rects:r,count:i=r.length}=t;e.fillStyle=n,e.beginPath();for(let t=0;t<i;t++){let n=r[t];if(n==null)continue;let i=Math.max(.5,n.height),a=Math.min(n.valueX,n.baselineX),o=Math.abs(n.valueX-n.baselineX);if(o===0)continue;let s=n.rounded&&i>=8?Math.min(4,i/2,o):0;s===0?e.rect(a,n.y,o,i):n.valueX>=n.baselineX?e.roundRect(a,n.y,o,i,[0,s,s,0]):e.roundRect(a,n.y,o,i,[s,0,0,s])}e.fill()},qt=(e,t)=>{let{color:n,curve:r,indexes:i,xAt:a,yAt:o,definedAt:s}=t,c=A().x(a).y(o).defined(s).curve(Bt(r)).context(e);e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath(),c(i),e.stroke()},Jt=(e,t)=>{let{color:n,curve:r,indexes:i,xAt:a,y0At:o,y1At:s,definedAt:c}=t,l=E().x(a).y0(o).y1(s).defined(c).curve(Bt(r)).context(e);e.beginPath(),l(i),e.save(),e.globalAlpha=.1,e.fillStyle=n,e.fill(),e.restore();let u=A().x(a).y(s).defined(c).curve(Bt(r)).context(e);e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath(),u(i),e.stroke()},Yt=(e,t)=>{let{color:n,columns:r,columnToX:i,valueK:a,valueB:o}=t;e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath();let s=!1;for(let t=0;t<r.columnCount;t++){if(r.hasData[t]===0){s=!1;continue}let n=i(t),c=(r.inValue[t]??0)*a+o,l=(r.minValue[t]??0)*a+o,u=(r.maxValue[t]??0)*a+o,d=(r.outValue[t]??0)*a+o;s?e.lineTo(n,c):(e.moveTo(n,c),s=!0),(l!==c||u!==c)&&(e.lineTo(n,l),e.lineTo(n,u)),d!==u&&e.lineTo(n,d)}e.stroke()},Xt=(e,t)=>{let{color:n,lowerColumns:r,upperColumns:i,columnToX:a,valueK:o,valueB:s}=t;e.beginPath();let c=-1,l=t=>{if(c<0)return;let n=!1;for(let r=c;r<=t;r++){let t=a(r),c=(i.maxValue[r]??0)*o+s;n?e.lineTo(t,c):(e.moveTo(t,c),n=!0)}for(let n=t;n>=c;n--){let t=a(n),i=(r.minValue[n]??0)*o+s;e.lineTo(t,i)}e.closePath(),c=-1};for(let e=0;e<i.columnCount;e++)i.hasData[e]===0?l(e-1):c<0&&(c=e);l(i.columnCount-1),e.save(),e.globalAlpha=.1,e.fillStyle=n,e.fill(),e.restore(),Yt(e,{color:n,columns:i,columnToX:a,valueK:o,valueB:s})},Zt=(e,t,n,r,i)=>{let a=!1;for(let[o,s]of i)a?e.lineTo(t+o*r,n+s*r):(e.moveTo(t+o*r,n+s*r),a=!0);e.closePath()},Qt=[[-1/3,-1],[1/3,-1],[1/3,-1/3],[1,-1/3],[1,1/3],[1/3,1/3],[1/3,1],[-1/3,1],[-1/3,1/3],[-1,1/3],[-1,-1/3],[-1/3,-1/3]],$t=Qt.map(([e,t])=>[(e-t)/Math.SQRT2,(e+t)/Math.SQRT2]),en=Array.from({length:10},(e,t)=>{let n=-Math.PI/2+t*Math.PI/5,r=t%2==0?1:.382;return[Math.cos(n)*r,Math.sin(n)*r]}),tn={circle:(e,t,n,r)=>{e.arc(t,n,r,0,Math.PI*2)},square:(e,t,n,r)=>{let i=r*.886;e.moveTo(t-i,n-i),e.lineTo(t+i,n-i),e.lineTo(t+i,n+i),e.lineTo(t-i,n+i),e.closePath()},triangle:(e,t,n,r)=>{let i=r*1.55;e.moveTo(t,n-i),e.lineTo(t+i*.866,n+i*.5),e.lineTo(t-i*.866,n+i*.5),e.closePath()},diamond:(e,t,n,r)=>{let i=r*1.253;e.moveTo(t,n-i),e.lineTo(t+i,n),e.lineTo(t,n+i),e.lineTo(t-i,n),e.closePath()},"triangle-down":(e,t,n,r)=>{let i=r*1.55;e.moveTo(t,n+i),e.lineTo(t+i*.866,n-i*.5),e.lineTo(t-i*.866,n-i*.5),e.closePath()},plus:(e,t,n,r)=>{Zt(e,t,n,r*1.189,Qt)},cross:(e,t,n,r)=>{Zt(e,t,n,r*1.189,$t)},star:(e,t,n,r)=>{Zt(e,t,n,r*1.673,en)}},nn=(e,t,n,r,i)=>{tn[i](e,t,n,r)},rn=(e,t)=>{let{color:n,surface:r,shape:i,indexes:a,xAt:o,yAt:s,definedAt:c}=t;e.fillStyle=n,e.strokeStyle=r,e.lineWidth=2;for(let t of a)c(t)&&(e.beginPath(),nn(e,o(t),s(t),4,i),e.fill(),e.stroke())},an=5e3,on=2e4,sn=(e,t)=>{let{color:n,surface:r,shape:i,totalPointCount:a,indexes:o,xAt:s,yAt:c,radiusAt:l}=t;if(e.fillStyle=n,a>on){e.beginPath();for(let t of o)l(t)<=0||e.rect(s(t)-1,c(t)-1,2,2);e.fill();return}let u=a<=an;e.strokeStyle=r,e.lineWidth=2;for(let t of o){let n=l(t);n<=0||(e.beginPath(),nn(e,s(t),c(t),n,i),e.fill(),u&&e.stroke())}},cn=(e,t)=>{let{count:n,order:r,screenX:i,screenY:a,radius:o,colorAt:s,shapeAt:c,alphaAt:l,surface:u}=t;if(e.save(),n>on){let t=``,n=-1;for(let c of r){let r=s(c);r!==t&&(e.fillStyle=r,t=r);let u=l(c);u!==n&&(e.globalAlpha=u,n=u);let d=Math.max(1,(o[c]??0)/2);e.fillRect((i[c]??0)-d/2,(a[c]??0)-d/2,d,d)}e.restore();return}let d=n<=an;e.strokeStyle=u,e.lineWidth=2;let f=``,p=-1;for(let t of r){let n=s(t);n!==f&&(e.fillStyle=n,f=n);let r=l(t);r!==p&&(e.globalAlpha=r,p=r),e.beginPath(),nn(e,i[t]??0,a[t]??0,o[t]??0,c(t)),e.fill(),d&&e.stroke()}e.restore()},ln=(e,t)=>{let{gridColor:n,axisColor:r,corners:i,edges:a,cubeAlpha:o,axes:s}=t;if(e.save(),o>.01){e.globalAlpha=o,e.strokeStyle=n,e.lineWidth=1,e.beginPath();for(let[t,n]of a){let r=i[t],a=i[n];r!=null&&a!=null&&(e.moveTo(r.x,r.y),e.lineTo(a.x,a.y))}e.stroke()}e.strokeStyle=r;for(let{alpha:t,from:n,to:r}of s)t<=.01||(e.globalAlpha=t,e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(r.x,r.y),e.stroke());e.restore()},un=(e,t)=>{let{textColor:n,fontFamily:r,plot:i,center:a,axes:o}=t;e.save(),e.fillStyle=n,e.font=`11px ${r}`,e.textAlign=`center`,e.textBaseline=`middle`;for(let{label:t,alpha:n,from:r,to:s}of o){if(n<=.01)continue;let o=Math.hypot(r.x-a.x,r.y-a.y),c=Math.hypot(s.x-a.x,s.y-a.y),l=c>=o?s:r,u=c>=o?r:s,d=Math.max(1,Math.hypot(l.x-u.x,l.y-u.y)),f=(l.x-u.x)/d*16,p=(l.y-u.y)/d*16,m=Math.min(i.left+i.width-8,Math.max(i.left+8,l.x+f)),h=Math.min(i.top+i.height-6,Math.max(i.top+6,l.y+p));e.globalAlpha=n,e.fillText(t,m,h)}e.restore()},dn=(e,t)=>{let{plot:n,color:r,textColor:i,y:a,label:o,fontFamily:s}=t;e.strokeStyle=r,e.lineWidth=1,e.setLineDash([4,4]),e.beginPath(),e.moveTo(n.left,$(a)),e.lineTo(n.left+n.width,$(a)),e.stroke(),e.setLineDash([]),o!=null&&o.length>0&&(e.font=`11px ${s}`,e.fillStyle=i,e.textAlign=`right`,e.textBaseline=`bottom`,e.fillText(o,n.left+n.width-4,a-3))},fn=(e,t)=>{let{plot:n,color:r,textColor:i,x:a,label:o,fontFamily:s}=t;if(e.strokeStyle=r,e.lineWidth=1,e.setLineDash([4,4]),e.beginPath(),e.moveTo($(a),n.top),e.lineTo($(a),n.top+n.height),e.stroke(),e.setLineDash([]),o!=null&&o.length>0){e.font=`11px ${s}`,e.fillStyle=i;let t=e.measureText(o).width,r=a+4+t<=n.left+n.width;e.textAlign=r?`left`:`right`,e.textBaseline=`top`,e.fillText(o,r?a+4:a-4,n.top+3)}},pn=(e,t)=>{let{plot:n,color:r,fontFamily:i,xLabels:a,yLabels:o}=t;e.save(),e.font=`11px ${i}`,e.fillStyle=r,e.textAlign=`right`,e.textBaseline=`middle`;for(let t of o)e.globalAlpha=t.alpha,e.fillText(t.text,n.left-8,t.position);e.textAlign=`center`,e.textBaseline=`top`;for(let t of a)e.globalAlpha=t.alpha,e.fillText(t.text,t.position,n.top+n.height+8);e.restore()},mn=e=>{let t=e.length,n=e[0]?.length??0,r=[],i=[];for(let e=0;e<t;e++)r.push(new Float64Array(n)),i.push(new Float64Array(n));let a=0,o=0,s=new Float64Array(n),c=new Float64Array(n),l=new Int32Array(n).fill(-1),u=new Int32Array(n).fill(-1);for(let d=0;d<t;d++){let t=e[d],f=r[d],p=i[d];if(t!=null&&f!=null&&p!=null)for(let e=0;e<n;e++){let n=t[e]??NaN;if(Number.isNaN(n))f[e]=NaN,p[e]=NaN;else if(n>=0){let t=s[e]??0,r=t+n;s[e]=r,f[e]=t,p[e]=r,r>o&&(o=r),n>0&&(l[e]=d)}else{let t=c[e]??0,r=t+n;c[e]=r,f[e]=r,p[e]=t,r<a&&(a=r),u[e]=d}}}return{lower:r,upper:i,min:a,max:o,positiveEnd:l,negativeEnd:u}},hn=e=>1-(1-e)**3;var gn=class{#e=/* @__PURE__ */ new Float64Array;#t=/* @__PURE__ */ new Float64Array;#n=/* @__PURE__ */ new Float64Array;#r=0;#i=0;#a=!1;get active(){return this.#a}values(){return this.#n}retarget(e,t){let{duration:n,now:r}=t,i=e.length,a=this.#n.length!==i;if(a&&(this.#e=new Float64Array(i),this.#t=new Float64Array(i),this.#n=new Float64Array(i)),a||n<=0){for(let t=0;t<i;t++){let n=e[t]??NaN;this.#e[t]=n,this.#t[t]=n,this.#n[t]=n}this.#a=!1;return}let o=!1;for(let t=0;t<i;t++){let n=e[t]??NaN,r=this.#n[t]??NaN;if(r!==n&&!(Number.isNaN(r)&&Number.isNaN(n))){o=!0;break}}if(o){for(let t=0;t<i;t++)this.#e[t]=this.#n[t]??NaN,this.#t[t]=e[t]??NaN;this.#r=r,this.#i=n,this.#a=!0}else{for(let t=0;t<i;t++)this.#t[t]=e[t]??NaN;this.#a=!1}}snap(){this.#n.set(this.#t),this.#a=!1}tick(e){if(!this.#a)return!1;let t=Math.min(1,(e-this.#r)/this.#i),n=hn(t);for(let e=0;e<this.#n.length;e++){let t=this.#e[e]??NaN,r=this.#t[e]??NaN;Number.isNaN(t)||Number.isNaN(r)?this.#n[e]=r:this.#n[e]=t+(r-t)*n}return t>=1&&(this.#a=!1),this.#a}},_n=class{#e=/* @__PURE__ */ new Float64Array;#t=/* @__PURE__ */ new Float64Array;#n=0;#r=!1;#i;#a;#o=0;#s=null;constructor(e={}){this.#i=e.speed??.14,this.#a=e.epsilon??.001}get active(){return this.#r}values(){return this.#t}jump(e){this.#s=null,this.#t.length!==e.length&&(this.#e=new Float64Array(e.length),this.#t=new Float64Array(e.length));for(let t=0;t<e.length;t++){let n=e[t]??NaN;this.#e[t]=n,this.#t[t]=n}this.#r=!1}aim(e,t){if(this.#t.length!==e.length){this.jump(e);return}if(this.#c(e))return;this.#s!=null&&(this.#l(t),this.#s=null,this.#r=!1);let n=0;for(let t=0;t<e.length;t++){let r=e[t]??NaN;this.#e[t]=r;let i=Math.abs(r-(this.#t[t]??NaN));Number.isFinite(i)&&i>n&&(n=i)}this.#o=n,this.#r||(this.#r=!0,this.#n=t)}glide(e,t){let{now:n,duration:r}=t;if(this.#t.length!==e.length||r<=0)this.jump(e);else if(!this.#c(e)){this.#s!=null&&this.#l(n);for(let t=0;t<e.length;t++)this.#e[t]=e[t]??NaN;this.#s={from:Float64Array.from(this.#t),start:n,duration:r},this.#r=!0,this.#n=n}}#c(e){for(let t=0;t<e.length;t++){let n=e[t]??NaN,r=this.#e[t]??NaN;if(r!==n&&!(Number.isNaN(r)&&Number.isNaN(n)))return!1}return!0}#l(e){let t=this.#s;if(t==null)return;let n=Math.min(1,Math.max(0,(e-t.start)/t.duration));for(let e=0;e<this.#t.length;e++){let r=t.from[e]??NaN,i=this.#e[e]??NaN;this.#t[e]=Number.isNaN(r)||Number.isNaN(i)?i:r+(i-r)*n}n>=1&&(this.#s=null,this.#r=!1)}tick(e){if(!this.#r)return!1;if(this.#s!=null)return this.#n=e,this.#l(e),this.#r;let t=Math.min(50,Math.max(0,e-this.#n));this.#n=e;let n=1-(1-this.#i)**(t/16.67),r=Math.max(this.#o*this.#a,2**-52),i=!0;for(let e=0;e<this.#t.length;e++){let t=this.#e[e]??NaN,a=this.#t[e]??NaN;if(Number.isNaN(t)||Number.isNaN(a)){this.#t[e]=t;continue}let o=a+(t-a)*n;n>0&&o===a||Math.abs(t-o)<=r?this.#t[e]=t:(this.#t[e]=o,i=!1)}return this.#r=!i,this.#r}};const vn=e=>`${e.colorInput}|${e.texture}`,yn={bar:`BarChart.Bar`,line:`LineChart.Line`,area:`AreaChart.Area`,scatter:`ScatterPlot.Point`},bn=1e3,xn=({bandwidth:e,groupCount:t})=>e>=8*t?2:+(e>=3*t);var Sn=class{#e;#t;#n;#r={xKey:``,xScale:`linear`,yDomain:[`auto`,`auto`],orientation:`vertical`,zKey:null,dimensions:3,stacked:!1,animate:!0};#i={onDatumActivate:null,onActiveIndexChange:null};#a=null;#o=!1;#s=null;#c=null;#l=null;#u=null;#d=null;#f=null;#p=null;#m;#h=!1;#g;#_=!1;#v=0;#y=0;#b=1;#x=[];#S=0;#C=/* @__PURE__ */ new Float64Array;#w=[];#T=null;#E=null;#D=!1;#O=!1;#k=/* @__PURE__ */ new Map;#A=0;#j=0;#M=!0;#N=!0;#P=null;#F=new _n({speed:.16});#I=new _n({speed:.2});#L=/* @__PURE__ */ new Map;#R=/* @__PURE__ */ new Map;#z=!1;#B=/* @__PURE__ */ new Map;#V=/* @__PURE__ */ new Map;#H=0;#U=null;#W=null;#G=/* @__PURE__ */ new Map;#K=!1;#q=/* @__PURE__ */ new Map;#J={alpha:0,target:0};#Y=-1/0;#X=!1;#Z=null;#Q=null;#$=null;#ee={left:0,top:0,width:0,height:0};#te=null;#ne=/* @__PURE__ */ new Float64Array;#re=[0,1];#ie={yaw:.65,pitch:-.35};#ae=new _n({speed:.12});#oe=new _n({speed:.16});#se=null;#ce=!1;#le=null;#ue=[];#de=[];#fe=[];#pe=null;#me=null;#he=/* @__PURE__ */ new Int32Array;#ge=/* @__PURE__ */ new Map;#_e=``;#ve=null;#ye=null;#be=null;#xe=void 0;#Se=null;#Ce=!1;#we=null;#Te=null;#Ee={width:0,height:0};#De=!1;#Oe=!1;#ke=0;#Ae=!1;constructor(e){this.#e=e.kind,this.#t=e.elements,this.#n=e.store,this.#m=e.inView??!0,this.#g=this.#m,e.size!=null&&(this.#v=e.size.width,this.#y=e.size.height),this.#b=this.#Ze(),this.#n.onSeriesChange=()=>{this.#O=!0,this.#qe()},this.#n.onPresentationChange=()=>{this.#qe()},this.#s=st(e.elements.plot,e=>{let t=this.#Ze();(e.contentRect.width!==this.#v||e.contentRect.height!==this.#y||t!==this.#b)&&(this.#v=e.contentRect.width,this.#y=e.contentRect.height,this.#b=t,this.#q.clear(),this.#ve=null,this.#qe())}),this.#m&&this.#Ne();let t=e.elements.root.ownerDocument.documentElement;this.#c=Ve(t,()=>{this.#$=null,this.#qe()}),this.#f=at(e.elements.root.ownerDocument,()=>{this.#G.clear(),this.#qe()}),this.#p=e.elements.root.ownerDocument.defaultView,this.#p!=null&&(this.#d=rt(this.#p,{before:this.#je,after:this.#Me}),this.#u=tt(this.#p,()=>{this.#b=this.#Ze(),this.#q.clear(),this.#qe()})),this.#oe.jump([1,1])}destroy(){this.#Ae=!0,this.#s?.(),this.#l?.disconnect(),this.#c?.(),this.#u?.(),this.#d?.(),this.#f?.(),this.#n.onSeriesChange=null,this.#n.onPresentationChange=null,this.#Q!=null&&(clearTimeout(this.#Q),this.#Q=null),this.#ke!==0&&cancelAnimationFrame(this.#ke)}setInView(e){e===this.#m||this.#Ae||(this.#m=e,e&&(this.#Ne(),(this.#Oe||this.#O)&&this.#Ye()))}markSeen(){if(this.#g||this.#Ae)return;this.#g=!0;let e=performance.now(),t=this.#ze();for(let n of this.#R.values())n.retarget([1],{duration:t,now:e});this.#qe()}releaseBackingStores(){if(this.#Ae)return;let e=this.#t.canvas;(e.width!==0||e.height!==0)&&(e.width=0,e.height=0),this.#Oe=!0}commitNow(){this.#Ae||(this.#ke!==0&&(cancelAnimationFrame(this.#ke),this.#ke=0),this.#De=!1,this.#Xe())}attachTooltip(e){this.#t.tooltip===e||this.#Ae||(this.#l?.disconnect(),this.#l=null,this.#Ee={width:0,height:0},this.#t.tooltip=e,e!=null&&this.#m&&this.#Ne(),this.#Je())}paintForPrint(){if(!(this.#Ae||this.#h)){if(this.#h=!0,this.#v===0||this.#y===0){let e=this.#t.plot.getBoundingClientRect();this.#v=e.width,this.#y=e.height}if(!this.#g){this.#g=!0;let e=performance.now();for(let t of this.#R.values())t.retarget([1],{duration:0,now:e})}this.#Oe=!0,this.#Xe()}}#je=()=>{this.paintForPrint()};#Me=()=>{this.#h=!1,this.#m||this.releaseBackingStores()};#Ne(){let e=this.#t.tooltip;e!=null&&this.#l==null&&typeof ResizeObserver<`u`&&(this.#l=new ResizeObserver(()=>{this.#Ee={width:e.offsetWidth,height:e.offsetHeight},this.#Je()}),this.#l.observe(e))}#Pe(){return this.#o||(this.#o=!0,this.#a=this.#t.canvas.getContext(`2d`)),this.#a}setOptions(e){let t=this.#r;if(this.#r=e,t.xScale!==e.xScale&&this.#B.clear(),t.animate&&!e.animate&&this.#Fe(),t.dimensions!==e.dimensions){let t=[+(e.dimensions>=2),+(e.dimensions>=3)],n=Cn(e.dimensions);if(this.#Re()===0||!this.#z)this.#oe.jump(t),this.#ie=n,this.#ae.jump([n.yaw,n.pitch]);else{let e=n.yaw+Math.round((this.#ie.yaw-n.yaw)/(Math.PI*2))*Math.PI*2;this.#oe.aim(t,performance.now()),this.#ae.jump([this.#ie.yaw,this.#ie.pitch]),this.#ae.aim([e,n.pitch],performance.now())}}(t.xKey!==e.xKey||t.xScale!==e.xScale||t.zKey!==e.zKey||t.stacked!==e.stacked)&&(this.#O=!0),(t.yDomain[0]!==e.yDomain[0]||t.yDomain[1]!==e.yDomain[1])&&(this.#ve=null,this.#z&&(this.#Re()===0?this.#F.jump(this.#Ve()):this.#F.aim(this.#Ve(),performance.now()))),this.#qe()}setCallbacks(e){this.#i=e}setRows(e){e!==this.#x&&(this.#x=e,this.#O=!0,this.#qe())}flushIngest(){!this.#O||this.#Ae||(this.#O=!1,this.#Ie())}setControlledActiveIndex(e){let t=this.#Se;this.#Se=null;let n=this.#xe!==void 0;if(this.#xe=e,e!==void 0){let n=t!=null&&t.index===e&&t.viaKeyboard;this.#At(e==null?null:this.#Et(e),{viaKeyboard:n,notify:!1})}else n&&this.#At(null,{viaKeyboard:!1,notify:!1});this.#Je()}handlePointerMove(e,t){if(this.#se!=null){let n=e-this.#se.lastX,r=t-this.#se.lastY;(this.#se.moved||Math.abs(n)+Math.abs(r)>3)&&(this.#se.moved=!0,this.#ie={yaw:this.#ie.yaw+n*.008,pitch:mt(this.#ie.pitch+r*.008)},this.#ae.jump([this.#ie.yaw,this.#ie.pitch]),this.#se.lastX=e,this.#se.lastY=t,this.#At(null,{viaKeyboard:!1,notify:!1}),this.#qe());return}if(this.#we=e,this.#Te=t,this.#e===`scatter`){let n=this.#Lt(e,t);this.#ye=n?.seriesKey??null,this.#ve=n==null?null:{x:n.screenX,y:n.screenY},this.#At(n?.index??null,{viaKeyboard:!1,notify:!0});return}let n=this.#Ot(e,t);this.#At(n,{viaKeyboard:!1,notify:!0})}handlePointerDown(e,t){this.#ce=!0,this.#Ue()?this.#se={lastX:e,lastY:t,moved:!1}:this.handlePointerMove(e,t)}handlePointerUp(e,t){let n=this.#se;this.#se=null;let r=this.#ce;if(this.#ce=!1,n!=null){if(n.moved)return;this.handlePointerMove(e,t)}r&&this.handleActivate(e,t)}handlePointerLeave(){this.#we=null,this.#Te=null,this.#se=null,this.#ce=!1,this.#ye=null,this.#ve=null,this.#At(null,{viaKeyboard:!1,notify:!0})}handleActivate(e,t){let n=this.#wt();if(n==null)return;let r=this.#Tt(n),i=this.#x[r];if(i==null)return;let a=this.#e===`scatter`?this.#ye:e==null||t==null?null:this.#kt(n,e,t);this.#i.onDatumActivate?.({index:r,xValue:this.#Dt(n),datum:i,dataKey:a})}handleKeyDown(e){if(this.#S===0)return!1;let t=this.#S-1,n=this.#wt(),r=this.#K?Math.max(1,Math.floor(this.#S/Math.max(1,this.#ee.width*this.#b))):1,i=Math.max(1,Math.floor(this.#S/10)),a=(()=>{switch(e){case`ArrowLeft`:return Math.max(0,(n??this.#S)-r);case`ArrowRight`:return Math.min(t,(n??-1)+r);case`PageUp`:return Math.min(t,(n??0)+i);case`PageDown`:return Math.max(0,(n??t)-i);case`Home`:return 0;case`End`:return t;case`Escape`:return null;default:return}})();return a===void 0?e===`Enter`||e===` `?(this.handleActivate(null,null),!0):!1:(this.#we=null,this.#Te=null,this.#ye=null,this.#ve=null,this.#At(a,{viaKeyboard:!0,notify:!0}),!0)}invalidateColors(){this.#$!=null&&(this.#$=null,this.#ge.clear(),this.#qe())}#Fe(){this.#F.jump(this.#Ve()),this.#I.jump(this.#He()),this.#oe.jump([+(this.#r.dimensions>=2),+(this.#r.dimensions>=3)]);let e=Cn(this.#r.dimensions);this.#ie=e,this.#ae.jump([e.yaw,e.pitch]);for(let e of this.#L.values())e.snap();for(let e of this.#R.values())e.snap();this.#J.alpha=this.#J.target,this.#qe()}#Ie(){let e=this.#x,{xKey:t,xScale:n}=this.#r,r=this.#n.seriesSpecs();this.#q.clear();let i=this.#C;if(n===`band`||n===`point`){let n=e.length,r=new Float64Array(n),i=Array.from({length:n},()=>``),a=!1;for(let o=0;o<n;o++){let n=e[o],s=n==null?void 0:j(n,t);s!==void 0&&(a=!0),i[o]=typeof s==`string`||typeof s==`number`||s instanceof Date?s:String(s),r[o]=o}y(n===0||a,()=>N(this.#Ge(),`xKey`,t,e)),this.#T=null,this.#E=null,this.#S=n,this.#C=r,this.#w=i,this.#N=!0}else{let r=new Float64Array(e.length),i=new Int32Array(e.length),a=0,o=!0,s=!1,c=!1;for(let l=0;l<e.length;l++){let u=e[l],d=u==null?void 0:j(u,t);d!==void 0&&(s=!0),d!=null&&(c=!0);let f=M(d,n===`time`);Number.isFinite(f)&&(a>0&&f<(r[a-1]??0)&&(o=!1),r[a]=f,i[a]=l,a+=1)}y(e.length===0||s,()=>N(this.#Ge(),`xKey`,t,e)),y(!c||a>0,()=>ee(this.#Ge(),t,n));let l=a,u=l===e.length?r:r.slice(0,l),d=l===e.length?i:i.slice(0,l);if(!o){let e=u,t=d,n=Array.from({length:l},(e,t)=>t).toSorted((t,n)=>(e[t]??0)-(e[n]??0)||t-n);u=new Float64Array(l),d=new Int32Array(l);for(let r=0;r<l;r++){let i=n[r]??r;u[r]=e[i]??0,d[r]=t[i]??0}}let f=!0;for(let e=0;e<l;e++)if(!Number.isInteger(u[e])){f=!1;break}if(l===e.length&&o)this.#T=null,this.#E=null;else{this.#T=d;let t=new Int32Array(e.length).fill(-1);for(let e=0;e<l;e++){let n=d[e];n!=null&&(t[n]=e)}this.#E=t}this.#S=l,this.#C=u,this.#w=[],this.#N=f}let a=!1;for(let e of this.#w)if(e instanceof Date&&J(e)){a=!0;break}this.#D=a;let o=this.#C[0],s=this.#C[this.#S-1],c=i[0],l=i[i.length-1];if(!this.#Ue()&&(n===`linear`||n===`time`)&&o!=null&&s!=null&&c!=null&&l!=null&&o>c&&o<=l&&s>=l){this.#J.target=1;let e=performance.now(),t=e-this.#Y;this.#Z=t>2e3?null:this.#Z==null?t:this.#Z*.7+t*.3,this.#Y=e,this.#X=!0}else(o!==c||s!==l)&&(this.#J.target=0,this.#Z=null),this.#X=!1;let u=this.#S,d=i.length===u&&u<=2500;if(d){for(let e=0;e<u;e++)if(i[e]!==this.#C[e]){d=!1;break}}let f=this.#k;this.#k=/* @__PURE__ */ new Map;let p=1/0,m=-1/0,h=!0;for(let t of r){let n=new Float64Array(u),r=!1;for(let i=0;i<u;i++){let a=e[this.#T==null?i:this.#T[i]??i],o=a==null?void 0:j(a,t.dataKey);if(o===void 0){n[i]=NaN;continue}r=!0;let s=typeof o==`number`&&Number.isFinite(o)?o:NaN;n[i]=s,Number.isNaN(s)||(s<p&&(p=s),s>m&&(m=s),Number.isInteger(s)||(h=!1))}y(u===0||r,()=>N(yn[t.mark],`dataKey`,t.dataKey,e)),this.#k.set(t.dataKey,n)}this.#A=p===1/0?0:p,this.#j=m===-1/0?0:m,this.#M=h;let g=this.#r.zKey;if(this.#e===`scatter`&&g!=null){let t=new Float64Array(u),n=1/0,r=-1/0,i=!1;for(let a=0;a<u;a++){let o=e[this.#T==null?a:this.#T[a]??a],s=o==null?void 0:j(o,g);s!==void 0&&(i=!0);let c=typeof s==`number`&&Number.isFinite(s)?s:NaN;t[a]=c,Number.isNaN(c)||(c<n&&(n=c),c>r&&(r=c))}y(u===0||i,()=>N(`ScatterPlot.Root`,`zKey`,g,e)),this.#ne=t,this.#re=n===1/0?[0,1]:Rt([n,r],5)}else this.#ne=/* @__PURE__ */ new Float64Array;this.#le=null,this.#ve=null,this.#P=this.#r.stacked?mn(r.map(e=>this.#k.get(e.dataKey)??/* @__PURE__ */ new Float64Array)):null,this.#K=ct({pointCount:u,columnCount:Math.max(1,Math.round(this.#ee.width*this.#b)),wasDecimated:this.#K});let _=this.#$;if(_!=null){for(let e of this.#n.seriesMeta())if(_.inputs.get(e.dataKey)!==vn(e)){this.#$=null;break}}this.#Le(r,f,d);let v=this.#wt();v!=null&&this.#At(Math.min(v,Math.max(0,u-1)),{viaKeyboard:this.#Ce,notify:!1}),this.#Pt({force:!0})}#Le(e,t,n){let r=performance.now(),i=this.#Re(),a=!this.#z;this.#z=this.#z||this.#S>0,a||i===0?(this.#F.jump(this.#Ve()),this.#I.jump(this.#He())):(this.#F.aim(this.#Ve(),r),this.#X&&this.#Z!=null?this.#I.glide(this.#He(),{now:r,duration:this.#Z}):this.#I.aim(this.#He(),r));let o=this.#S>0&&this.#S<=2500&&n,s=/* @__PURE__ */ new Set,c=/* @__PURE__ */ new Set,l=(e,t,n)=>{s.add(e);let a=this.#L.get(e);a??(a=new gn,this.#L.set(e,a));let c=o&&n&&a.values().length===t.length;a.retarget(t,{duration:c?i:0,now:r})};e.forEach((e,n)=>{c.add(e.dataKey);let i=t.has(e.dataKey);if(this.#P==null?l(e.dataKey,this.#k.get(e.dataKey)??/* @__PURE__ */ new Float64Array,i):(l(`${e.dataKey}:lower`,this.#P.lower[n]??/* @__PURE__ */ new Float64Array,i),l(`${e.dataKey}:upper`,this.#P.upper[n]??/* @__PURE__ */ new Float64Array,i)),!this.#R.has(e.dataKey)&&this.#S>0){let t=new gn,n=this.#ze();t.retarget([0],{duration:0,now:r}),(this.#g||n===0)&&t.retarget([1],{duration:this.#g?n:0,now:r}),this.#R.set(e.dataKey,t)}});for(let e of this.#L.keys())s.has(e)||this.#L.delete(e);for(let e of this.#R.keys())c.has(e)||this.#R.delete(e)}#Re(){return!this.#m&&!this.#h?0:this.#ze()}#ze(){return!this.#r.animate||this.#Be()?0:280}#Be(){return this.#p!=null&&Qe(this.#p)}#Ve(){let[e,t]=this.#r.yDomain,n,r;if(this.#P==null?this.#e===`line`||this.#e===`scatter`?(n=this.#A,r=this.#j):(n=Math.min(0,this.#A),r=Math.max(0,this.#j)):(n=Math.min(0,this.#P.min),r=Math.max(0,this.#P.max)),typeof e==`number`&&(n=e),typeof t==`number`&&(r=t),this.#S===0)return[0,1];let i=this.#e===`bar`||this.#e===`area`?zt([n,r],5):Rt([n,r],5);return[typeof e==`number`?e:i[0],typeof t==`number`?t:i[1]]}#He(){if(this.#S===0)return[0,1];let e=this.#C[0]??0,t=this.#C[this.#S-1]??0;return e===t?[e-.5,t+.5]:this.#e===`scatter`?Rt([e,t],5):[e,t]}#Ue(){return this.#e===`scatter`&&this.#r.zKey!=null}#We(){return this.#e===`bar`&&this.#r.orientation===`horizontal`}#Ge(){return`${yn[this.#e].split(`.`)[0]??`Chart`}.Root`}#Ke(e,t){let n=this.#G.get(t);return n??(this.#G.size>=512&&this.#G.clear(),n=e.measureText(t).width,this.#G.set(t,n)),n}#qe(){this.#Oe=!0,this.#_=!0,this.#Ye()}#Je(){this.#Ye()}#Ye(){this.#De||this.#Ae||(this.#De=!0,this.#ke=requestAnimationFrame(()=>{this.#De=!1,this.#ke=0,this.#Xe()}))}#Xe(){if(!this.#Ae){if(this.flushIngest(),this.#Oe&&!this.#m&&!this.#h)this.#_&&(this.#_=!1,this.#tt());else if(this.#Oe){this.#Oe=!1,this.#_=!1;let e=performance.now(),t=!1;t=this.#F.tick(e)||t,t=this.#I.tick(e)||t;for(let n of this.#L.values())t=n.tick(e)||t;for(let n of this.#R.values())t=n.tick(e)||t;if(t=this.#oe.tick(e)||t,this.#ae.tick(e)){t=!0;let e=this.#ae.values();this.#ie={yaw:e[0]??this.#ie.yaw,pitch:e[1]??this.#ie.pitch}}this.#v>0&&this.#y>0&&this.#Qe(),this.#tt(),t=this.#ut(e)||t,t&&this.#qe()}this.#zt()}}#Ze(){return typeof devicePixelRatio==`number`&&devicePixelRatio>0?Math.min(devicePixelRatio,3):1}#Qe(){let e=this.#t.root,t=`${ze(e.ownerDocument.documentElement)}|${this.#b}|${this.#r.orientation}`;if(this.#$?.signature===t)return;let n=this.#$e();if(n==null)return;let r=this.#Pe(),i=/* @__PURE__ */ new Map,a=/* @__PURE__ */ new Map,o=/* @__PURE__ */ new Map;for(let e of this.#n.seriesMeta()){let t=Le(n,e.colorInput);if(i.set(e.dataKey,t),a.set(e.dataKey,vn(e)),r!=null&&e.mark===`bar`&&e.texture!==`solid`){let i=Xe(r,{texture:e.texture,color:t,ink:n.resolve(Ge(t)),devicePixelRatio:this.#b,orientation:this.#r.orientation});i!=null&&o.set(e.dataKey,i)}}this.#G.clear(),this.#$={signature:t,resolver:n,series:i,inputs:a,barTextures:o,chrome:Re(n),fontFamily:n.fontFamily}}#$e(){let e=this.#t.root,t=e.ownerDocument.defaultView;return t==null?null:Ie(this.#t.plot,{computed:t.getComputedStyle(e),parseContext:Y(e.ownerDocument)})}#et(e){let t=this.#$?.signature??``;t!==this.#_e&&(this.#ge.clear(),this.#_e=t);let n=this.#ge.get(e);if(n!=null)return n;let r=this.#$?.resolver??this.#$e(),i=r==null?e:Le(r,e);return this.#ge.set(e,i),i}#tt(){let e=this.#n.getSnapshot(),t=this.#Ue(),n=this.#We(),r=!t&&e.xAxis!=null,i=!t&&e.yAxis!=null,a=n?r:i,o=(n?i:r)?24:8,s=Math.max(0,this.#y-8-o);this.#ee={left:8,top:8,width:Math.max(0,this.#v-16),height:s};let c=8;if(a){c=40;let e=this.#$==null?null:this.#Pe();if(e!=null&&this.#$!=null){e.font=`11px ${this.#$.fontFamily}`;let t=0,r=n?this.#st().map(e=>e.text):this.#ot().map(e=>e.text);for(let n of r){let r=this.#Ke(e,n);r>t&&(t=r)}c=Math.ceil(t)+14}}this.#ee={left:c,top:8,width:Math.max(0,this.#v-c-8),height:s};let l=n?this.#ee.top:this.#ee.left,u=n?this.#ee.top+this.#ee.height:this.#ee.left+this.#ee.width;this.#te=this.#r.xScale===`band`?Dt({count:this.#S,rangeStart:l,rangeEnd:u,paddingInner:.2,paddingOuter:.1}):this.#r.xScale===`point`?Dt({count:this.#S,rangeStart:l,rangeEnd:u,paddingInner:1,paddingOuter:.5}):null,this.#K=ct({pointCount:this.#S,columnCount:Math.max(1,Math.round(this.#ee.width*this.#b)),wasDecimated:this.#K})}#nt(){let e=this.#F.values();return Et([e[0]??0,e[1]??1],[this.#ee.top+this.#ee.height,this.#ee.top])}#rt(){let e=this.#F.values(),t=this.#We()?[this.#ee.left,this.#ee.left+this.#ee.width]:[this.#ee.top+this.#ee.height,this.#ee.top];return Et([e[0]??0,e[1]??1],t)}#it(){let e=this.#I.values();return Et([e[0]??0,e[1]??1],[this.#ee.left,this.#ee.left+this.#ee.width])}#at(e){let t=this.#te;if(t!=null)return Ot(t,e);let{k:n,b:r}=this.#it();return(this.#C[e]??0)*n+r}#ot(){let e=this.#n.getSnapshot(),t=this.#F.values(),n=e.yAxis?.tickCount,r=this.#We()?1/0:Math.max(2,Math.floor(this.#ee.height/28)),i=Math.min(n??1/0,r),a=n??5,o=e.yAxis?.tickFormat,s=`${t[0]}|${t[1]}|${i}|${a}|${this.#M}`,c=this.#U;if(c!=null&&c.key===s&&c.format===o)return c.ticks;let l=Mt([t[0]??0,t[1]??1],i,{count:a,integer:this.#M}),u=l.length>1?Math.abs((l[1]??0)-(l[0]??0)):0,d=Math.abs((t[1]??1)-(t[0]??0)),f=l.length>1?u:d,p=f>0?G(f):void 0,m=l.map(e=>{let t=W(e,p==null?void 0:{maximumFractionDigits:p});return{value:e,text:o==null?t:o(e,{defaultLabel:t,step:u})}});return this.#U={key:s,format:o,ticks:m},m}#st(){let e=this.#n.getSnapshot().xAxis?.tickFormat,t=this.#ct(),n=this.#W;if(n!=null&&n.key===t&&n.format===e&&n.xValues===this.#w)return n.ticks;let r=this.#lt();return this.#W={key:t,format:e,xValues:this.#w,ticks:r},r}#ct(){if(this.#te!=null){let e=this.#We();return`band|${e}|${e?this.#ee.height:this.#ee.width}|${this.#S}|${this.#D}`}let e=this.#I.values(),t=this.#n.getSnapshot().xAxis?.tickCount;return`${this.#r.xScale}|${e[0]}|${e[1]}|${t}|${this.#ee.width}|${this.#N}`}#lt(){let e=this.#n.getSnapshot(),t=e.xAxis?.tickFormat;if(this.#te!=null){let e=this.#We(),n=e?this.#ee.height:this.#ee.width,r=Math.max(1,Math.floor(n/(e?15:60))),i=Math.max(1,Math.ceil(this.#S/r)),a=[];for(let e=0;e<this.#S;e+=i){let n=this.#w[e]??``,r=de(n,{datasetHasTimeOfDay:this.#D});a.push({index:e,value:e,text:t==null?r:t(n,{defaultLabel:r})})}return a}let n=this.#I.values(),r=[n[0]??0,n[1]??1],i=e.xAxis?.tickCount??Math.max(2,Math.floor(this.#ee.width/90));if(this.#r.xScale===`time`){let e=Lt(r);return It(r,i).map(n=>{let r=e(n);return{index:null,value:n,text:t==null?r:t(new Date(n),{defaultLabel:r})}})}let a=jt(r,i,{integer:this.#N}),o=a.length>1?G(Math.abs((a[1]??0)-(a[0]??0))):void 0;return a.map(e=>{let n=W(e,o==null?void 0:{maximumFractionDigits:o});return{index:null,value:e,text:t==null?n:t(e,{defaultLabel:n})}})}#ut(e){let t=this.#Pe(),n=this.#$;if(t==null||n==null||this.#v<=0||this.#y<=0)return!1;let r=Math.min(50,Math.max(0,e-this.#H));this.#H=e;let i=this.#t.canvas,a=Math.round(this.#v*this.#b),o=Math.round(this.#y*this.#b);(i.width!==a||i.height!==o)&&(i.width=a,i.height=o),t.setTransform(this.#b,0,0,this.#b,0,0),t.clearRect(0,0,this.#v,this.#y);let s=this.#n.getSnapshot(),c=this.#ee;if(c.width<=0||c.height<=0)return!1;let l=this.#nt(),u=this.#it(),d=this.#n.seriesSpecs(),f=this.#Ue(),p=this.#Re()===0,m=s.xAxis!=null||s.yAxis!=null||s.grid!=null,h=f||!m?[]:this.#dt(t,n.fontFamily),g=f||!m?[]:this.#ft(t,n.fontFamily),_=wn(this.#B,h,r,p);_=wn(this.#V,g,r,p)||_;let v=this.#J;if(v.target===1){if(e-this.#Y>bn)v.target=0;else if(this.#Q==null){let t=bn-(e-this.#Y)+17;this.#Q=setTimeout(()=>{this.#Q=null,this.#qe()},t)}}if(p)v.alpha=v.target;else{let e=1-(1-(v.target>v.alpha?.16:.08))**(r/16.67);v.alpha+=(v.target-v.alpha)*e,Math.abs(v.target-v.alpha)<.02&&(v.alpha=v.target)}v.alpha!==v.target&&(_=!0);let y=this.#We(),b=y?this.#rt():l,x=e=>this.#te==null?e*u.k+u.b:Ot(this.#te,e),S=e=>e*b.k+b.b,C=[...this.#B.entries()].map(([e,t])=>({position:x(e),alpha:t.alpha})),w=[...this.#V.entries()].map(([e,t])=>({position:S(e),alpha:t.alpha})),T=()=>{if(s.grid==null||f)return;let e=s.grid.lines??(y?`vertical`:`horizontal`),r=y?C:w,i=y?w:C;Vt(t,{plot:c,color:n.chrome.grid,xLines:e===`horizontal`?[]:i,yLines:e===`vertical`?[]:r})},E=Math.min(40,c.width*.25),D=v.alpha>.01&&E>1;D||T(),t.save(),t.beginPath(),t.rect(c.left,c.top,c.width,c.height+1),t.clip();let O=null;if(this.#e===`bar`?y?this.#bt(t,d):this.#yt(t,d,l):this.#e===`scatter`?O=this.#Ft(t,d,l):this.#xt(t,d,l),t.restore(),D){t.save(),t.globalCompositeOperation=`destination-out`;let e=t.createLinearGradient(c.left,0,c.left+E,0);e.addColorStop(0,`rgba(0, 0, 0, ${v.alpha})`),e.addColorStop(1,`rgba(0, 0, 0, 0)`),t.fillStyle=e,t.fillRect(c.left,c.top,E,c.height+1),t.globalCompositeOperation=`destination-over`,T(),t.restore()}O!=null&&un(t,{textColor:n.chrome.tickText,fontFamily:n.fontFamily,plot:c,center:O.center,axes:O.axes}),this.#e===`bar`&&this.#S>0&&(y?Wt(t,{plot:c,color:n.chrome.baseline,x:S(0)}):Ut(t,{plot:c,color:n.chrome.baseline,y:S(0)}));for(let e of f?[]:s.referenceLines){let r=S(e.y);if(y?r<c.left||r>c.left+c.width:r<c.top||r>c.top+c.height)continue;let i=e.color==null?n.chrome.reference:this.#et(e.color);y?fn(t,{plot:c,color:i,textColor:n.chrome.tickText,x:r,label:e.label,fontFamily:n.fontFamily}):dn(t,{plot:c,color:i,textColor:n.chrome.tickText,y:r,label:e.label,fontFamily:n.fontFamily})}let k=s.xAxis==null||f?[]:[...this.#B.entries()].map(([e,t])=>({position:x(e),text:t.text,alpha:t.alpha})),A=s.yAxis==null||f?[]:[...this.#V.entries()].map(([e,t])=>({position:S(e),text:t.text,alpha:t.alpha})),j=y?A:k,M=y?k:A;return(j.length>0||M.length>0)&&pn(t,{plot:c,color:n.chrome.tickText,fontFamily:n.fontFamily,xLabels:j,yLabels:M}),_}#dt(e,t){e.font=`11px ${t}`;let n=this.#We(),r=this.#it(),i=[],a=-1/0;for(let t of this.#st()){let o=t.index!=null&&this.#te!=null,s=o&&this.#te!=null?Ot(this.#te,t.index??0):t.value*r.k+r.b,c=n?15/2:this.#Ke(e,t.text)/2,l=n?2:8;s-c<a+l||(a=s+c,i.push({key:o?t.index??0:t.value,text:t.text}))}return i}#ft(e,t){let n=this.#ot(),r=this.#rt();if(!this.#We()){let e=[],t=NaN;for(let i of n){let n=i.value*r.k+r.b;Math.abs(n-t)<13||(t=n,e.push({key:i.value,text:i.text}))}return e}e.font=`11px ${t}`;let i=[],a=-1/0;for(let t of n){let n=t.value*r.k+r.b,o=this.#Ke(e,t.text)/2;n-o<a+8||(a=n+o,i.push({key:t.value,text:t.text}))}return i}#pt(e,t,n){let r=t===`value`?e.dataKey:`${e.dataKey}:${t}`;if(!this.#K&&this.#S<=2500){let e=this.#L.get(r);if(e!=null&&e.values().length===this.#S)return e.values()}return t===`value`?this.#k.get(e.dataKey)??/* @__PURE__ */ new Float64Array:(t===`lower`?this.#P?.lower:this.#P?.upper)?.[n]??/* @__PURE__ */ new Float64Array}#mt(e){let t=[];for(let n=0;n<this.#S;n++)Number.isNaN(e[n]??NaN)||t.push(n);return t}#ht(e){return this.#fe.length!==e&&(this.#fe=Array.from({length:e},(e,t)=>t)),this.#fe}#gt(e){return this.#R.get(e)?.values()[0]??1}#_t(e,t){if(e==null)return 0;let n=e[t]??0;return Number.isNaN(n)?0:n}#vt(e,t,n){let r=this.#P;if(r==null)return!0;let i=r.lower[e]?.[t]??NaN,a=r.upper[e]?.[t]??NaN;if(Number.isNaN(i)||Number.isNaN(a))return!1;let o=i<0,s=(o?r.negativeEnd:r.positiveEnd)[t]??-1;if(s<0)return!1;let c=(o?r.lower:r.upper)[s]?.[t]??NaN;return Ce({lower:i,upper:a,pileOuter:c,toPixel:n})}#yt(e,t,n){let r=this.#te,i=this.#$;if(r==null||i==null||this.#S===0||t.length===0)return;let a=this.#P!=null,o=a?1:t.length,s=xn({bandwidth:r.bandwidth,groupCount:o}),c=(r.bandwidth-s*(o-1))/o,l=ye({step:r.step,slot:c}),u=e=>e*n.k+n.b,d=this.#ue;t.forEach((t,n)=>{let f=this.#gt(t.dataKey),p=0,m=a?this.#pt(t,`lower`,n):null,h=a?this.#pt(t,`upper`,n):this.#pt(t,`value`,n);for(let e=0;e<this.#S;e++){let t=h[e]??NaN;if(Number.isNaN(t))continue;let i=this.#_t(m,e),g=a?Q(r,e)+(r.bandwidth-l)/2:Q(r,e)+(r.bandwidth-(c*o+s*(o-1)))/2+n*(c+s)+(c-l)/2,_=Se({lower:i,upper:t,toPixel:u,reveal:f,gap:a?s:0}),v=d[p]??kn();d[p]=v,p+=1,v.x=g,v.width=l,v.baselineY=_.baseline,v.valueY=_.value,v.rounded=this.#vt(n,e,u)}Gt(e,{fill:i.barTextures.get(t.dataKey)??i.series.get(t.dataKey)??`currentColor`,rects:d,count:p})})}#bt(e,t){let n=this.#te,r=this.#$;if(n==null||r==null||this.#S===0||t.length===0)return;let i=this.#rt(),a=this.#P!=null,o=a?1:t.length,s=xn({bandwidth:n.bandwidth,groupCount:o}),c=(n.bandwidth-s*(o-1))/o,l=ye({step:n.step,slot:c}),u=e=>e*i.k+i.b,d=this.#de;t.forEach((t,i)=>{let f=this.#gt(t.dataKey),p=0,m=a?this.#pt(t,`lower`,i):null,h=a?this.#pt(t,`upper`,i):this.#pt(t,`value`,i);for(let e=0;e<this.#S;e++){let t=h[e]??NaN;if(Number.isNaN(t))continue;let r=this.#_t(m,e),g=a?Q(n,e)+(n.bandwidth-l)/2:Q(n,e)+(n.bandwidth-(c*o+s*(o-1)))/2+i*(c+s)+(c-l)/2,_=Se({lower:r,upper:t,toPixel:u,reveal:f,gap:a?s:0}),v=d[p]??An();d[p]=v,p+=1,v.y=g,v.height=l,v.baselineX=_.baseline,v.valueX=_.value,v.rounded=this.#vt(i,e,u)}Kt(e,{fill:r.barTextures.get(t.dataKey)??r.series.get(t.dataKey)??`currentColor`,rects:d,count:p})})}#xt(e,t,n){let r=this.#$;if(r==null||this.#S===0)return;let i=this.#it(),a=this.#te,o=e=>a==null?(this.#C[e]??0)*i.k+i.b:Ot(a,e);t.forEach((t,i)=>{let a=r.series.get(t.dataKey)??`currentColor`,s=this.#gt(t.dataKey);if(e.save(),s<1&&(e.beginPath(),e.rect(this.#ee.left,0,this.#ee.width*s,this.#y),e.clip()),this.#K){this.#St(e,t,i,a,n),e.restore();return}let c=t.mark===`area`,l=this.#pt(t,this.#P==null?`value`:`upper`,i),u=this.#P==null?null:this.#pt(t,`lower`,i),d=e=>!Number.isNaN(l[e]??NaN),f=t.connectNulls?this.#mt(l):this.#ht(this.#S),p=e=>(l[e]??0)*n.k+n.b;if(c){let r=u==null?()=>0*n.k+n.b:e=>(u[e]??0)*n.k+n.b;Jt(e,{color:a,curve:t.curve,indexes:f,xAt:o,y0At:r,y1At:p,definedAt:d})}else qt(e,{color:a,curve:t.curve,indexes:f,xAt:o,yAt:p,definedAt:d}),t.markers&&this.#ee.width/this.#S>=12&&rn(e,{color:a,surface:r.chrome.surface,shape:this.#n.seriesShape(t.dataKey),indexes:f,xAt:o,yAt:p,definedAt:d});e.restore()})}#St(e,t,n,r,i){let a=Math.max(1,Math.round(this.#ee.width*this.#b)),o=e=>this.#ee.left+(e+.5)/this.#b;if(t.mark===`area`){let s=this.#Ct(`${t.dataKey}:upper`,this.#pt(t,this.#P==null?`value`:`upper`,n),a),c=this.#P==null?null:this.#Ct(`${t.dataKey}:lower`,this.#pt(t,`lower`,n),a);if(c==null){let t=this.#me;t?.columnCount!==a&&(t=jn(a),this.#me=t),Xt(e,{color:r,lowerColumns:t,upperColumns:s,columnToX:o,valueK:i.k,valueB:i.b})}else Xt(e,{color:r,lowerColumns:c,upperColumns:s,columnToX:o,valueK:i.k,valueB:i.b});return}let s=this.#Ct(t.dataKey,this.#pt(t,`value`,n),a);Yt(e,{color:r,columns:s,columnToX:o,valueK:i.k,valueB:i.b})}#Ct(e,t,n){let r=this.#I.values(),i=`${r[0]??0}:${r[1]??1}:${n}`,a=this.#q.get(e);if(a!=null&&a.key===i)return a.columns;let o=[r[0]??0,r[1]??1],s=Et(o,[0,n]),c=lt({xs:this.#C,values:t,startIndex:0,endIndex:this.#S-1,positionK:s.k,positionB:s.b,columnCount:n});return this.#q.set(e,{key:i,columns:c}),c}#wt(){if(this.#S===0)return null;let e;return e=this.#xe===void 0?this.#be:this.#xe==null?null:this.#Et(this.#xe),e==null?null:Math.min(Math.max(0,e),this.#S-1)}#Tt(e){return this.#T==null?e:this.#T[e]??e}#Et(e){if(this.#x.length===0)return null;let t=Math.min(Math.max(0,e),this.#x.length-1);if(this.#E==null)return t;let n=this.#E[t]??-1;return n===-1?null:n}#Dt(e){if(e<0||e>=this.#S)return``;let{xScale:t}=this.#r;if(t===`band`||t===`point`)return this.#w[e]??``;let n=this.#C[e]??0;return t===`time`?new Date(n):n}#Ot(e,t){if(this.#S===0)return null;let n=this.#te;if(n!=null)return At(n,this.#We()?t:e);let{k:r,b:i}=this.#it();if(r===0)return 0;let a=e;if(this.#K){let t=Math.floor((e-this.#ee.left)*this.#b);a=this.#ee.left+(t+.5)/this.#b}return ut(this.#C,this.#S,(a-i)/r)}#kt(e,t,n){let r=this.#n.seriesSpecs(),i=this.#We(),a=this.#te;if(this.#e===`bar`&&this.#P==null&&a!=null&&r.length>1){let o=(i?n:t)-Q(a,e),s=Math.floor(o/Math.max(1,a.bandwidth)*r.length);return r[Math.min(r.length-1,Math.max(0,s))]?.dataKey??null}let{k:o,b:s}=i?this.#rt():this.#nt(),c=i?t:n,l=this.#P;if(this.#e===`bar`&&l!=null)for(let t=0;t<r.length;t++){let n=l.lower[t]?.[e]??NaN,i=l.upper[t]?.[e]??NaN;if(Number.isNaN(n)||Number.isNaN(i)||n===i)continue;let a=n*o+s,u=i*o+s;if(c>=Math.min(a,u)&&c<=Math.max(a,u))return r[t]?.dataKey??null}let u=null,d=1/0;return r.forEach((t,n)=>{let r=(this.#P==null?this.#k.get(t.dataKey):this.#P.upper[n])?.[e]??NaN;if(Number.isNaN(r))return;let i=Math.abs(r*o+s-c);i<d&&(d=i,u=t.dataKey)}),u}#At(e,t){let n=e==null||this.#S===0?null:Math.min(Math.max(0,e),this.#S-1),r=this.#xe!==void 0;if(t.notify&&n!==this.#wt()){let e=n==null?null:this.#Tt(n);if(this.#i.onActiveIndexChange?.(e),r){this.#Se={index:e,viaKeyboard:t.viaKeyboard};return}}this.#Ce=t.viaKeyboard,r||(this.#be=n),this.#Pt(),this.#Je()}#jt=null;#Mt=!1;#Nt=null;#Pt(e={force:!1}){let t=this.#wt();if(!e.force&&t===this.#jt&&this.#Ce===this.#Mt&&this.#ye===this.#Nt)return;if(this.#jt=t,this.#Mt=this.#Ce,this.#Nt=this.#ye,t==null||this.#S===0){this.#n.publishHover(null);return}let n=this.#Tt(t),r=this.#x[n]??{},i=this.#n.getSnapshot().series.map(e=>{let n=this.#k.get(e.dataKey)?.[t]??NaN;return{dataKey:e.dataKey,label:e.label,value:Number.isNaN(n)?null:n,color:e.color}});this.#r.stacked&&i.reverse(),this.#e===`scatter`&&(i=this.#ye==null?i.filter(e=>e.value!=null):i.filter(e=>e.dataKey===this.#ye));let a={index:n,xValue:this.#Dt(t),datum:r,points:i,viaKeyboard:this.#Ce};if(this.#Ue()){let e=this.#ne[t]??NaN;a.zValue=Number.isNaN(e)?null:e}this.#n.publishHover(a)}#Ft(e,t,n){let r=this.#$;if(r==null||this.#S===0||t.length===0)return null;if(this.#Ue())return this.#It(e,t);let i=this.#it(),a=this.#pe;if(a==null||a.columns!==this.#k||a.specs!==t){let e=t.map(e=>this.#mt(this.#k.get(e.dataKey)??/* @__PURE__ */ new Float64Array));a={columns:this.#k,specs:t,indexes:e,total:e.reduce((e,t)=>e+t.length,0)},this.#pe=a}let o=a.indexes,s=a.total;return t.forEach((t,a)=>{let c=this.#pt(t,`value`,a),l=o[a]??[];e.save(),e.globalAlpha=this.#gt(t.dataKey),sn(e,{color:r.series.get(t.dataKey)??`currentColor`,surface:r.chrome.surface,shape:this.#n.seriesShape(t.dataKey),totalPointCount:s,indexes:l,xAt:e=>(this.#C[e]??0)*i.k+i.b,yAt:e=>(c[e]??0)*n.k+n.b,radiusAt:()=>4}),e.restore()}),null}#It(e,t){let n=this.#$;if(n==null)return null;let r=this.#ee,i=ft(this.#ie),a=r.left+r.width/2,o=r.top+r.height/2,s=this.#oe.values(),c=s[0]??1,l=s[1]??1,u=.85-.22*c-.11*l,d=Math.min(r.width,r.height)/2*u,f=this.#I.values(),p=[f[0]??0,f[1]??1],m=this.#F.values(),h=[m[0]??0,m[1]??1],g=this.#re,_=t.map(e=>this.#gt(e.dataKey)),v=this.#oe.values(),y=v[0]??1,b=v[1]??1,x=(e,t,n)=>{let r=pt(e,t,n,i);return{x:a+r.x*d,y:o-r.y*d}},S=gt.map(([e,t,n])=>x(e,t,n)),C=t[0],w=t.length===1&&C!=null?C.dataKey:`y`,T=[{label:this.#r.xKey,alpha:1,from:x(-1,-y,-b),to:x(1,-y,-b)},{label:w,alpha:y,from:x(-1,-1,-b),to:x(-1,1,-b)},{label:this.#r.zKey??`z`,alpha:b,from:x(-1,-y,-1),to:x(-1,-y,1)}];ln(e,{gridColor:n.chrome.grid,axisColor:n.chrome.baseline,corners:S,edges:_t,cubeAlpha:b,axes:T});let E=this.#S*t.length,D=this.#le;(D==null||D.screenX.length<E)&&(D={screenX:new Float64Array(E),screenY:new Float64Array(E),radius:new Float64Array(E),seriesIndex:new Int32Array(E),pointIndex:new Int32Array(E),depths:new Float64Array(E),count:0});let O=D.depths,k=0;t.forEach((e,t)=>{let n=this.#pt(e,`value`,t);for(let e=0;e<this.#S;e++){let r=n[e]??NaN,s=this.#ne[e]??NaN;if(Number.isNaN(r)||Number.isNaN(s))continue;let c=pt(ht(this.#C[e]??0,p),ht(r,h)*y,ht(s,g)*b,i);D.screenX[k]=a+c.x*d,D.screenY[k]=o-c.y*d,D.radius[k]=4*c.scale,D.seriesIndex[k]=t,D.pointIndex[k]=e,O[k]=c.depth,k+=1}}),D.count=k,this.#le=D,this.#he.length<k&&(this.#he=new Int32Array(E));let A=this.#he.subarray(0,k);for(let e=0;e<k;e++)A[e]=e;A.sort((e,t)=>(O[t]??0)-(O[e]??0));let j=t.map(e=>this.#n.seriesShape(e.dataKey));return cn(e,{count:k,order:A,screenX:D.screenX,screenY:D.screenY,radius:D.radius,colorAt:e=>{let r=t[D.seriesIndex[e]??0];return r==null?`currentColor`:n.series.get(r.dataKey)??`currentColor`},shapeAt:e=>j[D.seriesIndex[e]??0]??`circle`,alphaAt:e=>_[D.seriesIndex[e]??0]??1,surface:n.chrome.surface}),{center:{x:a,y:o},axes:T}}#Lt(e,t){let n=this.#n.seriesSpecs(),r=576,i=null;if(this.#Ue()){let a=this.#le;if(a==null)return null;for(let o=0;o<a.count;o++){let s=(a.screenX[o]??0)-e,c=(a.screenY[o]??0)-t,l=s*s+c*c;if(l<r){let e=n[a.seriesIndex[o]??0];if(e==null)continue;r=l,i={seriesKey:e.dataKey,index:a.pointIndex[o]??0,screenX:a.screenX[o]??0,screenY:a.screenY[o]??0}}}return i}let a=this.#it(),o=this.#nt();for(let s of n){let n=this.#k.get(s.dataKey);if(n!=null)for(let c=0;c<this.#S;c++){let l=n[c]??NaN;if(Number.isNaN(l))continue;let u=(this.#C[c]??0)*a.k+a.b,d=l*o.k+o.b,f=u-e,p=d-t,m=f*f+p*p;m<r&&(r=m,i={seriesKey:s.dataKey,index:c,screenX:u,screenY:d})}}return i}#Rt(e){let t=this.#n.seriesSpecs();if(this.#Ue()){let t=this.#le;if(t==null)return null;for(let n=0;n<t.count;n++)if((t.pointIndex[n]??-1)===e)return{x:t.screenX[n]??0,y:t.screenY[n]??0};return null}let n=this.#it(),r=this.#nt();for(let i of t){let t=this.#k.get(i.dataKey)?.[e]??NaN;if(!Number.isNaN(t))return{x:(this.#C[e]??0)*n.k+n.b,y:t*r.k+r.b}}return null}#zt(){let{hover:e,tooltip:t}=this.#t;if(e==null)return;let{crosshair:n,band:r,markers:i}=e,a=this.#wt(),o=a!=null&&this.#S>0,s=this.#e===`bar`,c=this.#e===`scatter`;if(n.style.opacity=o&&!s&&!c?`1`:`0`,r.style.opacity=o&&s?`1`:`0`,i.style.opacity=o&&!s?`1`:`0`,t!=null&&(t.style.opacity=o?`1`:`0`),!o)return;let l=this.#ee;if(c){let e=this.#ve??this.#Rt(a);if(e==null){i.style.opacity=`0`,t!=null&&(t.style.opacity=`0`);return}for(;i.children.length>1;)i.lastElementChild?.remove();i.children.length===0&&i.appendChild(En(i.ownerDocument));let n=i.children[0];if(n instanceof HTMLElement){let t=this.#n.getSnapshot().series,r=this.#ye==null?t.find(e=>{let t=this.#k.get(e.dataKey)?.[a]??NaN;return!Number.isNaN(t)}):t.find(e=>e.dataKey===this.#ye);n.style.opacity=`1`,On(n,r?.shape??`circle`,r?.color??`currentColor`),n.style.transform=`translate3d(${e.x}px, ${e.y}px, 0)`}this.#Bt(e.x,e.y);return}let u=this.#at(a),d=this.#We();if(s){let e=this.#te;if(e!=null){let t=kt(e,a),n=Math.max(1,t.size),i=t.start-(n-t.size)/2;d?(r.style.transform=`translate3d(${l.left}px, ${i}px, 0)`,r.style.width=`${l.width}px`,r.style.height=`${n}px`):(r.style.transform=`translate3d(${i}px, ${l.top}px, 0)`,r.style.width=`${n}px`,r.style.height=`${l.height}px`)}}else{n.style.transform=`translate3d(${u}px, ${l.top}px, 0)`,n.style.height=`${l.height}px`;let e=this.#n.getSnapshot().series;for(;i.children.length>e.length;)i.lastElementChild?.remove();for(;i.children.length<e.length;)i.appendChild(En(i.ownerDocument));let t=this.#nt();e.forEach((e,n)=>{let r=i.children[n];if(!(r instanceof HTMLElement))return;let o=this.#k.get(e.dataKey)?.[a]??NaN,s=this.#pt(e,this.#P==null?`value`:`upper`,n)[a]??NaN;Number.isNaN(o)||Number.isNaN(s)?r.style.opacity=`0`:(r.style.opacity=`1`,On(r,e.shape,e.color),r.style.transform=`translate3d(${u}px, ${s*t.k+t.b}px, 0)`)})}s&&d&&this.#te!=null?this.#Bt(this.#we??l.left+l.width/2,Ot(this.#te,a)):this.#Bt(u,this.#Te??l.top+8)}#Bt(e,t){let n=this.#ee,r=this.#t.tooltip;if(r==null)return;let i=this.#Ee,a=e+12;a+i.width>n.left+n.width&&e-12-i.width>=n.left&&(a=e-12-i.width);let o=Math.max(0,Math.min(t-i.height/2,n.top+n.height-i.height));r.style.transform=`translate3d(${a}px, ${o}px, 0)`}};const Cn=e=>e===3?{yaw:.65,pitch:-.35}:{yaw:0,pitch:0},wn=(e,t,n,r)=>{for(let t of e.values())t.target=0;for(let n of t){let t=e.get(n.key);t==null?e.set(n.key,{alpha:+!!r,target:1,text:n.text}):(t.target=1,t.text=n.text)}let i=1-.84**(n/16.67),a=1-.88**(n/16.67),o=!1;for(let[t,n]of e){if(r)n.alpha=n.target;else{let e=n.target>n.alpha?i:a;n.alpha+=(n.target-n.alpha)*e}n.target===1&&n.alpha>.98&&(n.alpha=1),n.target===0&&n.alpha<.03?e.delete(t):n.alpha!==n.target&&(o=!0)}return o},Tn={circle:`circle(50%)`,square:`inset(8%)`,triangle:`polygon(50% 0%, 100% 100%, 0% 100%)`,diamond:`polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)`,"triangle-down":`polygon(0% 0%, 100% 0%, 50% 100%)`,plus:`polygon(33.33% 0%, 66.67% 0%, 66.67% 33.33%, 100% 33.33%, 100% 66.67%, 66.67% 66.67%, 66.67% 100%, 33.33% 100%, 33.33% 66.67%, 0% 66.67%, 0% 33.33%, 33.33% 33.33%)`,cross:`polygon(73.57% 2.86%, 97.14% 26.43%, 73.57% 50%, 97.14% 73.57%, 73.57% 97.14%, 50% 73.57%, 26.43% 97.14%, 2.86% 73.57%, 26.43% 50%, 2.86% 26.43%, 26.43% 2.86%, 50% 26.43%)`,star:`polygon(50% 2.45%, 61.8% 38.77%, 100% 38.77%, 69.1% 61.23%, 80.9% 97.55%, 50% 75.1%, 19.1% 97.55%, 30.9% 61.23%, 0% 38.77%, 38.2% 38.77%)`},En=e=>{let t=e.createElement(`div`);t.setAttribute(`data-slot`,`chart-active-point`),t.style.position=`absolute`,t.style.width=`12px`,t.style.height=`12px`,t.style.left=`-6px`,t.style.top=`-6px`;let n=e.createElement(`div`);n.style.position=`absolute`,n.style.inset=`0`,n.style.backgroundColor=`var(--background-color-card)`;let r=e.createElement(`div`);return r.style.position=`absolute`,r.style.inset=`2px`,t.appendChild(n),t.appendChild(r),t},Dn=/* @__PURE__ */ new WeakMap,On=(e,t,n)=>{let r=Dn.get(e);if(r?.shape===t&&r.color===n)return;Dn.set(e,{shape:t,color:n});let i=Tn[t];e.setAttribute(`data-shape`,t);let[a,o]=e.children;a instanceof HTMLElement&&(a.style.clipPath=i),o instanceof HTMLElement&&(o.style.clipPath=i,o.style.backgroundColor=n)},kn=()=>({x:0,width:0,baselineY:0,valueY:0,rounded:!1}),An=()=>({y:0,height:0,baselineX:0,valueX:0,rounded:!1}),jn=e=>{let t=new Float64Array(e);return{columnCount:e,hasData:new Uint8Array(e).fill(1),minValue:t,maxValue:t,inValue:t,outValue:t}},Mn=e=>e.replaceAll(`|`,`\\|`).replaceAll(/\s*\n\s*/g,` `),Nn=e=>e instanceof Date?Number.isNaN(e.getTime())?`—`:e.toISOString():typeof e==`number`?Number.isFinite(e)?String(e):`—`:typeof e==`string`?Mn(e):`—`,Pn=e=>typeof e==`number`&&Number.isFinite(e)?String(e):`—`,Fn=e=>`| ${e.join(` | `)} |`,In=({data:e,xKey:t,series:n,zKey:r})=>{let i=[Mn(t),...n.map(e=>Mn(e.label)),...r==null?[]:[Mn(r)]],a=e.map(e=>[Nn(j(e,t)),...n.map(t=>Pn(j(e,t.dataKey))),...r==null?[]:[Pn(j(e,r))]]);return[Fn(i),Fn(i.map(()=>`---`)),...a.map(e=>Fn(e))].join(`
2
- `)},Ln=(e,t)=>e==null?`var(${Ee(t)})`:Te(e)?`var(${Ee(e)})`:e,Rn={"chart-1":`circle`,"chart-2":`square`,"chart-3":`triangle`,"chart-4":`diamond`,"chart-5":`triangle-down`,"chart-6":`plus`,"chart-7":`cross`,"chart-8":`star`,"chart-other":`circle`},zn=(e,t)=>e??Rn[t],Bn={1:`chart-1`,2:`chart-2`,3:`chart-3`,4:`chart-4`,5:`chart-5`,6:`chart-6`,7:`chart-7`,8:`chart-8`,other:`chart-other`},Vn=e=>{let t=/* @__PURE__ */ new Set;for(let n of e)n.seriesSlot!=null&&n.seriesSlot!==`other`&&t.add(Bn[n.seriesSlot]);let n=/* @__PURE__ */ new Map,r=new Set(t);for(let t of e){if(t.seriesSlot!=null){n.set(t.dataKey,Bn[t.seriesSlot]);continue}let e=Oe.find(e=>!r.has(e))??`chart-other`;n.set(t.dataKey,e),r.add(e)}return n};var Hn=class{#e=/* @__PURE__ */ new Set;#t={series:[],hover:null,grid:null,xAxis:null,yAxis:null,referenceLines:[],tooltip:null,orientation:`vertical`};#n=/* @__PURE__ */ new Map;#r=null;#i=/* @__PURE__ */ new Map;#a=0;#o=null;#s=!1;#c=`vertical`;#l=null;#u=null;#d=/* @__PURE__ */ new Map;#f=/* @__PURE__ */ new Map;#p=null;#m=null;#h=!1;get hoverEver(){return this.#h}onSeriesChange=null;onPresentationChange=null;subscribe=e=>(this.#e.add(e),()=>{this.#e.delete(e)});getSnapshot=()=>this.#t;seriesSpecs(){return this.#r??=[...this.#n.values()].toSorted((e,t)=>e.sequence-t.sequence).map(e=>e.spec),this.#r}seriesShape(e){return this.#t.series.find(t=>t.dataKey===e)?.shape??Rn[`chart-other`]}registerSeries(e){let t=this.#i.get(e.dataKey)??this.#a++;return this.#i.set(e.dataKey,t),this.#n.set(e.dataKey,{spec:e,sequence:t}),this.#r=null,this.#g({seriesChanged:!0}),()=>{this.#n.get(e.dataKey)?.spec===e&&(this.#n.delete(e.dataKey),this.#r=null,this.#g({seriesChanged:!0}))}}setDecorative(e){this.#s!==e&&(this.#s=e,this.#g({seriesChanged:!0}))}setOrientation(e){this.#c!==e&&(this.#c=e,this.#g())}registerGrid(e){let t={lines:e};return this.#o=t,this.#g(),()=>{this.#o===t&&(this.#o=null,this.#g())}}registerXAxis(e){return this.#l=e,this.#g(),()=>{this.#l===e&&(this.#l=null,this.#g())}}registerYAxis(e){return this.#u=e,this.#g(),()=>{this.#u===e&&(this.#u=null,this.#g())}}registerReferenceLine(e,t){let n=this.#f.get(e)??this.#a++;return this.#f.set(e,n),this.#d.set(e,{spec:t,sequence:n}),this.#g(),()=>{this.#d.get(e)?.spec===t&&(this.#d.delete(e),this.#g())}}registerTooltip(e){return this.#p=e,this.#g(),()=>{this.#p===e&&(this.#p=null,this.#g())}}publishHover(e){this.#m!==e&&(this.#m=e,e!=null&&(this.#h=!0),this.#t={...this.#t,hover:e},this.#_())}seriesMeta(){let e=this.seriesSpecs(),t=Vn(e);return e.map(e=>{let n=t.get(e.dataKey)??`chart-other`,r=this.#s?De:Ln(e.color,n),i=this.#s?De:e.color??n;return{dataKey:e.dataKey,label:e.label,mark:e.mark,color:r,colorInput:i,shape:zn(e.shape,n),texture:e.texture}})}#g(e={seriesChanged:!1}){this.#t={series:e.seriesChanged?this.seriesMeta():this.#t.series,hover:this.#m,grid:this.#o,xAxis:this.#l,yAxis:this.#u,referenceLines:[...this.#d.values()].toSorted((e,t)=>e.sequence-t.sequence).map(e=>e.spec),tooltip:this.#p,orientation:this.#c},this.#_(),e.seriesChanged?this.onSeriesChange?.():this.onPresentationChange?.()}#_(){for(let e of this.#e)e()}};const Un=`100%`,Wn=`300%`,Gn=[`near`,`far`],Kn=/* @__PURE__ */ new WeakMap,qn=/* @__PURE__ */ new WeakMap,Jn=/* @__PURE__ */ new WeakMap;let Yn=null;const Xn=()=>{if(Yn==null){let e=new IntersectionObserver(()=>{},{scrollMargin:`0px`});Yn=`scrollMargin`in e,e.disconnect()}return Yn},Zn=/auto|scroll/,Qn=e=>{let t=e.ownerDocument,n=t.defaultView;if(n==null)return null;for(let r=e.parentElement;r!=null&&r!==t.documentElement&&r!==t.body;r=r.parentElement){let e=n.getComputedStyle(r);if(Zn.test(e.overflowY)||Zn.test(e.overflowX))return r}return null},$n=(e,t,n)=>new IntersectionObserver(t=>{for(let n of t)Jn.get(n.target)?.({band:e,inView:n.isIntersecting,rect:n.boundingClientRect});V()},{root:n,rootMargin:t,scrollMargin:t,threshold:0}),er=e=>{let t=Kn.get(e);return t??(t={near:$n(`near`,Un,null),far:$n(`far`,Wn,null),visible:$n(`visible`,`0px`,null),count:0},Kn.set(e,t)),t.count+=1,t},tr=(e,t)=>{--t.count,!(t.count>0)&&(t.near.disconnect(),t.far.disconnect(),t.visible.disconnect(),Kn.get(e)===t&&Kn.delete(e))},nr=(e,t)=>{let n=qn.get(e);if(n!=null)return n;let r={near:$n(`near`,Un,e),far:$n(`far`,Wn,e),open:{near:!1,far:!1},elements:/* @__PURE__ */ new Set};return Jn.set(e,({band:e,inView:t})=>{if(e!==`visible`&&r.open[e]!==t){r.open[e]=t;for(let n of r.elements)t?r[e].observe(n):(r[e].unobserve(n),Jn.get(n)?.({band:e,inView:!1,rect:null}))}}),t.near.observe(e),t.far.observe(e),t.count+=1,qn.set(e,r),r},rr=(e,t,n,r)=>{t.elements.size>0||(t.near.disconnect(),t.far.disconnect(),n.near.unobserve(e),n.far.unobserve(e),Jn.delete(e),qn.get(e)===t&&qn.delete(e),tr(r,n))},ir=(e,t)=>{if(typeof IntersectionObserver>`u`)return t({band:`near`,inView:!0,rect:null}),t({band:`far`,inView:!0,rect:null}),t({band:`visible`,inView:!0,rect:null}),V(),()=>{ae(e)};let n=e.ownerDocument,r=er(n);Jn.set(e,t),r.visible.observe(e);let i=Xn()?null:Qn(e);if(i==null)return r.near.observe(e),r.far.observe(e),()=>{Jn.get(e)===t&&(Jn.delete(e),ae(e),r.near.unobserve(e),r.far.unobserve(e),r.visible.unobserve(e),tr(n,r))};let a=nr(i,r);a.elements.add(e);for(let t of Gn)a.open[t]&&a[t].observe(e);return()=>{Jn.get(e)===t&&(Jn.delete(e),ae(e),a.elements.delete(e),a.near.unobserve(e),a.far.unobserve(e),r.visible.unobserve(e),tr(n,r),rr(i,a,r,n))}},ar=d(null),or=e=>{let t=f(ar);return y(t,()=>`${e} must be composed inside ${e.split(`.`)[0]}.Root — it registers into the chart it belongs to and renders nothing on its own.`),t},sr=e=>v(e.subscribe,e.getSnapshot,e.getSnapshot),cr=e=>{let t=u(3),n,r;return t[0]===e?(n=t[1],r=t[2]):(n=()=>e.getSnapshot().series,r=()=>e.getSnapshot().series,t[0]=e,t[1]=n,t[2]=r),v(e.subscribe,n,r)},lr=e=>{let t=u(3),n,r;return t[0]===e?(n=t[1],r=t[2]):(n=()=>ur(e),r=()=>ur(e),t[0]=e,t[1]=n,t[2]=r),v(e.subscribe,n,r)},ur=e=>{let t=e.getSnapshot().hover;return t?.viaKeyboard===!0?t:null},dr=e=>{let t=u(3),n,r;return t[0]===e?(n=t[1],r=t[2]):(n=()=>e.getSnapshot().orientation,r=()=>e.getSnapshot().orientation,t[0]=e,t[1]=n,t[2]=r),v(e.subscribe,n,r)},fr=(e,t)=>{let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>Object.hasOwn(t,n)&&Object.is(Reflect.get(e,n),Reflect.get(t,n)))},pr=e=>{let[t,n]=_(e);return fr(t,e)?t:(n(e),e)},mr={},hr=(e,t)=>{for(let n of e){let e=j(n,t);if(e!=null)return e instanceof Date?`time`:typeof e==`number`?`linear`:`point`}return`point`},gr=[`auto`,`auto`],_r=(e,t,n)=>{let r=(n,r)=>{let i=e.createElement(`div`);return i.setAttribute(`data-slot`,`${t}-${n}`),i.setAttribute(`aria-hidden`,`true`),i.className=r,i},i=e.createElement(`canvas`);return i.setAttribute(`data-slot`,`${t}-canvas`),i.setAttribute(`aria-hidden`,`true`),i.className=`absolute inset-0 size-full`,{canvas:i,hover:n.hover?{crosshair:r(`crosshair`,`bg-neutral-500 pointer-events-none absolute left-0 top-0 w-px opacity-0`),band:r(`hover-band`,`bg-neutral-500/10 pointer-events-none absolute left-0 top-0 rounded-sm opacity-0`),markers:r(`markers`,`pointer-events-none absolute inset-0 opacity-0`)}:null}},vr={bar:`Bar`,line:`Line`,area:`Area`,scatter:`Point`},yr=t=>{let i=u(211),a,o,s,c,l,d,f,p,b,C,w,T,E,D,O,k,A,j,M,N,ee,P,F,I,L,R,z,ne,B;i[0]===t?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],d=i[6],f=i[7],p=i[8],b=i[9],C=i[10],w=i[11],T=i[12],E=i[13],D=i[14],O=i[15],k=i[16],A=i[17],j=i[18],M=i[19],N=i[20],ee=i[21],P=i[22],F=i[23],I=i[24],L=i[25],R=i[26],z=i[27],ne=i[28],B=i[29]):({kind:w,componentName:p,slotName:j,data:b,xKey:z,xScale:ne,zKey:B,dimensions:N,yDomain:ee,stacked:P,orientation:F,animate:o,pending:I,mode:L,activeIndex:a,onActiveIndexChange:T,onDatumActivate:D,className:f,children:d,ref:A,"data-slot":C,"aria-label":c,"aria-labelledby":l,"aria-hidden":s,tabIndex:R,onFocus:O,onBlur:E,style:M,...k}=t,i[0]=t,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=d,i[7]=f,i[8]=p,i[9]=b,i[10]=C,i[11]=w,i[12]=T,i[13]=E,i[14]=D,i[15]=O,i[16]=k,i[17]=A,i[18]=j,i[19]=M,i[20]=N,i[21]=ee,i[22]=P,i[23]=F,i[24]=I,i[25]=L,i[26]=R,i[27]=z,i[28]=ne,i[29]=B);let V=N===void 0?3:N,oe=ee===void 0?gr:ee,H=P!==void 0&&P,U=F===void 0?`vertical`:F,se=I!==void 0&&I,ce=L===void 0?`interactive`:L,W=ce===`interactive`,G=ce===`decorative`,K=o??ce!==`static`,[q]=_(Br),[le,ue]=_(!1),J=g(null),de=g(null),fe=g(!1),pe=g(null),he;i[30]===Symbol.for(`react.memo_cache_sentinel`)?(he={near:!1,withinFar:!0,seen:!1,focused:!1},i[30]=he):he=i[30];let ge=g(he),ve=g(null),ye;i[31]===q.hoverEver?ye=i[32]:(ye=()=>q.hoverEver,i[31]=q.hoverEver,i[32]=ye);let be=v(q.subscribe,ye,Vr),xe;i[33]!==b||i[34]!==z||i[35]!==B?(xe={data:b,xKey:z,zKey:B},i[33]=b,i[34]=z,i[35]=B,i[36]=xe):xe=i[36];let Se=g(xe),Ce;i[37]!==p||i[38]!==w||i[39]!==q?(Ce=()=>({kind:w,componentName:p,store:q,engineRef:J,dataRef:Se}),i[37]=p,i[38]=w,i[39]=q,i[40]=Ce):Ce=i[40];let[we]=_(Ce),Te,Ee;i[41]!==b||i[42]!==z||i[43]!==B?(Te=()=>{Se.current={data:b,xKey:z,zKey:B}},Ee=[b,z,B],i[41]=b,i[42]=z,i[43]=B,i[44]=Te,i[45]=Ee):(Te=i[44],Ee=i[45]),h(Te,Ee);let De=g(null),Oe=e(De,A),ke=g(null),Ae=g(null),je=m(),Me;i[46]!==b||i[47]!==w||i[48]!==z||i[49]!==ne?(Me=w===`bar`?`band`:ne??hr(b,z),i[46]=b,i[47]=w,i[48]=z,i[49]=ne,i[50]=Me):Me=i[50];let Y=Me;y(w!==`scatter`||b.length===0||Y!==`point`,()=>`${p}.Root requires numeric or Date x values — the "${z}" values are not numbers or dates, so they have no position on a continuous scatter axis.`);let[X,Z]=oe,Ne;i[51]!==b||i[52]!==Y||i[53]!==z?(Ne=me(b,z,Y),i[51]=b,i[52]=Y,i[53]=z,i[54]=Ne):Ne=i[54];let Pe=Ne,Fe=Pe.hasTimeOfDay,Ie;i[55]!==Z||i[56]!==X?(Ie=[X,Z],i[55]=Z,i[56]=X,i[57]=Ie):Ie=i[57];let Le=B??null,Re;i[58]!==K||i[59]!==V||i[60]!==U||i[61]!==Y||i[62]!==H||i[63]!==Ie||i[64]!==Le||i[65]!==z?(Re={xKey:z,xScale:Y,yDomain:Ie,zKey:Le,dimensions:V,stacked:H,orientation:U,animate:K},i[58]=K,i[59]=V,i[60]=U,i[61]=Y,i[62]=H,i[63]=Ie,i[64]=Le,i[65]=z,i[66]=Re):Re=i[66];let ze;i[67]===Symbol.for(`react.memo_cache_sentinel`)?(ze={onDatumActivate:null,onActiveIndexChange:null},i[67]=ze):ze=i[67];let Be;i[68]===Re?Be=i[69]:(Be={options:Re,callbacks:ze,controlledActiveIndex:void 0},i[68]=Re,i[69]=Be);let Ve=g(Be),He;i[70]!==a||i[71]!==K||i[72]!==V||i[73]!==W||i[74]!==T||i[75]!==D||i[76]!==U||i[77]!==Y||i[78]!==H||i[79]!==z||i[80]!==Z||i[81]!==X||i[82]!==B?(He=()=>{Ve.current={options:{xKey:z,xScale:Y,yDomain:[X,Z],zKey:B??null,dimensions:V,stacked:H,orientation:U,animate:K},callbacks:W?{onDatumActivate:D??null,onActiveIndexChange:T??null}:{onDatumActivate:null,onActiveIndexChange:null},controlledActiveIndex:W?a:void 0}},i[70]=a,i[71]=K,i[72]=V,i[73]=W,i[74]=T,i[75]=D,i[76]=U,i[77]=Y,i[78]=H,i[79]=z,i[80]=Z,i[81]=X,i[82]=B,i[83]=He):He=i[83],h(He);let Ue,We;i[84]!==W||i[85]!==w||i[86]!==j||i[87]!==q?(Ue=()=>(pe.current=e=>{let t=De.current,n=ke.current;if(J.current!=null||t==null||n==null)return;ae(n);let r=_r(n.ownerDocument,j,{hover:W});n.prepend(r.canvas),r.hover!=null&&n.append(r.hover.crosshair,r.hover.band,r.hover.markers);let i=e!=null&&e.width>0&&e.height>0?{width:e.width,height:e.height}:void 0,a=new Sn({kind:w,store:q,elements:{root:t,plot:n,canvas:r.canvas,hover:r.hover,tooltip:Ae.current},inView:!1,size:i}),o=Ve.current;a.setOptions(o.options),a.setRows(Se.current.data),a.setCallbacks(o.callbacks),a.setControlledActiveIndex(o.controlledActiveIndex),J.current=a,de.current=r,a.flushIngest(),a.setInView(ge.current.near||ge.current.focused),ge.current.seen&&a.markSeen(),a.commitNow()},fe.current&&(fe.current=!1,pe.current(null)),()=>{fe.current=J.current!=null,pe.current=null;let e=J.current,t=de.current;J.current=null,de.current=null,e?.destroy(),t!=null&&(t.canvas.remove(),t.hover?.crosshair.remove(),t.hover?.band.remove(),t.hover?.markers.remove())}),We=[w,q,j,W],i[84]=W,i[85]=w,i[86]=j,i[87]=q,i[88]=Ue,i[89]=We):(Ue=i[88],We=i[89]),h(Ue,We);let Ge,Ke;i[90]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=()=>{let e=ke.current;if(e!=null)return ir(e,t=>{let{band:n,inView:r,rect:i}=t,a=J.current,o=ge.current;n===`near`?(o.near=r,a==null?r?re(e,{rect:i,run:e=>pe.current?.(e)}):ae(e):a.setInView(r||o.focused)):n===`visible`&&r?(o.seen=!0,a==null?ie(e):a.markSeen()):n===`far`&&(o.withinFar=r,!r&&!o.focused&&a?.releaseBackingStores())})},Ke=[],i[90]=Ge,i[91]=Ke):(Ge=i[90],Ke=i[91]),h(Ge,Ke);let qe,Je;i[92]===Symbol.for(`react.memo_cache_sentinel`)?(qe=()=>{let e=De.current?.ownerDocument.defaultView;if(e!=null)return rt(e,{before:()=>{pe.current?.(null),J.current?.paintForPrint()},after:Hr})},Je=[],i[92]=qe,i[93]=Je):(qe=i[92],Je=i[93]),h(qe,Je);let Ye,Xe;i[94]!==K||i[95]!==G||i[96]!==V||i[97]!==U||i[98]!==Y||i[99]!==H||i[100]!==q||i[101]!==z||i[102]!==Z||i[103]!==X||i[104]!==B?(Ye=()=>{J.current?.setOptions({xKey:z,xScale:Y,yDomain:[X,Z],zKey:B??null,dimensions:V,stacked:H,orientation:U,animate:K}),q.setOrientation(U),q.setDecorative(G)},Xe=[q,G,z,Y,X,Z,B,V,H,U,K],i[94]=K,i[95]=G,i[96]=V,i[97]=U,i[98]=Y,i[99]=H,i[100]=q,i[101]=z,i[102]=Z,i[103]=X,i[104]=B,i[105]=Ye,i[106]=Xe):(Ye=i[105],Xe=i[106]),h(Ye,Xe);let Ze,Qe;i[107]===b?(Ze=i[108],Qe=i[109]):(Ze=()=>{J.current?.setRows(b)},Qe=[b],i[107]=b,i[108]=Ze,i[109]=Qe),h(Ze,Qe);let $e;i[110]!==W||i[111]!==T||i[112]!==D?($e=()=>{J.current?.setCallbacks(W?{onDatumActivate:D??null,onActiveIndexChange:T??null}:{onDatumActivate:null,onActiveIndexChange:null})},i[110]=W,i[111]=T,i[112]=D,i[113]=$e):$e=i[113],h($e);let et,tt;i[114]!==a||i[115]!==W?(et=()=>{J.current?.setControlledActiveIndex(W?a:void 0)},tt=[W,a],i[114]=a,i[115]=W,i[116]=et,i[117]=tt):(et=i[116],tt=i[117]),h(et,tt);let nt=pr(M??mr),it;i[118]===Symbol.for(`react.memo_cache_sentinel`)?(it=()=>{J.current?.invalidateColors()},i[118]=it):it=i[118];let at;i[119]!==f||i[120]!==nt?(at=[f,nt],i[119]=f,i[120]=nt,i[121]=at):at=i[121],h(it,at);let ot;i[122]===q?ot=i[123]:(ot=()=>{let e=ve.current;if(e==null)return;let t=null,n=()=>{let n=_e(q.getSnapshot().series.map(Ur));n!==t&&(t=n,e.textContent=n)};return n(),q.subscribe(n)},i[122]=q,i[123]=ot);let st;i[124]!==G||i[125]!==q?(st=[q,G],i[124]=G,i[125]=q,i[126]=st):st=i[126],h(ot,st);let ct=g(null),lt;i[127]!==p||i[128]!==b||i[129]!==w||i[130]!==Y||i[131]!==q||i[132]!==z||i[133]!==B?(lt=()=>{let e=J.current;if(e!=null){e.flushIngest();return}let t=q.seriesSpecs().map(Wr),n=`${z}|${Y}|${B??``}|${t.join(`|`)}`,r=ct.current;(r==null||r.data!==b||r.signature!==n)&&(te({rootName:`${p}.Root`,partName:`${p}.${vr[w]}`,rows:b,xKey:z,xScale:Y,dataKeys:t,zKey:B??null}),ct.current={data:b,signature:n})},i[127]=p,i[128]=b,i[129]=w,i[130]=Y,i[131]=q,i[132]=z,i[133]=B,i[134]=lt):lt=i[134],h(lt);let ut=le?`engaged`:`dormant`,dt;i[135]!==C||i[136]!==j?(dt=r(C,j),i[135]=C,i[136]=j,i[137]=dt):dt=i[137];let ft;i[138]===f?ft=i[139]:(ft=n(`relative flex aspect-video w-full flex-col`,f),i[138]=f,i[139]=ft);let pt=G?!0:s,mt=G?void 0:R,ht=G?!0:void 0,gt;i[140]!==W||i[141]!==O?(gt=e=>{O?.(e),W&&ue(!0),ge.current.focused=!0,pe.current?.(null),J.current?.setInView(!0)},i[140]=W,i[141]=O,i[142]=gt):gt=i[142];let _t;i[143]===E?_t=i[144]:(_t=e=>{if(E?.(e),e.relatedTarget instanceof Node&&e.currentTarget.contains(e.relatedTarget))return;let t=ge.current;t.focused=!1;let n=J.current;n!=null&&(n.setInView(t.near),t.withinFar||n.releaseBackingStores())},i[143]=E,i[144]=_t);let vt=W?ut:void 0,yt=`${j}-plot`,bt=se&&`opacity-60 transition-opacity duration-300`,xt;i[145]===bt?xt=i[146]:(xt=n(`relative min-h-0 w-full flex-1`,bt),i[145]=bt,i[146]=xt);let St=ce===`static`?`img`:void 0,Ct=ce===`static`?c:void 0,wt=ce===`static`?l:void 0,Tt=ce===`static`?je:void 0,Et;i[147]!==c||i[148]!==l||i[149]!==je||i[150]!==W||i[151]!==w||i[152]!==B?(Et=W&&/* @__PURE__ */ x(`div`,{role:`application`,"aria-label":c,"aria-labelledby":l,"aria-describedby":je,tabIndex:0,className:n(`focus-visible:ring-focus-accent absolute inset-0 rounded-sm outline-none focus-visible:ring-2`,(w===`line`||w===`area`)&&`cursor-crosshair`,w===`scatter`&&B!=null&&`touch-none cursor-grab active:cursor-grabbing`),onPointerDown:e=>{e.isTrusted&&w===`scatter`&&B!=null&&e.currentTarget.setPointerCapture(e.pointerId),J.current??pe.current?.(ke.current?.getBoundingClientRect()??null),J.current?.handlePointerDown(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerMove:e=>{J.current?.handlePointerMove(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerUp:e=>{J.current?.handlePointerUp(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerLeave:()=>{J.current?.handlePointerLeave()},onPointerCancel:()=>{J.current?.handlePointerLeave()},onBlur:()=>{J.current?.handlePointerLeave()},onKeyDown:e=>{J.current?.handleKeyDown(e.key)&&e.preventDefault()}}),i[147]=c,i[148]=l,i[149]=je,i[150]=W,i[151]=w,i[152]=B,i[153]=Et):Et=i[153];let Dt;i[154]!==G||i[155]!==je||i[156]!==W||i[157]!==w||i[158]!==j||i[159]!==Pe?(Dt=!G&&/* @__PURE__ */ x(Ir,{id:je,kind:w,slotName:j,seriesRef:ve,summary:Pe,instructions:W}),i[154]=G,i[155]=je,i[156]=W,i[157]=w,i[158]=j,i[159]=Pe,i[160]=Dt):Dt=i[160];let Q;i[161]!==W||i[162]!==j||i[163]!==q||i[164]!==be||i[165]!==Fe?(Q=be&&W&&/* @__PURE__ */ x(Dr,{slotName:j,store:q,tooltipRef:e=>{Ae.current=e,J.current?.attachTooltip(e)},xHasTimeOfDay:Fe}),i[161]=W,i[162]=j,i[163]=q,i[164]=be,i[165]=Fe,i[166]=Q):Q=i[166];let Ot;i[167]!==yt||i[168]!==xt||i[169]!==St||i[170]!==Ct||i[171]!==wt||i[172]!==Tt||i[173]!==Et||i[174]!==Dt||i[175]!==Q?(Ot=/* @__PURE__ */ S(`div`,{"data-slot":yt,className:xt,role:St,"aria-label":Ct,"aria-labelledby":wt,"aria-describedby":Tt,ref:ke,children:[Et,Dt,Q]}),i[167]=yt,i[168]=xt,i[169]=St,i[170]=Ct,i[171]=wt,i[172]=Tt,i[173]=Et,i[174]=Dt,i[175]=Q,i[176]=Ot):Ot=i[176];let kt;i[177]!==W||i[178]!==q||i[179]!==Fe?(kt=W&&/* @__PURE__ */ x(Lr,{store:q,xHasTimeOfDay:Fe}),i[177]=W,i[178]=q,i[179]=Fe,i[180]=kt):kt=i[180];let At;i[181]!==c||i[182]!==l||i[183]!==b||i[184]!==le||i[185]!==W||i[186]!==j||i[187]!==q||i[188]!==Fe||i[189]!==z||i[190]!==B?(At=W&&le&&/* @__PURE__ */ x(zr,{data:b,label:c,labelledBy:l,slotName:j,store:q,xHasTimeOfDay:Fe,xKey:z,zKey:B}),i[181]=c,i[182]=l,i[183]=b,i[184]=le,i[185]=W,i[186]=j,i[187]=q,i[188]=Fe,i[189]=z,i[190]=B,i[191]=At):At=i[191];let jt;i[192]!==d||i[193]!==we||i[194]!==Ot||i[195]!==kt||i[196]!==At?(jt=/* @__PURE__ */ S(ar.Provider,{value:we,children:[Ot,d,kt,At]}),i[192]=d,i[193]=we,i[194]=Ot,i[195]=kt,i[196]=At,i[197]=jt):jt=i[197];let Mt;return i[198]!==Oe||i[199]!==k||i[200]!==M||i[201]!==dt||i[202]!==ft||i[203]!==pt||i[204]!==mt||i[205]!==ht||i[206]!==gt||i[207]!==_t||i[208]!==vt||i[209]!==jt?(Mt=/* @__PURE__ */ x(`div`,{"data-slot":dt,className:ft,"aria-hidden":pt,tabIndex:mt,inert:ht,ref:Oe,onFocus:gt,onBlur:_t,style:M,...k,"data-state":vt,children:jt}),i[198]=Oe,i[199]=k,i[200]=M,i[201]=dt,i[202]=ft,i[203]=pt,i[204]=mt,i[205]=ht,i[206]=gt,i[207]=_t,i[208]=vt,i[209]=jt,i[210]=Mt):Mt=i[210],Mt},br=(e,t,n)=>{let r=u(13),i=or(e);y(i.kind===t,()=>`${e} cannot be composed inside ${i.componentName}.Root — compose ${i.componentName} series parts instead.`);let{dataKey:a,label:o,seriesSlot:s,color:c,curve:l,markers:d,connectNulls:f,shape:p,texture:m}=n,g=l===void 0?`linear`:l,_=d!==void 0&&d,v=f!==void 0&&f,b=m===void 0?`solid`:m,x,S;return r[0]!==c||r[1]!==v||r[2]!==i.store||r[3]!==g||r[4]!==a||r[5]!==o||r[6]!==t||r[7]!==_||r[8]!==s||r[9]!==p||r[10]!==b?(x=()=>i.store.registerSeries({dataKey:a,label:o??a,seriesSlot:s,color:c,mark:t,curve:g,markers:_,connectNulls:v,shape:p,texture:b}),S=[i.store,a,o,s,c,t,g,_,v,p,b],r[0]=c,r[1]=v,r[2]=i.store,r[3]=g,r[4]=a,r[5]=o,r[6]=t,r[7]=_,r[8]=s,r[9]=p,r[10]=b,r[11]=x,r[12]=S):(x=r[11],S=r[12]),h(x,S),null},xr=(e,t)=>{let n=u(4),r=or(e),{lines:i}=t,a,o;return n[0]!==r.store||n[1]!==i?(a=()=>r.store.registerGrid(i),o=[r.store,i],n[0]=r.store,n[1]=i,n[2]=a,n[3]=o):(a=n[2],o=n[3]),h(a,o),null},Sr=(e,t)=>{let n=u(5),r=or(e),{tickFormat:i,tickCount:a}=t,o,s;return n[0]!==r.store||n[1]!==a||n[2]!==i?(o=()=>r.store.registerXAxis({tickFormat:i,tickCount:a}),s=[r.store,i,a],n[0]=r.store,n[1]=a,n[2]=i,n[3]=o,n[4]=s):(o=n[3],s=n[4]),h(o,s),null},Cr=(e,t)=>{let n=u(5),r=or(e),{tickFormat:i,tickCount:a}=t,o,s;return n[0]!==r.store||n[1]!==a||n[2]!==i?(o=()=>r.store.registerYAxis({tickFormat:i,tickCount:a}),s=[r.store,i,a],n[0]=r.store,n[1]=a,n[2]=i,n[3]=o,n[4]=s):(o=n[3],s=n[4]),h(o,s),null},wr=(e,t)=>{let n=u(7),r=or(e),i=m(),{y:a,label:o,color:s}=t,c,l;return n[0]!==s||n[1]!==r.store||n[2]!==i||n[3]!==o||n[4]!==a?(c=()=>r.store.registerReferenceLine(i,{y:a,label:o,color:s}),l=[r.store,i,a,o,s],n[0]=s,n[1]=r.store,n[2]=i,n[3]=o,n[4]=a,n[5]=c,n[6]=l):(c=n[5],l=n[6]),h(c,l),null},Tr=(e,t)=>{let n=u(16),r=or(e),i,a,o,s,c,l;n[0]===t?(i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6]):({labelFormat:s,valueFormat:l,indicator:c,footer:o,children:i,...a}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=o,n[4]=s,n[5]=c,n[6]=l);let d=c===void 0?`line`:c,f=pr(a),p,m;return n[7]!==i||n[8]!==r.store||n[9]!==o||n[10]!==d||n[11]!==s||n[12]!==f||n[13]!==l?(p=()=>r.store.registerTooltip({labelFormat:s,valueFormat:l,indicator:d,footer:o,children:i,divProps:f}),m=[r.store,s,l,d,o,i,f],n[7]=i,n[8]=r.store,n[9]=o,n[10]=d,n[11]=s,n[12]=f,n[13]=l,n[14]=p,n[15]=m):(p=n[14],m=n[15]),h(p,m),null},Er=(e,t,n)=>e==null?`—`:n==null?W(e):n(e,t),Dr=r=>{let i=u(26),{slotName:a,store:o,tooltipRef:s,xHasTimeOfDay:c}=r,l=sr(o),d=l.tooltip,f=l.hover,p;i[0]===d?.divProps?p=i[1]:(p=d?.divProps??{},i[0]=d?.divProps,i[1]=p);let m,_,v,y;i[2]===p?(m=i[3],_=i[4],v=i[5],y=i[6]):({className:m,ref:_,style:y,...v}=p,i[2]=p,i[3]=m,i[4]=_,i[5]=v,i[6]=y);let b=g(null),S=e(s,b),C,w;i[7]===_?(C=i[8],w=i[9]):(C=()=>{if(_==null)return;let e=t(_),n=e(b.current);return()=>{typeof n==`function`?n():e(null)}},w=[_],i[7]=_,i[8]=C,i[9]=w),h(C,w);let T=`${a}-tooltip`,E;i[10]===m?E=i[11]:(E=n(`bg-popover border-popover text-strong pointer-events-none absolute left-0 top-0 z-10 min-w-32 rounded-md border px-2.5 py-1.5 text-xs shadow-md`,m),i[10]=m,i[11]=E);let D;i[12]===y?D=i[13]:(D={opacity:0,...y},i[12]=y,i[13]=D);let O=D,k;i[14]!==d||i[15]!==f||i[16]!==a||i[17]!==c?(k=f!=null&&/* @__PURE__ */ x(Or,{slotName:a,config:d,hover:f,xHasTimeOfDay:c}),i[14]=d,i[15]=f,i[16]=a,i[17]=c,i[18]=k):k=i[18];let A;return i[19]!==S||i[20]!==v||i[21]!==T||i[22]!==E||i[23]!==O||i[24]!==k?(A=/* @__PURE__ */ x(`div`,{"data-slot":T,ref:S,className:E,style:O,...v,children:k}),i[19]=S,i[20]=v,i[21]=T,i[22]=E,i[23]=O,i[24]=k,i[25]=A):A=i[25],A},Or=e=>{let t=u(31),{slotName:n,config:r,hover:i,xHasTimeOfDay:a}=e;if(r?.children!=null){let e=`${n}-tooltip-label`,a;t[0]!==r||t[1]!==i?(a=r.children(i),t[0]=r,t[1]=i,t[2]=a):a=t[2];let o;return t[3]!==e||t[4]!==a?(o=/* @__PURE__ */ x(`div`,{"data-slot":e,className:`contents`,children:a}),t[3]=e,t[4]=a,t[5]=o):o=t[5],o}let o=r?.footer,s;t[6]!==r||t[7]!==i.xValue||t[8]!==a?(s=r?.labelFormat==null?de(i.xValue,{datasetHasTimeOfDay:a}):r.labelFormat(i.xValue),t[6]=r,t[7]=i.xValue,t[8]=a,t[9]=s):s=t[9];let c;t[10]===s?c=t[11]:(c=/* @__PURE__ */ x(`div`,{className:`text-muted font-medium`,children:s}),t[10]=s,t[11]=c);let l;if(t[12]!==r?.indicator||t[13]!==r?.valueFormat||t[14]!==i.points){let e;t[16]!==r?.indicator||t[17]!==r?.valueFormat?(e=e=>/* @__PURE__ */ S(`div`,{className:`flex items-center gap-1.5`,children:[r?.indicator!==`none`&&/* @__PURE__ */ x(`span`,{"aria-hidden":!0,className:`h-2.5 w-0.5 shrink-0 rounded-full`,style:{backgroundColor:e.color}}),/* @__PURE__ */ x(`span`,{className:`text-muted`,children:e.label}),/* @__PURE__ */ x(`span`,{className:`text-strong ml-auto pl-3 font-medium tabular-nums`,children:Er(e.value,e.dataKey,r?.valueFormat)})]},e.dataKey),t[16]=r?.indicator,t[17]=r?.valueFormat,t[18]=e):e=t[18],l=i.points.map(e),t[12]=r?.indicator,t[13]=r?.valueFormat,t[14]=i.points,t[15]=l}else l=t[15];let d;t[19]===l?d=t[20]:(d=/* @__PURE__ */ x(`div`,{className:`mt-1 grid gap-1`,children:l}),t[19]=l,t[20]=d);let f;t[21]===i.zValue?f=t[22]:(f=i.zValue!==void 0&&/* @__PURE__ */ S(`div`,{className:`mt-1 flex items-center gap-1.5`,children:[/* @__PURE__ */ x(`span`,{className:`text-muted`,children:`z`}),/* @__PURE__ */ x(`span`,{className:`text-strong ml-auto pl-3 font-medium tabular-nums`,children:i.zValue==null?`—`:W(i.zValue)})]}),t[21]=i.zValue,t[22]=f);let p;t[23]!==o||t[24]!==i?(p=o!=null&&/* @__PURE__ */ x(`div`,{className:`text-muted mt-1`,children:typeof o==`function`?o(i):o}),t[23]=o,t[24]=i,t[25]=p):p=t[25];let m;return t[26]!==c||t[27]!==d||t[28]!==f||t[29]!==p?(m=/* @__PURE__ */ S(b,{children:[c,d,f,p]}),t[26]=c,t[27]=d,t[28]=f,t[29]=p,t[30]=m):m=t[30],m},kr=(e,t,n=3)=>`repeating-linear-gradient(${e}, ${t} 0, ${t} 1px, transparent 1px, transparent ${n}px)`,Ar=`forced-color-adjust-none [print-color-adjust:exact] [-webkit-print-color-adjust:exact]`,jr={hatch:({ink:e})=>({backgroundImage:kr(`135deg`,e)}),"hatch-reverse":({ink:e})=>({backgroundImage:kr(`45deg`,e)}),crosshatch:({ink:e})=>({backgroundImage:`${kr(`135deg`,e,4)}, ${kr(`45deg`,e,4)}`}),perpendicular:({ink:e,orientation:t})=>({backgroundImage:kr(t===`horizontal`?`90deg`:`0deg`,e)}),parallel:({ink:e,orientation:t})=>({backgroundImage:kr(t===`horizontal`?`0deg`:`90deg`,e)}),grid:({ink:e})=>({backgroundImage:`${kr(`0deg`,e,4)}, ${kr(`90deg`,e,4)}`}),dots:({ink:e})=>({backgroundImage:`radial-gradient(circle at 1px 1px, ${e} 0.75px, transparent 0.8px)`,backgroundSize:`3px 3px`})},Mr=(e,t,n)=>e===`solid`?{}:jr[e]({ink:Ge(t),orientation:n}),Nr=e=>{let t=u(31),{series:r,orientation:i}=e;if(r.mark===`bar`){let e=r.texture,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=n(`size-2 shrink-0 rounded-[2px]`,Ar),t[0]=a):a=t[0];let o=r.color,s;t[1]!==i||t[2]!==r.color||t[3]!==r.texture?(s=Mr(r.texture,r.color,i),t[1]=i,t[2]=r.color,t[3]=r.texture,t[4]=s):s=t[4];let c;t[5]!==r.color||t[6]!==s?(c={backgroundColor:o,...s},t[5]=r.color,t[6]=s,t[7]=c):c=t[7];let l;return t[8]!==r.texture||t[9]!==c?(l=/* @__PURE__ */ x(`span`,{"aria-hidden":!0,"data-texture":e,className:a,style:c}),t[8]=r.texture,t[9]=c,t[10]=l):l=t[10],l}if(r.mark===`line`){let e;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=n(`absolute inset-x-0 top-1/2 h-0.5 -translate-y-1/2 rounded-full`,Ar),t[11]=e):e=t[11];let i;t[12]===r.color?i=t[13]:(i=/* @__PURE__ */ x(`span`,{className:e,style:{backgroundColor:r.color}}),t[12]=r.color,t[13]=i);let a=r.shape,o;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(o=n(`relative size-2`,Ar),t[14]=o):o=t[14];let s=Tn[r.shape],c;t[15]!==r.color||t[16]!==s?(c={backgroundColor:r.color,clipPath:s},t[15]=r.color,t[16]=s,t[17]=c):c=t[17];let l;t[18]!==r.shape||t[19]!==c?(l=/* @__PURE__ */ x(`span`,{"data-shape":a,className:o,style:c}),t[18]=r.shape,t[19]=c,t[20]=l):l=t[20];let u;return t[21]!==i||t[22]!==l?(u=/* @__PURE__ */ S(`span`,{"aria-hidden":!0,className:`relative flex h-2 w-3 shrink-0 items-center justify-center`,children:[i,l]}),t[21]=i,t[22]=l,t[23]=u):u=t[23],u}let a=r.shape,o;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(o=n(`size-2 shrink-0`,Ar),t[24]=o):o=t[24];let s=Tn[r.shape],c;t[25]!==r.color||t[26]!==s?(c={backgroundColor:r.color,clipPath:s},t[25]=r.color,t[26]=s,t[27]=c):c=t[27];let l;return t[28]!==r.shape||t[29]!==c?(l=/* @__PURE__ */ x(`span`,{"aria-hidden":!0,"data-shape":a,className:o,style:c}),t[28]=r.shape,t[29]=c,t[30]=l):l=t[30],l},Pr=t=>{let r=u(26),i,a,o,s,c,l;r[0]===t?(i=r[1],a=r[2],o=r[3],s=r[4],c=r[5],l=r[6]):({partName:o,slotName:l,className:a,children:i,ref:c,...s}=t,r[0]=t,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=c,r[6]=l);let d=or(o),f=cr(d.store),m=dr(d.store),h=g(null),v=e(h,c),[y,b]=_(!1),C;r[7]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>{let e=h.current;if(e!=null)return st(e,()=>{b(e.scrollHeight>e.clientHeight)})},r[7]=C):C=r[7];let w;if(r[8]===f?w=r[9]:(w=[f],r[8]=f,r[9]=w),p(C,w),f.length<2)return null;let T=`${l}-legend`,E;r[10]===a?E=r[11]:(E=n(`text-muted focus-visible:ring-focus-accent flex max-h-16 shrink-0 flex-wrap items-center gap-x-4 gap-y-1 overflow-y-auto rounded-sm pt-3 text-xs outline-none focus-visible:ring-2`,a),r[10]=a,r[11]=E);let D;r[12]===y?D=r[13]:(D=y&&{role:`group`,"aria-label":`Legend`,tabIndex:0},r[12]=y,r[13]=D);let O;r[14]!==i||r[15]!==m||r[16]!==f||r[17]!==l?(O=i==null?f.map(e=>/* @__PURE__ */ S(`div`,{className:`flex items-center gap-1.5`,children:[/* @__PURE__ */ x(Nr,{series:e,orientation:m}),e.label]},e.dataKey)):/* @__PURE__ */ x(`div`,{"data-slot":`${l}-legend-label`,className:`contents`,children:i(f)}),r[14]=i,r[15]=m,r[16]=f,r[17]=l,r[18]=O):O=r[18];let k;return r[19]!==v||r[20]!==s||r[21]!==T||r[22]!==E||r[23]!==D||r[24]!==O?(k=/* @__PURE__ */ x(`div`,{ref:v,"data-slot":T,className:E,...D,...s,children:O}),r[19]=v,r[20]=s,r[21]=T,r[22]=E,r[23]=D,r[24]=O,r[25]=k):k=r[25],k},Fr=e=>{let t=u(32),n,r,o,d,f,m,h,v;t[0]===e?(n=t[1],r=t[2],o=t[3],d=t[4],f=t[5],m=t[6],h=t[7],v=t[8]):({partName:d,slotName:h,label:v,onCopy:r,onCopyError:o,onClick:n,ref:m,...f}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=d,t[5]=f,t[6]=m,t[7]=h,t[8]=v);let y=v===void 0?`Copy data as Markdown`:v,T=or(d),E=s(),[D,O]=_(``),k=D!==``,A=g(!1),j=g(void 0),M,N;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>()=>{j.current!=null&&clearTimeout(j.current)},N=[],t[9]=M,t[10]=N):(M=t[9],N=t[10]),p(M,N);let ee=`${h}-copy-button`,P=k?`check`:`copy`,te;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(te={check:/* @__PURE__ */ x(C,{}),copy:/* @__PURE__ */ x(w,{})},t[11]=te):te=t[11];let F;t[12]===P?F=t[13]:(F=/* @__PURE__ */ x(i,{active:P,icons:te}),t[12]=P,t[13]=F);let I;t[14]!==T||t[15]!==E||t[16]!==n||t[17]!==r||t[18]!==o?(I=async e=>{try{if(n?.(e),e.defaultPrevented){j.current!=null&&(clearTimeout(j.current),j.current=void 0),O(``);return}let{data:t,xKey:i,zKey:a}=T.dataRef.current,o=In({data:t,xKey:i,zKey:a,series:T.store.getSnapshot().series});await E(o),r?.(o),O(c(`Copied`,A)),j.current!=null&&clearTimeout(j.current),j.current=setTimeout(()=>{O(``)},2e3)}catch(e){o?.(e)}},t[14]=T,t[15]=E,t[16]=n,t[17]=r,t[18]=o,t[19]=I):I=t[19];let L;t[20]!==y||t[21]!==f||t[22]!==m||t[23]!==ee||t[24]!==F||t[25]!==I?(L=/* @__PURE__ */ x(a,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,"data-slot":ee,label:y,icon:F,ref:m,onClick:I,...f}),t[20]=y,t[21]=f,t[22]=m,t[23]=ee,t[24]=F,t[25]=I,t[26]=L):L=t[26];let R;t[27]===D?R=t[28]:(R=/* @__PURE__ */ x(l,{children:D}),t[27]=D,t[28]=R);let z;return t[29]!==R||t[30]!==L?(z=/* @__PURE__ */ S(b,{children:[L,R]}),t[29]=R,t[30]=L,t[31]=z):z=t[31],z},Ir=e=>{let t=u(17),{id:n,kind:r,slotName:i,seriesRef:a,summary:s,instructions:c}=e,l=o(),d;t[0]!==l||t[1]!==r||t[2]!==s?(d=ve({kind:r,summary:s,hydrated:l}),t[0]=l,t[1]=r,t[2]=s,t[3]=d):d=t[3];let f=d,p=`${i}-description`,m;t[4]===f.sentence?m=t[5]:(m=/* @__PURE__ */ x(`span`,{children:f.sentence}),t[4]=f.sentence,t[5]=m);let h;t[6]===a?h=t[7]:(h=/* @__PURE__ */ x(`span`,{ref:a}),t[6]=a,t[7]=h);let g;t[8]!==c||t[9]!==f.instructions?(g=c&&/* @__PURE__ */ x(`span`,{children:f.instructions}),t[8]=c,t[9]=f.instructions,t[10]=g):g=t[10];let _;return t[11]!==n||t[12]!==p||t[13]!==m||t[14]!==h||t[15]!==g?(_=/* @__PURE__ */ S(`span`,{id:n,"data-slot":p,className:`sr-only`,children:[m,h,g]}),t[11]=n,t[12]=p,t[13]=m,t[14]=h,t[15]=g,t[16]=_):_=t[16],_},Lr=e=>{let t=u(6),{store:n,xHasTimeOfDay:r}=e,i=lr(n),[a,o]=_(``),s,c;t[0]!==i||t[1]!==r?(s=()=>{if(i==null){o(``);return}let e=i.points.map(Gr).join(`, `),t=i.zValue===void 0?``:`, z: ${i.zValue==null?`no data`:W(i.zValue)}`,n=setTimeout(()=>{o(`${de(i.xValue,{datasetHasTimeOfDay:r})}. ${e}${t}`)},120);return()=>clearTimeout(n)},c=[i,r],t[0]=i,t[1]=r,t[2]=s,t[3]=c):(s=t[2],c=t[3]),p(s,c);let l;return t[4]===a?l=t[5]:(l=/* @__PURE__ */ x(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:a}),t[4]=a,t[5]=l),l},Rr=(e,t)=>{let n=u(3),[r,i]=_(void 0),a,o;return n[0]===t?(a=n[1],o=n[2]):(a=()=>{if(t==null){i(void 0);return}let e=t.split(/\s+/).map(Kr).filter(Boolean).join(` `);i(e||void 0)},o=[t],n[0]=t,n[1]=a,n[2]=o),p(a,o),e??r},zr=e=>{let t=u(39),{data:n,label:r,labelledBy:i,slotName:a,store:o,xHasTimeOfDay:s,xKey:c,zKey:l}=e,d=cr(o),f=Rr(r,i);if(n.length===0||d.length===0)return null;let p,m,h,g,_;if(t[0]!==n||t[1]!==f||t[2]!==d||t[3]!==a||t[4]!==s||t[5]!==c||t[6]!==l){let e=n.slice(0,150);g=`sr-only`,_=`${a}-data-table`;let r=`${f==null?`Chart data`:`${f} — chart data`}${n.length>150?`. Showing the first 150 of ${n.length} rows.`:`.`}`;t[12]===r?m=t[13]:(m=/* @__PURE__ */ x(`caption`,{children:r}),t[12]=r,t[13]=m);let i;t[14]===c?i=t[15]:(i=/* @__PURE__ */ x(`th`,{scope:`col`,children:c}),t[14]=c,t[15]=i);let o;t[16]===d?o=t[17]:(o=d.map(qr),t[16]=d,t[17]=o);let u;t[18]===l?u=t[19]:(u=l!=null&&/* @__PURE__ */ x(`th`,{scope:`col`,children:l}),t[18]=l,t[19]=u),t[20]!==i||t[21]!==o||t[22]!==u?(h=/* @__PURE__ */ x(`thead`,{children:/* @__PURE__ */ S(`tr`,{children:[i,o,u]})}),t[20]=i,t[21]=o,t[22]=u,t[23]=h):h=t[23];let v;t[24]!==d||t[25]!==s||t[26]!==c||t[27]!==l?(v=(e,t)=>{let n=j(e,c),r=n instanceof Date&&!Number.isNaN(n.getTime()),i=typeof n==`string`||typeof n==`number`||n instanceof Date?de(n,{datasetHasTimeOfDay:s}):String(n);return/* @__PURE__ */ S(`tr`,{children:[/* @__PURE__ */ x(`th`,{scope:`row`,"data-value":typeof n==`number`&&Number.isFinite(n)?n:void 0,children:r?/* @__PURE__ */ x(`time`,{dateTime:n.toISOString(),children:i}):i}),d.map(t=>{let n=j(e,t.dataKey),r=typeof n==`number`&&Number.isFinite(n);return/* @__PURE__ */ x(`td`,{"data-value":r?n:void 0,children:r?W(n):`—`},t.dataKey)}),l!=null&&(()=>{let t=j(e,l),n=typeof t==`number`&&Number.isFinite(t);return/* @__PURE__ */ x(`td`,{"data-value":n?t:void 0,children:n?W(t):`—`})})()]},t)},t[24]=d,t[25]=s,t[26]=c,t[27]=l,t[28]=v):v=t[28],p=e.map(v),t[0]=n,t[1]=f,t[2]=d,t[3]=a,t[4]=s,t[5]=c,t[6]=l,t[7]=p,t[8]=m,t[9]=h,t[10]=g,t[11]=_}else p=t[7],m=t[8],h=t[9],g=t[10],_=t[11];let v;t[29]===p?v=t[30]:(v=/* @__PURE__ */ x(`tbody`,{children:p}),t[29]=p,t[30]=v);let y;t[31]!==m||t[32]!==h||t[33]!==v?(y=/* @__PURE__ */ S(`table`,{children:[m,h,v]}),t[31]=m,t[32]=h,t[33]=v,t[34]=y):y=t[34];let b;return t[35]!==g||t[36]!==_||t[37]!==y?(b=/* @__PURE__ */ x(`div`,{className:g,"data-slot":_,children:y}),t[35]=g,t[36]=_,t[37]=y,t[38]=b):b=t[38],b};function Br(){return new Hn}function Vr(){return!1}function Hr(){}function Ur(e){return e.label}function Wr(e){return e.dataKey}function Gr(e){return`${e.label}: ${e.value==null?`no data`:W(e.value)}`}function Kr(e){return document.getElementById(e)?.textContent?.trim()??``}function qr(e){return/* @__PURE__ */ x(`th`,{scope:`col`,children:e.label},e.dataKey)}export{wr as a,Sr as c,xr as i,Cr as l,Pr as n,br as o,yr as r,Tr as s,Fr as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./compose-refs-sFdxsL7k.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./slot-DdYN1L1C.js";import{t as i}from"./interactive-target-BXScNeOr.js";import{c as a}from"react/compiler-runtime";import{Children as o,createContext as s,isValidElement as c,useContext as l,useEffect as u,useId as d,useRef as f,useState as p}from"react";import m from"tiny-invariant";import{jsx as h}from"react/jsx-runtime";import{useVirtualizer as g}from"@tanstack/react-virtual";const _=s(null);function v(e){let t=l(_);return m(t,`List.${e} must be composed inside List.Root / List.VirtualRoot (or a SelectableList viewport).`),t}const y=s(null),b=s(null);function x(e){return c(e)?e.props.disabled===!0:!1}function S({start:e,step:t,count:n,isItemDisabled:r}){for(let i=e;i>=0&&i<n;i+=t)if(!r(i))return i;return-1}const C=`a[href]:not([tabindex="-1"]), button:not(:disabled):not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])`;function w(e){let t=e.matches(C)?e:e.querySelector(C);return t instanceof HTMLElement?t:null}function T(e){let t=e instanceof Element?e.closest(`[data-index]`):null;if(t==null)return null;let n=Number(t.getAttribute(`data-index`));return!Number.isInteger(n)||n<0?null:{item:t,index:n}}function E({count:e,isItemDisabled:t,focusItemAt:n}){return{onKeyDown:r=>{if(r.target instanceof HTMLElement&&(r.target.isContentEditable||r.target.tagName===`INPUT`||r.target.tagName===`TEXTAREA`||r.target.tagName===`SELECT`)||r.altKey||r.ctrlKey||r.metaKey)return;let i=T(r.target);if(i==null)return;let a=-1,o=1;switch(r.key){case`ArrowDown`:o=1,a=S({start:i.index+1,step:o,count:e,isItemDisabled:t});break;case`ArrowUp`:o=-1,a=S({start:i.index-1,step:o,count:e,isItemDisabled:t});break;case`Home`:o=1,a=S({start:0,step:o,count:e,isItemDisabled:t});break;case`End`:o=-1,a=S({start:e-1,step:o,count:e,isItemDisabled:t});break;default:return}r.preventDefault(),a>=0&&a!==i.index&&n(a,o)}}}function D(e){let t=a(41),{count:n,enabled:r,isItemDisabled:o,onActivate:s,itemId:c,scrollToIndex:l}=e,[d,m]=p(-1),h=f(!1),g=d>=n?n-1:d,_,v;if(t[0]!==d||t[1]!==n?(_=()=>{d>=n&&m(n-1)},v=[d,n],t[0]=d,t[1]=n,t[2]=_,t[3]=v):(_=t[2],v=t[3]),u(_,v),!r){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e={activeIndex:-1,collectionProps:{}},t[4]=e):e=t[4],e}let y;t[5]===o?y=t[6]:(y=e=>o?.(e)??!1,t[5]=o,t[6]=y);let b=y,x;t[7]!==n||t[8]!==b?(x=(e,t)=>S({start:e,step:t,count:n,isItemDisabled:b}),t[7]=n,t[8]=b,t[9]=x):x=t[9];let C=x,w;t[10]===l?w=t[11]:(w=e=>{e<0||(m(e),l(e))},t[10]=l,t[11]=w);let E=w,D;t[12]!==g||t[13]!==c?(D=g>=0?c(g):void 0,t[12]=g,t[13]=c,t[14]=D):D=t[14];let O;t[15]===b?O=t[16]:(O=e=>{let t=T(e.target);t!=null&&!b(t.index)?(m(t.index),h.current=!1):h.current=!0},t[15]=b,t[16]=O);let k;t[17]!==b||t[18]!==s?(k=e=>{if(e.defaultPrevented)return;let t=T(e.target);t==null||b(t.index)||i(e.target,t.item)||(m(t.index),s?.(t.index))},t[17]=b,t[18]=s,t[19]=k):k=t[19];let A;t[20]!==n||t[21]!==C||t[22]!==b?(A=e=>{if(e.target!==e.currentTarget){let t=T(e.target);t!=null&&!b(t.index)&&m(t.index),e.target instanceof HTMLElement&&e.target.tabIndex>=0||e.currentTarget.focus({preventScroll:!0}),h.current=!1;return}let t=h.current;h.current=!1,n>0&&!t&&m(e=>e<0?C(0,1):e)},t[20]=n,t[21]=C,t[22]=b,t[23]=A):A=t[23];let j;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>{e.currentTarget.contains(e.relatedTarget)||(m(-1),h.current=!1)},t[24]=j):j=t[24];let M;t[25]!==E||t[26]!==g||t[27]!==n||t[28]!==C||t[29]!==b||t[30]!==s?(M=e=>{if(e.target===e.currentTarget&&!(e.altKey||e.ctrlKey||e.metaKey)){h.current=!1;bb104:switch(e.key){case`ArrowDown`:e.preventDefault(),E(C(g<0?0:g+1,1));break bb104;case`ArrowUp`:e.preventDefault(),E(g<0?C(0,1):C(g-1,-1));break bb104;case`Home`:e.preventDefault(),E(C(0,1));break bb104;case`End`:e.preventDefault(),E(C(n-1,-1));break bb104;case` `:case`Enter`:!e.repeat&&g>=0&&!b(g)&&(e.preventDefault(),s?.(g));break bb104}}},t[25]=E,t[26]=g,t[27]=n,t[28]=C,t[29]=b,t[30]=s,t[31]=M):M=t[31];let N;t[32]!==M||t[33]!==D||t[34]!==O||t[35]!==k||t[36]!==A?(N={tabIndex:0,"aria-activedescendant":D,onMouseDown:O,onClick:k,onFocus:A,onBlur:j,onKeyDown:M},t[32]=M,t[33]=D,t[34]=O,t[35]=k,t[36]=A,t[37]=N):N=t[37];let P;return t[38]!==g||t[39]!==N?(P={activeIndex:g,collectionProps:N},t[38]=g,t[39]=N,t[40]=P):P=t[40],P}function O(e){let t=a(25),{count:n,focusItemAt:r,isItemDisabled:i,onActivate:o,itemId:s,scrollToIndex:c,semantics:l}=e,u=d(),f;t[0]===l?f=t[1]:(f={semantics:l},t[0]=l,t[1]=f);let p=f,m;t[2]!==u||t[3]!==s?(m=s??(e=>`${u}-item-${e}`),t[2]=u,t[3]=s,t[4]=m):m=t[4];let h=m,g=l===`grid`,_;t[5]!==n||t[6]!==i||t[7]!==o||t[8]!==h||t[9]!==c||t[10]!==g?(_={count:n,enabled:g,isItemDisabled:i,onActivate:o,itemId:h,scrollToIndex:c},t[5]=n,t[6]=i,t[7]=o,t[8]=h,t[9]=c,t[10]=g,t[11]=_):_=t[11];let{activeIndex:v,collectionProps:y}=D(_),b=s==null?h:null,x;t[12]!==v||t[13]!==b?(x={activeIndex:v,stampItemId:b},t[12]=v,t[13]=b,t[14]=x):x=t[14];let S=x,C;t[15]!==n||t[16]!==r||t[17]!==y||t[18]!==i||t[19]!==l?(C=l===`list`?E({count:n,isItemDisabled:i,focusItemAt:r}):y,t[15]=n,t[16]=r,t[17]=y,t[18]=i,t[19]=l,t[20]=C):C=t[20];let w=C,T;return t[21]!==w||t[22]!==S||t[23]!==p?(T={collectionProps:w,gridNav:S,listContext:p},t[21]=w,t[22]=S,t[23]=p,t[24]=T):T=t[24],T}function k(e){let r=a(26),{"aria-label":i,"aria-labelledby":o,"aria-multiselectable":s,children:c,className:l,collectionProps:u,gridNav:d,listContext:f,viewportProps:p,ref:m}=e,g,v;r[0]===p?(g=r[1],v=r[2]):({"data-slot":g,...v}=p,r[0]=p,r[1]=g,r[2]=v);let y;r[3]===g?y=r[4]:(y=n(g,`list`),r[3]=g,r[4]=y);let x;r[5]===l?x=r[6]:(x=t(`border-popover bg-popover scrollbar overscroll-none overflow-x-hidden overflow-y-auto rounded-md border p-1`,l),r[5]=l,r[6]=x);let S=f.semantics===`grid`?`grid`:`list`,C;r[7]!==i||r[8]!==o||r[9]!==s||r[10]!==c||r[11]!==u||r[12]!==S?(C=/* @__PURE__ */ h(`div`,{"data-slot":`list-collection`,role:S,"aria-label":i,"aria-labelledby":o,"aria-multiselectable":s,className:`relative flex w-full flex-col gap-px outline-hidden`,...u,children:c}),r[7]=i,r[8]=o,r[9]=s,r[10]=c,r[11]=u,r[12]=S,r[13]=C):C=r[13];let w;r[14]!==m||r[15]!==y||r[16]!==x||r[17]!==C||r[18]!==v?(w=/* @__PURE__ */ h(`div`,{ref:m,"data-slot":y,className:x,...v,children:C}),r[14]=m,r[15]=y,r[16]=x,r[17]=C,r[18]=v,r[19]=w):w=r[19];let T;r[20]!==d||r[21]!==w?(T=/* @__PURE__ */ h(b.Provider,{value:d,children:w}),r[20]=d,r[21]=w,r[22]=T):T=r[22];let E;return r[23]!==f||r[24]!==T?(E=/* @__PURE__ */ h(_.Provider,{value:f,children:T}),r[23]=f,r[24]=T,r[25]=E):E=r[25],E}const A=i=>{let o=a(43),s,c,u,d,f,p,m,g,_;o[0]===i?(s=o[1],c=o[2],u=o[3],d=o[4],f=o[5],p=o[6],m=o[7],g=o[8],_=o[9]):({"data-slot":d,asChild:s,children:c,className:u,disabled:g,ref:p,selected:_,style:m,...f}=i,o[0]=i,o[1]=s,o[2]=c,o[3]=u,o[4]=d,o[5]=f,o[6]=p,o[7]=m,o[8]=g,o[9]=_);let x=g!==void 0&&g,S=_!==void 0&&_,{semantics:C}=v(`Item`),w=l(y),T=l(b),E=C===`grid`,D=s?r:`div`,O=w?.placement??null,k=w?.index,A=E&&T!=null&&k!=null&&T.activeIndex===k,j=O?.measureRef??null,M=e(p,j),N;o[10]===d?N=o[11]:(N=n(d,`list-item`),o[10]=d,o[11]=N);let P;o[12]!==T||o[13]!==k||o[14]!==E||o[15]!==f?(P=E&&k!=null&&T?.stampItemId!=null?T.stampItemId(k):f.id,o[12]=T,o[13]=k,o[14]=E,o[15]=f,o[16]=P):P=o[16];let F=S?`selected`:`unselected`,I=x||void 0,L=A||void 0,R=E?`row`:`listitem`,z=E?S:void 0,B=E&&x?!0:f[`aria-disabled`],V=E?O?.posInSet:void 0,H=E?void 0:O?.posInSet,U=E?void 0:O?.setSize,W=!x&&`hover:bg-active-menu-item hover:data-[state=selected]:bg-active-selected-menu-item`,G=!E&&!x&&`has-[:focus-visible]:bg-active-menu-item has-[:focus-visible]:data-[state=selected]:bg-active-selected-menu-item`,K;o[17]!==u||o[18]!==W||o[19]!==G?(K=t(`rounded-md data-[state=selected]:bg-selected-menu-item data-[active]:bg-active-menu-item data-[active]:data-[state=selected]:bg-active-selected-menu-item`,W,G,u),o[17]=u,o[18]=W,o[19]=G,o[20]=K):K=o[20];let q;o[21]!==O||o[22]!==m?(q=O?{...m,...O.style}:m,o[21]=O,o[22]=m,o[23]=q):q=o[23];let J;return o[24]!==D||o[25]!==c||o[26]!==M||o[27]!==k||o[28]!==f||o[29]!==B||o[30]!==V||o[31]!==H||o[32]!==U||o[33]!==K||o[34]!==q||o[35]!==N||o[36]!==P||o[37]!==F||o[38]!==I||o[39]!==L||o[40]!==R||o[41]!==z?(J=/* @__PURE__ */ h(D,{ref:M,"data-slot":N,...f,id:P,"data-index":k,"data-state":F,"data-disabled":I,"data-active":L,role:R,"aria-selected":z,"aria-disabled":B,"aria-rowindex":V,"aria-posinset":H,"aria-setsize":U,className:K,style:q,children:c}),o[24]=D,o[25]=c,o[26]=M,o[27]=k,o[28]=f,o[29]=B,o[30]=V,o[31]=H,o[32]=U,o[33]=K,o[34]=q,o[35]=N,o[36]=P,o[37]=F,o[38]=I,o[39]=L,o[40]=R,o[41]=z,o[42]=J):J=o[42],J};function j(e){let t=a(5),{children:n,index:r}=e,i;t[0]===r?i=t[1]:(i={index:r,placement:null},t[0]=r,t[1]=i);let o=i,s;return t[2]!==n||t[3]!==o?(s=/* @__PURE__ */ h(y.Provider,{value:o,children:n}),t[2]=n,t[3]=o,t[4]=s):s=t[4],s}const M=t=>{let n=a(40),r,i,s,l,u,d,p,m,g,_,v;n[0]===t?(r=n[1],i=n[2],s=n[3],l=n[4],u=n[5],d=n[6],p=n[7],m=n[8],g=n[9],_=n[10],v=n[11]):({"aria-label":r,"aria-labelledby":i,"aria-multiselectable":s,children:l,className:u,isItemDisabled:d,onActivate:m,itemId:p,ref:_,semantics:v,...g}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s,n[4]=l,n[5]=u,n[6]=d,n[7]=p,n[8]=m,n[9]=g,n[10]=_,n[11]=v);let y=v===void 0?`list`:v,b=f(null),S=e(b,_),C;n[12]===l?C=n[13]:(C=o.toArray(l).filter(c),n[12]=l,n[13]=C);let T=C,E;n[14]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{b.current?.querySelector(`[data-index="${e}"]`)?.scrollIntoView({block:`nearest`})},n[14]=E):E=n[14];let D=E,A;n[15]===T.length?A=n[16]:(A=(e,t)=>{let n=b.current;if(n!=null)for(let r=e;r>=0&&r<T.length;r+=t){let e=n.querySelector(`[data-index="${r}"]`);if(e==null)continue;let t=w(e);if(t!=null){t.focus({preventScroll:!0}),e.scrollIntoView({block:`nearest`});return}}},n[15]=T.length,n[16]=A);let j=A,M;n[17]!==d||n[18]!==T?(M=d??(e=>x(T[e])),n[17]=d,n[18]=T,n[19]=M):M=n[19];let P;n[20]!==j||n[21]!==T.length||n[22]!==p||n[23]!==m||n[24]!==y||n[25]!==M?(P={count:T.length,focusItemAt:j,isItemDisabled:M,onActivate:m,itemId:p,scrollToIndex:D,semantics:y},n[20]=j,n[21]=T.length,n[22]=p,n[23]=m,n[24]=y,n[25]=M,n[26]=P):P=n[26];let{collectionProps:F,gridNav:I,listContext:L}=O(P),R;n[27]===T?R=n[28]:(R=T.map(N),n[27]=T,n[28]=R);let z;return n[29]!==r||n[30]!==i||n[31]!==s||n[32]!==u||n[33]!==F||n[34]!==S||n[35]!==I||n[36]!==L||n[37]!==g||n[38]!==R?(z=/* @__PURE__ */ h(k,{"aria-label":r,"aria-labelledby":i,"aria-multiselectable":s,className:u,collectionProps:F,gridNav:I,listContext:L,viewportProps:g,ref:S,children:R}),n[29]=r,n[30]=i,n[31]=s,n[32]=u,n[33]=F,n[34]=S,n[35]=I,n[36]=L,n[37]=g,n[38]=R,n[39]=z):z=n[39],z};function N(e,t){return/* @__PURE__ */ h(j,{index:t,children:e},e.key??t)}function P({virtualItem:e,count:t,measureRef:n}){return{posInSet:e.index+1,setSize:t,measureRef:n,style:{position:`absolute`,left:0,top:0,width:`100%`,transform:`translateY(${e.start}px)`}}}function F(e){let t=a(10),{children:n,count:r,measureRef:i,virtualItem:o}=e,s=o.index,c;t[0]!==r||t[1]!==i||t[2]!==o?(c=P({virtualItem:o,count:r,measureRef:i}),t[0]=r,t[1]=i,t[2]=o,t[3]=c):c=t[3];let l;t[4]!==c||t[5]!==o.index?(l={index:s,placement:c},t[4]=c,t[5]=o.index,t[6]=l):l=t[6];let u=l,d;return t[7]!==n||t[8]!==u?(d=/* @__PURE__ */ h(y.Provider,{value:u,children:n}),t[7]=n,t[8]=u,t[9]=d):d=t[9],d}function I({count:e,estimateItemHeight:t,getItemKey:n,overscan:r,scrollRef:i}){"use no memo";let a=g({count:e,getScrollElement:()=>i.current,estimateSize:()=>t,getItemKey:n,overscan:r,gap:1,initialRect:{width:0,height:t*(r+1)}});return{virtualItems:a.getVirtualItems(),totalSize:a.getTotalSize(),measureElement:a.measureElement,scrollToIndex:a.scrollToIndex}}const L=t=>{let n=a(68),r,i,s,l,d,p,m,g,_,v,y,b,S;n[0]===t?(r=n[1],i=n[2],s=n[3],l=n[4],d=n[5],p=n[6],m=n[7],g=n[8],_=n[9],v=n[10],y=n[11],b=n[12],S=n[13]):({"aria-label":r,"aria-labelledby":i,"aria-multiselectable":s,children:l,className:d,estimateItemHeight:y,isItemDisabled:p,onActivate:g,overscan:b,itemId:m,ref:v,semantics:S,..._}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s,n[4]=l,n[5]=d,n[6]=p,n[7]=m,n[8]=g,n[9]=_,n[10]=v,n[11]=y,n[12]=b,n[13]=S);let C=y===void 0?44:y,T=b===void 0?8:b,E=S===void 0?`list`:S,D=f(null),A=e(D,v),j;n[14]===l?j=n[15]:(j=o.toArray(l).filter(c),n[14]=l,n[15]=j);let M=j,N=M.length,P;n[16]===M?P=n[17]:(P=e=>M[e]?.key??e,n[16]=M,n[17]=P);let L=P,R;n[18]!==N||n[19]!==C||n[20]!==L||n[21]!==T?(R={count:N,estimateItemHeight:C,getItemKey:L,overscan:T,scrollRef:D},n[18]=N,n[19]=C,n[20]=L,n[21]=T,n[22]=R):R=n[22];let{virtualItems:z,totalSize:B,measureElement:V,scrollToIndex:H}=I(R),U;n[23]===H?U=n[24]:(U=e=>H(e,{align:`auto`}),n[23]=H,n[24]=U);let W=U,G=f(null),K,q;n[25]===Symbol.for(`react.memo_cache_sentinel`)?(K=()=>()=>{G.current!=null&&cancelAnimationFrame(G.current)},q=[],n[25]=K,n[26]=q):(K=n[25],q=n[26]),u(K,q);let J;n[27]!==N||n[28]!==W?(J=(e,t)=>{G.current!=null&&(cancelAnimationFrame(G.current),G.current=null);let n=e,r=0,i=()=>{G.current=null;let e=D.current;if(e==null||n<0||n>=N)return;W(n);let a=e.querySelector(`[data-index="${n}"]`);if(a!=null){let e=w(a);if(e!=null){e.focus({preventScroll:!0});return}n+=t,r=0}r+=1,r<10&&(G.current=requestAnimationFrame(i))};i()},n[27]=N,n[28]=W,n[29]=J):J=n[29];let ee=J,Y;n[30]!==p||n[31]!==M?(Y=p??(e=>x(M[e])),n[30]=p,n[31]=M,n[32]=Y):Y=n[32];let X;n[33]!==N||n[34]!==ee||n[35]!==m||n[36]!==g||n[37]!==W||n[38]!==E||n[39]!==Y?(X={count:N,focusItemAt:ee,isItemDisabled:Y,onActivate:g,itemId:m,scrollToIndex:W,semantics:E},n[33]=N,n[34]=ee,n[35]=m,n[36]=g,n[37]=W,n[38]=E,n[39]=Y,n[40]=X):X=n[40];let{collectionProps:te,gridNav:ne,listContext:re}=O(X),ie=z.some(e=>e.index===ne.activeIndex)?te[`aria-activedescendant`]:void 0,ae=E===`grid`?N:void 0,oe=`${B}px`,Z;n[41]===oe?Z=n[42]:(Z={height:oe},n[41]=oe,n[42]=Z);let Q;n[43]!==te||n[44]!==ie||n[45]!==ae||n[46]!==Z?(Q={...te,"aria-activedescendant":ie,"aria-rowcount":ae,style:Z},n[43]=te,n[44]=ie,n[45]=ae,n[46]=Z,n[47]=Q):Q=n[47];let $;if(n[48]!==N||n[49]!==M||n[50]!==V||n[51]!==z){let e;n[53]!==N||n[54]!==M||n[55]!==V?(e=e=>{let t=M[e.index];return t==null?null:/* @__PURE__ */ h(F,{virtualItem:e,count:N,measureRef:V,children:t},e.key)},n[53]=N,n[54]=M,n[55]=V,n[56]=e):e=n[56],$=z.map(e),n[48]=N,n[49]=M,n[50]=V,n[51]=z,n[52]=$}else $=n[52];let se;return n[57]!==r||n[58]!==i||n[59]!==s||n[60]!==d||n[61]!==A||n[62]!==ne||n[63]!==re||n[64]!==_||n[65]!==Q||n[66]!==$?(se=/* @__PURE__ */ h(k,{"aria-label":r,"aria-labelledby":i,"aria-multiselectable":s,className:d,collectionProps:Q,gridNav:ne,listContext:re,viewportProps:_,ref:A,children:$}),n[57]=r,n[58]=i,n[59]=s,n[60]=d,n[61]=A,n[62]=ne,n[63]=re,n[64]=_,n[65]=Q,n[66]=$,n[67]=se):se=n[67],se};export{A as n,M as r,L as t};