@ngrok/mantle 0.85.2 → 0.86.0

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 (52) hide show
  1. package/README.md +5 -5
  2. package/dist/agent.json +1 -1
  3. package/dist/alert-center.d.ts +13 -0
  4. package/dist/alert-center.js +1 -1
  5. package/dist/area-chart.d.ts +21 -0
  6. package/dist/area-chart.js +1 -1
  7. package/dist/bar-chart.d.ts +21 -0
  8. package/dist/bar-chart.js +1 -1
  9. package/dist/breadcrumb.d.ts +11 -0
  10. package/dist/{chart-2rorgvW0.js → chart-aZLMj4xx.js} +1 -1
  11. package/dist/command.d.ts +1 -1
  12. package/dist/data-table.d.ts +56 -0
  13. package/dist/data-table.js +1 -1
  14. package/dist/dropdown-menu-BSOdApBD.d.ts +1 -0
  15. package/dist/dropdown-menu-Bir-GKUs.js +1 -0
  16. package/dist/{dropdown-menu-BYapTV0f.d.ts → dropdown-menu-DhwzMnoH.d.ts} +147 -4
  17. package/dist/dropdown-menu.d.ts +2 -2
  18. package/dist/dropdown-menu.js +1 -1
  19. package/dist/line-chart.d.ts +21 -0
  20. package/dist/line-chart.js +1 -1
  21. package/dist/llms.txt +1 -1
  22. package/dist/multi-select.d.ts +43 -0
  23. package/dist/multi-select.js +1 -1
  24. package/dist/pagination.d.ts +1 -1
  25. package/dist/pagination.js +1 -1
  26. package/dist/scatter-plot.d.ts +21 -0
  27. package/dist/scatter-plot.js +1 -1
  28. package/dist/{select-CKAiBEGt.d.ts → select-DMlziWUZ.d.ts} +54 -1
  29. package/dist/select-DX72zQN2.js +1 -0
  30. package/dist/select.d.ts +1 -1
  31. package/dist/select.js +1 -1
  32. package/dist/selectable-list.d.ts +52 -0
  33. package/dist/selectable-list.js +1 -1
  34. package/dist/sidebar.d.ts +28 -1
  35. package/dist/sidebar.js +1 -1
  36. package/dist/split-button.d.ts +1 -1
  37. package/dist/split-button.js +1 -1
  38. package/dist/tabs.d.ts +38 -0
  39. package/dist/tabs.js +1 -1
  40. package/dist/theme-switcher.d.ts +2 -2
  41. package/dist/theme-switcher.js +1 -1
  42. package/dist/toast.d.ts +34 -1
  43. package/dist/toast.js +1 -1
  44. package/dist/tooltip-CHgJAU6j.js +1 -0
  45. package/dist/{tooltip-DA41fxe5.d.ts → tooltip-CfsA_JPe.d.ts} +42 -6
  46. package/dist/tooltip.d.ts +1 -1
  47. package/dist/tooltip.js +1 -1
  48. package/package.json +3 -3
  49. package/dist/dropdown-menu-BkPBh_8y.d.ts +0 -1
  50. package/dist/dropdown-menu-WydWB9lo.js +0 -1
  51. package/dist/select-DCni0ZwA.js +0 -1
  52. package/dist/tooltip-DikKOzqN.js +0 -1
