@skdx/web-components-charts 0.48.0 → 0.49.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/dist/area.cjs +30 -30
- package/dist/area.d.cts +2 -2
- package/dist/area.d.ts +2 -2
- package/dist/area.js +32 -32
- package/dist/bar.cjs +30 -30
- package/dist/bar.d.cts +2 -2
- package/dist/bar.d.ts +2 -2
- package/dist/bar.js +34 -34
- package/dist/boxplot.cjs +40 -40
- package/dist/boxplot.d.cts +2 -2
- package/dist/boxplot.d.ts +2 -2
- package/dist/boxplot.js +38 -38
- package/dist/bubble.cjs +40 -40
- package/dist/bubble.d.cts +2 -2
- package/dist/bubble.d.ts +2 -2
- package/dist/bubble.js +39 -39
- package/dist/bullet.cjs +38 -38
- package/dist/bullet.d.cts +2 -2
- package/dist/bullet.d.ts +2 -2
- package/dist/bullet.js +40 -40
- package/dist/bump.cjs +39 -39
- package/dist/bump.d.cts +2 -2
- package/dist/bump.d.ts +2 -2
- package/dist/bump.js +40 -40
- package/dist/candlestick.cjs +29 -29
- package/dist/candlestick.d.cts +2 -2
- package/dist/candlestick.d.ts +2 -2
- package/dist/candlestick.js +35 -35
- package/dist/chord.cjs +35 -35
- package/dist/chord.d.cts +2 -2
- package/dist/chord.d.ts +2 -2
- package/dist/chord.js +39 -39
- package/dist/circle-packing.cjs +37 -37
- package/dist/circle-packing.d.cts +2 -2
- package/dist/circle-packing.d.ts +2 -2
- package/dist/circle-packing.js +38 -38
- package/dist/combo.cjs +30 -30
- package/dist/combo.d.cts +2 -2
- package/dist/combo.d.ts +2 -2
- package/dist/combo.js +34 -34
- package/dist/contracts.json +17886 -0
- package/dist/dumbbell.cjs +40 -40
- package/dist/dumbbell.d.cts +2 -2
- package/dist/dumbbell.d.ts +2 -2
- package/dist/dumbbell.js +39 -39
- package/dist/funnel.cjs +36 -36
- package/dist/funnel.d.cts +2 -2
- package/dist/funnel.d.ts +2 -2
- package/dist/funnel.js +36 -36
- package/dist/gantt.cjs +36 -36
- package/dist/gantt.d.cts +2 -2
- package/dist/gantt.d.ts +2 -2
- package/dist/gantt.js +39 -39
- package/dist/gauge.cjs +38 -38
- package/dist/gauge.d.cts +2 -2
- package/dist/gauge.d.ts +2 -2
- package/dist/gauge.js +37 -37
- package/dist/heatmap.cjs +38 -38
- package/dist/heatmap.d.cts +2 -2
- package/dist/heatmap.d.ts +2 -2
- package/dist/heatmap.js +39 -39
- package/dist/histogram.cjs +30 -30
- package/dist/histogram.d.cts +2 -2
- package/dist/histogram.d.ts +2 -2
- package/dist/histogram.js +34 -34
- package/dist/icicle.cjs +40 -40
- package/dist/icicle.d.cts +2 -2
- package/dist/icicle.d.ts +2 -2
- package/dist/icicle.js +40 -40
- package/dist/{index-Hexgp_4S.d.cts → index-BkR4iVqI.d.ts} +8 -3
- package/dist/{index-pqdWxinA.d.ts → index-DjnBT-5R.d.cts} +8 -3
- package/dist/index.cjs +37 -37
- package/dist/index.d.cts +24 -4
- package/dist/index.d.ts +24 -4
- package/dist/index.js +38 -38
- package/dist/line.cjs +30 -30
- package/dist/line.d.cts +2 -2
- package/dist/line.d.ts +2 -2
- package/dist/line.js +32 -32
- package/dist/linear-gauge.cjs +35 -35
- package/dist/linear-gauge.d.cts +2 -2
- package/dist/linear-gauge.d.ts +2 -2
- package/dist/linear-gauge.js +40 -40
- package/dist/map.cjs +39 -39
- package/dist/map.d.cts +2 -2
- package/dist/map.d.ts +2 -2
- package/dist/map.js +37 -37
- package/dist/marimekko.cjs +40 -40
- package/dist/marimekko.d.cts +2 -2
- package/dist/marimekko.d.ts +2 -2
- package/dist/marimekko.js +38 -38
- package/dist/network.cjs +37 -37
- package/dist/network.d.cts +2 -2
- package/dist/network.d.ts +2 -2
- package/dist/network.js +38 -38
- package/dist/organization.cjs +38 -38
- package/dist/organization.d.cts +2 -2
- package/dist/organization.d.ts +2 -2
- package/dist/organization.js +36 -36
- package/dist/parallel.cjs +38 -38
- package/dist/parallel.d.cts +2 -2
- package/dist/parallel.d.ts +2 -2
- package/dist/parallel.js +40 -40
- package/dist/pareto.cjs +25 -25
- package/dist/pareto.d.cts +2 -2
- package/dist/pareto.d.ts +2 -2
- package/dist/pareto.js +24 -24
- package/dist/pie.cjs +36 -36
- package/dist/pie.d.cts +2 -2
- package/dist/pie.d.ts +2 -2
- package/dist/pie.js +40 -40
- package/dist/polar-area.cjs +38 -38
- package/dist/polar-area.d.cts +2 -2
- package/dist/polar-area.d.ts +2 -2
- package/dist/polar-area.js +40 -40
- package/dist/portable.d.cts +1 -1
- package/dist/portable.d.ts +1 -1
- package/dist/radar.cjs +40 -40
- package/dist/radar.d.cts +2 -2
- package/dist/radar.d.ts +2 -2
- package/dist/radar.js +40 -40
- package/dist/radial.cjs +36 -36
- package/dist/radial.d.cts +2 -2
- package/dist/radial.d.ts +2 -2
- package/dist/radial.js +38 -38
- package/dist/range.cjs +28 -28
- package/dist/range.d.cts +2 -2
- package/dist/range.d.ts +2 -2
- package/dist/range.js +28 -28
- package/dist/sankey.cjs +40 -40
- package/dist/sankey.d.cts +2 -2
- package/dist/sankey.d.ts +2 -2
- package/dist/sankey.js +40 -40
- package/dist/scatter.cjs +40 -40
- package/dist/scatter.d.cts +2 -2
- package/dist/scatter.d.ts +2 -2
- package/dist/scatter.js +39 -39
- package/dist/sparkline.cjs +36 -36
- package/dist/sparkline.d.cts +2 -2
- package/dist/sparkline.d.ts +2 -2
- package/dist/sparkline.js +37 -37
- package/dist/sunburst.cjs +38 -38
- package/dist/sunburst.d.cts +2 -2
- package/dist/sunburst.d.ts +2 -2
- package/dist/sunburst.js +40 -40
- package/dist/swarm.cjs +40 -40
- package/dist/swarm.d.cts +2 -2
- package/dist/swarm.d.ts +2 -2
- package/dist/swarm.js +39 -39
- package/dist/timeline.cjs +38 -38
- package/dist/timeline.d.cts +2 -2
- package/dist/timeline.d.ts +2 -2
- package/dist/timeline.js +40 -40
- package/dist/tree.cjs +38 -38
- package/dist/tree.d.cts +2 -2
- package/dist/tree.d.ts +2 -2
- package/dist/tree.js +36 -36
- package/dist/treemap.cjs +40 -40
- package/dist/treemap.d.cts +2 -2
- package/dist/treemap.d.ts +2 -2
- package/dist/treemap.js +38 -38
- package/dist/{types-DPf3PUs2.d.cts → types-5xXhTghj.d.cts} +1 -1
- package/dist/{types-DPf3PUs2.d.ts → types-5xXhTghj.d.ts} +1 -1
- package/dist/waffle.cjs +40 -40
- package/dist/waffle.d.cts +2 -2
- package/dist/waffle.d.ts +2 -2
- package/dist/waffle.js +40 -40
- package/dist/waterfall.cjs +37 -37
- package/dist/waterfall.d.cts +2 -2
- package/dist/waterfall.d.ts +2 -2
- package/dist/waterfall.js +38 -38
- package/dist/wrapper-api.json +1849 -0
- package/package.json +8 -6
package/dist/index.cjs
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
"use strict";var Pr=Object.defineProperty;var ds=Object.getOwnPropertyDescriptor;var pi=Object.getOwnPropertyNames;var bi=Object.prototype.hasOwnProperty;var gi=(e,n)=>{for(var t in n)Pr(e,t,{get:n[t],enumerable:!0})},xi=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of pi(n))!bi.call(e,a)&&a!==t&&Pr(e,a,{get:()=>n[a],enumerable:!(r=ds(n,a))||r.enumerable});return e};var yi=e=>xi(Pr({},"__esModule",{value:!0}),e),u=(e,n,t,r)=>{for(var a=r>1?void 0:r?ds(n,t):n,o=e.length-1,s;o>=0;o--)(s=e[o])&&(a=(r?s(n,t,a):s(a))||a);return r&&a&&Pr(n,t,a),a};var Ll={};gi(Ll,{SkdxAreaChart:()=>ur,SkdxBarChart:()=>dr,SkdxBoxplot:()=>At,SkdxBubbleChart:()=>Ue,SkdxBulletChart:()=>Kt,SkdxBumpChart:()=>_t,SkdxCandlestickChart:()=>Qe,SkdxChordChart:()=>pn,SkdxCirclePackingChart:()=>dn,SkdxComboChart:()=>hr,SkdxDumbbellChart:()=>zt,SkdxFunnelChart:()=>Jt,SkdxGanttChart:()=>tn,SkdxGaugeChart:()=>Je,SkdxHeatmap:()=>He,SkdxHistogram:()=>Ye,SkdxIcicleChart:()=>Dt,SkdxLineChart:()=>mr,SkdxLinearGauge:()=>St,SkdxMapChart:()=>Ot,SkdxMarimekkoChart:()=>gn,SkdxNetworkChart:()=>Vt,SkdxOrganizationChart:()=>Xt,SkdxParallelCoordinatesChart:()=>an,SkdxParetoChart:()=>ot,SkdxPieChart:()=>lt,SkdxPolarAreaChart:()=>Rt,SkdxRadarChart:()=>nt,SkdxRadialBarChart:()=>at,SkdxRangeChart:()=>_e,SkdxSankeyChart:()=>gt,SkdxScatterChart:()=>Xe,SkdxSparkline:()=>bt,SkdxSunburstChart:()=>rt,SkdxSwarmPlot:()=>yn,SkdxTimelineChart:()=>Tn,SkdxTreeChart:()=>Et,SkdxTreemap:()=>Tt,SkdxWaffleChart:()=>jt,SkdxWaterfallChart:()=>yt,csv:()=>Sr,exportChart:()=>Lr,makeFormatter:()=>ae,seriesCsv:()=>xo,svgMarkup:()=>Or,syncGroup:()=>ir});module.exports=yi(Ll);var si=require("lit/decorators.js");var ms=e=>Number(e.toPrecision(12)),vi,da=e=>(vi??(vi=new Intl.NumberFormat)).format(ms(e)),Mi=e=>{let n=Math.round(Math.abs(e)),t=e<0?"-":"",r=Math.floor(n/3600),a=Math.floor(n%3600/60),o=s=>String(s).padStart(2,"0");return r>0?`${t}${r}h ${o(a)}m`:a>0?`${t}${a}m ${o(n%60)}s`:`${t}${n}s`};function ae(e){if(e===void 0)return da;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:a="",timeZone:o}=e,s=m=>a?h=>m(h)+a:m,c=m=>r===void 0?m===void 0?{}:{maximumFractionDigits:m}:{minimumFractionDigits:r,maximumFractionDigits:r},l=m=>{let h=new Intl.NumberFormat(t,m);return s(f=>h.format(ms(f)))},d=m=>{let h=new Intl.DateTimeFormat(t,o?{...m,timeZone:o}:m);return f=>h.format(f)};switch(n){case"integer":return l({maximumFractionDigits:0});case"decimal":return l(c(2));case"percent":return l({style:"percent",...c(0)});case"currency":return l({style:"currency",currency:e.currency??"USD",...c()});case"compact":return l({notation:"compact",...c(1)});case"scientific":return l({notation:"scientific",...c(2)});case"date":return d({dateStyle:"medium"});case"time":return d({timeStyle:"short"});case"datetime":return d({dateStyle:"medium",timeStyle:"short"});case"duration":return s(Mi)}}function Qt(e,n){if(typeof e=="string")return e;let t=e instanceof Date?e.getTime():e;return n?ae(n)(t):e instanceof Date?new Intl.DateTimeFormat().format(e):da(t)}var qe=e=>{if(e instanceof Date)return e.getTime();if(typeof e=="number")return e;let n=Number(e);return Number.isFinite(n)&&e.trim()!==""?n:Date.parse(e)};function st([e,n],[t,r]){let a=n-e;return o=>a===0?t:t+(o-e)/a*(r-t)}function ht(e,n,t=5){if(e===n)return[e];let r=(n-e)/Math.max(1,t),a=10**Math.floor(Math.log10(r)),o=r/a,s=(o<1.5?1:o<3.5?2:o<7.5?5:10)*a,c=Math.floor(e/s)*s,l=Math.ceil(n/s)*s,d=[];for(let m=c;m<=l+s/2;m+=s)d.push(us(m));return d}function je(e,[n,t],r=.2){let a=e===0?0:(t-n)/e,o=a*(1-Math.max(0,Math.min(.9,r)));return{step:a,bandwidth:o,start:s=>n+s*a+(a-o)/2,center:s=>n+(s+.5)*a}}var us=e=>Number(e.toPrecision(12)),i=e=>Number(e.toFixed(2)),P=e=>typeof e=="number"&&Number.isFinite(e),Ve=e=>e.filter(P);function we(e){let n=1/0,t=-1/0;for(let r of e)P(r)&&(r<n&&(n=r),r>t&&(t=r));return n===1/0?[0,0]:[n,t]}function it(e,n="linear"){if(e.length===0)return"";let t=e[0];if(n==="step"||n==="stepBefore"||n==="stepAfter"){let d=`M${t.x} ${t.y}`;for(let m=1;m<e.length;m++){let h=e[m-1],f=e[m];n==="stepAfter"?d+=`H${f.x}V${f.y}`:n==="stepBefore"?d+=`V${f.y}H${f.x}`:d+=`H${i((h.x+f.x)/2)}V${f.y}H${f.x}`}return d}if(n==="linear"||e.length<3)return`M${e.map(d=>`${d.x} ${d.y}`).join("L")}`;let r=e.length,a=e.slice(1).map((d,m)=>d.x-e[m].x),o=e.slice(1).map((d,m)=>d.y-e[m].y),s=a.map((d,m)=>d===0?0:o[m]/d),c=[s[0]];for(let d=1;d<r-1;d++){let m=s[d-1],h=s[d];c.push(m*h<=0?0:(m+h)/2)}c.push(s[r-2]);for(let d=0;d<r-1;d++){let m=s[d];if(m===0){c[d]=0,c[d+1]=0;continue}let h=c[d]/m,f=c[d+1]/m,M=Math.hypot(h,f);M>3&&(c[d]=3*h*m/M,c[d+1]=3*f*m/M)}let l=`M${t.x} ${t.y}`;for(let d=0;d<r-1;d++){let m=e[d],h=e[d+1],f=a[d]/3;l+=`C${i(m.x+f)} ${i(m.y+f*c[d])} ${i(h.x-f)} ${i(h.y-f*c[d+1])} ${h.x} ${h.y}`}return l}var xr=1e3,yr=60*xr,vr=60*yr,Mr=24*vr,wi=[xr,5*xr,15*xr,30*xr,yr,5*yr,15*yr,30*yr,vr,3*vr,6*vr,12*vr,Mr,2*Mr,7*Mr,14*Mr];function Qn(e,n,t=6){if(!(n>e))return[e];let r=n-e,a=wi.find(h=>r/h<=t),o=[];if(a!==void 0){for(let h=Math.ceil(e/a)*a;h<=n;h+=a)o.push(h);return o.length?o:[e,n]}let s=r/(30*Mr),c=[1,2,3,6,12,24,60,120].find(h=>s/h<=t)??240,l=new Date(e),d=l.getUTCFullYear(),m=Math.ceil((l.getUTCMonth()+(l.getUTCDate()>1?1:0))/c)*c;for(let h=Date.UTC(d,m,1);h<=n;)o.push(h),m+=c,m>=12&&(d+=Math.floor(m/12),m%=12),h=Date.UTC(d,m,1);return o.length?o:[e,n]}function hs(e,n){let t=Math.floor(Math.log10(e)),r=Math.ceil(Math.log10(n)),a=r-t<=1?[1,2,5]:[1],o=[];for(let s=t;s<=r;s++)for(let c of a)o.push(us(c*10**s));return o.filter(s=>s>=e/1.0001&&s<=n*1.0001)}function Jn(e,n={}){if(n.thresholds&&n.thresholds.length>=2)return[...n.thresholds].filter(Number.isFinite).sort((l,d)=>l-d);let[t,r]=n.domain??we(e),a=Math.max(1,e.length),o=Math.max(1,n.bins??Math.ceil(Math.log2(a)+1)),s=n.binWidth??(r>t?(r-t)/o:1),c=r>t?Math.max(1,Math.ceil((r-t)/s-1e-9)):1;return Array.from({length:c+1},(l,d)=>Number((t+d*s).toPrecision(12)))}function er(e,n){let t=[];for(let o=0;o+1<n.length;o++)t.push({x0:n[o],x1:n[o+1],count:0});if(t.length===0)return t;let r=n[0],a=n[n.length-1];for(let o of Ve(e)){if(o<r||o>a)continue;let s=0,c=t.length-1;for(;s<c;){let l=s+c+1>>1;t[l].x0<=o?s=l:c=l-1}t[s].count++}return t}var ki=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,$i=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,Ii={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function Ti(e,n,t){return e.replace($i,(r,a,o)=>{let s=Ii[a];if(s===void 0)return a+o;let l=(o.match(ki)??[]).map((d,m)=>{let h=Number(d);if(s===-1)return String(h+n);if(s===-2)return String(h+t);let f=m%s;return s===7?f===5?String(h+n):f===6?String(h+t):d:String(f%2===0?h+n:h+t)});return a+l.join(" ")})}var fs=(e,n,t)=>e.map(r=>{switch(r.kind){case"rect":return{...r,x:r.x+n,y:r.y+t};case"circle":return{...r,cx:r.cx+n,cy:r.cy+t};case"line":return{...r,x1:r.x1+n,x2:r.x2+n,y1:r.y1+t,y2:r.y2+t};case"text":return{...r,x:r.x+n,y:r.y+t};case"path":return{...r,d:Ti(r.d,n,t)}}});var ma=["primary","success","warning","danger","neutral"].flatMap(e=>[500,700].map(n=>`var(--skdx-color-${e}-${n})`)).sort((e,n)=>Number(e.endsWith("700)"))-Number(n.endsWith("700)"))),K={axis:"var(--skdx-color-border-strong)",grid:"var(--skdx-color-border-subtle)",label:"var(--skdx-color-text-muted)",focus:"var(--skdx-color-focus-ring)",positive:"var(--skdx-color-success-500)",negative:"var(--skdx-color-danger-500)",fontFamily:"var(--skdx-font-family)",fontSize:"var(--skdx-font-size-xs)"},Bt=(e="neutral")=>e==="neutral"?K.axis:`var(--skdx-color-${e}-500)`,ua=(e="neutral")=>e==="neutral"?K.label:e==="primary"?"var(--skdx-color-text-accent)":`var(--skdx-color-text-${e})`,ps=(e,n)=>n??ma[e%ma.length];var fe={top:16,right:16,bottom:32,left:48};function Te(e,n,t=fe){return{x:t.left,y:t.top,width:Math.max(0,e-t.left-t.right),height:Math.max(0,n-t.top-t.bottom)}}function Zn(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function fa(e){let n=e.tooltip;return n===void 0||n===!0?{enabled:!0}:n===!1?{enabled:!1}:{...n,enabled:n.enabled??!0}}var Hr=e=>e.crosshair===!0||fa(e).trigger==="axis",Vr=20,Ai=120,bs=e=>{let n=Zn(e);return n&&(n.position==="left"||n.position==="right")?n.width??Ai:0},de=(e,n=600,t=300)=>({width:(e.width??n)-bs(e),height:(e.height??t)-(Zn(e)?.position==="bottom"?Vr:0)}),ue=(e,n,t)=>{let r=Zn(e);return!r||!(r.position===void 0||r.position==="top")?0:(n?Math.max(1,gs(n,t??de(e).width,r)):1)*Vr},ie=6.5;function pa(e,n){let t=Array.from(e),r=Math.max(0,Math.floor(n/ie));return t.length<=r?e:r===0?"":`${t.slice(0,r-1).join("")}\u2026`}var ne=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:ps(n)),xe=(e,n)=>e.hiddenSeries?.includes(n)??!1;function ha(e,n,t=[],r={},a=10,o=8,s=!1){let c=[],l=r.maxItems,d=l!==void 0&&l>=0&&e.length>l?e.slice(0,l):e,m=e.length-d.length,h=r.interactive??!0,f=o,M=a,$=(g,w,R,k)=>{let T=(w?18:4)+g.length*ie;f>o&&(s||f+T>n-8)&&(f=o,M+=Vr),w&&c.push({kind:"rect",part:"legend-swatch",x:f,y:M-5,width:10,height:10,fill:w,opacity:k?.3:void 0,item:R}),c.push({kind:"text",part:"legend-label",x:f+(w?14:0),y:M,text:g,baseline:"middle",fill:k?K.grid:K.label,item:R}),f+=T+12};for(let g of d){let w=t.includes(g.name),R=h?{label:g.name,series:g.name,legend:!0}:void 0;$(r.formatter?.(g.name)??g.name,g.color,R,w)}return m>0&&$(`+${m} more`,void 0,void 0,!1),r.align==="end"?Ci(c,n):c}function Ci(e,n){let t=new Map;for(let a of e){let o=a.kind==="rect"?a.y+5:a.y;t.set(o,[...t.get(o)??[],a])}let r=[];for(let a of t.values()){let o=Math.max(...a.map(c=>c.kind==="rect"?c.x+c.width:c.x+c.text.length*ie)),s=n-8-o;for(let c of a)r.push({...c,x:c.x+s})}return r}var gs=(e,n,t={})=>new Set(ha(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function he(e,n,t,r=[]){let a=Zn(e),o=a&&e.direction==="rtl"&&a.align===void 0?{...a,align:"end"}:a,s=fa(e),c=o?.position==="bottom",l=bs(e),d=e.hiddenSeries??[],m=o?l?ha(r,1/0,d,o,10,(o.position==="right"?n:0)+8,!0):ha(r,n,d,o,c?t+10:10):[],h=c?gs(r,n,o):0;return{width:n+l,height:c?t+Math.max(1,h)*Vr:t,legendOffset:o?.position==="left"?l:void 0,tooltip:s.enabled,tooltipFormatter:s.formatter,axisTooltipFormatter:s.axisFormatter,tooltipPortal:s.portal,tooltipPlacement:s.placement,tooltipAnchored:s.followPointer===!1?!0:void 0,description:e.description,decorative:e.decorative,animate:e.animate===!0?300:e.animate||void 0,responsive:!!e.responsive,shapes:m}}function ba(e){let n=e.legendOffset;if(!n)return e;let t=[...fs(e.shapes.filter(l=>!l.part.startsWith("legend-")),n,0),...e.shapes.filter(l=>l.part.startsWith("legend-"))],r=l=>({...l,x:l.x+n}),a=e.hit?{...e.hit,plot:r(e.hit.plot),xs:e.hit.xs.map(l=>l+n),brush:e.hit.brush?{box:r(e.hit.brush.box),window:r(e.hit.brush.window)}:void 0}:void 0,o=e.edit,s=o?{...o,scale:l=>o.scale(l)+n,invert:l=>o.invert(l-n),bars:o.bars.map(l=>({...l,x0:l.x0+n,x1:l.x1+n}))}:void 0,c=e.map?{...e.map,plot:r(e.map.plot)}:void 0;return{...e,shapes:t,hit:a,edit:s,map:c,legendOffset:void 0}}function _r(e,n,t,r,a,o="auto"){let s=Array.isArray(t)?t:[t],c=Math.max(1,Math.floor((r-12)/ie)),l=s.flatMap(w=>{let R=[],k=Array.from(w);for(;k.length>c;){let T=k.slice(0,c+1).lastIndexOf(" ");T<1&&(T=c),R.push(k.slice(0,T).join("")),k=k.slice(T),k[0]===" "&&k.shift()}return R.push(k.join("")),R}),d=Math.max(1,Math.floor((a-6)/16)),m=l.slice(0,d);l.length>d&&(m[d-1]=pa(`${m[d-1]}\u2026`,r-12));let h=Math.min(r,Math.max(0,...m.map(w=>Array.from(w).length))*ie+12),f=Math.min(a,6+m.length*16),M=o==="top"?{x:e-h/2,y:n-f-8}:o==="bottom"?{x:e-h/2,y:n+8}:o==="left"?{x:e-h-8,y:n-f/2}:o==="right"?{x:e+8,y:n-f/2}:{x:e+12,y:n-f-6},$=Math.max(0,Math.min(r-h,M.x)),g=Math.max(0,Math.min(a-f,M.y));return[{kind:"rect",part:"tooltip",title:s.join(`
|
|
2
|
-
`),x:i($),y:i(g),width:i(h),height:f,fill:"var(--skdx-color-surface-raised)",stroke:K.axis,rx:8},...m.map((w,R)=>({kind:"text",part:"tooltip-label",x:i($+6),y:i(g+11+R*16),text:w,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:m.length>1&&R===0?"bold":void 0}))]}function Gt(e,n){let[t,r]=we(e);return n?[Math.min(0,t),Math.max(0,r)]:[t,r]}function Ge([e,n],t,r=!1,a){let o=typeof r=="boolean"?{scale:r?"log":"linear"}:r,s=ae(o.format??a),c=o.min??e,l=o.max??n;o.reversed&&(t=[t[1],t[0]]);let d={id:o.id,position:o.position,options:o};if(o.scale==="sqrt"){let g=S=>Math.sign(S)*Math.sqrt(Math.abs(S)),w=o.nice===!1?[c,l]:ht(c,l,o.ticks),R=o.min??w[0],k=o.max??w[w.length-1],T=st([g(R),g(k)],t),D=S=>T(g(S)),v=ht(R,k,o.ticks).filter(S=>S>=R-1e-9&&S<=k+1e-9);return{...d,scale:D,domain:[R,k],format:s,ticks:(v.length>=2?v:[R,k]).map(S=>({pos:i(D(S)),label:s(S)})),zero:i(D(Math.min(Math.max(0,R),k)))}}if(o.scale==="log"){let g=Math.max(c,Number.EPSILON),w=Math.max(l,g),R=hs(g,w),k=[Math.log10(g),Math.log10(w)],T=st(k,t),D=v=>T(Math.log10(Math.max(v,Number.EPSILON)));return{...d,scale:D,domain:k,format:s,ticks:R.map(v=>({pos:i(D(v)),label:s(v)})),zero:i(t[0])}}let m=ht(c,l,o.ticks),h=[o.min??(o.nice===!1?c:m[0]),o.max??(o.nice===!1?l:m[m.length-1])],f=st(h,t),M=m.filter(g=>g>=h[0]-1e-9&&g<=h[1]+1e-9),$=(M.length>=2?M:[h[0],h[1]]).map(g=>({pos:i(f(g)),label:s(g)}));return{...d,scale:f,domain:h,format:s,ticks:$,zero:i(f(Math.min(Math.max(0,h[0]),h[1])))}}var jr=([e,n],t)=>Math.max(fe.left,ht(e,n).reduce((r,a)=>Math.max(r,t(a).length),0)*ie+14),En=e=>e?.grid!==!1;function Ne(e,n){if(e.length<2)return e;let t=e.reduce((a,o)=>Math.max(a,o.label.length),0)*ie+8,r=Math.max(1,Math.ceil(e.length*t/Math.max(1,n)));return r===1?e:e.filter((a,o)=>o%r===0)}var wr=(e,n,t,r)=>`${e}, ${n}: ${r(t)}`;function le(e,n,t,r){let a=e.error!==void 0?"error":e.loading?"loading":n?"empty":null;if(!a)return null;let{width:o,height:s}=de(e,t,r),c=a==="error"?e.error:a==="loading"?"Loading\u2026":e.emptyMessage??"No data available",l=[];return a==="loading"&&l.push({kind:"rect",part:"skeleton",x:0,y:0,width:o,height:s,fill:"var(--skdx-color-surface-sunken)",rx:8}),l.push({kind:"text",part:`state-${a}`,x:i(o/2),y:i(s/2),text:c,anchor:"middle",baseline:"middle",fill:a==="error"?"var(--skdx-color-text-danger)":K.label}),{...he(e,o,s),shapes:l,tooltip:!1}}var tr=(e,n,t)=>{let r=n.length*ie/2;return e+r>t?"end":e-r<0?"start":"middle"};function Ze(e,n={}){let{plot:t,xTicks:r,yTicks:a,baseline:o}=e,s=t.x+t.width,c=t.y+t.height,l=[],d=n.grid??!0,m=($,g)=>g?{kind:"line",part:"grid",x1:$.pos,x2:$.pos,y1:t.y,y2:c,stroke:K.grid}:{kind:"line",part:"grid",x1:t.x,x2:s,y1:$.pos,y2:$.pos,stroke:K.grid},h=n.x?.tickRotation??0,f=($,g,w,R)=>h?J($,g,w,{part:R,anchor:h<0?"end":"start",baseline:"middle",rotate:h}):Un($,g,w,e.width,{part:R,anchor:tr($,w,e.width)}),M=($,g,w,R,k)=>{for(let T of $)l.push(g==="x"?{kind:"line",part:"tick",x1:T.pos,x2:T.pos,y1:w,y2:i(w+R*k),stroke:K.axis}:{kind:"line",part:"tick",x1:w,x2:i(w+R*k),y1:T.pos,y2:T.pos,stroke:K.axis})};if(n.categoryGrid)for(let $ of r)l.push(m($,!n.horizontal));if(n.horizontal){let $=n.axes??[{ticks:a,position:"bottom",offset:0,label:n.yLabel,...n.y}];if(d)for(let g of a)l.push(m(g,!0));$[0]?.showLine!==!1&&l.push({kind:"line",part:"axis",x1:o,x2:o,y1:t.y,y2:c,stroke:K.axis});for(let g of $){let w=g.position==="top"||g.position==="right",R=i(w?t.y-g.offset:c+g.offset),k=w||g.offset>0;g.showLine&&k&&l.push({kind:"line",part:"axis",x1:t.x,x2:s,y1:R,y2:R,stroke:K.axis}),g.showTicks&&M(g.ticks,"x",R,w?-1:1,g.tickSize??4);let T=i(w?R-8:R+20);for(let D of g.ticks)l.push(w?J(D.pos,T,D.label,{part:"x-label-top",anchor:tr(D.pos,D.label,e.width)}):f(D.pos,T,D.label,"x-label"));g.label&&l.push(k?J(4,T,g.label,{part:"axis-title",anchor:"start",baseline:w?void 0:"middle"}):J(4,t.y-6,g.label,{part:"axis-title",anchor:"start"}))}n.x?.showLine&&l.push({kind:"line",part:"axis",x1:n.rtl?s:t.x,x2:n.rtl?s:t.x,y1:t.y,y2:c,stroke:K.axis}),n.x?.showTicks&&M(r,"y",n.rtl?s:t.x,n.rtl?1:-1,n.x.tickSize??4);for(let g of r)l.push(n.rtl?J(s+8,g.pos,g.label,{part:"y-label",anchor:"start",baseline:"middle"}):J(t.x-8,g.pos,g.label,{part:"y-label",anchor:"end",baseline:"middle"}))}else{if(d)for(let g of a)l.push(m(g,!1));n.y?.showLine!==!1&&l.push({kind:"line",part:"axis",x1:t.x,x2:s,y1:o,y2:o,stroke:K.axis});let $=n.axes??[{ticks:a,position:"left",offset:0,label:n.yLabel,...n.y},...n.rightTicks?[{ticks:n.rightTicks,position:"right",offset:0,label:n.rightLabel}]:[]];for(let g of $){let w=g.position==="left",R=w?t.x-g.offset:s+g.offset,k=w?"y-label":"y-label-right";g.showLine&&l.push({kind:"line",part:"axis",x1:i(R),x2:i(R),y1:t.y,y2:c,stroke:K.axis}),g.showTicks&&M(g.ticks,"y",i(R),w?-1:1,g.tickSize??4);for(let T of g.ticks)l.push(J(i(w?R-8:R+8),T.pos,T.label,{part:k,anchor:w?"end":"start",baseline:"middle"}));g.label&&l.push(J(i(w?g.offset===0?4:Math.max(4,R-40):g.offset===0?e.width-4:Math.min(e.width-4,R+40)),t.y-6,g.label,{part:"axis-title",anchor:w?"start":"end"}))}n.x?.showTicks&&M(r,"x",c,1,n.x.tickSize??4);for(let g of r)l.push(f(g.pos,c+(h?12:20),g.label,"x-label"))}return n.xLabel&&l.push(J(i(t.x+t.width/2),e.height-4,n.xLabel,{part:"axis-title",anchor:"middle"})),n.horizontal&&n.rightLabel&&l.push(J(e.width-4,t.y-6,n.rightLabel,{part:"axis-title",anchor:"end"})),l}var J=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:K.label,...r});function Un(e,n,t,r,a={}){let o=Math.max(4,Math.min(r-4,e)),s=a.anchor??"start",c=s==="middle"?2*Math.min(o-4,r-o-4):s==="end"?o-4:r-o-4,l=pa(t,c);return{kind:"text",part:"label",x:o,y:n,fill:K.label,...a,text:l,title:l===t?a.title:t}}function ft(e){return e.flatMap(n=>{if(n.kind!=="text"||n.fill!=="var(--skdx-color-text-on-accent)"&&n.part!=="reference-label")return[n];let t=n.text.length*ie+8,r=n.x-(n.anchor==="middle"?t/2:n.anchor==="end"?t-4:4),a=n.y-(n.baseline==="hanging"?2:n.baseline==="middle"?9:14);return[{kind:"rect",part:"label-background",x:r,y:a,width:t,height:18,rx:8,fill:"var(--skdx-color-surface-raised)"},{...n,fill:n.part==="reference-label"?n.fill:"var(--skdx-color-text-default)"}]})}var Ft=(e,n,t,r,a,o)=>({kind:"circle",part:"point",cx:e,cy:n,r:t,fill:r,title:a,item:o});function Wt(e,n){let t=[],{plot:r}=n,a=r.x+r.width,o=r.y+r.height,s=l=>Math.max(r.x,Math.min(a,l)),c=l=>Math.max(r.y,Math.min(o,l));for(let l of e??[]){let d=l.color??Bt(l.variant),m=l.color??ua(l.variant),h={part:"reference-label",fill:m},f=n.horizontal===!0;if("y"in l){let M=i(n.y(l.y,l.axis??"left"));if(f){let $=s(M);t.push(...ys($,r.y,o,d,l.label,h))}else{let $=c(M);t.push(...xs(r.x,a,$,d,l.label,h))}}else if("x"in l){let M=n.x(l.x);if(M===void 0)continue;f?t.push(...xs(r.x,a,c(i(M)),d,l.label,h)):t.push(...ys(s(i(M)),r.y,o,d,l.label,h))}else if("y1"in l){let M=i(n.y(l.y1,l.axis??"left")),$=i(n.y(l.y2,l.axis??"left"));f?t.push(...Ms(s(Math.min(M,$)),s(Math.max(M,$)),r,d,l.label,m)):t.push(...vs(c(Math.min(M,$)),c(Math.max(M,$)),r,d,l.label,m))}else{let M=n.x(l.x1),$=n.x(l.x2);if(M===void 0||$===void 0)continue;let g=i(Math.min(M,$)),w=i(Math.max(M,$));f?t.push(...vs(c(g),c(w),r,d,l.label,m)):t.push(...Ms(s(g),s(w),r,d,l.label,m))}}return t}function xs(e,n,t,r,a,o){let s={kind:"line",part:"reference",x1:e,x2:n,y1:t,y2:t,stroke:r,dash:"6 4",strokeWidth:1.5,title:a};return a?[s,J(n-4,t-5,a,{...o,anchor:"end"})]:[s]}function ys(e,n,t,r,a,o){let s={kind:"line",part:"reference",x1:e,x2:e,y1:n,y2:t,stroke:r,dash:"6 4",strokeWidth:1.5,title:a};return a?[s,J(e+4,n+10,a,{...o,anchor:"start"})]:[s]}function vs(e,n,t,r,a,o){let s={kind:"rect",part:"reference-area",x:t.x,y:e,width:t.width,height:i(Math.max(0,n-e)),fill:r,opacity:.12,title:a};return a?[s,J(t.x+t.width-4,e+12,a,{part:"reference-label",fill:o,anchor:"end"})]:[s]}function Ms(e,n,t,r,a,o){let s={kind:"rect",part:"reference-area",x:e,y:t.y,width:i(Math.max(0,n-e)),height:t.height,fill:r,opacity:.12,title:a};return a?[s,J(e+4,t.y+12,a,{part:"reference-label",fill:o,anchor:"start"})]:[s]}function Dn(e,n){let t=[],{plot:r}=n,a=r.x+r.width,o=r.y+r.height;for(let s of e??[]){let c=s.color??Bt(s.variant),l=s.color??ua(s.variant),d=($,g,w)=>{let R=n.x($);if(R===void 0)return;let k=n.y(g,w??"left");return n.horizontal?{x:i(k),y:i(R)}:{x:i(R),y:i(k)}},m=s.id??s.label,h=$=>({label:$,id:m,name:s.label});if(s.type==="line"||s.type==="band"){let{type:$,id:g,...w}=s;t.push(...Wt([w],n));continue}if(s.type==="rect"){let $=d(s.x1,s.y1,s.axis),g=d(s.x2,s.y2,s.axis);if(!$||!g)continue;let w=Math.max(r.x,Math.min($.x,g.x)),R=Math.max(r.y,Math.min($.y,g.y)),k=s.label??"";t.push({kind:"rect",part:"annotation-rect",x:i(w),y:i(R),width:i(Math.max(0,Math.min(a,Math.max($.x,g.x))-w)),height:i(Math.max(0,Math.min(o,Math.max($.y,g.y))-R)),fill:c,opacity:.12,stroke:c,title:k||void 0,item:k?h(k):void 0}),s.label&&t.push(J(i(w+4),i(R+12),s.label,{part:"annotation-label",fill:l}));continue}let f=d(s.x,s.y,s.axis);if(!f)continue;if(s.type==="text"){t.push(J(f.x,f.y,s.text,{part:"annotation-text",fill:l,anchor:"middle",baseline:"middle",title:s.label}));continue}let M=s.label??`${String(s.x)}, ${s.y}`;if(t.push({kind:"circle",part:"annotation-point",cx:f.x,cy:f.y,r:5,fill:c,stroke:"var(--skdx-color-surface-default)",title:M,item:h(M)}),s.type==="callout"&&s.label){let[$,g]=s.offset??[16,-16],w=i(Math.max(r.x,Math.min(a,f.x+$))),R=i(Math.max(r.y,Math.min(o,f.y+g)));t.push({kind:"line",part:"annotation-leader",x1:f.x,y1:f.y,x2:w,y2:R,stroke:c},J(w,R,s.label,{part:"annotation-label",fill:l,anchor:$>=0?"start":"end",baseline:"middle"}))}}return t}var ga=2e3;function Oi(e){if(e!=="none")return e===void 0||e==="auto"?{strategy:"lttb",threshold:ga}:typeof e=="string"?{strategy:e,threshold:ga}:{strategy:e.strategy,threshold:e.threshold??ga}}function Li(e,n){let t=e.length;if(n>=t||n<3)return e.map((c,l)=>l);let r=[0],a=[],o=(t-2)/(n-2),s=0;for(let c=0;c<n-2;c++){let l=Math.floor((c+1)*o)+1,d=Math.min(t-1,Math.floor((c+2)*o)+1),m=0,h=0,f=0;for(let T=l;T<d;T++){let D=e[T];P(D)&&(m+=T,h+=D,f++)}m=f?m/f:(l+d)/2,h=f?h/f:0;let M=Math.floor(c*o)+1,$=Math.min(t-1,Math.floor((c+1)*o)+1),g=e[s],w=P(g)?g:0,R=-1,k=-1;for(let T=M;T<$;T++){let D=e[T];if(!P(D)){a.push(T);continue}let v=Math.abs((s-m)*(D-w)-(s-T)*(h-w));v>k&&(k=v,R=T)}R<0&&(R=M),r.push(R),s=R}return r.push(t-1),a.length?[...new Set([...r,...a])].sort((c,l)=>c-l):r}function Si(e,n){let t=e.length,r=Math.max(1,Math.floor(n/2));if(r*2>=t)return e.map((s,c)=>c);let a=[],o=t/r;for(let s=0;s<r;s++){let c=Math.floor(s*o),l=s===r-1?t:Math.floor((s+1)*o),d=-1,m=-1;for(let h=c;h<l;h++){let f=e[h];if(!P(f)){a.push(h);continue}(d<0||f<e[d])&&(d=h),(m<0||f>e[m])&&(m=h)}d>=0&&a.push(Math.min(d,m)),m>=0&&m!==d&&a.push(Math.max(d,m))}return[...new Set(a)].sort((s,c)=>s-c)}function zi(e,n){let t=e.length,r=Math.max(1,Math.floor(n/4));if(r*4>=t)return e.map((s,c)=>c);let a=[],o=t/r;for(let s=0;s<r;s++){let c=Math.floor(s*o),l=s===r-1?t:Math.floor((s+1)*o),d=-1,m=-1,h=-1,f=-1;for(let M=c;M<l;M++){let $=e[M];if(!P($)){a.push(M);continue}h<0&&(h=M),f=M,(d<0||$<e[d])&&(d=M),(m<0||$>e[m])&&(m=M)}for(let M of[h,d,m,f])M>=0&&a.push(M)}return[...new Set(a)].sort((s,c)=>s-c)}function ws(e,n,t){let r=Oi(t);if(!r||n<=r.threshold||e.length===0)return;let a=r.strategy==="minmax"?Si:r.strategy==="m4"?zi:Li,o=new Set;for(let s of e)for(let c of a(s.slice(0,n),r.threshold))o.add(c);return[...o].sort((s,c)=>s-c)}var kr=e=>Math.max(0,Math.min(1,e));function ks(e){let n=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(n){let r=n[1],a=r.length===3?r.split("").map(o=>o+o).join(""):r;return[0,2,4].map(o=>parseInt(a.slice(o,o+2),16))}let t=/^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)/i.exec(e.trim());return t?[Number(t[1]),Number(t[2]),Number(t[3])]:void 0}function $s(e,n){if(e.length===0)return K.axis;if(e.length===1)return e[0];let t=kr(n)*(e.length-1),r=Math.min(e.length-2,Math.floor(t)),a=t-r,o=ks(e[r]),s=ks(e[r+1]);if(!o||!s)return e[Math.round(t)];let c=l=>Math.round(o[l]+(s[l]-o[l])*a);return`rgb(${c(0)}, ${c(1)}, ${c(2)})`}var Is=(e,n)=>n!==void 0&&n>=2?Math.min(n-1,Math.floor(kr(e)*n))/(n-1):kr(e);function Pt(e,n,t,r=K.negative,a=String){let[o,s]=we(n),c=e??{type:"sequential"},l=w=>i(.15+.85*w);if(c.type==="threshold"){let{thresholds:w,colors:R,labels:k}=c,T=v=>{if(typeof v!="number"||!Number.isFinite(v))return;let S=0;for(;S<w.length&&v>=w[S];)S++;return{fill:R[Math.min(S,R.length-1)]??t,opacity:1}},D=R.map((v,S)=>({fill:v,opacity:1,label:k?.[S]??(S===0?`< ${a(w[0]??0)}`:S===w.length?`\u2265 ${a(w[S-1])}`:`${a(w[S-1])} \u2013 ${a(w[S])}`)}));return{color:T,domain:[o,s],swatches:D,kind:"threshold"}}if(c.type==="ordinal"){let w=c.colors?.length?c.colors:[t];return{color:k=>typeof k=="number"&&Number.isFinite(k)?{fill:w[Math.abs(Math.round(k))%w.length],opacity:1}:void 0,domain:[o,s],swatches:w.map((k,T)=>({fill:k,opacity:1,label:String(T)})),kind:"ordinal"}}if(c.type==="diverging"){let[w,R,k]=c.domain??[-Math.max(Math.abs(o),Math.abs(s)),0,Math.max(Math.abs(o),Math.abs(s))],T=c.colors,D=z=>z<R?.5*(z-w)/Math.max(1e-12,R-w):.5+.5*(z-R)/Math.max(1e-12,k-R),v=z=>{let O=Is(c.reversed?1-kr(z):z,c.steps);if(T&&T.length>=2)return{fill:$s(T,O),opacity:1};let H=O<.5?r:t,b=Math.abs(O-.5)*2;return{fill:H,opacity:l(b)}},S=z=>typeof z=="number"&&Number.isFinite(z)?v(D(z)):void 0,L=c.steps??5,E=Array.from({length:L},(z,O)=>{let H=L===1?.5:O/(L-1),b=H<.5?w+(R-w)*(H*2):R+(k-R)*((H-.5)*2);return{...v(H),label:a(b)}});return{color:S,domain:[w,k],swatches:E,kind:"diverging"}}let[d,m]=c.domain??[o,s],h=c.colors,f=w=>{let R=Is(c.reversed?1-kr(w):w,c.steps);return h&&h.length>=2?{fill:$s(h,R),opacity:1}:{fill:h?.[0]??t,opacity:l(R)}},M=w=>typeof w!="number"||!Number.isFinite(w)?void 0:f(m===d?1:(w-d)/(m-d)),$=c.steps??5,g=Array.from({length:$},(w,R)=>{let k=$===1?1:R/($-1);return{...f(k),label:a(d+(m-d)*k)}});return{color:M,domain:[d,m],swatches:g,kind:"sequential"}}var Ni=34,Ri=72;function Bn(e){if(!e)return{bottom:0,right:0,options:{}};let n=e===!0?{}:e;return n.orientation==="vertical"?{bottom:0,right:Ri,options:n}:{bottom:Ni,right:0,options:n}}function nr(e,n,t){let r=typeof t=="string"?{title:t}:t??{},a=r.title,o=e.swatches;if(o.length===0||n.width<=0)return[];if(r.orientation==="vertical"){let m=Math.max(0,n.height-(a?16:0)),h=Math.min(16,m/o.length),f=n.y+(a?16:0),M=o.map((g,w)=>({kind:"rect",part:"color-legend-swatch",x:i(n.x),y:i(f+w*h),width:10,height:i(h),fill:g.fill,opacity:g.opacity,title:g.label})),$=h>=12?1:2;return o.forEach((g,w)=>{w%$!==0&&w!==o.length-1||M.push({kind:"text",part:"color-legend-label",x:i(n.x+14),y:i(f+(w+.5)*h),text:g.label,baseline:"middle",fill:K.label})}),a&&M.push({kind:"text",part:"color-legend-title",x:i(n.x),y:i(n.y+6),text:a,baseline:"middle",fill:K.label}),M}let s=Math.min(n.width/o.length,96),c=n.x+(n.width-s*o.length)/2,l=o.map((m,h)=>({kind:"rect",part:"color-legend-swatch",x:i(c+h*s),y:i(n.y),width:i(s),height:10,fill:m.fill,opacity:m.opacity,title:m.label})),d=e.kind==="threshold"?1:Math.max(1,Math.ceil(o.length*7*ie/Math.max(1,s*o.length)));return o.forEach((m,h)=>{h%d!==0&&h!==o.length-1||l.push({kind:"text",part:"color-legend-label",x:i(c+(h+.5)*s),y:i(n.y+22),text:m.label,anchor:"middle",fill:K.label})}),a&&l.push({kind:"text",part:"color-legend-title",x:i(c-6),y:i(n.y+5),text:a,anchor:"end",baseline:"middle",fill:K.label}),l}var Ei=1e4,Di=e=>Array.isArray(e)?{x:e[0],y:e[1],size:e[2],label:void 0,id:void 0,color:void 0,value:void 0}:{x:e.x,y:e.y,size:e.size,label:e.label,id:e.id,color:e.color,value:e.value};function xa(e,n,t,r,a,o,s,c){if(r==="circle")return{...Ft(e,n,t,a,o,s),part:c};let l=r==="square"?`M${i(e-t)} ${i(n-t)}h${i(2*t)}v${i(2*t)}h${i(-2*t)}Z`:r==="diamond"?`M${i(e)} ${i(n-t*1.3)}L${i(e+t*1.3)} ${i(n)}L${i(e)} ${i(n+t*1.3)}L${i(e-t*1.3)} ${i(n)}Z`:`M${i(e)} ${i(n-t*1.2)}L${i(e+t*1.15)} ${i(n+t*.9)}L${i(e-t*1.15)} ${i(n+t*.9)}Z`;return{kind:"path",part:c,d:l,fill:a,title:o,item:s}}function ya(e,n){let t=[],r=e.series.map((F,_)=>({name:F.name,id:F.id,symbol:F.symbol??"circle",color:ne(e,_,F.color),data:xe(e,F.name)?[]:F.data.flatMap((W,ee)=>{let te=Di(W);return P(te.x)&&P(te.y)?[{...te,index:ee}]:[]})})),a=e.sampling==="auto"?Ei:typeof e.sampling=="object"?e.sampling.threshold:1/0,o=r.reduce((F,_)=>F+_.data.length,0),s=o>a?Math.ceil(o/a):1;s>1&&t.push({code:"sampled",severity:"warning",message:`${o} points exceed the sampling threshold of ${a}; every ${s}th point is drawn.`});let c=s>1?r.map(F=>({...F,data:F.data.filter((_,W)=>W%s===0)})):r,l=c.flatMap(F=>F.data),d=le(e,l.length===0);if(d)return{...d,issues:t};let{width:m,height:h}=de(e),f=e.colorScale?Bn(e.colorLegend):{bottom:0,right:0,options:{}},M=e.series.map((F,_)=>({name:F.name,color:ne(e,_,F.color)})),$=Te(m,h,{...fe,top:fe.top+ue(e,M,m)+(e.yAxis?.label?12:0),right:fe.right+f.right,bottom:fe.bottom+(e.xAxis?.label?14:0)+f.bottom}),g=e.markerSize??3,w=Math.max(0,e.hitRadius??0),R=Math.max(0,e.jitter??0),k=we(l.map(F=>F.size)),T=F=>F==="diamond"?1.3:F==="triangle"?1.2:1,D=(F,_)=>Math.max(0,_?n.radius(F.size,k):g),v=0;for(let F of c){let _=F.data.some(ee=>ee.size!==void 0),W=T(F.symbol);for(let ee of F.data)v=Math.max(v,D(ee,_)*W)}let S=Math.min(1,Math.min($.width,$.height)*.45/Math.max(1,v+R)),L=R*S,E=v*S+L,z=new Map,O=e.colorScale?Pt(e.colorScale,l.map(F=>F.value),ne(e,0),void 0,ae(e.format)):void 0,H=Ge(Gt(l.map(F=>F.x),!1),[$.x+E,$.x+$.width-E],e.xAxis??{},e.format),b=Ge(Gt(l.map(F=>F.y),!1),[$.y+$.height-E,$.y+E],e.yAxis??{},e.format),x=he(e,m,h,M),C=[],y=[],B=[],U=[];for(let F of c){let _=F.data.some(W=>W.size!==void 0);for(let W of F.data){let ee=W.index,te=n.describe(F.name,W,H,b),re=D(W,_)*S,me=i(H.scale(W.x)),be=i(b.scale(W.y));if(L>0){let Be=`${Math.round(me)},${Math.round(be)}`,Fe=z.get(Be)??0;if(z.set(Be,Fe+1),Fe>0){let Mt=Fe*2.399963;me=i(me+L*Math.cos(Mt)),be=i(be+L*Math.sin(Mt))}}let Z=O?.color(W.value),oe={label:te,id:W.id,series:F.name,seriesId:F.id??F.name,name:W.label,index:ee,value:W.y},ke=W.color??Z?.fill??F.color;if(C.push(xa(me,be,i(re),F.symbol,ke,te,oe,_?n.part:"point")),w>0&&C.push({kind:"circle",part:"hit",cx:me,cy:be,r:i(re+w),fill:ke,opacity:0,title:te,item:oe}),e.labels&&W.label){let Be=W.label.length*ie,Fe=me-Be/2,Mt=be-re-4;U.some(wt=>Math.abs(wt.y-Mt)<12&&Fe<wt.x+wt.w+4&&Fe+Be+4>wt.x)||(U.push({x:Fe,y:Mt,w:Be}),y.push(J(me,i(Mt),W.label,{part:"point-label",anchor:"middle",fill:"var(--skdx-color-text-default)"})))}}if(e.trendline&&F.data.length>=2){let W=e.trendline===!0?"linear":e.trendline,ee=Bi(F.data.map(te=>[te.x,te.y]),W);if(ee){let[te,re]=H.domain,me=`${F.name} trend${W==="linear"?"":` (${W})`}: r\xB2 ${ee.r2.toFixed(2)}`,be=F.color;if(W==="linear")B.push({kind:"line",part:"trendline",x1:i(H.scale(te)),y1:i(b.scale(ee.predict(te))),x2:i(H.scale(re)),y2:i(b.scale(ee.predict(re))),stroke:be,dash:"5 4",strokeWidth:1.5,title:me});else{let Z=Array.from({length:40},(oe,ke)=>te+(re-te)*ke/39).map(oe=>({v:oe,p:ee.predict(oe)})).filter(({p:oe})=>Number.isFinite(oe)).map(({v:oe,p:ke})=>({x:i(H.scale(oe)),y:i(b.scale(ke))}));Z.length>1&&B.push({kind:"path",part:"trendline",d:it(Z),stroke:be,dash:"5 4",strokeWidth:1.5,title:me})}}}}let Y=-1/0,j=Ne(H.ticks,Math.max(1,$.width-2*E)),I=new Set;for(let F of[...j].sort((_,W)=>_.pos-W.pos)){let _=F.label.length*ie,W=e.xAxis?.tickRotation??0,ee=W?W<0?"end":"start":tr(F.pos,F.label,m),te=-(ee==="end"?_:ee==="middle"?_/2:0),re=W*Math.PI/180,me=[te,te+_].flatMap(oe=>[-7,7].map(ke=>F.pos+oe*Math.cos(re)-ke*Math.sin(re))),be=Math.min(...me),Z=Math.max(...me);be<Y+4||(Y=Z,I.add(F))}let G=j.filter(F=>I.has(F)),V={...x,plot:$,xTicks:G,yTicks:b.ticks,baseline:b.zero},Q={plot:$,x:F=>H.scale(qe(F)),y:F=>b.scale(F)},p=Wt(e.references,Q),q=O&&(f.bottom||f.right)?nr(O,f.right?{x:$.x+$.width+12,y:$.y,width:f.right,height:$.height}:{x:$.x,y:h-f.bottom+8,width:$.width,height:f.bottom},f.options):[],N=n.opacity;return{...x,shapes:[...Ze({...V,height:V.height-f.bottom},{xLabel:e.xAxis?.label,x:e.xAxis,y:{showLine:e.yAxis?.showLine,showTicks:e.yAxis?.showTicks,tickSize:e.yAxis?.tickSize,tickRotation:e.yAxis?.tickRotation}}),...e.yAxis?.label?[J(4,$.y-14,e.yAxis.label,{part:"axis-title",anchor:"start"})]:[],...p,...N!==void 0&&C.some(F=>F.part===n.part)?C.map(F=>(F.kind==="circle"||F.kind==="path")&&F.part!=="hit"?{...F,opacity:N}:F):C,...B,...y,...Dn(e.annotations,Q),...q,...x.shapes],issues:t}}function Bi(e,n="linear"){let t;if(n==="polynomial"){let l=0,d=0,m=0,h=0,f=0,M=0,$=0,g=0;for(let[S,L]of e)l+=1,d+=S,m+=S*S,h+=S**3,f+=S**4,M+=L,$+=S*L,g+=S*S*L;let w=S=>S[0]*(S[4]*S[8]-S[5]*S[7])-S[1]*(S[3]*S[8]-S[5]*S[6])+S[2]*(S[3]*S[7]-S[4]*S[6]),k=w([f,h,m,h,m,d,m,d,l]);if(Math.abs(k)<1e-12)return;let T=w([g,h,m,$,m,d,M,d,l])/k,D=w([f,g,m,h,$,d,m,M,l])/k,v=w([f,h,g,h,m,$,m,d,M])/k;t=S=>T*S*S+D*S+v}else{let l=n==="logarithmic"||n==="power"?Math.log:M=>M,d=n==="exponential"||n==="power"?Math.log:M=>M,m=e.filter(([M,$])=>Number.isFinite(l(M))&&Number.isFinite(d($))),h=Fi(m.map(([M,$])=>[l(M),d($)]));if(!h)return;let f=n==="exponential"||n==="power"?Math.exp:M=>M;t=M=>f(h.intercept+h.slope*l(M))}let r=t,a=e.filter(([l])=>Number.isFinite(r(l)));if(a.length===0)return;let o=a.reduce((l,[,d])=>l+d,0)/a.length,s=0,c=0;for(let[l,d]of a)s+=(d-r(l))**2,c+=(d-o)**2;return{predict:r,r2:c===0?1:Math.max(0,1-s/c)}}function va(e){let[n,t]=e.sizeRange??[3,18];return ya(e,{part:"bubble",opacity:.7,radius:(r,[a,o])=>P(r)?o===a?(n+t)/2:n+Math.sqrt((r-a)/(o-a))*(t-n):3,describe:(r,a,o,s)=>`${r}${a.label?` ${a.label}`:""}: ${o.format(a.x)}, ${s.format(a.y)}${P(a.size)?` (${s.format(a.size)})`:""}`})}function Fi(e){let n=e.length,t=e.reduce((d,m)=>d+m[0],0)/n,r=e.reduce((d,m)=>d+m[1],0)/n,a=0,o=0,s=0;for(let[d,m]of e)a+=(d-t)**2,o+=(d-t)*(m-r),s+=(m-r)**2;if(a===0)return;let c=o/a,l=s===0?1:o*o/(a*s);return{slope:c,intercept:r-c*t,r2:l}}var Pi=e=>{let n=0;return e.map(t=>P(t)?n+=t:null)},Hi=e=>e.map((n,t)=>{let r=e[t-1];return t>0&&P(n)&&P(r)?n-r:null}),Vi=e=>e.map((n,t)=>{let r=e[t-1];return t>0&&P(n)&&P(r)&&r!==0?(n-r)/Math.abs(r):null});function Ma(e,n){let t=Math.max(1,Math.floor(n));return e.map((r,a)=>{if(a<t-1)return null;let o=0;for(let s=a-t+1;s<=a;s++){let c=e[s];if(!P(c))return null;o+=c}return o/t})}function Ts(e,n){let t=Math.max(1,Math.floor(n)),r=2/(t+1),a,o=0,s=0;return e.map(c=>P(c)?a===void 0?(o+=c,s++,s<t?null:(a=o/t,a)):(a=r*c+(1-r)*a,a):a??null)}function _i(e,n="max"){let t=0;for(let r of e)P(r)&&(t=n==="sum"?t+r:Math.max(t,r));return e.map(r=>P(r)?t===0?0:r/t:null)}function ji(e,n="desc"){let t=e.filter(P).sort((r,a)=>n==="asc"?r-a:a-r);return e.map(r=>P(r)?t.indexOf(r)+1:null)}var Gi=(e,n=-1/0,t=1/0)=>e.map(r=>P(r)&&r>=n&&r<=t?r:null),Wi=(e,n="asc")=>[...e].sort((t,r)=>P(t)?P(r)?n==="asc"?t-r:r-t:-1:P(r)?1:0);function qi(e,n,t="sum"){let r=Math.max(1,Math.floor(n)),a=[];for(let o=0;o<e.length;o+=r){let s=e.slice(o,o+r).filter(P);if(s.length===0){a.push(null);continue}let c=s.reduce((l,d)=>l+d,0);a.push(t==="sum"?c:t==="mean"?c/s.length:t==="min"?Math.min(...s):Math.max(...s))}return a}function Zi(e,n={}){let t=e.filter(P),r=Jn(t,n);return{edges:r,counts:er(t,r).map(a=>a.count)}}function wa(e,n){let t=[...e];for(let r of n??[])switch(r.type){case"cumulative":t=Pi(t);break;case"difference":t=Hi(t);break;case"percentageChange":t=Vi(t);break;case"movingAverage":t=Ma(t,r.window);break;case"normalize":t=_i(t,r.to);break;case"rank":t=ji(t,r.order);break;case"filter":t=Gi(t,r.min,r.max);break;case"sort":t=Wi(t,r.order);break;case"aggregate":t=qi(t,r.every,r.method);break;case"bin":t=Zi(t,r).counts;break}return t}var Ui=100,Yi=2e3,As=32,Cs=28,Wr=e=>e.position==="right"||e.position==="top";function Ki(e){let t=(e.yAxis===void 0?[]:Array.isArray(e.yAxis)?e.yAxis:[e.yAxis]).map((a,o)=>({...a,id:a.id??(o===0?"left":o===1?"right":String(o)),position:a.position??(o===1?"right":"left")}));t.length===0&&t.push({id:"left",position:"left"});let r=t.some(a=>a.id==="right"||Wr(a));return e.rightAxis?t.push({...e.rightAxis,id:"right",position:"right"}):!r&&e.series.some(a=>a.axis==="right")&&t.push({id:"right",position:"right"}),t}function Ls(e,n){let t=e[0]?.id;return n===void 0||n==="left"?t:n==="right"?(e.find(r=>r.id==="right")??e.find(Wr))?.id:e.find(r=>r.id===n)?.id}var Gr=e=>e.kind==="bar"||e.kind==="range"&&e.style==="bar";function qt(e,n){let t=ae(e.format),{series:r,categories:a,issues:o,axes:s}=Qi(e,n,t),c=e.direction==="rtl",l=e.baseline??0,d=Math.max(a.length,...r.map(A=>Math.max(A.data.length,A.low.length))),m=r.every(A=>Ve(A.data).length===0&&Ve(A.high).length===0),h=le(e,m);if(h)return{...h,issues:o};let f=e.xAxis?.type??"category",M=f!=="category"&&a.length>0&&a.every(A=>typeof A!="string"||f==="time"&&P(qe(A))),$=M?a.map(qe):[],[g,w]=we($),R=e.xAxis?.format??(f==="time"?{style:w-g<2*864e5?"time":"date"}:void 0),k=Array.from({length:d},(A,se)=>{let pe=a[se];return pe===void 0?String(se+1):Qt(pe,R)}),T=Xi(e.zoom,d),D=Array.from({length:T.end-T.start},(A,se)=>T.start+se),v=e.orientation==="horizontal",L=r.map(A=>({...A,hidden:A.hidden||v&&!Gr(A)})).filter(A=>!A.hidden),E=L.some(A=>!Gr(A))?ws(L.filter(A=>!Gr(A)).map(A=>D.map(se=>(A.kind==="range"?A.high[se]:A.data[se])??null)),D.length,e.sampling):void 0,z=E?E.map(A=>D[A]):D,O=e.stacked==="percent"||e.stackOffset==="expand",H=e.stackOffset??"zero",b=new Map,x=new Map,C=new Map;for(let A of L)A.stack!==void 0&&A.kind!=="range"&&C.set(A.stack,[...C.get(A.stack)??[],A]);for(let A of C.values()){let se=new Array(d).fill(l),pe=new Array(d).fill(l),Oe=new Array(d).fill(0);if(O)for(let Ie of A)Ie.data.forEach((Me,Le)=>{P(Me)&&(Oe[Le]=Oe[Le]+Math.abs(Me))});for(let Ie of A){let Me=[],Le=[];for(let $e=0;$e<d;$e++){let Ce=Ie.data[$e];if(!P(Ce)){Me.push(null),Le.push(null);continue}let ve=Oe[$e],ge=O?ve>0?Ce/ve:0:Ce,Se=ge>=0?se:pe;Me.push(Se[$e]),Se[$e]=Se[$e]+ge,Le.push(Se[$e])}b.set(Ie,Me),x.set(Ie,Le)}if(H==="silhouette"||H==="wiggle"){let Ie=new Array(d).fill(0);if(H==="silhouette")for(let Me=0;Me<d;Me++)Ie[Me]=-(se[Me]-l)/2;else{let Me=0;for(let Le=0;Le<d;Le++){let $e=A.length,Ce=0;for(let ge=0;ge<$e;ge++){let Se=A[ge],Ee=Se.data[Le],Pe=Se.data[Le-1],ut=Le>0&&P(Ee)&&P(Pe)?Ee-Pe:0;Ce+=($e-ge-.5)*ut}let ve=se[Le]-l;Me=Le===0?-ve/2:Me-(ve>0?Ce/Math.max(1,$e):0),Ie[Le]=Me}}for(let Me of A){let Le=b.get(Me),$e=x.get(Me);for(let Ce=0;Ce<d;Ce++){let ve=Le[Ce],ge=$e[Ce];P(ve)&&(Le[Ce]=ve+Ie[Ce]),P(ge)&&($e[Ce]=ge+Ie[Ce])}}}}let y=A=>A.kind==="range"?{from:A.low,to:A.high}:{from:b.get(A)??new Array(d).fill(l),to:x.get(A)??A.data},B=A=>{let se=[],pe=!1;for(let Me of L){if(Me.axis!==A)continue;let{from:Le,to:$e}=y(Me);for(let Ce of z){let ve=$e[Ce];if(P(ve)&&se.push(ve),Me.kind==="range"||Me.stack!==void 0){let ge=Le[Ce];P(ge)&&se.push(ge)}}if(Me.errors)for(let Ce of z){let ve=Os(Me.data[Ce],Me.errors[Ce]);ve&&se.push(ve[0],ve[1])}(Me.kind==="bar"||Me.kind==="area")&&H==="zero"&&(pe=!0)}let[Oe,Ie]=we(se);return pe?[Math.min(l,Oe),Math.max(l,Ie)]:[Oe,Ie]},{width:U,height:Y}=de(e),j=e.brush?As+Cs:0,I=z.reduce((A,se)=>Math.max(A,k[se].length),0)*ie,G=O?{style:"percent"}:void 0,V=A=>{if(A.scale==="log")return fe.left;let[se,pe]=B(A.id),Oe=ae(A.format??G??e.format);return jr([A.min??se,A.max??pe],Oe)+(A.showTicks?A.tickSize??4:0)},Q=A=>v?Wr(A)?"top":"bottom":Wr(A)!==c?"right":"left",p=A=>v?24+(A.showTicks?A.tickSize??4:0):V(A),q=new Set(L.map(A=>A.axis)),N=s.filter(A=>q.has(A.id)||s.length>1),F=new Map,_={left:0,right:0,top:0,bottom:0};for(let A of N){let se=Q(A);F.set(A.id,_[se]),_[se]+=p(A)}let W=N.find(A=>Q(A)==="bottom"),ee=r.map(A=>({name:A.name,color:A.color})),te={top:fe.top+ue(e,ee,U)+(s.some(A=>A.label)?12:0)+_.top,right:v?c?Math.max(fe.left,I+16):fe.right:Math.max(fe.right,_.right),bottom:fe.bottom+j+(e.xAxis?.label?14:0)+(e.xAxis?.tickRotation?24:0)+_.bottom-(W?p(W):0),left:v?c?fe.right:Math.max(fe.left,I+16):Math.max(fe.left,_.left)},re=Te(U,Y,te),me=v?c?[re.x+re.width,re.x]:[re.x,re.x+re.width]:[re.y+re.height,re.y],be=v?[re.y,re.y+re.height]:c?[re.x+re.width,re.x]:[re.x,re.x+re.width],Z=new Map(s.map(A=>[A.id,{...Ge(B(A.id),me,{format:G,...A},e.format),position:Q(A),offset:F.get(A.id)??0}])),oe=s[0]?.id,ke=Z.get(oe),Be=A=>Z.get(Ls(s,A)??oe)??ke,Fe=(A,se)=>Be(se).scale(A),Mt=A=>i(A.scale(Math.min(Math.max(l,Math.min(...A.domain)),Math.max(...A.domain)))),wt=je(z.length,be,e.barGap),Cn=z.map(A=>$[A]),Nn=[...Cn].sort((A,se)=>A-se),un=1/0;for(let A=1;A<Nn.length;A++)un=Math.min(un,Nn[A]-Nn[A-1]);let[Mn,mt]=we(Cn),kt=un===1/0?Math.max(1,Math.abs(mt)*.05||1):un/2,hn=st([Mn-kt,mt+kt],be),Wn=A=>i(M?hn(Cn[A]):wt.center(A)),Ko=M?Math.abs(hn(Mn+(un===1/0?kt:un))-hn(Mn))*.8:wt.bandwidth,Xo=A=>M?Wn(A)-Ko/2:wt.start(A),di=M?(f==="time"?Qn(Mn-kt,mt+kt):ht(Mn-kt,mt+kt)).filter(A=>A>=Mn-kt&&A<=mt+kt).map(A=>({pos:i(hn(A)),label:Qt(A,R)})):Ne(z.map((A,se)=>({pos:Wn(se),label:k[A]})),v?1/0:re.width/Math.max(.2,Math.abs(Math.cos((e.xAxis?.tickRotation??0)*Math.PI/180)))),ta={...he(e,U,Y,ee),plot:re,xTicks:di,yTicks:v?Ne(ke.ticks,re.width):ke.ticks,baseline:Mt(ke)},mi=s[0],Qo=Ze(ta,{horizontal:v,rtl:c,axes:N.map(A=>{let se=Z.get(A.id);return{ticks:v?Ne(se.ticks,re.width):se.ticks,position:se.position,offset:se.offset??0,label:A.label,showLine:A.showLine,showTicks:A.showTicks,tickSize:A.tickSize}}),xLabel:e.xAxis?.label,grid:En(mi),categoryGrid:e.xAxis?.grid===!0,x:e.xAxis}),ui=A=>{if(typeof A=="number"&&a.every(pe=>typeof pe=="string"))return A;let se=typeof A=="string"?A:qe(A);for(let pe=0;pe<d;pe++){let Oe=a[pe];if(Oe!==void 0&&(typeof se=="string"?Oe===se||k[pe]===se:qe(Oe)===se))return pe}},Jo={plot:re,horizontal:v,x:A=>{if(M&&(typeof A!="string"||P(qe(A))))return hn(qe(A));let se=ui(A),pe=se===void 0?-1:z.indexOf(se);return pe<0?void 0:wt.center(pe)},y:(A,se)=>Fe(A,se)},es=Wt(e.references,Jo);Qo.push(...es.filter(A=>A.part!=="reference-label"));let hi=ft(es.filter(A=>A.part==="reference-label")),na=[],ra=new Map;for(let A of L){if(!Gr(A))continue;let se=A.stack??A,pe=na.indexOf(se);pe<0&&(pe=na.push(se)-1),ra.set(A,pe)}let Rr=Ko/Math.max(1,na.length),Rn=Math.min(Rr,e.barWidth??1/0),ts=(Rr-Rn)/2,aa=[],Er=[],oa=[],sa=[],ia=[],ns=[],Dr=[],Br=A=>Be(A.axis).format,la=Math.max(0,e.minBarSize??0),fi=(A,se,pe)=>{let Oe=Math.abs(se-A);if(Oe>=la)return[Math.min(A,se),Oe];let Me=A+(v?pe?1:-1:pe?-1:1)*la;return[Math.min(A,Me),la]},fr=(A,se,pe,Oe)=>({label:Oe,series:A.name,seriesId:A.id??A.name,category:k[se],index:se,value:pe}),rs=(A,se,pe,Oe)=>{let Ie=Os(Oe,A.errors?.[se]);if(!Ie)return;let Me=i(Fe(Ie[0],A.axis)),Le=i(Fe(Ie[1],A.axis)),$e=4,Ce="var(--skdx-color-text-default)",ve=`${A.name}, ${k[se]}: ${Br(A)(Ie[0])} \u2013 ${Br(A)(Ie[1])}`;ns.push(v?{kind:"line",part:"error-bar",x1:Me,x2:Le,y1:pe,y2:pe,stroke:Ce,title:ve}:{kind:"line",part:"error-bar",x1:pe,x2:pe,y1:Me,y2:Le,stroke:Ce,title:ve},v?{kind:"line",part:"error-cap",x1:Me,x2:Me,y1:i(pe-$e),y2:i(pe+$e),stroke:Ce}:{kind:"line",part:"error-cap",x1:i(pe-$e),x2:i(pe+$e),y1:Me,y2:Me,stroke:Ce},v?{kind:"line",part:"error-cap",x1:Le,x2:Le,y1:i(pe-$e),y2:i(pe+$e),stroke:Ce}:{kind:"line",part:"error-cap",x1:i(pe-$e),x2:i(pe+$e),y1:Le,y2:Le,stroke:Ce})};for(let A of L){let{from:se,to:pe}=y(A),Oe=Br(A),Ie=z.length<=Yi;if(A.kind==="bar"){let ve="";z.forEach((ge,Se)=>{let Ee=A.data[ge],Pe=se[ge],ut=pe[ge];if(!P(Ee)||!P(Pe)||!P(ut))return;let Xn=Fe(Pe,A.axis),qn=Fe(ut,A.axis),[pr,br]=fi(Xn,qn,ut>=Pe),gr=Xo(Se)+ra.get(A)*Rr+ts,os=i(v?pr:gr),ss=i(v?gr:pr),ca=i(v?br:Rn),is=i(v?Rn:br);if(!Ie){ve+=`M${os} ${ss}h${ca}v${is}h${-ca}Z`;return}let ls=wr(A.name,k[ge],O?ut-Pe:Ee,Oe);if(Er.push({kind:"rect",part:"bar",x:os,y:ss,width:ca,height:is,fill:A.color,rx:e.radius,title:ls,item:fr(A,ge,Ee,ls)}),rs(A,ge,i(gr+Rn/2),Ee),e.labels){let cs=Oe(O?ut-Pe:Ee);ia.push(v?J(i(Math.max(Xn,qn)+4),i(gr+Rn/2),cs,{baseline:"middle"}):J(i(gr+Rn/2),i(Math.min(Xn,qn)-4),cs,{anchor:"middle"}))}}),ve&&Er.push({kind:"path",part:"bars",d:ve,fill:A.color,title:A.name});continue}if(A.kind==="range"&&A.style==="bar"){z.forEach((ve,ge)=>{let Se=se[ve],Ee=pe[ve];if(!P(Se)||!P(Ee))return;let Pe=Fe(Math.min(Se,Ee),A.axis),ut=Fe(Math.max(Se,Ee),A.axis),Xn=Xo(ge)+ra.get(A)*Rr+ts,qn=`${A.name}, ${k[ve]}: ${Oe(Math.min(Se,Ee))} \u2013 ${Oe(Math.max(Se,Ee))}`,pr=fr(A,ve,Ee,qn),br=Math.max(1,Math.abs(ut-Pe));Er.push(v?{kind:"rect",part:"range",x:i(Math.min(Pe,ut)),y:i(Xn),width:i(br),height:i(Rn),fill:A.color,rx:e.radius,title:Ie?qn:void 0,item:pr}:{kind:"rect",part:"range",x:i(Xn),y:i(Math.min(Pe,ut)),width:i(Rn),height:i(br),fill:A.color,rx:e.radius,title:Ie?qn:void 0,item:pr})});continue}let Me=e.nulls==="connect"||e.nulls===void 0&&e.connectNulls,Le=[],$e=[];z.forEach((ve,ge)=>{let Se=se[ve],Ee=pe[ve];if(!P(Ee)||!P(Se)){!Me&&$e.length&&(Le.push($e),$e=[]);return}$e.push({x:Wn(ge),y:i(Fe(Ee,A.axis)),y0:i(Fe(Se,A.axis)),i:ve})}),$e.length&&Le.push($e);let Ce=A.markers??z.length<=Ui;for(let ve of Le){let ge=it(ve,A.curve);if(A.kind==="range"&&A.style==="line"){oa.push({kind:"path",part:"range-high",d:ge,stroke:A.color,strokeWidth:2,strokeLinejoin:"round"},{kind:"path",part:"range-low",d:it(ve.map(Se=>({x:Se.x,y:Se.y0})),A.curve),stroke:A.color,strokeWidth:2,strokeLinejoin:"round",dash:"4 3"});continue}if(A.kind==="range"){let Se=it([...ve].reverse().map(Ee=>({x:Ee.x,y:Ee.y0})),A.curve);aa.push({kind:"path",part:"range",d:`${ge}L${Se.slice(1)}Z`,fill:A.color,fillOpacity:.2,title:A.name});continue}if(A.kind==="area"){let Se=Mt(Be(A.axis)),Ee=A.stack!==void 0?it([...ve].reverse().map(ut=>({x:ut.x,y:ut.y0})),A.curve).slice(1):`${ve[ve.length-1]?.x} ${Se}L${ve[0]?.x} ${Se}`,Pe=`skdx-g-${A.index}`;A.gradient&&!Dr.some(ut=>ut.id===Pe)&&Dr.push({id:Pe,vertical:!0,stops:[{offset:0,color:A.color,opacity:A.fillOpacity},{offset:1,color:A.color,opacity:0}]}),aa.push({kind:"path",part:"area",d:`${ge}L${Ee}Z`,fill:A.gradient?`url(#${Pe})`:A.color,fillOpacity:A.gradient?void 0:A.fillOpacity})}oa.push({kind:"path",part:"line",d:ge,stroke:A.color,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",dash:A.dash})}if(A.kind==="range"&&Ie)for(let ve of Le)for(let ge of ve){let Se=A.low[ge.i],Ee=A.high[ge.i],Pe=`${A.name}, ${k[ge.i]}: ${Oe(Math.min(Se,Ee))} \u2013 ${Oe(Math.max(Se,Ee))}`;sa.push({...Ft(ge.x,ge.y,.01,A.color,Pe,fr(A,ge.i,Ee,Pe)),part:"anchor"})}if(A.kind!=="range")for(let ve of Le)for(let ge of ve){if(!Ce&&!Ie&&!e.labels&&!A.errors)continue;let Se=A.data[ge.i],Ee=O?pe[ge.i]-se[ge.i]:Se,Pe=wr(A.name,k[ge.i],Ee,Oe);(Ce||Ie)&&sa.push(Ce&&A.symbol!=="circle"?xa(ge.x,ge.y,A.markerSize,A.symbol,A.color,Ie?Pe:void 0,fr(A,ge.i,Se,Pe),"point"):{...Ft(ge.x,ge.y,Ce?A.markerSize:.01,A.color,Ie?Pe:void 0,fr(A,ge.i,Se,Pe)),part:Ce?"point":"anchor"}),Ie&&rs(A,ge.i,v?ge.y:ge.x,pe[ge.i]),e.labels&&ia.push(J(ge.x,ge.y-8,Oe(Ee),{anchor:"middle"}))}}let as={plot:re,xs:v?[]:z.map((A,se)=>Wn(se)),rows:z.map(A=>[k[A],...L.map(se=>{let pe=Br(se);if(se.kind==="range"){let Ie=se.low[A],Me=se.high[A];return`${se.name}: ${P(Ie)&&P(Me)?`${pe(Ie)} \u2013 ${pe(Me)}`:"\u2014"}`}let Oe=se.data[A];return`${se.name}: ${P(Oe)?pe(O?(x.get(se)?.[A]??0)-(b.get(se)?.[A]??0):Oe):"\u2014"}`})]),count:d,zoom:T,crosshair:Hr(e)},Fr=[];if(e.brush&&!v){let A={x:re.x,y:re.y+re.height+Cs,width:re.width,height:As},se=L.find(Oe=>Oe.kind!=="range"),pe={x:i(A.x+T.start/Math.max(1,d)*A.width),y:A.y,width:i((T.end-T.start)/Math.max(1,d)*A.width),height:A.height};if(Fr.push({kind:"rect",part:"brush",x:A.x,y:A.y,width:A.width,height:A.height,fill:"var(--skdx-color-surface-sunken)",stroke:K.grid}),se){let Oe=Ve(se.data),[Ie,Me]=we(Oe),Le=d>1?A.width/(d-1):0,$e=se.data.flatMap((ve,ge)=>P(ve)?[{x:i(A.x+ge*Le),y:i(A.y+A.height-(Me===Ie?.5:(ve-Ie)/(Me-Ie))*(A.height-4)-2)}]:[]),Ce=it($e);$e.length>1&&Fr.push({kind:"path",part:"brush-series",d:`${Ce}L${$e[$e.length-1]?.x} ${A.y+A.height}L${$e[0]?.x} ${A.y+A.height}Z`,fill:se.color,fillOpacity:.3})}Fr.push({kind:"rect",part:"brush-window",...pe,fill:"var(--skdx-color-primary-500)",opacity:.15,stroke:K.axis},{kind:"rect",part:"brush-handle",x:i(pe.x-3),y:A.y+8,width:6,height:A.height-16,fill:K.axis,rx:8},{kind:"rect",part:"brush-handle",x:i(pe.x+pe.width-3),y:A.y+8,width:6,height:A.height-16,fill:K.axis,rx:8}),as.brush={box:A,window:pe}}return{...ta,shapes:[...Qo,...aa,...Er,...oa,...ns,...sa,...ia,...hi,...Dn(e.annotations,Jo),...Fr,...ta.shapes],hit:as,issues:o,defs:Dr.length?Dr:void 0}}function Os(e,n){if(!(!P(e)||n===null||n===void 0))return typeof n=="number"?P(n)?[e-Math.abs(n),e+Math.abs(n)]:void 0:P(n[0])&&P(n[1])?[Math.min(n[0],n[1]),Math.max(n[0],n[1])]:void 0}function Xi(e,n){if(!e||n<2)return{start:0,end:n};let t=Math.max(0,Math.min(n-1,Math.floor(e.start))),r=Math.max(t+1,Math.min(n,Math.ceil(e.end)));return r-t<2&&n>=2?{start:Math.min(t,n-2),end:Math.min(t,n-2)+2}:{start:t,end:r}}function Qi(e,n,t){let r=k=>k.type??n,a=[],o=Ki(e),s=e.categories??[],c=(e.transforms??[]).filter(k=>k.type==="sort"||k.type==="bin"||k.type==="aggregate"),l=(e.transforms??[]).filter(k=>!c.includes(k)),d=e.stacked||e.stackOffset!==void 0&&e.stackOffset!=="zero",m=(k,T,D)=>{let v=D.filter(S=>S!==null&&!(typeof S=="number"&&Number.isFinite(S))).length;v&&a.push({code:"invalid-value",severity:"warning",message:`Series "${k}" has ${v} value${v===1?"":"s"} that ${v===1?"is":"are"} neither a number nor null; drawn as gaps.`,itemId:T??k}),s.length&&D.length!==s.length&&!e.transform&&a.push({code:"length-mismatch",severity:"warning",message:`Series "${k}" has ${D.length} values for ${s.length} categories.`,itemId:T??k})},h=e.series.map((k,T)=>{let D=r(k),v=d?!0:void 0,S=k.type==="range"?void 0:k.stack,L=S===!1?void 0:S===!0||S===void 0&&v?`${D}`:S;k.type==="range"?(m(k.name,k.id,k.low),m(k.name,k.id,k.high)):m(k.name,k.id,k.data);let E=O=>e.nulls==="zero"?O.map(H=>P(H)?H:0):O,z=Ls(o,k.axis);return z===void 0&&a.push({code:"unknown-axis",severity:"warning",message:`Series "${k.name}" names axis "${String(k.axis)}", which is not defined; drawn on the first axis.`,itemId:k.id??k.name}),{name:k.name,id:k.id,color:ne(e,T,k.color),axis:z??o[0]?.id,hidden:xe(e,k.name),index:T,kind:D,data:k.type==="range"?[]:E(wa(wa(k.data,l),k.transforms)),low:k.type==="range"?k.low:[],high:k.type==="range"?k.high:[],curve:k.curve??e.curve??"linear",dash:k.type==="range"?void 0:k.dash,markers:k.type==="range"?void 0:k.markers,symbol:k.type==="range"?"circle":k.symbol??"circle",markerSize:k.type==="range"?3:k.markerSize??3,errors:k.type==="range"?void 0:k.errors,stack:D==="range"||D==="line"?void 0:L,style:k.type==="range"?k.style??"area":"area",fillOpacity:(k.type==="range"?void 0:k.fillOpacity)??e.fillOpacity??.25,gradient:k.type!=="range"&&k.gradient===!0}}),f=()=>Math.max(s.length,...h.map(k=>Math.max(k.data.length,k.low.length))),M=k=>{let T=v=>v.length?k.map(S=>v[S]??null):v,D=Array.from({length:f()},(v,S)=>s[S]??String(S+1));s=k.map(v=>D[v]),h=h.map(v=>({...v,data:T(v.data),low:T(v.low),high:T(v.high)}))},$=(k,T)=>{let D=(T!==void 0?h.find(S=>S.name===T):void 0)??h.find(S=>!S.hidden&&S.kind!=="range")??h[0];T!==void 0&&!h.some(S=>S.name===T)&&a.push({code:"unknown-series",severity:"warning",message:`sort.by names "${T}", which is not a series; sorted by the first series.`});let v=Array.from({length:f()},(S,L)=>L).sort((S,L)=>{let E=D?.data[S]??D?.high[S],z=D?.data[L]??D?.high[L],O=P(E)?E:-1/0,H=P(z)?z:-1/0;return k==="asc"?O-H:H-O});M(v)},g=k=>{let T=h.flatMap(v=>Ve(v.data)),D=Jn(T,k);s=D.slice(1).map((v,S)=>`${t(D[S])}\u2013${t(v)}`),h=h.map(v=>{let S=Ve(v.data),L=0,E=er(S,D).map(z=>e.binMode==="density"?S.length?z.count/(S.length*(z.x1-z.x0)):0:e.binMode==="cumulative"?L+=z.count:z.count);return{...v,data:E}})},w=(k,T)=>{let D=Math.max(1,Math.floor(k)),v=f(),S=E=>{if(!E.length)return E;let z=[];for(let O=0;O<v;O+=D){let H=Ve(E.slice(O,O+D));z.push(H.length===0?null:T==="sum"?H.reduce((b,x)=>b+x,0):T==="mean"?H.reduce((b,x)=>b+x,0)/H.length:T==="min"?Math.min(...H):Math.max(...H))}return z};s=Array.from({length:v},(E,z)=>s[z]??String(z+1)).filter((E,z)=>z%D===0),h=h.map(E=>({...E,data:S(E.data),low:S(E.low),high:S(E.high)}))};e.transform==="histogram"?g({bins:e.bins,binWidth:e.binWidth,domain:e.binDomain}):e.transform==="cumulative"&&(h=h.map(k=>{let T=0;return{...k,data:k.data.map(D=>P(D)?T+=D:T)}}));for(let k of c)k.type==="sort"?$(k.order??"desc"):k.type==="bin"?g(k):k.type==="aggregate"&&w(k.every,k.method??"sum");typeof e.sort=="string"?$(e.sort):e.sort&&$(e.sort.order,e.sort.by);let R=e.xAxis?.domain;if(R){let k=f(),T=Array.from({length:k},(L,E)=>s[E]??String(E+1)),D=L=>{let E=typeof L=="string"?L:qe(L);return T.findIndex(z=>typeof E=="string"?z===E||Qt(z)===E:qe(z)===E)},v=R.map(D),S=L=>L.length?v.map(E=>E<0?null:L[E]??null):L;s=[...R],h=h.map(L=>({...L,data:S(L.data),low:S(L.low),high:S(L.high)}))}return{series:h,categories:s,issues:a,axes:o}}var ka=e=>qt(e,"bar");var $a=e=>qt(e,"line"),Ia=e=>qt(e,"area");function Fn(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var Ta=e=>e.id??e.name??e.series,Ss=e=>e.seriesId??e.series;function wn(e,n){let t=!1;return n.id!==void 0&&(t=!0,Ta(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,Ss(e)!==n.series&&e.series!==n.series)||n.index!==void 0&&(t=!0,e.index!==n.index)||n.category!==void 0&&(t=!0,e.category!==n.category)?!1:t}var Aa=(e,n,t=Fn(n))=>t.some(r=>wn(e,r)),Yn=e=>Fn(e).flatMap(n=>n.id!==void 0?[n.id]:[]);function Pn(e){let n={},t=Ta(e);t!==void 0&&(n.id=t);let r=Ss(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var Ca=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function Oa(e,n,t){let r=Fn(e),a=Pn(n),o=r.some(s=>wn(n,s));return t==="single"?o?[]:[a]:o?r.filter(s=>!wn(n,s)):[...r,a]}var Ji=.2;function el(e){let n=K.focus;switch(e.kind){case"rect":return{kind:"rect",part:"selected",x:e.x-1.5,y:e.y-1.5,width:e.width+3,height:e.height+3,fill:"none",stroke:n,rx:e.rx};case"circle":return{kind:"circle",part:"selected",cx:e.cx,cy:e.cy,r:e.r+2.5,fill:"none",stroke:n};case"path":return{kind:"path",part:"selected",d:e.d,fill:"none",stroke:n,strokeWidth:2.5};case"line":return{...e,part:"selected",stroke:n,strokeWidth:(e.strokeWidth??1)+3,title:void 0,item:void 0};case"text":return}}var tl=(e,n)=>e.kind==="text"?{...e,fill:K.grid}:{...e,opacity:(e.opacity??1)*n};function La(e,n){let t=Fn(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:Fn(n.highlighted),a=r[0];if(t.length===0&&!a)return e;let o={highlighted:n.highlightScope?.highlighted??"item",faded:n.highlightScope?.faded??"global"},s=[],c=m=>!a||r.some(h=>wn(m,h))?!0:o.highlighted==="series"?r.some(h=>h.series!==void 0&&wn(m,{series:h.series})):!1,l=m=>{if(!a||o.faded==="none"||c(m))return!1;if(o.faded==="series"){let h=a.series;return h!==void 0&&wn(m,{series:h})}return!0},d=e.shapes.map(m=>{let h=m.item;if(!h||h.legend)return m;if(t.some(f=>wn(h,f))){let f=el(m);f&&s.push(f)}return l(h)?tl(m,Ji):m});return s.length?{...e,shapes:[...d,...s]}:{...e,shapes:d}}var $r=2*Math.PI;function Ke(e,n,t,r,a,o){let s=(d,m)=>`${i(e+d*Math.sin(m))} ${i(n-d*Math.cos(m))}`;if(o-a>=$r-1e-9){let d=a+$r/2;return`${Ke(e,n,t,r,a,d)}${Ke(e,n,t,r,d,o)}`}let c=o-a>Math.PI?1:0,l=`M${s(t,a)}A${t} ${t} 0 ${c} 1 ${s(t,o)}`;return r>0?`${l}L${s(r,o)}A${r} ${r} 0 ${c} 0 ${s(r,a)}Z`:`${l}L${i(e)} ${i(n)}Z`}function nl(e,n,t,r,a,o,s){let c=o-a;if(s<=0||c>=$r-1e-9)return Ke(e,n,t,r,a,o);let l=Math.sin(Math.min(Math.PI/2,c/2)),d=Math.min(s,r>0?(t-r)/2:t/2,t*l/(1+l));if(r>0&&l<1&&(d=Math.min(d,r*l/(1-l))),d<=.25)return Ke(e,n,t,r,a,o);let m=(w,R)=>`${i(e+w*Math.sin(R))} ${i(n-w*Math.cos(R))}`,h=w=>`A${i(d)} ${i(d)} 0 0 1 ${w}`,f=Math.asin(d/(t-d)),M=Math.sqrt((t-d)**2-d*d),$=o-a-2*f>Math.PI?1:0,g=`M${m(M,a)}${h(m(t,a+f))}A${t} ${t} 0 ${$} 1 ${m(t,o-f)}${h(m(M,o))}`;if(r>0){let w=Math.asin(d/(r+d)),R=Math.sqrt((r+d)**2-d*d),k=o-a-2*w>Math.PI?1:0;g+=`L${m(R,o)}${h(m(r,o-w))}A${r} ${r} 0 ${k} 0 ${m(r,a+w)}${h(m(R,a))}Z`}else g+=`L${i(e)} ${i(n)}Z`;return g}function Sa(e){let n=[];for(let V of e.data)P(V.value)&&V.value<0&&n.push({code:"negative-value",severity:"warning",message:`"${V.name}" is negative (${V.value}); a share of a whole cannot be, so it is drawn as zero.`,itemId:V.id??V.name});let t=le(e,!e.data.some(V=>P(V.value)&&V.value>0),300,300);if(t)return{...t,issues:n};let r=ae(e.format),a=e.percentFormat?ae(e.percentFormat):V=>`${Math.round(V*100)}%`,o=Math.max(0,e.cornerRadius??0),{width:s,height:c}=de(e,300,300),l=e.data.map((V,Q)=>({name:V.name,color:ne(e,Q,V.color)})),d=ue(e,l,s),m=(e.startAngle??0)*Math.PI/180,h=(e.endAngle??(e.startAngle??0)+360)*Math.PI/180,f=Math.max(0,Math.min($r,h-m)),M=f<=Math.PI+1e-9&&Math.abs(Math.sin(m))>.99,$=e.labels&&e.labelPosition==="outside",g=s/2,w=Math.max(.2,Math.min(1,e.outerRadius??1)),R=$?40:8,k=(M?Math.max(0,Math.min(s/2,c-d)-R):Math.max(0,Math.min(s,c-d)/2-R))*w,T=M?m<0||m>Math.PI?c-R:d+R:d+(c-d)/2,D=k*Math.min(.95,Math.max(0,e.innerRadius??(e.variant==="donut"?.6:0))),v=e.data.map((V,Q)=>({...V,i:Q,value:P(V.value)&&!xe(e,V.name)?Math.max(0,V.value):0})),S=e.sort?[...v].sort((V,Q)=>e.sort==="asc"?V.value-Q.value:Q.value-V.value):v,L=S.reduce((V,Q)=>V+Q.value,0),E=S.filter(V=>V.value>0).length,z=Math.max(0,Math.min((e.padAngle??0)*Math.PI/180,f/Math.max(1,E)/2)),O=f>=$r-1e-9,H=E>1?O?E:E-1:0,b=f-H*z,x=Math.min((e.minAngle??0)*Math.PI/180,b/Math.max(1,E)),C=S.map(V=>L>0?V.value/L*b:0);if(x>0)for(let V=0;V<S.length;V++){let Q=S.map((N,F)=>N.value>0&&C[F]<x);if(!Q.some(Boolean))break;let p=Q.filter(Boolean).length*x,q=S.reduce((N,F,_)=>N+(Q[_]||F.value<=0?0:F.value),0);if(S.forEach((N,F)=>{C[F]=Q[F]?x:q>0?N.value/q*(b-p):0}),!S.some((N,F)=>N.value>0&&!Q[F]&&C[F]<x))break}let y=Fn(e.selected),B=m+(O&&H?z/2:0),U=[],Y=[],j=[],I=S.map((V,Q)=>{let p=L>0?V.value/L:0,q=B,N=B+C[Q];p>0&&(B=N+z);let F=a(p),_=`${V.name}: ${r(V.value)} (${F})`,W={label:_,id:V.id??V.name,name:V.name,index:V.i,value:V.value},ee=(q+N)/2;if(e.labels&&p>0){let re=`${V.name} ${F}`;if($){let me=Math.sin(ee),be=i(T-(k+14)*Math.cos(ee));j.some(Z=>Math.abs(Z-be)<12)||(j.push(be),Y.push({kind:"line",part:"label-connector",x1:i(g+k*me),y1:i(T-k*Math.cos(ee)),x2:i(g+(k+12)*me),y2:i(T-(k+12)*Math.cos(ee)),stroke:K.axis}),U.push(Un(i(g+(k+16)*me),be,re,s,{part:"slice-label",anchor:me>.1?"start":me<-.1?"end":"middle",baseline:"middle",fill:"var(--skdx-color-text-default)"})))}else if(p>.03){let me=(k+D)/2;U.push(Un(i(g+me*Math.sin(ee)),i(T-me*Math.cos(ee)),re,s,{part:"slice-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))}}let te=Aa(W,void 0,y)?Math.max(4,k*.06):0;return{kind:"path",part:"slice",d:p>0?nl(g+te*Math.sin(ee),T-te*Math.cos(ee),k,D,q,N,o):"",fill:ne(e,V.i,V.color),title:_,item:p>0?W:void 0}});e.centerLabel&&U.push(J(i(g),i(M?T-12:T),e.centerLabel,{part:"center-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)",weight:"bold"}));let G=he(e,s,c,l);return{...G,shapes:ft([...I,...Y,...G.shapes,...U]),issues:n}}var $t=2;function za(e){let n=Ve(e.data),t=le(e,n.length===0,120,32);if(t)return t;let r=ae(e.format),{width:a,height:o}=de(e,120,32),s=e.data.length,c=n[0],l=n[n.length-1],d=e.lastValue?r(l):"",m=a-$t-(d?d.length*ie+6:0),h=e.variant??"area",f=h==="winloss",M=[...n,...e.band??[],...e.target!==void 0?[e.target]:[]],$=st(f?[-1,1]:Gt(M,h==="bar"),[o-$t,$t]),g=e.x&&e.x.length>=s?e.x.map(qe):void 0,[w,R]=g?we(g):[0,1],k=st([w,R],[$t,m]),T=E=>s<2?($t+m)/2:g?R===w?($t+m)/2:k(g[E]):$t+E/(s-1)*(m-$t),D=e.trend?l>=c?K.positive:K.negative:ne(e,0,e.color),v=[];if(e.band&&!f){let[E,z]=e.band,O=Math.min($(E),$(z));v.push({kind:"rect",part:"band",x:$t,y:i(O),width:i(Math.max(0,m-$t)),height:i(Math.abs($(z)-$(E))),fill:K.axis,opacity:.12,title:`${r(Math.min(E,z))} \u2013 ${r(Math.max(E,z))}`})}e.target!==void 0&&P(e.target)&&!f&&v.push({kind:"line",part:"target",x1:$t,x2:i(m),y1:i($(e.target)),y2:i($(e.target)),stroke:K.axis,dash:"3 2",title:`Target: ${r(e.target)}`});let S=e.data.flatMap((E,z)=>P(E)?[{x:i(T(z)),y:i($(E)),v:E,i:z}]:[]),L=S[S.length-1];if(h==="bar"||f){let E=s>0?(m-$t)/s:0,z=i($(0));e.data.forEach((O,H)=>{if(!P(O))return;let b=i($(f?Math.sign(O):O));v.push({kind:"rect",part:"bar",x:i($t+H*E+E*.1),y:Math.min(b,z),width:i(Math.max(1,E*.8)),height:i(Math.max(1,Math.abs(z-b))),fill:f?O<0?K.negative:K.positive:O<0&&e.trend?K.negative:D,title:e.tooltip===!1?void 0:r(O)})})}else{let E=it(S,e.curve),z=S[0];h==="area"&&v.push({kind:"path",part:"area",d:E&&z&&L?`${E}L${L.x} ${o-$t}L${z.x} ${o-$t}Z`:"",fill:D,fillOpacity:.15}),v.push({kind:"path",part:"line",d:E,stroke:D,strokeWidth:1.5});let O=e.markers??["last"];L&&O.includes("last")&&v.push(Ft(L.x,L.y,2,D,void 0)),z&&O.includes("first")&&v.push({...Ft(z.x,z.y,2,D,void 0),part:"first"})}if(e.extremes&&S.length>1){let E=S.reduce((O,H)=>H.v<O.v?H:O),z=S.reduce((O,H)=>H.v>O.v?H:O);v.push({...Ft(E.x,E.y,2.5,K.negative,r(E.v)),part:"min"},{...Ft(z.x,z.y,2.5,K.positive,r(z.v)),part:"max"})}return d&&L&&v.push(J(i(m+4),L.y,d,{part:"last-value",baseline:"middle",fill:"var(--skdx-color-text-default)"})),{...he(e,a,o),shapes:v}}function Na(e){let n=e.metrics??(e.categories??[]).map(I=>({label:I})),t=le(e,n.length===0||e.series.every(I=>Ve(I.data).length===0),300,300);if(t)return t;let r=[],a=ae(e.format),{width:o,height:s}=de(e,300,300),c=e.series.map((I,G)=>({name:I.name,color:ne(e,G,I.color)})),l=ue(e,c,o),d=o/2,m=l+(s-l)/2,h=Math.max(0,Math.min(o,s-l)/2-36),f=n.length,M=(e.startAngle??0)*Math.PI/180-Math.PI/2,$=I=>M+I*2*Math.PI/Math.max(1,f),g=e.series.filter(I=>!xe(e,I.name)),w=e.normalize===!0?"series":e.normalize===!1||e.normalize===void 0?e.metrics?"metric":"none":e.normalize;w==="series"&&g.length>1&&r.push({code:"misleading-scale",severity:"warning",message:"normalize: 'series' scales each series to its own maximum, so polygons cannot be compared in magnitude; prefer 'metric' or 'none'."});let R=Math.max(1,Math.round(e.levels??4)),k=e.max??Math.max(0,we(g.flatMap(I=>I.data))[1]),T=w==="none"?ht(0,k,R):Array.from({length:R+1},(I,G)=>100*G/R),D=w==="none"?e.max??T[T.length-1]:100,v=n.map((I,G)=>{let V=g.map(F=>F.data[G]),[Q,p]=we(V),q=I.min??Math.min(0,Q),N=ht(q,I.max??p,R);return{min:q,max:I.max??N[N.length-1]}}),S=e.series.map(I=>Math.max(0,we(I.data)[1])),L=(I,G,V)=>{if(w==="series")return S[I]>0?V/S[I]*100:0;if(w==="metric"){let Q=v[G];return Q.max>Q.min?(V-Q.min)/(Q.max-Q.min)*100:0}return V},E=(I,G)=>{let V=D>0?Math.max(0,Math.min(G,D))/D*h:0;return{x:i(d+V*Math.cos($(I))),y:i(m+V*Math.sin($(I)))}},z=I=>f===0?"":`M${n.map((G,V)=>{let Q=E(V,I(V));return`${Q.x} ${Q.y}`}).join("L")}Z`,O=I=>{if(e.gridShape==="circle"){let G=D>0?I/D*h:0;return{kind:"circle",part:"grid",cx:i(d),cy:i(m),r:i(G),fill:"none",stroke:K.grid}}return{kind:"path",part:"grid",d:z(()=>I),stroke:K.grid}},H=T.filter(I=>I>0&&I<=D),b=I=>w==="none"?a(I):w==="series"?`${I}%`:(()=>{let G=v[0];return ae(n[0]?.format??e.format)(G.min+(G.max-G.min)*I/100)})(),x=[...H.map(O),...n.map((I,G)=>{let V=E(G,D);return{kind:"line",part:"grid",x1:i(d),y1:i(m),x2:V.x,y2:V.y,stroke:K.grid}}),...H.map(I=>J(i(d+4),E(0,I).y,b(I),{part:"y-label",baseline:"middle"})),...n.map((I,G)=>{let V=Math.cos($(G)),Q=h+14;return J(i(d+Q*V),i(m+Q*Math.sin($(G))),I.label,{part:"x-label",anchor:V>.1?"start":V<-.1?"end":"middle",baseline:"middle"})})],C=[],y=[],B=[],U=e.markers??!0,Y=e.markerSize??3;e.series.forEach((I,G)=>{if(xe(e,I.name))return;let V=ne(e,G,I.color),Q=p=>{let q=I.data[p];return P(q)?L(G,p,q):0};n.forEach((p,q)=>{let N=I.data[q];if(!P(N))return;let F=ae(p.format??e.format),_=E(q,L(G,q,N)),W=wr(I.name,p.label,N,F);C.push({...Ft(_.x,_.y,U?Y:.01,V,W,{label:W,id:p.id,series:I.name,seriesId:I.id,category:p.label,index:q,value:N}),part:U?"point":"anchor"}),e.labels&&B.push(J(_.x,i(_.y-7),F(N),{part:"value-label",anchor:"middle",fill:"var(--skdx-color-text-default)"}))}),y.push({kind:"path",part:"area",d:z(Q),fill:e.fill??!0?V:void 0,fillOpacity:.25,stroke:V,strokeWidth:2,title:I.name,item:{label:I.name,series:I.name,seriesId:I.id}})});let j=he(e,o,s,c);return{...j,shapes:[...x,...y,...C,...B,...j.shapes],issues:r}}var qr={top:24,right:8,bottom:8,left:64},Ra=864e5,Ea=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function rl(e,n="monday"){let t=n==="sunday"?[Ea[6],...Ea.slice(0,6)]:Ea,r=e.map(g=>({day:Math.floor(new Date(g.date).getTime()/Ra),value:g.value})).filter(g=>Number.isFinite(g.day));if(r.length===0)return{rows:t,columns:[],data:t.map(()=>[]),dates:t.map(()=>[])};let[a,o]=we(r.map(g=>g.day)),s=n==="sunday"?4:3,c=g=>((g+s)%7+7)%7,l=a-c(a),d=Math.floor((o-l)/7)+1,m=t.map(()=>new Array(d).fill(null)),h=t.map(()=>new Array(d).fill(void 0));for(let g of r){let w=Math.floor((g.day-l)/7);m[c(g.day)][w]=g.value,h[c(g.day)][w]=new Date(g.day*Ra).toISOString().slice(0,10)}let f=new Intl.DateTimeFormat(void 0,{month:"short"}),M=-1,$=Array.from({length:d},(g,w)=>{let R=new Date((l+w*7+6)*Ra),k=R.getUTCMonth();return k===M?"":(M=k,f.format(R))});return{rows:t,columns:$,data:m,dates:h}}var al=e=>e.colorScale??(e.diverging?{type:"diverging",steps:e.steps}:{type:"sequential",domain:e.domain,steps:e.steps}),zs=(e,n)=>{let t=e.map((r,a)=>a);return n&&t.sort((r,a)=>(n==="asc"?1:-1)*(e[r]-e[a])),t};function Da(e){let n=[],t=e.calendar?rl(e.calendar,e.weekStart):void 0,r=t?.rows??e.rows??[],a=t?.columns??e.columns??[],o=t?.data??e.data??[];!t&&(o.length!==r.length||o.some(b=>b.length!==a.length))&&n.push({code:"ragged-matrix",severity:"warning",message:`The matrix is ${o.length} \xD7 ${o[0]?.length??0} but there are ${r.length} rows and ${a.length} columns; missing cells are blank.`});let s=o.flat().filter(b=>b!=null&&!P(b)).length;s&&n.push({code:"invalid-value",severity:"warning",message:`${s} cell${s===1?" is":"s are"} neither a number nor null; drawn as blank.`});let c=o.flat(),l=le(e,r.length===0||a.length===0||!c.some(P));if(l)return{...l,issues:n};let d=ae(e.format),{width:m,height:h}=de(e),f=Bn(e.colorLegend),M=Te(m,h,{...qr,left:t?40:qr.left,right:qr.right+f.right,bottom:qr.bottom+f.bottom}),$=b=>b.reduce((x,C)=>x+(P(C)?C:0),0),g=zs(r.map((b,x)=>$(o[x]??[])),e.rowOrder),w=zs(a.map((b,x)=>$(o.map(C=>C[x]))),e.columnOrder),R=g.map(b=>r[b]),k=w.map(b=>a[b]),T=M.width/Math.max(1,k.length),D=M.height/Math.max(1,R.length),v=Pt(al(e),c,ne(e,0,e.color),e.negativeColor,d),S=[],L=[],E=e.cellGap??(t?1:0),z=e.cellRadius??(t?2:0);R.forEach((b,x)=>{k.forEach((C,y)=>{let B=o[g[x]]?.[w[y]],U=t?.dates[g[x]]?.[w[y]],Y=t?U??b:`${b}, ${C}`,j=i(M.x+y*T+E),I=i(M.y+x*D+E),G={x:j,y:I,width:i(Math.max(0,T-2*E)),height:i(Math.max(0,D-2*E)),rx:z||void 0};if(!P(B)){e.missingColor&&(!t||U)&&S.push({kind:"rect",part:"missing",...G,fill:e.missingColor,title:`${Y}: \u2014`});return}let V=v.color(B),Q=`${Y}: ${d(B)}`;S.push({kind:"rect",part:"cell",...G,fill:V.fill,opacity:V.opacity,title:Q,item:{label:Q,id:t?U:`${b}:${C}`,category:C,name:b,index:y,value:B}}),e.labels&&T>24&&D>12&&L.push(J(i(M.x+(y+.5)*T),i(M.y+(x+.5)*D),d(B),{part:"cell-label",anchor:"middle",baseline:"middle",fill:V.opacity>=.5?"var(--skdx-color-text-on-accent)":"var(--skdx-color-text-default)"}))})});let O=he(e,m,h),H=e.colorLegend?nr(v,f.right?{x:M.x+M.width+12,y:M.y,width:f.right,height:M.height}:{x:M.x,y:M.y+M.height+8,width:M.width,height:f.bottom},f.options):[];return{...O,shapes:[...R.map((b,x)=>J(M.x-8,i(M.y+(x+.5)*D),b,{part:"y-label",anchor:"end",baseline:"middle"})),...k.flatMap((b,x)=>b?[J(i(M.x+(x+.5)*T),M.y-8,b,{part:"x-label",anchor:t?"start":"middle"})]:[]),...S,...L,...H,...O.shapes],issues:n}}var Zr=8;function Ba(e){let n=e.variant==="pyramid",t=[],r=e.sort??(n?"asc":void 0),a=e.data.filter(x=>P(x.value)?!0:(t.push({code:"invalid-value",severity:"warning",message:`Stage "${x.name}" has no valid value and was dropped.`,itemId:x.id??x.name}),!1)).sort((x,C)=>r==="asc"?x.value-C.value:r==="desc"?C.value-x.value:0),o=le(e,a.length===0,400,300);if(o)return{...o,issues:t};let s=ae(e.format),{width:c,height:l}=de(e,400,300),d=a.length,m=e.orientation==="horizontal",h=Math.max(0,e.gap??4),f=e.labelPosition??"inside",M=Math.max(0,...a.map(x=>x.value)),$=a.reduce((x,C)=>x+Math.max(0,C.value),0),g=a[0]?.value??0,w=a.map((x,C)=>({name:x.name,color:ne(e,C,x.color)})),R=ue(e,w,c),k=m?c:l-R,T=m?l-R:c,D=f==="outside",v=Math.max(0,(D?T*2/3:T)-2*Zr),S=d===0?0:(k-2*Zr)/d,L=Math.max(0,Math.min(1,e.neckWidth??0)),E=x=>M>0?(L+(1-L)*(Math.max(0,x)/M))*v:0,z=e.percentFormat?ae(e.percentFormat):x=>`${Math.round(x*100)}%`,O=(m?R+(l-R)/2:c/2)-(D?T/6:0),H=a.flatMap((x,C)=>{let y=E(x.value),B=E(a[C+1]?.value??x.value),U=Zr+C*S+(m?0:R),Y=U+S-h,j=n?$>0?x.value/$:0:g>0?x.value/g:0,I=a[C-1]?.value,G=I!==void 0&&I>0?x.value/I-1:0,V=!n&&I!==void 0&&I>0?` \xB7 ${G<0?"\u2212":G>0?"+":""}${z(Math.abs(G))} from ${a[C-1]?.name}`:"",Q=`${x.name}: ${s(x.value)} (${z(j)})${V}`,q={kind:"path",part:"stage",d:m?`M${i(U)} ${i(O-y/2)}L${i(U)} ${i(O+y/2)}L${i(Y)} ${i(O+B/2)}L${i(Y)} ${i(O-B/2)}Z`:`M${i(O-y/2)} ${i(U)}L${i(O+y/2)} ${i(U)}L${i(O+B/2)} ${i(Y)}L${i(O-B/2)} ${i(Y)}Z`,fill:ne(e,C,x.color),title:Q,item:{label:Q,id:x.id??x.name,name:x.name,index:C,value:x.value}};if(f==="none")return[q];let N=`${x.name} \xB7 ${s(x.value)}`,F=(U+Y)/2;if(D){let W=O+v/2+Zr;return[q,Un(i(m?F:W),i(m?W:F),N,c,{part:"stage-label",anchor:m?"middle":"start",baseline:m?"hanging":"middle",fill:"var(--skdx-color-text-default)"})]}let _=Un(i(m?F:O),i(m?O:F),N,c,{part:"stage-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)"});return[q,{kind:"rect",part:"stage-label-background",x:i(_.x-(_.text.length*ie+8)/2),y:i((m?O:F)-9),width:_.text.length*ie+8,height:18,rx:8,fill:"var(--skdx-color-surface-default)"},_]}),b=he(e,c,l,w);return{...b,shapes:[...H,...b.shapes],issues:t}}var Ns=e=>e*Math.PI/180;function Fa(e){let n=e.data.filter(L=>P(L.value)),t=le(e,n.length===0,300,300);if(t)return t;let r=ae(e.format),{width:a,height:o}=de(e,300,300),s=n.map((L,E)=>({name:L.name,color:ne(e,E,L.color)})),c=ue(e,s,a),l=a/2,d=c+(o-c)/2,m=Math.max(0,Math.min(a,o-c)/2-(e.bands?20:8)),h=m*Math.min(.95,Math.max(0,e.innerRadius??.3)),f=Ns(e.startAngle??0),M=Ns(e.endAngle??(e.startAngle??0)+360),$=Math.max(0,Math.min(2*Math.PI,M-f)),g=e.max??Math.max(0,...n.map(L=>L.value)),w=n.length,R=Math.max(0,e.gap??.25),k=w===0?0:(m-h)/(w+R*(w-1)),T=e.rounded??!0,D=L=>g>0?Math.max(0,Math.min(1,L/g)):0,v=[];for(let L of e.bands??[]){let E=f+D(L.from)*$,z=f+D(L.to)*$;z<=E||v.push({kind:"path",part:"band",d:Ke(l,d,m+14,m+6,E,z),fill:Bt(L.variant),opacity:.6,title:`${r(L.from)} \u2013 ${r(L.to)}`})}if(n.forEach((L,E)=>{if(xe(e,L.name))return;let z=m-E*k*(1+R),O=z-k,H=ne(e,E,L.color),b=f+D(L.value)*$,x=`${L.name}: ${r(L.value)} (${Math.round(D(L.value)*100)}%)`;if((e.track??!0)&&v.push({kind:"path",part:"track",d:Ke(l,d,z,O,f,f+$),fill:K.grid,opacity:.6}),b>f&&(v.push({kind:"path",part:"bar",d:Ke(l,d,z,O,f,b),fill:H,title:x,item:{label:x,id:L.id,name:L.name,index:E,value:L.value}}),T&&$<2*Math.PI-1e-9)){let C=(O+z)/2;for(let y of[f,b])v.push({kind:"circle",part:"bar-cap",cx:i(l+C*Math.sin(y)),cy:i(d-C*Math.cos(y)),r:i(k/2),fill:H})}if(e.labels){let C=(O+z)/2;v.push(J(i(l+C*Math.sin(f)-6*Math.cos(f)),i(d-C*Math.cos(f)-6*Math.sin(f)),`${L.name} ${r(L.value)}`,{part:"bar-label",anchor:Math.cos(f)>=0?"end":"start",baseline:"middle"}))}}),e.target!==void 0&&P(e.target)){let L=f+D(e.target)*$,E=m-w*k*(1+R)+k*R;v.push({kind:"line",part:"target",x1:i(l+E*Math.sin(L)),y1:i(d-E*Math.cos(L)),x2:i(l+(m+4)*Math.sin(L)),y2:i(d-(m+4)*Math.cos(L)),stroke:"var(--skdx-color-text-default)",strokeWidth:2,title:`Target: ${r(e.target)}`})}e.centerLabel&&v.push(J(i(l),i(d),e.centerLabel,{part:"center-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)",weight:"bold"}));let S=he(e,a,o,s);return{...S,shapes:[...v,...S.shapes]}}var Rs=e=>e*Math.PI/180;function ol(e,n){let t=[0],r=[0],a=o=>{t.push(Math.sin(o)),r.push(-Math.cos(o))};a(e),a(n);for(let o=Math.ceil(e/(Math.PI/2));o*(Math.PI/2)<=n;o++)a(o*(Math.PI/2));return{x0:Math.min(...t),y0:Math.min(...r),x1:Math.max(...t),y1:Math.max(...r)}}function Pa(e){let n=le(e,!P(e.value),300,300);if(n)return n;let t=ae(e.format),{width:r,height:a}=de(e,300,300),o=ue(e),s=P(e.min)?e.min:0,c=P(e.max)?e.max:100,l=e.startAngle??-120,d=e.endAngle??120,m=Rs(l),h=Rs(Math.max(l,Math.min(l+360,d))),f=h-m,M=_=>c>s?Math.max(0,Math.min(1,(_-s)/(c-s))):0,$=_=>m+M(_)*f,g=e.variant==="solid",w=e.ticks===!1?0:e.ticks===!0||e.ticks===void 0?5:e.ticks,R=e.tickLabels??!0,k=Array.from({length:w},(_,W)=>w===1?s:s+(c-s)*W/(w-1)),T=w>0&&R,D=T?Math.max(...k.map(_=>t(_).length))*ie:0,v=T?14+D:10,S=T?26:10,L=ol(m,h),E=Math.max(L.x1-L.x0,.2),z=Math.max(L.y1-L.y0,.2),O=Math.max(0,Math.min((r-2*v)/E,(a-o-2*S)/z)),H=r/2-(L.x0+L.x1)/2*O,b=o+(a-o)/2-(L.y0+L.y1)/2*O,x=O*Math.max(.04,Math.min(.6,e.thickness??.18)),C=O-x,y=(_,W)=>({x:i(H+_*Math.sin(W)),y:i(b-_*Math.cos(W))}),B=[],U=`${t(s)} \u2013 ${t(c)}`,Y=(e.bands??[]).filter(_=>P(_.from)&&P(_.to)),j=_=>Y.find(W=>_>=W.from&&_<=W.to),I=_=>_.color??Bt(_.variant);B.push({kind:"path",part:"track",d:Ke(H,b,O,C,m,h),fill:K.grid,opacity:.6});for(let _ of Y){let W=$(Math.min(_.from,_.to)),ee=$(Math.max(_.from,_.to));if(ee<=W)continue;let te=`${_.label?`${_.label}: `:""}${t(_.from)} \u2013 ${t(_.to)}`;B.push(g?{kind:"path",part:"band",d:Ke(H,b,O+6,O+2,W,ee),fill:I(_),opacity:.7,title:te}:{kind:"path",part:"band",d:Ke(H,b,O,C,W,ee),fill:I(_),opacity:.75,title:te})}let G=`${e.caption??"Value"}: ${t(e.value)} (${U})`,V={label:G,name:e.caption,value:e.value},Q=$(e.value);if(g){let _=j(e.value),W=_?I(_):ne(e,0);Q>m+1e-6?B.push({kind:"path",part:"value",d:Ke(H,b,O,C,m,Q),fill:W,title:G,item:V}):B.push({...sl(H,b),title:G,item:V})}else{let _=y(C-4,Q),W=4,ee=y(W,Q-Math.PI/2),te=y(W,Q+Math.PI/2);B.push({kind:"path",part:"needle",d:`M${ee.x} ${ee.y}L${_.x} ${_.y}L${te.x} ${te.y}Z`,fill:"var(--skdx-color-text-default)",title:G,item:V},{kind:"circle",part:"hub",cx:i(H),cy:i(b),r:5,fill:"var(--skdx-color-text-default)"})}for(let _ of k){let W=$(_),ee=y(O+2,W),te=y(O+7,W);if(B.push({kind:"line",part:"tick",x1:ee.x,y1:ee.y,x2:te.x,y2:te.y,stroke:K.axis}),R){let re=y(O+12,W),me=Math.sin(W);B.push(J(re.x,re.y,t(_),{part:"tick-label",anchor:me>.3?"start":me<-.3?"end":"middle",baseline:"middle"}))}}if(P(e.target)){let _=$(e.target),W=y(C-2,_),ee=y(O+4,_);B.push({kind:"line",part:"target",x1:W.x,y1:W.y,x2:ee.x,y2:ee.y,stroke:"var(--skdx-color-text-default)",strokeWidth:2,title:`Target: ${t(e.target)}`})}let q=f<2*Math.PI-1e-6?L.y1<.2?b-C*.4:b+C*.45:b;B.push(J(i(H),i(q),e.centerLabel??t(e.value),{part:"center-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)",weight:"bold"})),e.caption&&B.push(J(i(H),i(q+16),e.caption,{part:"caption",anchor:"middle",baseline:"middle"}));let N=he(e,r,a),F=P(e.target)?`, target ${t(e.target)}`:"";return{...N,description:e.description??`${e.caption??"Value"} ${t(e.value)} on a scale from ${t(s)} to ${t(c)}${F}.`,shapes:[...B,...N.shapes]}}var sl=(e,n)=>({kind:"circle",part:"anchor",cx:i(e),cy:i(n),r:.01,fill:"none"});function Ha(e){let[n,t]=e.sizeRange??[4,24],r=ae(e.zAxis?.format??e.format),a=e.zAxis?.label,o=e.xAxis?.label,s=e.yAxis?.label,c=(l,d)=>l?`${l} ${d}`:d;return ya({...e,series:e.series.map(l=>({name:l.name,id:l.id,color:l.color,data:l.data.filter(d=>P(d.x)&&P(d.y)).map(d=>({x:d.x,y:d.y,size:P(d.z)?Math.max(0,d.z):0,label:d.label,id:d.id,color:d.color,value:d.value??d.z}))}))},{part:"bubble",opacity:.7,radius:(l,[,d])=>d>0&&P(l)?Math.max(n,Math.sqrt(l/d)*t):n,describe:(l,d,m,h)=>`${l}${d.label?` ${d.label}`:""}: ${c(o,m.format(d.x))}, ${c(s,h.format(d.y))}, ${c(a,r(d.size??0))}`})}function Va(e){let n=Ve(e.data),t=le(e,n.length===0);if(t)return t;let r=Jn(n,{bins:e.bins,binWidth:e.binWidth,domain:e.domain,thresholds:e.thresholds}),a=er(n,r),o=a.reduce((g,w)=>g+w.count,0),s=e.mode??"count",c=ae(e.xAxis?.format??e.format),l=ae(s==="percent"?{style:"percent",digits:1}:s==="density"?{style:"decimal",digits:3}:e.format),d=e.name??(s==="density"?"Density":s==="percent"?"Share":"Count"),m=g=>s==="density"?o>0&&g.x1>g.x0?g.count/(o*(g.x1-g.x0)):0:s==="percent"?o>0?g.count/o:0:g.count,h=a.map(g=>`${c(g.x0)}\u2013${c(g.x1)}`),f=qt({...e,format:l,series:[{name:d,data:a.map(m),color:e.color}],categories:h,xAxis:e.xAxis?.label?{label:e.xAxis.label}:void 0,barGap:e.barGap??.05,transform:void 0},"bar"),M=f.shapes.map((g,w)=>{if(g.part!=="bar"||!g.item||g.item.index===void 0)return g;let R=a[g.item.index];if(!R)return g;let k=o>0?` (${Math.round(R.count/o*1e3)/10}%)`:"",T=`${h[g.item.index]??String(w)}: ${R.count}${k}${s==="count"?"":` \xB7 ${d} ${l(m(R))}`}`;return{...g,title:g.title===void 0?void 0:T,item:{...g.item,label:T}}}),$=f.hit?.rows.map((g,w)=>{let R=a[w];return R?[g[0],`${d}: ${l(m(R))}`,`Observations: ${R.count}`]:g});return{...f,shapes:M,hit:f.hit&&$?{...f.hit,rows:$}:f.hit}}function il(e,n){let t=[],r=n;for(let a of e??[]){let o=typeof a=="number"?{from:r,to:a}:a;P(o.to)&&(t.push(o),r=o.to)}return t}function Ir(e){let n=e.data.filter(v=>P(v.value)),t=le(e,n.length===0,600,40+44*Math.max(1,e.data.length));if(t)return t;let r=ae(e.format),a=e.orientation==="vertical",{width:o,height:s}=de(e,600,a?300:40+44*n.length),c=v=>v.ranges??e.ranges,l=n.flatMap(v=>[v.value,v.target,...(c(v)??[]).map(S=>typeof S=="number"?S:S.to)]),[d,m]=we(l),h=e.min??Math.min(0,d),f=Math.max(0,...n.map(v=>v.name.length))*ie,M=Te(o,s,{top:fe.top+ue(e),right:e.labels&&!a?56:fe.right,bottom:fe.bottom,left:a?fe.left:Math.max(fe.left,f+16)}),$=a?[M.y+M.height,M.y]:[M.x,M.x+M.width],g=Ge([h,Math.max(h,m)],$,{min:h,max:e.max,ticks:e.ticks},e.format),w=je(n.length,a?[M.x,M.x+M.width]:[M.y,M.y+M.height],.3),R=he(e,o,s),k=n.map((v,S)=>({pos:i(w.center(S)),label:v.name})),T=Ze({...R,plot:M,xTicks:a?Ne(k,M.width):k,yTicks:a?g.ticks:Ne(g.ticks,M.width),baseline:g.zero},{horizontal:!a}),D=(v,S,L,E,z)=>{let O=g.scale(v),H=g.scale(S),b=Math.max(1,Math.abs(H-O));return a?{kind:"rect",x:i(L-E/2),y:i(Math.min(O,H)),width:i(E),height:i(b),...z}:{kind:"rect",x:i(Math.min(O,H)),y:i(L-E/2),width:i(b),height:i(E),...z}};return n.forEach((v,S)=>{if(xe(e,v.name))return;let L=w.center(S),E=w.bandwidth,z=il(c(v),h);z.forEach((x,C)=>{let y=`${v.name} ${x.label??`range ${C+1}`}: ${r(x.from)} \u2013 ${r(x.to)}`;T.push(D(x.from,x.to,L,E,{part:"range",fill:x.color??(x.variant?Bt(x.variant):K.axis),opacity:x.variant||x.color?.25:Math.max(.1,.4-C*.1),title:y}))});let O=P(v.target)?` \xB7 target ${r(v.target)}`:"",H=z.find(x=>v.value>=x.from&&v.value<=x.to),b=`${v.name}: ${r(v.value)}${O}${H?.label?` (${H.label})`:""}`;if(T.push(D(Math.min(h,v.value),v.value,L,E/3,{part:"measure",fill:ne(e,S,v.color),title:b,item:{label:b,id:v.id,name:v.name,index:S,value:v.value}})),P(v.target)){let x=i(g.scale(v.target));T.push({kind:"line",part:"target",x1:a?i(L-E/2.5):x,x2:a?i(L+E/2.5):x,y1:a?x:i(L-E/2.5),y2:a?x:i(L+E/2.5),stroke:"var(--skdx-color-text-default)",strokeWidth:3,title:`${v.name} target: ${r(v.target)}`})}if(e.labels){let x=g.scale(P(v.target)?Math.max(v.value,v.target):v.value);T.push(a?J(i(L),i(x-6),r(v.value),{part:"value-label",anchor:"middle"}):J(i(x+6),i(L),r(v.value),{part:"value-label",baseline:"middle"}))}}),{...R,shapes:[...T,...R.shapes]}}var _a=e=>qt(e,"bar");function ja(e){let n=e.variant??"area";return qt({...e,series:e.series.map(t=>({type:"range",name:t.name,low:t.low,high:t.high,color:t.color,axis:t.axis,curve:t.curve,style:n}))},"bar")}var Ur=e=>Math.round(e*1e6)/1e6,Es=60,ll=500;function Ga(e){let n=[],t=new Map;for(let Z of e.nodes)t.has(Z.id)?n.push({code:"duplicate-id",severity:"warning",message:`Node id "${Z.id}" is duplicated; the first definition is kept.`,itemId:Z.id}):t.set(Z.id,Z);let r=Z=>Z.group,a=[...t.values()].filter(Z=>!(Z.group!==void 0&&xe(e,Z.group))),o=new Set(a.map(Z=>Z.id)),s=e.edges.filter(Z=>{let oe=o.has(Z.source)&&o.has(Z.target);return!oe&&!(t.has(Z.source)&&t.has(Z.target))&&n.push({code:"unknown-node",severity:"warning",message:`Edge ${Z.source} \u2192 ${Z.target} names a node that does not exist and was dropped.`,itemId:Z.id}),oe}),c=le(e,a.length===0);if(c)return{...c,issues:n};let l=ae(e.format),{width:d,height:m}=de(e),[h,f]=e.nodeRange??[5,16],M=e.labels??a.length<=Es,$=[...new Set(e.nodes.map(r).filter(Z=>Z!==void 0))],g=$.map((Z,oe)=>({name:Z,color:ne(e,oe)})),w=Te(d,m,{top:ue(e,g,d)+f+8,right:f+(M?48:8),bottom:f+8,left:f+8}),R=(Z,oe)=>Z.color??ne(e,Z.group!==void 0?$.indexOf(Z.group):oe),[,k]=we(a.map(Z=>Z.value)),T=Z=>P(Z)&&k>0?h+Math.sqrt(Math.max(0,Z)/k)*(f-h):h,D=new Map;for(let Z of s)D.set(Z.source,(D.get(Z.source)??0)+1),Z.target!==Z.source&&D.set(Z.target,(D.get(Z.target)??0)+1);let v=a.length,S=new Map(a.map((Z,oe)=>[Z.id,oe])),L,E,z=e.arrange??"force";z==="manual"&&a.every(Z=>P(Z.x)&&P(Z.y))?(L=a.map(Z=>Z.x),E=a.map(Z=>Z.y)):z==="circular"||z==="manual"||v<3?(L=a.map((Z,oe)=>Ur(Math.cos(2*Math.PI*oe/v-Math.PI/2))),E=a.map((Z,oe)=>Ur(Math.sin(2*Math.PI*oe/v-Math.PI/2)))):{xs:L,ys:E}=cl(v,s.map(Z=>[S.get(Z.source),S.get(Z.target)]),e.iterations??Math.max(50,Math.min(300,Math.floor(3e4/v))));let[O,H]=we(L),[b,x]=we(E),C=Math.max(H-O,x-b)||1,y=Math.min(w.width/C,w.height/C),B=w.x+(w.width-(H-O)*y)/2,U=w.y+(w.height-(x-b)*y)/2,Y=a.map((Z,oe)=>({node:Z,index:oe,x:i(B+(L[oe]-O)*y),y:i(U+(E[oe]-b)*y),r:i(T(Z.value)),color:R(Z,oe),degree:D.get(Z.id)??0})),j=new Map(Y.map(Z=>[Z.node.id,Z])),I=Yn(e.selected)[0],G=I!==void 0?j.get(String(I)):void 0,V=new Set;if(G){V.add(G.node.id);for(let Z of s)Z.source===G.node.id&&V.add(Z.target),Z.target===G.node.id&&V.add(Z.source)}let Q=(Z,oe=Z)=>G&&!(V.has(Z)&&V.has(oe))?.15:void 0,p=Z=>!G||Z.source===G.node.id||Z.target===G.node.id,[,q]=we(s.map(Z=>Z.value)),N=s.length<=ll,F=[],_=(Z,oe,ke)=>F.some(Be=>Math.abs(Be.y-oe)<12&&Z<Be.x+Be.w+4&&Z+ke+4>Be.x)?!1:(F.push({x:Z,y:oe,w:ke}),!0),W=[],ee=[],te=s.map(Z=>{let oe=j.get(Z.source),ke=j.get(Z.target),Be=P(Z.value)&&q>0?1+3*Math.sqrt(Math.max(0,Z.value)/q):1,Fe=`${oe.node.label??oe.node.id} \u2192 ${ke.node.label??ke.node.id}${Z.label?` ${Z.label}`:""}${P(Z.value)?`: ${l(Z.value)}`:""}`,Mt=p(Z)?Q(Z.source,Z.target):.15,wt=N?{label:Fe,id:Z.id,name:Z.source,category:Z.target,value:Z.value}:void 0;if(oe===ke){let mt=oe.r*2.5;return{kind:"path",part:"edge",d:`M${i(oe.x)} ${i(oe.y-oe.r)}C${i(oe.x-mt)} ${i(oe.y-mt*1.5)} ${i(oe.x+mt)} ${i(oe.y-mt*1.5)} ${i(oe.x)} ${i(oe.y-oe.r)}`,stroke:K.axis,strokeWidth:Be,opacity:Mt??.7,title:N?Fe:void 0,item:wt}}let Cn=Math.sqrt((ke.x-oe.x)*(ke.x-oe.x)+(ke.y-oe.y)*(ke.y-oe.y))||1,Nn=(ke.x-oe.x)/Cn,un=(ke.y-oe.y)/Cn;if(e.directed){let mt=ke.x-Nn*ke.r,kt=ke.y-un*ke.r,hn=mt-Nn*6,Wn=kt-un*6;W.push({kind:"path",part:"arrow",d:`M${i(mt)} ${i(kt)}L${i(hn-un*3)} ${i(Wn+Nn*3)}L${i(hn+un*3)} ${i(Wn-Nn*3)}Z`,fill:K.axis,opacity:Mt??.7})}let Mn=`${Z.label??""}${P(Z.value)?`${Z.label?": ":""}${l(Z.value)}`:""}`;if(e.edgeLabels&&Mn){let mt=(oe.x+ke.x)/2,kt=(oe.y+ke.y)/2,hn=Mn.length*ie;_(mt-hn/2,kt,hn)&&ee.push(J(i(mt),i(kt),Mn,{part:"edge-label",anchor:"middle",baseline:"middle"}))}return{kind:"path",part:"edge",d:`M${i(oe.x)} ${i(oe.y)}L${i(ke.x)} ${i(ke.y)}`,stroke:K.axis,strokeWidth:Be,opacity:Mt??.7,title:N?Fe:void 0,item:wt}}),re=[],me=[];for(let Z of Y){let oe=Z.node.label??Z.node.id,ke=P(Z.node.value)?`: ${l(Z.node.value)}`:"",Be=Z.node.group!==void 0?` \xB7 ${Z.node.group}`:"",Fe=`${oe}${ke}${Be} \xB7 ${Z.degree} connection${Z.degree===1?"":"s"}`;if(re.push({kind:"circle",part:"node",cx:Z.x,cy:Z.y,r:Z.r,fill:Z.color,stroke:G?.node.id===Z.node.id?"var(--skdx-color-text-default)":"var(--skdx-color-surface-default)",opacity:Q(Z.node.id),title:Fe,item:{label:Fe,name:Z.node.id,category:Z.node.group,index:Z.index,value:Z.node.value}}),!M)continue;let Mt=oe.length*ie,wt=Z.x+Z.r+4,Cn=Z.y;_(wt,Cn,Mt)&&me.push(J(i(wt),i(Cn),oe,{part:"node-label",baseline:"middle",fill:Q(Z.node.id)===void 0?"var(--skdx-color-text-default)":K.grid}))}let be=he(e,d,m,g);return{...be,shapes:[...te,...W,...re,...ee,...me,...be.shapes],issues:n}}function cl(e,n,t){let r=Array.from({length:e},(l,d)=>Ur(Math.cos(2*Math.PI*d/e))),a=Array.from({length:e},(l,d)=>Ur(Math.sin(2*Math.PI*d/e))),o=Math.sqrt(4/e),s=new Array(e).fill(0),c=new Array(e).fill(0);for(let l=0;l<t;l++){let d=.1*(1-l/t)+.005;s.fill(0),c.fill(0);for(let m=0;m<e;m++)for(let h=m+1;h<e;h++){let f=r[m]-r[h],M=a[m]-a[h];f===0&&M===0&&(f=.001*(m%7+1),M=.001*(h%5+1));let $=f*f+M*M,g=o*o/$;s[m]=s[m]+f*g,c[m]=c[m]+M*g,s[h]=s[h]-f*g,c[h]=c[h]-M*g}for(let[m,h]of n){if(m===h)continue;let f=r[m]-r[h],M=a[m]-a[h],$=Math.sqrt(f*f+M*M)||1e-6,g=$*$/o/$;s[m]=s[m]-f*g,c[m]=c[m]-M*g,s[h]=s[h]+f*g,c[h]=c[h]+M*g}for(let m=0;m<e;m++){let h=Math.sqrt(s[m]*s[m]+c[m]*c[m])||1e-6,f=Math.min(h,d);r[m]=r[m]+s[m]/h*f,a[m]=a[m]+c[m]/h*f}}return{xs:r,ys:a}}var Wa=14;function qa(e){let n=[],t=e.events.map((C,y)=>({event:C,index:y,time:new Date(C.date).getTime()})).filter(C=>Number.isFinite(C.time)?!(C.event.group!==void 0&&xe(e,C.event.group)):(n.push({code:"invalid-value",severity:"warning",message:`Event "${C.event.label}" has an unparseable date and was dropped.`,itemId:C.event.id??C.event.label}),!1)).sort((C,y)=>C.time-y.time||C.index-y.index),r=le(e,t.length===0);if(r)return{...r,issues:n};let{width:a,height:o}=de(e),s=e.orientation==="vertical",c=[...new Set(e.events.map(C=>C.group).filter(C=>C!==void 0))],l=c.length?c:[""],[d,m]=we(t.map(C=>C.time)),h=e.xAxis?.format??{style:m-d<2*864e5?"time":"date"},f=C=>Qt(C,h),M=e.labels??!0,$=t.map(C=>{let y=C.event.group,B=C.event.color??(C.event.variant?Bt(C.event.variant):ne(e,y===void 0?0:c.indexOf(y))),U=C.event.description?` \u2014 ${C.event.description}`:"";return{...C,lane:y===void 0?0:c.indexOf(y),color:B,text:`${C.event.label} \xB7 ${f(C.time)}${U}`}}),g=c.map((C,y)=>({name:C,color:ne(e,y)})),w=he(e,a,o,g),R=C=>({label:C.text,id:C.event.id,name:C.event.label,category:C.event.group,index:C.index,value:C.time}),k=[];if(s){let C=Math.max(...$.map(Y=>f(Y.time).length))*ie+16,y=Te(a,o,{top:8+ue(e,g,a),right:8,bottom:8,left:C+12}),B=je($.length,[y.y,y.y+y.height],0),U=i(y.x);return k.push({kind:"line",part:"axis",x1:U,x2:U,y1:y.y,y2:y.y+y.height,stroke:K.axis}),$.forEach((Y,j)=>{let I=i(B.center(j));if(k.push(J(i(y.x-12),I,f(Y.time),{part:"x-label",anchor:"end",baseline:"middle"}),{kind:"circle",part:"event",cx:U,cy:I,r:5,fill:Y.color,stroke:"var(--skdx-color-surface-default)",title:Y.text,item:R(Y)}),M){let G=Y.event.description,V=B.step>=2*Wa&&G;k.push(J(i(y.x+12),V?i(I-7):I,Y.event.label,{part:"event-label",baseline:"middle",fill:"var(--skdx-color-text-default)"})),V&&k.push(J(i(y.x+12),i(I+7),G,{part:"event-description",baseline:"middle"}))}}),{...w,shapes:[...k,...w.shapes],issues:n}}let T=c.length?Math.max(...c.map(C=>C.length))*ie+16:8,D=Math.max(f(d).length,f(m).length)*ie/2+4,v=Te(a,o,{top:8+ue(e,g,a),right:Math.max(16,D),bottom:32+(e.xAxis?.label?14:0),left:Math.max(16,T,D)}),S=(m-d)*.04||36e5,L=st([d-S,m+S],[v.x,v.x+v.width]),E=Qn(d-S,m+S).filter(C=>C>=d-S&&C<=m+S).map(C=>({pos:i(L(C)),label:f(C)}));for(let C of Ne(E,v.width))k.push({kind:"line",part:"grid",x1:C.pos,x2:C.pos,y1:v.y,y2:v.y+v.height,stroke:K.grid},J(C.pos,v.y+v.height+20,C.label,{part:"x-label",anchor:"middle"}));e.xAxis?.label&&k.push(J(i(v.x+v.width/2),o-4,e.xAxis.label,{part:"axis-title",anchor:"middle"}));let z=je(l.length,[v.y,v.y+v.height],0),O=Math.max(0,Math.floor((z.step/2-14)/Wa));l.forEach((C,y)=>{let B=i(z.center(y));k.push({kind:"line",part:"axis",x1:v.x,x2:v.x+v.width,y1:B,y2:B,stroke:K.axis}),C&&k.push(J(v.x-8,B,C,{part:"y-label",anchor:"end",baseline:"middle"}))});let H=l.map(()=>[]),b=[],x=[];for(let C of $){let y=i(L(C.time)),B=i(z.center(C.lane));if(x.push({kind:"circle",part:"event",cx:y,cy:B,r:5,fill:C.color,stroke:"var(--skdx-color-surface-default)",title:C.text,item:R(C)}),!M)continue;let U=C.event.label.length*ie,Y=y-U/2,j=H[C.lane],I=0;for(;I<=O&&(j[I]??-1/0)>Y-6;)I++;if(I>O)continue;j[I]=Y+U;let G=i(B-12-I*Wa),V=i(Math.max(U/2+2,Math.min(a-U/2-2,y)));I>0&&b.push({kind:"line",part:"connector",x1:y,x2:y,y1:i(B-6),y2:i(G+4),stroke:K.grid}),b.push(J(V,G,C.event.label,{part:"event-label",anchor:"middle",fill:"var(--skdx-color-text-default)"}))}return{...w,shapes:[...k,...b,...x,...w.shapes],issues:n}}var Ds="var(--skdx-radius-default, var(--skdx-radius-md, 0.5rem))";function Yr(e){return["tooltip","skeleton","label-background","stage-label-background","brush-handle"].includes(e)?Ds:void 0}function or(e,n,t,r,a){let o=e.getBoundingClientRect();return{x:o.width?(n-o.left)*r/o.width:n,y:o.height?(t-o.top)*a/o.height:t}}var Za=(e,n,t)=>n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height;function Bs(e,n){let t=0,r=1/0;return e.xs.forEach((a,o)=>{let s=Math.abs(a-n);s<r&&(r=s,t=o)}),t}function Tr(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=Bs(t,n),a=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(a,r)??a}}function Ua(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=t.xs[Bs(t,n)];return{kind:"line",part:"crosshair",x1:r,x2:r,y1:t.plot.y,y2:t.plot.y+t.plot.height,stroke:K.axis,dash:"3 3"}}function Ya(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!Za(r.plot,n,t))return[];let a=Ua(e,n),{rows:o}=Tr(e,n),s=e.tooltipAnchored?r.plot.y+8:t;return[a,..._r(a.x1,s,o,e.width,e.height,e.tooltipPlacement)]}function Ka(e,n){let t=e.hit;if(!t||t.xs.length===0)return[];let r=t.rows.findIndex(o=>o[0]===n);if(r<0)return[];let a=t.xs[r];return Ya(e,a,t.plot.y+8)}function Xa(e,n,t,r,a){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:l,y:d}=or(t,r,a,e.width,e.height);if(Za(e.hit.plot,l,d)){let m=Tr(e,l),h=Ua(e,l);if(m&&h)return{lines:m.rows,shapes:[h]}}}let o=n?.closest?.("[data-skdx-part]"),s=e.tooltipFormatter?Hn(e,n)?.item:void 0,c=s&&e.tooltipFormatter?.(s)||o&&Array.from(o.children).find(l=>l.tagName.toLowerCase()==="title")?.textContent;return c?{lines:Array.isArray(c)?c:[c],shapes:[]}:{lines:[],shapes:[]}}function Fs(e,n,t,r,a,o,s){let c=e?.closest?.("[data-skdx-part]"),l=s&&s.tooltipFormatter?Hn(s,e)?.item:void 0,d=l&&s?.tooltipFormatter?.(l)||c&&Array.from(c.children).find($=>$.tagName.toLowerCase()==="title")?.textContent;if(!d)return[];let m=s?.tooltipAnchored?Hn(s,e):void 0,h=m?s?.shapes[m.index]:void 0,{x:f,y:M}=h?Ar(h):or(n,t,r,a,o);return _r(f,M,d,a,o,s?.tooltipPlacement)}function Qa(e,n,t,r,a){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:s}=or(t,r,a,e.width,e.height),c=Ya(e,o,s);if(c.length>0)return c}return Fs(n,t,r,a,e.width,e.height,e)}function Ja(e,n){let t=Hn(e,n);return t&&!t.item.legend?Pn(t.item):null}var dl=(e,n)=>{let{x:t,y:r}=Ar(e),a=e.kind==="circle"?e.cy:e.kind==="rect"?e.y+e.height/2:r;return t>=n.x&&t<=n.x+n.width&&a>=n.y&&a<=n.y+n.height};function eo(e,n){let t=new Set,r=[];for(let a of e.shapes){if(!a.item||a.item.legend||a.part==="anchor"||!dl(a,n))continue;let o=Pn(a.item),s=JSON.stringify(o);t.has(s)||(t.add(s),r.push(o))}return r}var to=e=>({kind:"rect",part:"selection-box",x:i(e.x),y:i(e.y),width:i(e.width),height:i(e.height),fill:K.focus,opacity:.12,stroke:K.focus}),Xr=(e,n,t,r)=>({x:Math.min(e,t),y:Math.min(n,r),width:Math.abs(t-e),height:Math.abs(r-n)});function Ps(e,n,t){let r=!1;for(let a=0,o=e.length-1;a<e.length;o=a++){let s=e[a],c=e[o];s.y>t!=c.y>t&&n<(c.x-s.x)*(t-s.y)/(c.y-s.y)+s.x&&(r=!r)}return r}function no(e,n){if(n.length<3)return[];let t=new Set,r=[];for(let a of e.shapes){if(!a.item||a.item.legend||a.part==="anchor")continue;let{x:o,y:s}=Ar(a),c=a.kind==="circle"?a.cy:a.kind==="rect"?a.y+a.height/2:s;if(!Ps(n,o,c))continue;let l=Pn(a.item),d=JSON.stringify(l);t.has(d)||(t.add(d),r.push(l))}return r}var ro=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${i(n.x)} ${i(n.y)}`).join("L")}`:"",fill:K.focus,fillOpacity:.12,stroke:K.focus,dash:"4 3"}),Kr=6;function ao(e,n,t){let r=e.edit;if(r){for(let a of r.bars)if(!(t<a.y||t>a.y+a.height||n<a.x0-Kr||n>a.x1+Kr))return Math.abs(n-a.x0)<=Kr?{bar:a,mode:"start"}:Math.abs(n-a.x1)<=Kr?{bar:a,mode:"end"}:{bar:a,mode:"move"}}}function oo(e,n,t){let r=e.edit;return Hs(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function so(e,n,t){let r=e.edit,a=t.key==="ArrowRight"?1:t.key==="ArrowLeft"?-1:0;if(!r||n===null||!a||!(t.shiftKey||t.altKey))return;let o=r.bars.find(l=>l.index===n);if(!o)return;let s=t.altKey?t.shiftKey?"start":"end":"move",c=r.snap??r.invert(o.x0+10)-r.invert(o.x0);return Hs(r,{bar:o,mode:s},a*c)}function Hs(e,{bar:n,mode:t},r){let a=c=>e.snap?Math.round(c/e.snap)*e.snap:c,o=n.start,s=n.end;return t==="move"?(o=a(n.start+r),s=o+(n.end-n.start)):t==="start"?o=Math.min(a(n.start+r),n.end):s=Math.max(a(n.end+r),n.start),{id:n.id,name:n.name,start:o,end:s}}function io(e,n,t){let r=e.edit,a=r.scale(t.start),o=r.scale(t.end);return{kind:"rect",part:"edit-ghost",x:i(Math.min(a,o)),y:i(n.bar.y),width:i(Math.max(1,Math.abs(o-a))),height:i(n.bar.height),fill:K.focus,opacity:.25,stroke:K.focus,rx:2}}var ml=64,ul=e=>Math.max(1,Math.min(ml,e));function lo(e,n,t,r){let a=n>0?.8:1.25,o=ul(e.view.zoom*a);if(o===e.view.zoom)return e.view;let{plot:s,scale:c}=e,[l,d]=e.view.center,m=(t-(s.x+s.width/2))/c,h=(r-(s.y+s.height/2))/c,f=e.view.zoom/o;return{center:[l+m*(1-f),e.fromY(e.toY(d)-h*(1-f))],zoom:o}}function co(e,n,t,r){let{scale:a}=e;return{center:[n.center[0]-t/a,e.fromY(e.toY(n.center[1])+r/a)],zoom:n.zoom}}function Hn(e,n){let t=n?.closest?.("[data-skdx-i]"),r=Number(t?.getAttribute("data-skdx-i")),a=Number.isInteger(r)?e.shapes[r]?.item:void 0;return a?{index:r,item:a}:void 0}var Qr=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function Ar(e){switch(e.kind){case"rect":return{x:e.x+e.width/2,y:e.y};case"circle":return{x:e.cx,y:e.cy-e.r};case"line":return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)};case"text":return{x:e.x,y:e.y};case"path":{let n=/M\s*(-?[\d.]+)[ ,](-?[\d.]+)/.exec(e.d);return n?{x:Number(n[1]),y:Number(n[2])}:{x:0,y:0}}}}function mo(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=K.focus,a;switch(t.kind){case"rect":a={kind:"rect",part:"focus",x:t.x-2,y:t.y-2,width:t.width+4,height:t.height+4,fill:"none",stroke:r,rx:2};break;case"circle":a={kind:"circle",part:"focus",cx:t.cx,cy:t.cy,r:t.r+3,fill:"none",stroke:r};break;case"line":a={kind:"line",part:"focus",x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:r,strokeWidth:4};break;case"text":a={kind:"rect",part:"focus",x:t.x-2,y:t.y-8,width:t.text.length*ie+4,height:16,fill:"none",stroke:r,rx:2};break;case"path":a={kind:"path",part:"focus",d:t.d,stroke:r,strokeWidth:2,fill:"none"};break}let{x:o,y:s}=Ar(t),c=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[a,...c?_r(i(o),i(s),c,e.width,e.height):[]]}function uo(e,n,t){let r=Qr(e);if(r.length===0)return;let a=n===null?-1:r.indexOf(n);switch(t){case"ArrowRight":case"ArrowDown":return r[Math.min(r.length-1,a+1)];case"ArrowLeft":case"ArrowUp":return r[Math.max(0,a<=0?0:a-1)];case"Home":return r[0];case"End":return r[r.length-1];case"Escape":return null;default:return}}var rr=2,ar=(e,n,t)=>{let r=Math.max(rr,Math.min(t,Math.round(n))),a=Math.max(0,Math.min(t-r,Math.round(e)));return{start:a,end:a+r}},Vs=(e,n)=>!e||e.start<=0&&e.end>=n;function ho(e,n,t){if(e.count<=rr||!e.plot.width)return;let{start:r,end:a}=e.zoom,o=a-r,s=n>0?1.25:.8,c=Math.max(rr,Math.min(e.count,Math.round(o*s)));if(c===o)return n>0&&!Vs(e.zoom,e.count)?ar(r,c,e.count):void 0;let l=Math.max(0,Math.min(1,(t-e.plot.x)/e.plot.width)),d=r+l*o;return ar(d-l*c,c,e.count)}function fo(e,n,t,r){let a=n.end-n.start,o=Math.max(rr,Math.min(e.count,Math.round(a/Math.max(.05,t)))),s=Math.max(0,Math.min(1,(r-e.plot.x)/Math.max(1,e.plot.width)));return ar(n.start+s*a-s*o,o,e.count)}function po(e,n,t){let r=n.end-n.start,a=e.plot.width/Math.max(1,r);return ar(n.start-t/a,r,e.count)}function bo(e,n,t){let r=e.brush;if(!r||!Za(r.box,n,t))return;let a=r.window;if(Math.abs(n-a.x)<=6)return{grab:"left",zoom:e.zoom};if(Math.abs(n-(a.x+a.width))<=6)return{grab:"right",zoom:e.zoom};if(n>a.x&&n<a.x+a.width)return{grab:"move",zoom:e.zoom};let o=e.zoom.end-e.zoom.start,s=(n-r.box.x)/Math.max(1,r.box.width)*e.count;return{grab:"move",zoom:ar(s-o/2,o,e.count)}}function go(e,n,t,r){let a=e.brush;if(!a)return t;let o=r/Math.max(1,a.box.width)*e.count;if(n==="move")return ar(t.start+o,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-rr,Math.round(t.start+o))),end:t.end};let s=Math.min(e.count,Math.max(t.start+rr,Math.round(t.end+o)));return{start:t.start,end:s}}function Lr(e,n){switch(n.type){case"svg":return Promise.resolve(Or(e,n.label,n.resolve));case"csv":return Promise.resolve(Sr(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=Or(e,n.label,n.resolve);return Gs(t,e.width,e.height,n.scale,n.background)}}}var kn=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/"/g,"""),Cr=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${kn(String(t))}"`).join("");function _s(e){let n=e.title?`<title>${kn(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${Cr([t,["d",e.d],["fill",e.fill??"none"],["stroke",e.stroke],["stroke-width",e.strokeWidth],["stroke-linecap",e.strokeLinecap],["stroke-linejoin",e.strokeLinejoin],["stroke-dasharray",e.dash],["opacity",e.opacity],["fill-opacity",e.fillOpacity]])}>${n}</path>`;case"rect":return`<rect${Cr([t,["x",e.x],["y",e.y],["width",e.width],["height",e.height],["rx",e.rx],["fill",e.fill],["stroke",e.stroke],["fill-opacity",e.opacity]])}>${n}</rect>`;case"line":return`<line${Cr([t,["x1",e.x1],["y1",e.y1],["x2",e.x2],["y2",e.y2],["stroke",e.stroke],["stroke-width",e.strokeWidth],["stroke-dasharray",e.dash],["opacity",e.opacity]])}>${n}</line>`;case"circle":return`<circle${Cr([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${Cr([t,["aria-label",e.title],["x",e.x],["y",e.y],["text-anchor",e.anchor],["dominant-baseline",e.baseline],["fill",e.fill],["font-weight",e.weight],["transform",e.rotate?`rotate(${e.rotate} ${e.x} ${e.y})`:void 0]])}>${kn(e.text)}</text>`}}function js(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${kn(t.id)}" x1="0" y1="0" x2="${t.vertical===!1?1:0}" y2="${t.vertical===!1?0:1}">${t.stops.map(r=>`<stop offset="${r.offset}" stop-color="${kn(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function Or(e,n,t){let r=js(e)+e.shapes.map(_s).join("");t&&(r=r.replace(/var\((--[\w-]+)\)/g,(s,c)=>t(c).trim()||s));let a=e.decorative?'aria-hidden="true"':`role="img" aria-label="${kn(n)}"`,o=e.description?`<desc>${kn(e.description)}</desc>`:"";return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e.width} ${e.height}" width="${e.width}" height="${e.height}" ${a} font-family="${kn(K.fontFamily)}" font-size="${kn(K.fontSize)}"><title>${kn(n)}</title>${o}${r}</svg>`}function Gs(e,n,t,r=2,a){return new Promise((o,s)=>{let c=URL.createObjectURL(new Blob([e],{type:"image/svg+xml;charset=utf-8"})),l=new Image;l.onload=()=>{URL.revokeObjectURL(c);let d=document.createElement("canvas");d.width=Math.round(n*r),d.height=Math.round(t*r);let m=d.getContext("2d");if(!m)return s(new Error("canvas 2d context unavailable"));a&&(m.fillStyle=a,m.fillRect(0,0,d.width,d.height)),m.drawImage(l,0,0,d.width,d.height),d.toBlob(h=>h?o(h):s(new Error("toBlob failed")),"image/png")},l.onerror=()=>{URL.revokeObjectURL(c),s(new Error("svg could not be decoded"))},l.src=c})}function Sr(e){let n=t=>{let r=t==null?"":String(t);return/[",\n\r]/.test(r)?`"${r.replace(/"/g,'""')}"`:r};return e.map(t=>t.map(n).join(",")).join(`\r
|
|
3
|
-
`)}function xo(e,n=[]){let t=Math.max(n.length,...e.map(a=>a.data.length)),r=[["",...e.map(a=>a.name)]];for(let a=0;a<t;a++){let o=n[a];r.push([o instanceof Date?o.toISOString():o??a+1,...e.map(s=>s.data[a])])}return Sr(r)}var De=e=>P(e.value)?e.value:(e.children??[]).reduce((n,t)=>n+De(t),0),yo=e=>P(e.value)||(e.children??[]).some(yo),zr=e=>e.length===0?0:1+Math.max(...e.map(n=>zr(n.children??[]))),tt=e=>e.id??e.name;function Ws(e,n){for(let t of e){if(tt(t)===n||t.name===n)return[t];let r=Ws(t.children??[],n);if(r)return[t,...r]}}var sr=(e,n)=>n==="asc"||n==="desc"?[...e].sort((t,r)=>n==="asc"?De(t)-De(r):De(r)-De(t)):[...e];function fn(e,n,t=1){return n===void 0?[...e]:e.map(r=>t>=n?{...r,value:De(r),children:void 0}:{...r,children:r.children?fn(r.children,n,t+1):void 0})}function $n(e,n){if(n===void 0)return{nodes:[...e],path:[]};let t=Ws(e,n);if(!t)return{nodes:[...e],path:[]};let r=t[t.length-1];return{nodes:r.children?.length?r.children:[r],path:t}}function vo(e,n){if(!n)return;let t=typeof n=="object"?n.maxRows??500:500,r=e.hit;if(r&&r.rows.length>0){let c=r.rows[0];if(r.rows.length>t)return;let l=["",...c.slice(1).map(m=>m.replace(/:\s[^:]*$/,""))],d=r.rows.map(m=>[m[0],...m.slice(1).map(h=>h.slice(h.lastIndexOf(": ")+2))]);return[l,...d]}let a=e.shapes.flatMap(c=>c.item&&!c.item.legend&&!(c.part==="anchor"&&!c.title)?[c.item]:[]);if(a.length===0||a.length>t)return;let o=["series","name","category","value"].filter(c=>a.some(l=>l[c]!==void 0)),s=(c,l)=>c[l]===void 0?"":String(c[l]);return[o.map(c=>c[0]?.toUpperCase()+c.slice(1)),...a.map(c=>o.map(l=>s(c,l)))]}var Mo=new Map;function ir(e){let n=Mo.get(e);if(n)return n.group;let t=new Set,r={},a={current:r,subscribe(o){return t.add(o),()=>{t.delete(o),t.size===0&&Mo.delete(e)}},publish(o,s){Object.assign(r,o);for(let c of t)c(o,s)}};return Mo.set(e,{group:a,listeners:t}),a}var qs='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',wo=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${qs}{animation:skdx-in var(--skdx-chart-duration,0ms) ease-out;transition:${["x","y","width","height","cx","cy","r","opacity","fill-opacity","d"].map(e=>`${e} var(--skdx-chart-duration,0ms) ease-out`).join(",")}}@media (prefers-reduced-motion:reduce){${qs}{animation:none;transition:none}}`;function ko(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}function $o(e){let n=[],t=e.nodes?new Set(e.nodes.map(b=>b.id)):void 0,r=e.links.filter(b=>!P(b.value)||b.value<=0?(n.push({code:"invalid-value",severity:"warning",message:`Link ${b.source} \u2192 ${b.target} has no positive value and was dropped.`,itemId:b.id}),!1):b.source===b.target?(n.push({code:"self-link",severity:"warning",message:`Link ${b.source} \u2192 ${b.target} points at its own node and was dropped.`,itemId:b.id}),!1):t&&!(t.has(b.source)&&t.has(b.target))?(n.push({code:"unknown-node",severity:"warning",message:`Link ${b.source} \u2192 ${b.target} names a node not in \`nodes\` and was dropped.`,itemId:b.id}),!1):!0),{links:a,back:o}=hl(r),s=e.cyclePolicy??"drop";for(let b of o)n.push({code:"cycle",severity:s==="error"?"error":"warning",message:`Link ${b.source} \u2192 ${b.target} closes a cycle and was ${s==="error"?"rejected":"dropped"}.`,itemId:b.id});let c=le(s==="error"&&o.length>0?{...e,error:e.error??`${o.length} link${o.length===1?"":"s"} close a cycle`}:e,a.length===0);if(c)return{...c,issues:n};let l=ae(e.format),d=Math.max(0,e.nodePadding??8),m=Math.max(1,e.nodeWidth??16),{width:h,height:f}=de(e),M=Te(h,f,{top:8+ue(e),right:96,bottom:8,left:8}),$=new Map,g=new Map((e.nodes??[]).map(b=>[b.id,b])),w=b=>{let x=$.get(b);if(!x){let C=g.get(b);x={id:b,name:C?.label??b,depth:0,value:0,color:ne(e,$.size,C?.color),x:0,y:0,height:0,outY:0,inY:0},$.set(b,x)}return x};for(let b of e.nodes??[])w(b.id);for(let b of a)w(b.source),w(b.target);for(let b=0,x=!0;x&&b<=$.size;b++){x=!1;for(let C of a){let y=w(C.source).depth+1;y>w(C.target).depth&&(w(C.target).depth=y,x=!0)}}let R=new Map,k=new Map;for(let b of a)R.set(b.source,(R.get(b.source)??0)+b.value),k.set(b.target,(k.get(b.target)??0)+b.value);if(e.align==="justify"){let b=Math.max(0,...[...$.values()].map(x=>x.depth));for(let x of $.values())R.has(x.id)||(x.depth=b)}let T=Yn(e.selected).map(String),D=b=>T.includes(b),v=b=>T.length===0||D(b)||a.some(x=>D(x.source)&&x.target===b||D(x.target)&&x.source===b);for(let b of $.values())b.value=Math.max(R.get(b.id)??0,k.get(b.id)??0);let S=new Map;for(let b of $.values())S.set(b.depth,[...S.get(b.depth)??[],b]);if(e.nodeSort)for(let b of S.values())b.sort((x,C)=>e.nodeSort==="asc"?x.value-C.value:C.value-x.value);let L=Math.max(0,...S.keys()),E=Math.min(...[...S.values()].map(b=>(M.height-d*(b.length-1))/b.reduce((x,C)=>x+C.value,0)));for(let[b,x]of S){let C=M.y;for(let y of x)y.x=M.x+(L===0?0:b*(M.width-m)/L),y.y=C,y.height=y.value*E,y.outY=y.inY=C,C+=y.height+d}let z=[...a];e.linkSort&&z.sort((b,x)=>e.linkSort==="asc"?b.value-x.value:x.value-b.value);let O=[],H=[];for(let b of z){let x=w(b.source),C=w(b.target),y=b.value*E,B=T.length===0||D(b.source)||D(b.target),U=x.x+m,Y=C.x,j=(U+Y)/2,I=x.outY,G=C.inY;x.outY+=y,C.inY+=y;let V=`${x.name} \u2192 ${C.name}: ${l(b.value)}`;O.push({kind:"path",part:"link",d:`M${i(U)} ${i(I)}C${i(j)} ${i(I)} ${i(j)} ${i(G)} ${i(Y)} ${i(G)}L${i(Y)} ${i(G+y)}C${i(j)} ${i(G+y)} ${i(j)} ${i(I+y)} ${i(U)} ${i(I+y)}Z`,fill:x.color,opacity:B?.4:.08,title:V,item:{label:V,id:b.id??`${b.source}\u2192${b.target}`,name:b.source,category:b.target,value:b.value}});let Q=Y-U>(x.name.length+l(b.value).length)*ie+24;e.linkLabels&&y>=12&&B&&Q&&H.push(J(i(j),i((I+G+y)/2),l(b.value),{part:"link-label",anchor:"middle",baseline:"middle"}))}for(let b of $.values()){let x=`${b.name}: ${l(b.value)}`;O.push({kind:"rect",part:"node",x:i(b.x),y:i(b.y),width:m,height:i(b.height),fill:b.color,opacity:v(b.id)?void 0:.3,title:x,item:{label:x,id:b.id,name:b.name,value:b.value}});let C=b.depth===L;(e.nodeLabels??!0)&&O.push(J(i(C?b.x-6:b.x+m+6),i(b.y+b.height/2),b.name,{anchor:C?"end":"start",baseline:"middle"}))}return{...he(e,h,f),shapes:[...O,...H],issues:n}}function hl(e){let n=new Map;for(let o of e)n.set(o.source,[...n.get(o.source)??[],o]);let t=new Map,r=new Set,a=o=>{t.set(o,"active");for(let s of n.get(o)??[]){let c=t.get(s.target);c==="active"?r.add(s):c===void 0&&a(s.target)}t.set(o,"done")};for(let o of e)t.has(o.source)||a(o.source);return{links:e.filter(o=>!r.has(o)),back:[...r]}}function Io(e,n,t,r,a,o){if(e.length===0)return;let s=(h,f)=>{let M=h.reduce((w,R)=>w+R.area,0),$=Math.max(...h.map(w=>w.area)),g=Math.min(...h.map(w=>w.area));return Math.max(f*f*$/(M*M),M*M/(f*f*g))},c=Math.min(r,a),l=[],d=0;for(;d<e.length;){let h=[...l,e[d]];if(l.length===0||s(h,c)<=s(l,c))l=h,d++;else break}let m=l.reduce((h,f)=>h+f.area,0);if(r>=a){let h=m/a,f=t;for(let M of l){let $=M.area/h;o(M,[n,f,h,$]),f+=$}Io(e.slice(d),n+h,t,r-h,a,o)}else{let h=m/r,f=n;for(let M of l){let $=M.area/h;o(M,[f,t,$,h]),f+=$}Io(e.slice(d),n,t+h,r,a-h,o)}}function fl(e,n,t,r,a,o,s){let c=e.reduce((d,m)=>d+m.area,0),l=s?t:n;for(let d of e){let m=c>0?d.area/c:0;if(s){let h=a*m;o(d,[n,l,r,h]),l+=h}else{let h=r*m;o(d,[l,t,h,a]),l+=h}}}function To(e){let{nodes:n,path:t}=$n(e.data,e.rootId),r=fn(n,e.maxDepth),a=le(e,!r.some(v=>De(v)>0));if(a)return a;let o=ae(e.format),{width:s,height:c}=de(e),l=e.breadcrumbs&&t.length>0,d=r.map((v,S)=>({name:v.name,color:ne(e,S,v.color)})),m=ue(e,d,s)+(l?20:0),h=Math.max(0,e.padding??2),f=e.sort??"desc",M=e.tiling??"squarify",$=e.labels??!0,g=[],w=[],R=v=>{for(let S of v)S.children?.length?R(S.children):w.push(De(S))};R(r);let k=e.colorScale?Pt(e.colorScale,w,ne(e,0),void 0,o):void 0,T=(v,S,L,E,z,O,H)=>{let b=v.reduce((y,B)=>y+Math.max(0,De(B)),0),x=sr(v,f).map(y=>{let B=De(y),Y=!((y.children?.length??0)>0)&&k?k.color(B):void 0;return{node:y,value:B,color:Y?.fill??y.color??O??ne(e,v.indexOf(y)),opacity:Y?.opacity,area:b>0?Math.max(0,B)/b*E*z:0}}).filter(y=>y.area>0&&!(O===void 0&&xe(e,y.node.name))),C=(y,[B,U,Y,j])=>{let I=`${y.node.name}: ${o(y.value)}`,G=(y.node.children?.length??0)>0;if(g.push({kind:"rect",part:G?"branch":"tile",x:i(B),y:i(U),width:i(Y),height:i(j),fill:y.color,opacity:G?.15:y.opacity,stroke:"var(--skdx-color-surface-default)",title:I,item:{label:I,id:tt(y.node),name:y.node.name,value:y.value}}),G)T(y.node.children,B+h,U+h,Math.max(0,Y-2*h),Math.max(0,j-2*h),y.color,H+1);else if($&&Y>40&&j>20){let V=Math.max(1,Math.floor((Y-12)/ie)),Q=y.node.name.length>V?`${y.node.name.slice(0,V-1)}\u2026`:y.node.name;g.push(J(i(B+6),i(U+6),Q,{baseline:"hanging",fill:"var(--skdx-color-text-on-accent)"}))}};M==="squarify"?Io(x,S,L,E,z,C):fl(x,S,L,E,z,C,M==="slice"||M==="sliceDice"&&H%2===0)};T(r,0,m,s,c-m,void 0,0),l&&g.push(...lr(t,8,ue(e,d,s)+10));let D=he(e,s,c,d);return{...D,shapes:ft([...g,...D.shapes])}}function lr(e,n,t){let r=[],a=n;return e.forEach((o,s)=>{s>0&&(r.push(J(i(a),t,"\u203A",{part:"breadcrumb-separator",baseline:"middle"})),a+=ie+6),r.push(J(i(a),t,o.name,{part:"breadcrumb",baseline:"middle",fill:"var(--skdx-color-text-default)",title:o.name,item:{label:o.name,id:tt(o),name:o.name}})),a+=o.name.length*ie+6}),r}var pl=.22,bl=20,Zs=32,Us=28,gl=e=>P(e.open)&&P(e.high)&&P(e.low)&&P(e.close);function Ao(e){let n=[],t=e.data.filter(N=>gl(N)?!0:(n.push({code:"invalid-value",severity:"warning",message:`Candle "${String(N.label)}" has a non-finite open/high/low/close and was dropped.`,itemId:N.id}),!1)),r=le(e,t.length===0);if(r)return{...r,issues:n};let a=e.upColor??K.positive,o=e.downColor??K.negative,s=ae(e.format),c=ae(e.volumeFormat??{style:"integer"}),l=t.length,d=Math.max(0,Math.min(l-2,Math.floor(e.zoom?.start??0))),m=e.zoom?Math.max(d+2,Math.min(l,Math.ceil(e.zoom.end))):l,h={start:d,end:m},f=t.slice(d,m),M=t.some(N=>P(N.volume)),{width:$,height:g}=de(e),w=e.brush?Zs+Us:0,R=e.rangeSelector??[],k=e.compare?f[0].close:void 0,T=N=>k!==void 0&&k!==0?N/k-1:N,D=k!==void 0?{style:"percent",digits:1}:void 0,v=ae({style:"percent",digits:1}),S=t.map(N=>N.close),L=(e.overlays??[]).map((N,F)=>{let _=N.name??`${N.type.toUpperCase()} ${N.period}`,W=N.type==="ema"?Ts(S,N.period):Ma(S,N.period);return{name:_,color:N.color??ne(e,F+2),values:W.slice(d,m),hidden:xe(e,_)}}),E=Gt([...f.flatMap(N=>[T(N.low),T(N.high)]),...L.filter(N=>!N.hidden).flatMap(N=>N.values.map(F=>P(F)?T(F):F))],!1),z=[{name:"Up",color:a},{name:"Down",color:o},...L.map(N=>({name:N.name,color:N.color}))],O=Te($,g,{...fe,top:fe.top+ue(e,z,$)+(R.length?bl:0),bottom:fe.bottom+w,left:e.scale==="log"?fe.left:jr(E,ae(D??e.yAxis?.format??e.format))}),H=M?O.height*pl:0,b={...O,height:Math.max(0,O.height-H-(M?8:0))},x=Ge(E,[b.y+b.height,b.y],{scale:e.scale==="log"?"log":"linear",format:D??e.yAxis?.format},e.format),C=f.map(N=>qe(N.label)),y=e.xAxis?.type==="time"&&C.every(N=>Number.isFinite(N)),B=je(f.length,[b.x,b.x+b.width]),U;if(y){let N=[...C].sort((be,Z)=>be-Z),F=1/0;for(let be=1;be<N.length;be++)F=Math.min(F,N[be]-N[be-1]);let[_,W]=we(C),ee=F===1/0?Math.max(1,Math.abs(W)*.05||1):F/2,te=st([_-ee,W+ee],[b.x,b.x+b.width]),re=Math.abs(te(_+(F===1/0?ee:F))-te(_))*.8;B={step:re,bandwidth:re,start:be=>te(C[be])-re/2,center:be=>te(C[be])};let me=e.xAxis?.format??{style:"date"};U=Qn(_-ee,W+ee).filter(be=>be>=_-ee&&be<=W+ee).map(be=>({pos:i(te(be)),label:Qt(be,me)}))}let Y=f.map(N=>Qt(N.label,e.xAxis?.format)),j=he(e,$,g,z),I={...j,plot:b,xTicks:Ne(U??f.map((N,F)=>({pos:i(B.center(F)),label:Y[F]})),b.width),yTicks:x.ticks,baseline:b.y+b.height},G=Ze(I),V={plot:b,x:N=>{let F=typeof N=="string"?N:qe(N),_=f.findIndex((W,ee)=>typeof F=="string"?Y[ee]===F||W.label===F:qe(W.label)===F);return _<0?void 0:B.center(_)},y:N=>x.scale(T(N))};G.push(...Wt(e.references,V)),R.forEach((N,F)=>{let _=N.candles>0?{start:Math.max(0,l-N.candles),end:l}:{start:0,end:l},W=_.start===d&&_.end===m;G.push(J(i(b.x+F*40),i(O.y-8),N.label,{part:"range-button",baseline:"middle",fill:W?"var(--skdx-color-text-default)":K.label,weight:W?"bold":void 0,title:`${N.label}: last ${N.candles>0?Math.min(N.candles,l):l} candles`,item:{label:N.label,name:N.label,range:_}}))});let Q=e.variant==="ohlc",p=[];if(f.forEach((N,F)=>{let W=N.close>=N.open?a:o,ee=i(B.center(F)),te=k!==void 0?` (${v(T(N.close))})`:"",re=`${Y[F]}: O ${s(N.open)} H ${s(N.high)} L ${s(N.low)} C ${s(N.close)}${te}${P(N.volume)?` V ${c(N.volume)}`:""}`,me={label:re,id:N.id,category:Y[F],index:d+F,value:N.close};p.push([Y[F],`Open: ${s(N.open)}`,`High: ${s(N.high)}`,`Low: ${s(N.low)}`,`Close: ${s(N.close)}${te}`,...P(N.volume)?[`Volume: ${c(N.volume)}`]:[],...L.filter(oe=>!oe.hidden).map(oe=>`${oe.name}: ${P(oe.values[F])?s(oe.values[F]):"\u2014"}`)]);let be=x.scale(T(Math.max(N.open,N.close))),Z=x.scale(T(Math.min(N.open,N.close)));if(Q){let oe=B.bandwidth/2;G.push({kind:"line",part:"wick",x1:ee,x2:ee,y1:i(x.scale(T(N.high))),y2:i(x.scale(T(N.low))),stroke:W,strokeWidth:1.5,title:re,item:me},{kind:"line",part:"open",x1:i(ee-oe),x2:ee,y1:i(x.scale(T(N.open))),y2:i(x.scale(T(N.open))),stroke:W,strokeWidth:1.5},{kind:"line",part:"close",x1:ee,x2:i(ee+oe),y1:i(x.scale(T(N.close))),y2:i(x.scale(T(N.close))),stroke:W,strokeWidth:1.5})}else G.push({kind:"line",part:"wick",x1:ee,x2:ee,y1:i(x.scale(T(N.high))),y2:i(x.scale(T(N.low))),stroke:W,title:re},{kind:"rect",part:"candle",x:i(B.start(F)),y:i(be),width:i(B.bandwidth),height:i(Math.max(1,Z-be)),fill:W,title:re,item:me})}),M){let N=b.y+b.height+8,[,F]=we(f.map(_=>_.volume));f.forEach((_,W)=>{if(!P(_.volume))return;let ee=F>0?_.volume/F*H:0;G.push({kind:"rect",part:"volume",x:i(B.start(W)),y:i(N+H-ee),width:i(B.bandwidth),height:i(Math.max(ee,0)),fill:_.close>=_.open?a:o,opacity:.4,title:`${Y[W]}: volume ${c(_.volume)}`})})}for(let N of L){if(N.hidden)continue;let F=N.values.flatMap((_,W)=>P(_)?[{x:i(B.center(W)),y:i(x.scale(T(_)))}]:[]);F.length<2||G.push({kind:"path",part:"overlay",d:it(F),stroke:N.color,strokeWidth:1.5,strokeLinejoin:"round",title:N.name,item:{label:N.name,series:N.name}})}for(let N of e.flags??[]){let F=V.x(N.label);if(F===void 0)continue;let _=f.findIndex((re,me)=>B.center(me)===F),W=f[_],ee=x.scale(T(W.high))-6,te=Bt(N.variant??"primary");G.push({kind:"path",part:"flag",d:`M${i(F)} ${i(ee)}V${i(ee-10)}H${i(F+8)}L${i(F+5)} ${i(ee-7)}L${i(F+8)} ${i(ee-4)}H${i(F)}Z`,fill:te,stroke:te,title:N.text,item:{label:N.text,name:N.text,category:Y[_],index:d+_}})}G.push(...Dn(e.annotations,V));let q={plot:O,xs:f.map((N,F)=>i(B.center(F))),rows:p,count:l,zoom:h,crosshair:Hr(e)};if(e.brush){let N={x:O.x,y:O.y+O.height+Us,width:O.width,height:Zs},F=t.map(me=>me.close),[_,W]=we(F),ee=l>1?N.width/(l-1):0,te=F.map((me,be)=>({x:i(N.x+be*ee),y:i(N.y+N.height-(W===_?.5:(me-_)/(W-_))*(N.height-4)-2)})),re={x:i(N.x+d/l*N.width),y:N.y,width:i((m-d)/l*N.width),height:N.height};G.push({kind:"rect",part:"brush",...N,fill:"var(--skdx-color-surface-sunken)",stroke:K.grid},{kind:"path",part:"brush-series",d:te.length>1?`${it(te)}L${te[te.length-1]?.x} ${N.y+N.height}L${te[0]?.x} ${N.y+N.height}Z`:"",fill:"var(--skdx-color-primary-500)",fillOpacity:.3},{kind:"rect",part:"brush-window",...re,fill:"var(--skdx-color-primary-500)",opacity:.15,stroke:K.axis},{kind:"rect",part:"brush-handle",x:i(re.x-3),y:N.y+8,width:6,height:N.height-16,fill:K.axis,rx:8},{kind:"rect",part:"brush-handle",x:i(re.x+re.width-3),y:N.y+8,width:6,height:N.height-16,fill:K.axis,rx:8}),q.brush={box:N,window:re}}return{...j,shapes:[...G,...j.shapes],hit:q,issues:n}}var xl="var(--skdx-color-success-500)",yl="var(--skdx-color-danger-500)";function Co(e){let n=[],t=e.data.filter(L=>L.type==="subtotal"||L.type==="total"||L.subtotal||P(L.value)?!0:(n.push({code:"invalid-value",severity:"warning",message:`Row "${L.name}" has no valid value and was dropped.`,itemId:L.id??L.name}),!1)),r=le(e,t.length===0);if(r)return{...r,issues:n};let a=ae(e.format),{width:o,height:s}=de(e),c=e.orientation==="horizontal",l=e.positiveColor??xl,d=e.negativeColor??yl,m=e.totalColor??ne(e,0),h=[],f=P(e.start)?e.start:0,M=L=>`${L>=0?"+":""}${a(L)}`;P(e.start)&&e.startLabel!==void 0&&h.push({id:void 0,name:e.startLabel,from:0,to:f,color:m,title:`${e.startLabel}: ${a(f)}`,flat:!0});for(let L of t){if((L.type??(L.subtotal?"subtotal":"change"))!=="change"){h.push({id:L.id,name:L.name,from:0,to:f,color:L.color??m,title:`${L.name}: ${a(f)}`,flat:!0});continue}let z=f;f+=L.value,h.push({id:L.id,name:L.name,from:z,to:f,color:L.color??(L.value>=0?l:d),title:`${L.name}: ${M(L.value)}`,flat:!1})}e.total!==void 0&&h.push({id:void 0,name:e.total,from:0,to:f,color:m,title:`${e.total}: ${a(f)}`,flat:!0});let $=c?Math.max(0,...h.map(L=>L.name.length))*ie+16:0,g=[{name:"Increase",color:l},{name:"Decrease",color:d}],w=Te(o,s,{...fe,top:fe.top+ue(e,g,o),left:Math.max(fe.left,$),right:e.labels&&c?56:fe.right}),R=h.flatMap(L=>[L.from,L.to]),k=Ge([Math.min(0,...R),Math.max(0,...R)],c?[w.x,w.x+w.width]:[w.y+w.height,w.y],{},e.format),T=je(h.length,c?[w.y,w.y+w.height]:[w.x,w.x+w.width]),D=he(e,o,s,g),v=h.map((L,E)=>({pos:i(T.center(E)),label:L.name})),S=Ze({...D,plot:w,xTicks:c?v:Ne(v,w.width),yTicks:c?Ne(k.ticks,w.width):k.ticks,baseline:k.zero},{horizontal:c});return h.forEach((L,E)=>{let z=k.scale(L.from),O=k.scale(L.to),H=Math.min(z,O),b=Math.max(1,Math.abs(O-z));if(S.push({kind:"rect",part:"bar",x:i(c?H:T.start(E)),y:i(c?T.start(E):H),width:i(c?b:T.bandwidth),height:i(c?T.bandwidth:b),fill:L.color,title:L.title,item:{label:L.title,id:L.id??L.name,name:L.name,index:E,value:L.flat?L.to:L.to-L.from}}),e.labels){let C=L.flat?a(L.to):M(L.to-L.from),y=Math.max(z,O);S.push(c?J(i(y+6),i(T.center(E)),C,{part:"value-label",baseline:"middle"}):J(i(T.center(E)),i(H-4),C,{part:"value-label",anchor:"middle"}))}let x=h[E+1];if(x&&(e.connectors??!0)){let C=i(O),y=i(k.scale(x.flat?x.to:x.from));S.push(c?{kind:"line",part:"connector",x1:C,x2:y,y1:i(T.start(E)+T.bandwidth),y2:i(T.start(E+1)),stroke:K.axis,dash:"4 3"}:{kind:"line",part:"connector",x1:i(T.start(E)+T.bandwidth),x2:i(T.start(E+1)),y1:C,y2:y,stroke:K.axis,dash:"4 3"})}}),{...D,shapes:[...S,...D.shapes],issues:n}}function vl(e){let n=new Map;for(let l of e)l.id!==void 0&&!n.has(l.id)&&n.set(l.id,l),n.has(l.name)||n.set(l.name,l);let t=new Map,r=new Set,a=l=>{let d=t.get(l);if(d)return d;if(r.has(l))return{length:0,next:void 0};r.add(l);let m={length:0,next:void 0};for(let f of l.dependsOn??[]){let M=n.get(f);if(!M||M===l)continue;let $=a(M);$.length>m.length&&(m={length:$.length,next:M})}r.delete(l);let h={length:m.length+Math.max(0,l.end-l.start),next:m.next};return t.set(l,h),h},o,s=-1;for(let l of e){let d=a(l);d.length>s&&(s=d.length,o=l)}let c=new Set;for(let l=o;l&&!c.has(l);l=t.get(l)?.next)c.add(l);return c}function Oo(e){let n=[],t=e.tasks.filter(p=>{let q=P(p.start)&&(p.milestone?!0:P(p.end));return q?!p.milestone&&p.end<p.start&&n.push({code:"inverted-range",severity:"warning",message:`Task "${p.name}" ends before it starts; the interval was normalized.`,itemId:p.id??p.name}):n.push({code:"invalid-value",severity:"warning",message:`Task "${p.name}" has no valid start/end and was dropped.`,itemId:p.id??p.name}),q}),r=le(e,t.length===0);if(r)return{...r,issues:n};let{width:a,height:o}=de(e),s=e.criticalPath?vl(t):void 0,c=p=>p.id??p.name,l=new Map;for(let p of t)p.id!==void 0&&!l.has(p.id)&&l.set(p.id,p),l.has(p.name)||l.set(p.name,p);let d=new Map,m=[];for(let p of t){let q=p.parent===void 0?void 0:l.get(p.parent);q&&q!==p?d.set(q,[...d.get(q)??[],p]):m.push(p)}let h=new Set(e.collapsed??[]),f=p=>h.has(c(p))||h.has(p.name),M=[],$=(p,q,N)=>{if(!N.has(p)&&(N.add(p),M.push({task:p,depth:q}),!f(p)))for(let F of d.get(p)??[])$(F,q+1,N)},g=new Set;for(let p of m)$(p,0,g);let w=M.map(p=>p.task),R=new Map(M.map(p=>[p.task,p.depth])),k=p=>{let q=d.get(p)??[];if(q.length===0||P(p.end)&&p.end!==p.start)return{start:p.start,end:p.end};let N=q.map(k);return{start:Math.min(...N.map(F=>F.start)),end:Math.max(...N.map(F=>F.end))}},T=[...new Set(w.map(p=>p.group??p.name))],D=new Map;for(let p of w){let q=p.group??p.name;D.has(q)||D.set(q,R.get(p)??0)}let v=p=>w.some(q=>(q.group??q.name)===p&&f(q)&&(d.get(q)?.length??0)>0)?" +":"",S=Math.max(0,...T.map(p=>p.length+v(p).length))*ie+Math.max(0,...T.map(p=>(D.get(p)??0)*12)),L=e.tasks.map((p,q)=>({name:p.name,color:ne(e,q,p.color)})),E=Te(a,o,{top:8+ue(e,L,a),right:16,bottom:32+(e.xAxis?.label?14:0),left:Math.min(a/2,Math.max(64,S+16))}),z=ae(e.xAxis?.format??e.format),O=e.today===void 0?void 0:qe(e.today),[H,b]=we([...w.flatMap(p=>{let q=k(p);return[...p.milestone?[p.start]:[q.start,q.end],...p.baseline?[p.baseline.start,p.baseline.end]:[]]}),...O!==void 0?[O]:[]]),x=Ge([H,b],[E.x,E.x+E.width],{ticks:e.xAxis?.ticks,format:e.xAxis?.format},e.format),C=je(T.length,[E.y,E.y+E.height]),y=[],B=[],U=p=>x.domain[0]+(p-E.x)/Math.max(1,E.width)*(x.domain[1]-x.domain[0]);for(let p of Ne(x.ticks,E.width))y.push({kind:"line",part:"grid",x1:p.pos,x2:p.pos,y1:E.y,y2:E.y+E.height,stroke:K.grid}),y.push(J(p.pos,E.y+E.height+20,p.label,{part:"x-label",anchor:tr(p.pos,p.label,a)}));T.forEach((p,q)=>{let N=w.find(F=>(F.group??F.name)===p);y.push(J(E.x-8,i(C.center(q)),`${p}${v(p)}`,{part:"y-label",anchor:"end",baseline:"middle",item:N&&(d.get(N)?.length??0)>0?{label:p,id:c(N),name:N.name}:void 0}))});for(let p of y){if(p.kind!=="text"||p.part!=="y-label")continue;let q=D.get(p.text.replace(/ \+$/,""))??0;q&&(p.x=i(p.x+q*12))}let Y=864e5;if(e.nonWorkingDays?.length&&b-H<=400*Y&&b>H){let p=new Set(e.nonWorkingDays);for(let q=Math.floor(H/Y)*Y;q<b;q+=Y){if(!p.has(new Date(q).getUTCDay()))continue;let N=Math.max(H,q),F=Math.min(b,q+Y);F<=N||y.push({kind:"rect",part:"non-working",x:i(x.scale(N)),y:E.y,width:i(Math.max(0,x.scale(F)-x.scale(N))),height:E.height,fill:K.grid,opacity:.12})}}e.xAxis?.label&&y.push(J(i(E.x+E.width/2),o-4,e.xAxis.label,{part:"axis-title",anchor:"middle"}));let j={plot:E,x:p=>x.scale(qe(p)),y:p=>C.center(p)};y.push(...Wt([...e.references??[],...O!==void 0?[{x:O,label:"Today",variant:"primary"}]:[]],j));let I=new Map,G=[];w.forEach(p=>{if(xe(e,p.name))return;let q=t.indexOf(p),N=T.indexOf(p.group??p.name),F=k(p),_=x.scale(Math.min(F.start,F.end)),W=p.milestone?_:x.scale(Math.max(F.start,F.end)),ee=(d.get(p)?.length??0)>0;if(p.baseline&&!p.milestone){let ke=x.scale(Math.min(p.baseline.start,p.baseline.end)),Be=x.scale(Math.max(p.baseline.start,p.baseline.end));y.push({kind:"rect",part:"baseline",x:i(ke),y:i(C.start(N)+C.bandwidth*.75),width:i(Math.max(1,Be-ke)),height:i(C.bandwidth/4),fill:K.axis,opacity:.6,rx:1,title:`${p.name} planned: ${z(p.baseline.start)} \u2013 ${z(p.baseline.end)}`})}let te=C.center(N),re=ne(e,q,p.color),me=s&&!s.has(p)?.35:void 0;if(I.has(p.name)||I.set(p.name,{x0:_,x1:W,mid:te}),p.id!==void 0&&!I.has(p.id)&&I.set(p.id,{x0:_,x1:W,mid:te}),p.milestone){let ke=C.bandwidth/2,Be=`${p.name}: ${z(p.start)}`;y.push({kind:"path",part:"milestone",d:`M${i(_)} ${i(te-ke)}L${i(_+ke)} ${i(te)}L${i(_)} ${i(te+ke)}L${i(_-ke)} ${i(te)}Z`,fill:re,opacity:me,title:Be,item:{label:Be,id:p.id,name:p.name,category:p.group,index:q,value:p.start}});return}let be=P(p.progress)?Math.max(0,Math.min(1,p.progress)):void 0,Z=`${p.name}: ${z(F.start)} \u2013 ${z(F.end)}${be!==void 0?` \xB7 ${Math.round(be*100)}% done`:""}`;ee||B.push({index:y.length,id:p.id??p.name,name:p.name,start:Math.min(p.start,p.end),end:Math.max(p.start,p.end),x0:i(_),x1:i(W),y:i(C.start(N)),height:i(C.bandwidth)});let oe=p.baseline?C.bandwidth*.7:C.bandwidth;y.push({kind:"rect",part:ee?"summary":"bar",x:i(_),y:i(C.start(N)),width:i(Math.max(1,W-_)),height:i(ee?C.bandwidth/3:oe),fill:re,rx:2,opacity:me,title:Z,item:{label:Z,id:p.id,name:p.name,category:p.group,index:q,value:Math.abs(p.end-p.start)}}),be!==void 0&&be>0&&G.push({kind:"rect",part:"progress",x:i(_),y:i(te-C.bandwidth/4),width:i(Math.max(1,(W-_)*be)),height:i(C.bandwidth/2),fill:"var(--skdx-color-text-default)",opacity:.35,rx:1})});let V=new Map;for(let p of t)p.id!==void 0&&!V.has(p.id)&&V.set(p.id,p),V.has(p.name)||V.set(p.name,p);for(let p of t)for(let q of p.dependsOn??[]){let N=I.get(q),F=I.get(p.id??p.name);if(!N){n.push({code:"unknown-node",severity:"warning",message:`Task "${p.name}" depends on "${String(q)}", which does not exist.`,itemId:p.id??p.name});continue}if(!F||N===F)continue;let _=Math.max(N.x1+6,F.x0-6),W=V.get(q),ee=s&&W&&s.has(W)&&s.has(p),te=`${W?.name??String(q)} \u2192 ${p.name}`;G.push({kind:"path",part:"dependency",d:`M${i(N.x1)} ${i(N.mid)}H${i(_)}V${i(F.mid)}H${i(F.x0)}`,stroke:ee?"var(--skdx-color-danger-500)":K.axis,strokeWidth:ee?2.5:1.5,opacity:s&&!ee?.35:void 0,title:te,item:{label:te,name:W?.name??String(q),category:p.name}})}y.push(...G,...Dn(e.annotations,j));let Q=he(e,a,o,L);return{...Q,shapes:[...y,...Q.shapes],issues:n,edit:{scale:p=>x.scale(p),invert:U,bars:B}}}var Lo=e=>{let n=e.length;return n===0?0:n%2?e[(n-1)/2]:(e[n/2-1]+e[n/2])/2},Ml=(e,n)=>{if(e.length===0)return 0;let t=(e.length-1)*n,r=Math.floor(t),a=Math.ceil(t),o=e[r],s=e[a];return o+(s-o)*(t-r)},wl=(e,n)=>{let t=e.length;if(t===0)return 0;let r=(t+1)*n-1;if(r<=0)return e[0];if(r>=t-1)return e[t-1];let a=Math.floor(r),o=e[a],s=e[a+1];return o+(s-o)*(r-a)};function kl(e,n="linear"){let t=Lo(e),r=e.length;if(r===0)return{q1:0,median:0,q3:0};if(n==="tukey"){let o=Math.floor(r/2),s=e.slice(0,r%2?o+1:o),c=e.slice((r%2,o));return{q1:Lo(s),median:t,q3:Lo(c)}}let a=n==="exclusive"?wl:Ml;return{q1:a(e,.25),median:t,q3:a(e,.75)}}function $l(e,n="linear",t=1.5){let r=Ve(e).sort(($,g)=>$-g),{q1:a,median:o,q3:s}=kl(r,n),c=s-a,l=a-t*c,d=s+t*c,m=r.filter($=>$>=l&&$<=d),h=r.length?r.reduce(($,g)=>$+g,0)/r.length:0,f=m[0]??a,M=m[m.length-1]??s;return{name:"",q1:a,median:o,q3:s,min:f,max:M,low:f,high:M,mean:h,outliers:r.filter($=>$<l||$>d),count:r.length}}var Ys=e=>"median"in e&&!("data"in e),Ks=e=>"data"in e&&Array.isArray(e.data[0]);function So(e){let n=e.quartileMethod??"linear",t=e.whisker??1.5,r=[],a=e.categories,o=a!==void 0,s=(y,B)=>r.push({code:"invalid-value",severity:"warning",message:B,itemId:y.id??y.name}),c=[];e.series.forEach((y,B)=>{let U=ne(e,B,y.color),Y=(j,I,G)=>{let V=G??(I&&Ve(I).length?$l(I,n,t):void 0);return!V||![V.min,V.q1,V.median,V.q3,V.max].every(P)?!1:(V.count!==void 0&&V.count<5&&r.push({code:"small-sample",severity:"warning",message:`Series "${y.name}"${o?` at "${a[j]??j}"`:""} has ${V.count} observation${V.count===1?"":"s"}; quartiles are not meaningful below 5.`,itemId:y.id??y.name}),c.push({si:B,ci:j,name:y.name,id:y.id,color:U,st:{...V,name:y.name},raw:I}),!0)};if(!o){(Ys(y)?Y(0,void 0,y):Ks(y)?Y(0,y.data.flat()):Y(0,y.data))||s(y,`Series "${y.name}" has no valid observations or summary and was skipped.`);return}if(Ys(y)){s(y,`Series "${y.name}" is a summary, which cannot be grouped by categories; it was skipped.`);return}if(!Ks(y)){s(y,`Series "${y.name}" is not grouped (its data is one sample, not one per category); it was drawn in the first category.`),Y(0,y.data);return}a.forEach((j,I)=>Y(I,y.data[I]))});let l=le(e,c.length===0);if(l)return{...l,issues:r};let d=ae(e.yAxis?.format??e.format),{width:m,height:h}=de(e),f=e.orientation==="horizontal",M=o?a:e.series.map(y=>y.name),$=Math.max(0,...M.map(y=>y.length))*ie,g=e.series.map((y,B)=>({name:y.name,color:ne(e,B,y.color)})),w=Te(m,h,{...fe,top:fe.top+ue(e,g,m)+(e.yAxis?.label?12:0),left:f?Math.max(fe.left,$+16):fe.left,bottom:fe.bottom+(f&&e.yAxis?.label?14:0)}),R=c.filter(y=>!xe(e,y.name)),k=R.flatMap(y=>[y.st.min,y.st.max,...y.st.outliers??[],...P(y.st.mean)?[y.st.mean]:[]]),T=Ge(Gt(k,!1),f?[w.x,w.x+w.width]:[w.y+w.height,w.y],e.yAxis??{},e.format),D=je(M.length,f?[w.y,w.y+w.height]:[w.x,w.x+w.width]),v=o?[...new Set(R.map(y=>y.si))]:[],S=o?D.bandwidth/Math.max(1,v.length):D.bandwidth,L=y=>o?D.start(y.ci)+(v.indexOf(y.si)+.5)*S:D.center(y.si),E=he(e,m,h,g),z=M.map((y,B)=>({pos:i(D.center(B)),label:y})),O=Ze({...E,plot:w,xTicks:f?z:Ne(z,w.width),yTicks:f?Ne(T.ticks,w.width):T.ticks,baseline:f?w.x:w.y+w.height},{horizontal:f,grid:En(e.yAxis),...f?{xLabel:e.yAxis?.label}:{yLabel:e.yAxis?.label}}),H=(y,B,U)=>{let Y=i(T.scale(y)),j=i(T.scale(B));return f?{x1:Y,x2:j,y1:U,y2:U}:{x1:U,x2:U,y1:Y,y2:j}},b=(y,B,U,Y)=>{let j=T.scale(y),I=T.scale(B),G=Math.max(1,Math.abs(I-j));return f?{x:i(Math.min(j,I)),y:i(U-Y/2),width:i(G),height:i(Y)}:{x:i(U-Y/2),y:i(Math.min(j,I)),width:i(Y),height:i(G)}},x=(y,B)=>f?`${i(T.scale(y))} ${i(B)}`:`${i(B)} ${i(T.scale(y))}`,C=(y,B,U,Y,j,I,G)=>({kind:"circle",part:j,cx:f?i(T.scale(y)):i(B),cy:f?i(B):i(T.scale(y)),r:U,fill:Y,opacity:G,title:I});for(let y of R){let{st:B,color:U,name:Y,raw:j}=y,I=i(L(y)),G=o?a[y.ci]:void 0,V=G!==void 0?`${Y}, ${G}`:Y,Q=`${V}: min ${d(B.min)} Q1 ${d(B.q1)} median ${d(B.median)} Q3 ${d(B.q3)} max ${d(B.max)}${e.mean&&P(B.mean)?` mean ${d(B.mean)}`:""}`,p={label:Q,id:y.id,series:Y,seriesId:y.id??Y,category:G,index:o?y.ci:y.si,value:B.median},q=S*.6,N=q/2,F=f?{x1:i(T.scale(B.median)),x2:i(T.scale(B.median)),y1:i(I-N),y2:i(I+N)}:{x1:i(I-N),x2:i(I+N),y1:i(T.scale(B.median)),y2:i(T.scale(B.median))},_=B.count,W=e.notched&&_?Math.min(1.58*(B.q3-B.q1)/Math.sqrt(_),(B.q3-B.q1)/2):0,ee=W?{kind:"path",part:"box",d:`M${[x(B.q1,I-N),x(B.median-W,I-N),x(B.median,I-N+q/4),x(B.median+W,I-N),x(B.q3,I-N),x(B.q3,I+N),x(B.median+W,I+N),x(B.median,I+N-q/4),x(B.median-W,I+N),x(B.q1,I+N)].join("L")}Z`,fill:U,stroke:U,fillOpacity:.5,title:Q,item:p}:{kind:"rect",part:"box",...b(B.q1,B.q3,I,q),fill:U,stroke:U,opacity:.5,title:Q,item:p};if(O.push({kind:"line",part:"whisker",...H(B.max,B.min,I),stroke:U,title:Q},ee,{kind:"line",part:"median",...F,stroke:U,title:Q},...(B.outliers??[]).map(te=>C(te,I,3,U,"outlier",`${V}: ${d(te)}`))),e.mean&&P(B.mean)){let te=f?i(T.scale(B.mean)):I,re=f?I:i(T.scale(B.mean));O.push({kind:"path",part:"mean",d:`M${te} ${i(re-4)}L${i(te+4)} ${re}L${te} ${i(re+4)}L${i(te-4)} ${re}Z`,fill:"var(--skdx-color-text-default)",title:`${V} mean: ${d(B.mean)}`})}e.points&&j&&Ve(j).forEach((te,re)=>{let me=(re*7919%97/96-.5)*q*.8;O.push(C(te,I+me,2,U,"observation",`${V}: ${d(te)}`,.6))})}return{...E,shapes:[...O,...E.shapes],issues:r}}var zo=e=>e*Math.PI/180;function No(e){let{nodes:n,path:t}=$n(e.data,e.rootId),r=fn(n,e.maxDepth),a=le(e,!r.some(x=>De(x)>0),300,300);if(a)return a;let o=ae(e.format),{width:s,height:c}=de(e,300,300),l=Math.min(.9,Math.max(0,e.innerRadius??0)),d=e.breadcrumbs&&t.length>0,m=d&&l===0,h=r.map((x,C)=>({name:x.name,color:ne(e,C,x.color)})),f=ue(e,h,s)+(m?20:0),M=s/2,$=f+(c-f)/2,g=Math.max(0,Math.min(s,c-f)/2-8),w=g*l,R=(g-w)/Math.max(1,zr(r)),k=zo(e.startAngle??0),T=zo(e.endAngle??(e.startAngle??0)+360),D=Math.max(0,zo(e.padAngle??0)),v=e.sort??"none",S=[],L=x=>{for(let C of x)C.children?.length?L(C.children):S.push(De(C))};L(r);let E=e.colorScale?Pt(e.colorScale,S,ne(e,0),void 0,o):void 0,z=[],O=[],H=(x,C,y,B,U)=>{let Y=p=>C===0&&xe(e,p.name)?0:Math.max(0,De(p)),j=sr(x,v),I=j.reduce((p,q)=>p+Y(q),0),G=Math.max(0,j.filter(p=>Y(p)>0).length-1),V=Math.max(0,B-G*D),Q=y;j.forEach(p=>{let q=Y(p),N=I>0?q/I*V:0,_=!((p.children?.length??0)>0)&&E?E.color(q):void 0,W=_?.fill??p.color??U??ne(e,x.indexOf(p));if(N>0){let ee=w+R*C,te=ee+R;if(e.labels&&N*((ee+te)/2)>p.name.length*ie+4){let me=Q+N/2,be=(ee+te)/2;O.push(J(i(M+be*Math.sin(me)),i($-be*Math.cos(me)),p.name,{part:"arc-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))}let re=`${p.name}: ${o(q)}`;z.push({kind:"path",part:"arc",d:Ke(M,$,te,ee,Q,Q+N),fill:W,opacity:_?_.opacity:1-C*.2,stroke:"var(--skdx-color-surface-default)",title:re,item:{label:re,id:tt(p),name:p.name,value:q}}),H(p.children??[],C+1,Q,N,W),Q+=N+D}})};if(H(r,0,k,Math.max(0,Math.min(2*Math.PI,T-k)),void 0),e.centerLabel&&O.push(J(i(M),i(d&&!m?$-8:$),e.centerLabel,{part:"center-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)",weight:"bold"})),d){let x=t.reduce((C,y)=>C+y.name.length*ie+6,0)+(t.length-1)*(ie+6);O.push(...m?lr(t,8,ue(e,h,s)+10):lr(t,M-x/2,e.centerLabel?$+8:$))}let b=he(e,s,c,h);return{...b,shapes:ft([...z,...O,...b.shapes])}}var Il=2*Math.PI,Tl=12,Nr=5;function Al(e){let n=[];if(e.links){let a=[...e.names??[]],o=new Set(a);for(let l of e.links)for(let d of[l.source,l.target])o.has(d)||(e.names&&n.push({code:"unknown-node",severity:"warning",message:`Link ${l.source} \u2192 ${l.target} names "${d}", which is not in \`names\`; it was added.`,itemId:l.id}),o.add(d),a.push(d));let s=new Map(a.map((l,d)=>[l,d])),c=a.map(()=>a.map(()=>0));for(let l of e.links){if(!P(l.value)||l.value<0){n.push({code:"invalid-value",severity:"warning",message:`Link ${l.source} \u2192 ${l.target} has no valid value and was dropped.`,itemId:l.id});continue}let d=c[s.get(l.source)];d[s.get(l.target)]=d[s.get(l.target)]+l.value}return{names:a,matrix:c,issues:n}}let t=e.names??[],r=e.matrix??[];return(r.length!==t.length||r.some(a=>a.length!==t.length))&&n.push({code:"ragged-matrix",severity:"warning",message:`The matrix is ${r.length} \xD7 ${r[0]?.length??0} but there are ${t.length} names; missing cells count as zero.`}),{names:t,matrix:r,issues:n}}function Ro(e){let{names:n,matrix:t,issues:r}=Al(e),a=le(e,n.length===0||!t.some(j=>j.some(I=>P(I)&&I>0)),300,300);if(a)return{...a,issues:r};let o=ae(e.format),{width:s,height:c}=de(e,300,300),l=(j,I)=>{let G=t[j]?.[I];return P(G)?Math.max(0,G):0},d=j=>n.reduce((I,G,V)=>I+l(j,V)+l(V,j),0),m=n.map((j,I)=>I);e.sort&&m.sort((j,I)=>e.sort==="asc"?d(j)-d(I):d(I)-d(j));let h=m.map(j=>n[j]),f=j=>ne(e,m[j]),M=h.map((j,I)=>({name:j,color:f(I)})),$=ue(e,M,s),g=s/2,w=$+(c-$)/2,R=e.ticks?8+Nr+14:8,k=R+Math.max(0,...n.map(j=>j.length))*ie+4,T=Math.max(0,Math.min(s/2-k,(c-$)/2-36)),D=Math.max(0,T-Tl),v=(e.padding??2.3)*Math.PI/180,S=h.length,L=Yn(e.selected)[0],E=L===void 0?-1:h.indexOf(String(L)),z=(j,I)=>xe(e,h[j])||xe(e,h[I])?0:l(m[j],m[I]),O=h.map((j,I)=>h.reduce((G,V,Q)=>G+z(I,Q),0)),H=O.reduce((j,I)=>j+I,0),b=H>0?(Il-v*S)/H:0,x=(j,I)=>`${i(g+I*Math.sin(j))} ${i(w-I*Math.cos(j))}`,C=[],y=0;for(let j=0;j<S;j++){let I=y,G=h.map((V,Q)=>{let p=y;return y+=z(j,Q)*b,{a0:p,a1:y}});C.push({a0:I,a1:y,sub:G}),y+=v}let B=[],U=[];for(let j=0;j<S;j++)for(let I=j;I<S;I++){let G=z(j,I),V=z(I,j);if(G+V===0)continue;let Q=C[j].sub[I],p=C[I].sub[j],q=ee=>ee.a1-ee.a0>Math.PI?1:0,N=j===I?`M${x(Q.a0,D)}A${D} ${D} 0 ${q(Q)} 1 ${x(Q.a1,D)}Q${i(g)} ${i(w)} ${x(Q.a0,D)}Z`:`M${x(Q.a0,D)}A${D} ${D} 0 ${q(Q)} 1 ${x(Q.a1,D)}Q${i(g)} ${i(w)} ${x(p.a0,D)}A${D} ${D} 0 ${q(p)} 1 ${x(p.a1,D)}Q${i(g)} ${i(w)} ${x(Q.a0,D)}Z`,F=G>=V?j:I,_=E<0||j===E||I===E,W=j===I?`${h[j]}: ${o(G)}`:`${h[j]} \u2192 ${h[I]}: ${o(G)} \xB7 ${h[I]} \u2192 ${h[j]}: ${o(V)}`;B.push({kind:"path",part:"chord",d:N,fill:f(F),opacity:_?.5:.08,title:W,item:{label:W,id:`${h[j]}\u2192${h[I]}`,name:h[j],category:h[I],value:G+V}})}C.forEach((j,I)=>{if(j.a1<=j.a0)return;let G=`${h[I]}: ${o(O[I])}`;B.push({kind:"path",part:"group",d:Ke(g,w,T,D,j.a0,j.a1),fill:f(I),opacity:E<0||I===E||z(I,E)+z(E,I)>0?void 0:.3,title:G,item:{label:G,id:h[I],name:h[I],index:I,value:O[I]}});let V=(j.a0+j.a1)/2,Q=Math.sin(V),p=T+R;if(B.push(J(i(g+p*Q),i(w-p*Math.cos(V)),h[I],{anchor:Q>.1?"start":Q<-.1?"end":"middle",baseline:"middle"})),!e.ticks)return;let q=O[I];ht(0,q,4).filter(N=>N<=q).forEach((N,F)=>{let _=j.a0+N*b,W=Math.sin(_),ee=Math.cos(_);if(B.push({kind:"line",part:"tick",x1:i(g+T*W),y1:i(w-T*ee),x2:i(g+(T+Nr)*W),y2:i(w-(T+Nr)*ee),stroke:K.axis}),F%2)return;let te=i(g+(T+Nr+3)*W),re=i(w-(T+Nr+3)*ee);U.some(me=>Math.abs(me.x-te)<12&&Math.abs(me.y-re)<12)||(U.push({x:te,y:re}),B.push(J(te,re,o(N),{part:"tick-label",anchor:W>.1?"start":W<-.1?"end":"middle",baseline:"middle"})))})});let Y=he(e,s,c,M);return{...Y,shapes:[...B,...Y.shapes],issues:r}}var Vn=8,Eo=e=>e.geometry.type==="Polygon"?e.geometry.coordinates:e.geometry.type==="MultiPolygon"?e.geometry.coordinates.flat():[],Qs=e=>e.geometry.type==="Point"?[e.geometry.coordinates]:e.geometry.type==="MultiPoint"?e.geometry.coordinates:[],Js=e=>e.geometry.type==="LineString"?[e.geometry.coordinates]:e.geometry.type==="MultiLineString"?e.geometry.coordinates:[],Xs=e=>[...Eo(e).flat(),...Qs(e),...Js(e).flat()],Cl=e=>Math.log(Math.tan(Math.PI/4+Math.max(-85,Math.min(85,e))*Math.PI/360)),cr=e=>e!==void 0&&Number.isFinite(e[0])&&Number.isFinite(e[1]);function Do(e){let n=[],t=e.features.filter(p=>{let q=Xs(p).some(cr);return q||n.push({code:"invalid-geometry",severity:"warning",message:`Feature "${p.name}" has no valid coordinates and was dropped.`,itemId:p.id??p.name}),q}),r=le(e,t.length===0);if(r)return{...r,issues:n};let a=ae(e.format),{width:o,height:s}=de(e),c=ue(e),l=Bn(e.colorLegend).bottom,d=Bn(e.colorLegend).right,m=e.projection==="mercator"?Cl:p=>p,h=t.filter(p=>Eo(p).length>0),f=(h.length?h:t).flatMap(p=>Xs(p).filter(cr)),[M,$]=f.length?we(f.map(p=>p[0])):[0,1],[g,w]=f.length?we(f.map(p=>m(p[1]))):[0,1],R=Math.min((o-d-2*Vn)/Math.max(1e-9,$-M),(s-c-l-2*Vn)/Math.max(1e-9,w-g)),k={x:Vn,y:c+Vn,width:o-d-2*Vn,height:s-c-l-2*Vn},T=Math.max(1,Math.min(64,e.view?.zoom??1)),D=R*T,v=e.view?.center?[e.view.center[0],m(e.view.center[1])]:[(M+$)/2,(g+w)/2],S=k.x+k.width/2-v[0]*D,L=k.y+k.height/2+v[1]*D,E=([p,q])=>({x:i(S+p*D),y:i(L-m(q)*D)}),z=p=>{let{x:q,y:N}=E(p);return`${q} ${N}`},O=ne(e,0,e.color),H=Pt(e.colorScale,t.map(p=>p.value),O,void 0,a),b=[],x=h.map(p=>{let q=Eo(p);if(e.labels&&q.length){let _=q.reduce((me,be)=>be.length>me.length?be:me),[W,ee]=we(_.map(me=>me[0])),[te,re]=we(_.map(me=>m(me[1])));b.push(J(i(S+((W+ee)/2-M)*D),i(L+(w-(te+re)/2)*D),p.name,{part:"region-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)"}))}let N=p.color!==void 0?{fill:p.color,opacity:1}:H.color(p.value),F=`${p.name}${P(p.value)?`: ${a(p.value)}`:""}`;return{kind:"path",part:"region",d:q.map(_=>`M${_.filter(cr).map(z).join("L")}Z`).join(""),fill:N?.fill??K.grid,opacity:N?.opacity??.6,stroke:"var(--skdx-color-surface-default)",title:F,item:{label:F,id:p.id??p.name,name:p.name,value:p.value}}}),C=[...e.lines??[],...t.flatMap(p=>Js(p).map(q=>({id:p.id,name:p.name,coordinates:q,value:p.value,color:p.color??(P(p.value)?H.color(p.value)?.fill:void 0),dash:void 0})))].filter(p=>p.coordinates.filter(cr).length>=2),[,y]=we(C.map(p=>p.value)),B=C.map((p,q)=>{let N=`${p.name}${P(p.value)?`: ${a(p.value)}`:""}`;return{kind:"path",part:"route",d:`M${p.coordinates.filter(cr).map(z).join("L")}`,stroke:p.color??ne(e,2),strokeWidth:P(p.value)&&y>0?1+3*Math.sqrt(Math.max(0,p.value)/y):1.5,strokeLinecap:"round",strokeLinejoin:"round",dash:p.dash,opacity:.85,title:N,item:{label:N,id:p.id??p.name,name:p.name,index:q,value:p.value}}}),U=[...e.points??[],...t.flatMap(p=>Qs(p).map(q=>({id:p.id,name:p.name,coordinates:q,value:p.value,color:p.color??(P(p.value)?H.color(p.value)?.fill:void 0)})))].filter(p=>cr(p.coordinates)),[Y,j]=e.sizeRange??[3,14],[,I]=we(U.map(p=>p.value)),G=U.map((p,q)=>{let{x:N,y:F}=E(p.coordinates),_=Number.isFinite(p.value)&&I>0,W=`${p.name}${_?`: ${a(p.value)}`:""}`;return{kind:"circle",part:_?"bubble":"point",cx:N,cy:F,r:i(_?Math.max(Y,Math.sqrt(Math.max(0,p.value)/I)*j):Y),fill:p.color??ne(e,1),stroke:"var(--skdx-color-surface-default)",opacity:.85,title:W,item:{label:W,id:p.id??p.name,name:p.name,index:q,value:p.value}}}),V=e.colorLegend?nr(H,d?{x:k.x+k.width+12,y:k.y,width:d,height:k.height}:{x:Vn,y:s-l+8,width:o-2*Vn,height:l},Bn(e.colorLegend).options):[],Q=e.projection==="mercator"?p=>Math.atan(Math.exp(p))*360/Math.PI-90:p=>p;return{...he(e,o,s),shapes:[...x,...B,...b,...G,...V],issues:n,map:{view:{center:[v[0],Q(v[1])],zoom:T},bounds:{minLon:M,maxLon:$,minLat:g,maxLat:w},plot:k,scale:D,toY:m,fromY:Q}}}function Bo(e){let n=[],t=e.segments.map((z,O)=>typeof z=="string"?{name:z,id:z,color:ne(e,O)}:{name:z.name,id:z.id??z.name,color:ne(e,O,z.color)}),r=t.map(z=>!xe(e,z.name)),a=(z,O)=>{let H=z.values[O];return H==null?0:!P(H)||H<0?(n.push({code:P(H)?"negative-value":"invalid-value",severity:"warning",message:`"${t[O]?.name}" in "${z.name}" is ${P(H)?"negative":"not a number"}; drawn as zero.`,itemId:z.id??z.name}),0):H},o=e.data.map((z,O)=>{let H=t.map((C,y)=>r[y]?a(z,y):0),b=H.reduce((C,y)=>C+y,0),x=P(z.total)&&z.total>=0?z.total:b;return{c:z,ci:O,values:H,sum:b,total:x}}),s=o.reduce((z,O)=>z+O.total,0),c=le(e,s<=0);if(c)return{...c,issues:n};let l=ae(e.format),d=ae(e.xAxis?.format??e.format),{width:m,height:h}=de(e),f=t.map(z=>({name:z.name,color:z.color})),M=Te(m,h,{...fe,top:fe.top+ue(e,f,m),bottom:fe.bottom+(e.xAxis?.label?14:0)+(e.xAxis?.format?14:0)}),$=Math.max(0,Math.min(.2,e.gap??.01))*M.width,g=Math.max(0,o.length-1),w=Math.max(0,M.width-$*g),R=Ge([0,1],[M.y+M.height,M.y],{format:{style:"percent"}}),k=he(e,m,h,f),T=M.x,D=o.map(z=>{let O=z.total/s*w,H={x:T,w:O};return T+=O+$,{...z,...H}}),v=D.map(z=>({pos:i(z.x+z.w/2),label:z.c.name})),S=Ze({...k,plot:M,xTicks:Ne(v,M.width),yTicks:R.ticks,baseline:R.zero},{xLabel:e.xAxis?.label,yLabel:void 0});if(e.xAxis?.format)for(let z of D)z.w>24&&S.push(J(i(z.x+z.w/2),M.y+M.height+34,d(z.total),{part:"x-total",anchor:"middle"}));let L=[],E=[];for(let z of D){let O=0;z.values.forEach((H,b)=>{let x=t[b];if(H<=0||z.sum<=0)return;let C=H/z.sum,y=R.scale(O+C),B=R.scale(O);O+=C;let U=`${Math.round(C*100)}%`,Y=`${x.name}, ${z.c.name}: ${l(H)} (${U}) \xB7 column ${d(z.total)}`,j=Math.max(0,B-y);L.push({kind:"rect",part:"cell",x:i(z.x),y:i(y),width:i(z.w),height:i(j),fill:x.color,stroke:"var(--skdx-color-surface-default)",title:Y,item:{label:Y,id:`${z.c.id??z.c.name}:${x.name}`,series:x.name,seriesId:x.id,category:z.c.name,index:z.ci,value:H}}),e.labels&&j>14&&z.w>24&&E.push(J(i(z.x+z.w/2),i(y+j/2),U,{part:"cell-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))})}return{...k,shapes:ft([...S,...L,...E,...k.shapes]),issues:n}}var ei=500;function Fo(e){let n=[],t=e.dimensions,r=e.data.filter(v=>!(v.group!==void 0&&xe(e,v.group))),a=le(e,t.length===0||r.length===0);if(a)return{...a,issues:n};let{width:o,height:s}=de(e),c=[...new Set(e.data.map(v=>v.group).filter(v=>v!==void 0))],l=t[0],d=t[t.length-1],m=v=>(v.label??v.key).length*ie/2+8,h=c.map((v,S)=>({name:v,color:ne(e,S)})),f=Te(o,s,{top:28+ue(e,h,o),right:Math.max(16,m(d)),bottom:16,left:Math.max(48,m(l))}),M=(v,S)=>{let L=v.values[S];return L==null?null:P(L)?L:(n.push({code:"invalid-value",severity:"warning",message:`"${v.name}" has a value on "${S}" that is not a number; drawn as a gap.`,itemId:v.id??v.name}),null)},$=t.map((v,S)=>{let[L,E]=we(r.map(B=>M(B,v.key))),z=ht(v.min??L,v.max??E),O=v.min??z[0],H=v.max??z[z.length-1],b=v.reversed?[f.y,f.y+f.height]:[f.y+f.height,f.y],x=st([O,H],b),C=i(t.length===1?f.x+f.width/2:f.x+S*f.width/(t.length-1)),y=ae(v.format??e.format);return{d:v,x:C,scale:B=>i(x(Math.max(O,Math.min(H,B)))),format:y,ticks:z.filter(B=>B>=O-1e-9&&B<=H+1e-9)}}),g=[];$.forEach((v,S)=>{g.push({kind:"line",part:"axis",x1:v.x,x2:v.x,y1:f.y,y2:f.y+f.height,stroke:K.axis});let L=S===$.length-1&&$.length>1?"start":"end";for(let E of v.ticks)g.push(J(i(L==="end"?v.x-6:v.x+6),v.scale(E),v.format(E),{part:"y-label",anchor:L,baseline:"middle"}));g.push(J(v.x,f.y-12,v.d.label??v.d.key,{part:"axis-title",anchor:"middle"}))});let w=r.length<=ei,R=e.opacity??(r.length>200?.25:.6),k=v=>(e.filters??[]).every(S=>{let L=M(v,S.key);return L!==null&&L>=(S.min??-1/0)&&L<=(S.max??1/0)}),T=r.map((v,S)=>{let L=[],E=[];for(let O of $){let H=M(v,O.d.key);if(H===null){!e.connectNulls&&E.length&&(L.push(E),E=[]);continue}E.push({x:O.x,y:O.scale(H)})}E.length&&L.push(E);let z=`${v.name}: ${$.map(O=>{let H=M(v,O.d.key);return`${O.d.label??O.d.key} ${H===null?"\u2014":O.format(H)}`}).join(" \xB7 ")}`;return{kind:"path",part:"row",d:L.map(O=>it(O,e.curve)).join(""),stroke:v.color??(v.group!==void 0?ne(e,c.indexOf(v.group)):ne(e,0)),strokeWidth:1.5,strokeLinejoin:"round",opacity:k(v)?R:.08,title:w?z:void 0,item:w?{label:z,id:v.id??v.name,name:v.name,category:v.group,index:S}:void 0}}),D=he(e,o,s,h);return{...D,shapes:[...g,...T,...D.shapes],issues:n}}function Po(e){let n=e.orientation==="vertical",t=le(e,!P(e.value),600,n?300:64);if(t)return t;let r=ae(e.format),a=e.min??0,o=(e.bands??[]).filter(d=>P(d.from)&&P(d.to)),s=e.max??Math.max(100,e.value,e.target??-1/0,...o.map(d=>d.to)),c=P(e.target)?`, target ${r(e.target)}`:"";return{...Ir({...e,height:e.height??(n?300:64),data:[{id:"value",name:e.caption??"",value:e.value,target:e.target,ranges:o}],min:a,max:s,labels:e.labels??!0,ticks:e.ticks}),description:e.description??`${e.caption??"Value"} ${r(e.value)} on a scale from ${r(a)} to ${r(s)}${c}.`}}function Ho(e){let n=[],t=e.data.filter(b=>{let x=P(b.start)||P(b.end);return x||n.push({code:"invalid-value",severity:"warning",message:`"${b.name}" has neither a valid start nor end and was dropped.`,itemId:b.id??b.name}),x}),r=le(e,t.length===0);if(r)return{...r,issues:n};let a=ae(e.xAxis?.format??e.format),{width:o,height:s}=de(e),c=e.orientation==="vertical",l=e.startLabel??"Start",d=e.endLabel??"End",m=xe(e,l),h=xe(e,d),f=[...t];if(e.sort){let b=x=>e.sort==="change"?(P(x.end)?x.end:0)-(P(x.start)?x.start:0):P(x.end)?x.end:-1/0;f.sort((x,C)=>e.sort==="asc"?b(x)-b(C):b(C)-b(x))}let M=Math.max(0,...f.map(b=>b.name.length))*ie,$=ne(e,0),g=ne(e,1),w=[{name:l,color:$},{name:d,color:g}],R=Te(o,s,{...fe,top:fe.top+ue(e,w,o)+(c&&e.xAxis?.label?12:0),right:e.labels&&!c?56:fe.right,bottom:fe.bottom+(!c&&e.xAxis?.label?14:0),left:c?fe.left:Math.max(fe.left,M+16)}),k=Ge(Gt(f.flatMap(b=>[m?void 0:b.start,h?void 0:b.end]),!1),c?[R.y+R.height,R.y]:[R.x,R.x+R.width],e.xAxis??{},e.format),T=je(f.length,c?[R.x,R.x+R.width]:[R.y,R.y+R.height]),D=he(e,o,s,w),v=f.map((b,x)=>({pos:i(T.center(x)),label:b.name})),S=Ze({...D,plot:R,xTicks:c?Ne(v,R.width):v,yTicks:c?k.ticks:Ne(k.ticks,R.width),baseline:c?R.y+R.height:R.x},{horizontal:!c,grid:En(e.xAxis),...c?{yLabel:e.xAxis?.label}:{xLabel:e.xAxis?.label}});S.push(...Wt(e.references,{plot:R,horizontal:!c,x:b=>{let x=f.findIndex(C=>C.name===b);return x<0?void 0:T.center(x)},y:b=>k.scale(b)}));let L=e.markerSize??5,E=(b,x)=>c?{x:i(x),y:i(k.scale(b))}:{x:i(k.scale(b)),y:i(x)},z=[],O=[],H=[];return f.forEach((b,x)=>{let C=T.center(x),y=P(b.start)?a(b.start):"\u2014",B=P(b.end)?a(b.end):"\u2014",U=`${b.name}: ${y} \u2192 ${B}`,Y={label:U,id:b.id??b.name,name:b.name,index:x,value:P(b.end)?b.end:void 0};if(!m&&!h&&P(b.start)&&P(b.end)){let j=E(b.start,C),I=E(b.end,C);z.push({kind:"line",part:"connector",x1:j.x,y1:j.y,x2:I.x,y2:I.y,stroke:b.color??K.axis,strokeWidth:3,title:U,item:Y})}for(let[j,I,G,V,Q]of[[b.start,"start",l,$,m],[b.end,"end",d,g,h]]){if(Q||!P(j))continue;let p=E(j,C),q=`${b.name} \xB7 ${G}: ${a(j)}`;O.push({kind:"circle",part:I,cx:p.x,cy:p.y,r:L,fill:V,stroke:"var(--skdx-color-surface-default)",title:q,item:{...Y,label:q,series:G}}),e.labels&&H.push(c?J(p.x,i(p.y+(I==="end"?-L-4:L+12)),a(j),{part:"value-label",anchor:"middle"}):J(i(p.x+(I==="end"?L+4:-L-4)),p.y,a(j),{part:"value-label",anchor:I==="end"?"start":"end",baseline:"middle"}))}}),{...D,shapes:[...S,...z,...O,...H,...D.shapes],issues:n}}function Vo(e){let n=[],r=e.data.filter(m=>{let h=P(m.value)&&m.value>=0;return h||n.push({code:"invalid-value",severity:"warning",message:`"${m.name}" has no valid non-negative value and was dropped.`,itemId:m.id??m.name}),h}).map((m,h)=>({d:m,i:h})).sort((m,h)=>h.d.value-m.d.value||m.i-h.i),a=r.reduce((m,{d:h})=>m+h.value,0),o=0,s=r.map(({d:m})=>a>0?(o+=m.value)/a:0),c=e.threshold,l=qt({...e,categories:r.map(({d:m})=>m.name),series:[{name:e.name??"Value",type:"bar",data:r.map(({d:m})=>m.value),color:r[0]?.d.color},{name:e.cumulativeLabel??"Cumulative",type:"line",axis:"right",data:s,curve:"linear"}],rightAxis:{min:0,max:1,format:{style:"percent"}},references:c!==void 0&&P(c)?[{y:c,axis:"right",label:`${Math.round(c*100)}%`,variant:"primary"}]:void 0},"bar"),d=l.shapes.map(m=>{if(m.part!=="bar"||m.kind!=="rect"||!m.item||m.item.index===void 0)return m;let h=r[m.item.index]?.d;return h?{...m,fill:h.color??m.fill,item:{...m.item,id:h.id??h.name,name:h.name}}:m});return{...l,shapes:d,issues:[...n,...l.issues??[]]}}function Jr(e){let{nodes:n,path:t}=$n(e.data,e.rootId),r=fn(n,e.maxDepth),a=le(e,r.length===0);if(a)return a;let o=ae(e.format),{width:s,height:c}=de(e),l=e.orientation!=="horizontal",d=e.nodeShape==="box",m=e.linkStyle??"curve",h=new Set(e.collapsed??[]),f=e.labels??!0,M=[],$=0,g=0,w=(I,G,V,Q)=>{let p=h.has(tt(I))||h.has(I.name),q=p?[]:I.children??[],N=I.color??V?.color??ne(e,Q),F={node:I,depth:G,slot:0,parent:V,collapsed:p,color:N};if(g=Math.max(g,G),q.length===0)F.slot=$++;else{let _=q.map((W,ee)=>w(W,G+1,F,ee));F.slot=(_[0].slot+_[_.length-1].slot)/2}return M.push(F),F};r.forEach((I,G)=>w(I,0,void 0,G));let R=I=>Math.max(I.name.length,I.subtitle?.length??0),k=Math.max(0,...M.map(I=>R(I.node)))*ie+16,T=e.nodeSize??36,D=e.nodeSize??5,v=d?k:2*D,S=d?T:2*D,L=!d&&f?k:0,E=Te(s,c,{top:ue(e)+S/2+4,bottom:S/2+4+(l&&!d?16:0),left:v/2+4,right:v/2+4+(l?0:L)}),z=Math.max(1,$),O=l?E.width:E.height,H=l?E.height:E.width,b=z===1?0:O/(z-1),x=g===0?0:H/g,C=I=>{let G=z===1?O/2:I.slot*b,V=I.depth*x;return l?{x:i(E.x+G),y:i(E.y+V)}:{x:i(E.x+V),y:i(E.y+G)}},y=[],B=[],U=[];for(let I of M){let{x:G,y:V}=C(I);if(I.parent){let N=C(I.parent),F=d?l?S/2:v/2:D,_=l?N.x:i(N.x+F),W=l?i(N.y+F):N.y,ee=l?G:i(G-F),te=l?i(V-F):V,re=i((_+ee)/2),me=i((W+te)/2),be=m==="straight"?`M${_} ${W}L${ee} ${te}`:m==="elbow"?l?`M${_} ${W}V${me}H${ee}V${te}`:`M${_} ${W}H${re}V${te}H${ee}`:l?`M${_} ${W}C${_} ${me} ${ee} ${me} ${ee} ${te}`:`M${_} ${W}C${re} ${W} ${re} ${te} ${ee} ${te}`;y.push({kind:"path",part:"link",d:be,stroke:K.axis,strokeWidth:1.5,title:`${I.parent.node.name} \u2192 ${I.node.name}`})}let Q=De(I.node),p=`${I.node.name}${I.node.subtitle?` \xB7 ${I.node.subtitle}`:""}${yo(I.node)?`: ${o(Q)}`:""}${I.collapsed?" (collapsed)":""}`,q={label:p,id:tt(I.node),name:I.node.name,value:Q};if(d){if(B.push({kind:"rect",part:"node",x:i(G-v/2),y:i(V-S/2),width:i(v),height:i(S),fill:I.color,rx:4,title:p,item:q}),f){let N=!!I.node.subtitle;U.push(J(G,i(N?V-7:V),I.node.name,{part:"node-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)",weight:"bold"})),N&&U.push(J(G,i(V+8),I.node.subtitle,{part:"node-subtitle",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))}}else B.push({kind:"circle",part:"node",cx:G,cy:V,r:i(D),fill:I.color,stroke:"var(--skdx-color-surface-default)",title:p,item:q}),f&&U.push(l?J(G,i(V+D+12),I.node.name,{part:"node-label",anchor:"middle",fill:"var(--skdx-color-text-default)"}):J(i(G+D+4),V,I.node.name,{part:"node-label",baseline:"middle",fill:"var(--skdx-color-text-default)"}));I.collapsed&&U.push(J(i(d?G+v/2-8:G+D+(l?6:-2)),i(d?V-S/2+8:V-D-2),"+",{part:"collapsed",anchor:"middle",baseline:"middle",fill:K.label,weight:"bold"}))}let Y=t.length?[J(8,ue(e)+10,t.map(I=>I.name).join(" \u203A "),{part:"breadcrumb",baseline:"middle"})]:[],j=he(e,s,c);return{...j,shapes:ft([...y,...B,...U,...Y,...j.shapes])}}var _o=e=>Jr({...e,nodeShape:"box",linkStyle:"elbow"});function ti(e,n){let t=[],r=e.map((f,M)=>({r:f,i:M})).sort((f,M)=>M.r-f.r),a=new Array(e.length);for(let{r:f,i:M}of r){let $;if(t.length===0)$={x:0,y:0,r:f};else{let w=Math.max(1,f/4);e:for(let R=0;R<1e6;R+=w)for(let k=0;k<24;k++){let T=k/24*2*Math.PI+R*.05,D={x:R*Math.cos(T),y:R*Math.sin(T),r:f};if(t.every(v=>Math.hypot(v.x-D.x,v.y-D.y)>=v.r+D.r+n)){$=D;break e}}}let g=$??{x:0,y:0,r:f};t.push(g),a[M]=g}let o=1/0,s=-1/0,c=1/0,l=-1/0;for(let f of t)o=Math.min(o,f.x-f.r),s=Math.max(s,f.x+f.r),c=Math.min(c,f.y-f.r),l=Math.max(l,f.y+f.r);let d=(o+s)/2,m=(c+l)/2,h=0;for(let f of a)f.x-=d,f.y-=m,h=Math.max(h,Math.hypot(f.x,f.y)+f.r);return{circles:a,enclosing:h}}function jo(e){let n=[],{nodes:t}=$n(e.data,e.rootId),r=fn(t,e.maxDepth),a=new Map(r.map((S,L)=>[tt(S),ne(e,L,S.color)])),o=r.filter(S=>!xe(e,S.name)),s=le(e,!o.some(S=>De(S)>0),300,300);if(s)return{...s,issues:n};let c=ae(e.format),{width:l,height:d}=de(e,300,300),m=r.map(S=>({name:S.name,color:a.get(tt(S))})),h=ue(e,m,l),f=e.padding??2,M=e.labels??!0,$=[],g=S=>{S.children?.length?S.children.forEach(g):$.push(De(S))};o.forEach(g);let w=Pt(e.colorScale,$,ne(e,0),void 0,c),R=[],k=[],T=(S,L,E,z,O)=>{let H=S.filter(y=>{let B=De(y)>0;return B||n.push({code:"invalid-value",severity:"warning",message:`"${y.name}" has no positive value and was dropped.`,itemId:tt(y)}),B});if(H.length===0)return;let{circles:b,enclosing:x}=ti(H.map(y=>Math.sqrt(De(y))),0),C=x>0?(z-f)/x:0;H.forEach((y,B)=>{let U=b[B],Y=i(L+U.x*C),j=i(E+U.y*C),I=Math.max(0,U.r*C-f/2),G=De(y),V=(y.children?.length??0)>0,Q=y.color??O??a.get(tt(y))??ne(e,B),p=V?Q:e.colorScale?w.color(G)?.fill??Q:Q,q=`${y.name}: ${c(G)}`;R.push({kind:"circle",part:V?"branch":"leaf",cx:Y,cy:j,r:i(I),fill:p,opacity:V?.15:e.colorScale&&!V?w.color(G)?.opacity:void 0,stroke:"var(--skdx-color-surface-default)",title:q,item:{label:q,id:tt(y),name:y.name,value:G}}),M&&!V&&I*2>y.name.length*ie+4&&k.push(J(Y,j,y.name,{part:"leaf-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"})),M&&V&&I*2>y.name.length*ie+4&&k.push(J(Y,i(j-I+10),y.name,{part:"branch-label",anchor:"middle",baseline:"middle"})),V&&T(y.children,Y,j,I,Q)})},D=Math.max(0,Math.min(l,d-h)/2-8);T(o,l/2,h+(d-h)/2,D,void 0);let v=he(e,l,d,m);return{...v,shapes:ft([...R,...k,...v.shapes]),issues:n}}function Go(e){let n=[],{nodes:t,path:r}=$n(e.data,e.rootId),a=fn(t,e.maxDepth).filter(z=>!xe(e,z.name)),o=le(e,!a.some(z=>De(z)>0));if(o)return{...o,issues:n};let s=ae(e.format),{width:c,height:l}=de(e),d=e.orientation==="horizontal",m=e.breadcrumbs&&r.length>0,h=a.map((z,O)=>({name:z.name,color:ne(e,O,z.color)})),f=ue(e,h,c)+(m?20:0),M=Te(c,l,{top:f,right:0,bottom:0,left:0}),$=e.padding??1,g=e.labels??!0,w=Math.max(1,zr(a)),R=(d?M.width:M.height)/w,k=[],T=z=>{z.children?.length?z.children.forEach(T):k.push(De(z))};a.forEach(T);let D=Pt(e.colorScale,k,ne(e,0),void 0,s),v=[],S=[],L=(z,O,H,b,x)=>{let C=sr(z,e.sort).filter(U=>{let Y=De(U)>0;return Y||n.push({code:"invalid-value",severity:"warning",message:`"${U.name}" has no positive value and was dropped.`,itemId:tt(U)}),Y}),y=C.reduce((U,Y)=>U+De(Y),0),B=H;C.forEach((U,Y)=>{let j=De(U),I=y>0?j/y*b:0,G=(U.children?.length??0)>0,V=U.color??x??ne(e,Y),Q=!G&&e.colorScale?D.color(j):void 0,p=O*R,q=d?{x:M.x+p+$/2,y:B+$/2,width:R-$,height:I-$}:{x:B+$/2,y:M.y+p+$/2,width:I-$,height:R-$},N=`${U.name}: ${s(j)}`;v.push({kind:"rect",part:"cell",x:i(q.x),y:i(q.y),width:i(Math.max(0,q.width)),height:i(Math.max(0,q.height)),fill:Q?.fill??V,opacity:Q?.opacity??(G?.7:void 0),title:N,item:{label:N,id:tt(U),name:U.name,value:j}}),g&&q.width>U.name.length*ie+6&&q.height>12&&S.push(J(i(q.x+4),i(q.y+q.height/2),U.name,{part:"cell-label",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"})),G&&L(U.children,O+1,B,I,V),B+=I})};L(a,0,d?M.y:M.x,d?M.height:M.width,void 0),m&&v.push(...lr(r,8,ue(e,h,c)+10));let E=he(e,c,l,h);return{...E,shapes:ft([...v,...S,...E.shapes]),issues:n}}function Wo(e){let n=[],t=e.series.map((O,H)=>({...O,index:H,hidden:xe(e,O.name)})),r=Math.max(e.categories?.length??0,...t.map(O=>O.data.length)),a=le(e,r===0||t.every(O=>O.hidden||Ve(O.data).length===0));if(a)return{...a,issues:n};for(let O of t){let H=O.data.filter(b=>b!==null&&!P(b)).length;H&&n.push({code:"invalid-value",severity:"warning",message:`Series "${O.name}" has ${H} value${H===1?"":"s"} that ${H===1?"is":"are"} neither a number nor null; drawn as gaps.`,itemId:O.id??O.name})}let o=ae(e.format),{width:s,height:c}=de(e),l=t.filter(O=>!O.hidden),d=l.map(()=>new Array(r).fill(null));for(let O=0;O<r;O++){if(e.ranked){l.forEach((b,x)=>{let C=b.data[O];d[x][O]=P(C)?C:null});continue}l.map((b,x)=>({si:x,v:b.data[O]})).filter(b=>P(b.v)).sort((b,x)=>x.v-b.v||b.si-x.si).forEach((b,x)=>{d[b.si][O]=x+1})}let m=e.topRank??Math.max(1,l.length),h=Array.from({length:r},(O,H)=>{let b=e.categories?.[H];return b===void 0?String(H+1):Qt(b,e.xAxis?.format)}),f=e.labels??!0,M=f?Math.max(0,...l.map(O=>O.name.length))*ie+12:0,$=e.series.map((O,H)=>({name:O.name,color:ne(e,H,O.color)})),g=Te(s,c,{...fe,top:fe.top+ue(e,$,s),right:Math.max(fe.right,M),bottom:fe.bottom+(e.xAxis?.label?14:0)}),w=st([.5,m+.5],[g.y,g.y+g.height]),R=je(r,[g.x,g.x+g.width],0),k=he(e,s,c,$),T=Array.from({length:m},(O,H)=>({pos:i(w(H+1)),label:`#${H+1}`})),D=Ze({...k,plot:g,xTicks:Ne(h.map((O,H)=>({pos:i(R.center(H)),label:O})),g.width),yTicks:m>20?T.filter((O,H)=>H%Math.ceil(m/20)===0):T,baseline:g.y+g.height},{xLabel:e.xAxis?.label,grid:e.xAxis?.grid!==!1}),v=e.markerSize??5,S=[],L=[],E=[],z=[];return l.forEach((O,H)=>{let b=ne(e,O.index,O.color),x=[],C=[],y;for(let B=0;B<r;B++){let U=d[H][B];if(U==null||U>m||U<1){C.length&&x.push(C),C=[];continue}let Y={x:i(R.center(B)),y:i(w(U))};C.push(Y),y=Y;let j=O.data[B],I=`${O.name}, ${h[B]}: #${U}${e.ranked||!P(j)?"":` (${o(j)})`}`;L.push(Ft(Y.x,Y.y,v,b,I,{label:I,id:O.id??O.name,series:O.name,seriesId:O.id??O.name,category:h[B],index:B,value:U}))}C.length&&x.push(C);for(let B of x)S.push({kind:"path",part:"line",d:it(B,e.curve??"monotone"),stroke:b,strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",title:O.name,item:{label:O.name,id:O.id??O.name,series:O.name,seriesId:O.id??O.name}});f&&y&&!z.some(B=>Math.abs(B-y.y)<12)&&(z.push(y.y),E.push(J(i(y.x+v+4),y.y,O.name,{part:"series-label",baseline:"middle",fill:K.label})))}),{...k,shapes:[...D,...S,...L,...E,...k.shapes],issues:n}}var qo=e=>e*Math.PI/180;function Zo(e){let n=[],t=e.data.map(x=>{let C=P(x.value);return C?x.value<0&&n.push({code:"negative-value",severity:"warning",message:`"${x.name}" is negative (${x.value}); a radius cannot be, so it is drawn as zero.`,itemId:x.id??x.name}):n.push({code:"invalid-value",severity:"warning",message:`"${x.name}" has no valid value and is drawn as zero.`,itemId:x.id??x.name}),{...x,value:C&&x.value>0?x.value:0}}),r=le(e,!t.some(x=>x.value>0),300,300);if(r)return{...r,issues:n};let a=ae(e.format),{width:o,height:s}=de(e,300,300),c=e.data.map((x,C)=>({name:x.name,color:ne(e,C,x.color)})),l=ue(e,c,o),d=o/2,m=l+(s-l)/2,h=Math.max(0,Math.min(o,s-l)/2-(e.labels?40:12)),f=h*Math.min(.9,Math.max(0,e.innerRadius??0)),M=Math.max(1,Math.round(e.levels??4)),$=Math.max(0,...t.map(x=>xe(e,x.name)?0:x.value)),g=ht(0,e.max??$,M).filter(x=>x>0),w=e.max??g[g.length-1],R=(e.scale??"sqrt")==="sqrt",k=x=>{let C=w>0?Math.max(0,Math.min(1,x/w)):0;return f+(h-f)*(R?Math.sqrt(C):C)},T=qo(e.startAngle??0),D=qo(e.endAngle??(e.startAngle??0)+360),v=Math.max(0,Math.min(2*Math.PI,D-T)),S=t.length,L=v/Math.max(1,S),E=Math.min(L*.9,qo(Math.max(0,e.padAngle??0))),z=g.filter(x=>x<=w).flatMap(x=>[{kind:"circle",part:"grid",cx:i(d),cy:i(m),r:i(k(x)),fill:"none",stroke:K.grid},J(i(d+4),i(m-k(x)),a(x),{part:"y-label",baseline:"middle"})]),O=[],H=[];t.forEach((x,C)=>{let y=T+C*L+E/2,B=y+L-E,U=xe(e,x.name),Y=`${x.name}: ${a(x.value)}`;if(!U&&x.value>0&&B>y&&O.push({kind:"path",part:"sector",d:Ke(d,m,k(x.value),f,y,B),fill:ne(e,C,x.color),stroke:"var(--skdx-color-surface-default)",title:Y,item:{label:Y,id:x.id??x.name,name:x.name,index:C,value:x.value}}),e.labels&&!U){let j=(y+B)/2,I=Math.sin(j);H.push(J(i(d+(h+8)*I),i(m-(h+8)*Math.cos(j)),x.name,{part:"sector-label",anchor:I>.1?"start":I<-.1?"end":"middle",baseline:"middle"}))}});let b=he(e,o,s,c);return{...b,shapes:[...z,...O,...H,...b.shapes],issues:n}}var ni=2e3;function ri(e,n,t){let r=[],a=[],o=(2*n)**2;for(let s of e){let c=[];for(let d=r.length-1;d>=0&&s-r[d].p<2*n;d--)c.push(r[d]);let l=0;for(let d=0;;d++){if(l=d===0?0:(d%2?1:-1)*Math.ceil(d/2),Math.abs(l)>t){l=Math.sign(l)*t;break}if(c.every(m=>(m.p-s)**2+(m.off-l)**2>=o))break}r.push({p:s,off:l}),a.push(l)}return a}function Uo(e){let n=[];for(let T of e.series){let D=T.data.filter(v=>v!==null&&!Number.isFinite(v)).length;D&&n.push({code:"invalid-value",severity:"warning",message:`Series "${T.name}" has ${D} value${D===1?"":"s"} that ${D===1?"is":"are"} neither a number nor null; skipped.`,itemId:T.id??T.name})}let t=e.series.map(T=>xe(e,T.name)?[]:Ve(T.data)),r=le(e,t.every(T=>T.length===0));if(r)return{...r,issues:n};let a=ae(e.yAxis?.format??e.format),{width:o,height:s}=de(e),c=e.orientation==="horizontal",l=Math.max(0,...e.series.map(T=>T.name.length))*ie,d=e.series.map((T,D)=>({name:T.name,color:ne(e,D,T.color)})),m=Te(o,s,{...fe,top:fe.top+ue(e,d,o)+(!c&&e.yAxis?.label?12:0),left:c?Math.max(fe.left,l+16):fe.left,bottom:fe.bottom+(c&&e.yAxis?.label?14:0)}),h=Ge(Gt(t.flat(),!1),c?[m.x,m.x+m.width]:[m.y+m.height,m.y],e.yAxis??{},e.format),f=je(e.series.length,c?[m.y,m.y+m.height]:[m.x,m.x+m.width]),M=he(e,o,s,d),$=e.series.map((T,D)=>({pos:i(f.center(D)),label:T.name})),g=Ze({...M,plot:m,xTicks:c?$:Ne($,m.width),yTicks:c?Ne(h.ticks,m.width):h.ticks,baseline:c?m.x:m.y+m.height},{horizontal:c,grid:En(e.yAxis),...c?{xLabel:e.yAxis?.label}:{yLabel:e.yAxis?.label}});g.push(...Wt(e.references,{plot:m,horizontal:c,x:T=>{let D=e.series.findIndex(v=>v.name===T);return D<0?void 0:f.center(D)},y:T=>h.scale(T)}));let w=e.markerSize??3,R=Math.max(0,f.bandwidth/2-w),k=[];return e.series.forEach((T,D)=>{let v=ne(e,D,T.color),S=f.center(D),L=(xe(e,T.name)?[]:T.data).map((O,H)=>({v:O,index:H})).filter(O=>P(O.v)).sort((O,H)=>h.scale(O.v)-h.scale(H.v)),E=ri(L.map(O=>h.scale(O.v)),w,R),z=L.length<=ni;L.forEach((O,H)=>{let b=h.scale(O.v),x=E[H],C=`${T.name}: ${a(O.v)}`;k.push({kind:"circle",part:"dot",cx:i(c?b:S+x),cy:i(c?S+x:b),r:w,fill:v,title:z?C:void 0,item:z?{label:C,id:T.id??T.name,series:T.name,seriesId:T.id??T.name,index:O.index,value:O.v}:void 0})})}),{...M,shapes:[...g,...k,...M.shapes],issues:n}}var ai=8;function oi(e){let n=e.map(a=>Math.floor(a)),t=Math.round(e.reduce((a,o)=>a+o,0))-n.reduce((a,o)=>a+o,0),r=e.map((a,o)=>({i:o,frac:a-Math.floor(a)})).sort((a,o)=>o.frac-a.frac||a.i-o.i);for(let{i:a}of r){if(t<=0)break;n[a]++,t--}return n}function Yo(e){let n=[],t=e.data.map(y=>{let B=P(y.value)&&y.value>=0;return B||n.push({code:P(y.value)?"negative-value":"invalid-value",severity:"warning",message:`"${y.name}" has no valid non-negative value and is drawn as zero.`,itemId:y.id??y.name}),{...y,value:B?y.value:0}}),r=t.reduce((y,B)=>y+(xe(e,B.name)?0:B.value),0),a=le(e,r<=0,300,300);if(a)return{...a,issues:n};let o=ae(e.format),s=P(e.total)&&e.total>0?e.total:r,c=Math.max(1,Math.round(e.rows??10)),l=Math.max(1,Math.round(e.columns??10)),d=c*l,m=y=>s>0?y/s:0,h=oi(t.map(y=>xe(e,y.name)?0:Math.min(1,m(y.value))*d)),{width:f,height:M}=de(e,300,300),$=new Map(t.map(y=>[y.name,`${Math.round(m(y.value)*100)}%`])),g=Zn(e),w=e.data.map((y,B)=>({name:y.name,color:ne(e,B,y.color)})),R=e.labels&&g?{...e,legend:{...g,formatter:y=>`${g.formatter?.(y)??y} ${$.get(y)??""}`}}:e,k=ue(R,w,f),T=Math.max(0,e.cellGap??2),D=Math.max(1,Math.min((f-2*ai)/l,(M-k-2*ai)/c)),v=(f-D*l)/2,S=k+(M-k-D*c)/2,L=e.orientation==="horizontal",E=y=>L?{x:v+y%l*D,y:S+Math.floor(y/l)*D}:{x:v+Math.floor(y/c)*D,y:S+(c-1-y%c)*D},z=(y,B,U,Y,j,I)=>{let{x:G,y:V}=E(y);return{kind:"rect",part:"cell",x:i(G+T/2),y:i(V+T/2),width:i(Math.max(.5,D-T)),height:i(Math.max(.5,D-T)),fill:B,stroke:I,opacity:j,rx:e.cellRadius??2,title:U,item:Y}},O=[],H=0;t.forEach((y,B)=>{let U=h[B],Y=`${y.name}: ${o(y.value)} (${Math.round(m(y.value)*100)}%)`,j={label:Y,id:y.id??y.name,name:y.name,index:B,value:y.value};for(let I=0;I<U&&H<d;I++,H++)O.push(z(H,ne(e,B,y.color),Y,j))});let b=s-r,x=b>0?`Other: ${o(b)} (${Math.round(m(b)*100)}%)`:"Empty";for(;H<d;H++)O.push(z(H,K.grid,x,void 0,.6,K.axis));let C=he(R,f,M,w);return{...C,shapes:[...O,...C.shapes],issues:n}}var ye=require("lit"),ce=require("lit/decorators.js"),ze=require("lit/directives/if-defined.js");var Re={fromAttribute:()=>!1},X=class extends ye.LitElement{constructor(){super(...arguments);this.legend=!1;this.tooltip=!0;this.selectionMode="none";this.loading=!1;this.decorative=!1;this.accessibleTable=!1;this.zoomable=!1;this.editable=!1;this.crossFilter=!1;this.animated=!1;this.responsive=!1;this.tip=[];this.overlay=[];this.portal=null;this.highlightState=null;this.crossState=null;this.lastCross=null;this.pointers=new Map;this.hover=null;this.token={};this.focused=null;this.hiddenState=[];this.drag=null;this.onPointerMove=t=>{let r=this.layout;if(!r)return;this.pointers.has(t.pointerId)&&this.pointers.set(t.pointerId,this.viewBox(t,r).x);let a=this.drag;if(a?.grab==="select"){let{x:o,y:s}=this.viewBox(t,r);this.overlay=[to(Xr(a.x,a.y,o,s))];return}if(a?.grab==="lasso"){let{x:o,y:s}=this.viewBox(t,r);a.points=[...a.points??[],{x:o,y:s}],this.overlay=[ro(a.points)];return}if(a?.grab==="edit"){if(!a.gantt)return;let{x:o}=this.viewBox(t,r);a.change=oo(r,a.gantt,o-a.x),this.overlay=[io(r,a.gantt,a.change)];return}if(a?.grab==="map"){if(!r.map||!a.view)return;let{x:o,y:s}=this.viewBox(t,r);this.setView(co(r.map,a.view,o-a.x,s-a.y));return}if(a&&r.hit){if(a.grab==="pinch"){let[s,c]=[...this.pointers.values()];if(s===void 0||c===void 0||!a.distance)return;this.setZoom(fo(r.hit,a.zoom,Math.abs(s-c)/a.distance,(s+c)/2));return}let{x:o}=this.viewBox(t,r);this.setZoom(a.grab==="pan"?po(r.hit,a.zoom,o-a.x):go(r.hit,a.grab,a.zoom,o-a.x));return}if(r.tooltipPortal){let{lines:o,shapes:s}=Xa(r,t.target,t.currentTarget,t.clientX,t.clientY);this.tip=s,this.portal=o.length?{x:t.clientX,y:t.clientY,lines:o}:null}else{let o=Qa(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(Ja(r,t.target)),this.syncId&&r.hit?.crosshair){let o=Tr(r,this.viewBox(t,r).x);this.shareCrosshair(o?r.hit.rows[o.index]?.[0]??null:null)}};this.onPointerDown=t=>{let r=this.layout;if(!r||t.button!==0)return;let{x:a,y:o}=this.viewBox(t,r),s=Hn(r,t.target)?.item.legend,c=this.canEdit(r)?ao(r,a,o):void 0;if(c){this.drag={x:a,y:o,zoom:{start:0,end:0},grab:"edit",gantt:c},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.brushing()&&!s){this.drag={x:a,y:o,zoom:{start:0,end:0},grab:this.selectionMode==="lasso"?"lasso":"select",points:[{x:a,y:o}]},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.canPan(r)&&r.map){let d=r.map.plot;if(a<d.x||a>d.x+d.width||o<d.y||o>d.y+d.height)return;this.drag={x:a,y:o,zoom:{start:0,end:0},grab:"map",view:r.map.view},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}let l=r.hit;if(!(!l||!this.canZoom(r))){if(this.pointers.set(t.pointerId,a),this.pointers.size===2){let[d,m]=[...this.pointers.values()];this.drag={x:(d+m)/2,y:o,zoom:l.zoom,grab:"pinch",distance:Math.abs(d-m)||1}}else{let d=bo(l,a,o);if(d)this.drag={x:a,y:o,zoom:d.zoom,grab:d.grab},d.zoom!==l.zoom&&this.setZoom(d.zoom);else if(this.zoomable&&a>=l.plot.x&&a<=l.plot.x+l.plot.width&&o>=l.plot.y&&o<=l.plot.y+l.plot.height)this.drag={x:a,y:o,zoom:l.zoom,grab:"pan"};else{this.pointers.delete(t.pointerId);return}}t.currentTarget.setPointerCapture(t.pointerId),this.clearTip()}};this.onPointerUp=t=>{this.pointers.delete(t.pointerId);let r=t.currentTarget;r.hasPointerCapture(t.pointerId)&&r.releasePointerCapture(t.pointerId);let a=this.drag,o=this.layout;if(o&&(a?.grab==="select"||a?.grab==="lasso"||a?.grab==="edit"||a?.grab==="map")){this.overlay=[];let{x:s,y:c}=this.viewBox(t,o);if(Math.abs(s-a.x)>2||Math.abs(c-a.y)>2){a.grab==="select"?this.setSelected(eo(o,Xr(a.x,a.y,s,c))):a.grab==="lasso"?this.setSelected(no(o,a.points??[])):a.grab==="edit"&&a.change&&this.emit("skdx-task-change",a.change),this.drag={...a,distance:-1};return}this.drag=null;return}(this.pointers.size===0||this.drag?.grab==="pinch")&&(this.drag=null)};this.onWheel=t=>{let r=this.layout;if(!r)return;let{x:a,y:o}=this.viewBox(t,r);if(r.map&&this.canPan(r)){let l=r.map.plot;if(a<l.x||a>l.x+l.width||o<l.y||o>l.y+l.height)return;t.preventDefault(),this.setView(lo(r.map,t.deltaY,a,o));return}let s=r.hit;if(!s||!this.canZoom(r)||o<s.plot.y||o>s.plot.y+s.plot.height)return;let c=ho(s,t.deltaY,a);c&&(t.preventDefault(),this.setZoom(c))};this.onClick=t=>{if(!this.layout)return;if(this.drag?.distance===-1){this.drag=null;return}let r=Hn(this.layout,t.target);r&&(r.item.range?this.setZoom(r.item.range):r.item.legend&&r.item.series!==void 0?this.toggle(r.item.series):(this.select(r.item),this.emit("skdx-item-click",r.item)))};this.onKeyDown=t=>{if(t.key==="Escape"){t.preventDefault(),this.focused=null,this.clearTip(),this.crossState=null,this.highlight(null);return}let r=this.layout;if(!r)return;if((t.key==="Enter"||t.key===" ")&&this.focused!==null){let c=r.shapes[this.focused]?.item;c&&(t.preventDefault(),this.select(c),this.emit("skdx-item-click",c));return}let a=this.canEdit(r)?so(r,this.focused,t):void 0;if(a){t.preventDefault(),this.emit("skdx-task-change",a);return}let o=uo(r,this.focused,t.key);if(o===void 0)return;t.preventDefault(),this.focused=o;let s=o===null?void 0:r.shapes[o]?.item;this.highlight(s?Pn(s):null)}}connectedCallback(){super.connectedCallback(),!(typeof ResizeObserver>"u")&&(this.observer=new ResizeObserver(([t])=>{let r=Math.floor(t?.contentRect.width??0);r>0&&(this.measured=r)}),this.observer.observe(this))}disconnectedCallback(){this.observer?.disconnect(),this.leave?.(),this.leave=void 0,this.joined=void 0,super.disconnectedCallback()}sized(){let{width:t,height:r,legend:a,tooltip:o,format:s,palette:c,loading:l,error:d,emptyMessage:m,description:h,decorative:f,animated:M,responsive:$,highlighted:g,highlightScope:w,accessibleTable:R}=this;return{width:$&&this.measured?this.measured:t,height:r,animate:M,responsive:$,legend:a,tooltip:o,format:s,palette:c,loading:l,error:d,emptyMessage:m,description:h,decorative:f,highlighted:g===void 0?this.highlightState:g,highlightScope:w,accessibleTable:R,hiddenSeries:this.hiddenSeries??this.hiddenState,zoom:this.zoom??this.zoomState,selected:this.selected??this.selectedState,view:this.view??this.viewState}}compactOverrides(){let t=this.responsive;return typeof t=="object"&&this.measured!==void 0&&this.measured<(t.breakpoint??480)?{...t.compact,width:this.measured}:void 0}emit(t,r){this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0}))}publish(t){this.syncId&&ir(this.syncId).publish(t,this.token)}join(){if(this.joined===this.syncId||(this.leave?.(),this.leave=void 0,this.joined=this.syncId,!this.syncId))return;let t=ir(this.syncId),r=a=>{"highlighted"in a&&(this.highlightState=a.highlighted??null),a.selected&&(this.selectedState=a.selected,this.crossFilter&&(this.highlightState=a.selected.length?a.selected:null)),"zoom"in a&&(this.zoomState=a.zoom),a.hiddenSeries&&(this.hiddenState=a.hiddenSeries),"crosshair"in a&&(this.crossState=a.crosshair??null)};r(t.current),this.leave=t.subscribe((a,o)=>{o!==this.token&&r(a)})}setZoom(t){this.zoomState=t,this.emit("skdx-zoom-change",t),this.publish({zoom:t})}setView(t){this.viewState=t,this.emit("skdx-view-change",t)}setSelected(t){this.selectedState=t,this.emit("skdx-selected-change",t),this.publish({selected:t})}toggle(t){let r=this.hiddenSeries??this.hiddenState,a=r.includes(t)?r.filter(o=>o!==t):[...r,t];this.hiddenState=a,this.emit("skdx-hidden-series-change",a),this.publish({hiddenSeries:a})}highlight(t){let r=this.hover;r===t||r&&t&&Ca(r,t)||(this.hover=t,this.emit("skdx-highlighted-change",t),this.highlightState=t,this.syncId&&this.publish({highlighted:t}))}select(t){let r=this.selectionMode;r!=="none"&&this.setSelected(Oa(this.selected??this.selectedState,t,r==="single"?"single":"multiple"))}shareCrosshair(t){!this.syncId||this.lastCross===t||(this.lastCross=t,this.publish({crosshair:t}))}clearTip(){this.tip=[],this.portal=null,this.shareCrosshair(null)}canZoom(t){return!!(t.hit&&(this.zoomable||t.hit.brush))}canPan(t){return!!(t.map&&this.zoomable)}canEdit(t){return!!(this.editable&&t.edit)}brushing(){return this.selectionMode==="brush"||this.selectionMode==="lasso"}viewBox(t,r){return or(t.currentTarget,t.clientX,t.clientY,r.width,r.height)}getSvgElement(){return this.renderRoot.querySelector("svg")}getLayout(){return this.layout}resetZoom(){this.setZoom(void 0)}zoomTo(t){this.setZoom(t)}focusItem(t){let r=this.layout;if(!r)return!1;let a=r.shapes.findIndex(o=>o.item&&!o.item.legend&&wn(o.item,t));return a<0?!1:(this.getSvgElement()?.focus(),this.focused=a,!0)}export(t){let r=this.layout;return r?Lr(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,a){this.join();let o=La(ba(t),this.sized());if(this.layout=o,o.issues!==this.reported){this.reported=o.issues;for(let w of o.issues??[])this.emit("skdx-data-issue",w)}let s=this.canZoom(o),c=this.canPan(o),l=this.canEdit(o),d=this.brushing(),m=s||c||l||d,h=!o.decorative&&Qr(o).length>0,f=ko(o),M=vo(o,this.accessibleTable),$=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||a,g=this.portal;return ye.html`<svg
|
|
1
|
+
"use strict";var Hr=Object.defineProperty;var bs=Object.getOwnPropertyDescriptor;var wi=Object.getOwnPropertyNames;var ki=Object.prototype.hasOwnProperty;var $i=(e,n)=>{for(var t in n)Hr(e,t,{get:n[t],enumerable:!0})},Ii=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of wi(n))!ki.call(e,o)&&o!==t&&Hr(e,o,{get:()=>n[o],enumerable:!(r=bs(n,o))||r.enumerable});return e};var Ti=e=>Ii(Hr({},"__esModule",{value:!0}),e),u=(e,n,t,r)=>{for(var o=r>1?void 0:r?bs(n,t):n,a=e.length-1,s;a>=0;a--)(s=e[a])&&(o=(r?s(n,t,o):s(o))||o);return r&&o&&Hr(n,t,o),o};var Fl={};$i(Fl,{SkdxAreaChart:()=>hr,SkdxBarChart:()=>mr,SkdxBoxplot:()=>At,SkdxBubbleChart:()=>Ue,SkdxBulletChart:()=>Kt,SkdxBumpChart:()=>_t,SkdxCandlestickChart:()=>Qe,SkdxChordChart:()=>pn,SkdxCirclePackingChart:()=>dn,SkdxComboChart:()=>fr,SkdxDumbbellChart:()=>zt,SkdxFunnelChart:()=>Jt,SkdxGanttChart:()=>tn,SkdxGaugeChart:()=>Je,SkdxHeatmap:()=>Ve,SkdxHistogram:()=>Ye,SkdxIcicleChart:()=>Dt,SkdxLineChart:()=>ur,SkdxLinearGauge:()=>Lt,SkdxMapChart:()=>Ot,SkdxMarimekkoChart:()=>gn,SkdxNetworkChart:()=>Ht,SkdxOrganizationChart:()=>Xt,SkdxParallelCoordinatesChart:()=>on,SkdxParetoChart:()=>at,SkdxPieChart:()=>lt,SkdxPolarAreaChart:()=>Nt,SkdxRadarChart:()=>nt,SkdxRadialBarChart:()=>ot,SkdxRangeChart:()=>_e,SkdxSankeyChart:()=>gt,SkdxScatterChart:()=>Xe,SkdxSparkline:()=>bt,SkdxSunburstChart:()=>rt,SkdxSwarmPlot:()=>yn,SkdxTimelineChart:()=>Tn,SkdxTreeChart:()=>Et,SkdxTreemap:()=>Tt,SkdxWaffleChart:()=>jt,SkdxWaterfallChart:()=>yt,csv:()=>Rr,exportChart:()=>zr,makeFormatter:()=>oe,parseChartSnapshot:()=>yr,readChartSnapshot:()=>po,seriesCsv:()=>$a,svgMarkup:()=>Lr,syncGroup:()=>lr});module.exports=Ti(Fl);var hi=require("lit/decorators.js");var gs=new Set(["__proto__","constructor","prototype"]),_r="skdx-chart-snapshot-request-v1";function fo(e,n){let t=r=>{if(r.target!==e)return;let o=r.detail;if(!(!o||typeof o.receive!="function"))try{o.receive(n())}catch(a){o.receive(void 0,a instanceof Error?a.message:String(a))}};return e.addEventListener(_r,t),()=>e.removeEventListener(_r,t)}function po(e){let n,t,r=0;if(e.dispatchEvent(new CustomEvent(_r,{detail:{receive(o,a){r++,n=o,t=a}}})),r>1)throw new Error("Duplicate owner chart snapshot listeners");if(t)throw new Error(t);return n===void 0?void 0:yr(n)}function On(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}function bo(e,n,t){let r=[],o=0,a=new Set,s=(i,c,m=0)=>{if(++o>1e5||m>64)throw new Error("Chart snapshot exceeds bounded input size/depth");if(i===null||typeof i=="boolean"||typeof i=="string")return i;if(typeof i=="number")return Number.isFinite(i)?i:{$number:String(i)};if(i===void 0)return;if(typeof i=="function"){r.push({code:"unserializable-chart-callback",path:c,message:"Callback omitted; captured geometry retains its actual output. Do not reconstruct this configuration as a literal renderer input."});return}if(i instanceof Date)return Number.isFinite(i.getTime())?{$date:i.toISOString()}:{$date:"Invalid Date"};if(!Array.isArray(i)&&!On(i))throw new Error(`Unsupported chart snapshot value at ${c}`);if(a.has(i))throw new Error(`Cyclic chart input at ${c}`);a.add(i);let h;if(Array.isArray(i))h=i.map((f,y)=>s(f,`${c}[${y}]`,m+1)??null);else{let f=[];for(let[y,$]of Object.entries(i)){if(gs.has(y))throw new Error("Unsafe chart snapshot key");let b=s($,`${c}.${y}`,m+1);b!==void 0&&f.push([y,b])}h=Object.fromEntries(f)}return a.delete(i),h},d={width:t.width,height:t.height,shapes:t.shapes,...t.defs?{defs:t.defs}:{},...t.issues?{issues:t.issues}:{},...t.table?{table:t.table}:{}};return yr({schemaVersion:"1.0.0",kind:e,configuration:s(n,"input"),canvas:s(d,"canvas"),diagnostics:r})}function yr(e){let n=0,t=(i,c=0)=>{if(++n>1e5||c>64)throw new Error("Chart snapshot exceeds bounded input size/depth");if(!(i===null||typeof i=="boolean"||typeof i=="string")&&!(typeof i=="number"&&Number.isFinite(i))){if(Array.isArray(i)){i.forEach(m=>t(m,c+1));return}if(!On(i))throw new Error("Chart snapshot must contain plain JSON only");for(let[m,h]of Object.entries(i)){if(gs.has(m))throw new Error("Unsafe chart snapshot key");t(h,c+1)}}};if(t(e),new TextEncoder().encode(JSON.stringify(e)).byteLength>8388608)throw new Error("Chart snapshot exceeds 8MB");if(!On(e)||Object.keys(e).some(i=>!["schemaVersion","kind","configuration","canvas","diagnostics"].includes(i))||e.schemaVersion!=="1.0.0"||typeof e.kind!="string"||!/^[a-z][a-z0-9-]*$/.test(e.kind)||!On(e.configuration)||!On(e.canvas)||!Array.isArray(e.diagnostics))throw new Error("Unsupported chart snapshot envelope");let r=e.canvas;if(Object.keys(r).some(i=>!["width","height","shapes","defs","issues","table"].includes(i)))throw new Error("Unsupported runtime geometry field");let o=(i,c=-1e5)=>typeof i=="number"&&Number.isFinite(i)&&i>=c&&i<=1e5;if(!o(r.width,.01)||!o(r.height,.01)||!Array.isArray(r.shapes)||!r.shapes.length||r.shapes.length>2e4)throw new Error("Invalid chart snapshot viewport/geometry");let a={path:["d","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","opacity","fillOpacity","dash"],rect:["x","y","width","height","fill","stroke","opacity","rx"],line:["x1","y1","x2","y2","stroke","dash","strokeWidth","opacity"],circle:["cx","cy","r","fill","stroke","opacity"],text:["x","y","text","anchor","baseline","fill","weight","rotate"]},s={path:["d"],rect:["x","y","width","height","fill"],line:["x1","y1","x2","y2","stroke"],circle:["cx","cy","r","fill"],text:["x","y","text"]},d=new Set(["x","y","x1","y1","x2","y2","width","height","cx","cy","r","strokeWidth","opacity","fillOpacity","rx","rotate"]);for(let i of r.shapes){if(!On(i)||typeof i.kind!="string"||!Object.hasOwn(a,i.kind)||typeof i.part!="string"||!i.part||Object.keys(i).some(c=>!["kind","part","title","item",...a[i.kind]??[]].includes(c)))throw new Error("Unsupported owner shape");for(let c of s[i.kind]??[])if(!(c in i))throw new Error("Missing owner geometry field");for(let[c,m]of Object.entries(i)){if(d.has(c)&&!o(m,["width","height","r","strokeWidth","rx","opacity","fillOpacity"].includes(c)?0:-1e5))throw new Error("Invalid owner geometry number");if(["opacity","fillOpacity"].includes(c)&&Number(m)>1)throw new Error("Invalid owner paint opacity");if(!d.has(c)&&c!=="item"&&typeof m!="string")throw new Error("Invalid owner shape field")}if(i.kind==="path"&&(typeof i.d!="string"||!/^\s*[Mm][MmLlHhVvCcSsQqTtAaZz0-9eE+.,\s-]*$/.test(i.d)||(i.d.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/g)??[]).some(c=>!o(Number(c)))))throw new Error("Invalid owner path geometry");for(let[c,m]of Object.entries({anchor:["start","middle","end"],baseline:["middle","hanging"],weight:["bold"],strokeLinecap:["round"],strokeLinejoin:["round"]}))if(i[c]!==void 0&&(typeof i[c]!="string"||!m.includes(i[c])))throw new Error("Invalid owner shape enum")}if(r.defs!==void 0){if(!Array.isArray(r.defs)||r.defs.length>1e3)throw new Error("Invalid owner gradient list");let i=new Set;for(let c of r.defs){if(!On(c)||typeof c.id!="string"||!/^[A-Za-z][\w-]*$/.test(c.id)||i.has(c.id)||Object.keys(c).some(h=>!["id","vertical","stops"].includes(h))||c.vertical!==void 0&&typeof c.vertical!="boolean"||!Array.isArray(c.stops)||c.stops.length<2||c.stops.length>64)throw new Error("Invalid owner gradient");i.add(c.id);let m=-1;for(let h of c.stops){if(!On(h)||Object.keys(h).some(f=>!["offset","color","opacity"].includes(f))||!o(h.offset,0)||h.offset>1||h.offset<m||typeof h.color!="string"||h.opacity!==void 0&&(!o(h.opacity,0)||h.opacity>1))throw new Error("Invalid owner gradient stop");m=h.offset}}}for(let i of e.diagnostics)if(!On(i)||Object.keys(i).some(c=>!["code","path","message"].includes(c))||[i.code,i.path,i.message].some(c=>typeof c!="string"||!c))throw new Error("Invalid snapshot diagnostic");return e}var xs=e=>Number(e.toPrecision(12)),Ai,go=e=>(Ai??(Ai=new Intl.NumberFormat)).format(xs(e)),Ci=e=>{let n=Math.round(Math.abs(e)),t=e<0?"-":"",r=Math.floor(n/3600),o=Math.floor(n%3600/60),a=s=>String(s).padStart(2,"0");return r>0?`${t}${r}h ${a(o)}m`:o>0?`${t}${o}m ${a(n%60)}s`:`${t}${n}s`};function oe(e){if(e===void 0)return go;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:o="",timeZone:a}=e,s=m=>o?h=>m(h)+o:m,d=m=>r===void 0?m===void 0?{}:{maximumFractionDigits:m}:{minimumFractionDigits:r,maximumFractionDigits:r},i=m=>{let h=new Intl.NumberFormat(t,m);return s(f=>h.format(xs(f)))},c=m=>{let h=new Intl.DateTimeFormat(t,a?{...m,timeZone:a}:m);return f=>h.format(f)};switch(n){case"integer":return i({maximumFractionDigits:0});case"decimal":return i(d(2));case"percent":return i({style:"percent",...d(0)});case"currency":return i({style:"currency",currency:e.currency??"USD",...d()});case"compact":return i({notation:"compact",...d(1)});case"scientific":return i({notation:"scientific",...d(2)});case"date":return c({dateStyle:"medium"});case"time":return c({timeStyle:"short"});case"datetime":return c({dateStyle:"medium",timeStyle:"short"});case"duration":return s(Ci)}}function Qt(e,n){if(typeof e=="string")return e;let t=e instanceof Date?e.getTime():e;return n?oe(n)(t):e instanceof Date?new Intl.DateTimeFormat().format(e):go(t)}var qe=e=>{if(e instanceof Date)return e.getTime();if(typeof e=="number")return e;let n=Number(e);return Number.isFinite(n)&&e.trim()!==""?n:Date.parse(e)};function st([e,n],[t,r]){let o=n-e;return a=>o===0?t:t+(a-e)/o*(r-t)}function ht(e,n,t=5){if(e===n)return[e];let r=(n-e)/Math.max(1,t),o=10**Math.floor(Math.log10(r)),a=r/o,s=(a<1.5?1:a<3.5?2:a<7.5?5:10)*o,d=Math.floor(e/s)*s,i=Math.ceil(n/s)*s,c=[];for(let m=d;m<=i+s/2;m+=s)c.push(ys(m));return c}function je(e,[n,t],r=.2){let o=e===0?0:(t-n)/e,a=o*(1-Math.max(0,Math.min(.9,r)));return{step:o,bandwidth:a,start:s=>n+s*o+(o-a)/2,center:s=>n+(s+.5)*o}}var ys=e=>Number(e.toPrecision(12)),l=e=>Number(e.toFixed(2)),P=e=>typeof e=="number"&&Number.isFinite(e),He=e=>e.filter(P);function we(e){let n=1/0,t=-1/0;for(let r of e)P(r)&&(r<n&&(n=r),r>t&&(t=r));return n===1/0?[0,0]:[n,t]}function it(e,n="linear"){if(e.length===0)return"";let t=e[0];if(n==="step"||n==="stepBefore"||n==="stepAfter"){let c=`M${t.x} ${t.y}`;for(let m=1;m<e.length;m++){let h=e[m-1],f=e[m];n==="stepAfter"?c+=`H${f.x}V${f.y}`:n==="stepBefore"?c+=`V${f.y}H${f.x}`:c+=`H${l((h.x+f.x)/2)}V${f.y}H${f.x}`}return c}if(n==="linear"||e.length<3)return`M${e.map(c=>`${c.x} ${c.y}`).join("L")}`;let r=e.length,o=e.slice(1).map((c,m)=>c.x-e[m].x),a=e.slice(1).map((c,m)=>c.y-e[m].y),s=o.map((c,m)=>c===0?0:a[m]/c),d=[s[0]];for(let c=1;c<r-1;c++){let m=s[c-1],h=s[c];d.push(m*h<=0?0:(m+h)/2)}d.push(s[r-2]);for(let c=0;c<r-1;c++){let m=s[c];if(m===0){d[c]=0,d[c+1]=0;continue}let h=d[c]/m,f=d[c+1]/m,y=Math.hypot(h,f);y>3&&(d[c]=3*h*m/y,d[c+1]=3*f*m/y)}let i=`M${t.x} ${t.y}`;for(let c=0;c<r-1;c++){let m=e[c],h=e[c+1],f=o[c]/3;i+=`C${l(m.x+f)} ${l(m.y+f*d[c])} ${l(h.x-f)} ${l(h.y-f*d[c+1])} ${h.x} ${h.y}`}return i}var vr=1e3,Mr=60*vr,wr=60*Mr,kr=24*wr,Oi=[vr,5*vr,15*vr,30*vr,Mr,5*Mr,15*Mr,30*Mr,wr,3*wr,6*wr,12*wr,kr,2*kr,7*kr,14*kr];function Jn(e,n,t=6){if(!(n>e))return[e];let r=n-e,o=Oi.find(h=>r/h<=t),a=[];if(o!==void 0){for(let h=Math.ceil(e/o)*o;h<=n;h+=o)a.push(h);return a.length?a:[e,n]}let s=r/(30*kr),d=[1,2,3,6,12,24,60,120].find(h=>s/h<=t)??240,i=new Date(e),c=i.getUTCFullYear(),m=Math.ceil((i.getUTCMonth()+(i.getUTCDate()>1?1:0))/d)*d;for(let h=Date.UTC(c,m,1);h<=n;)a.push(h),m+=d,m>=12&&(c+=Math.floor(m/12),m%=12),h=Date.UTC(c,m,1);return a.length?a:[e,n]}function vs(e,n){let t=Math.floor(Math.log10(e)),r=Math.ceil(Math.log10(n)),o=r-t<=1?[1,2,5]:[1],a=[];for(let s=t;s<=r;s++)for(let d of o)a.push(ys(d*10**s));return a.filter(s=>s>=e/1.0001&&s<=n*1.0001)}function er(e,n={}){if(n.thresholds&&n.thresholds.length>=2)return[...n.thresholds].filter(Number.isFinite).sort((i,c)=>i-c);let[t,r]=n.domain??we(e),o=Math.max(1,e.length),a=Math.max(1,n.bins??Math.ceil(Math.log2(o)+1)),s=n.binWidth??(r>t?(r-t)/a:1),d=r>t?Math.max(1,Math.ceil((r-t)/s-1e-9)):1;return Array.from({length:d+1},(i,c)=>Number((t+c*s).toPrecision(12)))}function tr(e,n){let t=[];for(let a=0;a+1<n.length;a++)t.push({x0:n[a],x1:n[a+1],count:0});if(t.length===0)return t;let r=n[0],o=n[n.length-1];for(let a of He(e)){if(a<r||a>o)continue;let s=0,d=t.length-1;for(;s<d;){let i=s+d+1>>1;t[i].x0<=a?s=i:d=i-1}t[s].count++}return t}var Si=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,Li=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,zi={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function Ri(e,n,t){return e.replace(Li,(r,o,a)=>{let s=zi[o];if(s===void 0)return o+a;let i=(a.match(Si)??[]).map((c,m)=>{let h=Number(c);if(s===-1)return String(h+n);if(s===-2)return String(h+t);let f=m%s;return s===7?f===5?String(h+n):f===6?String(h+t):c:String(f%2===0?h+n:h+t)});return o+i.join(" ")})}var Ms=(e,n,t)=>e.map(r=>{switch(r.kind){case"rect":return{...r,x:r.x+n,y:r.y+t};case"circle":return{...r,cx:r.cx+n,cy:r.cy+t};case"line":return{...r,x1:r.x1+n,x2:r.x2+n,y1:r.y1+t,y2:r.y2+t};case"text":return{...r,x:r.x+n,y:r.y+t};case"path":return{...r,d:Ri(r.d,n,t)}}});var xo=["primary","success","warning","danger","neutral"].flatMap(e=>[500,700].map(n=>`var(--skdx-color-${e}-${n})`)).sort((e,n)=>Number(e.endsWith("700)"))-Number(n.endsWith("700)"))),K={axis:"var(--skdx-color-border-strong)",grid:"var(--skdx-color-border-subtle)",label:"var(--skdx-color-text-muted)",focus:"var(--skdx-color-focus-ring)",positive:"var(--skdx-color-success-500)",negative:"var(--skdx-color-danger-500)",fontFamily:"var(--skdx-font-family)",fontSize:"var(--skdx-font-size-xs)"},Ft=(e="neutral")=>e==="neutral"?K.axis:`var(--skdx-color-${e}-500)`,yo=(e="neutral")=>e==="neutral"?K.label:e==="primary"?"var(--skdx-color-text-accent)":`var(--skdx-color-text-${e})`,ws=(e,n)=>n??xo[e%xo.length];var fe={top:16,right:16,bottom:32,left:48};function Te(e,n,t=fe){return{x:t.left,y:t.top,width:Math.max(0,e-t.left-t.right),height:Math.max(0,n-t.top-t.bottom)}}function Un(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function Mo(e){let n=e.tooltip;return n===void 0||n===!0?{enabled:!0}:n===!1?{enabled:!1}:{...n,enabled:n.enabled??!0}}var jr=e=>e.crosshair===!0||Mo(e).trigger==="axis",Gr=20,Ni=120,ks=e=>{let n=Un(e);return n&&(n.position==="left"||n.position==="right")?n.width??Ni:0},de=(e,n=600,t=300)=>({width:(e.width??n)-ks(e),height:(e.height??t)-(Un(e)?.position==="bottom"?Gr:0)}),ue=(e,n,t)=>{let r=Un(e);return!r||!(r.position===void 0||r.position==="top")?0:(n?Math.max(1,$s(n,t??de(e).width,r)):1)*Gr},ie=6.5;function wo(e,n){let t=Array.from(e),r=Math.max(0,Math.floor(n/ie));return t.length<=r?e:r===0?"":`${t.slice(0,r-1).join("")}\u2026`}var ne=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:ws(n)),xe=(e,n)=>e.hiddenSeries?.includes(n)??!1;function vo(e,n,t=[],r={},o=10,a=8,s=!1){let d=[],i=r.maxItems,c=i!==void 0&&i>=0&&e.length>i?e.slice(0,i):e,m=e.length-c.length,h=r.interactive??!0,f=a,y=o,$=(b,w,R,k)=>{let T=(w?18:4)+b.length*ie;f>a&&(s||f+T>n-8)&&(f=a,y+=Gr),w&&d.push({kind:"rect",part:"legend-swatch",x:f,y:y-5,width:10,height:10,fill:w,opacity:k?.3:void 0,item:R}),d.push({kind:"text",part:"legend-label",x:f+(w?14:0),y,text:b,baseline:"middle",fill:k?K.grid:K.label,item:R}),f+=T+12};for(let b of c){let w=t.includes(b.name),R=h?{label:b.name,series:b.name,legend:!0}:void 0;$(r.formatter?.(b.name)??b.name,b.color,R,w)}return m>0&&$(`+${m} more`,void 0,void 0,!1),r.align==="end"?Ei(d,n):d}function Ei(e,n){let t=new Map;for(let o of e){let a=o.kind==="rect"?o.y+5:o.y;t.set(a,[...t.get(a)??[],o])}let r=[];for(let o of t.values()){let a=Math.max(...o.map(d=>d.kind==="rect"?d.x+d.width:d.x+d.text.length*ie)),s=n-8-a;for(let d of o)r.push({...d,x:d.x+s})}return r}var $s=(e,n,t={})=>new Set(vo(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function he(e,n,t,r=[]){let o=Un(e),a=o&&e.direction==="rtl"&&o.align===void 0?{...o,align:"end"}:o,s=Mo(e),d=a?.position==="bottom",i=ks(e),c=e.hiddenSeries??[],m=a?i?vo(r,1/0,c,a,10,(a.position==="right"?n:0)+8,!0):vo(r,n,c,a,d?t+10:10):[],h=d?$s(r,n,a):0;return{width:n+i,height:d?t+Math.max(1,h)*Gr:t,legendOffset:a?.position==="left"?i:void 0,tooltip:s.enabled,tooltipFormatter:s.formatter,axisTooltipFormatter:s.axisFormatter,tooltipPortal:s.portal,tooltipPlacement:s.placement,tooltipAnchored:s.followPointer===!1?!0:void 0,description:e.description,decorative:e.decorative,animate:e.animate===!0?300:e.animate||void 0,responsive:!!e.responsive,shapes:m}}function ko(e){let n=e.legendOffset;if(!n)return e;let t=[...Ms(e.shapes.filter(i=>!i.part.startsWith("legend-")),n,0),...e.shapes.filter(i=>i.part.startsWith("legend-"))],r=i=>({...i,x:i.x+n}),o=e.hit?{...e.hit,plot:r(e.hit.plot),xs:e.hit.xs.map(i=>i+n),brush:e.hit.brush?{box:r(e.hit.brush.box),window:r(e.hit.brush.window)}:void 0}:void 0,a=e.edit,s=a?{...a,scale:i=>a.scale(i)+n,invert:i=>a.invert(i-n),bars:a.bars.map(i=>({...i,x0:i.x0+n,x1:i.x1+n}))}:void 0,d=e.map?{...e.map,plot:r(e.map.plot)}:void 0;return{...e,shapes:t,hit:o,edit:s,map:d,legendOffset:void 0}}function Wr(e,n,t,r,o,a="auto"){let s=Array.isArray(t)?t:[t],d=Math.max(1,Math.floor((r-12)/ie)),i=s.flatMap(w=>{let R=[],k=Array.from(w);for(;k.length>d;){let T=k.slice(0,d+1).lastIndexOf(" ");T<1&&(T=d),R.push(k.slice(0,T).join("")),k=k.slice(T),k[0]===" "&&k.shift()}return R.push(k.join("")),R}),c=Math.max(1,Math.floor((o-6)/16)),m=i.slice(0,c);i.length>c&&(m[c-1]=wo(`${m[c-1]}\u2026`,r-12));let h=Math.min(r,Math.max(0,...m.map(w=>Array.from(w).length))*ie+12),f=Math.min(o,6+m.length*16),y=a==="top"?{x:e-h/2,y:n-f-8}:a==="bottom"?{x:e-h/2,y:n+8}:a==="left"?{x:e-h-8,y:n-f/2}:a==="right"?{x:e+8,y:n-f/2}:{x:e+12,y:n-f-6},$=Math.max(0,Math.min(r-h,y.x)),b=Math.max(0,Math.min(o-f,y.y));return[{kind:"rect",part:"tooltip",title:s.join(`
|
|
2
|
+
`),x:l($),y:l(b),width:l(h),height:f,fill:"var(--skdx-color-surface-raised)",stroke:K.axis,rx:8},...m.map((w,R)=>({kind:"text",part:"tooltip-label",x:l($+6),y:l(b+11+R*16),text:w,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:m.length>1&&R===0?"bold":void 0}))]}function Gt(e,n){let[t,r]=we(e);return n?[Math.min(0,t),Math.max(0,r)]:[t,r]}function Ge([e,n],t,r=!1,o){let a=typeof r=="boolean"?{scale:r?"log":"linear"}:r,s=oe(a.format??o),d=a.min??e,i=a.max??n;a.reversed&&(t=[t[1],t[0]]);let c={id:a.id,position:a.position,options:a};if(a.scale==="sqrt"){let b=L=>Math.sign(L)*Math.sqrt(Math.abs(L)),w=a.nice===!1?[d,i]:ht(d,i,a.ticks),R=a.min??w[0],k=a.max??w[w.length-1],T=st([b(R),b(k)],t),E=L=>T(b(L)),M=ht(R,k,a.ticks).filter(L=>L>=R-1e-9&&L<=k+1e-9);return{...c,scale:E,domain:[R,k],format:s,ticks:(M.length>=2?M:[R,k]).map(L=>({pos:l(E(L)),label:s(L)})),zero:l(E(Math.min(Math.max(0,R),k)))}}if(a.scale==="log"){let b=Math.max(d,Number.EPSILON),w=Math.max(i,b),R=vs(b,w),k=[Math.log10(b),Math.log10(w)],T=st(k,t),E=M=>T(Math.log10(Math.max(M,Number.EPSILON)));return{...c,scale:E,domain:k,format:s,ticks:R.map(M=>({pos:l(E(M)),label:s(M)})),zero:l(t[0])}}let m=ht(d,i,a.ticks),h=[a.min??(a.nice===!1?d:m[0]),a.max??(a.nice===!1?i:m[m.length-1])],f=st(h,t),y=m.filter(b=>b>=h[0]-1e-9&&b<=h[1]+1e-9),$=(y.length>=2?y:[h[0],h[1]]).map(b=>({pos:l(f(b)),label:s(b)}));return{...c,scale:f,domain:h,format:s,ticks:$,zero:l(f(Math.min(Math.max(0,h[0]),h[1])))}}var qr=([e,n],t)=>Math.max(fe.left,ht(e,n).reduce((r,o)=>Math.max(r,t(o).length),0)*ie+14),Dn=e=>e?.grid!==!1;function Re(e,n){if(e.length<2)return e;let t=e.reduce((o,a)=>Math.max(o,a.label.length),0)*ie+8,r=Math.max(1,Math.ceil(e.length*t/Math.max(1,n)));return r===1?e:e.filter((o,a)=>a%r===0)}var $r=(e,n,t,r)=>`${e}, ${n}: ${r(t)}`;function le(e,n,t,r){let o=e.error!==void 0?"error":e.loading?"loading":n?"empty":null;if(!o)return null;let{width:a,height:s}=de(e,t,r),d=o==="error"?e.error:o==="loading"?"Loading\u2026":e.emptyMessage??"No data available",i=[];return o==="loading"&&i.push({kind:"rect",part:"skeleton",x:0,y:0,width:a,height:s,fill:"var(--skdx-color-surface-sunken)",rx:8}),i.push({kind:"text",part:`state-${o}`,x:l(a/2),y:l(s/2),text:d,anchor:"middle",baseline:"middle",fill:o==="error"?"var(--skdx-color-text-danger)":K.label}),{...he(e,a,s),shapes:i,tooltip:!1}}var nr=(e,n,t)=>{let r=n.length*ie/2;return e+r>t?"end":e-r<0?"start":"middle"};function Ze(e,n={}){let{plot:t,xTicks:r,yTicks:o,baseline:a}=e,s=t.x+t.width,d=t.y+t.height,i=[],c=n.grid??!0,m=($,b)=>b?{kind:"line",part:"grid",x1:$.pos,x2:$.pos,y1:t.y,y2:d,stroke:K.grid}:{kind:"line",part:"grid",x1:t.x,x2:s,y1:$.pos,y2:$.pos,stroke:K.grid},h=n.x?.tickRotation??0,f=($,b,w,R)=>h?J($,b,w,{part:R,anchor:h<0?"end":"start",baseline:"middle",rotate:h}):Yn($,b,w,e.width,{part:R,anchor:nr($,w,e.width)}),y=($,b,w,R,k)=>{for(let T of $)i.push(b==="x"?{kind:"line",part:"tick",x1:T.pos,x2:T.pos,y1:w,y2:l(w+R*k),stroke:K.axis}:{kind:"line",part:"tick",x1:w,x2:l(w+R*k),y1:T.pos,y2:T.pos,stroke:K.axis})};if(n.categoryGrid)for(let $ of r)i.push(m($,!n.horizontal));if(n.horizontal){let $=n.axes??[{ticks:o,position:"bottom",offset:0,label:n.yLabel,...n.y}];if(c)for(let b of o)i.push(m(b,!0));$[0]?.showLine!==!1&&i.push({kind:"line",part:"axis",x1:a,x2:a,y1:t.y,y2:d,stroke:K.axis});for(let b of $){let w=b.position==="top"||b.position==="right",R=l(w?t.y-b.offset:d+b.offset),k=w||b.offset>0;b.showLine&&k&&i.push({kind:"line",part:"axis",x1:t.x,x2:s,y1:R,y2:R,stroke:K.axis}),b.showTicks&&y(b.ticks,"x",R,w?-1:1,b.tickSize??4);let T=l(w?R-8:R+20);for(let E of b.ticks)i.push(w?J(E.pos,T,E.label,{part:"x-label-top",anchor:nr(E.pos,E.label,e.width)}):f(E.pos,T,E.label,"x-label"));b.label&&i.push(k?J(4,T,b.label,{part:"axis-title",anchor:"start",baseline:w?void 0:"middle"}):J(4,t.y-6,b.label,{part:"axis-title",anchor:"start"}))}n.x?.showLine&&i.push({kind:"line",part:"axis",x1:n.rtl?s:t.x,x2:n.rtl?s:t.x,y1:t.y,y2:d,stroke:K.axis}),n.x?.showTicks&&y(r,"y",n.rtl?s:t.x,n.rtl?1:-1,n.x.tickSize??4);for(let b of r)i.push(n.rtl?J(s+8,b.pos,b.label,{part:"y-label",anchor:"start",baseline:"middle"}):J(t.x-8,b.pos,b.label,{part:"y-label",anchor:"end",baseline:"middle"}))}else{if(c)for(let b of o)i.push(m(b,!1));n.y?.showLine!==!1&&i.push({kind:"line",part:"axis",x1:t.x,x2:s,y1:a,y2:a,stroke:K.axis});let $=n.axes??[{ticks:o,position:"left",offset:0,label:n.yLabel,...n.y},...n.rightTicks?[{ticks:n.rightTicks,position:"right",offset:0,label:n.rightLabel}]:[]];for(let b of $){let w=b.position==="left",R=w?t.x-b.offset:s+b.offset,k=w?"y-label":"y-label-right";b.showLine&&i.push({kind:"line",part:"axis",x1:l(R),x2:l(R),y1:t.y,y2:d,stroke:K.axis}),b.showTicks&&y(b.ticks,"y",l(R),w?-1:1,b.tickSize??4);for(let T of b.ticks)i.push(J(l(w?R-8:R+8),T.pos,T.label,{part:k,anchor:w?"end":"start",baseline:"middle"}));b.label&&i.push(J(l(w?b.offset===0?4:Math.max(4,R-40):b.offset===0?e.width-4:Math.min(e.width-4,R+40)),t.y-6,b.label,{part:"axis-title",anchor:w?"start":"end"}))}n.x?.showTicks&&y(r,"x",d,1,n.x.tickSize??4);for(let b of r)i.push(f(b.pos,d+(h?12:20),b.label,"x-label"))}return n.xLabel&&i.push(J(l(t.x+t.width/2),e.height-4,n.xLabel,{part:"axis-title",anchor:"middle"})),n.horizontal&&n.rightLabel&&i.push(J(e.width-4,t.y-6,n.rightLabel,{part:"axis-title",anchor:"end"})),i}var J=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:K.label,...r});function Yn(e,n,t,r,o={}){let a=Math.max(4,Math.min(r-4,e)),s=o.anchor??"start",d=s==="middle"?2*Math.min(a-4,r-a-4):s==="end"?a-4:r-a-4,i=wo(t,d);return{kind:"text",part:"label",x:a,y:n,fill:K.label,...o,text:i,title:i===t?o.title:t}}function ft(e){return e.flatMap(n=>{if(n.kind!=="text"||n.fill!=="var(--skdx-color-text-on-accent)"&&n.part!=="reference-label")return[n];let t=n.text.length*ie+8,r=n.x-(n.anchor==="middle"?t/2:n.anchor==="end"?t-4:4),o=n.y-(n.baseline==="hanging"?2:n.baseline==="middle"?9:14);return[{kind:"rect",part:"label-background",x:r,y:o,width:t,height:18,rx:8,fill:"var(--skdx-color-surface-raised)"},{...n,fill:n.part==="reference-label"?n.fill:"var(--skdx-color-text-default)"}]})}var Bt=(e,n,t,r,o,a)=>({kind:"circle",part:"point",cx:e,cy:n,r:t,fill:r,title:o,item:a});function Wt(e,n){let t=[],{plot:r}=n,o=r.x+r.width,a=r.y+r.height,s=i=>Math.max(r.x,Math.min(o,i)),d=i=>Math.max(r.y,Math.min(a,i));for(let i of e??[]){let c=i.color??Ft(i.variant),m=i.color??yo(i.variant),h={part:"reference-label",fill:m},f=n.horizontal===!0;if("y"in i){let y=l(n.y(i.y,i.axis??"left"));if(f){let $=s(y);t.push(...Ts($,r.y,a,c,i.label,h))}else{let $=d(y);t.push(...Is(r.x,o,$,c,i.label,h))}}else if("x"in i){let y=n.x(i.x);if(y===void 0)continue;f?t.push(...Is(r.x,o,d(l(y)),c,i.label,h)):t.push(...Ts(s(l(y)),r.y,a,c,i.label,h))}else if("y1"in i){let y=l(n.y(i.y1,i.axis??"left")),$=l(n.y(i.y2,i.axis??"left"));f?t.push(...Cs(s(Math.min(y,$)),s(Math.max(y,$)),r,c,i.label,m)):t.push(...As(d(Math.min(y,$)),d(Math.max(y,$)),r,c,i.label,m))}else{let y=n.x(i.x1),$=n.x(i.x2);if(y===void 0||$===void 0)continue;let b=l(Math.min(y,$)),w=l(Math.max(y,$));f?t.push(...As(d(b),d(w),r,c,i.label,m)):t.push(...Cs(s(b),s(w),r,c,i.label,m))}}return t}function Is(e,n,t,r,o,a){let s={kind:"line",part:"reference",x1:e,x2:n,y1:t,y2:t,stroke:r,dash:"6 4",strokeWidth:1.5,title:o};return o?[s,J(n-4,t-5,o,{...a,anchor:"end"})]:[s]}function Ts(e,n,t,r,o,a){let s={kind:"line",part:"reference",x1:e,x2:e,y1:n,y2:t,stroke:r,dash:"6 4",strokeWidth:1.5,title:o};return o?[s,J(e+4,n+10,o,{...a,anchor:"start"})]:[s]}function As(e,n,t,r,o,a){let s={kind:"rect",part:"reference-area",x:t.x,y:e,width:t.width,height:l(Math.max(0,n-e)),fill:r,opacity:.12,title:o};return o?[s,J(t.x+t.width-4,e+12,o,{part:"reference-label",fill:a,anchor:"end"})]:[s]}function Cs(e,n,t,r,o,a){let s={kind:"rect",part:"reference-area",x:e,y:t.y,width:l(Math.max(0,n-e)),height:t.height,fill:r,opacity:.12,title:o};return o?[s,J(e+4,t.y+12,o,{part:"reference-label",fill:a,anchor:"start"})]:[s]}function Fn(e,n){let t=[],{plot:r}=n,o=r.x+r.width,a=r.y+r.height;for(let s of e??[]){let d=s.color??Ft(s.variant),i=s.color??yo(s.variant),c=($,b,w)=>{let R=n.x($);if(R===void 0)return;let k=n.y(b,w??"left");return n.horizontal?{x:l(k),y:l(R)}:{x:l(R),y:l(k)}},m=s.id??s.label,h=$=>({label:$,id:m,name:s.label});if(s.type==="line"||s.type==="band"){let{type:$,id:b,...w}=s;t.push(...Wt([w],n));continue}if(s.type==="rect"){let $=c(s.x1,s.y1,s.axis),b=c(s.x2,s.y2,s.axis);if(!$||!b)continue;let w=Math.max(r.x,Math.min($.x,b.x)),R=Math.max(r.y,Math.min($.y,b.y)),k=s.label??"";t.push({kind:"rect",part:"annotation-rect",x:l(w),y:l(R),width:l(Math.max(0,Math.min(o,Math.max($.x,b.x))-w)),height:l(Math.max(0,Math.min(a,Math.max($.y,b.y))-R)),fill:d,opacity:.12,stroke:d,title:k||void 0,item:k?h(k):void 0}),s.label&&t.push(J(l(w+4),l(R+12),s.label,{part:"annotation-label",fill:i}));continue}let f=c(s.x,s.y,s.axis);if(!f)continue;if(s.type==="text"){t.push(J(f.x,f.y,s.text,{part:"annotation-text",fill:i,anchor:"middle",baseline:"middle",title:s.label}));continue}let y=s.label??`${String(s.x)}, ${s.y}`;if(t.push({kind:"circle",part:"annotation-point",cx:f.x,cy:f.y,r:5,fill:d,stroke:"var(--skdx-color-surface-default)",title:y,item:h(y)}),s.type==="callout"&&s.label){let[$,b]=s.offset??[16,-16],w=l(Math.max(r.x,Math.min(o,f.x+$))),R=l(Math.max(r.y,Math.min(a,f.y+b)));t.push({kind:"line",part:"annotation-leader",x1:f.x,y1:f.y,x2:w,y2:R,stroke:d},J(w,R,s.label,{part:"annotation-label",fill:i,anchor:$>=0?"start":"end",baseline:"middle"}))}}return t}var $o=2e3;function Di(e){if(e!=="none")return e===void 0||e==="auto"?{strategy:"lttb",threshold:$o}:typeof e=="string"?{strategy:e,threshold:$o}:{strategy:e.strategy,threshold:e.threshold??$o}}function Fi(e,n){let t=e.length;if(n>=t||n<3)return e.map((d,i)=>i);let r=[0],o=[],a=(t-2)/(n-2),s=0;for(let d=0;d<n-2;d++){let i=Math.floor((d+1)*a)+1,c=Math.min(t-1,Math.floor((d+2)*a)+1),m=0,h=0,f=0;for(let T=i;T<c;T++){let E=e[T];P(E)&&(m+=T,h+=E,f++)}m=f?m/f:(i+c)/2,h=f?h/f:0;let y=Math.floor(d*a)+1,$=Math.min(t-1,Math.floor((d+1)*a)+1),b=e[s],w=P(b)?b:0,R=-1,k=-1;for(let T=y;T<$;T++){let E=e[T];if(!P(E)){o.push(T);continue}let M=Math.abs((s-m)*(E-w)-(s-T)*(h-w));M>k&&(k=M,R=T)}R<0&&(R=y),r.push(R),s=R}return r.push(t-1),o.length?[...new Set([...r,...o])].sort((d,i)=>d-i):r}function Bi(e,n){let t=e.length,r=Math.max(1,Math.floor(n/2));if(r*2>=t)return e.map((s,d)=>d);let o=[],a=t/r;for(let s=0;s<r;s++){let d=Math.floor(s*a),i=s===r-1?t:Math.floor((s+1)*a),c=-1,m=-1;for(let h=d;h<i;h++){let f=e[h];if(!P(f)){o.push(h);continue}(c<0||f<e[c])&&(c=h),(m<0||f>e[m])&&(m=h)}c>=0&&o.push(Math.min(c,m)),m>=0&&m!==c&&o.push(Math.max(c,m))}return[...new Set(o)].sort((s,d)=>s-d)}function Pi(e,n){let t=e.length,r=Math.max(1,Math.floor(n/4));if(r*4>=t)return e.map((s,d)=>d);let o=[],a=t/r;for(let s=0;s<r;s++){let d=Math.floor(s*a),i=s===r-1?t:Math.floor((s+1)*a),c=-1,m=-1,h=-1,f=-1;for(let y=d;y<i;y++){let $=e[y];if(!P($)){o.push(y);continue}h<0&&(h=y),f=y,(c<0||$<e[c])&&(c=y),(m<0||$>e[m])&&(m=y)}for(let y of[h,c,m,f])y>=0&&o.push(y)}return[...new Set(o)].sort((s,d)=>s-d)}function Os(e,n,t){let r=Di(t);if(!r||n<=r.threshold||e.length===0)return;let o=r.strategy==="minmax"?Bi:r.strategy==="m4"?Pi:Fi,a=new Set;for(let s of e)for(let d of o(s.slice(0,n),r.threshold))a.add(d);return[...a].sort((s,d)=>s-d)}var Ir=e=>Math.max(0,Math.min(1,e));function Ss(e){let n=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(n){let r=n[1],o=r.length===3?r.split("").map(a=>a+a).join(""):r;return[0,2,4].map(a=>parseInt(o.slice(a,a+2),16))}let t=/^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)/i.exec(e.trim());return t?[Number(t[1]),Number(t[2]),Number(t[3])]:void 0}function Ls(e,n){if(e.length===0)return K.axis;if(e.length===1)return e[0];let t=Ir(n)*(e.length-1),r=Math.min(e.length-2,Math.floor(t)),o=t-r,a=Ss(e[r]),s=Ss(e[r+1]);if(!a||!s)return e[Math.round(t)];let d=i=>Math.round(a[i]+(s[i]-a[i])*o);return`rgb(${d(0)}, ${d(1)}, ${d(2)})`}var zs=(e,n)=>n!==void 0&&n>=2?Math.min(n-1,Math.floor(Ir(e)*n))/(n-1):Ir(e);function Pt(e,n,t,r=K.negative,o=String){let[a,s]=we(n),d=e??{type:"sequential"},i=w=>l(.15+.85*w);if(d.type==="threshold"){let{thresholds:w,colors:R,labels:k}=d,T=M=>{if(typeof M!="number"||!Number.isFinite(M))return;let L=0;for(;L<w.length&&M>=w[L];)L++;return{fill:R[Math.min(L,R.length-1)]??t,opacity:1}},E=R.map((M,L)=>({fill:M,opacity:1,label:k?.[L]??(L===0?`< ${o(w[0]??0)}`:L===w.length?`\u2265 ${o(w[L-1])}`:`${o(w[L-1])} \u2013 ${o(w[L])}`)}));return{color:T,domain:[a,s],swatches:E,kind:"threshold"}}if(d.type==="ordinal"){let w=d.colors?.length?d.colors:[t];return{color:k=>typeof k=="number"&&Number.isFinite(k)?{fill:w[Math.abs(Math.round(k))%w.length],opacity:1}:void 0,domain:[a,s],swatches:w.map((k,T)=>({fill:k,opacity:1,label:String(T)})),kind:"ordinal"}}if(d.type==="diverging"){let[w,R,k]=d.domain??[-Math.max(Math.abs(a),Math.abs(s)),0,Math.max(Math.abs(a),Math.abs(s))],T=d.colors,E=z=>z<R?.5*(z-w)/Math.max(1e-12,R-w):.5+.5*(z-R)/Math.max(1e-12,k-R),M=z=>{let O=zs(d.reversed?1-Ir(z):z,d.steps);if(T&&T.length>=2)return{fill:Ls(T,O),opacity:1};let V=O<.5?r:t,g=Math.abs(O-.5)*2;return{fill:V,opacity:i(g)}},L=z=>typeof z=="number"&&Number.isFinite(z)?M(E(z)):void 0,S=d.steps??5,D=Array.from({length:S},(z,O)=>{let V=S===1?.5:O/(S-1),g=V<.5?w+(R-w)*(V*2):R+(k-R)*((V-.5)*2);return{...M(V),label:o(g)}});return{color:L,domain:[w,k],swatches:D,kind:"diverging"}}let[c,m]=d.domain??[a,s],h=d.colors,f=w=>{let R=zs(d.reversed?1-Ir(w):w,d.steps);return h&&h.length>=2?{fill:Ls(h,R),opacity:1}:{fill:h?.[0]??t,opacity:i(R)}},y=w=>typeof w!="number"||!Number.isFinite(w)?void 0:f(m===c?1:(w-c)/(m-c)),$=d.steps??5,b=Array.from({length:$},(w,R)=>{let k=$===1?1:R/($-1);return{...f(k),label:o(c+(m-c)*k)}});return{color:y,domain:[c,m],swatches:b,kind:"sequential"}}var Vi=34,Hi=72;function Bn(e){if(!e)return{bottom:0,right:0,options:{}};let n=e===!0?{}:e;return n.orientation==="vertical"?{bottom:0,right:Hi,options:n}:{bottom:Vi,right:0,options:n}}function rr(e,n,t){let r=typeof t=="string"?{title:t}:t??{},o=r.title,a=e.swatches;if(a.length===0||n.width<=0)return[];if(r.orientation==="vertical"){let m=Math.max(0,n.height-(o?16:0)),h=Math.min(16,m/a.length),f=n.y+(o?16:0),y=a.map((b,w)=>({kind:"rect",part:"color-legend-swatch",x:l(n.x),y:l(f+w*h),width:10,height:l(h),fill:b.fill,opacity:b.opacity,title:b.label})),$=h>=12?1:2;return a.forEach((b,w)=>{w%$!==0&&w!==a.length-1||y.push({kind:"text",part:"color-legend-label",x:l(n.x+14),y:l(f+(w+.5)*h),text:b.label,baseline:"middle",fill:K.label})}),o&&y.push({kind:"text",part:"color-legend-title",x:l(n.x),y:l(n.y+6),text:o,baseline:"middle",fill:K.label}),y}let s=Math.min(n.width/a.length,96),d=n.x+(n.width-s*a.length)/2,i=a.map((m,h)=>({kind:"rect",part:"color-legend-swatch",x:l(d+h*s),y:l(n.y),width:l(s),height:10,fill:m.fill,opacity:m.opacity,title:m.label})),c=e.kind==="threshold"?1:Math.max(1,Math.ceil(a.length*7*ie/Math.max(1,s*a.length)));return a.forEach((m,h)=>{h%c!==0&&h!==a.length-1||i.push({kind:"text",part:"color-legend-label",x:l(d+(h+.5)*s),y:l(n.y+22),text:m.label,anchor:"middle",fill:K.label})}),o&&i.push({kind:"text",part:"color-legend-title",x:l(d-6),y:l(n.y+5),text:o,anchor:"end",baseline:"middle",fill:K.label}),i}var _i=1e4,ji=e=>Array.isArray(e)?{x:e[0],y:e[1],size:e[2],label:void 0,id:void 0,color:void 0,value:void 0}:{x:e.x,y:e.y,size:e.size,label:e.label,id:e.id,color:e.color,value:e.value};function Io(e,n,t,r,o,a,s,d){if(r==="circle")return{...Bt(e,n,t,o,a,s),part:d};let i=r==="square"?`M${l(e-t)} ${l(n-t)}h${l(2*t)}v${l(2*t)}h${l(-2*t)}Z`:r==="diamond"?`M${l(e)} ${l(n-t*1.3)}L${l(e+t*1.3)} ${l(n)}L${l(e)} ${l(n+t*1.3)}L${l(e-t*1.3)} ${l(n)}Z`:`M${l(e)} ${l(n-t*1.2)}L${l(e+t*1.15)} ${l(n+t*.9)}L${l(e-t*1.15)} ${l(n+t*.9)}Z`;return{kind:"path",part:d,d:i,fill:o,title:a,item:s}}function To(e,n){let t=[],r=e.series.map((B,_)=>({name:B.name,id:B.id,symbol:B.symbol??"circle",color:ne(e,_,B.color),data:xe(e,B.name)?[]:B.data.flatMap((W,ee)=>{let te=ji(W);return P(te.x)&&P(te.y)?[{...te,index:ee}]:[]})})),o=e.sampling==="auto"?_i:typeof e.sampling=="object"?e.sampling.threshold:1/0,a=r.reduce((B,_)=>B+_.data.length,0),s=a>o?Math.ceil(a/o):1;s>1&&t.push({code:"sampled",severity:"warning",message:`${a} points exceed the sampling threshold of ${o}; every ${s}th point is drawn.`});let d=s>1?r.map(B=>({...B,data:B.data.filter((_,W)=>W%s===0)})):r,i=d.flatMap(B=>B.data),c=le(e,i.length===0);if(c)return{...c,issues:t};let{width:m,height:h}=de(e),f=e.colorScale?Bn(e.colorLegend):{bottom:0,right:0,options:{}},y=e.series.map((B,_)=>({name:B.name,color:ne(e,_,B.color)})),$=Te(m,h,{...fe,top:fe.top+ue(e,y,m)+(e.yAxis?.label?12:0),right:fe.right+f.right,bottom:fe.bottom+(e.xAxis?.label?14:0)+f.bottom}),b=e.markerSize??3,w=Math.max(0,e.hitRadius??0),R=Math.max(0,e.jitter??0),k=we(i.map(B=>B.size)),T=B=>B==="diamond"?1.3:B==="triangle"?1.2:1,E=(B,_)=>Math.max(0,_?n.radius(B.size,k):b),M=0;for(let B of d){let _=B.data.some(ee=>ee.size!==void 0),W=T(B.symbol);for(let ee of B.data)M=Math.max(M,E(ee,_)*W)}let L=Math.min(1,Math.min($.width,$.height)*.45/Math.max(1,M+R)),S=R*L,D=M*L+S,z=new Map,O=e.colorScale?Pt(e.colorScale,i.map(B=>B.value),ne(e,0),void 0,oe(e.format)):void 0,V=Ge(Gt(i.map(B=>B.x),!1),[$.x+D,$.x+$.width-D],e.xAxis??{},e.format),g=Ge(Gt(i.map(B=>B.y),!1),[$.y+$.height-D,$.y+D],e.yAxis??{},e.format),x=he(e,m,h,y),C=[],v=[],F=[],U=[];for(let B of d){let _=B.data.some(W=>W.size!==void 0);for(let W of B.data){let ee=W.index,te=n.describe(B.name,W,V,g),re=E(W,_)*L,me=l(V.scale(W.x)),be=l(g.scale(W.y));if(S>0){let Fe=`${Math.round(me)},${Math.round(be)}`,Be=z.get(Fe)??0;if(z.set(Fe,Be+1),Be>0){let Mt=Be*2.399963;me=l(me+S*Math.cos(Mt)),be=l(be+S*Math.sin(Mt))}}let Z=O?.color(W.value),ae={label:te,id:W.id,series:B.name,seriesId:B.id??B.name,name:W.label,index:ee,value:W.y},ke=W.color??Z?.fill??B.color;if(C.push(Io(me,be,l(re),B.symbol,ke,te,ae,_?n.part:"point")),w>0&&C.push({kind:"circle",part:"hit",cx:me,cy:be,r:l(re+w),fill:ke,opacity:0,title:te,item:ae}),e.labels&&W.label){let Fe=W.label.length*ie,Be=me-Fe/2,Mt=be-re-4;U.some(wt=>Math.abs(wt.y-Mt)<12&&Be<wt.x+wt.w+4&&Be+Fe+4>wt.x)||(U.push({x:Be,y:Mt,w:Fe}),v.push(J(me,l(Mt),W.label,{part:"point-label",anchor:"middle",fill:"var(--skdx-color-text-default)"})))}}if(e.trendline&&B.data.length>=2){let W=e.trendline===!0?"linear":e.trendline,ee=Gi(B.data.map(te=>[te.x,te.y]),W);if(ee){let[te,re]=V.domain,me=`${B.name} trend${W==="linear"?"":` (${W})`}: r\xB2 ${ee.r2.toFixed(2)}`,be=B.color;if(W==="linear")F.push({kind:"line",part:"trendline",x1:l(V.scale(te)),y1:l(g.scale(ee.predict(te))),x2:l(V.scale(re)),y2:l(g.scale(ee.predict(re))),stroke:be,dash:"5 4",strokeWidth:1.5,title:me});else{let Z=Array.from({length:40},(ae,ke)=>te+(re-te)*ke/39).map(ae=>({v:ae,p:ee.predict(ae)})).filter(({p:ae})=>Number.isFinite(ae)).map(({v:ae,p:ke})=>({x:l(V.scale(ae)),y:l(g.scale(ke))}));Z.length>1&&F.push({kind:"path",part:"trendline",d:it(Z),stroke:be,dash:"5 4",strokeWidth:1.5,title:me})}}}}let Y=-1/0,j=Re(V.ticks,Math.max(1,$.width-2*D)),I=new Set;for(let B of[...j].sort((_,W)=>_.pos-W.pos)){let _=B.label.length*ie,W=e.xAxis?.tickRotation??0,ee=W?W<0?"end":"start":nr(B.pos,B.label,m),te=-(ee==="end"?_:ee==="middle"?_/2:0),re=W*Math.PI/180,me=[te,te+_].flatMap(ae=>[-7,7].map(ke=>B.pos+ae*Math.cos(re)-ke*Math.sin(re))),be=Math.min(...me),Z=Math.max(...me);be<Y+4||(Y=Z,I.add(B))}let G=j.filter(B=>I.has(B)),H={...x,plot:$,xTicks:G,yTicks:g.ticks,baseline:g.zero},Q={plot:$,x:B=>V.scale(qe(B)),y:B=>g.scale(B)},p=Wt(e.references,Q),q=O&&(f.bottom||f.right)?rr(O,f.right?{x:$.x+$.width+12,y:$.y,width:f.right,height:$.height}:{x:$.x,y:h-f.bottom+8,width:$.width,height:f.bottom},f.options):[],N=n.opacity;return{...x,shapes:[...Ze({...H,height:H.height-f.bottom},{xLabel:e.xAxis?.label,x:e.xAxis,y:{showLine:e.yAxis?.showLine,showTicks:e.yAxis?.showTicks,tickSize:e.yAxis?.tickSize,tickRotation:e.yAxis?.tickRotation}}),...e.yAxis?.label?[J(4,$.y-14,e.yAxis.label,{part:"axis-title",anchor:"start"})]:[],...p,...N!==void 0&&C.some(B=>B.part===n.part)?C.map(B=>(B.kind==="circle"||B.kind==="path")&&B.part!=="hit"?{...B,opacity:N}:B):C,...F,...v,...Fn(e.annotations,Q),...q,...x.shapes],issues:t}}function Gi(e,n="linear"){let t;if(n==="polynomial"){let i=0,c=0,m=0,h=0,f=0,y=0,$=0,b=0;for(let[L,S]of e)i+=1,c+=L,m+=L*L,h+=L**3,f+=L**4,y+=S,$+=L*S,b+=L*L*S;let w=L=>L[0]*(L[4]*L[8]-L[5]*L[7])-L[1]*(L[3]*L[8]-L[5]*L[6])+L[2]*(L[3]*L[7]-L[4]*L[6]),k=w([f,h,m,h,m,c,m,c,i]);if(Math.abs(k)<1e-12)return;let T=w([b,h,m,$,m,c,y,c,i])/k,E=w([f,b,m,h,$,c,m,y,i])/k,M=w([f,h,b,h,m,$,m,c,y])/k;t=L=>T*L*L+E*L+M}else{let i=n==="logarithmic"||n==="power"?Math.log:y=>y,c=n==="exponential"||n==="power"?Math.log:y=>y,m=e.filter(([y,$])=>Number.isFinite(i(y))&&Number.isFinite(c($))),h=Wi(m.map(([y,$])=>[i(y),c($)]));if(!h)return;let f=n==="exponential"||n==="power"?Math.exp:y=>y;t=y=>f(h.intercept+h.slope*i(y))}let r=t,o=e.filter(([i])=>Number.isFinite(r(i)));if(o.length===0)return;let a=o.reduce((i,[,c])=>i+c,0)/o.length,s=0,d=0;for(let[i,c]of o)s+=(c-r(i))**2,d+=(c-a)**2;return{predict:r,r2:d===0?1:Math.max(0,1-s/d)}}function Ao(e){let[n,t]=e.sizeRange??[3,18];return To(e,{part:"bubble",opacity:.7,radius:(r,[o,a])=>P(r)?a===o?(n+t)/2:n+Math.sqrt((r-o)/(a-o))*(t-n):3,describe:(r,o,a,s)=>`${r}${o.label?` ${o.label}`:""}: ${a.format(o.x)}, ${s.format(o.y)}${P(o.size)?` (${s.format(o.size)})`:""}`})}function Wi(e){let n=e.length,t=e.reduce((c,m)=>c+m[0],0)/n,r=e.reduce((c,m)=>c+m[1],0)/n,o=0,a=0,s=0;for(let[c,m]of e)o+=(c-t)**2,a+=(c-t)*(m-r),s+=(m-r)**2;if(o===0)return;let d=a/o,i=s===0?1:a*a/(o*s);return{slope:d,intercept:r-d*t,r2:i}}var qi=e=>{let n=0;return e.map(t=>P(t)?n+=t:null)},Zi=e=>e.map((n,t)=>{let r=e[t-1];return t>0&&P(n)&&P(r)?n-r:null}),Ui=e=>e.map((n,t)=>{let r=e[t-1];return t>0&&P(n)&&P(r)&&r!==0?(n-r)/Math.abs(r):null});function Co(e,n){let t=Math.max(1,Math.floor(n));return e.map((r,o)=>{if(o<t-1)return null;let a=0;for(let s=o-t+1;s<=o;s++){let d=e[s];if(!P(d))return null;a+=d}return a/t})}function Rs(e,n){let t=Math.max(1,Math.floor(n)),r=2/(t+1),o,a=0,s=0;return e.map(d=>P(d)?o===void 0?(a+=d,s++,s<t?null:(o=a/t,o)):(o=r*d+(1-r)*o,o):o??null)}function Yi(e,n="max"){let t=0;for(let r of e)P(r)&&(t=n==="sum"?t+r:Math.max(t,r));return e.map(r=>P(r)?t===0?0:r/t:null)}function Ki(e,n="desc"){let t=e.filter(P).sort((r,o)=>n==="asc"?r-o:o-r);return e.map(r=>P(r)?t.indexOf(r)+1:null)}var Xi=(e,n=-1/0,t=1/0)=>e.map(r=>P(r)&&r>=n&&r<=t?r:null),Qi=(e,n="asc")=>[...e].sort((t,r)=>P(t)?P(r)?n==="asc"?t-r:r-t:-1:P(r)?1:0);function Ji(e,n,t="sum"){let r=Math.max(1,Math.floor(n)),o=[];for(let a=0;a<e.length;a+=r){let s=e.slice(a,a+r).filter(P);if(s.length===0){o.push(null);continue}let d=s.reduce((i,c)=>i+c,0);o.push(t==="sum"?d:t==="mean"?d/s.length:t==="min"?Math.min(...s):Math.max(...s))}return o}function el(e,n={}){let t=e.filter(P),r=er(t,n);return{edges:r,counts:tr(t,r).map(o=>o.count)}}function Oo(e,n){let t=[...e];for(let r of n??[])switch(r.type){case"cumulative":t=qi(t);break;case"difference":t=Zi(t);break;case"percentageChange":t=Ui(t);break;case"movingAverage":t=Co(t,r.window);break;case"normalize":t=Yi(t,r.to);break;case"rank":t=Ki(t,r.order);break;case"filter":t=Xi(t,r.min,r.max);break;case"sort":t=Qi(t,r.order);break;case"aggregate":t=Ji(t,r.every,r.method);break;case"bin":t=el(t,r).counts;break}return t}var tl=100,nl=2e3,Ns=32,Es=28,Ur=e=>e.position==="right"||e.position==="top";function rl(e){let t=(e.yAxis===void 0?[]:Array.isArray(e.yAxis)?e.yAxis:[e.yAxis]).map((o,a)=>({...o,id:o.id??(a===0?"left":a===1?"right":String(a)),position:o.position??(a===1?"right":"left")}));t.length===0&&t.push({id:"left",position:"left"});let r=t.some(o=>o.id==="right"||Ur(o));return e.rightAxis?t.push({...e.rightAxis,id:"right",position:"right"}):!r&&e.series.some(o=>o.axis==="right")&&t.push({id:"right",position:"right"}),t}function Fs(e,n){let t=e[0]?.id;return n===void 0||n==="left"?t:n==="right"?(e.find(r=>r.id==="right")??e.find(Ur))?.id:e.find(r=>r.id===n)?.id}var Zr=e=>e.kind==="bar"||e.kind==="range"&&e.style==="bar";function qt(e,n){let t=oe(e.format),{series:r,categories:o,issues:a,axes:s}=al(e,n,t),d=e.direction==="rtl",i=e.baseline??0,c=Math.max(o.length,...r.map(A=>Math.max(A.data.length,A.low.length))),m=r.every(A=>He(A.data).length===0&&He(A.high).length===0),h=le(e,m);if(h)return{...h,issues:a};let f=e.xAxis?.type??"category",y=f!=="category"&&o.length>0&&o.every(A=>typeof A!="string"||f==="time"&&P(qe(A))),$=y?o.map(qe):[],[b,w]=we($),R=e.xAxis?.format??(f==="time"?{style:w-b<2*864e5?"time":"date"}:void 0),k=Array.from({length:c},(A,se)=>{let pe=o[se];return pe===void 0?String(se+1):Qt(pe,R)}),T=ol(e.zoom,c),E=Array.from({length:T.end-T.start},(A,se)=>T.start+se),M=e.orientation==="horizontal",S=r.map(A=>({...A,hidden:A.hidden||M&&!Zr(A)})).filter(A=>!A.hidden),D=S.some(A=>!Zr(A))?Os(S.filter(A=>!Zr(A)).map(A=>E.map(se=>(A.kind==="range"?A.high[se]:A.data[se])??null)),E.length,e.sampling):void 0,z=D?D.map(A=>E[A]):E,O=e.stacked==="percent"||e.stackOffset==="expand",V=e.stackOffset??"zero",g=new Map,x=new Map,C=new Map;for(let A of S)A.stack!==void 0&&A.kind!=="range"&&C.set(A.stack,[...C.get(A.stack)??[],A]);for(let A of C.values()){let se=new Array(c).fill(i),pe=new Array(c).fill(i),Oe=new Array(c).fill(0);if(O)for(let Ie of A)Ie.data.forEach((Me,Se)=>{P(Me)&&(Oe[Se]=Oe[Se]+Math.abs(Me))});for(let Ie of A){let Me=[],Se=[];for(let $e=0;$e<c;$e++){let Ce=Ie.data[$e];if(!P(Ce)){Me.push(null),Se.push(null);continue}let ve=Oe[$e],ge=O?ve>0?Ce/ve:0:Ce,Le=ge>=0?se:pe;Me.push(Le[$e]),Le[$e]=Le[$e]+ge,Se.push(Le[$e])}g.set(Ie,Me),x.set(Ie,Se)}if(V==="silhouette"||V==="wiggle"){let Ie=new Array(c).fill(0);if(V==="silhouette")for(let Me=0;Me<c;Me++)Ie[Me]=-(se[Me]-i)/2;else{let Me=0;for(let Se=0;Se<c;Se++){let $e=A.length,Ce=0;for(let ge=0;ge<$e;ge++){let Le=A[ge],Ee=Le.data[Se],Pe=Le.data[Se-1],ut=Se>0&&P(Ee)&&P(Pe)?Ee-Pe:0;Ce+=($e-ge-.5)*ut}let ve=se[Se]-i;Me=Se===0?-ve/2:Me-(ve>0?Ce/Math.max(1,$e):0),Ie[Se]=Me}}for(let Me of A){let Se=g.get(Me),$e=x.get(Me);for(let Ce=0;Ce<c;Ce++){let ve=Se[Ce],ge=$e[Ce];P(ve)&&(Se[Ce]=ve+Ie[Ce]),P(ge)&&($e[Ce]=ge+Ie[Ce])}}}}let v=A=>A.kind==="range"?{from:A.low,to:A.high}:{from:g.get(A)??new Array(c).fill(i),to:x.get(A)??A.data},F=A=>{let se=[],pe=!1;for(let Me of S){if(Me.axis!==A)continue;let{from:Se,to:$e}=v(Me);for(let Ce of z){let ve=$e[Ce];if(P(ve)&&se.push(ve),Me.kind==="range"||Me.stack!==void 0){let ge=Se[Ce];P(ge)&&se.push(ge)}}if(Me.errors)for(let Ce of z){let ve=Ds(Me.data[Ce],Me.errors[Ce]);ve&&se.push(ve[0],ve[1])}(Me.kind==="bar"||Me.kind==="area")&&V==="zero"&&(pe=!0)}let[Oe,Ie]=we(se);return pe?[Math.min(i,Oe),Math.max(i,Ie)]:[Oe,Ie]},{width:U,height:Y}=de(e),j=e.brush?Ns+Es:0,I=z.reduce((A,se)=>Math.max(A,k[se].length),0)*ie,G=O?{style:"percent"}:void 0,H=A=>{if(A.scale==="log")return fe.left;let[se,pe]=F(A.id),Oe=oe(A.format??G??e.format);return qr([A.min??se,A.max??pe],Oe)+(A.showTicks?A.tickSize??4:0)},Q=A=>M?Ur(A)?"top":"bottom":Ur(A)!==d?"right":"left",p=A=>M?24+(A.showTicks?A.tickSize??4:0):H(A),q=new Set(S.map(A=>A.axis)),N=s.filter(A=>q.has(A.id)||s.length>1),B=new Map,_={left:0,right:0,top:0,bottom:0};for(let A of N){let se=Q(A);B.set(A.id,_[se]),_[se]+=p(A)}let W=N.find(A=>Q(A)==="bottom"),ee=r.map(A=>({name:A.name,color:A.color})),te={top:fe.top+ue(e,ee,U)+(s.some(A=>A.label)?12:0)+_.top,right:M?d?Math.max(fe.left,I+16):fe.right:Math.max(fe.right,_.right),bottom:fe.bottom+j+(e.xAxis?.label?14:0)+(e.xAxis?.tickRotation?24:0)+_.bottom-(W?p(W):0),left:M?d?fe.right:Math.max(fe.left,I+16):Math.max(fe.left,_.left)},re=Te(U,Y,te),me=M?d?[re.x+re.width,re.x]:[re.x,re.x+re.width]:[re.y+re.height,re.y],be=M?[re.y,re.y+re.height]:d?[re.x+re.width,re.x]:[re.x,re.x+re.width],Z=new Map(s.map(A=>[A.id,{...Ge(F(A.id),me,{format:G,...A},e.format),position:Q(A),offset:B.get(A.id)??0}])),ae=s[0]?.id,ke=Z.get(ae),Fe=A=>Z.get(Fs(s,A)??ae)??ke,Be=(A,se)=>Fe(se).scale(A),Mt=A=>l(A.scale(Math.min(Math.max(i,Math.min(...A.domain)),Math.max(...A.domain)))),wt=je(z.length,be,e.barGap),Cn=z.map(A=>$[A]),Nn=[...Cn].sort((A,se)=>A-se),un=1/0;for(let A=1;A<Nn.length;A++)un=Math.min(un,Nn[A]-Nn[A-1]);let[Mn,mt]=we(Cn),kt=un===1/0?Math.max(1,Math.abs(mt)*.05||1):un/2,hn=st([Mn-kt,mt+kt],be),qn=A=>l(y?hn(Cn[A]):wt.center(A)),ns=y?Math.abs(hn(Mn+(un===1/0?kt:un))-hn(Mn))*.8:wt.bandwidth,rs=A=>y?qn(A)-ns/2:wt.start(A),gi=y?(f==="time"?Jn(Mn-kt,mt+kt):ht(Mn-kt,mt+kt)).filter(A=>A>=Mn-kt&&A<=mt+kt).map(A=>({pos:l(hn(A)),label:Qt(A,R)})):Re(z.map((A,se)=>({pos:qn(se),label:k[A]})),M?1/0:re.width/Math.max(.2,Math.abs(Math.cos((e.xAxis?.tickRotation??0)*Math.PI/180)))),oo={...he(e,U,Y,ee),plot:re,xTicks:gi,yTicks:M?Re(ke.ticks,re.width):ke.ticks,baseline:Mt(ke)},xi=s[0],os=Ze(oo,{horizontal:M,rtl:d,axes:N.map(A=>{let se=Z.get(A.id);return{ticks:M?Re(se.ticks,re.width):se.ticks,position:se.position,offset:se.offset??0,label:A.label,showLine:A.showLine,showTicks:A.showTicks,tickSize:A.tickSize}}),xLabel:e.xAxis?.label,grid:Dn(xi),categoryGrid:e.xAxis?.grid===!0,x:e.xAxis}),yi=A=>{if(typeof A=="number"&&o.every(pe=>typeof pe=="string"))return A;let se=typeof A=="string"?A:qe(A);for(let pe=0;pe<c;pe++){let Oe=o[pe];if(Oe!==void 0&&(typeof se=="string"?Oe===se||k[pe]===se:qe(Oe)===se))return pe}},as={plot:re,horizontal:M,x:A=>{if(y&&(typeof A!="string"||P(qe(A))))return hn(qe(A));let se=yi(A),pe=se===void 0?-1:z.indexOf(se);return pe<0?void 0:wt.center(pe)},y:(A,se)=>Be(A,se)},ss=Wt(e.references,as);os.push(...ss.filter(A=>A.part!=="reference-label"));let vi=ft(ss.filter(A=>A.part==="reference-label")),ao=[],so=new Map;for(let A of S){if(!Zr(A))continue;let se=A.stack??A,pe=ao.indexOf(se);pe<0&&(pe=ao.push(se)-1),so.set(A,pe)}let Dr=ns/Math.max(1,ao.length),En=Math.min(Dr,e.barWidth??1/0),is=(Dr-En)/2,io=[],Fr=[],lo=[],co=[],mo=[],ls=[],Br=[],Pr=A=>Fe(A.axis).format,uo=Math.max(0,e.minBarSize??0),Mi=(A,se,pe)=>{let Oe=Math.abs(se-A);if(Oe>=uo)return[Math.min(A,se),Oe];let Me=A+(M?pe?1:-1:pe?-1:1)*uo;return[Math.min(A,Me),uo]},pr=(A,se,pe,Oe)=>({label:Oe,series:A.name,seriesId:A.id??A.name,category:k[se],index:se,value:pe}),cs=(A,se,pe,Oe)=>{let Ie=Ds(Oe,A.errors?.[se]);if(!Ie)return;let Me=l(Be(Ie[0],A.axis)),Se=l(Be(Ie[1],A.axis)),$e=4,Ce="var(--skdx-color-text-default)",ve=`${A.name}, ${k[se]}: ${Pr(A)(Ie[0])} \u2013 ${Pr(A)(Ie[1])}`;ls.push(M?{kind:"line",part:"error-bar",x1:Me,x2:Se,y1:pe,y2:pe,stroke:Ce,title:ve}:{kind:"line",part:"error-bar",x1:pe,x2:pe,y1:Me,y2:Se,stroke:Ce,title:ve},M?{kind:"line",part:"error-cap",x1:Me,x2:Me,y1:l(pe-$e),y2:l(pe+$e),stroke:Ce}:{kind:"line",part:"error-cap",x1:l(pe-$e),x2:l(pe+$e),y1:Me,y2:Me,stroke:Ce},M?{kind:"line",part:"error-cap",x1:Se,x2:Se,y1:l(pe-$e),y2:l(pe+$e),stroke:Ce}:{kind:"line",part:"error-cap",x1:l(pe-$e),x2:l(pe+$e),y1:Se,y2:Se,stroke:Ce})};for(let A of S){let{from:se,to:pe}=v(A),Oe=Pr(A),Ie=z.length<=nl;if(A.kind==="bar"){let ve="";z.forEach((ge,Le)=>{let Ee=A.data[ge],Pe=se[ge],ut=pe[ge];if(!P(Ee)||!P(Pe)||!P(ut))return;let Qn=Be(Pe,A.axis),Zn=Be(ut,A.axis),[br,gr]=Mi(Qn,Zn,ut>=Pe),xr=rs(Le)+so.get(A)*Dr+is,ms=l(M?br:xr),us=l(M?xr:br),ho=l(M?gr:En),hs=l(M?En:gr);if(!Ie){ve+=`M${ms} ${us}h${ho}v${hs}h${-ho}Z`;return}let fs=$r(A.name,k[ge],O?ut-Pe:Ee,Oe);if(Fr.push({kind:"rect",part:"bar",x:ms,y:us,width:ho,height:hs,fill:A.color,rx:e.radius,title:fs,item:pr(A,ge,Ee,fs)}),cs(A,ge,l(xr+En/2),Ee),e.labels){let ps=Oe(O?ut-Pe:Ee);mo.push(M?J(l(Math.max(Qn,Zn)+4),l(xr+En/2),ps,{baseline:"middle"}):J(l(xr+En/2),l(Math.min(Qn,Zn)-4),ps,{anchor:"middle"}))}}),ve&&Fr.push({kind:"path",part:"bars",d:ve,fill:A.color,title:A.name});continue}if(A.kind==="range"&&A.style==="bar"){z.forEach((ve,ge)=>{let Le=se[ve],Ee=pe[ve];if(!P(Le)||!P(Ee))return;let Pe=Be(Math.min(Le,Ee),A.axis),ut=Be(Math.max(Le,Ee),A.axis),Qn=rs(ge)+so.get(A)*Dr+is,Zn=`${A.name}, ${k[ve]}: ${Oe(Math.min(Le,Ee))} \u2013 ${Oe(Math.max(Le,Ee))}`,br=pr(A,ve,Ee,Zn),gr=Math.max(1,Math.abs(ut-Pe));Fr.push(M?{kind:"rect",part:"range",x:l(Math.min(Pe,ut)),y:l(Qn),width:l(gr),height:l(En),fill:A.color,rx:e.radius,title:Ie?Zn:void 0,item:br}:{kind:"rect",part:"range",x:l(Qn),y:l(Math.min(Pe,ut)),width:l(En),height:l(gr),fill:A.color,rx:e.radius,title:Ie?Zn:void 0,item:br})});continue}let Me=e.nulls==="connect"||e.nulls===void 0&&e.connectNulls,Se=[],$e=[];z.forEach((ve,ge)=>{let Le=se[ve],Ee=pe[ve];if(!P(Ee)||!P(Le)){!Me&&$e.length&&(Se.push($e),$e=[]);return}$e.push({x:qn(ge),y:l(Be(Ee,A.axis)),y0:l(Be(Le,A.axis)),i:ve})}),$e.length&&Se.push($e);let Ce=A.markers??z.length<=tl;for(let ve of Se){let ge=it(ve,A.curve);if(A.kind==="range"&&A.style==="line"){lo.push({kind:"path",part:"range-high",d:ge,stroke:A.color,strokeWidth:2,strokeLinejoin:"round"},{kind:"path",part:"range-low",d:it(ve.map(Le=>({x:Le.x,y:Le.y0})),A.curve),stroke:A.color,strokeWidth:2,strokeLinejoin:"round",dash:"4 3"});continue}if(A.kind==="range"){let Le=it([...ve].reverse().map(Ee=>({x:Ee.x,y:Ee.y0})),A.curve);io.push({kind:"path",part:"range",d:`${ge}L${Le.slice(1)}Z`,fill:A.color,fillOpacity:.2,title:A.name});continue}if(A.kind==="area"){let Le=Mt(Fe(A.axis)),Ee=A.stack!==void 0?it([...ve].reverse().map(ut=>({x:ut.x,y:ut.y0})),A.curve).slice(1):`${ve[ve.length-1]?.x} ${Le}L${ve[0]?.x} ${Le}`,Pe=`skdx-g-${A.index}`;A.gradient&&!Br.some(ut=>ut.id===Pe)&&Br.push({id:Pe,vertical:!0,stops:[{offset:0,color:A.color,opacity:A.fillOpacity},{offset:1,color:A.color,opacity:0}]}),io.push({kind:"path",part:"area",d:`${ge}L${Ee}Z`,fill:A.gradient?`url(#${Pe})`:A.color,fillOpacity:A.gradient?void 0:A.fillOpacity})}lo.push({kind:"path",part:"line",d:ge,stroke:A.color,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",dash:A.dash})}if(A.kind==="range"&&Ie)for(let ve of Se)for(let ge of ve){let Le=A.low[ge.i],Ee=A.high[ge.i],Pe=`${A.name}, ${k[ge.i]}: ${Oe(Math.min(Le,Ee))} \u2013 ${Oe(Math.max(Le,Ee))}`;co.push({...Bt(ge.x,ge.y,.01,A.color,Pe,pr(A,ge.i,Ee,Pe)),part:"anchor"})}if(A.kind!=="range")for(let ve of Se)for(let ge of ve){if(!Ce&&!Ie&&!e.labels&&!A.errors)continue;let Le=A.data[ge.i],Ee=O?pe[ge.i]-se[ge.i]:Le,Pe=$r(A.name,k[ge.i],Ee,Oe);(Ce||Ie)&&co.push(Ce&&A.symbol!=="circle"?Io(ge.x,ge.y,A.markerSize,A.symbol,A.color,Ie?Pe:void 0,pr(A,ge.i,Le,Pe),"point"):{...Bt(ge.x,ge.y,Ce?A.markerSize:.01,A.color,Ie?Pe:void 0,pr(A,ge.i,Le,Pe)),part:Ce?"point":"anchor"}),Ie&&cs(A,ge.i,M?ge.y:ge.x,pe[ge.i]),e.labels&&mo.push(J(ge.x,ge.y-8,Oe(Ee),{anchor:"middle"}))}}let ds={plot:re,xs:M?[]:z.map((A,se)=>qn(se)),rows:z.map(A=>[k[A],...S.map(se=>{let pe=Pr(se);if(se.kind==="range"){let Ie=se.low[A],Me=se.high[A];return`${se.name}: ${P(Ie)&&P(Me)?`${pe(Ie)} \u2013 ${pe(Me)}`:"\u2014"}`}let Oe=se.data[A];return`${se.name}: ${P(Oe)?pe(O?(x.get(se)?.[A]??0)-(g.get(se)?.[A]??0):Oe):"\u2014"}`})]),count:c,zoom:T,crosshair:jr(e)},Vr=[];if(e.brush&&!M){let A={x:re.x,y:re.y+re.height+Es,width:re.width,height:Ns},se=S.find(Oe=>Oe.kind!=="range"),pe={x:l(A.x+T.start/Math.max(1,c)*A.width),y:A.y,width:l((T.end-T.start)/Math.max(1,c)*A.width),height:A.height};if(Vr.push({kind:"rect",part:"brush",x:A.x,y:A.y,width:A.width,height:A.height,fill:"var(--skdx-color-surface-sunken)",stroke:K.grid}),se){let Oe=He(se.data),[Ie,Me]=we(Oe),Se=c>1?A.width/(c-1):0,$e=se.data.flatMap((ve,ge)=>P(ve)?[{x:l(A.x+ge*Se),y:l(A.y+A.height-(Me===Ie?.5:(ve-Ie)/(Me-Ie))*(A.height-4)-2)}]:[]),Ce=it($e);$e.length>1&&Vr.push({kind:"path",part:"brush-series",d:`${Ce}L${$e[$e.length-1]?.x} ${A.y+A.height}L${$e[0]?.x} ${A.y+A.height}Z`,fill:se.color,fillOpacity:.3})}Vr.push({kind:"rect",part:"brush-window",...pe,fill:"var(--skdx-color-primary-500)",opacity:.15,stroke:K.axis},{kind:"rect",part:"brush-handle",x:l(pe.x-3),y:A.y+8,width:6,height:A.height-16,fill:K.axis,rx:8},{kind:"rect",part:"brush-handle",x:l(pe.x+pe.width-3),y:A.y+8,width:6,height:A.height-16,fill:K.axis,rx:8}),ds.brush={box:A,window:pe}}return{...oo,shapes:[...os,...io,...Fr,...lo,...ls,...co,...mo,...vi,...Fn(e.annotations,as),...Vr,...oo.shapes],hit:ds,issues:a,defs:Br.length?Br:void 0}}function Ds(e,n){if(!(!P(e)||n===null||n===void 0))return typeof n=="number"?P(n)?[e-Math.abs(n),e+Math.abs(n)]:void 0:P(n[0])&&P(n[1])?[Math.min(n[0],n[1]),Math.max(n[0],n[1])]:void 0}function ol(e,n){if(!e||n<2)return{start:0,end:n};let t=Math.max(0,Math.min(n-1,Math.floor(e.start))),r=Math.max(t+1,Math.min(n,Math.ceil(e.end)));return r-t<2&&n>=2?{start:Math.min(t,n-2),end:Math.min(t,n-2)+2}:{start:t,end:r}}function al(e,n,t){let r=k=>k.type??n,o=[],a=rl(e),s=e.categories??[],d=(e.transforms??[]).filter(k=>k.type==="sort"||k.type==="bin"||k.type==="aggregate"),i=(e.transforms??[]).filter(k=>!d.includes(k)),c=e.stacked||e.stackOffset!==void 0&&e.stackOffset!=="zero",m=(k,T,E)=>{let M=E.filter(L=>L!==null&&!(typeof L=="number"&&Number.isFinite(L))).length;M&&o.push({code:"invalid-value",severity:"warning",message:`Series "${k}" has ${M} value${M===1?"":"s"} that ${M===1?"is":"are"} neither a number nor null; drawn as gaps.`,itemId:T??k}),s.length&&E.length!==s.length&&!e.transform&&o.push({code:"length-mismatch",severity:"warning",message:`Series "${k}" has ${E.length} values for ${s.length} categories.`,itemId:T??k})},h=e.series.map((k,T)=>{let E=r(k),M=c?!0:void 0,L=k.type==="range"?void 0:k.stack,S=L===!1?void 0:L===!0||L===void 0&&M?`${E}`:L;k.type==="range"?(m(k.name,k.id,k.low),m(k.name,k.id,k.high)):m(k.name,k.id,k.data);let D=O=>e.nulls==="zero"?O.map(V=>P(V)?V:0):O,z=Fs(a,k.axis);return z===void 0&&o.push({code:"unknown-axis",severity:"warning",message:`Series "${k.name}" names axis "${String(k.axis)}", which is not defined; drawn on the first axis.`,itemId:k.id??k.name}),{name:k.name,id:k.id,color:ne(e,T,k.color),axis:z??a[0]?.id,hidden:xe(e,k.name),index:T,kind:E,data:k.type==="range"?[]:D(Oo(Oo(k.data,i),k.transforms)),low:k.type==="range"?k.low:[],high:k.type==="range"?k.high:[],curve:k.curve??e.curve??"linear",dash:k.type==="range"?void 0:k.dash,markers:k.type==="range"?void 0:k.markers,symbol:k.type==="range"?"circle":k.symbol??"circle",markerSize:k.type==="range"?3:k.markerSize??3,errors:k.type==="range"?void 0:k.errors,stack:E==="range"||E==="line"?void 0:S,style:k.type==="range"?k.style??"area":"area",fillOpacity:(k.type==="range"?void 0:k.fillOpacity)??e.fillOpacity??.25,gradient:k.type!=="range"&&k.gradient===!0}}),f=()=>Math.max(s.length,...h.map(k=>Math.max(k.data.length,k.low.length))),y=k=>{let T=M=>M.length?k.map(L=>M[L]??null):M,E=Array.from({length:f()},(M,L)=>s[L]??String(L+1));s=k.map(M=>E[M]),h=h.map(M=>({...M,data:T(M.data),low:T(M.low),high:T(M.high)}))},$=(k,T)=>{let E=(T!==void 0?h.find(L=>L.name===T):void 0)??h.find(L=>!L.hidden&&L.kind!=="range")??h[0];T!==void 0&&!h.some(L=>L.name===T)&&o.push({code:"unknown-series",severity:"warning",message:`sort.by names "${T}", which is not a series; sorted by the first series.`});let M=Array.from({length:f()},(L,S)=>S).sort((L,S)=>{let D=E?.data[L]??E?.high[L],z=E?.data[S]??E?.high[S],O=P(D)?D:-1/0,V=P(z)?z:-1/0;return k==="asc"?O-V:V-O});y(M)},b=k=>{let T=h.flatMap(M=>He(M.data)),E=er(T,k);s=E.slice(1).map((M,L)=>`${t(E[L])}\u2013${t(M)}`),h=h.map(M=>{let L=He(M.data),S=0,D=tr(L,E).map(z=>e.binMode==="density"?L.length?z.count/(L.length*(z.x1-z.x0)):0:e.binMode==="cumulative"?S+=z.count:z.count);return{...M,data:D}})},w=(k,T)=>{let E=Math.max(1,Math.floor(k)),M=f(),L=D=>{if(!D.length)return D;let z=[];for(let O=0;O<M;O+=E){let V=He(D.slice(O,O+E));z.push(V.length===0?null:T==="sum"?V.reduce((g,x)=>g+x,0):T==="mean"?V.reduce((g,x)=>g+x,0)/V.length:T==="min"?Math.min(...V):Math.max(...V))}return z};s=Array.from({length:M},(D,z)=>s[z]??String(z+1)).filter((D,z)=>z%E===0),h=h.map(D=>({...D,data:L(D.data),low:L(D.low),high:L(D.high)}))};e.transform==="histogram"?b({bins:e.bins,binWidth:e.binWidth,domain:e.binDomain}):e.transform==="cumulative"&&(h=h.map(k=>{let T=0;return{...k,data:k.data.map(E=>P(E)?T+=E:T)}}));for(let k of d)k.type==="sort"?$(k.order??"desc"):k.type==="bin"?b(k):k.type==="aggregate"&&w(k.every,k.method??"sum");typeof e.sort=="string"?$(e.sort):e.sort&&$(e.sort.order,e.sort.by);let R=e.xAxis?.domain;if(R){let k=f(),T=Array.from({length:k},(S,D)=>s[D]??String(D+1)),E=S=>{let D=typeof S=="string"?S:qe(S);return T.findIndex(z=>typeof D=="string"?z===D||Qt(z)===D:qe(z)===D)},M=R.map(E),L=S=>S.length?M.map(D=>D<0?null:S[D]??null):S;s=[...R],h=h.map(S=>({...S,data:L(S.data),low:L(S.low),high:L(S.high)}))}return{series:h,categories:s,issues:o,axes:a}}var So=e=>qt(e,"bar");var Lo=e=>qt(e,"line"),zo=e=>qt(e,"area");function Pn(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var Ro=e=>e.id??e.name??e.series,Bs=e=>e.seriesId??e.series;function wn(e,n){let t=!1;return n.id!==void 0&&(t=!0,Ro(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,Bs(e)!==n.series&&e.series!==n.series)||n.index!==void 0&&(t=!0,e.index!==n.index)||n.category!==void 0&&(t=!0,e.category!==n.category)?!1:t}var No=(e,n,t=Pn(n))=>t.some(r=>wn(e,r)),Kn=e=>Pn(e).flatMap(n=>n.id!==void 0?[n.id]:[]);function Vn(e){let n={},t=Ro(e);t!==void 0&&(n.id=t);let r=Bs(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var Eo=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function Do(e,n,t){let r=Pn(e),o=Vn(n),a=r.some(s=>wn(n,s));return t==="single"?a?[]:[o]:a?r.filter(s=>!wn(n,s)):[...r,o]}var sl=.2;function il(e){let n=K.focus;switch(e.kind){case"rect":return{kind:"rect",part:"selected",x:e.x-1.5,y:e.y-1.5,width:e.width+3,height:e.height+3,fill:"none",stroke:n,rx:e.rx};case"circle":return{kind:"circle",part:"selected",cx:e.cx,cy:e.cy,r:e.r+2.5,fill:"none",stroke:n};case"path":return{kind:"path",part:"selected",d:e.d,fill:"none",stroke:n,strokeWidth:2.5};case"line":return{...e,part:"selected",stroke:n,strokeWidth:(e.strokeWidth??1)+3,title:void 0,item:void 0};case"text":return}}var ll=(e,n)=>e.kind==="text"?{...e,fill:K.grid}:{...e,opacity:(e.opacity??1)*n};function Fo(e,n){let t=Pn(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:Pn(n.highlighted),o=r[0];if(t.length===0&&!o)return e;let a={highlighted:n.highlightScope?.highlighted??"item",faded:n.highlightScope?.faded??"global"},s=[],d=m=>!o||r.some(h=>wn(m,h))?!0:a.highlighted==="series"?r.some(h=>h.series!==void 0&&wn(m,{series:h.series})):!1,i=m=>{if(!o||a.faded==="none"||d(m))return!1;if(a.faded==="series"){let h=o.series;return h!==void 0&&wn(m,{series:h})}return!0},c=e.shapes.map(m=>{let h=m.item;if(!h||h.legend)return m;if(t.some(f=>wn(h,f))){let f=il(m);f&&s.push(f)}return i(h)?ll(m,sl):m});return s.length?{...e,shapes:[...c,...s]}:{...e,shapes:c}}var Tr=2*Math.PI;function Ke(e,n,t,r,o,a){let s=(c,m)=>`${l(e+c*Math.sin(m))} ${l(n-c*Math.cos(m))}`;if(a-o>=Tr-1e-9){let c=o+Tr/2;return`${Ke(e,n,t,r,o,c)}${Ke(e,n,t,r,c,a)}`}let d=a-o>Math.PI?1:0,i=`M${s(t,o)}A${t} ${t} 0 ${d} 1 ${s(t,a)}`;return r>0?`${i}L${s(r,a)}A${r} ${r} 0 ${d} 0 ${s(r,o)}Z`:`${i}L${l(e)} ${l(n)}Z`}function cl(e,n,t,r,o,a,s){let d=a-o;if(s<=0||d>=Tr-1e-9)return Ke(e,n,t,r,o,a);let i=Math.sin(Math.min(Math.PI/2,d/2)),c=Math.min(s,r>0?(t-r)/2:t/2,t*i/(1+i));if(r>0&&i<1&&(c=Math.min(c,r*i/(1-i))),c<=.25)return Ke(e,n,t,r,o,a);let m=(w,R)=>`${l(e+w*Math.sin(R))} ${l(n-w*Math.cos(R))}`,h=w=>`A${l(c)} ${l(c)} 0 0 1 ${w}`,f=Math.asin(c/(t-c)),y=Math.sqrt((t-c)**2-c*c),$=a-o-2*f>Math.PI?1:0,b=`M${m(y,o)}${h(m(t,o+f))}A${t} ${t} 0 ${$} 1 ${m(t,a-f)}${h(m(y,a))}`;if(r>0){let w=Math.asin(c/(r+c)),R=Math.sqrt((r+c)**2-c*c),k=a-o-2*w>Math.PI?1:0;b+=`L${m(R,a)}${h(m(r,a-w))}A${r} ${r} 0 ${k} 0 ${m(r,o+w)}${h(m(R,o))}Z`}else b+=`L${l(e)} ${l(n)}Z`;return b}function Bo(e){let n=[];for(let H of e.data)P(H.value)&&H.value<0&&n.push({code:"negative-value",severity:"warning",message:`"${H.name}" is negative (${H.value}); a share of a whole cannot be, so it is drawn as zero.`,itemId:H.id??H.name});let t=le(e,!e.data.some(H=>P(H.value)&&H.value>0),300,300);if(t)return{...t,issues:n};let r=oe(e.format),o=e.percentFormat?oe(e.percentFormat):H=>`${Math.round(H*100)}%`,a=Math.max(0,e.cornerRadius??0),{width:s,height:d}=de(e,300,300),i=e.data.map((H,Q)=>({name:H.name,color:ne(e,Q,H.color)})),c=ue(e,i,s),m=(e.startAngle??0)*Math.PI/180,h=(e.endAngle??(e.startAngle??0)+360)*Math.PI/180,f=Math.max(0,Math.min(Tr,h-m)),y=f<=Math.PI+1e-9&&Math.abs(Math.sin(m))>.99,$=e.labels&&e.labelPosition==="outside",b=s/2,w=Math.max(.2,Math.min(1,e.outerRadius??1)),R=$?40:8,k=(y?Math.max(0,Math.min(s/2,d-c)-R):Math.max(0,Math.min(s,d-c)/2-R))*w,T=y?m<0||m>Math.PI?d-R:c+R:c+(d-c)/2,E=k*Math.min(.95,Math.max(0,e.innerRadius??(e.variant==="donut"?.6:0))),M=e.data.map((H,Q)=>({...H,i:Q,value:P(H.value)&&!xe(e,H.name)?Math.max(0,H.value):0})),L=e.sort?[...M].sort((H,Q)=>e.sort==="asc"?H.value-Q.value:Q.value-H.value):M,S=L.reduce((H,Q)=>H+Q.value,0),D=L.filter(H=>H.value>0).length,z=Math.max(0,Math.min((e.padAngle??0)*Math.PI/180,f/Math.max(1,D)/2)),O=f>=Tr-1e-9,V=D>1?O?D:D-1:0,g=f-V*z,x=Math.min((e.minAngle??0)*Math.PI/180,g/Math.max(1,D)),C=L.map(H=>S>0?H.value/S*g:0);if(x>0)for(let H=0;H<L.length;H++){let Q=L.map((N,B)=>N.value>0&&C[B]<x);if(!Q.some(Boolean))break;let p=Q.filter(Boolean).length*x,q=L.reduce((N,B,_)=>N+(Q[_]||B.value<=0?0:B.value),0);if(L.forEach((N,B)=>{C[B]=Q[B]?x:q>0?N.value/q*(g-p):0}),!L.some((N,B)=>N.value>0&&!Q[B]&&C[B]<x))break}let v=Pn(e.selected),F=m+(O&&V?z/2:0),U=[],Y=[],j=[],I=L.map((H,Q)=>{let p=S>0?H.value/S:0,q=F,N=F+C[Q];p>0&&(F=N+z);let B=o(p),_=`${H.name}: ${r(H.value)} (${B})`,W={label:_,id:H.id??H.name,name:H.name,index:H.i,value:H.value},ee=(q+N)/2;if(e.labels&&p>0){let re=`${H.name} ${B}`;if($){let me=Math.sin(ee),be=l(T-(k+14)*Math.cos(ee));j.some(Z=>Math.abs(Z-be)<12)||(j.push(be),Y.push({kind:"line",part:"label-connector",x1:l(b+k*me),y1:l(T-k*Math.cos(ee)),x2:l(b+(k+12)*me),y2:l(T-(k+12)*Math.cos(ee)),stroke:K.axis}),U.push(Yn(l(b+(k+16)*me),be,re,s,{part:"slice-label",anchor:me>.1?"start":me<-.1?"end":"middle",baseline:"middle",fill:"var(--skdx-color-text-default)"})))}else if(p>.03){let me=(k+E)/2;U.push(Yn(l(b+me*Math.sin(ee)),l(T-me*Math.cos(ee)),re,s,{part:"slice-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))}}let te=No(W,void 0,v)?Math.max(4,k*.06):0;return{kind:"path",part:"slice",d:p>0?cl(b+te*Math.sin(ee),T-te*Math.cos(ee),k,E,q,N,a):"",fill:ne(e,H.i,H.color),title:_,item:p>0?W:void 0}});e.centerLabel&&U.push(J(l(b),l(y?T-12:T),e.centerLabel,{part:"center-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)",weight:"bold"}));let G=he(e,s,d,i);return{...G,shapes:ft([...I,...Y,...G.shapes,...U]),issues:n}}var $t=2;function Po(e){let n=He(e.data),t=le(e,n.length===0,120,32);if(t)return t;let r=oe(e.format),{width:o,height:a}=de(e,120,32),s=e.data.length,d=n[0],i=n[n.length-1],c=e.lastValue?r(i):"",m=o-$t-(c?c.length*ie+6:0),h=e.variant??"area",f=h==="winloss",y=[...n,...e.band??[],...e.target!==void 0?[e.target]:[]],$=st(f?[-1,1]:Gt(y,h==="bar"),[a-$t,$t]),b=e.x&&e.x.length>=s?e.x.map(qe):void 0,[w,R]=b?we(b):[0,1],k=st([w,R],[$t,m]),T=D=>s<2?($t+m)/2:b?R===w?($t+m)/2:k(b[D]):$t+D/(s-1)*(m-$t),E=e.trend?i>=d?K.positive:K.negative:ne(e,0,e.color),M=[];if(e.band&&!f){let[D,z]=e.band,O=Math.min($(D),$(z));M.push({kind:"rect",part:"band",x:$t,y:l(O),width:l(Math.max(0,m-$t)),height:l(Math.abs($(z)-$(D))),fill:K.axis,opacity:.12,title:`${r(Math.min(D,z))} \u2013 ${r(Math.max(D,z))}`})}e.target!==void 0&&P(e.target)&&!f&&M.push({kind:"line",part:"target",x1:$t,x2:l(m),y1:l($(e.target)),y2:l($(e.target)),stroke:K.axis,dash:"3 2",title:`Target: ${r(e.target)}`});let L=e.data.flatMap((D,z)=>P(D)?[{x:l(T(z)),y:l($(D)),v:D,i:z}]:[]),S=L[L.length-1];if(h==="bar"||f){let D=s>0?(m-$t)/s:0,z=l($(0));e.data.forEach((O,V)=>{if(!P(O))return;let g=l($(f?Math.sign(O):O));M.push({kind:"rect",part:"bar",x:l($t+V*D+D*.1),y:Math.min(g,z),width:l(Math.max(1,D*.8)),height:l(Math.max(1,Math.abs(z-g))),fill:f?O<0?K.negative:K.positive:O<0&&e.trend?K.negative:E,title:e.tooltip===!1?void 0:r(O)})})}else{let D=it(L,e.curve),z=L[0];h==="area"&&M.push({kind:"path",part:"area",d:D&&z&&S?`${D}L${S.x} ${a-$t}L${z.x} ${a-$t}Z`:"",fill:E,fillOpacity:.15}),M.push({kind:"path",part:"line",d:D,stroke:E,strokeWidth:1.5});let O=e.markers??["last"];S&&O.includes("last")&&M.push(Bt(S.x,S.y,2,E,void 0)),z&&O.includes("first")&&M.push({...Bt(z.x,z.y,2,E,void 0),part:"first"})}if(e.extremes&&L.length>1){let D=L.reduce((O,V)=>V.v<O.v?V:O),z=L.reduce((O,V)=>V.v>O.v?V:O);M.push({...Bt(D.x,D.y,2.5,K.negative,r(D.v)),part:"min"},{...Bt(z.x,z.y,2.5,K.positive,r(z.v)),part:"max"})}return c&&S&&M.push(J(l(m+4),S.y,c,{part:"last-value",baseline:"middle",fill:"var(--skdx-color-text-default)"})),{...he(e,o,a),shapes:M}}function Vo(e){let n=e.metrics??(e.categories??[]).map(I=>({label:I})),t=le(e,n.length===0||e.series.every(I=>He(I.data).length===0),300,300);if(t)return t;let r=[],o=oe(e.format),{width:a,height:s}=de(e,300,300),d=e.series.map((I,G)=>({name:I.name,color:ne(e,G,I.color)})),i=ue(e,d,a),c=a/2,m=i+(s-i)/2,h=Math.max(0,Math.min(a,s-i)/2-36),f=n.length,y=(e.startAngle??0)*Math.PI/180-Math.PI/2,$=I=>y+I*2*Math.PI/Math.max(1,f),b=e.series.filter(I=>!xe(e,I.name)),w=e.normalize===!0?"series":e.normalize===!1||e.normalize===void 0?e.metrics?"metric":"none":e.normalize;w==="series"&&b.length>1&&r.push({code:"misleading-scale",severity:"warning",message:"normalize: 'series' scales each series to its own maximum, so polygons cannot be compared in magnitude; prefer 'metric' or 'none'."});let R=Math.max(1,Math.round(e.levels??4)),k=e.max??Math.max(0,we(b.flatMap(I=>I.data))[1]),T=w==="none"?ht(0,k,R):Array.from({length:R+1},(I,G)=>100*G/R),E=w==="none"?e.max??T[T.length-1]:100,M=n.map((I,G)=>{let H=b.map(B=>B.data[G]),[Q,p]=we(H),q=I.min??Math.min(0,Q),N=ht(q,I.max??p,R);return{min:q,max:I.max??N[N.length-1]}}),L=e.series.map(I=>Math.max(0,we(I.data)[1])),S=(I,G,H)=>{if(w==="series")return L[I]>0?H/L[I]*100:0;if(w==="metric"){let Q=M[G];return Q.max>Q.min?(H-Q.min)/(Q.max-Q.min)*100:0}return H},D=(I,G)=>{let H=E>0?Math.max(0,Math.min(G,E))/E*h:0;return{x:l(c+H*Math.cos($(I))),y:l(m+H*Math.sin($(I)))}},z=I=>f===0?"":`M${n.map((G,H)=>{let Q=D(H,I(H));return`${Q.x} ${Q.y}`}).join("L")}Z`,O=I=>{if(e.gridShape==="circle"){let G=E>0?I/E*h:0;return{kind:"circle",part:"grid",cx:l(c),cy:l(m),r:l(G),fill:"none",stroke:K.grid}}return{kind:"path",part:"grid",d:z(()=>I),stroke:K.grid}},V=T.filter(I=>I>0&&I<=E),g=I=>w==="none"?o(I):w==="series"?`${I}%`:(()=>{let G=M[0];return oe(n[0]?.format??e.format)(G.min+(G.max-G.min)*I/100)})(),x=[...V.map(O),...n.map((I,G)=>{let H=D(G,E);return{kind:"line",part:"grid",x1:l(c),y1:l(m),x2:H.x,y2:H.y,stroke:K.grid}}),...V.map(I=>J(l(c+4),D(0,I).y,g(I),{part:"y-label",baseline:"middle"})),...n.map((I,G)=>{let H=Math.cos($(G)),Q=h+14;return J(l(c+Q*H),l(m+Q*Math.sin($(G))),I.label,{part:"x-label",anchor:H>.1?"start":H<-.1?"end":"middle",baseline:"middle"})})],C=[],v=[],F=[],U=e.markers??!0,Y=e.markerSize??3;e.series.forEach((I,G)=>{if(xe(e,I.name))return;let H=ne(e,G,I.color),Q=p=>{let q=I.data[p];return P(q)?S(G,p,q):0};n.forEach((p,q)=>{let N=I.data[q];if(!P(N))return;let B=oe(p.format??e.format),_=D(q,S(G,q,N)),W=$r(I.name,p.label,N,B);C.push({...Bt(_.x,_.y,U?Y:.01,H,W,{label:W,id:p.id,series:I.name,seriesId:I.id,category:p.label,index:q,value:N}),part:U?"point":"anchor"}),e.labels&&F.push(J(_.x,l(_.y-7),B(N),{part:"value-label",anchor:"middle",fill:"var(--skdx-color-text-default)"}))}),v.push({kind:"path",part:"area",d:z(Q),fill:e.fill??!0?H:void 0,fillOpacity:.25,stroke:H,strokeWidth:2,title:I.name,item:{label:I.name,series:I.name,seriesId:I.id}})});let j=he(e,a,s,d);return{...j,shapes:[...x,...v,...C,...F,...j.shapes],issues:r}}var Yr={top:24,right:8,bottom:8,left:64},Ho=864e5,_o=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function dl(e,n="monday"){let t=n==="sunday"?[_o[6],..._o.slice(0,6)]:_o,r=e.map(b=>({day:Math.floor(new Date(b.date).getTime()/Ho),value:b.value})).filter(b=>Number.isFinite(b.day));if(r.length===0)return{rows:t,columns:[],data:t.map(()=>[]),dates:t.map(()=>[])};let[o,a]=we(r.map(b=>b.day)),s=n==="sunday"?4:3,d=b=>((b+s)%7+7)%7,i=o-d(o),c=Math.floor((a-i)/7)+1,m=t.map(()=>new Array(c).fill(null)),h=t.map(()=>new Array(c).fill(void 0));for(let b of r){let w=Math.floor((b.day-i)/7);m[d(b.day)][w]=b.value,h[d(b.day)][w]=new Date(b.day*Ho).toISOString().slice(0,10)}let f=new Intl.DateTimeFormat(void 0,{month:"short"}),y=-1,$=Array.from({length:c},(b,w)=>{let R=new Date((i+w*7+6)*Ho),k=R.getUTCMonth();return k===y?"":(y=k,f.format(R))});return{rows:t,columns:$,data:m,dates:h}}var ml=e=>e.colorScale??(e.diverging?{type:"diverging",steps:e.steps}:{type:"sequential",domain:e.domain,steps:e.steps}),Ps=(e,n)=>{let t=e.map((r,o)=>o);return n&&t.sort((r,o)=>(n==="asc"?1:-1)*(e[r]-e[o])),t};function jo(e){let n=[],t=e.calendar?dl(e.calendar,e.weekStart):void 0,r=t?.rows??e.rows??[],o=t?.columns??e.columns??[],a=t?.data??e.data??[];!t&&(a.length!==r.length||a.some(g=>g.length!==o.length))&&n.push({code:"ragged-matrix",severity:"warning",message:`The matrix is ${a.length} \xD7 ${a[0]?.length??0} but there are ${r.length} rows and ${o.length} columns; missing cells are blank.`});let s=a.flat().filter(g=>g!=null&&!P(g)).length;s&&n.push({code:"invalid-value",severity:"warning",message:`${s} cell${s===1?" is":"s are"} neither a number nor null; drawn as blank.`});let d=a.flat(),i=le(e,r.length===0||o.length===0||!d.some(P));if(i)return{...i,issues:n};let c=oe(e.format),{width:m,height:h}=de(e),f=Bn(e.colorLegend),y=Te(m,h,{...Yr,left:t?40:Yr.left,right:Yr.right+f.right,bottom:Yr.bottom+f.bottom}),$=g=>g.reduce((x,C)=>x+(P(C)?C:0),0),b=Ps(r.map((g,x)=>$(a[x]??[])),e.rowOrder),w=Ps(o.map((g,x)=>$(a.map(C=>C[x]))),e.columnOrder),R=b.map(g=>r[g]),k=w.map(g=>o[g]),T=y.width/Math.max(1,k.length),E=y.height/Math.max(1,R.length),M=Pt(ml(e),d,ne(e,0,e.color),e.negativeColor,c),L=[],S=[],D=e.cellGap??(t?1:0),z=e.cellRadius??(t?2:0);R.forEach((g,x)=>{k.forEach((C,v)=>{let F=a[b[x]]?.[w[v]],U=t?.dates[b[x]]?.[w[v]],Y=t?U??g:`${g}, ${C}`,j=l(y.x+v*T+D),I=l(y.y+x*E+D),G={x:j,y:I,width:l(Math.max(0,T-2*D)),height:l(Math.max(0,E-2*D)),rx:z||void 0};if(!P(F)){e.missingColor&&(!t||U)&&L.push({kind:"rect",part:"missing",...G,fill:e.missingColor,title:`${Y}: \u2014`});return}let H=M.color(F),Q=`${Y}: ${c(F)}`;L.push({kind:"rect",part:"cell",...G,fill:H.fill,opacity:H.opacity,title:Q,item:{label:Q,id:t?U:`${g}:${C}`,category:C,name:g,index:v,value:F}}),e.labels&&T>24&&E>12&&S.push(J(l(y.x+(v+.5)*T),l(y.y+(x+.5)*E),c(F),{part:"cell-label",anchor:"middle",baseline:"middle",fill:H.opacity>=.5?"var(--skdx-color-text-on-accent)":"var(--skdx-color-text-default)"}))})});let O=he(e,m,h),V=e.colorLegend?rr(M,f.right?{x:y.x+y.width+12,y:y.y,width:f.right,height:y.height}:{x:y.x,y:y.y+y.height+8,width:y.width,height:f.bottom},f.options):[];return{...O,shapes:[...R.map((g,x)=>J(y.x-8,l(y.y+(x+.5)*E),g,{part:"y-label",anchor:"end",baseline:"middle"})),...k.flatMap((g,x)=>g?[J(l(y.x+(x+.5)*T),y.y-8,g,{part:"x-label",anchor:t?"start":"middle"})]:[]),...L,...S,...V,...O.shapes],issues:n}}var Kr=8;function Go(e){let n=e.variant==="pyramid",t=[],r=e.sort??(n?"asc":void 0),o=e.data.filter(x=>P(x.value)?!0:(t.push({code:"invalid-value",severity:"warning",message:`Stage "${x.name}" has no valid value and was dropped.`,itemId:x.id??x.name}),!1)).sort((x,C)=>r==="asc"?x.value-C.value:r==="desc"?C.value-x.value:0),a=le(e,o.length===0,400,300);if(a)return{...a,issues:t};let s=oe(e.format),{width:d,height:i}=de(e,400,300),c=o.length,m=e.orientation==="horizontal",h=Math.max(0,e.gap??4),f=e.labelPosition??"inside",y=Math.max(0,...o.map(x=>x.value)),$=o.reduce((x,C)=>x+Math.max(0,C.value),0),b=o[0]?.value??0,w=o.map((x,C)=>({name:x.name,color:ne(e,C,x.color)})),R=ue(e,w,d),k=m?d:i-R,T=m?i-R:d,E=f==="outside",M=Math.max(0,(E?T*2/3:T)-2*Kr),L=c===0?0:(k-2*Kr)/c,S=Math.max(0,Math.min(1,e.neckWidth??0)),D=x=>y>0?(S+(1-S)*(Math.max(0,x)/y))*M:0,z=e.percentFormat?oe(e.percentFormat):x=>`${Math.round(x*100)}%`,O=(m?R+(i-R)/2:d/2)-(E?T/6:0),V=o.flatMap((x,C)=>{let v=D(x.value),F=D(o[C+1]?.value??x.value),U=Kr+C*L+(m?0:R),Y=U+L-h,j=n?$>0?x.value/$:0:b>0?x.value/b:0,I=o[C-1]?.value,G=I!==void 0&&I>0?x.value/I-1:0,H=!n&&I!==void 0&&I>0?` \xB7 ${G<0?"\u2212":G>0?"+":""}${z(Math.abs(G))} from ${o[C-1]?.name}`:"",Q=`${x.name}: ${s(x.value)} (${z(j)})${H}`,q={kind:"path",part:"stage",d:m?`M${l(U)} ${l(O-v/2)}L${l(U)} ${l(O+v/2)}L${l(Y)} ${l(O+F/2)}L${l(Y)} ${l(O-F/2)}Z`:`M${l(O-v/2)} ${l(U)}L${l(O+v/2)} ${l(U)}L${l(O+F/2)} ${l(Y)}L${l(O-F/2)} ${l(Y)}Z`,fill:ne(e,C,x.color),title:Q,item:{label:Q,id:x.id??x.name,name:x.name,index:C,value:x.value}};if(f==="none")return[q];let N=`${x.name} \xB7 ${s(x.value)}`,B=(U+Y)/2;if(E){let W=O+M/2+Kr;return[q,Yn(l(m?B:W),l(m?W:B),N,d,{part:"stage-label",anchor:m?"middle":"start",baseline:m?"hanging":"middle",fill:"var(--skdx-color-text-default)"})]}let _=Yn(l(m?B:O),l(m?O:B),N,d,{part:"stage-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)"});return[q,{kind:"rect",part:"stage-label-background",x:l(_.x-(_.text.length*ie+8)/2),y:l((m?O:B)-9),width:_.text.length*ie+8,height:18,rx:8,fill:"var(--skdx-color-surface-default)"},_]}),g=he(e,d,i,w);return{...g,shapes:[...V,...g.shapes],issues:t}}var Vs=e=>e*Math.PI/180;function Wo(e){let n=e.data.filter(S=>P(S.value)),t=le(e,n.length===0,300,300);if(t)return t;let r=oe(e.format),{width:o,height:a}=de(e,300,300),s=n.map((S,D)=>({name:S.name,color:ne(e,D,S.color)})),d=ue(e,s,o),i=o/2,c=d+(a-d)/2,m=Math.max(0,Math.min(o,a-d)/2-(e.bands?20:8)),h=m*Math.min(.95,Math.max(0,e.innerRadius??.3)),f=Vs(e.startAngle??0),y=Vs(e.endAngle??(e.startAngle??0)+360),$=Math.max(0,Math.min(2*Math.PI,y-f)),b=e.max??Math.max(0,...n.map(S=>S.value)),w=n.length,R=Math.max(0,e.gap??.25),k=w===0?0:(m-h)/(w+R*(w-1)),T=e.rounded??!0,E=S=>b>0?Math.max(0,Math.min(1,S/b)):0,M=[];for(let S of e.bands??[]){let D=f+E(S.from)*$,z=f+E(S.to)*$;z<=D||M.push({kind:"path",part:"band",d:Ke(i,c,m+14,m+6,D,z),fill:Ft(S.variant),opacity:.6,title:`${r(S.from)} \u2013 ${r(S.to)}`})}if(n.forEach((S,D)=>{if(xe(e,S.name))return;let z=m-D*k*(1+R),O=z-k,V=ne(e,D,S.color),g=f+E(S.value)*$,x=`${S.name}: ${r(S.value)} (${Math.round(E(S.value)*100)}%)`;if((e.track??!0)&&M.push({kind:"path",part:"track",d:Ke(i,c,z,O,f,f+$),fill:K.grid,opacity:.6}),g>f&&(M.push({kind:"path",part:"bar",d:Ke(i,c,z,O,f,g),fill:V,title:x,item:{label:x,id:S.id,name:S.name,index:D,value:S.value}}),T&&$<2*Math.PI-1e-9)){let C=(O+z)/2;for(let v of[f,g])M.push({kind:"circle",part:"bar-cap",cx:l(i+C*Math.sin(v)),cy:l(c-C*Math.cos(v)),r:l(k/2),fill:V})}if(e.labels){let C=(O+z)/2;M.push(J(l(i+C*Math.sin(f)-6*Math.cos(f)),l(c-C*Math.cos(f)-6*Math.sin(f)),`${S.name} ${r(S.value)}`,{part:"bar-label",anchor:Math.cos(f)>=0?"end":"start",baseline:"middle"}))}}),e.target!==void 0&&P(e.target)){let S=f+E(e.target)*$,D=m-w*k*(1+R)+k*R;M.push({kind:"line",part:"target",x1:l(i+D*Math.sin(S)),y1:l(c-D*Math.cos(S)),x2:l(i+(m+4)*Math.sin(S)),y2:l(c-(m+4)*Math.cos(S)),stroke:"var(--skdx-color-text-default)",strokeWidth:2,title:`Target: ${r(e.target)}`})}e.centerLabel&&M.push(J(l(i),l(c),e.centerLabel,{part:"center-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)",weight:"bold"}));let L=he(e,o,a,s);return{...L,shapes:[...M,...L.shapes]}}var Hs=e=>e*Math.PI/180;function ul(e,n){let t=[0],r=[0],o=a=>{t.push(Math.sin(a)),r.push(-Math.cos(a))};o(e),o(n);for(let a=Math.ceil(e/(Math.PI/2));a*(Math.PI/2)<=n;a++)o(a*(Math.PI/2));return{x0:Math.min(...t),y0:Math.min(...r),x1:Math.max(...t),y1:Math.max(...r)}}function qo(e){let n=le(e,!P(e.value),300,300);if(n)return n;let t=oe(e.format),{width:r,height:o}=de(e,300,300),a=ue(e),s=P(e.min)?e.min:0,d=P(e.max)?e.max:100,i=e.startAngle??-120,c=e.endAngle??120,m=Hs(i),h=Hs(Math.max(i,Math.min(i+360,c))),f=h-m,y=_=>d>s?Math.max(0,Math.min(1,(_-s)/(d-s))):0,$=_=>m+y(_)*f,b=e.variant==="solid",w=e.ticks===!1?0:e.ticks===!0||e.ticks===void 0?5:e.ticks,R=e.tickLabels??!0,k=Array.from({length:w},(_,W)=>w===1?s:s+(d-s)*W/(w-1)),T=w>0&&R,E=T?Math.max(...k.map(_=>t(_).length))*ie:0,M=T?14+E:10,L=T?26:10,S=ul(m,h),D=Math.max(S.x1-S.x0,.2),z=Math.max(S.y1-S.y0,.2),O=Math.max(0,Math.min((r-2*M)/D,(o-a-2*L)/z)),V=r/2-(S.x0+S.x1)/2*O,g=a+(o-a)/2-(S.y0+S.y1)/2*O,x=O*Math.max(.04,Math.min(.6,e.thickness??.18)),C=O-x,v=(_,W)=>({x:l(V+_*Math.sin(W)),y:l(g-_*Math.cos(W))}),F=[],U=`${t(s)} \u2013 ${t(d)}`,Y=(e.bands??[]).filter(_=>P(_.from)&&P(_.to)),j=_=>Y.find(W=>_>=W.from&&_<=W.to),I=_=>_.color??Ft(_.variant);F.push({kind:"path",part:"track",d:Ke(V,g,O,C,m,h),fill:K.grid,opacity:.6});for(let _ of Y){let W=$(Math.min(_.from,_.to)),ee=$(Math.max(_.from,_.to));if(ee<=W)continue;let te=`${_.label?`${_.label}: `:""}${t(_.from)} \u2013 ${t(_.to)}`;F.push(b?{kind:"path",part:"band",d:Ke(V,g,O+6,O+2,W,ee),fill:I(_),opacity:.7,title:te}:{kind:"path",part:"band",d:Ke(V,g,O,C,W,ee),fill:I(_),opacity:.75,title:te})}let G=`${e.caption??"Value"}: ${t(e.value)} (${U})`,H={label:G,name:e.caption,value:e.value},Q=$(e.value);if(b){let _=j(e.value),W=_?I(_):ne(e,0);Q>m+1e-6?F.push({kind:"path",part:"value",d:Ke(V,g,O,C,m,Q),fill:W,title:G,item:H}):F.push({...hl(V,g),title:G,item:H})}else{let _=v(C-4,Q),W=4,ee=v(W,Q-Math.PI/2),te=v(W,Q+Math.PI/2);F.push({kind:"path",part:"needle",d:`M${ee.x} ${ee.y}L${_.x} ${_.y}L${te.x} ${te.y}Z`,fill:"var(--skdx-color-text-default)",title:G,item:H},{kind:"circle",part:"hub",cx:l(V),cy:l(g),r:5,fill:"var(--skdx-color-text-default)"})}for(let _ of k){let W=$(_),ee=v(O+2,W),te=v(O+7,W);if(F.push({kind:"line",part:"tick",x1:ee.x,y1:ee.y,x2:te.x,y2:te.y,stroke:K.axis}),R){let re=v(O+12,W),me=Math.sin(W);F.push(J(re.x,re.y,t(_),{part:"tick-label",anchor:me>.3?"start":me<-.3?"end":"middle",baseline:"middle"}))}}if(P(e.target)){let _=$(e.target),W=v(C-2,_),ee=v(O+4,_);F.push({kind:"line",part:"target",x1:W.x,y1:W.y,x2:ee.x,y2:ee.y,stroke:"var(--skdx-color-text-default)",strokeWidth:2,title:`Target: ${t(e.target)}`})}let q=f<2*Math.PI-1e-6?S.y1<.2?g-C*.4:g+C*.45:g;F.push(J(l(V),l(q),e.centerLabel??t(e.value),{part:"center-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)",weight:"bold"})),e.caption&&F.push(J(l(V),l(q+16),e.caption,{part:"caption",anchor:"middle",baseline:"middle"}));let N=he(e,r,o),B=P(e.target)?`, target ${t(e.target)}`:"";return{...N,description:e.description??`${e.caption??"Value"} ${t(e.value)} on a scale from ${t(s)} to ${t(d)}${B}.`,shapes:[...F,...N.shapes]}}var hl=(e,n)=>({kind:"circle",part:"anchor",cx:l(e),cy:l(n),r:.01,fill:"none"});function Zo(e){let[n,t]=e.sizeRange??[4,24],r=oe(e.zAxis?.format??e.format),o=e.zAxis?.label,a=e.xAxis?.label,s=e.yAxis?.label,d=(i,c)=>i?`${i} ${c}`:c;return To({...e,series:e.series.map(i=>({name:i.name,id:i.id,color:i.color,data:i.data.filter(c=>P(c.x)&&P(c.y)).map(c=>({x:c.x,y:c.y,size:P(c.z)?Math.max(0,c.z):0,label:c.label,id:c.id,color:c.color,value:c.value??c.z}))}))},{part:"bubble",opacity:.7,radius:(i,[,c])=>c>0&&P(i)?Math.max(n,Math.sqrt(i/c)*t):n,describe:(i,c,m,h)=>`${i}${c.label?` ${c.label}`:""}: ${d(a,m.format(c.x))}, ${d(s,h.format(c.y))}, ${d(o,r(c.size??0))}`})}function Uo(e){let n=He(e.data),t=le(e,n.length===0);if(t)return t;let r=er(n,{bins:e.bins,binWidth:e.binWidth,domain:e.domain,thresholds:e.thresholds}),o=tr(n,r),a=o.reduce((b,w)=>b+w.count,0),s=e.mode??"count",d=oe(e.xAxis?.format??e.format),i=oe(s==="percent"?{style:"percent",digits:1}:s==="density"?{style:"decimal",digits:3}:e.format),c=e.name??(s==="density"?"Density":s==="percent"?"Share":"Count"),m=b=>s==="density"?a>0&&b.x1>b.x0?b.count/(a*(b.x1-b.x0)):0:s==="percent"?a>0?b.count/a:0:b.count,h=o.map(b=>`${d(b.x0)}\u2013${d(b.x1)}`),f=qt({...e,format:i,series:[{name:c,data:o.map(m),color:e.color}],categories:h,xAxis:e.xAxis?.label?{label:e.xAxis.label}:void 0,barGap:e.barGap??.05,transform:void 0},"bar"),y=f.shapes.map((b,w)=>{if(b.part!=="bar"||!b.item||b.item.index===void 0)return b;let R=o[b.item.index];if(!R)return b;let k=a>0?` (${Math.round(R.count/a*1e3)/10}%)`:"",T=`${h[b.item.index]??String(w)}: ${R.count}${k}${s==="count"?"":` \xB7 ${c} ${i(m(R))}`}`;return{...b,title:b.title===void 0?void 0:T,item:{...b.item,label:T}}}),$=f.hit?.rows.map((b,w)=>{let R=o[w];return R?[b[0],`${c}: ${i(m(R))}`,`Observations: ${R.count}`]:b});return{...f,shapes:y,hit:f.hit&&$?{...f.hit,rows:$}:f.hit}}function fl(e,n){let t=[],r=n;for(let o of e??[]){let a=typeof o=="number"?{from:r,to:o}:o;P(a.to)&&(t.push(a),r=a.to)}return t}function Ar(e){let n=e.data.filter(M=>P(M.value)),t=le(e,n.length===0,600,40+44*Math.max(1,e.data.length));if(t)return t;let r=oe(e.format),o=e.orientation==="vertical",{width:a,height:s}=de(e,600,o?300:40+44*n.length),d=M=>M.ranges??e.ranges,i=n.flatMap(M=>[M.value,M.target,...(d(M)??[]).map(L=>typeof L=="number"?L:L.to)]),[c,m]=we(i),h=e.min??Math.min(0,c),f=Math.max(0,...n.map(M=>M.name.length))*ie,y=Te(a,s,{top:fe.top+ue(e),right:e.labels&&!o?56:fe.right,bottom:fe.bottom,left:o?fe.left:Math.max(fe.left,f+16)}),$=o?[y.y+y.height,y.y]:[y.x,y.x+y.width],b=Ge([h,Math.max(h,m)],$,{min:h,max:e.max,ticks:e.ticks},e.format),w=je(n.length,o?[y.x,y.x+y.width]:[y.y,y.y+y.height],.3),R=he(e,a,s),k=n.map((M,L)=>({pos:l(w.center(L)),label:M.name})),T=Ze({...R,plot:y,xTicks:o?Re(k,y.width):k,yTicks:o?b.ticks:Re(b.ticks,y.width),baseline:b.zero},{horizontal:!o}),E=(M,L,S,D,z)=>{let O=b.scale(M),V=b.scale(L),g=Math.max(1,Math.abs(V-O));return o?{kind:"rect",x:l(S-D/2),y:l(Math.min(O,V)),width:l(D),height:l(g),...z}:{kind:"rect",x:l(Math.min(O,V)),y:l(S-D/2),width:l(g),height:l(D),...z}};return n.forEach((M,L)=>{if(xe(e,M.name))return;let S=w.center(L),D=w.bandwidth,z=fl(d(M),h);z.forEach((x,C)=>{let v=`${M.name} ${x.label??`range ${C+1}`}: ${r(x.from)} \u2013 ${r(x.to)}`;T.push(E(x.from,x.to,S,D,{part:"range",fill:x.color??(x.variant?Ft(x.variant):K.axis),opacity:x.variant||x.color?.25:Math.max(.1,.4-C*.1),title:v}))});let O=P(M.target)?` \xB7 target ${r(M.target)}`:"",V=z.find(x=>M.value>=x.from&&M.value<=x.to),g=`${M.name}: ${r(M.value)}${O}${V?.label?` (${V.label})`:""}`;if(T.push(E(Math.min(h,M.value),M.value,S,D/3,{part:"measure",fill:ne(e,L,M.color),title:g,item:{label:g,id:M.id,name:M.name,index:L,value:M.value}})),P(M.target)){let x=l(b.scale(M.target));T.push({kind:"line",part:"target",x1:o?l(S-D/2.5):x,x2:o?l(S+D/2.5):x,y1:o?x:l(S-D/2.5),y2:o?x:l(S+D/2.5),stroke:"var(--skdx-color-text-default)",strokeWidth:3,title:`${M.name} target: ${r(M.target)}`})}if(e.labels){let x=b.scale(P(M.target)?Math.max(M.value,M.target):M.value);T.push(o?J(l(S),l(x-6),r(M.value),{part:"value-label",anchor:"middle"}):J(l(x+6),l(S),r(M.value),{part:"value-label",baseline:"middle"}))}}),{...R,shapes:[...T,...R.shapes]}}var Yo=e=>qt(e,"bar");function Ko(e){let n=e.variant??"area";return qt({...e,series:e.series.map(t=>({type:"range",name:t.name,low:t.low,high:t.high,color:t.color,axis:t.axis,curve:t.curve,style:n}))},"bar")}var Xr=e=>Math.round(e*1e6)/1e6,_s=60,pl=500;function Xo(e){let n=[],t=new Map;for(let Z of e.nodes)t.has(Z.id)?n.push({code:"duplicate-id",severity:"warning",message:`Node id "${Z.id}" is duplicated; the first definition is kept.`,itemId:Z.id}):t.set(Z.id,Z);let r=Z=>Z.group,o=[...t.values()].filter(Z=>!(Z.group!==void 0&&xe(e,Z.group))),a=new Set(o.map(Z=>Z.id)),s=e.edges.filter(Z=>{let ae=a.has(Z.source)&&a.has(Z.target);return!ae&&!(t.has(Z.source)&&t.has(Z.target))&&n.push({code:"unknown-node",severity:"warning",message:`Edge ${Z.source} \u2192 ${Z.target} names a node that does not exist and was dropped.`,itemId:Z.id}),ae}),d=le(e,o.length===0);if(d)return{...d,issues:n};let i=oe(e.format),{width:c,height:m}=de(e),[h,f]=e.nodeRange??[5,16],y=e.labels??o.length<=_s,$=[...new Set(e.nodes.map(r).filter(Z=>Z!==void 0))],b=$.map((Z,ae)=>({name:Z,color:ne(e,ae)})),w=Te(c,m,{top:ue(e,b,c)+f+8,right:f+(y?48:8),bottom:f+8,left:f+8}),R=(Z,ae)=>Z.color??ne(e,Z.group!==void 0?$.indexOf(Z.group):ae),[,k]=we(o.map(Z=>Z.value)),T=Z=>P(Z)&&k>0?h+Math.sqrt(Math.max(0,Z)/k)*(f-h):h,E=new Map;for(let Z of s)E.set(Z.source,(E.get(Z.source)??0)+1),Z.target!==Z.source&&E.set(Z.target,(E.get(Z.target)??0)+1);let M=o.length,L=new Map(o.map((Z,ae)=>[Z.id,ae])),S,D,z=e.arrange??"force";z==="manual"&&o.every(Z=>P(Z.x)&&P(Z.y))?(S=o.map(Z=>Z.x),D=o.map(Z=>Z.y)):z==="circular"||z==="manual"||M<3?(S=o.map((Z,ae)=>Xr(Math.cos(2*Math.PI*ae/M-Math.PI/2))),D=o.map((Z,ae)=>Xr(Math.sin(2*Math.PI*ae/M-Math.PI/2)))):{xs:S,ys:D}=bl(M,s.map(Z=>[L.get(Z.source),L.get(Z.target)]),e.iterations??Math.max(50,Math.min(300,Math.floor(3e4/M))));let[O,V]=we(S),[g,x]=we(D),C=Math.max(V-O,x-g)||1,v=Math.min(w.width/C,w.height/C),F=w.x+(w.width-(V-O)*v)/2,U=w.y+(w.height-(x-g)*v)/2,Y=o.map((Z,ae)=>({node:Z,index:ae,x:l(F+(S[ae]-O)*v),y:l(U+(D[ae]-g)*v),r:l(T(Z.value)),color:R(Z,ae),degree:E.get(Z.id)??0})),j=new Map(Y.map(Z=>[Z.node.id,Z])),I=Kn(e.selected)[0],G=I!==void 0?j.get(String(I)):void 0,H=new Set;if(G){H.add(G.node.id);for(let Z of s)Z.source===G.node.id&&H.add(Z.target),Z.target===G.node.id&&H.add(Z.source)}let Q=(Z,ae=Z)=>G&&!(H.has(Z)&&H.has(ae))?.15:void 0,p=Z=>!G||Z.source===G.node.id||Z.target===G.node.id,[,q]=we(s.map(Z=>Z.value)),N=s.length<=pl,B=[],_=(Z,ae,ke)=>B.some(Fe=>Math.abs(Fe.y-ae)<12&&Z<Fe.x+Fe.w+4&&Z+ke+4>Fe.x)?!1:(B.push({x:Z,y:ae,w:ke}),!0),W=[],ee=[],te=s.map(Z=>{let ae=j.get(Z.source),ke=j.get(Z.target),Fe=P(Z.value)&&q>0?1+3*Math.sqrt(Math.max(0,Z.value)/q):1,Be=`${ae.node.label??ae.node.id} \u2192 ${ke.node.label??ke.node.id}${Z.label?` ${Z.label}`:""}${P(Z.value)?`: ${i(Z.value)}`:""}`,Mt=p(Z)?Q(Z.source,Z.target):.15,wt=N?{label:Be,id:Z.id,name:Z.source,category:Z.target,value:Z.value}:void 0;if(ae===ke){let mt=ae.r*2.5;return{kind:"path",part:"edge",d:`M${l(ae.x)} ${l(ae.y-ae.r)}C${l(ae.x-mt)} ${l(ae.y-mt*1.5)} ${l(ae.x+mt)} ${l(ae.y-mt*1.5)} ${l(ae.x)} ${l(ae.y-ae.r)}`,stroke:K.axis,strokeWidth:Fe,opacity:Mt??.7,title:N?Be:void 0,item:wt}}let Cn=Math.sqrt((ke.x-ae.x)*(ke.x-ae.x)+(ke.y-ae.y)*(ke.y-ae.y))||1,Nn=(ke.x-ae.x)/Cn,un=(ke.y-ae.y)/Cn;if(e.directed){let mt=ke.x-Nn*ke.r,kt=ke.y-un*ke.r,hn=mt-Nn*6,qn=kt-un*6;W.push({kind:"path",part:"arrow",d:`M${l(mt)} ${l(kt)}L${l(hn-un*3)} ${l(qn+Nn*3)}L${l(hn+un*3)} ${l(qn-Nn*3)}Z`,fill:K.axis,opacity:Mt??.7})}let Mn=`${Z.label??""}${P(Z.value)?`${Z.label?": ":""}${i(Z.value)}`:""}`;if(e.edgeLabels&&Mn){let mt=(ae.x+ke.x)/2,kt=(ae.y+ke.y)/2,hn=Mn.length*ie;_(mt-hn/2,kt,hn)&&ee.push(J(l(mt),l(kt),Mn,{part:"edge-label",anchor:"middle",baseline:"middle"}))}return{kind:"path",part:"edge",d:`M${l(ae.x)} ${l(ae.y)}L${l(ke.x)} ${l(ke.y)}`,stroke:K.axis,strokeWidth:Fe,opacity:Mt??.7,title:N?Be:void 0,item:wt}}),re=[],me=[];for(let Z of Y){let ae=Z.node.label??Z.node.id,ke=P(Z.node.value)?`: ${i(Z.node.value)}`:"",Fe=Z.node.group!==void 0?` \xB7 ${Z.node.group}`:"",Be=`${ae}${ke}${Fe} \xB7 ${Z.degree} connection${Z.degree===1?"":"s"}`;if(re.push({kind:"circle",part:"node",cx:Z.x,cy:Z.y,r:Z.r,fill:Z.color,stroke:G?.node.id===Z.node.id?"var(--skdx-color-text-default)":"var(--skdx-color-surface-default)",opacity:Q(Z.node.id),title:Be,item:{label:Be,name:Z.node.id,category:Z.node.group,index:Z.index,value:Z.node.value}}),!y)continue;let Mt=ae.length*ie,wt=Z.x+Z.r+4,Cn=Z.y;_(wt,Cn,Mt)&&me.push(J(l(wt),l(Cn),ae,{part:"node-label",baseline:"middle",fill:Q(Z.node.id)===void 0?"var(--skdx-color-text-default)":K.grid}))}let be=he(e,c,m,b);return{...be,shapes:[...te,...W,...re,...ee,...me,...be.shapes],issues:n}}function bl(e,n,t){let r=Array.from({length:e},(i,c)=>Xr(Math.cos(2*Math.PI*c/e))),o=Array.from({length:e},(i,c)=>Xr(Math.sin(2*Math.PI*c/e))),a=Math.sqrt(4/e),s=new Array(e).fill(0),d=new Array(e).fill(0);for(let i=0;i<t;i++){let c=.1*(1-i/t)+.005;s.fill(0),d.fill(0);for(let m=0;m<e;m++)for(let h=m+1;h<e;h++){let f=r[m]-r[h],y=o[m]-o[h];f===0&&y===0&&(f=.001*(m%7+1),y=.001*(h%5+1));let $=f*f+y*y,b=a*a/$;s[m]=s[m]+f*b,d[m]=d[m]+y*b,s[h]=s[h]-f*b,d[h]=d[h]-y*b}for(let[m,h]of n){if(m===h)continue;let f=r[m]-r[h],y=o[m]-o[h],$=Math.sqrt(f*f+y*y)||1e-6,b=$*$/a/$;s[m]=s[m]-f*b,d[m]=d[m]-y*b,s[h]=s[h]+f*b,d[h]=d[h]+y*b}for(let m=0;m<e;m++){let h=Math.sqrt(s[m]*s[m]+d[m]*d[m])||1e-6,f=Math.min(h,c);r[m]=r[m]+s[m]/h*f,o[m]=o[m]+d[m]/h*f}}return{xs:r,ys:o}}var Qo=14;function Jo(e){let n=[],t=e.events.map((C,v)=>({event:C,index:v,time:new Date(C.date).getTime()})).filter(C=>Number.isFinite(C.time)?!(C.event.group!==void 0&&xe(e,C.event.group)):(n.push({code:"invalid-value",severity:"warning",message:`Event "${C.event.label}" has an unparseable date and was dropped.`,itemId:C.event.id??C.event.label}),!1)).sort((C,v)=>C.time-v.time||C.index-v.index),r=le(e,t.length===0);if(r)return{...r,issues:n};let{width:o,height:a}=de(e),s=e.orientation==="vertical",d=[...new Set(e.events.map(C=>C.group).filter(C=>C!==void 0))],i=d.length?d:[""],[c,m]=we(t.map(C=>C.time)),h=e.xAxis?.format??{style:m-c<2*864e5?"time":"date"},f=C=>Qt(C,h),y=e.labels??!0,$=t.map(C=>{let v=C.event.group,F=C.event.color??(C.event.variant?Ft(C.event.variant):ne(e,v===void 0?0:d.indexOf(v))),U=C.event.description?` \u2014 ${C.event.description}`:"";return{...C,lane:v===void 0?0:d.indexOf(v),color:F,text:`${C.event.label} \xB7 ${f(C.time)}${U}`}}),b=d.map((C,v)=>({name:C,color:ne(e,v)})),w=he(e,o,a,b),R=C=>({label:C.text,id:C.event.id,name:C.event.label,category:C.event.group,index:C.index,value:C.time}),k=[];if(s){let C=Math.max(...$.map(Y=>f(Y.time).length))*ie+16,v=Te(o,a,{top:8+ue(e,b,o),right:8,bottom:8,left:C+12}),F=je($.length,[v.y,v.y+v.height],0),U=l(v.x);return k.push({kind:"line",part:"axis",x1:U,x2:U,y1:v.y,y2:v.y+v.height,stroke:K.axis}),$.forEach((Y,j)=>{let I=l(F.center(j));if(k.push(J(l(v.x-12),I,f(Y.time),{part:"x-label",anchor:"end",baseline:"middle"}),{kind:"circle",part:"event",cx:U,cy:I,r:5,fill:Y.color,stroke:"var(--skdx-color-surface-default)",title:Y.text,item:R(Y)}),y){let G=Y.event.description,H=F.step>=2*Qo&&G;k.push(J(l(v.x+12),H?l(I-7):I,Y.event.label,{part:"event-label",baseline:"middle",fill:"var(--skdx-color-text-default)"})),H&&k.push(J(l(v.x+12),l(I+7),G,{part:"event-description",baseline:"middle"}))}}),{...w,shapes:[...k,...w.shapes],issues:n}}let T=d.length?Math.max(...d.map(C=>C.length))*ie+16:8,E=Math.max(f(c).length,f(m).length)*ie/2+4,M=Te(o,a,{top:8+ue(e,b,o),right:Math.max(16,E),bottom:32+(e.xAxis?.label?14:0),left:Math.max(16,T,E)}),L=(m-c)*.04||36e5,S=st([c-L,m+L],[M.x,M.x+M.width]),D=Jn(c-L,m+L).filter(C=>C>=c-L&&C<=m+L).map(C=>({pos:l(S(C)),label:f(C)}));for(let C of Re(D,M.width))k.push({kind:"line",part:"grid",x1:C.pos,x2:C.pos,y1:M.y,y2:M.y+M.height,stroke:K.grid},J(C.pos,M.y+M.height+20,C.label,{part:"x-label",anchor:"middle"}));e.xAxis?.label&&k.push(J(l(M.x+M.width/2),a-4,e.xAxis.label,{part:"axis-title",anchor:"middle"}));let z=je(i.length,[M.y,M.y+M.height],0),O=Math.max(0,Math.floor((z.step/2-14)/Qo));i.forEach((C,v)=>{let F=l(z.center(v));k.push({kind:"line",part:"axis",x1:M.x,x2:M.x+M.width,y1:F,y2:F,stroke:K.axis}),C&&k.push(J(M.x-8,F,C,{part:"y-label",anchor:"end",baseline:"middle"}))});let V=i.map(()=>[]),g=[],x=[];for(let C of $){let v=l(S(C.time)),F=l(z.center(C.lane));if(x.push({kind:"circle",part:"event",cx:v,cy:F,r:5,fill:C.color,stroke:"var(--skdx-color-surface-default)",title:C.text,item:R(C)}),!y)continue;let U=C.event.label.length*ie,Y=v-U/2,j=V[C.lane],I=0;for(;I<=O&&(j[I]??-1/0)>Y-6;)I++;if(I>O)continue;j[I]=Y+U;let G=l(F-12-I*Qo),H=l(Math.max(U/2+2,Math.min(o-U/2-2,v)));I>0&&g.push({kind:"line",part:"connector",x1:v,x2:v,y1:l(F-6),y2:l(G+4),stroke:K.grid}),g.push(J(H,G,C.event.label,{part:"event-label",anchor:"middle",fill:"var(--skdx-color-text-default)"}))}return{...w,shapes:[...k,...g,...x,...w.shapes],issues:n}}var js="var(--skdx-radius-default, var(--skdx-radius-md, 0.5rem))";function Qr(e){return["tooltip","skeleton","label-background","stage-label-background","brush-handle"].includes(e)?js:void 0}function sr(e,n,t,r,o){let a=e.getBoundingClientRect();return{x:a.width?(n-a.left)*r/a.width:n,y:a.height?(t-a.top)*o/a.height:t}}var ea=(e,n,t)=>n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height;function Gs(e,n){let t=0,r=1/0;return e.xs.forEach((o,a)=>{let s=Math.abs(o-n);s<r&&(r=s,t=a)}),t}function Cr(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=Gs(t,n),o=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(o,r)??o}}function ta(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=t.xs[Gs(t,n)];return{kind:"line",part:"crosshair",x1:r,x2:r,y1:t.plot.y,y2:t.plot.y+t.plot.height,stroke:K.axis,dash:"3 3"}}function na(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!ea(r.plot,n,t))return[];let o=ta(e,n),{rows:a}=Cr(e,n),s=e.tooltipAnchored?r.plot.y+8:t;return[o,...Wr(o.x1,s,a,e.width,e.height,e.tooltipPlacement)]}function ra(e,n){let t=e.hit;if(!t||t.xs.length===0)return[];let r=t.rows.findIndex(a=>a[0]===n);if(r<0)return[];let o=t.xs[r];return na(e,o,t.plot.y+8)}function oa(e,n,t,r,o){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:i,y:c}=sr(t,r,o,e.width,e.height);if(ea(e.hit.plot,i,c)){let m=Cr(e,i),h=ta(e,i);if(m&&h)return{lines:m.rows,shapes:[h]}}}let a=n?.closest?.("[data-skdx-part]"),s=e.tooltipFormatter?Hn(e,n)?.item:void 0,d=s&&e.tooltipFormatter?.(s)||a&&Array.from(a.children).find(i=>i.tagName.toLowerCase()==="title")?.textContent;return d?{lines:Array.isArray(d)?d:[d],shapes:[]}:{lines:[],shapes:[]}}function Ws(e,n,t,r,o,a,s){let d=e?.closest?.("[data-skdx-part]"),i=s&&s.tooltipFormatter?Hn(s,e)?.item:void 0,c=i&&s?.tooltipFormatter?.(i)||d&&Array.from(d.children).find($=>$.tagName.toLowerCase()==="title")?.textContent;if(!c)return[];let m=s?.tooltipAnchored?Hn(s,e):void 0,h=m?s?.shapes[m.index]:void 0,{x:f,y}=h?Or(h):sr(n,t,r,o,a);return Wr(f,y,c,o,a,s?.tooltipPlacement)}function aa(e,n,t,r,o){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:a,y:s}=sr(t,r,o,e.width,e.height),d=na(e,a,s);if(d.length>0)return d}return Ws(n,t,r,o,e.width,e.height,e)}function sa(e,n){let t=Hn(e,n);return t&&!t.item.legend?Vn(t.item):null}var gl=(e,n)=>{let{x:t,y:r}=Or(e),o=e.kind==="circle"?e.cy:e.kind==="rect"?e.y+e.height/2:r;return t>=n.x&&t<=n.x+n.width&&o>=n.y&&o<=n.y+n.height};function ia(e,n){let t=new Set,r=[];for(let o of e.shapes){if(!o.item||o.item.legend||o.part==="anchor"||!gl(o,n))continue;let a=Vn(o.item),s=JSON.stringify(a);t.has(s)||(t.add(s),r.push(a))}return r}var la=e=>({kind:"rect",part:"selection-box",x:l(e.x),y:l(e.y),width:l(e.width),height:l(e.height),fill:K.focus,opacity:.12,stroke:K.focus}),eo=(e,n,t,r)=>({x:Math.min(e,t),y:Math.min(n,r),width:Math.abs(t-e),height:Math.abs(r-n)});function qs(e,n,t){let r=!1;for(let o=0,a=e.length-1;o<e.length;a=o++){let s=e[o],d=e[a];s.y>t!=d.y>t&&n<(d.x-s.x)*(t-s.y)/(d.y-s.y)+s.x&&(r=!r)}return r}function ca(e,n){if(n.length<3)return[];let t=new Set,r=[];for(let o of e.shapes){if(!o.item||o.item.legend||o.part==="anchor")continue;let{x:a,y:s}=Or(o),d=o.kind==="circle"?o.cy:o.kind==="rect"?o.y+o.height/2:s;if(!qs(n,a,d))continue;let i=Vn(o.item),c=JSON.stringify(i);t.has(c)||(t.add(c),r.push(i))}return r}var da=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${l(n.x)} ${l(n.y)}`).join("L")}`:"",fill:K.focus,fillOpacity:.12,stroke:K.focus,dash:"4 3"}),Jr=6;function ma(e,n,t){let r=e.edit;if(r){for(let o of r.bars)if(!(t<o.y||t>o.y+o.height||n<o.x0-Jr||n>o.x1+Jr))return Math.abs(n-o.x0)<=Jr?{bar:o,mode:"start"}:Math.abs(n-o.x1)<=Jr?{bar:o,mode:"end"}:{bar:o,mode:"move"}}}function ua(e,n,t){let r=e.edit;return Zs(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function ha(e,n,t){let r=e.edit,o=t.key==="ArrowRight"?1:t.key==="ArrowLeft"?-1:0;if(!r||n===null||!o||!(t.shiftKey||t.altKey))return;let a=r.bars.find(i=>i.index===n);if(!a)return;let s=t.altKey?t.shiftKey?"start":"end":"move",d=r.snap??r.invert(a.x0+10)-r.invert(a.x0);return Zs(r,{bar:a,mode:s},o*d)}function Zs(e,{bar:n,mode:t},r){let o=d=>e.snap?Math.round(d/e.snap)*e.snap:d,a=n.start,s=n.end;return t==="move"?(a=o(n.start+r),s=a+(n.end-n.start)):t==="start"?a=Math.min(o(n.start+r),n.end):s=Math.max(o(n.end+r),n.start),{id:n.id,name:n.name,start:a,end:s}}function fa(e,n,t){let r=e.edit,o=r.scale(t.start),a=r.scale(t.end);return{kind:"rect",part:"edit-ghost",x:l(Math.min(o,a)),y:l(n.bar.y),width:l(Math.max(1,Math.abs(a-o))),height:l(n.bar.height),fill:K.focus,opacity:.25,stroke:K.focus,rx:2}}var xl=64,yl=e=>Math.max(1,Math.min(xl,e));function pa(e,n,t,r){let o=n>0?.8:1.25,a=yl(e.view.zoom*o);if(a===e.view.zoom)return e.view;let{plot:s,scale:d}=e,[i,c]=e.view.center,m=(t-(s.x+s.width/2))/d,h=(r-(s.y+s.height/2))/d,f=e.view.zoom/a;return{center:[i+m*(1-f),e.fromY(e.toY(c)-h*(1-f))],zoom:a}}function ba(e,n,t,r){let{scale:o}=e;return{center:[n.center[0]-t/o,e.fromY(e.toY(n.center[1])+r/o)],zoom:n.zoom}}function Hn(e,n){let t=n?.closest?.("[data-skdx-i]"),r=Number(t?.getAttribute("data-skdx-i")),o=Number.isInteger(r)?e.shapes[r]?.item:void 0;return o?{index:r,item:o}:void 0}var to=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function Or(e){switch(e.kind){case"rect":return{x:e.x+e.width/2,y:e.y};case"circle":return{x:e.cx,y:e.cy-e.r};case"line":return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)};case"text":return{x:e.x,y:e.y};case"path":{let n=/M\s*(-?[\d.]+)[ ,](-?[\d.]+)/.exec(e.d);return n?{x:Number(n[1]),y:Number(n[2])}:{x:0,y:0}}}}function ga(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=K.focus,o;switch(t.kind){case"rect":o={kind:"rect",part:"focus",x:t.x-2,y:t.y-2,width:t.width+4,height:t.height+4,fill:"none",stroke:r,rx:2};break;case"circle":o={kind:"circle",part:"focus",cx:t.cx,cy:t.cy,r:t.r+3,fill:"none",stroke:r};break;case"line":o={kind:"line",part:"focus",x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:r,strokeWidth:4};break;case"text":o={kind:"rect",part:"focus",x:t.x-2,y:t.y-8,width:t.text.length*ie+4,height:16,fill:"none",stroke:r,rx:2};break;case"path":o={kind:"path",part:"focus",d:t.d,stroke:r,strokeWidth:2,fill:"none"};break}let{x:a,y:s}=Or(t),d=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[o,...d?Wr(l(a),l(s),d,e.width,e.height):[]]}function xa(e,n,t){let r=to(e);if(r.length===0)return;let o=n===null?-1:r.indexOf(n);switch(t){case"ArrowRight":case"ArrowDown":return r[Math.min(r.length-1,o+1)];case"ArrowLeft":case"ArrowUp":return r[Math.max(0,o<=0?0:o-1)];case"Home":return r[0];case"End":return r[r.length-1];case"Escape":return null;default:return}}var or=2,ar=(e,n,t)=>{let r=Math.max(or,Math.min(t,Math.round(n))),o=Math.max(0,Math.min(t-r,Math.round(e)));return{start:o,end:o+r}},Us=(e,n)=>!e||e.start<=0&&e.end>=n;function ya(e,n,t){if(e.count<=or||!e.plot.width)return;let{start:r,end:o}=e.zoom,a=o-r,s=n>0?1.25:.8,d=Math.max(or,Math.min(e.count,Math.round(a*s)));if(d===a)return n>0&&!Us(e.zoom,e.count)?ar(r,d,e.count):void 0;let i=Math.max(0,Math.min(1,(t-e.plot.x)/e.plot.width)),c=r+i*a;return ar(c-i*d,d,e.count)}function va(e,n,t,r){let o=n.end-n.start,a=Math.max(or,Math.min(e.count,Math.round(o/Math.max(.05,t)))),s=Math.max(0,Math.min(1,(r-e.plot.x)/Math.max(1,e.plot.width)));return ar(n.start+s*o-s*a,a,e.count)}function Ma(e,n,t){let r=n.end-n.start,o=e.plot.width/Math.max(1,r);return ar(n.start-t/o,r,e.count)}function wa(e,n,t){let r=e.brush;if(!r||!ea(r.box,n,t))return;let o=r.window;if(Math.abs(n-o.x)<=6)return{grab:"left",zoom:e.zoom};if(Math.abs(n-(o.x+o.width))<=6)return{grab:"right",zoom:e.zoom};if(n>o.x&&n<o.x+o.width)return{grab:"move",zoom:e.zoom};let a=e.zoom.end-e.zoom.start,s=(n-r.box.x)/Math.max(1,r.box.width)*e.count;return{grab:"move",zoom:ar(s-a/2,a,e.count)}}function ka(e,n,t,r){let o=e.brush;if(!o)return t;let a=r/Math.max(1,o.box.width)*e.count;if(n==="move")return ar(t.start+a,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-or,Math.round(t.start+a))),end:t.end};let s=Math.min(e.count,Math.max(t.start+or,Math.round(t.end+a)));return{start:t.start,end:s}}function zr(e,n){switch(n.type){case"svg":return Promise.resolve(Lr(e,n.label,n.resolve));case"csv":return Promise.resolve(Rr(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=Lr(e,n.label,n.resolve);return Xs(t,e.width,e.height,n.scale,n.background)}}}var kn=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/"/g,"""),Sr=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${kn(String(t))}"`).join("");function Ys(e){let n=e.title?`<title>${kn(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${Sr([t,["d",e.d],["fill",e.fill??"none"],["stroke",e.stroke],["stroke-width",e.strokeWidth],["stroke-linecap",e.strokeLinecap],["stroke-linejoin",e.strokeLinejoin],["stroke-dasharray",e.dash],["opacity",e.opacity],["fill-opacity",e.fillOpacity]])}>${n}</path>`;case"rect":return`<rect${Sr([t,["x",e.x],["y",e.y],["width",e.width],["height",e.height],["rx",e.rx],["fill",e.fill],["stroke",e.stroke],["fill-opacity",e.opacity]])}>${n}</rect>`;case"line":return`<line${Sr([t,["x1",e.x1],["y1",e.y1],["x2",e.x2],["y2",e.y2],["stroke",e.stroke],["stroke-width",e.strokeWidth],["stroke-dasharray",e.dash],["opacity",e.opacity]])}>${n}</line>`;case"circle":return`<circle${Sr([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${Sr([t,["aria-label",e.title],["x",e.x],["y",e.y],["text-anchor",e.anchor],["dominant-baseline",e.baseline],["fill",e.fill],["font-weight",e.weight],["transform",e.rotate?`rotate(${e.rotate} ${e.x} ${e.y})`:void 0]])}>${kn(e.text)}</text>`}}function Ks(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${kn(t.id)}" x1="0" y1="0" x2="${t.vertical===!1?1:0}" y2="${t.vertical===!1?0:1}">${t.stops.map(r=>`<stop offset="${r.offset}" stop-color="${kn(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function Lr(e,n,t){let r=Ks(e)+e.shapes.map(Ys).join("");t&&(r=r.replace(/var\((--[\w-]+)\)/g,(s,d)=>t(d).trim()||s));let o=e.decorative?'aria-hidden="true"':`role="img" aria-label="${kn(n)}"`,a=e.description?`<desc>${kn(e.description)}</desc>`:"";return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e.width} ${e.height}" width="${e.width}" height="${e.height}" ${o} font-family="${kn(K.fontFamily)}" font-size="${kn(K.fontSize)}"><title>${kn(n)}</title>${a}${r}</svg>`}function Xs(e,n,t,r=2,o){return new Promise((a,s)=>{let d=URL.createObjectURL(new Blob([e],{type:"image/svg+xml;charset=utf-8"})),i=new Image;i.onload=()=>{URL.revokeObjectURL(d);let c=document.createElement("canvas");c.width=Math.round(n*r),c.height=Math.round(t*r);let m=c.getContext("2d");if(!m)return s(new Error("canvas 2d context unavailable"));o&&(m.fillStyle=o,m.fillRect(0,0,c.width,c.height)),m.drawImage(i,0,0,c.width,c.height),c.toBlob(h=>h?a(h):s(new Error("toBlob failed")),"image/png")},i.onerror=()=>{URL.revokeObjectURL(d),s(new Error("svg could not be decoded"))},i.src=d})}function Rr(e){let n=t=>{let r=t==null?"":String(t);return/[",\n\r]/.test(r)?`"${r.replace(/"/g,'""')}"`:r};return e.map(t=>t.map(n).join(",")).join(`\r
|
|
3
|
+
`)}function $a(e,n=[]){let t=Math.max(n.length,...e.map(o=>o.data.length)),r=[["",...e.map(o=>o.name)]];for(let o=0;o<t;o++){let a=n[o];r.push([a instanceof Date?a.toISOString():a??o+1,...e.map(s=>s.data[o])])}return Rr(r)}var De=e=>P(e.value)?e.value:(e.children??[]).reduce((n,t)=>n+De(t),0),Ia=e=>P(e.value)||(e.children??[]).some(Ia),Nr=e=>e.length===0?0:1+Math.max(...e.map(n=>Nr(n.children??[]))),tt=e=>e.id??e.name;function Qs(e,n){for(let t of e){if(tt(t)===n||t.name===n)return[t];let r=Qs(t.children??[],n);if(r)return[t,...r]}}var ir=(e,n)=>n==="asc"||n==="desc"?[...e].sort((t,r)=>n==="asc"?De(t)-De(r):De(r)-De(t)):[...e];function fn(e,n,t=1){return n===void 0?[...e]:e.map(r=>t>=n?{...r,value:De(r),children:void 0}:{...r,children:r.children?fn(r.children,n,t+1):void 0})}function $n(e,n){if(n===void 0)return{nodes:[...e],path:[]};let t=Qs(e,n);if(!t)return{nodes:[...e],path:[]};let r=t[t.length-1];return{nodes:r.children?.length?r.children:[r],path:t}}function Ta(e,n){if(!n)return;let t=typeof n=="object"?n.maxRows??500:500,r=e.hit;if(r&&r.rows.length>0){let d=r.rows[0];if(r.rows.length>t)return;let i=["",...d.slice(1).map(m=>m.replace(/:\s[^:]*$/,""))],c=r.rows.map(m=>[m[0],...m.slice(1).map(h=>h.slice(h.lastIndexOf(": ")+2))]);return[i,...c]}let o=e.shapes.flatMap(d=>d.item&&!d.item.legend&&!(d.part==="anchor"&&!d.title)?[d.item]:[]);if(o.length===0||o.length>t)return;let a=["series","name","category","value"].filter(d=>o.some(i=>i[d]!==void 0)),s=(d,i)=>d[i]===void 0?"":String(d[i]);return[a.map(d=>d[0]?.toUpperCase()+d.slice(1)),...o.map(d=>a.map(i=>s(d,i)))]}var Aa=new Map;function lr(e){let n=Aa.get(e);if(n)return n.group;let t=new Set,r={},o={current:r,subscribe(a){return t.add(a),()=>{t.delete(a),t.size===0&&Aa.delete(e)}},publish(a,s){Object.assign(r,a);for(let d of t)d(a,s)}};return Aa.set(e,{group:o,listeners:t}),o}var Js='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',Ca=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${Js}{animation:skdx-in var(--skdx-chart-duration,0ms) ease-out;transition:${["x","y","width","height","cx","cy","r","opacity","fill-opacity","d"].map(e=>`${e} var(--skdx-chart-duration,0ms) ease-out`).join(",")}}@media (prefers-reduced-motion:reduce){${Js}{animation:none;transition:none}}`;function Oa(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}function Sa(e){let n=[],t=e.nodes?new Set(e.nodes.map(g=>g.id)):void 0,r=e.links.filter(g=>!P(g.value)||g.value<=0?(n.push({code:"invalid-value",severity:"warning",message:`Link ${g.source} \u2192 ${g.target} has no positive value and was dropped.`,itemId:g.id}),!1):g.source===g.target?(n.push({code:"self-link",severity:"warning",message:`Link ${g.source} \u2192 ${g.target} points at its own node and was dropped.`,itemId:g.id}),!1):t&&!(t.has(g.source)&&t.has(g.target))?(n.push({code:"unknown-node",severity:"warning",message:`Link ${g.source} \u2192 ${g.target} names a node not in \`nodes\` and was dropped.`,itemId:g.id}),!1):!0),{links:o,back:a}=vl(r),s=e.cyclePolicy??"drop";for(let g of a)n.push({code:"cycle",severity:s==="error"?"error":"warning",message:`Link ${g.source} \u2192 ${g.target} closes a cycle and was ${s==="error"?"rejected":"dropped"}.`,itemId:g.id});let d=le(s==="error"&&a.length>0?{...e,error:e.error??`${a.length} link${a.length===1?"":"s"} close a cycle`}:e,o.length===0);if(d)return{...d,issues:n};let i=oe(e.format),c=Math.max(0,e.nodePadding??8),m=Math.max(1,e.nodeWidth??16),{width:h,height:f}=de(e),y=Te(h,f,{top:8+ue(e),right:96,bottom:8,left:8}),$=new Map,b=new Map((e.nodes??[]).map(g=>[g.id,g])),w=g=>{let x=$.get(g);if(!x){let C=b.get(g);x={id:g,name:C?.label??g,depth:0,value:0,color:ne(e,$.size,C?.color),x:0,y:0,height:0,outY:0,inY:0},$.set(g,x)}return x};for(let g of e.nodes??[])w(g.id);for(let g of o)w(g.source),w(g.target);for(let g=0,x=!0;x&&g<=$.size;g++){x=!1;for(let C of o){let v=w(C.source).depth+1;v>w(C.target).depth&&(w(C.target).depth=v,x=!0)}}let R=new Map,k=new Map;for(let g of o)R.set(g.source,(R.get(g.source)??0)+g.value),k.set(g.target,(k.get(g.target)??0)+g.value);if(e.align==="justify"){let g=Math.max(0,...[...$.values()].map(x=>x.depth));for(let x of $.values())R.has(x.id)||(x.depth=g)}let T=Kn(e.selected).map(String),E=g=>T.includes(g),M=g=>T.length===0||E(g)||o.some(x=>E(x.source)&&x.target===g||E(x.target)&&x.source===g);for(let g of $.values())g.value=Math.max(R.get(g.id)??0,k.get(g.id)??0);let L=new Map;for(let g of $.values())L.set(g.depth,[...L.get(g.depth)??[],g]);if(e.nodeSort)for(let g of L.values())g.sort((x,C)=>e.nodeSort==="asc"?x.value-C.value:C.value-x.value);let S=Math.max(0,...L.keys()),D=Math.min(...[...L.values()].map(g=>(y.height-c*(g.length-1))/g.reduce((x,C)=>x+C.value,0)));for(let[g,x]of L){let C=y.y;for(let v of x)v.x=y.x+(S===0?0:g*(y.width-m)/S),v.y=C,v.height=v.value*D,v.outY=v.inY=C,C+=v.height+c}let z=[...o];e.linkSort&&z.sort((g,x)=>e.linkSort==="asc"?g.value-x.value:x.value-g.value);let O=[],V=[];for(let g of z){let x=w(g.source),C=w(g.target),v=g.value*D,F=T.length===0||E(g.source)||E(g.target),U=x.x+m,Y=C.x,j=(U+Y)/2,I=x.outY,G=C.inY;x.outY+=v,C.inY+=v;let H=`${x.name} \u2192 ${C.name}: ${i(g.value)}`;O.push({kind:"path",part:"link",d:`M${l(U)} ${l(I)}C${l(j)} ${l(I)} ${l(j)} ${l(G)} ${l(Y)} ${l(G)}L${l(Y)} ${l(G+v)}C${l(j)} ${l(G+v)} ${l(j)} ${l(I+v)} ${l(U)} ${l(I+v)}Z`,fill:x.color,opacity:F?.4:.08,title:H,item:{label:H,id:g.id??`${g.source}\u2192${g.target}`,name:g.source,category:g.target,value:g.value}});let Q=Y-U>(x.name.length+i(g.value).length)*ie+24;e.linkLabels&&v>=12&&F&&Q&&V.push(J(l(j),l((I+G+v)/2),i(g.value),{part:"link-label",anchor:"middle",baseline:"middle"}))}for(let g of $.values()){let x=`${g.name}: ${i(g.value)}`;O.push({kind:"rect",part:"node",x:l(g.x),y:l(g.y),width:m,height:l(g.height),fill:g.color,opacity:M(g.id)?void 0:.3,title:x,item:{label:x,id:g.id,name:g.name,value:g.value}});let C=g.depth===S;(e.nodeLabels??!0)&&O.push(J(l(C?g.x-6:g.x+m+6),l(g.y+g.height/2),g.name,{anchor:C?"end":"start",baseline:"middle"}))}return{...he(e,h,f),shapes:[...O,...V],issues:n}}function vl(e){let n=new Map;for(let a of e)n.set(a.source,[...n.get(a.source)??[],a]);let t=new Map,r=new Set,o=a=>{t.set(a,"active");for(let s of n.get(a)??[]){let d=t.get(s.target);d==="active"?r.add(s):d===void 0&&o(s.target)}t.set(a,"done")};for(let a of e)t.has(a.source)||o(a.source);return{links:e.filter(a=>!r.has(a)),back:[...r]}}function La(e,n,t,r,o,a){if(e.length===0)return;let s=(h,f)=>{let y=h.reduce((w,R)=>w+R.area,0),$=Math.max(...h.map(w=>w.area)),b=Math.min(...h.map(w=>w.area));return Math.max(f*f*$/(y*y),y*y/(f*f*b))},d=Math.min(r,o),i=[],c=0;for(;c<e.length;){let h=[...i,e[c]];if(i.length===0||s(h,d)<=s(i,d))i=h,c++;else break}let m=i.reduce((h,f)=>h+f.area,0);if(r>=o){let h=m/o,f=t;for(let y of i){let $=y.area/h;a(y,[n,f,h,$]),f+=$}La(e.slice(c),n+h,t,r-h,o,a)}else{let h=m/r,f=n;for(let y of i){let $=y.area/h;a(y,[f,t,$,h]),f+=$}La(e.slice(c),n,t+h,r,o-h,a)}}function Ml(e,n,t,r,o,a,s){let d=e.reduce((c,m)=>c+m.area,0),i=s?t:n;for(let c of e){let m=d>0?c.area/d:0;if(s){let h=o*m;a(c,[n,i,r,h]),i+=h}else{let h=r*m;a(c,[i,t,h,o]),i+=h}}}function za(e){let{nodes:n,path:t}=$n(e.data,e.rootId),r=fn(n,e.maxDepth),o=le(e,!r.some(M=>De(M)>0));if(o)return o;let a=oe(e.format),{width:s,height:d}=de(e),i=e.breadcrumbs&&t.length>0,c=r.map((M,L)=>({name:M.name,color:ne(e,L,M.color)})),m=ue(e,c,s)+(i?20:0),h=Math.max(0,e.padding??2),f=e.sort??"desc",y=e.tiling??"squarify",$=e.labels??!0,b=[],w=[],R=M=>{for(let L of M)L.children?.length?R(L.children):w.push(De(L))};R(r);let k=e.colorScale?Pt(e.colorScale,w,ne(e,0),void 0,a):void 0,T=(M,L,S,D,z,O,V)=>{let g=M.reduce((v,F)=>v+Math.max(0,De(F)),0),x=ir(M,f).map(v=>{let F=De(v),Y=!((v.children?.length??0)>0)&&k?k.color(F):void 0;return{node:v,value:F,color:Y?.fill??v.color??O??ne(e,M.indexOf(v)),opacity:Y?.opacity,area:g>0?Math.max(0,F)/g*D*z:0}}).filter(v=>v.area>0&&!(O===void 0&&xe(e,v.node.name))),C=(v,[F,U,Y,j])=>{let I=`${v.node.name}: ${a(v.value)}`,G=(v.node.children?.length??0)>0;if(b.push({kind:"rect",part:G?"branch":"tile",x:l(F),y:l(U),width:l(Y),height:l(j),fill:v.color,opacity:G?.15:v.opacity,stroke:"var(--skdx-color-surface-default)",title:I,item:{label:I,id:tt(v.node),name:v.node.name,value:v.value}}),G)T(v.node.children,F+h,U+h,Math.max(0,Y-2*h),Math.max(0,j-2*h),v.color,V+1);else if($&&Y>40&&j>20){let H=Math.max(1,Math.floor((Y-12)/ie)),Q=v.node.name.length>H?`${v.node.name.slice(0,H-1)}\u2026`:v.node.name;b.push(J(l(F+6),l(U+6),Q,{baseline:"hanging",fill:"var(--skdx-color-text-on-accent)"}))}};y==="squarify"?La(x,L,S,D,z,C):Ml(x,L,S,D,z,C,y==="slice"||y==="sliceDice"&&V%2===0)};T(r,0,m,s,d-m,void 0,0),i&&b.push(...cr(t,8,ue(e,c,s)+10));let E=he(e,s,d,c);return{...E,shapes:ft([...b,...E.shapes])}}function cr(e,n,t){let r=[],o=n;return e.forEach((a,s)=>{s>0&&(r.push(J(l(o),t,"\u203A",{part:"breadcrumb-separator",baseline:"middle"})),o+=ie+6),r.push(J(l(o),t,a.name,{part:"breadcrumb",baseline:"middle",fill:"var(--skdx-color-text-default)",title:a.name,item:{label:a.name,id:tt(a),name:a.name}})),o+=a.name.length*ie+6}),r}var wl=.22,kl=20,ei=32,ti=28,$l=e=>P(e.open)&&P(e.high)&&P(e.low)&&P(e.close);function Ra(e){let n=[],t=e.data.filter(N=>$l(N)?!0:(n.push({code:"invalid-value",severity:"warning",message:`Candle "${String(N.label)}" has a non-finite open/high/low/close and was dropped.`,itemId:N.id}),!1)),r=le(e,t.length===0);if(r)return{...r,issues:n};let o=e.upColor??K.positive,a=e.downColor??K.negative,s=oe(e.format),d=oe(e.volumeFormat??{style:"integer"}),i=t.length,c=Math.max(0,Math.min(i-2,Math.floor(e.zoom?.start??0))),m=e.zoom?Math.max(c+2,Math.min(i,Math.ceil(e.zoom.end))):i,h={start:c,end:m},f=t.slice(c,m),y=t.some(N=>P(N.volume)),{width:$,height:b}=de(e),w=e.brush?ei+ti:0,R=e.rangeSelector??[],k=e.compare?f[0].close:void 0,T=N=>k!==void 0&&k!==0?N/k-1:N,E=k!==void 0?{style:"percent",digits:1}:void 0,M=oe({style:"percent",digits:1}),L=t.map(N=>N.close),S=(e.overlays??[]).map((N,B)=>{let _=N.name??`${N.type.toUpperCase()} ${N.period}`,W=N.type==="ema"?Rs(L,N.period):Co(L,N.period);return{name:_,color:N.color??ne(e,B+2),values:W.slice(c,m),hidden:xe(e,_)}}),D=Gt([...f.flatMap(N=>[T(N.low),T(N.high)]),...S.filter(N=>!N.hidden).flatMap(N=>N.values.map(B=>P(B)?T(B):B))],!1),z=[{name:"Up",color:o},{name:"Down",color:a},...S.map(N=>({name:N.name,color:N.color}))],O=Te($,b,{...fe,top:fe.top+ue(e,z,$)+(R.length?kl:0),bottom:fe.bottom+w,left:e.scale==="log"?fe.left:qr(D,oe(E??e.yAxis?.format??e.format))}),V=y?O.height*wl:0,g={...O,height:Math.max(0,O.height-V-(y?8:0))},x=Ge(D,[g.y+g.height,g.y],{scale:e.scale==="log"?"log":"linear",format:E??e.yAxis?.format},e.format),C=f.map(N=>qe(N.label)),v=e.xAxis?.type==="time"&&C.every(N=>Number.isFinite(N)),F=je(f.length,[g.x,g.x+g.width]),U;if(v){let N=[...C].sort((be,Z)=>be-Z),B=1/0;for(let be=1;be<N.length;be++)B=Math.min(B,N[be]-N[be-1]);let[_,W]=we(C),ee=B===1/0?Math.max(1,Math.abs(W)*.05||1):B/2,te=st([_-ee,W+ee],[g.x,g.x+g.width]),re=Math.abs(te(_+(B===1/0?ee:B))-te(_))*.8;F={step:re,bandwidth:re,start:be=>te(C[be])-re/2,center:be=>te(C[be])};let me=e.xAxis?.format??{style:"date"};U=Jn(_-ee,W+ee).filter(be=>be>=_-ee&&be<=W+ee).map(be=>({pos:l(te(be)),label:Qt(be,me)}))}let Y=f.map(N=>Qt(N.label,e.xAxis?.format)),j=he(e,$,b,z),I={...j,plot:g,xTicks:Re(U??f.map((N,B)=>({pos:l(F.center(B)),label:Y[B]})),g.width),yTicks:x.ticks,baseline:g.y+g.height},G=Ze(I),H={plot:g,x:N=>{let B=typeof N=="string"?N:qe(N),_=f.findIndex((W,ee)=>typeof B=="string"?Y[ee]===B||W.label===B:qe(W.label)===B);return _<0?void 0:F.center(_)},y:N=>x.scale(T(N))};G.push(...Wt(e.references,H)),R.forEach((N,B)=>{let _=N.candles>0?{start:Math.max(0,i-N.candles),end:i}:{start:0,end:i},W=_.start===c&&_.end===m;G.push(J(l(g.x+B*40),l(O.y-8),N.label,{part:"range-button",baseline:"middle",fill:W?"var(--skdx-color-text-default)":K.label,weight:W?"bold":void 0,title:`${N.label}: last ${N.candles>0?Math.min(N.candles,i):i} candles`,item:{label:N.label,name:N.label,range:_}}))});let Q=e.variant==="ohlc",p=[];if(f.forEach((N,B)=>{let W=N.close>=N.open?o:a,ee=l(F.center(B)),te=k!==void 0?` (${M(T(N.close))})`:"",re=`${Y[B]}: O ${s(N.open)} H ${s(N.high)} L ${s(N.low)} C ${s(N.close)}${te}${P(N.volume)?` V ${d(N.volume)}`:""}`,me={label:re,id:N.id,category:Y[B],index:c+B,value:N.close};p.push([Y[B],`Open: ${s(N.open)}`,`High: ${s(N.high)}`,`Low: ${s(N.low)}`,`Close: ${s(N.close)}${te}`,...P(N.volume)?[`Volume: ${d(N.volume)}`]:[],...S.filter(ae=>!ae.hidden).map(ae=>`${ae.name}: ${P(ae.values[B])?s(ae.values[B]):"\u2014"}`)]);let be=x.scale(T(Math.max(N.open,N.close))),Z=x.scale(T(Math.min(N.open,N.close)));if(Q){let ae=F.bandwidth/2;G.push({kind:"line",part:"wick",x1:ee,x2:ee,y1:l(x.scale(T(N.high))),y2:l(x.scale(T(N.low))),stroke:W,strokeWidth:1.5,title:re,item:me},{kind:"line",part:"open",x1:l(ee-ae),x2:ee,y1:l(x.scale(T(N.open))),y2:l(x.scale(T(N.open))),stroke:W,strokeWidth:1.5},{kind:"line",part:"close",x1:ee,x2:l(ee+ae),y1:l(x.scale(T(N.close))),y2:l(x.scale(T(N.close))),stroke:W,strokeWidth:1.5})}else G.push({kind:"line",part:"wick",x1:ee,x2:ee,y1:l(x.scale(T(N.high))),y2:l(x.scale(T(N.low))),stroke:W,title:re},{kind:"rect",part:"candle",x:l(F.start(B)),y:l(be),width:l(F.bandwidth),height:l(Math.max(1,Z-be)),fill:W,title:re,item:me})}),y){let N=g.y+g.height+8,[,B]=we(f.map(_=>_.volume));f.forEach((_,W)=>{if(!P(_.volume))return;let ee=B>0?_.volume/B*V:0;G.push({kind:"rect",part:"volume",x:l(F.start(W)),y:l(N+V-ee),width:l(F.bandwidth),height:l(Math.max(ee,0)),fill:_.close>=_.open?o:a,opacity:.4,title:`${Y[W]}: volume ${d(_.volume)}`})})}for(let N of S){if(N.hidden)continue;let B=N.values.flatMap((_,W)=>P(_)?[{x:l(F.center(W)),y:l(x.scale(T(_)))}]:[]);B.length<2||G.push({kind:"path",part:"overlay",d:it(B),stroke:N.color,strokeWidth:1.5,strokeLinejoin:"round",title:N.name,item:{label:N.name,series:N.name}})}for(let N of e.flags??[]){let B=H.x(N.label);if(B===void 0)continue;let _=f.findIndex((re,me)=>F.center(me)===B),W=f[_],ee=x.scale(T(W.high))-6,te=Ft(N.variant??"primary");G.push({kind:"path",part:"flag",d:`M${l(B)} ${l(ee)}V${l(ee-10)}H${l(B+8)}L${l(B+5)} ${l(ee-7)}L${l(B+8)} ${l(ee-4)}H${l(B)}Z`,fill:te,stroke:te,title:N.text,item:{label:N.text,name:N.text,category:Y[_],index:c+_}})}G.push(...Fn(e.annotations,H));let q={plot:O,xs:f.map((N,B)=>l(F.center(B))),rows:p,count:i,zoom:h,crosshair:jr(e)};if(e.brush){let N={x:O.x,y:O.y+O.height+ti,width:O.width,height:ei},B=t.map(me=>me.close),[_,W]=we(B),ee=i>1?N.width/(i-1):0,te=B.map((me,be)=>({x:l(N.x+be*ee),y:l(N.y+N.height-(W===_?.5:(me-_)/(W-_))*(N.height-4)-2)})),re={x:l(N.x+c/i*N.width),y:N.y,width:l((m-c)/i*N.width),height:N.height};G.push({kind:"rect",part:"brush",...N,fill:"var(--skdx-color-surface-sunken)",stroke:K.grid},{kind:"path",part:"brush-series",d:te.length>1?`${it(te)}L${te[te.length-1]?.x} ${N.y+N.height}L${te[0]?.x} ${N.y+N.height}Z`:"",fill:"var(--skdx-color-primary-500)",fillOpacity:.3},{kind:"rect",part:"brush-window",...re,fill:"var(--skdx-color-primary-500)",opacity:.15,stroke:K.axis},{kind:"rect",part:"brush-handle",x:l(re.x-3),y:N.y+8,width:6,height:N.height-16,fill:K.axis,rx:8},{kind:"rect",part:"brush-handle",x:l(re.x+re.width-3),y:N.y+8,width:6,height:N.height-16,fill:K.axis,rx:8}),q.brush={box:N,window:re}}return{...j,shapes:[...G,...j.shapes],hit:q,issues:n}}var Il="var(--skdx-color-success-500)",Tl="var(--skdx-color-danger-500)";function Na(e){let n=[],t=e.data.filter(S=>S.type==="subtotal"||S.type==="total"||S.subtotal||P(S.value)?!0:(n.push({code:"invalid-value",severity:"warning",message:`Row "${S.name}" has no valid value and was dropped.`,itemId:S.id??S.name}),!1)),r=le(e,t.length===0);if(r)return{...r,issues:n};let o=oe(e.format),{width:a,height:s}=de(e),d=e.orientation==="horizontal",i=e.positiveColor??Il,c=e.negativeColor??Tl,m=e.totalColor??ne(e,0),h=[],f=P(e.start)?e.start:0,y=S=>`${S>=0?"+":""}${o(S)}`;P(e.start)&&e.startLabel!==void 0&&h.push({id:void 0,name:e.startLabel,from:0,to:f,color:m,title:`${e.startLabel}: ${o(f)}`,flat:!0});for(let S of t){if((S.type??(S.subtotal?"subtotal":"change"))!=="change"){h.push({id:S.id,name:S.name,from:0,to:f,color:S.color??m,title:`${S.name}: ${o(f)}`,flat:!0});continue}let z=f;f+=S.value,h.push({id:S.id,name:S.name,from:z,to:f,color:S.color??(S.value>=0?i:c),title:`${S.name}: ${y(S.value)}`,flat:!1})}e.total!==void 0&&h.push({id:void 0,name:e.total,from:0,to:f,color:m,title:`${e.total}: ${o(f)}`,flat:!0});let $=d?Math.max(0,...h.map(S=>S.name.length))*ie+16:0,b=[{name:"Increase",color:i},{name:"Decrease",color:c}],w=Te(a,s,{...fe,top:fe.top+ue(e,b,a),left:Math.max(fe.left,$),right:e.labels&&d?56:fe.right}),R=h.flatMap(S=>[S.from,S.to]),k=Ge([Math.min(0,...R),Math.max(0,...R)],d?[w.x,w.x+w.width]:[w.y+w.height,w.y],{},e.format),T=je(h.length,d?[w.y,w.y+w.height]:[w.x,w.x+w.width]),E=he(e,a,s,b),M=h.map((S,D)=>({pos:l(T.center(D)),label:S.name})),L=Ze({...E,plot:w,xTicks:d?M:Re(M,w.width),yTicks:d?Re(k.ticks,w.width):k.ticks,baseline:k.zero},{horizontal:d});return h.forEach((S,D)=>{let z=k.scale(S.from),O=k.scale(S.to),V=Math.min(z,O),g=Math.max(1,Math.abs(O-z));if(L.push({kind:"rect",part:"bar",x:l(d?V:T.start(D)),y:l(d?T.start(D):V),width:l(d?g:T.bandwidth),height:l(d?T.bandwidth:g),fill:S.color,title:S.title,item:{label:S.title,id:S.id??S.name,name:S.name,index:D,value:S.flat?S.to:S.to-S.from}}),e.labels){let C=S.flat?o(S.to):y(S.to-S.from),v=Math.max(z,O);L.push(d?J(l(v+6),l(T.center(D)),C,{part:"value-label",baseline:"middle"}):J(l(T.center(D)),l(V-4),C,{part:"value-label",anchor:"middle"}))}let x=h[D+1];if(x&&(e.connectors??!0)){let C=l(O),v=l(k.scale(x.flat?x.to:x.from));L.push(d?{kind:"line",part:"connector",x1:C,x2:v,y1:l(T.start(D)+T.bandwidth),y2:l(T.start(D+1)),stroke:K.axis,dash:"4 3"}:{kind:"line",part:"connector",x1:l(T.start(D)+T.bandwidth),x2:l(T.start(D+1)),y1:C,y2:v,stroke:K.axis,dash:"4 3"})}}),{...E,shapes:[...L,...E.shapes],issues:n}}function Al(e){let n=new Map;for(let i of e)i.id!==void 0&&!n.has(i.id)&&n.set(i.id,i),n.has(i.name)||n.set(i.name,i);let t=new Map,r=new Set,o=i=>{let c=t.get(i);if(c)return c;if(r.has(i))return{length:0,next:void 0};r.add(i);let m={length:0,next:void 0};for(let f of i.dependsOn??[]){let y=n.get(f);if(!y||y===i)continue;let $=o(y);$.length>m.length&&(m={length:$.length,next:y})}r.delete(i);let h={length:m.length+Math.max(0,i.end-i.start),next:m.next};return t.set(i,h),h},a,s=-1;for(let i of e){let c=o(i);c.length>s&&(s=c.length,a=i)}let d=new Set;for(let i=a;i&&!d.has(i);i=t.get(i)?.next)d.add(i);return d}function Ea(e){let n=[],t=e.tasks.filter(p=>{let q=P(p.start)&&(p.milestone?!0:P(p.end));return q?!p.milestone&&p.end<p.start&&n.push({code:"inverted-range",severity:"warning",message:`Task "${p.name}" ends before it starts; the interval was normalized.`,itemId:p.id??p.name}):n.push({code:"invalid-value",severity:"warning",message:`Task "${p.name}" has no valid start/end and was dropped.`,itemId:p.id??p.name}),q}),r=le(e,t.length===0);if(r)return{...r,issues:n};let{width:o,height:a}=de(e),s=e.criticalPath?Al(t):void 0,d=p=>p.id??p.name,i=new Map;for(let p of t)p.id!==void 0&&!i.has(p.id)&&i.set(p.id,p),i.has(p.name)||i.set(p.name,p);let c=new Map,m=[];for(let p of t){let q=p.parent===void 0?void 0:i.get(p.parent);q&&q!==p?c.set(q,[...c.get(q)??[],p]):m.push(p)}let h=new Set(e.collapsed??[]),f=p=>h.has(d(p))||h.has(p.name),y=[],$=(p,q,N)=>{if(!N.has(p)&&(N.add(p),y.push({task:p,depth:q}),!f(p)))for(let B of c.get(p)??[])$(B,q+1,N)},b=new Set;for(let p of m)$(p,0,b);let w=y.map(p=>p.task),R=new Map(y.map(p=>[p.task,p.depth])),k=p=>{let q=c.get(p)??[];if(q.length===0||P(p.end)&&p.end!==p.start)return{start:p.start,end:p.end};let N=q.map(k);return{start:Math.min(...N.map(B=>B.start)),end:Math.max(...N.map(B=>B.end))}},T=[...new Set(w.map(p=>p.group??p.name))],E=new Map;for(let p of w){let q=p.group??p.name;E.has(q)||E.set(q,R.get(p)??0)}let M=p=>w.some(q=>(q.group??q.name)===p&&f(q)&&(c.get(q)?.length??0)>0)?" +":"",L=Math.max(0,...T.map(p=>p.length+M(p).length))*ie+Math.max(0,...T.map(p=>(E.get(p)??0)*12)),S=e.tasks.map((p,q)=>({name:p.name,color:ne(e,q,p.color)})),D=Te(o,a,{top:8+ue(e,S,o),right:16,bottom:32+(e.xAxis?.label?14:0),left:Math.min(o/2,Math.max(64,L+16))}),z=oe(e.xAxis?.format??e.format),O=e.today===void 0?void 0:qe(e.today),[V,g]=we([...w.flatMap(p=>{let q=k(p);return[...p.milestone?[p.start]:[q.start,q.end],...p.baseline?[p.baseline.start,p.baseline.end]:[]]}),...O!==void 0?[O]:[]]),x=Ge([V,g],[D.x,D.x+D.width],{ticks:e.xAxis?.ticks,format:e.xAxis?.format},e.format),C=je(T.length,[D.y,D.y+D.height]),v=[],F=[],U=p=>x.domain[0]+(p-D.x)/Math.max(1,D.width)*(x.domain[1]-x.domain[0]);for(let p of Re(x.ticks,D.width))v.push({kind:"line",part:"grid",x1:p.pos,x2:p.pos,y1:D.y,y2:D.y+D.height,stroke:K.grid}),v.push(J(p.pos,D.y+D.height+20,p.label,{part:"x-label",anchor:nr(p.pos,p.label,o)}));T.forEach((p,q)=>{let N=w.find(B=>(B.group??B.name)===p);v.push(J(D.x-8,l(C.center(q)),`${p}${M(p)}`,{part:"y-label",anchor:"end",baseline:"middle",item:N&&(c.get(N)?.length??0)>0?{label:p,id:d(N),name:N.name}:void 0}))});for(let p of v){if(p.kind!=="text"||p.part!=="y-label")continue;let q=E.get(p.text.replace(/ \+$/,""))??0;q&&(p.x=l(p.x+q*12))}let Y=864e5;if(e.nonWorkingDays?.length&&g-V<=400*Y&&g>V){let p=new Set(e.nonWorkingDays);for(let q=Math.floor(V/Y)*Y;q<g;q+=Y){if(!p.has(new Date(q).getUTCDay()))continue;let N=Math.max(V,q),B=Math.min(g,q+Y);B<=N||v.push({kind:"rect",part:"non-working",x:l(x.scale(N)),y:D.y,width:l(Math.max(0,x.scale(B)-x.scale(N))),height:D.height,fill:K.grid,opacity:.12})}}e.xAxis?.label&&v.push(J(l(D.x+D.width/2),a-4,e.xAxis.label,{part:"axis-title",anchor:"middle"}));let j={plot:D,x:p=>x.scale(qe(p)),y:p=>C.center(p)};v.push(...Wt([...e.references??[],...O!==void 0?[{x:O,label:"Today",variant:"primary"}]:[]],j));let I=new Map,G=[];w.forEach(p=>{if(xe(e,p.name))return;let q=t.indexOf(p),N=T.indexOf(p.group??p.name),B=k(p),_=x.scale(Math.min(B.start,B.end)),W=p.milestone?_:x.scale(Math.max(B.start,B.end)),ee=(c.get(p)?.length??0)>0;if(p.baseline&&!p.milestone){let ke=x.scale(Math.min(p.baseline.start,p.baseline.end)),Fe=x.scale(Math.max(p.baseline.start,p.baseline.end));v.push({kind:"rect",part:"baseline",x:l(ke),y:l(C.start(N)+C.bandwidth*.75),width:l(Math.max(1,Fe-ke)),height:l(C.bandwidth/4),fill:K.axis,opacity:.6,rx:1,title:`${p.name} planned: ${z(p.baseline.start)} \u2013 ${z(p.baseline.end)}`})}let te=C.center(N),re=ne(e,q,p.color),me=s&&!s.has(p)?.35:void 0;if(I.has(p.name)||I.set(p.name,{x0:_,x1:W,mid:te}),p.id!==void 0&&!I.has(p.id)&&I.set(p.id,{x0:_,x1:W,mid:te}),p.milestone){let ke=C.bandwidth/2,Fe=`${p.name}: ${z(p.start)}`;v.push({kind:"path",part:"milestone",d:`M${l(_)} ${l(te-ke)}L${l(_+ke)} ${l(te)}L${l(_)} ${l(te+ke)}L${l(_-ke)} ${l(te)}Z`,fill:re,opacity:me,title:Fe,item:{label:Fe,id:p.id,name:p.name,category:p.group,index:q,value:p.start}});return}let be=P(p.progress)?Math.max(0,Math.min(1,p.progress)):void 0,Z=`${p.name}: ${z(B.start)} \u2013 ${z(B.end)}${be!==void 0?` \xB7 ${Math.round(be*100)}% done`:""}`;ee||F.push({index:v.length,id:p.id??p.name,name:p.name,start:Math.min(p.start,p.end),end:Math.max(p.start,p.end),x0:l(_),x1:l(W),y:l(C.start(N)),height:l(C.bandwidth)});let ae=p.baseline?C.bandwidth*.7:C.bandwidth;v.push({kind:"rect",part:ee?"summary":"bar",x:l(_),y:l(C.start(N)),width:l(Math.max(1,W-_)),height:l(ee?C.bandwidth/3:ae),fill:re,rx:2,opacity:me,title:Z,item:{label:Z,id:p.id,name:p.name,category:p.group,index:q,value:Math.abs(p.end-p.start)}}),be!==void 0&&be>0&&G.push({kind:"rect",part:"progress",x:l(_),y:l(te-C.bandwidth/4),width:l(Math.max(1,(W-_)*be)),height:l(C.bandwidth/2),fill:"var(--skdx-color-text-default)",opacity:.35,rx:1})});let H=new Map;for(let p of t)p.id!==void 0&&!H.has(p.id)&&H.set(p.id,p),H.has(p.name)||H.set(p.name,p);for(let p of t)for(let q of p.dependsOn??[]){let N=I.get(q),B=I.get(p.id??p.name);if(!N){n.push({code:"unknown-node",severity:"warning",message:`Task "${p.name}" depends on "${String(q)}", which does not exist.`,itemId:p.id??p.name});continue}if(!B||N===B)continue;let _=Math.max(N.x1+6,B.x0-6),W=H.get(q),ee=s&&W&&s.has(W)&&s.has(p),te=`${W?.name??String(q)} \u2192 ${p.name}`;G.push({kind:"path",part:"dependency",d:`M${l(N.x1)} ${l(N.mid)}H${l(_)}V${l(B.mid)}H${l(B.x0)}`,stroke:ee?"var(--skdx-color-danger-500)":K.axis,strokeWidth:ee?2.5:1.5,opacity:s&&!ee?.35:void 0,title:te,item:{label:te,name:W?.name??String(q),category:p.name}})}v.push(...G,...Fn(e.annotations,j));let Q=he(e,o,a,S);return{...Q,shapes:[...v,...Q.shapes],issues:n,edit:{scale:p=>x.scale(p),invert:U,bars:F}}}var Da=e=>{let n=e.length;return n===0?0:n%2?e[(n-1)/2]:(e[n/2-1]+e[n/2])/2},Cl=(e,n)=>{if(e.length===0)return 0;let t=(e.length-1)*n,r=Math.floor(t),o=Math.ceil(t),a=e[r],s=e[o];return a+(s-a)*(t-r)},Ol=(e,n)=>{let t=e.length;if(t===0)return 0;let r=(t+1)*n-1;if(r<=0)return e[0];if(r>=t-1)return e[t-1];let o=Math.floor(r),a=e[o],s=e[o+1];return a+(s-a)*(r-o)};function Sl(e,n="linear"){let t=Da(e),r=e.length;if(r===0)return{q1:0,median:0,q3:0};if(n==="tukey"){let a=Math.floor(r/2),s=e.slice(0,r%2?a+1:a),d=e.slice((r%2,a));return{q1:Da(s),median:t,q3:Da(d)}}let o=n==="exclusive"?Ol:Cl;return{q1:o(e,.25),median:t,q3:o(e,.75)}}function Ll(e,n="linear",t=1.5){let r=He(e).sort(($,b)=>$-b),{q1:o,median:a,q3:s}=Sl(r,n),d=s-o,i=o-t*d,c=s+t*d,m=r.filter($=>$>=i&&$<=c),h=r.length?r.reduce(($,b)=>$+b,0)/r.length:0,f=m[0]??o,y=m[m.length-1]??s;return{name:"",q1:o,median:a,q3:s,min:f,max:y,low:f,high:y,mean:h,outliers:r.filter($=>$<i||$>c),count:r.length}}var ni=e=>"median"in e&&!("data"in e),ri=e=>"data"in e&&Array.isArray(e.data[0]);function Fa(e){let n=e.quartileMethod??"linear",t=e.whisker??1.5,r=[],o=e.categories,a=o!==void 0,s=(v,F)=>r.push({code:"invalid-value",severity:"warning",message:F,itemId:v.id??v.name}),d=[];e.series.forEach((v,F)=>{let U=ne(e,F,v.color),Y=(j,I,G)=>{let H=G??(I&&He(I).length?Ll(I,n,t):void 0);return!H||![H.min,H.q1,H.median,H.q3,H.max].every(P)?!1:(H.count!==void 0&&H.count<5&&r.push({code:"small-sample",severity:"warning",message:`Series "${v.name}"${a?` at "${o[j]??j}"`:""} has ${H.count} observation${H.count===1?"":"s"}; quartiles are not meaningful below 5.`,itemId:v.id??v.name}),d.push({si:F,ci:j,name:v.name,id:v.id,color:U,st:{...H,name:v.name},raw:I}),!0)};if(!a){(ni(v)?Y(0,void 0,v):ri(v)?Y(0,v.data.flat()):Y(0,v.data))||s(v,`Series "${v.name}" has no valid observations or summary and was skipped.`);return}if(ni(v)){s(v,`Series "${v.name}" is a summary, which cannot be grouped by categories; it was skipped.`);return}if(!ri(v)){s(v,`Series "${v.name}" is not grouped (its data is one sample, not one per category); it was drawn in the first category.`),Y(0,v.data);return}o.forEach((j,I)=>Y(I,v.data[I]))});let i=le(e,d.length===0);if(i)return{...i,issues:r};let c=oe(e.yAxis?.format??e.format),{width:m,height:h}=de(e),f=e.orientation==="horizontal",y=a?o:e.series.map(v=>v.name),$=Math.max(0,...y.map(v=>v.length))*ie,b=e.series.map((v,F)=>({name:v.name,color:ne(e,F,v.color)})),w=Te(m,h,{...fe,top:fe.top+ue(e,b,m)+(e.yAxis?.label?12:0),left:f?Math.max(fe.left,$+16):fe.left,bottom:fe.bottom+(f&&e.yAxis?.label?14:0)}),R=d.filter(v=>!xe(e,v.name)),k=R.flatMap(v=>[v.st.min,v.st.max,...v.st.outliers??[],...P(v.st.mean)?[v.st.mean]:[]]),T=Ge(Gt(k,!1),f?[w.x,w.x+w.width]:[w.y+w.height,w.y],e.yAxis??{},e.format),E=je(y.length,f?[w.y,w.y+w.height]:[w.x,w.x+w.width]),M=a?[...new Set(R.map(v=>v.si))]:[],L=a?E.bandwidth/Math.max(1,M.length):E.bandwidth,S=v=>a?E.start(v.ci)+(M.indexOf(v.si)+.5)*L:E.center(v.si),D=he(e,m,h,b),z=y.map((v,F)=>({pos:l(E.center(F)),label:v})),O=Ze({...D,plot:w,xTicks:f?z:Re(z,w.width),yTicks:f?Re(T.ticks,w.width):T.ticks,baseline:f?w.x:w.y+w.height},{horizontal:f,grid:Dn(e.yAxis),...f?{xLabel:e.yAxis?.label}:{yLabel:e.yAxis?.label}}),V=(v,F,U)=>{let Y=l(T.scale(v)),j=l(T.scale(F));return f?{x1:Y,x2:j,y1:U,y2:U}:{x1:U,x2:U,y1:Y,y2:j}},g=(v,F,U,Y)=>{let j=T.scale(v),I=T.scale(F),G=Math.max(1,Math.abs(I-j));return f?{x:l(Math.min(j,I)),y:l(U-Y/2),width:l(G),height:l(Y)}:{x:l(U-Y/2),y:l(Math.min(j,I)),width:l(Y),height:l(G)}},x=(v,F)=>f?`${l(T.scale(v))} ${l(F)}`:`${l(F)} ${l(T.scale(v))}`,C=(v,F,U,Y,j,I,G)=>({kind:"circle",part:j,cx:f?l(T.scale(v)):l(F),cy:f?l(F):l(T.scale(v)),r:U,fill:Y,opacity:G,title:I});for(let v of R){let{st:F,color:U,name:Y,raw:j}=v,I=l(S(v)),G=a?o[v.ci]:void 0,H=G!==void 0?`${Y}, ${G}`:Y,Q=`${H}: min ${c(F.min)} Q1 ${c(F.q1)} median ${c(F.median)} Q3 ${c(F.q3)} max ${c(F.max)}${e.mean&&P(F.mean)?` mean ${c(F.mean)}`:""}`,p={label:Q,id:v.id,series:Y,seriesId:v.id??Y,category:G,index:a?v.ci:v.si,value:F.median},q=L*.6,N=q/2,B=f?{x1:l(T.scale(F.median)),x2:l(T.scale(F.median)),y1:l(I-N),y2:l(I+N)}:{x1:l(I-N),x2:l(I+N),y1:l(T.scale(F.median)),y2:l(T.scale(F.median))},_=F.count,W=e.notched&&_?Math.min(1.58*(F.q3-F.q1)/Math.sqrt(_),(F.q3-F.q1)/2):0,ee=W?{kind:"path",part:"box",d:`M${[x(F.q1,I-N),x(F.median-W,I-N),x(F.median,I-N+q/4),x(F.median+W,I-N),x(F.q3,I-N),x(F.q3,I+N),x(F.median+W,I+N),x(F.median,I+N-q/4),x(F.median-W,I+N),x(F.q1,I+N)].join("L")}Z`,fill:U,stroke:U,fillOpacity:.5,title:Q,item:p}:{kind:"rect",part:"box",...g(F.q1,F.q3,I,q),fill:U,stroke:U,opacity:.5,title:Q,item:p};if(O.push({kind:"line",part:"whisker",...V(F.max,F.min,I),stroke:U,title:Q},ee,{kind:"line",part:"median",...B,stroke:U,title:Q},...(F.outliers??[]).map(te=>C(te,I,3,U,"outlier",`${H}: ${c(te)}`))),e.mean&&P(F.mean)){let te=f?l(T.scale(F.mean)):I,re=f?I:l(T.scale(F.mean));O.push({kind:"path",part:"mean",d:`M${te} ${l(re-4)}L${l(te+4)} ${re}L${te} ${l(re+4)}L${l(te-4)} ${re}Z`,fill:"var(--skdx-color-text-default)",title:`${H} mean: ${c(F.mean)}`})}e.points&&j&&He(j).forEach((te,re)=>{let me=(re*7919%97/96-.5)*q*.8;O.push(C(te,I+me,2,U,"observation",`${H}: ${c(te)}`,.6))})}return{...D,shapes:[...O,...D.shapes],issues:r}}var Ba=e=>e*Math.PI/180;function Pa(e){let{nodes:n,path:t}=$n(e.data,e.rootId),r=fn(n,e.maxDepth),o=le(e,!r.some(x=>De(x)>0),300,300);if(o)return o;let a=oe(e.format),{width:s,height:d}=de(e,300,300),i=Math.min(.9,Math.max(0,e.innerRadius??0)),c=e.breadcrumbs&&t.length>0,m=c&&i===0,h=r.map((x,C)=>({name:x.name,color:ne(e,C,x.color)})),f=ue(e,h,s)+(m?20:0),y=s/2,$=f+(d-f)/2,b=Math.max(0,Math.min(s,d-f)/2-8),w=b*i,R=(b-w)/Math.max(1,Nr(r)),k=Ba(e.startAngle??0),T=Ba(e.endAngle??(e.startAngle??0)+360),E=Math.max(0,Ba(e.padAngle??0)),M=e.sort??"none",L=[],S=x=>{for(let C of x)C.children?.length?S(C.children):L.push(De(C))};S(r);let D=e.colorScale?Pt(e.colorScale,L,ne(e,0),void 0,a):void 0,z=[],O=[],V=(x,C,v,F,U)=>{let Y=p=>C===0&&xe(e,p.name)?0:Math.max(0,De(p)),j=ir(x,M),I=j.reduce((p,q)=>p+Y(q),0),G=Math.max(0,j.filter(p=>Y(p)>0).length-1),H=Math.max(0,F-G*E),Q=v;j.forEach(p=>{let q=Y(p),N=I>0?q/I*H:0,_=!((p.children?.length??0)>0)&&D?D.color(q):void 0,W=_?.fill??p.color??U??ne(e,x.indexOf(p));if(N>0){let ee=w+R*C,te=ee+R;if(e.labels&&N*((ee+te)/2)>p.name.length*ie+4){let me=Q+N/2,be=(ee+te)/2;O.push(J(l(y+be*Math.sin(me)),l($-be*Math.cos(me)),p.name,{part:"arc-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))}let re=`${p.name}: ${a(q)}`;z.push({kind:"path",part:"arc",d:Ke(y,$,te,ee,Q,Q+N),fill:W,opacity:_?_.opacity:1-C*.2,stroke:"var(--skdx-color-surface-default)",title:re,item:{label:re,id:tt(p),name:p.name,value:q}}),V(p.children??[],C+1,Q,N,W),Q+=N+E}})};if(V(r,0,k,Math.max(0,Math.min(2*Math.PI,T-k)),void 0),e.centerLabel&&O.push(J(l(y),l(c&&!m?$-8:$),e.centerLabel,{part:"center-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)",weight:"bold"})),c){let x=t.reduce((C,v)=>C+v.name.length*ie+6,0)+(t.length-1)*(ie+6);O.push(...m?cr(t,8,ue(e,h,s)+10):cr(t,y-x/2,e.centerLabel?$+8:$))}let g=he(e,s,d,h);return{...g,shapes:ft([...z,...O,...g.shapes])}}var zl=2*Math.PI,Rl=12,Er=5;function Nl(e){let n=[];if(e.links){let o=[...e.names??[]],a=new Set(o);for(let i of e.links)for(let c of[i.source,i.target])a.has(c)||(e.names&&n.push({code:"unknown-node",severity:"warning",message:`Link ${i.source} \u2192 ${i.target} names "${c}", which is not in \`names\`; it was added.`,itemId:i.id}),a.add(c),o.push(c));let s=new Map(o.map((i,c)=>[i,c])),d=o.map(()=>o.map(()=>0));for(let i of e.links){if(!P(i.value)||i.value<0){n.push({code:"invalid-value",severity:"warning",message:`Link ${i.source} \u2192 ${i.target} has no valid value and was dropped.`,itemId:i.id});continue}let c=d[s.get(i.source)];c[s.get(i.target)]=c[s.get(i.target)]+i.value}return{names:o,matrix:d,issues:n}}let t=e.names??[],r=e.matrix??[];return(r.length!==t.length||r.some(o=>o.length!==t.length))&&n.push({code:"ragged-matrix",severity:"warning",message:`The matrix is ${r.length} \xD7 ${r[0]?.length??0} but there are ${t.length} names; missing cells count as zero.`}),{names:t,matrix:r,issues:n}}function Va(e){let{names:n,matrix:t,issues:r}=Nl(e),o=le(e,n.length===0||!t.some(j=>j.some(I=>P(I)&&I>0)),300,300);if(o)return{...o,issues:r};let a=oe(e.format),{width:s,height:d}=de(e,300,300),i=(j,I)=>{let G=t[j]?.[I];return P(G)?Math.max(0,G):0},c=j=>n.reduce((I,G,H)=>I+i(j,H)+i(H,j),0),m=n.map((j,I)=>I);e.sort&&m.sort((j,I)=>e.sort==="asc"?c(j)-c(I):c(I)-c(j));let h=m.map(j=>n[j]),f=j=>ne(e,m[j]),y=h.map((j,I)=>({name:j,color:f(I)})),$=ue(e,y,s),b=s/2,w=$+(d-$)/2,R=e.ticks?8+Er+14:8,k=R+Math.max(0,...n.map(j=>j.length))*ie+4,T=Math.max(0,Math.min(s/2-k,(d-$)/2-36)),E=Math.max(0,T-Rl),M=(e.padding??2.3)*Math.PI/180,L=h.length,S=Kn(e.selected)[0],D=S===void 0?-1:h.indexOf(String(S)),z=(j,I)=>xe(e,h[j])||xe(e,h[I])?0:i(m[j],m[I]),O=h.map((j,I)=>h.reduce((G,H,Q)=>G+z(I,Q),0)),V=O.reduce((j,I)=>j+I,0),g=V>0?(zl-M*L)/V:0,x=(j,I)=>`${l(b+I*Math.sin(j))} ${l(w-I*Math.cos(j))}`,C=[],v=0;for(let j=0;j<L;j++){let I=v,G=h.map((H,Q)=>{let p=v;return v+=z(j,Q)*g,{a0:p,a1:v}});C.push({a0:I,a1:v,sub:G}),v+=M}let F=[],U=[];for(let j=0;j<L;j++)for(let I=j;I<L;I++){let G=z(j,I),H=z(I,j);if(G+H===0)continue;let Q=C[j].sub[I],p=C[I].sub[j],q=ee=>ee.a1-ee.a0>Math.PI?1:0,N=j===I?`M${x(Q.a0,E)}A${E} ${E} 0 ${q(Q)} 1 ${x(Q.a1,E)}Q${l(b)} ${l(w)} ${x(Q.a0,E)}Z`:`M${x(Q.a0,E)}A${E} ${E} 0 ${q(Q)} 1 ${x(Q.a1,E)}Q${l(b)} ${l(w)} ${x(p.a0,E)}A${E} ${E} 0 ${q(p)} 1 ${x(p.a1,E)}Q${l(b)} ${l(w)} ${x(Q.a0,E)}Z`,B=G>=H?j:I,_=D<0||j===D||I===D,W=j===I?`${h[j]}: ${a(G)}`:`${h[j]} \u2192 ${h[I]}: ${a(G)} \xB7 ${h[I]} \u2192 ${h[j]}: ${a(H)}`;F.push({kind:"path",part:"chord",d:N,fill:f(B),opacity:_?.5:.08,title:W,item:{label:W,id:`${h[j]}\u2192${h[I]}`,name:h[j],category:h[I],value:G+H}})}C.forEach((j,I)=>{if(j.a1<=j.a0)return;let G=`${h[I]}: ${a(O[I])}`;F.push({kind:"path",part:"group",d:Ke(b,w,T,E,j.a0,j.a1),fill:f(I),opacity:D<0||I===D||z(I,D)+z(D,I)>0?void 0:.3,title:G,item:{label:G,id:h[I],name:h[I],index:I,value:O[I]}});let H=(j.a0+j.a1)/2,Q=Math.sin(H),p=T+R;if(F.push(J(l(b+p*Q),l(w-p*Math.cos(H)),h[I],{anchor:Q>.1?"start":Q<-.1?"end":"middle",baseline:"middle"})),!e.ticks)return;let q=O[I];ht(0,q,4).filter(N=>N<=q).forEach((N,B)=>{let _=j.a0+N*g,W=Math.sin(_),ee=Math.cos(_);if(F.push({kind:"line",part:"tick",x1:l(b+T*W),y1:l(w-T*ee),x2:l(b+(T+Er)*W),y2:l(w-(T+Er)*ee),stroke:K.axis}),B%2)return;let te=l(b+(T+Er+3)*W),re=l(w-(T+Er+3)*ee);U.some(me=>Math.abs(me.x-te)<12&&Math.abs(me.y-re)<12)||(U.push({x:te,y:re}),F.push(J(te,re,a(N),{part:"tick-label",anchor:W>.1?"start":W<-.1?"end":"middle",baseline:"middle"})))})});let Y=he(e,s,d,y);return{...Y,shapes:[...F,...Y.shapes],issues:r}}var _n=8,Ha=e=>e.geometry.type==="Polygon"?e.geometry.coordinates:e.geometry.type==="MultiPolygon"?e.geometry.coordinates.flat():[],ai=e=>e.geometry.type==="Point"?[e.geometry.coordinates]:e.geometry.type==="MultiPoint"?e.geometry.coordinates:[],si=e=>e.geometry.type==="LineString"?[e.geometry.coordinates]:e.geometry.type==="MultiLineString"?e.geometry.coordinates:[],oi=e=>[...Ha(e).flat(),...ai(e),...si(e).flat()],El=e=>Math.log(Math.tan(Math.PI/4+Math.max(-85,Math.min(85,e))*Math.PI/360)),dr=e=>e!==void 0&&Number.isFinite(e[0])&&Number.isFinite(e[1]);function _a(e){let n=[],t=e.features.filter(p=>{let q=oi(p).some(dr);return q||n.push({code:"invalid-geometry",severity:"warning",message:`Feature "${p.name}" has no valid coordinates and was dropped.`,itemId:p.id??p.name}),q}),r=le(e,t.length===0);if(r)return{...r,issues:n};let o=oe(e.format),{width:a,height:s}=de(e),d=ue(e),i=Bn(e.colorLegend).bottom,c=Bn(e.colorLegend).right,m=e.projection==="mercator"?El:p=>p,h=t.filter(p=>Ha(p).length>0),f=(h.length?h:t).flatMap(p=>oi(p).filter(dr)),[y,$]=f.length?we(f.map(p=>p[0])):[0,1],[b,w]=f.length?we(f.map(p=>m(p[1]))):[0,1],R=Math.min((a-c-2*_n)/Math.max(1e-9,$-y),(s-d-i-2*_n)/Math.max(1e-9,w-b)),k={x:_n,y:d+_n,width:a-c-2*_n,height:s-d-i-2*_n},T=Math.max(1,Math.min(64,e.view?.zoom??1)),E=R*T,M=e.view?.center?[e.view.center[0],m(e.view.center[1])]:[(y+$)/2,(b+w)/2],L=k.x+k.width/2-M[0]*E,S=k.y+k.height/2+M[1]*E,D=([p,q])=>({x:l(L+p*E),y:l(S-m(q)*E)}),z=p=>{let{x:q,y:N}=D(p);return`${q} ${N}`},O=ne(e,0,e.color),V=Pt(e.colorScale,t.map(p=>p.value),O,void 0,o),g=[],x=h.map(p=>{let q=Ha(p);if(e.labels&&q.length){let _=q.reduce((me,be)=>be.length>me.length?be:me),[W,ee]=we(_.map(me=>me[0])),[te,re]=we(_.map(me=>m(me[1])));g.push(J(l(L+((W+ee)/2-y)*E),l(S+(w-(te+re)/2)*E),p.name,{part:"region-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)"}))}let N=p.color!==void 0?{fill:p.color,opacity:1}:V.color(p.value),B=`${p.name}${P(p.value)?`: ${o(p.value)}`:""}`;return{kind:"path",part:"region",d:q.map(_=>`M${_.filter(dr).map(z).join("L")}Z`).join(""),fill:N?.fill??K.grid,opacity:N?.opacity??.6,stroke:"var(--skdx-color-surface-default)",title:B,item:{label:B,id:p.id??p.name,name:p.name,value:p.value}}}),C=[...e.lines??[],...t.flatMap(p=>si(p).map(q=>({id:p.id,name:p.name,coordinates:q,value:p.value,color:p.color??(P(p.value)?V.color(p.value)?.fill:void 0),dash:void 0})))].filter(p=>p.coordinates.filter(dr).length>=2),[,v]=we(C.map(p=>p.value)),F=C.map((p,q)=>{let N=`${p.name}${P(p.value)?`: ${o(p.value)}`:""}`;return{kind:"path",part:"route",d:`M${p.coordinates.filter(dr).map(z).join("L")}`,stroke:p.color??ne(e,2),strokeWidth:P(p.value)&&v>0?1+3*Math.sqrt(Math.max(0,p.value)/v):1.5,strokeLinecap:"round",strokeLinejoin:"round",dash:p.dash,opacity:.85,title:N,item:{label:N,id:p.id??p.name,name:p.name,index:q,value:p.value}}}),U=[...e.points??[],...t.flatMap(p=>ai(p).map(q=>({id:p.id,name:p.name,coordinates:q,value:p.value,color:p.color??(P(p.value)?V.color(p.value)?.fill:void 0)})))].filter(p=>dr(p.coordinates)),[Y,j]=e.sizeRange??[3,14],[,I]=we(U.map(p=>p.value)),G=U.map((p,q)=>{let{x:N,y:B}=D(p.coordinates),_=Number.isFinite(p.value)&&I>0,W=`${p.name}${_?`: ${o(p.value)}`:""}`;return{kind:"circle",part:_?"bubble":"point",cx:N,cy:B,r:l(_?Math.max(Y,Math.sqrt(Math.max(0,p.value)/I)*j):Y),fill:p.color??ne(e,1),stroke:"var(--skdx-color-surface-default)",opacity:.85,title:W,item:{label:W,id:p.id??p.name,name:p.name,index:q,value:p.value}}}),H=e.colorLegend?rr(V,c?{x:k.x+k.width+12,y:k.y,width:c,height:k.height}:{x:_n,y:s-i+8,width:a-2*_n,height:i},Bn(e.colorLegend).options):[],Q=e.projection==="mercator"?p=>Math.atan(Math.exp(p))*360/Math.PI-90:p=>p;return{...he(e,a,s),shapes:[...x,...F,...g,...G,...H],issues:n,map:{view:{center:[M[0],Q(M[1])],zoom:T},bounds:{minLon:y,maxLon:$,minLat:b,maxLat:w},plot:k,scale:E,toY:m,fromY:Q}}}function ja(e){let n=[],t=e.segments.map((z,O)=>typeof z=="string"?{name:z,id:z,color:ne(e,O)}:{name:z.name,id:z.id??z.name,color:ne(e,O,z.color)}),r=t.map(z=>!xe(e,z.name)),o=(z,O)=>{let V=z.values[O];return V==null?0:!P(V)||V<0?(n.push({code:P(V)?"negative-value":"invalid-value",severity:"warning",message:`"${t[O]?.name}" in "${z.name}" is ${P(V)?"negative":"not a number"}; drawn as zero.`,itemId:z.id??z.name}),0):V},a=e.data.map((z,O)=>{let V=t.map((C,v)=>r[v]?o(z,v):0),g=V.reduce((C,v)=>C+v,0),x=P(z.total)&&z.total>=0?z.total:g;return{c:z,ci:O,values:V,sum:g,total:x}}),s=a.reduce((z,O)=>z+O.total,0),d=le(e,s<=0);if(d)return{...d,issues:n};let i=oe(e.format),c=oe(e.xAxis?.format??e.format),{width:m,height:h}=de(e),f=t.map(z=>({name:z.name,color:z.color})),y=Te(m,h,{...fe,top:fe.top+ue(e,f,m),bottom:fe.bottom+(e.xAxis?.label?14:0)+(e.xAxis?.format?14:0)}),$=Math.max(0,Math.min(.2,e.gap??.01))*y.width,b=Math.max(0,a.length-1),w=Math.max(0,y.width-$*b),R=Ge([0,1],[y.y+y.height,y.y],{format:{style:"percent"}}),k=he(e,m,h,f),T=y.x,E=a.map(z=>{let O=z.total/s*w,V={x:T,w:O};return T+=O+$,{...z,...V}}),M=E.map(z=>({pos:l(z.x+z.w/2),label:z.c.name})),L=Ze({...k,plot:y,xTicks:Re(M,y.width),yTicks:R.ticks,baseline:R.zero},{xLabel:e.xAxis?.label,yLabel:void 0});if(e.xAxis?.format)for(let z of E)z.w>24&&L.push(J(l(z.x+z.w/2),y.y+y.height+34,c(z.total),{part:"x-total",anchor:"middle"}));let S=[],D=[];for(let z of E){let O=0;z.values.forEach((V,g)=>{let x=t[g];if(V<=0||z.sum<=0)return;let C=V/z.sum,v=R.scale(O+C),F=R.scale(O);O+=C;let U=`${Math.round(C*100)}%`,Y=`${x.name}, ${z.c.name}: ${i(V)} (${U}) \xB7 column ${c(z.total)}`,j=Math.max(0,F-v);S.push({kind:"rect",part:"cell",x:l(z.x),y:l(v),width:l(z.w),height:l(j),fill:x.color,stroke:"var(--skdx-color-surface-default)",title:Y,item:{label:Y,id:`${z.c.id??z.c.name}:${x.name}`,series:x.name,seriesId:x.id,category:z.c.name,index:z.ci,value:V}}),e.labels&&j>14&&z.w>24&&D.push(J(l(z.x+z.w/2),l(v+j/2),U,{part:"cell-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))})}return{...k,shapes:ft([...L,...S,...D,...k.shapes]),issues:n}}var ii=500;function Ga(e){let n=[],t=e.dimensions,r=e.data.filter(M=>!(M.group!==void 0&&xe(e,M.group))),o=le(e,t.length===0||r.length===0);if(o)return{...o,issues:n};let{width:a,height:s}=de(e),d=[...new Set(e.data.map(M=>M.group).filter(M=>M!==void 0))],i=t[0],c=t[t.length-1],m=M=>(M.label??M.key).length*ie/2+8,h=d.map((M,L)=>({name:M,color:ne(e,L)})),f=Te(a,s,{top:28+ue(e,h,a),right:Math.max(16,m(c)),bottom:16,left:Math.max(48,m(i))}),y=(M,L)=>{let S=M.values[L];return S==null?null:P(S)?S:(n.push({code:"invalid-value",severity:"warning",message:`"${M.name}" has a value on "${L}" that is not a number; drawn as a gap.`,itemId:M.id??M.name}),null)},$=t.map((M,L)=>{let[S,D]=we(r.map(F=>y(F,M.key))),z=ht(M.min??S,M.max??D),O=M.min??z[0],V=M.max??z[z.length-1],g=M.reversed?[f.y,f.y+f.height]:[f.y+f.height,f.y],x=st([O,V],g),C=l(t.length===1?f.x+f.width/2:f.x+L*f.width/(t.length-1)),v=oe(M.format??e.format);return{d:M,x:C,scale:F=>l(x(Math.max(O,Math.min(V,F)))),format:v,ticks:z.filter(F=>F>=O-1e-9&&F<=V+1e-9)}}),b=[];$.forEach((M,L)=>{b.push({kind:"line",part:"axis",x1:M.x,x2:M.x,y1:f.y,y2:f.y+f.height,stroke:K.axis});let S=L===$.length-1&&$.length>1?"start":"end";for(let D of M.ticks)b.push(J(l(S==="end"?M.x-6:M.x+6),M.scale(D),M.format(D),{part:"y-label",anchor:S,baseline:"middle"}));b.push(J(M.x,f.y-12,M.d.label??M.d.key,{part:"axis-title",anchor:"middle"}))});let w=r.length<=ii,R=e.opacity??(r.length>200?.25:.6),k=M=>(e.filters??[]).every(L=>{let S=y(M,L.key);return S!==null&&S>=(L.min??-1/0)&&S<=(L.max??1/0)}),T=r.map((M,L)=>{let S=[],D=[];for(let O of $){let V=y(M,O.d.key);if(V===null){!e.connectNulls&&D.length&&(S.push(D),D=[]);continue}D.push({x:O.x,y:O.scale(V)})}D.length&&S.push(D);let z=`${M.name}: ${$.map(O=>{let V=y(M,O.d.key);return`${O.d.label??O.d.key} ${V===null?"\u2014":O.format(V)}`}).join(" \xB7 ")}`;return{kind:"path",part:"row",d:S.map(O=>it(O,e.curve)).join(""),stroke:M.color??(M.group!==void 0?ne(e,d.indexOf(M.group)):ne(e,0)),strokeWidth:1.5,strokeLinejoin:"round",opacity:k(M)?R:.08,title:w?z:void 0,item:w?{label:z,id:M.id??M.name,name:M.name,category:M.group,index:L}:void 0}}),E=he(e,a,s,h);return{...E,shapes:[...b,...T,...E.shapes],issues:n}}function Wa(e){let n=e.orientation==="vertical",t=le(e,!P(e.value),600,n?300:64);if(t)return t;let r=oe(e.format),o=e.min??0,a=(e.bands??[]).filter(c=>P(c.from)&&P(c.to)),s=e.max??Math.max(100,e.value,e.target??-1/0,...a.map(c=>c.to)),d=P(e.target)?`, target ${r(e.target)}`:"";return{...Ar({...e,height:e.height??(n?300:64),data:[{id:"value",name:e.caption??"",value:e.value,target:e.target,ranges:a}],min:o,max:s,labels:e.labels??!0,ticks:e.ticks}),description:e.description??`${e.caption??"Value"} ${r(e.value)} on a scale from ${r(o)} to ${r(s)}${d}.`}}function qa(e){let n=[],t=e.data.filter(g=>{let x=P(g.start)||P(g.end);return x||n.push({code:"invalid-value",severity:"warning",message:`"${g.name}" has neither a valid start nor end and was dropped.`,itemId:g.id??g.name}),x}),r=le(e,t.length===0);if(r)return{...r,issues:n};let o=oe(e.xAxis?.format??e.format),{width:a,height:s}=de(e),d=e.orientation==="vertical",i=e.startLabel??"Start",c=e.endLabel??"End",m=xe(e,i),h=xe(e,c),f=[...t];if(e.sort){let g=x=>e.sort==="change"?(P(x.end)?x.end:0)-(P(x.start)?x.start:0):P(x.end)?x.end:-1/0;f.sort((x,C)=>e.sort==="asc"?g(x)-g(C):g(C)-g(x))}let y=Math.max(0,...f.map(g=>g.name.length))*ie,$=ne(e,0),b=ne(e,1),w=[{name:i,color:$},{name:c,color:b}],R=Te(a,s,{...fe,top:fe.top+ue(e,w,a)+(d&&e.xAxis?.label?12:0),right:e.labels&&!d?56:fe.right,bottom:fe.bottom+(!d&&e.xAxis?.label?14:0),left:d?fe.left:Math.max(fe.left,y+16)}),k=Ge(Gt(f.flatMap(g=>[m?void 0:g.start,h?void 0:g.end]),!1),d?[R.y+R.height,R.y]:[R.x,R.x+R.width],e.xAxis??{},e.format),T=je(f.length,d?[R.x,R.x+R.width]:[R.y,R.y+R.height]),E=he(e,a,s,w),M=f.map((g,x)=>({pos:l(T.center(x)),label:g.name})),L=Ze({...E,plot:R,xTicks:d?Re(M,R.width):M,yTicks:d?k.ticks:Re(k.ticks,R.width),baseline:d?R.y+R.height:R.x},{horizontal:!d,grid:Dn(e.xAxis),...d?{yLabel:e.xAxis?.label}:{xLabel:e.xAxis?.label}});L.push(...Wt(e.references,{plot:R,horizontal:!d,x:g=>{let x=f.findIndex(C=>C.name===g);return x<0?void 0:T.center(x)},y:g=>k.scale(g)}));let S=e.markerSize??5,D=(g,x)=>d?{x:l(x),y:l(k.scale(g))}:{x:l(k.scale(g)),y:l(x)},z=[],O=[],V=[];return f.forEach((g,x)=>{let C=T.center(x),v=P(g.start)?o(g.start):"\u2014",F=P(g.end)?o(g.end):"\u2014",U=`${g.name}: ${v} \u2192 ${F}`,Y={label:U,id:g.id??g.name,name:g.name,index:x,value:P(g.end)?g.end:void 0};if(!m&&!h&&P(g.start)&&P(g.end)){let j=D(g.start,C),I=D(g.end,C);z.push({kind:"line",part:"connector",x1:j.x,y1:j.y,x2:I.x,y2:I.y,stroke:g.color??K.axis,strokeWidth:3,title:U,item:Y})}for(let[j,I,G,H,Q]of[[g.start,"start",i,$,m],[g.end,"end",c,b,h]]){if(Q||!P(j))continue;let p=D(j,C),q=`${g.name} \xB7 ${G}: ${o(j)}`;O.push({kind:"circle",part:I,cx:p.x,cy:p.y,r:S,fill:H,stroke:"var(--skdx-color-surface-default)",title:q,item:{...Y,label:q,series:G}}),e.labels&&V.push(d?J(p.x,l(p.y+(I==="end"?-S-4:S+12)),o(j),{part:"value-label",anchor:"middle"}):J(l(p.x+(I==="end"?S+4:-S-4)),p.y,o(j),{part:"value-label",anchor:I==="end"?"start":"end",baseline:"middle"}))}}),{...E,shapes:[...L,...z,...O,...V,...E.shapes],issues:n}}function Za(e){let n=[],r=e.data.filter(m=>{let h=P(m.value)&&m.value>=0;return h||n.push({code:"invalid-value",severity:"warning",message:`"${m.name}" has no valid non-negative value and was dropped.`,itemId:m.id??m.name}),h}).map((m,h)=>({d:m,i:h})).sort((m,h)=>h.d.value-m.d.value||m.i-h.i),o=r.reduce((m,{d:h})=>m+h.value,0),a=0,s=r.map(({d:m})=>o>0?(a+=m.value)/o:0),d=e.threshold,i=qt({...e,categories:r.map(({d:m})=>m.name),series:[{name:e.name??"Value",type:"bar",data:r.map(({d:m})=>m.value),color:r[0]?.d.color},{name:e.cumulativeLabel??"Cumulative",type:"line",axis:"right",data:s,curve:"linear"}],rightAxis:{min:0,max:1,format:{style:"percent"}},references:d!==void 0&&P(d)?[{y:d,axis:"right",label:`${Math.round(d*100)}%`,variant:"primary"}]:void 0},"bar"),c=i.shapes.map(m=>{if(m.part!=="bar"||m.kind!=="rect"||!m.item||m.item.index===void 0)return m;let h=r[m.item.index]?.d;return h?{...m,fill:h.color??m.fill,item:{...m.item,id:h.id??h.name,name:h.name}}:m});return{...i,shapes:c,issues:[...n,...i.issues??[]]}}function no(e){let{nodes:n,path:t}=$n(e.data,e.rootId),r=fn(n,e.maxDepth),o=le(e,r.length===0);if(o)return o;let a=oe(e.format),{width:s,height:d}=de(e),i=e.orientation!=="horizontal",c=e.nodeShape==="box",m=e.linkStyle??"curve",h=new Set(e.collapsed??[]),f=e.labels??!0,y=[],$=0,b=0,w=(I,G,H,Q)=>{let p=h.has(tt(I))||h.has(I.name),q=p?[]:I.children??[],N=I.color??H?.color??ne(e,Q),B={node:I,depth:G,slot:0,parent:H,collapsed:p,color:N};if(b=Math.max(b,G),q.length===0)B.slot=$++;else{let _=q.map((W,ee)=>w(W,G+1,B,ee));B.slot=(_[0].slot+_[_.length-1].slot)/2}return y.push(B),B};r.forEach((I,G)=>w(I,0,void 0,G));let R=I=>Math.max(I.name.length,I.subtitle?.length??0),k=Math.max(0,...y.map(I=>R(I.node)))*ie+16,T=e.nodeSize??36,E=e.nodeSize??5,M=c?k:2*E,L=c?T:2*E,S=!c&&f?k:0,D=Te(s,d,{top:ue(e)+L/2+4,bottom:L/2+4+(i&&!c?16:0),left:M/2+4,right:M/2+4+(i?0:S)}),z=Math.max(1,$),O=i?D.width:D.height,V=i?D.height:D.width,g=z===1?0:O/(z-1),x=b===0?0:V/b,C=I=>{let G=z===1?O/2:I.slot*g,H=I.depth*x;return i?{x:l(D.x+G),y:l(D.y+H)}:{x:l(D.x+H),y:l(D.y+G)}},v=[],F=[],U=[];for(let I of y){let{x:G,y:H}=C(I);if(I.parent){let N=C(I.parent),B=c?i?L/2:M/2:E,_=i?N.x:l(N.x+B),W=i?l(N.y+B):N.y,ee=i?G:l(G-B),te=i?l(H-B):H,re=l((_+ee)/2),me=l((W+te)/2),be=m==="straight"?`M${_} ${W}L${ee} ${te}`:m==="elbow"?i?`M${_} ${W}V${me}H${ee}V${te}`:`M${_} ${W}H${re}V${te}H${ee}`:i?`M${_} ${W}C${_} ${me} ${ee} ${me} ${ee} ${te}`:`M${_} ${W}C${re} ${W} ${re} ${te} ${ee} ${te}`;v.push({kind:"path",part:"link",d:be,stroke:K.axis,strokeWidth:1.5,title:`${I.parent.node.name} \u2192 ${I.node.name}`})}let Q=De(I.node),p=`${I.node.name}${I.node.subtitle?` \xB7 ${I.node.subtitle}`:""}${Ia(I.node)?`: ${a(Q)}`:""}${I.collapsed?" (collapsed)":""}`,q={label:p,id:tt(I.node),name:I.node.name,value:Q};if(c){if(F.push({kind:"rect",part:"node",x:l(G-M/2),y:l(H-L/2),width:l(M),height:l(L),fill:I.color,rx:4,title:p,item:q}),f){let N=!!I.node.subtitle;U.push(J(G,l(N?H-7:H),I.node.name,{part:"node-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)",weight:"bold"})),N&&U.push(J(G,l(H+8),I.node.subtitle,{part:"node-subtitle",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))}}else F.push({kind:"circle",part:"node",cx:G,cy:H,r:l(E),fill:I.color,stroke:"var(--skdx-color-surface-default)",title:p,item:q}),f&&U.push(i?J(G,l(H+E+12),I.node.name,{part:"node-label",anchor:"middle",fill:"var(--skdx-color-text-default)"}):J(l(G+E+4),H,I.node.name,{part:"node-label",baseline:"middle",fill:"var(--skdx-color-text-default)"}));I.collapsed&&U.push(J(l(c?G+M/2-8:G+E+(i?6:-2)),l(c?H-L/2+8:H-E-2),"+",{part:"collapsed",anchor:"middle",baseline:"middle",fill:K.label,weight:"bold"}))}let Y=t.length?[J(8,ue(e)+10,t.map(I=>I.name).join(" \u203A "),{part:"breadcrumb",baseline:"middle"})]:[],j=he(e,s,d);return{...j,shapes:ft([...v,...F,...U,...Y,...j.shapes])}}var Ua=e=>no({...e,nodeShape:"box",linkStyle:"elbow"});function li(e,n){let t=[],r=e.map((f,y)=>({r:f,i:y})).sort((f,y)=>y.r-f.r),o=new Array(e.length);for(let{r:f,i:y}of r){let $;if(t.length===0)$={x:0,y:0,r:f};else{let w=Math.max(1,f/4);e:for(let R=0;R<1e6;R+=w)for(let k=0;k<24;k++){let T=k/24*2*Math.PI+R*.05,E={x:R*Math.cos(T),y:R*Math.sin(T),r:f};if(t.every(M=>Math.hypot(M.x-E.x,M.y-E.y)>=M.r+E.r+n)){$=E;break e}}}let b=$??{x:0,y:0,r:f};t.push(b),o[y]=b}let a=1/0,s=-1/0,d=1/0,i=-1/0;for(let f of t)a=Math.min(a,f.x-f.r),s=Math.max(s,f.x+f.r),d=Math.min(d,f.y-f.r),i=Math.max(i,f.y+f.r);let c=(a+s)/2,m=(d+i)/2,h=0;for(let f of o)f.x-=c,f.y-=m,h=Math.max(h,Math.hypot(f.x,f.y)+f.r);return{circles:o,enclosing:h}}function Ya(e){let n=[],{nodes:t}=$n(e.data,e.rootId),r=fn(t,e.maxDepth),o=new Map(r.map((L,S)=>[tt(L),ne(e,S,L.color)])),a=r.filter(L=>!xe(e,L.name)),s=le(e,!a.some(L=>De(L)>0),300,300);if(s)return{...s,issues:n};let d=oe(e.format),{width:i,height:c}=de(e,300,300),m=r.map(L=>({name:L.name,color:o.get(tt(L))})),h=ue(e,m,i),f=e.padding??2,y=e.labels??!0,$=[],b=L=>{L.children?.length?L.children.forEach(b):$.push(De(L))};a.forEach(b);let w=Pt(e.colorScale,$,ne(e,0),void 0,d),R=[],k=[],T=(L,S,D,z,O)=>{let V=L.filter(v=>{let F=De(v)>0;return F||n.push({code:"invalid-value",severity:"warning",message:`"${v.name}" has no positive value and was dropped.`,itemId:tt(v)}),F});if(V.length===0)return;let{circles:g,enclosing:x}=li(V.map(v=>Math.sqrt(De(v))),0),C=x>0?(z-f)/x:0;V.forEach((v,F)=>{let U=g[F],Y=l(S+U.x*C),j=l(D+U.y*C),I=Math.max(0,U.r*C-f/2),G=De(v),H=(v.children?.length??0)>0,Q=v.color??O??o.get(tt(v))??ne(e,F),p=H?Q:e.colorScale?w.color(G)?.fill??Q:Q,q=`${v.name}: ${d(G)}`;R.push({kind:"circle",part:H?"branch":"leaf",cx:Y,cy:j,r:l(I),fill:p,opacity:H?.15:e.colorScale&&!H?w.color(G)?.opacity:void 0,stroke:"var(--skdx-color-surface-default)",title:q,item:{label:q,id:tt(v),name:v.name,value:G}}),y&&!H&&I*2>v.name.length*ie+4&&k.push(J(Y,j,v.name,{part:"leaf-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"})),y&&H&&I*2>v.name.length*ie+4&&k.push(J(Y,l(j-I+10),v.name,{part:"branch-label",anchor:"middle",baseline:"middle"})),H&&T(v.children,Y,j,I,Q)})},E=Math.max(0,Math.min(i,c-h)/2-8);T(a,i/2,h+(c-h)/2,E,void 0);let M=he(e,i,c,m);return{...M,shapes:ft([...R,...k,...M.shapes]),issues:n}}function Ka(e){let n=[],{nodes:t,path:r}=$n(e.data,e.rootId),o=fn(t,e.maxDepth).filter(z=>!xe(e,z.name)),a=le(e,!o.some(z=>De(z)>0));if(a)return{...a,issues:n};let s=oe(e.format),{width:d,height:i}=de(e),c=e.orientation==="horizontal",m=e.breadcrumbs&&r.length>0,h=o.map((z,O)=>({name:z.name,color:ne(e,O,z.color)})),f=ue(e,h,d)+(m?20:0),y=Te(d,i,{top:f,right:0,bottom:0,left:0}),$=e.padding??1,b=e.labels??!0,w=Math.max(1,Nr(o)),R=(c?y.width:y.height)/w,k=[],T=z=>{z.children?.length?z.children.forEach(T):k.push(De(z))};o.forEach(T);let E=Pt(e.colorScale,k,ne(e,0),void 0,s),M=[],L=[],S=(z,O,V,g,x)=>{let C=ir(z,e.sort).filter(U=>{let Y=De(U)>0;return Y||n.push({code:"invalid-value",severity:"warning",message:`"${U.name}" has no positive value and was dropped.`,itemId:tt(U)}),Y}),v=C.reduce((U,Y)=>U+De(Y),0),F=V;C.forEach((U,Y)=>{let j=De(U),I=v>0?j/v*g:0,G=(U.children?.length??0)>0,H=U.color??x??ne(e,Y),Q=!G&&e.colorScale?E.color(j):void 0,p=O*R,q=c?{x:y.x+p+$/2,y:F+$/2,width:R-$,height:I-$}:{x:F+$/2,y:y.y+p+$/2,width:I-$,height:R-$},N=`${U.name}: ${s(j)}`;M.push({kind:"rect",part:"cell",x:l(q.x),y:l(q.y),width:l(Math.max(0,q.width)),height:l(Math.max(0,q.height)),fill:Q?.fill??H,opacity:Q?.opacity??(G?.7:void 0),title:N,item:{label:N,id:tt(U),name:U.name,value:j}}),b&&q.width>U.name.length*ie+6&&q.height>12&&L.push(J(l(q.x+4),l(q.y+q.height/2),U.name,{part:"cell-label",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"})),G&&S(U.children,O+1,F,I,H),F+=I})};S(o,0,c?y.y:y.x,c?y.height:y.width,void 0),m&&M.push(...cr(r,8,ue(e,h,d)+10));let D=he(e,d,i,h);return{...D,shapes:ft([...M,...L,...D.shapes]),issues:n}}function Xa(e){let n=[],t=e.series.map((O,V)=>({...O,index:V,hidden:xe(e,O.name)})),r=Math.max(e.categories?.length??0,...t.map(O=>O.data.length)),o=le(e,r===0||t.every(O=>O.hidden||He(O.data).length===0));if(o)return{...o,issues:n};for(let O of t){let V=O.data.filter(g=>g!==null&&!P(g)).length;V&&n.push({code:"invalid-value",severity:"warning",message:`Series "${O.name}" has ${V} value${V===1?"":"s"} that ${V===1?"is":"are"} neither a number nor null; drawn as gaps.`,itemId:O.id??O.name})}let a=oe(e.format),{width:s,height:d}=de(e),i=t.filter(O=>!O.hidden),c=i.map(()=>new Array(r).fill(null));for(let O=0;O<r;O++){if(e.ranked){i.forEach((g,x)=>{let C=g.data[O];c[x][O]=P(C)?C:null});continue}i.map((g,x)=>({si:x,v:g.data[O]})).filter(g=>P(g.v)).sort((g,x)=>x.v-g.v||g.si-x.si).forEach((g,x)=>{c[g.si][O]=x+1})}let m=e.topRank??Math.max(1,i.length),h=Array.from({length:r},(O,V)=>{let g=e.categories?.[V];return g===void 0?String(V+1):Qt(g,e.xAxis?.format)}),f=e.labels??!0,y=f?Math.max(0,...i.map(O=>O.name.length))*ie+12:0,$=e.series.map((O,V)=>({name:O.name,color:ne(e,V,O.color)})),b=Te(s,d,{...fe,top:fe.top+ue(e,$,s),right:Math.max(fe.right,y),bottom:fe.bottom+(e.xAxis?.label?14:0)}),w=st([.5,m+.5],[b.y,b.y+b.height]),R=je(r,[b.x,b.x+b.width],0),k=he(e,s,d,$),T=Array.from({length:m},(O,V)=>({pos:l(w(V+1)),label:`#${V+1}`})),E=Ze({...k,plot:b,xTicks:Re(h.map((O,V)=>({pos:l(R.center(V)),label:O})),b.width),yTicks:m>20?T.filter((O,V)=>V%Math.ceil(m/20)===0):T,baseline:b.y+b.height},{xLabel:e.xAxis?.label,grid:e.xAxis?.grid!==!1}),M=e.markerSize??5,L=[],S=[],D=[],z=[];return i.forEach((O,V)=>{let g=ne(e,O.index,O.color),x=[],C=[],v;for(let F=0;F<r;F++){let U=c[V][F];if(U==null||U>m||U<1){C.length&&x.push(C),C=[];continue}let Y={x:l(R.center(F)),y:l(w(U))};C.push(Y),v=Y;let j=O.data[F],I=`${O.name}, ${h[F]}: #${U}${e.ranked||!P(j)?"":` (${a(j)})`}`;S.push(Bt(Y.x,Y.y,M,g,I,{label:I,id:O.id??O.name,series:O.name,seriesId:O.id??O.name,category:h[F],index:F,value:U}))}C.length&&x.push(C);for(let F of x)L.push({kind:"path",part:"line",d:it(F,e.curve??"monotone"),stroke:g,strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",title:O.name,item:{label:O.name,id:O.id??O.name,series:O.name,seriesId:O.id??O.name}});f&&v&&!z.some(F=>Math.abs(F-v.y)<12)&&(z.push(v.y),D.push(J(l(v.x+M+4),v.y,O.name,{part:"series-label",baseline:"middle",fill:K.label})))}),{...k,shapes:[...E,...L,...S,...D,...k.shapes],issues:n}}var Qa=e=>e*Math.PI/180;function Ja(e){let n=[],t=e.data.map(x=>{let C=P(x.value);return C?x.value<0&&n.push({code:"negative-value",severity:"warning",message:`"${x.name}" is negative (${x.value}); a radius cannot be, so it is drawn as zero.`,itemId:x.id??x.name}):n.push({code:"invalid-value",severity:"warning",message:`"${x.name}" has no valid value and is drawn as zero.`,itemId:x.id??x.name}),{...x,value:C&&x.value>0?x.value:0}}),r=le(e,!t.some(x=>x.value>0),300,300);if(r)return{...r,issues:n};let o=oe(e.format),{width:a,height:s}=de(e,300,300),d=e.data.map((x,C)=>({name:x.name,color:ne(e,C,x.color)})),i=ue(e,d,a),c=a/2,m=i+(s-i)/2,h=Math.max(0,Math.min(a,s-i)/2-(e.labels?40:12)),f=h*Math.min(.9,Math.max(0,e.innerRadius??0)),y=Math.max(1,Math.round(e.levels??4)),$=Math.max(0,...t.map(x=>xe(e,x.name)?0:x.value)),b=ht(0,e.max??$,y).filter(x=>x>0),w=e.max??b[b.length-1],R=(e.scale??"sqrt")==="sqrt",k=x=>{let C=w>0?Math.max(0,Math.min(1,x/w)):0;return f+(h-f)*(R?Math.sqrt(C):C)},T=Qa(e.startAngle??0),E=Qa(e.endAngle??(e.startAngle??0)+360),M=Math.max(0,Math.min(2*Math.PI,E-T)),L=t.length,S=M/Math.max(1,L),D=Math.min(S*.9,Qa(Math.max(0,e.padAngle??0))),z=b.filter(x=>x<=w).flatMap(x=>[{kind:"circle",part:"grid",cx:l(c),cy:l(m),r:l(k(x)),fill:"none",stroke:K.grid},J(l(c+4),l(m-k(x)),o(x),{part:"y-label",baseline:"middle"})]),O=[],V=[];t.forEach((x,C)=>{let v=T+C*S+D/2,F=v+S-D,U=xe(e,x.name),Y=`${x.name}: ${o(x.value)}`;if(!U&&x.value>0&&F>v&&O.push({kind:"path",part:"sector",d:Ke(c,m,k(x.value),f,v,F),fill:ne(e,C,x.color),stroke:"var(--skdx-color-surface-default)",title:Y,item:{label:Y,id:x.id??x.name,name:x.name,index:C,value:x.value}}),e.labels&&!U){let j=(v+F)/2,I=Math.sin(j);V.push(J(l(c+(h+8)*I),l(m-(h+8)*Math.cos(j)),x.name,{part:"sector-label",anchor:I>.1?"start":I<-.1?"end":"middle",baseline:"middle"}))}});let g=he(e,a,s,d);return{...g,shapes:[...z,...O,...V,...g.shapes],issues:n}}var ci=2e3;function di(e,n,t){let r=[],o=[],a=(2*n)**2;for(let s of e){let d=[];for(let c=r.length-1;c>=0&&s-r[c].p<2*n;c--)d.push(r[c]);let i=0;for(let c=0;;c++){if(i=c===0?0:(c%2?1:-1)*Math.ceil(c/2),Math.abs(i)>t){i=Math.sign(i)*t;break}if(d.every(m=>(m.p-s)**2+(m.off-i)**2>=a))break}r.push({p:s,off:i}),o.push(i)}return o}function es(e){let n=[];for(let T of e.series){let E=T.data.filter(M=>M!==null&&!Number.isFinite(M)).length;E&&n.push({code:"invalid-value",severity:"warning",message:`Series "${T.name}" has ${E} value${E===1?"":"s"} that ${E===1?"is":"are"} neither a number nor null; skipped.`,itemId:T.id??T.name})}let t=e.series.map(T=>xe(e,T.name)?[]:He(T.data)),r=le(e,t.every(T=>T.length===0));if(r)return{...r,issues:n};let o=oe(e.yAxis?.format??e.format),{width:a,height:s}=de(e),d=e.orientation==="horizontal",i=Math.max(0,...e.series.map(T=>T.name.length))*ie,c=e.series.map((T,E)=>({name:T.name,color:ne(e,E,T.color)})),m=Te(a,s,{...fe,top:fe.top+ue(e,c,a)+(!d&&e.yAxis?.label?12:0),left:d?Math.max(fe.left,i+16):fe.left,bottom:fe.bottom+(d&&e.yAxis?.label?14:0)}),h=Ge(Gt(t.flat(),!1),d?[m.x,m.x+m.width]:[m.y+m.height,m.y],e.yAxis??{},e.format),f=je(e.series.length,d?[m.y,m.y+m.height]:[m.x,m.x+m.width]),y=he(e,a,s,c),$=e.series.map((T,E)=>({pos:l(f.center(E)),label:T.name})),b=Ze({...y,plot:m,xTicks:d?$:Re($,m.width),yTicks:d?Re(h.ticks,m.width):h.ticks,baseline:d?m.x:m.y+m.height},{horizontal:d,grid:Dn(e.yAxis),...d?{xLabel:e.yAxis?.label}:{yLabel:e.yAxis?.label}});b.push(...Wt(e.references,{plot:m,horizontal:d,x:T=>{let E=e.series.findIndex(M=>M.name===T);return E<0?void 0:f.center(E)},y:T=>h.scale(T)}));let w=e.markerSize??3,R=Math.max(0,f.bandwidth/2-w),k=[];return e.series.forEach((T,E)=>{let M=ne(e,E,T.color),L=f.center(E),S=(xe(e,T.name)?[]:T.data).map((O,V)=>({v:O,index:V})).filter(O=>P(O.v)).sort((O,V)=>h.scale(O.v)-h.scale(V.v)),D=di(S.map(O=>h.scale(O.v)),w,R),z=S.length<=ci;S.forEach((O,V)=>{let g=h.scale(O.v),x=D[V],C=`${T.name}: ${o(O.v)}`;k.push({kind:"circle",part:"dot",cx:l(d?g:L+x),cy:l(d?L+x:g),r:w,fill:M,title:z?C:void 0,item:z?{label:C,id:T.id??T.name,series:T.name,seriesId:T.id??T.name,index:O.index,value:O.v}:void 0})})}),{...y,shapes:[...b,...k,...y.shapes],issues:n}}var mi=8;function ui(e){let n=e.map(o=>Math.floor(o)),t=Math.round(e.reduce((o,a)=>o+a,0))-n.reduce((o,a)=>o+a,0),r=e.map((o,a)=>({i:a,frac:o-Math.floor(o)})).sort((o,a)=>a.frac-o.frac||o.i-a.i);for(let{i:o}of r){if(t<=0)break;n[o]++,t--}return n}function ts(e){let n=[],t=e.data.map(v=>{let F=P(v.value)&&v.value>=0;return F||n.push({code:P(v.value)?"negative-value":"invalid-value",severity:"warning",message:`"${v.name}" has no valid non-negative value and is drawn as zero.`,itemId:v.id??v.name}),{...v,value:F?v.value:0}}),r=t.reduce((v,F)=>v+(xe(e,F.name)?0:F.value),0),o=le(e,r<=0,300,300);if(o)return{...o,issues:n};let a=oe(e.format),s=P(e.total)&&e.total>0?e.total:r,d=Math.max(1,Math.round(e.rows??10)),i=Math.max(1,Math.round(e.columns??10)),c=d*i,m=v=>s>0?v/s:0,h=ui(t.map(v=>xe(e,v.name)?0:Math.min(1,m(v.value))*c)),{width:f,height:y}=de(e,300,300),$=new Map(t.map(v=>[v.name,`${Math.round(m(v.value)*100)}%`])),b=Un(e),w=e.data.map((v,F)=>({name:v.name,color:ne(e,F,v.color)})),R=e.labels&&b?{...e,legend:{...b,formatter:v=>`${b.formatter?.(v)??v} ${$.get(v)??""}`}}:e,k=ue(R,w,f),T=Math.max(0,e.cellGap??2),E=Math.max(1,Math.min((f-2*mi)/i,(y-k-2*mi)/d)),M=(f-E*i)/2,L=k+(y-k-E*d)/2,S=e.orientation==="horizontal",D=v=>S?{x:M+v%i*E,y:L+Math.floor(v/i)*E}:{x:M+Math.floor(v/d)*E,y:L+(d-1-v%d)*E},z=(v,F,U,Y,j,I)=>{let{x:G,y:H}=D(v);return{kind:"rect",part:"cell",x:l(G+T/2),y:l(H+T/2),width:l(Math.max(.5,E-T)),height:l(Math.max(.5,E-T)),fill:F,stroke:I,opacity:j,rx:e.cellRadius??2,title:U,item:Y}},O=[],V=0;t.forEach((v,F)=>{let U=h[F],Y=`${v.name}: ${a(v.value)} (${Math.round(m(v.value)*100)}%)`,j={label:Y,id:v.id??v.name,name:v.name,index:F,value:v.value};for(let I=0;I<U&&V<c;I++,V++)O.push(z(V,ne(e,F,v.color),Y,j))});let g=s-r,x=g>0?`Other: ${a(g)} (${Math.round(m(g)*100)}%)`:"Empty";for(;V<c;V++)O.push(z(V,K.grid,x,void 0,.6,K.axis));let C=he(R,f,y,w);return{...C,shapes:[...O,...C.shapes],issues:n}}var ye=require("lit"),ce=require("lit/decorators.js"),ze=require("lit/directives/if-defined.js");var Ne={fromAttribute:()=>!1},X=class extends ye.LitElement{constructor(){super(...arguments);this.legend=!1;this.tooltip=!0;this.selectionMode="none";this.loading=!1;this.decorative=!1;this.accessibleTable=!1;this.zoomable=!1;this.editable=!1;this.crossFilter=!1;this.animated=!1;this.responsive=!1;this.tip=[];this.overlay=[];this.portal=null;this.highlightState=null;this.crossState=null;this.lastCross=null;this.pointers=new Map;this.hover=null;this.token={};this.snapshotKind="";this.focused=null;this.hiddenState=[];this.drag=null;this.onPointerMove=t=>{let r=this.layout;if(!r)return;this.pointers.has(t.pointerId)&&this.pointers.set(t.pointerId,this.viewBox(t,r).x);let o=this.drag;if(o?.grab==="select"){let{x:a,y:s}=this.viewBox(t,r);this.overlay=[la(eo(o.x,o.y,a,s))];return}if(o?.grab==="lasso"){let{x:a,y:s}=this.viewBox(t,r);o.points=[...o.points??[],{x:a,y:s}],this.overlay=[da(o.points)];return}if(o?.grab==="edit"){if(!o.gantt)return;let{x:a}=this.viewBox(t,r);o.change=ua(r,o.gantt,a-o.x),this.overlay=[fa(r,o.gantt,o.change)];return}if(o?.grab==="map"){if(!r.map||!o.view)return;let{x:a,y:s}=this.viewBox(t,r);this.setView(ba(r.map,o.view,a-o.x,s-o.y));return}if(o&&r.hit){if(o.grab==="pinch"){let[s,d]=[...this.pointers.values()];if(s===void 0||d===void 0||!o.distance)return;this.setZoom(va(r.hit,o.zoom,Math.abs(s-d)/o.distance,(s+d)/2));return}let{x:a}=this.viewBox(t,r);this.setZoom(o.grab==="pan"?Ma(r.hit,o.zoom,a-o.x):ka(r.hit,o.grab,o.zoom,a-o.x));return}if(r.tooltipPortal){let{lines:a,shapes:s}=oa(r,t.target,t.currentTarget,t.clientX,t.clientY);this.tip=s,this.portal=a.length?{x:t.clientX,y:t.clientY,lines:a}:null}else{let a=aa(r,t.target,t.currentTarget,t.clientX,t.clientY);(a.length>0||this.tip.length>0)&&(this.tip=a)}if(this.highlight(sa(r,t.target)),this.syncId&&r.hit?.crosshair){let a=Cr(r,this.viewBox(t,r).x);this.shareCrosshair(a?r.hit.rows[a.index]?.[0]??null:null)}};this.onPointerDown=t=>{let r=this.layout;if(!r||t.button!==0)return;let{x:o,y:a}=this.viewBox(t,r),s=Hn(r,t.target)?.item.legend,d=this.canEdit(r)?ma(r,o,a):void 0;if(d){this.drag={x:o,y:a,zoom:{start:0,end:0},grab:"edit",gantt:d},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.brushing()&&!s){this.drag={x:o,y:a,zoom:{start:0,end:0},grab:this.selectionMode==="lasso"?"lasso":"select",points:[{x:o,y:a}]},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.canPan(r)&&r.map){let c=r.map.plot;if(o<c.x||o>c.x+c.width||a<c.y||a>c.y+c.height)return;this.drag={x:o,y:a,zoom:{start:0,end:0},grab:"map",view:r.map.view},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}let i=r.hit;if(!(!i||!this.canZoom(r))){if(this.pointers.set(t.pointerId,o),this.pointers.size===2){let[c,m]=[...this.pointers.values()];this.drag={x:(c+m)/2,y:a,zoom:i.zoom,grab:"pinch",distance:Math.abs(c-m)||1}}else{let c=wa(i,o,a);if(c)this.drag={x:o,y:a,zoom:c.zoom,grab:c.grab},c.zoom!==i.zoom&&this.setZoom(c.zoom);else if(this.zoomable&&o>=i.plot.x&&o<=i.plot.x+i.plot.width&&a>=i.plot.y&&a<=i.plot.y+i.plot.height)this.drag={x:o,y:a,zoom:i.zoom,grab:"pan"};else{this.pointers.delete(t.pointerId);return}}t.currentTarget.setPointerCapture(t.pointerId),this.clearTip()}};this.onPointerUp=t=>{this.pointers.delete(t.pointerId);let r=t.currentTarget;r.hasPointerCapture(t.pointerId)&&r.releasePointerCapture(t.pointerId);let o=this.drag,a=this.layout;if(a&&(o?.grab==="select"||o?.grab==="lasso"||o?.grab==="edit"||o?.grab==="map")){this.overlay=[];let{x:s,y:d}=this.viewBox(t,a);if(Math.abs(s-o.x)>2||Math.abs(d-o.y)>2){o.grab==="select"?this.setSelected(ia(a,eo(o.x,o.y,s,d))):o.grab==="lasso"?this.setSelected(ca(a,o.points??[])):o.grab==="edit"&&o.change&&this.emit("skdx-task-change",o.change),this.drag={...o,distance:-1};return}this.drag=null;return}(this.pointers.size===0||this.drag?.grab==="pinch")&&(this.drag=null)};this.onWheel=t=>{let r=this.layout;if(!r)return;let{x:o,y:a}=this.viewBox(t,r);if(r.map&&this.canPan(r)){let i=r.map.plot;if(o<i.x||o>i.x+i.width||a<i.y||a>i.y+i.height)return;t.preventDefault(),this.setView(pa(r.map,t.deltaY,o,a));return}let s=r.hit;if(!s||!this.canZoom(r)||a<s.plot.y||a>s.plot.y+s.plot.height)return;let d=ya(s,t.deltaY,o);d&&(t.preventDefault(),this.setZoom(d))};this.onClick=t=>{if(!this.layout)return;if(this.drag?.distance===-1){this.drag=null;return}let r=Hn(this.layout,t.target);r&&(r.item.range?this.setZoom(r.item.range):r.item.legend&&r.item.series!==void 0?this.toggle(r.item.series):(this.select(r.item),this.emit("skdx-item-click",r.item)))};this.onKeyDown=t=>{if(t.key==="Escape"){t.preventDefault(),this.focused=null,this.clearTip(),this.crossState=null,this.highlight(null);return}let r=this.layout;if(!r)return;if((t.key==="Enter"||t.key===" ")&&this.focused!==null){let d=r.shapes[this.focused]?.item;d&&(t.preventDefault(),this.select(d),this.emit("skdx-item-click",d));return}let o=this.canEdit(r)?ha(r,this.focused,t):void 0;if(o){t.preventDefault(),this.emit("skdx-task-change",o);return}let a=xa(r,this.focused,t.key);if(a===void 0)return;t.preventDefault(),this.focused=a;let s=a===null?void 0:r.shapes[a]?.item;this.highlight(s?Vn(s):null)}}updated(){let t=this.renderRoot.querySelector("svg")??void 0;t===this.snapshotSvg&&this.removeSnapshot||(this.removeSnapshot?.(),this.snapshotSvg=t,this.removeSnapshot=t?fo(t,()=>{if(!this.snapshotConfiguration||!this.layout)throw new Error("Actual owner chart configuration unavailable");return bo(this.snapshotKind,this.snapshotConfiguration,this.layout)}):void 0)}connectedCallback(){super.connectedCallback(),this.requestUpdate(),!(typeof ResizeObserver>"u")&&(this.observer=new ResizeObserver(([t])=>{let r=Math.floor(t?.contentRect.width??0);r>0&&(this.measured=r)}),this.observer.observe(this))}disconnectedCallback(){this.removeSnapshot?.(),this.removeSnapshot=void 0,this.snapshotSvg=void 0,this.observer?.disconnect(),this.leave?.(),this.leave=void 0,this.joined=void 0,super.disconnectedCallback()}sized(){let{width:t,height:r,legend:o,tooltip:a,format:s,palette:d,loading:i,error:c,emptyMessage:m,description:h,decorative:f,animated:y,responsive:$,highlighted:b,highlightScope:w,accessibleTable:R}=this;return{width:$&&this.measured?this.measured:t,height:r,animate:y,responsive:$,legend:o,tooltip:a,format:s,palette:d,loading:i,error:c,emptyMessage:m,description:h,decorative:f,highlighted:b===void 0?this.highlightState:b,highlightScope:w,accessibleTable:R,hiddenSeries:this.hiddenSeries??this.hiddenState,zoom:this.zoom??this.zoomState,selected:this.selected??this.selectedState,view:this.view??this.viewState}}compactOverrides(){let t=this.responsive;return typeof t=="object"&&this.measured!==void 0&&this.measured<(t.breakpoint??480)?{...t.compact,width:this.measured}:void 0}emit(t,r){this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0}))}publish(t){this.syncId&&lr(this.syncId).publish(t,this.token)}join(){if(this.joined===this.syncId||(this.leave?.(),this.leave=void 0,this.joined=this.syncId,!this.syncId))return;let t=lr(this.syncId),r=o=>{"highlighted"in o&&(this.highlightState=o.highlighted??null),o.selected&&(this.selectedState=o.selected,this.crossFilter&&(this.highlightState=o.selected.length?o.selected:null)),"zoom"in o&&(this.zoomState=o.zoom),o.hiddenSeries&&(this.hiddenState=o.hiddenSeries),"crosshair"in o&&(this.crossState=o.crosshair??null)};r(t.current),this.leave=t.subscribe((o,a)=>{a!==this.token&&r(o)})}setZoom(t){this.zoomState=t,this.emit("skdx-zoom-change",t),this.publish({zoom:t})}setView(t){this.viewState=t,this.emit("skdx-view-change",t)}setSelected(t){this.selectedState=t,this.emit("skdx-selected-change",t),this.publish({selected:t})}toggle(t){let r=this.hiddenSeries??this.hiddenState,o=r.includes(t)?r.filter(a=>a!==t):[...r,t];this.hiddenState=o,this.emit("skdx-hidden-series-change",o),this.publish({hiddenSeries:o})}highlight(t){let r=this.hover;r===t||r&&t&&Eo(r,t)||(this.hover=t,this.emit("skdx-highlighted-change",t),this.highlightState=t,this.syncId&&this.publish({highlighted:t}))}select(t){let r=this.selectionMode;r!=="none"&&this.setSelected(Do(this.selected??this.selectedState,t,r==="single"?"single":"multiple"))}shareCrosshair(t){!this.syncId||this.lastCross===t||(this.lastCross=t,this.publish({crosshair:t}))}clearTip(){this.tip=[],this.portal=null,this.shareCrosshair(null)}canZoom(t){return!!(t.hit&&(this.zoomable||t.hit.brush))}canPan(t){return!!(t.map&&this.zoomable)}canEdit(t){return!!(this.editable&&t.edit)}brushing(){return this.selectionMode==="brush"||this.selectionMode==="lasso"}viewBox(t,r){return sr(t.currentTarget,t.clientX,t.clientY,r.width,r.height)}getSvgElement(){return this.renderRoot.querySelector("svg")}getLayout(){return this.layout}resetZoom(){this.setZoom(void 0)}zoomTo(t){this.setZoom(t)}focusItem(t){let r=this.layout;if(!r)return!1;let o=r.shapes.findIndex(a=>a.item&&!a.item.legend&&wn(a.item,t));return o<0?!1:(this.getSvgElement()?.focus(),this.focused=o,!0)}export(t){let r=this.layout;return r?zr(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,o,a){this.join();let s=Fo(ko(t),this.sized());if(this.layout=s,this.snapshotKind=r,this.snapshotConfiguration=a,s.issues!==this.reported){this.reported=s.issues;for(let R of s.issues??[])this.emit("skdx-data-issue",R)}let d=this.canZoom(s),i=this.canPan(s),c=this.canEdit(s),m=this.brushing(),h=d||i||c||m,f=!s.decorative&&to(s).length>0,y=Oa(s),$=Ta(s,this.accessibleTable),b=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||o,w=this.portal;return ye.html`<svg
|
|
4
4
|
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
-
viewBox="0 0 ${
|
|
6
|
-
width=${
|
|
7
|
-
height=${
|
|
8
|
-
role=${
|
|
9
|
-
aria-hidden=${
|
|
10
|
-
aria-label=${
|
|
11
|
-
aria-description=${(0,ze.ifDefined)(
|
|
12
|
-
tabindex=${
|
|
5
|
+
viewBox="0 0 ${s.width} ${s.height}"
|
|
6
|
+
width=${s.width}
|
|
7
|
+
height=${s.height}
|
|
8
|
+
role=${s.decorative?"presentation":"img"}
|
|
9
|
+
aria-hidden=${s.decorative?"true":ye.nothing}
|
|
10
|
+
aria-label=${s.decorative?ye.nothing:o}
|
|
11
|
+
aria-description=${(0,ze.ifDefined)(s.description)}
|
|
12
|
+
tabindex=${f?0:ye.nothing}
|
|
13
13
|
data-skdx-chart=${r}
|
|
14
|
-
data-zoomable=${
|
|
15
|
-
data-brushing=${
|
|
16
|
-
data-editable=${
|
|
17
|
-
style=${
|
|
14
|
+
data-zoomable=${d||i?"":ye.nothing}
|
|
15
|
+
data-brushing=${m&&!(d||i)?"":ye.nothing}
|
|
16
|
+
data-editable=${c?"":ye.nothing}
|
|
17
|
+
style=${y?`--skdx-chart-duration:${y}`:ye.nothing}
|
|
18
18
|
font-family=${K.fontFamily}
|
|
19
19
|
font-size=${K.fontSize}
|
|
20
|
-
@pointermove=${
|
|
20
|
+
@pointermove=${s.tooltip||h?this.onPointerMove:ye.nothing}
|
|
21
21
|
@pointerleave=${()=>{this.clearTip(),this.highlight(null)}}
|
|
22
|
-
@pointerdown=${
|
|
23
|
-
@pointerup=${
|
|
24
|
-
@pointercancel=${
|
|
25
|
-
@wheel=${
|
|
26
|
-
@dblclick=${
|
|
22
|
+
@pointerdown=${h?this.onPointerDown:ye.nothing}
|
|
23
|
+
@pointerup=${h?this.onPointerUp:ye.nothing}
|
|
24
|
+
@pointercancel=${h?this.onPointerUp:ye.nothing}
|
|
25
|
+
@wheel=${d||i?this.onWheel:ye.nothing}
|
|
26
|
+
@dblclick=${d||i?()=>i?this.setView(void 0):this.setZoom(void 0):ye.nothing}
|
|
27
27
|
@click=${this.onClick}
|
|
28
|
-
@keydown=${
|
|
28
|
+
@keydown=${f?this.onKeyDown:ye.nothing}
|
|
29
29
|
@blur=${()=>{this.focused=null,this.highlight(null)}}
|
|
30
30
|
>
|
|
31
|
-
<title>${
|
|
32
|
-
${
|
|
33
|
-
${
|
|
34
|
-
${
|
|
35
|
-
${
|
|
36
|
-
${
|
|
31
|
+
<title>${o}</title>
|
|
32
|
+
${s.description?ye.svg`<desc>${s.description}</desc>`:ye.nothing}
|
|
33
|
+
${y?ye.svg`<style>${Ca}</style>`:ye.nothing} ${Dl(s)}
|
|
34
|
+
${ro(s.shapes)}
|
|
35
|
+
${ro(this.tip.length||!this.crossState?this.tip:ra(s,this.crossState))}
|
|
36
|
+
${ro(ga(s,this.focused))} ${ro(this.overlay)}
|
|
37
37
|
</svg>
|
|
38
|
-
${
|
|
38
|
+
${w?ye.html`<div
|
|
39
39
|
role="tooltip"
|
|
40
40
|
data-skdx-tooltip=${r}
|
|
41
|
-
style="left:${
|
|
41
|
+
style="left:${w.x+12}px;top:${w.y+12}px"
|
|
42
42
|
>
|
|
43
|
-
${
|
|
43
|
+
${w.lines.map(R=>ye.html`<div>${R}</div>`)}
|
|
44
44
|
</div>`:ye.nothing}
|
|
45
|
-
${
|
|
45
|
+
${$?ye.html`<table data-skdx-table=${r}>
|
|
46
46
|
<caption>
|
|
47
|
-
${
|
|
47
|
+
${b}
|
|
48
48
|
</caption>
|
|
49
49
|
<thead>
|
|
50
50
|
<tr>
|
|
51
|
-
${(
|
|
51
|
+
${($[0]??[]).map(R=>ye.html`<th scope="col">${R}</th>`)}
|
|
52
52
|
</tr>
|
|
53
53
|
</thead>
|
|
54
54
|
<tbody>
|
|
55
|
-
${
|
|
56
|
-
${
|
|
55
|
+
${$.slice(1).map(R=>ye.html`<tr>
|
|
56
|
+
${R.map((k,T)=>T===0?ye.html`<th scope="row">${k}</th>`:ye.html`<td>${k}</td>`)}
|
|
57
57
|
</tr>`)}
|
|
58
58
|
</tbody>
|
|
59
59
|
</table>`:ye.nothing}`}};X.styles=ye.css`
|
|
@@ -109,4 +109,4 @@
|
|
|
109
109
|
[role='tooltip'] > :first-child:not(:only-child) {
|
|
110
110
|
font-weight: bold;
|
|
111
111
|
}
|
|
112
|
-
`,u([(0,ce.property)({type:Number})],X.prototype,"width",2),u([(0,ce.property)({type:Number})],X.prototype,"height",2),u([(0,ce.property)()],X.prototype,"label",2),u([(0,ce.property)({type:Boolean,reflect:!0})],X.prototype,"legend",2),u([(0,ce.property)({type:Boolean,attribute:"no-tooltip",converter:Re})],X.prototype,"tooltip",2),u([(0,ce.property)({attribute:!1})],X.prototype,"format",2),u([(0,ce.property)({attribute:!1})],X.prototype,"palette",2),u([(0,ce.property)({attribute:!1})],X.prototype,"hiddenSeries",2),u([(0,ce.property)({attribute:!1})],X.prototype,"selected",2),u([(0,ce.property)({attribute:"selection-mode"})],X.prototype,"selectionMode",2),u([(0,ce.property)({attribute:!1})],X.prototype,"highlighted",2),u([(0,ce.property)({attribute:!1})],X.prototype,"highlightScope",2),u([(0,ce.property)({type:Boolean,reflect:!0})],X.prototype,"loading",2),u([(0,ce.property)()],X.prototype,"error",2),u([(0,ce.property)({attribute:"empty-message"})],X.prototype,"emptyMessage",2),u([(0,ce.property)()],X.prototype,"description",2),u([(0,ce.property)({type:Boolean,reflect:!0})],X.prototype,"decorative",2),u([(0,ce.property)({type:Boolean,attribute:"accessible-table"})],X.prototype,"accessibleTable",2),u([(0,ce.property)({attribute:!1})],X.prototype,"zoom",2),u([(0,ce.property)({attribute:!1})],X.prototype,"view",2),u([(0,ce.property)({type:Boolean,reflect:!0})],X.prototype,"zoomable",2),u([(0,ce.property)({type:Boolean,reflect:!0})],X.prototype,"editable",2),u([(0,ce.property)({attribute:"sync-id"})],X.prototype,"syncId",2),u([(0,ce.property)({type:Boolean,attribute:"cross-filter"})],X.prototype,"crossFilter",2),u([(0,ce.property)({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],X.prototype,"animated",2),u([(0,ce.property)({type:Boolean,reflect:!0})],X.prototype,"responsive",2),u([(0,ce.state)()],X.prototype,"tip",2),u([(0,ce.state)()],X.prototype,"overlay",2),u([(0,ce.state)()],X.prototype,"portal",2),u([(0,ce.state)()],X.prototype,"measured",2),u([(0,ce.state)()],X.prototype,"viewState",2),u([(0,ce.state)()],X.prototype,"highlightState",2),u([(0,ce.state)()],X.prototype,"crossState",2),u([(0,ce.state)()],X.prototype,"focused",2),u([(0,ce.state)()],X.prototype,"hiddenState",2),u([(0,ce.state)()],X.prototype,"zoomState",2),u([(0,ce.state)()],X.prototype,"selectedState",2);var Ae=class extends X{constructor(){super(...arguments);this.series=[];this.labels=!1;this.connectNulls=!1;this.stacked=!1;this.brush=!1;this.crosshair=!1}input(){let{series:t,categories:r,xAxis:a,yAxis:o,rightAxis:s,references:c,annotations:l,labels:d,curve:m,connectNulls:h,nulls:f,stacked:M,stackOffset:$,orientation:g,radius:w,barGap:R,barWidth:k,sort:T,transform:D,transforms:v,bins:S,binWidth:L,binDomain:E,binMode:z,sampling:O,brush:H,crosshair:b}=this;return{...this.sized(),series:t,categories:r,xAxis:a,yAxis:o,rightAxis:s,references:c,annotations:l,labels:d,curve:m,connectNulls:h,nulls:f,stacked:M,stackOffset:$,orientation:g,radius:w,barGap:R,barWidth:k,sort:T,transform:D,transforms:v,bins:S,binWidth:L,binDomain:E,binMode:z,sampling:O,brush:H,crosshair:b,...this.compactOverrides()}}};u([(0,ce.property)({attribute:!1})],Ae.prototype,"series",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"categories",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"xAxis",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"yAxis",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"rightAxis",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"references",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"annotations",2),u([(0,ce.property)({type:Boolean,reflect:!0})],Ae.prototype,"labels",2),u([(0,ce.property)()],Ae.prototype,"curve",2),u([(0,ce.property)({type:Boolean,attribute:"connect-nulls"})],Ae.prototype,"connectNulls",2),u([(0,ce.property)()],Ae.prototype,"nulls",2),u([(0,ce.property)({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],Ae.prototype,"stacked",2),u([(0,ce.property)({attribute:"stack-offset"})],Ae.prototype,"stackOffset",2),u([(0,ce.property)()],Ae.prototype,"orientation",2),u([(0,ce.property)({type:Number})],Ae.prototype,"radius",2),u([(0,ce.property)({type:Number,attribute:"bar-gap"})],Ae.prototype,"barGap",2),u([(0,ce.property)({type:Number,attribute:"bar-width"})],Ae.prototype,"barWidth",2),u([(0,ce.property)()],Ae.prototype,"sort",2),u([(0,ce.property)()],Ae.prototype,"transform",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"transforms",2),u([(0,ce.property)({type:Number})],Ae.prototype,"bins",2),u([(0,ce.property)({type:Number,attribute:"bin-width"})],Ae.prototype,"binWidth",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"binDomain",2),u([(0,ce.property)({attribute:"bin-mode"})],Ae.prototype,"binMode",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"sampling",2),u([(0,ce.property)({type:Boolean,reflect:!0})],Ae.prototype,"brush",2),u([(0,ce.property)({type:Boolean,reflect:!0})],Ae.prototype,"crosshair",2);var Ol=e=>e.defs&&e.defs.length?ye.svg`<defs>${e.defs.map(n=>ye.svg`<linearGradient id=${n.id} x1="0" y1="0" x2=${n.vertical===!1?1:0} y2=${n.vertical===!1?0:1}>${n.stops.map(t=>ye.svg`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${(0,ze.ifDefined)(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:ye.nothing,ea=e=>ye.svg`${e.map((n,t)=>{let r=n.title?ye.svg`<title>${n.title}</title>`:ye.nothing,a=n.item?t:void 0;switch(n.kind){case"path":return ye.svg`<path data-skdx-part=${n.part} data-skdx-i=${(0,ze.ifDefined)(a)} d=${n.d} fill=${n.fill??"none"} stroke=${(0,ze.ifDefined)(n.stroke)} stroke-width=${(0,ze.ifDefined)(n.strokeWidth)} stroke-linecap=${(0,ze.ifDefined)(n.strokeLinecap)} stroke-linejoin=${(0,ze.ifDefined)(n.strokeLinejoin)} stroke-dasharray=${(0,ze.ifDefined)(n.dash)} opacity=${(0,ze.ifDefined)(n.opacity)} fill-opacity=${(0,ze.ifDefined)(n.fillOpacity)}>${r}</path>`;case"rect":return ye.svg`<rect data-skdx-part=${n.part} data-skdx-i=${(0,ze.ifDefined)(a)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${(0,ze.ifDefined)(n.rx)} style=${(0,ze.ifDefined)(Yr(n.part)?`rx:${Yr(n.part)}`:void 0)} fill=${n.fill} stroke=${(0,ze.ifDefined)(n.stroke)} fill-opacity=${(0,ze.ifDefined)(n.opacity)} pointer-events=${(0,ze.ifDefined)(n.part==="stage-label-background"||n.part==="label-background"?"none":void 0)}>${r}</rect>`;case"line":return ye.svg`<line data-skdx-part=${n.part} data-skdx-i=${(0,ze.ifDefined)(a)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${(0,ze.ifDefined)(n.strokeWidth)} stroke-dasharray=${(0,ze.ifDefined)(n.dash)} opacity=${(0,ze.ifDefined)(n.opacity)}>${r}</line>`;case"circle":return ye.svg`<circle data-skdx-part=${n.part} data-skdx-i=${(0,ze.ifDefined)(a)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${(0,ze.ifDefined)(n.stroke)} opacity=${(0,ze.ifDefined)(n.opacity)}>${r}</circle>`;case"text":return ye.svg`<text aria-label=${(0,ze.ifDefined)(n.title)} data-skdx-part=${n.part} data-skdx-i=${(0,ze.ifDefined)(a)} x=${n.x} y=${n.y} text-anchor=${(0,ze.ifDefined)(n.anchor)} dominant-baseline=${(0,ze.ifDefined)(n.baseline)} fill=${(0,ze.ifDefined)(n.fill)} font-weight=${(0,ze.ifDefined)(n.weight)} pointer-events=${(0,ze.ifDefined)(a===void 0?"none":void 0)} transform=${(0,ze.ifDefined)(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var dr=class extends Ae{render(){return this.root(ka(this.input()),"bar",this.label??"Bar chart")}};dr=u([(0,si.customElement)("skdx-bar-chart")],dr);var ii=require("lit/decorators.js");var mr=class extends Ae{render(){return this.root($a(this.input()),"line",this.label??"Line chart")}};mr=u([(0,ii.customElement)("skdx-line-chart")],mr);var li=require("lit/decorators.js");var ur=class extends Ae{render(){return this.root(Ia(this.input()),"area",this.label??"Area chart")}};ur=u([(0,li.customElement)("skdx-area-chart")],ur);var Ht=require("lit/decorators.js");var lt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,variant:r,innerRadius:a,outerRadius:o,labels:s,labelPosition:c,padAngle:l,sort:d,startAngle:m,endAngle:h,centerLabel:f}=this;return this.root(Sa({...this.sized(),data:t,variant:r,innerRadius:a,outerRadius:o,labels:s,labelPosition:c,padAngle:l,sort:d,startAngle:m,endAngle:h,centerLabel:f,...this.compactOverrides()}),"pie",this.label??"Pie chart")}};u([(0,Ht.property)({attribute:!1})],lt.prototype,"data",2),u([(0,Ht.property)()],lt.prototype,"variant",2),u([(0,Ht.property)({type:Number,attribute:"inner-radius"})],lt.prototype,"innerRadius",2),u([(0,Ht.property)({type:Number,attribute:"outer-radius"})],lt.prototype,"outerRadius",2),u([(0,Ht.property)({type:Boolean,reflect:!0})],lt.prototype,"labels",2),u([(0,Ht.property)({attribute:"label-position"})],lt.prototype,"labelPosition",2),u([(0,Ht.property)({type:Number,attribute:"pad-angle"})],lt.prototype,"padAngle",2),u([(0,Ht.property)()],lt.prototype,"sort",2),u([(0,Ht.property)({type:Number,attribute:"start-angle"})],lt.prototype,"startAngle",2),u([(0,Ht.property)({type:Number,attribute:"end-angle"})],lt.prototype,"endAngle",2),u([(0,Ht.property)({attribute:"center-label"})],lt.prototype,"centerLabel",2),lt=u([(0,Ht.customElement)("skdx-pie-chart")],lt);var pt=require("lit/decorators.js");var Xe=class extends X{constructor(){super(...arguments);this.series=[];this.labels=!1}render(){let{series:t,sizeRange:r,labels:a,xAxis:o,yAxis:s,references:c,annotations:l,colorScale:d,colorLegend:m,hitRadius:h,jitter:f,trendline:M,sampling:$}=this;return this.root(va({...this.sized(),series:t,sizeRange:r,labels:a,xAxis:o,yAxis:s,references:c,annotations:l,colorScale:d,colorLegend:m,hitRadius:h,jitter:f,trendline:M,sampling:$,...this.compactOverrides()}),"scatter",this.label??"Scatter chart")}};u([(0,pt.property)({attribute:!1})],Xe.prototype,"series",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"sizeRange",2),u([(0,pt.property)({type:Boolean,reflect:!0})],Xe.prototype,"labels",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"xAxis",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"yAxis",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"references",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"annotations",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"colorScale",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"colorLegend",2),u([(0,pt.property)({type:Number,attribute:"hit-radius"})],Xe.prototype,"hitRadius",2),u([(0,pt.property)({type:Number})],Xe.prototype,"jitter",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"trendline",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"sampling",2),Xe=u([(0,pt.customElement)("skdx-scatter-chart")],Xe);var Zt=require("lit/decorators.js");var bt=class extends X{constructor(){super(...arguments);this.data=[];this.trend=!1;this.extremes=!1;this.lastValue=!1}render(){let{data:t,color:r,curve:a,variant:o,trend:s,extremes:c,lastValue:l,target:d,band:m,markers:h}=this;return this.root(za({...this.sized(),data:t,color:r,curve:a,variant:o,trend:s,extremes:c,lastValue:l,target:d,band:m,markers:h,...this.compactOverrides()}),"sparkline",this.label??"Sparkline")}};u([(0,Zt.property)({attribute:!1})],bt.prototype,"data",2),u([(0,Zt.property)()],bt.prototype,"color",2),u([(0,Zt.property)()],bt.prototype,"curve",2),u([(0,Zt.property)()],bt.prototype,"variant",2),u([(0,Zt.property)({type:Boolean,reflect:!0})],bt.prototype,"trend",2),u([(0,Zt.property)({type:Boolean,reflect:!0})],bt.prototype,"extremes",2),u([(0,Zt.property)({type:Boolean,reflect:!0,attribute:"last-value"})],bt.prototype,"lastValue",2),u([(0,Zt.property)({type:Number})],bt.prototype,"target",2),u([(0,Zt.property)({attribute:!1})],bt.prototype,"band",2),u([(0,Zt.property)({attribute:!1})],bt.prototype,"markers",2),bt=u([(0,Zt.customElement)("skdx-sparkline")],bt);var It=require("lit/decorators.js");var nt=class extends X{constructor(){super(...arguments);this.series=[];this.fill=!0;this.markers=!0;this.labels=!1}render(){let{series:t,categories:r,metrics:a,normalized:o,max:s,fill:c,levels:l,markers:d,markerSize:m,labels:h,startAngle:f,gridShape:M}=this;return this.root(Na({...this.sized(),series:t,categories:r,metrics:a,normalize:o,max:s,fill:c,levels:l,markers:d,markerSize:m,labels:h,startAngle:f,gridShape:M,...this.compactOverrides()}),"radar",this.label??"Radar chart")}};u([(0,It.property)({attribute:!1})],nt.prototype,"series",2),u([(0,It.property)({attribute:!1})],nt.prototype,"categories",2),u([(0,It.property)({attribute:!1})],nt.prototype,"metrics",2),u([(0,It.property)({attribute:!1})],nt.prototype,"normalized",2),u([(0,It.property)({type:Number})],nt.prototype,"max",2),u([(0,It.property)({type:Boolean,attribute:"no-fill",converter:Re})],nt.prototype,"fill",2),u([(0,It.property)({type:Number})],nt.prototype,"levels",2),u([(0,It.property)({type:Boolean,attribute:"no-markers",converter:Re})],nt.prototype,"markers",2),u([(0,It.property)({type:Number,attribute:"marker-size"})],nt.prototype,"markerSize",2),u([(0,It.property)({type:Boolean,reflect:!0})],nt.prototype,"labels",2),u([(0,It.property)({type:Number,attribute:"start-angle"})],nt.prototype,"startAngle",2),u([(0,It.property)({attribute:"grid-shape"})],nt.prototype,"gridShape",2),nt=u([(0,It.customElement)("skdx-radar-chart")],nt);var We=require("lit/decorators.js");var He=class extends X{constructor(){super(...arguments);this.diverging=!1;this.labels=!1}render(){let{rows:t,columns:r,data:a,calendar:o,color:s,diverging:c,negativeColor:l,labels:d,domain:m,steps:h,weekStart:f,colorScale:M,colorLegend:$,missingColor:g,cellGap:w,cellRadius:R,rowOrder:k,columnOrder:T}=this;return this.root(Da({...this.sized(),rows:t,columns:r,data:a,calendar:o,color:s,diverging:c,negativeColor:l,labels:d,domain:m,steps:h,weekStart:f,colorScale:M,colorLegend:$,missingColor:g,cellGap:w,cellRadius:R,rowOrder:k,columnOrder:T,...this.compactOverrides()}),"heatmap",this.label??"Heatmap")}};u([(0,We.property)({attribute:!1})],He.prototype,"rows",2),u([(0,We.property)({attribute:!1})],He.prototype,"columns",2),u([(0,We.property)({attribute:!1})],He.prototype,"data",2),u([(0,We.property)({attribute:!1})],He.prototype,"calendar",2),u([(0,We.property)()],He.prototype,"color",2),u([(0,We.property)({type:Boolean,reflect:!0})],He.prototype,"diverging",2),u([(0,We.property)({attribute:"negative-color"})],He.prototype,"negativeColor",2),u([(0,We.property)({type:Boolean,reflect:!0})],He.prototype,"labels",2),u([(0,We.property)({attribute:!1})],He.prototype,"domain",2),u([(0,We.property)({type:Number})],He.prototype,"steps",2),u([(0,We.property)({attribute:"week-start"})],He.prototype,"weekStart",2),u([(0,We.property)({attribute:!1})],He.prototype,"colorScale",2),u([(0,We.property)({attribute:!1})],He.prototype,"colorLegend",2),u([(0,We.property)({attribute:"missing-color"})],He.prototype,"missingColor",2),u([(0,We.property)({type:Number,attribute:"cell-gap"})],He.prototype,"cellGap",2),u([(0,We.property)({type:Number,attribute:"cell-radius"})],He.prototype,"cellRadius",2),u([(0,We.property)({attribute:"row-order"})],He.prototype,"rowOrder",2),u([(0,We.property)({attribute:"column-order"})],He.prototype,"columnOrder",2),He=u([(0,We.customElement)("skdx-heatmap")],He);var On=require("lit/decorators.js");var Jt=class extends X{constructor(){super(...arguments);this.data=[]}render(){let{data:t,orientation:r,variant:a,gap:o,labelPosition:s,sort:c}=this;return this.root(Ba({...this.sized(),data:t,orientation:r,variant:a,gap:o,labelPosition:s,sort:c,...this.compactOverrides()}),"funnel",this.label??"Funnel chart")}};u([(0,On.property)({attribute:!1})],Jt.prototype,"data",2),u([(0,On.property)()],Jt.prototype,"orientation",2),u([(0,On.property)()],Jt.prototype,"variant",2),u([(0,On.property)({type:Number})],Jt.prototype,"gap",2),u([(0,On.property)({attribute:"label-position"})],Jt.prototype,"labelPosition",2),u([(0,On.property)()],Jt.prototype,"sort",2),Jt=u([(0,On.customElement)("skdx-funnel-chart")],Jt);var Ut=require("lit/decorators.js");var gt=class extends X{constructor(){super(...arguments);this.links=[];this.nodeLabels=!0;this.linkLabels=!1}render(){let{links:t,nodes:r,align:a,nodeWidth:o,nodePadding:s,nodeSort:c,linkSort:l,nodeLabels:d,linkLabels:m,cyclePolicy:h}=this;return this.root($o({...this.sized(),links:t,nodes:r,align:a,nodeWidth:o,nodePadding:s,nodeSort:c,linkSort:l,nodeLabels:d,linkLabels:m,cyclePolicy:h,...this.compactOverrides()}),"sankey",this.label??"Sankey chart")}};u([(0,Ut.property)({attribute:!1})],gt.prototype,"links",2),u([(0,Ut.property)({attribute:!1})],gt.prototype,"nodes",2),u([(0,Ut.property)()],gt.prototype,"align",2),u([(0,Ut.property)({type:Number,attribute:"node-width"})],gt.prototype,"nodeWidth",2),u([(0,Ut.property)({type:Number,attribute:"node-padding"})],gt.prototype,"nodePadding",2),u([(0,Ut.property)({attribute:"node-sort"})],gt.prototype,"nodeSort",2),u([(0,Ut.property)({attribute:"link-sort"})],gt.prototype,"linkSort",2),u([(0,Ut.property)({type:Boolean,attribute:"no-node-labels",converter:Re})],gt.prototype,"nodeLabels",2),u([(0,Ut.property)({type:Boolean,reflect:!0,attribute:"link-labels"})],gt.prototype,"linkLabels",2),u([(0,Ut.property)({attribute:"cycle-policy"})],gt.prototype,"cyclePolicy",2),gt=u([(0,Ut.customElement)("skdx-sankey-chart")],gt);var en=require("lit/decorators.js");var Tt=class extends X{constructor(){super(...arguments);this.data=[];this.breadcrumbs=!1;this.labels=!0}render(){let{data:t,rootId:r,breadcrumbs:a,maxDepth:o,sort:s,padding:c,tiling:l,colorScale:d,labels:m}=this;return this.root(To({...this.sized(),data:t,rootId:r,breadcrumbs:a,maxDepth:o,sort:s,padding:c,tiling:l,colorScale:d,labels:m,...this.compactOverrides()}),"treemap",this.label??"Treemap")}};u([(0,en.property)({attribute:!1})],Tt.prototype,"data",2),u([(0,en.property)({attribute:!1})],Tt.prototype,"rootId",2),u([(0,en.property)({type:Boolean,reflect:!0})],Tt.prototype,"breadcrumbs",2),u([(0,en.property)({type:Number,attribute:"max-depth"})],Tt.prototype,"maxDepth",2),u([(0,en.property)()],Tt.prototype,"sort",2),u([(0,en.property)({type:Number})],Tt.prototype,"padding",2),u([(0,en.property)()],Tt.prototype,"tiling",2),u([(0,en.property)({attribute:!1})],Tt.prototype,"colorScale",2),u([(0,en.property)({type:Boolean,attribute:"no-labels",converter:Re})],Tt.prototype,"labels",2),Tt=u([(0,en.customElement)("skdx-treemap")],Tt);var xt=require("lit/decorators.js");var Qe=class extends X{constructor(){super(...arguments);this.data=[];this.brush=!1;this.crosshair=!1}render(){let{data:t,scale:r,variant:a,xAxis:o,yAxis:s,volumeFormat:c,references:l,annotations:d,overlays:m,upColor:h,downColor:f,brush:M,crosshair:$}=this;return this.root(Ao({...this.sized(),data:t,scale:r,variant:a,xAxis:o,yAxis:s,volumeFormat:c,references:l,annotations:d,overlays:m,upColor:h,downColor:f,brush:M,crosshair:$,...this.compactOverrides()}),"candlestick",this.label??"Candlestick chart")}};u([(0,xt.property)({attribute:!1})],Qe.prototype,"data",2),u([(0,xt.property)()],Qe.prototype,"scale",2),u([(0,xt.property)()],Qe.prototype,"variant",2),u([(0,xt.property)({attribute:!1})],Qe.prototype,"xAxis",2),u([(0,xt.property)({attribute:!1})],Qe.prototype,"yAxis",2),u([(0,xt.property)({attribute:!1})],Qe.prototype,"volumeFormat",2),u([(0,xt.property)({attribute:!1})],Qe.prototype,"references",2),u([(0,xt.property)({attribute:!1})],Qe.prototype,"annotations",2),u([(0,xt.property)({attribute:!1})],Qe.prototype,"overlays",2),u([(0,xt.property)({attribute:"up-color"})],Qe.prototype,"upColor",2),u([(0,xt.property)({attribute:"down-color"})],Qe.prototype,"downColor",2),u([(0,xt.property)({type:Boolean,reflect:!0})],Qe.prototype,"brush",2),u([(0,xt.property)({type:Boolean,reflect:!0})],Qe.prototype,"crosshair",2),Qe=u([(0,xt.customElement)("skdx-candlestick-chart")],Qe);var Yt=require("lit/decorators.js");var yt=class extends X{constructor(){super(...arguments);this.data=[];this.connectors=!0;this.labels=!1}render(){let{data:t,total:r,start:a,startLabel:o,orientation:s,connectors:c,labels:l,positiveColor:d,negativeColor:m,totalColor:h}=this;return this.root(Co({...this.sized(),data:t,total:r,start:a,startLabel:o,orientation:s,connectors:c,labels:l,positiveColor:d,negativeColor:m,totalColor:h,...this.compactOverrides()}),"waterfall",this.label??"Waterfall chart")}};u([(0,Yt.property)({attribute:!1})],yt.prototype,"data",2),u([(0,Yt.property)()],yt.prototype,"total",2),u([(0,Yt.property)({type:Number})],yt.prototype,"start",2),u([(0,Yt.property)({attribute:"start-label"})],yt.prototype,"startLabel",2),u([(0,Yt.property)()],yt.prototype,"orientation",2),u([(0,Yt.property)({type:Boolean,attribute:"no-connectors",converter:Re})],yt.prototype,"connectors",2),u([(0,Yt.property)({type:Boolean,reflect:!0})],yt.prototype,"labels",2),u([(0,Yt.property)({attribute:"positive-color"})],yt.prototype,"positiveColor",2),u([(0,Yt.property)({attribute:"negative-color"})],yt.prototype,"negativeColor",2),u([(0,Yt.property)({attribute:"total-color"})],yt.prototype,"totalColor",2),yt=u([(0,Yt.customElement)("skdx-waterfall-chart")],yt);var Ln=require("lit/decorators.js");var tn=class extends X{constructor(){super(...arguments);this.tasks=[];this.criticalPath=!1}render(){let{tasks:t,references:r,annotations:a,today:o,criticalPath:s,xAxis:c}=this;return this.root(Oo({...this.sized(),tasks:t,references:r,annotations:a,today:o,criticalPath:s,xAxis:c,...this.compactOverrides()}),"gantt",this.label??"Gantt chart")}};u([(0,Ln.property)({attribute:!1})],tn.prototype,"tasks",2),u([(0,Ln.property)({attribute:!1})],tn.prototype,"references",2),u([(0,Ln.property)({attribute:!1})],tn.prototype,"annotations",2),u([(0,Ln.property)({attribute:!1})],tn.prototype,"today",2),u([(0,Ln.property)({type:Boolean,reflect:!0,attribute:"critical-path"})],tn.prototype,"criticalPath",2),u([(0,Ln.property)({attribute:!1})],tn.prototype,"xAxis",2),tn=u([(0,Ln.customElement)("skdx-gantt-chart")],tn);var nn=require("lit/decorators.js");var At=class extends X{constructor(){super(...arguments);this.series=[];this.mean=!1;this.points=!1;this.notched=!1}render(){let{series:t,orientation:r,quartileMethod:a,whisker:o,mean:s,points:c,notched:l,categories:d,yAxis:m}=this;return this.root(So({...this.sized(),series:t,orientation:r,quartileMethod:a,whisker:o,mean:s,points:c,notched:l,categories:d,yAxis:m,...this.compactOverrides()}),"boxplot",this.label??"Box plot")}};u([(0,nn.property)({attribute:!1})],At.prototype,"series",2),u([(0,nn.property)()],At.prototype,"orientation",2),u([(0,nn.property)({attribute:"quartile-method"})],At.prototype,"quartileMethod",2),u([(0,nn.property)({type:Number})],At.prototype,"whisker",2),u([(0,nn.property)({type:Boolean,reflect:!0})],At.prototype,"mean",2),u([(0,nn.property)({type:Boolean,reflect:!0})],At.prototype,"points",2),u([(0,nn.property)({type:Boolean,reflect:!0})],At.prototype,"notched",2),u([(0,nn.property)({attribute:!1})],At.prototype,"categories",2),u([(0,nn.property)({attribute:!1})],At.prototype,"yAxis",2),At=u([(0,nn.customElement)("skdx-boxplot")],At);var Ct=require("lit/decorators.js");var rt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1;this.breadcrumbs=!1}render(){let{data:t,innerRadius:r,centerLabel:a,labels:o,rootId:s,breadcrumbs:c,maxDepth:l,sort:d,startAngle:m,endAngle:h,padAngle:f,colorScale:M}=this;return this.root(No({...this.sized(),data:t,innerRadius:r,centerLabel:a,labels:o,rootId:s,breadcrumbs:c,maxDepth:l,sort:d,startAngle:m,endAngle:h,padAngle:f,colorScale:M,...this.compactOverrides()}),"sunburst",this.label??"Sunburst chart")}};u([(0,Ct.property)({attribute:!1})],rt.prototype,"data",2),u([(0,Ct.property)({type:Number,attribute:"inner-radius"})],rt.prototype,"innerRadius",2),u([(0,Ct.property)({attribute:"center-label"})],rt.prototype,"centerLabel",2),u([(0,Ct.property)({type:Boolean,reflect:!0})],rt.prototype,"labels",2),u([(0,Ct.property)({attribute:!1})],rt.prototype,"rootId",2),u([(0,Ct.property)({type:Boolean,reflect:!0})],rt.prototype,"breadcrumbs",2),u([(0,Ct.property)({type:Number,attribute:"max-depth"})],rt.prototype,"maxDepth",2),u([(0,Ct.property)()],rt.prototype,"sort",2),u([(0,Ct.property)({type:Number,attribute:"start-angle"})],rt.prototype,"startAngle",2),u([(0,Ct.property)({type:Number,attribute:"end-angle"})],rt.prototype,"endAngle",2),u([(0,Ct.property)({type:Number,attribute:"pad-angle"})],rt.prototype,"padAngle",2),u([(0,Ct.property)({attribute:!1})],rt.prototype,"colorScale",2),rt=u([(0,Ct.customElement)("skdx-sunburst-chart")],rt);var _n=require("lit/decorators.js");var pn=class extends X{render(){let{names:n,matrix:t,links:r,padding:a,sort:o}=this;return this.root(Ro({...this.sized(),names:n,matrix:t,links:r,padding:a,sort:o,...this.compactOverrides()}),"chord",this.label??"Chord chart")}};u([(0,_n.property)({attribute:!1})],pn.prototype,"names",2),u([(0,_n.property)({attribute:!1})],pn.prototype,"matrix",2),u([(0,_n.property)({attribute:!1})],pn.prototype,"links",2),u([(0,_n.property)({type:Number})],pn.prototype,"padding",2),u([(0,_n.property)()],pn.prototype,"sort",2),pn=u([(0,_n.customElement)("skdx-chord-chart")],pn);var rn=require("lit/decorators.js");var Ot=class extends X{constructor(){super(...arguments);this.features=[];this.labels=!1}render(){let{features:t,color:r,colorScale:a,colorLegend:o,projection:s,points:c,lines:l,sizeRange:d,labels:m}=this;return this.root(Do({...this.sized(),features:t,color:r,colorScale:a,colorLegend:o,projection:s,points:c,lines:l,sizeRange:d,labels:m,...this.compactOverrides()}),"map",this.label??"Map")}};u([(0,rn.property)({attribute:!1})],Ot.prototype,"features",2),u([(0,rn.property)()],Ot.prototype,"color",2),u([(0,rn.property)({attribute:!1})],Ot.prototype,"colorScale",2),u([(0,rn.property)({attribute:!1})],Ot.prototype,"colorLegend",2),u([(0,rn.property)()],Ot.prototype,"projection",2),u([(0,rn.property)({attribute:!1})],Ot.prototype,"points",2),u([(0,rn.property)({attribute:!1})],Ot.prototype,"lines",2),u([(0,rn.property)({attribute:!1})],Ot.prototype,"sizeRange",2),u([(0,rn.property)({type:Boolean,reflect:!0})],Ot.prototype,"labels",2),Ot=u([(0,rn.customElement)("skdx-map-chart")],Ot);var Lt=require("lit/decorators.js");var at=class extends X{constructor(){super(...arguments);this.data=[];this.track=!0;this.rounded=!0;this.labels=!1}render(){let{data:t,max:r,startAngle:a,endAngle:o,innerRadius:s,gap:c,track:l,rounded:d,labels:m,bands:h,target:f,centerLabel:M}=this;return this.root(Fa({...this.sized(),data:t,max:r,startAngle:a,endAngle:o,innerRadius:s,gap:c,track:l,rounded:d,labels:m,bands:h,target:f,centerLabel:M,...this.compactOverrides()}),"radial",this.label??"Radial bar chart")}};u([(0,Lt.property)({attribute:!1})],at.prototype,"data",2),u([(0,Lt.property)({type:Number})],at.prototype,"max",2),u([(0,Lt.property)({type:Number,attribute:"start-angle"})],at.prototype,"startAngle",2),u([(0,Lt.property)({type:Number,attribute:"end-angle"})],at.prototype,"endAngle",2),u([(0,Lt.property)({type:Number,attribute:"inner-radius"})],at.prototype,"innerRadius",2),u([(0,Lt.property)({type:Number})],at.prototype,"gap",2),u([(0,Lt.property)({type:Boolean,attribute:"no-track",converter:Re})],at.prototype,"track",2),u([(0,Lt.property)({type:Boolean,attribute:"no-rounded",converter:Re})],at.prototype,"rounded",2),u([(0,Lt.property)({type:Boolean,reflect:!0})],at.prototype,"labels",2),u([(0,Lt.property)({attribute:!1})],at.prototype,"bands",2),u([(0,Lt.property)({type:Number})],at.prototype,"target",2),u([(0,Lt.property)({attribute:"center-label"})],at.prototype,"centerLabel",2),at=u([(0,Lt.customElement)("skdx-radial-bar-chart")],at);var vt=require("lit/decorators.js");var Je=class extends X{constructor(){super(...arguments);this.value=Number.NaN;this.tickLabels=!0}render(){let{value:t,min:r,max:a,variant:o,startAngle:s,endAngle:c,thickness:l,bands:d,target:m,ticks:h,tickLabels:f,centerLabel:M,caption:$}=this;return this.root(Pa({...this.sized(),value:t,min:r,max:a,variant:o,startAngle:s,endAngle:c,thickness:l,bands:d,target:m,ticks:h,tickLabels:f,centerLabel:M,caption:$,...this.compactOverrides()}),"gauge",this.label??"Gauge chart")}};u([(0,vt.property)({type:Number})],Je.prototype,"value",2),u([(0,vt.property)({type:Number})],Je.prototype,"min",2),u([(0,vt.property)({type:Number})],Je.prototype,"max",2),u([(0,vt.property)()],Je.prototype,"variant",2),u([(0,vt.property)({type:Number,attribute:"start-angle"})],Je.prototype,"startAngle",2),u([(0,vt.property)({type:Number,attribute:"end-angle"})],Je.prototype,"endAngle",2),u([(0,vt.property)({type:Number})],Je.prototype,"thickness",2),u([(0,vt.property)({attribute:!1})],Je.prototype,"bands",2),u([(0,vt.property)({type:Number})],Je.prototype,"target",2),u([(0,vt.property)({attribute:!1})],Je.prototype,"ticks",2),u([(0,vt.property)({type:Boolean,attribute:"no-tick-labels",converter:Re})],Je.prototype,"tickLabels",2),u([(0,vt.property)({attribute:"center-label"})],Je.prototype,"centerLabel",2),u([(0,vt.property)()],Je.prototype,"caption",2),Je=u([(0,vt.customElement)("skdx-gauge-chart")],Je);var ct=require("lit/decorators.js");var Ue=class extends X{constructor(){super(...arguments);this.series=[];this.labels=!1}render(){let{series:t,sizeRange:r,labels:a,xAxis:o,yAxis:s,zAxis:c,references:l,annotations:d,colorScale:m,colorLegend:h,hitRadius:f,jitter:M,trendline:$,sampling:g}=this;return this.root(Ha({...this.sized(),series:t,sizeRange:r,labels:a,xAxis:o,yAxis:s,zAxis:c,references:l,annotations:d,colorScale:m,colorLegend:h,hitRadius:f,jitter:M,trendline:$,sampling:g,...this.compactOverrides()}),"bubble",this.label??"Bubble chart")}};u([(0,ct.property)({attribute:!1})],Ue.prototype,"series",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"sizeRange",2),u([(0,ct.property)({type:Boolean,reflect:!0})],Ue.prototype,"labels",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"xAxis",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"yAxis",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"zAxis",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"references",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"annotations",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"colorScale",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"colorLegend",2),u([(0,ct.property)({type:Number,attribute:"hit-radius"})],Ue.prototype,"hitRadius",2),u([(0,ct.property)({type:Number})],Ue.prototype,"jitter",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"trendline",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"sampling",2),Ue=u([(0,ct.customElement)("skdx-bubble-chart")],Ue);var dt=require("lit/decorators.js");var Ye=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,name:r,color:a,bins:o,binWidth:s,thresholds:c,domain:l,mode:d,xAxis:m,yAxis:h,references:f,annotations:M,labels:$,barGap:g}=this;return this.root(Va({...this.sized(),data:t,name:r,color:a,bins:o,binWidth:s,thresholds:c,domain:l,mode:d,xAxis:m,yAxis:h,references:f,annotations:M,labels:$,barGap:g,...this.compactOverrides()}),"histogram",this.label??"Histogram")}};u([(0,dt.property)({attribute:!1})],Ye.prototype,"data",2),u([(0,dt.property)()],Ye.prototype,"name",2),u([(0,dt.property)()],Ye.prototype,"color",2),u([(0,dt.property)({type:Number})],Ye.prototype,"bins",2),u([(0,dt.property)({type:Number,attribute:"bin-width"})],Ye.prototype,"binWidth",2),u([(0,dt.property)({attribute:!1})],Ye.prototype,"thresholds",2),u([(0,dt.property)({attribute:!1})],Ye.prototype,"domain",2),u([(0,dt.property)()],Ye.prototype,"mode",2),u([(0,dt.property)({attribute:!1})],Ye.prototype,"xAxis",2),u([(0,dt.property)({attribute:!1})],Ye.prototype,"yAxis",2),u([(0,dt.property)({attribute:!1})],Ye.prototype,"references",2),u([(0,dt.property)({attribute:!1})],Ye.prototype,"annotations",2),u([(0,dt.property)({type:Boolean,reflect:!0})],Ye.prototype,"labels",2),u([(0,dt.property)({type:Number,attribute:"bar-gap"})],Ye.prototype,"barGap",2),Ye=u([(0,dt.customElement)("skdx-histogram")],Ye);var In=require("lit/decorators.js");var Kt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,orientation:r,ranges:a,min:o,max:s,labels:c,ticks:l}=this;return this.root(Ir({...this.sized(),data:t,orientation:r,ranges:a,min:o,max:s,labels:c,ticks:l,...this.compactOverrides()}),"bullet",this.label??"Bullet chart")}};u([(0,In.property)({attribute:!1})],Kt.prototype,"data",2),u([(0,In.property)()],Kt.prototype,"orientation",2),u([(0,In.property)({attribute:!1})],Kt.prototype,"ranges",2),u([(0,In.property)({type:Number})],Kt.prototype,"min",2),u([(0,In.property)({type:Number})],Kt.prototype,"max",2),u([(0,In.property)({type:Boolean,reflect:!0})],Kt.prototype,"labels",2),u([(0,In.property)({type:Number})],Kt.prototype,"ticks",2),Kt=u([(0,In.customElement)("skdx-bullet-chart")],Kt);var ci=require("lit/decorators.js");var hr=class extends Ae{render(){return this.root(_a(this.input()),"combo",this.label??"Combo chart")}};hr=u([(0,ci.customElement)("skdx-combo-chart")],hr);var et=require("lit/decorators.js");var _e=class extends X{constructor(){super(...arguments);this.series=[];this.connectNulls=!1;this.brush=!1;this.crosshair=!1}render(){let{series:t,variant:r,categories:a,xAxis:o,yAxis:s,rightAxis:c,references:l,annotations:d,curve:m,connectNulls:h,orientation:f,radius:M,barGap:$,barWidth:g,brush:w,crosshair:R}=this;return this.root(ja({...this.sized(),series:t,variant:r,categories:a,xAxis:o,yAxis:s,rightAxis:c,references:l,annotations:d,curve:m,connectNulls:h,orientation:f,radius:M,barGap:$,barWidth:g,brush:w,crosshair:R,...this.compactOverrides()}),"range",this.label??"Range chart")}};u([(0,et.property)({attribute:!1})],_e.prototype,"series",2),u([(0,et.property)()],_e.prototype,"variant",2),u([(0,et.property)({attribute:!1})],_e.prototype,"categories",2),u([(0,et.property)({attribute:!1})],_e.prototype,"xAxis",2),u([(0,et.property)({attribute:!1})],_e.prototype,"yAxis",2),u([(0,et.property)({attribute:!1})],_e.prototype,"rightAxis",2),u([(0,et.property)({attribute:!1})],_e.prototype,"references",2),u([(0,et.property)({attribute:!1})],_e.prototype,"annotations",2),u([(0,et.property)()],_e.prototype,"curve",2),u([(0,et.property)({type:Boolean,reflect:!0,attribute:"connect-nulls"})],_e.prototype,"connectNulls",2),u([(0,et.property)()],_e.prototype,"orientation",2),u([(0,et.property)({type:Number})],_e.prototype,"radius",2),u([(0,et.property)({type:Number,attribute:"bar-gap"})],_e.prototype,"barGap",2),u([(0,et.property)({type:Number,attribute:"bar-width"})],_e.prototype,"barWidth",2),u([(0,et.property)({type:Boolean,reflect:!0})],_e.prototype,"brush",2),u([(0,et.property)({type:Boolean,reflect:!0})],_e.prototype,"crosshair",2),_e=u([(0,et.customElement)("skdx-range-chart")],_e);var bn=require("lit/decorators.js");var Vt=class extends X{constructor(){super(...arguments);this.nodes=[];this.edges=[];this.labels=!0;this.directed=!1;this.edgeLabels=!1}render(){let{nodes:t,edges:r,arrange:a,labels:o,nodeRange:s,iterations:c,directed:l,edgeLabels:d}=this;return this.root(Ga({...this.sized(),nodes:t,edges:r,arrange:a,labels:o,nodeRange:s,iterations:c,directed:l,edgeLabels:d,...this.compactOverrides()}),"network",this.label??"Network chart")}};u([(0,bn.property)({attribute:!1})],Vt.prototype,"nodes",2),u([(0,bn.property)({attribute:!1})],Vt.prototype,"edges",2),u([(0,bn.property)()],Vt.prototype,"arrange",2),u([(0,bn.property)({type:Boolean,attribute:"no-labels",converter:Re})],Vt.prototype,"labels",2),u([(0,bn.property)({attribute:!1})],Vt.prototype,"nodeRange",2),u([(0,bn.property)({type:Number})],Vt.prototype,"iterations",2),u([(0,bn.property)({type:Boolean,reflect:!0})],Vt.prototype,"directed",2),u([(0,bn.property)({type:Boolean,reflect:!0,attribute:"edge-labels"})],Vt.prototype,"edgeLabels",2),Vt=u([(0,bn.customElement)("skdx-network-chart")],Vt);var Kn=require("lit/decorators.js");var Tn=class extends X{constructor(){super(...arguments);this.events=[];this.labels=!0}render(){let{events:t,orientation:r,xAxis:a,labels:o}=this;return this.root(qa({...this.sized(),events:t,orientation:r,xAxis:a,labels:o,...this.compactOverrides()}),"timeline",this.label??"Timeline chart")}};u([(0,Kn.property)({attribute:!1})],Tn.prototype,"events",2),u([(0,Kn.property)()],Tn.prototype,"orientation",2),u([(0,Kn.property)({attribute:!1})],Tn.prototype,"xAxis",2),u([(0,Kn.property)({type:Boolean,attribute:"no-labels",converter:Re})],Tn.prototype,"labels",2),Tn=u([(0,Kn.customElement)("skdx-timeline-chart")],Tn);var jn=require("lit/decorators.js");var gn=class extends X{constructor(){super(...arguments);this.segments=[];this.data=[];this.labels=!1}render(){let{segments:t,data:r,labels:a,gap:o,xAxis:s}=this;return this.root(Bo({...this.sized(),segments:t,data:r,labels:a,gap:o,xAxis:s,...this.compactOverrides()}),"marimekko",this.label??"Marimekko chart")}};u([(0,jn.property)({attribute:!1})],gn.prototype,"segments",2),u([(0,jn.property)({attribute:!1})],gn.prototype,"data",2),u([(0,jn.property)({type:Boolean,reflect:!0})],gn.prototype,"labels",2),u([(0,jn.property)({type:Number})],gn.prototype,"gap",2),u([(0,jn.property)({attribute:!1})],gn.prototype,"xAxis",2),gn=u([(0,jn.customElement)("skdx-marimekko-chart")],gn);var Sn=require("lit/decorators.js");var an=class extends X{constructor(){super(...arguments);this.dimensions=[];this.data=[];this.connectNulls=!1}render(){let{dimensions:t,data:r,opacity:a,curve:o,connectNulls:s,filters:c}=this;return this.root(Fo({...this.sized(),dimensions:t,data:r,opacity:a,curve:o,connectNulls:s,filters:c,...this.compactOverrides()}),"parallel",this.label??"Parallel coordinates chart")}};u([(0,Sn.property)({attribute:!1})],an.prototype,"dimensions",2),u([(0,Sn.property)({attribute:!1})],an.prototype,"data",2),u([(0,Sn.property)({type:Number})],an.prototype,"opacity",2),u([(0,Sn.property)()],an.prototype,"curve",2),u([(0,Sn.property)({type:Boolean,reflect:!0,attribute:"connect-nulls"})],an.prototype,"connectNulls",2),u([(0,Sn.property)({attribute:!1})],an.prototype,"filters",2),an=u([(0,Sn.customElement)("skdx-parallel-coordinates-chart")],an);var on=require("lit/decorators.js");var St=class extends X{constructor(){super(...arguments);this.value=Number.NaN;this.labels=!0}render(){let{value:t,min:r,max:a,target:o,bands:s,orientation:c,caption:l,labels:d,ticks:m}=this;return this.root(Po({...this.sized(),value:t,min:r,max:a,target:o,bands:s,orientation:c,caption:l,labels:d,ticks:m,...this.compactOverrides()}),"linear-gauge",this.label??"Linear gauge")}};u([(0,on.property)({type:Number})],St.prototype,"value",2),u([(0,on.property)({type:Number})],St.prototype,"min",2),u([(0,on.property)({type:Number})],St.prototype,"max",2),u([(0,on.property)({type:Number})],St.prototype,"target",2),u([(0,on.property)({attribute:!1})],St.prototype,"bands",2),u([(0,on.property)()],St.prototype,"orientation",2),u([(0,on.property)()],St.prototype,"caption",2),u([(0,on.property)({type:Boolean,attribute:"no-labels",converter:Re})],St.prototype,"labels",2),u([(0,on.property)({type:Number})],St.prototype,"ticks",2),St=u([(0,on.customElement)("skdx-linear-gauge")],St);var sn=require("lit/decorators.js");var zt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,startLabel:r,endLabel:a,orientation:o,labels:s,sort:c,markerSize:l,xAxis:d,references:m}=this;return this.root(Ho({...this.sized(),data:t,startLabel:r,endLabel:a,orientation:o,labels:s,sort:c,markerSize:l,xAxis:d,references:m,...this.compactOverrides()}),"dumbbell",this.label??"Dumbbell chart")}};u([(0,sn.property)({attribute:!1})],zt.prototype,"data",2),u([(0,sn.property)({attribute:"start-label"})],zt.prototype,"startLabel",2),u([(0,sn.property)({attribute:"end-label"})],zt.prototype,"endLabel",2),u([(0,sn.property)()],zt.prototype,"orientation",2),u([(0,sn.property)({type:Boolean,reflect:!0})],zt.prototype,"labels",2),u([(0,sn.property)()],zt.prototype,"sort",2),u([(0,sn.property)({type:Number,attribute:"marker-size"})],zt.prototype,"markerSize",2),u([(0,sn.property)({attribute:!1})],zt.prototype,"xAxis",2),u([(0,sn.property)({attribute:!1})],zt.prototype,"references",2),zt=u([(0,sn.customElement)("skdx-dumbbell-chart")],zt);var Nt=require("lit/decorators.js");var ot=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1;this.brush=!1;this.crosshair=!1}render(){let{data:t,threshold:r,cumulativeLabel:a,name:o,labels:s,radius:c,barGap:l,barWidth:d,xAxis:m,yAxis:h,brush:f,crosshair:M}=this;return this.root(Vo({...this.sized(),data:t,threshold:r,cumulativeLabel:a,name:o,labels:s,radius:c,barGap:l,barWidth:d,xAxis:m,yAxis:h,brush:f,crosshair:M,...this.compactOverrides()}),"pareto",this.label??"Pareto chart")}};u([(0,Nt.property)({attribute:!1})],ot.prototype,"data",2),u([(0,Nt.property)({type:Number})],ot.prototype,"threshold",2),u([(0,Nt.property)({attribute:"cumulative-label"})],ot.prototype,"cumulativeLabel",2),u([(0,Nt.property)()],ot.prototype,"name",2),u([(0,Nt.property)({type:Boolean,reflect:!0})],ot.prototype,"labels",2),u([(0,Nt.property)({type:Number})],ot.prototype,"radius",2),u([(0,Nt.property)({type:Number,attribute:"bar-gap"})],ot.prototype,"barGap",2),u([(0,Nt.property)({type:Number,attribute:"bar-width"})],ot.prototype,"barWidth",2),u([(0,Nt.property)({attribute:!1})],ot.prototype,"xAxis",2),u([(0,Nt.property)({attribute:!1})],ot.prototype,"yAxis",2),u([(0,Nt.property)({type:Boolean,reflect:!0})],ot.prototype,"brush",2),u([(0,Nt.property)({type:Boolean,reflect:!0})],ot.prototype,"crosshair",2),ot=u([(0,Nt.customElement)("skdx-pareto-chart")],ot);var xn=require("lit/decorators.js");var _t=class extends X{constructor(){super(...arguments);this.series=[];this.ranked=!1;this.labels=!0}render(){let{series:t,categories:r,ranked:a,topRank:o,curve:s,labels:c,markerSize:l,xAxis:d}=this;return this.root(Wo({...this.sized(),series:t,categories:r,ranked:a,topRank:o,curve:s,labels:c,markerSize:l,xAxis:d,...this.compactOverrides()}),"bump",this.label??"Bump chart")}};u([(0,xn.property)({attribute:!1})],_t.prototype,"series",2),u([(0,xn.property)({attribute:!1})],_t.prototype,"categories",2),u([(0,xn.property)({type:Boolean,reflect:!0})],_t.prototype,"ranked",2),u([(0,xn.property)({type:Number,attribute:"top-rank"})],_t.prototype,"topRank",2),u([(0,xn.property)()],_t.prototype,"curve",2),u([(0,xn.property)({type:Boolean,attribute:"no-labels",converter:Re})],_t.prototype,"labels",2),u([(0,xn.property)({type:Number,attribute:"marker-size"})],_t.prototype,"markerSize",2),u([(0,xn.property)({attribute:!1})],_t.prototype,"xAxis",2),_t=u([(0,xn.customElement)("skdx-bump-chart")],_t);var ln=require("lit/decorators.js");var Rt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,scale:r,max:a,startAngle:o,endAngle:s,padAngle:c,innerRadius:l,levels:d,labels:m}=this;return this.root(Zo({...this.sized(),data:t,scale:r,max:a,startAngle:o,endAngle:s,padAngle:c,innerRadius:l,levels:d,labels:m,...this.compactOverrides()}),"polar-area",this.label??"Polar area chart")}};u([(0,ln.property)({attribute:!1})],Rt.prototype,"data",2),u([(0,ln.property)()],Rt.prototype,"scale",2),u([(0,ln.property)({type:Number})],Rt.prototype,"max",2),u([(0,ln.property)({type:Number,attribute:"start-angle"})],Rt.prototype,"startAngle",2),u([(0,ln.property)({type:Number,attribute:"end-angle"})],Rt.prototype,"endAngle",2),u([(0,ln.property)({type:Number,attribute:"pad-angle"})],Rt.prototype,"padAngle",2),u([(0,ln.property)({type:Number,attribute:"inner-radius"})],Rt.prototype,"innerRadius",2),u([(0,ln.property)({type:Number})],Rt.prototype,"levels",2),u([(0,ln.property)({type:Boolean,reflect:!0})],Rt.prototype,"labels",2),Rt=u([(0,ln.customElement)("skdx-polar-area-chart")],Rt);var Gn=require("lit/decorators.js");var yn=class extends X{constructor(){super(...arguments);this.series=[]}render(){let{series:t,orientation:r,markerSize:a,yAxis:o,references:s}=this;return this.root(Uo({...this.sized(),series:t,orientation:r,markerSize:a,yAxis:o,references:s,...this.compactOverrides()}),"swarm",this.label??"Swarm plot")}};u([(0,Gn.property)({attribute:!1})],yn.prototype,"series",2),u([(0,Gn.property)()],yn.prototype,"orientation",2),u([(0,Gn.property)({type:Number,attribute:"marker-size"})],yn.prototype,"markerSize",2),u([(0,Gn.property)({attribute:!1})],yn.prototype,"yAxis",2),u([(0,Gn.property)({attribute:!1})],yn.prototype,"references",2),yn=u([(0,Gn.customElement)("skdx-swarm-plot")],yn);var vn=require("lit/decorators.js");var jt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,total:r,rows:a,columns:o,orientation:s,cellGap:c,cellRadius:l,labels:d}=this;return this.root(Yo({...this.sized(),data:t,total:r,rows:a,columns:o,orientation:s,cellGap:c,cellRadius:l,labels:d,...this.compactOverrides()}),"waffle",this.label??"Waffle chart")}};u([(0,vn.property)({attribute:!1})],jt.prototype,"data",2),u([(0,vn.property)({type:Number})],jt.prototype,"total",2),u([(0,vn.property)({type:Number})],jt.prototype,"rows",2),u([(0,vn.property)({type:Number})],jt.prototype,"columns",2),u([(0,vn.property)()],jt.prototype,"orientation",2),u([(0,vn.property)({type:Number,attribute:"cell-gap"})],jt.prototype,"cellGap",2),u([(0,vn.property)({type:Number,attribute:"cell-radius"})],jt.prototype,"cellRadius",2),u([(0,vn.property)({type:Boolean,reflect:!0})],jt.prototype,"labels",2),jt=u([(0,vn.customElement)("skdx-waffle-chart")],jt);var cn=require("lit/decorators.js");var Et=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!0}render(){let{data:t,orientation:r,nodeShape:a,linkStyle:o,rootId:s,collapsed:c,maxDepth:l,labels:d,nodeSize:m}=this;return this.root(Jr({...this.sized(),data:t,orientation:r,nodeShape:a,linkStyle:o,rootId:s,collapsed:c,maxDepth:l,labels:d,nodeSize:m,...this.compactOverrides()}),"tree",this.label??"Tree chart")}};u([(0,cn.property)({attribute:!1})],Et.prototype,"data",2),u([(0,cn.property)()],Et.prototype,"orientation",2),u([(0,cn.property)({attribute:"node-shape"})],Et.prototype,"nodeShape",2),u([(0,cn.property)({attribute:"link-style"})],Et.prototype,"linkStyle",2),u([(0,cn.property)({attribute:!1})],Et.prototype,"rootId",2),u([(0,cn.property)({attribute:!1})],Et.prototype,"collapsed",2),u([(0,cn.property)({type:Number,attribute:"max-depth"})],Et.prototype,"maxDepth",2),u([(0,cn.property)({type:Boolean,attribute:"no-labels",converter:Re})],Et.prototype,"labels",2),u([(0,cn.property)({type:Number,attribute:"node-size"})],Et.prototype,"nodeSize",2),Et=u([(0,cn.customElement)("skdx-tree-chart")],Et);var An=require("lit/decorators.js");var Xt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!0}render(){let{data:t,orientation:r,rootId:a,collapsed:o,maxDepth:s,labels:c,nodeSize:l}=this;return this.root(_o({...this.sized(),data:t,orientation:r,rootId:a,collapsed:o,maxDepth:s,labels:c,nodeSize:l,...this.compactOverrides()}),"organization",this.label??"Organization chart")}};u([(0,An.property)({attribute:!1})],Xt.prototype,"data",2),u([(0,An.property)()],Xt.prototype,"orientation",2),u([(0,An.property)({attribute:!1})],Xt.prototype,"rootId",2),u([(0,An.property)({attribute:!1})],Xt.prototype,"collapsed",2),u([(0,An.property)({type:Number,attribute:"max-depth"})],Xt.prototype,"maxDepth",2),u([(0,An.property)({type:Boolean,attribute:"no-labels",converter:Re})],Xt.prototype,"labels",2),u([(0,An.property)({type:Number,attribute:"node-size"})],Xt.prototype,"nodeSize",2),Xt=u([(0,An.customElement)("skdx-organization-chart")],Xt);var zn=require("lit/decorators.js");var dn=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!0}render(){let{data:t,rootId:r,maxDepth:a,labels:o,padding:s,colorScale:c}=this;return this.root(jo({...this.sized(),data:t,rootId:r,maxDepth:a,labels:o,padding:s,colorScale:c,...this.compactOverrides()}),"circle-packing",this.label??"Circle packing chart")}};u([(0,zn.property)({attribute:!1})],dn.prototype,"data",2),u([(0,zn.property)({attribute:!1})],dn.prototype,"rootId",2),u([(0,zn.property)({type:Number,attribute:"max-depth"})],dn.prototype,"maxDepth",2),u([(0,zn.property)({type:Boolean,attribute:"no-labels",converter:Re})],dn.prototype,"labels",2),u([(0,zn.property)({type:Number})],dn.prototype,"padding",2),u([(0,zn.property)({attribute:!1})],dn.prototype,"colorScale",2),dn=u([(0,zn.customElement)("skdx-circle-packing-chart")],dn);var mn=require("lit/decorators.js");var Dt=class extends X{constructor(){super(...arguments);this.data=[];this.breadcrumbs=!1;this.labels=!0}render(){let{data:t,orientation:r,rootId:a,breadcrumbs:o,maxDepth:s,sort:c,labels:l,padding:d,colorScale:m}=this;return this.root(Go({...this.sized(),data:t,orientation:r,rootId:a,breadcrumbs:o,maxDepth:s,sort:c,labels:l,padding:d,colorScale:m,...this.compactOverrides()}),"icicle",this.label??"Icicle chart")}};u([(0,mn.property)({attribute:!1})],Dt.prototype,"data",2),u([(0,mn.property)()],Dt.prototype,"orientation",2),u([(0,mn.property)({attribute:!1})],Dt.prototype,"rootId",2),u([(0,mn.property)({type:Boolean,reflect:!0})],Dt.prototype,"breadcrumbs",2),u([(0,mn.property)({type:Number,attribute:"max-depth"})],Dt.prototype,"maxDepth",2),u([(0,mn.property)()],Dt.prototype,"sort",2),u([(0,mn.property)({type:Boolean,attribute:"no-labels",converter:Re})],Dt.prototype,"labels",2),u([(0,mn.property)({type:Number})],Dt.prototype,"padding",2),u([(0,mn.property)({attribute:!1})],Dt.prototype,"colorScale",2),Dt=u([(0,mn.customElement)("skdx-icicle-chart")],Dt);0&&(module.exports={SkdxAreaChart,SkdxBarChart,SkdxBoxplot,SkdxBubbleChart,SkdxBulletChart,SkdxBumpChart,SkdxCandlestickChart,SkdxChordChart,SkdxCirclePackingChart,SkdxComboChart,SkdxDumbbellChart,SkdxFunnelChart,SkdxGanttChart,SkdxGaugeChart,SkdxHeatmap,SkdxHistogram,SkdxIcicleChart,SkdxLineChart,SkdxLinearGauge,SkdxMapChart,SkdxMarimekkoChart,SkdxNetworkChart,SkdxOrganizationChart,SkdxParallelCoordinatesChart,SkdxParetoChart,SkdxPieChart,SkdxPolarAreaChart,SkdxRadarChart,SkdxRadialBarChart,SkdxRangeChart,SkdxSankeyChart,SkdxScatterChart,SkdxSparkline,SkdxSunburstChart,SkdxSwarmPlot,SkdxTimelineChart,SkdxTreeChart,SkdxTreemap,SkdxWaffleChart,SkdxWaterfallChart,csv,exportChart,makeFormatter,seriesCsv,svgMarkup,syncGroup});
|
|
112
|
+
`,u([(0,ce.property)({type:Number})],X.prototype,"width",2),u([(0,ce.property)({type:Number})],X.prototype,"height",2),u([(0,ce.property)()],X.prototype,"label",2),u([(0,ce.property)({type:Boolean,reflect:!0})],X.prototype,"legend",2),u([(0,ce.property)({type:Boolean,attribute:"no-tooltip",converter:Ne})],X.prototype,"tooltip",2),u([(0,ce.property)({attribute:!1})],X.prototype,"format",2),u([(0,ce.property)({attribute:!1})],X.prototype,"palette",2),u([(0,ce.property)({attribute:!1})],X.prototype,"hiddenSeries",2),u([(0,ce.property)({attribute:!1})],X.prototype,"selected",2),u([(0,ce.property)({attribute:"selection-mode"})],X.prototype,"selectionMode",2),u([(0,ce.property)({attribute:!1})],X.prototype,"highlighted",2),u([(0,ce.property)({attribute:!1})],X.prototype,"highlightScope",2),u([(0,ce.property)({type:Boolean,reflect:!0})],X.prototype,"loading",2),u([(0,ce.property)()],X.prototype,"error",2),u([(0,ce.property)({attribute:"empty-message"})],X.prototype,"emptyMessage",2),u([(0,ce.property)()],X.prototype,"description",2),u([(0,ce.property)({type:Boolean,reflect:!0})],X.prototype,"decorative",2),u([(0,ce.property)({type:Boolean,attribute:"accessible-table"})],X.prototype,"accessibleTable",2),u([(0,ce.property)({attribute:!1})],X.prototype,"zoom",2),u([(0,ce.property)({attribute:!1})],X.prototype,"view",2),u([(0,ce.property)({type:Boolean,reflect:!0})],X.prototype,"zoomable",2),u([(0,ce.property)({type:Boolean,reflect:!0})],X.prototype,"editable",2),u([(0,ce.property)({attribute:"sync-id"})],X.prototype,"syncId",2),u([(0,ce.property)({type:Boolean,attribute:"cross-filter"})],X.prototype,"crossFilter",2),u([(0,ce.property)({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],X.prototype,"animated",2),u([(0,ce.property)({type:Boolean,reflect:!0})],X.prototype,"responsive",2),u([(0,ce.state)()],X.prototype,"tip",2),u([(0,ce.state)()],X.prototype,"overlay",2),u([(0,ce.state)()],X.prototype,"portal",2),u([(0,ce.state)()],X.prototype,"measured",2),u([(0,ce.state)()],X.prototype,"viewState",2),u([(0,ce.state)()],X.prototype,"highlightState",2),u([(0,ce.state)()],X.prototype,"crossState",2),u([(0,ce.state)()],X.prototype,"focused",2),u([(0,ce.state)()],X.prototype,"hiddenState",2),u([(0,ce.state)()],X.prototype,"zoomState",2),u([(0,ce.state)()],X.prototype,"selectedState",2);var Ae=class extends X{constructor(){super(...arguments);this.series=[];this.labels=!1;this.connectNulls=!1;this.stacked=!1;this.brush=!1;this.crosshair=!1}input(){let{series:t,categories:r,xAxis:o,yAxis:a,rightAxis:s,references:d,annotations:i,labels:c,curve:m,connectNulls:h,nulls:f,stacked:y,stackOffset:$,orientation:b,radius:w,barGap:R,barWidth:k,sort:T,transform:E,transforms:M,bins:L,binWidth:S,binDomain:D,binMode:z,sampling:O,brush:V,crosshair:g}=this;return{...this.sized(),series:t,categories:r,xAxis:o,yAxis:a,rightAxis:s,references:d,annotations:i,labels:c,curve:m,connectNulls:h,nulls:f,stacked:y,stackOffset:$,orientation:b,radius:w,barGap:R,barWidth:k,sort:T,transform:E,transforms:M,bins:L,binWidth:S,binDomain:D,binMode:z,sampling:O,brush:V,crosshair:g,...this.compactOverrides()}}};u([(0,ce.property)({attribute:!1})],Ae.prototype,"series",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"categories",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"xAxis",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"yAxis",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"rightAxis",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"references",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"annotations",2),u([(0,ce.property)({type:Boolean,reflect:!0})],Ae.prototype,"labels",2),u([(0,ce.property)()],Ae.prototype,"curve",2),u([(0,ce.property)({type:Boolean,attribute:"connect-nulls"})],Ae.prototype,"connectNulls",2),u([(0,ce.property)()],Ae.prototype,"nulls",2),u([(0,ce.property)({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],Ae.prototype,"stacked",2),u([(0,ce.property)({attribute:"stack-offset"})],Ae.prototype,"stackOffset",2),u([(0,ce.property)()],Ae.prototype,"orientation",2),u([(0,ce.property)({type:Number})],Ae.prototype,"radius",2),u([(0,ce.property)({type:Number,attribute:"bar-gap"})],Ae.prototype,"barGap",2),u([(0,ce.property)({type:Number,attribute:"bar-width"})],Ae.prototype,"barWidth",2),u([(0,ce.property)()],Ae.prototype,"sort",2),u([(0,ce.property)()],Ae.prototype,"transform",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"transforms",2),u([(0,ce.property)({type:Number})],Ae.prototype,"bins",2),u([(0,ce.property)({type:Number,attribute:"bin-width"})],Ae.prototype,"binWidth",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"binDomain",2),u([(0,ce.property)({attribute:"bin-mode"})],Ae.prototype,"binMode",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"sampling",2),u([(0,ce.property)({type:Boolean,reflect:!0})],Ae.prototype,"brush",2),u([(0,ce.property)({type:Boolean,reflect:!0})],Ae.prototype,"crosshair",2);var Dl=e=>e.defs&&e.defs.length?ye.svg`<defs>${e.defs.map(n=>ye.svg`<linearGradient id=${n.id} x1="0" y1="0" x2=${n.vertical===!1?1:0} y2=${n.vertical===!1?0:1}>${n.stops.map(t=>ye.svg`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${(0,ze.ifDefined)(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:ye.nothing,ro=e=>ye.svg`${e.map((n,t)=>{let r=n.title?ye.svg`<title>${n.title}</title>`:ye.nothing,o=n.item?t:void 0;switch(n.kind){case"path":return ye.svg`<path data-skdx-part=${n.part} data-skdx-i=${(0,ze.ifDefined)(o)} d=${n.d} fill=${n.fill??"none"} stroke=${(0,ze.ifDefined)(n.stroke)} stroke-width=${(0,ze.ifDefined)(n.strokeWidth)} stroke-linecap=${(0,ze.ifDefined)(n.strokeLinecap)} stroke-linejoin=${(0,ze.ifDefined)(n.strokeLinejoin)} stroke-dasharray=${(0,ze.ifDefined)(n.dash)} opacity=${(0,ze.ifDefined)(n.opacity)} fill-opacity=${(0,ze.ifDefined)(n.fillOpacity)}>${r}</path>`;case"rect":return ye.svg`<rect data-skdx-part=${n.part} data-skdx-i=${(0,ze.ifDefined)(o)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${(0,ze.ifDefined)(n.rx)} style=${(0,ze.ifDefined)(Qr(n.part)?`rx:${Qr(n.part)}`:void 0)} fill=${n.fill} stroke=${(0,ze.ifDefined)(n.stroke)} fill-opacity=${(0,ze.ifDefined)(n.opacity)} pointer-events=${(0,ze.ifDefined)(n.part==="stage-label-background"||n.part==="label-background"?"none":void 0)}>${r}</rect>`;case"line":return ye.svg`<line data-skdx-part=${n.part} data-skdx-i=${(0,ze.ifDefined)(o)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${(0,ze.ifDefined)(n.strokeWidth)} stroke-dasharray=${(0,ze.ifDefined)(n.dash)} opacity=${(0,ze.ifDefined)(n.opacity)}>${r}</line>`;case"circle":return ye.svg`<circle data-skdx-part=${n.part} data-skdx-i=${(0,ze.ifDefined)(o)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${(0,ze.ifDefined)(n.stroke)} opacity=${(0,ze.ifDefined)(n.opacity)}>${r}</circle>`;case"text":return ye.svg`<text aria-label=${(0,ze.ifDefined)(n.title)} data-skdx-part=${n.part} data-skdx-i=${(0,ze.ifDefined)(o)} x=${n.x} y=${n.y} text-anchor=${(0,ze.ifDefined)(n.anchor)} dominant-baseline=${(0,ze.ifDefined)(n.baseline)} fill=${(0,ze.ifDefined)(n.fill)} font-weight=${(0,ze.ifDefined)(n.weight)} pointer-events=${(0,ze.ifDefined)(o===void 0?"none":void 0)} transform=${(0,ze.ifDefined)(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var mr=class extends Ae{render(){let n=this.input();return this.root(So(n),"bar",this.label??"Bar chart",n)}};mr=u([(0,hi.customElement)("skdx-bar-chart")],mr);var fi=require("lit/decorators.js");var ur=class extends Ae{render(){let n=this.input();return this.root(Lo(n),"line",this.label??"Line chart",n)}};ur=u([(0,fi.customElement)("skdx-line-chart")],ur);var pi=require("lit/decorators.js");var hr=class extends Ae{render(){let n=this.input();return this.root(zo(n),"area",this.label??"Area chart",n)}};hr=u([(0,pi.customElement)("skdx-area-chart")],hr);var Vt=require("lit/decorators.js");var lt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,variant:r,innerRadius:o,outerRadius:a,labels:s,labelPosition:d,padAngle:i,sort:c,startAngle:m,endAngle:h,centerLabel:f}=this,y={...this.sized(),data:t,variant:r,innerRadius:o,outerRadius:a,labels:s,labelPosition:d,padAngle:i,sort:c,startAngle:m,endAngle:h,centerLabel:f,...this.compactOverrides()};return this.root(Bo(y),"pie",this.label??"Pie chart",y)}};u([(0,Vt.property)({attribute:!1})],lt.prototype,"data",2),u([(0,Vt.property)()],lt.prototype,"variant",2),u([(0,Vt.property)({type:Number,attribute:"inner-radius"})],lt.prototype,"innerRadius",2),u([(0,Vt.property)({type:Number,attribute:"outer-radius"})],lt.prototype,"outerRadius",2),u([(0,Vt.property)({type:Boolean,reflect:!0})],lt.prototype,"labels",2),u([(0,Vt.property)({attribute:"label-position"})],lt.prototype,"labelPosition",2),u([(0,Vt.property)({type:Number,attribute:"pad-angle"})],lt.prototype,"padAngle",2),u([(0,Vt.property)()],lt.prototype,"sort",2),u([(0,Vt.property)({type:Number,attribute:"start-angle"})],lt.prototype,"startAngle",2),u([(0,Vt.property)({type:Number,attribute:"end-angle"})],lt.prototype,"endAngle",2),u([(0,Vt.property)({attribute:"center-label"})],lt.prototype,"centerLabel",2),lt=u([(0,Vt.customElement)("skdx-pie-chart")],lt);var pt=require("lit/decorators.js");var Xe=class extends X{constructor(){super(...arguments);this.series=[];this.labels=!1}render(){let{series:t,sizeRange:r,labels:o,xAxis:a,yAxis:s,references:d,annotations:i,colorScale:c,colorLegend:m,hitRadius:h,jitter:f,trendline:y,sampling:$}=this,b={...this.sized(),series:t,sizeRange:r,labels:o,xAxis:a,yAxis:s,references:d,annotations:i,colorScale:c,colorLegend:m,hitRadius:h,jitter:f,trendline:y,sampling:$,...this.compactOverrides()};return this.root(Ao(b),"scatter",this.label??"Scatter chart",b)}};u([(0,pt.property)({attribute:!1})],Xe.prototype,"series",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"sizeRange",2),u([(0,pt.property)({type:Boolean,reflect:!0})],Xe.prototype,"labels",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"xAxis",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"yAxis",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"references",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"annotations",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"colorScale",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"colorLegend",2),u([(0,pt.property)({type:Number,attribute:"hit-radius"})],Xe.prototype,"hitRadius",2),u([(0,pt.property)({type:Number})],Xe.prototype,"jitter",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"trendline",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"sampling",2),Xe=u([(0,pt.customElement)("skdx-scatter-chart")],Xe);var Zt=require("lit/decorators.js");var bt=class extends X{constructor(){super(...arguments);this.data=[];this.trend=!1;this.extremes=!1;this.lastValue=!1}render(){let{data:t,color:r,curve:o,variant:a,trend:s,extremes:d,lastValue:i,target:c,band:m,markers:h}=this,f={...this.sized(),data:t,color:r,curve:o,variant:a,trend:s,extremes:d,lastValue:i,target:c,band:m,markers:h,...this.compactOverrides()};return this.root(Po(f),"sparkline",this.label??"Sparkline",f)}};u([(0,Zt.property)({attribute:!1})],bt.prototype,"data",2),u([(0,Zt.property)()],bt.prototype,"color",2),u([(0,Zt.property)()],bt.prototype,"curve",2),u([(0,Zt.property)()],bt.prototype,"variant",2),u([(0,Zt.property)({type:Boolean,reflect:!0})],bt.prototype,"trend",2),u([(0,Zt.property)({type:Boolean,reflect:!0})],bt.prototype,"extremes",2),u([(0,Zt.property)({type:Boolean,reflect:!0,attribute:"last-value"})],bt.prototype,"lastValue",2),u([(0,Zt.property)({type:Number})],bt.prototype,"target",2),u([(0,Zt.property)({attribute:!1})],bt.prototype,"band",2),u([(0,Zt.property)({attribute:!1})],bt.prototype,"markers",2),bt=u([(0,Zt.customElement)("skdx-sparkline")],bt);var It=require("lit/decorators.js");var nt=class extends X{constructor(){super(...arguments);this.series=[];this.fill=!0;this.markers=!0;this.labels=!1}render(){let{series:t,categories:r,metrics:o,normalized:a,max:s,fill:d,levels:i,markers:c,markerSize:m,labels:h,startAngle:f,gridShape:y}=this,$={...this.sized(),series:t,categories:r,metrics:o,normalize:a,max:s,fill:d,levels:i,markers:c,markerSize:m,labels:h,startAngle:f,gridShape:y,...this.compactOverrides()};return this.root(Vo($),"radar",this.label??"Radar chart",$)}};u([(0,It.property)({attribute:!1})],nt.prototype,"series",2),u([(0,It.property)({attribute:!1})],nt.prototype,"categories",2),u([(0,It.property)({attribute:!1})],nt.prototype,"metrics",2),u([(0,It.property)({attribute:!1})],nt.prototype,"normalized",2),u([(0,It.property)({type:Number})],nt.prototype,"max",2),u([(0,It.property)({type:Boolean,attribute:"no-fill",converter:Ne})],nt.prototype,"fill",2),u([(0,It.property)({type:Number})],nt.prototype,"levels",2),u([(0,It.property)({type:Boolean,attribute:"no-markers",converter:Ne})],nt.prototype,"markers",2),u([(0,It.property)({type:Number,attribute:"marker-size"})],nt.prototype,"markerSize",2),u([(0,It.property)({type:Boolean,reflect:!0})],nt.prototype,"labels",2),u([(0,It.property)({type:Number,attribute:"start-angle"})],nt.prototype,"startAngle",2),u([(0,It.property)({attribute:"grid-shape"})],nt.prototype,"gridShape",2),nt=u([(0,It.customElement)("skdx-radar-chart")],nt);var We=require("lit/decorators.js");var Ve=class extends X{constructor(){super(...arguments);this.diverging=!1;this.labels=!1}render(){let{rows:t,columns:r,data:o,calendar:a,color:s,diverging:d,negativeColor:i,labels:c,domain:m,steps:h,weekStart:f,colorScale:y,colorLegend:$,missingColor:b,cellGap:w,cellRadius:R,rowOrder:k,columnOrder:T}=this,E={...this.sized(),rows:t,columns:r,data:o,calendar:a,color:s,diverging:d,negativeColor:i,labels:c,domain:m,steps:h,weekStart:f,colorScale:y,colorLegend:$,missingColor:b,cellGap:w,cellRadius:R,rowOrder:k,columnOrder:T,...this.compactOverrides()};return this.root(jo(E),"heatmap",this.label??"Heatmap",E)}};u([(0,We.property)({attribute:!1})],Ve.prototype,"rows",2),u([(0,We.property)({attribute:!1})],Ve.prototype,"columns",2),u([(0,We.property)({attribute:!1})],Ve.prototype,"data",2),u([(0,We.property)({attribute:!1})],Ve.prototype,"calendar",2),u([(0,We.property)()],Ve.prototype,"color",2),u([(0,We.property)({type:Boolean,reflect:!0})],Ve.prototype,"diverging",2),u([(0,We.property)({attribute:"negative-color"})],Ve.prototype,"negativeColor",2),u([(0,We.property)({type:Boolean,reflect:!0})],Ve.prototype,"labels",2),u([(0,We.property)({attribute:!1})],Ve.prototype,"domain",2),u([(0,We.property)({type:Number})],Ve.prototype,"steps",2),u([(0,We.property)({attribute:"week-start"})],Ve.prototype,"weekStart",2),u([(0,We.property)({attribute:!1})],Ve.prototype,"colorScale",2),u([(0,We.property)({attribute:!1})],Ve.prototype,"colorLegend",2),u([(0,We.property)({attribute:"missing-color"})],Ve.prototype,"missingColor",2),u([(0,We.property)({type:Number,attribute:"cell-gap"})],Ve.prototype,"cellGap",2),u([(0,We.property)({type:Number,attribute:"cell-radius"})],Ve.prototype,"cellRadius",2),u([(0,We.property)({attribute:"row-order"})],Ve.prototype,"rowOrder",2),u([(0,We.property)({attribute:"column-order"})],Ve.prototype,"columnOrder",2),Ve=u([(0,We.customElement)("skdx-heatmap")],Ve);var Sn=require("lit/decorators.js");var Jt=class extends X{constructor(){super(...arguments);this.data=[]}render(){let{data:t,orientation:r,variant:o,gap:a,labelPosition:s,sort:d}=this,i={...this.sized(),data:t,orientation:r,variant:o,gap:a,labelPosition:s,sort:d,...this.compactOverrides()};return this.root(Go(i),"funnel",this.label??"Funnel chart",i)}};u([(0,Sn.property)({attribute:!1})],Jt.prototype,"data",2),u([(0,Sn.property)()],Jt.prototype,"orientation",2),u([(0,Sn.property)()],Jt.prototype,"variant",2),u([(0,Sn.property)({type:Number})],Jt.prototype,"gap",2),u([(0,Sn.property)({attribute:"label-position"})],Jt.prototype,"labelPosition",2),u([(0,Sn.property)()],Jt.prototype,"sort",2),Jt=u([(0,Sn.customElement)("skdx-funnel-chart")],Jt);var Ut=require("lit/decorators.js");var gt=class extends X{constructor(){super(...arguments);this.links=[];this.nodeLabels=!0;this.linkLabels=!1}render(){let{links:t,nodes:r,align:o,nodeWidth:a,nodePadding:s,nodeSort:d,linkSort:i,nodeLabels:c,linkLabels:m,cyclePolicy:h}=this,f={...this.sized(),links:t,nodes:r,align:o,nodeWidth:a,nodePadding:s,nodeSort:d,linkSort:i,nodeLabels:c,linkLabels:m,cyclePolicy:h,...this.compactOverrides()};return this.root(Sa(f),"sankey",this.label??"Sankey chart",f)}};u([(0,Ut.property)({attribute:!1})],gt.prototype,"links",2),u([(0,Ut.property)({attribute:!1})],gt.prototype,"nodes",2),u([(0,Ut.property)()],gt.prototype,"align",2),u([(0,Ut.property)({type:Number,attribute:"node-width"})],gt.prototype,"nodeWidth",2),u([(0,Ut.property)({type:Number,attribute:"node-padding"})],gt.prototype,"nodePadding",2),u([(0,Ut.property)({attribute:"node-sort"})],gt.prototype,"nodeSort",2),u([(0,Ut.property)({attribute:"link-sort"})],gt.prototype,"linkSort",2),u([(0,Ut.property)({type:Boolean,attribute:"no-node-labels",converter:Ne})],gt.prototype,"nodeLabels",2),u([(0,Ut.property)({type:Boolean,reflect:!0,attribute:"link-labels"})],gt.prototype,"linkLabels",2),u([(0,Ut.property)({attribute:"cycle-policy"})],gt.prototype,"cyclePolicy",2),gt=u([(0,Ut.customElement)("skdx-sankey-chart")],gt);var en=require("lit/decorators.js");var Tt=class extends X{constructor(){super(...arguments);this.data=[];this.breadcrumbs=!1;this.labels=!0}render(){let{data:t,rootId:r,breadcrumbs:o,maxDepth:a,sort:s,padding:d,tiling:i,colorScale:c,labels:m}=this,h={...this.sized(),data:t,rootId:r,breadcrumbs:o,maxDepth:a,sort:s,padding:d,tiling:i,colorScale:c,labels:m,...this.compactOverrides()};return this.root(za(h),"treemap",this.label??"Treemap",h)}};u([(0,en.property)({attribute:!1})],Tt.prototype,"data",2),u([(0,en.property)({attribute:!1})],Tt.prototype,"rootId",2),u([(0,en.property)({type:Boolean,reflect:!0})],Tt.prototype,"breadcrumbs",2),u([(0,en.property)({type:Number,attribute:"max-depth"})],Tt.prototype,"maxDepth",2),u([(0,en.property)()],Tt.prototype,"sort",2),u([(0,en.property)({type:Number})],Tt.prototype,"padding",2),u([(0,en.property)()],Tt.prototype,"tiling",2),u([(0,en.property)({attribute:!1})],Tt.prototype,"colorScale",2),u([(0,en.property)({type:Boolean,attribute:"no-labels",converter:Ne})],Tt.prototype,"labels",2),Tt=u([(0,en.customElement)("skdx-treemap")],Tt);var xt=require("lit/decorators.js");var Qe=class extends X{constructor(){super(...arguments);this.data=[];this.brush=!1;this.crosshair=!1}render(){let{data:t,scale:r,variant:o,xAxis:a,yAxis:s,volumeFormat:d,references:i,annotations:c,overlays:m,upColor:h,downColor:f,brush:y,crosshair:$}=this,b={...this.sized(),data:t,scale:r,variant:o,xAxis:a,yAxis:s,volumeFormat:d,references:i,annotations:c,overlays:m,upColor:h,downColor:f,brush:y,crosshair:$,...this.compactOverrides()};return this.root(Ra(b),"candlestick",this.label??"Candlestick chart",b)}};u([(0,xt.property)({attribute:!1})],Qe.prototype,"data",2),u([(0,xt.property)()],Qe.prototype,"scale",2),u([(0,xt.property)()],Qe.prototype,"variant",2),u([(0,xt.property)({attribute:!1})],Qe.prototype,"xAxis",2),u([(0,xt.property)({attribute:!1})],Qe.prototype,"yAxis",2),u([(0,xt.property)({attribute:!1})],Qe.prototype,"volumeFormat",2),u([(0,xt.property)({attribute:!1})],Qe.prototype,"references",2),u([(0,xt.property)({attribute:!1})],Qe.prototype,"annotations",2),u([(0,xt.property)({attribute:!1})],Qe.prototype,"overlays",2),u([(0,xt.property)({attribute:"up-color"})],Qe.prototype,"upColor",2),u([(0,xt.property)({attribute:"down-color"})],Qe.prototype,"downColor",2),u([(0,xt.property)({type:Boolean,reflect:!0})],Qe.prototype,"brush",2),u([(0,xt.property)({type:Boolean,reflect:!0})],Qe.prototype,"crosshair",2),Qe=u([(0,xt.customElement)("skdx-candlestick-chart")],Qe);var Yt=require("lit/decorators.js");var yt=class extends X{constructor(){super(...arguments);this.data=[];this.connectors=!0;this.labels=!1}render(){let{data:t,total:r,start:o,startLabel:a,orientation:s,connectors:d,labels:i,positiveColor:c,negativeColor:m,totalColor:h}=this,f={...this.sized(),data:t,total:r,start:o,startLabel:a,orientation:s,connectors:d,labels:i,positiveColor:c,negativeColor:m,totalColor:h,...this.compactOverrides()};return this.root(Na(f),"waterfall",this.label??"Waterfall chart",f)}};u([(0,Yt.property)({attribute:!1})],yt.prototype,"data",2),u([(0,Yt.property)()],yt.prototype,"total",2),u([(0,Yt.property)({type:Number})],yt.prototype,"start",2),u([(0,Yt.property)({attribute:"start-label"})],yt.prototype,"startLabel",2),u([(0,Yt.property)()],yt.prototype,"orientation",2),u([(0,Yt.property)({type:Boolean,attribute:"no-connectors",converter:Ne})],yt.prototype,"connectors",2),u([(0,Yt.property)({type:Boolean,reflect:!0})],yt.prototype,"labels",2),u([(0,Yt.property)({attribute:"positive-color"})],yt.prototype,"positiveColor",2),u([(0,Yt.property)({attribute:"negative-color"})],yt.prototype,"negativeColor",2),u([(0,Yt.property)({attribute:"total-color"})],yt.prototype,"totalColor",2),yt=u([(0,Yt.customElement)("skdx-waterfall-chart")],yt);var Ln=require("lit/decorators.js");var tn=class extends X{constructor(){super(...arguments);this.tasks=[];this.criticalPath=!1}render(){let{tasks:t,references:r,annotations:o,today:a,criticalPath:s,xAxis:d}=this,i={...this.sized(),tasks:t,references:r,annotations:o,today:a,criticalPath:s,xAxis:d,...this.compactOverrides()};return this.root(Ea(i),"gantt",this.label??"Gantt chart",i)}};u([(0,Ln.property)({attribute:!1})],tn.prototype,"tasks",2),u([(0,Ln.property)({attribute:!1})],tn.prototype,"references",2),u([(0,Ln.property)({attribute:!1})],tn.prototype,"annotations",2),u([(0,Ln.property)({attribute:!1})],tn.prototype,"today",2),u([(0,Ln.property)({type:Boolean,reflect:!0,attribute:"critical-path"})],tn.prototype,"criticalPath",2),u([(0,Ln.property)({attribute:!1})],tn.prototype,"xAxis",2),tn=u([(0,Ln.customElement)("skdx-gantt-chart")],tn);var nn=require("lit/decorators.js");var At=class extends X{constructor(){super(...arguments);this.series=[];this.mean=!1;this.points=!1;this.notched=!1}render(){let{series:t,orientation:r,quartileMethod:o,whisker:a,mean:s,points:d,notched:i,categories:c,yAxis:m}=this,h={...this.sized(),series:t,orientation:r,quartileMethod:o,whisker:a,mean:s,points:d,notched:i,categories:c,yAxis:m,...this.compactOverrides()};return this.root(Fa(h),"boxplot",this.label??"Box plot",h)}};u([(0,nn.property)({attribute:!1})],At.prototype,"series",2),u([(0,nn.property)()],At.prototype,"orientation",2),u([(0,nn.property)({attribute:"quartile-method"})],At.prototype,"quartileMethod",2),u([(0,nn.property)({type:Number})],At.prototype,"whisker",2),u([(0,nn.property)({type:Boolean,reflect:!0})],At.prototype,"mean",2),u([(0,nn.property)({type:Boolean,reflect:!0})],At.prototype,"points",2),u([(0,nn.property)({type:Boolean,reflect:!0})],At.prototype,"notched",2),u([(0,nn.property)({attribute:!1})],At.prototype,"categories",2),u([(0,nn.property)({attribute:!1})],At.prototype,"yAxis",2),At=u([(0,nn.customElement)("skdx-boxplot")],At);var Ct=require("lit/decorators.js");var rt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1;this.breadcrumbs=!1}render(){let{data:t,innerRadius:r,centerLabel:o,labels:a,rootId:s,breadcrumbs:d,maxDepth:i,sort:c,startAngle:m,endAngle:h,padAngle:f,colorScale:y}=this,$={...this.sized(),data:t,innerRadius:r,centerLabel:o,labels:a,rootId:s,breadcrumbs:d,maxDepth:i,sort:c,startAngle:m,endAngle:h,padAngle:f,colorScale:y,...this.compactOverrides()};return this.root(Pa($),"sunburst",this.label??"Sunburst chart",$)}};u([(0,Ct.property)({attribute:!1})],rt.prototype,"data",2),u([(0,Ct.property)({type:Number,attribute:"inner-radius"})],rt.prototype,"innerRadius",2),u([(0,Ct.property)({attribute:"center-label"})],rt.prototype,"centerLabel",2),u([(0,Ct.property)({type:Boolean,reflect:!0})],rt.prototype,"labels",2),u([(0,Ct.property)({attribute:!1})],rt.prototype,"rootId",2),u([(0,Ct.property)({type:Boolean,reflect:!0})],rt.prototype,"breadcrumbs",2),u([(0,Ct.property)({type:Number,attribute:"max-depth"})],rt.prototype,"maxDepth",2),u([(0,Ct.property)()],rt.prototype,"sort",2),u([(0,Ct.property)({type:Number,attribute:"start-angle"})],rt.prototype,"startAngle",2),u([(0,Ct.property)({type:Number,attribute:"end-angle"})],rt.prototype,"endAngle",2),u([(0,Ct.property)({type:Number,attribute:"pad-angle"})],rt.prototype,"padAngle",2),u([(0,Ct.property)({attribute:!1})],rt.prototype,"colorScale",2),rt=u([(0,Ct.customElement)("skdx-sunburst-chart")],rt);var jn=require("lit/decorators.js");var pn=class extends X{render(){let{names:n,matrix:t,links:r,padding:o,sort:a}=this,s={...this.sized(),names:n,matrix:t,links:r,padding:o,sort:a,...this.compactOverrides()};return this.root(Va(s),"chord",this.label??"Chord chart",s)}};u([(0,jn.property)({attribute:!1})],pn.prototype,"names",2),u([(0,jn.property)({attribute:!1})],pn.prototype,"matrix",2),u([(0,jn.property)({attribute:!1})],pn.prototype,"links",2),u([(0,jn.property)({type:Number})],pn.prototype,"padding",2),u([(0,jn.property)()],pn.prototype,"sort",2),pn=u([(0,jn.customElement)("skdx-chord-chart")],pn);var rn=require("lit/decorators.js");var Ot=class extends X{constructor(){super(...arguments);this.features=[];this.labels=!1}render(){let{features:t,color:r,colorScale:o,colorLegend:a,projection:s,points:d,lines:i,sizeRange:c,labels:m}=this,h={...this.sized(),features:t,color:r,colorScale:o,colorLegend:a,projection:s,points:d,lines:i,sizeRange:c,labels:m,...this.compactOverrides()};return this.root(_a(h),"map",this.label??"Map",h)}};u([(0,rn.property)({attribute:!1})],Ot.prototype,"features",2),u([(0,rn.property)()],Ot.prototype,"color",2),u([(0,rn.property)({attribute:!1})],Ot.prototype,"colorScale",2),u([(0,rn.property)({attribute:!1})],Ot.prototype,"colorLegend",2),u([(0,rn.property)()],Ot.prototype,"projection",2),u([(0,rn.property)({attribute:!1})],Ot.prototype,"points",2),u([(0,rn.property)({attribute:!1})],Ot.prototype,"lines",2),u([(0,rn.property)({attribute:!1})],Ot.prototype,"sizeRange",2),u([(0,rn.property)({type:Boolean,reflect:!0})],Ot.prototype,"labels",2),Ot=u([(0,rn.customElement)("skdx-map-chart")],Ot);var St=require("lit/decorators.js");var ot=class extends X{constructor(){super(...arguments);this.data=[];this.track=!0;this.rounded=!0;this.labels=!1}render(){let{data:t,max:r,startAngle:o,endAngle:a,innerRadius:s,gap:d,track:i,rounded:c,labels:m,bands:h,target:f,centerLabel:y}=this,$={...this.sized(),data:t,max:r,startAngle:o,endAngle:a,innerRadius:s,gap:d,track:i,rounded:c,labels:m,bands:h,target:f,centerLabel:y,...this.compactOverrides()};return this.root(Wo($),"radial",this.label??"Radial bar chart",$)}};u([(0,St.property)({attribute:!1})],ot.prototype,"data",2),u([(0,St.property)({type:Number})],ot.prototype,"max",2),u([(0,St.property)({type:Number,attribute:"start-angle"})],ot.prototype,"startAngle",2),u([(0,St.property)({type:Number,attribute:"end-angle"})],ot.prototype,"endAngle",2),u([(0,St.property)({type:Number,attribute:"inner-radius"})],ot.prototype,"innerRadius",2),u([(0,St.property)({type:Number})],ot.prototype,"gap",2),u([(0,St.property)({type:Boolean,attribute:"no-track",converter:Ne})],ot.prototype,"track",2),u([(0,St.property)({type:Boolean,attribute:"no-rounded",converter:Ne})],ot.prototype,"rounded",2),u([(0,St.property)({type:Boolean,reflect:!0})],ot.prototype,"labels",2),u([(0,St.property)({attribute:!1})],ot.prototype,"bands",2),u([(0,St.property)({type:Number})],ot.prototype,"target",2),u([(0,St.property)({attribute:"center-label"})],ot.prototype,"centerLabel",2),ot=u([(0,St.customElement)("skdx-radial-bar-chart")],ot);var vt=require("lit/decorators.js");var Je=class extends X{constructor(){super(...arguments);this.value=Number.NaN;this.tickLabels=!0}render(){let{value:t,min:r,max:o,variant:a,startAngle:s,endAngle:d,thickness:i,bands:c,target:m,ticks:h,tickLabels:f,centerLabel:y,caption:$}=this,b={...this.sized(),value:t,min:r,max:o,variant:a,startAngle:s,endAngle:d,thickness:i,bands:c,target:m,ticks:h,tickLabels:f,centerLabel:y,caption:$,...this.compactOverrides()};return this.root(qo(b),"gauge",this.label??"Gauge chart",b)}};u([(0,vt.property)({type:Number})],Je.prototype,"value",2),u([(0,vt.property)({type:Number})],Je.prototype,"min",2),u([(0,vt.property)({type:Number})],Je.prototype,"max",2),u([(0,vt.property)()],Je.prototype,"variant",2),u([(0,vt.property)({type:Number,attribute:"start-angle"})],Je.prototype,"startAngle",2),u([(0,vt.property)({type:Number,attribute:"end-angle"})],Je.prototype,"endAngle",2),u([(0,vt.property)({type:Number})],Je.prototype,"thickness",2),u([(0,vt.property)({attribute:!1})],Je.prototype,"bands",2),u([(0,vt.property)({type:Number})],Je.prototype,"target",2),u([(0,vt.property)({attribute:!1})],Je.prototype,"ticks",2),u([(0,vt.property)({type:Boolean,attribute:"no-tick-labels",converter:Ne})],Je.prototype,"tickLabels",2),u([(0,vt.property)({attribute:"center-label"})],Je.prototype,"centerLabel",2),u([(0,vt.property)()],Je.prototype,"caption",2),Je=u([(0,vt.customElement)("skdx-gauge-chart")],Je);var ct=require("lit/decorators.js");var Ue=class extends X{constructor(){super(...arguments);this.series=[];this.labels=!1}render(){let{series:t,sizeRange:r,labels:o,xAxis:a,yAxis:s,zAxis:d,references:i,annotations:c,colorScale:m,colorLegend:h,hitRadius:f,jitter:y,trendline:$,sampling:b}=this,w={...this.sized(),series:t,sizeRange:r,labels:o,xAxis:a,yAxis:s,zAxis:d,references:i,annotations:c,colorScale:m,colorLegend:h,hitRadius:f,jitter:y,trendline:$,sampling:b,...this.compactOverrides()};return this.root(Zo(w),"bubble",this.label??"Bubble chart",w)}};u([(0,ct.property)({attribute:!1})],Ue.prototype,"series",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"sizeRange",2),u([(0,ct.property)({type:Boolean,reflect:!0})],Ue.prototype,"labels",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"xAxis",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"yAxis",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"zAxis",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"references",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"annotations",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"colorScale",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"colorLegend",2),u([(0,ct.property)({type:Number,attribute:"hit-radius"})],Ue.prototype,"hitRadius",2),u([(0,ct.property)({type:Number})],Ue.prototype,"jitter",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"trendline",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"sampling",2),Ue=u([(0,ct.customElement)("skdx-bubble-chart")],Ue);var dt=require("lit/decorators.js");var Ye=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,name:r,color:o,bins:a,binWidth:s,thresholds:d,domain:i,mode:c,xAxis:m,yAxis:h,references:f,annotations:y,labels:$,barGap:b}=this,w={...this.sized(),data:t,name:r,color:o,bins:a,binWidth:s,thresholds:d,domain:i,mode:c,xAxis:m,yAxis:h,references:f,annotations:y,labels:$,barGap:b,...this.compactOverrides()};return this.root(Uo(w),"histogram",this.label??"Histogram",w)}};u([(0,dt.property)({attribute:!1})],Ye.prototype,"data",2),u([(0,dt.property)()],Ye.prototype,"name",2),u([(0,dt.property)()],Ye.prototype,"color",2),u([(0,dt.property)({type:Number})],Ye.prototype,"bins",2),u([(0,dt.property)({type:Number,attribute:"bin-width"})],Ye.prototype,"binWidth",2),u([(0,dt.property)({attribute:!1})],Ye.prototype,"thresholds",2),u([(0,dt.property)({attribute:!1})],Ye.prototype,"domain",2),u([(0,dt.property)()],Ye.prototype,"mode",2),u([(0,dt.property)({attribute:!1})],Ye.prototype,"xAxis",2),u([(0,dt.property)({attribute:!1})],Ye.prototype,"yAxis",2),u([(0,dt.property)({attribute:!1})],Ye.prototype,"references",2),u([(0,dt.property)({attribute:!1})],Ye.prototype,"annotations",2),u([(0,dt.property)({type:Boolean,reflect:!0})],Ye.prototype,"labels",2),u([(0,dt.property)({type:Number,attribute:"bar-gap"})],Ye.prototype,"barGap",2),Ye=u([(0,dt.customElement)("skdx-histogram")],Ye);var In=require("lit/decorators.js");var Kt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,orientation:r,ranges:o,min:a,max:s,labels:d,ticks:i}=this,c={...this.sized(),data:t,orientation:r,ranges:o,min:a,max:s,labels:d,ticks:i,...this.compactOverrides()};return this.root(Ar(c),"bullet",this.label??"Bullet chart",c)}};u([(0,In.property)({attribute:!1})],Kt.prototype,"data",2),u([(0,In.property)()],Kt.prototype,"orientation",2),u([(0,In.property)({attribute:!1})],Kt.prototype,"ranges",2),u([(0,In.property)({type:Number})],Kt.prototype,"min",2),u([(0,In.property)({type:Number})],Kt.prototype,"max",2),u([(0,In.property)({type:Boolean,reflect:!0})],Kt.prototype,"labels",2),u([(0,In.property)({type:Number})],Kt.prototype,"ticks",2),Kt=u([(0,In.customElement)("skdx-bullet-chart")],Kt);var bi=require("lit/decorators.js");var fr=class extends Ae{render(){let n=this.input();return this.root(Yo(n),"combo",this.label??"Combo chart",n)}};fr=u([(0,bi.customElement)("skdx-combo-chart")],fr);var et=require("lit/decorators.js");var _e=class extends X{constructor(){super(...arguments);this.series=[];this.connectNulls=!1;this.brush=!1;this.crosshair=!1}render(){let{series:t,variant:r,categories:o,xAxis:a,yAxis:s,rightAxis:d,references:i,annotations:c,curve:m,connectNulls:h,orientation:f,radius:y,barGap:$,barWidth:b,brush:w,crosshair:R}=this,k={...this.sized(),series:t,variant:r,categories:o,xAxis:a,yAxis:s,rightAxis:d,references:i,annotations:c,curve:m,connectNulls:h,orientation:f,radius:y,barGap:$,barWidth:b,brush:w,crosshair:R,...this.compactOverrides()};return this.root(Ko(k),"range",this.label??"Range chart",k)}};u([(0,et.property)({attribute:!1})],_e.prototype,"series",2),u([(0,et.property)()],_e.prototype,"variant",2),u([(0,et.property)({attribute:!1})],_e.prototype,"categories",2),u([(0,et.property)({attribute:!1})],_e.prototype,"xAxis",2),u([(0,et.property)({attribute:!1})],_e.prototype,"yAxis",2),u([(0,et.property)({attribute:!1})],_e.prototype,"rightAxis",2),u([(0,et.property)({attribute:!1})],_e.prototype,"references",2),u([(0,et.property)({attribute:!1})],_e.prototype,"annotations",2),u([(0,et.property)()],_e.prototype,"curve",2),u([(0,et.property)({type:Boolean,reflect:!0,attribute:"connect-nulls"})],_e.prototype,"connectNulls",2),u([(0,et.property)()],_e.prototype,"orientation",2),u([(0,et.property)({type:Number})],_e.prototype,"radius",2),u([(0,et.property)({type:Number,attribute:"bar-gap"})],_e.prototype,"barGap",2),u([(0,et.property)({type:Number,attribute:"bar-width"})],_e.prototype,"barWidth",2),u([(0,et.property)({type:Boolean,reflect:!0})],_e.prototype,"brush",2),u([(0,et.property)({type:Boolean,reflect:!0})],_e.prototype,"crosshair",2),_e=u([(0,et.customElement)("skdx-range-chart")],_e);var bn=require("lit/decorators.js");var Ht=class extends X{constructor(){super(...arguments);this.nodes=[];this.edges=[];this.labels=!0;this.directed=!1;this.edgeLabels=!1}render(){let{nodes:t,edges:r,arrange:o,labels:a,nodeRange:s,iterations:d,directed:i,edgeLabels:c}=this,m={...this.sized(),nodes:t,edges:r,arrange:o,labels:a,nodeRange:s,iterations:d,directed:i,edgeLabels:c,...this.compactOverrides()};return this.root(Xo(m),"network",this.label??"Network chart",m)}};u([(0,bn.property)({attribute:!1})],Ht.prototype,"nodes",2),u([(0,bn.property)({attribute:!1})],Ht.prototype,"edges",2),u([(0,bn.property)()],Ht.prototype,"arrange",2),u([(0,bn.property)({type:Boolean,attribute:"no-labels",converter:Ne})],Ht.prototype,"labels",2),u([(0,bn.property)({attribute:!1})],Ht.prototype,"nodeRange",2),u([(0,bn.property)({type:Number})],Ht.prototype,"iterations",2),u([(0,bn.property)({type:Boolean,reflect:!0})],Ht.prototype,"directed",2),u([(0,bn.property)({type:Boolean,reflect:!0,attribute:"edge-labels"})],Ht.prototype,"edgeLabels",2),Ht=u([(0,bn.customElement)("skdx-network-chart")],Ht);var Xn=require("lit/decorators.js");var Tn=class extends X{constructor(){super(...arguments);this.events=[];this.labels=!0}render(){let{events:t,orientation:r,xAxis:o,labels:a}=this,s={...this.sized(),events:t,orientation:r,xAxis:o,labels:a,...this.compactOverrides()};return this.root(Jo(s),"timeline",this.label??"Timeline chart",s)}};u([(0,Xn.property)({attribute:!1})],Tn.prototype,"events",2),u([(0,Xn.property)()],Tn.prototype,"orientation",2),u([(0,Xn.property)({attribute:!1})],Tn.prototype,"xAxis",2),u([(0,Xn.property)({type:Boolean,attribute:"no-labels",converter:Ne})],Tn.prototype,"labels",2),Tn=u([(0,Xn.customElement)("skdx-timeline-chart")],Tn);var Gn=require("lit/decorators.js");var gn=class extends X{constructor(){super(...arguments);this.segments=[];this.data=[];this.labels=!1}render(){let{segments:t,data:r,labels:o,gap:a,xAxis:s}=this,d={...this.sized(),segments:t,data:r,labels:o,gap:a,xAxis:s,...this.compactOverrides()};return this.root(ja(d),"marimekko",this.label??"Marimekko chart",d)}};u([(0,Gn.property)({attribute:!1})],gn.prototype,"segments",2),u([(0,Gn.property)({attribute:!1})],gn.prototype,"data",2),u([(0,Gn.property)({type:Boolean,reflect:!0})],gn.prototype,"labels",2),u([(0,Gn.property)({type:Number})],gn.prototype,"gap",2),u([(0,Gn.property)({attribute:!1})],gn.prototype,"xAxis",2),gn=u([(0,Gn.customElement)("skdx-marimekko-chart")],gn);var zn=require("lit/decorators.js");var on=class extends X{constructor(){super(...arguments);this.dimensions=[];this.data=[];this.connectNulls=!1}render(){let{dimensions:t,data:r,opacity:o,curve:a,connectNulls:s,filters:d}=this,i={...this.sized(),dimensions:t,data:r,opacity:o,curve:a,connectNulls:s,filters:d,...this.compactOverrides()};return this.root(Ga(i),"parallel",this.label??"Parallel coordinates chart",i)}};u([(0,zn.property)({attribute:!1})],on.prototype,"dimensions",2),u([(0,zn.property)({attribute:!1})],on.prototype,"data",2),u([(0,zn.property)({type:Number})],on.prototype,"opacity",2),u([(0,zn.property)()],on.prototype,"curve",2),u([(0,zn.property)({type:Boolean,reflect:!0,attribute:"connect-nulls"})],on.prototype,"connectNulls",2),u([(0,zn.property)({attribute:!1})],on.prototype,"filters",2),on=u([(0,zn.customElement)("skdx-parallel-coordinates-chart")],on);var an=require("lit/decorators.js");var Lt=class extends X{constructor(){super(...arguments);this.value=Number.NaN;this.labels=!0}render(){let{value:t,min:r,max:o,target:a,bands:s,orientation:d,caption:i,labels:c,ticks:m}=this,h={...this.sized(),value:t,min:r,max:o,target:a,bands:s,orientation:d,caption:i,labels:c,ticks:m,...this.compactOverrides()};return this.root(Wa(h),"linear-gauge",this.label??"Linear gauge",h)}};u([(0,an.property)({type:Number})],Lt.prototype,"value",2),u([(0,an.property)({type:Number})],Lt.prototype,"min",2),u([(0,an.property)({type:Number})],Lt.prototype,"max",2),u([(0,an.property)({type:Number})],Lt.prototype,"target",2),u([(0,an.property)({attribute:!1})],Lt.prototype,"bands",2),u([(0,an.property)()],Lt.prototype,"orientation",2),u([(0,an.property)()],Lt.prototype,"caption",2),u([(0,an.property)({type:Boolean,attribute:"no-labels",converter:Ne})],Lt.prototype,"labels",2),u([(0,an.property)({type:Number})],Lt.prototype,"ticks",2),Lt=u([(0,an.customElement)("skdx-linear-gauge")],Lt);var sn=require("lit/decorators.js");var zt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,startLabel:r,endLabel:o,orientation:a,labels:s,sort:d,markerSize:i,xAxis:c,references:m}=this,h={...this.sized(),data:t,startLabel:r,endLabel:o,orientation:a,labels:s,sort:d,markerSize:i,xAxis:c,references:m,...this.compactOverrides()};return this.root(qa(h),"dumbbell",this.label??"Dumbbell chart",h)}};u([(0,sn.property)({attribute:!1})],zt.prototype,"data",2),u([(0,sn.property)({attribute:"start-label"})],zt.prototype,"startLabel",2),u([(0,sn.property)({attribute:"end-label"})],zt.prototype,"endLabel",2),u([(0,sn.property)()],zt.prototype,"orientation",2),u([(0,sn.property)({type:Boolean,reflect:!0})],zt.prototype,"labels",2),u([(0,sn.property)()],zt.prototype,"sort",2),u([(0,sn.property)({type:Number,attribute:"marker-size"})],zt.prototype,"markerSize",2),u([(0,sn.property)({attribute:!1})],zt.prototype,"xAxis",2),u([(0,sn.property)({attribute:!1})],zt.prototype,"references",2),zt=u([(0,sn.customElement)("skdx-dumbbell-chart")],zt);var Rt=require("lit/decorators.js");var at=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1;this.brush=!1;this.crosshair=!1}render(){let{data:t,threshold:r,cumulativeLabel:o,name:a,labels:s,radius:d,barGap:i,barWidth:c,xAxis:m,yAxis:h,brush:f,crosshair:y}=this,$={...this.sized(),data:t,threshold:r,cumulativeLabel:o,name:a,labels:s,radius:d,barGap:i,barWidth:c,xAxis:m,yAxis:h,brush:f,crosshair:y,...this.compactOverrides()};return this.root(Za($),"pareto",this.label??"Pareto chart",$)}};u([(0,Rt.property)({attribute:!1})],at.prototype,"data",2),u([(0,Rt.property)({type:Number})],at.prototype,"threshold",2),u([(0,Rt.property)({attribute:"cumulative-label"})],at.prototype,"cumulativeLabel",2),u([(0,Rt.property)()],at.prototype,"name",2),u([(0,Rt.property)({type:Boolean,reflect:!0})],at.prototype,"labels",2),u([(0,Rt.property)({type:Number})],at.prototype,"radius",2),u([(0,Rt.property)({type:Number,attribute:"bar-gap"})],at.prototype,"barGap",2),u([(0,Rt.property)({type:Number,attribute:"bar-width"})],at.prototype,"barWidth",2),u([(0,Rt.property)({attribute:!1})],at.prototype,"xAxis",2),u([(0,Rt.property)({attribute:!1})],at.prototype,"yAxis",2),u([(0,Rt.property)({type:Boolean,reflect:!0})],at.prototype,"brush",2),u([(0,Rt.property)({type:Boolean,reflect:!0})],at.prototype,"crosshair",2),at=u([(0,Rt.customElement)("skdx-pareto-chart")],at);var xn=require("lit/decorators.js");var _t=class extends X{constructor(){super(...arguments);this.series=[];this.ranked=!1;this.labels=!0}render(){let{series:t,categories:r,ranked:o,topRank:a,curve:s,labels:d,markerSize:i,xAxis:c}=this,m={...this.sized(),series:t,categories:r,ranked:o,topRank:a,curve:s,labels:d,markerSize:i,xAxis:c,...this.compactOverrides()};return this.root(Xa(m),"bump",this.label??"Bump chart",m)}};u([(0,xn.property)({attribute:!1})],_t.prototype,"series",2),u([(0,xn.property)({attribute:!1})],_t.prototype,"categories",2),u([(0,xn.property)({type:Boolean,reflect:!0})],_t.prototype,"ranked",2),u([(0,xn.property)({type:Number,attribute:"top-rank"})],_t.prototype,"topRank",2),u([(0,xn.property)()],_t.prototype,"curve",2),u([(0,xn.property)({type:Boolean,attribute:"no-labels",converter:Ne})],_t.prototype,"labels",2),u([(0,xn.property)({type:Number,attribute:"marker-size"})],_t.prototype,"markerSize",2),u([(0,xn.property)({attribute:!1})],_t.prototype,"xAxis",2),_t=u([(0,xn.customElement)("skdx-bump-chart")],_t);var ln=require("lit/decorators.js");var Nt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,scale:r,max:o,startAngle:a,endAngle:s,padAngle:d,innerRadius:i,levels:c,labels:m}=this,h={...this.sized(),data:t,scale:r,max:o,startAngle:a,endAngle:s,padAngle:d,innerRadius:i,levels:c,labels:m,...this.compactOverrides()};return this.root(Ja(h),"polar-area",this.label??"Polar area chart",h)}};u([(0,ln.property)({attribute:!1})],Nt.prototype,"data",2),u([(0,ln.property)()],Nt.prototype,"scale",2),u([(0,ln.property)({type:Number})],Nt.prototype,"max",2),u([(0,ln.property)({type:Number,attribute:"start-angle"})],Nt.prototype,"startAngle",2),u([(0,ln.property)({type:Number,attribute:"end-angle"})],Nt.prototype,"endAngle",2),u([(0,ln.property)({type:Number,attribute:"pad-angle"})],Nt.prototype,"padAngle",2),u([(0,ln.property)({type:Number,attribute:"inner-radius"})],Nt.prototype,"innerRadius",2),u([(0,ln.property)({type:Number})],Nt.prototype,"levels",2),u([(0,ln.property)({type:Boolean,reflect:!0})],Nt.prototype,"labels",2),Nt=u([(0,ln.customElement)("skdx-polar-area-chart")],Nt);var Wn=require("lit/decorators.js");var yn=class extends X{constructor(){super(...arguments);this.series=[]}render(){let{series:t,orientation:r,markerSize:o,yAxis:a,references:s}=this,d={...this.sized(),series:t,orientation:r,markerSize:o,yAxis:a,references:s,...this.compactOverrides()};return this.root(es(d),"swarm",this.label??"Swarm plot",d)}};u([(0,Wn.property)({attribute:!1})],yn.prototype,"series",2),u([(0,Wn.property)()],yn.prototype,"orientation",2),u([(0,Wn.property)({type:Number,attribute:"marker-size"})],yn.prototype,"markerSize",2),u([(0,Wn.property)({attribute:!1})],yn.prototype,"yAxis",2),u([(0,Wn.property)({attribute:!1})],yn.prototype,"references",2),yn=u([(0,Wn.customElement)("skdx-swarm-plot")],yn);var vn=require("lit/decorators.js");var jt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,total:r,rows:o,columns:a,orientation:s,cellGap:d,cellRadius:i,labels:c}=this,m={...this.sized(),data:t,total:r,rows:o,columns:a,orientation:s,cellGap:d,cellRadius:i,labels:c,...this.compactOverrides()};return this.root(ts(m),"waffle",this.label??"Waffle chart",m)}};u([(0,vn.property)({attribute:!1})],jt.prototype,"data",2),u([(0,vn.property)({type:Number})],jt.prototype,"total",2),u([(0,vn.property)({type:Number})],jt.prototype,"rows",2),u([(0,vn.property)({type:Number})],jt.prototype,"columns",2),u([(0,vn.property)()],jt.prototype,"orientation",2),u([(0,vn.property)({type:Number,attribute:"cell-gap"})],jt.prototype,"cellGap",2),u([(0,vn.property)({type:Number,attribute:"cell-radius"})],jt.prototype,"cellRadius",2),u([(0,vn.property)({type:Boolean,reflect:!0})],jt.prototype,"labels",2),jt=u([(0,vn.customElement)("skdx-waffle-chart")],jt);var cn=require("lit/decorators.js");var Et=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!0}render(){let{data:t,orientation:r,nodeShape:o,linkStyle:a,rootId:s,collapsed:d,maxDepth:i,labels:c,nodeSize:m}=this,h={...this.sized(),data:t,orientation:r,nodeShape:o,linkStyle:a,rootId:s,collapsed:d,maxDepth:i,labels:c,nodeSize:m,...this.compactOverrides()};return this.root(no(h),"tree",this.label??"Tree chart",h)}};u([(0,cn.property)({attribute:!1})],Et.prototype,"data",2),u([(0,cn.property)()],Et.prototype,"orientation",2),u([(0,cn.property)({attribute:"node-shape"})],Et.prototype,"nodeShape",2),u([(0,cn.property)({attribute:"link-style"})],Et.prototype,"linkStyle",2),u([(0,cn.property)({attribute:!1})],Et.prototype,"rootId",2),u([(0,cn.property)({attribute:!1})],Et.prototype,"collapsed",2),u([(0,cn.property)({type:Number,attribute:"max-depth"})],Et.prototype,"maxDepth",2),u([(0,cn.property)({type:Boolean,attribute:"no-labels",converter:Ne})],Et.prototype,"labels",2),u([(0,cn.property)({type:Number,attribute:"node-size"})],Et.prototype,"nodeSize",2),Et=u([(0,cn.customElement)("skdx-tree-chart")],Et);var An=require("lit/decorators.js");var Xt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!0}render(){let{data:t,orientation:r,rootId:o,collapsed:a,maxDepth:s,labels:d,nodeSize:i}=this,c={...this.sized(),data:t,orientation:r,rootId:o,collapsed:a,maxDepth:s,labels:d,nodeSize:i,...this.compactOverrides()};return this.root(Ua(c),"organization",this.label??"Organization chart",c)}};u([(0,An.property)({attribute:!1})],Xt.prototype,"data",2),u([(0,An.property)()],Xt.prototype,"orientation",2),u([(0,An.property)({attribute:!1})],Xt.prototype,"rootId",2),u([(0,An.property)({attribute:!1})],Xt.prototype,"collapsed",2),u([(0,An.property)({type:Number,attribute:"max-depth"})],Xt.prototype,"maxDepth",2),u([(0,An.property)({type:Boolean,attribute:"no-labels",converter:Ne})],Xt.prototype,"labels",2),u([(0,An.property)({type:Number,attribute:"node-size"})],Xt.prototype,"nodeSize",2),Xt=u([(0,An.customElement)("skdx-organization-chart")],Xt);var Rn=require("lit/decorators.js");var dn=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!0}render(){let{data:t,rootId:r,maxDepth:o,labels:a,padding:s,colorScale:d}=this,i={...this.sized(),data:t,rootId:r,maxDepth:o,labels:a,padding:s,colorScale:d,...this.compactOverrides()};return this.root(Ya(i),"circle-packing",this.label??"Circle packing chart",i)}};u([(0,Rn.property)({attribute:!1})],dn.prototype,"data",2),u([(0,Rn.property)({attribute:!1})],dn.prototype,"rootId",2),u([(0,Rn.property)({type:Number,attribute:"max-depth"})],dn.prototype,"maxDepth",2),u([(0,Rn.property)({type:Boolean,attribute:"no-labels",converter:Ne})],dn.prototype,"labels",2),u([(0,Rn.property)({type:Number})],dn.prototype,"padding",2),u([(0,Rn.property)({attribute:!1})],dn.prototype,"colorScale",2),dn=u([(0,Rn.customElement)("skdx-circle-packing-chart")],dn);var mn=require("lit/decorators.js");var Dt=class extends X{constructor(){super(...arguments);this.data=[];this.breadcrumbs=!1;this.labels=!0}render(){let{data:t,orientation:r,rootId:o,breadcrumbs:a,maxDepth:s,sort:d,labels:i,padding:c,colorScale:m}=this,h={...this.sized(),data:t,orientation:r,rootId:o,breadcrumbs:a,maxDepth:s,sort:d,labels:i,padding:c,colorScale:m,...this.compactOverrides()};return this.root(Ka(h),"icicle",this.label??"Icicle chart",h)}};u([(0,mn.property)({attribute:!1})],Dt.prototype,"data",2),u([(0,mn.property)()],Dt.prototype,"orientation",2),u([(0,mn.property)({attribute:!1})],Dt.prototype,"rootId",2),u([(0,mn.property)({type:Boolean,reflect:!0})],Dt.prototype,"breadcrumbs",2),u([(0,mn.property)({type:Number,attribute:"max-depth"})],Dt.prototype,"maxDepth",2),u([(0,mn.property)()],Dt.prototype,"sort",2),u([(0,mn.property)({type:Boolean,attribute:"no-labels",converter:Ne})],Dt.prototype,"labels",2),u([(0,mn.property)({type:Number})],Dt.prototype,"padding",2),u([(0,mn.property)({attribute:!1})],Dt.prototype,"colorScale",2),Dt=u([(0,mn.customElement)("skdx-icicle-chart")],Dt);0&&(module.exports={SkdxAreaChart,SkdxBarChart,SkdxBoxplot,SkdxBubbleChart,SkdxBulletChart,SkdxBumpChart,SkdxCandlestickChart,SkdxChordChart,SkdxCirclePackingChart,SkdxComboChart,SkdxDumbbellChart,SkdxFunnelChart,SkdxGanttChart,SkdxGaugeChart,SkdxHeatmap,SkdxHistogram,SkdxIcicleChart,SkdxLineChart,SkdxLinearGauge,SkdxMapChart,SkdxMarimekkoChart,SkdxNetworkChart,SkdxOrganizationChart,SkdxParallelCoordinatesChart,SkdxParetoChart,SkdxPieChart,SkdxPolarAreaChart,SkdxRadarChart,SkdxRadialBarChart,SkdxRangeChart,SkdxSankeyChart,SkdxScatterChart,SkdxSparkline,SkdxSunburstChart,SkdxSwarmPlot,SkdxTimelineChart,SkdxTreeChart,SkdxTreemap,SkdxWaffleChart,SkdxWaterfallChart,csv,exportChart,makeFormatter,parseChartSnapshot,readChartSnapshot,seriesCsv,svgMarkup,syncGroup});
|