@tabler/charts-bootstrap 0.2.0 → 0.4.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.
- package/README.md +5 -4
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tabler-charts-bootstrap.min.js +3 -2
- package/dist/tabler-charts-bootstrap.min.js.map +1 -1
- package/dist/tabler.css +1 -1
- package/package.json +8 -14
- package/scss/_tabler.scss +4 -3
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
var TablerCharts=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t=0){let n=n=>{let r=typeof e==`number`?e:e?.[n];return Number.isFinite(r)?r:t};return{top:n(`top`),right:n(`right`),bottom:n(`bottom`),left:n(`left`)}}let n=(e,t)=>t?{...e,left:e.right,right:e.left}:e;function r(e,t,n){return{x:n.left,y:n.top,width:Math.max(0,e-n.left-n.right),height:Math.max(0,t-n.top-n.bottom)}}let i=e=>e>=4352&&(e<=4447||e>=11904&&e<=42191||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65280&&e<=65376||e>=127744);function a(e){return e>=`0`&&e<=`9`?e===`1`?.45:.63:" !'.,:;|ijlI`".includes(e)?.27:`()[]{}-/frt`.includes(e)?.38:`%@MWmw`.includes(e)?.88:`CDGHNOQU`.includes(e)?.76:e>=`A`&&e<=`Z`?.66:.57}function o(e,t){let n=0;for(let t=0;t<e.length;t++){let r=e.codePointAt(t);n+=s[r]??(i(r)?1:.57),r>65535&&t++}return n*t}let s=/* @__PURE__ */ Array.from({length:128},(e,t)=>a(String.fromCharCode(t))),c=e=>Math.round(e*100)/100,l=1.25,u=`http://www.w3.org/2000/svg`,d={fill:`rgb(0, 0, 0)`,"fill-opacity":`1`,stroke:`none`,"stroke-width":`1px`,"stroke-opacity":`1`,"stroke-dasharray":`none`,"stroke-dashoffset":`0px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"paint-order":`normal`,"shape-rendering":`auto`,"vector-effect":`none`,opacity:`1`,visibility:`visible`},f={...d,"font-family":``,"font-size":``,"font-weight":`400`,"font-style":`normal`,"font-variant-numeric":`normal`,"letter-spacing":`normal`},p={"stop-color":``,"stop-opacity":`1`},m={opacity:`1`},h=/* @__PURE__ */ new Set([`path`,`line`,`rect`,`circle`,`ellipse`,`polygon`,`polyline`]);function g(e){let t=`element`in e&&!(e instanceof Element)?e.element:e,n=t.localName===`svg`?t:t.querySelector(`:scope > svg.tc-chart`);if(!n)throw Error(`@tabler/charts: no rendered chart to export.`);return n}function _(e){let t=e.transform;if(!t||t===`none`)return;let n=t.replace(/px/g,``);if(n.startsWith(`translate`))return n;let[r=0,i=0]=(e.transformOrigin||`0 0`).split(` `).map(Number.parseFloat);return r||i?`translate(${r} ${i}) ${n} translate(${-r} ${-i})`:n}function v(e,t){let n=getComputedStyle(e);if(n.display===`none`)return!1;let r=e.localName,i=r===`text`?f:r===`stop`?p:h.has(r)?d:m,a=[];for(let e in i){let t=n.getPropertyValue(e);t&&t!==i[e]&&a.push(`${e}:${t}`)}t.removeAttribute(`style`),a.length&&t.setAttribute(`style`,a.join(`;`));let o=_(n);o&&t.setAttribute(`transform`,o);let s=Array.from(e.children),c=Array.from(t.children);return s.forEach((e,t)=>{let n=c[t];(e.classList.contains(`tc-hover-layer`)||!v(e,n))&&n.remove()}),!0}function y(e){let t=e.querySelector(`:scope > .tc-legend`),n=t?Array.from(t.querySelectorAll(`.tc-legend-item`)):[];if(!t||!n.length)return;let r=e.ownerDocument,i=e.querySelector(`:scope > svg.tc-patterned`),a=t.getBoundingClientRect(),o=r.createElementNS(u,`g`);for(let e of n){let t=e.querySelector(`.tc-legend-swatch`),n=e.querySelector(`.tc-legend-name`);if(!t||!n)continue;let s=t.getBoundingClientRect(),l=n.getBoundingClientRect(),d=getComputedStyle(t).getPropertyValue(`--tc-series-color`).trim(),f=/\btc-series-([1-8])\b/.exec(e.getAttribute(`class`)??``)?.[1]??`other`,p=i?getComputedStyle(i).getPropertyValue(`--tc-pattern-${f}`).trim():``,m=e.classList.contains(`tc-legend-item-hidden`),h=r.createElementNS(u,`circle`);h.setAttribute(`cx`,String(c(s.left-a.left+s.width/2))),h.setAttribute(`cy`,String(c(s.top-a.top+s.height/2))),h.setAttribute(`r`,String(c(s.width/2-(m?.75:0)))),h.setAttribute(`style`,m?`fill:none;stroke:${d};stroke-width:1.5px`:`fill:${p.startsWith(`url(`)?p:d}`);let g=getComputedStyle(n),_=r.createElementNS(u,`text`);_.setAttribute(`x`,String(c(l.left-a.left))),_.setAttribute(`y`,String(c(l.top-a.top+l.height/2))),_.setAttribute(`dy`,`0.35em`),_.setAttribute(`style`,`fill:${g.color};font-family:${g.fontFamily};font-size:${g.fontSize};font-weight:${g.fontWeight}`),_.textContent=n.textContent,o.append(h,_)}let s=t.getAttribute(`data-position`)===`bottom`,l=Number.parseFloat(getComputedStyle(t)[s?`marginTop`:`marginBottom`])||0;return{svg:o,height:c(a.height+l),margin:l,bottom:s}}function b(e,t={}){let n=g(e);for(let e of n.getAnimations?.({subtree:!0})??[])e.finish();let r=n.cloneNode(!0);v(n,r);let i=n.ownerDocument,a=Number(n.getAttribute(`width`)),o=Number(n.getAttribute(`height`));r.setAttribute(`xmlns`,u),r.removeAttribute(`class`),r.removeAttribute(`tabindex`),r.removeAttribute(`data-resizing`),r.removeAttribute(`aria-describedby`),r.removeAttribute(`aria-activedescendant`);let s=getComputedStyle(n),c=n.parentElement,l=t.legend!==!1&&c?y(c):void 0,d=o;if(l){let e=i.createElementNS(u,`g`);e.append(...Array.from(r.childNodes)),l.bottom?l.svg.setAttribute(`transform`,`translate(0 ${o+l.margin})`):e.setAttribute(`transform`,`translate(0 ${l.height})`),r.append(e,l.svg),d=o+l.height}r.setAttribute(`width`,String(a)),r.setAttribute(`height`,String(d)),r.setAttribute(`viewBox`,`0 0 ${a} ${d}`);let f=n.getAttribute(`aria-label`);if(f){let e=i.createElementNS(u,`title`);e.textContent=f,r.prepend(e)}let p=t.background===void 0||t.background===`auto`?s.getPropertyValue(`--tc-surface`).trim()||void 0:t.background||void 0;if(p){let e=i.createElementNS(u,`rect`);e.setAttribute(`width`,`100%`),e.setAttribute(`height`,`100%`),e.setAttribute(`fill`,p),r.insertBefore(e,r.querySelector(`:scope > title`)?.nextSibling??r.firstChild)}return new XMLSerializer().serializeToString(r)}async function x(e,t={}){let{type:n=`image/png`,scale:r=2,quality:i}=t,a=b(e,{...t,...n===`image/jpeg`&&t.background===!1?{background:`#fff`}:{}}),o=g(e).ownerDocument,s=new Image;s.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(a)}`,await s.decode();let c=o.createElement(`canvas`);c.width=Math.round(s.width*r),c.height=Math.round(s.height*r);let l=c.getContext(`2d`);if(!l)throw Error(`@tabler/charts: no 2d canvas to draw the image.`);return l.drawImage(s,0,0,c.width,c.height),new Promise((e,t)=>{c.toBlob(n=>n?e(n):t(/* @__PURE__ */ Error(`@tabler/charts: could not encode.`)),n,i)})}async function S(e,t={}){let{format:n=`png`}=t,r=g(e),i=n===`svg`?new Blob([b(e,t)],{type:`image/svg+xml`}):await x(e,{...t,type:`image/${n}`}),a=(t.filename??r.getAttribute(`aria-label`)??`chart`).replace(/[\\/:*?"<>|]+/g,``).trim(),o=r.ownerDocument.createElement(`a`);o.href=URL.createObjectURL(i),o.download=`${a||`chart`}.${n===`jpeg`?`jpg`:n}`,o.click(),setTimeout(()=>URL.revokeObjectURL(o.href),1e3)}let C={};function w(e){Object.assign(C,e)}let T=/* @__PURE__ */ new Set;function E(e){T.add(e),C.post=(e,t,n,r)=>{for(let i of T)t=i(e,t,n,r);return t}}function D(e){let t=C[e];if(!t)throw Error(`@tabler/charts: Import "@tabler/charts/${e===`dates`?`time`:e}" for ${e}.`);return t}w({export:S});function O(e,t,...n){let r={},i;if(t)for(let e in t){let n=t[e];if(e===`key`)n!=null&&(i=n);else if(e===`class`){let e=k(n);e&&(r.class=e)}else if(e===`style`){let e=j(n);e&&(r.style=e)}else n===!0?r[e]=``:(typeof n==`string`||typeof n==`number`&&Number.isFinite(n))&&(r[e]=n)}let a=[];return M(n,a),{tag:e,attrs:r,children:a,key:i}}function k(e){if(!e)return``;if(typeof e==`string`)return e;let t=``;for(let n of e){let e=k(n);e&&(t=t?`${t} ${e}`:e)}return t}let A=/[;{}<>"'\\]|\/\*|\b(?:url(?!\(#[\w-]+\))|src|attr|image|image-set|cross-fade|element|expression)\s*\(/i;function j(e){if(!e)return``;if(typeof e==`string`)return e;let t=``;for(let n in e){let r=e[n];r==null||r===``||A.test(String(r))||(t+=`${t?`;`:``}${n}:${r}`)}return t}function M(e,t){for(let n of e){if(n==null||typeof n==`boolean`)continue;if(Array.isArray(n)){M(n,t);continue}if(typeof n==`object`){t.push(n);continue}let e=String(n);if(e===``)continue;let r=t.length-1;r>=0&&typeof t[r]==`string`?t[r]+=e:t.push(e)}}let N=/* @__PURE__ */ new Map,P=/* @__PURE__ */ new Map;function F(e,t,n){let r=e.get(t);return r===void 0&&(e.size>=64&&e.clear(),r=n(),e.set(t,r)),r}function ee(e,t){return`${JSON.stringify(e??null)}|${JSON.stringify(t)}`}function I(e,t={}){return F(N,ee(e,t),()=>new Intl.NumberFormat(e,t))}function L(e,t={}){return F(P,ee(e,t),()=>new Intl.DateTimeFormat(e,t))}let R=e=>e===0?0:e;function z(e,t){if(typeof e==`function`)return e;let{compactSymbols:n,...r}=e??{};if(n)return V(n===!0?B:n,r,t);let i=I(t,r);return e=>i.format(R(e))}let B=[`K`,`M`,`B`,`T`];function V(e,{notation:t,compactDisplay:n,...r},i){let a=U(r),o=I(i,a?r:{...r,maximumSignificantDigits:2}),s=a?o:I(i,{...r,maximumFractionDigits:0});return t=>{for(let n=0;;n++){let r=R(t/1e3**n),i=(Math.abs(r)<10?o:s).formatToParts(r),a=``,c;for(let e of i)e.type===`integer`&&(a+=e.value),(e.type===`integer`||e.type===`fraction`)&&(c=e);if(a.length<4||n>=e.length)return n&&c&&(c.value+=e[n-1]),i.map(e=>e.value).join(``)}}}let H=e=>e.notation===`compact`||!!e.compactSymbols,U=e=>(e.minimumFractionDigits??e.maximumFractionDigits??e.minimumSignificantDigits??e.maximumSignificantDigits)!==void 0;function W(e,t){return z(typeof e==`object`&&H(e)&&!U(e)?{...e,maximumSignificantDigits:3}:e,t)}function te(e){let t=Math.abs(e);return!Number.isFinite(t)||t===0?0:Math.max(0,-Math.floor(Math.log10(t)+1e-9))}function G(e){return U(e)||!!e.compactSymbols||(e.notation??`standard`)!==`standard`}function ne(e,t,n){if(typeof t==`function`)return t;let r=t??{};if(G(r))return z(r,n);let i=te(e);r.style===`percent`&&(i=Math.max(0,i-2));let a=z({...r,minimumFractionDigits:i,maximumFractionDigits:i},n),o=Math.abs(e)*1e-9;return e=>a(Math.abs(e)<o?0:e)}function re(e,t){if(typeof e==`function`)return t=>e(typeof t==`number`?new Date(t):t);let n=L(t,e);return e=>n.format(e)}let ie=Math.sqrt(50),ae=Math.sqrt(10),oe=Math.sqrt(2);function se(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=ie?10:a>=ae?5:a>=oe?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&n>=.5&&n<2?se(e,t,n*2):[s,c,l]}function ce(e,t,n=5){if(!(n>0)||!Number.isFinite(e)||!Number.isFinite(t))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?se(t,e,n):se(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);for(let e=0;e<s;e++){let t=r?a-e:i+e;c[e]=o<0?t/-o:t*o}return c}function le(e,t,n){return se(e,t,n)[2]}function ue(e,t,n=5){let r=t<e,i=r?le(t,e,n):le(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function de(e,t,n=5){if(!Number.isFinite(e)||!Number.isFinite(t)||e===t||!(n>0))return[e,t];let r=t<e,i=r?t:e,a=r?e:t,o;for(let e=0;e<10;e++){let e=le(i,a,n);if(e===o)return r?[a,i]:[i,a];if(e>0)i=Math.floor(i/e)*e,a=Math.ceil(a/e)*e;else if(e<0)i=Math.ceil(i*e)/e,a=Math.floor(a*e)/e;else break;o=e}return[e,t]}function fe(e,t={}){let{count:n=5,format:r,locale:i}=t,[a,o]=e.domain,s=ne(ue(a,o,n),r,i);return e.ticks(n).map(t=>({value:t,position:e(t),label:s(t)}))}function pe(e,t=String){return e.domain.map((n,r)=>({value:n,position:e.at(r)+e.bandwidth/2,label:t(n,r)}))}let me=e=>e===`top`||e===`bottom`;function he(e,t,n,r=8){if(e.length<2)return e.slice();let i=e.map(e=>me(t)?o(e.label,n):n*l),a=(t,n)=>Math.abs(e[n].position-e[t].position)>=(i[t]+i[n])/2+r,s=e.length-1,c=Math.abs(e[s].position-e[0].position),u=i.reduce((e,t)=>e+t+r,0),d=c>0?Math.max(1,Math.floor(u/c)):s;for(let t=d;t<=s;t++){let n=!0;for(let e=t;e<=s&&n;e+=t)n=a(e-t,e);if(!n)continue;let r=[];for(let e=0;e<=s;e+=t)r.push(e);let i=r[r.length-1];return i!==s&&(a(i,s)?r.push(s):r.length>1&&a(r[r.length-2],s)&&(r[r.length-1]=s)),r.map(t=>e[t])}return e.slice(0,1)}function ge(e,t,n,r={}){let{tickSize:i=0,tickPadding:a=8}=r;if(t.length===0)return 0;let s=me(e)?n*l:t.reduce((e,t)=>Math.max(e,o(t.label,n)),0)+3;return Math.ceil(s+i+a)}function _e(e){let{position:t,ticks:n,area:r,tickSize:i=0,tickPadding:a=8,line:o=!1}=e,s=me(t),l=t===`top`||t===`left`?-1:1,u=l*(i+a),d=t===`top`?r.y:t===`bottom`?r.y+r.height:t===`left`?r.x:r.x+r.width,f=s?{y:u,dy:t===`top`?`0em`:`0.71em`,"text-anchor":`middle`}:{x:u,dy:`0.32em`,"text-anchor":t===`left`?`end`:`start`},p=s?{y2:l*i}:{x2:l*i};return O(`g`,{key:`axis-${t}`,class:[`tc-axis`,s?`tc-axis-x`:`tc-axis-y`,`tc-axis-${t}`],"aria-hidden":`true`},o&&O(`line`,s?{class:`tc-axis-line`,x1:r.x,x2:r.x+r.width,y1:d,y2:d}:{class:`tc-axis-line`,x1:d,x2:d,y1:r.y,y2:r.y+r.height}),n.map(e=>O(`g`,{key:e.value,class:`tc-tick`,style:s?`transform:translate(${c(e.position)}px,${c(d)}px)`:`transform:translate(${c(d)}px,${c(e.position)}px)`},i>0&&O(`line`,{class:`tc-tick-line`,...p}),O(`text`,{class:`tc-tick-label`,...f},e.label))))}function ve(e){let{direction:t,ticks:n,area:r}=e;return O(`g`,{key:`grid-${t}`,class:[`tc-grid`,`tc-grid-${t}`],"aria-hidden":`true`},n.map(e=>{let n=c(e.position);return O(`line`,{key:e.value,class:[`tc-grid-line`,e.value===0&&`tc-grid-line-zero`],...t===`y`?{x1:r.x,x2:r.x+r.width,y1:0,y2:0,style:`transform:translateY(${n}px)`}:{x1:0,x2:0,y1:r.y,y2:r.y+r.height,style:`transform:translateX(${n}px)`}})}))}function ye(e,t,n={}){let{paddingInner:r=0,paddingOuter:i=0,align:a=.5}=n,o=Math.min(1,Math.max(0,r)),s=e.length,[c,l]=t,u=l<c,d=u?l:c,f=u?c:l,p=(f-d)/Math.max(1,s-o+i*2),m=d+(f-d-p*(s-o))*a,h=p*(1-o),g=/* @__PURE__ */ new Map;for(let t=0;t<s;t++){let n=e[t];g.has(n)||g.set(n,t)}let _=e=>m+p*(u?s-1-e:e),v=e=>{let t=g.get(e);return t===void 0?void 0:_(t)};return Object.assign(v,{domain:e.slice(),range:[c,l],bandwidth:h,step:p,at:_,center(e){let t=v(e);return t===void 0?void 0:t+h/2},indexAt(e){if(s===0)return-1;let t=p===0?0:Math.round((e-m-h/2)/p),n=Math.min(s-1,Math.max(0,t));return u?s-1-n:n}})}function be(e,t,n={}){let{padding:r=0,align:i}=n;return ye(e,t,{paddingInner:1,paddingOuter:r,...i===void 0?{}:{align:i}})}function xe(e){let t=1/0,n=-1/0;for(let r of e)r!=null&&Number.isFinite(r)&&(r<t&&(t=r),r>n&&(n=r));return t<=n?[t,n]:void 0}function Se(e,t,n={}){let[r,i]=e,[a,o]=t,s=i-r,c=s===0?0:(o-a)/s,l=(a+o)/2,{clamp:u=!1}=n,d=Math.min(a,o),f=Math.max(a,o),p=Math.min(r,i),m=Math.max(r,i);return Object.assign(e=>{if(s===0)return l;let t=a+(e-r)*c;return u?Math.min(f,Math.max(d,t)):t},{domain:[r,i],range:[a,o],invert(e){if(s===0||o===a)return r;let t=r+(e-a)/c;return u?Math.min(m,Math.max(p,t)):t},ticks(e){return ce(r,i,e)},nice(e){return Se(de(r,i,e),t,n)}})}let K=e=>typeof e==`number`&&Math.abs(e)<=1e300?Math.abs(e)<1e-300?0:e:null,Ce=e=>K(e)??void 0,we=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Te=e=>Array.isArray(e)?e:[],Ee=e=>typeof e==`string`?e:K(e)===null?``:String(e),De=e=>typeof e==`string`||K(e instanceof Date?+e:e)!==null?e:``,Oe=e=>{let t=Te(e);return t.every(e=>e==null||K(e)===e)?t:t.map(K)},ke=(e,t)=>Te(e).filter(we).map(t),Ae=e=>({...e,name:Ee(e.name),id:typeof e.id==`string`?e.id:void 0,color:typeof e.color==`string`?e.color:void 0}),je=e=>{let t=we(e)?e:{};return{...t,labels:Array.isArray(t.labels)?t.labels.map(De):void 0,series:ke(t.series,e=>({...Ae(e),values:Oe(e.values)}))}},q=e=>t=>({...t,data:e(t.data)}),Me=e=>ke(e,e=>({...Ae(e),value:K(e.value)??0,max:Ce(e.max)})),J=e=>e.id??e.name;function Ne(e){return e.map((e,t)=>{let n={key:J(e),name:e.name,index:t};return e.color&&(n.color=e.color),e.hidden&&(n.hidden=!0),n})}function Pe(e,t){return{key:J(e),class:[`tc-series`,`tc-series-${t+1}`,e.class],"data-series":e.name,style:{"--tc-series-color":e.color}}}let Y=e=>e instanceof Date?e.getTime():e,X=J,Fe=e=>Ne(e.series);function Ie(e){if(e.labels)return e.labels.slice();let t=Math.max(0,...e.series.map(e=>e.values.length));return Array.from({length:t},(e,t)=>t+1)}function Le(e,t){return e==null||!Number.isFinite(e)?!1:t?.scale!==`log`||e>0}let Re=e=>e.x?.type===`time`&&Ie(e.data).every(e=>Number.isFinite(Be(e)));function ze(e,t){return e.x?.format?e.x.format:Re(e)?D(`dates`)(Ie(e.data),e.x?.utc,t.locale):e=>String(e)}let Be=e=>new Date(e).getTime();function Ve(e,t,n){return n.scale===`log`?D(`log`).scale(e,t):Se(e,t)}function He(e,t,n,r,i){return t.scale===`log`?D(`log`).ticks(e,n,r,i):fe(e,{count:n,format:r,locale:i})}let Ue=e=>{let{shapes:t,patterns:n}=e;return t??n===!0?C[`point-shapes`]:void 0},We=(e,t)=>Math.min(K(e?.ticks)??t,100);function Ge(e,t,n,r,i=/* @__PURE__ */ new Set,a,o=[]){let s=a??e.series.filter(e=>!i.has(X(e))).flatMap(e=>e.values);return Ke(o.length?[...s,...o]:s,t,n,r)}function Ke(e,t,n,r){if(t.scale===`log`)return D(`log`).domain(e,t);let i=K(t.min),a=K(t.max),[o,s]=xe(e)??[0,1];if((t.zero??n)&&(o=Math.min(o,0),s=Math.max(s,0)),o===s){if(o===0)s=1;else{let e=Math.abs(o)*.1;o-=e,s+=e}}if(i!==null&&(o=i),a!==null&&(s=a),t.nice!==!1){let[e,t]=de(o,s,r);i===null&&(o=e),a===null&&(s=t)}return[o,s]}function qe(e){return e.annotations?.length?D(`annotations`):void 0}function Je(e,t,n,r){let i=e.y??{},a=We(i,Math.max(2,r)),o=Ge(e.data,i,n.zero,a,t.hidden,n.values,qe(e)?.values(e.annotations)),s=n.tickFormat??i.format,c=e=>Ve(o,e,i),l=e=>He(e,i,a,s,t.locale);return{scale:c,ticks:l,probe:l(c([0,1]))}}function Ye(e,t,n,r,i,a){let{area:o,x:s,y:c,xTicks:l,yTicks:u,horizontal:d}=r,f=e.x??{},p=t.rtl?`right`:`left`,m=qe(e)?.layers(e.annotations,{area:o,horizontal:d,fontSize:t.fontSize,value:c,band:s,keys:i,time:a}),h=e.y?.show!==!1&&[_e({position:d?`bottom`:p,ticks:u,area:o})],g=(f.show!==!1&&r.labels.length>0||f.line)&&[_e({position:d?p:`bottom`,ticks:l,area:o,line:f.line===!0})],_=e=>e.flatMap(e=>e||[]);return{...r,background:_([e.y?.grid!==!1&&ve({direction:d?`x`:`y`,ticks:u,area:o}),f.grid&&ve({direction:d?`y`:`x`,ticks:l,area:o}),m?.under]),foreground:_([m?.over,d?g:h,d?h:g]),clip:Ze(t,o,n)}}function Xe(e,i,a){let{data:s}=e,c=e.y??{},u=e.x??{},{fontSize:d,locale:f,width:p,height:m}=i,h=a.overhang??0,g=i.rtl===!0,_=u.reverse??g,v=n(t(e.padding),g),y=Ie(s),b=ze(e,i),x=c.show!==!1,S=u.show!==!1&&y.length>0,C=Re(e)&&a.scale===`point`,w=Je(e,i,a,Math.round(m/60)),T=w.probe,E=Math.max(2,Math.round(p/80)),O=y.map(Y),k=e=>b(y[e],e),A=C?D(`time`).axis(y,O,u,E,f):{edges:y.length?[k(0),k(y.length-1)]:[],scale:e=>a.scale===`point`?be(O,e):ye(O,e,{paddingInner:a.paddingInner??.3,paddingOuter:a.paddingOuter??.15}),ticks:e=>pe(e,(e,t)=>k(t))},j=A.edges,M=Math.ceil(d*l/2),N=e=>S?o(j[e?j.length-1:0]??``,d):0,P=N(_!==g),F=N(_===g),ee=a.scale===`point`,I=x?ge(`left`,T,d):0,L=e=>{let t=t=>ee?Math.ceil(t/2):Math.max(0,Math.ceil(t/2-e));return{right:v.right+Math.max(t(F),h,8),left:v.left+Math.max(I,t(P),h,x?0:8)}},R=Math.max(1,y.length)*2,z=L((p-v.left-v.right-I)/R);ee||(z=L((p-z.left-z.right)/R));let B=r(p,m,{top:v.top+Math.max(x?M:0,h,4),bottom:v.bottom+Math.max(S?ge(`bottom`,[T[0]],d):x?M:0,h,4),...n(z,g)}),V=B.x+B.width,H=A.scale(_?[V,B.x]:[B.x,V]),U=w.scale([B.y+B.height,B.y]),W=he(w.ticks(U),`left`,d,4);return Ye(e,i,h,{area:B,labels:y,x:H,y:U,horizontal:!1,xTicks:S?he(A.ticks(H),`bottom`,d):[],yTicks:W},O,A.time)}function Ze(e,t,n){let r=`${e.id}-clip`,i=n+1;return{def:O(`clipPath`,{id:r},O(`rect`,{x:t.x-i,y:t.y-i,width:t.width+i*2,height:t.height+i*2})),url:`url(#${r})`}}function Qe(e,t){let{dash:n,width:r}=e;return{...Pe(e,t),style:{"--tc-series-color":e.color,"--tc-series-dash":Number.isFinite(n)?`${n}px`:n,"--tc-series-width":Number.isFinite(r)?`${r}px`:void 0}}}function $e(e,t,n,r,i){let{area:a,x:o,labels:s,horizontal:c}=e,{data:l}=t,u=ze(t,n),d=W(t.y?.format,n.locale),f=e=>{let i=o.at(e),f=i+o.bandwidth/2,p=s[e],m=c?{x:a.x,y:f}:{x:f,y:null},h=[];l.series.forEach((i,a)=>{if(n.hidden.has(X(i)))return;let o=i.values[e],s=Le(o,t.y)?o:null,c=s===null?m:r(a,e,s),l={name:i.name,seriesIndex:a,value:s,text:s===null?`–`:d(s),...c};i.color&&(l.color=i.color),h.push(l)});let g={index:e,label:Y(p),title:u(p,e),x:c?a.x+a.width/2:f,area:a,items:h};return c&&(g.y=f,g.axis=`y`),o.bandwidth>0&&(g.band=c?{x:a.x,y:i,width:a.width,height:o.bandwidth}:{x:i,y:a.y,width:o.bandwidth,height:a.height}),g};return{count:s.length,reversed:o.range[1]<o.range[0],hitTest(e,t){if(s.length===0||e<a.x-8||e>a.x+a.width+8||t<a.y-8||t>a.y+a.height+8)return null;let n=o.indexAt(c?t:e),r=f(n),l=i?.(e,t,n);return l!==void 0&&(r.seriesIndex=l),r},hitIndex(e,t){if(e<0||e>=s.length)return null;let n=f(e);return t!==void 0&&n.items.some(e=>e.seriesIndex===t)&&(n.seriesIndex=t),n}}}function et(e,t,n=1/0){let r=Ie(e.data),i=r.length>n?r.slice(0,n):r,a=ze(e,t),o=W(e.y?.format,t.locale),s=e.data.series.filter(e=>!t.hidden.has(X(e)));return{columns:[``,...s.map(e=>e.name)],total:r.length,rows:i.map((e,t)=>[a(e,t),...s.map(e=>{let n=e.values[t];return n==null||!Number.isFinite(n)?`–`:o(n)})])}}function tt(e,t){if(e.time){let n=e.time(new Date(Be(t)));return Number.isFinite(n)?[n,n]:void 0}let n=e.keys.indexOf(Y(t));return n<0?void 0:[e.band.at(n),e.band.at(n)+e.band.bandwidth]}let nt=(e,t)=>{if(!Array.isArray(e))return t(e);let n=e.map(t);return n.length===2&&!n.includes(null)?n:null},rt=e=>e===void 0?e:ke(e,e=>({...e,y:e.y===void 0?e.y:nt(e.y,K),x:e.x===void 0?e.x:nt(e.x,De),label:e.label==null?void 0:Ee(e.label),color:typeof e.color==`string`?e.color:void 0})).filter(e=>e.y!==null&&e.x!==null&&(e.x??e.y)!==void 0),it=e=>Array.isArray(e);function at(e){let t=[];for(let n of rt(e)??[])if(n.y!==void 0)for(let e of it(n.y)?n.y:[n.y])Number.isFinite(e)&&t.push(e);return t}function ot(e,t){if(e=rt(e),!e?.length)return{under:null,over:null};let{area:n,horizontal:r,fontSize:i}=t,a=[],s=[],l=n.x,u=n.x+n.width,d=n.y,f=n.y+n.height,p=(e,t,n)=>e>=t-.5&&e<=n+.5,m=e.map(e=>{let n,i;if(e.y!==void 0){let[a,o]=it(e.y)?e.y:[e.y,e.y];if(!Number.isFinite(a)||!Number.isFinite(o))return;n=[t.value(a),t.value(o)],i=r}else if(e.x!==void 0){let[a,o]=it(e.x)?e.x:[e.x,e.x],s=tt(t,a),c=tt(t,o);if(!s||!c)return;n=it(e.x)?[Math.min(s[0],c[0]),Math.max(s[1],c[1])]:[(s[0]+s[1])/2,(s[0]+s[1])/2],i=!r}else return;let a=Math.min(n[0],n[1]),o=Math.max(n[0],n[1]),[s,c]=i?[l,u]:[d,f];if(p(a,s,c)||p(o,s,c)||a<s&&o>c)return{a0:Math.max(a,s),a1:Math.min(o,c),vertical:i}}),h=[],g=[];m.forEach((e,t)=>{if(!e||e.a1-e.a0>.5)return;let n=e.a0;g.push([t,e.vertical?[n-1.5,d,n+1.5,f]:[l,n-1.5,u,n+1.5]])});let _=(e,[t,n,r,i])=>e[2]<=t||e[0]>=r||e[3]<=n||e[1]>=i,v=e=>h.every(t=>_(e,t)),y=(e,t)=>v(e)&&g.every(([n,r])=>n===t||_(e,r));return e.forEach((e,t)=>{let n=e.id??t,r=t=>({key:t?`${n}-${t}`:n,class:[`tc-annotation`,e.y===void 0?`tc-annotation-x`:`tc-annotation-y`,e.class],style:{"--tc-annotation-color":e.color}}),p=e.position!==`start`,g=m[t];if(!g)return;let{a0:_,a1:b,vertical:x}=g,S;if(e.label){let n=o(e.label,i*.92),r=b-_<=.5,a=[];if(x){let e=_+4,t=r?_-4-n:Math.max(l,b-4-n),o=e+n<=u?[e,t]:[t,e],s=p?d+i:f-4,c=(p?1:-1)*i*1.2;for(let e of o)if(!(e<l||e+n>u))for(let t=0;t<3;t++)a.push([e,s+t*c]);a.length||a.push([Math.max(l+4,o[0]),s])}else{let e=p?u-4-n:l+4,t=p?l+4:u-4-n;for(let n of[e,t])r?a.push([n,_-4],[n,_+i]):a.push([n,_+i],[n,b-4])}let s=([e,t])=>[e,t-i,e+n,t+i*.25],m=a.find(e=>y(s(e),t))??a.find(e=>v(s(e)))??a[0];h.push(s(m)),S=O(`text`,{class:`tc-annotation-label`,x:c(m[0]),y:c(m[1])},e.label)}if(b-_>.5){let e=x?`M${c(_)},${c(d)}H${c(b)}V${c(f)}H${c(_)}Z`:`M${c(l)},${c(_)}H${c(u)}V${c(b)}H${c(l)}Z`;a.push(O(`g`,r(),O(`path`,{class:`tc-annotation-band`,d:e}))),S&&s.push(O(`g`,r(`label`),S));return}let C=c(_);s.push(O(`g`,r(),O(`line`,x?{class:`tc-annotation-line`,x1:C,x2:C,y1:c(d),y2:c(f)}:{class:`tc-annotation-line`,x1:c(l),x2:c(u),y1:C,y2:C}),S))}),{under:a.length?O(`g`,{key:`annotations-under`,class:`tc-annotations`,"aria-hidden":`true`},a):null,over:s.length?O(`g`,{key:`annotations-over`,class:`tc-annotations`,"aria-hidden":`true`},s):null}}function st(e,t,n){let r=e[0],i=e[e.length-1],a=r!==void 0&&i!==void 0?Math.abs(Be(i)-Be(r)):0,o=re({year:`numeric`,month:`short`,day:`numeric`,...a>0&&a<2592e5?{hour:`numeric`,minute:`2-digit`}:{},...t?{timeZone:`UTC`}:{}},n);return e=>Number.isFinite(Be(e))?o(Be(e)):String(e)}function ct(e,t,n={}){let r=n.base&&n.base>1?n.base:10,i=n.clamp===!0,a=e[0]<0||e[1]<0?-1:1,o=e=>Math.max(Number.MIN_VALUE,e*a),s=Math.log(r),c=r===10?Math.log10:r===2?Math.log2:e=>Math.log(e)/s,l=e=>c(o(e)),u=e=>a*r**e,d=l(e[0]),f=l(e[1]),[p,m]=t,h=f-d,g=h===0?0:(m-p)/h,_=Math.min(p,m),v=Math.max(p,m);return Object.assign(e=>{if(h===0)return(p+m)/2;let t=p+(l(e)-d)*g;return i?Math.min(v,Math.max(_,t)):t},{domain:[e[0],e[1]],range:[p,m],invert(t){return h===0||m===p?e[0]:u(d+(t-p)/g)},ticks(e=5){let t=Math.min(d,f),n=Math.max(d,f);if(!Number.isFinite(t)||!Number.isFinite(n))return[];let i=Math.floor(t),o=Math.ceil(n),s=o-i,c=e=>{let r=l(e);return r>=t-1e-9&&r<=n+1e-9},u=[];if(s<=e&&Number.isInteger(r)){let t=e=>{let t=[];for(let n=i;n<=o;n++)for(let i=1;i<r;i++){let o=a*i*r**n;e(i)&&c(o)&&t.push(o)}return t};u=t(()=>!0),u.length>e*2&&(u=t(e=>e===1||e===2||e===5)),u.length>e*2&&(u=t(e=>e===1))}else{let i=Math.max(1,Math.ceil(s/Math.max(1,e)));for(let e=Math.ceil(t/i)*i;e<=n+1e-9;e+=i){let t=a*r**e;c(t)&&u.push(t)}}return f<d?u.reverse():u},nice(){let e=u(Math.floor(Math.min(d,f))),r=u(Math.ceil(Math.max(d,f)));return ct(f<d?[r,e]:[e,r],t,n)}})}function lt(e,t){let[n,r]=xe(e.filter(e=>e!=null&&e>0&&Number.isFinite(e)))??[1,10],i=K(t.min),a=K(t.max);if(i!==null&&i>0&&(n=i),a!==null&&a>0&&(r=a),n===r&&(r=n*10),t.nice!==!1){let e=ct([n,r],[0,1]).nice().domain;i===null&&(n=e[0]),a===null&&(r=e[1])}return[n,r]}function ut(e,t,n,r){let i=z(n,r);return e.ticks(t).map(t=>({value:t,position:e(t),label:i(t)}))}function dt(e){return e?`${e.index}:${e.seriesIndex??``}`:``}function ft(e,t,n,r,i){let a=e.getBoundingClientRect(),o=a.width>0?r/a.width:1,s=a.height>0?i/a.height:1;return{x:(t-a.left)*o,y:(n-a.top)*s}}function pt(e,t){return O(`div`,{class:`tc-legend-items`},e.map(e=>{let n=t.has(e.key);return O(`button`,{key:e.key,type:`button`,class:[`tc-legend-item`,`tc-series`,`tc-series-${e.index+1}`,n&&`tc-legend-item-hidden`],style:{"--tc-series-color":e.color},"aria-pressed":n?`false`:`true`,"data-key":e.key},O(`span`,{class:`tc-legend-swatch`,"aria-hidden":`true`}),O(`span`,{class:`tc-legend-name`},e.name))}))}function mt(e){return new Set(e.filter(e=>e.hidden).map(e=>e.key))}let ht=/^[a-zA-Z_][\w:.-]*$/,gt=/^on/i;function _t(e){return ht.test(e)}function vt(e){return ht.test(e)&&!gt.test(e)}let yt=`http://www.w3.org/2000/svg`,bt=`http://www.w3.org/1999/xhtml`,Z=/* @__PURE__ */ new WeakMap,xt=/* @__PURE__ */ new WeakMap;function St(e,t,n){let r=xt.get(e)??(n?.parentNode===e?n:void 0);if(t===null||!_t(t.tag))return r&&(r.remove(),xt.delete(e)),null;if(r&&Ot(r,t))return At(r,t),xt.set(e,r),r;if(r&&C.hydrate?.(r,t,Ct(e,t.tag)))return xt.set(e,r),r;let i=Dt(t,Ct(e,t.tag),e.ownerDocument);return r?r.replaceWith(i):e.appendChild(i),xt.set(e,i),i}function Ct(e,t){return t===`svg`||e.namespaceURI===`http://www.w3.org/2000/svg`&&e.localName!==`foreignObject`?yt:bt}function wt(e){return e.namespaceURI===`http://www.w3.org/2000/svg`&&e.localName!==`foreignObject`?yt:bt}function Tt(e,t,n){if(typeof e==`string`){let t=n.createTextNode(e);return Z.set(t,e),t}return _t(e.tag)?Dt(e,e.tag===`svg`?yt:t,n):null}function Et(e,t,n){t===`style`?e.style.cssText=n:e.setAttribute(t,n)}function Dt(e,t,n){let r=n.createElementNS(t,e.tag),{attrs:i}=e;for(let e in i)vt(e)&&Et(r,e,String(i[e]));let a=wt(r);for(let t of e.children){let e=Tt(t,a,n);e&&r.appendChild(e)}return Z.set(r,e),r}function Ot(e,t){let n=Z.get(e);return n===void 0?!1:typeof t==`string`?typeof n==`string`:typeof n!=`string`&&n.tag===t.tag&&n.key===t.key}function kt(e,t){typeof t==`string`?Z.get(e)!==t&&(e.data=t,Z.set(e,t)):At(e,t)}function At(e,t){let n=Z.get(e);n!==t&&(jt(e,n.attrs,C.sweep?.(e,n,t)??t.attrs,!0),Mt(e,t.children),Z.set(e,t))}function jt(e,t,n,r=!1){for(let i in n){let a=n[i];t[i]!==a&&vt(i)&&(r&&i===`d`&&C.morph?.(e,String(t[i]??``),String(a))||Et(e,i,String(a)))}for(let r in t)!(r in n)&&vt(r)&&e.removeAttribute(r)}function Mt(e,t){if(t.length===0&&e.firstChild===null)return;let n=Array.from(e.childNodes),r=/* @__PURE__ */ new Map,i=[];for(let e of n){let t=Z.get(e);t!==void 0&&(typeof t!=`string`&&t.key!==void 0?r.set(t.key,e):i.push(e))}let a=Array(t.length),o=/* @__PURE__ */ new Set,s=0;for(let e=0;e<t.length;e++){let n=t[e],c;typeof n!=`string`&&n.key!==void 0?c=r.get(n.key):s<i.length&&(c=i[s]),c&&!o.has(c)&&Ot(c,n)&&(a[e]=c,o.add(c),c===i[s]&&s++)}for(let t of n)o.has(t)||e.removeChild(t);let c=wt(e),l=e.ownerDocument,u=null;for(let n=t.length-1;n>=0;n--){let r=t[n],i=a[n];if(i)kt(i,r);else if(i=Tt(r,c,l)??void 0,!i)continue;(i.parentNode!==e||i.nextSibling!==u)&&e.insertBefore(i,u),u=i}}let Nt=/* @__PURE__ */ new Set([`a`,`b`,`button`,`caption`,`div`,`em`,`i`,`label`,`li`,`ol`,`p`,`section`,`small`,`span`,`strong`,`table`,`tbody`,`td`,`th`,`thead`,`tr`,`ul`]),Pt=/* @__PURE__ */ new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`]);function Ft(e,t={}){return typeof e==`string`?Ut(e):It(t.xmlns!==!1&&e.tag===`svg`&&e.attrs.xmlns===void 0?{...e,attrs:{xmlns:`http://www.w3.org/2000/svg`,...e.attrs}}:e,t.namespace?t.namespace===`svg`:!Nt.has(e.tag))}function It(e,t){let{tag:n,attrs:r,children:i}=e;if(!_t(n))return``;let a=t||n===`svg`,o=`<${n}`;for(let e in r)vt(e)&&(o+=` ${e}="${Wt(String(r[e]))}"`);if(i.length===0){if(a)return`${o}/>`;if(Pt.has(n.toLowerCase()))return`${o}>`}o+=`>`;let s=a&&n!==`foreignObject`;for(let e of i)o+=typeof e==`string`?Ut(e):It(e,s);return`${o}</${n}>`}let Lt=/[&<>]/,Rt=/[&"<>]/,zt=/[&<>]/g,Bt=/[&"<>]/g,Vt={"&":`&`,"<":`<`,">":`>`,'"':`"`},Ht=e=>Vt[e];function Ut(e){return Lt.test(e)?e.replace(zt,Ht):e}function Wt(e){return Rt.test(e)?e.replace(Bt,Ht):e}let Gt=/* @__PURE__ */ new WeakMap,Kt=/* @__PURE__ */ new WeakSet,qt;function Jt(){return qt||typeof ResizeObserver!=`function`||(qt=new ResizeObserver(e=>{for(let{target:t,contentRect:n}of e)t.isConnected?(Kt.add(t),Gt.get(t)?.(n.width,n.height)):Kt.has(t)&&(Kt.delete(t),qt?.unobserve(t))})),qt}function Yt(e,t){let n=Jt();return n?(Gt.set(e,t),n.observe(e),()=>{Gt.get(e)===t&&(Gt.delete(e),n.unobserve(e))}):()=>{}}let Xt=/* @__PURE__ */ new Map,Zt=!1,Qt=e=>{typeof requestAnimationFrame==`function`?requestAnimationFrame(e):queueMicrotask(e)};function $t(e){try{e()}catch(e){setTimeout(()=>{throw e})}}function en(e,t){Xt.set(e,t),Zt||(Zt=!0,Qt(rn))}let tn={};function nn(e){Xt.delete(e)}function rn(){Zt=!1;let e=0,t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Map;do{for(let[r,i]of Xt)Xt.delete(r),t.has(r)?n.set(r,i):(t.add(r),$t(i),e++);e+=tn.idle?.()??0}while(Xt.size>0);for(let[e,t]of n)en(e,t);return e}let an=0,on=()=>`tc-${++an}`;function sn(e,t){let n=t?.width??0,r=Math.max(0,Math.round(Number.isFinite(e.width)?e.width:n>0?n:600)),i=e.aspectRatio&&e.aspectRatio>0?e.aspectRatio:2,a=Number.isFinite(e.height)?e.height:e.height===`container`&&(t?.height??0)>0?t?.height:r/i;return{width:r,height:Math.max(0,Math.round(a))}}function cn(e,t,n,r,i,a,o){let s,c=ln(e,t,n,e=>{s=e,r(e)},i,a,o),l=e.type.render(e,c);return C.post?C.post(e,l,s,c):l}function ln(e,t,n,r,i,a,o=e.rtl===!0){return{rtl:o,width:t.width,height:t.height,fontSize:e.fontSize??a??12,locale:e.locale,id:n,onHitTest:r,hidden:i}}function un(e){let t={...e.type?.clean?e.type.clean(e):e};for(let e in t)typeof t[e]==`number`&&!Number.isFinite(t[e])&&delete t[e];return t}function dn(e){if(!e.type||typeof e.type.render!=`function`)throw TypeError("@tabler/charts: `type` must be a chart type such as line.")}function fn(e){let t=e.type.legend?.(e)??[],n=e.legend;return{items:t,show:n===void 0?t.length>=2:n!==!1&&t.length>0,position:typeof n==`object`&&n.position===`bottom`?`bottom`:`top`}}function pn(e){if(e.title)return e.title;let t=(e.type.legend?.(e)??[]).map(e=>e.name).filter(Boolean),n=t.slice(0,6).join(`, `);return`${e.type.name} chart${t.length?`: ${n}${t.length>6?`, …`:``}`:``}`}let mn=e=>Array.isArray(e)?e.reduce((e,t)=>e+mn(t),0):e&&typeof e==`object`?1+mn(e.children):0,hn=(e,t)=>e.animate===!1||e.animate!==!0&&mn(t)>1e3;function gn(e,t,n,r,i,a,o,s,c=e.rtl===!0){let{width:l,height:u}=t,d=e.description?`${n}-desc`:void 0,{patterns:f}=e,p=f===!1?void 0:(f===!0?D(`patterns`):C.patterns)?.(e,n);return O(`svg`,{class:[`tc-chart`,`tc-chart-${e.type.name}`,r&&`tc-static`,c&&`tc-rtl`,p?.[0],e.class],style:p?.[1],viewBox:`0 0 ${l} ${u}`,width:l,height:u,role:`img`,"aria-label":pn(e),"aria-describedby":d,...s},d&&O(`desc`,{key:`desc`,id:d},e.description),p?.[2],a&&O(`g`,{key:`hover-under`,class:`tc-hover-layer`},a),i,o&&O(`g`,{key:`hover-over`,class:`tc-hover-layer`},o))}function _n(e,t,n=e.id??`tc`,r=()=>{}){dn(e),e=un(e);let i=mt(fn(e).items),a=cn(e,t,n,r,i),o=e;return gn(o,t,n,hn(o,a),a)}function vn(e,t){return Ft(_n(e,t))}let yn=[`hover`,`click`,`legend-toggle`,`render`],bn=/* @__PURE__ */ new WeakMap;var xn=class{element;id;#e;#t=(e,t)=>{let n=this.#e.height===`container`,r=e!==this.#n.width||n&&t!==this.#n.height;this.#n={width:e,height:t},r&&(e||t)&&(this.#h=void 0,this.#S(),this.#C())};#n={};#r=/* @__PURE__ */ new Map;#i;#a=[];#o=!1;#s;#c;#l=``;#u=null;#d;#f;#p=/* @__PURE__ */ new Map;#m;#h;#g=!1;constructor(e,t,n=[]){let r=typeof e==`string`?document.querySelector(e):e;if(!r)throw Error(`@tabler/charts: element "${String(e)}" not found.`);bn.get(r)?.destroy(),bn.set(r,this),this.element=r,this.#e=un(t),this.id=t.id??on(),this.#m=r.querySelector(`:scope > svg.tc-chart`),this.#T(),this.#i=Yt(r,this.#t);try{for(let e of[...n,...t.plugins??[]])this.#a.push(e.install(this));this.render()}catch(e){throw this.destroy(),e}}get config(){return this.#e}get size(){let e=this.#n;if(this.#e.height===`container`&&e.height){let t=0;for(let e of this.#a)t+=e.reservedHeight?.()??0;t&&(e={...e,height:e.height-t})}return sn(this.#e,e)}get rtl(){let e=this.#e;return this.#h===void 0&&(this.#g=e.rtl===`auto`?typeof getComputedStyle==`function`&&getComputedStyle(this.element).direction===`rtl`:e.rtl===!0,this.#h=e.fontSize??this.#w()),this.#g}get fontSize(){return this.#d?.fontSize??this.#e.fontSize??12}get interaction(){return this.#s}get active(){return this.#u}get pointer(){let e=this.#c;return this.#u&&e?.kind===`pointer`?{x:e.x,y:e.y}:void 0}get highlightSource(){return this.#u?this.#c?.kind:void 0}highlightIndex(e,t){let n=this.#s?.hitIndex(e,t)??null;return n?(this.#c={kind:`index`,index:e,seriesIndex:t},this.#b(n),n):null}highlightAt(e,t,n){let r=this.hitTest(e,t);return this.#c={kind:`pointer`,x:e,y:t},this.#b(r,n),r}clearHighlight(e){this.#c=void 0,this.#b(null,e)}toggleSeries(e,t){let{items:n}=fn(this.#e),r=typeof e==`number`?n.find(t=>t.index===e):n.find(t=>t.key===e)??n.find(t=>t.name===e);if(!r)return this;let i=t??!this.#x(n).has(r.key);return this.#p.set(r.key,i),this.emit(`legend-toggle`,{key:r.key,name:r.name,index:r.index,hidden:i}),this.#C(),this}isHidden(e){return this.#x(fn(this.#e).items).has(e)}update(e){this.#e=un({...this.#e,...e});for(let t in e)t!==`data`&&(this.#h=void 0);return this.#C(),this}setConfig(e){return this.#e=un(e),this.#h=void 0,this.#C(),this}setData(e){return this.update({data:e})}resize(){return this.#o||(this.#i=Yt(this.element,this.#t)),this.#T(),this.#h=void 0,this.#C(),this}render(){if(this.#o)return this;nn(this);let e=this.#e,t=e;dn(t);let n=fn(e),r=this.#x(n.items);for(let e of this.#a)e.beforeRender?.({config:t,legend:n,hidden:r});let i=this.size,{content:a,stale:o,changed:s}=this.#_(i,r);o&&this.#v();let c=this.#m;St(this.element,this.#y(a,i),c),this.#m=null,c&&this.#S();for(let e of this.#a)e.afterRender?.({config:t,legend:n,hidden:r,size:i,stale:o,changed:s});return o&&this.emit(`render`,{size:i}),this}#_(e,t){let n=this.#e,r=[...t].sort().join(`\0`),i=this.rtl,a=n.fontSize??this.#h,o=this.#d,s=!o||o.cfg!==n||o.hidden!==r,c=s||o?.width!==e.width||o.height!==e.height||o.fontSize!==a||o.rtl!==i;if(!o||c){this.#s=void 0;let s=cn(n,e,this.id,e=>{this.#s=e},t,a,i);o={cfg:n,width:e.width,height:e.height,hidden:r,fontSize:a,rtl:i,content:s,still:hn(n,s)},this.#d=o}return{content:o,stale:c,changed:s}}#v(){let e=this.#c;if(!e)return;let t=e.kind===`pointer`?this.hitTest(e.x,e.y):this.#s?.hitIndex(e.index,e.seriesIndex)??null;this.#b(t,void 0,!0,!1)}#y(e,t){let n=this.#e,r=this.#u,i=[],a=[],o;for(let e of this.#a){if(r&&e.layers){let t=e.layers(r,n);i.push(t.under),a.push(t.over)}let t=e.svgAttrs?.(n);t&&(o={...o,...t})}return gn(n,t,this.id,e.still,e.content,i.length?i:void 0,a.length?a:void 0,o,e.rtl)}hitTest(e,t){return this.#s?.hitTest(e,t)??null}on(e,t){let n=this.#r.get(e);return n||(n=/* @__PURE__ */ new Set,this.#r.set(e,n)),n.add(t),()=>{n.delete(t)}}destroy(){if(!this.#o){this.#o=!0,bn.get(this.element)===this&&bn.delete(this.element),nn(this),clearTimeout(this.#f),this.#i();for(let e of this.#a)e.destroy?.();this.#r.clear(),St(this.element,null)}}#b(e,t,n=!1,r=!0){let i=dt(e);!n&&i===this.#l||n&&i===``&&this.#l===``||(this.#l=i,this.#u=e,this.emit(`hover`,t?{hit:e,event:t}:{hit:e}),r&&this.#C())}#x(e){let t=/* @__PURE__ */ new Set;for(let n of e)(this.#p.get(n.key)??n.hidden)&&t.add(n.key);return t}#S(){let e=this.element.querySelector(`:scope > svg.tc-chart`);e&&(e.setAttribute(`data-resizing`,``),clearTimeout(this.#f),this.#f=setTimeout(()=>e.removeAttribute(`data-resizing`),200))}#C(){this.#o||en(this,()=>this.render())}#w(){if(typeof getComputedStyle!=`function`)return;let e=Number.parseFloat(getComputedStyle(this.element).getPropertyValue(`--tc-font-size`));return Number.isFinite(e)&&e>0?e:void 0}#T(){let e=this.element,t=typeof getComputedStyle==`function`?getComputedStyle(e):void 0,n=e=>Number.parseFloat(e??``)||0;this.#n={width:e.clientWidth-n(t?.paddingLeft)-n(t?.paddingRight),height:e.clientHeight-n(t?.paddingTop)-n(t?.paddingBottom)}}emit(e,t){let n=this.#r.get(e);if(n)for(let e of n)e(t)}};let Sn=[`M-2,2L2,-2M0,8L8,0M6,10L10,6`,`M2,2h.01M6,6h.01`,`M-2,6L2,10M0,0L8,8M6,-2L10,2`,`M0,4H8`,`M0,8L8,0M0,0L8,8`,`M4,0V8`,`M0,4H8M4,0V8`,`M1,2H4M5,6H8`],Cn=Sn.length,wn=e=>e<Cn?[`${e+1}`,`tc-series-${e+1}`]:[`other`,``];function Tn(e,t){let n=/* @__PURE__ */ new Map;for(let r of e){let[e,i]=wn(r.index);n.has(e)||n.set(e,O(`pattern`,{key:e,id:`${t}-pattern-${e}`,class:[`tc-pattern`,`tc-series`,i],width:8,height:8,patternUnits:`userSpaceOnUse`,style:{"--tc-series-color":r.color}},O(`rect`,{class:`tc-pattern-bg`,width:8,height:8}),O(`path`,{class:`tc-pattern-ink`,d:Sn[r.index%Cn]})))}return[...n.values()]}function En(e,t){let n={};for(let r of e){let[e]=wn(r.index);n[`--tc-pattern-${e}`]=`url(#${t}-pattern-${e})`}return n}function Dn(e,t){let{items:n}=fn(e);if(n.length)return[e.patterns===!0?`tc-patterned`:`tc-patterns-auto`,En(n,t),O(`defs`,{key:`patterns`},Tn(n,t))]}let On=[[],[-.9,-.9,.9,-.9,.9,.9,-.9,.9],[0,-1.3,1.2,.9,-1.2,.9],[0,-1.3,1.3,0,0,1.3,-1.3,0],[-1.2,-.9,1.2,-.9,0,1.3],[-.4,-1.2,.4,-1.2,.4,-.4,1.2,-.4,1.2,.4,.4,.4,.4,1.2,-.4,1.2,-.4,.4,-1.2,.4,-1.2,-.4,-.4,-.4],[-.7,-1.2,0,-.5,.7,-1.2,1.2,-.7,.5,0,1.2,.7,.7,1.2,0,.5,-.7,1.2,-1.2,.7,-.5,0,-1.2,-.7],[0,-1.4,.32,-.44,1.33,-.43,.52,.17,.82,1.13,0,.55,-.82,1.13,-.52,.17,-1.33,-.43,-.32,-.44]];function kn(e,t,n,r){let i=On[e]??[];if(!i.length)return`M${c(t-r)},${c(n)}a${r},${r},0,1,0,${2*r},0a${r},${r},0,1,0,${-2*r},0Z`;let a=``;for(let e=0;e<i.length;e+=2)a+=`${e?`L`:`M`}${c(t+i[e]*r)},${c(n+i[e+1]*r)}`;return`${a}Z`}function An(e,t){if(Array.isArray(e))return e.map(e=>An(e,t));if(!e||typeof e!=`object`)return e;let{attrs:n}=e,r=String(n.class??``),i=/\btc-series-(\d+)\b/.exec(r);return e.tag===`circle`&&t>=0&&/\btc-point\b/.test(r)&&!/\btc-bubble\b/.test(r)?{tag:`path`,attrs:{class:`${r} tc-marker`,d:kn(t,+(n.cx??0),+(n.cy??0),+(n.r??0))},children:[],key:e.key}:{...e,children:e.children.map(e=>An(e,i?Number(i[1])-1:t))}}let jn=(e,t)=>e.shapes??e.patterns===!0?An(t,-1):t,Mn=1e3,Nn=60*Mn,Pn=60*Nn,Fn=24*Pn,In=30*Fn,Ln=365*Fn,Rn=[{unit:`second`,step:1,ms:Mn},{unit:`second`,step:5,ms:5*Mn},{unit:`second`,step:15,ms:15*Mn},{unit:`second`,step:30,ms:30*Mn},{unit:`minute`,step:1,ms:Nn},{unit:`minute`,step:5,ms:5*Nn},{unit:`minute`,step:15,ms:15*Nn},{unit:`minute`,step:30,ms:30*Nn},{unit:`hour`,step:1,ms:Pn},{unit:`hour`,step:3,ms:3*Pn},{unit:`hour`,step:6,ms:6*Pn},{unit:`hour`,step:12,ms:12*Pn},{unit:`day`,step:1,ms:Fn},{unit:`day`,step:2,ms:2*Fn},{unit:`week`,step:1,ms:6048e5},{unit:`month`,step:1,ms:In},{unit:`month`,step:3,ms:3*In},{unit:`year`,step:1,ms:Ln}];function zn(e){let t=(t,n)=>{switch(n){case`year`:return e?t.getUTCFullYear():t.getFullYear();case`month`:return e?t.getUTCMonth():t.getMonth();case`day`:case`week`:return e?t.getUTCDate():t.getDate();case`hour`:return e?t.getUTCHours():t.getHours();case`minute`:return e?t.getUTCMinutes():t.getMinutes();default:return e?t.getUTCSeconds():t.getSeconds()}},n=(t,n,r,i=0,a=0,o=0)=>e?new Date(Date.UTC(t,n,r,i,a,o)):new Date(t,n,r,i,a,o),r=t=>e?t.getUTCDay():t.getDay();return{floor:(e,{unit:i,step:a})=>{let o=t(e,`year`),s=t(e,`month`),c=t(e,`day`);switch(i){case`year`:return n(Math.floor(o/a)*a,0,1);case`month`:return n(o,Math.floor(s/a)*a,1);case`week`:return n(o,s,c-(r(e)+6)%7);case`day`:return n(o,s,Math.floor((c-1)/a)*a+1);case`hour`:return n(o,s,c,Math.floor(t(e,`hour`)/a)*a);case`minute`:return n(o,s,c,t(e,`hour`),Math.floor(t(e,`minute`)/a)*a);default:return n(o,s,c,t(e,`hour`),t(e,`minute`),Math.floor(t(e,`second`)/a)*a)}},next:(e,{unit:r,step:i})=>{let a=t(e,`year`),o=t(e,`month`),s=t(e,`day`);switch(r){case`year`:return n(a+i,0,1);case`month`:return n(a,o+i,1);case`week`:return n(a,o,s+7*i);case`day`:{let e=n(a,o,s+i);return t(e,`month`)===o?e:n(a,o+1,1)}case`hour`:return n(a,o,s,t(e,`hour`)+i);case`minute`:return n(a,o,s,t(e,`hour`),t(e,`minute`)+i);default:return n(a,o,s,t(e,`hour`),t(e,`minute`),t(e,`second`)+i)}},boundary:(e,n)=>{switch(n){case`second`:return t(e,`second`)===0;case`minute`:return t(e,`minute`)===0&&t(e,`second`)===0;case`hour`:return t(e,`hour`)===0&&t(e,`minute`)===0;case`day`:case`week`:return t(e,`day`)===1;case`month`:return t(e,`month`)===0;default:return!1}}}}function Bn(e,t){let n=Math.abs(e)/Math.max(1,t),r=0;for(;r<Rn.length&&Rn[r].ms<n;)r++;if(r===Rn.length){let e=Math.max(1,ue(0,n/Ln,1));return{unit:`year`,step:e,ms:e*Ln}}if(r===0)return Rn[0];let i=Rn[r-1],a=Rn[r];return n/i.ms<a.ms/n?i:a}let Vn=e=>e instanceof Date?e.getTime():e,Hn={second:[{hour:`numeric`,minute:`2-digit`,second:`2-digit`},{hour:`numeric`,minute:`2-digit`}],minute:[{hour:`numeric`,minute:`2-digit`},{hour:`numeric`,minute:`2-digit`}],hour:[{hour:`numeric`,minute:`2-digit`},{month:`short`,day:`numeric`}],day:[{month:`short`,day:`numeric`},null],week:[{month:`short`,day:`numeric`},null],month:[{month:`short`},{year:`numeric`}],year:[{year:`numeric`},null]};function Un(e,t,n={}){let r=n.utc===!0,i=Vn(e[0]),a=Vn(e[1]),[o,s]=t,c=a-i,l=c===0?0:(s-o)/c,u=zn(r),d=n.clamp===!0,f=Math.min(o,s),p=Math.max(o,s),m=e=>{if(c===0)return(o+s)/2;let t=o+(Vn(e)-i)*l;return d?Math.min(p,Math.max(f,t)):t},h=(e=5)=>Bn(c,e);return Object.assign(m,{domain:[i,a],range:[o,s],utc:r,invert(e){return new Date(c===0||s===o?i:i+(e-o)/l)},ticks(e=5){if(!Number.isFinite(i)||!Number.isFinite(a))return[];let t=Math.min(i,a),n=Math.max(i,a);if(t===n)return[new Date(t)];let r=h(e),o=[],s=u.floor(new Date(t),r);for(s.getTime()<t&&(s=u.next(s,r));s.getTime()<=n&&o.length<1e3;)o.push(s),s=u.next(s,r);return a<i?o.reverse():o},tickFormat(e=5,t){let{unit:n}=h(e),[i,a]=Hn[n],o=r?{timeZone:`UTC`}:{},s=L(t,{...i,...o}),c=a?L(t,{...a,...o}):null;return e=>(c&&u.boundary(e,n)?c:s).format(e)},nice(r=5){if(c===0||!Number.isFinite(c))return Un(e,t,n);let o=h(r),s=u.floor(new Date(Math.min(i,a)),o),l=u.floor(new Date(Math.max(i,a)),o);return l.getTime()<Math.max(i,a)&&(l=u.next(l,o)),Un(a<i?[l,s]:[s,l],t,n)}})}function Wn(e,t,n,r){let[i,a]=xe(e)??[0,1],o=e.filter(e=>Number.isFinite(e)),s=Un([i,a],n,{utc:r}),c=e.map(e=>s(e));return{scale:Object.assign(e=>c[t.indexOf(e)],{domain:t.slice(),range:n,bandwidth:0,step:o.length>1?(n[1]-n[0])/(o.length-1):0,at:e=>c[e]??n[0],center:e=>c[t.indexOf(e)],indexAt(e){if(c.length===0)return-1;let t=n[1]<n[0],r=0,i=c.length-1;for(;r<i;){let n=r+i>>1;c[n]<e===t?i=n:r=n+1}let a=r-1;return a>=0&&Math.abs(e-c[a])<Math.abs(c[r]-e)?a:r}}),time:s}}function Gn(e,t,n,r,i){let a=e.map(Be),o=e=>Wn(a,t,e,n.utc===!0),s=o([0,1]).time,{format:c}=n,l=c?e=>c(e,-1):s.tickFormat(r,i),u=s;return{edges:s.ticks(r).map(l),scale(e){let t=o(e);return u=t.time,t.scale},ticks:()=>u.ticks(r).map(e=>({value:e.getTime(),position:u(e),label:l(e)})),get time(){return u}}}let Kn=(e,t)=>e.x<t.x+t.width&&t.x<e.x+e.width&&e.y<t.y+t.height&&t.y<e.y+e.height,qn=(e,t)=>t.x>=e.x-1&&t.y>=e.y-1&&t.x+t.width<=e.x+e.width+1&&t.y+t.height<=e.y+e.height+1;function Jn(e,t,n){let r=e.valueLabels,i=typeof r==`object`?r:{},{fontSize:a,locale:s}=n,l=e.type.valueLabels,u=l?.marks===`slice`,d=l?.marks===`cell`,f=!!e.stacked,p=i.format?z(i.format,s):u?e=>I(s,{style:`percent`,maximumFractionDigits:1}).format(e):l?.format?z(l.format(e),s):void 0,m=a,h=[],g=/* @__PURE__ */ new Map,_=0;for(let e=0;e<t.count;e++){let n=t.hitIndex(e);for(let t of n?.items??[])t.value!==null&&t.y!==null&&n&&(_+=Math.abs(t.value),!u&&!t.box&&i.points!==`all`&&g.set(t.seriesIndex,h.length),h.push([`${e}-${t.seriesIndex}`,t,n]))}let v=h.flatMap(([,e])=>e.box?[e.box]:[]),y=[];return h.forEach(([e,t,r],s)=>{let{area:c}=r;if(!u&&!t.box&&i.points!==`all`&&g.get(t.seriesIndex)!==s)return;let l=t.value,h=l/(_||1),b=p?p(u?h:l):t.text,x=o(b,a),S=(n,r,i)=>(!t.box&&!u&&(n=Math.max(c.x+x/2+2,Math.min(n,c.x+c.width-x/2-2))),{key:e,text:b,x:n,y:r,inside:i,box:{x:n-x/2-2,y:r-m/2,width:x+4,height:m}}),C=t.y,w=[],{box:T}=t;if(u)w.push(S(t.x,C,!0));else if(T){let e=r.axis===`y`,i=l<0;if(!f&&!d){let r=(e?x/2:m/2)+4,a=i?1:-1,o=C+a*r,s=n.rtl?-a:a;w.push(e?S(t.x-s*r,C,!1):S(t.x,o,!1),...e?[]:[S(T.x+x/2-3,o,!1),S(T.x+T.width-x/2+3,o,!1)],e?S(t.x+s*r,C,!0):S(t.x,C-a*r,!0))}else w.push(S(T.x+T.width/2,T.y+T.height/2,!0))}else{let e=x/2+4+4;w.push(S(t.x,C-m/2-4-2,!1),S(t.x,C+m/2+4+2,!1),S(t.x-e,C,!1),S(t.x+e,C,!1))}let E={...c,y:0,height:c.y+c.height},D=(e,n={...e.box,x:e.box.x+5,width:e.box.width-10})=>qn(u?c:E,e.box)&&(!e.inside||!T||qn(T,e.box))&&(!u||Yn(t,c,h,e.box))&&!y.some(t=>Kn(t.box,e.box))&&!v.some(e=>e!==T&&Kn(e,n)),O=w.find(e=>D(e));O&&y.push(O)}),y.length?O(`g`,{key:`value-labels`,class:`tc-value-labels`,"aria-hidden":`true`},y.map(e=>O(`text`,{key:e.key,class:[`tc-value-label`,e.inside&&`tc-value-label-inside`],style:`transform:translate(${c(e.x)}px,${c(e.y)}px)`,"text-anchor":`middle`,dy:`0.35em`},e.text))):null}function Yn(e,t,n,r){let i=t.width/2,a=Math.hypot(e.x-t.x-i,e.y-t.y-i),o=2*(i-a);return r.width<=n*2*Math.PI*a&&r.height<=o}let Xn=(e,t,n,r)=>e.valueLabels&&n?[t,Jn(e,n,r)]:t;function Zn(e,t,n){return e.nodeType===1&&e.localName===t.tag&&e.namespaceURI===n}function Qn(e,t){let n={};for(let t of e.getAttributeNames())n[t]=e.getAttribute(t);n.style&&=``,jt(e,n,t.attrs);let r=t.children.some(e=>typeof e==`string`);for(let t of Array.from(e.childNodes))(t.nodeType===8||!r&&t.nodeType===3)&&e.removeChild(t);let i=wt(e),a=e.firstChild;for(let n of t.children){let t=a?a.nextSibling:null;if(typeof n==`string`?a?.nodeType===3:a&&Zn(a,n,n.tag===`svg`?`http://www.w3.org/2000/svg`:i))typeof n==`string`?(a.data!==n&&(a.data=n),Z.set(a,n)):Qn(a,n),a=t;else{let t=Tt(n,i,e.ownerDocument);t&&e.insertBefore(t,a)}}for(;a;){let t=a;a=a.nextSibling,e.removeChild(t)}Z.set(e,t)}function $n(e,t,n){return Z.has(e)||!Zn(e,t,n)?!1:(Qn(e,t),!0)}let er=/* @__PURE__ */ new WeakMap;function tr(e){let t=er.get(e);return t&&cancelAnimationFrame(t.frame),er.delete(e),t?.now}function nr(e,t,n,r,i,a){let o={frame:0,now:t.slice()},s=performance.now(),c=l=>{let u=Math.min(1,Math.max(0,(l-s)/r)),d=1-(1-u)**3;o.now=n.map((e,n)=>t[n]+(e-t[n])*d),e.setAttribute(`d`,u<1?i(o.now):a),u<1?o.frame=requestAnimationFrame(c):er.delete(e)};er.set(e,o),o.frame=requestAnimationFrame(c)}let rr=/-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi,ir;function ar(e,t,n){ir??=typeof CSS>`u`||CSS.supports(`d`,`path("M0 0")`);let r=tr(e);if(ir||e.closest(`.tc-static,[data-resizing]`))return!1;let i=getComputedStyle(e),a=i.transitionProperty.split(`, `).findIndex(e=>e===`d`||e===`all`),o=a<0?0:Number.parseFloat(i.transitionDuration.split(`, `)[a]??``)*1e3,s=n.split(rr),l=n.match(rr)?.map(Number)??[],u=t.match(rr)?.map(Number)??[];return!(o>0)||u.length!==l.length||t.split(rr).join()!==s.join()?!1:(nr(e,r?.length===l.length?r:u,l,o,e=>e.reduce((e,t,n)=>e+c(t)+s[n+1],s[0]),n),!0)}function or(e,t){let n=e.length;if(!(t>=3)||n<=t)return e.map((e,t)=>t);let r=[],i=-1;for(let t=0;t<n;t++){let n=e[t]!=null;n&&i===-1&&(i=t),!n&&i!==-1&&(r.push([i,t]),i=-1)}i!==-1&&r.push([i,n]);let a=r.reduce((e,[t,n])=>e+(n-t),0),o=[],s=0;for(let[n,i]of r)n>s&&o.push(s),sr(e,n,i,Math.max(2,Math.round(t*(i-n)/a)),o),s=i;return s<n&&o.push(s),o}function sr(e,t,n,r,i){let a=n-t;if(a<=r){for(let e=t;e<n;e++)i.push(e);return}let o=t=>e[t],s=(a-2)/(r-2),c=t;i.push(c);for(let e=0;e<r-2;e++){let r=t+1+Math.floor((e+1)*s),a=Math.min(n,t+1+Math.floor((e+2)*s)),l=0,u=0;for(let e=r;e<a;e++)l+=o(e)[0],u+=o(e)[1];let d=Math.max(1,a-r);l/=d,u/=d;let f=t+1+Math.floor(e*s),p=Math.min(n-1,t+1+Math.floor((e+1)*s)),[m,h]=o(c),g=f,_=-1;for(let e=f;e<p;e++){let[t,n]=o(e),r=Math.abs((m-l)*(n-h)-(m-t)*(u-h));r>_&&(_=r,g=e)}i.push(g),c=g}i.push(n-1)}function cr(e,t){return or(e,t).map(t=>e[t])}var lr=class{d=``;#e;constructor(e){this.#e=10**Math.max(0,Math.min(12,Math.floor(e)))}#t(e){let t=Math.round(e*this.#e)/this.#e;return String(t===0?0:t)}#n(e,t){return`${this.#t(e)},${this.#t(t)}`}moveTo(e,t){this.d+=`M${this.#n(e,t)}`}lineTo(e,t){this.d+=`L${this.#n(e,t)}`}curveTo(e,t,n,r,i,a){this.d+=`C${this.#n(e,t)},${this.#n(n,r)},${this.#n(i,a)}`}close(){this.d+=`Z`}};function ur(e,t,n,r){let i=n===`monotone`?dr(t):t,a=i[0];if(!a)return 0;switch(r?e.moveTo(a[0],a[1]):e.lineTo(a[0],a[1]),n){case`monotone`:mr(e,i);break;case`step`:fr(e,i,.5);break;case`step-before`:fr(e,i,0);break;case`step-after`:fr(e,i,1);break;default:for(let t=1;t<i.length;t++){let n=i[t];e.lineTo(n[0],n[1])}}return i.length}function dr(e){return e.filter((t,n)=>{let r=e[n-1];return!r||t[0]!==r[0]||t[1]!==r[1]})}function fr(e,t,n){for(let r=1;r<t.length;r++){let[i,a]=t[r-1],[o,s]=t[r];if(n<=0)e.lineTo(i,s),e.lineTo(o,s);else if(n>=1)e.lineTo(o,a),e.lineTo(o,s);else{let c=i*(1-n)+o*n;e.lineTo(c,a),e.lineTo(c,s),r===t.length-1&&e.lineTo(o,s)}}}let pr=e=>e<0?-1:1;function mr(e,t){let n=t.length;if(n<2)return;if(n===2){let n=t[1];e.lineTo(n[0],n[1]);return}let r=Array(n);for(let e=1;e<n-1;e++){let[n,i]=t[e-1],[a,o]=t[e],[s,c]=t[e+1],l=a-n,u=s-a,d=(o-i)/(l||(u<0?-0:0)),f=(c-o)/(u||(l<0?-0:0)),p=(d*u+f*l)/(l+u);r[e]=(pr(d)+pr(f))*Math.min(Math.abs(d),Math.abs(f),.5*Math.abs(p))||0}r[0]=hr(t[0],t[1],r[1]),r[n-1]=hr(t[n-2],t[n-1],r[n-2]);for(let i=1;i<n;i++){let[n,a]=t[i-1],[o,s]=t[i],c=(o-n)/3;e.curveTo(n+c,a+c*r[i-1],o-c,s-c*r[i],o,s)}}function hr(e,t,n){let r=t[0]-e[0];return r?3*(t[1]-e[1])/r/2-n/2:n}let gr=e=>e!=null&&Number.isFinite(e[0])&&Number.isFinite(e[1]);function _r(e,t=()=>!0){let n=[],r;for(let i=0;i<e.length;i++)gr(e[i])&&t(i)?(r||(r=[],n.push(r)),r.push(i)):r=void 0;return n}function vr(e,t={}){let{curve:n=`linear`,precision:r=2}=t,i=new lr(r);for(let t of _r(e))ur(i,t.map(t=>e[t]),n,!0)===1&&i.close();return i.d}function yr(e,t,n={}){let{curve:r=`linear`,precision:i=2}=n,a=new lr(i),o=e=>typeof t==`number`?t:t[e]??NaN;for(let t of _r(e,e=>Number.isFinite(o(e))))ur(a,t.map(t=>e[t]),r,!0),ur(a,t.map(t=>[e[t][0],o(t)]).reverse(),r===`step-before`?`step-after`:r===`step-after`?`step-before`:r,!1),a.close();return a.d}let br={png:`PNG`,svg:`SVG`,jpeg:`JPEG`,webp:`WebP`},xr=[`png`,`svg`];function Sr(e){return e===!0?{}:Array.isArray(e)?{formats:e}:e}function Cr(){return{name:`download`,install(e){let t=e.element,n=t.ownerDocument,r,i={},a=!t.classList.contains(`tc-container`),o=()=>r?.querySelector(`.tc-download-toggle`),s=()=>r?.querySelector(`.tc-download-menu`),c=()=>Array.from(r?.querySelectorAll(`.tc-download-item`)??[]),l=e=>{let t=s();t&&(t.hidden=!e,o()?.setAttribute(`aria-expanded`,String(e)),e?n.addEventListener(`pointerdown`,d,!0):n.removeEventListener(`pointerdown`,d,!0))},u=()=>s()?.hidden===!1,d=e=>{r?.contains(e.target)||l(!1)},f=t=>{let n=t.target;if(n.closest(`.tc-download-toggle`)){l(!u()),u()&&c()[0]?.focus();return}let r=n.closest(`.tc-download-item`)?.getAttribute(`data-format`);r&&(l(!1),o()?.focus(),D(`export`)(e,{...i,format:r}))},p=e=>{if(e.key===`Escape`&&u()){e.preventDefault(),l(!1),o()?.focus();return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let t=c();t.length&&(e.preventDefault(),u()||l(!0),t[(t.indexOf(n.activeElement)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus())},m=e=>{r?.contains(e.relatedTarget)||l(!1)},h=()=>{r&&(l(!1),St(r,null),r.remove(),r=void 0,a&&t.classList.remove(`tc-container`))};return{afterRender({config:a,changed:o}){let s=a.download;if(!s||typeof document>`u`){h();return}if(!o&&r?.isConnected)return;D(`export`),i=Sr(s);let c=i.formats?.length?i.formats:xr;r||(r=n.createElement(`div`),r.className=`tc-download`,r.addEventListener(`click`,f),r.addEventListener(`keydown`,p),r.addEventListener(`focusout`,m)),St(r,O(`div`,{class:`tc-download-box`},O(`button`,{type:`button`,class:`tc-download-toggle`,"aria-label":i.label??`Download`,"aria-haspopup":`menu`,"aria-expanded":`false`},O(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,"aria-hidden":`true`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},O(`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M7 11l5 5 5-5M12 4v12`}))),O(`div`,{class:`tc-download-menu`,role:`menu`,hidden:``},c.map(e=>O(`button`,{key:e,type:`button`,role:`menuitem`,class:`tc-download-item`,"data-format":e},br[e]??e))))),r.dir=e.rtl?`rtl`:``,t.classList.add(`tc-container`),r.isConnected||t.appendChild(r)},destroy:h}}}}function wr(e,t,n){return O(`g`,{key:e,class:[`tc-series`,`tc-series-${e+1}`],style:{"--tc-series-color":t}},n)}function Tr(e,t=!0){let{area:n}=e;return O(`g`,{class:`tc-hover`,"aria-hidden":`true`},e.mark?null:e.band?O(`rect`,{class:`tc-hover-band`,x:c(e.band.x),y:c(e.band.y),width:c(e.band.width),height:c(e.band.height)}):t&&O(`line`,e.guide?{class:`tc-crosshair`,x1:c(e.guide.x1),x2:c(e.guide.x2),y1:c(e.guide.y1),y2:c(e.guide.y2)}:{class:`tc-crosshair`,x1:c(e.x),x2:c(e.x),y1:c(n.y),y2:c(n.y+n.height)}))}function Er(e,t=4,n){let{mark:r}=e;if(r){let t=e.items.find(t=>t.seriesIndex===e.seriesIndex)??e.items[0];return O(`g`,{class:`tc-hover`,"aria-hidden":`true`},t&&wr(t.seriesIndex,t.color,O(`path`,{class:`tc-hover-mark`,d:r.d,style:`transform:translate(${c(r.x)}px,${c(r.y)}px)`})))}return O(`g`,{class:`tc-hover`,"aria-hidden":`true`},!e.band&&e.items.map(e=>e.y!==null&&wr(e.seriesIndex,e.color,n?O(`path`,{class:`tc-point tc-point-active tc-marker`,d:n(e.seriesIndex,e.x,e.y,t)}):O(`circle`,{class:`tc-point tc-point-active`,cx:c(e.x),cy:c(e.y),r:t}))))}let Dr=/* @__PURE__ */ new WeakSet;function Or(e){let t=e.element;if(Dr.has(e)||typeof t.addEventListener!=`function`)return;Dr.add(e);let n=n=>{let r=t.querySelector(`svg.tc-chart`);if(!r)return;let{width:i,height:a}=e.size;return ft(r,n.clientX,n.clientY,i,a)},r=e=>!!e.target?.closest?.(`.tc-download`),i=t=>{t.pointerType!==`touch`&&e.highlightSource===`pointer`&&e.clearHighlight(t)},a=t=>{if(r(t)){i(t);return}let a=n(t);a&&e.highlightAt(a.x,a.y,t)},o=t=>{if(r(t))return;let i=n(t),a=i?e.hitTest(i.x,i.y):null;a&&e.emit(`click`,{hit:a,event:t})};return t.addEventListener(`pointermove`,a),t.addEventListener(`pointerdown`,a),t.addEventListener(`pointerleave`,i),t.addEventListener(`click`,o),()=>{Dr.delete(e),t.removeEventListener(`pointermove`,a),t.removeEventListener(`pointerdown`,a),t.removeEventListener(`pointerleave`,i),t.removeEventListener(`click`,o)}}function kr(){return{name:`pointer`,install(e){let t=Or(e);return t?{destroy:t}:{}}}}function Ar(){return{name:`highlight`,install(e){let t=Or(e);return{layers:(e,t)=>({under:Tr(e,t.crosshair!==!1),over:Er(e,4,Ue(t))}),...t?{destroy:t}:{}}}}}function jr(e,t){let[n=``,...r]=e.columns;return O(`table`,{class:`tc-table`},t&&O(`caption`,null,t),O(`thead`,null,O(`tr`,null,O(`th`,{scope:`col`},n),r.map((e,t)=>O(`th`,{key:t,scope:`col`},e)))),O(`tbody`,null,e.rows.map(([e=``,...t],n)=>O(`tr`,{key:n},O(`th`,{scope:`row`},e),t.map((e,t)=>O(`td`,{key:t},e))))))}function Mr(e){let t=(e.seriesIndex===void 0?e.items:e.items.filter(t=>t.seriesIndex===e.seriesIndex)).map(e=>`${e.name} ${e.text}`).join(`, `);return e.title?`${e.title}: ${t}`:t}let Nr=e=>e.keyboard??e.type.keyboard??!0;function Pr(){return{name:`keyboard`,install(e){let t=e.element,n,r=()=>(n||(n=t.ownerDocument.createElement(`div`),n.className=`tc-sr-only`,n.setAttribute(`aria-live`,`polite`),n.setAttribute(`aria-atomic`,`true`),t.appendChild(n)),n),i=e=>{r().textContent=e},a=(t,n)=>{let r=e.highlightIndex(t,n);r&&i(Mr(r))},o=t=>{let n=e.interaction;if(!n||n.count===0)return!1;n.reversed&&/^Arrow(L|R)/.test(t)&&(t=t===`ArrowLeft`?`ArrowRight`:`ArrowLeft`);let r=e.highlightSource===`index`?e.active:null,i=n.count-1,o=r?.index,s=r?.seriesIndex,c=r?.items.map(e=>e.seriesIndex)??[],l=s===void 0?-1:c.indexOf(s);switch(t){case`ArrowRight`:return a(o===void 0?0:Math.min(i,o+1),s),!0;case`ArrowLeft`:return a(o===void 0?i:Math.max(0,o-1),s),!0;case`Home`:return a(0,s),!0;case`End`:return a(i,s),!0;case`ArrowDown`:case`ArrowUp`:{if(o===void 0||c.length===0)return a(0),!0;let e=t===`ArrowDown`?1:-1,n=l===-1?e>0?0:c.length-1:l+e;return a(o,n<0||n>=c.length?void 0:c[n]),!0}case`Escape`:return r?(e.clearHighlight(),!0):!1;default:return!1}},s=e=>e?.matches?.(`svg.tc-chart`)===!0,c=t=>{let{key:n}=t;Nr(e.config)&&s(t.target)&&o(n)&&t.preventDefault()},l=t=>{s(t.target)&&e.highlightSource===`index`&&e.clearHighlight()},u=t=>{Nr(e.config)&&s(t.target)&&r()};return t.addEventListener(`keydown`,c),t.addEventListener(`focusin`,u),t.addEventListener(`focusout`,l),{svgAttrs:e=>Nr(e)?{tabindex:0}:void 0,destroy(){t.removeEventListener(`keydown`,c),t.removeEventListener(`focusin`,u),t.removeEventListener(`focusout`,l),n?.remove()}}}}}function Fr(){return{name:`legend`,install(e){let t=e.element,n=t.querySelector(`:scope > .tc-legend`)??void 0,r=n?.firstElementChild??null,i=!1,a=t=>{let n=(t.target.closest?.(`.tc-legend-item`))?.getAttribute(`data-key`);n!=null&&e.toggleSeries(n)},o=()=>{n&&=(St(n,null),n.removeEventListener(`click`,a),i=!1,n.remove(),void 0)},s=()=>{if(!n)return;let e=t.querySelector(`:scope > svg.tc-chart`);n.dataset.position===`bottom`?e?e.nextElementSibling!==n&&e.after(n):n.isConnected||t.appendChild(n):n.isConnected&&n.nextElementSibling===e||t.insertBefore(n,e??t.firstChild)};return{beforeRender({legend:c,hidden:l}){!c.show||typeof document>`u`?o():(n||(n=t.ownerDocument.createElement(`div`),n.className=`tc-legend`),i||=(n.addEventListener(`click`,a),!0),n.dataset.position=c.position,n.dir=e.rtl?`rtl`:``,St(n,pt(c.items,l),r),r=null,s())},reservedHeight(){if(!n?.isConnected)return 0;let{marginTop:e,marginBottom:t}=getComputedStyle(n);return n.offsetHeight+(Number.parseFloat(e)||0)+(Number.parseFloat(t)||0)},afterRender:s,destroy:o}}}}let Ir=/* @__PURE__ */ new Map,Lr=/* @__PURE__ */ new WeakMap,Rr=!1;function zr(e,t){let n=Lr.get(e);if(!n){n=/* @__PURE__ */ new Map;for(let t=0;t<e.count;t++){let r=e.hitIndex(t);r&&!n.has(r.label)&&n.set(r.label,t)}Lr.set(e,n)}return n.get(t)}function Br(){return{name:`sync`,install(e){let t=new WeakRef(e),n,r,i=()=>{n?.delete(t),r&&n?.size===0&&Ir.get(r)===n&&Ir.delete(r)},a=()=>{let a=e.config.sync,o=a?Ir.get(a)??/* @__PURE__ */ new Set:void 0;o!==n&&(i(),a&&o&&(o.add(t),Ir.set(a,o)),n=o,r=a)};a();let o=e.on(`hover`,({hit:t})=>{if(!(Rr||!n||t&&e.highlightSource!==`pointer`)){Rr=!0;try{for(let r of n){let i=r.deref();if(i||n.delete(r),!i||i===e)continue;let a=t&&i.interaction&&zr(i.interaction,t.label);a==null?i.clearHighlight():i.highlightIndex(a)}}finally{Rr=!1}}});return{afterRender:a,destroy(){o(),i()}}}}}let Vr=/* @__PURE__ */ new Map,Hr=!1;function Ur(){Hr=!1;let e=0;for(;Vr.size>0;){let t=Array.from(Vr.values());Vr.clear();for(let n of t)$t(n),e++}return e}function Wr(e,t){tn.idle=Ur,Vr.set(e,t),Hr||(Hr=!0,typeof requestIdleCallback==`function`?requestIdleCallback(Ur,{timeout:1e3}):setTimeout(Ur,100))}function Gr(e){Vr.delete(e)}function Kr(){return{name:`table`,install(e){let t=e.element,n=t.querySelector(`:scope > .tc-table-wrap`)??void 0,r=n?.firstElementChild??null,i,a={},o=()=>{Gr(a),n&&=(St(n,null),n.remove(),void 0)},s=(i,a,s)=>{let c=i.table??!0,l=typeof c==`object`&&c.maxRows?c.maxRows:1e3,u=c!==!1&&typeof document<`u`?i.type.table?.(i,ln(i,a,e.id,()=>{},s,e.fontSize),l):void 0;if(!u){o();return}let d=c===`visible`||typeof c==`object`&&c.visible===!0,f=i.title,p=u.total??u.rows.length,m=u.rows.length>l?{columns:u.columns,rows:u.rows.slice(0,l)}:u;if(p>m.rows.length){let e=I(i.locale),t=`${e.format(m.rows.length)} of ${e.format(p)} rows`;f=f?`${f} (${t})`:t}n||=t.ownerDocument.createElement(`div`),n.className=d?`tc-table-wrap`:`tc-table-wrap tc-sr-only`,St(n,jr(m,f),r),r=null;let h=t.querySelector(`:scope > svg.tc-chart`),g=t.querySelector(`:scope > .tc-legend[data-position="bottom"]`)??h;g&&g.nextElementSibling!==n?g.after(n):n.isConnected||t.appendChild(n)};return{afterRender({config:e,size:t,hidden:r,changed:o}){if(!o&&n?.isConnected)return;let c=e.table??!0,l=i===c;i=c,l&&n?.isConnected&&n.classList.contains(`tc-sr-only`)?Wr(a,()=>s(e,t,r)):(Gr(a),s(e,t,r))},destroy:o}}}}function qr(e,t){if(t)return t;let n=e.items.find(t=>t.seriesIndex===e.seriesIndex)??e.items[0];return e.guide&&n?.y!=null?{x:n.x,y:n.y}:e.axis===`y`?{x:n?.x??e.x,y:e.y??e.area.y}:{x:e.x,y:n?.y??e.area.y+e.area.height/2}}function Jr(e,t={}){return O(`div`,{class:`tc-tooltip-content`},t.format?t.format(e):[e.title&&O(`div`,{class:`tc-tooltip-title`},e.title),e.items.map(t=>O(`div`,{key:t.seriesIndex,class:[`tc-tooltip-item`,`tc-series`,`tc-series-${t.seriesIndex+1}`,e.seriesIndex===t.seriesIndex&&`tc-tooltip-item-active`],style:{"--tc-series-color":t.color}},O(`span`,{class:`tc-tooltip-swatch`}),O(`span`,{class:`tc-tooltip-name`},t.name),O(`span`,{class:`tc-tooltip-value`},t.text))),t.footer&&O(`div`,{class:`tc-tooltip-footer`},t.footer(e))])}function Yr(e,t,n,r=12,i=!1){let{x:a=0,y:o=0}=n,s=e.x+r+t.width<=a+n.width,c=e.x-r-t.width>=a,l=(i?c||!s:c&&!s)?`left`:`right`,u=l===`right`?e.x+r:e.x-r-t.width,d=Math.max(a,Math.min(u,a+n.width-t.width)),f=Math.max(o,Math.min(e.y-t.height/2,o+n.height-t.height));return{x:Math.round(d),y:Math.round(f),side:l}}function Xr(e){let t=0,n=0,r=innerWidth,i=innerHeight;for(let a=e;a;){let e=getComputedStyle(a);if(e.overflowX!==`visible`||e.overflowY!==`visible`){let e=a.getBoundingClientRect();t=Math.max(t,e.left),n=Math.max(n,e.top),r=Math.min(r,e.right),i=Math.min(i,e.bottom);break}a=a.parentElement??(a.getRootNode().host||null)}return{left:t,top:n,right:r,bottom:i}}let Zr=[];function Qr(){for(let e of Zr.splice(0).map(e=>e()))e?.()}function $r(){return{name:`tooltip`,install(e){let t=Or(e),n=e.element,r=!n.classList.contains(`tc-container`);n.classList.add(`tc-container`);let i,a=0;return{afterRender(){let t=e.config.tooltip,r=e.active,o=r&&qr(r,e.pointer);if(t===!1||typeof document>`u`||!r||!o||!Number.isFinite(o.x)||!Number.isFinite(o.y)){a++,i?.removeAttribute(`data-visible`);return}i||(i=n.ownerDocument.createElement(`div`),i.className=`tc-tooltip`,i.setAttribute(`aria-hidden`,`true`),n.appendChild(i));let s=typeof t==`object`?t:void 0;i.classList.toggle(`tc-tooltip-light`,s?.theme===`light`);let{rtl:c}=e;i.dir=c?`rtl`:``,St(i,Jr(r,s));let l=i,u=++a;Zr.push(()=>{let t=n.querySelector(`svg.tc-chart`);if(!t||u!==a)return;let{width:i,height:s}=e.size,d=n.getBoundingClientRect(),f=t.getBoundingClientRect(),p=d.width>0&&n.offsetWidth>0?d.width/n.offsetWidth:1,m=f.width>0?f.width/i/p:1,h=f.height>0?f.height/s/p:1,g={x:(f.left-d.left)/p-n.clientLeft,y:(f.top-d.top)/p-n.clientTop},_=r.axis===`y`||r.guide?o.x:r.x,v=r.axis===`y`?r.y??o.y:o.y,y=Xr(n),b=Yr({x:g.x+_*m,y:g.y+v*h},{width:l.offsetWidth,height:l.offsetHeight},{x:(y.left-d.left)/p-n.clientLeft,y:(y.top-d.top)/p-n.clientTop,width:(y.right-y.left)/p,height:(y.bottom-y.top)/p},12,c);return()=>{l.style.transform=`translate(${b.x}px, ${b.y}px)`,l.dataset.side=b.side,l.hasAttribute(`data-visible`)||(getComputedStyle(l).transform,l.setAttribute(`data-visible`,``))}}),en(Zr,Qr)},destroy(){a++,i&&(St(i,null),i.remove()),r&&n.classList.remove(`tc-container`),t?.()}}}}}function ei(){return[Ar(),Fr(),$r(),Kr(),Pr(),Br(),Cr()]}var ti=class extends xn{constructor(e,t){super(e,t,ei())}};function ni(e){return O(`mask`,{id:e,maskContentUnits:`objectBoundingBox`},O(`linearGradient`,{id:`${e}-gradient`,x1:0,y1:0,x2:0,y2:1},O(`stop`,{class:`tc-fade-start`,offset:0}),O(`stop`,{class:`tc-fade-end`,offset:1})),O(`rect`,{width:1,height:1,fill:`url(#${e}-gradient)`}))}function ri(e,t,n={}){let{percent:r=!1,nullAsZero:i=!1,hidden:a}=n,o=e.map(e=>!a?.has(X(e))),s=e.map(()=>Array(t).fill(null));for(let n=0;n<t;n++){let t=0;r&&e.forEach((e,r)=>{let i=e.values[n];o[r]&&i!=null&&(t+=Math.abs(i))});let a=0,c=0,l,u;for(let d=0;d<e.length;d++){let f=e[d];if(!o[d])continue;let p=f.values[n],m=p!=null;if(!m&&!i)continue;let h=m?p:0;r&&(h=t===0?0:h/t);let g=s[d];if(h<0){let e={y0:c,y1:c+h};g[n]=e,c+=h,u=e}else{let e={y0:a,y1:a+h};g[n]=e,a+=h,l=e}}r&&(l&&Math.abs(a-1)<1e-9&&(l.y1=1),u&&Math.abs(c+1)<1e-9&&(u.y1=-1))}return s}function ii(e){let t=[];for(let n of e)for(let e of n)e&&t.push(e.y0,e.y1);return t}function ai(e,t,n,r,i,a){let o=[];for(let s=0;s<t;s++){let t=e.values[s];a(t)?o.push([n(s),r(t)]):i||o.push(null)}return o}function oi(e,t,n){let{curve:r=`monotone`,points:i=`none`,pointRadius:a=4,connectNulls:o=!1,area:s=n,stacked:l=!1,decimate:u,fill:d=l?`solid`:`gradient`}=e,f=i===`none`?2:a+2,{series:p}=e.data,m=Ie(e.data).length,h=l?ri(p,m,{percent:l===`percent`,nullAsZero:!0,hidden:t.hidden}):null,g=Xe(e,t,{scale:`point`,zero:s||h!==null,overhang:f,...h?{values:ii(h)}:{},...l===`percent`?{tickFormat:{style:`percent`}}:{}}),{x:_,y:v,labels:y}=g,b=v(Math.min(Math.max(0,v.domain[0]),v.domain[1]));t.onHitTest($e(g,e,t,(e,t,n)=>({x:_.at(t),y:v(h?h[e]?.[t]?.y1??0:n)})));let x=s&&d===`gradient`,S=`${t.id}-fade`,C=e=>!t.hidden.has(X(e)),w=p.map((t,n)=>{if(!C(t))return[];let r=h?.[n];return r?r.map((e,t)=>e?[_.at(t),v(e.y1)]:null):ai(t,y.length,e=>_.at(e),v,o,t=>Le(t,e.y))}),T=w.map(e=>u!==void 0&&e.length>u?D(`decimate`)(e,u):null),E=e=>{let t=w[e],n=T[e];return n?n.map(e=>t[e]):t},k=e=>{let t=h?.[e];if(!t)return b;let n=t.map(e=>e?v(e.y0):null),r=T[e];return r?r.map(e=>n[e]??null):n},A=s&&O(`g`,{class:`tc-areas`},e.data.series.map((e,t)=>C(e)&&O(`g`,Qe(e,t),O(`path`,{class:[`tc-area`,x&&`tc-area-gradient`],d:yr(E(t),k(t),{curve:r}),mask:x?`url(#${S})`:void 0})))),j=e.data.series.map((e,t)=>{if(!C(e))return null;let n=E(t),o=n.filter(e=>e!=null),s=i===`all`?o:i===`last`?o.slice(-1):[];return O(`g`,Qe(e,t),O(`path`,{class:`tc-line`,d:vr(n,{curve:r})}),s.length>0&&O(`g`,{class:`tc-points`},s.map(([e,t])=>O(`circle`,{key:e,class:`tc-point`,cx:c(e),cy:c(t),r:a}))))});return[O(`defs`,{key:`defs`},g.clip.def,x&&ni(S)),g.background,O(`g`,{key:`series`,class:`tc-series-list`,"clip-path":g.clip.url},A,j),g.foreground]}let si={name:`line`,clean:q(je),render:(e,t)=>oi(e,t,!1),legend:e=>Fe(e.data),table:(e,t,n)=>et(e,t,n)},ci={name:`area`,clean:q(je),render:(e,t)=>oi(e,t,!0),legend:e=>Fe(e.data),table:(e,t,n)=>et(e,t,n)},Q=e=>{let t=c(e);return t===0?0:t};function li(e,t,n,r,i=0){let a=Math.max(0,t),o=Math.abs(n-r),s=Math.max(0,Math.min(i,a/2,o)),c=Q(e),l=Q(e+a),u=Q(n),d=Q(r),f=r<=n,p=Q(f?r+s:r-s),m=+!!f,h=Q(s);return`M${c},${u}L${c},${p}A${h},${h},0,0,${m},${Q(e+s)},${d}L${Q(e+a-s)},${d}A${h},${h},0,0,${m},${l},${p}L${l},${u}Z`}function ui(e,t,n,r,i=0){let a=Math.max(0,t),o=Math.abs(r-n),s=Math.max(0,Math.min(i,a/2,o)),c=Q(e),l=Q(e+a),u=Q(n),d=Q(r),f=r>=n,p=Q(f?r-s:r+s),m=+!!f,h=Q(s);return`M${u},${c}L${p},${c}A${h},${h},0,0,${m},${d},${Q(e+s)}L${d},${Q(e+a-s)}A${h},${h},0,0,${m},${p},${l}L${u},${l}Z`}function di(e,i,a){let s=e.y??{},c=e.x??{},{fontSize:l,width:u,height:d,rtl:f}=i,p=a.overhang??0,m=n(t(e.padding),f),h=Ie(e.data),g=ze(e,i),_=Je(e,i,a,Math.round(u/80)),v=_.probe,y=s.show!==!1,b=c.show!==!1&&h.length>0,x=h.map((e,t)=>({value:Y(e),position:0,label:g(e,t)})),S=e=>y&&e?Math.ceil(o(e.label,l)/2):0,C=r(u,d,n({top:m.top+Math.max(p,4),right:m.right+Math.max(S(v[v.length-1]),p,8),bottom:m.bottom+Math.max(y?ge(`bottom`,v,l):0,p,4),left:m.left+Math.max(b?ge(`left`,x,l):0,S(v[0]),p,8)},f)),w=h.map(Y),T=ye(w,[C.y,C.y+C.height],{paddingInner:a.paddingInner??.3,paddingOuter:a.paddingOuter??.15}),E=C.x+C.width,D=_.scale(f?[E,C.x]:[C.x,E]),O=he(_.ticks(D),`bottom`,l);return Ye(e,i,p,{area:C,labels:h,x:T,y:D,horizontal:!0,xTicks:b?he(pe(T,(e,t)=>g(h[t],t)),`left`,l):[],yTicks:O},w)}let fi={name:`bar`,clean:q(je),render(e,t){let{radius:n=4,maxBarWidth:r=24,gap:i=2,groupPadding:a=.3,stacked:o=!1,orientation:s=`vertical`,curve:c=`monotone`}=e,l=s===`horizontal`,{series:u}=e.data,d=Ie(e.data).length,f=e=>(u[e]?.type??`bar`)!==`bar`,p=u.filter((e,t)=>f(t)).map(X),m=p.length?/* @__PURE__ */ new Set([...t.hidden,...p]):t.hidden,h=o?ri(u,d,{percent:o===`percent`,hidden:m}):null,g={scale:`band`,zero:!0,paddingInner:a,paddingOuter:a/2,...h?{values:[...ii(h),...u.flatMap((e,t)=>f(t)?e.values:[])]}:{},...o===`percent`?{tickFormat:{style:`percent`}}:{}},_=l?di(e,t,g):Xe(e,t,g),{x:v,y,labels:b}=_,x=/* @__PURE__ */ new Map;u.forEach((e,n)=>{!t.hidden.has(X(e))&&!f(n)&&x.set(n,x.size)});let S=[...x.keys()],C=h?1:Math.max(1,x.size),w=Math.max(0,Math.min(r,(v.bandwidth-(h?0:i*(C-1)))/C)),T=w*C+(h?0:i*(C-1)),E=(v.bandwidth-T)/2,k=e=>v.range[1]<v.range[0]?C-1-e:e,A=(e,t)=>v.at(t)+E+(h?0:k(x.get(e)??0)*(w+i)),j=(t,n)=>{if(h)return h[t]?.[n]??null;let r=u[t]?.values[n];return Le(r,e.y)?{y0:0,y1:r}:null},M=b.map((e,t)=>{let n=-1,r=-1;for(let e of S){let i=j(e,t);i&&(i.y1>i.y0?n=e:i.y1<i.y0&&(r=e))}return{up:n,down:r}});t.onHitTest($e(_,e,t,(e,t,n)=>{if(f(e)){let e=v.at(t)+v.bandwidth/2;return l?{x:y(n),y:e}:{x:e,y:y(n)}}let r=A(e,t),i=j(e,t),a=y(i?.y1??0),o=y(i?.y0??0),s=Math.min(a,o),c=Math.abs(a-o);return l?{x:a,y:r+w/2,box:{x:s,y:r,width:c,height:w}}:{x:r+w/2,y:a,box:{x:r,y:s,width:w,height:c}}},(e,t,n)=>{let r=l?t:e,a=l?e:t;if(h){let e=A(0,n);return r<e-i/2||r>e+w+i/2?void 0:S.find(e=>{let t=j(e,n);if(!t)return!1;let r=y(t.y0),o=y(t.y1);return a>=Math.min(r,o)-i/2&&a<=Math.max(r,o)+i/2})}let o=Math.floor((r-(v.at(n)+E)+i/2)/(w+i)),s=S[k(o)];return s!==void 0&&j(s,n)?s:void 0}));let N=u.map((e,t)=>x.has(t)&&O(`g`,Qe(e,t),b.map((e,r)=>{let a=j(t,r);if(!a)return null;let o=a.y1<a.y0,s=Math.sign(y(a.y1)-y(a.y0)),c=a.y0===0?0:s*i,u=!h||(o?M[r]?.down:M[r]?.up)===t,d=l?ui:li;return O(`path`,{key:Y(e),class:[`tc-bar`,o&&`tc-bar-negative`,l&&`tc-bar-horizontal`],d:d(A(t,r),w,y(a.y0)+c,y(a.y1),u?n:0)})}))),P=p.length?D(`line`):null,F=y(Math.min(Math.max(0,y.domain[0]),y.domain[1])),ee=u.map((n,r)=>{if(!P||!f(r)||t.hidden.has(X(n)))return null;let i=b.map((t,r)=>{let i=n.values[r];if(!Le(i,e.y))return null;let a=v.at(r)+v.bandwidth/2;return l?[y(i),a]:[a,y(i)]}),a=n.type===`area`&&!l;return O(`g`,Qe(n,r),a&&O(`path`,{class:`tc-area`,d:P.areaPath(i,F,{curve:c})}),O(`path`,{class:`tc-line`,d:P.linePath(i,{curve:c})}))});return[O(`defs`,{key:`defs`},_.clip.def),_.background,O(`g`,{key:`series`,class:`tc-series-list`,"clip-path":_.clip.url},N,ee),_.foreground]},legend:e=>Fe(e.data),table:(e,t,n)=>et(e,t,n)},pi=(e,t,n,r,i)=>{let a=`A${i},${i},0,0,1,`;return`M${c(e+i)},${t}H${c(e+n-i)}${a}${c(e+n)},${c(t+i)}V${c(t+r-i)}${a}${c(e+n-i)},${c(t+r)}H${c(e+i)}${a}${e},${c(t+r-i)}V${c(t+i)}${a}${c(e+i)},${t}Z`},mi=(e,t)=>[e.open,e.high,e.low,e.close].every(e=>Le(e,t));function hi(e){let t=t=>e.data.map(n=>mi(n,e.y)?n[t]:null),n={data:{labels:e.data.map(e=>e.x),series:[{name:`Open`,values:t(`open`)},{name:`High`,values:t(`high`)},{name:`Low`,values:t(`low`)},{name:`Close`,values:t(`close`)}]}};return e.x&&(n.x=e.x),e.y&&(n.y=e.y),e.padding!==void 0&&(n.padding=e.padding),e.annotations&&(n.annotations=e.annotations),n}let gi={name:`candlestick`,clean:q(e=>ke(e,e=>({...e,x:De(e.x),open:K(e.open),high:K(e.high),low:K(e.low),close:K(e.close)}))),render(e,t){let{maxCandleWidth:n=16,groupPadding:r=.3,radius:i=1}=e,a=hi(e),o=Xe(a,t,{scale:`band`,zero:!1,paddingInner:r,paddingOuter:r/2}),{x:s,y:l,labels:u}=o,d=Math.max(1,Math.min(n,s.bandwidth)),f=e=>s.at(e)+s.bandwidth/2,p=e=>e.close>=e.open,m=$e(o,a,t,(e,t,n)=>({x:f(t),y:l(n)})),h=t=>{let n=t?e.data[t.index]:void 0;if(!t||!n)return t;let r=p(n)?`var(--tc-up-color,var(--tc-color-6))`:`var(--tc-negative-color,var(--tc-color-8))`;return{...t,items:t.items.map(e=>({...e,color:r}))}},g={count:m.count,hitIndex:(e,t)=>h(m.hitIndex(e,t)),hitTest:(e,t)=>h(m.hitTest(e,t))};t.onHitTest(g);let _=e.data.map((t,n)=>{if(!mi(t,e.y))return null;let r=c(f(n)),a=l(Math.max(t.open,t.close)),o=Math.max(l(Math.min(t.open,t.close)),a+1),s=c(f(n)-d/2),m=c(Math.min(i,d/2,(o-a)/2));return O(`g`,{key:Y(u[n]),class:[`tc-candle`,p(t)?`tc-candle-up`:`tc-candle-down`]},O(`path`,{class:`tc-candle-wick`,d:`M${r},${c(l(t.high))}V${c(l(t.low))}`}),O(`path`,{class:`tc-candle-body`,d:pi(s,c(a),c(d),c(o-a),m)}))});return[O(`defs`,{key:`defs`},o.clip.def),o.background,O(`g`,{key:`series`,class:`tc-series-list tc-candles`,"clip-path":o.clip.url},_),o.foreground]},table:(e,t,n)=>et(hi(e),t,n)},$=1e-12,_i=Math.PI,vi=_i/2,yi=2*_i,bi=Math.PI/180,xi=e=>e>=1?vi:e<=-1?-vi:Math.asin(e),Si=e=>e>1?0:e<-1?_i:Math.acos(e);function Ci(e,t,n,r,i,a,o,s){let c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<$))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function wi(e,t,n,r,i,a,o){let s=e-n,c=t-r,l=(o?a:-a)/Math.sqrt(s*s+c*c),u=l*c,d=-l*s,f=e+u,p=t+d,m=n+u,h=r+d,g=(f+m)/2,_=(p+h)/2,v=m-f,y=h-p,b=v*v+y*y,x=i-a,S=f*h-m*p,C=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*b-S*S)),w=(S*y-v*C)/b,T=(-S*v-y*C)/b,E=(S*y+v*C)/b,D=(-S*v+y*C)/b,O=w-g,k=T-_,A=E-g,j=D-_;return O*O+k*k>A*A+j*j&&(w=E,T=D),{cx:w,cy:T,x01:-u,y01:-d,x11:w*(i/x-1),y11:T*(i/x-1)}}function Ti(e,t,n,r,i,a,o){let s=r,c=i,l=r,u=i,d=a,f=a,p=(e.padAngle??0)/2,m=p>$?e.padRadius??Math.sqrt(t*t+n*n):0,h=Math.min(Math.abs(n-t)/2,e.cornerRadius??0),g=h,_=h;if(m>$){let e=xi(m/t*Math.sin(p)),a=xi(m/n*Math.sin(p));d-=e*2,d>$?(e*=o?1:-1,l+=e,u-=e):(d=0,l=u=(r+i)/2),f-=a*2,f>$?(a*=o?1:-1,s+=a,c-=a):(f=0,s=c=(r+i)/2)}let v=n*Math.cos(s),y=n*Math.sin(s),b=t*Math.cos(u),x=t*Math.sin(u),S=n*Math.cos(c),C=n*Math.sin(c),w=t*Math.cos(l),T=t*Math.sin(l);if(h>$&&a<_i){let e=Ci(v,y,w,T,S,C,b,x);if(e){let r=v-e[0],i=y-e[1],a=S-e[0],o=C-e[1],s=(r*a+i*o)/(Math.sqrt(r*r+i*i)*Math.sqrt(a*a+o*o)),c=1/Math.sin(Si(s)/2),l=Math.sqrt(e[0]*e[0]+e[1]*e[1]);g=Math.min(h,(t-l)/(c-1)),_=Math.min(h,(n-l)/(c+1))}else g=_=0}return{a00:l,a01:s,a10:u,a11:c,da0:d,da1:f,rc:h,rc0:g,rc1:_,x01:v,y01:y,x10:b,y10:x,x11:S,y11:C,x00:w,y00:T}}function Ei(e){let t=(e.innerRadius+e.outerRadius)/2,n=(e.startAngle+e.endAngle)/2-vi;return[Math.cos(n)*t,Math.sin(n)*t]}function Di(e,t,n){let r=Math.sqrt(t*t+n*n);return r>0?2*Math.asin(Math.min(1,e/2/r)):0}let Oi=(e,t)=>Math.atan2(t,e);function ki(e){let t=10**Math.max(0,Math.min(12,Math.floor(e.precision??2))),n=e=>{let n=Math.round(e*t)/t;return String(n===0?0:n)},r=``,i=(e,t)=>{r+=`M${n(e)},${n(t)}`},a=(e,t)=>{r+=`L${n(e)},${n(t)}`},o=(e,t,i,a)=>{r+=`A${n(e)},${n(e)},0,0,${t},${n(i)},${n(a)}`},s=(e,t,n,r)=>{let i=r?t-n:n-t;i=(i%yi+yi)%yi,i<$&&Math.abs(n-t)>$&&(i=yi);let a=r?t-i/2:t+i/2,s=+!r;o(e,s,e*Math.cos(a),e*Math.sin(a)),o(e,s,e*Math.cos(n),e*Math.sin(n))},c=Math.max(0,e.innerRadius),l=Math.max(0,e.outerRadius);l<c&&([c,l]=[l,c]);let u=e.startAngle-vi,d=e.endAngle-vi,f=Math.abs(d-u),p=d>u,m=+!!p;if(!(l>$)){i(0,0);for(let e=0;e<4;e++)o(0,m,0,0);a(0,0);for(let e=0;e<4;e++)o(0,m,0,0);return`${r}Z`}if(f>yi-$){let e=l*Math.cos(u),t=l*Math.sin(u);i(e,t),o(l,m,e,t),s(l,u,u+(p?yi:-yi)*(1-1e-9),!p),o(l,m,e,t);let n=c*Math.cos(u),d=c*Math.sin(u);if(a(n,d),o(c,m,n,d),c>$)s(c,u,u+(p?-yi:yi)*(1-1e-9),p);else for(let e=0;e<2;e++)o(0,m,0,0);return o(c,m,n,d),`${r}Z`}let{a00:h,a01:g,a10:_,a11:v,da0:y,da1:b,rc:x,rc0:S,rc1:C,x01:w,y01:T,x10:E,y10:D,x11:O,y11:k,x00:A,y00:j}=Ti(e,c,l,u,d,f,p);if(b>$&&C>$){let e=wi(A,j,w,T,l,C,p),t=wi(O,k,E,D,l,C,p);if(i(e.cx+e.x01,e.cy+e.y01),C<x){let e=t.cx+t.x01,n=t.cy+t.y01;o(C,m,e,n),o(l,m,e,n),o(l,m,e,n),o(C,m,e,n)}else o(C,m,e.cx+e.x11,e.cy+e.y11),s(l,Oi(e.cx+e.x11,e.cy+e.y11),Oi(t.cx+t.x11,t.cy+t.y11),!p),o(C,m,t.cx+t.x01,t.cy+t.y01)}else{if(i(w,T),o(l,m,w,T),b>$)s(l,g,v,!p);else for(let e=0;e<2;e++)o(l,m,w,T);o(l,m,O,k)}if(!(c>$)||!(y>$)){a(E,D);for(let e=0;e<4;e++)o(c,m,E,D)}else if(S>$){let e=wi(E,D,O,k,c,-S,p),t=wi(w,T,A,j,c,-S,p);if(a(e.cx+e.x01,e.cy+e.y01),S<x){let e=t.cx+t.x01,n=t.cy+t.y01;o(S,m,e,n),o(c,m,e,n),o(c,m,e,n),o(S,m,e,n)}else o(S,m,e.cx+e.x11,e.cy+e.y11),s(c,Oi(e.cx+e.x11,e.cy+e.y11),Oi(t.cx+t.x11,t.cy+t.y11),p),o(S,m,t.cx+t.x01,t.cy+t.y01)}else a(E,D),o(c,m,E,D),s(c,_,h,p),o(c,m,A,j);return`${r}Z`}function Ai(e,t){let n=O(`path`,{class:e,d:ki(t)});return n.arc=[t.innerRadius,t.outerRadius,t.startAngle,t.endAngle,t.padAngle??0,t.cornerRadius??0],n}function ji(e,t,n){let{arc:r,attrs:i}=n;if(!r||t.attrs.d===i.d)return;let a=tr(e)??t.arc,o=Number.parseFloat(getComputedStyle(e).transitionDuration)*1e3;if(a&&o>0)return nr(e,a,r,o,([e,t,n,r,i,a])=>ki({innerRadius:e,outerRadius:t,startAngle:n,endAngle:r,padAngle:i,cornerRadius:a}),String(i.d)),{...i,d:t.attrs.d}}let Mi=Math.PI/2;function Ni(e){let{data:t}=e;return typeof t==`number`?[{name:``,value:t}]:Array.isArray(t)?t:[t]}function Pi(e,t){let n=e.max??100;return Ni(e).map((e,t)=>({data:e,index:t,max:e.max??n})).filter(e=>!t.has(J(e.data))).map((e,t)=>({...e,position:t,value:Math.min(e.max,Math.max(0,e.data.value||0))}))}function Fi(e,t,n,r,i){let a=[[0,0]],o=t+n;a.push([Math.sin(t),-Math.cos(t)],[Math.sin(o),-Math.cos(o)]);for(let e=Math.ceil(t/Mi)*Mi,n=0;n<5&&e<=o+1e-9;n++)a.push([Math.sin(e),-Math.cos(e)]),e+=Mi;let s=Math.min(e.width,e.height)/2,c={x0:0,y0:0,x1:0,y1:0};for(let t=0;t<4;t++){c={x0:0,y0:r,x1:0,y1:i};for(let[e,t]of a)c.x0=Math.min(c.x0,e*s),c.x1=Math.max(c.x1,e*s),c.y0=Math.min(c.y0,t*s),c.y1=Math.max(c.y1,t*s);let t=Math.min(e.width/(c.x1-c.x0),e.height/(c.y1-c.y0));if(Math.abs(t-1)<.001)break;s=Math.max(0,s*t)}return{outer:s,cx:e.x+(e.width-(c.x1-c.x0))/2-c.x0,cy:e.y+(e.height-(c.y1-c.y0))/2-c.y0}}function Ii(e,n){let{width:i,height:a,locale:o}=n,s=Math.max(1,e.thickness??12),c=Math.max(0,e.gap??4),l=e.cornerRadius??s/2,u=t(e.padding,0),d=r(i,a,{top:u.top+8,right:u.right+8,bottom:u.bottom+8,left:u.left+8}),f=(e.startAngle??0)*bi,p=Math.min(360,Math.max(0,e.angle??360))*bi,m=Pi(e,n.hidden),h=e.center,g=m[0],_=h!==!1&&g!==void 0,v=_?h?.label??(g.data.name||void 0):void 0,{outer:y,cx:b,cy:x}=Fi(d,f,p,_?-1.4*n.fontSize:0,_?(v?2:.7)*n.fontSize:0),S=z(e.format,o),C=I(o,{style:`percent`,maximumFractionDigits:1}),w=(e,t=0)=>{let n=Math.max(0,y-e.position*(s+c));return{innerRadius:Math.max(0,n-s-t),outerRadius:n+t}},T=e=>e.max>0?e.value/e.max:0,E=(e,t=0)=>({...w(e,t),startAngle:f,endAngle:f+p*T(e),cornerRadius:l}),D=e=>{let[t,n]=Ei(E(e)),r={name:e.data.name,seriesIndex:e.index,value:e.value,text:`${S(e.value)} (${C.format(T(e))})`,x:b+t,y:x+n};return e.data.color&&(r.color=e.data.color),{index:e.position,label:e.data.name,title:``,x:b+t,area:{x:b-y,y:x-y,width:y*2,height:y*2},items:[r],seriesIndex:e.index,mark:{d:ki(E(e,2)),x:b,y:x}}},k={count:m.length,hitIndex:e=>{let t=m[e];return t?D(t):null},hitTest(e,t){let n=Math.hypot(e-b,t-x),r=m.find(e=>{let{innerRadius:t,outerRadius:r}=w(e,2);return n>=t&&n<=r});return r?D(r):null}};n.onHitTest(k);let A=m.map(e=>O(`g`,Pe(e.data,e.index),Ai(`tc-gauge-track`,{...E(e),endAngle:f+p}),Ai(`tc-gauge-arc`,E(e)))),j=_?h?.value??C.format(T(g)):``;return[O(`g`,{class:`tc-gauge`,style:`transform:translate(${b}px,${x}px)`},O(`g`,{class:`tc-gauge-rings`},A)),_&&O(`g`,{class:`tc-gauge-center`,"aria-hidden":`true`},O(`text`,{class:`tc-gauge-value`,x:b,y:x,dy:v?`0`:`0.35em`,"text-anchor":`middle`},j),v&&O(`text`,{class:`tc-gauge-label`,x:b,y:x,dy:`1.6em`,"text-anchor":`middle`},v))]}function Li(e,t){let n=z(e.format,t.locale),r=I(t.locale,{style:`percent`,maximumFractionDigits:1});return{columns:[``,`Value`,`Share`],rows:Pi(e,t.hidden).map(e=>[e.data.name,n(e.value),r.format(e.max>0?e.value/e.max:0)])}}let Ri={name:`gauge`,clean:q(e=>Me(typeof e==`number`?[{name:``,value:e}]:we(e)?[e]:e)),render:(e,t)=>(C.sweep=ji,Ii(e,t)),legend:e=>Ne(Ni(e)),table:Li};function zi(e,t,n,r,i){let a=Math.max(0,Math.min(i,n/2,r/2)),o=c;return`M${o(e+a)},${o(t)}H${o(e+n-a)}A${o(a)},${o(a)},0,0,1,${o(e+n)},${o(t+a)}V${o(t+r-a)}A${o(a)},${o(a)},0,0,1,${o(e+n-a)},${o(t+r)}H${o(e+a)}A${o(a)},${o(a)},0,0,1,${o(e)},${o(t+r-a)}V${o(t+a)}A${o(a)},${o(a)},0,0,1,${o(e+a)},${o(t)}Z`}let Bi=`var(--tc-heat-empty,var(--tc-grid-color))`,Vi=(e,t=`var(--tc-heat-color,var(--tc-color-1))`)=>`color-mix(in oklab,${t} ${c(e*100)}%,${Bi})`,Hi=(e,t)=>e.name??`range-${t+1}`,Ui=(e,t)=>e.findIndex(e=>(e.from===void 0||t>=e.from)&&(e.to===void 0||t<e.to)),Wi=(e,t)=>e.color??(t<8?`var(--tc-color-${t+1})`:`var(--tc-color-other)`);function Gi(e,i){let{width:a,height:s,fontSize:l,locale:u}=i,{gap:d=2,radius:f=3}=e,p=Ie(e.data),m=e.x?.format??(e=>String(e)),h=z(e.format,u),[g,_]=xe(e.data.series.flatMap(e=>e.values))??[0,1],v=e.min??Math.min(0,g),y=e.max??_,b=t=>{let{mid:n}=e,r;return r=n!==void 0&&e.colors&&v<n&&n<y?t<=n?(t-v)/(n-v)*.5:.5+(t-n)/(y-n)*.5:y>v?(t-v)/(y-v):+(t>v),Math.min(1,Math.max(0,r))},x=e=>.08+.92*b(e),S=e.ranges?.length?e.ranges:void 0,C=!S&&e.colors&&e.colors.length>=2?e.colors:void 0,w=!S&&!C&&e.colorBy===`series`,T=w?e.data.series.filter(e=>!i.hidden.has(X(e))):e.data.series,E=t=>e.data.series.indexOf(t),D=(e,t)=>{if(S){let t=Ui(S,e),n=S[t];return!n||i.hidden.has(Hi(n,t))?{color:Bi,empty:!0}:{style:{"--tc-cell-fill":n.color},color:n.color}}if(C){let t=b(e)*(C.length-1),n=Math.min(C.length-2,Math.floor(t)),r=c((t-n)*100),i=C[n],a=r<=0?i:r>=100?C[n+1]:`color-mix(in oklab,${C[n+1]} ${r}%,${i})`;return{style:{"--tc-cell-fill":a},color:a}}let n=x(e);return{style:`--tc-heat:${c(n*100)}%`,color:w?Vi(n,Wi(t,E(t))):Vi(n)}},{rtl:k}=i,A=n(t(e.padding,0),k),j=e.x?.show!==!1&&p.length>0,M=e.y?.show!==!1&&T.length>0,N=T.map((e,t)=>({value:t,position:0,label:e.name})),P=M?ge(`left`,N,l):0,F=j?ge(`bottom`,[{value:0,position:0,label:`M`}],l):0,ee=j?o(m(p[p.length-1],p.length-1),l):0,I=(a-A.left-A.right-P)/Math.max(1,p.length)/2,L=r(a,s,n({top:A.top,right:A.right+Math.max(0,Math.ceil(ee/2-I)),bottom:A.bottom+F,left:A.left+P},k)),R=L.x+L.width,B=ye(p.map((e,t)=>t),k?[R,L.x]:[L.x,R]),V=ye(T.map((e,t)=>t),[L.y,L.y+L.height]),H=Math.max(0,B.bandwidth-d),U=Math.max(0,V.bandwidth-d),W=e=>B.at(e)+d/2,te=e=>V.at(e)+d/2,G=(e,t)=>{let n=T[t]?.values[e];return n!=null&&Number.isFinite(n)?n:null},ne=(e,t=0)=>{if(e<0||e>=p.length||T.length===0)return null;let n=Math.max(0,Math.min(T.length-1,t)),r=T.map((t,n)=>{let r=G(e,n),i=S&&r!==null?S[Ui(S,r)]:void 0;return{name:t.name,seriesIndex:n,value:r,text:r===null?`–`:i?.name?`${h(r)} · ${i.name}`:h(r),x:W(e)+H/2,y:te(n)+U/2,box:{x:W(e),y:te(n),width:H,height:U},color:r===null?`var(--tc-grid-color)`:D(r,t).color}});return{index:e,label:Y(p[e]),title:m(p[e],e),x:W(e)+H/2,area:L,items:r,seriesIndex:n,mark:{d:zi(W(e)-2,te(n)-2,H+4,U+4,f+2),x:0,y:0}}},re={count:p.length,reversed:k===!0,hitIndex:(e,t)=>ne(e,t),hitTest(e,t){if(e<L.x||e>L.x+L.width||t<L.y||t>L.y+L.height)return null;let n=Math.min(p.length-1,Math.floor((e-L.x)/(B.step||1))),r=k?p.length-1-n:n,i=Math.min(T.length-1,Math.floor((t-L.y)/(V.step||1)));return ne(r,i)}};i.onHitTest(re);let ie=T.map((e,t)=>O(`g`,{key:X(e),class:[`tc-heatmap-row`,w&&[`tc-series`,`tc-series-${E(e)+1}`]],"data-series":e.name,style:w?{"--tc-series-color":e.color}:void 0},p.map((n,r)=>{let i=G(r,t),a=i===null?void 0:D(i,e);return O(`rect`,{key:Y(n),class:[`tc-cell`,(i===null||a?.empty)&&`tc-cell-empty`],x:c(W(r)),y:c(te(t)),width:c(H),height:c(U),rx:c(Math.min(f,H/2,U/2)),style:a?.style})}))),ae=j?he(pe(B,(e,t)=>m(p[t],t)),`bottom`,l):[],oe=M?pe(V,(e,t)=>T[t]?.name??``):[];return[O(`g`,{class:`tc-heatmap-cells`},ie),j&&_e({position:`bottom`,ticks:ae,area:L}),M&&_e({position:k?`right`:`left`,ticks:oe,area:L})]}function Ki(e){let{ranges:t}=e;if(t?.length){let n=z(e.format,e.locale);return t.map((e,t)=>({key:Hi(e,t),name:e.name??(e.from===void 0?`< ${n(e.to??0)}`:e.to===void 0?`≥ ${n(e.from)}`:`${n(e.from)}–${n(e.to)}`),index:t,color:e.color}))}return e.colors&&e.colors.length>=2?[]:e.colorBy===`series`?Fe(e.data):[]}let qi={name:`heatmap`,clean:q(je),render:Gi,legend:Ki,valueLabels:{marks:`cell`,format:e=>e.format},table:(e,t,n)=>et({data:e.data,...e.x?{x:e.x}:{},y:{format:e.format}},t,n)},Ji=5e3;function Yi(e,t){return e.data.map((e,t)=>({data:e,index:t,seats:Math.min(Ji,Math.max(0,Math.round(e.seats||0)))})).filter(e=>!t.has(J(e.data))).map((e,t)=>({...e,position:t}))}function Xi(e,t){let n=Math.min(Ji,t.reduce((e,t)=>e+t.seats,0)),r=Math.min(Ji,Math.round(e.total??0));return{taken:n,total:Math.max(n,r>0?r:0)}}function Zi(e,t){let n=t.reduce((e,t)=>e+t,0),r=t.map(t=>Math.floor(e*t/n)),i=e-r.reduce((e,t)=>e+t,0),a=t.map((t,i)=>({i,lost:e*t/n-r[i]})).sort((e,t)=>t.lost-e.lost||t.i-e.i);for(let{i:e}of a){if(i<=0)break;r[e]=r[e]+1,i--}return r}function Qi(e,t,n,r,i,a){let o={x0:0,y0:0,x1:0,y1:0};if(e<=0)return{seats:[],dot:0,box:o};let s=1-i,c=r>=Math.PI*2-1e-9,l=e=>Array.from({length:e},(t,n)=>e>1?i+n*s/(e-1):1),u=e=>e>1?s/(e-1):s,d=e=>{let t=u(e);return l(e).reduce((e,n)=>e+Math.floor(n*r/t)+ +!c,0)},f=t&&t>0?Math.min(Math.round(t),e):1;if(!t)for(;f<e&&d(f)<e;)f++;let p=l(f),m=u(f),h=Zi(e,p),g=[],_=f>1?m:1/0;p.forEach((e,t)=>{let i=h[t],a=i>1?r/(c?i:i-1):0;i>1&&(_=Math.min(_,e*a));for(let o=0;o<i;o++){let s=i>1?n+o*a:n+r/2;g.push({x:e*Math.sin(s),y:-e*Math.cos(s),angle:s,row:t})}}),g.sort((e,t)=>e.angle-t.angle||e.row-t.row);let v=(Number.isFinite(_)?_:s)*(1-a)*.5;for(let e of g)o.x0=Math.min(o.x0,e.x-v),o.x1=Math.max(o.x1,e.x+v),o.y0=Math.min(o.y0,e.y-v),o.y1=Math.max(o.y1,e.y+v);return{seats:g,dot:v,box:o}}function $i(e,n){let{width:i,height:a,locale:o}=n,s=r(i,a,t(e.padding,0)),l=Math.min(360,Math.max(0,e.angle??180))*bi,u=(e.startAngle??-(l/bi)/2)*bi,d=Math.min(.95,Math.max(0,e.innerRadius??.45)),f=Math.min(.9,Math.max(0,e.gap??.35)),p=Yi(e,n.hidden),{taken:m,total:h}=Xi(e,p),g=Qi(h,e.rows,u,l,d,f),_=e.center,v=_!==!1,y=v?_?.label:void 0,b=l<=Math.PI+1e-9&&Math.abs(u+l/2)<1e-9,x=n.fontSize,S=v?b?-(y?3.4:2.1)*x:-1.4*x:0,C=v?b?0:(y?2:.7)*x:0,w=Math.min(s.width,s.height)/2,T={x0:0,y0:0,x1:0,y1:0};for(let e=0;e<4&&w>0;e++){T={x0:Math.min(g.box.x0*w,0),y0:Math.min(g.box.y0*w,S),x1:Math.max(g.box.x1*w,0),y1:Math.max(g.box.y1*w,C)};let e=Math.min(s.width/(T.x1-T.x0),s.height/(T.y1-T.y0));if(Math.abs(e-1)<.001)break;w=Math.max(0,w*e)}let E=s.x+(s.width-(T.x1-T.x0))/2-T.x0,D=s.y+(s.height-(T.y1-T.y0))/2-T.y0,k=c(g.dot*w),A=e=>[E+e.x*w,D+e.y*w],j=0,M=p.map(e=>{let t=j;return j+=e.seats,g.seats.slice(t,j)}),N=g.seats.slice(m,h),P=p.filter(e=>e.seats>0),F=z(e.format,o),ee=I(o,{style:`percent`,maximumFractionDigits:1}),L=(e,t)=>{let n=M[e.position],r=0,i=0;if(t)[r,i]=A(t);else for(let e of n){let[t,a]=A(e);r+=t/n.length,i+=a/n.length}let a={name:e.data.name,seriesIndex:e.index,value:e.seats,text:`${F(e.seats)} (${ee.format(h>0?e.seats/h:0)})`,x:r,y:i};e.data.color&&(a.color=e.data.color);let o=k+3,s=n.map(e=>{let[t,n]=A(e);return`M${c(t+o)},${c(n)}A${o},${o},0,1,1,${c(t-o)},${c(n)}A${o},${o},0,1,1,${c(t+o)},${c(n)}Z`}).join(``);return{index:P.indexOf(e),label:e.data.name,title:``,x:r,area:{x:E-w,y:D-w,width:w*2,height:w*2},items:[a],seriesIndex:e.index,mark:{d:s,x:0,y:0}}},R={count:P.length,hitIndex:e=>{let t=P[e];return t?L(t):null},hitTest(e,t){let n=k+2,r;for(let i of P)for(let a of M[i.position]){let[o,s]=A(a),c=Math.hypot(e-o,t-s);c<=n&&(!r||c<r.d)&&(r={party:i,seat:a,d:c})}return r?L(r.party,r.seat):null}};n.onHitTest(R);let B=(e,t,n)=>{let[r,i]=A(e);return O(`circle`,{key:t,class:n,r:k,style:`transform:translate(${c(r-E)}px,${c(i-D)}px)`})},V=p.map(e=>O(`g`,Pe(e.data,e.index),M[e.position].map((e,t)=>B(e,t,`tc-seat`)))),H=v?_?.value??F(h):``;return[O(`g`,{class:`tc-parliament`,style:`transform:translate(${c(E)}px,${c(D)}px)`},O(`g`,{class:`tc-parliament-seats`},V,N.length>0&&O(`g`,{key:`vacant`,class:`tc-parliament-vacant`},N.map((e,t)=>B(e,t,`tc-seat tc-seat-vacant`))))),v&&O(`g`,{class:`tc-parliament-center`,"aria-hidden":`true`},y&&O(`text`,{class:`tc-parliament-label`,x:c(E),y:c(D),dy:b?`-2.5em`:`1.6em`,"text-anchor":`middle`},y),O(`text`,{class:`tc-parliament-value`,x:c(E),y:c(D),dy:b?`-0.4em`:y?`0`:`0.35em`,"text-anchor":`middle`},H))]}function ea(e,t){let n=Yi(e,t.hidden),{total:r}=Xi(e,n),i=z(e.format,t.locale),a=I(t.locale,{style:`percent`,maximumFractionDigits:1});return{columns:[``,`Seats`,`Share`],rows:n.map(e=>[e.data.name,i(e.seats),a.format(r>0?e.seats/r:0)])}}let ta={name:`parliament`,clean:q(e=>ke(e,e=>({...Ae(e),seats:K(e.seats)??0}))),render:$i,legend:e=>Ne(e.data),table:ea};function na(e,t,n=`Others`){let r=e.map((e,t)=>({data:e,index:t,value:Math.max(0,e.value||0)})),i=Number.isFinite(t)&&t>=0?t:9,a=i?Math.max(1,Math.round(i)):1/0;if(r.length<=a)return r;let o=new Set([...r].sort((e,t)=>t.value-e.value||e.index-t.index).slice(0,a-1)),s=r.reduce((e,t)=>o.has(t)?e:e+t.value,0);return[...r.filter(e=>o.has(e)),{data:{name:n,id:`__others__`,value:s},index:Math.max(8,r.length),value:s}]}function ra(e){return e.map(({data:e,index:t})=>{let n={key:J(e),name:e.name,index:t};return e.color&&(n.color=e.color),e.hidden&&(n.hidden=!0),n})}let ia=e=>na(e.data,e.maxSlices,e.othersLabel);function aa(e,t){let n=e.data.length,r=ia(e).filter(e=>!t.has(J(e.data)));return e.order===`size`&&r.sort((e,t)=>Number(e.index>=n)-Number(t.index>=n)||t.value-e.value||e.index-t.index),{segments:r,total:r.reduce((e,t)=>e+t.value,0)}}function oa(e,n){let{width:i,height:a,locale:o}=n,s=Math.max(0,e.gap??2),l=Math.max(0,e.radius??4),u=r(i,a,t(e.padding,0)),{segments:d,total:f}=aa(e,n.hidden),p=d.filter(e=>e.value>0),m=u.x,h=p.map((e,t)=>{let n=e.value/f*u.width,r=t===0?0:s/2,i=t===p.length-1?0:s/2,a={x:m+r,y:u.y,width:Math.max(0,n-r-i),height:u.height};return m+=n,a}),g=z(e.format,o),_=I(o,{style:`percent`,maximumFractionDigits:1}),v=e=>{let t=p[e],n=h[e],r=n.x+n.width/2,i={name:t.data.name,seriesIndex:t.index,value:t.value,text:`${g(t.value)} (${_.format(t.value/f)})`,x:r,y:n.y+n.height/2,box:n};t.data.color&&(i.color=t.data.color);let a=c;return{index:e,label:t.data.name,title:``,x:r,area:u,items:[i],seriesIndex:t.index,mark:{d:`M${a(n.x+1)},${a(n.y+1)}h${a(n.width-2)}v${a(n.height-2)}h${a(2-n.width)}Z`,x:0,y:0}}},y={count:p.length,hitIndex:e=>p[e]?v(e):null,hitTest(e,t){if(t<u.y||t>u.y+u.height)return null;let n=h.findIndex(t=>e>=t.x-s/2&&e<=t.x+t.width+s/2);return n<0?null:v(n)}};return n.onHitTest(y),O(`g`,{class:`tc-percentage-bar`},p.length===0&&O(`rect`,{key:`track`,class:`tc-percentage-bar-track`,x:c(u.x),y:c(u.y),width:c(u.width),height:c(u.height),rx:c(Math.min(l,u.width/2,u.height/2))}),d.map(e=>{let t=h[p.indexOf(e)];return O(`g`,Pe(e.data,e.index),t&&O(`rect`,{class:`tc-segment`,x:c(t.x),y:c(t.y),width:c(t.width),height:c(t.height),rx:c(Math.min(l,t.width/2,t.height/2))}))}))}function sa(e,t){let{segments:n,total:r}=aa(e,t.hidden),i=z(e.format,t.locale),a=I(t.locale,{style:`percent`,maximumFractionDigits:1});return{columns:[``,`Value`,`Share`],rows:n.map(e=>[e.data.name,i(e.value),a.format(r>0?e.value/r:0)])}}let ca={name:`percentage-bar`,clean:e=>{let t=e;return{...t,data:Me(t.data),height:t.height??(t.aspectRatio?void 0:16)}},render:oa,legend:e=>ra(ia(e)),table:sa,valueLabels:{marks:`cell`}};function la(e,t){let n=na(e.data,e.maxSlices,e.othersLabel).filter(e=>!t.has(J(e.data))),r=n.reduce((e,t)=>e+t.value,0),i=(e.startAngle??0)*bi;return{slices:n.map(e=>{let t=r>0?e.value/r*Math.PI*2:0,n={...e,startAngle:i,endAngle:i+t};return i+=t,n}),total:r}}function ua(e,n,i){let{width:a,height:o,locale:s}=n,c=e.gap??2,l=r(a,o,t(e.padding,0)),u=Math.max(0,Math.min(l.width,l.height)/2-8),d=u*Math.min(.95,Math.max(0,e.innerRadius??i.inner)),f=e.cornerRadius??i.corner,p=l.x+l.width/2,m=l.y+l.height/2,{slices:h,total:g}=la(e,n.hidden),_=h.filter(e=>e.value>0),v=d===0&&_.length>1?c:0,y=d>0&&_.length>1?Di(c,d,u):0,b=z(e.format,s),x=I(s,{style:`percent`,maximumFractionDigits:1}),S=(e,t=d,n=u)=>({innerRadius:t,outerRadius:n,startAngle:e.startAngle,endAngle:e.endAngle,padAngle:y,cornerRadius:f}),C=(e,t)=>{let[n,r]=Ei(S(e)),i={name:e.data.name,seriesIndex:e.index,value:e.value,text:`${b(e.value)} (${x.format(g>0?e.value/g:0)})`,x:p+n,y:m+r};return e.data.color&&(i.color=e.data.color),{index:t,label:e.data.name,title:``,x:p+n,area:{x:p-u,y:m-u,width:u*2,height:u*2},items:[i],seriesIndex:e.index,mark:{d:ki({...S(e,u+2,u+6),cornerRadius:2}),x:p,y:m}}},w={count:_.length,hitIndex:e=>{let t=_[e];return t?C(t,e):null},hitTest(t,n){let r=t-p,i=n-m,a=Math.hypot(r,i);if(a<d-2||a>u+8)return null;let o=(e.startAngle??0)*bi,s=Math.PI*2,c=Math.atan2(r,-i);c=o+((c-o)%s+s)%s;let l=_.findIndex(e=>c>=e.startAngle&&c<e.endAngle);return l===-1?null:C(_[l],l)}};n.onHitTest(w);let T=h.map(e=>O(`g`,Pe(e.data,e.index),Ai(`tc-slice`,S(e)))),E=e.center,D=d>0&&E!==!1,k=D?E?.value??b(g):``,A=D?E?.label:void 0;return[O(`g`,{class:`tc-pie`,style:`transform:translate(${p}px,${m}px)`},g===0&&O(`path`,{class:`tc-pie-track`,d:ki({innerRadius:d,outerRadius:u,startAngle:0,endAngle:Math.PI*2})}),O(`g`,{class:`tc-pie-slices`,style:v>0?`--tc-pie-gap:${v}px`:void 0},T)),D&&O(`g`,{class:`tc-pie-center`,"aria-hidden":`true`},O(`text`,{class:`tc-pie-value`,x:p,y:m,dy:A?`0`:`0.35em`,"text-anchor":`middle`},k),A&&O(`text`,{class:`tc-pie-label`,x:p,y:m,dy:`1.6em`,"text-anchor":`middle`},A))]}function da(e,t){let{slices:n,total:r}=la(e,t.hidden),i=z(e.format,t.locale),a=I(t.locale,{style:`percent`,maximumFractionDigits:1});return{columns:[``,`Value`,`Share`],rows:n.map(e=>[e.data.name,i(e.value),a.format(r>0?e.value/r:0)])}}function fa(e,t){return{name:e,clean:q(Me),render:(e,n)=>(C.sweep=ji,ua(e,n,t)),legend:e=>ra(na(e.data,e.maxSlices,e.othersLabel)),table:da,valueLabels:{marks:`slice`}}}let pa=fa(`pie`,{inner:0,corner:0}),ma=fa(`donut`,{inner:.62,corner:4});function ha(e,t,n){if(o(e,n)<=t)return e;let r=e.length;for(;r>0&&o(`${e.slice(0,r)}…`,n)>t;)r--;return r>0?`${e.slice(0,r).trimEnd()}…`:``}function ga(e,t,n){let r=[],i=``;for(let a of e.split(` `)){let e=i?`${i} ${a}`:a;!i||o(e,n)<=t?i=e:(r.push(i),i=a)}return r.push(i),r.length>3&&r.splice(2,r.length,r.slice(2).join(` `)),r}let _a=e=>e>.1?1:e<-.1?-1:0;function va(e,t,n,r){let i=Math.min(e.width,e.height)/2;return t.forEach((t,a)=>{let s=Math.sin(t),c=Math.cos(t),l=n[a]??[],u=Math.max(0,...l.map(e=>o(e,r))),d=ya(l.length,r),f=_a(s),p=f===0?u/2:u+8;if(Math.abs(s)>1e-6&&(i=Math.min(i,(e.width/2-p)/Math.abs(s))),Math.abs(c)>1e-6){let t=(f===0?d+8:d/2)/Math.abs(c);i=Math.min(i,e.height/2/Math.abs(c)-t)}}),Math.max(0,i)}let ya=(e,t)=>t*(1+Math.max(0,e-1)*l);function ba(e,n){let{width:i,height:a,fontSize:o,locale:s}=n,u=e.r??{},{fill:d=!0,points:f=!1,pointRadius:p=4}=e,m=e.data.series,h=Ie(e.data),g=h.length,_=m.filter(e=>!n.hidden.has(X(e))),v=e.format??(e=>String(e)),y=W(u.format,s),b=t(e.padding),x=r(i,a,{top:b.top+8,right:b.right+8,bottom:b.bottom+8,left:b.left+8}),S=x.x+x.width/2,C=x.y+x.height/2,w=h.map((e,t)=>t/Math.max(1,g)*Math.PI*2),T=h.map((e,t)=>v(e,t)),E=e.labelWidth??x.width/4,D=T.map(e=>ga(e,E,o)),k=Math.max(va(x,w,D,o),Math.min(x.width,x.height)/2*.5),A=D.map((e,t)=>{let n=Math.sin(w[t]),r=_a(n)===0?x.width:x.width/2-k*Math.abs(n)-8;return e.map(e=>ha(e,r,o))}),j=We(u,Math.max(2,Math.round(k/40))),M=Se(Ke(_.flatMap(e=>e.values),u,!0,j),[0,k],{clamp:!0}),N=fe(M,{count:j,format:u.format,locale:s}),P=(e,t)=>[S+t*Math.sin(w[e]),C-t*Math.cos(w[e])],F=e=>`${e.map((e,t)=>`${t?`L`:`M`}${P(t,e).map(c).join(`,`)}`).join(``)}Z`,ee=t=>e.grid===`circle`?`M${c(S)},${c(C-t)}A${c(t)},${c(t)},0,1,1,${c(S)},${c(C+t)}A${c(t)},${c(t)},0,1,1,${c(S)},${c(C-t)}Z`:F(h.map(()=>t)),I=e=>e!=null&&Number.isFinite(e)?M(e):0,L=e=>{let t=[];m.forEach((r,i)=>{if(n.hidden.has(X(r)))return;let a=r.values[e],o=a!=null&&Number.isFinite(a)?a:null,[s,c]=P(e,I(o)),l={name:r.name,seriesIndex:i,value:o,text:o===null?`–`:y(o),x:s,y:o===null?null:c};r.color&&(l.color=r.color),t.push(l)});let[r,i]=P(e,k);return{index:e,label:Y(h[e]),title:T[e],x:r,area:{x:S-k,y:C-k,width:k*2,height:k*2},items:t,guide:{x1:S,y1:C,x2:r,y2:i}}},R={count:g,hitTest(e,t){if(g===0||Math.hypot(e-S,t-C)>k+8)return null;let n=Math.atan2(e-S,C-t),r=(n<0?n+Math.PI*2:n)/(Math.PI*2);return L(Math.round(r*g)%g)},hitIndex(e,t){if(e<0||e>=g)return null;let n=L(e);return t!==void 0&&n.items.some(e=>e.seriesIndex===t)&&(n.seriesIndex=t),n}};n.onHitTest(R);let z=O(`g`,{key:`grid`,class:`tc-radar-grid`,"aria-hidden":`true`},N.filter(e=>e.position>0).map(e=>O(`path`,{key:e.value,class:`tc-radar-ring`,d:ee(e.position)})),h.map((e,t)=>{let[n,r]=P(t,k);return O(`line`,{key:Y(e),class:`tc-radar-spoke`,x1:c(S),y1:c(C),x2:c(n),y2:c(r)})})),B=m.map((e,t)=>{if(n.hidden.has(X(e)))return null;let r=F(h.map((t,n)=>I(e.values[n])));return O(`g`,Qe(e,t),d&&O(`path`,{class:`tc-area`,d:r}),O(`path`,{class:`tc-line`,d:r}),f&&O(`g`,{class:`tc-points`},h.map((t,n)=>{let r=e.values[n];if(r==null||!Number.isFinite(r))return null;let[i,a]=P(n,M(r));return O(`circle`,{key:Y(t),class:`tc-point`,cx:c(i),cy:c(a),r:p})})))}),V=O(`g`,{key:`labels`,class:`tc-radar-labels`,"aria-hidden":`true`},h.map((e,t)=>{let n=w[t],r=_a(Math.sin(n)),i=Math.cos(n),[a,o]=P(t,k+8),[s=``,...u]=A[t]??[],d=u.length*l,f=r===0?i>0?`${c(-d)}em`:`0.71em`:`${c(.35-d/2)}em`;return O(`text`,{key:Y(e),class:`tc-tick-label tc-radar-label`,x:c(a),y:c(o),"text-anchor":r>0?`start`:r<0?`end`:`middle`,dy:f},s,u.map((e,t)=>O(`tspan`,{key:t,x:c(a),dy:`${l}em`},e)))})),H=u.show!==!1&&O(`g`,{key:`values`,class:`tc-radar-values`,"aria-hidden":`true`},N.filter(e=>e.position>0).map(e=>O(`text`,{key:e.value,class:`tc-tick-label tc-radar-value`,x:c(S+4),y:c(C-e.position),dy:`0.35em`},e.label)));return[z,O(`g`,{key:`series`,class:`tc-series-list tc-radar-series`,style:`transform-origin:${c(S)}px ${c(C)}px`},B),V,H]}let xa={name:`radar`,clean:q(je),render:ba,legend:e=>Fe(e.data),table:(e,t,n)=>et({data:e.data,...e.r?.format?{y:{format:e.r.format}}:{},...e.format?{x:{format:e.format}}:{}},t,n)};function Sa(e,t,n){if(o(e,n)<=t)return e;let r=e.length;for(;r>0&&o(`${e.slice(0,r)}…`,n)>t;)r--;return r>0?`${e.slice(0,r).trimEnd()}…`:``}let Ca=e=>e.data.color??`var(--tc-color-${e.slot})`;function wa(e,t,n){let r=/* @__PURE__ */ new Map,i=[],a=(e,t)=>{let n=r.get(e);return n||(n={data:t??{name:e},index:i.length,slot:1,column:0,value:0,x:0,y:0,height:0,ins:[],outs:[]},r.set(e,n),i.push(n)),n},o=new Map((e.nodes??[]).map(e=>[e.name,e])),s=n=>{let r=o.get(n);return t.has(n)||r?.color!==void 0&&t.has(Ta(e,r.color))},c=[];e.links.forEach((e,t)=>{if(e.from===e.to||s(e.from)||s(e.to))return;let n=a(e.from,o.get(e.from)),r=a(e.to,o.get(e.to)),i={data:e,index:t,source:n,target:r,sy:0,ty:0,width:0};c.push(i),e.value<=0||(n.outs.push(i),r.ins.push(i))});for(let e of i)e.value=Math.max(e.outs.reduce((e,t)=>e+t.data.value,0),e.ins.reduce((e,t)=>e+t.data.value,0));for(let e=0;e<i.length;e++){let e=!1;for(let t of c)t.data.value>0&&t.target.column<=t.source.column&&(t.target.column=t.source.column+1,e=!0);if(!e)break}let l=i.reduce((e,t)=>Math.max(e,t.column),0);if(n)for(let e of i)e.outs.length===0&&(e.column=l);let u=[...o.keys()];i.sort((e,t)=>{if(e.column!==t.column)return e.column-t.column;let n=u.indexOf(e.data.name),r=u.indexOf(t.data.name);return n!==-1&&r!==-1?n-r:n===r?e.index-t.index:n===-1?1:-1});let d=/* @__PURE__ */ new Map;return i.forEach((e,t)=>{e.index=t;let n=(d.get(e.column)??0)+1;d.set(e.column,n),e.slot=(n-1)%8+1}),{nodes:i,links:c,columns:l+1}}let Ta=(e,t)=>(e.nodes??[]).find(e=>e.color===t)?.name??t;function Ea(e,i){let{width:a,height:s,fontSize:c,locale:l}=i,u=Math.max(1,e.nodeWidth??12),d=Math.max(0,e.nodePadding??16),{rtl:f}=i,p=r(a,s,n(t(e.padding),f)),{nodes:m,links:h,columns:g}=wa(e.data,i.hidden,e.align!==`left`),_=W(e.format,l),v=m.map(e=>[e.data.name,_(e.value)]),y=e=>m.reduce((t,n,r)=>{if(!e(n))return t;let[i,a]=v[r];return Math.max(t,o(i,c),o(a,c))},0),b=p.width*.3,x=g>1?Math.min(b,y(e=>e.column===0)):0,S=Math.min(b,y(e=>e.column===g-1)),C={x:p.x+(x?x+8:0),y:p.y,width:Math.max(0,p.width-(x?x+8:0)-(S?S+8:0)),height:p.height},w=g>1?(C.width-u)/(g-1):0,T=Array.from({length:g},()=>[]);for(let e of m)T[e.column]?.push(e);let E=T.reduce((e,t)=>t.length>1?Math.min(e,C.height/2/(t.length-1)):e,d),D=1/0;for(let e of T){let t=e.reduce((e,t)=>e+t.value,0);t>0&&(D=Math.min(D,(C.height-(e.length-1)*E)/t))}(!Number.isFinite(D)||D<0)&&(D=0),T.forEach((e,t)=>{let n=e.reduce((e,t)=>e+t.value*D,0)+(e.length-1)*E,r=C.y+(C.height-n)/2;for(let n of e){let e=C.x+(g>1?t*w:(C.width-u)/2);n.x=f?a-e-u:e,n.y=r,n.height=n.value*D,r+=n.height+E}});for(let e of m){let t=e.y;for(let n of[...e.outs].sort((e,t)=>e.target.y-t.target.y))n.sy=t,n.width=n.data.value*D,t+=n.width;t=e.y;for(let n of[...e.ins].sort((e,t)=>e.source.y-t.source.y))n.ty=t,t+=n.data.value*D}let O=m.map((e,t)=>{let[n,r]=v[t],i=e.column===0&&g>1?`left`:`right`,a=i===`left`?x:e.column===g-1?S:w-u-16,o=T[e.column],s=o.indexOf(e),l=[o[s-1],o[s+1]].filter(e=>!!e).reduce((t,n)=>Math.min(t,(e.height+n.height)/2+E),1/0)>=c*2.25;return{side:i,name:Sa(n,a,c),value:l?Sa(r,a,c):``}});return f&&(C.x=a-C.x-C.width),{nodes:m,links:h,plot:C,nodeWidth:u,labels:O}}let Da=(e,t)=>e.source.x>e.target.x?[e.source.x,e.target.x+t]:[e.source.x+t,e.target.x];function Oa(e,t){let[n,r]=Da(e,t),i=(n+r)/2,{sy:a,ty:o,width:s}=e,l=(...e)=>e.map(c).join(`,`);return`M${l(n,a)}C${l(i,a,i,o,r,o)}L${l(r,o+s)}C${l(i,o+s,i,a+s,n,a+s)}Z`}let ka=(e,t,n,r,i)=>{let a=1-i;return a*a*a*e+3*a*a*i*t+3*a*i*i*n+i*i*i*r};function Aa(e,t,n,r){let[i,a]=Da(e,t);if(n<Math.min(i,a)||n>Math.max(i,a)||i===a)return!1;let o=(i+a)/2,s=0,c=1;for(let e=0;e<20;e++){let e=(s+c)/2;ka(i,o,o,a,e)<n==a>i?s=e:c=e}let l=ka(e.sy,e.sy,e.ty,e.ty,(s+c)/2);return r>=l&&r<=l+e.width}function ja(e,t){let{nodes:n,links:r,plot:i,nodeWidth:a,labels:o}=Ea(e,t),s=r.filter(e=>e.data.value>0),l=W(e.format,t.locale),u=e=>({d:`M0,0h${c(a)}v${c(e.height)}h${c(-a)}Z`,x:e.x,y:e.y}),d=e=>({name:`${e.source.data.name} ${t.rtl?`←`:`→`} ${e.target.data.name}`,seriesIndex:e.index,color:Ca(e.source),value:e.data.value,text:l(e.data.value),x:(e.source.x+a+e.target.x)/2,y:ka(e.sy,e.sy,e.ty,e.ty,.5)+e.width/2}),f=(e,t)=>{let n={name:e.data.name,seriesIndex:r.length+e.index,color:Ca(e),value:e.value,text:l(e.value),x:e.x+a/2,y:e.y+e.height/2},o=[...e.ins,...e.outs].map(d),c=o.find(e=>e.seriesIndex===t),f=c&&s.find(e=>e.index===t);return{index:e.index,label:e.data.name,title:``,x:n.x,area:i,items:[n,...o],seriesIndex:c?t:n.seriesIndex,mark:f?{d:Oa(f,a),x:0,y:0}:u(e)}},p=e=>{let t=d(e);return{index:e.source.index,label:e.source.data.name,title:``,x:t.x,area:i,items:[t],seriesIndex:e.index,mark:{d:Oa(e,a),x:0,y:0}}},m={count:n.length,hitTest(e,t){let r=n.find(n=>e>=n.x-2&&e<=n.x+a+2&&t>=n.y-2&&t<=n.y+n.height+2);if(r)return f(r);let i=s.find(n=>Aa(n,a,e,t));return i?p(i):null},hitIndex(e,t){let r=n[e];return r?f(r,t):null}};return t.onHitTest(m),[O(`g`,{key:`links`,class:`tc-sankey-links`},s.map(e=>O(`path`,{key:`${e.source.data.name}→${e.target.data.name}#${e.index}`,class:[`tc-series`,`tc-series-${e.source.slot}`,`tc-sankey-link`],style:{"--tc-series-color":e.source.data.color},d:Oa(e,a)}))),O(`g`,{key:`nodes`,class:`tc-sankey-nodes`},n.map(e=>O(`g`,{key:e.data.name,class:[`tc-series`,`tc-series-${e.slot}`],"data-series":e.data.name,style:{"--tc-series-color":e.data.color}},O(`rect`,{class:`tc-sankey-node`,x:c(e.x),y:c(e.y),width:c(a),height:c(e.height)})))),O(`g`,{key:`labels`,class:`tc-sankey-labels`,"aria-hidden":`true`},n.map((e,n)=>{let r=o[n];if(!r.name&&!r.value)return null;let i=r.side===`left`!=(t.rtl===!0),s=c(i?e.x-8:e.x+a+8),l=c(e.y+e.height/2),u=i?`end`:`start`;return O(`g`,{key:e.data.name,class:`tc-sankey-label`},O(`text`,{class:`tc-value-label tc-sankey-name`,x:s,y:l,dy:r.value?`-0.25em`:`0.35em`,"text-anchor":u},r.name),r.value&&O(`text`,{class:`tc-tick-label tc-sankey-value`,x:s,y:l,dy:`0.95em`,"text-anchor":u},r.value))}))]}function Ma(e){let t=/* @__PURE__ */ new Map;for(let n of e.data.nodes??[])if(n.color&&!t.has(n.color)){let e={key:n.name,name:n.name,index:t.size,color:n.color};n.hidden&&(e.hidden=!0),t.set(n.color,e)}return[...t.values()]}function Na(e,t){let{links:n}=wa(e.data,t.hidden,!0),r=W(e.format,t.locale);return{columns:[`From`,`To`,`Value`],rows:n.map(e=>[e.data.from,e.data.to,r(e.data.value)])}}let Pa={name:`sankey`,clean:q(e=>{let t=we(e)?e:{};return{...t,nodes:Array.isArray(t.nodes)?ke(t.nodes,e=>Ae(e)):void 0,links:ke(t.links,e=>({from:Ee(e.from),to:Ee(e.to),value:Math.max(0,K(e.value)??0)}))}}),render:ja,legend:Ma,table:Na},Fa=e=>`M${e},0A${e},${e},0,1,1,${-e},0A${e},${e},0,1,1,${e},0Z`,Ia=e=>e.size!=null&&Number.isFinite(e.size)&&e.size>0?e.size:void 0;function La(e,i){let{width:a,height:s,fontSize:u,locale:d}=i,f=e.x??{},p=e.y??{},m=e.radius??4,h=e.data.series.filter(e=>!i.hidden.has(J(e))).flatMap(e=>e.points),g=h.map(Ia).filter(e=>e!==void 0),_=xe(g)?.[1]??0,v=e.size?.min??4,y=e.size?.max??24,b=e=>e!=null&&e>0&&_>0?v+(y-v)*Math.sqrt(e/_):m,x=Math.max(m,g.length?y:0)+2,S=We(p,Math.max(2,Math.round(s/60))),C=We(f,Math.max(2,Math.round(a/80))),w=e=>Le(e.x,f)&&Le(e.y,p),T=h.filter(w),E=Ke(T.map(e=>e.x),f,!1,C),D=Ke(T.map(e=>e.y),p,!1,S),k=f.show!==!1,A=p.show!==!1,j=(e,t,n)=>He(e,t,n,t.format,d),M=j(Ve(D,[1,0],p),p,S),N=j(Ve(E,[0,1],f),f,C),P=e=>k&&e?Math.ceil(o(e.label,u)/2):0,{rtl:F}=i,ee=f.reverse??F===!0,I=ee===(F===!0)?0:N.length-1,L=n(t(e.padding),F),R=r(a,s,n({top:L.top+Math.max(A?Math.ceil(u*l/2):0,x,4),right:L.right+Math.max(P(N[N.length-1-I]),x,8),bottom:L.bottom+Math.max(k?ge(`bottom`,N,u):0,x,4),left:L.left+Math.max(A?ge(`left`,M,u):0,P(N[I]),x)},F)),B=R.x+R.width,V=Ve(E,ee?[B,R.x]:[R.x,B],f),H=Ve(D,[R.y+R.height,R.y],p),U=he(j(V,f,C),`bottom`,u),te=he(j(H,p,S),`left`,u,4),G=[];e.data.series.forEach((e,t)=>{i.hidden.has(J(e))||e.points.forEach((e,n)=>{w(e)&&G.push({seriesIndex:t,pointIndex:n,point:e,cx:V(e.x),cy:H(e.y),r:b(Ia(e))})})}),G.sort((e,t)=>e.cx-t.cx);let ne=W(f.format,d),re=W(p.format,d),ie=z(void 0,d),ae=(t,n)=>{let r=e.data.series[t.seriesIndex],i=Ia(t.point),a=i===void 0?``:` · ${ie(i)}`,o={name:r.name,seriesIndex:t.seriesIndex,value:t.point.y,text:`${ne(t.point.x)}, ${re(t.point.y)}${a}`,x:t.cx,y:t.cy};return r.color&&(o.color=r.color),{index:n,label:t.point.label??r.name,title:t.point.label??``,x:t.cx,area:R,items:[o],seriesIndex:t.seriesIndex,mark:{d:Fa(c(t.r+4)),x:t.cx,y:t.cy}}},oe={count:G.length,hitIndex:e=>{let t=G[e];return t?ae(t,e):null},hitTest(e,t){let n=0,r=G.length,i=24+y;for(;n<r;){let t=n+r>>1;G[t].cx<e-i?n=t+1:r=t}let a=-1,o=1/0;for(let r=n;r<G.length;r++){let n=G[r];if(n.cx>e+i)break;let s=Math.hypot(n.cx-e,n.cy-t)-n.r;s<o&&s<=24&&(a=r,o=s)}return a===-1?null:ae(G[a],a)}};i.onHitTest(oe);let se=Ue(e),ce=(e,t)=>{if(!e.length)return null;let n=c(m),r=``;for(let i of e)r+=se?se(t,V(i.x),H(i.y),n):`M${c(V(i.x)-m)},${c(H(i.y))}a${n},${n},0,1,0,${2*n},0a${n},${n},0,1,0,${-2*n},0`;return O(`path`,{key:`dots`,class:[`tc-point tc-dots`,se&&`tc-marker`],d:r})},le=[];p.grid!==!1&&le.push(ve({direction:`y`,ticks:te,area:R})),f.grid&&le.push(ve({direction:`x`,ticks:U,area:R}));let ue=Ze(i,R,g.length?0:x),de=e.data.series.map((e,t)=>!i.hidden.has(J(e))&&O(`g`,Pe(e,t),ce(e.points.filter(e=>w(e)&&Ia(e)===void 0),t),e.points.map((e,t)=>w(e)&&Ia(e)!==void 0&&O(`circle`,{key:t,class:`tc-point tc-bubble`,cx:c(V(e.x)),cy:c(H(e.y)),r:c(b(Ia(e)))}))));return[O(`defs`,null,ue.def),le,O(`g`,{key:`series`,class:`tc-series-list`,"clip-path":ue.url},de),A&&_e({position:F?`right`:`left`,ticks:te,area:R}),k&&_e({position:`bottom`,ticks:U,area:R})]}function Ra(e,t,n=1/0){let r=W(e.x?.format,t.locale),i=W(e.y?.format,t.locale),a=z(void 0,t.locale),o=e.data.series.filter(e=>!t.hidden.has(J(e))),s=o.some(e=>e.points.some(e=>e.size!=null)),c=o.some(e=>e.points.some(e=>e.label!=null)),l=o.reduce((e,t)=>e+t.points.length,0),u=n;return{columns:[``,...c?[`Label`]:[],`x`,`y`,...s?[`Size`]:[]],total:l,rows:o.flatMap(e=>{let t=e.points.slice(0,Math.max(0,u));return u-=t.length,t.map(t=>[e.name,...c?[t.label??``]:[],r(t.x),i(t.y),...s?[Ia(t)===void 0?`–`:a(Ia(t))]:[]])})}}let za={name:`scatter`,clean:q(e=>({...we(e)?e:{},series:ke(we(e)&&e.series,e=>({...Ae(e),points:ke(e.points,e=>({...e,x:K(e.x),y:K(e.y),size:K(e.size)??void 0,label:e.label==null?void 0:Ee(e.label)})).filter(e=>e.x!==null&&e.y!==null)}))})),render:La,legend:e=>Ne(e.data.series),table:Ra,valueLabels:{format:e=>e.y?.format}};function Ba(e,n){let{variant:i=`line`,curve:a=`monotone`,point:o=`last`,markers:s=`none`,pointRadius:l=3,name:u=`Value`}=e,d=e.data.map(e=>e==null||!Number.isFinite(e)?null:e),f=d.length,p=o===`last`||s===`minmax`?l+2:2,m=t(e.padding,0),h=r(n.width,n.height,{top:m.top+p,right:m.right+p,bottom:m.bottom+p,left:m.left+p}),g=i===`tristate`,_=e.zero??i!==`line`,v=g?[-1,1]:Ke(d,{nice:!1},_,2),y=i===`bar`||g,b=f>0?h.width/f:0,x=e=>n.rtl?f-1-e:e,S=e=>y?h.x+b*x(e)+b/2:h.x+(f>1?h.width*x(e)/(f-1):h.width/2),C=Se(v,[h.y+h.height,h.y]),w=C(Math.min(Math.max(0,v[0]),v[1])),T=d.map((e,t)=>e===null?null:[S(t),C(e)]),E=z(e.format,n.locale),D=t=>{let n=e.labels?.[t];return n===void 0?``:String(n)},k=e=>C(g?Math.sign(e):e),A=t=>{let n=d[t];if(n===void 0)return null;let r=S(t),i={name:u,seriesIndex:0,value:n,text:n===null?`–`:E(n),x:r,y:n===null?null:k(n)},a={index:t,label:Y(e.labels?.[t]??t+1),title:D(t),x:r,area:h,items:[i]};return n!==null&&(a.mark={d:Fa(l+3),x:r,y:k(n)}),a},j={count:f,reversed:n.rtl===!0,hitIndex:e=>A(e),hitTest(e,t){if(f===0||t<h.y-p||t>h.y+h.height+p)return null;let n=y?Math.floor((e-h.x)/b):Math.round((e-h.x)/Math.max(1,h.width)*(f-1));return A(x(Math.max(0,Math.min(f-1,n))))}};n.onHitTest(j);let M=[];if(g){let e=Math.max(1,b-1);M.push(O(`line`,{class:`tc-sparkline-zero`,x1:h.x,x2:h.x+h.width,y1:c(w),y2:c(w)})),d.forEach((t,n)=>{if(t===null)return;let r=Math.sign(t),i=Math.min(2,h.height/2),[a,o]=r===0?[w+i/2,w-i/2]:[w,C(r)];M.push(O(`path`,{key:n,class:[`tc-bar`,r<0&&`tc-bar-negative`,r<0?`tc-tristate-loss`:r>0?`tc-tristate-win`:`tc-tristate-draw`],d:li(S(n)-e/2,e,a,o,r===0?0:Math.min(2,e/2))}))})}else if(y){let e=Math.max(1,b-1);d.forEach((t,n)=>{t!==null&&M.push(O(`path`,{key:n,class:[`tc-bar`,t<0&&`tc-bar-negative`],d:li(S(n)-e/2,e,w,C(t),Math.min(2,e/2))}))})}else i===`area`&&M.push(O(`path`,{class:`tc-area tc-area-gradient`,d:yr(T,w,{curve:a}),mask:`url(#${n.id}-fade)`})),M.push(O(`path`,{class:`tc-line`,d:vr(T,{curve:a})}));let N=(e,t)=>{let n=d[e];return n==null?null:O(`circle`,{key:`${t}-${e}`,class:[`tc-point`,t],cx:c(S(e)),cy:c(C(n)),r:l})},P=[];if(s===`minmax`){let e=-1,t=-1;d.forEach((n,r)=>{n!==null&&((e===-1||n<d[e])&&(e=r),(t===-1||n>d[t])&&(t=r))}),e!==-1&&P.push(N(e,`tc-point-min`)),t!==-1&&t!==e&&P.push(N(t,`tc-point-max`))}let F=-1;if(o===`last`){for(let e=f-1;e>=0;e--)if(d[e]!==null){F=e;break}}return[i===`area`&&O(`defs`,null,ni(`${n.id}-fade`)),O(`g`,{class:`tc-series tc-series-1 tc-sparkline`},M,P,F!==-1&&!y&&N(F,`tc-point-last`))]}let Va={name:`sparkline`,clean:e=>({...q(Oe)(e),labels:Array.isArray(e.labels)?e.labels.map(De):void 0}),render:Ba,keyboard:!1};function Ha(e){return e.map(e=>{if(e.children?.length){let t=Ha(e.children);return{node:e,children:t,value:t.reduce((e,t)=>e+t.value,0)}}return{node:e,value:Math.max(0,e.value??0)}})}function Ua(e,t){return Ha(e.data).map((e,t)=>({entry:e,index:t})).filter(({entry:e})=>!t.has(J(e.node)))}function Wa(e,t,n,r,i,a){let o=e.filter(e=>e.value>0).sort((e,t)=>t.value-e.value),s=o.reduce((e,t)=>e+t.value,0),c=0;for(;c<o.length&&r>0&&i>0;){let e=Math.min(r,i),l=r*i/s,u=o[c].value,d=0,f=1/0,p=c;for(;p<o.length;p++){let t=d+o[p].value,n=(t*l/e)**2,r=Math.max(n/(o[p].value*l),u*l/n);if(r>f)break;f=r,d=t}let m=d*l/e,h=0;for(;c<p;c++){let e=o[c],s=e.value*l/m;r>=i?a(e,t,n+h,m,s):a(e,t+h,n,s,m),h+=s}r>=i?(t+=m,r-=m):(n+=m,i-=m),s-=d}}function Ga(e,t,n,r,i,a,o,s,c,l){Wa(e,t,n,r,i,(u,d,f,p,m)=>{let h=c?.index??l?.[e.indexOf(u)],g=c?`${c.key}/${J(u.node)}`:J(u.node),_=c?.trail??[],v=.01,y=[d-t<v?s[0]:1,f-n<v?s[1]:1,t+r-d-p<v?s[2]:1,n+i-f-m<v?s[3]:1];if(u.children)Ga(u.children,d,f,p,m,a,o,y,{index:h,key:g,trail:[..._,u.node.name]});else{let e=a/2;o.push({node:u.node,key:g,top:h,trail:_,value:u.value,x:d+y[0]*e,y:f+y[1]*e,width:Math.max(0,p-(y[0]+y[2])*e),height:Math.max(0,m-(y[1]+y[3])*e)})}})}function Ka(e,t,n){if(o(e,n)<=t)return e;let r=[...e];for(;r.length>2;){r.pop();let e=`${r.join(``).trimEnd()}…`;if(o(e,n)<=t)return e}return``}function qa(e,n){let{width:i,height:a,fontSize:s,locale:l}=n,u=Math.max(0,e.gap??2),d=Math.max(0,e.radius??3),f=r(i,a,t(e.padding,0)),p=Ua(e,n.hidden),m=p.reduce((e,{entry:t})=>e+t.value,0),h=[];Ga(p.map(({entry:e})=>e),f.x,f.y,f.width,f.height,u,h,[0,0,0,0],void 0,p.map(({index:e})=>e));let g=z(e.format,l),_=I(l,{style:`percent`,maximumFractionDigits:1}),v=(t,n)=>{let r=t.x+t.width/2,i={name:t.node.name,seriesIndex:t.top,value:t.value,text:`${g(t.value)} (${_.format(m>0?t.value/m:0)})`,x:r,y:t.y+t.height/2},a=t.node.color??e.data[t.top]?.color;return a&&(i.color=a),{index:n,label:[...t.trail,t.node.name].join(` › `),title:t.trail.join(` › `),x:r,area:f,items:[i],seriesIndex:t.top,mark:{d:zi(t.x+1,t.y+1,t.width-2,t.height-2,d-1),x:0,y:0}}},y={count:h.length,hitIndex:e=>{let t=h[e];return t?v(t,e):null},hitTest(e,t){let n=h.findIndex(n=>e>=n.x-u/2&&e<=n.x+n.width+u/2&&t>=n.y-u/2&&t<=n.y+n.height+u/2);return n<0?null:v(h[n],n)}};n.onHitTest(y);let b=p.map(({entry:e,index:t})=>O(`g`,Pe(e.node,t),h.filter(e=>e.top===t).map(e=>O(`rect`,{key:e.key,class:[`tc-tile`,e.trail.length>0&&e.node.class],x:c(e.x),y:c(e.y),width:c(e.width),height:c(e.height),rx:c(Math.min(d,e.width/2,e.height/2)),style:e.trail.length>0?{"--tc-series-color":e.node.color}:void 0})))),x=s*1.3,S=e.labels!==!1&&h.flatMap(e=>{let t=e.width-12,n=e.height>=x+6?Ka(e.node.name,t,s):``;if(!n)return[];let r=g(e.value),i=c(e.x+6),a=e.y+6+s*.85;return[O(`text`,{key:e.key,class:`tc-treemap-label`,x:i,y:c(a)},n),e.height>=x*2+9&&o(r,s)<=t&&O(`text`,{key:`${e.key}/value`,class:`tc-treemap-label tc-treemap-value`,x:i,y:c(a+x)},r)]});return[O(`g`,{class:`tc-treemap-tiles`},b),S&&O(`g`,{class:`tc-treemap-labels`,"aria-hidden":`true`},S)]}function Ja(e,t,n){let r=Ua(e,t.hidden),i=r.reduce((e,{entry:t})=>e+t.value,0),a=z(e.format,t.locale),o=I(t.locale,{style:`percent`,maximumFractionDigits:1}),s=[],c=(e,t)=>{for(let n of e){let e=[...t,n.node.name];n.children?c(n.children,e):s.push([e.join(` › `),a(n.value),o.format(i>0?n.value/i:0)])}};c(r.map(({entry:e})=>e),[]);let l={columns:[``,`Value`,`Share`],rows:s};return s.length>n&&(l.rows=s.slice(0,n),l.total=s.length),l}function Ya(e,t=0,n={left:5e3}){let r=[];for(let i of Te(e)){if(!we(i)||n.left<=0)continue;n.left--;let e=t<8&&Array.isArray(i.children)?Ya(i.children,t+1,n):void 0;r.push({...Ae(i),value:K(i.value)??0,children:e})}return r}let Xa={name:`treemap`,clean:q(e=>Ya(e)),render:qa,legend:e=>Ne(e.data),table:Ja},Za={line:si,area:ci,bar:fi,pie:pa,donut:ma,scatter:za,sparkline:Va,gauge:Ri,heatmap:qi,candlestick:gi,radar:xa,sankey:Pa,parliament:ta,treemap:Xa,"percentage-bar":ca};w({time:{scale:Un,points:Wn,axis:Gn},dates:st,log:{scale:ct,domain:lt,ticks:ut},decimate:or,line:{linePath:vr,areaPath:yr},annotations:{layers:ot,values:at},patterns:Dn,"point-shapes":kn,hydrate:$n,morph:ar}),E(jn),E(Xn);let Qa=`[data-tc-chart]`,$a=/* @__PURE__ */ new Set([`chart`,`src`,`data`,`options`]),eo=/* @__PURE__ */ new Set([`title`,`description`,`locale`,`sync`,`id`,`class`]),to=/* @__PURE__ */ new WeakMap,no=/* @__PURE__ */ new WeakSet;function ro(e){return to.get(e)}function io(e){to.get(e)?.destroy(),to.delete(e)}function ao(e){return e===`true`||e===``?!0:e===`false`?!1:e!==``&&Number.isFinite(Number(e))?Number(e):/^\s*[[{]/.test(e)?oo(e,`a data-tc-* attribute`):e}function oo(e,t){try{return JSON.parse(e)}catch(e){throw SyntaxError(`@tabler/charts-bootstrap: invalid JSON in ${t}: ${e.message}`)}}function so(e){let t={},n=e.dataset.tcOptions;n&&Object.assign(t,oo(n,`data-tc-options`));for(let[n,r]of Object.entries(e.dataset)){if(!n.startsWith(`tc`)||r===void 0)continue;let e=n.charAt(2).toLowerCase()+n.slice(3);$a.has(e)||(t[e]=e===`legend`&&r===`bottom`?{position:`bottom`}:e===`tooltip`&&r===`light`?{theme:`light`}:e===`download`&&/^[a-z]/i.test(r)&&!/^(true|false)$/.test(r)?r.split(/[\s,]+/).filter(Boolean):eo.has(e)?r:ao(r))}return t}function co(e){let t=e.dataset.tcData;if(t)return oo(t,`data-tc-data`);let n=e.querySelector(`:scope > script[type="application/json"]`)?.textContent?.trim();return n?oo(n,`the inline <script type="application/json">`):void 0}function lo(e,t,n){e.dispatchEvent(new CustomEvent(`tc-${t}`,{detail:n,bubbles:!0}))}function uo(e,t,n){let r=new ti(e,{...so(e),type:t,data:n});for(let t of yn)r.on(t,n=>lo(e,t,n));return to.set(e,r),lo(e,`render`,{size:r.size}),r}function fo(e,t){let n=to.get(e);if(n||no.has(e))return n;let r=e.dataset.tcChart??``,i=t[r];if(!i){let e=Object.keys(t).join(`, `);throw Error(`@tabler/charts-bootstrap: unknown chart type "${r}". Known types: ${e}.`)}let a=e.dataset.tcSrc;return a?(no.add(e),e.setAttribute(`aria-busy`,`true`),fetch(a).then(e=>{if(!e.ok)throw Error(`${e.status} ${e.statusText}`.trim());return e.json()}).then(t=>e.isConnected?uo(e,i,t):void 0,t=>{lo(e,`error`,{error:t,src:a}),console.error(`@tabler/charts-bootstrap: could not load ${a}:`,t)}).finally(()=>{no.delete(e),e.removeAttribute(`aria-busy`)})):uo(e,i,co(e)??[])}function po(e=document,t={}){let n={...Za,...t.types},r=[...e.querySelectorAll(Qa)];e instanceof Element&&e.matches(Qa)&&r.unshift(e);let i=r.map(e=>{try{return fo(e,n)}catch(t){lo(e,`error`,{error:t}),console.error(t);return}});return Promise.all(i).then(e=>e.filter(e=>e!==void 0))}function mo(e=document.body,t={}){po(e,t);let n=new MutationObserver(e=>{for(let n of e){let e=n.target.closest?.(Qa);if(!(e&&to.has(e))){for(let e of n.removedNodes)if(e instanceof Element){to.has(e)&&io(e);for(let t of e.querySelectorAll(Qa))io(t)}for(let e of n.addedNodes)e instanceof Element&&!e.isConnected||e instanceof Element&&po(e,t)}}});return n.observe(e,{childList:!0,subtree:!0}),()=>n.disconnect()}if(typeof document<`u`){let e=document.currentScript;if(!e?.hasAttribute(`data-no-styles`)&&!document.getElementById(`tc-styles`)){let t=document.createElement(`style`);t.id=`tc-styles`,t.textContent=`/*! @tabler/charts | MIT */
|
|
2
|
-
:where(:root),:where([data-theme=light]){--tc-color-1:var(--tblr-primary,#2a78d6);--tc-color-2:var(--tblr-orange,#eb6834);--tc-color-3:var(--tblr-teal,#1baf7a);--tc-color-4:var(--tblr-yellow,#eda100);--tc-color-5:var(--tblr-pink,#e87ba4);--tc-color-6:var(--tblr-green,#008300);--tc-color-7:var(--tblr-indigo,#4a3aa7);--tc-color-8:var(--tblr-red,#e34948);--tc-color-other:var(--tblr-secondary,#8a8983);--tc-surface:var(--tblr-bg-surface,#fff);--tc-text-color:var(--tblr-body-color,#0b0b0b);--tc-text-muted:var(--tblr-secondary,#6f6e69);--tc-grid-color:var(--tblr-border-color-translucent,#e1e0d9);--tc-baseline-color:var(--tblr-border-color,#c3c2b7);--tc-hover-color:rgba(var(--tblr-emphasis-color-rgb,11, 11, 11), .04);--tc-tooltip-bg:var(--tblr-dark,#0b0b0b);--tc-tooltip-color:#fff;--tc-tooltip-muted:#ffffffb3;--tc-tooltip-border:#ffffff1f;--tc-tooltip-shadow:var(--tblr-box-shadow,0 4px 16px #0b0b0b1f);--tc-tooltip-radius:var(--tblr-border-radius,6px);--tc-tooltip-light-bg:#fff;--tc-tooltip-light-color:#0b0b0b;--tc-tooltip-light-muted:#6f6e69;--tc-tooltip-light-border:#0b0b0b1a;--tc-focus-color:var(--tc-color-1);--tc-font-family:var(--tblr-body-font-family,inherit);--tc-font-size:12px;--tc-stroke-width:2px;--tc-grid-width:1px;--tc-area-opacity:.1;--tc-area-gradient-start:.24;--tc-area-gradient-end:0;--tc-pie-value-size:1.75em;--tc-bubble-opacity:.7;--tc-point-ring:2px;--tc-duration:.4s;--tc-duration-fast:.12s;--tc-easing:cubic-bezier(.4, 0, .2, 1)}@media (prefers-color-scheme:dark){:where(:root:not([data-theme=light])){--tc-color-1:var(--tblr-primary,#3987e5);--tc-color-2:var(--tblr-orange,#d95926);--tc-color-3:var(--tblr-teal,#199e70);--tc-color-4:var(--tblr-yellow,#c98500);--tc-color-5:var(--tblr-pink,#d55181);--tc-color-6:var(--tblr-green,#008300);--tc-color-7:var(--tblr-indigo,#9085e9);--tc-color-8:var(--tblr-red,#e66767);--tc-color-other:var(--tblr-secondary,#7c7b76);--tc-surface:var(--tblr-bg-surface,#1a1a19);--tc-text-color:var(--tblr-body-color,#fff);--tc-text-muted:var(--tblr-secondary,#a3a29c);--tc-grid-color:var(--tblr-border-color-translucent,#2c2c2a);--tc-baseline-color:var(--tblr-border-color,#4a4a46);--tc-hover-color:rgba(var(--tblr-emphasis-color-rgb,255, 255, 255), .06);--tc-tooltip-bg:var(--tblr-dark,#262625);--tc-tooltip-shadow:var(--tblr-box-shadow,0 4px 16px #0006);--tc-focus-color:var(--tc-color-1)}}:where([data-theme=dark]){--tc-color-1:var(--tblr-primary,#3987e5);--tc-color-2:var(--tblr-orange,#d95926);--tc-color-3:var(--tblr-teal,#199e70);--tc-color-4:var(--tblr-yellow,#c98500);--tc-color-5:var(--tblr-pink,#d55181);--tc-color-6:var(--tblr-green,#008300);--tc-color-7:var(--tblr-indigo,#9085e9);--tc-color-8:var(--tblr-red,#e66767);--tc-color-other:var(--tblr-secondary,#7c7b76);--tc-surface:var(--tblr-bg-surface,#1a1a19);--tc-text-color:var(--tblr-body-color,#fff);--tc-text-muted:var(--tblr-secondary,#a3a29c);--tc-grid-color:var(--tblr-border-color-translucent,#2c2c2a);--tc-baseline-color:var(--tblr-border-color,#4a4a46);--tc-hover-color:rgba(var(--tblr-emphasis-color-rgb,255, 255, 255), .06);--tc-tooltip-bg:var(--tblr-dark,#262625);--tc-tooltip-shadow:var(--tblr-box-shadow,0 4px 16px #0006);--tc-focus-color:var(--tc-color-1)}.tc-chart{max-width:100%;height:auto;font-family:var(--tc-font-family);font-size:var(--tc-font-size);letter-spacing:normal;word-spacing:normal;text-transform:none;color:var(--tc-text-color);-webkit-tap-highlight-color:transparent;direction:ltr;display:block;overflow:visible}.tc-chart :where(text){font:inherit}.tc-series{--tc-series-color:var(--tc-color-other);--tc-series-pattern:var(--tc-pattern-other);--tc-pattern-dash:1 3;--tc-pattern-ink:var(--tc-pattern-color,var(--tc-surface));--tc-swatch-pattern:repeating-linear-gradient(45deg, var(--tc-pattern-ink) 0 1px, #0000 0 3px)}.tc-series-1{--tc-series-color:var(--tc-color-1);--tc-series-pattern:var(--tc-pattern-1);--tc-pattern-dash:none;--tc-swatch-pattern:repeating-linear-gradient(45deg, var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-series-2{--tc-series-color:var(--tc-color-2);--tc-series-pattern:var(--tc-pattern-2);--tc-pattern-dash:6 3;--tc-swatch-pattern:radial-gradient(var(--tc-pattern-ink) .8px, #0000 1.2px) 0 0 / 4px 4px}.tc-series-3{--tc-series-color:var(--tc-color-3);--tc-series-pattern:var(--tc-pattern-3);--tc-pattern-dash:2 3;--tc-swatch-pattern:repeating-linear-gradient(-45deg, var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-series-4{--tc-series-color:var(--tc-color-4);--tc-series-pattern:var(--tc-pattern-4);--tc-pattern-dash:10 3 2 3;--tc-swatch-pattern:repeating-linear-gradient(var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-series-5{--tc-series-color:var(--tc-color-5);--tc-series-pattern:var(--tc-pattern-5);--tc-pattern-dash:4 4;--tc-swatch-pattern:repeating-linear-gradient(45deg, var(--tc-pattern-ink) 0 1px, #0000 0 4px), repeating-linear-gradient(-45deg, var(--tc-pattern-ink) 0 1px, #0000 0 4px)}.tc-series-6{--tc-series-color:var(--tc-color-6);--tc-series-pattern:var(--tc-pattern-6);--tc-pattern-dash:12 4;--tc-swatch-pattern:repeating-linear-gradient(90deg, var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-series-7{--tc-series-color:var(--tc-color-7);--tc-series-pattern:var(--tc-pattern-7);--tc-pattern-dash:2 2 6 2;--tc-swatch-pattern:repeating-linear-gradient(var(--tc-pattern-ink) 0 1px, #0000 0 4px), repeating-linear-gradient(90deg, var(--tc-pattern-ink) 0 1px, #0000 0 4px)}.tc-series-8{--tc-series-color:var(--tc-color-8);--tc-series-pattern:var(--tc-pattern-8);--tc-pattern-dash:8 2 2 2;--tc-swatch-pattern:linear-gradient(90deg, #0000 50%, var(--tc-series-color) 0) 0 0 / 4px 4px, repeating-linear-gradient(var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-tick-label{fill:var(--tc-text-muted);font-variant-numeric:tabular-nums}.tc-grid-line,.tc-grid-line-zero,.tc-axis-line,.tc-tick-line,.tc-crosshair,.tc-sparkline-zero,.tc-radar-ring,.tc-radar-spoke{stroke:var(--tc-baseline-color);stroke-width:var(--tc-grid-width);shape-rendering:crispedges;vector-effect:non-scaling-stroke}.tc-grid-line,.tc-sparkline-zero,.tc-radar-ring,.tc-radar-spoke{stroke:var(--tc-grid-color)}.tc-grid-line-zero{stroke:var(--tc-baseline-color)}.tc-line{fill:none;stroke:var(--tc-series-color);stroke-width:var(--tc-series-width,var(--tc-stroke-width));stroke-dasharray:var(--tc-series-dash,none);stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke}.tc-area{fill:var(--tc-series-color);fill-opacity:var(--tc-area-opacity);stroke:none}.tc-pie-slices{--tc-pie-gap:0px}.tc-slice{fill:var(--tc-series-color);stroke:var(--tc-surface);stroke-width:var(--tc-pie-gap);stroke-linejoin:round}.tc-pie-track,.tc-gauge-track{fill:var(--tc-grid-color)}.tc-gauge-arc{fill:var(--tc-series-color)}.tc-pie-value,.tc-gauge-value,.tc-parliament-value{font-size:var(--tc-pie-value-size);fill:var(--tc-text-color);font-variant-numeric:tabular-nums;font-weight:600}.tc-pie-label,.tc-gauge-label,.tc-parliament-label{fill:var(--tc-text-muted)}.tc-seat{fill:var(--tc-series-color);transition:transform var(--tc-duration) var(--tc-easing), r var(--tc-duration) var(--tc-easing)}.tc-seat-vacant{fill:var(--tc-grid-color)}.tc-chart-parliament .tc-hover-mark{opacity:.25}.tc-segment{fill:var(--tc-series-color);transition:var(--tc-duration) var(--tc-easing);transition-property:x,width}.tc-percentage-bar-track{fill:var(--tc-grid-color)}.tc-tile{fill:var(--tc-series-color);fill-opacity:var(--tc-treemap-opacity,1);transition:var(--tc-duration) var(--tc-easing);transition-property:x,y,width,height}.tc-treemap-value{font-weight:400}.tc-sankey-node{fill:var(--tc-series-color)}.tc-sankey-link{fill:var(--tc-series-color);fill-opacity:var(--tc-area-opacity);stroke:none}.tc-chart-sankey{--tc-area-opacity:.35}.tc-sankey-value{font-size:.92em}.tc-chart-sankey .tc-hover-mark{opacity:.5}.tc-radar-ring,.tc-radar-spoke,.tc-chart-radar .tc-crosshair{fill:none;shape-rendering:auto}.tc-area-gradient{fill-opacity:1}.tc-fade-start{stop-color:#fff;stop-opacity:var(--tc-area-gradient-start)}.tc-fade-end{stop-color:#fff;stop-opacity:var(--tc-area-gradient-end)}.tc-chart-sparkline{--tc-stroke-width:1.5px;--tc-area-gradient-start:.3}.tc-bubble{fill-opacity:var(--tc-bubble-opacity)}.tc-point{fill:var(--tc-series-color);stroke:var(--tc-surface);stroke-width:var(--tc-point-ring);paint-order:stroke;transition:cx var(--tc-duration) var(--tc-easing), cy var(--tc-duration) var(--tc-easing)}.tc-point-min,.tc-point-max{fill:var(--tc-text-muted)}.tc-annotation{--tc-annotation-color:var(--tc-text-muted)}.tc-annotation-line{stroke:var(--tc-annotation-color);stroke-width:1px;stroke-dasharray:4 3;shape-rendering:crispedges;vector-effect:non-scaling-stroke}.tc-annotation-band{fill:var(--tc-annotation-color);fill-opacity:.1}.tc-annotation-label{fill:var(--tc-annotation-color);font-weight:500}.tc-annotation-label,.tc-radar-value{paint-order:stroke;stroke:var(--tc-surface);stroke-width:3px;stroke-linejoin:round;font-size:.92em}.tc-annotations{pointer-events:none}.tc-value-label,.tc-treemap-label{fill:var(--tc-text-color);font-variant-numeric:tabular-nums;paint-order:stroke;stroke:var(--tc-surface);stroke-width:3px;stroke-linejoin:round;transition:transform var(--tc-duration) var(--tc-easing);animation:tc-fade-in var(--tc-duration) var(--tc-easing);font-weight:500}.tc-marker{transition:d var(--tc-duration) var(--tc-easing)}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) :is(.tc-legend-swatch,.tc-tooltip-swatch){background:var(--tc-series-color);width:10px;height:10px}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-2 :is(.tc-legend-swatch,.tc-tooltip-swatch){border-radius:1px;scale:.8}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-3 :is(.tc-legend-swatch,.tc-tooltip-swatch){clip-path:polygon(50% 3.6%,92.9% 82.1%,7.1% 82.1%);border-radius:0}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-4 :is(.tc-legend-swatch,.tc-tooltip-swatch){clip-path:polygon(50% 3.6%,96.4% 50%,50% 96.4%,3.6% 50%);border-radius:0}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-5 :is(.tc-legend-swatch,.tc-tooltip-swatch){clip-path:polygon(7.1% 17.9%,92.9% 17.9%,50% 96.4%);border-radius:0}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-6 :is(.tc-legend-swatch,.tc-tooltip-swatch){clip-path:polygon(35.7% 7.1%,64.3% 7.1%,64.3% 35.7%,92.9% 35.7%,92.9% 64.3%,64.3% 64.3%,64.3% 92.9%,35.7% 92.9%,35.7% 64.3%,7.1% 64.3%,7.1% 35.7%,35.7% 35.7%);border-radius:0}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-7 :is(.tc-legend-swatch,.tc-tooltip-swatch){clip-path:polygon(25% 7.1%,50% 32.1%,75% 7.1%,92.9% 25%,67.9% 50%,92.9% 75%,75% 92.9%,50% 67.9%,25% 92.9%,7.1% 75%,32.1% 50%,7.1% 25%);border-radius:0}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-8 :is(.tc-legend-swatch,.tc-tooltip-swatch){clip-path:polygon(50% 0%,61.4% 34.3%,97.5% 34.6%,68.6% 56.1%,79.3% 90.4%,50% 69.6%,20.7% 90.4%,31.4% 56.1%,2.5% 34.6%,38.6% 34.3%);border-radius:0}.tc-pattern-bg{fill:var(--tc-series-color)}.tc-pattern-ink{fill:none;stroke:var(--tc-pattern-ink);stroke-width:1.5px;stroke-linecap:round}.tc-patterned :is(.tc-bar,.tc-area,.tc-slice,.tc-gauge-arc,.tc-bubble){fill:var(--tc-series-pattern,var(--tc-series-color))}.tc-patterned .tc-area{fill-opacity:max(var(--tc-area-opacity), .4)}.tc-patterned .tc-line{stroke-dasharray:var(--tc-series-dash,var(--tc-pattern-dash))}:has(>.tc-patterned)>:is(.tc-legend,.tc-tooltip) :is(.tc-legend-swatch,.tc-tooltip-swatch){background:var(--tc-swatch-pattern), var(--tc-series-color)}@keyframes tc-reveal{0%{clip-path:inset(0 var(--tc-reveal,100% 0 0))}to{clip-path:inset(0)}}@keyframes tc-grow{0%{transform:scaleY(0)}}@keyframes tc-grow-x{0%{transform:scaleX(0)}}@keyframes tc-fade-in{0%{opacity:0}}.tc-line,.tc-area,.tc-bar,.tc-radar-ring,.tc-dots{transition:d var(--tc-duration) var(--tc-easing)}.tc-slice,.tc-gauge-arc,.tc-gauge-track{transition:none var(--tc-duration)}.tc-rtl{--tc-reveal:0 0 100%}.tc-chart-line .tc-series-list,.tc-chart-area .tc-series-list{animation:tc-reveal calc(var(--tc-duration) * 2) var(--tc-easing)}.tc-series-list .tc-series,.tc-areas .tc-series,.tc-sankey-links .tc-sankey-link,.tc-sankey-nodes .tc-series,.tc-parliament-seats .tc-series,.tc-parliament-seats .tc-seat,.tc-series-list .tc-point,.tc-heatmap-cells,.tc-treemap-tiles,.tc-percentage-bar,.tc-candles,.tc-tick,.tc-grid-line{animation:tc-fade-in var(--tc-duration) var(--tc-easing)}.tc-bar{fill:var(--tc-series-color);transform-box:fill-box;transform-origin:50% 100%;animation:tc-grow var(--tc-duration) var(--tc-easing)}.tc-bar-negative{transform-origin:50% 0}.tc-cell{fill:var(--tc-cell-fill,var(--tc-heat-color,var(--tc-color-1)));transition:fill var(--tc-duration) var(--tc-easing)}@supports (color:color-mix(in oklab, red 50%, blue)){.tc-cell{fill:var(--tc-cell-fill,color-mix(in oklab, var(--tc-heat-color,var(--tc-color-1)) var(--tc-heat,100%), var(--tc-heat-empty,var(--tc-grid-color))))}}.tc-heatmap-row.tc-series{--tc-heat-color:var(--tc-series-color)}.tc-cell-empty{fill:var(--tc-heat-empty,var(--tc-grid-color));opacity:.5}.tc-candle{--tc-candle-color:var(--tc-up-color,var(--tc-color-6))}.tc-candle-down{--tc-candle-color:var(--tc-negative-color,var(--tc-color-8))}.tc-candle-body{fill:var(--tc-candle-color);transition:d var(--tc-duration) var(--tc-easing), fill var(--tc-duration) var(--tc-easing)}.tc-candle-wick{fill:none;stroke:var(--tc-candle-color);stroke-width:1px;vector-effect:non-scaling-stroke;transition:d var(--tc-duration) var(--tc-easing), stroke var(--tc-duration) var(--tc-easing)}.tc-tristate-loss{fill:var(--tc-negative-color,var(--tc-color-8))}.tc-tristate-draw{fill:var(--tc-baseline-color)}.tc-bar-horizontal{transform-origin:0;animation-name:tc-grow-x}.tc-bar-horizontal.tc-bar-negative,.tc-rtl .tc-bar-horizontal{transform-origin:100%}.tc-rtl .tc-bar-horizontal.tc-bar-negative{transform-origin:0}.tc-tick,.tc-grid-line{transition:transform var(--tc-duration) var(--tc-easing)}@keyframes tc-pie-in{0%{opacity:0;transform:scale(.85)}}.tc-pie-slices,.tc-gauge-rings,.tc-parliament-seats,.tc-radar-series{animation:tc-pie-in calc(var(--tc-duration) * 1.5) var(--tc-easing)}.tc-hover .tc-point{transition:none;animation:none}.tc-static,.tc-chart[data-resizing]{--tc-duration:0s}:where(.tc-container){position:relative}.tc-hover{pointer-events:none}.tc-hover-band{fill:var(--tc-hover-color)}.tc-hover-mark{fill:var(--tc-series-color);opacity:.35}.tc-chart-heatmap .tc-hover-mark,.tc-chart-treemap .tc-hover-mark,.tc-chart-percentage-bar .tc-hover-mark{fill:none;stroke:var(--tc-text-color);stroke-width:2px;opacity:.6}.tc-tooltip{z-index:10;pointer-events:none;opacity:0;min-width:120px;max-width:min(280px,100%);font-family:var(--tc-font-family);font-size:var(--tc-font-size);overflow-wrap:anywhere;color:var(--tc-tooltip-color);background:var(--tc-tooltip-bg);border:1px solid var(--tc-tooltip-border);border-radius:var(--tc-tooltip-radius);box-shadow:var(--tc-tooltip-shadow);transition:opacity var(--tc-duration-fast) var(--tc-easing);padding:8px 10px;line-height:1.4;position:absolute;top:0;left:0}.tc-tooltip-light{--tc-tooltip-bg:var(--tc-tooltip-light-bg);--tc-tooltip-color:var(--tc-tooltip-light-color);--tc-tooltip-muted:var(--tc-tooltip-light-muted);--tc-tooltip-border:var(--tc-tooltip-light-border)}.tc-tooltip .tc-series{--tc-pattern-ink:var(--tc-pattern-color,var(--tc-tooltip-bg))}.tc-tooltip[data-visible]{opacity:1;transition:opacity var(--tc-duration-fast) var(--tc-easing), transform var(--tc-duration-fast) var(--tc-easing)}.tc-tooltip-title{margin-bottom:4px;font-weight:600}.tc-tooltip-item{align-items:center;gap:8px;display:flex}.tc-tooltip-swatch,.tc-legend-swatch{background:var(--tc-series-color);border-radius:50%;flex:none;width:8px;height:8px}.tc-tooltip-name{color:var(--tc-tooltip-muted);flex:1}.tc-tooltip-value{white-space:nowrap;font-variant-numeric:tabular-nums;font-weight:500}.tc-tooltip-footer{border-top:1px solid var(--tc-tooltip-border);margin-top:4px;padding-top:4px}.tc-tooltip-item-active .tc-tooltip-name{color:var(--tc-tooltip-color)}.tc-legend{font-family:var(--tc-font-family);font-size:var(--tc-font-size);margin-bottom:8px;line-height:1.4}.tc-legend[data-position=bottom]{margin:8px 0 0}.tc-legend-items{flex-wrap:wrap;gap:4px 12px;display:flex}.tc-legend-item{appearance:none;font:inherit;text-align:start;color:var(--tc-text-color);cursor:pointer;transition:color var(--tc-duration-fast) var(--tc-easing);background:0 0;border:0;border-radius:4px;align-items:center;gap:6px;margin:0;padding:2px 4px;display:inline-flex}.tc-legend-item:hover{background:var(--tc-hover-color)}.tc-legend-item:focus-visible{outline:2px solid var(--tc-focus-color);outline-offset:1px}.tc-legend-item-hidden{color:var(--tc-text-muted)}.tc-legend-item-hidden .tc-legend-swatch{box-shadow:inset 0 0 0 1.5px var(--tc-series-color);background:0 0}.tc-download{z-index:11;font-family:var(--tc-font-family);font-size:var(--tc-font-size);line-height:1.4;position:absolute;top:0;right:0}.tc-download-toggle,.tc-download-item{appearance:none;font:inherit;color:var(--tc-text-muted);cursor:pointer;background:0 0;border:0;border-radius:4px;align-items:center;margin:0;display:flex}.tc-download-toggle{justify-content:center;width:24px;height:24px;padding:0}.tc-download-toggle:hover,.tc-download-toggle[aria-expanded=true],.tc-download-item:hover{color:var(--tc-text-color);background:var(--tc-hover-color)}.tc-download-toggle:focus-visible,.tc-download-item:focus-visible{outline:2px solid var(--tc-focus-color);outline-offset:1px}.tc-download-menu{min-width:80px;color:var(--tc-text-color);background:var(--tc-surface);border:1px solid var(--tc-grid-color);border-radius:var(--tc-tooltip-radius);box-shadow:var(--tc-tooltip-shadow);margin-top:2px;padding:4px;position:absolute;top:100%;right:0}.tc-download[dir=rtl],[dir=rtl]>*>.tc-download-menu{left:0;right:auto}.tc-download-item{text-align:start;white-space:nowrap;width:100%;padding:4px 8px}.tc-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.tc-chart:focus{outline:none}.tc-chart:focus-visible{outline:2px solid var(--tc-focus-color);outline-offset:2px;border-radius:2px}.tc-table-wrap:not(.tc-sr-only){margin-top:12px;overflow-x:auto}.tc-table{border-collapse:collapse;width:100%;font-family:var(--tc-font-family);font-size:var(--tc-font-size);font-variant-numeric:tabular-nums;color:var(--tc-text-color)}.tc-table caption{text-align:start;margin-bottom:4px;font-weight:600}.tc-table th,.tc-table td{text-align:end;border-bottom:1px solid var(--tc-grid-color);padding:4px 8px}.tc-table th[scope=row],.tc-table thead th:first-child{text-align:start}.tc-table thead th{color:var(--tc-text-muted);border-bottom-color:var(--tc-baseline-color);font-weight:600}@media (prefers-reduced-motion:reduce){.tc-chart,.tc-tooltip{--tc-duration:0s;--tc-duration-fast:0s}}@media (forced-colors:active){.tc-value-label,.tc-treemap-label{fill:canvastext;stroke:canvas}.tc-tick-label{fill:canvastext}.tc-grid-line,.tc-radar-ring,.tc-radar-spoke{stroke:graytext}.tc-grid-line-zero,.tc-axis-line,.tc-tick-line,.tc-line{stroke:canvastext}.tc-area{fill:graytext}.tc-bar,.tc-point{fill:canvastext;stroke:canvas}.tc-crosshair{stroke:highlight}.tc-tooltip{border-color:canvastext}.tc-legend-swatch{background:canvastext}.tc-legend-item-hidden .tc-legend-swatch{background:0 0;box-shadow:inset 0 0 0 1.5px canvastext}.tc-pattern-bg{fill:canvas}.tc-pattern-ink{stroke:canvastext}:is(.tc-patterned,.tc-patterns-auto) :is(.tc-bar,.tc-area,.tc-slice,.tc-gauge-arc,.tc-bubble){fill:var(--tc-series-pattern,CanvasText);fill-opacity:1;stroke:canvastext;stroke-width:1px}.tc-patterns-auto .tc-line{stroke-dasharray:var(--tc-series-dash,var(--tc-pattern-dash))}:has(>:is(.tc-patterned,.tc-patterns-auto))>:is(.tc-legend,.tc-tooltip) .tc-series{--tc-pattern-color:CanvasText;--tc-series-color:Canvas}:has(>:is(.tc-patterned,.tc-patterns-auto))>:is(.tc-legend,.tc-tooltip) :is(.tc-legend-swatch,.tc-tooltip-swatch){forced-color-adjust:none;background:var(--tc-swatch-pattern), Canvas;box-shadow:inset 0 0 0 1px canvastext}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) :is(.tc-legend-swatch,.tc-tooltip-swatch){box-shadow:none;background:canvastext}}:where(:root,[data-bs-theme]){--tc-color-1:var(--bs-primary,#2a78d6);--tc-focus-color:var(--bs-primary,#2a78d6);--tc-surface:var(--bs-body-bg,#fff);--tc-text-color:var(--bs-body-color,#0b0b0b);--tc-text-muted:var(--bs-secondary-color,#6f6e69);--tc-grid-color:var(--bs-border-color-translucent,#e1e0d9);--tc-baseline-color:var(--bs-border-color,#c3c2b7);--tc-hover-color:rgba(var(--bs-emphasis-color-rgb,11, 11, 11), .05);--tc-tooltip-bg:var(--bs-emphasis-color,#0b0b0b);--tc-tooltip-color:var(--bs-body-bg,#fff);--tc-tooltip-muted:rgba(var(--bs-body-bg-rgb,255, 255, 255), .7);--tc-tooltip-border:rgba(var(--bs-body-bg-rgb,255, 255, 255), .12);--tc-tooltip-shadow:var(--bs-box-shadow,0 4px 16px #0b0b0b1f);--tc-tooltip-radius:var(--bs-border-radius,6px);--tc-font-family:var(--bs-body-font-family,inherit)}:where(:root,[data-bs-theme=light]){--tc-color-2:#eb6834;--tc-color-3:#1baf7a;--tc-color-4:#eda100;--tc-color-5:#e87ba4;--tc-color-6:#008300;--tc-color-7:#4a3aa7;--tc-color-8:#e34948}:where([data-bs-theme=dark]){--tc-color-2:#d95926;--tc-color-3:#199e70;--tc-color-4:#c98500;--tc-color-5:#d55181;--tc-color-6:#008300;--tc-color-7:#9085e9;--tc-color-8:#e66767}`,t.nonce=e?.nonce??``,document.head.prepend(t)}let t=e?.hasAttribute(`data-observe`)??!1,n=()=>t?mo(document.body):void po(document);document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,n):n()}return e.Chart=ti,e.LINE_HEIGHT=l,e.VERSION=`0.2.0`,e.arcCentroid=Ei,e.arcPathStable=ki,e.area=ci,e.areaPath=yr,e.axis=_e,e.axisSize=ge,e.band=ye,e.bandTicks=pe,e.bar=fi,e.barPath=li,e.buildChart=_n,e.cancel=nn,e.candlestick=gi,e.categoryInteraction=$e,e.chartEvents=yn,e.chartLabel=pn,e.chartToString=vn,e.dataTable=Kr,e.defaultHidden=mt,e.defaultPlugins=ei,e.describeHit=Mr,e.dispose=io,e.domainOf=Ke,e.donut=ma,e.download=Cr,e.downloadChart=S,e.escapeAttr=Wt,e.escapeText=Ut,e.estimateTextWidth=o,e.exportImage=x,e.exportSVG=b,e.extent=xe,e.feature=D,e.features=C,e.flush=rn,e.formatDate=re,e.formatDetail=W,e.formatNumber=z,e.formatTicks=ne,e.gauge=Ri,e.getChart=ro,e.getDateFormat=L,e.getNumberFormat=I,e.grid=ve,e.h=O,e.hbarPath=ui,e.heatmap=qi,e.highlight=Ar,e.hitAnchor=qr,e.hoverOverlay=Er,e.hoverUnderlay=Tr,e.init=po,e.innerRect=r,e.insets=t,e.keyboard=Pr,e.legend=Fr,e.legendContent=pt,e.line=si,e.linePath=vr,e.linear=Se,e.linearTicks=fe,e.log=ct,e.lttb=cr,e.lttbIndices=or,e.niceDomain=de,e.normalizeClass=k,e.normalizeStyle=j,e.observe=mo,e.padAngleForGap=Di,e.parliament=ta,e.percentageBar=ca,e.pie=pa,e.placeTooltip=Yr,e.point=be,e.pointer=kr,e.radar=xa,e.register=w,e.render=St,e.renderContext=ln,e.renderToString=Ft,e.resolveLegend=fn,e.resolveSize=sn,e.sankey=Pa,e.scatter=za,e.schedule=en,e.seriesKey=X,e.seriesLegend=Fe,e.seriesTable=et,e.sparkline=Va,e.stepPrecision=te,e.sync=Br,e.tableContent=jr,e.thinTicks=he,e.tickIncrement=le,e.tickStep=ue,e.ticks=ce,e.time=Un,e.timePointScale=Wn,e.tooltip=$r,e.tooltipContent=Jr,e.treemap=Xa,e.types=Za,e})({});
|
|
1
|
+
var TablerCharts=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let t={};function n(e){Object.assign(t,e)}let r=e=>e.shapes??e.patterns===!0?t.swatch:void 0,i=/* @__PURE__ */ new Set;function a(e){i.add(e),t.post=(e,t,n,r)=>{for(let a of i)t=a(e,t,n,r);return t}}function o(e){let n=t[e];if(!n)throw Error(`@tabler/charts: Import "@tabler/charts/${e===`dates`?`time`:e}" for ${e}.`);return n}function s(e){return e?`${e.index}:${e.seriesIndex??``}`:``}function c(e,t,n,r,i){let a=e.getBoundingClientRect(),o=a.width>0?r/a.width:1,s=a.height>0?i/a.height:1;return{x:(t-a.left)*o,y:(n-a.top)*s}}function l(e,t,...n){let r={},i;if(t)for(let e in t){let n=t[e];if(e===`key`)n!=null&&(i=n);else if(e===`class`){let e=u(n);e&&(r.class=e)}else if(e===`style`){let e=f(n);e&&(r.style=e)}else n===!0?r[e]=``:(typeof n==`string`||typeof n==`number`&&Number.isFinite(n))&&(r[e]=n)}let a=[];return p(n,a),{tag:e,attrs:r,children:a,key:i}}function u(e){if(!e)return``;if(typeof e==`string`)return e;let t=``;for(let n of e){let e=u(n);e&&(t=t?`${t} ${e}`:e)}return t}let d=/[;{}<>"'\\]|\/\*|\b(?:url(?!\(#[\w-]+\))|src|attr|image|image-set|cross-fade|element|expression)\s*\(/i;function f(e){if(!e)return``;if(typeof e==`string`)return e;let t=``;for(let n in e){let r=e[n];r==null||r===``||d.test(String(r))||(t+=`${t?`;`:``}${n}:${r}`)}return t}function p(e,t){for(let n of e){if(n==null||typeof n==`boolean`)continue;if(Array.isArray(n)){p(n,t);continue}if(typeof n==`object`){t.push(n);continue}let e=String(n);if(e===``)continue;let r=t.length-1;r>=0&&typeof t[r]==`string`?t[r]+=e:t.push(e)}}function m(e,t,n){return l(`div`,{class:`tc-legend-items`},e.map(e=>{let r=t.has(e.key);return l(`button`,{key:e.key,type:`button`,class:[`tc-legend-item`,`tc-series`,`tc-series-${e.index+1}`,r&&`tc-legend-item-hidden`],style:{"--tc-series-color":e.color,...n?.(e.index)},"aria-pressed":r?`false`:`true`,"data-key":e.key},l(`span`,{class:`tc-legend-swatch`,"aria-hidden":`true`}),l(`span`,{class:`tc-legend-name`},e.name))}))}function h(e){return new Set(e.filter(e=>e.hidden).map(e=>e.key))}let g=/^[a-zA-Z_][\w:.-]*$/,_=/^on/i;function v(e){return g.test(e)}function y(e){return g.test(e)&&!_.test(e)}let b=`http://www.w3.org/2000/svg`,x=/* @__PURE__ */ new WeakMap,S=/* @__PURE__ */ new WeakMap;function C(e,n,r){let i=S.get(e)??(r?.parentNode===e?r:void 0);if(n===null||!v(n.tag))return i&&(i.remove(),S.delete(e)),null;if(i&&k(i,n))return j(i,n),S.set(e,i),i;if(i&&t.hydrate?.(i,n,w(e,n.tag)))return S.set(e,i),i;let a=O(n,w(e,n.tag),e.ownerDocument);return i?i.replaceWith(a):e.appendChild(a),S.set(e,a),a}let w=(e,t)=>t===`svg`?b:T(e);function T(e){return e.namespaceURI===`http://www.w3.org/2000/svg`&&e.localName!==`foreignObject`?b:`http://www.w3.org/1999/xhtml`}function E(e,t,n){if(typeof e==`string`){let t=n.createTextNode(e);return x.set(t,e),t}return v(e.tag)?O(e,e.tag===`svg`?b:t,n):null}function D(e,t,n){t===`style`?e.style.cssText=n:e.setAttribute(t,n)}function O(e,t,n){let r=n.createElementNS(t,e.tag),{attrs:i}=e;for(let e in i)y(e)&&D(r,e,String(i[e]));let a=T(r);for(let t of e.children){let e=E(t,a,n);e&&r.appendChild(e)}return x.set(r,e),r}function k(e,t){let n=x.get(e);return n===void 0?!1:typeof t==`string`?typeof n==`string`:typeof n!=`string`&&n.tag===t.tag&&n.key===t.key}function A(e,t){typeof t==`string`?x.get(e)!==t&&(e.data=t,x.set(e,t)):j(e,t)}function j(e,n){let r=x.get(e);r!==n&&(M(e,r.attrs,t.sweep?.(e,r,n)??n.attrs,!0),N(e,n.children),x.set(e,n))}function M(e,n,r,i=!1){for(let a in r){let o=r[a];n[a]!==o&&y(a)&&(i&&a===`d`&&t.morph?.(e,String(n[a]??``),String(o))||D(e,a,String(o)))}for(let t in n)!(t in r)&&y(t)&&e.removeAttribute(t)}function N(e,t){if(t.length===0&&e.firstChild===null)return;let n=Array.from(e.childNodes),r=/* @__PURE__ */ new Map,i=[];for(let e of n){let t=x.get(e);t!==void 0&&(typeof t!=`string`&&t.key!==void 0?r.set(t.key,e):i.push(e))}let a=Array(t.length),o=/* @__PURE__ */ new Set,s=0;for(let e=0;e<t.length;e++){let n=t[e],c;typeof n!=`string`&&n.key!==void 0?c=r.get(n.key):s<i.length&&(c=i[s]),c&&!o.has(c)&&k(c,n)&&(a[e]=c,o.add(c),c===i[s]&&s++)}for(let t of n)o.has(t)||e.removeChild(t);let c=T(e),l=e.ownerDocument,u=null;for(let n=t.length-1;n>=0;n--){let r=t[n],i=a[n];if(i)A(i,r);else if(i=E(r,c,l)??void 0,!i)continue;(i.parentNode!==e||i.nextSibling!==u)&&e.insertBefore(i,u),u=i}}let P=/* @__PURE__ */ new Set([`a`,`b`,`button`,`caption`,`div`,`em`,`i`,`label`,`li`,`ol`,`p`,`section`,`small`,`span`,`strong`,`table`,`tbody`,`td`,`th`,`thead`,`tr`,`ul`]),F=/* @__PURE__ */ new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`]);function I(e,t={}){return typeof e==`string`?ie(e):L(t.xmlns!==!1&&e.tag===`svg`&&e.attrs.xmlns===void 0?{...e,attrs:{xmlns:`http://www.w3.org/2000/svg`,...e.attrs}}:e,t.namespace?t.namespace===`svg`:!P.has(e.tag))}function L(e,t){let{tag:n,attrs:r,children:i}=e;if(!v(n))return``;let a=t||n===`svg`,o=`<${n}`;for(let e in r)y(e)&&(o+=` ${e}="${ae(String(r[e]))}"`);if(i.length===0){if(a)return`${o}/>`;if(F.has(n.toLowerCase()))return`${o}>`}o+=`>`;let s=a&&n!==`foreignObject`;for(let e of i)o+=typeof e==`string`?ie(e):L(e,s);return`${o}</${n}>`}let R=/[&<>]/,ee=/[&"<>]/,z=/[&<>]/g,te=/[&"<>]/g,ne={"&":`&`,"<":`<`,">":`>`,'"':`"`},re=e=>ne[e];function ie(e){return R.test(e)?e.replace(z,re):e}function ae(e){return ee.test(e)?e.replace(te,re):e}let oe=/* @__PURE__ */ new WeakMap,se=/* @__PURE__ */ new WeakSet,ce;function le(){return ce||typeof ResizeObserver!=`function`||(ce=new ResizeObserver(e=>{for(let{target:t,contentRect:n}of e)t.isConnected?(se.add(t),oe.get(t)?.(n.width,n.height)):se.has(t)&&(se.delete(t),ce?.unobserve(t))})),ce}function ue(e,t){let n=le();return n?(oe.set(e,t),n.observe(e),()=>{oe.get(e)===t&&(oe.delete(e),n.unobserve(e))}):()=>{}}let de=/* @__PURE__ */ new Map,B=!1,fe=e=>{typeof requestAnimationFrame==`function`?requestAnimationFrame(e):queueMicrotask(e)};function pe(e){try{e()}catch(e){setTimeout(()=>{throw e})}}function V(e,t){de.set(e,t),B||(B=!0,fe(ge))}let me={};function he(e){de.delete(e)}function ge(){B=!1;let e=0,t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Map;do{for(let[r,i]of de)de.delete(r),t.has(r)?n.set(r,i):(t.add(r),pe(i),e++);e+=me.idle?.()??0}while(de.size>0);for(let[e,t]of n)V(e,t);return e}let _e=e=>typeof e.crosshair==`object`&&e.crosshair?.value===!0,ve=0,ye=()=>`tc-${++ve}`;function be(e,t){let n=t?.width??0,r=Math.max(0,Math.round(Number.isFinite(e.width)?e.width:n>0?n:600)),i=e.aspectRatio&&e.aspectRatio>0?e.aspectRatio:2,a=Number.isFinite(e.height)?e.height:e.height===`container`&&(t?.height??0)>0?t?.height:e.type?.height?.(Se(e),r)??r/i;return{width:r,height:Math.max(0,Math.round(a))}}let xe=/* @__PURE__ */ new WeakMap;function Se(e){let{prepare:t}=e.type;if(!t)return e;let n=xe.get(e)??t(e);return xe.set(e,n),n}function Ce(e,n){let r=e.type.render(Se(e),n),i=r?.content===void 0?{content:r}:r;return t.post&&(i.content=t.post(e,i.content,i.interaction,n)),i}function we(e,{size:t,id:n,hidden:r,fontSize:i,rtl:a=e.rtl===!0}){return{rtl:a,width:t.width,height:t.height,fontSize:e.fontSize??i??12,locale:e.locale,id:n,hidden:r}}function Te(e){let t={...e.type?.clean?e.type.clean(e):e};for(let e in t)typeof t[e]==`number`&&!Number.isFinite(t[e])&&delete t[e];return t}function Ee(e){if(!e.type||typeof e.type.render!=`function`)throw TypeError("@tabler/charts: `type` must be a chart type such as line.")}let De=[`top`,`bottom`,`left`,`right`,`auto`];function Oe(e){let t=e.type.legend?.(Se(e))??[],n=e.legend,r=n===void 0?t.length>=2:n!==!1&&t.length>0,i=typeof n==`object`?n.position:void 0;return{items:t,show:r,position:i&&De.includes(i)?i:`top`}}function ke(e){if(e.title)return e.title;let t=Oe(e).items.map(e=>e.name).filter(Boolean),n=t.slice(0,6).join(`, `);return`${e.type.name} chart${t.length?`: ${n}${t.length>6?`, …`:``}`:``}`}let Ae=e=>Array.isArray(e)?e.reduce((e,t)=>e+Ae(t),0):e&&typeof e==`object`?1+Ae(e.children):0,je=(e,t)=>e.animate===!1||e.animate!==!0&&Ae(t)>1e3;function Me(e,n,r,i,a,s,c,u,d=e.rtl===!0){let{width:f,height:p}=n,m=e.description?`${r}-desc`:void 0,{patterns:h}=e,g=h===!1?void 0:(h===!0?o(`patterns`):t.patterns)?.(e,r);return l(`svg`,{class:[`tc-chart`,`tc-chart-${e.type.name}`,i&&`tc-static`,d&&`tc-rtl`,g?.[0],e.class],style:g?.[1],viewBox:`0 0 ${f} ${p}`,width:f,height:p,role:`img`,"aria-label":ke(e),"aria-describedby":m,...u},m&&l(`desc`,{key:`desc`,id:m},e.description),g?.[2],s&&l(`g`,{key:`hover-under`,class:`tc-hover-layer`},s),a,c&&l(`g`,{key:`hover-over`,class:`tc-hover-layer`},c))}function Ne(e,t,n=e.id??`tc`){Ee(e);let r=Te(e),{content:i,interaction:a}=Ce(r,we(r,{size:t,id:n,hidden:h(Oe(r).items)}));return{svg:Me(r,t,n,je(r,i),i),interaction:a}}function Pe(e,t,n){return Ne(e,t,n).svg}function Fe(e,t){return I(Ne(e,t).svg)}let Ie=[`hover`,`click`,`legend-toggle`,`render`],Le=`:scope > svg.tc-chart`,Re=e=>typeof getComputedStyle==`function`?getComputedStyle(e):void 0,ze=/* @__PURE__ */ new WeakMap;var Be=class{element;id;#e;#t=(e,t)=>{let n=this.#e.height===`container`,r=e!==this.#n.width||n&&t!==this.#n.height;this.#n={width:e,height:t},r&&(e||t)&&(this.#h=void 0,this.#S(),this.#C())};#n={};#r=/* @__PURE__ */ new Map;#i;#a=[];#o=!1;#s;#c;#l=``;#u=null;#d;#f;#p=/* @__PURE__ */ new Map;#m;#h;#g=!1;constructor(e,t,n=[]){let r=typeof e==`string`?document.querySelector(e):e;if(!r)throw Error(`@tabler/charts: element "${String(e)}" not found.`);ze.get(r)?.destroy(),ze.set(r,this),this.element=r,this.#e=Te(t),this.id=t.id??ye(),this.#m=r.querySelector(Le),this.#T(),this.#i=ue(r,this.#t);try{for(let e of[...n,...t.type.plugins??[],...t.plugins??[]])this.#a.push(e.install(this));this.render()}catch(e){throw this.destroy(),e}}get config(){return this.#e}get size(){let e=this.#n,t=0;for(let e of this.#a)t+=e.reservedWidth?.()??0;t&&e.width&&(e={...e,width:e.width-t});let{height:n,legend:r}=this.#e,i=Number.isFinite(n)&&typeof r==`object`&&r?.withinHeight===!0,a=0;if(i||n===`container`&&e.height)for(let e of this.#a)a+=e.reservedHeight?.()??0;a&&!i&&(e={...e,height:e.height-a});let o=be(this.#e,e);return i&&(o.height=Math.max(0,o.height-Math.round(a))),o}get rtl(){let e=this.#e;return this.#h===void 0&&(this.#g=e.rtl===`auto`?Re(this.element)?.direction===`rtl`:e.rtl===!0,this.#h=e.fontSize??this.#w()),this.#g}get fontSize(){return this.#d?.fontSize??this.#e.fontSize??12}get interaction(){return this.#s}get active(){return this.#u}get pointer(){let e=this.#c;return this.#u&&e?.kind===`pointer`?{x:e.x,y:e.y}:void 0}get highlightSource(){return this.#u?this.#c?.kind:void 0}highlightIndex(e,t){let n=this.#s?.hitIndex(e,t)??null;return n?(this.#c={kind:`index`,index:e,seriesIndex:t},this.#b(n),n):null}highlightAt(e,t,n){let r=this.hitTest(e,t);return this.#c={kind:`pointer`,x:e,y:t},this.#b(r,n),r}clearHighlight(e){this.#c=void 0,this.#b(null,e)}toggleSeries(e,t){let{items:n}=Oe(this.#e),r=typeof e==`number`?n.find(t=>t.index===e):n.find(t=>t.key===e)??n.find(t=>t.name===e);if(!r)return this;let i=t??!this.#x(n).has(r.key);return this.#p.set(r.key,i),this.emit(`legend-toggle`,{key:r.key,name:r.name,index:r.index,hidden:i}),this.#C(),this}isHidden(e){return this.#x(Oe(this.#e).items).has(e)}update(e){this.#e=Te({...this.#e,...e});for(let t in e)t!==`data`&&(this.#h=void 0);return this.#C(),this}setConfig(e){return this.#e=Te(e),this.#h=void 0,this.#C(),this}setData(e){return this.update({data:e})}resize(){return this.#o||(this.#i=ue(this.element,this.#t)),this.#T(),this.#h=void 0,this.#C(),this}render(){if(this.#o)return this;he(this);let e=this.#e,t=e;Ee(t);let n=Oe(e),r=this.#x(n.items);for(let e of this.#a)e.beforeRender?.({config:t,legend:n,hidden:r});let i=this.size,{content:a,stale:o,changed:s}=this.#_(i,r);o&&this.#v();let c=this.#m;C(this.element,this.#y(a,i),c),this.#m=null,c&&this.#S();for(let e of this.#a)e.afterRender?.({config:t,legend:n,hidden:r,size:i,stale:o,changed:s});return o&&this.emit(`render`,{size:i}),this}#_(e,n){let r=this.#e,i=[...n].sort().join(`\0`),a=this.rtl,o=r.fontSize??this.#h,s=this.#d,c=!s||s.cfg!==r||s.hidden!==i,l=c||s?.width!==e.width||s.height!==e.height||s.fontSize!==o||s.rtl!==a;if(!s||l){r.type.sweep&&(t.sweep=r.type.sweep);let{content:c,interaction:l}=Ce(r,we(r,{size:e,id:this.id,hidden:n,fontSize:o,rtl:a}));this.#s=l,s={cfg:r,width:e.width,height:e.height,hidden:i,fontSize:o,rtl:a,content:c,still:je(r,c)},this.#d=s}return{content:s,stale:l,changed:c}}#v(){let e=this.#c;if(!e)return;let t=e.kind===`pointer`?this.hitTest(e.x,e.y):this.#s?.hitIndex(e.index,e.seriesIndex)??null;this.#b(t,void 0,!0,!1)}#y(e,t){let n=this.#e,r=this.#u,i=[],a=[],o;for(let e of this.#a){if(r&&e.layers){let t=e.layers(r,n);i.push(t.under),a.push(t.over)}let t=e.svgAttrs?.(n);t&&(o={...o,...t})}return Me(n,t,this.id,e.still,e.content,i.length?i:void 0,a.length?a:void 0,o,e.rtl)}hitTest(e,t){return this.#s?.hitTest(e,t)??null}on(e,t){let n=this.#r.get(e);return n||(n=/* @__PURE__ */ new Set,this.#r.set(e,n)),n.add(t),()=>{n.delete(t)}}destroy(){if(!this.#o){this.#o=!0,ze.get(this.element)===this&&ze.delete(this.element),he(this),clearTimeout(this.#f),this.#i();for(let e of this.#a)e.destroy?.();this.#r.clear(),C(this.element,null)}}#b(e,t,n=!1,r=!0){let i=s(e);!n&&i===this.#l?e?.cursor&&_e(this.#e)&&e.cursor.position!==this.#u?.cursor?.position&&(this.#u=e,r&&this.#C()):n&&i===``&&this.#l===``||(this.#l=i,this.#u=e,this.emit(`hover`,t?{hit:e,event:t}:{hit:e}),r&&this.#C())}#x(e){let t=/* @__PURE__ */ new Set;for(let n of e)(this.#p.get(n.key)??n.hidden)&&t.add(n.key);return t}#S(){let e=this.element.querySelector(Le);e&&(e.setAttribute(`data-resizing`,``),clearTimeout(this.#f),this.#f=setTimeout(()=>e.removeAttribute(`data-resizing`),200))}#C(){this.#o||V(this,()=>this.render())}#w(){let e=Number.parseFloat(Re(this.element)?.getPropertyValue(`--tc-font-size`)??``);return Number.isFinite(e)&&e>0?e:void 0}#T(){let e=this.element,t=Re(e),n=e=>Number.parseFloat(e??``)||0;this.#n={width:e.clientWidth-n(t?.paddingLeft)-n(t?.paddingRight),height:e.clientHeight-n(t?.paddingTop)-n(t?.paddingBottom)}}emit(e,t){let n=this.#r.get(e);if(n)for(let e of n)e(t)}};function Ve(e,t=0){let n=n=>{let r=typeof e==`number`?e:e?.[n];return Number.isFinite(r)?r:t};return{top:n(`top`),right:n(`right`),bottom:n(`bottom`),left:n(`left`)}}let He=(e,t)=>t?{...e,left:e.right,right:e.left}:e;function Ue(e,t,n){return{x:n.left,y:n.top,width:Math.max(0,e-n.left-n.right),height:Math.max(0,t-n.top-n.bottom)}}function We(e,t,n){let{width:r,height:i,rtl:a}=e,o=Ve(t),s=n({...o,start:a?o.right:o.left,end:a?o.left:o.right}),c=Ue(r,i,{...s,left:a?s.end:s.start,right:a?s.start:s.end}),l=c.x+c.width;return{area:c,side:a?`right`:`left`,range:(e=a)=>e?[l,c.x]:[c.x,l]}}let Ge=e=>e>=4352&&(e<=4447||e>=11904&&e<=42191||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65280&&e<=65376||e>=127744);function Ke(e){return e>=`0`&&e<=`9`?e===`1`?.45:.63:" !'.,:;|ijlI`".includes(e)?.27:`()[]{}-/frt`.includes(e)?.38:`%@MWmw`.includes(e)?.88:`CDGHNOQU`.includes(e)?.76:e>=`A`&&e<=`Z`?.66:.57}function H(e,t){let n=0;for(let t=0;t<e.length;t++){let r=e.codePointAt(t);n+=qe[r]??(Ge(r)?1:.57),r>65535&&t++}return n*t}let qe=/* @__PURE__ */ Array.from({length:128},(e,t)=>Ke(String.fromCharCode(t))),U=e=>Math.round(e*100)/100,W=1.25,Je=`http://www.w3.org/2000/svg`,Ye={fill:`rgb(0, 0, 0)`,"fill-opacity":`1`,stroke:`none`,"stroke-width":`1px`,"stroke-opacity":`1`,"stroke-dasharray":`none`,"stroke-dashoffset":`0px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"paint-order":`normal`,"shape-rendering":`auto`,"vector-effect":`none`,opacity:`1`,visibility:`visible`},Xe={...Ye,"font-family":``,"font-size":``,"font-weight":`400`,"font-style":`normal`,"font-variant-numeric":`normal`,"letter-spacing":`normal`},Ze={"stop-color":``,"stop-opacity":`1`},Qe={opacity:`1`},$e=/* @__PURE__ */ new Set([`path`,`line`,`rect`,`circle`,`ellipse`,`polygon`,`polyline`]);function et(e){let t=`element`in e&&!(e instanceof Element)?e.element:e,n=t.localName===`svg`?t:t.querySelector(`:scope > svg.tc-chart`);if(!n)throw Error(`@tabler/charts: no rendered chart to export.`);return n}function tt(e){let t=e.transform;if(!t||t===`none`)return;let n=t.replace(/px/g,``);if(n.startsWith(`translate`))return n;let[r=0,i=0]=(e.transformOrigin||`0 0`).split(` `).map(Number.parseFloat);return r||i?`translate(${r} ${i}) ${n} translate(${-r} ${-i})`:n}function nt(e,t){let n=getComputedStyle(e);if(n.display===`none`)return!1;let r=e.localName,i=r===`text`?Xe:r===`stop`?Ze:$e.has(r)?Ye:Qe,a=[];for(let e in i){let t=n.getPropertyValue(e);t&&t!==i[e]&&a.push(`${e}:${t}`)}t.removeAttribute(`style`),a.length&&t.setAttribute(`style`,a.join(`;`));let o=tt(n);o&&t.setAttribute(`transform`,o);let s=Array.from(e.children),c=Array.from(t.children);return s.forEach((e,t)=>{let n=c[t];(e.classList.contains(`tc-hover-layer`)||!nt(e,n))&&n.remove()}),!0}function rt(e){let t=e.querySelector(`:scope > .tc-legend`),n=t?Array.from(t.querySelectorAll(`.tc-legend-item`)):[];if(!t||!n.length)return;let r=e.ownerDocument,i=e.querySelector(`:scope > svg.tc-patterned`),a=t.getBoundingClientRect(),o=r.createElementNS(Je,`g`);for(let e of n){let t=e.querySelector(`.tc-legend-swatch`),n=e.querySelector(`.tc-legend-name`);if(!t||!n)continue;let s=t.getBoundingClientRect(),c=n.getBoundingClientRect(),l=getComputedStyle(t).getPropertyValue(`--tc-series-color`).trim(),u=/\btc-series-([1-8])\b/.exec(e.getAttribute(`class`)??``)?.[1]??`other`,d=i?getComputedStyle(i).getPropertyValue(`--tc-pattern-${u}`).trim():``,f=e.classList.contains(`tc-legend-item-hidden`),p=r.createElementNS(Je,`circle`);p.setAttribute(`cx`,String(U(s.left-a.left+s.width/2))),p.setAttribute(`cy`,String(U(s.top-a.top+s.height/2))),p.setAttribute(`r`,String(U(s.width/2-(f?.75:0)))),p.setAttribute(`style`,f?`fill:none;stroke:${l};stroke-width:1.5px`:`fill:${d.startsWith(`url(`)?d:l}`);let m=getComputedStyle(n),h=r.createElementNS(Je,`text`);h.setAttribute(`x`,String(U(c.left-a.left))),h.setAttribute(`y`,String(U(c.top-a.top+c.height/2))),h.setAttribute(`dy`,`0.35em`),h.setAttribute(`style`,`fill:${m.color};font-family:${m.fontFamily};font-size:${m.fontSize};font-weight:${m.fontWeight}`),h.textContent=n.textContent,o.append(p,h)}return{svg:o,box:a}}function it(e,t={}){let n=et(e);for(let e of n.getAnimations?.({subtree:!0})??[])e.finish();let r=n.cloneNode(!0);nt(n,r);let i=n.ownerDocument,a=Number(n.getAttribute(`width`)),o=Number(n.getAttribute(`height`));r.setAttribute(`xmlns`,Je),r.removeAttribute(`class`),r.removeAttribute(`tabindex`),r.removeAttribute(`data-resizing`),r.removeAttribute(`aria-describedby`),r.removeAttribute(`aria-activedescendant`);let s=getComputedStyle(n),c=n.parentElement,l=t.legend!==!1&&c?rt(c):void 0,u=a,d=o;if(l){let{box:e}=l,t=n.getBoundingClientRect(),s=Math.min(t.left,e.left),c=Math.min(t.top,e.top),f=i.createElementNS(Je,`g`);f.append(...Array.from(r.childNodes));let p=(e,t,n)=>{(t||n)&&e.setAttribute(`transform`,`translate(${U(t)} ${U(n)})`)};p(f,t.left-s,t.top-c),p(l.svg,e.left-s,e.top-c),r.append(f,l.svg),u=U(Math.max(t.left+a,e.right)-s),d=U(Math.max(t.top+o,e.bottom)-c)}r.setAttribute(`width`,String(u)),r.setAttribute(`height`,String(d)),r.setAttribute(`viewBox`,`0 0 ${u} ${d}`);let f=n.getAttribute(`aria-label`);if(f){let e=i.createElementNS(Je,`title`);e.textContent=f,r.prepend(e)}let p=t.background===void 0||t.background===`auto`?s.getPropertyValue(`--tc-surface`).trim()||void 0:t.background||void 0;if(p){let e=i.createElementNS(Je,`rect`);e.setAttribute(`width`,`100%`),e.setAttribute(`height`,`100%`),e.setAttribute(`fill`,p),r.insertBefore(e,r.querySelector(`:scope > title`)?.nextSibling??r.firstChild)}return new XMLSerializer().serializeToString(r)}async function at(e,t={}){let{type:n=`image/png`,scale:r=2,quality:i}=t,a=it(e,{...t,...n===`image/jpeg`&&t.background===!1?{background:`#fff`}:{}}),o=et(e).ownerDocument,s=new Image;s.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(a)}`,await s.decode();let c=o.createElement(`canvas`);c.width=Math.round(s.width*r),c.height=Math.round(s.height*r);let l=c.getContext(`2d`);if(!l)throw Error(`@tabler/charts: no 2d canvas to draw the image.`);return l.drawImage(s,0,0,c.width,c.height),new Promise((e,t)=>{c.toBlob(n=>n?e(n):t(/* @__PURE__ */ Error(`@tabler/charts: could not encode.`)),n,i)})}function ot(e){let{config:t,interaction:n}=e,{data:r,x:i}=t,a=r?.series;if(!n||!Array.isArray(a)||!a.every(e=>Array.isArray(e?.values)))return;let o=Array.from({length:n.count},(e,t)=>n.hitIndex(t)),s=/* @__PURE__ */ new Map;for(let e of o)for(let t of e?.items??[])s.set(t.seriesIndex,t.name);let c=[...s.keys()].sort((e,t)=>e-t),l=[[``,...c.map(e=>s.get(e))]];for(let e of o){if(!e)continue;let t=r?.labels?.[e.index],n=t instanceof Date?t:i?.type===`time`&&typeof e.label==`number`&&new Date(e.label);l.push([n&&Number.isFinite(n.getTime())?n.toISOString():String(e.label),...c.map(t=>{let n=e.items.find(e=>e.seriesIndex===t)?.value;return n==null?``:String(n)})])}return l}function st(e){let{config:t}=e,n=Se(t),r=new Set((t.type.legend?.(n)??[]).map(e=>e.key).filter(t=>e.isHidden(t))),i=t.type.table?.(n,{locale:t.locale,hidden:r,rtl:e.rtl},1/0);if(!i)throw Error(`@tabler/charts: this chart type has no data for a CSV.`);return[i.columns,...i.rows]}function ct(e,t={}){if(!e?.config?.type)throw Error(`@tabler/charts: exportCSV() takes the chart, not its element.`);let n=t.delimiter??`,`,r=e=>{let t=/^[=+\-@\t\r]/.test(e)&&!Number.isFinite(Number(e))?`'${e}`:e;return t.includes(n)||/["\r\n]/.test(t)?`"${t.replace(/"/g,`""`)}"`:t};return(ot(e)??st(e)).map(e=>e.map(r).join(n)).join(`\r
|
|
2
|
+
`)}async function lt(e,t={}){let{format:n=`png`}=t,r=et(e),i=n===`csv`?new Blob([`${ct(e,t)}`],{type:`text/csv;charset=utf-8`}):n===`svg`?new Blob([it(e,t)],{type:`image/svg+xml`}):await at(e,{...t,type:`image/${n}`}),a=(t.filename??r.getAttribute(`aria-label`)??`chart`).replace(/[\\/:*?"<>|]+/g,``).trim(),o=r.ownerDocument.createElement(`a`);o.href=URL.createObjectURL(i),o.download=`${a||`chart`}.${n===`jpeg`?`jpg`:n}`,o.click(),setTimeout(()=>URL.revokeObjectURL(o.href),1e3)}n({export:lt});let ut=/* @__PURE__ */ new Map,dt=/* @__PURE__ */ new Map;function ft(e,t,n){let r=e.get(t);return r===void 0&&(e.size>=64&&e.clear(),r=n(),e.set(t,r)),r}function pt(e,t){return`${JSON.stringify(e??null)}|${JSON.stringify(t)}`}function G(e,t={}){return ft(ut,pt(e,t),()=>new Intl.NumberFormat(e,t))}function mt(e,t={}){return ft(dt,pt(e,t),()=>new Intl.DateTimeFormat(e,t))}let ht=e=>e===0?0:e;function K(e,t){if(typeof e==`function`)return e;let{compactSymbols:n,...r}=e??{};if(n)return _t(n===!0?gt:n,r,t);let i=G(t,r);return e=>i.format(ht(e))}let gt=[`K`,`M`,`B`,`T`];function _t(e,{notation:t,compactDisplay:n,...r},i){let a=yt(r),o=G(i,a?r:{...r,maximumSignificantDigits:2}),s=a?o:G(i,{...r,maximumFractionDigits:0});return t=>{for(let n=0;;n++){let r=ht(t/1e3**n),i=(Math.abs(r)<10?o:s).formatToParts(r),a=``,c;for(let e of i)e.type===`integer`&&(a+=e.value),(e.type===`integer`||e.type===`fraction`)&&(c=e);if(a.length<4||n>=e.length)return n&&c&&(c.value+=e[n-1]),i.map(e=>e.value).join(``)}}}let vt=e=>e.notation===`compact`||!!e.compactSymbols,yt=e=>(e.minimumFractionDigits??e.maximumFractionDigits??e.minimumSignificantDigits??e.maximumSignificantDigits)!==void 0;function bt(e,t){return K(typeof e==`object`&&vt(e)&&!yt(e)?{...e,maximumSignificantDigits:3}:e,t)}function xt(e){let t=Math.abs(e);return!Number.isFinite(t)||t===0?0:Math.max(0,-Math.floor(Math.log10(t)+1e-9))}function St(e){return yt(e)||!!e.compactSymbols||(e.notation??`standard`)!==`standard`}function Ct(e,t,n){if(typeof t==`function`)return t;let r=t??{};if(St(r))return K(r,n);let i=xt(e);r.style===`percent`&&(i=Math.max(0,i-2));let a=K({...r,minimumFractionDigits:i,maximumFractionDigits:i},n),o=Math.abs(e)*1e-9;return e=>a(Math.abs(e)<o?0:e)}function wt(e,t){if(typeof e==`function`)return t=>e(typeof t==`number`?new Date(t):t);let n=mt(t,e);return e=>n.format(e)}let Tt=Math.sqrt(50),Et=Math.sqrt(10),Dt=Math.sqrt(2);function Ot(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=Tt?10:a>=Et?5:a>=Dt?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&n>=.5&&n<2?Ot(e,t,n*2):[s,c,l]}function kt(e,t,n=5){if(!(n>0)||!Number.isFinite(e)||!Number.isFinite(t))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?Ot(t,e,n):Ot(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);for(let e=0;e<s;e++){let t=r?a-e:i+e;c[e]=o<0?t/-o:t*o}return c}function At(e,t,n){return Ot(e,t,n)[2]}function jt(e,t,n=5){let r=t<e,i=r?At(t,e,n):At(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Mt(e,t,n=5){if(!Number.isFinite(e)||!Number.isFinite(t)||e===t||!(n>0))return[e,t];let r=t<e,i=r?t:e,a=r?e:t,o;for(let e=0;e<10;e++){let e=At(i,a,n);if(e===o)return r?[a,i]:[i,a];if(e>0)i=Math.floor(i/e)*e,a=Math.ceil(a/e)*e;else if(e<0)i=Math.ceil(i*e)/e,a=Math.floor(a*e)/e;else break;o=e}return[e,t]}function Nt(e,t={}){let{count:n=5,format:r,locale:i}=t,[a,o]=e.domain,s=Ct(jt(a,o,n),r,i);return e.ticks(n).map(t=>({value:t,position:e(t),label:s(t)}))}function Pt(e,t=String){return e.domain.map((n,r)=>({value:n,position:e.at(r)+e.bandwidth/2,label:t(n,r)}))}let Ft=e=>e===`top`||e===`bottom`;function It(e,t,n,r=8){if(e.length<2)return e.slice();let i=e.map(e=>Ft(t)?H(e.label,n):n*W),a=(t,n)=>Math.abs(e[n].position-e[t].position)>=(i[t]+i[n])/2+r,o=e.length-1,s=Math.abs(e[o].position-e[0].position),c=i.reduce((e,t)=>e+t+r,0),l=s>0?Math.max(1,Math.floor(c/s)):o;for(let t=l;t<=o;t++){let n=!0;for(let e=t;e<=o&&n;e+=t)n=a(e-t,e);if(!n)continue;let r=[];for(let e=0;e<=o;e+=t)r.push(e);let i=r[r.length-1];return i!==o&&(a(i,o)?r.push(o):r.length>1&&a(r[r.length-2],o)&&(r[r.length-1]=o)),r.map(t=>e[t])}return e.slice(0,1)}function q(e,t,n,r={}){let{tickSize:i=0,tickPadding:a=8,rotate:o}=r;if(t.length===0)return 0;let s=Ft(e)&&!o?n*W:t.reduce((e,t)=>Math.max(e,H(t.label,n)),0)+3;return Math.ceil(s+i+a)}let Lt=(e,t)=>e?Math.ceil(t*W)+6:0;function Rt(e,t,n,r,i,a){let o=q(e,t,i,{rotate:a})+6,s=e===`left`?-1:1,c=o+i*W/2;return l(`text`,{key:`axis-title-${e}`,class:`tc-axis-title tc-axis-title-${e}`,transform:e===`bottom`?`translate(${U(n.x+n.width/2)},${U(n.y+n.height+o)})`:`translate(${U(e===`left`?n.x-c:n.x+n.width+c)},${U(n.y+n.height/2)}) rotate(${s*90})`,dy:e===`bottom`?`0.71em`:`0.32em`,"text-anchor":`middle`,"aria-hidden":`true`},r)}function zt(e){let{position:t,ticks:n,area:r,tickSize:i=0,tickPadding:a=8,line:o=!1,rotate:s}=e,c=Ft(t),u=t===`top`||t===`left`?-1:1,d=u*(i+a),f=t===`top`?r.y:t===`bottom`?r.y+r.height:t===`left`?r.x:r.x+r.width,p=s?{transform:`rotate(-90)`,x:-d,dy:`0.32em`,"text-anchor":`end`}:c?{y:d,dy:t===`top`?`0em`:`0.71em`,"text-anchor":`middle`}:{x:d,dy:`0.32em`,"text-anchor":t===`left`?`end`:`start`},m=c?{y2:u*i}:{x2:u*i};return l(`g`,{key:`axis-${t}`,class:[`tc-axis`,c?`tc-axis-x`:`tc-axis-y`,`tc-axis-${t}`],"aria-hidden":`true`},o&&l(`line`,c?{class:`tc-axis-line`,x1:r.x,x2:r.x+r.width,y1:f,y2:f}:{class:`tc-axis-line`,x1:f,x2:f,y1:r.y,y2:r.y+r.height}),n.map(e=>l(`g`,{key:e.value,class:`tc-tick`,style:c?`transform:translate(${U(e.position)}px,${U(f)}px)`:`transform:translate(${U(f)}px,${U(e.position)}px)`},i>0&&l(`line`,{class:`tc-tick-line`,...m}),l(`text`,{class:`tc-tick-label`,...p},e.label))))}function Bt(e){let{direction:t,ticks:n,area:r}=e;return l(`g`,{key:`grid-${t}`,class:[`tc-grid`,`tc-grid-${t}`],"aria-hidden":`true`},n.map(e=>{let n=U(e.position);return l(`line`,{key:e.value,class:[`tc-grid-line`,e.value===0&&`tc-grid-line-zero`],...t===`y`?{x1:r.x,x2:r.x+r.width,y1:0,y2:0,style:`transform:translateY(${n}px)`}:{x1:0,x2:0,y1:r.y,y2:r.y+r.height,style:`transform:translateX(${n}px)`}})}))}function Vt(e,t,n={}){let{paddingInner:r=0,paddingOuter:i=0,align:a=.5}=n,o=Math.min(1,Math.max(0,r)),s=e.length,[c,l]=t,u=l<c,d=u?l:c,f=u?c:l,p=(f-d)/Math.max(1,s-o+i*2),m=d+(f-d-p*(s-o))*a,h=p*(1-o),g=/* @__PURE__ */ new Map;for(let t=0;t<s;t++){let n=e[t];g.has(n)||g.set(n,t)}let _=e=>m+p*(u?s-1-e:e),v=e=>{let t=g.get(e);return t===void 0?void 0:_(t)};return Object.assign(v,{domain:e.slice(),range:[c,l],bandwidth:h,step:p,at:_,center(e){let t=v(e);return t===void 0?void 0:t+h/2},indexAt(e){if(s===0)return-1;let t=p===0?0:Math.round((e-m-h/2)/p),n=Math.min(s-1,Math.max(0,t));return u?s-1-n:n}})}function Ht(e,t,n={}){let{padding:r=0,align:i}=n;return Vt(e,t,{paddingInner:1,paddingOuter:r,...i===void 0?{}:{align:i}})}function Ut(e){let t=1/0,n=-1/0;for(let r of e)r!=null&&Number.isFinite(r)&&(r<t&&(t=r),r>n&&(n=r));return t<=n?[t,n]:void 0}function Wt(e,t,n={}){let[r,i]=e,[a,o]=t,s=i-r,c=s===0?0:(o-a)/s,l=(a+o)/2,{clamp:u=!1}=n,d=Math.min(a,o),f=Math.max(a,o),p=Math.min(r,i),m=Math.max(r,i);return Object.assign(e=>{if(s===0)return l;let t=a+(e-r)*c;return u?Math.min(f,Math.max(d,t)):t},{domain:[r,i],range:[a,o],invert(e){if(s===0||o===a)return r;let t=r+(e-a)/c;return u?Math.min(m,Math.max(p,t)):t},ticks(e){return kt(r,i,e)},nice(e){return Wt(Mt(r,i,e),t,n)}})}let J=e=>typeof e==`number`&&Math.abs(e)<=1e300?Math.abs(e)<1e-300?0:e:null,Gt=e=>J(e)??void 0,Y=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Kt=e=>Array.isArray(e)?e:[],qt=e=>typeof e==`string`?e:J(e)===null?``:String(e),Jt=e=>typeof e==`string`||J(e instanceof Date?+e:e)!==null?e:``,Yt=e=>{let t=Kt(e);return t.every(e=>e==null||J(e)===e)?t:t.map(J)},Xt=(e,t)=>Kt(e).filter(Y).map(t),Zt=e=>({...e,name:qt(e.name),id:typeof e.id==`string`?e.id:void 0,color:typeof e.color==`string`?e.color:void 0}),Qt=e=>{let t=Y(e)?e:{};return{...t,labels:Array.isArray(t.labels)?t.labels.map(Jt):void 0,series:Xt(t.series,e=>({...Zt(e),values:Yt(e.values)}))}},$t=e=>t=>({...t,data:e(t.data)}),en=e=>Xt(e,e=>({...Zt(e),value:J(e.value)??0,max:Gt(e.max)})),X=e=>e.id??e.name;function tn(e){return e.map((e,t)=>{let n={key:X(e),name:e.name,index:t};return e.color&&(n.color=e.color),e.hidden&&(n.hidden=!0),n})}function nn(e,t){return{key:X(e),class:[`tc-series`,`tc-series-${t+1}`,e.class],"data-series":e.name,style:{"--tc-series-color":e.color}}}let Z=e=>e instanceof Date?e.getTime():e,rn=e=>e.view||e.zoom?o(`zoom`).window(e):e,Q=X,an=e=>e.orientation!==`horizontal`&&e.data.series.some(e=>e.axis===`y2`);function on(e){let t=an(e),n={second:!1,axis:e.y??{}},r={second:!0,axis:e.y2??{}};return e=>t&&e?.axis===`y2`?r:n}let sn=(e,t)=>e.y2&&t?.axis===`y2`?e.y2:e.y,cn=e=>tn(e.series);function ln(e){if(e.labels)return e.labels.slice();let t=Math.max(0,...e.series.map(e=>e.values.length));return Array.from({length:t},(e,t)=>t+1)}function un(e,t){return e==null||!Number.isFinite(e)?!1:t?.scale!==`log`||e>0}let dn=e=>e.x?.type===`time`&&ln(e.data).every(e=>Number.isFinite(pn(e)));function fn(e,t){return e.x?.format?e.x.format:dn(e)?o(`dates`)(ln(e.data),e.x?.utc,t.locale):e=>String(e)}let pn=e=>new Date(e).getTime();function mn(e,t,n){return n.scale===`log`?o(`log`).scale(e,t):Wt(e,t)}function hn(e,t,n,r,i){return t.scale===`log`?o(`log`).ticks(e,n,r,i):Nt(e,{count:n,format:r,locale:i})}let gn=e=>{let{shapes:n,patterns:r}=e;return n??r===!0?t[`point-shapes`]:void 0};function _n(e,t,n,r,i,a,o){return e?l(`path`,{key:n,class:[r,`tc-marker`],d:e(t,i,a,o)}):l(`circle`,{key:n,class:r,cx:i,cy:a,r:o})}let vn=(e,t)=>Math.min(J(e?.ticks)??t,100);function yn(e,t,n,r,i=/* @__PURE__ */ new Set,a,o=[]){let s=a??e.series.filter(e=>!i.has(Q(e))).flatMap(e=>e.values);return bn(o.length?[...s,...o]:s,t,n,r)}function bn(e,t,n,r){if(t.scale===`log`)return o(`log`).domain(e,t);let i=J(t.min),a=J(t.max),[s,c]=Ut(e)??[0,1];if((t.zero??n)&&(s=Math.min(s,0),c=Math.max(c,0)),s===c){if(s===0)c=1;else{let e=Math.abs(s)*.1;s-=e,c+=e}}if(i!==null&&(s=i),a!==null&&(c=a),t.nice!==!1){let[e,t]=Mt(s,c,r);i===null&&(s=e),a===null&&(c=t)}return[s,c]}function xn(e){return e.annotations?.length?o(`annotations`):void 0}function Sn(e,t,n,r,i){let a=i===`y2`,o=(a?e.y2:e.y)??{},s=vn(o,Math.max(2,r)),c;if(a){let r=e.data.series.filter(e=>e.axis===`y2`),i=r.filter(e=>!t.hidden.has(Q(e)));c=bn((i.length?i:r).flatMap(e=>e.values),o,n.zero2??n.zero,s)}else c=yn(i===`y`?{...e.data,series:e.data.series.filter(e=>e.axis!==`y2`)}:e.data,o,n.zero,s,t.hidden,n.values,xn(e)?.values(e.annotations));let l=a?o.format:n.tickFormat??o.format,u=e=>mn(c,e,o),d=e=>hn(e,o,s,l,t.locale);return{scale:u,ticks:d,probe:d(u([0,1]))}}function Cn(e,t,n,r,i,a,o){let{area:s,x:c,y:l,xTicks:u,yTicks:d,y2Ticks:f,horizontal:p}=i,m=e.x??{},h=wn(e,!p&&!o&&m.show!==!1),g=n===`left`?`right`:`left`,_=xn(e)?.layers(e.annotations,{area:s,horizontal:p,fontSize:t.fontSize,value:l,band:c,keys:a,time:o}),v=e.y?.show!==!1&&[zt({position:p?`bottom`:n,ticks:d,area:s})],y=(m.show!==!1&&i.labels.length>0||m.line)&&[zt({position:p?n:`bottom`,ticks:u,area:s,line:m.line===!0,rotate:h})],b=!!f&&e.y2?.show!==!1&&[zt({position:g,ticks:f,area:s})],x=(e,n,r)=>!!e&&Rt(n,r||[],s,e,t.fontSize,n===`bottom`&&h),S=[x(e.y?.title,p?`bottom`:n,!!v&&d),x(m.title,p?n:`bottom`,u),!!f&&x(e.y2?.title,g,!!b&&f)],C=e=>e.flatMap(e=>e||[]);return{...i,background:C([e.y?.grid!==!1&&Bt({direction:p?`x`:`y`,ticks:d,area:s}),m.grid&&Bt({direction:p?`y`:`x`,ticks:u,area:s}),_?.under]),foreground:C([_?.over,p?y:v,p?v:y,b,...S]),clip:En(t,s,r)}}let wn=(e,t)=>t&&e.x?.rotate===!0;function Tn(e,t,n){let{data:r}=e,i=e.y??{},a=e.x??{},{fontSize:s,locale:c,width:l,height:u}=t,d=n.overhang??0,f=t.rtl===!0,p=a.reverse??f,m=ln(r),h=fn(e,t),g=i.show!==!1,_=a.show!==!1&&m.length>0,v=dn(e)&&n.scale===`point`,y=Math.round(u/60),b=an(e),x=Sn(e,t,n,y,b?`y`:void 0),S=x.probe,C=e.y2??{},w=b?Sn(e,t,n,y,`y2`):null,T=!!w&&C.show!==!1,E=Math.max(2,Math.round(l/80)),D=m.map(Z),O=e=>h(m[e],e),k=v?o(`time`).axis(m,D,a,E,c):{edges:m.length?[O(0),O(m.length-1)]:[],scale:e=>n.scale===`point`?Ht(D,e):Vt(D,e,{paddingInner:n.paddingInner??.3,paddingOuter:n.paddingOuter??.15}),ticks:e=>Pt(e,(e,t)=>O(t))},A=k.edges,j=wn(e,_&&!v),M=j?m.map((e,t)=>({value:t,position:0,label:O(t)})):[],N=Math.ceil(s*W/2),P=e=>j?s*W:_?H(A[e?A.length-1:0]??``,s):0,F=P(p!==f),I=P(p===f),L=n.scale===`point`,R=(g?q(`left`,S,s):0)+Lt(i.title,s),ee=w?(T?q(`right`,w.probe,s):0)+Lt(C.title,s):0,{area:z,side:te,range:ne}=We(t,e.padding,e=>{let t=t=>{let n=e=>L?Math.ceil(e/2):Math.max(0,Math.ceil(e/2-t));return{start:e.start+Math.max(R,n(F),d,g?0:8),end:e.end+Math.max(ee,n(I),d,8)}},n=Math.max(1,m.length)*2,r=t((l-e.start-e.end-R-ee)/n);return L||(r=t((l-r.start-r.end)/n)),{top:e.top+Math.max(g||T?N:0,d,4),bottom:e.bottom+Math.max((j?q(`bottom`,M,s,{rotate:j}):_?q(`bottom`,[S[0]],s):g?N:0)+Lt(a.title,s),d,4),...r}}),re=k.scale(ne(p)),ie=x.scale([z.y+z.height,z.y]),ae=w?.scale([z.y+z.height,z.y]),oe=It(x.ticks(ie),`left`,s,4),se={area:z,labels:m,x:re,y:ie,horizontal:!1,xTicks:_?j?It(k.ticks(re),`left`,s/W,2):It(k.ticks(re),`bottom`,s):[],yTicks:oe};return w&&ae&&(se.y2=ae,se.y2Ticks=It(w.ticks(ae),`right`,s,4)),Cn(e,t,te,d,se,D,k.time)}function En(e,t,n){let r=`${e.id}-clip`,i=n+1;return{def:l(`clipPath`,{id:r},l(`rect`,{x:t.x-i,y:t.y-i,width:t.width+i*2,height:t.height+i*2})),url:`url(#${r})`}}function Dn(e,t){let{dash:n,width:r}=e;return{...nn(e,t),style:{"--tc-series-color":e.color,"--tc-series-dash":Number.isFinite(n)?`${n}px`:n,"--tc-series-width":Number.isFinite(r)?`${r}px`:void 0}}}function On(e,t,n,r,i){let{area:a,x:o,labels:s,horizontal:c}=e,{data:l}=t,u=fn(t,n),d=on(t),f=l.series.map(e=>d(e).axis),p=f.map(e=>bt(e.format,n.locale)),m=t.y??{},[h,g]=e.y.domain,[_,v]=e.y.range,y=m.scale===`log`||_===v?bt(m.format,n.locale):Ct(Math.abs((g-h)/(v-_)),m.format,n.locale),b=(t,r)=>{let i=c?t:r,a=Math.min(_,v),o=Math.max(_,v),s=e.y.invert(i);if(i<a||i>o||!Number.isFinite(s))return;let l={value:s,text:y(s),position:i,side:c?`bottom`:n.rtl?`right`:`left`};return m.show===!1&&(l.inside=!0),l},x=e=>{let t=o.at(e),i=t+o.bandwidth/2,d=s[e],m=c?{x:a.x,y:i}:{x:i,y:null},h=[];l.series.forEach((t,i)=>{if(n.hidden.has(Q(t)))return;let a=t.values[e],o=un(a,f[i])?a:null,s=o===null?m:r(i,e,o),c={name:t.name,seriesIndex:i,value:o,text:o===null?`–`:p[i](o),...s};t.color&&(c.color=t.color),h.push(c)});let g={index:e,label:Z(d),title:u(d,e),x:c?a.x+a.width/2:i,area:a,items:h};return c&&(g.y=i,g.axis=`y`),o.bandwidth>0&&(g.highlight=c?{kind:`band`,x:a.x,y:t,width:a.width,height:o.bandwidth}:{kind:`band`,x:t,y:a.y,width:o.bandwidth,height:a.height}),g};return{count:s.length,reversed:o.range[1]<o.range[0],hitTest(e,t){if(s.length===0||e<a.x-8||e>a.x+a.width+8||t<a.y-8||t>a.y+a.height+8)return null;let n=o.indexAt(c?t:e),r=x(n),l=i?.(e,t,n);l!==void 0&&(r.seriesIndex=l);let u=b(e,t);return u&&(r.cursor=u),r},hitIndex(e,t){if(e<0||e>=s.length)return null;let n=x(e);return t!==void 0&&n.items.some(e=>e.seriesIndex===t)&&(n.seriesIndex=t),n}}}function kn(e,t,n=1/0){let r=ln(e.data),i=r.length>n?r.slice(0,n):r,a=fn(e,t),o=on(e),s=e.data.series.filter(e=>!t.hidden.has(Q(e))),c=s.map(e=>bt(o(e).axis.format,t.locale));return{columns:[``,...s.map(e=>e.name)],total:r.length,rows:i.map((e,t)=>[a(e,t),...s.map((e,n)=>{let r=e.values[t];return r==null||!Number.isFinite(r)?`–`:c[n](r)})])}}let An=e=>Array.isArray(e)?e.length:ln(e).length;function jn(e,t){let n=Math.max(0,t-1),r=(e,t)=>Math.min(n,Math.max(t,Math.round(e))),i=r(J(e?.start)??0,0);return[i,r(J(e?.end)??n,i)]}function Mn(e){let{data:t,view:n,x:r}=e,[i,a]=jn(n,An(t));if(i===0&&a>=An(t)-1)return e;let o=e=>e.slice(i,a+1),s={...e},c=r?.format;if(c&&(s.x={...r,format:(e,t)=>c(e,t+i)}),Array.isArray(t))return s.data=o(t),s;let l=t,u=ln(l),d=u.map(Z);return s.data={...l,labels:o(u),series:l.series.map(e=>{let t={...e,values:o(e.values)},n=e.dashFrom==null?-1:d.indexOf(Z(e.dashFrom));return n>=0&&n<i&&(t.dashFrom=u[i]),t})},s}let Nn=/* @__PURE__ */ new Set([`line`,`area`,`bar`,`candlestick`]),Pn=`http://www.w3.org/2000/svg`;function Fn(e){let t=e.element,n=()=>t.querySelector(`:scope > svg.tc-chart`),r=()=>{let t=e.interaction,n=t?.hitIndex(0);if(!n||!t)return;let r=n.axis===`y`,i=e=>r?e.y:e.x,a=t.count-1,o=t.hitIndex(a),s=o&&a>0&&Math.abs(i(o)-i(n))/a||(r?n.area.height:n.area.width)||1;return{area:n.area,vertical:r,reversed:!!t.reversed,step:s,at:e=>{let n=t.hitIndex(e);return n?i(n):void 0}}},i=(t,i)=>{let a=n(),o=r()?.area;if(!a||!o)return;let{width:s,height:l}=e.size,u=c(a,t,i,s,l),d=u.x>=o.x&&u.x<=o.x+o.width&&u.y>=o.y&&u.y<=o.y+o.height,f=(e,t,n)=>Math.min(t+n,Math.max(t,e));return{at:[f(u.x,o.x,o.width),f(u.y,o.y,o.height)],inside:d}};return{svg:n,plot:r,locate:i,onPlot:e=>e.target?.closest?.(`svg.tc-chart`)===n()&&!!i(e.clientX,e.clientY)?.inside}}let In=/* @__PURE__ */ new Map,Ln=e=>e.config,Rn=e=>!!Ln(e).brush,zn=e=>Rn(e)?`selection`:`view`,Bn=e=>An(Ln(e).data),Vn=e=>jn(Ln(e)[zn(e)],Bn(e)),Hn=(e,[t,n])=>t===0&&n>=Bn(e)-1,Un=/* @__PURE__ */ new WeakMap,Wn=/* @__PURE__ */ new WeakMap,Gn=e=>Fn(e).plot()?.vertical,Kn=e=>{let{brush:t}=Ln(e);return Nn.has(e.config.type.name)&&(typeof t!=`object`||t.align!==!1)};function qn(e,t){let n=Fn(e).plot()?.area;if(!n)return;let{width:r,height:i}=e.size;return(t?[n.y,i-n.y-n.height]:[n.x,r-n.x-n.width]).map((t,n)=>t-(Wn.get(e)?.[n]??0))}let Jn=/* @__PURE__ */ new WeakMap,Yn=e=>`${zn(e)} ${Vn(e)}`,Xn=/* @__PURE__ */ new WeakMap;function Zn(e){let{data:t}=Ln(e),n=Xn.get(t);return n||(n=(Array.isArray(t)?t.map(e=>e.x):ln(t)).map(Z),Xn.set(t,n)),n}function Qn(e,[t,n]){let[r,i]=Vn(e);if(t===r&&n===i)return;let a=Hn(e,[t,n])?void 0:{start:t,end:n};e.update({[zn(e)]:a})}function $n(e,t,n){if(Hn(e,n))return;let r=Zn(e),i=Zn(t),a=e=>{let t=i.indexOf(r[e]);return t<0?e:t};return jn({start:a(n[0]),end:a(n[1])},i.length)}let er=e=>{let t=e.element;if(typeof t.addEventListener!=`function`)return{};let n=t.ownerDocument,{svg:r,plot:i,locate:a,onPlot:o}=Fn(e),s=()=>Nn.has(e.config.type.name),c=()=>s()&&Rn(e),l=()=>{let{brush:t}=Ln(e),n=typeof t==`object`?J(t.min):null;return Math.max(0,Math.min(Bn(e),Math.round(n??2))-1)},u=(t,n)=>{let r=Math.max(0,Bn(e)-1),i=Math.min(r,Math.max(l(),n-t)),a=Math.min(r-i,Math.max(0,t));Qn(e,[a,a+i])},d,f,p=()=>{d?.delete(e),f&&d?.size===0&&In.get(f)===d&&In.delete(f),d=void 0},m=()=>{let t=s()?Ln(e).sync:void 0;t===f&&d||(p(),f=t,t&&(d=In.get(t)??/* @__PURE__ */ new Set,d.add(e),In.set(t,d)))},h=()=>{if(m(),!d)return;let t=Vn(e),n=Yn(e),r=!Jn.has(e);if(n===Jn.get(e))return;Jn.set(e,n);let i=[...d].filter(t=>Rn(t)!==Rn(e));if(r&&Hn(e,t))for(let t of i){let n=$n(t,e,Vn(t));if(n)return Qn(e,n)}else for(let n of i)Qn(n,$n(e,n,t)??[0,Bn(n)-1]),Rn(n)||Jn.set(n,Yn(n))},g=Ln(e).padding,_=g,v;Un.set(e,t=>{let n=Ln(e).padding!==_;if(!t&&(v||n))return;n?(g=Ln(e).padding,_=g,Wn.delete(e)):v&&Wn.set(e,v),v=void 0;let r=Wn.get(e)??[0,0],a=Kn(e)?i()?.vertical:void 0,o=[0,0];if(a!==void 0&&d){let t=[...d].filter(e=>Kn(e)&&Gn(e)===a),n=qn(e,a);if(n&&t.some(Rn)){let e=t.map(e=>qn(e,a));o=n.map((t,n)=>Math.max(0,...e.map(e=>e?e[n]-t:0)))}}if(o.every((e,t)=>Math.abs(e-r[t])<.5))return;v=o;let s=Ve(g),[c,l]=a?[`top`,`bottom`]:[`left`,`right`];_=o.some(Boolean)?{...s,[c]:s[c]+o[0],[l]:s[l]+o[1]}:g,e.update({padding:_})});let y,b=()=>{y?.[0].remove(),y=void 0},x=()=>{let t=r(),a=i();if(!c()||!t||!a){b();return}if(!y){let e=e=>{let t=n.createElementNS(Pn,`rect`);return t.setAttribute(`class`,e),t},t=n.createElementNS(Pn,`g`);t.setAttribute(`class`,`tc-brush`),y=[t,e(`tc-brush-selection`),e(`tc-brush-handle`),e(`tc-brush-handle`)],t.append(y[1],y[2],y[3])}y[0].parentNode!==t&&t.append(y[0]);let[o,s]=Vn(e),l=a.vertical?a.area.y:a.area.x,u=a.vertical?a.area.height:a.area.width,d=e=>Math.min(l+u,Math.max(l,e)),f=a.at(o)??l,p=a.at(s)??l+u,m=d(Math.min(f,p)-a.step/2),h=d(Math.max(f,p)+a.step/2),g=(e,t,n)=>{let r=a.vertical?{x:a.area.x,y:t,width:a.area.width,height:n}:{x:t,y:a.area.y,width:n,height:a.area.height};for(let[t,n]of Object.entries(r))e.setAttribute(t,`${n}`)};g(y[1],m,h-m);let _=f<=p?[m,h]:[h,m];g(y[2],_[0]-3,6),g(y[3],_[1]-3,6)},S,C,w=!1,T=([t,n])=>e.interaction?.hitTest(t,n)?.index,E=e=>{e.pointerId===C&&(S=void 0,C=void 0,n.removeEventListener(`pointerup`,E),n.removeEventListener(`pointercancel`,E))},D=t=>{if(!c()||S||!o(t)||t.pointerType===`mouse`&&t.button!==0)return;let r=a(t.clientX,t.clientY)?.at,i=r&&T(r);if(!r||i===void 0)return;let s=t.target,l=s===y?.[2]?0:s===y?.[3]?1:s===y?.[1]?`move`:`new`;S={from:r,range:Vn(e),mode:l,index:i},C=t.pointerId,w=!1,n.addEventListener(`pointerup`,E),n.addEventListener(`pointercancel`,E)},O=t=>{let n=i(),o=S&&t.pointerId===C&&a(t.clientX,t.clientY)?.at;if(!S||!o||!n)return;let s=+!!n.vertical;if(!w){if(Math.abs(o[s]-S.from[s])<4)return;w=!0;try{r()?.setPointerCapture(t.pointerId)}catch{}}t.stopPropagation(),e.clearHighlight();let[c,d]=S.range,f=T(o);if(S.mode===`move`){let t=(o[s]-S.from[s])/n.step,r=Math.round(n.reversed?-t:t),i=Math.max(0,Bn(e)-1),a=Math.min(i-d,Math.max(-c,r));u(c+a,d+a)}else if(f===void 0)return;else S.mode===`new`?u(Math.min(S.index,f),Math.max(S.index,f)):S.mode===0?u(Math.min(f,d-l()),d):u(c,Math.max(f,c+l()))},k=e=>{w&&e.stopPropagation(),w=!1},A=t=>{c()&&o(t)&&u(0,Bn(e)-1)},j=t=>{if(t.target!==r()||!c())return;let{key:n}=t,a=n===`ArrowLeft`?-1:+(n===`ArrowRight`),[o,s]=Vn(e);if(n===`0`)u(0,Bn(e)-1);else if(t.shiftKey&&a){let t=i()?.reversed?-a:a,n=Math.max(0,Bn(e)-1),r=Math.min(n-s,Math.max(-o,t));u(o+r,s+r)}else return;t.stopPropagation(),t.preventDefault()};return t.addEventListener(`pointermove`,O,!0),t.addEventListener(`click`,k,!0),t.addEventListener(`keydown`,j,!0),t.addEventListener(`pointerdown`,D),t.addEventListener(`dblclick`,A),{svgAttrs:()=>c()?{"data-zoom-axis":i()?.vertical?`y`:`x`}:void 0,afterRender(){x(),h();for(let t of d??[e])Un.get(t)?.(t===e)},destroy(){t.removeEventListener(`pointermove`,O,!0),t.removeEventListener(`click`,k,!0),t.removeEventListener(`keydown`,j,!0),t.removeEventListener(`pointerdown`,D),t.removeEventListener(`dblclick`,A),n.removeEventListener(`pointerup`,E),n.removeEventListener(`pointercancel`,E),b();let e=d;p();for(let t of e??[])Un.get(t)?.()}}},tr=[[`in`,`Zoom in`,`M12 5v14M5 12h14`],[`out`,`Zoom out`,`M5 12h14`],[`reset`,`Reset zoom`,`M20 11a8.1 8.1 0 0 0-15.5-2M4 5v4h4M4 13a8.1 8.1 0 0 0 15.5 2M20 19v-4h-4`]],nr=e=>{let t=e.element;if(typeof t.addEventListener!=`function`)return{};let n=t.ownerDocument,r=()=>e.config,i=()=>Nn.has(e.config.type.name)&&!!r().zoom&&!r().brush,a=()=>{let{zoom:e}=r();return typeof e==`object`?e:{}},o=()=>An(r().data),s=()=>jn(r().view,o()),c=()=>Math.max(0,Math.min(o(),Math.round(J(a().min)??2))-1),{svg:l,plot:u,locate:d,onPlot:f}=Fn(e),p=[0,0],m=([t,n])=>{let r=e.interaction?.hitTest(t,n);return r?p[0]+r.index:void 0},h,g=()=>{let[e,t]=s();return(h?.start!==e||h.end!==t)&&(h={a:e,b:t,start:e,end:t}),[h.a,h.b]},_=(t,n)=>{let r=Math.max(0,o()-1),i=Math.min(r,Math.max(c(),n-t));t+=(n-t-i)/2,t=Math.min(r-i,Math.max(0,t)),n=t+i;let a=Math.round(t),l=Math.round(n);l-a<c()&&(l=Math.min(r,a+c()),a=l-c());let[u,d]=s();return h={a:t,b:n,start:a,end:l},a===u&&l===d?!1:(e.update({view:a===0&&l===r?void 0:{start:a,end:l}}),!0)},v=(t,n)=>{let[r,i]=g(),a=e.active,o=n??(a?p[0]+a.index:(r+i)/2);return _(o-(o-r)/t,o+(i-o)/t)},y=e=>{let[t,n]=g(),r=Math.max(0,o()-1),i=Math.min(r-n,Math.max(-t,e));return _(t+i,n+i)},b=()=>_(0,o()-1),x=/* @__PURE__ */ new Map,S,C=!1,w,T,E=!t.classList.contains(`tc-container`),D=()=>{w?.remove(),w=void 0},O=(e,t)=>{let r=l(),i=u();if(!r||!i)return;w||(w=n.createElementNS(Pn,`rect`),w.setAttribute(`class`,`tc-zoom-selection`)),w.parentNode!==r&&r.append(w);let a=+!!i.vertical,o=Math.min(e[a],t[a]),s=Math.abs(e[a]-t[a]),c=i.vertical?{x:i.area.x,y:o,width:i.area.width,height:s}:{x:o,y:i.area.y,width:s,height:i.area.height};for(let[e,t]of Object.entries(c))w.setAttribute(e,`${t}`)},k=e=>{let t=x.get(e.pointerId);if(x.delete(e.pointerId),S&&!S.pan&&C&&t&&e.type===`pointerup`){let e=m(S.from),n=m(t);e!==void 0&&n!==void 0&&e!==n&&_(Math.min(e,n),Math.max(e,n))}x.size===0&&(S=void 0,D(),n.removeEventListener(`pointerup`,k),n.removeEventListener(`pointercancel`,k))},A=e=>{if(!i()||!f(e)||e.pointerType===`mouse`&&e.button!==0)return;let t=d(e.clientX,e.clientY)?.at;t&&(x.size===0?(C=!1,S={from:t,range:p,pan:e.shiftKey}):(S=void 0,D()),x.set(e.pointerId,t),n.addEventListener(`pointerup`,k),n.addEventListener(`pointercancel`,k))},j=t=>{let n=x.get(t.pointerId),r=d(t.clientX,t.clientY)?.at,i=u();if(!n||!r||!i)return;let a=+!!i.vertical;if(!C){if(x.size===1&&Math.abs(r[a]-n[a])<4)return;C=!0;try{l()?.setPointerCapture(t.pointerId)}catch{}}if(t.stopPropagation(),e.clearHighlight(),x.set(t.pointerId,r),x.size>1){let e=[...x].find(([e])=>e!==t.pointerId)?.[1];if(!e)return;let i=Math.abs(n[a]-e[a]),o=Math.abs(r[a]-e[a]);i>0&&o>0&&v(o/i,m([(r[0]+e[0])/2,(r[1]+e[1])/2]))}else if(S?.pan){let[e,t]=S.range,n=(r[a]-S.from[a])/i.step,s=Math.round(i.reversed?n:-n),c=Math.max(0,o()-1),l=Math.min(c-t,Math.max(-e,s));_(e+l,t+l)}else S&&O(S.from,r)},M=e=>{if(!i()||a().wheel===!1||!f(e))return;let t=u(),n=d(e.clientX,e.clientY)?.at;if(!t||!n)return;let[r,o]=g(),s=e.shiftKey||Math.abs(e.deltaX)>Math.abs(e.deltaY),c=s&&e.deltaX||e.deltaY,l=s?y((t.reversed?-c:c)/t.step):v(Math.exp(-c*(e.ctrlKey?.01:.002)),m(n)),p=h&&(h.a!==r||h.b!==o);(l||p)&&e.preventDefault()},N=e=>{i()&&f(e)&&b()},P=e=>{C&&e.stopPropagation(),C=!1},F=e=>{if(e.target!==l()||!i())return;let{key:t}=e,n=t===`ArrowLeft`?-1:+(t===`ArrowRight`);if(t===`+`||t===`=`)v(2);else if(t===`-`)v(1/2);else if(t===`0`)b();else if(e.shiftKey&&n)y(u()?.reversed?-n:n);else return;e.stopPropagation(),e.preventDefault()},I=e=>{let t=e.target.closest(`button`)?.value;t===`reset`?b():t&&v(t===`in`?2:1/2)};t.addEventListener(`pointermove`,j,!0),t.addEventListener(`click`,P,!0),t.addEventListener(`keydown`,F,!0),t.addEventListener(`pointerdown`,A),t.addEventListener(`wheel`,M,{passive:!1}),t.addEventListener(`dblclick`,N);let L=()=>{if(!i()||a().controls===!1){T?.remove(),T=void 0;return}if(!T){T=n.createElement(`div`),T.className=`tc-zoom`;for(let[e,,t]of tr){let r=n.createElement(`button`);r.type=`button`,r.className=`tc-download-toggle`,r.value=e;let i=n.createElementNS(Pn,`svg`);i.setAttribute(`viewBox`,`0 0 24 24`),i.setAttribute(`width`,`16`),i.setAttribute(`height`,`16`),i.setAttribute(`aria-hidden`,`true`);let a=n.createElementNS(Pn,`path`);a.setAttribute(`d`,t),i.append(a),r.append(i),T.append(r)}T.addEventListener(`click`,I),t.classList.add(`tc-container`)}T.isConnected||t.append(T),T.dir=e.rtl?`rtl`:``;let[r,l]=s(),u=r===0&&l>=o()-1,d={in:l-r<=c(),out:u,reset:u},f=a().labels;for(let[e,t]of[...T.querySelectorAll(`button`)].entries()){let[n,r]=tr[e];t.setAttribute(`aria-label`,f?.[n]??r),t.disabled=d[n]}};return{svgAttrs:()=>i()?{"data-zoom-axis":u()?.vertical?`y`:`x`}:void 0,afterRender(){i()&&(p=s()),w&&l()?.append(w),L()},destroy(){t.removeEventListener(`pointermove`,j,!0),t.removeEventListener(`click`,P,!0),t.removeEventListener(`keydown`,F,!0),t.removeEventListener(`pointerdown`,A),t.removeEventListener(`wheel`,M),t.removeEventListener(`dblclick`,N),n.removeEventListener(`pointerup`,k),n.removeEventListener(`pointercancel`,k),D(),T?.remove(),T&&E&&t.classList.remove(`tc-container`)}}};n({zoom:{window:Mn,install:e=>{let t=[nr(e),er(e)];return{svgAttrs:e=>t[0]?.svgAttrs?.(e)??t[1]?.svgAttrs?.(e),afterRender(e){for(let n of t)n.afterRender?.(e)},destroy(){for(let e of t)e.destroy?.()}}}}});function rr(e,t){if(e.time){let n=e.time(new Date(pn(t)));return Number.isFinite(n)?[n,n]:void 0}let n=e.keys.indexOf(Z(t));return n<0?void 0:[e.band.at(n),e.band.at(n)+e.band.bandwidth]}let ir=(e,t)=>{if(!Array.isArray(e))return t(e);let n=e.map(t);return n.length===2&&!n.includes(null)?n:null},ar=e=>e===void 0?e:Xt(e,e=>({...e,y:e.y===void 0?e.y:ir(e.y,J),x:e.x===void 0?e.x:ir(e.x,Jt),label:e.label==null?void 0:qt(e.label),color:typeof e.color==`string`?e.color:void 0})).filter(e=>e.y!==null&&e.x!==null&&(e.x??e.y)!==void 0),or=e=>Array.isArray(e);function sr(e){let t=[];for(let n of ar(e)??[])if(n.y!==void 0)for(let e of or(n.y)?n.y:[n.y])Number.isFinite(e)&&t.push(e);return t}function cr(e,t){if(e=ar(e),!e?.length)return{under:null,over:null};let{area:n,horizontal:r,fontSize:i}=t,a=[],o=[],s=n.x,c=n.x+n.width,u=n.y,d=n.y+n.height,f=(e,t,n)=>e>=t-.5&&e<=n+.5,p=e=>{let n,i;if(e.y!==void 0){let[a,o]=or(e.y)?e.y:[e.y,e.y];if(!Number.isFinite(a)||!Number.isFinite(o))return;n=[t.value(a),t.value(o)],i=r}else if(e.x!==void 0){let[a,o]=or(e.x)?e.x:[e.x,e.x],s=rr(t,a),c=rr(t,o);if(!s||!c)return;n=or(e.x)?[Math.min(s[0],c[0]),Math.max(s[1],c[1])]:[(s[0]+s[1])/2,(s[0]+s[1])/2],i=!r}else return;let a=Math.min(n[0],n[1]),o=Math.max(n[0],n[1]),[l,p]=i?[s,c]:[u,d];if(f(a,l,p)||f(o,l,p)||a<l&&o>p)return{a0:Math.max(a,l),a1:Math.min(o,p),vertical:i}},m=e=>{if(e.x===void 0||e.y===void 0||or(e.x)||or(e.y))return;let n=rr(t,e.x),i=t.value(e.y);if(!n||!Number.isFinite(i))return;let a=(n[0]+n[1])/2,[o,l]=r?[i,a]:[a,i];return f(o,s,c)&&f(l,u,d)?[o,l]:void 0},h=e=>e.x!==void 0&&e.y!==void 0&&!or(e.x)&&!or(e.y),g=e.map(m),_=e.map(e=>h(e)?void 0:p(e)),v=[],y=[];_.forEach((e,t)=>{if(!e||e.a1-e.a0>.5)return;let n=e.a0;y.push([t,e.vertical?[n-1.5,u,n+1.5,d]:[s,n-1.5,c,n+1.5]])}),g.forEach((e,t)=>{e&&y.push([t,[e[0]-4,e[1]-4,e[0]+4,e[1]+4]])});let b=(e,[t,n,r,i])=>e[2]<=t||e[0]>=r||e[3]<=n||e[1]>=i,x=e=>v.every(t=>b(e,t)),S=(e,t)=>x(e)&&y.every(([n,r])=>n===t||b(e,r));return e.forEach((e,t)=>{let n=e.id??t,r=t=>({key:t?`${n}-${t}`:n,class:[`tc-annotation`,h(e)?`tc-annotation-point`:e.y===void 0?`tc-annotation-x`:`tc-annotation-y`,e.class],style:{"--tc-annotation-color":e.color,"--tc-annotation-dash":Number.isFinite(e.dash)?`${e.dash}px`:e.dash}}),f=(t,n)=>{let r=i*.92,a=l(`text`,{class:`tc-annotation-label`,x:U(t[0]),y:U(t[1])},e.label);return e.labelBackground?[l(`rect`,{class:`tc-annotation-label-bg`,x:U(t[0]-3),y:U(t[1]-r),width:U(n+6),height:U(r*1.35),rx:2}),a]:[a]},p=e.position!==`start`,m=g[t];if(m){let[n,a]=m,u;if(e.label){let r=H(e.label,i*.92),o=a+i*.35,l=[[n+8,o],[n-8-r,o],[n-r/2,a-8],[n-r/2,a+8+i*.8],[n+8,a+8+i*.8],[n+8,a-8],[n-8-r,a+8+i*.8],[n-8-r,a-8]],d=([e,t])=>[e,t-i,e+r,t+i*.25],p=e=>e[0]>=s&&e[0]+r<=c,m=l.find(e=>p(e)&&S(d(e),t))??l.find(e=>p(e)&&x(d(e)));m&&(v.push(d(m)),u=f(m,r))}o.push(l(`g`,r(),l(`circle`,{class:`tc-annotation-dot`,cx:U(n),cy:U(a),r:4}),u));return}let y=_[t];if(!y)return;let{a0:b,a1:C,vertical:w}=y,T;if(e.label){let n=H(e.label,i*.92),r=C-b<=.5,a=[];if(w){let e=b+4,t=r?b-4-n:Math.max(s,C-4-n),o=e+n<=c?[e,t]:[t,e],l=p?u+i:d-4,f=(p?1:-1)*i*1.2;for(let e of o)if(!(e<s||e+n>c))for(let t=0;t<3;t++)a.push([e,l+t*f]);a.length||a.push([Math.max(s+4,o[0]),l])}else{let e=p?c-4-n:s+4,t=p?s+4:c-4-n;for(let n of[e,t])r?a.push([n,b-4],[n,b+i]):a.push([n,b+i],[n,C-4])}let o=([e,t])=>[e,t-i,e+n,t+i*.25],l=a.find(e=>S(o(e),t))??a.find(e=>x(o(e)))??a[0];v.push(o(l)),T=f(l,n)}if(C-b>.5){let e=w?`M${U(b)},${U(u)}H${U(C)}V${U(d)}H${U(b)}Z`:`M${U(s)},${U(b)}H${U(c)}V${U(C)}H${U(s)}Z`;a.push(l(`g`,r(),l(`path`,{class:`tc-annotation-band`,d:e}))),T&&o.push(l(`g`,r(`label`),T));return}let E=U(b);o.push(l(`g`,r(),l(`line`,w?{class:`tc-annotation-line`,x1:E,x2:E,y1:U(u),y2:U(d)}:{class:`tc-annotation-line`,x1:U(s),x2:U(c),y1:E,y2:E}),T))}),{under:a.length?l(`g`,{key:`annotations-under`,class:`tc-annotations`,"aria-hidden":`true`},a):null,over:o.length?l(`g`,{key:`annotations-over`,class:`tc-annotations`,"aria-hidden":`true`},o):null}}function lr(e,t,n){let r=e[0],i=e[e.length-1],a=r!==void 0&&i!==void 0?Math.abs(pn(i)-pn(r)):0,o=wt({year:`numeric`,month:`short`,day:`numeric`,...a>0&&a<2592e5?{hour:`numeric`,minute:`2-digit`}:{},...t?{timeZone:`UTC`}:{}},n);return e=>Number.isFinite(pn(e))?o(pn(e)):String(e)}function ur(e,t){let n=typeof e.endLabels==`object`?e.endLabels:{},r=on(e);return e.data.series.flatMap((e,i)=>{let{axis:a}=r(e),o=e.values.filter(e=>un(e,a)).pop();if(o==null||t.hidden.has(Q(e)))return[];let s=n.format?K(n.format,t.locale):bt(a.format,t.locale);return{index:i,key:Q(e),name:e.name,value:n.value===!1?``:s(o),color:e.color}})}let dr=(e,t)=>{let n=e.value?6+H(e.value,t)*1.06:0;return H(e.name,t)+n},fr=(e,t)=>e.length?Math.ceil(14+Math.max(...e.map(e=>dr(e,t)))):0;function pr(e,t,n,r,i){let a=Math.ceil(r*W),o=e.flatMap(e=>e.point?{...e,point:e.point,y:e.point[1]}:[]).sort((e,t)=>e.point[1]-t.point[1]);if(!o.length)return null;let s=t.y;for(let e of o)e.y=Math.max(e.y,s),s=e.y+a;let c=Math.max(t.y+t.height,(o[0]?.y??0)+(o.length-1)*a);for(let e of o.slice().reverse())e.y=Math.min(e.y,c),c=e.y-a;let u=n?-1:1,d=(n?t.x-i:t.x+t.width+i)+u*14;return l(`g`,{key:`end-labels`,class:`tc-end-labels`,"aria-hidden":`true`},o.map(e=>{let[t,r]=e.point,a=Math.abs(e.y-r)>1;return l(`g`,{key:e.key,class:[`tc-end-label`,`tc-series`,`tc-series-${e.index+1}`],style:{"--tc-series-color":e.color}},a&&l(`path`,{class:`tc-end-label-line`,d:`M${U(t+u*(i+2))},${U(r)}L${U(d-u*3)},${U(e.y)}`}),l(`text`,{class:`tc-end-label-text`,style:`transform:translate(${U(d)}px,${U(e.y)}px)`,"text-anchor":n?`end`:`start`,dy:`0.35em`},n?[e.value&&l(`tspan`,{class:`tc-end-label-value`},e.value),l(`tspan`,{dx:e.value?6:void 0},e.name)]:[e.name,e.value&&l(`tspan`,{class:`tc-end-label-value`,dx:6},e.value)]))}))}function mr(e,t,n){let r=ur(e,t),i=e.x?.reverse??t.rtl===!0,a=i?`left`:`right`,o=Ve(e.padding);return{options:{...e,padding:{...o,[a]:o[a]+fr(r,t.fontSize)}},layer:(e,a)=>pr(r.map(t=>({...t,point:(e[t.index]??[]).filter(e=>e!=null).pop()??null})),a,i,t.fontSize,n)}}function hr(e,t,n={}){let r=n.base&&n.base>1?n.base:10,i=n.clamp===!0,a=e[0]<0||e[1]<0?-1:1,o=e=>Math.max(Number.MIN_VALUE,e*a),s=Math.log(r),c=r===10?Math.log10:r===2?Math.log2:e=>Math.log(e)/s,l=e=>c(o(e)),u=e=>a*r**e,d=l(e[0]),f=l(e[1]),[p,m]=t,h=f-d,g=h===0?0:(m-p)/h,_=Math.min(p,m),v=Math.max(p,m);return Object.assign(e=>{if(h===0)return(p+m)/2;let t=p+(l(e)-d)*g;return i?Math.min(v,Math.max(_,t)):t},{domain:[e[0],e[1]],range:[p,m],invert(t){return h===0||m===p?e[0]:u(d+(t-p)/g)},ticks(e=5){let t=Math.min(d,f),n=Math.max(d,f);if(!Number.isFinite(t)||!Number.isFinite(n))return[];let i=Math.floor(t),o=Math.ceil(n),s=o-i,c=e=>{let r=l(e);return r>=t-1e-9&&r<=n+1e-9},u=[];if(s<=e&&Number.isInteger(r)){let t=e=>{let t=[];for(let n=i;n<=o;n++)for(let i=1;i<r;i++){let o=a*i*r**n;e(i)&&c(o)&&t.push(o)}return t};u=t(()=>!0),u.length>e*2&&(u=t(e=>e===1||e===2||e===5)),u.length>e*2&&(u=t(e=>e===1))}else{let i=Math.max(1,Math.ceil(s/Math.max(1,e)));for(let e=Math.ceil(t/i)*i;e<=n+1e-9;e+=i){let t=a*r**e;c(t)&&u.push(t)}}return f<d?u.reverse():u},nice(){let e=u(Math.floor(Math.min(d,f))),r=u(Math.ceil(Math.max(d,f)));return hr(f<d?[r,e]:[e,r],t,n)}})}function gr(e,t){let[n,r]=Ut(e.filter(e=>e!=null&&e>0&&Number.isFinite(e)))??[1,10],i=J(t.min),a=J(t.max);if(i!==null&&i>0&&(n=i),a!==null&&a>0&&(r=a),n===r&&(r=n*10),t.nice!==!1){let e=hr([n,r],[0,1]).nice().domain;i===null&&(n=e[0]),a===null&&(r=e[1])}return[n,r]}function _r(e,t,n,r){let i=K(n,r);return e.ticks(t).map(t=>({value:t,position:e(t),label:i(t)}))}let vr=[`M-2,2L2,-2M0,8L8,0M6,10L10,6`,`M2,2h.01M6,6h.01`,`M-2,6L2,10M0,0L8,8M6,-2L10,2`,`M0,4H8`,`M0,8L8,0M0,0L8,8`,`M4,0V8`,`M0,4H8M4,0V8`,`M1,2H4M5,6H8`],yr=vr.length,br=e=>e<yr?[`${e+1}`,`tc-series-${e+1}`]:[`other`,``];function xr(e,t){let n=/* @__PURE__ */ new Map;for(let r of e){let[e,i]=br(r.index);n.has(e)||n.set(e,l(`pattern`,{key:e,id:`${t}-pattern-${e}`,class:[`tc-pattern`,`tc-series`,i],width:8,height:8,patternUnits:`userSpaceOnUse`,style:{"--tc-series-color":r.color}},l(`rect`,{class:`tc-pattern-bg`,width:8,height:8}),l(`path`,{class:`tc-pattern-ink`,d:vr[r.index%yr]})))}return[...n.values()]}function Sr(e,t){let n={};for(let r of e){let[e]=br(r.index);n[`--tc-pattern-${e}`]=`url(#${t}-pattern-${e})`}return n}function Cr(e,t){let{items:n}=Oe(e);if(n.length)return[e.patterns===!0?`tc-patterned`:`tc-patterns-auto`,Sr(n,t),l(`defs`,{key:`patterns`},xr(n,t))]}let wr=[[],[-.9,-.9,.9,-.9,.9,.9,-.9,.9],[0,-1.3,1.2,.9,-1.2,.9],[0,-1.3,1.3,0,0,1.3,-1.3,0],[-1.2,-.9,1.2,-.9,0,1.3],[-.4,-1.2,.4,-1.2,.4,-.4,1.2,-.4,1.2,.4,.4,.4,.4,1.2,-.4,1.2,-.4,.4,-1.2,.4,-1.2,-.4,-.4,-.4],[-.7,-1.2,0,-.5,.7,-1.2,1.2,-.7,.5,0,1.2,.7,.7,1.2,0,.5,-.7,1.2,-1.2,.7,-.5,0,-1.2,-.7],[0,-1.4,.32,-.44,1.33,-.43,.52,.17,.82,1.13,0,.55,-.82,1.13,-.52,.17,-1.33,-.43,-.32,-.44]];function Tr(e,t,n,r){let i=wr[e]??[];if(!i.length)return`M${U(t-r)},${U(n)}a${r},${r},0,1,0,${2*r},0a${r},${r},0,1,0,${-2*r},0Z`;let a=``;for(let e=0;e<i.length;e+=2)a+=`${e?`L`:`M`}${U(t+i[e]*r)},${U(n+i[e+1]*r)}`;return`${a}Z`}function Er(e){if(!wr[e]?.length)return;let t=Tr(e,50,50,35.7).slice(1,-1).replace(/,/g,`% `).replace(/L/g,`%,`);return{"--tc-shape":e===1?`inset(10% round 1px)`:`polygon(${t}%)`,"--tc-shape-radius":0}}let Dr=` — `,Or=(e,t)=>H(e.name,t)*1.08+(e.value?H(Dr+e.value,t):0),kr=e=>Math.sin(e.angle)>=0;function Ar(e,t,n){let r=Math.ceil(n*W),i=Math.max(1,Math.floor(t.height/r)),a=[!1,!0].map(t=>e.filter(e=>kr(e)===t).sort((e,t)=>t.weight-e.weight).slice(0,i)),o=a.map(e=>e.length?Math.ceil(30+Math.max(...e.map(e=>Or(e,n)))):0),s=12+Math.ceil(r/2),c={x:t.x+o[0],y:t.y+s,width:t.width-o[0]-o[1],height:t.height-s*2};return Math.min(c.width,c.height)/2<32?null:{area:c,layer:(e,n,i)=>l(`g`,{key:`slice-labels`,class:`tc-slice-labels`,"aria-hidden":`true`},a.flatMap((a,o)=>{let s=o?1:-1,c=a.map(e=>({label:e,y:n-Math.cos(e.angle)*(i+12)})).sort((e,t)=>e.y-t.y),u=t.y+r/2;for(let e of c)e.y=Math.max(e.y,u),u=e.y+r;let d=t.y+t.height-r/2;for(let e of c.slice().reverse())e.y=Math.min(e.y,d),d=e.y-r;let f=e+s*(i+12+12);return c.map(({label:t,y:r})=>{let a=Math.sin(t.angle),c=Math.cos(t.angle),u=i-6;return l(`g`,{key:t.key,class:[`tc-slice-label`,`tc-series`,`tc-series-${t.index+1}`]},l(`path`,{class:`tc-slice-label-line`,d:`M${U(e+a*u)},${U(n-c*u)}L${U(e+a*(i+12))},${U(r)}H${U(f)}`}),l(`text`,{class:`tc-slice-label-text`,style:`transform:translate(${U(f+s*6)}px,${U(r)}px)`,"text-anchor":o?`start`:`end`,dy:`0.35em`},l(`tspan`,{class:`tc-slice-label-name`},t.name),t.value&&Dr+t.value))})}))}}let jr=1e3,Mr=60*jr,Nr=60*Mr,Pr=24*Nr,Fr=30*Pr,Ir=365*Pr,Lr=[{unit:`second`,step:1,ms:jr},{unit:`second`,step:5,ms:5*jr},{unit:`second`,step:15,ms:15*jr},{unit:`second`,step:30,ms:30*jr},{unit:`minute`,step:1,ms:Mr},{unit:`minute`,step:5,ms:5*Mr},{unit:`minute`,step:15,ms:15*Mr},{unit:`minute`,step:30,ms:30*Mr},{unit:`hour`,step:1,ms:Nr},{unit:`hour`,step:3,ms:3*Nr},{unit:`hour`,step:6,ms:6*Nr},{unit:`hour`,step:12,ms:12*Nr},{unit:`day`,step:1,ms:Pr},{unit:`day`,step:2,ms:2*Pr},{unit:`week`,step:1,ms:6048e5},{unit:`month`,step:1,ms:Fr},{unit:`month`,step:3,ms:3*Fr},{unit:`year`,step:1,ms:Ir}];function Rr(e){let t=(t,n)=>{switch(n){case`year`:return e?t.getUTCFullYear():t.getFullYear();case`month`:return e?t.getUTCMonth():t.getMonth();case`day`:case`week`:return e?t.getUTCDate():t.getDate();case`hour`:return e?t.getUTCHours():t.getHours();case`minute`:return e?t.getUTCMinutes():t.getMinutes();default:return e?t.getUTCSeconds():t.getSeconds()}},n=(t,n,r,i=0,a=0,o=0)=>e?new Date(Date.UTC(t,n,r,i,a,o)):new Date(t,n,r,i,a,o),r=t=>e?t.getUTCDay():t.getDay();return{floor:(e,{unit:i,step:a})=>{let o=t(e,`year`),s=t(e,`month`),c=t(e,`day`);switch(i){case`year`:return n(Math.floor(o/a)*a,0,1);case`month`:return n(o,Math.floor(s/a)*a,1);case`week`:return n(o,s,c-(r(e)+6)%7);case`day`:return n(o,s,Math.floor((c-1)/a)*a+1);case`hour`:return n(o,s,c,Math.floor(t(e,`hour`)/a)*a);case`minute`:return n(o,s,c,t(e,`hour`),Math.floor(t(e,`minute`)/a)*a);default:return n(o,s,c,t(e,`hour`),t(e,`minute`),Math.floor(t(e,`second`)/a)*a)}},next:(e,{unit:r,step:i})=>{let a=t(e,`year`),o=t(e,`month`),s=t(e,`day`);switch(r){case`year`:return n(a+i,0,1);case`month`:return n(a,o+i,1);case`week`:return n(a,o,s+7*i);case`day`:{let e=n(a,o,s+i);return t(e,`month`)===o?e:n(a,o+1,1)}case`hour`:return n(a,o,s,t(e,`hour`)+i);case`minute`:return n(a,o,s,t(e,`hour`),t(e,`minute`)+i);default:return n(a,o,s,t(e,`hour`),t(e,`minute`),t(e,`second`)+i)}},boundary:(e,n)=>{switch(n){case`second`:return t(e,`second`)===0;case`minute`:return t(e,`minute`)===0&&t(e,`second`)===0;case`hour`:return t(e,`hour`)===0&&t(e,`minute`)===0;case`day`:case`week`:return t(e,`day`)===1;case`month`:return t(e,`month`)===0;default:return!1}}}}function zr(e,t){let n=Math.abs(e)/Math.max(1,t),r=0;for(;r<Lr.length&&Lr[r].ms<n;)r++;if(r===Lr.length){let e=Math.max(1,jt(0,n/Ir,1));return{unit:`year`,step:e,ms:e*Ir}}if(r===0)return Lr[0];let i=Lr[r-1],a=Lr[r];return n/i.ms<a.ms/n?i:a}let Br=e=>e instanceof Date?e.getTime():e,Vr={second:[{hour:`numeric`,minute:`2-digit`,second:`2-digit`},{hour:`numeric`,minute:`2-digit`}],minute:[{hour:`numeric`,minute:`2-digit`},{hour:`numeric`,minute:`2-digit`}],hour:[{hour:`numeric`,minute:`2-digit`},{month:`short`,day:`numeric`}],day:[{month:`short`,day:`numeric`},null],week:[{month:`short`,day:`numeric`},null],month:[{month:`short`},{year:`numeric`}],year:[{year:`numeric`},null]};function Hr(e,t,n={}){let r=n.utc===!0,i=Br(e[0]),a=Br(e[1]),[o,s]=t,c=a-i,l=c===0?0:(s-o)/c,u=Rr(r),d=n.clamp===!0,f=Math.min(o,s),p=Math.max(o,s),m=e=>{if(c===0)return(o+s)/2;let t=o+(Br(e)-i)*l;return d?Math.min(p,Math.max(f,t)):t},h=(e=5)=>zr(c,e);return Object.assign(m,{domain:[i,a],range:[o,s],utc:r,invert(e){return new Date(c===0||s===o?i:i+(e-o)/l)},ticks(e=5){if(!Number.isFinite(i)||!Number.isFinite(a))return[];let t=Math.min(i,a),n=Math.max(i,a);if(t===n)return[new Date(t)];let r=h(e),o=[],s=u.floor(new Date(t),r);for(s.getTime()<t&&(s=u.next(s,r));s.getTime()<=n&&o.length<1e3;)o.push(s),s=u.next(s,r);return a<i?o.reverse():o},tickFormat(e=5,t){let{unit:n}=h(e),[i,a]=Vr[n],o=r?{timeZone:`UTC`}:{},s=mt(t,{...i,...o}),c=a?mt(t,{...a,...o}):null;return e=>(c&&u.boundary(e,n)?c:s).format(e)},nice(r=5){if(c===0||!Number.isFinite(c))return Hr(e,t,n);let o=h(r),s=u.floor(new Date(Math.min(i,a)),o),l=u.floor(new Date(Math.max(i,a)),o);return l.getTime()<Math.max(i,a)&&(l=u.next(l,o)),Hr(a<i?[l,s]:[s,l],t,n)}})}function Ur(e,t,n,r){let[i,a]=Ut(e)??[0,1],o=e.filter(e=>Number.isFinite(e)),s=Hr([i,a],n,{utc:r}),c=e.map(e=>s(e));return{scale:Object.assign(e=>c[t.indexOf(e)],{domain:t.slice(),range:n,bandwidth:0,step:o.length>1?(n[1]-n[0])/(o.length-1):0,at:e=>c[e]??n[0],center:e=>c[t.indexOf(e)],indexAt(e){if(c.length===0)return-1;let t=n[1]<n[0],r=0,i=c.length-1;for(;r<i;){let n=r+i>>1;c[n]<e===t?i=n:r=n+1}let a=r-1;return a>=0&&Math.abs(e-c[a])<Math.abs(c[r]-e)?a:r}}),time:s}}function Wr(e,t,n,r,i){let a=e.map(pn),o=e=>Ur(a,t,e,n.utc===!0),s=o([0,1]).time,{format:c}=n,l=c?e=>c(e,-1):s.tickFormat(r,i),u=s;return{edges:s.ticks(r).map(l),scale(e){let t=o(e);return u=t.time,t.scale},ticks:()=>u.ticks(r).map(e=>({value:e.getTime(),position:u(e),label:l(e)})),get time(){return u}}}let Gr=(e,t)=>e.x<t.x+t.width&&t.x<e.x+e.width&&e.y<t.y+t.height&&t.y<e.y+e.height,Kr=(e,t)=>t.x>=e.x-1&&t.y>=e.y-1&&t.x+t.width<=e.x+e.width+1&&t.y+t.height<=e.y+e.height+1,qr=e=>{let t=e.data?.series;return Array.isArray(t)?t.map(e=>e?.valueLabels):[]},Jr=e=>!!e.valueLabels||qr(e).includes(!0);function Yr(e,t,n){let r=e.valueLabels,i=typeof r==`object`?r:{},{fontSize:a,locale:o}=n,s=e.type.valueLabels,c=s?.marks===`slice`,u=s?.marks===`cell`,d=!!e.stacked,f=i.format?K(i.format,o):c?e=>G(o,{style:`percent`,maximumFractionDigits:1}).format(e):s?.format?K(s.format(e),o):void 0,p=a,m=qr(e),h=e=>{let t=m[e];return typeof t==`boolean`?t:!!r},g=[],_=[],v=/* @__PURE__ */ new Map,y=0;for(let e=0;e<t.count;e++){let n=t.hitIndex(e);for(let t of n?.items??[])t.value!==null&&t.y!==null&&n&&(y+=Math.abs(t.value),t.box&&_.push(t.box),h(t.seriesIndex)&&(!c&&!t.box&&i.points!==`all`&&v.set(t.seriesIndex,g.length),g.push([`${e}-${t.seriesIndex}`,t,n])))}let b=[];return g.forEach(([e,t,r],o)=>{let{area:s}=r;if(!c&&!t.box&&i.points!==`all`&&v.get(t.seriesIndex)!==o)return;let l=t.value,m=l/(y||1),h=f?f(c?m:l):t.text,g=H(h,a),x=(n,r,i)=>(!t.box&&!c&&(n=Math.max(s.x+g/2+2,Math.min(n,s.x+s.width-g/2-2))),{key:e,series:t.seriesIndex,text:h,x:n,y:r,inside:i,box:{x:n-g/2-2,y:r-p/2,width:g+4,height:p}}),S=t.y,C=[],{box:w}=t;if(c)C.push(x(t.x,S,!0));else if(w){let e=r.axis===`y`,i=l<0;if(!d&&!u){let r=(e?g/2:p/2)+4,a=i?1:-1,o=S+a*r,s=n.rtl?-a:a;C.push(e?x(t.x-s*r,S,!1):x(t.x,o,!1),...e?[]:[x(w.x+g/2-3,o,!1),x(w.x+w.width-g/2+3,o,!1)],e?x(t.x+s*r,S,!0):x(t.x,S-a*r,!0))}else C.push(x(w.x+w.width/2,w.y+w.height/2,!0))}else{let e=g/2+4+4;C.push(x(t.x,S-p/2-4-2,!1),x(t.x,S+p/2+4+2,!1),x(t.x-e,S,!1),x(t.x+e,S,!1))}let T={...s,y:0,height:s.y+s.height},E=e=>({...e.box,x:e.box.x+5,width:e.box.width-10}),D=(e,n=!1)=>Kr(c?s:T,e.box)&&(!e.inside||!w||Kr(w,e.box))&&(!c||Xr(t,s,m,e.box))&&!b.some(t=>Gr(t.box,e.box))&&(n||!_.some(t=>t!==w&&Gr(t,E(e)))),O=C.find(e=>D(e))??(i.overMarks&&!w&&!c?C.find(e=>D(e,!0)):void 0);O&&b.push(O)}),b.length?l(`g`,{key:`value-labels`,class:`tc-value-labels`,"aria-hidden":`true`},b.map(e=>l(`text`,{key:e.key,class:[`tc-value-label`,`tc-series`,`tc-series-${e.series+1}`,e.inside&&`tc-value-label-inside`],style:`transform:translate(${U(e.x)}px,${U(e.y)}px)`,"text-anchor":`middle`,dy:`0.35em`},e.text))):null}function Xr(e,t,n,r){let i=t.width/2,a=Math.hypot(e.x-t.x-i,e.y-t.y-i),o=2*(i-a);return r.width<=n*2*Math.PI*a&&r.height<=o}let Zr=(e,t,n,r)=>n&&Jr(e)?[t,Yr(e,n,r)]:t;function Qr(e,t,n){return e.nodeType===1&&e.localName===t.tag&&e.namespaceURI===n}function $r(e,t){let n={};for(let t of e.getAttributeNames())n[t]=e.getAttribute(t);n.style&&=``,M(e,n,t.attrs);let r=t.children.some(e=>typeof e==`string`);for(let t of Array.from(e.childNodes))(t.nodeType===8||!r&&t.nodeType===3)&&e.removeChild(t);let i=T(e),a=e.firstChild;for(let n of t.children){let t=a?a.nextSibling:null;if(typeof n==`string`?a?.nodeType===3:a&&Qr(a,n,n.tag===`svg`?`http://www.w3.org/2000/svg`:i))typeof n==`string`?(a.data!==n&&(a.data=n),x.set(a,n)):$r(a,n),a=t;else{let t=E(n,i,e.ownerDocument);t&&e.insertBefore(t,a)}}for(;a;){let t=a;a=a.nextSibling,e.removeChild(t)}x.set(e,t)}function ei(e,t,n){return x.has(e)||!Qr(e,t,n)?!1:($r(e,t),!0)}let ti=/* @__PURE__ */ new WeakMap;function ni(e){let t=ti.get(e);return t&&cancelAnimationFrame(t.frame),ti.delete(e),t?.now}function ri(e,t,n,r,i,a){let o={frame:0,now:t.slice()},s=performance.now(),c=l=>{let u=Math.min(1,Math.max(0,(l-s)/r)),d=1-(1-u)**3;o.now=n.map((e,n)=>t[n]+(e-t[n])*d),e.setAttribute(`d`,u<1?i(o.now):a),u<1?o.frame=requestAnimationFrame(c):ti.delete(e)};ti.set(e,o),o.frame=requestAnimationFrame(c)}let ii=/-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi,ai;function oi(e,t,n){ai??=typeof CSS>`u`||CSS.supports(`d`,`path("M0 0")`);let r=ni(e);if(ai||e.closest(`.tc-static,[data-resizing]`))return!1;let i=getComputedStyle(e),a=i.transitionProperty.split(`, `).findIndex(e=>e===`d`||e===`all`),o=a<0?0:Number.parseFloat(i.transitionDuration.split(`, `)[a]??``)*1e3,s=n.split(ii),c=n.match(ii)?.map(Number)??[],l=t.match(ii)?.map(Number)??[];return!(o>0)||l.length!==c.length||t.split(ii).join()!==s.join()?!1:(ri(e,r?.length===c.length?r:l,c,o,e=>e.reduce((e,t,n)=>e+U(t)+s[n+1],s[0]),n),!0)}function si(e,t){let n=e.length;if(!(t>=3)||n<=t)return e.map((e,t)=>t);let r=[],i=-1;for(let t=0;t<n;t++){let n=e[t]!=null;n&&i===-1&&(i=t),!n&&i!==-1&&(r.push([i,t]),i=-1)}i!==-1&&r.push([i,n]);let a=r.reduce((e,[t,n])=>e+(n-t),0),o=[],s=0;for(let[n,i]of r)n>s&&o.push(s),ci(e,n,i,Math.max(2,Math.round(t*(i-n)/a)),o),s=i;return s<n&&o.push(s),o}function ci(e,t,n,r,i){let a=n-t;if(a<=r){for(let e=t;e<n;e++)i.push(e);return}let o=t=>e[t],s=(a-2)/(r-2),c=t;i.push(c);for(let e=0;e<r-2;e++){let r=t+1+Math.floor((e+1)*s),a=Math.min(n,t+1+Math.floor((e+2)*s)),l=0,u=0;for(let e=r;e<a;e++)l+=o(e)[0],u+=o(e)[1];let d=Math.max(1,a-r);l/=d,u/=d;let f=t+1+Math.floor(e*s),p=Math.min(n-1,t+1+Math.floor((e+1)*s)),[m,h]=o(c),g=f,_=-1;for(let e=f;e<p;e++){let[t,n]=o(e),r=Math.abs((m-l)*(n-h)-(m-t)*(u-h));r>_&&(_=r,g=e)}i.push(g),c=g}i.push(n-1)}function li(e,t){return si(e,t).map(t=>e[t])}function ui(e){let t=10**Math.max(0,Math.min(12,Math.floor(e))),n=e=>Math.round(e*t)/t||0;return(e,t)=>`${n(e)},${n(t)}`}let di=(e,t)=>t===`monotone`?mi(e):e;function fi(e,t,n,r){let i=t[0];if(!i)return``;let a=(r?`M`:`L`)+e(i[0],i[1]);if(n===`monotone`)return a+_i(e,t);let o=pi[n];if(o!==void 0)return a+hi(e,t,o);let s=a;for(let n=1;n<t.length;n++){let r=t[n];s+=`L${e(r[0],r[1])}`}return s}let pi={step:.5,"step-before":0,"step-after":1};function mi(e){return e.filter((t,n)=>{let r=e[n-1];return!r||t[0]!==r[0]||t[1]!==r[1]})}function hi(e,t,n){let r=``;for(let i=1;i<t.length;i++){let[a,o]=t[i-1],[s,c]=t[i];if(n<=0)r+=`L${e(a,c)}L${e(s,c)}`;else if(n>=1)r+=`L${e(s,o)}L${e(s,c)}`;else{let l=a*(1-n)+s*n;r+=`L${e(l,o)}L${e(l,c)}`,i===t.length-1&&(r+=`L${e(s,c)}`)}}return r}let gi=e=>e<0?-1:1;function _i(e,t){let n=t.length;if(n<2)return``;if(n===2){let n=t[1];return`L${e(n[0],n[1])}`}let r=Array(n);for(let e=1;e<n-1;e++){let[n,i]=t[e-1],[a,o]=t[e],[s,c]=t[e+1],l=a-n,u=s-a,d=(o-i)/(l||(u<0?-0:0)),f=(c-o)/(u||(l<0?-0:0)),p=(d*u+f*l)/(l+u);r[e]=(gi(d)+gi(f))*Math.min(Math.abs(d),Math.abs(f),.5*Math.abs(p))||0}r[0]=vi(t[0],t[1],r[1]),r[n-1]=vi(t[n-2],t[n-1],r[n-2]);let i=``;for(let a=1;a<n;a++){let[n,o]=t[a-1],[s,c]=t[a],l=(s-n)/3;i+=`C${e(n+l,o+l*r[a-1])},${e(s-l,c-l*r[a])},${e(s,c)}`}return i}function vi(e,t,n){let r=t[0]-e[0];return r?3*(t[1]-e[1])/r/2-n/2:n}let yi=e=>e!=null&&Number.isFinite(e[0])&&Number.isFinite(e[1]);function bi(e,t=()=>!0){let n=[],r;for(let i=0;i<e.length;i++)yi(e[i])&&t(i)?(r||(r=[],n.push(r)),r.push(i)):r=void 0;return n}function xi(e,t={}){let{curve:n=`linear`,precision:r=2}=t,i=ui(r),a=``;for(let t of bi(e)){let r=di(t.map(t=>e[t]),n);a+=fi(i,r,n,!0),r.length===1&&(a+=`Z`)}return a}function Si(e,t,n={}){let{curve:r=`linear`,precision:i=2}=n,a=ui(i),o=``,s=e=>typeof t==`number`?t:t[e]??NaN;for(let t of bi(e,e=>Number.isFinite(s(e)))){o+=fi(a,di(t.map(t=>e[t]),r),r,!0);let n=t.map(t=>[e[t][0],s(t)]).reverse(),i=r===`step-before`?`step-after`:r===`step-after`?`step-before`:r;o+=`${fi(a,di(n,i),i,!1)}Z`}return o}let Ci={png:`PNG`,svg:`SVG`,jpeg:`JPEG`,webp:`WebP`,csv:`CSV`},wi=[`png`,`svg`];function Ti(e){return e===!0?{}:Array.isArray(e)?{formats:e}:e}function Ei(){return{name:`download`,install(e){let t=e.element,n=t.ownerDocument,r,i={},a=!t.classList.contains(`tc-container`),s=()=>r?.querySelector(`.tc-download-toggle`),c=()=>r?.querySelector(`.tc-download-menu`),u=()=>Array.from(r?.querySelectorAll(`.tc-download-item`)??[]),d=e=>{let t=c();t&&(t.hidden=!e,s()?.setAttribute(`aria-expanded`,String(e)),e?n.addEventListener(`pointerdown`,p,!0):n.removeEventListener(`pointerdown`,p,!0))},f=()=>c()?.hidden===!1,p=e=>{r?.contains(e.target)||d(!1)},m=t=>{let n=t.target;if(n.closest(`.tc-download-toggle`)){d(!f()),f()&&u()[0]?.focus();return}let r=n.closest(`.tc-download-item`)?.getAttribute(`data-format`);r&&(d(!1),s()?.focus(),o(`export`)(e,{...i,format:r}))},h=e=>{if(e.key===`Escape`&&f()){e.preventDefault(),d(!1),s()?.focus();return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let t=u();t.length&&(e.preventDefault(),f()||d(!0),t[(t.indexOf(n.activeElement)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus())},g=e=>{r?.contains(e.relatedTarget)||d(!1)},_=()=>{r&&(d(!1),C(r,null),r.remove(),r=void 0,a&&t.classList.remove(`tc-container`))};return{afterRender({config:a,changed:s}){let c=a.download;if(!c||typeof document>`u`){_();return}if(!s&&r?.isConnected)return;o(`export`),i=Ti(c);let u=i.formats?.length?i.formats:wi;r||(r=n.createElement(`div`),r.className=`tc-download`,r.addEventListener(`click`,m),r.addEventListener(`keydown`,h),r.addEventListener(`focusout`,g)),C(r,l(`div`,{class:`tc-download-box`},l(`button`,{type:`button`,class:`tc-download-toggle`,"aria-label":i.label??`Download`,"aria-haspopup":`menu`,"aria-expanded":`false`},l(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,"aria-hidden":`true`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},l(`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M7 11l5 5 5-5M12 4v12`}))),l(`div`,{class:`tc-download-menu`,role:`menu`,hidden:``},u.map(e=>l(`button`,{key:e,type:`button`,role:`menuitem`,class:`tc-download-item`,"data-format":e},Ci[e]??e))))),r.dir=e.rtl?`rtl`:``,t.classList.add(`tc-container`),r.isConnected||t.appendChild(r)},destroy:_}}}}function Di(e,t,n){return l(`g`,{key:e,class:[`tc-series`,`tc-series-${e+1}`],style:{"--tc-series-color":t}},n)}function Oi(e,t){let n=e.items.find(t=>t.seriesIndex===e.seriesIndex)??e.items[0];return n&&Di(n.seriesIndex,n.color,l(`path`,{class:`tc-hover-mark`,d:t.d,style:`transform:translate(${U(t.x??0)}px,${U(t.y??0)}px)`}))}function ki(e,t=!0){let{area:n,highlight:r={kind:`crosshair`}}=e,i=(e,n,r,i)=>t&&l(`line`,{class:`tc-crosshair`,x1:U(e),x2:U(r),y1:U(n),y2:U(i)});return l(`g`,{class:`tc-hover`,"aria-hidden":`true`},r.kind===`halo`?r.under&&Oi(e,r):r.kind===`band`?l(`rect`,{class:`tc-hover-band`,x:U(r.x),y:U(r.y),width:U(r.width),height:U(r.height)}):r.kind===`spoke`?i(r.x1,r.y1,r.x2,r.y2):i(e.x,n.y,e.x,n.y+n.height))}function Ai(e,t=4,n,r=!0){let i=e.highlight;return l(`g`,{class:`tc-hover`,"aria-hidden":`true`},i?.kind===`halo`?!i.under&&Oi(e,i):r&&i?.kind!==`band`&&e.items.map(e=>e.y!==null&&Di(e.seriesIndex,e.color,n?l(`path`,{class:`tc-point tc-point-active tc-marker`,d:n(e.seriesIndex,e.x,e.y,t)}):l(`circle`,{class:`tc-point tc-point-active`,cx:U(e.x),cy:U(e.y),r:t}))))}function ji(e,t){let{cursor:n,area:r}=e;if(!n)return;let{position:i,side:a,inside:o}=n,s=r.x+r.width,c=r.y+r.height,u=H(n.text,t)+8,d=Math.round(t*W)+2,f,p;return a===`bottom`?(f=Math.min(Math.max(i-u/2,r.x),s-u),p=o?c-d-2:c+4):(p=Math.min(Math.max(i-d/2,r.y-d/2),c-d/2),f=a===`left`?o?r.x+2:r.x-4-u:o?s-u-2:s+4),l(`g`,{class:`tc-hover tc-crosshair-value`,"aria-hidden":`true`},l(`line`,a===`bottom`?{class:`tc-crosshair`,x1:U(i),x2:U(i),y1:U(r.y),y2:U(c)}:{class:`tc-crosshair`,x1:U(r.x),x2:U(s),y1:U(i),y2:U(i)}),l(`rect`,{class:`tc-crosshair-tag`,x:U(f),y:U(p),width:U(u),height:d,rx:3}),l(`text`,{class:`tc-crosshair-label`,x:U(f+u/2),y:U(p+d/2),dy:`0.32em`,"text-anchor":`middle`},n.text))}let Mi=/* @__PURE__ */ new WeakSet;function Ni(e){let t=e.element;if(Mi.has(e)||typeof t.addEventListener!=`function`)return;Mi.add(e);let n=n=>{let r=t.querySelector(`svg.tc-chart`);if(!r)return;let{width:i,height:a}=e.size;return c(r,n.clientX,n.clientY,i,a)},r=e=>!!e.target?.closest?.(`.tc-download,.tc-map-zoom`),i=t=>{t.pointerType!==`touch`&&e.highlightSource===`pointer`&&e.clearHighlight(t)},a=t=>{if(r(t)){i(t);return}let a=n(t);a&&e.highlightAt(a.x,a.y,t)},o=t=>{if(r(t))return;let i=n(t),a=i?e.hitTest(i.x,i.y):null;a&&e.emit(`click`,{hit:a,event:t})};return t.addEventListener(`pointermove`,a),t.addEventListener(`pointerdown`,a),t.addEventListener(`pointerleave`,i),t.addEventListener(`click`,o),()=>{Mi.delete(e),t.removeEventListener(`pointermove`,a),t.removeEventListener(`pointerdown`,a),t.removeEventListener(`pointerleave`,i),t.removeEventListener(`click`,o)}}function Pi(){return{name:`pointer`,install(e){let t=Ni(e);return t?{destroy:t}:{}}}}function Fi(){return{name:`highlight`,install(e){let t=Ni(e);return{layers:(t,n)=>({under:ki(t,n.crosshair!==!1),over:[Ai(t,4,gn(n),n.activePoints!==!1),_e(n)&&ji(t,e.fontSize)]}),...t?{destroy:t}:{}}}}}function Ii(e,t){let[n=``,...r]=e.columns;return l(`table`,{class:`tc-table`},t&&l(`caption`,null,t),l(`thead`,null,l(`tr`,null,l(`th`,{scope:`col`},n),r.map((e,t)=>l(`th`,{key:t,scope:`col`},e)))),l(`tbody`,null,e.rows.map(([e=``,...t],n)=>l(`tr`,{key:n},l(`th`,{scope:`row`},e),t.map((e,t)=>l(`td`,{key:t},e))))))}function Li(e){let t=(e.seriesIndex===void 0?e.items:e.items.filter(t=>t.seriesIndex===e.seriesIndex)).map(e=>`${e.name} ${e.text}`).join(`, `);return e.title?`${e.title}: ${t}`:t}let Ri=e=>e.keyboard??e.type.keyboard??!0;function zi(){return{name:`keyboard`,install(e){let t=e.element,n,r=()=>(n||(n=t.ownerDocument.createElement(`div`),n.className=`tc-sr-only`,n.setAttribute(`aria-live`,`polite`),n.setAttribute(`aria-atomic`,`true`),t.appendChild(n)),n),i=e=>{r().textContent=e},a=(t,n)=>{let r=e.highlightIndex(t,n);r&&i(Li(r))},o=t=>{let n=e.interaction;if(!n||n.count===0)return!1;n.reversed&&/^Arrow(L|R)/.test(t)&&(t=t===`ArrowLeft`?`ArrowRight`:`ArrowLeft`);let r=n.rows??1;n.rows&&/^Arrow(U|D)/.test(t)&&(t=t===`ArrowUp`?`ArrowLeft`:`ArrowRight`,r=1);let i=e.highlightSource===`index`?e.active:null,o=n.count-1,s=i?.index,c=i?.seriesIndex,l=i?.items.map(e=>e.seriesIndex)??[],u=c===void 0?-1:l.indexOf(c);switch(t){case`ArrowRight`:return a(s===void 0?0:Math.min(o,s+r),c),!0;case`ArrowLeft`:return a(s===void 0?o:Math.max(0,s-r),c),!0;case`Home`:return a(0,c),!0;case`End`:return a(o,c),!0;case`ArrowDown`:case`ArrowUp`:{if(s===void 0||l.length===0)return a(0),!0;let e=t===`ArrowDown`?1:-1,n=u===-1?e>0?0:l.length-1:u+e;return a(s,n<0||n>=l.length?void 0:l[n]),!0}case`Escape`:return i?(e.clearHighlight(),!0):!1;default:return!1}},s=e=>e?.matches?.(`svg.tc-chart`)===!0,c=t=>{let{key:n}=t;Ri(e.config)&&s(t.target)&&o(n)&&t.preventDefault()},l=t=>{s(t.target)&&e.highlightSource===`index`&&e.clearHighlight()},u=t=>{Ri(e.config)&&s(t.target)&&r()};return t.addEventListener(`keydown`,c),t.addEventListener(`focusin`,u),t.addEventListener(`focusout`,l),{svgAttrs:e=>Ri(e)?{tabindex:0}:void 0,destroy(){t.removeEventListener(`keydown`,c),t.removeEventListener(`focusin`,u),t.removeEventListener(`focusout`,l),n?.remove()}}}}}let Bi={left:`right`,right:`left`},Vi=`tc-legend-beside`,Hi=`tc-legend-start`;function Ui(){return{name:`legend`,install(e){let t=e.element,n=t.querySelector(`:scope > .tc-legend`)??void 0,i=n?.firstElementChild??null,a=!1,o=t=>{let n=(t.target.closest?.(`.tc-legend-item`))?.getAttribute(`data-key`);n!=null&&e.toggleSeries(n)},s=()=>{n&&(C(n,null),n.removeEventListener(`click`,o),a=!1,n.remove(),n=void 0,t.classList.remove(Vi,Hi))},c=!1,l=()=>{let e=n?.dataset.position;return e===`left`||e===`right`},u=()=>{if(!n)return;let e=t.querySelector(`:scope > svg.tc-chart`);c?e?e.nextElementSibling!==n&&e.after(n):n.isConnected||t.appendChild(n):n.isConnected&&n.nextElementSibling===e||t.insertBefore(n,e??t.firstChild)},d=e=>{n&&(n.dataset.position=e,c=e===`bottom`||l()&&e===`right`!=(getComputedStyle(t).direction===`rtl`),u(),t.classList.toggle(Vi,l()),t.classList.toggle(Hi,l()&&!c))},f=()=>Number.parseFloat(getComputedStyle(t).columnGap)||0;return{beforeRender({config:c,legend:l,hidden:u}){if(!l.show||typeof document>`u`){s();return}n||(n=t.ownerDocument.createElement(`div`),n.className=`tc-legend`),a||=(n.addEventListener(`click`,o),!0),n.dir=e.rtl?`rtl`:``,C(n,m(l.items,u,r(c)),i),i=null;let{position:p}=l,h=p===`auto`?`right`:p;d(e.rtl&&Bi[h]||h),p===`auto`&&(n.offsetWidth+f())*3>t.clientWidth&&d(`bottom`)},reservedHeight(){if(!n?.isConnected||l())return 0;let{marginTop:e,marginBottom:t}=getComputedStyle(n);return n.offsetHeight+(Number.parseFloat(e)||0)+(Number.parseFloat(t)||0)},reservedWidth(){return n?.isConnected&&l()?n.offsetWidth+f():0},afterRender:u,destroy:s}}}}let Wi=/* @__PURE__ */ new Map,Gi=/* @__PURE__ */ new WeakMap,Ki=!1;function qi(e,t){let n=Gi.get(e);if(!n){n=/* @__PURE__ */ new Map;for(let t=0;t<e.count;t++){let r=e.hitIndex(t);r&&!n.has(r.label)&&n.set(r.label,t)}Gi.set(e,n)}return n.get(t)}function Ji(){return{name:`sync`,install(e){let t=new WeakRef(e),n,r,i=()=>{n?.delete(t),r&&n?.size===0&&Wi.get(r)===n&&Wi.delete(r)},a=()=>{let a=e.config.sync,o=a?Wi.get(a)??/* @__PURE__ */ new Set:void 0;o!==n&&(i(),a&&o&&(o.add(t),Wi.set(a,o)),n=o,r=a)};a();let o=e.on(`hover`,({hit:t})=>{if(!(Ki||!n||t&&e.highlightSource!==`pointer`)){Ki=!0;try{for(let r of n){let i=r.deref();if(i||n.delete(r),!i||i===e)continue;let a=t&&i.interaction&&qi(i.interaction,t.label);a==null?i.clearHighlight():i.highlightIndex(a)}}finally{Ki=!1}}});return{afterRender:a,destroy(){o(),i()}}}}}let Yi=/* @__PURE__ */ new Map,Xi=!1;function Zi(){Xi=!1;let e=0;for(;Yi.size>0;){let t=Array.from(Yi.values());Yi.clear();for(let n of t)pe(n),e++}return e}function Qi(e,t){me.idle=Zi,Yi.set(e,t),Xi||(Xi=!0,typeof requestIdleCallback==`function`?requestIdleCallback(Zi,{timeout:1e3}):setTimeout(Zi,100))}function $i(e){Yi.delete(e)}function ea(){return{name:`table`,install(e){let t=e.element,n=t.querySelector(`:scope > .tc-table-wrap`)??void 0,r=n?.firstElementChild??null,i,a={},o=()=>{$i(a),n&&=(C(n,null),n.remove(),void 0)},s=(i,a)=>{let s=i.table??!0,c=typeof s==`object`&&s.maxRows?s.maxRows:1e3,l=s!==!1&&typeof document<`u`?i.type.table?.(Se(i),{locale:i.locale,hidden:a,rtl:e.rtl},c):void 0;if(!l){o();return}let u=s===`visible`||typeof s==`object`&&s.visible===!0,d=i.title,f=l.total??l.rows.length,p=l.rows.length>c?{columns:l.columns,rows:l.rows.slice(0,c)}:l;if(f>p.rows.length){let e=G(i.locale),t=`${e.format(p.rows.length)} of ${e.format(f)} rows`;d=d?`${d} (${t})`:t}n||=t.ownerDocument.createElement(`div`),n.className=u?`tc-table-wrap`:`tc-table-wrap tc-sr-only`,C(n,Ii(p,d),r),r=null;let m=t.querySelector(`:scope > svg.tc-chart`),h=t.querySelector(`:scope > svg.tc-chart + .tc-legend`)??m;h&&h.nextElementSibling!==n?h.after(n):n.isConnected||t.appendChild(n)};return{afterRender({config:e,hidden:t,changed:r}){if(!r&&n?.isConnected)return;let o=e.table??!0,c=i===o;i=o,c&&n?.isConnected&&n.classList.contains(`tc-sr-only`)?Qi(a,()=>s(e,t)):($i(a),s(e,t))},destroy:o}}}}function ta(e,t){if(t)return t;let n=e.items.find(t=>t.seriesIndex===e.seriesIndex)??e.items[0];return e.highlight?.kind===`spoke`&&n?.y!=null?{x:n.x,y:n.y}:e.axis===`y`?{x:n?.x??e.x,y:e.y??e.area.y}:{x:e.x,y:n?.y??e.area.y+e.area.height/2}}function na(e,t={},n){return l(`div`,{class:`tc-tooltip-content`},t.format?t.format(e):[e.title&&l(`div`,{class:`tc-tooltip-title`},e.title),e.items.map(t=>l(`div`,{key:t.seriesIndex,class:[`tc-tooltip-item`,`tc-series`,`tc-series-${t.seriesIndex+1}`,e.seriesIndex===t.seriesIndex&&`tc-tooltip-item-active`],style:{"--tc-series-color":t.color,...n?.(t.seriesIndex)}},l(`span`,{class:`tc-tooltip-swatch`}),l(`span`,{class:`tc-tooltip-name`},t.name),l(`span`,{class:`tc-tooltip-value`},t.text))),t.footer&&l(`div`,{class:`tc-tooltip-footer`},t.footer(e))])}function ra(e,t,n,r=12,i=!1){let{x:a=0,y:o=0}=n,s=e.x+r+t.width<=a+n.width,c=e.x-r-t.width>=a,l=(i?c||!s:c&&!s)?`left`:`right`,u=l===`right`?e.x+r:e.x-r-t.width,d=Math.max(a,Math.min(u,a+n.width-t.width)),f=Math.max(o,Math.min(e.y-t.height/2,o+n.height-t.height));return{x:Math.round(d),y:Math.round(f),side:l}}function ia(e){let t=0,n=0,r=innerWidth,i=innerHeight;for(let a=e;a;){let e=getComputedStyle(a);if(e.overflowX!==`visible`||e.overflowY!==`visible`){let e=a.getBoundingClientRect();t=Math.max(t,e.left),n=Math.max(n,e.top),r=Math.min(r,e.right),i=Math.min(i,e.bottom);break}a=a.parentElement??(a.getRootNode().host||null)}return{left:t,top:n,right:r,bottom:i}}let aa=[];function oa(){for(let e of aa.splice(0).map(e=>e()))e?.()}function sa(){return{name:`tooltip`,install(e){let t=Ni(e),n=e.element,i=!n.classList.contains(`tc-container`);n.classList.add(`tc-container`);let a,o=0;return{afterRender(){let t=e.config.tooltip,i=e.active,s=i&&ta(i,e.pointer);if(t===!1||typeof document>`u`||!i||!s||!Number.isFinite(s.x)||!Number.isFinite(s.y)){o++,a?.removeAttribute(`data-visible`);return}a||(a=n.ownerDocument.createElement(`div`),a.className=`tc-tooltip`,a.setAttribute(`aria-hidden`,`true`),n.appendChild(a));let c=typeof t==`object`?t:void 0;a.classList.toggle(`tc-tooltip-light`,c?.theme===`light`);let{rtl:l}=e;a.dir=l?`rtl`:``,C(a,na(i,c,r(e.config)));let u=a,d=++o;aa.push(()=>{let t=n.querySelector(`svg.tc-chart`);if(!t||d!==o)return;let{width:r,height:a}=e.size,c=n.getBoundingClientRect(),f=t.getBoundingClientRect(),p=c.width>0&&n.offsetWidth>0?c.width/n.offsetWidth:1,m=f.width>0?f.width/r/p:1,h=f.height>0?f.height/a/p:1,g={x:(f.left-c.left)/p-n.clientLeft,y:(f.top-c.top)/p-n.clientTop},_=i.axis===`y`||i.highlight?.kind===`spoke`?s.x:i.x,v=i.axis===`y`?i.y??s.y:s.y,y=ia(n),b=ra({x:g.x+_*m,y:g.y+v*h},{width:u.offsetWidth,height:u.offsetHeight},{x:(y.left-c.left)/p-n.clientLeft,y:(y.top-c.top)/p-n.clientTop,width:(y.right-y.left)/p,height:(y.bottom-y.top)/p},12,l);return()=>{u.style.transform=`translate(${b.x}px, ${b.y}px)`,u.dataset.side=b.side,u.hasAttribute(`data-visible`)||(getComputedStyle(u).transform,u.setAttribute(`data-visible`,``))}}),V(aa,oa)},destroy(){o++,a&&(C(a,null),a.remove()),i&&n.classList.remove(`tc-container`),t?.()}}}}}let ca=()=>({name:`zoom`,install:e=>t.zoom?.install(e)??{}});function la(){return[Fi(),Ui(),sa(),ea(),zi(),Ji(),Ei(),ca()]}var ua=class extends Be{constructor(e,t){super(e,t,la())}};function da(e){return l(`mask`,{id:e,maskContentUnits:`objectBoundingBox`},l(`linearGradient`,{id:`${e}-gradient`,x1:0,y1:0,x2:0,y2:1},l(`stop`,{class:`tc-fade-start`,offset:0}),l(`stop`,{class:`tc-fade-end`,offset:1})),l(`rect`,{width:1,height:1,fill:`url(#${e}-gradient)`}))}function fa(e,t,n={}){let{percent:r=!1,nullAsZero:i=!1,hidden:a}=n,o=e.map(e=>!a?.has(Q(e))),s=e.map(()=>Array(t).fill(null));for(let n=0;n<t;n++){let t=0;r&&e.forEach((e,r)=>{let i=e.values[n];o[r]&&i!=null&&(t+=Math.abs(i))});let a=0,c=0,l,u;for(let d=0;d<e.length;d++){let f=e[d];if(!o[d])continue;let p=f.values[n],m=p!=null;if(!m&&!i)continue;let h=m?p:0;r&&(h=t===0?0:h/t);let g=s[d];if(h<0){let e={y0:c,y1:c+h};g[n]=e,c+=h,u=e}else{let e={y0:a,y1:a+h};g[n]=e,a+=h,l=e}}r&&(l&&Math.abs(a-1)<1e-9&&(l.y1=1),u&&Math.abs(c+1)<1e-9&&(u.y1=-1))}return s}function pa(e){let t=[];for(let n of e)for(let e of n)e&&t.push(e.y0,e.y1);return t}function ma(e,t,n,r,i,a){let o=[];for(let s=0;s<t;s++){let t=e.values[s];a(t)?o.push([n(s),r(t)]):i||o.push(null)}return o}function ha(e,t,n){let{curve:r=`monotone`,points:i=`none`,pointRadius:a=4,connectNulls:s=!1,area:c=n,stacked:u=!1,decimate:d,fill:f=u?`solid`:`gradient`}=e,p=i===`none`?2:a+2,{series:m}=e.data,h=ln(e.data).length,g=on(e),_=m.filter(e=>g(e).second).map(Q),v=u?fa(m,h,{percent:u===`percent`,nullAsZero:!0,hidden:_.length?/* @__PURE__ */ new Set([...t.hidden,..._]):t.hidden}):null,y=e.endLabels?o(`end-labels`)(e,t,p):null,b=Tn(y?.options??e,t,{scale:`point`,zero:c||v!==null,zero2:c,overhang:p,...v?{values:pa(v)}:{},...u===`percent`?{tickFormat:{style:`percent`}}:{}}),{x,labels:S}=b,C=e=>sn(b,m[e]),w=e=>{let t=C(e);return t(Math.min(Math.max(0,t.domain[0]),t.domain[1]))},T=e=>!g(m[e]).second&&v?.[e]||null,E=On(b,e,t,(e,t,n)=>{let r=T(e);return{x:x.at(t),y:C(e)(r?r[t]?.y1??0:n)}}),D=c&&f===`gradient`,O=`${t.id}-fade`,k=e=>!t.hidden.has(Q(e)),A=m.map((e,t)=>{if(!k(e))return[];let n=C(t),r=T(t);if(r)return r.map((e,t)=>e?[x.at(t),n(e.y1)]:null);let i=g(e).axis;return ma(e,S.length,e=>x.at(e),n,s,e=>un(e,i))}),j=A.map(e=>d!==void 0&&e.length>d?o(`decimate`)(e,d):null),M=e=>{let t=A[e],n=j[e];return n?n.map(e=>t[e]):t},N=e=>{let t=T(e);if(!t)return w(e);let n=C(e),r=t.map(e=>e?n(e.y0):null),i=j[e];return i?i.map(e=>r[e]??null):r},P=c&&l(`g`,{class:`tc-areas`},e.data.series.map((e,t)=>k(e)&&l(`g`,Dn(e,t),l(`path`,{class:[`tc-area`,D&&`tc-area-gradient`],d:Si(M(t),N(t),{curve:r}),mask:D?`url(#${O})`:void 0})))),F=gn(e),I=S.map(Z),L=[],R=e.data.series.map((e,n)=>{if(!k(e))return null;let o=M(n),s=o.filter(e=>e!=null),c=i===`all`?s:i===`last`?s.slice(-1):[],u=xi(o,{curve:r}),d=e.dashFrom==null?-1:I.indexOf(Z(e.dashFrom)),f=d>0&&d<I.length-1,{dash:p=`5 4`}=e;if(f){let r=U(x.at(d)),i=(i,a)=>l(`clipPath`,{key:`${i}-${Q(e)}`,id:`${t.id}-${i}-${n}`},l(`rect`,{x:a?r-1e5:r,y:-1e5,width:1e5,height:2e5})),a=x.at(0)<=r;L.push(i(`solid`,a),i(`dashed`,!a))}return l(`g`,Dn(f?{...e,dash:void 0}:e,n),l(`path`,{key:`line`,class:`tc-line`,d:u,"clip-path":f?`url(#${t.id}-solid-${n})`:void 0}),f&&l(`path`,{key:`dashed`,class:`tc-line tc-line-dashed`,d:u,"clip-path":`url(#${t.id}-dashed-${n})`,style:{"--tc-series-dash":Number.isFinite(p)?`${p}px`:p}}),c.length>0&&l(`g`,{class:`tc-points`},c.map(([e,t])=>_n(F,n,e,`tc-point`,U(e),U(t),a))))});return{content:[l(`defs`,{key:`defs`},b.clip.def,D&&da(O),L),b.background,l(`g`,{key:`series`,class:`tc-series-list`,"clip-path":b.clip.url},P,R),b.foreground,y?.layer(A,b.area)],interaction:E}}let ga={name:`line`,clean:$t(Qt),prepare:rn,render:(e,t)=>ha(e,t,!1),legend:e=>cn(e.data),table:(e,t,n)=>kn(e,t,n)},_a={name:`area`,clean:$t(Qt),prepare:rn,render:(e,t)=>ha(e,t,!0),legend:e=>cn(e.data),table:(e,t,n)=>kn(e,t,n)},va=e=>{let t=U(e);return t===0?0:t};function ya(e,t,n,r,i=0){let a=Math.max(0,t),o=Math.abs(n-r),s=Math.max(0,Math.min(i,a/2,o)),c=va(e),l=va(e+a),u=va(n),d=va(r),f=r<=n,p=va(f?r+s:r-s),m=+!!f,h=va(s);return`M${c},${u}L${c},${p}A${h},${h},0,0,${m},${va(e+s)},${d}L${va(e+a-s)},${d}A${h},${h},0,0,${m},${l},${p}L${l},${u}Z`}function ba(e,t,n,r,i=0){let a=Math.max(0,t),o=Math.abs(r-n),s=Math.max(0,Math.min(i,a/2,o)),c=va(e),l=va(e+a),u=va(n),d=va(r),f=r>=n,p=va(f?r-s:r+s),m=+!!f,h=va(s);return`M${u},${c}L${p},${c}A${h},${h},0,0,${m},${d},${va(e+s)}L${d},${va(e+a-s)}A${h},${h},0,0,${m},${p},${l}L${u},${l}Z`}function xa(e,t,n){let r=e.y??{},i=e.x??{},{fontSize:a,width:o}=t,s=n.overhang??0,c=ln(e.data),l=fn(e,t),u=Sn(e,t,n,Math.round(o/80)),d=u.probe,f=r.show!==!1,p=i.show!==!1&&c.length>0,m=c.map((e,t)=>({value:Z(e),position:0,label:l(e,t)})),h=e=>f&&e?Math.ceil(H(e.label,a)/2):0,{area:g,side:_,range:v}=We(t,e.padding,e=>({top:e.top+Math.max(s,4),bottom:e.bottom+Math.max((f?q(`bottom`,d,a):0)+Lt(r.title,a),s,4),start:e.start+Math.max((p?q(`left`,m,a):0)+Lt(i.title,a),h(d[0]),s,8),end:e.end+Math.max(h(d[d.length-1]),s,8)})),y=c.map(Z),b=Vt(y,[g.y,g.y+g.height],{paddingInner:n.paddingInner??.3,paddingOuter:n.paddingOuter??.15}),x=u.scale(v()),S=It(u.ticks(x),`bottom`,a);return Cn(e,t,_,s,{area:g,labels:c,x:b,y:x,horizontal:!0,xTicks:p?It(Pt(b,(e,t)=>l(c[t],t)),`left`,a):[],yTicks:S},y)}let Sa={name:`bar`,clean:$t(Qt),prepare:rn,render(e,t){let{radius:n=4,maxBarWidth:r=24,gap:i=2,groupPadding:a=.3,stacked:s=!1,orientation:c=`vertical`,curve:u=`monotone`}=e,d=c===`horizontal`,{series:f}=e.data,p=ln(e.data).length,m=e=>(f[e]?.type??`bar`)!==`bar`,h=f.filter((e,t)=>m(t)).map(Q),g=on(e),_=e=>g(f[e]).second,v=f.filter((e,t)=>m(t)||_(t)).map(Q),y=v.length?/* @__PURE__ */ new Set([...t.hidden,...v]):t.hidden,b=s?fa(f,p,{percent:s===`percent`,hidden:y}):null,x=e=>!!b&&!m(e)&&!_(e),S={scale:`band`,zero:!0,paddingInner:a,paddingOuter:a/2,zero2:f.some((e,t)=>_(t)&&e.type!==`line`),...b?{values:[...pa(b),...f.flatMap((e,t)=>m(t)&&!_(t)?e.values:[])]}:{},...s===`percent`?{tickFormat:{style:`percent`}}:{}},C=d?xa(e,t,S):Tn(e,t,S),{x:w,labels:T}=C,E=e=>sn(C,f[e]),D=/* @__PURE__ */ new Map,O=0,k=-1;f.forEach((e,n)=>{t.hidden.has(Q(e))||m(n)||(x(n)?(k<0&&(k=O++),D.set(n,k)):D.set(n,O++))});let A=[...D.keys()],j=Math.max(1,O),M=Math.max(0,Math.min(r,(w.bandwidth-i*(j-1))/j)),N=M*j+i*(j-1),P=(w.bandwidth-N)/2,F=e=>w.range[1]<w.range[0]?j-1-e:e,I=(e,t)=>w.at(t)+P+F(D.get(e)??0)*(M+i),L=(e,t)=>{if(x(e))return b?.[e]?.[t]??null;let n=f[e],r=n?.values[t];return un(r,g(n).axis)?{y0:0,y1:r}:null},R=T.map((e,t)=>{let n=-1,r=-1;for(let e of A){if(!x(e))continue;let i=L(e,t);i&&(i.y1>i.y0?n=e:i.y1<i.y0&&(r=e))}return{up:n,down:r}}),ee=On(C,e,t,(e,t,n)=>{let r=E(e);if(m(e)){let e=w.at(t)+w.bandwidth/2;return d?{x:r(n),y:e}:{x:e,y:r(n)}}let i=I(e,t),a=L(e,t),o=r(a?.y1??0),s=r(a?.y0??0),c=Math.min(o,s),l=Math.abs(o-s);return d?{x:o,y:i+M/2,box:{x:c,y:i,width:l,height:M}}:{x:i+M/2,y:o,box:{x:i,y:c,width:M,height:l}}},(e,t,n)=>{let r=d?t:e,a=d?e:t,o=F(Math.floor((r-(w.at(n)+P)+i/2)/(M+i)));if(o===k)return A.find(e=>{if(!x(e))return!1;let t=L(e,n);if(!t)return!1;let r=E(e),o=r(t.y0),s=r(t.y1);return a>=Math.min(o,s)-i/2&&a<=Math.max(o,s)+i/2});let s=A.find(e=>D.get(e)===o);return s!==void 0&&L(s,n)?s:void 0}),z=f.map((e,t)=>D.has(t)&&l(`g`,Dn(e,t),T.map((e,r)=>{let a=L(t,r);if(!a)return null;let o=E(t),s=a.y1<a.y0,c=Math.sign(o(a.y1)-o(a.y0)),u=a.y0===0?0:c*i,f=!x(t)||(s?R[r]?.down:R[r]?.up)===t,p=d?ba:ya;return l(`path`,{key:Z(e),class:[`tc-bar`,s&&`tc-bar-negative`,d&&`tc-bar-horizontal`],d:p(I(t,r),M,o(a.y0)+u,o(a.y1),f?n:0)})}))),te=h.length?o(`line`):null,ne=f.map((e,n)=>{if(!te||!m(n)||t.hidden.has(Q(e)))return null;let r=E(n),i=g(e).axis,a=r(Math.min(Math.max(0,r.domain[0]),r.domain[1])),o=T.map((t,n)=>{let a=e.values[n];if(!un(a,i))return null;let o=w.at(n)+w.bandwidth/2;return d?[r(a),o]:[o,r(a)]}),s=e.type===`area`&&!d;return l(`g`,Dn(e,n),s&&l(`path`,{class:`tc-area`,d:te.areaPath(o,a,{curve:u})}),l(`path`,{class:`tc-line`,d:te.linePath(o,{curve:u})}))});return{content:[l(`defs`,{key:`defs`},C.clip.def),C.background,l(`g`,{key:`series`,class:`tc-series-list`,"clip-path":C.clip.url},z,ne),C.foreground],interaction:ee}},legend:e=>cn(e.data),table:(e,t,n)=>kn(e,t,n)};function Ca(e,t,n,r,i){let a=Math.max(0,Math.min(i,n/2,r/2)),o=U;return`M${o(e+a)},${o(t)}H${o(e+n-a)}A${o(a)},${o(a)},0,0,1,${o(e+n)},${o(t+a)}V${o(t+r-a)}A${o(a)},${o(a)},0,0,1,${o(e+n-a)},${o(t+r)}H${o(e+a)}A${o(a)},${o(a)},0,0,1,${o(e)},${o(t+r-a)}V${o(t+a)}A${o(a)},${o(a)},0,0,1,${o(e+a)},${o(t)}Z`}let wa=864e5,Ta=[`var(--tc-color-1)`,`var(--tc-grid-color)`,`var(--tc-color-8)`],Ea=3660,Da=e=>typeof e==`string`||typeof e==`number`||e instanceof Date?J(new Date(e).getTime()):null,Oa=(e,t)=>{let n=new Date(e);return Math.floor((t?e:Date.UTC(n.getFullYear(),n.getMonth(),n.getDate()))/wa)},ka=e=>/* @__PURE__ */ new Date(e*wa),Aa=e=>((e+4)%7+7)%7,ja=e=>Array.isArray(e)?[{name:``,values:e}]:e.series,Ma=e=>{let t=Array.isArray(e)?{series:[{name:``,values:e}]}:Y(e)?e:{};return{...t,series:Xt(t.series,e=>({...Zt(e),values:Xt(e.values,e=>({date:Da(e.date),value:J(e.value)})).filter(e=>e.date!==null)}))}};function Na(e){let t=e.utc===!0,n=(Math.floor(J(e.weekStart)??1)%7+7)%7,r=e=>(Aa(e)-n+7)%7,i=1/0,a=-1/0;for(let n of ja(e.data))for(let e of n.values){let n=Da(e.date);if(n===null)continue;let r=Oa(n,t);r<i&&(i=r),r>a&&(a=r)}let o=Da(e.to),s=Da(e.from),c=o===null?a:Oa(o,t),l=J(e.weeks),u=s===null?l!==null&&l>0&&Number.isFinite(c)?c-r(c)-(Math.min(Ea/7,Math.floor(l))-1)*7:i:Oa(s,t);c-u>=Ea&&(u=c-Ea+1);let d=Number.isFinite(u)&&Number.isFinite(c)&&c>=u?c-u+1:0,f=[];if(d){let e=ka(u),t=e.getUTCFullYear(),n=e.getUTCMonth(),i=e=>Math.floor(Date.UTC(t,n+e,1)/wa),a=c<Math.floor(Date.UTC(t+1,n,e.getUTCDate())/wa)||c+(6-r(c))-(u-r(u))<371;for(let e=u,t=1;e<=c;t++){let n=a?c:Math.min(c,i(t*12)-1),o=e-r(e);f.push({start:e,end:n,gridStart:o,columns:(n+(6-r(n))-o+1)/7}),e=n+1}}return{from:u,count:d,bands:f,columns:f.reduce((e,t)=>Math.max(e,t.columns),0),weekStart:n,row:r}}function Pa(e,t){let{width:n,height:r,fontSize:i,locale:a}=t,{radius:o=2,utc:s=!1}=e,c=Math.min(64,Math.max(1,Math.floor(J(e.levels)??4))),u=ja(e.data),d=u.filter(e=>!t.hidden.has(X(e))),f=K(e.format,a),p={timeZone:`UTC`},m=wt(e.dateFormat??{year:`numeric`,month:`short`,day:`numeric`,...p},a),h=e.x?.format??wt({month:`short`,...p},a),g=e.y?.format??wt({weekday:`short`,...p},a),_=wt({year:`numeric`,...p},a),v=wt({year:`2-digit`,...p},a),y=/* @__PURE__ */ new Map,b=d.map(e=>{let t=/* @__PURE__ */ new Map;for(let n of e.values){let e=Da(n.date);if(e===null)continue;let r=Oa(e,s),i=J(n.value);t.set(r,i===null?t.get(r)??null:(t.get(r)??0)+i),y.set(r,i===null?y.get(r)??null:(y.get(r)??0)+i)}return t}),{from:x,count:S,bands:C,columns:w,weekStart:T,row:E}=Na(e),D=0,O=0;for(let e of y.values())e!==null&&(e<D&&(D=e),e>O&&(O=e));let k=J(e.min)??D,A=Math.max(J(e.max)??O,k),j=e.colors===`diverging`,M=j?Ta:Array.isArray(e.colors)&&e.colors.length>=2?e.colors:void 0,N=J(e.mid)??(j?0:null);if(j&&N!==null){let t=Math.max(A-N,N-k);J(e.min)===null&&(k=N-t),J(e.max)===null&&(A=N+t)}let P=e=>{let t=M&&N!==null&&k<N&&N<A?e<=N?(e-k)/(N-k)*.5:.5+(e-N)/(A-N)*.5:A>k?(e-k)/(A-k):+(e>k);return Math.min(1,Math.max(0,t))},F=e=>M?Math.round(P(e)*c):e<=k?0:Math.min(c,Math.ceil(P(e)*c)||c),I=e=>{if(!M)return`--tc-heat:${U(e/c*100)}%`;let t=e/c*(M.length-1),n=Math.min(M.length-2,Math.floor(t)),r=U((t-n)*100);return{"--tc-cell-fill":r<=0?M[n]:r>=100?M[n+1]:`color-mix(in oklab,${M[n+1]} ${r}%,${M[n]})`}},L=Ve(e.padding,0),R=e.x?.show!==!1&&S>0,ee=e.y?.show!==!1&&S>0,z=e.scale!==!1&&S>0,te=typeof e.scale==`object`?e.scale:{},ne=te.low??(M?f(k):`Less`),re=te.high??(M?f(A):`More`),ie=Array.from({length:7},(e,t)=>g(ka(3+(T+t)%7))),ae=ee?q(`left`,ie.map((e,t)=>({value:t,position:0,label:e})),i):0,oe=R?q(`top`,[{value:0,position:0,label:`M`}],i):0,se=C.length>1,ce=C.map(e=>{let t=ka(e.start),n=ka(e.end);return t.getUTCFullYear()===n.getUTCFullYear()?_(t):`${_(t)}–${v(n)}`}),le=se&&R,ue=le?Math.ceil(ce.reduce((e,t)=>Math.max(e,H(t,i)),0))+8:0,de=z?Math.ceil(i*W)+6:0,B=Ue(n,r,{top:L.top,right:L.right,bottom:L.bottom+de,left:L.left+Math.max(ae,ue)}),fe=C.length,pe=B.height-fe*oe-(fe-1)*10,V=w?Math.max(0,Math.min(B.width/w,pe/(7*fe))):0,me=Math.max(0,Math.min(J(e.gap)??2,V/4)),he=Math.max(0,V-me),ge=e=>B.y+e*(oe+V*7+10)+oe,_e=e=>B.x+e*V+me/2,ve={x:B.x,y:B.y,width:V*w,height:fe?ge(fe-1)+V*7-B.y:0},ye=e=>{let t=Math.max(0,C.findIndex(t=>e<=t.end)),n=Math.floor((e-C[t].gridStart)/7);return{x:_e(n),y:ge(t)+E(e)*V+me/2}},be=(e,t)=>{if(e<0||e>=S)return null;let n=x+e,r=ye(n),i=r.x+he/2,a=r.y+he/2,s={x:r.x,y:r.y,width:he,height:he},c=d.map((e,t)=>{let r=b[t]?.get(n)??null;return{name:e.name,seriesIndex:u.indexOf(e),value:r,text:r===null?`–`:f(r),x:i,y:a,box:s,color:e.color}});return{index:e,label:ka(n).toISOString().slice(0,10),title:m(ka(n)),x:i,area:ve,items:c,seriesIndex:t,highlight:{kind:`halo`,d:Ca(s.x-2,s.y-2,he+4,he+4,o+2)}}},xe={count:S,rows:7,hitIndex:be,hitTest(e,t){if(!V||e<ve.x)return null;let n=Math.floor((e-ve.x)/V);for(let e=0;e<fe;e++){let r=C[e],i=Math.floor((t-ge(e))/V);if(t<ge(e)||i>6||n>=r.columns)continue;let a=r.gridStart+n*7+i;return a<r.start||a>r.end?null:be(a-x)}return null}},Se=[];for(let e=x;e<x+S;e++){let t=y.get(e)??null,n=ye(e);Se.push(l(`rect`,{key:e,class:[`tc-cell`,t===null&&`tc-cell-empty`],x:U(n.x),y:U(n.y),width:U(he),height:U(he),rx:U(Math.min(o,he/2)),style:t===null?void 0:I(F(t))}))}let Ce=C.map((e,t)=>{let n=[];for(let t=0;t<e.columns;t++){let r=Math.max(e.start,e.gridStart+t*7),i=ka(r).getUTCMonth();(t===0||i!==ka(Math.max(e.start,r-7)).getUTCMonth())&&n.push({value:r,position:B.x+t*V+V/2,label:h(ka(r))})}let r=ie.map((e,n)=>({value:n,position:ge(t)+n*V+V/2,label:e})),a={x:B.x,y:ge(t),width:V*e.columns,height:V*7};return l(`g`,{key:`band-${e.start}`,class:`tc-calendar-band`},R&&zt({position:`top`,ticks:It(n,`top`,i),area:a}),ee&&zt({position:`left`,ticks:It(r,`left`,i),area:a}),le&&l(`text`,{class:`tc-tick-label tc-calendar-year`,x:U(B.x-8),y:U(ge(t)-8),"text-anchor":`end`,"aria-hidden":`true`},ce[t]))}),we=Math.min(he,i),Te=ve.y+ve.height+6+we/2,Ee=H(ne,i),De=H(re,i),Oe=c+1,ke=Ee+6+Oe*(we+me)+6+De,Ae=Math.max(B.x,B.x+ve.width-ke);return{content:[l(`g`,{key:`cells`,class:`tc-calendar-cells`},Se),Ce,z&&l(`g`,{key:`scale`,class:`tc-calendar-scale`,"aria-hidden":`true`},l(`text`,{class:`tc-tick-label`,x:U(Ae),y:U(Te),dy:`0.32em`},ne),Array.from({length:Oe},(e,t)=>l(`rect`,{key:t,class:`tc-cell`,x:U(Ae+Ee+6+t*(we+me)),y:U(Te-we/2),width:U(we),height:U(we),rx:U(Math.min(o,we/2)),style:I(t)})),l(`text`,{class:`tc-tick-label`,x:U(Ae+Ee+6+Oe*(we+me)+6),y:U(Te),dy:`0.32em`},re))],interaction:xe}}function Fa(e){let{bands:t,columns:n}=Na(e),r=t.length;if(!r)return;let i=e.x?.show===!1?0:23,a=e.y?.show===!1?0:36,o=r*i+(r-1)*10+(e.scale===!1?0:21);return{left:a,fixed:o,rows:7*r,columns:n,width:a+n*13,height:o+r*7*13}}function Ia(e){let t=Fa(e);return t&&Math.max(2,U(t.width/t.height))}function La(e,t){let n=Fa(e);if(!n||e.aspectRatio!==e.autoRatio||t>=n.width)return;let r=Math.max(0,t-n.left)/n.columns*n.rows;return Math.min(t/2,n.fixed+r)}let Ra=e=>Array.isArray(e.data)?[]:tn(ja(e.data));function za(e,t,n){let r=ja(e.data).filter(e=>!t.hidden.has(X(e))),i=e.utc===!0,a=K(e.format,t.locale),o=wt(e.dateFormat??{year:`numeric`,month:`short`,day:`numeric`,timeZone:`UTC`},t.locale),s=/* @__PURE__ */ new Map;r.forEach((e,t)=>{for(let n of e.values){let e=Da(n.date);if(e===null)continue;let a=Oa(e,i),o=s.get(a)??r.map(()=>null),c=J(n.value);c!==null&&(o[t]=(o[t]??0)+c),s.set(a,o)}});let c=[...s.keys()].sort((e,t)=>e-t);return{columns:[``,...r.map(e=>e.name)],total:c.length,rows:c.slice(0,n).map(e=>[o(ka(e)),...(s.get(e)??[]).map(e=>e===null?`–`:a(e))])}}let Ba={name:`calendar`,clean:e=>{let t=$t(Ma)(e);if(t.aspectRatio!==void 0&&t.aspectRatio!==t.autoRatio)return t;let n=Ia(t);return{...t,aspectRatio:n,autoRatio:n}},render:Pa,height:La,legend:Ra,table:za,valueLabels:{marks:`cell`,format:e=>e.format}},Va=(e,t,n,r,i)=>{let a=`A${i},${i},0,0,1,`;return`M${U(e+i)},${t}H${U(e+n-i)}${a}${U(e+n)},${U(t+i)}V${U(t+r-i)}${a}${U(e+n-i)},${U(t+r)}H${U(e+i)}${a}${e},${U(t+r-i)}V${U(t+i)}${a}${U(e+i)},${t}Z`},Ha=(e,t)=>[e.open,e.high,e.low,e.close].every(e=>un(e,t));function Ua(e){let t=t=>e.data.map(n=>Ha(n,e.y)?n[t]:null),n={data:{labels:e.data.map(e=>e.x),series:[{name:`Open`,values:t(`open`)},{name:`High`,values:t(`high`)},{name:`Low`,values:t(`low`)},{name:`Close`,values:t(`close`)}]}};return e.x&&(n.x=e.x),e.y&&(n.y=e.y),e.padding!==void 0&&(n.padding=e.padding),e.annotations&&(n.annotations=e.annotations),n}let Wa={name:`candlestick`,clean:$t(e=>Xt(e,e=>({...e,x:Jt(e.x),open:J(e.open),high:J(e.high),low:J(e.low),close:J(e.close)}))),prepare:rn,render(e,t){let{maxCandleWidth:n=16,groupPadding:r=.3,radius:i=1}=e,a=Ua(e),o=Tn(a,t,{scale:`band`,zero:!1,paddingInner:r,paddingOuter:r/2}),{x:s,y:c,labels:u}=o,d=Math.max(1,Math.min(n,s.bandwidth)),f=e=>s.at(e)+s.bandwidth/2,p=e=>e.close>=e.open,m=On(o,a,t,(e,t,n)=>({x:f(t),y:c(n)})),h=t=>{let n=t?e.data[t.index]:void 0;if(!t||!n)return t;let r=p(n)?`var(--tc-up-color,var(--tc-color-6))`:`var(--tc-negative-color,var(--tc-color-8))`;return{...t,items:t.items.map(e=>({...e,color:r}))}},g={count:m.count,hitIndex:(e,t)=>h(m.hitIndex(e,t)),hitTest:(e,t)=>h(m.hitTest(e,t))},_=e.data.map((t,n)=>{if(!Ha(t,e.y))return null;let r=U(f(n)),a=c(Math.max(t.open,t.close)),o=Math.max(c(Math.min(t.open,t.close)),a+1),s=U(f(n)-d/2),m=U(Math.min(i,d/2,(o-a)/2));return l(`g`,{key:Z(u[n]),class:[`tc-candle`,p(t)?`tc-candle-up`:`tc-candle-down`]},l(`path`,{class:`tc-candle-wick`,d:`M${r},${U(c(t.high))}V${U(c(t.low))}`}),l(`path`,{class:`tc-candle-body`,d:Va(s,U(a),U(d),U(o-a),m)}))});return{content:[l(`defs`,{key:`defs`},o.clip.def),o.background,l(`g`,{key:`series`,class:`tc-series-list tc-candles`,"clip-path":o.clip.url},_),o.foreground],interaction:g}},table:(e,t,n)=>kn(Ua(e),t,n)};function Ga(e,t,n){if(H(e,n)<=t)return e;let r=[...e];for(;r.length>2;){r.pop();let e=`${r.join(``).trimEnd()}…`;if(H(e,n)<=t)return e}return``}let Ka=(e,t)=>t>0?e/t:0;function qa(e){let t=e.data[0]?.value??0;return e.data.map((n,r)=>({data:n,value:n.value,ofFirst:r===0?1:Ka(n.value,t),ofPrevious:r===0?1:Ka(n.value,e.data[r-1].value)}))}let Ja=(e,t)=>U((t>1?.3+.7*e/(t-1):1)*100),Ya=(e,t,n)=>Math.max(0,Math.min(e,t/2,n/2));function Xa(e,t,n,r,i,a){let o=t-e,s=r-n,c=Ya(a,o,i-n),l=Ya(a,o,i-r),u=o>0?c/o:0,d=o>0?l/o:0,f=U;return`M${f(e)},${f(n+c)}Q${f(e)},${f(n)},${f(e+o*u)},${f(n+s*u)}L${f(t-o*d)},${f(r-s*d)}Q${f(t)},${f(r)},${f(t)},${f(r+l)}L${f(t)},${f(i)}L${f(e)},${f(i)}Z`}function Za(e,t){let{width:n,height:r,fontSize:i,locale:a}=t,o=Math.max(0,e.radius??4),s=Ue(n,r,Ve(e.padding,0)),c=qa(e),u=c.length;if(u===0)return{content:null};let d=K(e.format,a),f=G(a,{style:`percent`,maximumFractionDigits:1}),p=typeof e.format==`function`?d:K({...e.format,notation:`compact`},a),m=i*1.3,h=e.labels===!1?0:Math.min(s.height,m*3+8),g=s.y+s.height,_=s.height-h,v=s.width/u,y=e=>s.x+e*v,b=Math.max(0,...c.map(e=>e.value)),x=e=>g-(b>0?e/b*_:0),S=e=>c[e].data.color??`color-mix(in oklab,var(--tc-funnel-color,var(--tc-color-1)) ${Ja(e,u)}%,var(--tc-surface))`,C=e=>{let t=c[e],n=y(e)+v/2,r=[{name:t.data.name,seriesIndex:0,value:t.value,text:d(t.value),x:n,y:x(t.value),color:S(e)}],i=(e,t,i)=>r.push({name:`of ${t.data.name}`,seriesIndex:e,value:i,text:f.format(i),x:n,y:null,color:`transparent`});return e>0&&i(1,c[0],t.ofFirst),e>1&&i(2,c[e-1],t.ofPrevious),{index:e,label:t.data.name,title:``,x:n,area:s,highlight:{kind:`band`,x:y(e),y:s.y,width:v,height:s.height},items:r}},w={count:u,hitIndex:e=>e>=0&&e<u?C(e):null,hitTest(e,t){return e<s.x||e>s.x+s.width||t<s.y||t>g?null:C(Math.min(u-1,Math.floor((e-s.x)/(v||1))))}},T=c.slice(1).map((e,t)=>l(`line`,{key:X(e.data),class:`tc-grid-line tc-funnel-divider`,x1:U(y(t+1)),x2:U(y(t+1)),y1:U(s.y),y2:U(g)})),E=c.map((e,t)=>l(`path`,{key:X(e.data),class:[`tc-funnel-stage`,e.data.class],"data-series":e.data.name,d:Xa(y(t),y(t+1),x(e.value),x((c[t+1]??e).value),g,o),style:{"--tc-funnel-color":e.data.color,"--tc-funnel-shade":`${e.data.color?100:Ja(t,u)}%`}})),D=h>=m*3&&c.flatMap((e,t)=>{let n=t===0?0:10,r=v-n-10,a=U(y(t)+n),o=s.y+i*.85,c=X(e.data),u=e=>H(e,i)<=r,h=Ga(e.data.name,r,i),g=d(e.value),_=u(g)?g:p(e.value),b=t>0?f.format(e.ofFirst):``;return[h&&l(`text`,{key:c,class:`tc-funnel-name`,x:a,y:U(o)},h),u(_)&&l(`text`,{key:`${c}/value`,class:`tc-funnel-value`,x:a,y:U(o+m)},_),b&&u(b)&&l(`text`,{key:`${c}/share`,class:`tc-funnel-share`,x:a,y:U(o+m*2)},b)]});return{content:[l(`g`,{class:`tc-funnel-dividers`,"aria-hidden":`true`},T),l(`g`,{class:`tc-funnel-stages`},E),D&&l(`g`,{class:`tc-funnel-labels`,"aria-hidden":`true`},D)],interaction:w}}function Qa(e,t,n){let r=K(e.format,t.locale),i=G(t.locale,{style:`percent`,maximumFractionDigits:1}),a=qa(e).map(e=>[e.data.name,r(e.value),i.format(e.ofFirst),i.format(e.ofPrevious)]),o={columns:[``,`Value`,`Of first`,`Of previous`],rows:a};return a.length>n&&(o.rows=a.slice(0,n),o.total=a.length),o}let $a={name:`funnel`,clean:$t(e=>Xt(e,e=>({...Zt(e),value:J(e.value)})).filter(e=>e.value!==null&&e.value>=0)),render:Za,table:Qa},$=1e-12,eo=Math.PI,to=eo/2,no=2*eo,ro=Math.PI/180,io=e=>e>=1?to:e<=-1?-to:Math.asin(e),ao=e=>e>1?0:e<-1?eo:Math.acos(e);function oo(e,t,n,r,i,a,o,s){let c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<$))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function so(e,t,n,r,i,a,o){let s=e-n,c=t-r,l=(o?a:-a)/Math.sqrt(s*s+c*c),u=l*c,d=-l*s,f=e+u,p=t+d,m=n+u,h=r+d,g=(f+m)/2,_=(p+h)/2,v=m-f,y=h-p,b=v*v+y*y,x=i-a,S=f*h-m*p,C=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*b-S*S)),w=(S*y-v*C)/b,T=(-S*v-y*C)/b,E=(S*y+v*C)/b,D=(-S*v+y*C)/b,O=w-g,k=T-_,A=E-g,j=D-_;return O*O+k*k>A*A+j*j&&(w=E,T=D),{cx:w,cy:T,x01:-u,y01:-d,x11:w*(i/x-1),y11:T*(i/x-1)}}function co(e,t,n,r,i,a,o){let s=r,c=i,l=r,u=i,d=a,f=a,p=(e.padAngle??0)/2,m=p>$?e.padRadius??Math.sqrt(t*t+n*n):0,h=Math.min(Math.abs(n-t)/2,e.cornerRadius??0),g=h,_=h;if(m>$){let e=io(m/t*Math.sin(p)),a=io(m/n*Math.sin(p));d-=e*2,d>$?(e*=o?1:-1,l+=e,u-=e):(d=0,l=u=(r+i)/2),f-=a*2,f>$?(a*=o?1:-1,s+=a,c-=a):(f=0,s=c=(r+i)/2)}let v=n*Math.cos(s),y=n*Math.sin(s),b=t*Math.cos(u),x=t*Math.sin(u),S=n*Math.cos(c),C=n*Math.sin(c),w=t*Math.cos(l),T=t*Math.sin(l);if(h>$&&a<eo){let e=oo(v,y,w,T,S,C,b,x);if(e){let r=v-e[0],i=y-e[1],a=S-e[0],o=C-e[1],s=(r*a+i*o)/(Math.sqrt(r*r+i*i)*Math.sqrt(a*a+o*o)),c=1/Math.sin(ao(s)/2),l=Math.sqrt(e[0]*e[0]+e[1]*e[1]);g=Math.min(h,(t-l)/(c-1)),_=Math.min(h,(n-l)/(c+1))}else g=_=0}return{a00:l,a01:s,a10:u,a11:c,da0:d,da1:f,rc:h,rc0:g,rc1:_,x01:v,y01:y,x10:b,y10:x,x11:S,y11:C,x00:w,y00:T}}function lo(e){let t=(e.innerRadius+e.outerRadius)/2,n=(e.startAngle+e.endAngle)/2-to;return[Math.cos(n)*t,Math.sin(n)*t]}function uo(e,t,n){let r=Math.sqrt(t*t+n*n);return r>0?2*Math.asin(Math.min(1,e/2/r)):0}let fo=(e,t)=>Math.atan2(t,e);function po(e){let t=10**Math.max(0,Math.min(12,Math.floor(e.precision??2))),n=e=>{let n=Math.round(e*t)/t;return String(n===0?0:n)},r=``,i=(e,t)=>{r+=`M${n(e)},${n(t)}`},a=(e,t)=>{r+=`L${n(e)},${n(t)}`},o=(e,t,i,a)=>{r+=`A${n(e)},${n(e)},0,0,${t},${n(i)},${n(a)}`},s=(e,t,n,r)=>{let i=r?t-n:n-t;i=(i%no+no)%no,i<$&&Math.abs(n-t)>$&&(i=no);let a=r?t-i/2:t+i/2,s=+!r;o(e,s,e*Math.cos(a),e*Math.sin(a)),o(e,s,e*Math.cos(n),e*Math.sin(n))},c=Math.max(0,e.innerRadius),l=Math.max(0,e.outerRadius);l<c&&([c,l]=[l,c]);let u=e.startAngle-to,d=e.endAngle-to,f=Math.abs(d-u),p=d>u,m=+!!p;if(!(l>$)){i(0,0);for(let e=0;e<4;e++)o(0,m,0,0);a(0,0);for(let e=0;e<4;e++)o(0,m,0,0);return`${r}Z`}if(f>no-$){let e=l*Math.cos(u),t=l*Math.sin(u);i(e,t),o(l,m,e,t),s(l,u,u+(p?no:-no)*(1-1e-9),!p),o(l,m,e,t);let n=c*Math.cos(u),d=c*Math.sin(u);if(a(n,d),o(c,m,n,d),c>$)s(c,u,u+(p?-no:no)*(1-1e-9),p);else for(let e=0;e<2;e++)o(0,m,0,0);return o(c,m,n,d),`${r}Z`}let{a00:h,a01:g,a10:_,a11:v,da0:y,da1:b,rc:x,rc0:S,rc1:C,x01:w,y01:T,x10:E,y10:D,x11:O,y11:k,x00:A,y00:j}=co(e,c,l,u,d,f,p);if(b>$&&C>$){let e=so(A,j,w,T,l,C,p),t=so(O,k,E,D,l,C,p);if(i(e.cx+e.x01,e.cy+e.y01),C<x){let e=t.cx+t.x01,n=t.cy+t.y01;o(C,m,e,n),o(l,m,e,n),o(l,m,e,n),o(C,m,e,n)}else o(C,m,e.cx+e.x11,e.cy+e.y11),s(l,fo(e.cx+e.x11,e.cy+e.y11),fo(t.cx+t.x11,t.cy+t.y11),!p),o(C,m,t.cx+t.x01,t.cy+t.y01)}else{if(i(w,T),o(l,m,w,T),b>$)s(l,g,v,!p);else for(let e=0;e<2;e++)o(l,m,w,T);o(l,m,O,k)}if(!(c>$)||!(y>$)){a(E,D);for(let e=0;e<4;e++)o(c,m,E,D)}else if(S>$){let e=so(E,D,O,k,c,-S,p),t=so(w,T,A,j,c,-S,p);if(a(e.cx+e.x01,e.cy+e.y01),S<x){let e=t.cx+t.x01,n=t.cy+t.y01;o(S,m,e,n),o(c,m,e,n),o(c,m,e,n),o(S,m,e,n)}else o(S,m,e.cx+e.x11,e.cy+e.y11),s(c,fo(e.cx+e.x11,e.cy+e.y11),fo(t.cx+t.x11,t.cy+t.y11),p),o(S,m,t.cx+t.x01,t.cy+t.y01)}else a(E,D),o(c,m,E,D),s(c,_,h,p),o(c,m,A,j);return`${r}Z`}function mo(e,t){let n=l(`path`,{class:e,d:po(t)});return n.arc=[t.innerRadius,t.outerRadius,t.startAngle,t.endAngle,t.padAngle??0,t.cornerRadius??0],n}function ho(e,t,n){let{arc:r,attrs:i}=n;if(!r||t.attrs.d===i.d)return;let a=ni(e)??t.arc,o=Number.parseFloat(getComputedStyle(e).transitionDuration)*1e3;if(a&&o>0)return ri(e,a,r,o,([e,t,n,r,i,a])=>po({innerRadius:e,outerRadius:t,startAngle:n,endAngle:r,padAngle:i,cornerRadius:a}),String(i.d)),{...i,d:t.attrs.d}}let go=Math.PI/2;function _o(e){let{data:t}=e;return typeof t==`number`?[{name:``,value:t}]:Array.isArray(t)?t:[t]}function vo(e,t){let n=e.max??100;return _o(e).map((e,t)=>({data:e,index:t,max:e.max??n})).filter(e=>!t.has(X(e.data))).map((e,t)=>({...e,position:t,value:Math.min(e.max,Math.max(0,e.data.value||0))}))}function yo(e,t,n,r,i){let a=[[0,0]],o=t+n;a.push([Math.sin(t),-Math.cos(t)],[Math.sin(o),-Math.cos(o)]);for(let e=Math.ceil(t/go)*go,n=0;n<5&&e<=o+1e-9;n++)a.push([Math.sin(e),-Math.cos(e)]),e+=go;let s=Math.min(e.width,e.height)/2,c={x0:0,y0:0,x1:0,y1:0};for(let t=0;t<4;t++){c={x0:0,y0:r,x1:0,y1:i};for(let[e,t]of a)c.x0=Math.min(c.x0,e*s),c.x1=Math.max(c.x1,e*s),c.y0=Math.min(c.y0,t*s),c.y1=Math.max(c.y1,t*s);let t=Math.min(e.width/(c.x1-c.x0),e.height/(c.y1-c.y0));if(Math.abs(t-1)<.001)break;s=Math.max(0,s*t)}return{outer:s,cx:e.x+(e.width-(c.x1-c.x0))/2-c.x0,cy:e.y+(e.height-(c.y1-c.y0))/2-c.y0}}function bo(e,t){let{width:n,height:r,locale:i}=t,a=Math.max(1,e.thickness??12),o=Math.max(0,e.gap??4),s=e.cornerRadius??a/2,c=Ve(e.padding,0),u=Ue(n,r,{top:c.top+8,right:c.right+8,bottom:c.bottom+8,left:c.left+8}),d=(e.startAngle??0)*ro,f=Math.min(360,Math.max(0,e.angle??360))*ro,p=vo(e,t.hidden),m=e.center,h=p[0],g=m!==!1&&h!==void 0,_=g?m?.label??(h.data.name||void 0):void 0,{outer:v,cx:y,cy:b}=yo(u,d,f,g?-1.4*t.fontSize:0,g?(_?2:.7)*t.fontSize:0),x=K(e.format,i),S=G(i,{style:`percent`,maximumFractionDigits:1}),C=(e,t=0)=>{let n=Math.max(0,v-e.position*(a+o));return{innerRadius:Math.max(0,n-a-t),outerRadius:n+t}},w=e=>e.max>0?e.value/e.max:0,T=(e,t=0)=>({...C(e,t),startAngle:d,endAngle:d+f*w(e),cornerRadius:s}),E=e=>{let[t,n]=lo(T(e)),r={name:e.data.name,seriesIndex:e.index,value:e.value,text:`${x(e.value)} (${S.format(w(e))})`,x:y+t,y:b+n};return e.data.color&&(r.color=e.data.color),{index:e.position,label:e.data.name,title:``,x:y+t,area:{x:y-v,y:b-v,width:v*2,height:v*2},items:[r],seriesIndex:e.index,highlight:{kind:`halo`,d:po(T(e,2)),x:y,y:b}}},D={count:p.length,hitIndex:e=>{let t=p[e];return t?E(t):null},hitTest(e,t){let n=Math.hypot(e-y,t-b),r=p.find(e=>{let{innerRadius:t,outerRadius:r}=C(e,2);return n>=t&&n<=r});return r?E(r):null}},O=p.map(e=>l(`g`,nn(e.data,e.index),mo(`tc-gauge-track`,{...T(e),endAngle:d+f}),mo(`tc-gauge-arc`,T(e)))),k=g?m?.value??S.format(w(h)):``;return{content:[l(`g`,{class:`tc-gauge`,style:`transform:translate(${y}px,${b}px)`},l(`g`,{class:`tc-gauge-rings`},O)),g&&l(`g`,{class:`tc-gauge-center`,"aria-hidden":`true`},l(`text`,{class:`tc-gauge-value`,x:y,y:b,dy:_?`0`:`0.35em`,"text-anchor":`middle`},k),_&&l(`text`,{class:`tc-gauge-label`,x:y,y:b,dy:`1.6em`,"text-anchor":`middle`},_))],interaction:D}}function xo(e,t){let n=K(e.format,t.locale),r=G(t.locale,{style:`percent`,maximumFractionDigits:1});return{columns:[``,`Value`,`Share`],rows:vo(e,t.hidden).map(e=>[e.data.name,n(e.value),r.format(e.max>0?e.value/e.max:0)])}}let So={name:`gauge`,clean:$t(e=>en(typeof e==`number`?[{name:``,value:e}]:Y(e)?[e]:e)),render:bo,sweep:ho,legend:e=>tn(_o(e)),table:xo},Co=`var(--tc-heat-empty,var(--tc-grid-color))`,wo=(e,t=`var(--tc-heat-color,var(--tc-color-1))`)=>`color-mix(in oklab,${t} ${U(e*100)}%,${Co})`,To=(e,t)=>e.name??`range-${t+1}`,Eo=(e,t)=>e.findIndex(e=>(e.from===void 0||t>=e.from)&&(e.to===void 0||t<e.to)),Do=(e,t)=>e.color??(t<8?`var(--tc-color-${t+1})`:`var(--tc-color-other)`);function Oo(e,t){let{width:n,fontSize:r,locale:i}=t,{gap:a=2,radius:o=3}=e,s=ln(e.data),c=e.x?.format??(e=>String(e)),u=K(e.format,i),[d,f]=Ut(e.data.series.flatMap(e=>e.values))??[0,1],p=e.min??Math.min(0,d),m=e.max??f,h=t=>{let{mid:n}=e,r;return r=n!==void 0&&e.colors&&p<n&&n<m?t<=n?(t-p)/(n-p)*.5:.5+(t-n)/(m-n)*.5:m>p?(t-p)/(m-p):+(t>p),Math.min(1,Math.max(0,r))},g=e=>.08+.92*h(e),_=e.ranges?.length?e.ranges:void 0,v=!_&&e.colors&&e.colors.length>=2?e.colors:void 0,y=!_&&!v&&e.colorBy===`series`,b=y?e.data.series.filter(e=>!t.hidden.has(Q(e))):e.data.series,x=t=>e.data.series.indexOf(t),S=(e,n)=>{if(_){let n=Eo(_,e),r=_[n];return!r||t.hidden.has(To(r,n))?{color:Co,empty:!0}:{style:{"--tc-cell-fill":r.color},color:r.color}}if(v){let t=h(e)*(v.length-1),n=Math.min(v.length-2,Math.floor(t)),r=U((t-n)*100),i=v[n],a=r<=0?i:r>=100?v[n+1]:`color-mix(in oklab,${v[n+1]} ${r}%,${i})`;return{style:{"--tc-cell-fill":a},color:a}}let r=g(e);return{style:`--tc-heat:${U(r*100)}%`,color:y?wo(r,Do(n,x(n))):wo(r)}},{rtl:C}=t,w=e.x?.show!==!1&&s.length>0,T=e.y?.show!==!1&&b.length>0,E=b.map((e,t)=>({value:t,position:0,label:e.name})),D=T?q(`left`,E,r):0,O=w?q(`bottom`,[{value:0,position:0,label:`M`}],r):0,k=w?H(c(s[s.length-1],s.length-1),r):0,{area:A,side:j,range:M}=We(t,e.padding,e=>{let t=(n-e.start-e.end-D)/Math.max(1,s.length)/2;return{top:e.top,bottom:e.bottom+O,start:e.start+D,end:e.end+Math.max(0,Math.ceil(k/2-t))}}),N=Vt(s.map((e,t)=>t),M()),P=Vt(b.map((e,t)=>t),[A.y,A.y+A.height]),F=Math.max(0,N.bandwidth-a),I=Math.max(0,P.bandwidth-a),L=e=>N.at(e)+a/2,R=e=>P.at(e)+a/2,ee=(e,t)=>{let n=b[t]?.values[e];return n!=null&&Number.isFinite(n)?n:null},z=(e,t=0)=>{if(e<0||e>=s.length||b.length===0)return null;let n=Math.max(0,Math.min(b.length-1,t)),r=b.map((t,n)=>{let r=ee(e,n),i=_&&r!==null?_[Eo(_,r)]:void 0;return{name:t.name,seriesIndex:n,value:r,text:r===null?`–`:i?.name?`${u(r)} · ${i.name}`:u(r),x:L(e)+F/2,y:R(n)+I/2,box:{x:L(e),y:R(n),width:F,height:I},color:r===null?`var(--tc-grid-color)`:S(r,t).color}});return{index:e,label:Z(s[e]),title:c(s[e],e),x:L(e)+F/2,area:A,items:r,seriesIndex:n,highlight:{kind:`halo`,d:Ca(L(e)-2,R(n)-2,F+4,I+4,o+2)}}},te={count:s.length,reversed:C===!0,hitIndex:(e,t)=>z(e,t),hitTest(e,t){if(e<A.x||e>A.x+A.width||t<A.y||t>A.y+A.height)return null;let n=Math.min(s.length-1,Math.floor((e-A.x)/(N.step||1))),r=C?s.length-1-n:n,i=Math.min(b.length-1,Math.floor((t-A.y)/(P.step||1)));return z(r,i)}},ne=b.map((e,t)=>l(`g`,{key:Q(e),class:[`tc-heatmap-row`,y&&[`tc-series`,`tc-series-${x(e)+1}`]],"data-series":e.name,style:y?{"--tc-series-color":e.color}:void 0},s.map((n,r)=>{let i=ee(r,t),a=i===null?void 0:S(i,e);return l(`rect`,{key:Z(n),class:[`tc-cell`,(i===null||a?.empty)&&`tc-cell-empty`],x:U(L(r)),y:U(R(t)),width:U(F),height:U(I),rx:U(Math.min(o,F/2,I/2)),style:a?.style})}))),re=w?It(Pt(N,(e,t)=>c(s[t],t)),`bottom`,r):[],ie=T?Pt(P,(e,t)=>b[t]?.name??``):[];return{content:[l(`g`,{class:`tc-heatmap-cells`},ne),w&&zt({position:`bottom`,ticks:re,area:A}),T&&zt({position:j,ticks:ie,area:A})],interaction:te}}function ko(e){let{ranges:t}=e;if(t?.length){let n=K(e.format,e.locale);return t.map((e,t)=>({key:To(e,t),name:e.name??(e.from===void 0?`< ${n(e.to??0)}`:e.to===void 0?`≥ ${n(e.from)}`:`${n(e.from)}–${n(e.to)}`),index:t,color:e.color}))}return e.colors&&e.colors.length>=2?[]:e.colorBy===`series`?cn(e.data):[]}let Ao={name:`heatmap`,clean:$t(Qt),render:Oo,legend:ko,valueLabels:{marks:`cell`,format:e=>e.format},table:(e,t,n)=>kn({data:e.data,...e.x?{x:e.x}:{},y:{format:e.format}},t,n)};function jo(e,t){let n=Math.min(t.max,Math.max(1,J(e?.scale)??1)),r=t.k*n,i=(e,t,n)=>{let i=n/r;return i>=t?(t-i)/2:Math.min(t-i,Math.max(0,e??0))};return r>0?{x:i(J(e?.x),t.mapWidth,t.width),y:i(J(e?.y),t.mapHeight,t.height),scale:n}:{x:0,y:0,scale:n}}let Mo=`http://www.w3.org/2000/svg`,No=[`M12 5v14M5 12h14`,`M5 12h14`];function Po(){return{name:`map`,install(e){let t=e.element;if(typeof t.addEventListener!=`function`)return{};let n=t.ownerDocument,r=n.defaultView,i=()=>e.config,a=()=>e.config.type.name===`map`,o=()=>a()&&!!i().zoom,s=()=>e.interaction?.map,l=()=>t.querySelector(`:scope > svg.tc-chart`),u=e=>e.target?.closest?.(`svg.tc-chart`)===l()&&!!l(),d=0,f=/* @__PURE__ */ new Map,p=!1,m,h=!t.classList.contains(`tc-container`),g=()=>r?.cancelAnimationFrame(d),_=()=>{let e=s();return e&&jo(i().view,e)},v=t=>{let n=s();n&&e.update({view:jo(t,n)})},y=(t,n)=>{let r=l(),{width:i,height:a}=e.size,o=r?c(r,t,n,i,a):{x:0,y:0};return[o.x,o.y]},b=(e,t)=>{let n=s(),r=_();if(!n||!r)return null;let i=n.k*r.scale,[a,o]=y(e,t);return[r.x+(a-n.x)/i,r.y+(o-n.y)/i]},x=e=>{g();let t=s(),n=_();if(!t||!n)return;let a=jo(e,t);if(i().animate===!1||!r?.requestAnimationFrame||r.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches){v(a);return}let o=performance.now(),c=e=>{let t=Math.min((e-o)/200,1),i=1-(1-t)**3,s=(e,t)=>e+(t-e)*i;v({x:s(n.x,a.x),y:s(n.y,a.y),scale:1/s(1/n.scale,1/a.scale)}),t<1&&(d=r.requestAnimationFrame(c))};d=r.requestAnimationFrame(c)},S=(e,t,n=!1)=>{let r=s(),i=_();if(!r||!i||!(r.k>0))return;let a=Math.min(r.max,Math.max(1,i.scale*e)),o=r.k*i.scale,[c,l]=t??[i.x+r.width/o/2,i.y+r.height/o/2],u={x:c-(c-i.x)*i.scale/a,y:l-(l-i.y)*i.scale/a,scale:a};n?x(u):(g(),v(u))},C=t=>{let n=i(),r=t?.region;if(!a()||!n.select||!r)return;let o=[...n.selected??[]],s=o.filter(e=>e!==r),c=s.length<o.length?s:n.select===`multiple`?[...o,r]:[r];e.update({selected:c}),n.onSelect?.(c,r)},w=t=>{f.delete(t.pointerId),f.size===0&&(n.removeEventListener(`pointerup`,w),n.removeEventListener(`pointercancel`,w),p&&e.update({}))},T=e=>{o()&&u(e)&&(e.pointerType!==`mouse`||e.button===0)&&(f.size===0&&(p=!1),f.set(e.pointerId,[e.clientX,e.clientY]),g(),n.addEventListener(`pointerup`,w),n.addEventListener(`pointercancel`,w))},E=t=>{let n=f.get(t.pointerId),r=_(),i=s();if(!n||!r||!i)return;let a=[t.clientX,t.clientY];if(!p){if(f.size===1&&Math.hypot(a[0]-n[0],a[1]-n[1])<4)return;p=!0;try{l()?.setPointerCapture(t.pointerId)}catch{}}if(t.stopPropagation(),e.clearHighlight(),f.set(t.pointerId,a),f.size===1){let e=i.k*r.scale,[t,o]=y(n[0],n[1]),[s,c]=y(a[0],a[1]);v({x:r.x-(s-t)/e,y:r.y-(c-o)/e,scale:r.scale});return}let o=[...f].find(([e])=>e!==t.pointerId)?.[1];if(!o)return;let c=Math.hypot(n[0]-o[0],n[1]-o[1]),u=Math.hypot(a[0]-o[0],a[1]-o[1]);c>0&&u>0&&S(u/c,b((a[0]+o[0])/2,(a[1]+o[1])/2))},D=e=>{let{zoom:t}=i();o()&&(typeof t!=`object`||t.wheel!==!1)&&u(e)&&(e.preventDefault(),S(Math.exp(-e.deltaY*(e.ctrlKey?.01:.002)),b(e.clientX,e.clientY)))},O=e=>{o()&&u(e)&&S(2,b(e.clientX,e.clientY),!0)},k=e=>{p&&e.stopPropagation(),p=!1},A=t=>{if(t.target!==l()||!a())return;let{key:n}=t;if(o()&&(n===`+`||n===`=`))S(2,null,!0);else if(o()&&n===`-`)S(1/2,null,!0);else if(o()&&n===`0`)x({x:0,y:0,scale:1});else if(i().select&&(n===`Enter`||n===` `)&&e.active)C(e.active);else return;t.preventDefault()},j=e=>{let t=e.target.closest(`button`);t&&S(t.value===`in`?2:1/2,null,!0)};t.addEventListener(`pointermove`,E,!0),t.addEventListener(`click`,k,!0),t.addEventListener(`pointerdown`,T),t.addEventListener(`wheel`,D,{passive:!1}),t.addEventListener(`dblclick`,O),t.addEventListener(`keydown`,A);let M=e.on(`click`,({hit:e})=>C(e));return{svgAttrs:()=>o()?{"data-zoom":p&&f.size?`drag`:``}:void 0,afterRender:()=>{if(!o()){m?.remove(),m=void 0;return}if(!m){m=n.createElement(`div`),m.className=`tc-map-zoom`;for(let[e,t]of No.entries()){let r=n.createElement(`button`);r.type=`button`,r.className=`tc-download-toggle`,r.value=e?`out`:`in`;let i=n.createElementNS(Mo,`svg`);i.setAttribute(`viewBox`,`0 0 24 24`),i.setAttribute(`width`,`16`),i.setAttribute(`height`,`16`),i.setAttribute(`aria-hidden`,`true`);let a=n.createElementNS(Mo,`path`);a.setAttribute(`d`,t),i.append(a),r.append(i),m.append(r)}m.addEventListener(`click`,j),t.classList.add(`tc-container`)}m.isConnected||t.append(m);let{zoom:e}=i(),r=typeof e==`object`?e.labels:void 0,a=_(),c=s()?.max??1,[l,u]=m.querySelectorAll(`button`);l&&u&&a&&(l.setAttribute(`aria-label`,r?.in??`Zoom in`),u.setAttribute(`aria-label`,r?.out??`Zoom out`),l.disabled=a.scale>=c,u.disabled=a.scale<=1)},destroy(){g(),M(),t.removeEventListener(`pointermove`,E,!0),t.removeEventListener(`click`,k,!0),t.removeEventListener(`pointerdown`,T),t.removeEventListener(`wheel`,D),t.removeEventListener(`dblclick`,O),t.removeEventListener(`keydown`,A),n.removeEventListener(`pointerup`,w),n.removeEventListener(`pointercancel`,w),m?.remove(),m&&h&&t.classList.remove(`tc-container`)}}}}}let Fo=`var(--tc-heat-empty,var(--tc-grid-color))`;function Io(e,t,n,r,i){return{position(i){let a=r&&n!==null&&e<n&&n<t?i<=n?(i-e)/(n-e)*.5:.5+(i-n)/(t-n)*.5:t>e?(i-e)/(t-e):+(i>e);return Math.min(1,Math.max(0,a))},paint(e){if(r){let t=e*(r.length-1),n=Math.min(r.length-2,Math.floor(t)),i=U((t-n)*100),a=r[n],o=i<=0?a:i>=100?r[n+1]:`color-mix(in oklab,${r[n+1]} ${i}%,${a})`;return{style:{"--tc-cell-fill":o},color:o}}let t=U((i+(1-i)*e)*100);return{style:`--tc-heat:${t}%`,color:`color-mix(in oklab,var(--tc-heat-color,var(--tc-color-1)) ${t}%,${Fo})`}}}}let Lo=e=>e.select===`multiple`?e.selected??[]:e.select===`single`?(e.selected??[]).slice(0,1):[],Ro=.2,zo=Math.PI/180,Bo={};function Vo(e,t){Bo[e]=t}let Ho=e=>Y(e)&&Y(e.regions)&&(J(e.width)??0)>0&&(J(e.height)??0)>0;function Uo(e){let t=[],n=[],r=0,i=0;for(let[,a=``,o=``]of e.matchAll(/([MLHVZ])([^MLHVZ]*)/gi)){let e=(o.match(/-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi)??[]).map(Number),s=a>=`a`,c=a.toUpperCase();if(c===`Z`){n.length&&(r=n[0],i=n[1]);continue}let l=c===`H`||c===`V`?1:2;for(let a=0;a+l<=e.length;a+=l){let o=e[a],l=e[a+1];c===`H`?r=s?r+o:o:c===`V`?i=s?i+o:o:(r=s?r+o:o,i=s?i+l:l),c===`M`&&a===0&&(n=[],t.push(n)),n.push(r,i)}}return t}let Wo=/* @__PURE__ */ new WeakMap;function Go(e){let t=Wo.get(e);if(t)return t;t=/* @__PURE__ */ new Map;for(let[n,r]of Object.entries(e.regions)){if(!Y(r)||typeof r.path!=`string`)continue;let e=Uo(r.path).filter(e=>e.every(Number.isFinite)),i=[1/0,1/0,-1/0,-1/0],a=0,o=0,s=-1;for(let t of e){let e=1/0,n=1/0,r=-1/0,c=-1/0;for(let i=0;i<t.length;i+=2)e=Math.min(e,t[i]),r=Math.max(r,t[i]),n=Math.min(n,t[i+1]),c=Math.max(c,t[i+1]);i[0]=Math.min(i[0],e),i[1]=Math.min(i[1],n),i[2]=Math.max(i[2],r),i[3]=Math.max(i[3],c);let l=(r-e)*(c-n);l>s&&(s=l,a=(e+r)/2,o=(n+c)/2)}s<0||t.set(n,{code:n,name:qt(r.name)||n,path:r.path,point:r.point===!0,rings:e,box:i,x:a,y:o})}return Wo.set(e,t),t}function Ko(e,t,n){let r=!1;for(let i of e)for(let e=0,a=i.length-2;e<i.length;a=e,e+=2){let o=i[e],s=i[e+1],c=i[a],l=i[a+1];s>n!=l>n&&t<(c-o)*(n-s)/(l-s)+o&&(r=!r)}return r}let qo=(e,t,n)=>`M${U(e-n)} ${U(t)}a${n} ${n} 0 1 0 ${n*2} 0a${n} ${n} 0 1 0 ${-n*2} 0Z`;function Jo(e,t){let{width:n,height:r,fontSize:i,locale:a}=t;if(typeof e.map==`string`&&!Bo[e.map])throw Error(`[tabler-charts] Map "${e.map}" is not registered. Import it (e.g. from '@tabler/charts/maps/world') and call addMap('${e.map}', data).`);let o=typeof e.map==`string`?Bo[e.map]:e.map;if(!Ho(o))return{content:null};let s=Go(o),c=e.data??{},u=K(e.format,a),d=Math.max(0,J(e.markerRadius)??4),f=[],p=/* @__PURE__ */ new Map,m=1/0,h=-1/0;for(let e of Object.keys(c)){let t=s.get(e),n=J(c[e]);t&&n!==null&&(p.set(t,f.length),f.push({shape:t,value:n}),n<m&&(m=n),n>h&&(h=n))}let g=f.length,_=J(e.min)??(g?Math.min(0,m):0),v=J(e.max)??(g?h:1),y=e.colors&&e.colors.length>=2?e.colors:void 0,{position:b,paint:x}=Io(_,v,J(e.mid),y,.1),S=Ve(e.padding,0),C=e.scale!==!1&&g>0,w=C?Math.ceil(i*W)+8:0,T=Ue(n,r,{...S,bottom:S.bottom+w}),E=typeof e.zoom==`object`?e.zoom:{},D={...T,k:Math.max(0,Math.min(T.width/o.width,T.height/o.height)),mapWidth:o.width,mapHeight:o.height,max:Math.max(1,J(E.max)??8)},O=jo(e.view,D),k=Math.round(D.k*O.scale*1e4)/1e4,A=U(T.x-O.x*k),j=U(T.y-O.y*k),M=e=>A+e*k,N=e=>j+e*k,P=O.scale>1,F=new Set(Lo(e)),{projection:I}=o,L=Y(I)&&J(I.scale)!==null&&Array.isArray(I.translate)&&I.translate.slice(0,2).every(e=>J(e)!==null)?(e,t)=>[M(e*zo*I.scale+I.translate[0]),N(I.translate[1]-1.25*Math.log(Math.tan(Math.PI/4+.4*t*zo))*I.scale)]:void 0,R=[];if(L&&k>0)for(let t of e.markers??[]){let[e,n]=L(t.lng,t.lat);Number.isFinite(e)&&Number.isFinite(n)&&R.push({name:t.name??``,x:e,y:n})}let ee=f.length;for(let e of R)f.push({marker:e,value:null});let z=f.length;for(let e of s.values())e.point||p.has(e)||(p.set(e,f.length),f.push({shape:e,value:null}));let te=e=>{let t=f[e];if(!t)return null;let{shape:n,marker:r}=t,i=r??(n?.point?{x:M(n.x),y:N(n.y)}:void 0),a=i?.x??M(n?.x??0),o=i?.y??N(n?.y??0),s=r?.name??n?.name??``,c=t.value;return{index:e,label:n?.code??s,...n?{region:n.code}:{marker:s},title:``,x:a,area:T,items:[{name:s,seriesIndex:0,value:c,text:c===null?``:u(c),x:a,y:o,color:r?`var(--tc-map-marker-color,var(--tc-color-1))`:c===null?Fo:x(b(c)).color}],highlight:{kind:`halo`,d:i?qo(i.x,i.y,d+3):(n?.rings??[]).map(e=>{let t=``;for(let n=0;n<e.length;n+=2)t+=`${n?`L`:`M`}${Math.round(M(e[n])*10)/10} ${Math.round(N(e[n+1])*10)/10}`;return`${t}Z`}).join(``)}}},ne={count:z,map:D,hitIndex:te,hitTest(e,t){if(!(k>0)||e<T.x||e>T.x+T.width||t<T.y||t>T.y+T.height)return null;let n=n=>Math.hypot(n.x-e,n.y-t)<=d+4;for(let e=z-1;e>=ee;e--)if(n(f[e]?.marker))return te(e);for(let e=0;e<g;e++){let t=f[e]?.shape;if(t.point&&n({x:M(t.x),y:N(t.y)}))return te(e)}let r=(e-A)/k,i=(t-j)/k;for(let[e,t]of p){let[n,a,o,s]=e.box;if(!(e.point||r<n||r>o||i<a||i>s)&&Ko(e.rings,r,i))return te(t)}return null}},re=[],ie=[],ae=[];for(let e of s.values()){let t=p.get(e),n=t===void 0?null:f[t]?.value??null,r=n===null?void 0:x(b(n)).style,i=F.has(e.code)&&`tc-region-selected`;e.point?n!==null&&ae.push(l(`circle`,{key:e.code,class:[`tc-region tc-region-point tc-cell`,i],"data-region":e.code,cx:U(M(e.x)),cy:U(N(e.y)),r:d,style:r})):(i?ie:re).push(l(`path`,{key:e.code,class:[`tc-region`,n===null?`tc-region-empty`:`tc-cell`,i],"data-region":e.code,d:e.path,style:r}))}let oe=new Map(R.map(e=>[e.name,e])),se=(e.lines??[]).flatMap((e,t)=>{let n=oe.get(e.from),r=oe.get(e.to);if(!n||!r)return[];let i=(n.x+r.x)/2+(r.y-n.y)*Ro,a=(n.y+r.y)/2-(r.x-n.x)*Ro;return l(`path`,{key:`${e.from}›${e.to}›${t}`,class:`tc-map-line`,d:`M${U(n.x)} ${U(n.y)}Q${U(i)} ${U(a)} ${U(r.x)} ${U(r.y)}`})}),ce=typeof e.scale==`object`?e.scale:{},le=ce.low??u(_),ue=ce.high??u(v),de=H(le,i),B=de+8+120+8+H(ue,i),fe=Math.round(T.x+Math.max(0,(T.width-B)/2)),pe=Math.round(fe+de+8),V=T.y+T.height+8+(w-8)/2,me=e.select===`single`||e.select===`multiple`,he=`${t.id}-map`;return{content:[P&&l(`clipPath`,{key:`clip`,id:he},l(`rect`,{x:T.x,y:T.y,width:T.width,height:T.height})),l(`g`,{key:`map`,class:[`tc-map`,me&&`tc-map-selectable`],"clip-path":P?`url(#${he})`:void 0},k>0&&l(`g`,{key:`regions`,class:`tc-map-regions`,transform:`translate(${A} ${j}) scale(${k})`},re,ie),l(`g`,{key:`points`,class:`tc-map-points`},ae),l(`g`,{key:`lines`,class:`tc-map-lines`},se),l(`g`,{key:`markers`,class:`tc-map-markers`},R.map((e,t)=>l(`circle`,{key:`${e.name}›${t}`,class:`tc-map-marker`,"data-marker":e.name,cx:U(e.x),cy:U(e.y),r:d})))),C&&l(`g`,{key:`scale`,class:`tc-map-scale`,"aria-hidden":`true`,"shape-rendering":`crispEdges`},l(`text`,{class:`tc-tick-label`,x:fe,y:U(V),dy:`0.32em`},le),Array.from({length:24},(e,t)=>l(`rect`,{key:t,class:`tc-cell`,x:pe+t*5,y:U(V-4),width:5,height:8,style:x(t/23).style})),l(`text`,{class:`tc-tick-label`,x:pe+120+8,y:U(V),dy:`0.32em`},ue))],interaction:ne}}function Yo(e,t,n){let r=typeof e.map==`string`?Bo[e.map]:e.map,i=Ho(r)?Go(r):void 0,a=K(e.format,t.locale),o=[];for(let[t,n]of Object.entries(e.data??{})){let e=J(n),r=i?.get(t);r&&e!==null&&o.push([r.name,a(e)])}return{columns:[``,`Value`],total:o.length,rows:o.slice(0,n)}}function Xo(e){let t=typeof e.map==`string`?Bo[e.map]:e.map;if(!Ho(t))return;let n=e.scale!==!1&&Object.keys(e.data??{}).length>0;return U(600/(600*t.height/t.width+(n?23:0)))}let Zo=e=>{let t=e,n={};if(Y(t.data))for(let[e,r]of Object.entries(t.data)){let t=J(r);t!==null&&(n[e]=t)}return{...e,map:typeof t.map==`string`||Ho(t.map)?t.map:void 0,data:n,colors:Kt(t.colors).filter(e=>typeof e==`string`&&e.trim()!==``),markers:Xt(t.markers,e=>({lat:J(e.lat),lng:J(e.lng),...typeof e.name==`string`?{name:e.name}:{}})).filter(e=>e.lat!==null&&e.lng!==null),lines:Xt(t.lines,e=>({from:qt(e.from),to:qt(e.to)})),select:t.select===`single`||t.select===`multiple`?t.select:void 0,selected:Kt(t.selected).filter(e=>typeof e==`string`),view:Y(t.view)?t.view:void 0,onSelect:typeof t.onSelect==`function`?t.onSelect:void 0}},Qo={name:`map`,clean:e=>{let t=Zo(e);if(t.aspectRatio!==void 0&&t.aspectRatio!==t.autoRatio)return t;let n=Xo(t);return{...t,aspectRatio:n,autoRatio:n}},render:Jo,table:Yo,plugins:[Po()]},$o=5e3;function es(e,t){return e.data.map((e,t)=>({data:e,index:t,seats:Math.min($o,Math.max(0,Math.round(e.seats||0)))})).filter(e=>!t.has(X(e.data))).map((e,t)=>({...e,position:t}))}function ts(e,t){let n=Math.min($o,t.reduce((e,t)=>e+t.seats,0)),r=Math.min($o,Math.round(e.total??0));return{taken:n,total:Math.max(n,r>0?r:0)}}function ns(e,t){let n=t.reduce((e,t)=>e+t,0),r=t.map(t=>Math.floor(e*t/n)),i=e-r.reduce((e,t)=>e+t,0),a=t.map((t,i)=>({i,lost:e*t/n-r[i]})).sort((e,t)=>t.lost-e.lost||t.i-e.i);for(let{i:e}of a){if(i<=0)break;r[e]=r[e]+1,i--}return r}function rs(e,t,n,r,i,a){let o={x0:0,y0:0,x1:0,y1:0};if(e<=0)return{seats:[],dot:0,box:o};let s=1-i,c=r>=Math.PI*2-1e-9,l=e=>Array.from({length:e},(t,n)=>e>1?i+n*s/(e-1):1),u=e=>e>1?s/(e-1):s,d=e=>{let t=u(e);return l(e).reduce((e,n)=>e+Math.floor(n*r/t)+ +!c,0)},f=t&&t>0?Math.min(Math.round(t),e):1;if(!t)for(;f<e&&d(f)<e;)f++;let p=l(f),m=u(f),h=ns(e,p),g=[],_=f>1?m:1/0;p.forEach((e,t)=>{let i=h[t],a=i>1?r/(c?i:i-1):0;i>1&&(_=Math.min(_,e*a));for(let o=0;o<i;o++){let s=i>1?n+o*a:n+r/2;g.push({x:e*Math.sin(s),y:-e*Math.cos(s),angle:s,row:t})}}),g.sort((e,t)=>e.angle-t.angle||e.row-t.row);let v=(Number.isFinite(_)?_:s)*(1-a)*.5;for(let e of g)o.x0=Math.min(o.x0,e.x-v),o.x1=Math.max(o.x1,e.x+v),o.y0=Math.min(o.y0,e.y-v),o.y1=Math.max(o.y1,e.y+v);return{seats:g,dot:v,box:o}}function is(e,t){let{width:n,height:r,locale:i}=t,a=Ue(n,r,Ve(e.padding,0)),o=Math.min(360,Math.max(0,e.angle??180))*ro,s=(e.startAngle??-(o/ro)/2)*ro,c=Math.min(.95,Math.max(0,e.innerRadius??.45)),u=Math.min(.9,Math.max(0,e.gap??.35)),d=es(e,t.hidden),{taken:f,total:p}=ts(e,d),m=rs(p,e.rows,s,o,c,u),h=e.center,g=h!==!1,_=g?h?.label:void 0,v=o<=Math.PI+1e-9&&Math.abs(s+o/2)<1e-9,y=t.fontSize,b=g?v?-(_?3.4:2.1)*y:-1.4*y:0,x=g?v?0:(_?2:.7)*y:0,S=Math.min(a.width,a.height)/2,C={x0:0,y0:0,x1:0,y1:0};for(let e=0;e<4&&S>0;e++){C={x0:Math.min(m.box.x0*S,0),y0:Math.min(m.box.y0*S,b),x1:Math.max(m.box.x1*S,0),y1:Math.max(m.box.y1*S,x)};let e=Math.min(a.width/(C.x1-C.x0),a.height/(C.y1-C.y0));if(Math.abs(e-1)<.001)break;S=Math.max(0,S*e)}let w=a.x+(a.width-(C.x1-C.x0))/2-C.x0,T=a.y+(a.height-(C.y1-C.y0))/2-C.y0,E=U(m.dot*S),D=e=>[w+e.x*S,T+e.y*S],O=0,k=d.map(e=>{let t=O;return O+=e.seats,m.seats.slice(t,O)}),A=m.seats.slice(f,p),j=d.filter(e=>e.seats>0),M=K(e.format,i),N=G(i,{style:`percent`,maximumFractionDigits:1}),P=(e,t)=>{let n=k[e.position],r=0,i=0;if(t)[r,i]=D(t);else for(let e of n){let[t,a]=D(e);r+=t/n.length,i+=a/n.length}let a={name:e.data.name,seriesIndex:e.index,value:e.seats,text:`${M(e.seats)} (${N.format(p>0?e.seats/p:0)})`,x:r,y:i};e.data.color&&(a.color=e.data.color);let o=E+3,s=n.map(e=>{let[t,n]=D(e);return`M${U(t+o)},${U(n)}A${o},${o},0,1,1,${U(t-o)},${U(n)}A${o},${o},0,1,1,${U(t+o)},${U(n)}Z`}).join(``);return{index:j.indexOf(e),label:e.data.name,title:``,x:r,area:{x:w-S,y:T-S,width:S*2,height:S*2},items:[a],seriesIndex:e.index,highlight:{kind:`halo`,d:s}}},F={count:j.length,hitIndex:e=>{let t=j[e];return t?P(t):null},hitTest(e,t){let n=E+2,r;for(let i of j)for(let a of k[i.position]){let[o,s]=D(a),c=Math.hypot(e-o,t-s);c<=n&&(!r||c<r.d)&&(r={party:i,seat:a,d:c})}return r?P(r.party,r.seat):null}},I=(e,t,n)=>{let[r,i]=D(e);return l(`circle`,{key:t,class:n,r:E,style:`transform:translate(${U(r-w)}px,${U(i-T)}px)`})},L=d.map(e=>l(`g`,nn(e.data,e.index),k[e.position].map((e,t)=>I(e,t,`tc-seat`)))),R=g?h?.value??M(p):``;return{content:[l(`g`,{class:`tc-parliament`,style:`transform:translate(${U(w)}px,${U(T)}px)`},l(`g`,{class:`tc-parliament-seats`},L,A.length>0&&l(`g`,{key:`vacant`,class:`tc-parliament-vacant`},A.map((e,t)=>I(e,t,`tc-seat tc-seat-vacant`))))),g&&l(`g`,{class:`tc-parliament-center`,"aria-hidden":`true`},_&&l(`text`,{class:`tc-parliament-label`,x:U(w),y:U(T),dy:v?`-2.5em`:`1.6em`,"text-anchor":`middle`},_),l(`text`,{class:`tc-parliament-value`,x:U(w),y:U(T),dy:v?`-0.4em`:_?`0`:`0.35em`,"text-anchor":`middle`},R))],interaction:F}}function as(e,t){let n=es(e,t.hidden),{total:r}=ts(e,n),i=K(e.format,t.locale),a=G(t.locale,{style:`percent`,maximumFractionDigits:1});return{columns:[``,`Seats`,`Share`],rows:n.map(e=>[e.data.name,i(e.seats),a.format(r>0?e.seats/r:0)])}}let os={name:`parliament`,clean:$t(e=>Xt(e,e=>({...Zt(e),seats:J(e.seats)??0}))),render:is,legend:e=>tn(e.data),table:as};function ss(e,t,n=`Others`){let r=e.map((e,t)=>({data:e,index:t,value:Math.max(0,e.value||0)})),i=Number.isFinite(t)&&t>=0?t:9,a=i?Math.max(1,Math.round(i)):1/0;if(r.length<=a)return r;let o=new Set([...r].sort((e,t)=>t.value-e.value||e.index-t.index).slice(0,a-1)),s=r.reduce((e,t)=>o.has(t)?e:e+t.value,0);return[...r.filter(e=>o.has(e)),{data:{name:n,id:`__others__`,value:s},index:Math.max(8,r.length),value:s,others:!0}]}function cs(e){return e.map(({data:e,index:t})=>{let n={key:X(e),name:e.name,index:t};return e.color&&(n.color=e.color),e.hidden&&(n.hidden=!0),n})}let ls=e=>({...e,slices:ss(e.data,e.maxSlices,e.othersLabel)}),us=e=>cs(e.slices);function ds(e,t){let n=e.slices.filter(e=>!t.has(X(e.data)));return e.order===`size`&&n.sort((e,t)=>Number(!!e.others)-Number(!!t.others)||t.value-e.value||e.index-t.index),{segments:n,total:n.reduce((e,t)=>e+t.value,0)}}function fs(e,t){let{width:n,height:r,locale:i}=t,a=Math.max(0,e.gap??2),o=Math.max(0,e.radius??4),s=Ue(n,r,Ve(e.padding,0)),{segments:c,total:u}=ds(e,t.hidden),d=c.filter(e=>e.value>0),f=s.x,p=d.map((e,n)=>{let r=e.value/u*s.width,i=n===0?0:a/2,o=n===d.length-1?0:a/2,c=Math.max(0,r-i-o),l=f+i,p={x:t.rtl?s.x*2+s.width-l-c:l,y:s.y,width:c,height:s.height};return f+=r,p}),m=K(e.format,i),h=G(i,{style:`percent`,maximumFractionDigits:1}),g=e=>{let t=d[e],n=p[e],r=n.x+n.width/2,i={name:t.data.name,seriesIndex:t.index,value:t.value,text:`${m(t.value)} (${h.format(t.value/u)})`,x:r,y:n.y+n.height/2,box:n};t.data.color&&(i.color=t.data.color);let a=U;return{index:e,label:t.data.name,title:``,x:r,area:s,items:[i],seriesIndex:t.index,highlight:{kind:`halo`,d:`M${a(n.x+1)},${a(n.y+1)}h${a(n.width-2)}v${a(n.height-2)}h${a(2-n.width)}Z`}}},_={count:d.length,reversed:t.rtl===!0,hitIndex:e=>d[e]?g(e):null,hitTest(e,t){if(t<s.y||t>s.y+s.height)return null;let n=p.findIndex(t=>e>=t.x-a/2&&e<=t.x+t.width+a/2);return n<0?null:g(n)}};return{content:l(`g`,{class:`tc-percentage-bar`},d.length===0&&l(`rect`,{key:`track`,class:`tc-percentage-bar-track`,x:U(s.x),y:U(s.y),width:U(s.width),height:U(s.height),rx:U(Math.min(o,s.width/2,s.height/2))}),c.map(e=>{let t=p[d.indexOf(e)];return l(`g`,nn(e.data,e.index),t&&l(`rect`,{class:`tc-segment`,x:U(t.x),y:U(t.y),width:U(t.width),height:U(t.height),rx:U(Math.min(o,t.width/2,t.height/2))}))})),interaction:_}}function ps(e,t){let{segments:n,total:r}=ds(e,t.hidden),i=K(e.format,t.locale),a=G(t.locale,{style:`percent`,maximumFractionDigits:1});return{columns:[``,`Value`,`Share`],rows:n.map(e=>[e.data.name,i(e.value),a.format(r>0?e.value/r:0)])}}let ms={name:`percentage-bar`,clean:e=>{let t=e;return{...t,data:en(t.data),height:t.height??(t.aspectRatio?void 0:16)}},prepare:ls,render:fs,legend:us,table:ps,valueLabels:{marks:`cell`}};function hs(e,t){let n=e.slices.filter(e=>!t.has(X(e.data))),r=n.reduce((e,t)=>e+t.value,0),i=(e.startAngle??0)*ro;return{slices:n.map(e=>{let t=r>0?e.value/r*Math.PI*2:0,n={...e,startAngle:i,endAngle:i+t};return i+=t,n}),total:r}}function gs(e,t,n){let{width:r,height:i,locale:a}=t,s=e.gap??2,{slices:c,total:u}=hs(e,t.hidden),d=c.filter(e=>e.value>0),f=K(e.format,a),p=G(a,{style:`percent`,maximumFractionDigits:1}),m=Ue(r,i,Ve(e.padding,0)),h=e.labels===!0?`share`:e.labels?e.labels.value:!1,g=e.labels?o(`slice-labels`)(d.map(e=>({key:X(e.data),index:e.index,name:e.data.name,value:h===!1?``:h===`value`?f(e.value):p.format(e.value/u),angle:(e.startAngle+e.endAngle)/2,weight:e.value})),m,t.fontSize):null,_=g?.area??m,v=Math.max(0,Math.min(_.width,_.height)/2-8),y=v*Math.min(.95,Math.max(0,e.innerRadius??n.inner)),b=e.cornerRadius??n.corner,x=_.x+_.width/2,S=_.y+_.height/2,C=y===0&&d.length>1?s:0,w=y>0&&d.length>1?uo(s,y,v):0,T=(e,t=y,n=v)=>({innerRadius:t,outerRadius:n,startAngle:e.startAngle,endAngle:e.endAngle,padAngle:w,cornerRadius:b}),E=(e,t)=>{let[n,r]=lo(T(e)),i={name:e.data.name,seriesIndex:e.index,value:e.value,text:`${f(e.value)} (${p.format(u>0?e.value/u:0)})`,x:x+n,y:S+r};return e.data.color&&(i.color=e.data.color),{index:t,label:e.data.name,title:``,x:x+n,area:{x:x-v,y:S-v,width:v*2,height:v*2},items:[i],seriesIndex:e.index,highlight:{kind:`halo`,d:po({...T(e,v+2,v+6),cornerRadius:2}),x,y:S}}},D={count:d.length,hitIndex:e=>{let t=d[e];return t?E(t,e):null},hitTest(t,n){let r=t-x,i=n-S,a=Math.hypot(r,i);if(a<y-2||a>v+8)return null;let o=(e.startAngle??0)*ro,s=Math.PI*2,c=Math.atan2(r,-i);c=o+((c-o)%s+s)%s;let l=d.findIndex(e=>c>=e.startAngle&&c<e.endAngle);return l===-1?null:E(d[l],l)}},O=c.map(e=>l(`g`,nn(e.data,e.index),mo(`tc-slice`,T(e)))),k=e.center,A=y>0&&k!==!1,j=A?k?.value??f(u):``,M=A?k?.label:void 0;return{content:[l(`g`,{class:`tc-pie`,style:`transform:translate(${x}px,${S}px)`},u===0&&l(`path`,{class:`tc-pie-track`,d:po({innerRadius:y,outerRadius:v,startAngle:0,endAngle:Math.PI*2})}),l(`g`,{class:`tc-pie-slices`,style:C>0?`--tc-pie-gap:${C}px`:void 0},O)),g?.layer(x,S,v),A&&l(`g`,{class:`tc-pie-center`,"aria-hidden":`true`},l(`text`,{class:`tc-pie-value`,x,y:S,dy:M?`0`:`0.35em`,"text-anchor":`middle`},j),M&&l(`text`,{class:`tc-pie-label`,x,y:S,dy:`1.6em`,"text-anchor":`middle`},M))],interaction:D}}function _s(e,t){let{slices:n,total:r}=hs(e,t.hidden),i=K(e.format,t.locale),a=G(t.locale,{style:`percent`,maximumFractionDigits:1});return{columns:[``,`Value`,`Share`],rows:n.map(e=>[e.data.name,i(e.value),a.format(r>0?e.value/r:0)])}}function vs(e,t){return{name:e,clean:$t(en),prepare:ls,render:(e,n)=>gs(e,n,t),sweep:ho,legend:us,table:_s,valueLabels:{marks:`slice`}}}let ys=vs(`pie`,{inner:0,corner:0}),bs=vs(`donut`,{inner:.62,corner:4});function xs(e,t,n){if(H(e,n)<=t)return e;let r=e.length;for(;r>0&&H(`${e.slice(0,r)}…`,n)>t;)r--;return r>0?`${e.slice(0,r).trimEnd()}…`:``}function Ss(e,t,n){let r=[],i=``;for(let a of e.split(` `)){let e=i?`${i} ${a}`:a;!i||H(e,n)<=t?i=e:(r.push(i),i=a)}return r.push(i),r.length>3&&r.splice(2,r.length,r.slice(2).join(` `)),r}let Cs=e=>e>.1?1:e<-.1?-1:0;function ws(e,t,n,r){let i=Math.min(e.width,e.height)/2;return t.forEach((t,a)=>{let o=Math.sin(t),s=Math.cos(t),c=n[a]??[],l=Math.max(0,...c.map(e=>H(e,r))),u=Ts(c.length,r),d=Cs(o),f=d===0?l/2:l+8;if(Math.abs(o)>1e-6&&(i=Math.min(i,(e.width/2-f)/Math.abs(o))),Math.abs(s)>1e-6){let t=(d===0?u+8:u/2)/Math.abs(s);i=Math.min(i,e.height/2/Math.abs(s)-t)}}),Math.max(0,i)}let Ts=(e,t)=>t*(1+Math.max(0,e-1)*W);function Es(e,t){let{width:n,height:r,fontSize:i,locale:a}=t,o=e.r??{},{fill:s=!0,points:c=!1,pointRadius:u=4}=e,d=e.data.series,f=ln(e.data),p=f.length,m=d.filter(e=>!t.hidden.has(Q(e))),h=e.format??(e=>String(e)),g=bt(o.format,a),_=Ve(e.padding),v=Ue(n,r,{top:_.top+8,right:_.right+8,bottom:_.bottom+8,left:_.left+8}),y=v.x+v.width/2,b=v.y+v.height/2,x=f.map((e,t)=>t/Math.max(1,p)*Math.PI*2),S=f.map((e,t)=>h(e,t)),C=e.labelWidth??v.width/4,w=S.map(e=>Ss(e,C,i)),T=Math.max(ws(v,x,w,i),Math.min(v.width,v.height)/2*.5),E=w.map((e,t)=>{let n=Math.sin(x[t]),r=Cs(n)===0?v.width:v.width/2-T*Math.abs(n)-8;return e.map(e=>xs(e,r,i))}),D=vn(o,Math.max(2,Math.round(T/40))),O=Wt(bn(m.flatMap(e=>e.values),o,!0,D),[0,T],{clamp:!0}),k=Nt(O,{count:D,format:o.format,locale:a}),A=(e,t)=>[y+t*Math.sin(x[e]),b-t*Math.cos(x[e])],j=e=>`${e.map((e,t)=>`${t?`L`:`M`}${A(t,e).map(U).join(`,`)}`).join(``)}Z`,M=t=>e.grid===`circle`?`M${U(y)},${U(b-t)}A${U(t)},${U(t)},0,1,1,${U(y)},${U(b+t)}A${U(t)},${U(t)},0,1,1,${U(y)},${U(b-t)}Z`:j(f.map(()=>t)),N=e=>e!=null&&Number.isFinite(e)?O(e):0,P=e=>{let n=[];d.forEach((r,i)=>{if(t.hidden.has(Q(r)))return;let a=r.values[e],o=a!=null&&Number.isFinite(a)?a:null,[s,c]=A(e,N(o)),l={name:r.name,seriesIndex:i,value:o,text:o===null?`–`:g(o),x:s,y:o===null?null:c};r.color&&(l.color=r.color),n.push(l)});let[r,i]=A(e,T);return{index:e,label:Z(f[e]),title:S[e],x:r,area:{x:y-T,y:b-T,width:T*2,height:T*2},items:n,highlight:{kind:`spoke`,x1:y,y1:b,x2:r,y2:i}}},F={count:p,hitTest(e,t){if(p===0||Math.hypot(e-y,t-b)>T+8)return null;let n=Math.atan2(e-y,b-t),r=(n<0?n+Math.PI*2:n)/(Math.PI*2);return P(Math.round(r*p)%p)},hitIndex(e,t){if(e<0||e>=p)return null;let n=P(e);return t!==void 0&&n.items.some(e=>e.seriesIndex===t)&&(n.seriesIndex=t),n}},I=l(`g`,{key:`grid`,class:`tc-radar-grid`,"aria-hidden":`true`},k.filter(e=>e.position>0).map(e=>l(`path`,{key:e.value,class:`tc-radar-ring`,d:M(e.position)})),f.map((e,t)=>{let[n,r]=A(t,T);return l(`line`,{key:Z(e),class:`tc-radar-spoke`,x1:U(y),y1:U(b),x2:U(n),y2:U(r)})})),L=gn(e),R=d.map((e,n)=>{if(t.hidden.has(Q(e)))return null;let r=j(f.map((t,n)=>N(e.values[n])));return l(`g`,Dn(e,n),s&&l(`path`,{class:`tc-area`,d:r}),l(`path`,{class:`tc-line`,d:r}),c&&l(`g`,{class:`tc-points`},f.map((t,r)=>{let i=e.values[r];if(i==null||!Number.isFinite(i))return null;let[a,o]=A(r,O(i));return _n(L,n,Z(t),`tc-point`,U(a),U(o),u)})))}),ee=l(`g`,{key:`labels`,class:`tc-radar-labels`,"aria-hidden":`true`},f.map((e,t)=>{let n=x[t],r=Cs(Math.sin(n)),i=Math.cos(n),[a,o]=A(t,T+8),[s=``,...c]=E[t]??[],u=c.length*W,d=r===0?i>0?`${U(-u)}em`:`0.71em`:`${U(.35-u/2)}em`;return l(`text`,{key:Z(e),class:`tc-tick-label tc-radar-label`,x:U(a),y:U(o),"text-anchor":r>0?`start`:r<0?`end`:`middle`,dy:d},s,c.map((e,t)=>l(`tspan`,{key:t,x:U(a),dy:`${W}em`},e)))})),z=o.show!==!1&&l(`g`,{key:`values`,class:`tc-radar-values`,"aria-hidden":`true`},k.filter(e=>e.position>0).map(e=>l(`text`,{key:e.value,class:`tc-tick-label tc-radar-value`,x:U(y+4),y:U(b-e.position),dy:`0.35em`},e.label)));return{content:[I,l(`g`,{key:`series`,class:`tc-series-list tc-radar-series`,style:`transform-origin:${U(y)}px ${U(b)}px`},R),ee,z],interaction:F}}let Ds={name:`radar`,clean:$t(Qt),render:Es,legend:e=>cn(e.data),table:(e,t,n)=>kn({data:e.data,...e.r?.format?{y:{format:e.r.format}}:{},...e.format?{x:{format:e.format}}:{}},t,n)},Os=864e5,ks=(e,t)=>{if(!t)return J(e);let n=pn(e);return Number.isFinite(n)?n:null};function As(e){let t=e.x?.type===`time`,n=[],r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=[];for(let o of e.data){let e=ks(o.from,t),s=ks(o.to,t);if(e===null||s===null)continue;let c=r.get(o.name);c===void 0&&(c=n.length,r.set(o.name,c),n.push(o.name));let l=o.id??o.name,u=i.get(l)??0;i.set(l,u+1),a.push({item:o,key:u?`${l}/${u}`:l,row:c,from:Math.min(e,s),to:Math.max(e,s)})}return{...e,timed:t,rows:n,bars:a}}function js(e,t){let{format:n,utc:r}=e.x??{};if(!e.timed)return bt(n,t);if(typeof n==`function`)return n;let[i,a]=Ut(e.bars.flatMap(e=>[e.from,e.to]))??[0,0],s=o(`dates`)([i,a],r,t);return e=>s(e)}function Ms(e){let t=t=>ks(t,e.timed);return Kt(e.annotations).filter(Y).flatMap(e=>{let{x:n,y:r,...i}=e,a={...i};if(n!==void 0){let e=Array.isArray(n)?n.map(t):t(n);if(e===null||Array.isArray(e)&&(e.length!==2||e.includes(null)))return[];a.y=e}return r!==void 0&&(a.x=typeof r==`string`&&(n===void 0||Array.isArray(n))?[r,r]:r),[a]})}function Ns(e,t,n){let r=e.x??{},i=vn(r,Math.max(2,Math.round(t.width/80))),a=[...e.bars.flatMap(e=>[e.from,e.to]),...n],s=ks(r.min,e.timed),c=ks(r.max,e.timed);if(!e.timed){let{format:e}=r,n=bn(a,{...s===null?{}:{min:s},...c===null?{}:{max:c},nice:r.nice!==!1},!1,i);return{domain:n,ticks:r=>Nt(Wt(n,r),{count:i,format:e,locale:t.locale})}}let l=o(`time`).scale,u=r.utc===!0,[d,f]=Ut(a)??[0,Os];if(d===f&&(d-=Os/2,f+=Os/2),s!==null&&(d=s),c!==null&&(f=c),r.nice!==!1)for(let e=0;e<2;e++){let[e,t]=l([d,f],[0,1],{utc:u}).nice(i).domain;s===null&&(d=e),c===null&&(f=t)}let p=[d,f],{format:m}=r;return{domain:p,ticks(e){let n=l(p,e,{utc:u}),r=typeof m==`function`?e=>m(e.getTime()):n.tickFormat(i,t.locale);return n.ticks(i).map(e=>({value:e.getTime(),position:n(e),label:r(e)}))}}}function Ps(e,t){let{radius:n=4,maxBarWidth:r=24,groupPadding:i=.3,rows:a,bars:o}=e,{fontSize:s}=t,c=e.x??{},u=e.y??{},d=Ms(e),f=Ns(e,t,d.flatMap(e=>e.y===void 0?[]:e.y)),p=c.show!==!1,m=u.show!==!1&&a.length>0,h=f.ticks([0,1]),g=a.map(e=>({value:e,position:0,label:e})),_=e=>p&&e?Math.ceil(H(e.label,s)/2):0,{area:v,side:y,range:b}=We(t,e.padding,e=>({top:e.top+4,bottom:e.bottom+Math.max((p?q(`bottom`,h,s):0)+Lt(c.title,s),4),start:e.start+Math.max((m?q(`left`,g,s):0)+Lt(u.title,s),_(h[0]),8),end:e.end+Math.max(_(h[h.length-1]),8)})),x=Vt(a,[v.y,v.y+v.height],{paddingInner:i,paddingOuter:i/2}),S=Wt(f.domain,b()),C=It(f.ticks(S.range),`bottom`,s),w=m?It(Pt(x),`left`,s):[],T=Cn({data:{series:[]},x:{show:u.show!==!1,grid:u.grid===!0,title:u.title},y:{show:p,grid:c.grid!==!1,title:c.title},annotations:d},t,y,0,{area:v,labels:a,x,y:S,horizontal:!0,xTicks:w,yTicks:C},a),E=Math.max(1,Math.min(r,x.bandwidth)),D=e=>x.at(e.row)+(x.bandwidth-E)/2,O=e=>{let t=S(e.from),n=S(e.to),r=Math.min(t,n),i=Math.max(t,n);if(i-r>=2)return[r,i];let a=(r+i)/2;return[a-1,a+1]},k=js(e,t.locale),A=e=>{let n=o[e],[r,i]=O(n),a=D(n),s={name:n.item.name,seriesIndex:0,value:n.to-n.from,text:`${k(n.from)} – ${k(n.to)}`,x:t.rtl?r:i,y:a+E/2,box:{x:r,y:a,width:i-r,height:E}};return n.item.color&&(s.color=n.item.color),{index:e,label:n.item.name,title:``,x:(r+i)/2,y:x.at(n.row)+x.bandwidth/2,axis:`y`,area:v,items:[s],highlight:{kind:`band`,x:v.x,y:x.at(n.row),width:v.width,height:x.bandwidth}}},j={count:o.length,hitIndex:e=>e>=0&&e<o.length?A(e):null,hitTest(e,t){if(e<v.x-8||e>v.x+v.width+8||t<v.y-8||t>v.y+v.height+8)return null;let n=x.indexAt(t),r=-1,i=1/0;if(o.forEach((t,a)=>{if(t.row!==n)return;let[o,s]=O(t),c=Math.max(o-e,e-s,0);c<=i&&(i=c,r=a)}),r<0)return null;let a=A(r);return i===0&&(a.seriesIndex=0),a}},M=o.map(e=>{let[t,r]=O(e);return l(`path`,{key:e.key,class:[`tc-bar`,`tc-bar-horizontal`,`tc-range-bar`,e.item.class],"data-series":e.item.name,d:Ca(t,D(e),r-t,E,Math.max(0,n)),style:{"--tc-series-color":e.item.color}})});return{content:[l(`defs`,{key:`defs`},T.clip.def),T.background,l(`g`,{key:`series`,class:`tc-series-list tc-range-bars`,"clip-path":T.clip.url},l(`g`,{class:`tc-series tc-series-1`},M)),T.foreground],interaction:j}}function Fs(e,t,n){let r=js(e,t.locale),{bars:i}=e,a=i.length>n?i.slice(0,n):i;return{columns:[``,`From`,`To`],total:i.length,rows:a.map(e=>[e.item.name,r(e.from),r(e.to)])}}let Is={name:`range-bar`,clean:$t(e=>Xt(e,e=>({...Zt(e),from:Jt(e.from),to:Jt(e.to)}))),prepare:As,render:Ps,table:Fs};function Ls(e,t,n){if(H(e,n)<=t)return e;let r=e.length;for(;r>0&&H(`${e.slice(0,r)}…`,n)>t;)r--;return r>0?`${e.slice(0,r).trimEnd()}…`:``}let Rs=e=>e.data.color??`var(--tc-color-${e.slot})`;function zs(e,t,n){let r=/* @__PURE__ */ new Map,i=[],a=(e,t)=>{let n=r.get(e);return n||(n={data:t??{name:e},index:i.length,slot:1,column:0,value:0,x:0,y:0,height:0,ins:[],outs:[]},r.set(e,n),i.push(n)),n},o=new Map((e.nodes??[]).map(e=>[e.name,e])),s=n=>{let r=o.get(n);return t.has(n)||r?.color!==void 0&&t.has(Bs(e,r.color))},c=[];e.links.forEach((e,t)=>{if(e.from===e.to||s(e.from)||s(e.to))return;let n=a(e.from,o.get(e.from)),r=a(e.to,o.get(e.to)),i={data:e,index:t,source:n,target:r,sy:0,ty:0,width:0};c.push(i),e.value<=0||(n.outs.push(i),r.ins.push(i))});for(let e of i)e.value=Math.max(e.outs.reduce((e,t)=>e+t.data.value,0),e.ins.reduce((e,t)=>e+t.data.value,0));for(let e=0;e<i.length;e++){let e=!1;for(let t of c)t.data.value>0&&t.target.column<=t.source.column&&(t.target.column=t.source.column+1,e=!0);if(!e)break}let l=i.reduce((e,t)=>Math.max(e,t.column),0);if(n)for(let e of i)e.outs.length===0&&(e.column=l);let u=[...o.keys()];i.sort((e,t)=>{if(e.column!==t.column)return e.column-t.column;let n=u.indexOf(e.data.name),r=u.indexOf(t.data.name);return n!==-1&&r!==-1?n-r:n===r?e.index-t.index:n===-1?1:-1});let d=/* @__PURE__ */ new Map;return i.forEach((e,t)=>{e.index=t;let n=(d.get(e.column)??0)+1;d.set(e.column,n),e.slot=(n-1)%8+1}),{nodes:i,links:c,columns:l+1}}let Bs=(e,t)=>(e.nodes??[]).find(e=>e.color===t)?.name??t;function Vs(e,t){let{width:n,height:r,fontSize:i,locale:a}=t,o=Math.max(1,e.nodeWidth??12),s=Math.max(0,e.nodePadding??16),{rtl:c}=t,l=Ue(n,r,He(Ve(e.padding),c)),{nodes:u,links:d,columns:f}=zs(e.data,t.hidden,e.align!==`left`),p=bt(e.format,a),m=u.map(e=>[e.data.name,p(e.value)]),h=e=>u.reduce((t,n,r)=>{if(!e(n))return t;let[a,o]=m[r];return Math.max(t,H(a,i),H(o,i))},0),g=l.width*.3,_=f>1?Math.min(g,h(e=>e.column===0)):0,v=Math.min(g,h(e=>e.column===f-1)),y={x:l.x+(_?_+8:0),y:l.y,width:Math.max(0,l.width-(_?_+8:0)-(v?v+8:0)),height:l.height},b=f>1?(y.width-o)/(f-1):0,x=Array.from({length:f},()=>[]);for(let e of u)x[e.column]?.push(e);let S=x.reduce((e,t)=>t.length>1?Math.min(e,y.height/2/(t.length-1)):e,s),C=1/0;for(let e of x){let t=e.reduce((e,t)=>e+t.value,0);t>0&&(C=Math.min(C,(y.height-(e.length-1)*S)/t))}(!Number.isFinite(C)||C<0)&&(C=0),x.forEach((e,t)=>{let r=e.reduce((e,t)=>e+t.value*C,0)+(e.length-1)*S,i=y.y+(y.height-r)/2;for(let r of e){let e=y.x+(f>1?t*b:(y.width-o)/2);r.x=c?n-e-o:e,r.y=i,r.height=r.value*C,i+=r.height+S}});for(let e of u){let t=e.y;for(let n of[...e.outs].sort((e,t)=>e.target.y-t.target.y))n.sy=t,n.width=n.data.value*C,t+=n.width;t=e.y;for(let n of[...e.ins].sort((e,t)=>e.source.y-t.source.y))n.ty=t,t+=n.data.value*C}let w=u.map((e,t)=>{let[n,r]=m[t],a=e.column===0&&f>1?`left`:`right`,s=a===`left`?_:e.column===f-1?v:b-o-16,c=x[e.column],l=c.indexOf(e),u=[c[l-1],c[l+1]].filter(e=>!!e).reduce((t,n)=>Math.min(t,(e.height+n.height)/2+S),1/0)>=i*2.25;return{side:a,name:Ls(n,s,i),value:u?Ls(r,s,i):``}});return c&&(y.x=n-y.x-y.width),{nodes:u,links:d,plot:y,nodeWidth:o,labels:w}}let Hs=(e,t)=>e.source.x>e.target.x?[e.source.x,e.target.x+t]:[e.source.x+t,e.target.x];function Us(e,t){let[n,r]=Hs(e,t),i=(n+r)/2,{sy:a,ty:o,width:s}=e,c=(...e)=>e.map(U).join(`,`);return`M${c(n,a)}C${c(i,a,i,o,r,o)}L${c(r,o+s)}C${c(i,o+s,i,a+s,n,a+s)}Z`}let Ws=(e,t,n,r,i)=>{let a=1-i;return a*a*a*e+3*a*a*i*t+3*a*i*i*n+i*i*i*r};function Gs(e,t,n,r){let[i,a]=Hs(e,t);if(n<Math.min(i,a)||n>Math.max(i,a)||i===a)return!1;let o=(i+a)/2,s=0,c=1;for(let e=0;e<20;e++){let e=(s+c)/2;Ws(i,o,o,a,e)<n==a>i?s=e:c=e}let l=Ws(e.sy,e.sy,e.ty,e.ty,(s+c)/2);return r>=l&&r<=l+e.width}function Ks(e,t){let{nodes:n,links:r,plot:i,nodeWidth:a,labels:o}=Vs(e,t),s=r.filter(e=>e.data.value>0),c=bt(e.format,t.locale),u=e=>({kind:`halo`,d:`M0,0h${U(a)}v${U(e.height)}h${U(-a)}Z`,x:e.x,y:e.y,under:!0}),d=e=>({kind:`halo`,d:Us(e,a),under:!0}),f=e=>({name:`${e.source.data.name} ${t.rtl?`←`:`→`} ${e.target.data.name}`,seriesIndex:e.index,color:Rs(e.source),value:e.data.value,text:c(e.data.value),x:(e.source.x+a+e.target.x)/2,y:Ws(e.sy,e.sy,e.ty,e.ty,.5)+e.width/2}),p=(e,t)=>{let n={name:e.data.name,seriesIndex:r.length+e.index,color:Rs(e),value:e.value,text:c(e.value),x:e.x+a/2,y:e.y+e.height/2},o=[...e.ins,...e.outs].map(f),l=o.find(e=>e.seriesIndex===t),p=l&&s.find(e=>e.index===t);return{index:e.index,label:e.data.name,title:``,x:n.x,area:i,items:[n,...o],seriesIndex:l?t:n.seriesIndex,highlight:p?d(p):u(e)}},m=e=>{let t=f(e);return{index:e.source.index,label:e.source.data.name,title:``,x:t.x,area:i,items:[t],seriesIndex:e.index,highlight:d(e)}},h={count:n.length,hitTest(e,t){let r=n.find(n=>e>=n.x-2&&e<=n.x+a+2&&t>=n.y-2&&t<=n.y+n.height+2);if(r)return p(r);let i=s.find(n=>Gs(n,a,e,t));return i?m(i):null},hitIndex(e,t){let r=n[e];return r?p(r,t):null}};return{content:[l(`g`,{key:`links`,class:`tc-sankey-links`},s.map(e=>l(`path`,{key:`${e.source.data.name}→${e.target.data.name}#${e.index}`,class:[`tc-series`,`tc-series-${e.source.slot}`,`tc-sankey-link`],style:{"--tc-series-color":e.source.data.color},d:Us(e,a)}))),l(`g`,{key:`nodes`,class:`tc-sankey-nodes`},n.map(e=>l(`g`,{key:e.data.name,class:[`tc-series`,`tc-series-${e.slot}`],"data-series":e.data.name,style:{"--tc-series-color":e.data.color}},l(`rect`,{class:`tc-sankey-node`,x:U(e.x),y:U(e.y),width:U(a),height:U(e.height)})))),l(`g`,{key:`labels`,class:`tc-sankey-labels`,"aria-hidden":`true`},n.map((e,n)=>{let r=o[n];if(!r.name&&!r.value)return null;let i=r.side===`left`!=(t.rtl===!0),s=U(i?e.x-8:e.x+a+8),c=U(e.y+e.height/2),u=i?`end`:`start`;return l(`g`,{key:e.data.name,class:`tc-sankey-label`},l(`text`,{class:`tc-value-label tc-sankey-name`,x:s,y:c,dy:r.value?`-0.25em`:`0.35em`,"text-anchor":u},r.name),r.value&&l(`text`,{class:`tc-tick-label tc-sankey-value`,x:s,y:c,dy:`0.95em`,"text-anchor":u},r.value))}))],interaction:h}}function qs(e){let t=/* @__PURE__ */ new Map;for(let n of e.data.nodes??[])if(n.color&&!t.has(n.color)){let e={key:n.name,name:n.name,index:t.size,color:n.color};n.hidden&&(e.hidden=!0),t.set(n.color,e)}return[...t.values()]}function Js(e,t){let{links:n}=zs(e.data,t.hidden,!0),r=bt(e.format,t.locale);return{columns:[`From`,`To`,`Value`],rows:n.map(e=>[e.data.from,e.data.to,r(e.data.value)])}}let Ys={name:`sankey`,clean:$t(e=>{let t=Y(e)?e:{};return{...t,nodes:Array.isArray(t.nodes)?Xt(t.nodes,e=>Zt(e)):void 0,links:Xt(t.links,e=>({from:qt(e.from),to:qt(e.to),value:Math.max(0,J(e.value)??0)}))}}),render:Ks,legend:qs,table:Js},Xs=e=>`M${e},0A${e},${e},0,1,1,${-e},0A${e},${e},0,1,1,${e},0Z`;function Zs(e){return e.labels?e.labels.map(String):e.series.some(e=>e.points.some(e=>typeof e.x==`string`))?[...new Set(e.series.flatMap(e=>e.points.map(e=>String(e.x))))]:null}let Qs=e=>e.size!=null&&Number.isFinite(e.size)&&e.size>0?e.size:void 0;function $s(e,t){let n=bt(e.x?.format,t),r=!!Zs(e.data);return e=>r||typeof e==`string`?String(e):n(e)}function ec(e,t){let{width:n,height:r,fontSize:i,locale:a}=t,o=e.x??{},s=e.y??{},c=e.radius??4,u=e.data.series.filter(e=>!t.hidden.has(X(e))).flatMap(e=>e.points),d=u.map(Qs).filter(e=>e!==void 0),f=Ut(d)?.[1]??0,p=e.size?.min??4,m=e.size?.max??24,h=e=>e!=null&&e>0&&f>0?p+(m-p)*Math.sqrt(e/f):c,g=Math.max(c,d.length?m:0)+2,_=vn(s,Math.max(2,Math.round(r/60))),v=vn(o,Math.max(2,Math.round(n/80))),y=Zs(e.data),b=new Map((y??[]).map((e,t)=>[e,t]).reverse()),x=e=>(y?b.has(String(e.x)):typeof e.x==`number`&&un(e.x,o))&&un(e.y,s),S=u.filter(x),C=bn(y?[]:S.map(e=>e.x),o,!1,v),w=bn(S.map(e=>e.y),s,!1,_),T=o.show!==!1,E=s.show!==!1,D=(e,t,n)=>hn(e,t,n,t.format,a),O=D(mn(w,[1,0],s),s,_),k=y?y.map(e=>({value:e,position:0,label:e})):D(mn(C,[0,1],o),o,v),A=(e,t=0)=>T&&e?Math.max(0,Math.ceil(H(e.label,i)/2-t)):0,j=o.reverse??t.rtl===!0,M=j===(t.rtl===!0)?0:k.length-1,N=(E?q(`left`,O,i):0)+Lt(s.title,i),{area:P,side:F,range:I}=We(t,e.padding,e=>{let t=t=>({start:e.start+Math.max(N,A(k[M],t),g),end:e.end+Math.max(A(k[k.length-1-M],t),g,8)}),r=t(0);return y?.length&&(r=t((n-r.start-r.end)/(y.length*2))),{top:e.top+Math.max(E?Math.ceil(i*W/2):0,g,4),bottom:e.bottom+Math.max((T?q(`bottom`,k,i):0)+Lt(o.title,i),g,4),...r}}),L=mn(w,[P.y+P.height,P.y],s),R,ee;if(y){let[e,t]=I(j),n=n=>e+(t-e)*(n+.5)/y.length;R=e=>n(b.get(String(e))),ee=y.map((e,t)=>({value:e,position:n(t),label:e}))}else{let e=mn(C,I(j),o);R=t=>e(t),ee=D(e,o,v)}let z=It(ee,`bottom`,i),te=It(D(L,s,_),`left`,i,4),ne=[];e.data.series.forEach((e,n)=>{t.hidden.has(X(e))||e.points.forEach((e,t)=>{x(e)&&ne.push({seriesIndex:n,pointIndex:t,point:e,cx:R(e.x),cy:L(e.y),r:h(Qs(e))})})}),ne.sort((e,t)=>e.cx-t.cx);let re=$s(e,a),ie=bt(s.format,a),ae=K(void 0,a),oe=(t,n)=>{let r=e.data.series[t.seriesIndex],i=Qs(t.point),a=i===void 0?``:` · ${ae(i)}`,o={name:r.name,seriesIndex:t.seriesIndex,value:t.point.y,text:`${re(t.point.x)}, ${ie(t.point.y)}${a}`,x:t.cx,y:t.cy};return r.color&&(o.color=r.color),{index:n,label:t.point.label??r.name,title:t.point.label??``,x:t.cx,area:P,items:[o],seriesIndex:t.seriesIndex,highlight:{kind:`halo`,d:Xs(U(t.r+4)),x:t.cx,y:t.cy}}},se={count:ne.length,hitIndex:e=>{let t=ne[e];return t?oe(t,e):null},hitTest(e,t){let n=0,r=ne.length,i=24+m;for(;n<r;){let t=n+r>>1;ne[t].cx<e-i?n=t+1:r=t}let a=-1,o=1/0;for(let r=n;r<ne.length;r++){let n=ne[r];if(n.cx>e+i)break;let s=Math.hypot(n.cx-e,n.cy-t)-n.r;s<o&&s<=24&&(a=r,o=s)}return a===-1?null:oe(ne[a],a)}},ce=gn(e),le=(e,t)=>{if(!e.length)return null;let n=U(c),r=``;for(let i of e)r+=ce?ce(t,R(i.x),L(i.y),n):`M${U(R(i.x)-c)},${U(L(i.y))}a${n},${n},0,1,0,${2*n},0a${n},${n},0,1,0,${-2*n},0`;return l(`path`,{key:`dots`,class:[`tc-point tc-dots`,ce&&`tc-marker`],d:r})},ue=[];s.grid!==!1&&ue.push(Bt({direction:`y`,ticks:te,area:P})),o.grid&&ue.push(Bt({direction:`x`,ticks:z,area:P}));let de=En(t,P,d.length?0:g),B=e.data.series.map((e,n)=>!t.hidden.has(X(e))&&l(`g`,nn(e,n),le(e.points.filter(e=>x(e)&&Qs(e)===void 0),n),e.points.map((e,t)=>x(e)&&Qs(e)!==void 0&&l(`circle`,{key:t,class:`tc-point tc-bubble`,cx:U(R(e.x)),cy:U(L(e.y)),r:U(h(Qs(e)))}))));return{content:[l(`defs`,null,de.def),ue,l(`g`,{key:`series`,class:`tc-series-list`,"clip-path":de.url},B),E&&zt({position:F,ticks:te,area:P}),T&&zt({position:`bottom`,ticks:z,area:P}),!!s.title&&Rt(F,E?te:[],P,s.title,i),!!o.title&&Rt(`bottom`,T?z:[],P,o.title,i)],interaction:se}}function tc(e,t,n=1/0){let r=$s(e,t.locale),i=bt(e.y?.format,t.locale),a=K(void 0,t.locale),o=e.data.series.filter(e=>!t.hidden.has(X(e))),s=o.some(e=>e.points.some(e=>e.size!=null)),c=o.some(e=>e.points.some(e=>e.label!=null)),l=o.reduce((e,t)=>e+t.points.length,0),u=n;return{columns:[``,...c?[`Label`]:[],`x`,`y`,...s?[`Size`]:[]],total:l,rows:o.flatMap(e=>{let t=e.points.slice(0,Math.max(0,u));return u-=t.length,t.map(t=>[e.name,...c?[t.label??``]:[],r(t.x),i(t.y),...s?[Qs(t)===void 0?`–`:a(Qs(t))]:[]])})}}let nc={name:`scatter`,clean:$t(e=>({...Y(e)?e:{},labels:Y(e)&&Array.isArray(e.labels)?e.labels.map(qt):void 0,series:Xt(Y(e)&&e.series,e=>({...Zt(e),points:Xt(e.points,e=>({...e,x:typeof e.x==`string`?e.x:J(e.x),y:J(e.y),size:J(e.size)??void 0,label:e.label==null?void 0:qt(e.label)})).filter(e=>e.x!==null&&e.y!==null)}))})),render:ec,legend:e=>tn(e.data.series),table:tc,valueLabels:{format:e=>e.y?.format}};function rc(e,t){let{variant:n=`line`,curve:r=`monotone`,point:i=`last`,markers:a=`none`,pointRadius:o=3,name:s=`Value`}=e,c=e.data.map(e=>e==null||!Number.isFinite(e)?null:e),u=c.length,d=i===`last`||a===`minmax`?o+2:2,f=Ve(e.padding,0),p=Ue(t.width,t.height,{top:f.top+d,right:f.right+d,bottom:f.bottom+d,left:f.left+d}),m=n===`tristate`,h=e.zero??n!==`line`,g=m?[-1,1]:bn(c,{nice:!1},h,2),_=n===`bar`||m,v=u>0?p.width/u:0,y=e=>t.rtl?u-1-e:e,b=e=>_?p.x+v*y(e)+v/2:p.x+(u>1?p.width*y(e)/(u-1):p.width/2),x=Wt(g,[p.y+p.height,p.y]),S=x(Math.min(Math.max(0,g[0]),g[1])),C=c.map((e,t)=>e===null?null:[b(t),x(e)]),w=K(e.format,t.locale),T=t=>{let n=e.labels?.[t];return n===void 0?``:String(n)},E=e=>x(m?Math.sign(e):e),D=t=>{let n=c[t];if(n===void 0)return null;let r=b(t),i={name:s,seriesIndex:0,value:n,text:n===null?`–`:w(n),x:r,y:n===null?null:E(n)},a={index:t,label:Z(e.labels?.[t]??t+1),title:T(t),x:r,area:p,items:[i]};return n!==null&&(a.highlight={kind:`halo`,d:Xs(o+3),x:r,y:E(n)}),a},O={count:u,reversed:t.rtl===!0,hitIndex:e=>D(e),hitTest(e,t){if(u===0||t<p.y-d||t>p.y+p.height+d)return null;let n=_?Math.floor((e-p.x)/v):Math.round((e-p.x)/Math.max(1,p.width)*(u-1));return D(y(Math.max(0,Math.min(u-1,n))))}},k=[];if(m){let e=Math.max(1,v-1);k.push(l(`line`,{class:`tc-sparkline-zero`,x1:p.x,x2:p.x+p.width,y1:U(S),y2:U(S)})),c.forEach((t,n)=>{if(t===null)return;let r=Math.sign(t),i=Math.min(2,p.height/2),[a,o]=r===0?[S+i/2,S-i/2]:[S,x(r)];k.push(l(`path`,{key:n,class:[`tc-bar`,r<0&&`tc-bar-negative`,r<0?`tc-tristate-loss`:r>0?`tc-tristate-win`:`tc-tristate-draw`],d:ya(b(n)-e/2,e,a,o,r===0?0:Math.min(2,e/2))}))})}else if(_){let e=Math.max(1,v-1);c.forEach((t,n)=>{t!==null&&k.push(l(`path`,{key:n,class:[`tc-bar`,t<0&&`tc-bar-negative`],d:ya(b(n)-e/2,e,S,x(t),Math.min(2,e/2))}))})}else n===`area`&&k.push(l(`path`,{class:`tc-area tc-area-gradient`,d:Si(C,S,{curve:r}),mask:`url(#${t.id}-fade)`})),k.push(l(`path`,{class:`tc-line`,d:xi(C,{curve:r})}));let A=gn(e),j=(e,t)=>{let n=c[e];return n==null?null:_n(A,0,`${t}-${e}`,[`tc-point`,t],U(b(e)),U(x(n)),o)},M=[];if(a===`minmax`){let e=-1,t=-1;c.forEach((n,r)=>{n!==null&&((e===-1||n<c[e])&&(e=r),(t===-1||n>c[t])&&(t=r))}),e!==-1&&M.push(j(e,`tc-point-min`)),t!==-1&&t!==e&&M.push(j(t,`tc-point-max`))}let N=-1;if(i===`last`){for(let e=u-1;e>=0;e--)if(c[e]!==null){N=e;break}}return{content:[n===`area`&&l(`defs`,null,da(`${t.id}-fade`)),l(`g`,{class:`tc-series tc-series-1 tc-sparkline`},k,M,N!==-1&&!_&&j(N,`tc-point-last`))],interaction:O}}let ic={name:`sparkline`,clean:e=>({...$t(Yt)(e),labels:Array.isArray(e.labels)?e.labels.map(Jt):void 0}),render:rc,keyboard:!1};function ac(e){return e.map(e=>{if(e.children?.length){let t=ac(e.children);return{node:e,children:t,value:t.reduce((e,t)=>e+t.value,0)}}return{node:e,value:Math.max(0,e.value??0)}})}let oc=e=>Array.isArray(e.colors)&&e.colors.length>=2?e.colors:void 0,sc=e=>e.colorBy===`value`||oc(e)!==void 0;function cc(e){let t=0,n=e=>{for(let r of e)r.children?n(r.children):t=Math.max(t,r.value)};n(e.sized);let{position:r,paint:i}=Io(J(e.min)??0,J(e.max)??t,J(e.mid),oc(e),.08);return e=>i(r(e))}function lc(e,t){let n=sc(e);return e.sized.map((e,t)=>({entry:e,index:t})).filter(({entry:e})=>!t.has(X(e.node))&&!(n&&e.node.hidden))}function uc(e,t,n,r,i,a){let o=e.filter(e=>e.value>0).sort((e,t)=>t.value-e.value),s=o.reduce((e,t)=>e+t.value,0),c=0;for(;c<o.length&&r>0&&i>0;){let e=Math.min(r,i),l=r*i/s,u=o[c].value,d=0,f=1/0,p=c;for(;p<o.length;p++){let t=d+o[p].value,n=(t*l/e)**2,r=Math.max(n/(o[p].value*l),u*l/n);if(r>f)break;f=r,d=t}let m=d*l/e,h=0;for(;c<p;c++){let e=o[c],s=e.value*l/m;r>=i?a(e,t,n+h,m,s):a(e,t+h,n,s,m),h+=s}r>=i?(t+=m,r-=m):(n+=m,i-=m),s-=d}}function dc(e,t,n,r,i,a,o,s,c,l){uc(e,t,n,r,i,(u,d,f,p,m)=>{let h=c?.index??l?.[e.indexOf(u)],g=c?`${c.key}/${X(u.node)}`:X(u.node),_=c?.trail??[],v=.01,y=[d-t<v?s[0]:1,f-n<v?s[1]:1,t+r-d-p<v?s[2]:1,n+i-f-m<v?s[3]:1];if(u.children)dc(u.children,d,f,p,m,a,o,y,{index:h,key:g,trail:[..._,u.node.name]});else{let e=a/2;o.push({node:u.node,key:g,top:h,trail:_,value:u.value,x:d+y[0]*e,y:f+y[1]*e,width:Math.max(0,p-(y[0]+y[2])*e),height:Math.max(0,m-(y[1]+y[3])*e)})}})}function fc(e,t){let{width:n,height:r,fontSize:i,locale:a}=t,o=Math.max(0,e.gap??2),s=Math.max(0,e.radius??3),c=Ue(n,r,Ve(e.padding,0)),u=lc(e,t.hidden),d=u.reduce((e,{entry:t})=>e+t.value,0),f=[];dc(u.map(({entry:e})=>e),c.x,c.y,c.width,c.height,o,f,[0,0,0,0],void 0,u.map(({index:e})=>e));let p=sc(e)?cc(e):void 0,m=K(e.format,a),h=G(a,{style:`percent`,maximumFractionDigits:1}),g=(t,n)=>{let r=t.x+t.width/2,i={name:t.node.name,seriesIndex:t.top,value:t.value,text:`${m(t.value)} (${h.format(d>0?t.value/d:0)})`,x:r,y:t.y+t.height/2},a=p?p(t.value).color:t.node.color??e.data[t.top]?.color;return a&&(i.color=a),{index:n,label:[...t.trail,t.node.name].join(` › `),title:t.trail.join(` › `),x:r,area:c,items:[i],seriesIndex:t.top,highlight:{kind:`halo`,d:Ca(t.x+1,t.y+1,t.width-2,t.height-2,s-1)}}},_={count:f.length,hitIndex:e=>{let t=f[e];return t?g(t,e):null},hitTest(e,t){let n=f.findIndex(n=>e>=n.x-o/2&&e<=n.x+n.width+o/2&&t>=n.y-o/2&&t<=n.y+n.height+o/2);return n<0?null:g(f[n],n)}},v=u.map(({entry:e,index:t})=>l(`g`,nn(e.node,t),f.filter(e=>e.top===t).map(e=>l(`rect`,{key:e.key,class:[`tc-tile`,p&&`tc-tile-shaded`,e.trail.length>0&&e.node.class],x:U(e.x),y:U(e.y),width:U(e.width),height:U(e.height),rx:U(Math.min(s,e.width/2,e.height/2)),style:p?p(e.value).style:e.trail.length>0?{"--tc-series-color":e.node.color}:void 0})))),y=i*1.3,b=e.labels!==!1&&f.flatMap(e=>{let t=e.width-12,n=e.height>=y+6?Ga(e.node.name,t,i):``;if(!n)return[];let r=m(e.value),a=U(e.x+6),o=e.y+6+i*.85;return[l(`text`,{key:e.key,class:`tc-treemap-label`,x:a,y:U(o)},n),e.height>=y*2+9&&H(r,i)<=t&&l(`text`,{key:`${e.key}/value`,class:`tc-treemap-label tc-treemap-value`,x:a,y:U(o+y)},r)]});return{content:[l(`g`,{class:`tc-treemap-tiles`},v),b&&l(`g`,{class:`tc-treemap-labels`,"aria-hidden":`true`},b)],interaction:_}}function pc(e,t,n){let r=lc(e,t.hidden),i=r.reduce((e,{entry:t})=>e+t.value,0),a=K(e.format,t.locale),o=G(t.locale,{style:`percent`,maximumFractionDigits:1}),s=[],c=(e,t)=>{for(let n of e){let e=[...t,n.node.name];n.children?c(n.children,e):s.push([e.join(` › `),a(n.value),o.format(i>0?n.value/i:0)])}};c(r.map(({entry:e})=>e),[]);let l={columns:[``,`Value`,`Share`],rows:s};return s.length>n&&(l.rows=s.slice(0,n),l.total=s.length),l}function mc(e,t=0,n={left:5e3}){let r=[];for(let i of Kt(e)){if(!Y(i)||n.left<=0)continue;n.left--;let e=t<8&&Array.isArray(i.children)?mc(i.children,t+1,n):void 0;r.push({...Zt(i),value:J(i.value)??0,children:e})}return r}let hc={name:`treemap`,clean:$t(e=>mc(e)),prepare:e=>({...e,sized:ac(e.data)}),render:fc,legend:e=>sc(e)?[]:tn(e.data),table:pc},gc={line:ga,area:_a,bar:Sa,pie:ys,donut:bs,scatter:nc,sparkline:ic,gauge:So,heatmap:Ao,calendar:Ba,map:Qo,candlestick:Wa,radar:Ds,sankey:Ys,parliament:os,treemap:hc,"percentage-bar":ms,funnel:$a,"range-bar":Is};n({time:{scale:Hr,points:Ur,axis:Wr},dates:lr,log:{scale:hr,domain:gr,ticks:_r},decimate:si,line:{linePath:xi,areaPath:Si},annotations:{layers:cr,values:sr},"end-labels":mr,"slice-labels":Ar,patterns:Cr,"point-shapes":Tr,swatch:Er,hydrate:ei,morph:oi}),a(Zr);let _c=`[data-tc-chart]`,vc=/* @__PURE__ */ new Set([`chart`,`src`,`data`,`options`]),yc=/* @__PURE__ */ new Set([`title`,`description`,`locale`,`sync`,`id`,`class`]),bc=/* @__PURE__ */ new WeakMap,xc=/* @__PURE__ */ new WeakSet;function Sc(e){return bc.get(e)}function Cc(e){bc.get(e)?.destroy(),bc.delete(e)}function wc(e){return e===`true`||e===``?!0:e===`false`?!1:e!==``&&Number.isFinite(Number(e))?Number(e):/^\s*[[{]/.test(e)?Tc(e,`a data-tc-* attribute`):e}function Tc(e,t){try{return JSON.parse(e)}catch(e){throw SyntaxError(`@tabler/charts-bootstrap: invalid JSON in ${t}: ${e.message}`)}}function Ec(e){let t={},n=e.dataset.tcOptions;n&&Object.assign(t,Tc(n,`data-tc-options`));for(let[n,r]of Object.entries(e.dataset)){if(!n.startsWith(`tc`)||r===void 0)continue;let e=n.charAt(2).toLowerCase()+n.slice(3);vc.has(e)||(t[e]=e===`legend`&&/^(top|bottom|left|right|auto)$/.test(r)?{position:r}:e===`tooltip`&&r===`light`?{theme:`light`}:e===`download`&&/^[a-z]/i.test(r)&&!/^(true|false)$/.test(r)?r.split(/[\s,]+/).filter(Boolean):yc.has(e)?r:wc(r))}return t}function Dc(e){let t=e.dataset.tcData;if(t)return Tc(t,`data-tc-data`);let n=e.querySelector(`:scope > script[type="application/json"]`)?.textContent?.trim();return n?Tc(n,`the inline <script type="application/json">`):void 0}function Oc(e,t,n){e.dispatchEvent(new CustomEvent(`tc-${t}`,{detail:n,bubbles:!0}))}function kc(e,t,n){let r=new ua(e,{...Ec(e),type:t,data:n});for(let t of Ie)r.on(t,n=>Oc(e,t,n));return bc.set(e,r),Oc(e,`render`,{size:r.size}),r}function Ac(e,t){let n=bc.get(e);if(n||xc.has(e))return n;let r=e.dataset.tcChart??``,i=t[r];if(!i){let e=Object.keys(t).join(`, `);throw Error(`@tabler/charts-bootstrap: unknown chart type "${r}". Known types: ${e}.`)}let a=e.dataset.tcSrc;return a?(xc.add(e),e.setAttribute(`aria-busy`,`true`),fetch(a).then(e=>{if(!e.ok)throw Error(`${e.status} ${e.statusText}`.trim());return e.json()}).then(t=>e.isConnected?kc(e,i,t):void 0,t=>{Oc(e,`error`,{error:t,src:a}),console.error(`@tabler/charts-bootstrap: could not load ${a}:`,t)}).finally(()=>{xc.delete(e),e.removeAttribute(`aria-busy`)})):kc(e,i,Dc(e)??[])}function jc(e=document,t={}){let n={...gc,...t.types},r=[...e.querySelectorAll(_c)];e instanceof Element&&e.matches(_c)&&r.unshift(e);let i=r.map(e=>{try{return Ac(e,n)}catch(t){Oc(e,`error`,{error:t}),console.error(t);return}});return Promise.all(i).then(e=>e.filter(e=>e!==void 0))}function Mc(e=document.body,t={}){jc(e,t);let n=new MutationObserver(e=>{for(let n of e){let e=n.target.closest?.(_c);if(!(e&&bc.has(e))){for(let e of n.removedNodes)if(e instanceof Element){bc.has(e)&&Cc(e);for(let t of e.querySelectorAll(_c))Cc(t)}for(let e of n.addedNodes)e instanceof Element&&!e.isConnected||e instanceof Element&&jc(e,t)}}});return n.observe(e,{childList:!0,subtree:!0}),()=>n.disconnect()}if(typeof document<`u`){let e=document.currentScript;if(!e?.hasAttribute(`data-no-styles`)&&!document.getElementById(`tc-styles`)){let t=document.createElement(`style`);t.id=`tc-styles`,t.textContent=`/*! @tabler/charts | MIT */
|
|
3
|
+
:where(:root),:where([data-theme=light]){--tc-color-1:var(--tblr-chart-1,var(--tblr-primary,#2a78d6));--tc-color-2:var(--tblr-chart-2,var(--tblr-orange,#eb6834));--tc-color-3:var(--tblr-chart-3,var(--tblr-teal,#1baf7a));--tc-color-4:var(--tblr-chart-4,var(--tblr-yellow,#eda100));--tc-color-5:var(--tblr-chart-5,var(--tblr-pink,#e87ba4));--tc-color-6:var(--tblr-cyan,#008300);--tc-color-7:var(--tblr-indigo,#4a3aa7);--tc-color-8:var(--tblr-red,#e34948);--tc-color-other:var(--tblr-secondary,#8a8983);--tc-surface:var(--tblr-bg-surface,#fff);--tc-text-color:var(--tblr-body-color,#0b0b0b);--tc-text-muted:var(--tblr-secondary,#6f6e69);--tc-grid-color:var(--tblr-border-color-translucent,#e1e0d9);--tc-baseline-color:var(--tblr-border-color,#c3c2b7);--tc-hover-color:rgba(var(--tblr-emphasis-color-rgb,11, 11, 11), .04);--tc-tooltip-bg:var(--tblr-dark,#0b0b0b);--tc-tooltip-color:#fff;--tc-tooltip-muted:#ffffffb3;--tc-tooltip-border:#ffffff1f;--tc-tooltip-shadow:var(--tblr-box-shadow,0 4px 16px #0b0b0b1f);--tc-tooltip-radius:var(--tblr-border-radius,6px);--tc-tooltip-light-bg:#fff;--tc-tooltip-light-color:#0b0b0b;--tc-tooltip-light-muted:#6f6e69;--tc-tooltip-light-border:#0b0b0b1a;--tc-focus-color:var(--tc-color-1);--tc-font-family:var(--tblr-body-font-family,inherit);--tc-font-size:12px;--tc-stroke-width:2px;--tc-grid-width:1px;--tc-area-opacity:.1;--tc-area-gradient-start:.24;--tc-area-gradient-end:0;--tc-pie-value-size:1.75em;--tc-bubble-opacity:.7;--tc-point-ring:2px;--tc-duration:.4s;--tc-duration-fast:.12s;--tc-easing:cubic-bezier(.4, 0, .2, 1)}@media (prefers-color-scheme:dark){:where(:root:not([data-theme=light])){--tc-color-1:var(--tblr-chart-1,var(--tblr-primary,#3987e5));--tc-color-2:var(--tblr-chart-2,var(--tblr-orange,#d95926));--tc-color-3:var(--tblr-chart-3,var(--tblr-teal,#199e70));--tc-color-4:var(--tblr-chart-4,var(--tblr-yellow,#c98500));--tc-color-5:var(--tblr-chart-5,var(--tblr-pink,#d55181));--tc-color-6:var(--tblr-cyan,#008300);--tc-color-7:var(--tblr-indigo,#9085e9);--tc-color-8:var(--tblr-red,#e66767);--tc-color-other:var(--tblr-secondary,#7c7b76);--tc-surface:var(--tblr-bg-surface,#1a1a19);--tc-text-color:var(--tblr-body-color,#fff);--tc-text-muted:var(--tblr-secondary,#a3a29c);--tc-grid-color:var(--tblr-border-color-translucent,#2c2c2a);--tc-baseline-color:var(--tblr-border-color,#4a4a46);--tc-hover-color:rgba(var(--tblr-emphasis-color-rgb,255, 255, 255), .06);--tc-tooltip-bg:var(--tblr-dark,#262625);--tc-tooltip-shadow:var(--tblr-box-shadow,0 4px 16px #0006);--tc-focus-color:var(--tc-color-1)}}:where([data-theme=dark]){--tc-color-1:var(--tblr-chart-1,var(--tblr-primary,#3987e5));--tc-color-2:var(--tblr-chart-2,var(--tblr-orange,#d95926));--tc-color-3:var(--tblr-chart-3,var(--tblr-teal,#199e70));--tc-color-4:var(--tblr-chart-4,var(--tblr-yellow,#c98500));--tc-color-5:var(--tblr-chart-5,var(--tblr-pink,#d55181));--tc-color-6:var(--tblr-cyan,#008300);--tc-color-7:var(--tblr-indigo,#9085e9);--tc-color-8:var(--tblr-red,#e66767);--tc-color-other:var(--tblr-secondary,#7c7b76);--tc-surface:var(--tblr-bg-surface,#1a1a19);--tc-text-color:var(--tblr-body-color,#fff);--tc-text-muted:var(--tblr-secondary,#a3a29c);--tc-grid-color:var(--tblr-border-color-translucent,#2c2c2a);--tc-baseline-color:var(--tblr-border-color,#4a4a46);--tc-hover-color:rgba(var(--tblr-emphasis-color-rgb,255, 255, 255), .06);--tc-tooltip-bg:var(--tblr-dark,#262625);--tc-tooltip-shadow:var(--tblr-box-shadow,0 4px 16px #0006);--tc-focus-color:var(--tc-color-1)}.tc-chart{max-width:100%;height:auto;font-family:var(--tc-font-family);font-size:var(--tc-font-size);letter-spacing:normal;word-spacing:normal;text-transform:none;color:var(--tc-text-color);-webkit-tap-highlight-color:transparent;direction:ltr;display:block;overflow:visible}.tc-chart :where(text){font:inherit}.tc-series{--tc-series-color:var(--tc-color-other);--tc-series-pattern:var(--tc-pattern-other);--tc-pattern-dash:1 3;--tc-pattern-ink:var(--tc-pattern-color,var(--tc-surface));--tc-swatch-pattern:repeating-linear-gradient(45deg, var(--tc-pattern-ink) 0 1px, #0000 0 3px)}.tc-series-1{--tc-series-color:var(--tc-color-1);--tc-series-pattern:var(--tc-pattern-1);--tc-pattern-dash:none;--tc-swatch-pattern:repeating-linear-gradient(45deg, var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-series-2{--tc-series-color:var(--tc-color-2);--tc-series-pattern:var(--tc-pattern-2);--tc-pattern-dash:6 3;--tc-swatch-pattern:radial-gradient(var(--tc-pattern-ink) .8px, #0000 1.2px) 0 0 / 4px 4px}.tc-series-3{--tc-series-color:var(--tc-color-3);--tc-series-pattern:var(--tc-pattern-3);--tc-pattern-dash:2 3;--tc-swatch-pattern:repeating-linear-gradient(-45deg, var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-series-4{--tc-series-color:var(--tc-color-4);--tc-series-pattern:var(--tc-pattern-4);--tc-pattern-dash:10 3 2 3;--tc-swatch-pattern:repeating-linear-gradient(var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-series-5{--tc-series-color:var(--tc-color-5);--tc-series-pattern:var(--tc-pattern-5);--tc-pattern-dash:4 4;--tc-swatch-pattern:repeating-linear-gradient(45deg, var(--tc-pattern-ink) 0 1px, #0000 0 4px), repeating-linear-gradient(-45deg, var(--tc-pattern-ink) 0 1px, #0000 0 4px)}.tc-series-6{--tc-series-color:var(--tc-color-6);--tc-series-pattern:var(--tc-pattern-6);--tc-pattern-dash:12 4;--tc-swatch-pattern:repeating-linear-gradient(90deg, var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-series-7{--tc-series-color:var(--tc-color-7);--tc-series-pattern:var(--tc-pattern-7);--tc-pattern-dash:2 2 6 2;--tc-swatch-pattern:repeating-linear-gradient(var(--tc-pattern-ink) 0 1px, #0000 0 4px), repeating-linear-gradient(90deg, var(--tc-pattern-ink) 0 1px, #0000 0 4px)}.tc-series-8{--tc-series-color:var(--tc-color-8);--tc-series-pattern:var(--tc-pattern-8);--tc-pattern-dash:8 2 2 2;--tc-swatch-pattern:linear-gradient(90deg, #0000 50%, var(--tc-series-color) 0) 0 0 / 4px 4px, repeating-linear-gradient(var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-tick-label{fill:var(--tc-text-muted);font-variant-numeric:tabular-nums}.tc-axis-title{fill:var(--tc-text-muted)}.tc-grid-line,.tc-grid-line-zero,.tc-axis-line,.tc-tick-line,.tc-crosshair,.tc-sparkline-zero,.tc-radar-ring,.tc-radar-spoke{stroke:var(--tc-baseline-color);stroke-width:var(--tc-grid-width);shape-rendering:crispedges;vector-effect:non-scaling-stroke}.tc-grid-line,.tc-sparkline-zero,.tc-radar-ring,.tc-radar-spoke{stroke:var(--tc-grid-color)}.tc-grid-line-zero{stroke:var(--tc-baseline-color)}.tc-line{fill:none;stroke:var(--tc-series-color);stroke-width:var(--tc-series-width,var(--tc-stroke-width));stroke-dasharray:var(--tc-series-dash,none);stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke}.tc-area{fill:var(--tc-series-color);fill-opacity:var(--tc-area-opacity);stroke:none}.tc-pie-slices{--tc-pie-gap:0px}.tc-slice{fill:var(--tc-series-color);stroke:var(--tc-surface);stroke-width:var(--tc-pie-gap);stroke-linejoin:round}.tc-pie-track,.tc-gauge-track{fill:var(--tc-grid-color)}.tc-gauge-arc{fill:var(--tc-series-color)}.tc-pie-value,.tc-gauge-value,.tc-parliament-value{font-size:var(--tc-pie-value-size);fill:var(--tc-text-color);font-variant-numeric:tabular-nums;font-weight:600}.tc-pie-label,.tc-gauge-label,.tc-parliament-label{fill:var(--tc-text-muted)}.tc-seat{fill:var(--tc-series-color);transition:transform var(--tc-duration) var(--tc-easing), r var(--tc-duration) var(--tc-easing)}.tc-seat-vacant{fill:var(--tc-grid-color)}.tc-chart-parliament .tc-hover-mark{opacity:.25}.tc-segment{fill:var(--tc-series-color);transition:var(--tc-duration) var(--tc-easing);transition-property:x,width}.tc-percentage-bar-track{fill:var(--tc-grid-color)}.tc-tile{fill:var(--tc-series-color);fill-opacity:var(--tc-treemap-opacity,1);transition:var(--tc-duration) var(--tc-easing);transition-property:x,y,width,height}.tc-tile-shaded{fill:var(--tc-cell-fill,var(--tc-heat-color,var(--tc-color-1)));transition-property:x,y,width,height,fill}@supports (color:color-mix(in oklab, red 50%, blue)){.tc-tile-shaded{fill:var(--tc-cell-fill,color-mix(in oklab, var(--tc-heat-color,var(--tc-color-1)) var(--tc-heat,100%), var(--tc-heat-empty,var(--tc-grid-color))))}}.tc-treemap-value{font-weight:400}.tc-funnel-stage{fill:var(--tc-funnel-color,var(--tc-color-1));transition:d var(--tc-duration) var(--tc-easing)}@supports (color:color-mix(in oklab, red 50%, blue)){.tc-funnel-stage{fill:color-mix(in oklab, var(--tc-funnel-color,var(--tc-color-1)) var(--tc-funnel-shade,100%), var(--tc-surface))}}.tc-funnel-name,.tc-funnel-share{fill:var(--tc-text-muted)}.tc-funnel-value{fill:var(--tc-text-color);font-weight:600}.tc-funnel-value,.tc-funnel-share{font-variant-numeric:tabular-nums}.tc-sankey-node{fill:var(--tc-series-color)}.tc-sankey-link{fill:var(--tc-series-color);fill-opacity:var(--tc-area-opacity);stroke:none}.tc-chart-sankey{--tc-area-opacity:.35}.tc-sankey-value{font-size:.92em}.tc-chart-sankey .tc-hover-mark{opacity:.5}.tc-radar-ring,.tc-radar-spoke,.tc-chart-radar .tc-crosshair{fill:none;shape-rendering:auto}.tc-area-gradient{fill-opacity:1}.tc-fade-start{stop-color:#fff;stop-opacity:var(--tc-area-gradient-start)}.tc-fade-end{stop-color:#fff;stop-opacity:var(--tc-area-gradient-end)}.tc-chart-sparkline{--tc-stroke-width:1.5px;--tc-area-gradient-start:.3}.tc-bubble{fill-opacity:var(--tc-bubble-opacity)}.tc-point{fill:var(--tc-series-color);stroke:var(--tc-surface);stroke-width:var(--tc-point-ring);paint-order:stroke;transition:cx var(--tc-duration) var(--tc-easing), cy var(--tc-duration) var(--tc-easing)}.tc-point-min,.tc-point-max{fill:var(--tc-text-muted)}.tc-annotation{--tc-annotation-color:var(--tc-text-muted)}.tc-annotation-line{stroke:var(--tc-annotation-color);stroke-width:1px;stroke-dasharray:var(--tc-annotation-dash,4 3);shape-rendering:crispedges;vector-effect:non-scaling-stroke}.tc-annotation-dot{fill:var(--tc-annotation-color);stroke:var(--tc-surface);stroke-width:1.5px}.tc-annotation-band{fill:var(--tc-annotation-color);fill-opacity:.1}.tc-annotation-label{fill:var(--tc-annotation-color);font-weight:500}.tc-annotation-label,.tc-radar-value{paint-order:stroke;stroke:var(--tc-surface);stroke-width:3px;stroke-linejoin:round;font-size:.92em}.tc-annotation-label-bg{fill:var(--tc-surface)}.tc-annotations{pointer-events:none}.tc-value-label,.tc-treemap-label{fill:var(--tc-text-color);font-variant-numeric:tabular-nums;paint-order:stroke;stroke:var(--tc-surface);stroke-width:3px;stroke-linejoin:round;transition:transform var(--tc-duration) var(--tc-easing);animation:tc-fade-in var(--tc-duration) var(--tc-easing);font-weight:500}.tc-end-label-text{fill:var(--tc-text-color);transition:transform var(--tc-duration) var(--tc-easing)}.tc-end-label-value{font-variant-numeric:tabular-nums;font-weight:600}.tc-end-label-line{fill:none;stroke:var(--tc-series-color);stroke-width:1px;transition:d var(--tc-duration) var(--tc-easing)}.tc-slice-label-text{fill:var(--tc-text-color);transition:transform var(--tc-duration) var(--tc-easing)}.tc-slice-label-name{font-weight:600}.tc-slice-label-line{fill:none;stroke:var(--tc-baseline-color);stroke-width:1px;transition:d var(--tc-duration) var(--tc-easing)}.tc-marker{transition:d var(--tc-duration) var(--tc-easing)}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) :is(.tc-legend-swatch,.tc-tooltip-swatch){background:var(--tc-series-color);border-radius:var(--tc-shape-radius,50%);width:10px;height:10px;clip-path:var(--tc-shape,none)}.tc-pattern-bg{fill:var(--tc-series-color)}.tc-pattern-ink{fill:none;stroke:var(--tc-pattern-ink);stroke-width:1.5px;stroke-linecap:round}.tc-patterned :is(.tc-bar,.tc-area,.tc-slice,.tc-gauge-arc,.tc-bubble){fill:var(--tc-series-pattern,var(--tc-series-color))}.tc-patterned .tc-area{fill-opacity:max(var(--tc-area-opacity), .4)}.tc-patterned .tc-line{stroke-dasharray:var(--tc-series-dash,var(--tc-pattern-dash))}:has(>.tc-patterned)>:is(.tc-legend,.tc-tooltip) :is(.tc-legend-swatch,.tc-tooltip-swatch){background:var(--tc-swatch-pattern), var(--tc-series-color)}@keyframes tc-reveal{0%{clip-path:inset(0 var(--tc-reveal,100% 0 0))}to{clip-path:inset(0)}}@keyframes tc-grow{0%{transform:scaleY(0)}}@keyframes tc-grow-x{0%{transform:scaleX(0)}}@keyframes tc-fade-in{0%{opacity:0}}.tc-line,.tc-area,.tc-bar,.tc-radar-ring,.tc-dots{transition:d var(--tc-duration) var(--tc-easing)}.tc-slice,.tc-gauge-arc,.tc-gauge-track{transition:none var(--tc-duration)}.tc-rtl{--tc-reveal:0 0 100%}.tc-chart-line .tc-series-list,.tc-chart-area .tc-series-list{animation:tc-reveal calc(var(--tc-duration) * 2) var(--tc-easing)}.tc-series-list .tc-series,.tc-areas .tc-series,.tc-sankey-links .tc-sankey-link,.tc-sankey-nodes .tc-series,.tc-parliament-seats .tc-series,.tc-parliament-seats .tc-seat,.tc-series-list .tc-point,.tc-heatmap-cells,.tc-calendar-cells,.tc-map-regions,.tc-treemap-tiles,.tc-percentage-bar,.tc-funnel-stages,.tc-candles,.tc-tick,.tc-grid-line{animation:tc-fade-in var(--tc-duration) var(--tc-easing)}.tc-bar{fill:var(--tc-series-color);transform-box:fill-box;transform-origin:50% 100%;animation:tc-grow var(--tc-duration) var(--tc-easing)}.tc-bar-negative{transform-origin:50% 0}.tc-cell{fill:var(--tc-cell-fill,var(--tc-heat-color,var(--tc-color-1)));transition:fill var(--tc-duration) var(--tc-easing)}@supports (color:color-mix(in oklab, red 50%, blue)){.tc-cell{fill:var(--tc-cell-fill,color-mix(in oklab, var(--tc-heat-color,var(--tc-color-1)) var(--tc-heat,100%), var(--tc-heat-empty,var(--tc-grid-color))))}}.tc-heatmap-row.tc-series{--tc-heat-color:var(--tc-series-color)}.tc-cell-empty{fill:var(--tc-heat-empty,var(--tc-grid-color));opacity:.5}.tc-region{stroke:var(--tc-surface);stroke-width:.5px;vector-effect:non-scaling-stroke}.tc-region-empty{fill:var(--tc-heat-empty,var(--tc-grid-color))}.tc-region-point,.tc-map-marker{stroke-width:2px}.tc-map-marker{fill:var(--tc-map-marker-color,var(--tc-color-1));stroke:var(--tc-surface)}.tc-region-selected{stroke:var(--tc-text-color);stroke-width:1.5px}.tc-map-selectable .tc-region{cursor:pointer}.tc-chart-map[data-zoom]{touch-action:none;cursor:grab;user-select:none}.tc-chart-map[data-zoom=drag]{cursor:grabbing}.tc-map-zoom,.tc-zoom{z-index:10;background:var(--tc-surface);border:1px solid var(--tc-grid-color);border-radius:6px;position:absolute;top:0;right:0}.tc-download~.tc-map-zoom{top:28px}.tc-map-zoom svg,.tc-zoom svg{fill:none;stroke:currentColor;stroke-width:2px;stroke-linecap:round}.tc-map-zoom :disabled,.tc-zoom :disabled{opacity:.4;pointer-events:none}.tc-chart[data-zoom-axis]{user-select:none}.tc-chart[data-zoom-axis=x]{touch-action:pan-y}.tc-chart[data-zoom-axis=y]{touch-action:pan-x}.tc-zoom-selection,.tc-brush-selection{fill:var(--tc-focus-color);fill-opacity:.12;stroke:var(--tc-focus-color);stroke-opacity:.4}.tc-zoom-selection{pointer-events:none}.tc-brush-selection{cursor:grab}.tc-brush-handle{fill:var(--tc-focus-color);rx:2px;cursor:ew-resize}[data-zoom-axis=y] .tc-brush-handle{cursor:ns-resize}.tc-zoom{display:flex}.tc-download~.tc-zoom{right:28px}.tc-zoom[dir=rtl]{left:0;right:auto}.tc-download~.tc-zoom[dir=rtl]{left:28px}.tc-map-line{fill:none;stroke:var(--tc-map-line-color,var(--tc-color-1));stroke-width:1.5px;stroke-dasharray:4;animation:tc-map-line calc(var(--tc-duration) * 3) linear infinite}@keyframes tc-map-line{to{stroke-dashoffset:-8px}}.tc-candle{--tc-candle-color:var(--tc-up-color,var(--tc-color-6))}.tc-candle-down{--tc-candle-color:var(--tc-negative-color,var(--tc-color-8))}.tc-candle-body{fill:var(--tc-candle-color);transition:d var(--tc-duration) var(--tc-easing), fill var(--tc-duration) var(--tc-easing)}.tc-candle-wick{fill:none;stroke:var(--tc-candle-color);stroke-width:1px;vector-effect:non-scaling-stroke;transition:d var(--tc-duration) var(--tc-easing), stroke var(--tc-duration) var(--tc-easing)}.tc-tristate-loss{fill:var(--tc-negative-color,var(--tc-color-8))}.tc-tristate-draw{fill:var(--tc-baseline-color)}.tc-bar-horizontal{transform-origin:0;animation-name:tc-grow-x}.tc-bar-horizontal.tc-bar-negative,.tc-rtl .tc-bar-horizontal{transform-origin:100%}.tc-rtl .tc-bar-horizontal.tc-bar-negative{transform-origin:0}.tc-tick,.tc-grid-line{transition:transform var(--tc-duration) var(--tc-easing)}@keyframes tc-pie-in{0%{opacity:0;transform:scale(.85)}}.tc-pie-slices,.tc-gauge-rings,.tc-parliament-seats,.tc-radar-series{animation:tc-pie-in calc(var(--tc-duration) * 1.5) var(--tc-easing)}.tc-hover .tc-point{transition:none;animation:none}.tc-static,.tc-chart[data-resizing]{--tc-duration:0s}:where(.tc-container){position:relative}.tc-hover{pointer-events:none}.tc-hover-band{fill:var(--tc-hover-color)}.tc-crosshair-tag{fill:var(--tc-tooltip-bg)}.tc-crosshair-label{fill:var(--tc-tooltip-color);font-variant-numeric:tabular-nums}.tc-hover-mark{fill:var(--tc-series-color);opacity:.35}.tc-chart-heatmap .tc-hover-mark,.tc-chart-calendar .tc-hover-mark,.tc-chart-map .tc-hover-mark,.tc-chart-treemap .tc-hover-mark,.tc-chart-percentage-bar .tc-hover-mark{fill:none;stroke:var(--tc-text-color);stroke-width:2px;opacity:.6}.tc-tooltip{z-index:10;pointer-events:none;opacity:0;min-width:120px;max-width:min(280px,100%);font-family:var(--tc-font-family);font-size:var(--tc-font-size);overflow-wrap:anywhere;color:var(--tc-tooltip-color);background:var(--tc-tooltip-bg);border:1px solid var(--tc-tooltip-border);border-radius:var(--tc-tooltip-radius);box-shadow:var(--tc-tooltip-shadow);transition:opacity var(--tc-duration-fast) var(--tc-easing);padding:8px 10px;line-height:1.4;position:absolute;top:0;left:0}.tc-tooltip-light{--tc-tooltip-bg:var(--tc-tooltip-light-bg);--tc-tooltip-color:var(--tc-tooltip-light-color);--tc-tooltip-muted:var(--tc-tooltip-light-muted);--tc-tooltip-border:var(--tc-tooltip-light-border)}.tc-tooltip .tc-series{--tc-pattern-ink:var(--tc-pattern-color,var(--tc-tooltip-bg))}.tc-tooltip[data-visible]{opacity:1;transition:opacity var(--tc-duration-fast) var(--tc-easing), transform var(--tc-duration-fast) var(--tc-easing)}.tc-tooltip-title{margin-bottom:4px;font-weight:600}.tc-tooltip-item{align-items:center;gap:8px;display:flex}.tc-tooltip-swatch,.tc-legend-swatch{background:var(--tc-series-color);border-radius:50%;flex:none;width:8px;height:8px}.tc-tooltip-name{color:var(--tc-tooltip-muted);flex:1}.tc-tooltip-value{white-space:nowrap;font-variant-numeric:tabular-nums;font-weight:500}.tc-tooltip-footer{border-top:1px solid var(--tc-tooltip-border);margin-top:4px;padding-top:4px}.tc-tooltip-item-active .tc-tooltip-name{color:var(--tc-tooltip-color)}.tc-legend{font-family:var(--tc-font-family);font-size:var(--tc-font-size);margin-bottom:8px;line-height:1.4}.tc-legend[data-position=bottom]{margin:8px 0 0}:where(.tc-legend-beside){grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:16px;display:grid}:where(.tc-legend-beside.tc-legend-start){grid-template-columns:auto minmax(0,1fr)}:where(.tc-legend-beside)>:not(.tc-legend,svg.tc-chart){grid-column:1/-1}.tc-legend:is([data-position=left],[data-position=right]){justify-self:start;max-width:16em;margin:0}.tc-legend:is([data-position=left],[data-position=right]) .tc-legend-items{flex-flow:column}.tc-legend-items{flex-wrap:wrap;gap:4px 12px;display:flex}.tc-legend-item{appearance:none;font:inherit;text-align:start;color:var(--tc-text-color);cursor:pointer;transition:color var(--tc-duration-fast) var(--tc-easing);background:0 0;border:0;border-radius:4px;align-items:center;gap:6px;margin:0;padding:2px 4px;display:inline-flex}.tc-legend-item:hover{background:var(--tc-hover-color)}.tc-legend-item:focus-visible{outline:2px solid var(--tc-focus-color);outline-offset:1px}.tc-legend-item-hidden{color:var(--tc-text-muted)}.tc-legend-item-hidden .tc-legend-swatch{box-shadow:inset 0 0 0 1.5px var(--tc-series-color);background:0 0}.tc-download{z-index:11;font-family:var(--tc-font-family);font-size:var(--tc-font-size);line-height:1.4;position:absolute;top:0;right:0}.tc-download-toggle,.tc-download-item{appearance:none;font:inherit;color:var(--tc-text-muted);cursor:pointer;background:0 0;border:0;border-radius:4px;align-items:center;margin:0;display:flex}.tc-download-toggle{justify-content:center;width:24px;height:24px;padding:0}.tc-download-toggle:hover,.tc-download-toggle[aria-expanded=true],.tc-download-item:hover{color:var(--tc-text-color);background:var(--tc-hover-color)}.tc-download-toggle:focus-visible,.tc-download-item:focus-visible{outline:2px solid var(--tc-focus-color);outline-offset:1px}.tc-download-menu{min-width:80px;color:var(--tc-text-color);background:var(--tc-surface);border:1px solid var(--tc-grid-color);border-radius:var(--tc-tooltip-radius);box-shadow:var(--tc-tooltip-shadow);margin-top:2px;padding:4px;position:absolute;top:100%;right:0}.tc-download[dir=rtl],[dir=rtl]>*>.tc-download-menu{left:0;right:auto}.tc-download-item{text-align:start;white-space:nowrap;width:100%;padding:4px 8px}.tc-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.tc-chart:focus{outline:none}.tc-chart:focus-visible{outline:2px solid var(--tc-focus-color);outline-offset:2px;border-radius:2px}.tc-table-wrap:not(.tc-sr-only){margin-top:12px;overflow-x:auto}.tc-table{border-collapse:collapse;width:100%;font-family:var(--tc-font-family);font-size:var(--tc-font-size);font-variant-numeric:tabular-nums;color:var(--tc-text-color)}.tc-table caption{text-align:start;margin-bottom:4px;font-weight:600}.tc-table th,.tc-table td{text-align:end;border-bottom:1px solid var(--tc-grid-color);padding:4px 8px}.tc-table th[scope=row],.tc-table thead th:first-child{text-align:start}.tc-table thead th{color:var(--tc-text-muted);border-bottom-color:var(--tc-baseline-color);font-weight:600}@media (prefers-reduced-motion:reduce){.tc-chart,.tc-tooltip{--tc-duration:0s;--tc-duration-fast:0s}}@media (forced-colors:active){.tc-value-label,.tc-treemap-label{fill:canvastext;stroke:canvas}.tc-end-label-text,.tc-slice-label-text{fill:canvastext}.tc-slice-label-line{stroke:graytext}.tc-tick-label,.tc-axis-title,.tc-funnel-labels{fill:canvastext}.tc-grid-line,.tc-radar-ring,.tc-radar-spoke{stroke:graytext}.tc-grid-line-zero,.tc-axis-line,.tc-tick-line,.tc-line{stroke:canvastext}.tc-area{fill:graytext}.tc-bar,.tc-funnel-stage,.tc-point{fill:canvastext;stroke:canvas}.tc-crosshair{stroke:highlight}.tc-tooltip{border-color:canvastext}.tc-legend-swatch{background:canvastext}.tc-legend-item-hidden .tc-legend-swatch{background:0 0;box-shadow:inset 0 0 0 1.5px canvastext}.tc-pattern-bg{fill:canvas}.tc-pattern-ink{stroke:canvastext}:is(.tc-patterned,.tc-patterns-auto) :is(.tc-bar,.tc-area,.tc-slice,.tc-gauge-arc,.tc-bubble){fill:var(--tc-series-pattern,CanvasText);fill-opacity:1;stroke:canvastext;stroke-width:1px}.tc-patterns-auto .tc-line{stroke-dasharray:var(--tc-series-dash,var(--tc-pattern-dash))}:has(>:is(.tc-patterned,.tc-patterns-auto))>:is(.tc-legend,.tc-tooltip) .tc-series{--tc-pattern-color:CanvasText;--tc-series-color:Canvas}:has(>:is(.tc-patterned,.tc-patterns-auto))>:is(.tc-legend,.tc-tooltip) :is(.tc-legend-swatch,.tc-tooltip-swatch){forced-color-adjust:none;background:var(--tc-swatch-pattern), Canvas;box-shadow:inset 0 0 0 1px canvastext}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) :is(.tc-legend-swatch,.tc-tooltip-swatch){box-shadow:none;background:canvastext}}:where(:root,[data-bs-theme],[data-bs-theme-primary],[data-bs-theme-base],[data-bs-theme-font],[data-bs-theme-radius]){--tc-color-1:var(--bs-primary,var(--tblr-chart-1,var(--tblr-primary,#2a78d6)));--tc-focus-color:var(--bs-primary,var(--tblr-chart-1,var(--tblr-primary,#2a78d6)));--tc-surface:var(--bs-body-bg,var(--tblr-bg-surface,#fff));--tc-text-color:var(--bs-body-color,var(--tblr-body-color,#0b0b0b));--tc-text-muted:var(--bs-secondary-color,var(--tblr-secondary,#6f6e69));--tc-grid-color:var(--bs-border-color-translucent,var(--tblr-border-color-translucent,#e1e0d9));--tc-baseline-color:var(--bs-border-color,var(--tblr-border-color,#c3c2b7));--tc-hover-color:rgba(var(--bs-emphasis-color-rgb,var(--tblr-emphasis-color-rgb,11, 11, 11)), .05);--tc-tooltip-bg:var(--bs-emphasis-color,var(--tblr-tooltip-bg,#0b0b0b));--tc-tooltip-color:var(--bs-body-bg,var(--tblr-tooltip-color,#fff));--tc-tooltip-muted:rgba(var(--bs-body-bg-rgb,var(--tblr-body-bg-rgb,255, 255, 255)), .7);--tc-tooltip-border:rgba(var(--bs-body-bg-rgb,var(--tblr-body-bg-rgb,255, 255, 255)), .12);--tc-tooltip-shadow:var(--bs-box-shadow,var(--tblr-box-shadow,0 4px 16px #0b0b0b1f));--tc-tooltip-radius:var(--bs-border-radius,var(--tblr-border-radius,6px));--tc-font-family:var(--bs-body-font-family,var(--tblr-body-font-family,inherit))}:where(:root,[data-bs-theme=light]){--tc-color-2:var(--tblr-chart-2,var(--tblr-orange,#eb6834));--tc-color-3:var(--tblr-chart-3,var(--tblr-teal,#1baf7a));--tc-color-4:var(--tblr-chart-4,var(--tblr-yellow,#eda100));--tc-color-5:var(--tblr-chart-5,var(--tblr-pink,#e87ba4));--tc-color-6:var(--tblr-cyan,#008300);--tc-color-7:var(--tblr-indigo,#4a3aa7);--tc-color-8:var(--tblr-red,#e34948)}:where([data-bs-theme=dark]){--tc-color-2:var(--tblr-chart-2,var(--tblr-orange,#d95926));--tc-color-3:var(--tblr-chart-3,var(--tblr-teal,#199e70));--tc-color-4:var(--tblr-chart-4,var(--tblr-yellow,#c98500));--tc-color-5:var(--tblr-chart-5,var(--tblr-pink,#d55181));--tc-color-6:var(--tblr-cyan,#008300);--tc-color-7:var(--tblr-indigo,#9085e9);--tc-color-8:var(--tblr-red,#e66767)}`,t.nonce=e?.nonce??``,document.head.prepend(t)}let t=e?.hasAttribute(`data-observe`)??!1,n=()=>t?Mc(document.body):void jc(document);document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,n):queueMicrotask(n)}return e.Chart=ua,e.LINE_HEIGHT=W,e.VERSION=`0.4.0`,e.addMap=Vo,e.arcCentroid=lo,e.arcPathStable=po,e.area=_a,e.areaPath=Si,e.axis=zt,e.axisSize=q,e.band=Vt,e.bandTicks=Pt,e.bar=Sa,e.barPath=ya,e.buildChart=Pe,e.calendar=Ba,e.cancel=he,e.candlestick=Wa,e.categoryInteraction=On,e.chartEvents=Ie,e.chartLabel=ke,e.chartModel=Se,e.chartToString=Fe,e.dataTable=ea,e.defaultHidden=h,e.defaultPlugins=la,e.describeHit=Li,e.dispose=Cc,e.domainOf=bn,e.donut=bs,e.download=Ei,e.downloadChart=lt,e.escapeAttr=ae,e.escapeText=ie,e.estimateTextWidth=H,e.exportCSV=ct,e.exportImage=at,e.exportSVG=it,e.extent=Ut,e.feature=o,e.features=t,e.flush=ge,e.formatDate=wt,e.formatDetail=bt,e.formatNumber=K,e.formatTicks=Ct,e.funnel=$a,e.gauge=So,e.getChart=Sc,e.getDateFormat=mt,e.getNumberFormat=G,e.grid=Bt,e.h=l,e.hbarPath=ba,e.heatmap=Ao,e.highlight=Fi,e.hitAnchor=ta,e.hoverOverlay=Ai,e.hoverUnderlay=ki,e.hoverValue=ji,e.init=jc,e.innerRect=Ue,e.insets=Ve,e.keyboard=zi,e.legend=Ui,e.legendContent=m,e.line=ga,e.linePath=xi,e.linear=Wt,e.linearTicks=Nt,e.log=hr,e.lttb=li,e.lttbIndices=si,e.map=Qo,e.niceDomain=Mt,e.normalizeClass=u,e.normalizeStyle=f,e.observe=Mc,e.padAngleForGap=uo,e.parliament=os,e.percentageBar=ms,e.pie=ys,e.placeTooltip=ra,e.point=Ht,e.pointer=Pi,e.radar=Ds,e.rangeBar=Is,e.register=n,e.render=C,e.renderChart=Ne,e.renderContext=we,e.renderToString=I,e.resolveLegend=Oe,e.resolveSize=be,e.sankey=Ys,e.scatter=nc,e.schedule=V,e.seriesKey=Q,e.seriesLegend=cn,e.seriesTable=kn,e.sparkline=ic,e.stepPrecision=xt,e.sync=Ji,e.tableContent=Ii,e.thinTicks=It,e.tickIncrement=At,e.tickStep=jt,e.ticks=kt,e.time=Hr,e.timePointScale=Ur,e.tooltip=sa,e.tooltipContent=na,e.treemap=hc,e.types=gc,e.zoom=ca,e})({});
|
|
3
4
|
//# sourceMappingURL=tabler-charts-bootstrap.min.js.map
|