package/README.md CHANGED
@@ -47,7 +47,7 @@ Mantle ships machine-readable entry points for coding agents — see [For AI Age
47
47
  Mantle ships runtime components from `@ngrok/mantle`, while build-time and server-side tooling lives in `@ngrok/mantle-vite-plugins`:
48
48
 
49
49
  - `@ngrok/mantle/code-block`: runtime React components and `mantleCode` template tag
50
- - `@ngrok/mantle-vite-plugins`: Vite + rehype integration via `mantleCodeBlockPlugins()`
50
+ - `@ngrok/mantle-vite-plugins`: Vite + rehype integration via `mantleCodeBlockPlugins()`, and `mantleSourcesPlugin()` to trim the production Tailwind scan ([docs](https://mantle.ngrok.com/vite-plugins))
51
51
  - `@ngrok/mantle-server-syntax-highlighter`: server-side highlighting engine for API routes/actions
52
52
 
53
53
  This keeps Vite/Shiki/parser dependencies out of frontend installs that only need Mantle's runtime UI package.
@@ -74,10 +74,10 @@ const result = await highlighter.highlight({
74
74
 
75
75
  ## Related Packages
76
76
 
77
- | Package | Description | Links |
78
- | ----------------------------------------- | ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
79
- | `@ngrok/mantle-vite-plugins` | Vite + rehype plugins for code block highlighting | [GitHub](https://github.com/ngrok/mantle/tree/main/packages/mantle-vite-plugins) · [npm](https://www.npmjs.com/package/@ngrok/mantle-vite-plugins) |
80
- | `@ngrok/mantle-server-syntax-highlighter` | Server-side syntax highlighting engine powered by Shiki | [GitHub](https://github.com/ngrok/mantle/tree/main/packages/mantle-server-syntax-highlighter) · [npm](https://www.npmjs.com/package/@ngrok/mantle-server-syntax-highlighter) |
77
+ | Package | Description | Links |
78
+ | ----------------------------------------- | ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
79
+ | `@ngrok/mantle-vite-plugins` | Vite plugins: trim the production Tailwind scan, highlight code blocks at build time | [GitHub](https://github.com/ngrok/mantle/tree/main/packages/mantle-vite-plugins) · [npm](https://www.npmjs.com/package/@ngrok/mantle-vite-plugins) |
80
+ | `@ngrok/mantle-server-syntax-highlighter` | Server-side syntax highlighting engine powered by Shiki | [GitHub](https://github.com/ngrok/mantle/tree/main/packages/mantle-server-syntax-highlighter) · [npm](https://www.npmjs.com/package/@ngrok/mantle-server-syntax-highlighter) |
81
81
 
82
82
  ## Contributing
83
83
 
package/dist/agent.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngrok/mantle",
3
- "version": "0.85.2",
3
+ "version": "0.86.0",
4
4
  "origin": "https://mantle.ngrok.com",
5
5
  "endpoints": {
6
6
  "docs": "https://mantle.ngrok.com/",
@@ -163,11 +163,20 @@ type AlertCenterItemProps = {
163
163
  * Server rendering emits no alert DOM — the bar enters after hydration with
164
164
  * its height animation, the same entrance every arriving alert gets.
165
165
  *
166
+ * **Structure.** `children` render inside a
167
+ * `<div data-slot="alert-center-item-label">`, the only node the portal puts
168
+ * in the host. A portal owns no node of its own, so React removes each portal
169
+ * child from the host by itself. A browser translation engine reparents a bare
170
+ * text child. A removal aimed at one throws, so the wrapper keeps the removed
171
+ * node an element. The wrapper is `display: contents`, so the authored children
172
+ * stay direct flex items of the banner chrome and keep its `gap`.
173
+ *
166
174
  * **Data attributes:**
167
175
  *
168
176
  * | Data Attribute | Value | Description |
169
177
  * | --- | --- | --- |
170
178
  * | `data-slot` | `alert-center-item-host` | On the stable per-id host element the item's children portal into. |
179
+ * | `data-slot` | `alert-center-item-label` | On the layout-transparent element inside the host that wraps the item's children. |
171
180
  * | `data-alert-host` | the item's `id` | On that same host — which alert's projected children it holds. |
172
181
  *
173
182
  * @see https://mantle.ngrok.com/components/feedback/alert-center#alertcenteritem
@@ -595,11 +604,15 @@ declare const AlertCenter: {
595
604
  * expansion row adopts by rank — children stay in the author's React tree
596
605
  * and keep their state across re-ranks. Mount to show; unmount to dismiss.
597
606
  *
607
+ * `children` render inside a `<div data-slot="alert-center-item-label">`, so
608
+ * the node React removes from the host is always an element.
609
+ *
598
610
  * **Data attributes:**
599
611
  *
600
612
  * | Data Attribute | Value | Description |
601
613
  * | --- | --- | --- |
602
614
  * | `data-slot` | `alert-center-item-host` | On the stable per-id host element the item's children portal into. |
615
+ * | `data-slot` | `alert-center-item-label` | On the layout-transparent element inside the host that wraps the item's children. |
603
616
  * | `data-alert-host` | the item's `id` | On that same host — which alert's projected children it holds. |
604
617
  *
605
618
  * @see https://mantle.ngrok.com/components/feedback/alert-center#alertcenteritem
@@ -1 +1 @@
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-0HCjnNv1.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{n as i,t as a}from"./alert-OP_-aGJD.js";import{c as o}from"react/compiler-runtime";import{createContext as s,useContext as c,useEffect as l,useId as u,useReducer as d,useRef as f,useState as p,useSyncExternalStore as m}from"react";import h from"tiny-invariant";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{createPortal as v}from"react-dom";const y={danger:5,warning:4,important:3,info:2,success:1};function b(e,t){if(t.parentElement===e)return!1;if(typeof e.moveBefore==`function`&&t.isConnected&&e.isConnected)try{return e.moveBefore(t,null),!0}catch{}return e.appendChild(t),!0}function x(e){return e.replace(/\s+/g,` `).trim()}function S(e){let t=e.querySelector(`[data-slot="alert-title"]`);if(t==null)return``;let n=t.cloneNode(!0);if(!(n instanceof Element))return x(t.textContent??``);for(let e of n.querySelectorAll(`button`))e.remove();let r=x(n.textContent??``);for(let e of n.querySelectorAll(`a`))e.remove();let i=x(n.textContent??``);return i===``?r:i}function C(e){return e.toSorted((e,t)=>y[t.intent]-y[e.intent]||w(e.order,t.order)||e.sequence-t.sequence)}function w(e,t){return e===t?0:e==null?1:t==null||e<t?-1:1}function T(e,t){if(t===0)return``;if(e===``)return`${t} alert${t===1?``:`s`}`;let n=t-1;return n===0?e:`${e}, and ${n} more alert${n===1?``:`s`}`}const E=[];var D=class{#e=new Set;#t=new Map;#n=new Map;#r=new Map;#i=0;#a=E;#o=``;#s=!1;getHost(e){let t=this.#r.get(e);if(t!=null)return t;let n=document.createElement(`div`);return n.style.display=`contents`,n.setAttribute(`data-slot`,`alert-center-item-host`),n.setAttribute(`data-alert-host`,e),this.#r.set(e,n),n}#c=null;captureHostSnapshot(e){if(e!==this.#a[0]?.id)return;let t=this.#r.get(e);t!=null&&t.hasChildNodes()&&(this.#c={id:e,content:t.cloneNode(!0)})}getHostSnapshot=e=>this.#c?.id===e?this.#c.content:null;subscribe=e=>(this.#e.add(e),()=>{this.#e.delete(e)});getSnapshot=()=>this.#a;hasAlert=e=>this.#t.has(e);getTopLabel=()=>this.#o;setTopLabel(e){this.#o!==e&&(this.#o=e,this.#p())}#l=null;requestFocusRestore(e){this.#l=e}flushFocusRestore(){let e=this.#l;e!=null&&e.isConnected&&(this.#l=null,document.activeElement!==e&&e.focus({preventScroll:!0}))}#u=null;#d=0;getPlacementVersion=()=>this.#d;notifyPlacementChange(){this.#d++,this.#p()}setBarElement(e){this.#u=e}getBarElement=()=>this.#u;getContentMounted=()=>this.#s;setContentMounted(e){this.#s!==e&&(this.#s=e,this.#p())}register(e){h(!this.#t.has(e.id),`AlertCenter.Item id "${e.id}" is already registered by another mounted item — ids must be unique under one <AlertCenter.Root>. Render one item per id, or give each alert its own id.`);let t=this.#n.get(e.id)??this.#i++;this.#n.set(e.id,t);let n={...e,sequence:t};return this.#t.set(e.id,n),this.#f(),()=>{this.#t.get(e.id)===n&&(this.#t.delete(e.id),this.#f())}}#f(){this.#a=C([...this.#t.values()]),this.#p()}#p(){for(let e of this.#e)e()}};const O=s(null),k=s(null);function A(e){let t=c(O);return h(t,`${e} must be rendered inside <AlertCenter.Root>.`),t}function ee(e){let t=c(k);return h(t,`${e} must be rendered inside <AlertCenter.Root>.`),t}const te=e=>m(e.subscribe,e.getSnapshot,e.getSnapshot),j=s(!1);function M(e){let t=o(5),{store:n}=e,r=te(n),i=m(n.subscribe,n.getTopLabel,n.getTopLabel),a;t[0]!==r.length||t[1]!==i?(a=T(i,r.length),t[0]=r.length,t[1]=i,t[2]=a):a=t[2];let s;return t[3]===a?s=t[4]:(s=g(`div`,{"data-slot":`alert-center-announcer`,className:`sr-only`,role:`status`,"aria-live":`polite`,children:a}),t[3]=a,t[4]=s),s}const N=e=>{let t=o(18),{children:n,defaultOpen:r,onOpenChange:i,open:a}=e,[s]=p(U),c=u(),[l,d]=p(r??!1),f=a??l,m;t[0]!==i||t[1]!==a?(m=e=>{a??d(e),i?.(e)},t[0]=i,t[1]=a,t[2]=m):m=t[2];let h=m,v;t[3]!==c||t[4]!==s?(v={store:s,contentId:c},t[3]=c,t[4]=s,t[5]=v):v=t[5];let y=v,b;t[6]!==f||t[7]!==h?(b={isExpanded:f,setExpanded:h},t[6]=f,t[7]=h,t[8]=b):b=t[8];let x=b,S;t[9]!==n||t[10]!==x?(S=g(k.Provider,{value:x,children:n}),t[9]=n,t[10]=x,t[11]=S):S=t[11];let C;t[12]===s?C=t[13]:(C=g(M,{store:s}),t[12]=s,t[13]=C);let w;return t[14]!==y||t[15]!==S||t[16]!==C?(w=_(O.Provider,{value:y,children:[S,C]}),t[14]=y,t[15]=S,t[16]=C,t[17]=w):w=t[17],w},P=t=>{let n=o(22),{children:r,className:a,id:s,intent:l,order:u}=t,{store:d}=A(`AlertCenter.Item`),f=c(j);h(!f,`AlertCenter.Item cannot be rendered inside another item's children.`);let[m,_]=p(null),y,b;n[0]!==s||n[1]!==d?(y=()=>{_(d.getHost(s))},b=[d,s],n[0]=s,n[1]=d,n[2]=y,n[3]=b):(y=n[2],b=n[3]),e(y,b);let x,S;n[4]!==a||n[5]!==s||n[6]!==l||n[7]!==u||n[8]!==d?(x=()=>d.register({id:s,intent:l,className:a,order:u}),S=[d,s,l,a,u],n[4]=a,n[5]=s,n[6]=l,n[7]=u,n[8]=d,n[9]=x,n[10]=S):(x=n[9],S=n[10]),e(x,S);let C;if(n[11]!==s||n[12]!==d?(C=()=>{d.captureHostSnapshot(s)},n[11]=s,n[12]=d,n[13]=C):C=n[13],e(C),m==null)return null;let w;n[14]===r?w=n[15]:(w=g(j.Provider,{value:!0,children:r}),n[14]=r,n[15]=w);let T;n[16]!==l||n[17]!==w?(T=g(i,{intent:l,redirectDismissFocus:!1,children:w}),n[16]=l,n[17]=w,n[18]=T):T=n[18];let E;return n[19]!==m||n[20]!==T?(E=v(T,m),n[19]=m,n[20]=T,n[21]=E):E=n[21],E},F=n=>{let i=o(14),s,l,u,d;i[0]===n?(s=i[1],l=i[2],u=i[3],d=i[4]):({"data-slot":s,label:l,ref:d,...u}=n,i[0]=n,i[1]=s,i[2]=l,i[3]=u,i[4]=d);let _=c(j);h(_,`AlertCenter.DismissIconButton must be composed inside an <AlertCenter.Item>'s children.`);let{store:v}=A(`AlertCenter.DismissIconButton`);m(v.subscribe,v.getPlacementVersion,v.getPlacementVersion);let y=f(null),b=t(y,d),[x,C]=p(null),w;i[5]===l?w=i[6]:(w=()=>{if(l!=null)return;let e=y.current?.closest(`[data-alert-id]`),t=e==null?``:S(e);C(t===``?null:`Dismiss ${t}`)},i[5]=l,i[6]=w),e(w);let T=l??x??void 0,E;i[7]===s?E=i[8]:(E=r(s,`alert-center-dismiss-icon-button`),i[7]=s,i[8]=E);let D;return i[9]!==b||i[10]!==u||i[11]!==T||i[12]!==E?(D=g(a.DismissIconButton,{ref:b,label:T,...u,"data-slot":E}),i[9]=b,i[10]=u,i[11]=T,i[12]=E,i[13]=D):D=i[13],D};function I(e,t){switch(t){case`show`:return`open`;case`hide`:return e===`closed`?`closed`:`closing`;case`exited`:return e===`closing`?`closed`:e}}function L(t){let n=o(10),{present:r}=t,[i,a]=d(I,r?`open`:`closed`),s,c;n[0]===r?(s=n[1],c=n[2]):(s=()=>{a(r?`show`:`hide`)},c=[r],n[0]=r,n[1]=s,n[2]=c),e(s,c);let u,f;n[3]===i?(u=n[4],f=n[5]):(u=()=>{if(i!==`closing`)return;let e=window.setTimeout(()=>a(`exited`),200);return()=>window.clearTimeout(e)},f=[i],n[3]=i,n[4]=u,n[5]=f),l(u,f);let p;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{e.target===e.currentTarget&&e.propertyName===`height`&&a(`exited`)},n[6]=p):p=n[6];let m=p,h=i!==`closed`,g=i===`open`?`open`:`closed`,_;return n[7]!==h||n[8]!==g?(_={isMounted:h,dataState:g,onExitTransitionEnd:m},n[7]=h,n[8]=g,n[9]=_):_=n[9],_}function R(t){let n=o(5),{containerRef:r,isAttached:i}=t,a=f(null),s,c;n[0]!==r||n[1]!==i?(s=()=>{let e=r.current;if(!i||e==null)return;let t=e=>{e.target instanceof Element&&(a.current=e.target)},n=t=>{t.relatedTarget instanceof Node&&!e.contains(t.relatedTarget)&&(a.current=null)};return e.addEventListener(`focusin`,t),e.addEventListener(`focusout`,n),()=>{e.removeEventListener(`focusin`,t),e.removeEventListener(`focusout`,n)}},c=[r,i],n[0]=r,n[1]=i,n[2]=s,n[3]=c):(s=n[2],c=n[3]),e(s,c);let l;return n[4]===Symbol.for(`react.memo_cache_sentinel`)?(l={lastFocusedWithinRef:a},n[4]=l):l=n[4],l}function z(){let e=document.querySelector(`main, [role="main"]`);e!=null&&(e.hasAttribute(`tabindex`)||(e.tabIndex=-1),e.focus({preventScroll:!0}))}function B(t){let n=o(10),{isMounted:r,store:i,topId:a}=t,s=f(null),c;n[0]===r?c=n[1]:(c={containerRef:s,isAttached:r},n[0]=r,n[1]=c);let{lastFocusedWithinRef:l}=R(c),u=f(a),d;n[2]!==l||n[3]!==i||n[4]!==a?(d=()=>{let e=u.current;if(u.current=a,e==null||a===e)return;let t=l.current;if(i.hasAlert(e)){t instanceof HTMLElement&&document.activeElement!==t&&i.requestFocusRestore(t);return}if(t==null||t.isConnected)return;l.current=null;let n=s.current;if(a==null){z();return}n!=null&&(n.querySelector(`[data-alert-dismiss], [data-alert-expand]`)??n).focus()},n[2]=l,n[3]=i,n[4]=a,n[5]=d):d=n[5];let p;n[6]!==i||n[7]!==a?(p=[i,a],n[6]=i,n[7]=a,n[8]=p):p=n[8],e(d,p);let m;return n[9]===Symbol.for(`react.memo_cache_sentinel`)?(m={wrapperRef:s},n[9]=m):m=n[9],m}const V=`gap-2 py-2 pr-2 [&_[data-slot=alert-icon]]:shrink-0`,H={Root:N,Bar:t=>{let i=o(62),s,c,l,u;i[0]===t?(s=i[1],c=i[2],l=i[3],u=i[4]):({className:s,"data-slot":c,ref:u,...l}=t,i[0]=t,i[1]=s,i[2]=c,i[3]=l,i[4]=u);let{store:d,contentId:h}=A(`AlertCenter.Bar`),{isExpanded:v,setExpanded:y}=ee(`AlertCenter.Bar`),x=te(d),C=m(d.subscribe,d.getContentMounted,d.getContentMounted),w=x[0]??null,T=w!=null,E;i[5]===T?E=i[6]:(E={present:T},i[5]=T,i[6]=E);let{isMounted:D,dataState:O,onExitTransitionEnd:k}=L(E),[j,M]=p(w);w!=null&&w!==j&&M(w);let N=w??j,P=f(null),F;i[7]!==N||i[8]!==d||i[9]!==w?(F=()=>{let e=P.current;if(e==null)return;if(w!=null){let t=d.getHost(w.id);t.parentElement!==e&&e.childNodes.length>0&&e.replaceChildren(),b(e,t)&&d.notifyPlacementChange(),d.flushFocusRestore();return}let t=N==null?null:d.getHostSnapshot(N.id);t!=null&&t.parentNode!==e&&e.replaceChildren(t)},i[7]=N,i[8]=d,i[9]=w,i[10]=F):F=i[10],e(F);let I=w?.id,R;i[11]!==D||i[12]!==d||i[13]!==I?(R={isMounted:D,store:d,topId:I},i[11]=D,i[12]=d,i[13]=I,i[14]=R):R=i[14];let{wrapperRef:z}=B(R),H;i[15]!==T||i[16]!==d||i[17]!==z?(H=()=>{let e=z.current;d.setTopLabel(T&&e!=null?S(e):``)},i[15]=T,i[16]=d,i[17]=z,i[18]=H):H=i[18],e(H);let U;i[19]!==T||i[20]!==d||i[21]!==z?(U=()=>{let e=z.current;if(e==null)return;let t=new MutationObserver(()=>{d.setTopLabel(T?S(e):``)});return t.observe(e,{subtree:!0,childList:!0,characterData:!0}),()=>{t.disconnect()}},i[19]=T,i[20]=d,i[21]=z,i[22]=U):U=i[22];let W;i[23]!==D||i[24]!==T||i[25]!==d?(W=[d,T,D],i[23]=D,i[24]=T,i[25]=d,i[26]=W):W=i[26],e(U,W);let G,K;i[27]===d?(G=i[28],K=i[29]):(G=()=>()=>{d.setTopLabel(``)},K=[d],i[27]=d,i[28]=G,i[29]=K),e(G,K);let q;i[30]!==d||i[31]!==z?(q=()=>{d.setBarElement(z.current)},i[30]=d,i[31]=z,i[32]=q):q=i[32],e(q);let J,Y;if(i[33]===d?(J=i[34],Y=i[35]):(J=()=>()=>{d.setBarElement(null)},Y=[d],i[33]=d,i[34]=J,i[35]=Y),e(J,Y),!D||N==null)return null;let ne=T?x.length-1:0,re=!T,ie=N.intent,X;i[36]!==N.className||i[37]!==s?(X=n(V,`not-has-data-[slot=alert-description]:[&_[data-alert-dismiss],&_[data-alert-expand]]:top-1/2 not-has-data-[slot=alert-description]:[&_[data-alert-dismiss],&_[data-alert-expand]]:-translate-y-1/2`,`has-data-alert-expand:[&_[data-alert-dismiss]]:right-16 md:has-data-alert-expand:[&_[data-alert-dismiss]]:right-24`,s,N.className),i[36]=N.className,i[37]=s,i[38]=X):X=i[38];let Z;i[39]===c?Z=i[40]:(Z=r(c,`alert-center-bar`),i[39]=c,i[40]=Z);let ae;i[41]===Symbol.for(`react.memo_cache_sentinel`)?(ae=g(`div`,{ref:P,className:`contents`,"data-slot":`alert-center-bar-mount`}),i[41]=ae):ae=i[41];let Q;i[42]!==h||i[43]!==C||i[44]!==v||i[45]!==ne||i[46]!==y?(Q=ne>0&&C&&g(a.ExpandButton,{count:ne,expanded:v,"aria-controls":h,onClick:()=>y(!v)}),i[42]=h,i[43]=C,i[44]=v,i[45]=ne,i[46]=y,i[47]=Q):Q=i[47];let $;i[48]!==N.id||i[49]!==N.intent||i[50]!==l||i[51]!==u||i[52]!==X||i[53]!==Z||i[54]!==Q?($=_(a.Root,{ref:u,appearance:`banner`,intent:ie,className:X,...l,"data-slot":Z,"data-placement":`bar`,"data-alert-id":N.id,children:[ae,Q]}),i[48]=N.id,i[49]=N.intent,i[50]=l,i[51]=u,i[52]=X,i[53]=Z,i[54]=Q,i[55]=$):$=i[55];let oe;return i[56]!==O||i[57]!==k||i[58]!==re||i[59]!==$||i[60]!==z?(oe=g(`div`,{ref:z,"data-slot":`alert-center-bar-wrapper`,tabIndex:-1,inert:re,className:`shrink-0 overflow-hidden transition-[height,opacity] duration-200 ease-out [interpolate-size:allow-keywords] starting:h-0 starting:opacity-0 data-state-closed:h-0 data-state-closed:opacity-0 data-state-closed:duration-150 motion-reduce:transition-none`,"data-state":O,onTransitionEnd:k,children:$}),i[56]=O,i[57]=k,i[58]=re,i[59]=$,i[60]=z,i[61]=oe):oe=i[61],oe},Content:i=>{let a=o(38),s,c,l,u,d,p;a[0]===i?(s=a[1],c=a[2],l=a[3],u=a[4],d=a[5],p=a[6]):({"aria-label":p,"aria-labelledby":s,className:c,"data-slot":l,ref:d,...u}=i,a[0]=i,a[1]=s,a[2]=c,a[3]=l,a[4]=u,a[5]=d,a[6]=p);let m=p===void 0?`More alerts`:p,{store:h,contentId:_}=A(`AlertCenter.Content`),{isExpanded:v,setExpanded:y}=ee(`AlertCenter.Content`),x=te(h).slice(1),S=x.length>0,C,w;a[7]===h?(C=a[8],w=a[9]):(C=()=>(h.setContentMounted(!0),()=>{h.setContentMounted(!1)}),w=[h],a[7]=h,a[8]=C,a[9]=w),e(C,w);let T=f(S),E,D;a[10]!==S||a[11]!==v||a[12]!==y?(E=()=>{let e=T.current&&!S;T.current=S,e&&v&&y(!1)},D=[S,v,y],a[10]=S,a[11]=v,a[12]=y,a[13]=E,a[14]=D):(E=a[13],D=a[14]),e(E,D);let O=f(null),k=t(O,d),j;a[15]===S?j=a[16]:(j={containerRef:O,isAttached:S},a[15]=S,a[16]=j);let{lastFocusedWithinRef:M}=R(j),N=x.map(W).join(` `),P;a[17]===h?P=a[18]:(P=()=>{let e=O.current;if(e==null)return;let t=!1;for(let n of e.querySelectorAll(`[data-alert-mount]`)){let e=n.getAttribute(`data-alert-mount`);e!=null&&b(n,h.getHost(e))&&(t=!0)}t&&h.notifyPlacementChange(),h.flushFocusRestore()},a[17]=h,a[18]=P),e(P,[h,N]);let F;if(a[19]!==M||a[20]!==h?(F=()=>{let e=M.current;if(e==null)return;if(e.isConnected){let t=O.current;e instanceof HTMLElement&&document.activeElement!==e&&(t==null||!t.contains(e))&&(M.current=null,e.focus({preventScroll:!0}));return}M.current=null;let t=O.current?.querySelector(`[data-alert-dismiss]`);if(t!=null){t.focus();return}let n=h.getBarElement()?.querySelector(`[data-alert-dismiss], [data-alert-expand]`);if(n!=null){n.focus();return}z()},a[19]=M,a[20]=h,a[21]=F):F=a[21],e(F,[h,N]),x.length===0)return null;let I;a[22]===l?I=a[23]:(I=r(l,`alert-center-content`),a[22]=l,a[23]=I);let L=v?`open`:`closed`,B;a[24]===c?B=a[25]:(B=n(`h-0 overflow-hidden invisible [content-visibility:hidden] transition-[height,visibility,content-visibility] transition-discrete duration-200 ease-out [interpolate-size:allow-keywords] data-state-open:h-auto data-state-open:visible data-state-open:[content-visibility:visible] motion-reduce:transition-none`,c),a[24]=c,a[25]=B);let V=s==null?m:void 0,H=x.map(G),U;a[26]!==s||a[27]!==V||a[28]!==H?(U=g(`ul`,{"aria-label":V,"aria-labelledby":s,className:`flex w-full flex-col`,children:H}),a[26]=s,a[27]=V,a[28]=H,a[29]=U):U=a[29];let K;return a[30]!==k||a[31]!==_||a[32]!==u||a[33]!==L||a[34]!==B||a[35]!==U||a[36]!==I?(K=g(`div`,{...u,ref:k,"data-slot":I,id:_,"data-state":L,className:B,children:U}),a[30]=k,a[31]=_,a[32]=u,a[33]=L,a[34]=B,a[35]=U,a[36]=I,a[37]=K):K=a[37],K},Item:P,DismissIconButton:F};function U(){return new D}function W(e){return e.id}function G(e){return g(`li`,{children:g(a.Root,{appearance:`banner`,intent:e.intent,className:n(V,e.className),"data-slot":`alert-center-item`,"data-placement":`list`,"data-alert-id":e.id,children:g(`div`,{className:`contents`,"data-alert-mount":e.id})})},e.id)}export{H as AlertCenter};
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-0HCjnNv1.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{n as i,t as a}from"./alert-OP_-aGJD.js";import{c as o}from"react/compiler-runtime";import{createContext as s,useContext as c,useEffect as l,useId as u,useReducer as d,useRef as f,useState as p,useSyncExternalStore as m}from"react";import h from"tiny-invariant";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{createPortal as v}from"react-dom";const y={danger:5,warning:4,important:3,info:2,success:1};function b(e,t){if(t.parentElement===e)return!1;if(typeof e.moveBefore==`function`&&t.isConnected&&e.isConnected)try{return e.moveBefore(t,null),!0}catch{}return e.appendChild(t),!0}function x(e){return e.replace(/\s+/g,` `).trim()}function S(e){let t=e.querySelector(`[data-slot="alert-title"]`);if(t==null)return``;let n=t.cloneNode(!0);if(!(n instanceof Element))return x(t.textContent??``);for(let e of n.querySelectorAll(`button`))e.remove();let r=x(n.textContent??``);for(let e of n.querySelectorAll(`a`))e.remove();let i=x(n.textContent??``);return i===``?r:i}function C(e){return e.toSorted((e,t)=>y[t.intent]-y[e.intent]||w(e.order,t.order)||e.sequence-t.sequence)}function w(e,t){return e===t?0:e==null?1:t==null||e<t?-1:1}function T(e,t){if(t===0)return``;if(e===``)return`${t} alert${t===1?``:`s`}`;let n=t-1;return n===0?e:`${e}, and ${n} more alert${n===1?``:`s`}`}const E=[];var D=class{#e=new Set;#t=new Map;#n=new Map;#r=new Map;#i=0;#a=E;#o=``;#s=!1;getHost(e){let t=this.#r.get(e);if(t!=null)return t;let n=document.createElement(`div`);return n.style.display=`contents`,n.setAttribute(`data-slot`,`alert-center-item-host`),n.setAttribute(`data-alert-host`,e),this.#r.set(e,n),n}#c=null;captureHostSnapshot(e){if(e!==this.#a[0]?.id)return;let t=this.#r.get(e);t!=null&&t.firstElementChild?.hasChildNodes()===!0&&(this.#c={id:e,content:t.cloneNode(!0)})}getHostSnapshot=e=>this.#c?.id===e?this.#c.content:null;subscribe=e=>(this.#e.add(e),()=>{this.#e.delete(e)});getSnapshot=()=>this.#a;hasAlert=e=>this.#t.has(e);getTopLabel=()=>this.#o;setTopLabel(e){this.#o!==e&&(this.#o=e,this.#p())}#l=null;requestFocusRestore(e){this.#l=e}flushFocusRestore(){let e=this.#l;e!=null&&e.isConnected&&(this.#l=null,document.activeElement!==e&&e.focus({preventScroll:!0}))}#u=null;#d=0;getPlacementVersion=()=>this.#d;notifyPlacementChange(){this.#d++,this.#p()}setBarElement(e){this.#u=e}getBarElement=()=>this.#u;getContentMounted=()=>this.#s;setContentMounted(e){this.#s!==e&&(this.#s=e,this.#p())}register(e){h(!this.#t.has(e.id),`AlertCenter.Item id "${e.id}" is already registered by another mounted item — ids must be unique under one <AlertCenter.Root>. Render one item per id, or give each alert its own id.`);let t=this.#n.get(e.id)??this.#i++;this.#n.set(e.id,t);let n={...e,sequence:t};return this.#t.set(e.id,n),this.#f(),()=>{this.#t.get(e.id)===n&&(this.#t.delete(e.id),this.#f())}}#f(){this.#a=C([...this.#t.values()]),this.#p()}#p(){for(let e of this.#e)e()}};const O=s(null),k=s(null);function A(e){let t=c(O);return h(t,`${e} must be rendered inside <AlertCenter.Root>.`),t}function ee(e){let t=c(k);return h(t,`${e} must be rendered inside <AlertCenter.Root>.`),t}const te=e=>m(e.subscribe,e.getSnapshot,e.getSnapshot),j=s(!1);function M(e){let t=o(5),{store:n}=e,r=te(n),i=m(n.subscribe,n.getTopLabel,n.getTopLabel),a;t[0]!==r.length||t[1]!==i?(a=T(i,r.length),t[0]=r.length,t[1]=i,t[2]=a):a=t[2];let s;return t[3]===a?s=t[4]:(s=g(`div`,{"data-slot":`alert-center-announcer`,className:`sr-only`,role:`status`,"aria-live":`polite`,children:a}),t[3]=a,t[4]=s),s}const N=e=>{let t=o(18),{children:n,defaultOpen:r,onOpenChange:i,open:a}=e,[s]=p(U),c=u(),[l,d]=p(r??!1),f=a??l,m;t[0]!==i||t[1]!==a?(m=e=>{a??d(e),i?.(e)},t[0]=i,t[1]=a,t[2]=m):m=t[2];let h=m,v;t[3]!==c||t[4]!==s?(v={store:s,contentId:c},t[3]=c,t[4]=s,t[5]=v):v=t[5];let y=v,b;t[6]!==f||t[7]!==h?(b={isExpanded:f,setExpanded:h},t[6]=f,t[7]=h,t[8]=b):b=t[8];let x=b,S;t[9]!==n||t[10]!==x?(S=g(k.Provider,{value:x,children:n}),t[9]=n,t[10]=x,t[11]=S):S=t[11];let C;t[12]===s?C=t[13]:(C=g(M,{store:s}),t[12]=s,t[13]=C);let w;return t[14]!==y||t[15]!==S||t[16]!==C?(w=_(O.Provider,{value:y,children:[S,C]}),t[14]=y,t[15]=S,t[16]=C,t[17]=w):w=t[17],w},P=t=>{let n=o(22),{children:r,className:a,id:s,intent:l,order:u}=t,{store:d}=A(`AlertCenter.Item`),f=c(j);h(!f,`AlertCenter.Item cannot be rendered inside another item's children.`);let[m,_]=p(null),y,b;n[0]!==s||n[1]!==d?(y=()=>{_(d.getHost(s))},b=[d,s],n[0]=s,n[1]=d,n[2]=y,n[3]=b):(y=n[2],b=n[3]),e(y,b);let x,S;n[4]!==a||n[5]!==s||n[6]!==l||n[7]!==u||n[8]!==d?(x=()=>d.register({id:s,intent:l,className:a,order:u}),S=[d,s,l,a,u],n[4]=a,n[5]=s,n[6]=l,n[7]=u,n[8]=d,n[9]=x,n[10]=S):(x=n[9],S=n[10]),e(x,S);let C;if(n[11]!==s||n[12]!==d?(C=()=>{d.captureHostSnapshot(s)},n[11]=s,n[12]=d,n[13]=C):C=n[13],e(C),m==null)return null;let w;n[14]===r?w=n[15]:(w=g(j.Provider,{value:!0,children:g(`div`,{className:`contents`,"data-slot":`alert-center-item-label`,children:r})}),n[14]=r,n[15]=w);let T;n[16]!==l||n[17]!==w?(T=g(i,{intent:l,redirectDismissFocus:!1,children:w}),n[16]=l,n[17]=w,n[18]=T):T=n[18];let E;return n[19]!==m||n[20]!==T?(E=v(T,m),n[19]=m,n[20]=T,n[21]=E):E=n[21],E},F=n=>{let i=o(14),s,l,u,d;i[0]===n?(s=i[1],l=i[2],u=i[3],d=i[4]):({"data-slot":s,label:l,ref:d,...u}=n,i[0]=n,i[1]=s,i[2]=l,i[3]=u,i[4]=d);let _=c(j);h(_,`AlertCenter.DismissIconButton must be composed inside an <AlertCenter.Item>'s children.`);let{store:v}=A(`AlertCenter.DismissIconButton`);m(v.subscribe,v.getPlacementVersion,v.getPlacementVersion);let y=f(null),b=t(y,d),[x,C]=p(null),w;i[5]===l?w=i[6]:(w=()=>{if(l!=null)return;let e=y.current?.closest(`[data-alert-id]`),t=e==null?``:S(e);C(t===``?null:`Dismiss ${t}`)},i[5]=l,i[6]=w),e(w);let T=l??x??void 0,E;i[7]===s?E=i[8]:(E=r(s,`alert-center-dismiss-icon-button`),i[7]=s,i[8]=E);let D;return i[9]!==b||i[10]!==u||i[11]!==T||i[12]!==E?(D=g(a.DismissIconButton,{ref:b,label:T,...u,"data-slot":E}),i[9]=b,i[10]=u,i[11]=T,i[12]=E,i[13]=D):D=i[13],D};function I(e,t){switch(t){case`show`:return`open`;case`hide`:return e===`closed`?`closed`:`closing`;case`exited`:return e===`closing`?`closed`:e}}function L(t){let n=o(10),{present:r}=t,[i,a]=d(I,r?`open`:`closed`),s,c;n[0]===r?(s=n[1],c=n[2]):(s=()=>{a(r?`show`:`hide`)},c=[r],n[0]=r,n[1]=s,n[2]=c),e(s,c);let u,f;n[3]===i?(u=n[4],f=n[5]):(u=()=>{if(i!==`closing`)return;let e=window.setTimeout(()=>a(`exited`),200);return()=>window.clearTimeout(e)},f=[i],n[3]=i,n[4]=u,n[5]=f),l(u,f);let p;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{e.target===e.currentTarget&&e.propertyName===`height`&&a(`exited`)},n[6]=p):p=n[6];let m=p,h=i!==`closed`,g=i===`open`?`open`:`closed`,_;return n[7]!==h||n[8]!==g?(_={isMounted:h,dataState:g,onExitTransitionEnd:m},n[7]=h,n[8]=g,n[9]=_):_=n[9],_}function R(t){let n=o(5),{containerRef:r,isAttached:i}=t,a=f(null),s,c;n[0]!==r||n[1]!==i?(s=()=>{let e=r.current;if(!i||e==null)return;let t=e=>{e.target instanceof Element&&(a.current=e.target)},n=t=>{t.relatedTarget instanceof Node&&!e.contains(t.relatedTarget)&&(a.current=null)};return e.addEventListener(`focusin`,t),e.addEventListener(`focusout`,n),()=>{e.removeEventListener(`focusin`,t),e.removeEventListener(`focusout`,n)}},c=[r,i],n[0]=r,n[1]=i,n[2]=s,n[3]=c):(s=n[2],c=n[3]),e(s,c);let l;return n[4]===Symbol.for(`react.memo_cache_sentinel`)?(l={lastFocusedWithinRef:a},n[4]=l):l=n[4],l}function z(){let e=document.querySelector(`main, [role="main"]`);e!=null&&(e.hasAttribute(`tabindex`)||(e.tabIndex=-1),e.focus({preventScroll:!0}))}function B(t){let n=o(10),{isMounted:r,store:i,topId:a}=t,s=f(null),c;n[0]===r?c=n[1]:(c={containerRef:s,isAttached:r},n[0]=r,n[1]=c);let{lastFocusedWithinRef:l}=R(c),u=f(a),d;n[2]!==l||n[3]!==i||n[4]!==a?(d=()=>{let e=u.current;if(u.current=a,e==null||a===e)return;let t=l.current;if(i.hasAlert(e)){t instanceof HTMLElement&&document.activeElement!==t&&i.requestFocusRestore(t);return}if(t==null||t.isConnected)return;l.current=null;let n=s.current;if(a==null){z();return}n!=null&&(n.querySelector(`[data-alert-dismiss], [data-alert-expand]`)??n).focus()},n[2]=l,n[3]=i,n[4]=a,n[5]=d):d=n[5];let p;n[6]!==i||n[7]!==a?(p=[i,a],n[6]=i,n[7]=a,n[8]=p):p=n[8],e(d,p);let m;return n[9]===Symbol.for(`react.memo_cache_sentinel`)?(m={wrapperRef:s},n[9]=m):m=n[9],m}const V=`gap-2 py-2 pr-2 [&_[data-slot=alert-icon]]:shrink-0`,H={Root:N,Bar:t=>{let i=o(62),s,c,l,u;i[0]===t?(s=i[1],c=i[2],l=i[3],u=i[4]):({className:s,"data-slot":c,ref:u,...l}=t,i[0]=t,i[1]=s,i[2]=c,i[3]=l,i[4]=u);let{store:d,contentId:h}=A(`AlertCenter.Bar`),{isExpanded:v,setExpanded:y}=ee(`AlertCenter.Bar`),x=te(d),C=m(d.subscribe,d.getContentMounted,d.getContentMounted),w=x[0]??null,T=w!=null,E;i[5]===T?E=i[6]:(E={present:T},i[5]=T,i[6]=E);let{isMounted:D,dataState:O,onExitTransitionEnd:k}=L(E),[j,M]=p(w);w!=null&&w!==j&&M(w);let N=w??j,P=f(null),F;i[7]!==N||i[8]!==d||i[9]!==w?(F=()=>{let e=P.current;if(e==null)return;if(w!=null){let t=d.getHost(w.id);t.parentElement!==e&&e.childNodes.length>0&&e.replaceChildren(),b(e,t)&&d.notifyPlacementChange(),d.flushFocusRestore();return}let t=N==null?null:d.getHostSnapshot(N.id);t!=null&&t.parentNode!==e&&e.replaceChildren(t)},i[7]=N,i[8]=d,i[9]=w,i[10]=F):F=i[10],e(F);let I=w?.id,R;i[11]!==D||i[12]!==d||i[13]!==I?(R={isMounted:D,store:d,topId:I},i[11]=D,i[12]=d,i[13]=I,i[14]=R):R=i[14];let{wrapperRef:z}=B(R),H;i[15]!==T||i[16]!==d||i[17]!==z?(H=()=>{let e=z.current;d.setTopLabel(T&&e!=null?S(e):``)},i[15]=T,i[16]=d,i[17]=z,i[18]=H):H=i[18],e(H);let U;i[19]!==T||i[20]!==d||i[21]!==z?(U=()=>{let e=z.current;if(e==null)return;let t=new MutationObserver(()=>{d.setTopLabel(T?S(e):``)});return t.observe(e,{subtree:!0,childList:!0,characterData:!0}),()=>{t.disconnect()}},i[19]=T,i[20]=d,i[21]=z,i[22]=U):U=i[22];let W;i[23]!==D||i[24]!==T||i[25]!==d?(W=[d,T,D],i[23]=D,i[24]=T,i[25]=d,i[26]=W):W=i[26],e(U,W);let G,K;i[27]===d?(G=i[28],K=i[29]):(G=()=>()=>{d.setTopLabel(``)},K=[d],i[27]=d,i[28]=G,i[29]=K),e(G,K);let q;i[30]!==d||i[31]!==z?(q=()=>{d.setBarElement(z.current)},i[30]=d,i[31]=z,i[32]=q):q=i[32],e(q);let J,Y;if(i[33]===d?(J=i[34],Y=i[35]):(J=()=>()=>{d.setBarElement(null)},Y=[d],i[33]=d,i[34]=J,i[35]=Y),e(J,Y),!D||N==null)return null;let ne=T?x.length-1:0,re=!T,ie=N.intent,X;i[36]!==N.className||i[37]!==s?(X=n(V,`not-has-data-[slot=alert-description]:[&_[data-alert-dismiss],&_[data-alert-expand]]:top-1/2 not-has-data-[slot=alert-description]:[&_[data-alert-dismiss],&_[data-alert-expand]]:-translate-y-1/2`,`has-data-alert-expand:[&_[data-alert-dismiss]]:right-16 md:has-data-alert-expand:[&_[data-alert-dismiss]]:right-24`,s,N.className),i[36]=N.className,i[37]=s,i[38]=X):X=i[38];let Z;i[39]===c?Z=i[40]:(Z=r(c,`alert-center-bar`),i[39]=c,i[40]=Z);let ae;i[41]===Symbol.for(`react.memo_cache_sentinel`)?(ae=g(`div`,{ref:P,className:`contents`,"data-slot":`alert-center-bar-mount`}),i[41]=ae):ae=i[41];let Q;i[42]!==h||i[43]!==C||i[44]!==v||i[45]!==ne||i[46]!==y?(Q=ne>0&&C&&g(a.ExpandButton,{count:ne,expanded:v,"aria-controls":h,onClick:()=>y(!v)}),i[42]=h,i[43]=C,i[44]=v,i[45]=ne,i[46]=y,i[47]=Q):Q=i[47];let $;i[48]!==N.id||i[49]!==N.intent||i[50]!==l||i[51]!==u||i[52]!==X||i[53]!==Z||i[54]!==Q?($=_(a.Root,{ref:u,appearance:`banner`,intent:ie,className:X,...l,"data-slot":Z,"data-placement":`bar`,"data-alert-id":N.id,children:[ae,Q]}),i[48]=N.id,i[49]=N.intent,i[50]=l,i[51]=u,i[52]=X,i[53]=Z,i[54]=Q,i[55]=$):$=i[55];let oe;return i[56]!==O||i[57]!==k||i[58]!==re||i[59]!==$||i[60]!==z?(oe=g(`div`,{ref:z,"data-slot":`alert-center-bar-wrapper`,tabIndex:-1,inert:re,className:`shrink-0 overflow-hidden transition-[height,opacity] duration-200 ease-out [interpolate-size:allow-keywords] starting:h-0 starting:opacity-0 data-state-closed:h-0 data-state-closed:opacity-0 data-state-closed:duration-150 motion-reduce:transition-none`,"data-state":O,onTransitionEnd:k,children:$}),i[56]=O,i[57]=k,i[58]=re,i[59]=$,i[60]=z,i[61]=oe):oe=i[61],oe},Content:i=>{let a=o(38),s,c,l,u,d,p;a[0]===i?(s=a[1],c=a[2],l=a[3],u=a[4],d=a[5],p=a[6]):({"aria-label":p,"aria-labelledby":s,className:c,"data-slot":l,ref:d,...u}=i,a[0]=i,a[1]=s,a[2]=c,a[3]=l,a[4]=u,a[5]=d,a[6]=p);let m=p===void 0?`More alerts`:p,{store:h,contentId:_}=A(`AlertCenter.Content`),{isExpanded:v,setExpanded:y}=ee(`AlertCenter.Content`),x=te(h).slice(1),S=x.length>0,C,w;a[7]===h?(C=a[8],w=a[9]):(C=()=>(h.setContentMounted(!0),()=>{h.setContentMounted(!1)}),w=[h],a[7]=h,a[8]=C,a[9]=w),e(C,w);let T=f(S),E,D;a[10]!==S||a[11]!==v||a[12]!==y?(E=()=>{let e=T.current&&!S;T.current=S,e&&v&&y(!1)},D=[S,v,y],a[10]=S,a[11]=v,a[12]=y,a[13]=E,a[14]=D):(E=a[13],D=a[14]),e(E,D);let O=f(null),k=t(O,d),j;a[15]===S?j=a[16]:(j={containerRef:O,isAttached:S},a[15]=S,a[16]=j);let{lastFocusedWithinRef:M}=R(j),N=x.map(W).join(` `),P;a[17]===h?P=a[18]:(P=()=>{let e=O.current;if(e==null)return;let t=!1;for(let n of e.querySelectorAll(`[data-alert-mount]`)){let e=n.getAttribute(`data-alert-mount`);e!=null&&b(n,h.getHost(e))&&(t=!0)}t&&h.notifyPlacementChange(),h.flushFocusRestore()},a[17]=h,a[18]=P),e(P,[h,N]);let F;if(a[19]!==M||a[20]!==h?(F=()=>{let e=M.current;if(e==null)return;if(e.isConnected){let t=O.current;e instanceof HTMLElement&&document.activeElement!==e&&(t==null||!t.contains(e))&&(M.current=null,e.focus({preventScroll:!0}));return}M.current=null;let t=O.current?.querySelector(`[data-alert-dismiss]`);if(t!=null){t.focus();return}let n=h.getBarElement()?.querySelector(`[data-alert-dismiss], [data-alert-expand]`);if(n!=null){n.focus();return}z()},a[19]=M,a[20]=h,a[21]=F):F=a[21],e(F,[h,N]),x.length===0)return null;let I;a[22]===l?I=a[23]:(I=r(l,`alert-center-content`),a[22]=l,a[23]=I);let L=v?`open`:`closed`,B;a[24]===c?B=a[25]:(B=n(`h-0 overflow-hidden invisible [content-visibility:hidden] transition-[height,visibility,content-visibility] transition-discrete duration-200 ease-out [interpolate-size:allow-keywords] data-state-open:h-auto data-state-open:visible data-state-open:[content-visibility:visible] motion-reduce:transition-none`,c),a[24]=c,a[25]=B);let V=s==null?m:void 0,H=x.map(G),U;a[26]!==s||a[27]!==V||a[28]!==H?(U=g(`ul`,{"aria-label":V,"aria-labelledby":s,className:`flex w-full flex-col`,children:H}),a[26]=s,a[27]=V,a[28]=H,a[29]=U):U=a[29];let K;return a[30]!==k||a[31]!==_||a[32]!==u||a[33]!==L||a[34]!==B||a[35]!==U||a[36]!==I?(K=g(`div`,{...u,ref:k,"data-slot":I,id:_,"data-state":L,className:B,children:U}),a[30]=k,a[31]=_,a[32]=u,a[33]=L,a[34]=B,a[35]=U,a[36]=I,a[37]=K):K=a[37],K},Item:P,DismissIconButton:F};function U(){return new D}function W(e){return e.id}function G(e){return g(`li`,{children:g(a.Root,{appearance:`banner`,intent:e.intent,className:n(V,e.className),"data-slot":`alert-center-item`,"data-placement":`list`,"data-alert-id":e.id,children:g(`div`,{className:`contents`,"data-alert-mount":e.id})})},e.id)}export{H as AlertCenter};
@@ -249,6 +249,19 @@ declare const ReferenceLine: (props: AreaChartReferenceLineProps) => null;
249
249
  * is absent — compose it to format the label or values, append a footer, or
250
250
  * replace the content entirely via the render-prop `children`.
251
251
  *
252
+ * **Structure.** A `children` readout renders inside a
253
+ * `<div data-slot="area-chart-tooltip-label">`. When it goes away, React removes
254
+ * that div instead of your own text nodes: a browser translation engine
255
+ * reparents a text node, and a removal aimed at one throws. The div is
256
+ * `display: contents`, so it lays out nothing of its own. To style it as a box,
257
+ * set a display of your own on it first.
258
+ *
259
+ * **Data attributes:**
260
+ *
261
+ * | Data Attribute | Value | Description |
262
+ * | --- | --- | --- |
263
+ * | `data-slot` | `"area-chart-tooltip-label"` | On the `<div>` wrapping a `children` readout. The default readout has none. |
264
+ *
252
265
  * @see https://mantle.ngrok.com/components/charts/area-chart#areacharttooltip
253
266
  *
254
267
  * @example
@@ -271,11 +284,19 @@ declare const Tooltip: (props: AreaChartTooltipProps) => null;
271
284
  * must never rely on color-matching alone. It renders nothing for a single
272
285
  * series (the chart's title already names it).
273
286
  *
287
+ * **Structure.** A `children` render prop renders inside a
288
+ * `<div data-slot="area-chart-legend-label">`. When it goes away, React removes
289
+ * that div instead of your own text nodes: a browser translation engine
290
+ * reparents a text node, and a removal aimed at one throws. The div is
291
+ * `display: contents`, so it lays out nothing of its own. To style it as a box,
292
+ * set a display of your own on it first.
293
+ *
274
294
  * **Data attributes:**
275
295
  *
276
296
  * | Data Attribute | Value | Description |
277
297
  * | --- | --- | --- |
278
298
  * | `data-slot` | `"area-chart-legend"` | The legend list. `AreaChart.Legend` renders it in flow below the plot. |
299
+ * | `data-slot` | `"area-chart-legend-label"` | On the `<div>` wrapping a `children` render prop. The default legend has none. |
279
300
  * | `data-shape` | `"circle"` \| `"square"` \| `"triangle"` \| `"diamond"` \| `"triangle-down"` \| `"plus"` \| `"cross"` \| `"star"` | On each series' swatch, naming the glyph its `AreaChart.Area` wears — the `shape` it set, else the one paired to its series slot. The swatch clips itself to that glyph, so target this only to restyle a key. |
280
301
  *
281
302
  * @see https://mantle.ngrok.com/components/charts/area-chart#areachartlegend
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-2rorgvW0.js";import{c as l}from"react/compiler-runtime";import{jsx as u}from"react/jsx-runtime";const d={Root:e=>{let t=l(2),n;return t[0]===e?n=t[1]:(n=u(o,{kind:`area`,componentName:`AreaChart`,slotName:`area-chart`,...e}),t[0]=e,t[1]=n),n},Area:e=>a(`AreaChart.Area`,`area`,e),Grid:e=>n(`AreaChart.Grid`,e),XAxis:e=>t(`AreaChart.XAxis`,e),YAxis:e=>r(`AreaChart.YAxis`,e),ReferenceLine:t=>e(`AreaChart.ReferenceLine`,t),Tooltip:e=>s(`AreaChart.Tooltip`,e),Legend:e=>{let t=l(2),n;return t[0]===e?n=t[1]:(n=u(i,{partName:`AreaChart.Legend`,slotName:`area-chart`,...e}),t[0]=e,t[1]=n),n},CopyButton:e=>{let t=l(2),n;return t[0]===e?n=t[1]:(n=u(c,{partName:`AreaChart.CopyButton`,slotName:`area-chart`,...e}),t[0]=e,t[1]=n),n}};export{d as AreaChart};
1
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-aZLMj4xx.js";import{c as l}from"react/compiler-runtime";import{jsx as u}from"react/jsx-runtime";const d={Root:e=>{let t=l(2),n;return t[0]===e?n=t[1]:(n=u(o,{kind:`area`,componentName:`AreaChart`,slotName:`area-chart`,...e}),t[0]=e,t[1]=n),n},Area:e=>a(`AreaChart.Area`,`area`,e),Grid:e=>n(`AreaChart.Grid`,e),XAxis:e=>t(`AreaChart.XAxis`,e),YAxis:e=>r(`AreaChart.YAxis`,e),ReferenceLine:t=>e(`AreaChart.ReferenceLine`,t),Tooltip:e=>s(`AreaChart.Tooltip`,e),Legend:e=>{let t=l(2),n;return t[0]===e?n=t[1]:(n=u(i,{partName:`AreaChart.Legend`,slotName:`area-chart`,...e}),t[0]=e,t[1]=n),n},CopyButton:e=>{let t=l(2),n;return t[0]===e?n=t[1]:(n=u(c,{partName:`AreaChart.CopyButton`,slotName:`area-chart`,...e}),t[0]=e,t[1]=n),n}};export{d as AreaChart};
@@ -248,6 +248,19 @@ declare const ReferenceLine: (props: BarChartReferenceLineProps) => null;
248
248
  * absent — compose it to format the label or values, append a footer, or
249
249
  * replace the content entirely via the render-prop `children`.
250
250
  *
251
+ * **Structure.** A `children` readout renders inside a
252
+ * `<div data-slot="bar-chart-tooltip-label">`. When it goes away, React removes
253
+ * that div instead of your own text nodes: a browser translation engine
254
+ * reparents a text node, and a removal aimed at one throws. The div is
255
+ * `display: contents`, so it lays out nothing of its own. To style it as a box,
256
+ * set a display of your own on it first.
257
+ *
258
+ * **Data attributes:**
259
+ *
260
+ * | Data Attribute | Value | Description |
261
+ * | --- | --- | --- |
262
+ * | `data-slot` | `"bar-chart-tooltip-label"` | On the `<div>` wrapping a `children` readout. The default readout has none. |
263
+ *
251
264
  * @see https://mantle.ngrok.com/components/charts/bar-chart#barcharttooltip
252
265
  *
253
266
  * @example
@@ -269,11 +282,19 @@ declare const Tooltip: (props: BarChartTooltipProps) => null;
269
282
  * must never rely on color-matching alone. It renders nothing for a single
270
283
  * series (the chart's title already names it).
271
284
  *
285
+ * **Structure.** A `children` render prop renders inside a
286
+ * `<div data-slot="bar-chart-legend-label">`. When it goes away, React removes
287
+ * that div instead of your own text nodes: a browser translation engine
288
+ * reparents a text node, and a removal aimed at one throws. The div is
289
+ * `display: contents`, so it lays out nothing of its own. To style it as a box,
290
+ * set a display of your own on it first.
291
+ *
272
292
  * **Data attributes:**
273
293
  *
274
294
  * | Data Attribute | Value | Description |
275
295
  * | --- | --- | --- |
276
296
  * | `data-slot` | `"bar-chart-legend"` | The legend list. `BarChart.Legend` renders it in flow below the plot. |
297
+ * | `data-slot` | `"bar-chart-legend-label"` | On the `<div>` wrapping a `children` render prop. The default legend has none. |
277
298
  * | `data-texture` | `"solid"` \| `"hatch"` \| `"hatch-reverse"` \| `"crosshatch"` \| `"perpendicular"` \| `"parallel"` \| `"grid"` \| `"dots"` | On each series' swatch, naming the `texture` its `BarChart.Bar` registered. The swatch paints the pattern itself, so target this only to restyle a key. |
278
299
  *
279
300
  * @see https://mantle.ngrok.com/components/charts/bar-chart#barchartlegend
package/dist/bar-chart.js CHANGED
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-2rorgvW0.js";import{c as l}from"react/compiler-runtime";import{jsx as u}from"react/jsx-runtime";const d={Root:e=>{let t=l(2),n;return t[0]===e?n=t[1]:(n=u(o,{kind:`bar`,componentName:`BarChart`,slotName:`bar-chart`,...e}),t[0]=e,t[1]=n),n},Bar:e=>a(`BarChart.Bar`,`bar`,e),Grid:e=>n(`BarChart.Grid`,e),XAxis:e=>t(`BarChart.XAxis`,e),YAxis:e=>r(`BarChart.YAxis`,e),ReferenceLine:t=>e(`BarChart.ReferenceLine`,t),Tooltip:e=>s(`BarChart.Tooltip`,e),Legend:e=>{let t=l(2),n;return t[0]===e?n=t[1]:(n=u(i,{partName:`BarChart.Legend`,slotName:`bar-chart`,...e}),t[0]=e,t[1]=n),n},CopyButton:e=>{let t=l(2),n;return t[0]===e?n=t[1]:(n=u(c,{partName:`BarChart.CopyButton`,slotName:`bar-chart`,...e}),t[0]=e,t[1]=n),n}};export{d as BarChart};
1
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-aZLMj4xx.js";import{c as l}from"react/compiler-runtime";import{jsx as u}from"react/jsx-runtime";const d={Root:e=>{let t=l(2),n;return t[0]===e?n=t[1]:(n=u(o,{kind:`bar`,componentName:`BarChart`,slotName:`bar-chart`,...e}),t[0]=e,t[1]=n),n},Bar:e=>a(`BarChart.Bar`,`bar`,e),Grid:e=>n(`BarChart.Grid`,e),XAxis:e=>t(`BarChart.XAxis`,e),YAxis:e=>r(`BarChart.YAxis`,e),ReferenceLine:t=>e(`BarChart.ReferenceLine`,t),Tooltip:e=>s(`BarChart.Tooltip`,e),Legend:e=>{let t=l(2),n;return t[0]===e?n=t[1]:(n=u(i,{partName:`BarChart.Legend`,slotName:`bar-chart`,...e}),t[0]=e,t[1]=n),n},CopyButton:e=>{let t=l(2),n;return t[0]===e?n=t[1]:(n=u(c,{partName:`BarChart.CopyButton`,slotName:`bar-chart`,...e}),t[0]=e,t[1]=n),n}};export{d as BarChart};
@@ -575,6 +575,12 @@ type Crumb = {
575
575
  * links that only exist in fetched data. The node renders its own
576
576
  * `Breadcrumb.Item`s and `Breadcrumb.Separator`s, and falls back to
577
577
  * `Breadcrumb.Skeleton` while its data loads.
578
+ *
579
+ * Render a host element at the root, never bare text. `Breadcrumb.List`
580
+ * renders an `<ol>`, so a crumb's outermost node is a direct child of a
581
+ * list. A bare string there is a text node React removes by itself, and
582
+ * a browser translation engine has reparented it first, so the removal
583
+ * throws and the page goes blank.
578
584
  */
579
585
  kind: "content";
580
586
  content: ReactNode;
@@ -619,6 +625,11 @@ declare const routeBreadcrumb: ((label: ReactNode, options?: {
619
625
  * and links that only exist in fetched data. The node decides link vs
620
626
  * current page itself, because the trail builder cannot see inside it.
621
627
  *
628
+ * `content` must render a host element at its root, never bare text. A
629
+ * bare string lands as a direct text child of `Breadcrumb.List`'s `<ol>`,
630
+ * where a removal throws on a translated page. Wrap it in a
631
+ * `Breadcrumb.Item`, or in whatever the segment already renders.
632
+ *
622
633
  * @example
623
634
  * ```tsx
624
635
  * const handle = { breadcrumb: () => [routeBreadcrumb.content(<AppTrail appId="app_123" />)] };
@@ -1,2 +1,2 @@
1
1
  import{n as e,t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./cx-0HCjnNv1.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{t as i}from"./button-pwkdtR3U.js";import{t as a}from"./use-copy-to-clipboard-ByLT8veV.js";import{t as o}from"./alternate-announcement-BkH4bOKp.js";import{t as s}from"./live-region-B2vJRvPH.js";import{c}from"react/compiler-runtime";import{createContext as l,useContext as u,useEffect as d,useId as f,useLayoutEffect as p,useRef as m,useState as h,useSyncExternalStore as g}from"react";import _ from"tiny-invariant";import{Fragment as v,jsx as y,jsxs as b}from"react/jsx-runtime";import{CheckIcon as x}from"@phosphor-icons/react/Check";import{CopyIcon as S}from"@phosphor-icons/react/Copy";import{scaleTime as C}from"d3-scale";import{area as w,curveLinear as T,curveMonotoneX as E,curveStep as D,line as O}from"d3-shape";const k=(e,t)=>Reflect.get(e,t),A=e=>{let{step:t,slot:n}=e,r=Math.min(64,Math.max(24,t*.6));return Math.min(n,r)},j=.5,M=(e,t)=>e<0?e:t,N=e=>{let{lower:t,upper:n,toPixel:r,reveal:i,gap:a}=e,o=r(t<0?n:t),s=o+(r(M(t,n))-o)*i;if(Math.abs(o-r(0))<j)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}},P=e=>{let{lower:t,upper:n,pileOuter:r,toPixel:i}=e;if(Number.isNaN(r))return!1;let a=i(M(t,n));return Math.abs(a-i(r))<j},F=[`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`,`chart-6`,`chart-7`,`chart-8`,`chart-other`],I=e=>F.includes(e),L=e=>`--color-${e}`,R=`var(--color-chart-decorative)`,ee=[`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`,`chart-6`,`chart-7`,`chart-8`],z=e=>{let t=e.toLowerCase();return t.includes(`var(`)||t.includes(`currentcolor`)},B=(e,t)=>{let n=e.ownerDocument,r=n.createElement(`span`);r.style.display=`none`,r.style.color=t,e.appendChild(r);let i=n.defaultView?.getComputedStyle(r).color??``;return r.remove(),i},te=(e,t)=>I(t)?B(e,`var(${L(t)})`):z(t)?B(e,t):t,ne=e=>({grid:B(e,`var(--border-color-card-muted)`),baseline:B(e,`var(--border-color-card)`),tickText:B(e,`var(--text-color-muted)`),reference:B(e,`var(--color-neutral-500)`),surface:B(e,`var(--background-color-card)`)}),re=e=>`${e.className}|${e.getAttribute(`data-applied-theme`)??``}|${e.getAttribute(`data-theme`)??``}`,ie=(e,t)=>{let n=new MutationObserver(t);return n.observe(e,{attributes:!0,attributeFilter:[`class`,`data-applied-theme`,`data-theme`]}),()=>n.disconnect()},ae=1.5,V=1.1,H=1.6,U=e=>`oklch(from ${e} calc(l - 0.18) c h)`,W=(e,t,n)=>{let r=ae;if(n===`up`){e.moveTo(-1.5,t+r),e.lineTo(t+r,-1.5),e.moveTo(-1.5,r),e.lineTo(r,-1.5),e.moveTo(t-r,t+r),e.lineTo(t+r,t-r);return}e.moveTo(-1.5,-1.5),e.lineTo(t+r,t+r),e.moveTo(t-r,-1.5),e.lineTo(t+r,r),e.moveTo(-1.5,t-r),e.lineTo(r,t+r)},oe=(e,t)=>{let{size:n,width:r}=t;e.fillRect(0,n/2-r/2,n,r)},se=(e,t)=>{let{size:n,width:r}=t;e.fillRect(n/2-r/2,0,r,n)},ce={hatch:(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=ae,e.beginPath(),W(e,t,`up`),e.stroke()},"hatch-reverse":(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=ae,e.beginPath(),W(e,t,`down`),e.stroke()},crosshatch:(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=1,e.beginPath(),W(e,t,`up`),W(e,t,`down`),e.stroke()},perpendicular:(e,{size:t,ink:n,orientation:r})=>{e.fillStyle=n,r===`horizontal`?se(e,{size:t,width:2}):oe(e,{size:t,width:2})},parallel:(e,{size:t,ink:n,orientation:r})=>{e.fillStyle=n,r===`horizontal`?oe(e,{size:t,width:2}):se(e,{size:t,width:2})},grid:(e,{size:t,ink:n})=>{e.fillStyle=n,oe(e,{size:t,width:V}),se(e,{size:t,width:V})},dots:(e,{size:t,ink:n})=>{e.fillStyle=n,e.beginPath(),e.arc(t/4,t/4,H,0,Math.PI*2),e.moveTo(3*t/4+H,3*t/4),e.arc(3*t/4,3*t/4,H,0,Math.PI*2),e.fill()}},le=(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),ce[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},ue=e=>{let{pointCount:t,columnCount:n,wasDecimated:r}=e;return n<=0?!1:r?t>=n*3:t>=n*4},de=e=>{let{xs:t,values:n,startIndex:r,endIndex:i,positionK:a,positionB:o,columnCount:s}=e,c=new Uint8Array(s),l=new Float64Array(s),u=new Float64Array(s),d=new Float64Array(s),f=new Float64Array(s);for(let e=r;e<=i;e++){let r=n[e]??NaN;if(Number.isNaN(r))continue;let i=t[e]??NaN,p=Math.floor(i*a+o);if(p===s&&(p=s-1),!(p<0||p>=s)){if(c[p]===0){c[p]=1,l[p]=r,u[p]=r,d[p]=r,f[p]=r;continue}r<(l[p]??1/0)&&(l[p]=r),r>(u[p]??-1/0)&&(u[p]=r),f[p]=r}}return{columnCount:s,hasData:c,minValue:l,maxValue:u,inValue:d,outValue:f}},fe=new Intl.NumberFormat,pe=new Intl.NumberFormat(void 0,{maximumSignificantDigits:4}),me=new Map,G=(e,t)=>{let n=Object.is(e,-0)?0:e,r=t?.maximumFractionDigits;if(r!=null){let e=me.get(r);return e??(e=new Intl.NumberFormat(void 0,{maximumFractionDigits:r}),me.set(r,e)),e.format(n)}return n!==0&&Math.abs(n)<1?pe.format(n):fe.format(n)},he=e=>!Number.isFinite(e)||e<=0?0:Math.min(20,Math.max(0,-Math.floor(Math.log10(e)))),ge=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}),_e=new Intl.DateTimeFormat(void 0,{year:`numeric`,month:`short`,day:`numeric`}),ve=e=>e.getHours()!==0||e.getMinutes()!==0||e.getSeconds()!==0||e.getMilliseconds()!==0,K=(e,t)=>typeof e==`string`?e:typeof e==`number`?G(e):Number.isNaN(e.getTime())?`—`:t?.datasetHasTimeOfDay??ve(e)?ge.format(e):_e.format(e),ye=(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},be=Math.PI/2-.05,xe=e=>({cosYaw:Math.cos(e.yaw),sinYaw:Math.sin(e.yaw),cosPitch:Math.cos(e.pitch),sinPitch:Math.sin(e.pitch)}),Se=(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}},Ce=e=>Math.min(be,Math.max(-be,e)),q=(e,t)=>{let n=t[1]-t[0];return n===0?0:(e-t[0])/n*2-1},we=[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1],[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],Te=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[1,5],[2,6],[3,7]],Ee=Math.sqrt(50),De=Math.sqrt(10),Oe=Math.sqrt(2),J=(e,t,n,r)=>{let i=(t-e)/Math.max(0,n),a=r?.integer?Math.max(1,i):i,o=Math.floor(Math.log10(a)),s=a/10**o,c=s>=Ee?10:s>=De?5:s>=Oe?2:1,l,u,d;return o<0?(d=10**-o/c,l=Math.round(e*d),u=Math.round(t*d),l/d<e&&(l+=1),u/d>t&&--u,d=-d):(d=10**o*c,l=Math.round(e/d),u=Math.round(t/d),l*d<e&&(l+=1),u*d>t&&--u),u<l&&.5<=n&&n<2?J(e,t,n*2,r):[l,u,d]},ke=(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?J(t,e,n,r):J(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},Ae=(e,t,n)=>J(e,t,n)[2],je=(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}},Me=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}},Y=(e,t)=>e.rangeStart+e.offset+t*e.step,X=(e,t)=>Y(e,t)+e.bandwidth/2,Ne=(e,t)=>({start:Y(e,t)-(e.step-e.bandwidth)/2,size:e.step}),Pe=(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))},Fe=(e,t,n)=>ke(e[0],e[1],t,n);let Ie=null,Le=null;const Re=e=>{if(Le!=null&&Ie!=null&&Ie[0]===e[0]&&Ie[1]===e[1])return Le;let t=C().domain([new Date(e[0]),new Date(e[1])]);return Ie=[e[0],e[1]],Le=t,t},ze=(e,t)=>Re(e).ticks(t).map(e=>e.getTime()),Be=e=>{let t=Re(e).tickFormat();return e=>t(new Date(e))},Z=(e,t)=>{if(e[0]>e[1])return Z([e[1],e[0]],t);if(e[0]===e[1]){let n=e[0],r=n===0?1:Math.abs(n)*.5;return Z([n-r,n+r],t)}let n=e[0],r=e[1],i=NaN;for(let e=0;e<10;e++){let e=Ae(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]},Ve=(e,t)=>{let n=Z(e,t);return e[0]===0?[0,n[1]]:n},Q=e=>e===`monotone`?E:e===`step`?D:T,$=e=>Math.round(e)+.5,He=(e,t)=>{let{plot:n,color:r,xLines:i,yLines:a}=t;e.save(),e.strokeStyle=r,e.lineWidth=1;for(let t of i)e.globalAlpha=t.alpha,e.beginPath(),e.moveTo($(t.position),n.top),e.lineTo($(t.position),n.top+n.height),e.stroke();for(let t of a)e.globalAlpha=t.alpha,e.beginPath(),e.moveTo(n.left,$(t.position)),e.lineTo(n.left+n.width,$(t.position)),e.stroke();e.restore()},Ue=(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()},We=(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()},Ge=(e,t)=>{let{fill:n,rects:r}=t;e.fillStyle=n,e.beginPath();for(let t of r){let n=Math.max(.5,t.width),r=Math.min(t.valueY,t.baselineY),i=Math.abs(t.baselineY-t.valueY);if(i===0)continue;let a=t.rounded&&n>=8?Math.min(4,n/2,i):0;if(a===0){e.rect(t.x,r,n,i);continue}t.valueY<=t.baselineY?e.roundRect(t.x,r,n,i,[a,a,0,0]):e.roundRect(t.x,r,n,i,[0,0,a,a])}e.fill()},Ke=(e,t)=>{let{fill:n,rects:r}=t;e.fillStyle=n,e.beginPath();for(let t of r){let n=Math.max(.5,t.height),r=Math.min(t.valueX,t.baselineX),i=Math.abs(t.valueX-t.baselineX);if(i===0)continue;let a=t.rounded&&n>=8?Math.min(4,n/2,i):0;if(a===0){e.rect(r,t.y,i,n);continue}t.valueX>=t.baselineX?e.roundRect(r,t.y,i,n,[0,a,a,0]):e.roundRect(r,t.y,i,n,[a,0,0,a])}e.fill()},qe=(e,t)=>{let{color:n,curve:r,indexes:i,xAt:a,yAt:o,definedAt:s}=t,c=O().x(a).y(o).defined(s).curve(Q(r)).context(e);e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath(),c(i),e.stroke()},Je=(e,t)=>{let{color:n,curve:r,indexes:i,xAt:a,y0At:o,y1At:s,definedAt:c}=t,l=w().x(a).y0(o).y1(s).defined(c).curve(Q(r)).context(e);e.beginPath(),l(i),e.save(),e.globalAlpha=.1,e.fillStyle=n,e.fill(),e.restore();let u=O().x(a).y(s).defined(c).curve(Q(r)).context(e);e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath(),u(i),e.stroke()},Ye=(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()},Xe=(e,t)=>{let{color:n,lowerColumns:r,upperColumns:i,columnToX:a,valueK:o,valueB:s}=t;e.beginPath();let c=-1,l=t=>{if(c<0)return;let n=!1;for(let r=c;r<=t;r++){let t=a(r),c=(i.maxValue[r]??0)*o+s;n?e.lineTo(t,c):(e.moveTo(t,c),n=!0)}for(let n=t;n>=c;n--){let t=a(n),i=(r.minValue[n]??0)*o+s;e.lineTo(t,i)}e.closePath(),c=-1};for(let e=0;e<i.columnCount;e++){if(i.hasData[e]===0){l(e-1);continue}c<0&&(c=e)}l(i.columnCount-1),e.save(),e.globalAlpha=.1,e.fillStyle=n,e.fill(),e.restore(),Ye(e,{color:n,columns:i,columnToX:a,valueK:o,valueB:s})},Ze=(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()},Qe=[[-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]],$e=Qe.map(([e,t])=>[(e-t)/Math.SQRT2,(e+t)/Math.SQRT2]),et=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]}),tt={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)=>{Ze(e,t,n,r*1.189,Qe)},cross:(e,t,n,r)=>{Ze(e,t,n,r*1.189,$e)},star:(e,t,n,r)=>{Ze(e,t,n,r*1.673,et)}},nt=(e,t,n,r,i)=>{tt[i](e,t,n,r)},rt=(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(),nt(e,o(t),s(t),4,i),e.fill(),e.stroke())},it=5e3,at=2e4,ot=(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>at){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<=it;e.strokeStyle=r,e.lineWidth=2;for(let t of o){let n=l(t);n<=0||(e.beginPath(),nt(e,s(t),c(t),n,i),e.fill(),u&&e.stroke())}},st=(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>at){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<=it;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(),nt(e,i[t]??0,a[t]??0,o[t]??0,c(t)),e.fill(),d&&e.stroke()}e.restore()},ct=(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()},lt=(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()},ut=(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))},dt=(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)}},ft=(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()},pt=e=>{let t=e.length,n=e[0]?.length??0,r=[],i=[];for(let e=0;e<t;e++)r.push(new Float64Array(n)),i.push(new Float64Array(n));let a=0,o=0,s=new Float64Array(n),c=new Float64Array(n),l=new Int32Array(n).fill(-1),u=new Int32Array(n).fill(-1);for(let d=0;d<t;d++){let t=e[d],f=r[d],p=i[d];if(t!=null&&f!=null&&p!=null)for(let e=0;e<n;e++){let n=t[e]??NaN;if(Number.isNaN(n)){f[e]=NaN,p[e]=NaN;continue}if(n>=0){let t=s[e]??0,r=t+n;s[e]=r,f[e]=t,p[e]=r,r>o&&(o=r),n>0&&(l[e]=d)}else{let t=c[e]??0,r=t+n;c[e]=r,f[e]=r,p[e]=t,r<a&&(a=r),u[e]=d}}}return{lower:r,upper:i,min:a,max:o,positiveEnd:l,negativeEnd:u}},mt=e=>1-(1-e)**3;var ht=class{#e=new Float64Array;#t=new Float64Array;#n=new Float64Array;#r=0;#i=0;#a=!1;get active(){return this.#a}values(){return this.#n}retarget(e,t){let{duration:n,now:r}=t,i=e.length,a=this.#n.length!==i;if(a&&(this.#e=new Float64Array(i),this.#t=new Float64Array(i),this.#n=new Float64Array(i)),a||n<=0){for(let t=0;t<i;t++){let n=e[t]??NaN;this.#e[t]=n,this.#t[t]=n,this.#n[t]=n}this.#a=!1;return}let o=!1;for(let t=0;t<i;t++){let n=e[t]??NaN,r=this.#n[t]??NaN;if(r!==n&&!(Number.isNaN(r)&&Number.isNaN(n))){o=!0;break}}if(!o){for(let t=0;t<i;t++)this.#t[t]=e[t]??NaN;this.#a=!1;return}for(let t=0;t<i;t++)this.#e[t]=this.#n[t]??NaN,this.#t[t]=e[t]??NaN;this.#r=r,this.#i=n,this.#a=!0}snap(){this.#n.set(this.#t),this.#a=!1}tick(e){if(!this.#a)return!1;let t=Math.min(1,(e-this.#r)/this.#i),n=mt(t);for(let e=0;e<this.#n.length;e++){let t=this.#e[e]??NaN,r=this.#t[e]??NaN;if(Number.isNaN(t)||Number.isNaN(r)){this.#n[e]=r;continue}this.#n[e]=t+(r-t)*n}return t>=1&&(this.#a=!1),this.#a}},gt=class{#e=new Float64Array;#t=new Float64Array;#n=0;#r=!1;#i;#a;#o=0;constructor(e={}){this.#i=e.speed??.14,this.#a=e.epsilon??.001}get active(){return this.#r}values(){return this.#t}jump(e){this.#t.length!==e.length&&(this.#e=new Float64Array(e.length),this.#t=new Float64Array(e.length));for(let t=0;t<e.length;t++){let n=e[t]??NaN;this.#e[t]=n,this.#t[t]=n}this.#r=!1}aim(e,t){if(this.#t.length!==e.length){this.jump(e);return}let n=!1;for(let t=0;t<e.length;t++){let r=e[t]??NaN,i=this.#e[t]??NaN;if(i!==r&&!(Number.isNaN(i)&&Number.isNaN(r))){n=!0;break}}if(!n)return;let r=0;for(let t=0;t<e.length;t++){let n=e[t]??NaN;this.#e[t]=n;let i=Math.abs(n-(this.#t[t]??NaN));Number.isFinite(i)&&i>r&&(r=i)}this.#o=r,this.#r||(this.#r=!0,this.#n=t)}tick(e){if(!this.#r)return!1;let t=Math.min(50,Math.max(0,e-this.#n));this.#n=e;let n=1-(1-this.#i)**(t/16.67),r=Math.max(this.#o*this.#a,2**-52),i=!0;for(let e=0;e<this.#t.length;e++){let t=this.#e[e]??NaN,a=this.#t[e]??NaN;if(Number.isNaN(t)||Number.isNaN(a)){this.#t[e]=t;continue}let o=a+(t-a)*n;n>0&&o===a||Math.abs(t-o)<=r?this.#t[e]=t:(this.#t[e]=o,i=!1)}return this.#r=!i,this.#r}};const _t=e=>`${e.colorInput}|${e.texture}`,vt={bar:`BarChart.Bar`,line:`LineChart.Line`,area:`AreaChart.Area`,scatter:`ScatterPlot.Point`},yt=1e3;var bt=class{#e;#t;#n;#r={xKey:``,xScale:`linear`,yDomain:[`auto`,`auto`],orientation:`vertical`,zKey:null,dimensions:3,stacked:!1,animate:!0};#i={onDatumActivate:null,onActiveIndexChange:null};#a;#o=null;#s=null;#c=null;#l=null;#u=0;#d=0;#f=1;#p=[];#m=0;#h=new Float64Array;#g=[];#_=null;#v=null;#y=!1;#b=!1;#x=new Map;#S=0;#C=0;#w=!0;#T=!0;#E=null;#D=new gt({speed:.16});#O=new gt({speed:.2});#k=new Map;#A=new Map;#j=null;#M=!1;#N=new Map;#P=new Map;#F=0;#I=!1;#L=new Map;#R={alpha:0,target:0};#z=0;#B=null;#V=null;#H=null;#U={left:0,top:0,width:0,height:0};#W=null;#G=new Float64Array;#K=[0,1];#q={yaw:.65,pitch:-.35};#J=new gt({speed:.12});#Y=new gt({speed:.16});#X=null;#Z=!1;#Q=null;#$=new Int32Array;#ee=new Map;#te=``;#ne=null;#re=null;#ie=null;#ae=void 0;#oe=null;#se=!1;#ce=null;#le=null;#ue={width:0,height:0};#de=!1;#fe=!1;#pe=0;#me=!1;constructor(e){this.#e=e.kind,this.#t=e.elements,this.#n=e.store,this.#a=e.elements.canvas.getContext(`2d`),this.#n.onSeriesChange=()=>{this.#b=!0,this.#De()},this.#n.onPresentationChange=()=>{this.#De()},typeof ResizeObserver<`u`&&(this.#o=new ResizeObserver(e=>{let t=e[0];t!=null&&(this.#u=t.contentRect.width,this.#d=t.contentRect.height,this.#f=this.#je(),this.#L.clear(),this.#ne=null,this.#De())}),this.#o.observe(e.elements.plot),this.#c=new ResizeObserver(()=>{this.#ue={width:this.#t.tooltip.offsetWidth,height:this.#t.tooltip.offsetHeight},this.#Oe()}),this.#c.observe(e.elements.tooltip));let t=e.elements.root.ownerDocument.documentElement;this.#s=ie(t,()=>{this.#H=null,this.#De()}),this.#he(),this.#Y.jump([1,1])}destroy(){this.#me=!0,this.#o?.disconnect(),this.#c?.disconnect(),this.#s?.(),this.#l?.(),this.#n.onSeriesChange=null,this.#n.onPresentationChange=null,this.#B!=null&&(clearTimeout(this.#B),this.#B=null),this.#pe!==0&&cancelAnimationFrame(this.#pe)}#he(){if(typeof matchMedia>`u`||this.#me)return;this.#l?.();let e=matchMedia(`(resolution: ${this.#je()}dppx)`),t=()=>{this.#f=this.#je(),this.#L.clear(),this.#De(),this.#he()};e.addEventListener(`change`,t,{once:!0}),this.#l=()=>e.removeEventListener(`change`,t)}setOptions(e){let t=this.#r;if(this.#r=e,t.xScale!==e.xScale&&this.#N.clear(),t.animate&&!e.animate&&this.#ge(),t.dimensions!==e.dimensions){let t=[+(e.dimensions>=2),+(e.dimensions>=3)],n=xt(e.dimensions);if(this.#ye()===0||!this.#M)this.#Y.jump(t),this.#q=n,this.#J.jump([n.yaw,n.pitch]);else{let e=n.yaw+Math.round((this.#q.yaw-n.yaw)/(Math.PI*2))*Math.PI*2;this.#Y.aim(t,performance.now()),this.#J.jump([this.#q.yaw,this.#q.pitch]),this.#J.aim([e,n.pitch],performance.now())}}(t.xKey!==e.xKey||t.xScale!==e.xScale||t.zKey!==e.zKey||t.stacked!==e.stacked)&&(this.#b=!0),(t.yDomain[0]!==e.yDomain[0]||t.yDomain[1]!==e.yDomain[1])&&(this.#ne=null,this.#M&&(this.#ye()===0?this.#D.jump(this.#xe()):this.#D.aim(this.#xe(),performance.now()))),this.#De()}setCallbacks(e){this.#i=e}setRows(e){e!==this.#p&&(this.#p=e,this.#b=!0,this.#De())}flushIngest(){!this.#b||this.#me||(this.#b=!1,this.#_e())}setControlledActiveIndex(e){let t=this.#oe;this.#oe=null;let n=this.#ae!==void 0;if(this.#ae=e,e!==void 0){let n=t!=null&&t.index===e&&t.viaKeyboard;this.#at(e==null?null:this.#tt(e),{viaKeyboard:n,notify:!1})}else n&&this.#at(null,{viaKeyboard:!1,notify:!1});this.#Oe()}handlePointerMove(e,t){if(this.#X!=null){let n=e-this.#X.lastX,r=t-this.#X.lastY;(this.#X.moved||Math.abs(n)+Math.abs(r)>3)&&(this.#X.moved=!0,this.#q={yaw:this.#q.yaw+n*.008,pitch:Ce(this.#q.pitch+r*.008)},this.#J.jump([this.#q.yaw,this.#q.pitch]),this.#X.lastX=e,this.#X.lastY=t,this.#at(null,{viaKeyboard:!1,notify:!1}),this.#De());return}if(this.#ce=e,this.#le=t,this.#e===`scatter`){let n=this.#ft(e,t);this.#re=n?.seriesKey??null,this.#ne=n==null?null:{x:n.screenX,y:n.screenY},this.#at(n?.index??null,{viaKeyboard:!1,notify:!0});return}let n=this.#rt(e,t);this.#at(n,{viaKeyboard:!1,notify:!0})}handlePointerDown(e,t){if(this.#Z=!0,this.#Ce()){this.#X={lastX:e,lastY:t,moved:!1};return}this.handlePointerMove(e,t)}handlePointerUp(e,t){let n=this.#X;this.#X=null;let r=this.#Z;if(this.#Z=!1,n!=null){if(n.moved)return;this.handlePointerMove(e,t)}r&&this.handleActivate(e,t)}handlePointerLeave(){this.#ce=null,this.#le=null,this.#X=null,this.#Z=!1,this.#re=null,this.#ne=null,this.#at(null,{viaKeyboard:!1,notify:!0})}handleActivate(e,t){let n=this.#$e();if(n==null)return;let r=this.#et(n),i=this.#p[r];if(i==null)return;let a=this.#e===`scatter`?this.#re:e==null||t==null?null:this.#it(n,e,t);this.#i.onDatumActivate?.({index:r,xValue:this.#nt(n),datum:i,dataKey:a})}handleKeyDown(e){if(this.#m===0)return!1;let t=this.#m-1,n=this.#$e(),r=this.#I?Math.max(1,Math.floor(this.#m/Math.max(1,this.#U.width*this.#f))):1,i=Math.max(1,Math.floor(this.#m/10)),a=(()=>{switch(e){case`ArrowLeft`:return Math.max(0,(n??this.#m)-r);case`ArrowRight`:return Math.min(t,(n??-1)+r);case`PageUp`:return Math.min(t,(n??0)+i);case`PageDown`:return Math.max(0,(n??t)-i);case`Home`:return 0;case`End`:return t;case`Escape`:return null;default:return}})();return a===void 0?e===`Enter`||e===` `?(this.handleActivate(null,null),!0):!1:(this.#ce=null,this.#le=null,this.#re=null,this.#ne=null,this.#at(a,{viaKeyboard:!0,notify:!0}),!0)}invalidateColors(){this.#H=null,this.#De()}#ge(){this.#D.jump(this.#xe()),this.#O.jump(this.#Se()),this.#Y.jump([+(this.#r.dimensions>=2),+(this.#r.dimensions>=3)]);let e=xt(this.#r.dimensions);this.#q=e,this.#J.jump([e.yaw,e.pitch]);for(let e of this.#k.values())e.snap();for(let e of this.#A.values())e.snap();this.#R.alpha=this.#R.target,this.#De()}#_e(){let e=this.#p,{xKey:t,xScale:n}=this.#r,r=this.#n.seriesSpecs();this.#L.clear();let i=this.#h;if(n===`band`||n===`point`){let n=e.length,r=new Float64Array(n),i=Array.from({length:n},()=>``),a=!1;for(let o=0;o<n;o++){let n=e[o],s=n==null?void 0:k(n,t);s!==void 0&&(a=!0),i[o]=typeof s==`string`||typeof s==`number`||s instanceof Date?s:String(s),r[o]=o}_(n===0||a,`${this.#Te()} xKey "${t}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),this.#_=null,this.#v=null,this.#m=n,this.#h=r,this.#g=i,this.#T=!0}else{let r=[],i=!1,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e[s],l=c==null?void 0:k(c,t);l!==void 0&&(i=!0),l!=null&&(a=!0);let u=Et(l,n===`time`);Number.isFinite(u)&&(r.push({source:s,x:u}),o=!0)}_(e.length===0||i,`${this.#Te()} xKey "${t}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),_(!a||o,`${this.#Te()} could not read any "${t}" values as ${n===`time`?`dates`:`numbers`} for the "${n}" x scale — check the xScale and the data types.`);let s=!0;for(let e=1;e<r.length;e++)if((r[e]?.x??0)<(r[e-1]?.x??0)){s=!1;break}let c=s?r:r.toSorted((e,t)=>e.x-t.x),l=c.length,u=new Float64Array(l),d=l===e.length,f=!0,p=new Int32Array(l);for(let e=0;e<l;e++){let t=c[e];t!=null&&(u[e]=t.x,Number.isInteger(t.x)||(f=!1),p[e]=t.source,t.source!==e&&(d=!1))}if(d)this.#_=null,this.#v=null;else{this.#_=p;let t=new Int32Array(e.length).fill(-1);for(let e=0;e<l;e++){let n=p[e];n!=null&&(t[n]=e)}this.#v=t}this.#m=l,this.#h=u,this.#g=[],this.#T=f}let a=!1;for(let e of this.#g)if(e instanceof Date&&ve(e)){a=!0;break}this.#y=a;let o=this.#h[0],s=this.#h[this.#m-1],c=i[0],l=i[i.length-1];!this.#Ce()&&(n===`linear`||n===`time`)&&o!=null&&s!=null&&c!=null&&l!=null&&o>c&&s>=l?(this.#R.target=1,this.#z=performance.now()):(o!==c||s!==l)&&(this.#R.target=0);let u=this.#m,d=i.length===u&&u<=2500;if(d){for(let e=0;e<u;e++)if(i[e]!==this.#h[e]){d=!1;break}}let f=this.#x;this.#x=new Map;let p=1/0,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.#_==null?i:this.#_[i]??i],o=a==null?void 0:k(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))}_(u===0||r,`${vt[t.mark]} dataKey "${t.dataKey}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),this.#x.set(t.dataKey,n)}this.#S=p===1/0?0:p,this.#C=m===-1/0?0:m,this.#w=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.#_==null?a:this.#_[a]??a],s=o==null?void 0:k(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))}_(u===0||i,`ScatterPlot.Root zKey "${g}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),this.#G=t,this.#K=n===1/0?[0,1]:Z([n,r],5)}else this.#G=new Float64Array;this.#Q=null,this.#ne=null,this.#E=this.#r.stacked?pt(r.map(e=>this.#x.get(e.dataKey)??new Float64Array)):null,this.#I=ue({pointCount:u,columnCount:Math.max(1,Math.round(this.#U.width*this.#f)),wasDecimated:this.#I});let v=this.#H;if(v!=null){for(let e of this.#n.seriesMeta())if(v.inputs.get(e.dataKey)!==_t(e)){this.#H=null;break}}this.#ve(r,f,d);let y=this.#$e();y!=null&&this.#at(Math.min(y,Math.max(0,u-1)),{viaKeyboard:this.#se,notify:!1}),this.#lt({force:!0})}#ve(e,t,n){let r=performance.now(),i=this.#ye(),a=!this.#M;this.#M=this.#M||this.#m>0,a||i===0?(this.#D.jump(this.#xe()),this.#O.jump(this.#Se())):(this.#D.aim(this.#xe(),r),this.#O.aim(this.#Se(),r));let o=this.#m>0&&this.#m<=2500&&n,s=new Set,c=new Set,l=(e,t,n)=>{s.add(e);let a=this.#k.get(e);a??(a=new ht,this.#k.set(e,a));let c=o&&n&&a.values().length===t.length;a.retarget(t,{duration:c?i:0,now:r})};e.forEach((e,n)=>{c.add(e.dataKey);let a=t.has(e.dataKey);if(this.#E==null?l(e.dataKey,this.#x.get(e.dataKey)??new Float64Array,a):(l(`${e.dataKey}:lower`,this.#E.lower[n]??new Float64Array,a),l(`${e.dataKey}:upper`,this.#E.upper[n]??new Float64Array,a)),!this.#A.has(e.dataKey)&&this.#m>0){let t=new ht;t.retarget([0],{duration:0,now:r}),t.retarget([1],{duration:i,now:r}),this.#A.set(e.dataKey,t)}});for(let e of this.#k.keys())s.has(e)||this.#k.delete(e);for(let e of this.#A.keys())c.has(e)||this.#A.delete(e)}#ye(){return!this.#r.animate||this.#be()?0:280}#be(){return typeof matchMedia>`u`?!1:(this.#j??=matchMedia(`(prefers-reduced-motion: reduce)`),this.#j.matches)}#xe(){let[e,t]=this.#r.yDomain,n,r;if(this.#E==null?this.#e===`line`||this.#e===`scatter`?(n=this.#S,r=this.#C):(n=Math.min(0,this.#S),r=Math.max(0,this.#C)):(n=Math.min(0,this.#E.min),r=Math.max(0,this.#E.max)),typeof e==`number`&&(n=e),typeof t==`number`&&(r=t),this.#m===0)return[0,1];let i=this.#e===`bar`||this.#e===`area`?Ve([n,r],5):Z([n,r],5);return[typeof e==`number`?e:i[0],typeof t==`number`?t:i[1]]}#Se(){if(this.#m===0)return[0,1];let e=this.#h[0]??0,t=this.#h[this.#m-1]??0;return e===t?[e-.5,t+.5]:this.#e===`scatter`?Z([e,t],5):[e,t]}#Ce(){return this.#e===`scatter`&&this.#r.zKey!=null}#we(){return this.#e===`bar`&&this.#r.orientation===`horizontal`}#Te(){return`${vt[this.#e].split(`.`)[0]??`Chart`}.Root`}#Ee(e,t){let n=this.#V;n??(n=this.#t.canvas.ownerDocument.createElement(`canvas`),this.#V=n),(n.width!==e||n.height!==t)&&(n.width=e,n.height=t);let r=n.getContext(`2d`);return r==null?null:{canvas:n,ctx:r}}#De(){this.#fe=!0,this.#ke()}#Oe(){this.#ke()}#ke(){this.#de||this.#me||(this.#de=!0,this.#pe=requestAnimationFrame(()=>{this.#de=!1,this.#pe=0,this.#Ae()}))}#Ae(){if(!this.#me){if(this.flushIngest(),this.#fe){this.#fe=!1;let e=performance.now(),t=!1;t=this.#D.tick(e)||t,t=this.#O.tick(e)||t;for(let n of this.#k.values())t=n.tick(e)||t;for(let n of this.#A.values())t=n.tick(e)||t;if(t=this.#Y.tick(e)||t,this.#J.tick(e)){t=!0;let e=this.#J.values();this.#q={yaw:e[0]??this.#q.yaw,pitch:e[1]??this.#q.pitch}}this.#Me(),this.#Pe(),t=this.#Ve(e)||t,t&&this.#De()}this.#mt()}}#je(){return typeof devicePixelRatio==`number`&&devicePixelRatio>0?Math.min(devicePixelRatio,3):1}#Me(){let e=this.#t.root,t=`${re(e.ownerDocument.documentElement)}|${this.#f}|${this.#r.orientation}`;if(this.#H?.signature===t)return;let n=e.ownerDocument.defaultView;if(n==null)return;let r=this.#a,i=new Map,a=new Map,o=new Map;for(let t of this.#n.seriesMeta()){let n=te(e,t.colorInput);if(i.set(t.dataKey,n),a.set(t.dataKey,_t(t)),r!=null&&t.mark===`bar`&&t.texture!==`solid`){let i=le(r,{texture:t.texture,color:n,ink:B(e,U(n)),devicePixelRatio:this.#f,orientation:this.#r.orientation});i!=null&&o.set(t.dataKey,i)}}this.#H={signature:t,series:i,inputs:a,barTextures:o,chrome:ne(e),fontFamily:n.getComputedStyle(e).fontFamily||`sans-serif`}}#Ne(e){let t=this.#H?.signature??``;t!==this.#te&&(this.#ee.clear(),this.#te=t);let n=this.#ee.get(e);if(n!=null)return n;let r=te(this.#t.root,e);return this.#ee.set(e,r),r}#Pe(){let e=this.#n.getSnapshot(),t=this.#Ce(),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.#d-8-o);this.#U={left:8,top:8,width:Math.max(0,this.#u-16),height:s};let c=8;if(a){c=40;let e=this.#a;if(e!=null&&this.#H!=null){e.font=`11px ${this.#H.fontFamily}`;let t=0,r=n?this.#Be().map(e=>e.text):this.#ze().map(e=>e.text);for(let n of r){let r=e.measureText(n).width;r>t&&(t=r)}c=Math.ceil(t)+14}}this.#U={left:c,top:8,width:Math.max(0,this.#u-c-8),height:s};let l=n?this.#U.top:this.#U.left,u=n?this.#U.top+this.#U.height:this.#U.left+this.#U.width;this.#W=this.#r.xScale===`band`?Me({count:this.#m,rangeStart:l,rangeEnd:u,paddingInner:.2,paddingOuter:.1}):this.#r.xScale===`point`?Me({count:this.#m,rangeStart:l,rangeEnd:u,paddingInner:1,paddingOuter:.5}):null,this.#I=ue({pointCount:this.#m,columnCount:Math.max(1,Math.round(this.#U.width*this.#f)),wasDecimated:this.#I})}#Fe(){let e=this.#D.values();return je([e[0]??0,e[1]??1],[this.#U.top+this.#U.height,this.#U.top])}#Ie(){let e=this.#D.values(),t=this.#we()?[this.#U.left,this.#U.left+this.#U.width]:[this.#U.top+this.#U.height,this.#U.top];return je([e[0]??0,e[1]??1],t)}#Le(){let e=this.#O.values();return je([e[0]??0,e[1]??1],[this.#U.left,this.#U.left+this.#U.width])}#Re(e){let t=this.#W;if(t!=null)return X(t,e);let{k:n,b:r}=this.#Le();return(this.#h[e]??0)*n+r}#ze(){let e=this.#n.getSnapshot(),t=this.#D.values(),n=Fe([t[0]??0,t[1]??1],e.yAxis?.tickCount??5,{integer:this.#w}),r=e.yAxis?.tickFormat,i=n.length>1?he(Math.abs((n[1]??0)-(n[0]??0))):void 0;return n.map(e=>({value:e,text:r==null?G(e,i==null?void 0:{maximumFractionDigits:i}):r(e)}))}#Be(){let e=this.#n.getSnapshot(),t=e.xAxis?.tickFormat;if(this.#W!=null){let e=this.#we(),n=e?this.#U.height:this.#U.width,r=Math.max(1,Math.floor(n/(e?15:60))),i=Math.max(1,Math.ceil(this.#m/r)),a=[];for(let e=0;e<this.#m;e+=i){let n=this.#g[e]??``;a.push({index:e,value:e,text:t==null?K(n,{datasetHasTimeOfDay:this.#y}):t(n)})}return a}let n=this.#O.values(),r=[n[0]??0,n[1]??1],i=e.xAxis?.tickCount??Math.max(2,Math.floor(this.#U.width/90));if(this.#r.xScale===`time`){let e=Be(r);return ze(r,i).map(n=>({index:null,value:n,text:t==null?e(n):t(new Date(n))}))}let a=Fe(r,i,{integer:this.#T}),o=a.length>1?he(Math.abs((a[1]??0)-(a[0]??0))):void 0;return a.map(e=>({index:null,value:e,text:t==null?G(e,o==null?void 0:{maximumFractionDigits:o}):t(e)}))}#Ve(e){let t=this.#a,n=this.#H;if(t==null||n==null||this.#u<=0||this.#d<=0)return!1;let r=Math.min(50,Math.max(0,e-this.#F));this.#F=e;let i=this.#t.canvas,a=Math.round(this.#u*this.#f),o=Math.round(this.#d*this.#f);(i.width!==a||i.height!==o)&&(i.width=a,i.height=o),t.setTransform(this.#f,0,0,this.#f,0,0),t.clearRect(0,0,this.#u,this.#d);let s=this.#n.getSnapshot(),c=this.#U;if(c.width<=0||c.height<=0)return!1;let l=this.#Fe(),u=this.#Le(),d=this.#n.seriesSpecs(),f=this.#Ce(),p=this.#ye()===0,m=f?[]:this.#He(t,n.fontFamily),h=f?[]:this.#Ue(t,n.fontFamily),g=St(this.#N,m,r,p);g=St(this.#P,h,r,p)||g;let _=this.#R;if(_.target===1){if(e-this.#z>yt)_.target=0;else if(this.#B==null){let t=yt-(e-this.#z)+17;this.#B=setTimeout(()=>{this.#B=null,this.#De()},t)}}if(p)_.alpha=_.target;else{let e=1-(1-(_.target>_.alpha?.16:.08))**(r/16.67);_.alpha+=(_.target-_.alpha)*e,Math.abs(_.target-_.alpha)<.02&&(_.alpha=_.target)}_.alpha!==_.target&&(g=!0);let v=this.#we(),y=v?this.#Ie():l,b=e=>this.#W==null?e*u.k+u.b:X(this.#W,e),x=e=>e*y.k+y.b,S=[...this.#N.entries()].map(([e,t])=>({position:b(e),alpha:t.alpha})),C=[...this.#P.entries()].map(([e,t])=>({position:x(e),alpha:t.alpha}));if(s.grid!=null&&!f){let e=s.grid.lines??(v?`vertical`:`horizontal`),r=v?S:C,i=v?C:S;He(t,{plot:c,color:n.chrome.grid,xLines:e===`horizontal`?[]:i,yLines:e===`vertical`?[]:r})}let w=Math.min(40,c.width*.25),T=t,E=null;_.alpha>.01&&w>1&&(E=this.#Ee(a,o),E!=null&&(E.ctx.setTransform(this.#f,0,0,this.#f,0,0),E.ctx.clearRect(0,0,this.#u,this.#d),T=E.ctx)),T.save(),T.beginPath(),T.rect(c.left,c.top,c.width,c.height+1),T.clip();let D=null;if(this.#e===`bar`?v?this.#Ye(T,d):this.#Je(T,d,l):this.#e===`scatter`?D=this.#ut(T,d,l):this.#Xe(T,d,l),T.restore(),E!=null){T.save(),T.globalCompositeOperation=`destination-out`;let e=T.createLinearGradient(c.left,0,c.left+w,0);e.addColorStop(0,`rgba(0, 0, 0, ${_.alpha})`),e.addColorStop(1,`rgba(0, 0, 0, 0)`),T.fillStyle=e,T.fillRect(c.left,c.top,w,c.height+1),T.restore(),t.drawImage(E.canvas,0,0,this.#u,this.#d)}D!=null&&lt(t,{textColor:n.chrome.tickText,fontFamily:n.fontFamily,plot:c,center:D.center,axes:D.axes}),this.#e===`bar`&&this.#m>0&&(v?We(t,{plot:c,color:n.chrome.baseline,x:x(0)}):Ue(t,{plot:c,color:n.chrome.baseline,y:x(0)}));for(let e of f?[]:s.referenceLines){let r=x(e.y);if(v?r<c.left||r>c.left+c.width:r<c.top||r>c.top+c.height)continue;let i=e.color==null?n.chrome.reference:this.#Ne(e.color);v?dt(t,{plot:c,color:i,textColor:n.chrome.tickText,x:r,label:e.label,fontFamily:n.fontFamily}):ut(t,{plot:c,color:i,textColor:n.chrome.tickText,y:r,label:e.label,fontFamily:n.fontFamily})}let O=s.xAxis==null||f?[]:[...this.#N.entries()].map(([e,t])=>({position:b(e),text:t.text,alpha:t.alpha})),k=s.yAxis==null||f?[]:[...this.#P.entries()].map(([e,t])=>({position:x(e),text:t.text,alpha:t.alpha})),A=v?k:O,j=v?O:k;return(A.length>0||j.length>0)&&ft(t,{plot:c,color:n.chrome.tickText,fontFamily:n.fontFamily,xLabels:A,yLabels:j}),g}#He(e,t){e.font=`11px ${t}`;let n=this.#we(),r=this.#Le(),i=[],a=-1/0;for(let t of this.#Be()){let o=t.index!=null&&this.#W!=null,s=o&&this.#W!=null?X(this.#W,t.index??0):t.value*r.k+r.b,c=n?15/2:e.measureText(t.text).width/2,l=n?2:8;s-c<a+l||(a=s+c,i.push({key:o?t.index??0:t.value,text:t.text}))}return i}#Ue(e,t){let n=this.#ze();if(!this.#we())return n.map(e=>({key:e.value,text:e.text}));e.font=`11px ${t}`;let r=this.#Ie(),i=[],a=-1/0;for(let t of n){let n=t.value*r.k+r.b,o=e.measureText(t.text).width/2;n-o<a+8||(a=n+o,i.push({key:t.value,text:t.text}))}return i}#We(e,t,n){let r=t===`value`?e.dataKey:`${e.dataKey}:${t}`;if(!this.#I&&this.#m<=2500){let e=this.#k.get(r);if(e!=null&&e.values().length===this.#m)return e.values()}return t===`value`?this.#x.get(e.dataKey)??new Float64Array:(t===`lower`?this.#E?.lower:this.#E?.upper)?.[n]??new Float64Array}#Ge(e){return this.#A.get(e)?.values()[0]??1}#Ke(e,t){if(e==null)return 0;let n=e[t]??0;return Number.isNaN(n)?0:n}#qe(e,t,n){let r=this.#E;if(r==null)return!0;let i=r.lower[e]?.[t]??NaN,a=r.upper[e]?.[t]??NaN;if(Number.isNaN(i)||Number.isNaN(a))return!1;let o=i<0,s=(o?r.negativeEnd:r.positiveEnd)[t]??-1;if(s<0)return!1;let c=(o?r.lower:r.upper)[s]?.[t]??NaN;return P({lower:i,upper:a,pileOuter:c,toPixel:n})}#Je(e,t,n){let r=this.#W,i=this.#H;if(r==null||i==null||this.#m===0||t.length===0)return;let a=this.#E!=null,o=a?1:t.length,s=r.bandwidth>=8*o?2:+(r.bandwidth>=3*o),c=(r.bandwidth-s*(o-1))/o,l=A({step:r.step,slot:c}),u=e=>e*n.k+n.b;t.forEach((t,n)=>{let d=this.#Ge(t.dataKey),f=[],p=a?this.#We(t,`lower`,n):null,m=a?this.#We(t,`upper`,n):this.#We(t,`value`,n);for(let e=0;e<this.#m;e++){let t=m[e]??NaN;if(Number.isNaN(t))continue;let i=this.#Ke(p,e),h=a?Y(r,e)+(r.bandwidth-l)/2:Y(r,e)+(r.bandwidth-(c*o+s*(o-1)))/2+n*(c+s)+(c-l)/2,g=N({lower:i,upper:t,toPixel:u,reveal:d,gap:a?s:0});f.push({x:h,width:l,baselineY:g.baseline,valueY:g.value,rounded:this.#qe(n,e,u)})}Ge(e,{fill:i.barTextures.get(t.dataKey)??i.series.get(t.dataKey)??`currentColor`,rects:f})})}#Ye(e,t){let n=this.#W,r=this.#H;if(n==null||r==null||this.#m===0||t.length===0)return;let i=this.#Ie(),a=this.#E!=null,o=a?1:t.length,s=n.bandwidth>=8*o?2:+(n.bandwidth>=3*o),c=(n.bandwidth-s*(o-1))/o,l=A({step:n.step,slot:c}),u=e=>e*i.k+i.b;t.forEach((t,i)=>{let d=this.#Ge(t.dataKey),f=[],p=a?this.#We(t,`lower`,i):null,m=a?this.#We(t,`upper`,i):this.#We(t,`value`,i);for(let e=0;e<this.#m;e++){let t=m[e]??NaN;if(Number.isNaN(t))continue;let r=this.#Ke(p,e),h=a?Y(n,e)+(n.bandwidth-l)/2:Y(n,e)+(n.bandwidth-(c*o+s*(o-1)))/2+i*(c+s)+(c-l)/2,g=N({lower:r,upper:t,toPixel:u,reveal:d,gap:a?s:0});f.push({y:h,height:l,baselineX:g.baseline,valueX:g.value,rounded:this.#qe(i,e,u)})}Ke(e,{fill:r.barTextures.get(t.dataKey)??r.series.get(t.dataKey)??`currentColor`,rects:f})})}#Xe(e,t,n){let r=this.#H;if(r==null||this.#m===0)return;let i=this.#Le(),a=this.#W,o=e=>a==null?(this.#h[e]??0)*i.k+i.b:X(a,e);t.forEach((t,i)=>{let a=r.series.get(t.dataKey)??`currentColor`,s=this.#Ge(t.dataKey);if(e.save(),s<1&&(e.beginPath(),e.rect(this.#U.left,0,this.#U.width*s,this.#d),e.clip()),this.#I){this.#Ze(e,t,i,a,n),e.restore();return}let c=t.mark===`area`,l=this.#We(t,this.#E==null?`value`:`upper`,i),u=this.#E==null?null:this.#We(t,`lower`,i),d=e=>!Number.isNaN(l[e]??NaN),f=[];for(let e=0;e<this.#m;e++)(!t.connectNulls||d(e))&&f.push(e);let 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;Je(e,{color:a,curve:t.curve,indexes:f,xAt:o,y0At:r,y1At:p,definedAt:d})}else qe(e,{color:a,curve:t.curve,indexes:f,xAt:o,yAt:p,definedAt:d}),t.markers&&this.#U.width/this.#m>=12&&rt(e,{color:a,surface:r.chrome.surface,shape:this.#n.seriesShape(t.dataKey),indexes:f,xAt:o,yAt:p,definedAt:d});e.restore()})}#Ze(e,t,n,r,i){let a=Math.max(1,Math.round(this.#U.width*this.#f)),o=e=>this.#U.left+(e+.5)/this.#f;if(t.mark===`area`){let s=this.#Qe(`${t.dataKey}:upper`,this.#We(t,this.#E==null?`value`:`upper`,n),a),c=this.#E==null?null:this.#Qe(`${t.dataKey}:lower`,this.#We(t,`lower`,n),a);c==null?Xe(e,{color:r,lowerColumns:Dt(s,0),upperColumns:s,columnToX:o,valueK:i.k,valueB:i.b}):Xe(e,{color:r,lowerColumns:c,upperColumns:s,columnToX:o,valueK:i.k,valueB:i.b});return}let s=this.#Qe(t.dataKey,this.#We(t,`value`,n),a);Ye(e,{color:r,columns:s,columnToX:o,valueK:i.k,valueB:i.b})}#Qe(e,t,n){let r=this.#O.values(),i=`${r[0]??0}:${r[1]??1}:${n}`,a=this.#L.get(e);if(a!=null&&a.key===i)return a.columns;let o=[r[0]??0,r[1]??1],s=je(o,[0,n]),c=de({xs:this.#h,values:t,startIndex:0,endIndex:this.#m-1,positionK:s.k,positionB:s.b,columnCount:n});return this.#L.set(e,{key:i,columns:c}),c}#$e(){if(this.#m===0)return null;let e;return e=this.#ae===void 0?this.#ie:this.#ae==null?null:this.#tt(this.#ae),e==null?null:Math.min(Math.max(0,e),this.#m-1)}#et(e){return this.#_==null?e:this.#_[e]??e}#tt(e){if(this.#p.length===0)return null;let t=Math.min(Math.max(0,e),this.#p.length-1);if(this.#v==null)return t;let n=this.#v[t]??-1;return n===-1?null:n}#nt(e){if(e<0||e>=this.#m)return``;let{xScale:t}=this.#r;if(t===`band`||t===`point`)return this.#g[e]??``;let n=this.#h[e]??0;return t===`time`?new Date(n):n}#rt(e,t){if(this.#m===0)return null;let n=this.#W;if(n!=null)return Pe(n,this.#we()?t:e);let{k:r,b:i}=this.#Le();if(r===0)return 0;let a=e;if(this.#I){let t=Math.floor((e-this.#U.left)*this.#f);a=this.#U.left+(t+.5)/this.#f}return ye(this.#h,this.#m,(a-i)/r)}#it(e,t,n){let r=this.#n.seriesSpecs(),i=this.#we(),a=this.#W;if(this.#e===`bar`&&this.#E==null&&a!=null&&r.length>1){let o=(i?n:t)-Y(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.#Ie():this.#Fe(),c=i?t:n,l=this.#E;if(this.#e===`bar`&&l!=null)for(let t=0;t<r.length;t++){let n=l.lower[t]?.[e]??NaN,i=l.upper[t]?.[e]??NaN;if(Number.isNaN(n)||Number.isNaN(i)||n===i)continue;let a=n*o+s,u=i*o+s;if(c>=Math.min(a,u)&&c<=Math.max(a,u))return r[t]?.dataKey??null}let u=null,d=1/0;return r.forEach((t,n)=>{let r=(this.#E==null?this.#x.get(t.dataKey):this.#E.upper[n])?.[e]??NaN;if(Number.isNaN(r))return;let i=Math.abs(r*o+s-c);i<d&&(d=i,u=t.dataKey)}),u}#at(e,t){let n=e==null||this.#m===0?null:Math.min(Math.max(0,e),this.#m-1),r=this.#ae!==void 0;if(t.notify&&n!==this.#$e()){let e=n==null?null:this.#et(n);if(this.#i.onActiveIndexChange?.(e),r){this.#oe={index:e,viaKeyboard:t.viaKeyboard};return}}this.#se=t.viaKeyboard,r||(this.#ie=n),this.#lt(),this.#Oe()}#ot=null;#st=!1;#ct=null;#lt(e={force:!1}){let t=this.#$e();if(!e.force&&t===this.#ot&&this.#se===this.#st&&this.#re===this.#ct)return;if(this.#ot=t,this.#st=this.#se,this.#ct=this.#re,t==null||this.#m===0){this.#n.publishHover(null);return}let n=this.#et(t),r=this.#p[n]??{},i=this.#n.getSnapshot().series.map(e=>{let n=this.#x.get(e.dataKey)?.[t]??NaN;return{dataKey:e.dataKey,label:e.label,value:Number.isNaN(n)?null:n,color:e.color}});this.#r.stacked&&i.reverse(),this.#e===`scatter`&&(i=this.#re==null?i.filter(e=>e.value!=null):i.filter(e=>e.dataKey===this.#re));let a={index:n,xValue:this.#nt(t),datum:r,points:i,viaKeyboard:this.#se};if(this.#Ce()){let e=this.#G[t]??NaN;a.zValue=Number.isNaN(e)?null:e}this.#n.publishHover(a)}#ut(e,t,n){let r=this.#H;if(r==null||this.#m===0||t.length===0)return null;if(this.#Ce())return this.#dt(e,t);let i=this.#Le(),a=t.map((e,t)=>{let n=this.#We(e,`value`,t),r=[];for(let e=0;e<this.#m;e++)Number.isNaN(n[e]??NaN)||r.push(e);return r}),o=a.reduce((e,t)=>e+t.length,0);return t.forEach((t,s)=>{let c=this.#We(t,`value`,s),l=a[s]??[];e.save(),e.globalAlpha=this.#Ge(t.dataKey),ot(e,{color:r.series.get(t.dataKey)??`currentColor`,surface:r.chrome.surface,shape:this.#n.seriesShape(t.dataKey),totalPointCount:o,indexes:l,xAt:e=>(this.#h[e]??0)*i.k+i.b,yAt:e=>(c[e]??0)*n.k+n.b,radiusAt:()=>4}),e.restore()}),null}#dt(e,t){let n=this.#H;if(n==null)return null;let r=this.#U,i=xe(this.#q),a=r.left+r.width/2,o=r.top+r.height/2,s=this.#Y.values(),c=s[0]??1,l=s[1]??1,u=.85-.22*c-.11*l,d=Math.min(r.width,r.height)/2*u,f=this.#O.values(),p=[f[0]??0,f[1]??1],m=this.#D.values(),h=[m[0]??0,m[1]??1],g=this.#K,_=t.map(e=>this.#Ge(e.dataKey)),v=this.#Y.values(),y=v[0]??1,b=v[1]??1,x=(e,t,n)=>{let r=Se(e,t,n,i);return{x:a+r.x*d,y:o-r.y*d}},S=we.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)}];ct(e,{gridColor:n.chrome.grid,axisColor:n.chrome.baseline,corners:S,edges:Te,cubeAlpha:b,axes:T});let E=this.#m*t.length,D=this.#Q;(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.#We(e,`value`,t);for(let e=0;e<this.#m;e++){let r=n[e]??NaN,s=this.#G[e]??NaN;if(Number.isNaN(r)||Number.isNaN(s))continue;let c=Se(q(this.#h[e]??0,p),q(r,h)*y,q(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.#Q=D,this.#$.length<k&&(this.#$=new Int32Array(E));let A=this.#$.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 st(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}}#ft(e,t){let n=this.#n.seriesSpecs(),r=576,i=null;if(this.#Ce()){let a=this.#Q;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.#Le(),o=this.#Fe();for(let s of n){let n=this.#x.get(s.dataKey);if(n!=null)for(let c=0;c<this.#m;c++){let l=n[c]??NaN;if(Number.isNaN(l))continue;let u=(this.#h[c]??0)*a.k+a.b,d=l*o.k+o.b,f=u-e,p=d-t,m=f*f+p*p;m<r&&(r=m,i={seriesKey:s.dataKey,index:c,screenX:u,screenY:d})}}return i}#pt(e){let t=this.#n.seriesSpecs();if(this.#Ce()){let t=this.#Q;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.#Le(),r=this.#Fe();for(let i of t){let t=this.#x.get(i.dataKey)?.[e]??NaN;if(!Number.isNaN(t))return{x:(this.#h[e]??0)*n.k+n.b,y:t*r.k+r.b}}return null}#mt(){let{crosshair:e,band:t,markers:n,tooltip:r}=this.#t,i=this.#$e(),a=i!=null&&this.#m>0,o=this.#e===`bar`,s=this.#e===`scatter`;if(e.style.opacity=a&&!o&&!s?`1`:`0`,t.style.opacity=a&&o?`1`:`0`,n.style.opacity=a&&!o?`1`:`0`,r.style.opacity=a?`1`:`0`,!a)return;let c=this.#U;if(s){let e=this.#ne??this.#pt(i);if(e==null){n.style.opacity=`0`,r.style.opacity=`0`;return}for(;n.children.length>1;)n.lastElementChild?.remove();n.children.length===0&&n.appendChild(wt(n.ownerDocument));let t=n.children[0];if(t instanceof HTMLElement){let n=this.#n.getSnapshot().series,r=this.#re==null?n.find(e=>{let t=this.#x.get(e.dataKey)?.[i]??NaN;return!Number.isNaN(t)}):n.find(e=>e.dataKey===this.#re);t.style.opacity=`1`,Tt(t,r?.shape??`circle`,r?.color??`currentColor`),t.style.transform=`translate3d(${e.x}px, ${e.y}px, 0)`}this.#ht(e.x,e.y);return}let l=this.#Re(i),u=this.#we();if(o){let e=this.#W;if(e!=null){let n=Ne(e,i),r=Math.max(1,n.size),a=n.start-(r-n.size)/2;u?(t.style.transform=`translate3d(${c.left}px, ${a}px, 0)`,t.style.width=`${c.width}px`,t.style.height=`${r}px`):(t.style.transform=`translate3d(${a}px, ${c.top}px, 0)`,t.style.width=`${r}px`,t.style.height=`${c.height}px`)}}else{e.style.transform=`translate3d(${l}px, ${c.top}px, 0)`,e.style.height=`${c.height}px`;let t=this.#n.getSnapshot().series;for(;n.children.length>t.length;)n.lastElementChild?.remove();for(;n.children.length<t.length;)n.appendChild(wt(n.ownerDocument));let r=this.#Fe();t.forEach((e,t)=>{let a=n.children[t];if(!(a instanceof HTMLElement))return;let o=this.#x.get(e.dataKey)?.[i]??NaN,s=this.#We(e,this.#E==null?`value`:`upper`,t)[i]??NaN;if(Number.isNaN(o)||Number.isNaN(s)){a.style.opacity=`0`;return}a.style.opacity=`1`,Tt(a,e.shape,e.color),a.style.transform=`translate3d(${l}px, ${s*r.k+r.b}px, 0)`})}o&&u&&this.#W!=null?this.#ht(this.#ce??c.left+c.width/2,X(this.#W,i)):this.#ht(l,this.#le??c.top+8)}#ht(e,t){let n=this.#U,r=this.#t.tooltip,i=this.#ue,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 xt=e=>e===3?{yaw:.65,pitch:-.35}:{yaw:0,pitch:0},St=(e,t,n,r)=>{for(let t of e.values())t.target=0;for(let n of t){let t=e.get(n.key);t==null?e.set(n.key,{alpha:+!!r,target:1,text:n.text}):(t.target=1,t.text=n.text)}let i=1-.84**(n/16.67),a=1-.88**(n/16.67),o=!1;for(let[t,n]of e){if(r)n.alpha=n.target;else{let e=n.target>n.alpha?i:a;n.alpha+=(n.target-n.alpha)*e}if(n.target===1&&n.alpha>.98&&(n.alpha=1),n.target===0&&n.alpha<.03){e.delete(t);continue}n.alpha!==n.target&&(o=!0)}return o},Ct={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%)`},wt=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},Tt=(e,t,n)=>{let r=Ct[t];e.setAttribute(`data-shape`,t);let[i,a]=e.children;i instanceof HTMLElement&&(i.style.clipPath=r),a instanceof HTMLElement&&(a.style.clipPath=r,a.style.backgroundColor=n)},Et=(e,t)=>e instanceof Date?e.getTime():typeof e==`number`?e:t&&typeof e==`string`?new Date(e).getTime():NaN,Dt=(e,t)=>({columnCount:e.columnCount,hasData:e.hasData,minValue:new Float64Array(e.columnCount).fill(t),maxValue:new Float64Array(e.columnCount).fill(t),inValue:new Float64Array(e.columnCount).fill(t),outValue:new Float64Array(e.columnCount).fill(t)}),Ot=e=>e.replaceAll(`|`,`\\|`).replaceAll(/\s*\n\s*/g,` `),kt=e=>e instanceof Date?Number.isNaN(e.getTime())?`—`:e.toISOString():typeof e==`number`?Number.isFinite(e)?String(e):`—`:typeof e==`string`?Ot(e):`—`,At=e=>typeof e==`number`&&Number.isFinite(e)?String(e):`—`,jt=e=>`| ${e.join(` | `)} |`,Mt=({data:e,xKey:t,series:n,zKey:r})=>{let i=[Ot(t),...n.map(e=>Ot(e.label)),...r==null?[]:[Ot(r)]],a=e.map(e=>[kt(k(e,t)),...n.map(t=>At(k(e,t.dataKey))),...r==null?[]:[At(k(e,r))]]);return[jt(i),jt(i.map(()=>`---`)),...a.map(e=>jt(e))].join(`
2
- `)},Nt=(e,t)=>e==null?`var(${L(t)})`:I(e)?`var(${L(e)})`:e,Pt={"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`},Ft=(e,t)=>e??Pt[t],It={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`},Lt=e=>{let t=new Set;for(let n of e)n.seriesSlot!=null&&n.seriesSlot!==`other`&&t.add(It[n.seriesSlot]);let n=new Map,r=new Set(t);for(let t of e){if(t.seriesSlot!=null){n.set(t.dataKey,It[t.seriesSlot]);continue}let e=ee.find(e=>!r.has(e))??`chart-other`;n.set(t.dataKey,e),r.add(e)}return n};var Rt=class{#e=new Set;#t={series:[],hover:null,grid:null,xAxis:null,yAxis:null,referenceLines:[],tooltip:null,orientation:`vertical`};#n=new Map;#r=new Map;#i=0;#a=null;#o=!1;#s=`vertical`;#c=null;#l=null;#u=new Map;#d=new Map;#f=null;#p=null;onSeriesChange=null;onPresentationChange=null;subscribe=e=>(this.#e.add(e),()=>{this.#e.delete(e)});getSnapshot=()=>this.#t;seriesSpecs(){return[...this.#n.values()].toSorted((e,t)=>e.sequence-t.sequence).map(e=>e.spec)}seriesShape(e){return this.#t.series.find(t=>t.dataKey===e)?.shape??Pt[`chart-other`]}registerSeries(e){let t=this.#r.get(e.dataKey)??this.#i++;return this.#r.set(e.dataKey,t),this.#n.set(e.dataKey,{spec:e,sequence:t}),this.#m({seriesChanged:!0}),()=>{this.#n.get(e.dataKey)?.spec===e&&(this.#n.delete(e.dataKey),this.#m({seriesChanged:!0}))}}setDecorative(e){this.#o!==e&&(this.#o=e,this.#m({seriesChanged:!0}))}setOrientation(e){this.#s!==e&&(this.#s=e,this.#m())}registerGrid(e){let t={lines:e};return this.#a=t,this.#m(),()=>{this.#a===t&&(this.#a=null,this.#m())}}registerXAxis(e){return this.#c=e,this.#m(),()=>{this.#c===e&&(this.#c=null,this.#m())}}registerYAxis(e){return this.#l=e,this.#m(),()=>{this.#l===e&&(this.#l=null,this.#m())}}registerReferenceLine(e,t){let n=this.#d.get(e)??this.#i++;return this.#d.set(e,n),this.#u.set(e,{spec:t,sequence:n}),this.#m(),()=>{this.#u.get(e)?.spec===t&&(this.#u.delete(e),this.#m())}}registerTooltip(e){return this.#f=e,this.#m(),()=>{this.#f===e&&(this.#f=null,this.#m())}}publishHover(e){this.#p!==e&&(this.#p=e,this.#t={...this.#t,hover:e},this.#h())}seriesMeta(){let e=this.seriesSpecs(),t=Lt(e);return e.map(e=>{let n=t.get(e.dataKey)??`chart-other`,r=this.#o?R:Nt(e.color,n),i=this.#o?R:e.color??n;return{dataKey:e.dataKey,label:e.label,mark:e.mark,color:r,colorInput:i,shape:Ft(e.shape,n),texture:e.texture}})}#m(e={seriesChanged:!1}){this.#t={series:this.seriesMeta(),hover:this.#p,grid:this.#a,xAxis:this.#c,yAxis:this.#l,referenceLines:[...this.#u.values()].toSorted((e,t)=>e.sequence-t.sequence).map(e=>e.spec),tooltip:this.#f,orientation:this.#s},this.#h(),e.seriesChanged?this.onSeriesChange?.():this.onPresentationChange?.()}#h(){for(let e of this.#e)e()}};const zt=l(null),Bt=e=>{let t=u(zt);return _(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},Vt=e=>g(e.subscribe,e.getSnapshot,e.getSnapshot),Ht=e=>{let t=c(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),g(e.subscribe,n,r)},Ut=e=>{let t=c(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),g(e.subscribe,n,r)},Wt=(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)))},Gt=e=>{let[t,n]=h(e);return Wt(t,e)?t:(n(e),e)},Kt=(e,t)=>{for(let n of e){let e=k(n,t);if(e!=null)return e instanceof Date?`time`:typeof e==`number`?`linear`:`point`}return`point`},qt=[`auto`,`auto`],Jt=t=>{let i=c(133),a,o,s,l,u,d,g,x,S,C,w,T,E,D,O,A,j,M,N,P,F,I,L,R,ee,z;i[0]===t?(a=i[1],o=i[2],s=i[3],l=i[4],u=i[5],d=i[6],g=i[7],x=i[8],S=i[9],C=i[10],w=i[11],T=i[12],E=i[13],D=i[14],O=i[15],A=i[16],j=i[17],M=i[18],N=i[19],P=i[20],F=i[21],I=i[22],L=i[23],R=i[24],ee=i[25],z=i[26]):({kind:C,componentName:g,slotName:O,data:x,xKey:R,xScale:ee,zKey:z,dimensions:A,yDomain:j,stacked:M,orientation:N,animate:P,pending:F,decorative:I,activeIndex:a,onActiveIndexChange:w,onDatumActivate:T,className:d,children:u,ref:D,"data-slot":S,"aria-label":s,"aria-labelledby":l,"aria-hidden":o,tabIndex:L,...E}=t,i[0]=t,i[1]=a,i[2]=o,i[3]=s,i[4]=l,i[5]=u,i[6]=d,i[7]=g,i[8]=x,i[9]=S,i[10]=C,i[11]=w,i[12]=T,i[13]=E,i[14]=D,i[15]=O,i[16]=A,i[17]=j,i[18]=M,i[19]=N,i[20]=P,i[21]=F,i[22]=I,i[23]=L,i[24]=R,i[25]=ee,i[26]=z);let B=A===void 0?3:A,te=j===void 0?qt:j,ne=M!==void 0&&M,re=N===void 0?`vertical`:N,ie=P===void 0||P,ae=F!==void 0&&F,V=I!==void 0&&I,[H]=h(mn),U=m(null),W;i[27]!==x||i[28]!==R||i[29]!==z?(W={data:x,xKey:R,zKey:z},i[27]=x,i[28]=R,i[29]=z,i[30]=W):W=i[30];let oe=m(W),se;i[31]!==g||i[32]!==C||i[33]!==H?(se=()=>({kind:C,componentName:g,store:H,engineRef:U,dataRef:oe}),i[31]=g,i[32]=C,i[33]=H,i[34]=se):se=i[34];let[ce]=h(se),le,ue;i[35]!==x||i[36]!==R||i[37]!==z?(le=()=>{oe.current={data:x,xKey:R,zKey:z}},ue=[x,R,z],i[35]=x,i[36]=R,i[37]=z,i[38]=le,i[39]=ue):(le=i[38],ue=i[39]),p(le,ue);let de=m(null),fe=e(de,D),pe=m(null),me=m(null),G=m(null),he=m(null),ge=m(null),_e=m(null),K=f(),ye;i[40]!==x||i[41]!==C||i[42]!==R||i[43]!==ee?(ye=C===`bar`?`band`:ee??Kt(x,R),i[40]=x,i[41]=C,i[42]=R,i[43]=ee,i[44]=ye):ye=i[44];let be=ye;_(C!==`scatter`||x.length===0||be!==`point`,`${g}.Root requires numeric or Date x values — the "${R}" values are not numbers or dates, so they have no position on a continuous scatter axis.`);let[xe,Se]=te,Ce;bb0:{for(let e of x){let t=k(e,R);if(t instanceof Date&&ve(t)){Ce=!0;break bb0}}Ce=!1}let q=Ce,we,Te;i[45]!==C||i[46]!==H?(we=()=>{let e=de.current,t=pe.current,n=me.current,r=G.current,i=he.current,a=ge.current,o=_e.current;if(e==null||t==null||n==null||r==null||i==null||a==null||o==null)return;let s=new bt({kind:C,store:H,elements:{root:e,plot:t,canvas:n,crosshair:r,band:i,markers:a,tooltip:o}});return U.current=s,()=>{U.current=null,s.destroy()}},Te=[C,H],i[45]=C,i[46]=H,i[47]=we,i[48]=Te):(we=i[47],Te=i[48]),p(we,Te);let Ee,De;i[49]!==ie||i[50]!==V||i[51]!==B||i[52]!==re||i[53]!==be||i[54]!==ne||i[55]!==H||i[56]!==R||i[57]!==Se||i[58]!==xe||i[59]!==z?(Ee=()=>{U.current?.setOptions({xKey:R,xScale:be,yDomain:[xe,Se],zKey:z??null,dimensions:B,stacked:ne,orientation:re,animate:ie}),H.setOrientation(re),H.setDecorative(V)},De=[H,V,R,be,xe,Se,z,B,ne,re,ie],i[49]=ie,i[50]=V,i[51]=B,i[52]=re,i[53]=be,i[54]=ne,i[55]=H,i[56]=R,i[57]=Se,i[58]=xe,i[59]=z,i[60]=Ee,i[61]=De):(Ee=i[60],De=i[61]),p(Ee,De);let Oe,J;i[62]===x?(Oe=i[63],J=i[64]):(Oe=()=>{U.current?.setRows(x)},J=[x],i[62]=x,i[63]=Oe,i[64]=J),p(Oe,J);let ke;i[65]!==V||i[66]!==w||i[67]!==T?(ke=()=>{U.current?.setCallbacks(V?{onDatumActivate:null,onActiveIndexChange:null}:{onDatumActivate:T??null,onActiveIndexChange:w??null})},i[65]=V,i[66]=w,i[67]=T,i[68]=ke):ke=i[68],p(ke);let Ae,je;i[69]!==a||i[70]!==V?(Ae=()=>{U.current?.setControlledActiveIndex(V?void 0:a)},je=[V,a],i[69]=a,i[70]=V,i[71]=Ae,i[72]=je):(Ae=i[71],je=i[72]),p(Ae,je);let Me;i[73]===Symbol.for(`react.memo_cache_sentinel`)?(Me=()=>{U.current?.flushIngest()},i[73]=Me):Me=i[73],p(Me);let Y;i[74]!==S||i[75]!==O?(Y=r(S,O),i[74]=S,i[75]=O,i[76]=Y):Y=i[76];let X;i[77]===d?X=i[78]:(X=n(`relative flex aspect-video w-full flex-col`,d),i[77]=d,i[78]=X);let Ne=V?!0:o,Pe=V?void 0:L,Fe=V?!0:void 0,Ie=`${O}-plot`,Le=ae&&`opacity-60 transition-opacity duration-300`,Re;i[79]===Le?Re=i[80]:(Re=n(`relative min-h-0 w-full flex-1`,Le),i[79]=Le,i[80]=Re);let ze=`${O}-canvas`,Be;i[81]===ze?Be=i[82]:(Be=y(`canvas`,{"data-slot":ze,ref:me,"aria-hidden":!0,className:`absolute inset-0 size-full`}),i[81]=ze,i[82]=Be);let Z;i[83]!==s||i[84]!==l||i[85]!==V||i[86]!==K||i[87]!==C||i[88]!==z?(Z=V?null:b(v,{children:[y(`div`,{role:`application`,"aria-label":s,"aria-labelledby":l,"aria-describedby":K,tabIndex:0,className:n(`focus-visible:ring-focus-accent absolute inset-0 rounded-sm outline-none focus-visible:ring-2`,(C===`line`||C===`area`)&&`cursor-crosshair`,C===`scatter`&&z!=null&&`touch-none cursor-grab active:cursor-grabbing`),onPointerDown:e=>{e.isTrusted&&C===`scatter`&&z!=null&&e.currentTarget.setPointerCapture(e.pointerId),U.current?.handlePointerDown(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerMove:e=>{U.current?.handlePointerMove(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerUp:e=>{U.current?.handlePointerUp(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerLeave:()=>{U.current?.handlePointerLeave()},onPointerCancel:()=>{U.current?.handlePointerLeave()},onBlur:()=>{U.current?.handlePointerLeave()},onKeyDown:e=>{U.current?.handleKeyDown(e.key)&&e.preventDefault()}}),y(`span`,{id:K,className:`sr-only`,children:`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.`})]}),i[83]=s,i[84]=l,i[85]=V,i[86]=K,i[87]=C,i[88]=z,i[89]=Z):Z=i[89];let Ve=`${O}-crosshair`,Q;i[90]===Ve?Q=i[91]:(Q=y(`div`,{"data-slot":Ve,ref:G,"aria-hidden":!0,className:`bg-neutral-500 pointer-events-none absolute left-0 top-0 w-px opacity-0`}),i[90]=Ve,i[91]=Q);let $=`${O}-hover-band`,He;i[92]===$?He=i[93]:(He=y(`div`,{"data-slot":$,ref:he,"aria-hidden":!0,className:`bg-neutral-500/10 pointer-events-none absolute left-0 top-0 rounded-sm opacity-0`}),i[92]=$,i[93]=He);let Ue=`${O}-markers`,We;i[94]===Ue?We=i[95]:(We=y(`div`,{"data-slot":Ue,ref:ge,"aria-hidden":!0,className:`pointer-events-none absolute inset-0 opacity-0`}),i[94]=Ue,i[95]=We);let Ge;i[96]!==O||i[97]!==H||i[98]!==q?(Ge=y(nn,{slotName:O,store:H,tooltipRef:_e,xHasTimeOfDay:q}),i[96]=O,i[97]=H,i[98]=q,i[99]=Ge):Ge=i[99];let Ke;i[100]!==Ie||i[101]!==Re||i[102]!==Be||i[103]!==Z||i[104]!==Q||i[105]!==He||i[106]!==We||i[107]!==Ge?(Ke=b(`div`,{"data-slot":Ie,className:Re,ref:pe,children:[Be,Z,Q,He,We,Ge]}),i[100]=Ie,i[101]=Re,i[102]=Be,i[103]=Z,i[104]=Q,i[105]=He,i[106]=We,i[107]=Ge,i[108]=Ke):Ke=i[108];let qe;i[109]!==s||i[110]!==l||i[111]!==x||i[112]!==V||i[113]!==O||i[114]!==H||i[115]!==q||i[116]!==R||i[117]!==z?(qe=V?null:b(v,{children:[y(dn,{store:H,xHasTimeOfDay:q}),y(pn,{data:x,label:s,labelledBy:l,slotName:O,store:H,xHasTimeOfDay:q,xKey:R,zKey:z})]}),i[109]=s,i[110]=l,i[111]=x,i[112]=V,i[113]=O,i[114]=H,i[115]=q,i[116]=R,i[117]=z,i[118]=qe):qe=i[118];let Je;i[119]!==u||i[120]!==ce||i[121]!==Ke||i[122]!==qe?(Je=b(zt.Provider,{value:ce,children:[Ke,u,qe]}),i[119]=u,i[120]=ce,i[121]=Ke,i[122]=qe,i[123]=Je):Je=i[123];let Ye;return i[124]!==fe||i[125]!==E||i[126]!==Y||i[127]!==X||i[128]!==Ne||i[129]!==Pe||i[130]!==Fe||i[131]!==Je?(Ye=y(`div`,{"data-slot":Y,className:X,"aria-hidden":Ne,tabIndex:Pe,inert:Fe,ref:fe,...E,children:Je}),i[124]=fe,i[125]=E,i[126]=Y,i[127]=X,i[128]=Ne,i[129]=Pe,i[130]=Fe,i[131]=Je,i[132]=Ye):Ye=i[132],Ye},Yt=(e,t,n)=>{let r=c(13),i=Bt(e);_(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:l,curve:u,markers:d,connectNulls:f,shape:m,texture:h}=n,g=u===void 0?`linear`:u,v=d!==void 0&&d,y=f!==void 0&&f,b=h===void 0?`solid`:h,x,S;return r[0]!==l||r[1]!==y||r[2]!==i.store||r[3]!==g||r[4]!==a||r[5]!==o||r[6]!==t||r[7]!==v||r[8]!==s||r[9]!==m||r[10]!==b?(x=()=>i.store.registerSeries({dataKey:a,label:o??a,seriesSlot:s,color:l,mark:t,curve:g,markers:v,connectNulls:y,shape:m,texture:b}),S=[i.store,a,o,s,l,t,g,v,y,m,b],r[0]=l,r[1]=y,r[2]=i.store,r[3]=g,r[4]=a,r[5]=o,r[6]=t,r[7]=v,r[8]=s,r[9]=m,r[10]=b,r[11]=x,r[12]=S):(x=r[11],S=r[12]),p(x,S),null},Xt=(e,t)=>{let n=c(4),r=Bt(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]),p(a,o),null},Zt=(e,t)=>{let n=c(5),r=Bt(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]),p(o,s),null},Qt=(e,t)=>{let n=c(5),r=Bt(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]),p(o,s),null},$t=(e,t)=>{let n=c(7),r=Bt(e),i=f(),{y:a,label:o,color:s}=t,l,u;return n[0]!==s||n[1]!==r.store||n[2]!==i||n[3]!==o||n[4]!==a?(l=()=>r.store.registerReferenceLine(i,{y:a,label:o,color:s}),u=[r.store,i,a,o,s],n[0]=s,n[1]=r.store,n[2]=i,n[3]=o,n[4]=a,n[5]=l,n[6]=u):(l=n[5],u=n[6]),p(l,u),null},en=(e,t)=>{let n=c(16),r=Bt(e),i,a,o,s,l,u;n[0]===t?(i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],u=n[6]):({labelFormat:s,valueFormat:u,indicator:l,footer:o,children:i,...a}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=o,n[4]=s,n[5]=l,n[6]=u);let d=l===void 0?`line`:l,f=Gt(a),m,h;return n[7]!==i||n[8]!==r.store||n[9]!==o||n[10]!==d||n[11]!==s||n[12]!==f||n[13]!==u?(m=()=>r.store.registerTooltip({labelFormat:s,valueFormat:u,indicator:d,footer:o,children:i,divProps:f}),h=[r.store,s,u,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]=u,n[14]=m,n[15]=h):(m=n[14],h=n[15]),p(m,h),null},tn=(e,t,n)=>e==null?`—`:n==null?G(e):n(e,t),nn=r=>{let i=c(26),{slotName:a,store:o,tooltipRef:s,xHasTimeOfDay:l}=r,u=Vt(o),d=u.tooltip,f=u.hover,h;i[0]===d?.divProps?h=i[1]:(h=d?.divProps??{},i[0]=d?.divProps,i[1]=h);let g,_,x,S;i[2]===h?(g=i[3],_=i[4],x=i[5],S=i[6]):({className:g,ref:_,style:S,...x}=h,i[2]=h,i[3]=g,i[4]=_,i[5]=x,i[6]=S);let C=m(null),w=e(s,C),T,E;i[7]===_?(T=i[8],E=i[9]):(T=()=>{if(_==null)return;let e=t(_),n=e(C.current);return()=>{typeof n==`function`?n():e(null)}},E=[_],i[7]=_,i[8]=T,i[9]=E),p(T,E);let D=d?.footer,O=`${a}-tooltip`,k;i[10]===g?k=i[11]:(k=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`,g),i[10]=g,i[11]=k);let A;i[12]===S?A=i[13]:(A={opacity:0,...S},i[12]=S,i[13]=A);let j=A,M;i[14]!==d||i[15]!==D||i[16]!==f||i[17]!==l?(M=f==null?null:d?.children==null?b(v,{children:[y(`div`,{className:`text-muted font-medium`,children:d?.labelFormat==null?K(f.xValue,{datasetHasTimeOfDay:l}):d.labelFormat(f.xValue)}),y(`div`,{className:`mt-1 grid gap-1`,children:f.points.map(e=>b(`div`,{className:`flex items-center gap-1.5`,children:[d?.indicator===`none`?null:y(`span`,{"aria-hidden":!0,className:`h-2.5 w-0.5 shrink-0 rounded-full`,style:{backgroundColor:e.color}}),y(`span`,{className:`text-muted`,children:e.label}),y(`span`,{className:`text-strong ml-auto pl-3 font-medium tabular-nums`,children:tn(e.value,e.dataKey,d?.valueFormat)})]},e.dataKey))}),f.zValue===void 0?null:b(`div`,{className:`mt-1 flex items-center gap-1.5`,children:[y(`span`,{className:`text-muted`,children:`z`}),y(`span`,{className:`text-strong ml-auto pl-3 font-medium tabular-nums`,children:f.zValue==null?`—`:G(f.zValue)})]}),D==null?null:y(`div`,{className:`text-muted mt-1`,children:typeof D==`function`?D(f):D})]}):d.children(f),i[14]=d,i[15]=D,i[16]=f,i[17]=l,i[18]=M):M=i[18];let N;return i[19]!==w||i[20]!==x||i[21]!==O||i[22]!==k||i[23]!==j||i[24]!==M?(N=y(`div`,{"data-slot":O,ref:w,className:k,style:j,...x,children:M}),i[19]=w,i[20]=x,i[21]=O,i[22]=k,i[23]=j,i[24]=M,i[25]=N):N=i[25],N},rn=(e,t,n=3)=>`repeating-linear-gradient(${e}, ${t} 0, ${t} 1px, transparent 1px, transparent ${n}px)`,an=`forced-color-adjust-none [print-color-adjust:exact] [-webkit-print-color-adjust:exact]`,on={hatch:({ink:e})=>({backgroundImage:rn(`135deg`,e)}),"hatch-reverse":({ink:e})=>({backgroundImage:rn(`45deg`,e)}),crosshatch:({ink:e})=>({backgroundImage:`${rn(`135deg`,e,4)}, ${rn(`45deg`,e,4)}`}),perpendicular:({ink:e,orientation:t})=>({backgroundImage:rn(t===`horizontal`?`90deg`:`0deg`,e)}),parallel:({ink:e,orientation:t})=>({backgroundImage:rn(t===`horizontal`?`0deg`:`90deg`,e)}),grid:({ink:e})=>({backgroundImage:`${rn(`0deg`,e,4)}, ${rn(`90deg`,e,4)}`}),dots:({ink:e})=>({backgroundImage:`radial-gradient(circle at 1px 1px, ${e} 0.75px, transparent 0.8px)`,backgroundSize:`3px 3px`})},sn=(e,t,n)=>e===`solid`?{}:on[e]({ink:U(t),orientation:n}),cn=e=>{let t=c(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]`,an),t[0]=a):a=t[0];let o=r.color,s;t[1]!==i||t[2]!==r.color||t[3]!==r.texture?(s=sn(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=y(`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`,an),t[11]=e):e=t[11];let i;t[12]===r.color?i=t[13]:(i=y(`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`,an),t[14]=o):o=t[14];let s=Ct[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=y(`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=b(`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`,an),t[24]=o):o=t[24];let s=Ct[r.shape],l;t[25]!==r.color||t[26]!==s?(l={backgroundColor:r.color,clipPath:s},t[25]=r.color,t[26]=s,t[27]=l):l=t[27];let u;return t[28]!==r.shape||t[29]!==l?(u=y(`span`,{"aria-hidden":!0,"data-shape":a,className:o,style:l}),t[28]=r.shape,t[29]=l,t[30]=u):u=t[30],u},ln=e=>{let t=c(17),r,i,a,o,s;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4],s=t[5]):({partName:a,slotName:s,className:i,children:r,...o}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s);let l=Bt(a),u=Ht(l.store),d=Ut(l.store);if(u.length<2)return null;let f=`${s}-legend`,p;t[6]===i?p=t[7]:(p=n(`text-muted flex flex-wrap items-center gap-x-4 gap-y-1 pt-3 text-xs`,i),t[6]=i,t[7]=p);let m;t[8]!==r||t[9]!==d||t[10]!==u?(m=r==null?u.map(e=>b(`div`,{className:`flex items-center gap-1.5`,children:[y(cn,{series:e,orientation:d}),e.label]},e.dataKey)):r(u),t[8]=r,t[9]=d,t[10]=u,t[11]=m):m=t[11];let h;return t[12]!==o||t[13]!==f||t[14]!==p||t[15]!==m?(h=y(`div`,{"data-slot":f,className:p,...o,children:m}),t[12]=o,t[13]=f,t[14]=p,t[15]=m,t[16]=h):h=t[16],h},un=e=>{let t=c(31),n,r,l,u,f,p,g,_;t[0]===e?(n=t[1],r=t[2],l=t[3],u=t[4],f=t[5],p=t[6],g=t[7],_=t[8]):({partName:u,slotName:g,label:_,onCopy:r,onCopyError:l,onClick:n,ref:p,...f}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=l,t[4]=u,t[5]=f,t[6]=p,t[7]=g,t[8]=_);let C=_===void 0?`Copy data as Markdown`:_,w=Bt(u),T=a(),[E,D]=h(``),O=E!==``,k=m(!1),A=m(void 0),j,M;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>()=>{A.current!=null&&clearTimeout(A.current)},M=[],t[9]=j,t[10]=M):(j=t[9],M=t[10]),d(j,M);let N=`${g}-copy-button`,P;t[11]===O?P=t[12]:(P=y(O?x:S,{}),t[11]=O,t[12]=P);let F;t[13]!==w||t[14]!==T||t[15]!==n||t[16]!==r||t[17]!==l?(F=async e=>{try{if(n?.(e),e.defaultPrevented){A.current!=null&&(clearTimeout(A.current),A.current=void 0),D(``);return}let{data:t,xKey:i,zKey:a}=w.dataRef.current,s=Mt({data:t,xKey:i,zKey:a,series:w.store.getSnapshot().series});await T(s),r?.(s),D(o(`Copied`,k)),A.current!=null&&clearTimeout(A.current),A.current=setTimeout(()=>{D(``)},2e3)}catch(e){l?.(e)}},t[13]=w,t[14]=T,t[15]=n,t[16]=r,t[17]=l,t[18]=F):F=t[18];let I;t[19]!==C||t[20]!==f||t[21]!==p||t[22]!==N||t[23]!==P||t[24]!==F?(I=y(i,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,"data-slot":N,label:C,icon:P,ref:p,onClick:F,...f}),t[19]=C,t[20]=f,t[21]=p,t[22]=N,t[23]=P,t[24]=F,t[25]=I):I=t[25];let L;t[26]===E?L=t[27]:(L=y(s,{children:E}),t[26]=E,t[27]=L);let R;return t[28]!==I||t[29]!==L?(R=b(v,{children:[I,L]}),t[28]=I,t[29]=L,t[30]=R):R=t[30],R},dn=e=>{let t=c(6),{store:n,xHasTimeOfDay:r}=e,i=Vt(n),[a,o]=h(``),s=i.hover,l,u;t[0]!==s||t[1]!==r?(l=()=>{if(s==null||!s.viaKeyboard){o(``);return}let e=s.points.map(hn).join(`, `),t=s.zValue===void 0?``:`, z: ${s.zValue==null?`no data`:G(s.zValue)}`,n=setTimeout(()=>{o(`${K(s.xValue,{datasetHasTimeOfDay:r})}. ${e}${t}`)},120);return()=>clearTimeout(n)},u=[s,r],t[0]=s,t[1]=r,t[2]=l,t[3]=u):(l=t[2],u=t[3]),d(l,u);let f;return t[4]===a?f=t[5]:(f=y(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:a}),t[4]=a,t[5]=f),f},fn=(e,t)=>{let n=c(3),[r,i]=h(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(gn).filter(Boolean).join(` `);i(e||void 0)},o=[t],n[0]=t,n[1]=a,n[2]=o),d(a,o),e??r},pn=e=>{let t=c(39),{data:n,label:r,labelledBy:i,slotName:a,store:o,xHasTimeOfDay:s,xKey:l,zKey:u}=e,d=Ht(o),f=fn(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]!==l||t[6]!==u){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=y(`caption`,{children:r}),t[12]=r,t[13]=m);let i;t[14]===l?i=t[15]:(i=y(`th`,{scope:`col`,children:l}),t[14]=l,t[15]=i);let o;t[16]===d?o=t[17]:(o=d.map(_n),t[16]=d,t[17]=o);let c;t[18]===u?c=t[19]:(c=u==null?null:y(`th`,{scope:`col`,children:u}),t[18]=u,t[19]=c),t[20]!==i||t[21]!==o||t[22]!==c?(h=y(`thead`,{children:b(`tr`,{children:[i,o,c]})}),t[20]=i,t[21]=o,t[22]=c,t[23]=h):h=t[23];let v;t[24]!==d||t[25]!==s||t[26]!==l||t[27]!==u?(v=(e,t)=>{let n=k(e,l),r=n instanceof Date&&!Number.isNaN(n.getTime()),i=typeof n==`string`||typeof n==`number`||n instanceof Date?K(n,{datasetHasTimeOfDay:s}):String(n);return b(`tr`,{children:[y(`th`,{scope:`row`,"data-value":typeof n==`number`&&Number.isFinite(n)?n:void 0,children:r?y(`time`,{dateTime:n.toISOString(),children:i}):i}),d.map(t=>{let n=k(e,t.dataKey),r=typeof n==`number`&&Number.isFinite(n);return y(`td`,{"data-value":r?n:void 0,children:r?G(n):`—`},t.dataKey)}),u==null?null:(()=>{let t=k(e,u),n=typeof t==`number`&&Number.isFinite(t);return y(`td`,{"data-value":n?t:void 0,children:n?G(t):`—`})})()]},t)},t[24]=d,t[25]=s,t[26]=l,t[27]=u,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]=l,t[6]=u,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=y(`tbody`,{children:p}),t[29]=p,t[30]=v);let x;t[31]!==m||t[32]!==h||t[33]!==v?(x=b(`table`,{children:[m,h,v]}),t[31]=m,t[32]=h,t[33]=v,t[34]=x):x=t[34];let S;return t[35]!==g||t[36]!==_||t[37]!==x?(S=y(`div`,{className:g,"data-slot":_,children:x}),t[35]=g,t[36]=_,t[37]=x,t[38]=S):S=t[38],S};function mn(){return new Rt}function hn(e){return`${e.label}: ${e.value==null?`no data`:G(e.value)}`}function gn(e){return document.getElementById(e)?.textContent?.trim()??``}function _n(e){return y(`th`,{scope:`col`,children:e.label},e.dataKey)}export{$t as a,Zt as c,Xt as i,Qt as l,ln as n,Yt as o,Jt as r,en as s,un as t};
2
+ `)},Nt=(e,t)=>e==null?`var(${L(t)})`:I(e)?`var(${L(e)})`:e,Pt={"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`},Ft=(e,t)=>e??Pt[t],It={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`},Lt=e=>{let t=new Set;for(let n of e)n.seriesSlot!=null&&n.seriesSlot!==`other`&&t.add(It[n.seriesSlot]);let n=new Map,r=new Set(t);for(let t of e){if(t.seriesSlot!=null){n.set(t.dataKey,It[t.seriesSlot]);continue}let e=ee.find(e=>!r.has(e))??`chart-other`;n.set(t.dataKey,e),r.add(e)}return n};var Rt=class{#e=new Set;#t={series:[],hover:null,grid:null,xAxis:null,yAxis:null,referenceLines:[],tooltip:null,orientation:`vertical`};#n=new Map;#r=new Map;#i=0;#a=null;#o=!1;#s=`vertical`;#c=null;#l=null;#u=new Map;#d=new Map;#f=null;#p=null;onSeriesChange=null;onPresentationChange=null;subscribe=e=>(this.#e.add(e),()=>{this.#e.delete(e)});getSnapshot=()=>this.#t;seriesSpecs(){return[...this.#n.values()].toSorted((e,t)=>e.sequence-t.sequence).map(e=>e.spec)}seriesShape(e){return this.#t.series.find(t=>t.dataKey===e)?.shape??Pt[`chart-other`]}registerSeries(e){let t=this.#r.get(e.dataKey)??this.#i++;return this.#r.set(e.dataKey,t),this.#n.set(e.dataKey,{spec:e,sequence:t}),this.#m({seriesChanged:!0}),()=>{this.#n.get(e.dataKey)?.spec===e&&(this.#n.delete(e.dataKey),this.#m({seriesChanged:!0}))}}setDecorative(e){this.#o!==e&&(this.#o=e,this.#m({seriesChanged:!0}))}setOrientation(e){this.#s!==e&&(this.#s=e,this.#m())}registerGrid(e){let t={lines:e};return this.#a=t,this.#m(),()=>{this.#a===t&&(this.#a=null,this.#m())}}registerXAxis(e){return this.#c=e,this.#m(),()=>{this.#c===e&&(this.#c=null,this.#m())}}registerYAxis(e){return this.#l=e,this.#m(),()=>{this.#l===e&&(this.#l=null,this.#m())}}registerReferenceLine(e,t){let n=this.#d.get(e)??this.#i++;return this.#d.set(e,n),this.#u.set(e,{spec:t,sequence:n}),this.#m(),()=>{this.#u.get(e)?.spec===t&&(this.#u.delete(e),this.#m())}}registerTooltip(e){return this.#f=e,this.#m(),()=>{this.#f===e&&(this.#f=null,this.#m())}}publishHover(e){this.#p!==e&&(this.#p=e,this.#t={...this.#t,hover:e},this.#h())}seriesMeta(){let e=this.seriesSpecs(),t=Lt(e);return e.map(e=>{let n=t.get(e.dataKey)??`chart-other`,r=this.#o?R:Nt(e.color,n),i=this.#o?R:e.color??n;return{dataKey:e.dataKey,label:e.label,mark:e.mark,color:r,colorInput:i,shape:Ft(e.shape,n),texture:e.texture}})}#m(e={seriesChanged:!1}){this.#t={series:this.seriesMeta(),hover:this.#p,grid:this.#a,xAxis:this.#c,yAxis:this.#l,referenceLines:[...this.#u.values()].toSorted((e,t)=>e.sequence-t.sequence).map(e=>e.spec),tooltip:this.#f,orientation:this.#s},this.#h(),e.seriesChanged?this.onSeriesChange?.():this.onPresentationChange?.()}#h(){for(let e of this.#e)e()}};const zt=l(null),Bt=e=>{let t=u(zt);return _(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},Vt=e=>g(e.subscribe,e.getSnapshot,e.getSnapshot),Ht=e=>{let t=c(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),g(e.subscribe,n,r)},Ut=e=>{let t=c(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),g(e.subscribe,n,r)},Wt=(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)))},Gt=e=>{let[t,n]=h(e);return Wt(t,e)?t:(n(e),e)},Kt=(e,t)=>{for(let n of e){let e=k(n,t);if(e!=null)return e instanceof Date?`time`:typeof e==`number`?`linear`:`point`}return`point`},qt=[`auto`,`auto`],Jt=t=>{let i=c(133),a,o,s,l,u,d,g,x,S,C,w,T,E,D,O,A,j,M,N,P,F,I,L,R,ee,z;i[0]===t?(a=i[1],o=i[2],s=i[3],l=i[4],u=i[5],d=i[6],g=i[7],x=i[8],S=i[9],C=i[10],w=i[11],T=i[12],E=i[13],D=i[14],O=i[15],A=i[16],j=i[17],M=i[18],N=i[19],P=i[20],F=i[21],I=i[22],L=i[23],R=i[24],ee=i[25],z=i[26]):({kind:C,componentName:g,slotName:O,data:x,xKey:R,xScale:ee,zKey:z,dimensions:A,yDomain:j,stacked:M,orientation:N,animate:P,pending:F,decorative:I,activeIndex:a,onActiveIndexChange:w,onDatumActivate:T,className:d,children:u,ref:D,"data-slot":S,"aria-label":s,"aria-labelledby":l,"aria-hidden":o,tabIndex:L,...E}=t,i[0]=t,i[1]=a,i[2]=o,i[3]=s,i[4]=l,i[5]=u,i[6]=d,i[7]=g,i[8]=x,i[9]=S,i[10]=C,i[11]=w,i[12]=T,i[13]=E,i[14]=D,i[15]=O,i[16]=A,i[17]=j,i[18]=M,i[19]=N,i[20]=P,i[21]=F,i[22]=I,i[23]=L,i[24]=R,i[25]=ee,i[26]=z);let B=A===void 0?3:A,te=j===void 0?qt:j,ne=M!==void 0&&M,re=N===void 0?`vertical`:N,ie=P===void 0||P,ae=F!==void 0&&F,V=I!==void 0&&I,[H]=h(mn),U=m(null),W;i[27]!==x||i[28]!==R||i[29]!==z?(W={data:x,xKey:R,zKey:z},i[27]=x,i[28]=R,i[29]=z,i[30]=W):W=i[30];let oe=m(W),se;i[31]!==g||i[32]!==C||i[33]!==H?(se=()=>({kind:C,componentName:g,store:H,engineRef:U,dataRef:oe}),i[31]=g,i[32]=C,i[33]=H,i[34]=se):se=i[34];let[ce]=h(se),le,ue;i[35]!==x||i[36]!==R||i[37]!==z?(le=()=>{oe.current={data:x,xKey:R,zKey:z}},ue=[x,R,z],i[35]=x,i[36]=R,i[37]=z,i[38]=le,i[39]=ue):(le=i[38],ue=i[39]),p(le,ue);let de=m(null),fe=e(de,D),pe=m(null),me=m(null),G=m(null),he=m(null),ge=m(null),_e=m(null),K=f(),ye;i[40]!==x||i[41]!==C||i[42]!==R||i[43]!==ee?(ye=C===`bar`?`band`:ee??Kt(x,R),i[40]=x,i[41]=C,i[42]=R,i[43]=ee,i[44]=ye):ye=i[44];let be=ye;_(C!==`scatter`||x.length===0||be!==`point`,`${g}.Root requires numeric or Date x values — the "${R}" values are not numbers or dates, so they have no position on a continuous scatter axis.`);let[xe,Se]=te,Ce;bb0:{for(let e of x){let t=k(e,R);if(t instanceof Date&&ve(t)){Ce=!0;break bb0}}Ce=!1}let q=Ce,we,Te;i[45]!==C||i[46]!==H?(we=()=>{let e=de.current,t=pe.current,n=me.current,r=G.current,i=he.current,a=ge.current,o=_e.current;if(e==null||t==null||n==null||r==null||i==null||a==null||o==null)return;let s=new bt({kind:C,store:H,elements:{root:e,plot:t,canvas:n,crosshair:r,band:i,markers:a,tooltip:o}});return U.current=s,()=>{U.current=null,s.destroy()}},Te=[C,H],i[45]=C,i[46]=H,i[47]=we,i[48]=Te):(we=i[47],Te=i[48]),p(we,Te);let Ee,De;i[49]!==ie||i[50]!==V||i[51]!==B||i[52]!==re||i[53]!==be||i[54]!==ne||i[55]!==H||i[56]!==R||i[57]!==Se||i[58]!==xe||i[59]!==z?(Ee=()=>{U.current?.setOptions({xKey:R,xScale:be,yDomain:[xe,Se],zKey:z??null,dimensions:B,stacked:ne,orientation:re,animate:ie}),H.setOrientation(re),H.setDecorative(V)},De=[H,V,R,be,xe,Se,z,B,ne,re,ie],i[49]=ie,i[50]=V,i[51]=B,i[52]=re,i[53]=be,i[54]=ne,i[55]=H,i[56]=R,i[57]=Se,i[58]=xe,i[59]=z,i[60]=Ee,i[61]=De):(Ee=i[60],De=i[61]),p(Ee,De);let Oe,J;i[62]===x?(Oe=i[63],J=i[64]):(Oe=()=>{U.current?.setRows(x)},J=[x],i[62]=x,i[63]=Oe,i[64]=J),p(Oe,J);let ke;i[65]!==V||i[66]!==w||i[67]!==T?(ke=()=>{U.current?.setCallbacks(V?{onDatumActivate:null,onActiveIndexChange:null}:{onDatumActivate:T??null,onActiveIndexChange:w??null})},i[65]=V,i[66]=w,i[67]=T,i[68]=ke):ke=i[68],p(ke);let Ae,je;i[69]!==a||i[70]!==V?(Ae=()=>{U.current?.setControlledActiveIndex(V?void 0:a)},je=[V,a],i[69]=a,i[70]=V,i[71]=Ae,i[72]=je):(Ae=i[71],je=i[72]),p(Ae,je);let Me;i[73]===Symbol.for(`react.memo_cache_sentinel`)?(Me=()=>{U.current?.flushIngest()},i[73]=Me):Me=i[73],p(Me);let Y;i[74]!==S||i[75]!==O?(Y=r(S,O),i[74]=S,i[75]=O,i[76]=Y):Y=i[76];let X;i[77]===d?X=i[78]:(X=n(`relative flex aspect-video w-full flex-col`,d),i[77]=d,i[78]=X);let Ne=V?!0:o,Pe=V?void 0:L,Fe=V?!0:void 0,Ie=`${O}-plot`,Le=ae&&`opacity-60 transition-opacity duration-300`,Re;i[79]===Le?Re=i[80]:(Re=n(`relative min-h-0 w-full flex-1`,Le),i[79]=Le,i[80]=Re);let ze=`${O}-canvas`,Be;i[81]===ze?Be=i[82]:(Be=y(`canvas`,{"data-slot":ze,ref:me,"aria-hidden":!0,className:`absolute inset-0 size-full`}),i[81]=ze,i[82]=Be);let Z;i[83]!==s||i[84]!==l||i[85]!==V||i[86]!==K||i[87]!==C||i[88]!==z?(Z=V?null:b(v,{children:[y(`div`,{role:`application`,"aria-label":s,"aria-labelledby":l,"aria-describedby":K,tabIndex:0,className:n(`focus-visible:ring-focus-accent absolute inset-0 rounded-sm outline-none focus-visible:ring-2`,(C===`line`||C===`area`)&&`cursor-crosshair`,C===`scatter`&&z!=null&&`touch-none cursor-grab active:cursor-grabbing`),onPointerDown:e=>{e.isTrusted&&C===`scatter`&&z!=null&&e.currentTarget.setPointerCapture(e.pointerId),U.current?.handlePointerDown(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerMove:e=>{U.current?.handlePointerMove(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerUp:e=>{U.current?.handlePointerUp(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerLeave:()=>{U.current?.handlePointerLeave()},onPointerCancel:()=>{U.current?.handlePointerLeave()},onBlur:()=>{U.current?.handlePointerLeave()},onKeyDown:e=>{U.current?.handleKeyDown(e.key)&&e.preventDefault()}}),y(`span`,{id:K,className:`sr-only`,children:`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.`})]}),i[83]=s,i[84]=l,i[85]=V,i[86]=K,i[87]=C,i[88]=z,i[89]=Z):Z=i[89];let Ve=`${O}-crosshair`,Q;i[90]===Ve?Q=i[91]:(Q=y(`div`,{"data-slot":Ve,ref:G,"aria-hidden":!0,className:`bg-neutral-500 pointer-events-none absolute left-0 top-0 w-px opacity-0`}),i[90]=Ve,i[91]=Q);let $=`${O}-hover-band`,He;i[92]===$?He=i[93]:(He=y(`div`,{"data-slot":$,ref:he,"aria-hidden":!0,className:`bg-neutral-500/10 pointer-events-none absolute left-0 top-0 rounded-sm opacity-0`}),i[92]=$,i[93]=He);let Ue=`${O}-markers`,We;i[94]===Ue?We=i[95]:(We=y(`div`,{"data-slot":Ue,ref:ge,"aria-hidden":!0,className:`pointer-events-none absolute inset-0 opacity-0`}),i[94]=Ue,i[95]=We);let Ge;i[96]!==O||i[97]!==H||i[98]!==q?(Ge=y(nn,{slotName:O,store:H,tooltipRef:_e,xHasTimeOfDay:q}),i[96]=O,i[97]=H,i[98]=q,i[99]=Ge):Ge=i[99];let Ke;i[100]!==Ie||i[101]!==Re||i[102]!==Be||i[103]!==Z||i[104]!==Q||i[105]!==He||i[106]!==We||i[107]!==Ge?(Ke=b(`div`,{"data-slot":Ie,className:Re,ref:pe,children:[Be,Z,Q,He,We,Ge]}),i[100]=Ie,i[101]=Re,i[102]=Be,i[103]=Z,i[104]=Q,i[105]=He,i[106]=We,i[107]=Ge,i[108]=Ke):Ke=i[108];let qe;i[109]!==s||i[110]!==l||i[111]!==x||i[112]!==V||i[113]!==O||i[114]!==H||i[115]!==q||i[116]!==R||i[117]!==z?(qe=V?null:b(v,{children:[y(dn,{store:H,xHasTimeOfDay:q}),y(pn,{data:x,label:s,labelledBy:l,slotName:O,store:H,xHasTimeOfDay:q,xKey:R,zKey:z})]}),i[109]=s,i[110]=l,i[111]=x,i[112]=V,i[113]=O,i[114]=H,i[115]=q,i[116]=R,i[117]=z,i[118]=qe):qe=i[118];let Je;i[119]!==u||i[120]!==ce||i[121]!==Ke||i[122]!==qe?(Je=b(zt.Provider,{value:ce,children:[Ke,u,qe]}),i[119]=u,i[120]=ce,i[121]=Ke,i[122]=qe,i[123]=Je):Je=i[123];let Ye;return i[124]!==fe||i[125]!==E||i[126]!==Y||i[127]!==X||i[128]!==Ne||i[129]!==Pe||i[130]!==Fe||i[131]!==Je?(Ye=y(`div`,{"data-slot":Y,className:X,"aria-hidden":Ne,tabIndex:Pe,inert:Fe,ref:fe,...E,children:Je}),i[124]=fe,i[125]=E,i[126]=Y,i[127]=X,i[128]=Ne,i[129]=Pe,i[130]=Fe,i[131]=Je,i[132]=Ye):Ye=i[132],Ye},Yt=(e,t,n)=>{let r=c(13),i=Bt(e);_(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:l,curve:u,markers:d,connectNulls:f,shape:m,texture:h}=n,g=u===void 0?`linear`:u,v=d!==void 0&&d,y=f!==void 0&&f,b=h===void 0?`solid`:h,x,S;return r[0]!==l||r[1]!==y||r[2]!==i.store||r[3]!==g||r[4]!==a||r[5]!==o||r[6]!==t||r[7]!==v||r[8]!==s||r[9]!==m||r[10]!==b?(x=()=>i.store.registerSeries({dataKey:a,label:o??a,seriesSlot:s,color:l,mark:t,curve:g,markers:v,connectNulls:y,shape:m,texture:b}),S=[i.store,a,o,s,l,t,g,v,y,m,b],r[0]=l,r[1]=y,r[2]=i.store,r[3]=g,r[4]=a,r[5]=o,r[6]=t,r[7]=v,r[8]=s,r[9]=m,r[10]=b,r[11]=x,r[12]=S):(x=r[11],S=r[12]),p(x,S),null},Xt=(e,t)=>{let n=c(4),r=Bt(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]),p(a,o),null},Zt=(e,t)=>{let n=c(5),r=Bt(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]),p(o,s),null},Qt=(e,t)=>{let n=c(5),r=Bt(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]),p(o,s),null},$t=(e,t)=>{let n=c(7),r=Bt(e),i=f(),{y:a,label:o,color:s}=t,l,u;return n[0]!==s||n[1]!==r.store||n[2]!==i||n[3]!==o||n[4]!==a?(l=()=>r.store.registerReferenceLine(i,{y:a,label:o,color:s}),u=[r.store,i,a,o,s],n[0]=s,n[1]=r.store,n[2]=i,n[3]=o,n[4]=a,n[5]=l,n[6]=u):(l=n[5],u=n[6]),p(l,u),null},en=(e,t)=>{let n=c(16),r=Bt(e),i,a,o,s,l,u;n[0]===t?(i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],u=n[6]):({labelFormat:s,valueFormat:u,indicator:l,footer:o,children:i,...a}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=o,n[4]=s,n[5]=l,n[6]=u);let d=l===void 0?`line`:l,f=Gt(a),m,h;return n[7]!==i||n[8]!==r.store||n[9]!==o||n[10]!==d||n[11]!==s||n[12]!==f||n[13]!==u?(m=()=>r.store.registerTooltip({labelFormat:s,valueFormat:u,indicator:d,footer:o,children:i,divProps:f}),h=[r.store,s,u,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]=u,n[14]=m,n[15]=h):(m=n[14],h=n[15]),p(m,h),null},tn=(e,t,n)=>e==null?`—`:n==null?G(e):n(e,t),nn=r=>{let i=c(27),{slotName:a,store:o,tooltipRef:s,xHasTimeOfDay:l}=r,u=Vt(o),d=u.tooltip,f=u.hover,h;i[0]===d?.divProps?h=i[1]:(h=d?.divProps??{},i[0]=d?.divProps,i[1]=h);let g,_,x,S;i[2]===h?(g=i[3],_=i[4],x=i[5],S=i[6]):({className:g,ref:_,style:S,...x}=h,i[2]=h,i[3]=g,i[4]=_,i[5]=x,i[6]=S);let C=m(null),w=e(s,C),T,E;i[7]===_?(T=i[8],E=i[9]):(T=()=>{if(_==null)return;let e=t(_),n=e(C.current);return()=>{typeof n==`function`?n():e(null)}},E=[_],i[7]=_,i[8]=T,i[9]=E),p(T,E);let D=d?.footer,O=`${a}-tooltip`,k;i[10]===g?k=i[11]:(k=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`,g),i[10]=g,i[11]=k);let A;i[12]===S?A=i[13]:(A={opacity:0,...S},i[12]=S,i[13]=A);let j=A,M;i[14]!==d||i[15]!==D||i[16]!==f||i[17]!==a||i[18]!==l?(M=f==null?null:d?.children==null?b(v,{children:[y(`div`,{className:`text-muted font-medium`,children:d?.labelFormat==null?K(f.xValue,{datasetHasTimeOfDay:l}):d.labelFormat(f.xValue)}),y(`div`,{className:`mt-1 grid gap-1`,children:f.points.map(e=>b(`div`,{className:`flex items-center gap-1.5`,children:[d?.indicator===`none`?null:y(`span`,{"aria-hidden":!0,className:`h-2.5 w-0.5 shrink-0 rounded-full`,style:{backgroundColor:e.color}}),y(`span`,{className:`text-muted`,children:e.label}),y(`span`,{className:`text-strong ml-auto pl-3 font-medium tabular-nums`,children:tn(e.value,e.dataKey,d?.valueFormat)})]},e.dataKey))}),f.zValue===void 0?null:b(`div`,{className:`mt-1 flex items-center gap-1.5`,children:[y(`span`,{className:`text-muted`,children:`z`}),y(`span`,{className:`text-strong ml-auto pl-3 font-medium tabular-nums`,children:f.zValue==null?`—`:G(f.zValue)})]}),D==null?null:y(`div`,{className:`text-muted mt-1`,children:typeof D==`function`?D(f):D})]}):y(`div`,{"data-slot":`${a}-tooltip-label`,className:`contents`,children:d.children(f)}),i[14]=d,i[15]=D,i[16]=f,i[17]=a,i[18]=l,i[19]=M):M=i[19];let N;return i[20]!==w||i[21]!==x||i[22]!==O||i[23]!==k||i[24]!==j||i[25]!==M?(N=y(`div`,{"data-slot":O,ref:w,className:k,style:j,...x,children:M}),i[20]=w,i[21]=x,i[22]=O,i[23]=k,i[24]=j,i[25]=M,i[26]=N):N=i[26],N},rn=(e,t,n=3)=>`repeating-linear-gradient(${e}, ${t} 0, ${t} 1px, transparent 1px, transparent ${n}px)`,an=`forced-color-adjust-none [print-color-adjust:exact] [-webkit-print-color-adjust:exact]`,on={hatch:({ink:e})=>({backgroundImage:rn(`135deg`,e)}),"hatch-reverse":({ink:e})=>({backgroundImage:rn(`45deg`,e)}),crosshatch:({ink:e})=>({backgroundImage:`${rn(`135deg`,e,4)}, ${rn(`45deg`,e,4)}`}),perpendicular:({ink:e,orientation:t})=>({backgroundImage:rn(t===`horizontal`?`90deg`:`0deg`,e)}),parallel:({ink:e,orientation:t})=>({backgroundImage:rn(t===`horizontal`?`0deg`:`90deg`,e)}),grid:({ink:e})=>({backgroundImage:`${rn(`0deg`,e,4)}, ${rn(`90deg`,e,4)}`}),dots:({ink:e})=>({backgroundImage:`radial-gradient(circle at 1px 1px, ${e} 0.75px, transparent 0.8px)`,backgroundSize:`3px 3px`})},sn=(e,t,n)=>e===`solid`?{}:on[e]({ink:U(t),orientation:n}),cn=e=>{let t=c(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]`,an),t[0]=a):a=t[0];let o=r.color,s;t[1]!==i||t[2]!==r.color||t[3]!==r.texture?(s=sn(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=y(`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`,an),t[11]=e):e=t[11];let i;t[12]===r.color?i=t[13]:(i=y(`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`,an),t[14]=o):o=t[14];let s=Ct[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=y(`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=b(`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`,an),t[24]=o):o=t[24];let s=Ct[r.shape],l;t[25]!==r.color||t[26]!==s?(l={backgroundColor:r.color,clipPath:s},t[25]=r.color,t[26]=s,t[27]=l):l=t[27];let u;return t[28]!==r.shape||t[29]!==l?(u=y(`span`,{"aria-hidden":!0,"data-shape":a,className:o,style:l}),t[28]=r.shape,t[29]=l,t[30]=u):u=t[30],u},ln=e=>{let t=c(18),r,i,a,o,s;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4],s=t[5]):({partName:a,slotName:s,className:i,children:r,...o}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s);let l=Bt(a),u=Ht(l.store),d=Ut(l.store);if(u.length<2)return null;let f=`${s}-legend`,p;t[6]===i?p=t[7]:(p=n(`text-muted flex flex-wrap items-center gap-x-4 gap-y-1 pt-3 text-xs`,i),t[6]=i,t[7]=p);let m;t[8]!==r||t[9]!==d||t[10]!==u||t[11]!==s?(m=r==null?u.map(e=>b(`div`,{className:`flex items-center gap-1.5`,children:[y(cn,{series:e,orientation:d}),e.label]},e.dataKey)):y(`div`,{"data-slot":`${s}-legend-label`,className:`contents`,children:r(u)}),t[8]=r,t[9]=d,t[10]=u,t[11]=s,t[12]=m):m=t[12];let h;return t[13]!==o||t[14]!==f||t[15]!==p||t[16]!==m?(h=y(`div`,{"data-slot":f,className:p,...o,children:m}),t[13]=o,t[14]=f,t[15]=p,t[16]=m,t[17]=h):h=t[17],h},un=e=>{let t=c(31),n,r,l,u,f,p,g,_;t[0]===e?(n=t[1],r=t[2],l=t[3],u=t[4],f=t[5],p=t[6],g=t[7],_=t[8]):({partName:u,slotName:g,label:_,onCopy:r,onCopyError:l,onClick:n,ref:p,...f}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=l,t[4]=u,t[5]=f,t[6]=p,t[7]=g,t[8]=_);let C=_===void 0?`Copy data as Markdown`:_,w=Bt(u),T=a(),[E,D]=h(``),O=E!==``,k=m(!1),A=m(void 0),j,M;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>()=>{A.current!=null&&clearTimeout(A.current)},M=[],t[9]=j,t[10]=M):(j=t[9],M=t[10]),d(j,M);let N=`${g}-copy-button`,P;t[11]===O?P=t[12]:(P=y(O?x:S,{}),t[11]=O,t[12]=P);let F;t[13]!==w||t[14]!==T||t[15]!==n||t[16]!==r||t[17]!==l?(F=async e=>{try{if(n?.(e),e.defaultPrevented){A.current!=null&&(clearTimeout(A.current),A.current=void 0),D(``);return}let{data:t,xKey:i,zKey:a}=w.dataRef.current,s=Mt({data:t,xKey:i,zKey:a,series:w.store.getSnapshot().series});await T(s),r?.(s),D(o(`Copied`,k)),A.current!=null&&clearTimeout(A.current),A.current=setTimeout(()=>{D(``)},2e3)}catch(e){l?.(e)}},t[13]=w,t[14]=T,t[15]=n,t[16]=r,t[17]=l,t[18]=F):F=t[18];let I;t[19]!==C||t[20]!==f||t[21]!==p||t[22]!==N||t[23]!==P||t[24]!==F?(I=y(i,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,"data-slot":N,label:C,icon:P,ref:p,onClick:F,...f}),t[19]=C,t[20]=f,t[21]=p,t[22]=N,t[23]=P,t[24]=F,t[25]=I):I=t[25];let L;t[26]===E?L=t[27]:(L=y(s,{children:E}),t[26]=E,t[27]=L);let R;return t[28]!==I||t[29]!==L?(R=b(v,{children:[I,L]}),t[28]=I,t[29]=L,t[30]=R):R=t[30],R},dn=e=>{let t=c(6),{store:n,xHasTimeOfDay:r}=e,i=Vt(n),[a,o]=h(``),s=i.hover,l,u;t[0]!==s||t[1]!==r?(l=()=>{if(s==null||!s.viaKeyboard){o(``);return}let e=s.points.map(hn).join(`, `),t=s.zValue===void 0?``:`, z: ${s.zValue==null?`no data`:G(s.zValue)}`,n=setTimeout(()=>{o(`${K(s.xValue,{datasetHasTimeOfDay:r})}. ${e}${t}`)},120);return()=>clearTimeout(n)},u=[s,r],t[0]=s,t[1]=r,t[2]=l,t[3]=u):(l=t[2],u=t[3]),d(l,u);let f;return t[4]===a?f=t[5]:(f=y(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:a}),t[4]=a,t[5]=f),f},fn=(e,t)=>{let n=c(3),[r,i]=h(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(gn).filter(Boolean).join(` `);i(e||void 0)},o=[t],n[0]=t,n[1]=a,n[2]=o),d(a,o),e??r},pn=e=>{let t=c(39),{data:n,label:r,labelledBy:i,slotName:a,store:o,xHasTimeOfDay:s,xKey:l,zKey:u}=e,d=Ht(o),f=fn(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]!==l||t[6]!==u){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=y(`caption`,{children:r}),t[12]=r,t[13]=m);let i;t[14]===l?i=t[15]:(i=y(`th`,{scope:`col`,children:l}),t[14]=l,t[15]=i);let o;t[16]===d?o=t[17]:(o=d.map(_n),t[16]=d,t[17]=o);let c;t[18]===u?c=t[19]:(c=u==null?null:y(`th`,{scope:`col`,children:u}),t[18]=u,t[19]=c),t[20]!==i||t[21]!==o||t[22]!==c?(h=y(`thead`,{children:b(`tr`,{children:[i,o,c]})}),t[20]=i,t[21]=o,t[22]=c,t[23]=h):h=t[23];let v;t[24]!==d||t[25]!==s||t[26]!==l||t[27]!==u?(v=(e,t)=>{let n=k(e,l),r=n instanceof Date&&!Number.isNaN(n.getTime()),i=typeof n==`string`||typeof n==`number`||n instanceof Date?K(n,{datasetHasTimeOfDay:s}):String(n);return b(`tr`,{children:[y(`th`,{scope:`row`,"data-value":typeof n==`number`&&Number.isFinite(n)?n:void 0,children:r?y(`time`,{dateTime:n.toISOString(),children:i}):i}),d.map(t=>{let n=k(e,t.dataKey),r=typeof n==`number`&&Number.isFinite(n);return y(`td`,{"data-value":r?n:void 0,children:r?G(n):`—`},t.dataKey)}),u==null?null:(()=>{let t=k(e,u),n=typeof t==`number`&&Number.isFinite(t);return y(`td`,{"data-value":n?t:void 0,children:n?G(t):`—`})})()]},t)},t[24]=d,t[25]=s,t[26]=l,t[27]=u,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]=l,t[6]=u,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=y(`tbody`,{children:p}),t[29]=p,t[30]=v);let x;t[31]!==m||t[32]!==h||t[33]!==v?(x=b(`table`,{children:[m,h,v]}),t[31]=m,t[32]=h,t[33]=v,t[34]=x):x=t[34];let S;return t[35]!==g||t[36]!==_||t[37]!==x?(S=y(`div`,{className:g,"data-slot":_,children:x}),t[35]=g,t[36]=_,t[37]=x,t[38]=S):S=t[38],S};function mn(){return new Rt}function hn(e){return`${e.label}: ${e.value==null?`no data`:G(e.value)}`}function gn(e){return document.getElementById(e)?.textContent?.trim()??``}function _n(e){return y(`th`,{scope:`col`,children:e.label},e.dataKey)}export{$t as a,Zt as c,Xt as i,Qt as l,ln as n,Yt as o,Jt as r,en as s,un as t};
package/dist/command.d.ts CHANGED
@@ -1178,7 +1178,7 @@ type CommandDialogState = {
1178
1178
  * const { openWithQuery } = useCommandDialog();
1179
1179
  * return (
1180
1180
  * <Command.Item onSelect={() => openWithQuery(query)}>
1181
- * Search everything for {query}
1181
+ * {`Search everything for “${query}”`}
1182
1182
  * </Command.Item>
1183
1183
  * );
1184
1184
  * }
@@ -427,6 +427,20 @@ type DataTableActionCellProps = ComponentProps<typeof Table$1.Cell>;
427
427
  * without the row navigating. Your own `onClick` still runs. The `<td>` keeps
428
428
  * its `role="cell"`.
429
429
  *
430
+ * **Structure.** `children` render inside a
431
+ * `<span data-slot="data-table-action-cell-label">`. The sticky-column indicator is a permanent element sibling,
432
+ * so without the span a bare text child is never a lone child: a browser
433
+ * translation engine reparents that text node, and the removal React runs when
434
+ * the content changes shape or goes away throws. The span is
435
+ * `display: contents`, so it adds no box and the cell's layout is unchanged.
436
+ *
437
+ * **Data attributes:**
438
+ *
439
+ * | Data Attribute | Value | Description |
440
+ * | --- | --- | --- |
441
+ * | `data-slot` | `"data-table-action-cell"` | On the cell element. |
442
+ * | `data-slot` | `"data-table-action-cell-label"` | On the `<span>` wrapping `children`. |
443
+ *
430
444
  * @see https://mantle.ngrok.com/components/data-display/data-table#datatableactioncell
431
445
  *
432
446
  * @example
@@ -451,6 +465,20 @@ type DataTableActionHeaderProps = ComponentProps<typeof Table$1.Header>;
451
465
  * screen-reader-only "Actions" label by default, so the column has a name while
452
466
  * it stays visually empty.
453
467
  *
468
+ * **Structure.** `children` render inside a
469
+ * `<span data-slot="data-table-action-header-label">`. The indicator and the fallback `sr-only` label both sit beside `children`,
470
+ * so without the span a bare text child is never a lone child: a browser
471
+ * translation engine reparents that text node, and the removal React runs when
472
+ * the content changes shape or goes away throws. The span is
473
+ * `display: contents`, so it adds no box and the cell's layout is unchanged.
474
+ *
475
+ * **Data attributes:**
476
+ *
477
+ * | Data Attribute | Value | Description |
478
+ * | --- | --- | --- |
479
+ * | `data-slot` | `"data-table-action-header"` | On the cell element. |
480
+ * | `data-slot` | `"data-table-action-header-label"` | On the `<span>` wrapping `children`. |
481
+ *
454
482
  * @see https://mantle.ngrok.com/components/data-display/data-table#datatableactionheader
455
483
  *
456
484
  * @example
@@ -1039,6 +1067,20 @@ declare const DataTable: {
1039
1067
  * propagation and keeps the click's default action, so an action menu opens
1040
1068
  * without the row navigating.
1041
1069
  *
1070
+ * **Structure.** `children` render inside a
1071
+ * `<span data-slot="data-table-action-cell-label">`. The sticky-column indicator is a permanent element sibling,
1072
+ * so without the span a bare text child is never a lone child: a browser
1073
+ * translation engine reparents that text node, and the removal React runs when
1074
+ * the content changes shape or goes away throws. The span is
1075
+ * `display: contents`, so it adds no box and the cell's layout is unchanged.
1076
+ *
1077
+ * **Data attributes:**
1078
+ *
1079
+ * | Data Attribute | Value | Description |
1080
+ * | --- | --- | --- |
1081
+ * | `data-slot` | `"data-table-action-cell"` | On the cell element. |
1082
+ * | `data-slot` | `"data-table-action-cell-label"` | On the `<span>` wrapping `children`. |
1083
+ *
1042
1084
  * @see https://mantle.ngrok.com/components/data-display/data-table#datatableactioncell
1043
1085
  *
1044
1086
  * @example
@@ -1062,6 +1104,20 @@ declare const DataTable: {
1062
1104
  * screen-reader-only "Actions" label by default, so the column has a name while
1063
1105
  * it stays visually empty.
1064
1106
  *
1107
+ * **Structure.** `children` render inside a
1108
+ * `<span data-slot="data-table-action-header-label">`. The indicator and the fallback `sr-only` label both sit beside `children`,
1109
+ * so without the span a bare text child is never a lone child: a browser
1110
+ * translation engine reparents that text node, and the removal React runs when
1111
+ * the content changes shape or goes away throws. The span is
1112
+ * `display: contents`, so it adds no box and the cell's layout is unchanged.
1113
+ *
1114
+ * **Data attributes:**
1115
+ *
1116
+ * | Data Attribute | Value | Description |
1117
+ * | --- | --- | --- |
1118
+ * | `data-slot` | `"data-table-action-header"` | On the cell element. |
1119
+ * | `data-slot` | `"data-table-action-header-label"` | On the `<span>` wrapping `children`. |
1120
+ *
1065
1121
  * @see https://mantle.ngrok.com/components/data-display/data-table#datatableactionheader
1066
1122
  *
1067
1123
  * @example