@skdx/web-components-charts 0.39.0 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/README.md +2 -3
  2. package/dist/area.cjs +38 -35
  3. package/dist/area.d.cts +1 -1
  4. package/dist/area.d.ts +1 -1
  5. package/dist/area.js +28 -25
  6. package/dist/bar.cjs +38 -35
  7. package/dist/bar.d.cts +1 -1
  8. package/dist/bar.d.ts +1 -1
  9. package/dist/bar.js +28 -25
  10. package/dist/boxplot.cjs +33 -30
  11. package/dist/boxplot.d.cts +1 -1
  12. package/dist/boxplot.d.ts +1 -1
  13. package/dist/boxplot.js +40 -37
  14. package/dist/bubble.cjs +37 -34
  15. package/dist/bubble.d.cts +1 -1
  16. package/dist/bubble.d.ts +1 -1
  17. package/dist/bubble.js +25 -22
  18. package/dist/bullet.cjs +40 -37
  19. package/dist/bullet.d.cts +1 -1
  20. package/dist/bullet.d.ts +1 -1
  21. package/dist/bullet.js +38 -35
  22. package/dist/bump.cjs +38 -35
  23. package/dist/bump.d.cts +1 -1
  24. package/dist/bump.d.ts +1 -1
  25. package/dist/bump.js +38 -35
  26. package/dist/candlestick.cjs +40 -37
  27. package/dist/candlestick.d.cts +1 -1
  28. package/dist/candlestick.d.ts +1 -1
  29. package/dist/candlestick.js +35 -32
  30. package/dist/chord.cjs +26 -23
  31. package/dist/chord.d.cts +1 -1
  32. package/dist/chord.d.ts +1 -1
  33. package/dist/chord.js +40 -37
  34. package/dist/circle-packing.cjs +26 -23
  35. package/dist/circle-packing.d.cts +1 -1
  36. package/dist/circle-packing.d.ts +1 -1
  37. package/dist/circle-packing.js +40 -37
  38. package/dist/combo.cjs +38 -35
  39. package/dist/combo.d.cts +1 -1
  40. package/dist/combo.d.ts +1 -1
  41. package/dist/combo.js +28 -25
  42. package/dist/dumbbell.cjs +32 -29
  43. package/dist/dumbbell.d.cts +1 -1
  44. package/dist/dumbbell.d.ts +1 -1
  45. package/dist/dumbbell.js +40 -37
  46. package/dist/funnel.cjs +30 -27
  47. package/dist/funnel.d.cts +1 -1
  48. package/dist/funnel.d.ts +1 -1
  49. package/dist/funnel.js +40 -37
  50. package/dist/gantt.cjs +40 -37
  51. package/dist/gantt.d.cts +1 -1
  52. package/dist/gantt.d.ts +1 -1
  53. package/dist/gantt.js +30 -27
  54. package/dist/gauge.cjs +34 -31
  55. package/dist/gauge.d.cts +1 -1
  56. package/dist/gauge.d.ts +1 -1
  57. package/dist/gauge.js +39 -36
  58. package/dist/heatmap.cjs +40 -37
  59. package/dist/heatmap.d.cts +1 -1
  60. package/dist/heatmap.d.ts +1 -1
  61. package/dist/heatmap.js +30 -27
  62. package/dist/histogram.cjs +30 -27
  63. package/dist/histogram.d.cts +1 -1
  64. package/dist/histogram.d.ts +1 -1
  65. package/dist/histogram.js +30 -27
  66. package/dist/icicle.cjs +45 -42
  67. package/dist/icicle.d.cts +1 -1
  68. package/dist/icicle.d.ts +1 -1
  69. package/dist/icicle.js +45 -42
  70. package/dist/{index-oF5ss8v9.d.cts → index-D44-61v7.d.cts} +11 -5
  71. package/dist/{index-oF5ss8v9.d.ts → index-D44-61v7.d.ts} +11 -5
  72. package/dist/index.cjs +40 -37
  73. package/dist/index.d.cts +2 -2
  74. package/dist/index.d.ts +2 -2
  75. package/dist/index.js +40 -37
  76. package/dist/line.cjs +38 -35
  77. package/dist/line.d.cts +1 -1
  78. package/dist/line.d.ts +1 -1
  79. package/dist/line.js +28 -25
  80. package/dist/linear-gauge.cjs +40 -37
  81. package/dist/linear-gauge.d.cts +1 -1
  82. package/dist/linear-gauge.d.ts +1 -1
  83. package/dist/linear-gauge.js +38 -35
  84. package/dist/map.cjs +40 -37
  85. package/dist/map.d.cts +1 -1
  86. package/dist/map.d.ts +1 -1
  87. package/dist/map.js +40 -37
  88. package/dist/marimekko.cjs +31 -28
  89. package/dist/marimekko.d.cts +1 -1
  90. package/dist/marimekko.d.ts +1 -1
  91. package/dist/marimekko.js +32 -29
  92. package/dist/network.cjs +26 -23
  93. package/dist/network.d.cts +1 -1
  94. package/dist/network.d.ts +1 -1
  95. package/dist/network.js +40 -37
  96. package/dist/organization.cjs +29 -26
  97. package/dist/organization.d.cts +1 -1
  98. package/dist/organization.d.ts +1 -1
  99. package/dist/organization.js +40 -37
  100. package/dist/parallel.cjs +25 -22
  101. package/dist/parallel.d.cts +1 -1
  102. package/dist/parallel.d.ts +1 -1
  103. package/dist/parallel.js +37 -34
  104. package/dist/pareto.cjs +30 -27
  105. package/dist/pareto.d.cts +1 -1
  106. package/dist/pareto.d.ts +1 -1
  107. package/dist/pareto.js +30 -27
  108. package/dist/pie.cjs +40 -37
  109. package/dist/pie.d.cts +1 -1
  110. package/dist/pie.d.ts +1 -1
  111. package/dist/pie.js +39 -36
  112. package/dist/polar-area.cjs +40 -37
  113. package/dist/polar-area.d.cts +1 -1
  114. package/dist/polar-area.d.ts +1 -1
  115. package/dist/polar-area.js +40 -37
  116. package/dist/radar.cjs +27 -24
  117. package/dist/radar.d.cts +1 -1
  118. package/dist/radar.d.ts +1 -1
  119. package/dist/radar.js +40 -37
  120. package/dist/radial.cjs +39 -36
  121. package/dist/radial.d.cts +1 -1
  122. package/dist/radial.d.ts +1 -1
  123. package/dist/radial.js +39 -36
  124. package/dist/range.cjs +30 -27
  125. package/dist/range.d.cts +1 -1
  126. package/dist/range.d.ts +1 -1
  127. package/dist/range.js +30 -27
  128. package/dist/sankey.cjs +31 -28
  129. package/dist/sankey.d.cts +1 -1
  130. package/dist/sankey.d.ts +1 -1
  131. package/dist/sankey.js +40 -37
  132. package/dist/scatter.cjs +28 -25
  133. package/dist/scatter.d.cts +1 -1
  134. package/dist/scatter.d.ts +1 -1
  135. package/dist/scatter.js +29 -26
  136. package/dist/sparkline.cjs +23 -20
  137. package/dist/sparkline.d.cts +1 -1
  138. package/dist/sparkline.d.ts +1 -1
  139. package/dist/sparkline.js +38 -35
  140. package/dist/sunburst.cjs +40 -37
  141. package/dist/sunburst.d.cts +1 -1
  142. package/dist/sunburst.d.ts +1 -1
  143. package/dist/sunburst.js +40 -37
  144. package/dist/swarm.cjs +36 -33
  145. package/dist/swarm.d.cts +1 -1
  146. package/dist/swarm.d.ts +1 -1
  147. package/dist/swarm.js +37 -34
  148. package/dist/timeline.cjs +24 -21
  149. package/dist/timeline.d.cts +1 -1
  150. package/dist/timeline.d.ts +1 -1
  151. package/dist/timeline.js +40 -37
  152. package/dist/tree.cjs +25 -22
  153. package/dist/tree.d.cts +1 -1
  154. package/dist/tree.d.ts +1 -1
  155. package/dist/tree.js +40 -37
  156. package/dist/treemap.cjs +27 -24
  157. package/dist/treemap.d.cts +1 -1
  158. package/dist/treemap.d.ts +1 -1
  159. package/dist/treemap.js +40 -37
  160. package/dist/waffle.cjs +38 -35
  161. package/dist/waffle.d.cts +1 -1
  162. package/dist/waffle.d.ts +1 -1
  163. package/dist/waffle.js +38 -35
  164. package/dist/waterfall.cjs +31 -28
  165. package/dist/waterfall.d.cts +1 -1
  166. package/dist/waterfall.d.ts +1 -1
  167. package/dist/waterfall.js +34 -31
  168. package/package.json +4 -4
package/dist/line.cjs CHANGED
@@ -1,61 +1,62 @@
1
- "use strict";var Ye=Object.defineProperty;var Un=Object.getOwnPropertyDescriptor;var Ur=Object.getOwnPropertyNames;var Kr=Object.prototype.hasOwnProperty;var qr=(e,n)=>{for(var t in n)Ye(e,t,{get:n[t],enumerable:!0})},Yr=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Ur(n))!Kr.call(e,i)&&i!==t&&Ye(e,i,{get:()=>n[i],enumerable:!(r=Un(n,i))||r.enumerable});return e};var Xr=e=>Yr(Ye({},"__esModule",{value:!0}),e),S=(e,n,t,r)=>{for(var i=r>1?void 0:r?Un(n,t):n,o=e.length-1,s;o>=0;o--)(s=e[o])&&(i=(r?s(n,t,i):s(i))||i);return r&&i&&Ye(n,t,i),i};var Vi={};qr(Vi,{SkdxLineChart:()=>_e});module.exports=Xr(Vi);var Dr=require("lit/decorators.js");var Kn=e=>Number(e.toPrecision(12)),Qr,qn=e=>(Qr??(Qr=new Intl.NumberFormat)).format(Kn(e)),Jr=e=>{let n=Math.round(Math.abs(e)),t=e<0?"-":"",r=Math.floor(n/3600),i=Math.floor(n%3600/60),o=s=>String(s).padStart(2,"0");return r>0?`${t}${r}h ${o(i)}m`:i>0?`${t}${i}m ${o(n%60)}s`:`${t}${n}s`};function ve(e){if(e===void 0)return qn;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:i="",timeZone:o}=e,s=u=>i?h=>u(h)+i:u,l=u=>r===void 0?u===void 0?{}:{maximumFractionDigits:u}:{minimumFractionDigits:r,maximumFractionDigits:r},c=u=>{let h=new Intl.NumberFormat(t,u);return s(b=>h.format(Kn(b)))},d=u=>{let h=new Intl.DateTimeFormat(t,o?{...u,timeZone:o}:u);return b=>h.format(b)};switch(n){case"integer":return c({maximumFractionDigits:0});case"decimal":return c(l(2));case"percent":return c({style:"percent",...l(0)});case"currency":return c({style:"currency",currency:e.currency??"USD",...l()});case"compact":return c({notation:"compact",...l(1)});case"scientific":return c({notation:"scientific",...l(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(Jr)}}function Xe(e,n){if(typeof e=="string")return e;let t=e instanceof Date?e.getTime():e;return n?ve(n)(t):e instanceof Date?new Intl.DateTimeFormat().format(e):qn(t)}var oe=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 we([e,n],[t,r]){let i=n-e;return o=>i===0?t:t+(o-e)/i*(r-t)}function pe(e,n,t=5){if(e===n)return[e];let r=(n-e)/Math.max(1,t),i=10**Math.floor(Math.log10(r)),o=r/i,s=(o<1.5?1:o<3.5?2:o<7.5?5:10)*i,l=Math.floor(e/s)*s,c=Math.ceil(n/s)*s,d=[];for(let u=l;u<=c+s/2;u+=s)d.push(Xn(u));return d}function Yn(e,[n,t],r=.2){let i=e===0?0:(t-n)/e,o=i*(1-Math.max(0,Math.min(.9,r)));return{step:i,bandwidth:o,start:s=>n+s*i+(i-o)/2,center:s=>n+(s+.5)*i}}var Xn=e=>Number(e.toPrecision(12)),m=e=>Number(e.toFixed(2)),I=e=>typeof e=="number"&&Number.isFinite(e),se=e=>e.filter(I);function ae(e){let n=1/0,t=-1/0;for(let r of e)I(r)&&(r<n&&(n=r),r>t&&(t=r));return n===1/0?[0,0]:[n,t]}function be(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 u=1;u<e.length;u++){let h=e[u-1],b=e[u];n==="stepAfter"?d+=`H${b.x}V${b.y}`:n==="stepBefore"?d+=`V${b.y}H${b.x}`:d+=`H${m((h.x+b.x)/2)}V${b.y}H${b.x}`}return d}if(n==="linear"||e.length<3)return`M${e.map(d=>`${d.x} ${d.y}`).join("L")}`;let r=e.length,i=e.slice(1).map((d,u)=>d.x-e[u].x),o=e.slice(1).map((d,u)=>d.y-e[u].y),s=i.map((d,u)=>d===0?0:o[u]/d),l=[s[0]];for(let d=1;d<r-1;d++){let u=s[d-1],h=s[d];l.push(u*h<=0?0:(u+h)/2)}l.push(s[r-2]);for(let d=0;d<r-1;d++){let u=s[d];if(u===0){l[d]=0,l[d+1]=0;continue}let h=l[d]/u,b=l[d+1]/u,y=Math.hypot(h,b);y>3&&(l[d]=3*h*u/y,l[d+1]=3*b*u/y)}let c=`M${t.x} ${t.y}`;for(let d=0;d<r-1;d++){let u=e[d],h=e[d+1],b=i[d]/3;c+=`C${m(u.x+b)} ${m(u.y+b*l[d])} ${m(h.x-b)} ${m(h.y-b*l[d+1])} ${h.x} ${h.y}`}return c}var Le=1e3,Re=60*Le,Ve=60*Re,Be=24*Ve,ei=[Le,5*Le,15*Le,30*Le,Re,5*Re,15*Re,30*Re,Ve,3*Ve,6*Ve,12*Ve,Be,2*Be,7*Be,14*Be];function Qn(e,n,t=6){if(!(n>e))return[e];let r=n-e,i=ei.find(h=>r/h<=t),o=[];if(i!==void 0){for(let h=Math.ceil(e/i)*i;h<=n;h+=i)o.push(h);return o.length?o:[e,n]}let s=r/(30*Be),l=[1,2,3,6,12,24,60,120].find(h=>s/h<=t)??240,c=new Date(e),d=c.getUTCFullYear(),u=Math.ceil((c.getUTCMonth()+(c.getUTCDate()>1?1:0))/l)*l;for(let h=Date.UTC(d,u,1);h<=n;)o.push(h),u+=l,u>=12&&(d+=Math.floor(u/12),u%=12),h=Date.UTC(d,u,1);return o.length?o:[e,n]}function Jn(e,n){let t=Math.floor(Math.log10(e)),r=Math.ceil(Math.log10(n)),i=r-t<=1?[1,2,5]:[1],o=[];for(let s=t;s<=r;s++)for(let l of i)o.push(Xn(l*10**s));return o.filter(s=>s>=e/1.0001&&s<=n*1.0001)}function Qe(e,n={}){if(n.thresholds&&n.thresholds.length>=2)return[...n.thresholds].filter(Number.isFinite).sort((c,d)=>c-d);let[t,r]=n.domain??ae(e),i=Math.max(1,e.length),o=Math.max(1,n.bins??Math.ceil(Math.log2(i)+1)),s=n.binWidth??(r>t?(r-t)/o:1),l=r>t?Math.max(1,Math.ceil((r-t)/s-1e-9)):1;return Array.from({length:l+1},(c,d)=>Number((t+d*s).toPrecision(12)))}function Je(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],i=n[n.length-1];for(let o of se(e)){if(o<r||o>i)continue;let s=0,l=t.length-1;for(;s<l;){let c=s+l+1>>1;t[c].x0<=o?s=c:l=c-1}t[s].count++}return t}var ti=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,ni=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,ri={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function ii(e,n,t){return e.replace(ni,(r,i,o)=>{let s=ri[i];if(s===void 0)return i+o;let c=(o.match(ti)??[]).map((d,u)=>{let h=Number(d);if(s===-1)return String(h+n);if(s===-2)return String(h+t);let b=u%s;return s===7?b===5?String(h+n):b===6?String(h+t):d:String(b%2===0?h+n:h+t)});return i+c.join(" ")})}var er=(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:ii(r.d,n,t)}}});var At=["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)"))),V={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)"},et=(e="neutral")=>e==="neutral"?V.axis:`var(--skdx-color-${e}-500)`,zt=(e="neutral")=>e==="neutral"?V.label:e==="primary"?"var(--skdx-color-text-accent)":`var(--skdx-color-text-${e})`,tr=(e,n)=>n??At[e%At.length];var ee={top:16,right:16,bottom:32,left:48};function nr(e,n,t=ee){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 Pe(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function Lt(e){let n=e.tooltip;return n===void 0||n===!0?{enabled:!0}:n===!1?{enabled:!1}:{...n,enabled:n.enabled??!0}}var rr=e=>e.crosshair===!0||Lt(e).trigger==="axis",tt=20,oi=120,ir=e=>{let n=Pe(e);return n&&(n.position==="left"||n.position==="right")?n.width??oi:0},nt=(e,n=600,t=300)=>({width:(e.width??n)-ir(e),height:(e.height??t)-(Pe(e)?.position==="bottom"?tt:0)}),or=(e,n,t)=>{let r=Pe(e);return!r||!(r.position===void 0||r.position==="top")?0:(n?Math.max(1,lr(n,t??nt(e).width,r)):1)*tt},te=6.5,sr=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:tr(n)),ar=(e,n)=>e.hiddenSeries?.includes(n)??!1;function Ot(e,n,t=[],r={},i=10,o=8,s=!1){let l=[],c=r.maxItems,d=c!==void 0&&c>=0&&e.length>c?e.slice(0,c):e,u=e.length-d.length,h=r.interactive??!0,b=o,y=i,x=(p,M,v,f)=>{let w=(M?18:4)+p.length*te;b>o&&(s||b+w>n-8)&&(b=o,y+=tt),M&&l.push({kind:"rect",part:"legend-swatch",x:b,y:y-5,width:10,height:10,fill:M,opacity:f?.3:void 0,item:v}),l.push({kind:"text",part:"legend-label",x:b+(M?14:0),y,text:p,baseline:"middle",fill:f?V.grid:V.label,item:v}),b+=w+12};for(let p of d){let M=t.includes(p.name),v=h?{label:p.name,series:p.name,legend:!0}:void 0;x(r.formatter?.(p.name)??p.name,p.color,v,M)}return u>0&&x(`+${u} more`,void 0,void 0,!1),r.align==="end"?si(l,n):l}function si(e,n){let t=new Map;for(let i of e){let o=i.kind==="rect"?i.y+5:i.y;t.set(o,[...t.get(o)??[],i])}let r=[];for(let i of t.values()){let o=Math.max(...i.map(l=>l.kind==="rect"?l.x+l.width:l.x+l.text.length*te)),s=n-8-o;for(let l of i)r.push({...l,x:l.x+s})}return r}var lr=(e,n,t={})=>new Set(Ot(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function Rt(e,n,t,r=[]){let i=Pe(e),o=i&&e.direction==="rtl"&&i.align===void 0?{...i,align:"end"}:i,s=Lt(e),l=o?.position==="bottom",c=ir(e),d=e.hiddenSeries??[],u=o?c?Ot(r,1/0,d,o,10,(o.position==="right"?n:0)+8,!0):Ot(r,n,d,o,l?t+10:10):[],h=l?lr(r,n,o):0;return{width:n+c,height:l?t+Math.max(1,h)*tt:t,legendOffset:o?.position==="left"?c: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:u}}function Vt(e){let n=e.legendOffset;if(!n)return e;let t=[...er(e.shapes.filter(c=>!c.part.startsWith("legend-")),n,0),...e.shapes.filter(c=>c.part.startsWith("legend-"))],r=c=>({...c,x:c.x+n}),i=e.hit?{...e.hit,plot:r(e.hit.plot),xs:e.hit.xs.map(c=>c+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:c=>o.scale(c)+n,invert:c=>o.invert(c-n),bars:o.bars.map(c=>({...c,x0:c.x0+n,x1:c.x1+n}))}:void 0,l=e.map?{...e.map,plot:r(e.map.plot)}:void 0;return{...e,shapes:t,hit:i,edit:s,map:l,legendOffset:void 0}}function rt(e,n,t,r,i,o="auto"){let s=Array.isArray(t)?t:[t],l=Math.max(...s.map(b=>b.length))*te+12,c=6+s.length*16,d=o==="top"?{x:e-l/2,y:n-c-8}:o==="bottom"?{x:e-l/2,y:n+8}:o==="left"?{x:e-l-8,y:n-c/2}:o==="right"?{x:e+8,y:n-c/2}:{x:e+12,y:n-c-6},u=Math.max(0,Math.min(r-l,d.x)),h=Math.max(0,Math.min(i-c,d.y));return[{kind:"rect",part:"tooltip",x:m(u),y:m(h),width:m(l),height:c,fill:"var(--skdx-color-surface-raised)",stroke:V.axis,rx:3},...s.map((b,y)=>({kind:"text",part:"tooltip-label",x:m(u+6),y:m(h+11+y*16),text:b,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:s.length>1&&y===0?"bold":void 0}))]}function cr([e,n],t,r=!1,i){let o=typeof r=="boolean"?{scale:r?"log":"linear"}:r,s=ve(o.format??i),l=o.min??e,c=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 p=z=>Math.sign(z)*Math.sqrt(Math.abs(z)),M=o.nice===!1?[l,c]:pe(l,c,o.ticks),v=o.min??M[0],f=o.max??M[M.length-1],w=we([p(v),p(f)],t),T=z=>w(p(z)),k=pe(v,f,o.ticks).filter(z=>z>=v-1e-9&&z<=f+1e-9);return{...d,scale:T,domain:[v,f],format:s,ticks:(k.length>=2?k:[v,f]).map(z=>({pos:m(T(z)),label:s(z)})),zero:m(T(Math.min(Math.max(0,v),f)))}}if(o.scale==="log"){let p=Math.max(l,Number.EPSILON),M=Math.max(c,p),v=Jn(p,M),f=[Math.log10(p),Math.log10(M)],w=we(f,t),T=k=>w(Math.log10(Math.max(k,Number.EPSILON)));return{...d,scale:T,domain:f,format:s,ticks:v.map(k=>({pos:m(T(k)),label:s(k)})),zero:m(t[0])}}let u=pe(l,c,o.ticks),h=[o.min??(o.nice===!1?l:u[0]),o.max??(o.nice===!1?c:u[u.length-1])],b=we(h,t),y=u.filter(p=>p>=h[0]-1e-9&&p<=h[1]+1e-9),x=(y.length>=2?y:[h[0],h[1]]).map(p=>({pos:m(b(p)),label:s(p)}));return{...d,scale:b,domain:h,format:s,ticks:x,zero:m(b(Math.min(Math.max(0,h[0]),h[1])))}}var dr=([e,n],t)=>Math.max(ee.left,pe(e,n).reduce((r,i)=>Math.max(r,t(i).length),0)*te+14),ur=e=>e?.grid!==!1;function it(e,n){if(e.length<2)return e;let t=e.reduce((i,o)=>Math.max(i,o.label.length),0)*te+8,r=Math.max(1,Math.ceil(e.length*t/Math.max(1,n)));return r===1?e:e.filter((i,o)=>o%r===0)}var Bt=(e,n,t,r)=>`${e}, ${n}: ${r(t)}`;function hr(e,n,t,r){let i=e.error!==void 0?"error":e.loading?"loading":n?"empty":null;if(!i)return null;let{width:o,height:s}=nt(e,t,r),l=i==="error"?e.error:i==="loading"?"Loading\u2026":e.emptyMessage??"No data available",c=[];return i==="loading"&&c.push({kind:"rect",part:"skeleton",x:0,y:0,width:o,height:s,fill:"var(--skdx-color-surface-sunken)",rx:4}),c.push({kind:"text",part:`state-${i}`,x:m(o/2),y:m(s/2),text:l,anchor:"middle",baseline:"middle",fill:i==="error"?"var(--skdx-color-text-danger)":V.label}),{...Rt(e,o,s),shapes:c,tooltip:!1}}var fr=(e,n,t)=>{let r=n.length*te/2;return e+r>t?"end":e-r<0?"start":"middle"};function Pt(e,n={}){let{plot:t,xTicks:r,yTicks:i,baseline:o}=e,s=t.x+t.width,l=t.y+t.height,c=[],d=n.grid??!0,u=(x,p)=>p?{kind:"line",part:"grid",x1:x.pos,x2:x.pos,y1:t.y,y2:l,stroke:V.grid}:{kind:"line",part:"grid",x1:t.x,x2:s,y1:x.pos,y2:x.pos,stroke:V.grid},h=n.x?.tickRotation??0,b=(x,p,M,v)=>h?Y(x,p,M,{part:v,anchor:h<0?"end":"start",baseline:"middle",rotate:h}):Y(x,p,M,{part:v,anchor:fr(x,M,e.width)}),y=(x,p,M,v,f)=>{for(let w of x)c.push(p==="x"?{kind:"line",part:"tick",x1:w.pos,x2:w.pos,y1:M,y2:m(M+v*f),stroke:V.axis}:{kind:"line",part:"tick",x1:M,x2:m(M+v*f),y1:w.pos,y2:w.pos,stroke:V.axis})};if(n.categoryGrid)for(let x of r)c.push(u(x,!n.horizontal));if(n.horizontal){let x=n.axes??[{ticks:i,position:"bottom",offset:0,label:n.yLabel,...n.y}];if(d)for(let p of i)c.push(u(p,!0));x[0]?.showLine!==!1&&c.push({kind:"line",part:"axis",x1:o,x2:o,y1:t.y,y2:l,stroke:V.axis});for(let p of x){let M=p.position==="top"||p.position==="right",v=m(M?t.y-p.offset:l+p.offset),f=M||p.offset>0;p.showLine&&f&&c.push({kind:"line",part:"axis",x1:t.x,x2:s,y1:v,y2:v,stroke:V.axis}),p.showTicks&&y(p.ticks,"x",v,M?-1:1,p.tickSize??4);let w=m(M?v-8:v+20);for(let T of p.ticks)c.push(M?Y(T.pos,w,T.label,{part:"x-label-top",anchor:fr(T.pos,T.label,e.width)}):b(T.pos,w,T.label,"x-label"));p.label&&c.push(f?Y(4,w,p.label,{part:"axis-title",anchor:"start",baseline:M?void 0:"middle"}):Y(4,t.y-6,p.label,{part:"axis-title",anchor:"start"}))}n.x?.showLine&&c.push({kind:"line",part:"axis",x1:n.rtl?s:t.x,x2:n.rtl?s:t.x,y1:t.y,y2:l,stroke:V.axis}),n.x?.showTicks&&y(r,"y",n.rtl?s:t.x,n.rtl?1:-1,n.x.tickSize??4);for(let p of r)c.push(n.rtl?Y(s+8,p.pos,p.label,{part:"y-label",anchor:"start",baseline:"middle"}):Y(t.x-8,p.pos,p.label,{part:"y-label",anchor:"end",baseline:"middle"}))}else{if(d)for(let p of i)c.push(u(p,!1));n.y?.showLine!==!1&&c.push({kind:"line",part:"axis",x1:t.x,x2:s,y1:o,y2:o,stroke:V.axis});let x=n.axes??[{ticks:i,position:"left",offset:0,label:n.yLabel,...n.y},...n.rightTicks?[{ticks:n.rightTicks,position:"right",offset:0,label:n.rightLabel}]:[]];for(let p of x){let M=p.position==="left",v=M?t.x-p.offset:s+p.offset,f=M?"y-label":"y-label-right";p.showLine&&c.push({kind:"line",part:"axis",x1:m(v),x2:m(v),y1:t.y,y2:l,stroke:V.axis}),p.showTicks&&y(p.ticks,"y",m(v),M?-1:1,p.tickSize??4);for(let w of p.ticks)c.push(Y(m(M?v-8:v+8),w.pos,w.label,{part:f,anchor:M?"end":"start",baseline:"middle"}));p.label&&c.push(Y(m(M?p.offset===0?4:Math.max(4,v-40):p.offset===0?e.width-4:Math.min(e.width-4,v+40)),t.y-6,p.label,{part:"axis-title",anchor:M?"start":"end"}))}n.x?.showTicks&&y(r,"x",l,1,n.x.tickSize??4);for(let p of r)c.push(b(p.pos,l+(h?12:20),p.label,"x-label"))}return n.xLabel&&c.push(Y(m(t.x+t.width/2),e.height-4,n.xLabel,{part:"axis-title",anchor:"middle"})),n.horizontal&&n.rightLabel&&c.push(Y(e.width-4,t.y-6,n.rightLabel,{part:"axis-title",anchor:"end"})),c}var Y=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:V.label,...r}),De=(e,n,t,r,i,o)=>({kind:"circle",part:"point",cx:e,cy:n,r:t,fill:r,title:i,item:o});function Dt(e,n){let t=[],{plot:r}=n,i=r.x+r.width,o=r.y+r.height,s=c=>Math.max(r.x,Math.min(i,c)),l=c=>Math.max(r.y,Math.min(o,c));for(let c of e??[]){let d=c.color??et(c.variant),u=c.color??zt(c.variant),h={part:"reference-label",fill:u},b=n.horizontal===!0;if("y"in c){let y=m(n.y(c.y,c.axis??"left"));if(b){let x=s(y);t.push(...pr(x,r.y,o,d,c.label,h))}else{let x=l(y);t.push(...mr(r.x,i,x,d,c.label,h))}}else if("x"in c){let y=n.x(c.x);if(y===void 0)continue;b?t.push(...mr(r.x,i,l(m(y)),d,c.label,h)):t.push(...pr(s(m(y)),r.y,o,d,c.label,h))}else if("y1"in c){let y=m(n.y(c.y1,c.axis??"left")),x=m(n.y(c.y2,c.axis??"left"));b?t.push(...gr(s(Math.min(y,x)),s(Math.max(y,x)),r,d,c.label,u)):t.push(...br(l(Math.min(y,x)),l(Math.max(y,x)),r,d,c.label,u))}else{let y=n.x(c.x1),x=n.x(c.x2);if(y===void 0||x===void 0)continue;let p=m(Math.min(y,x)),M=m(Math.max(y,x));b?t.push(...br(l(p),l(M),r,d,c.label,u)):t.push(...gr(s(p),s(M),r,d,c.label,u))}}return t}function mr(e,n,t,r,i,o){let s={kind:"line",part:"reference",x1:e,x2:n,y1:t,y2:t,stroke:r,dash:"6 4",strokeWidth:1.5,title:i};return i?[s,Y(n-4,t-5,i,{...o,anchor:"end"})]:[s]}function pr(e,n,t,r,i,o){let s={kind:"line",part:"reference",x1:e,x2:e,y1:n,y2:t,stroke:r,dash:"6 4",strokeWidth:1.5,title:i};return i?[s,Y(e+4,n+10,i,{...o,anchor:"start"})]:[s]}function br(e,n,t,r,i,o){let s={kind:"rect",part:"reference-area",x:t.x,y:e,width:t.width,height:m(Math.max(0,n-e)),fill:r,opacity:.12,title:i};return i?[s,Y(t.x+t.width-4,e+12,i,{part:"reference-label",fill:o,anchor:"end"})]:[s]}function gr(e,n,t,r,i,o){let s={kind:"rect",part:"reference-area",x:e,y:t.y,width:m(Math.max(0,n-e)),height:t.height,fill:r,opacity:.12,title:i};return i?[s,Y(e+4,t.y+12,i,{part:"reference-label",fill:o,anchor:"start"})]:[s]}function xr(e,n){let t=[],{plot:r}=n,i=r.x+r.width,o=r.y+r.height;for(let s of e??[]){let l=s.color??et(s.variant),c=s.color??zt(s.variant),d=(x,p,M)=>{let v=n.x(x);if(v===void 0)return;let f=n.y(p,M??"left");return n.horizontal?{x:m(f),y:m(v)}:{x:m(v),y:m(f)}},u=s.id??s.label,h=x=>({label:x,id:u,name:s.label});if(s.type==="line"||s.type==="band"){let{type:x,id:p,...M}=s;t.push(...Dt([M],n));continue}if(s.type==="rect"){let x=d(s.x1,s.y1,s.axis),p=d(s.x2,s.y2,s.axis);if(!x||!p)continue;let M=Math.max(r.x,Math.min(x.x,p.x)),v=Math.max(r.y,Math.min(x.y,p.y)),f=s.label??"";t.push({kind:"rect",part:"annotation-rect",x:m(M),y:m(v),width:m(Math.max(0,Math.min(i,Math.max(x.x,p.x))-M)),height:m(Math.max(0,Math.min(o,Math.max(x.y,p.y))-v)),fill:l,opacity:.12,stroke:l,title:f||void 0,item:f?h(f):void 0}),s.label&&t.push(Y(m(M+4),m(v+12),s.label,{part:"annotation-label",fill:c}));continue}let b=d(s.x,s.y,s.axis);if(!b)continue;if(s.type==="text"){t.push(Y(b.x,b.y,s.text,{part:"annotation-text",fill:c,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:b.x,cy:b.y,r:5,fill:l,stroke:"var(--skdx-color-surface-default)",title:y,item:h(y)}),s.type==="callout"&&s.label){let[x,p]=s.offset??[16,-16],M=m(Math.max(r.x,Math.min(i,b.x+x))),v=m(Math.max(r.y,Math.min(o,b.y+p)));t.push({kind:"line",part:"annotation-leader",x1:b.x,y1:b.y,x2:M,y2:v,stroke:l},Y(M,v,s.label,{part:"annotation-label",fill:c,anchor:x>=0?"start":"end",baseline:"middle"}))}}return t}var Nt=2e3;function ai(e){if(e!=="none")return e===void 0||e==="auto"?{strategy:"lttb",threshold:Nt}:typeof e=="string"?{strategy:e,threshold:Nt}:{strategy:e.strategy,threshold:e.threshold??Nt}}function li(e,n){let t=e.length;if(n>=t||n<3)return e.map((l,c)=>c);let r=[0],i=[],o=(t-2)/(n-2),s=0;for(let l=0;l<n-2;l++){let c=Math.floor((l+1)*o)+1,d=Math.min(t-1,Math.floor((l+2)*o)+1),u=0,h=0,b=0;for(let w=c;w<d;w++){let T=e[w];I(T)&&(u+=w,h+=T,b++)}u=b?u/b:(c+d)/2,h=b?h/b:0;let y=Math.floor(l*o)+1,x=Math.min(t-1,Math.floor((l+1)*o)+1),p=e[s],M=I(p)?p:0,v=-1,f=-1;for(let w=y;w<x;w++){let T=e[w];if(!I(T)){i.push(w);continue}let k=Math.abs((s-u)*(T-M)-(s-w)*(h-M));k>f&&(f=k,v=w)}v<0&&(v=y),r.push(v),s=v}return r.push(t-1),i.length?[...new Set([...r,...i])].sort((l,c)=>l-c):r}function ci(e,n){let t=e.length,r=Math.max(1,Math.floor(n/2));if(r*2>=t)return e.map((s,l)=>l);let i=[],o=t/r;for(let s=0;s<r;s++){let l=Math.floor(s*o),c=s===r-1?t:Math.floor((s+1)*o),d=-1,u=-1;for(let h=l;h<c;h++){let b=e[h];if(!I(b)){i.push(h);continue}(d<0||b<e[d])&&(d=h),(u<0||b>e[u])&&(u=h)}d>=0&&i.push(Math.min(d,u)),u>=0&&u!==d&&i.push(Math.max(d,u))}return[...new Set(i)].sort((s,l)=>s-l)}function di(e,n){let t=e.length,r=Math.max(1,Math.floor(n/4));if(r*4>=t)return e.map((s,l)=>l);let i=[],o=t/r;for(let s=0;s<r;s++){let l=Math.floor(s*o),c=s===r-1?t:Math.floor((s+1)*o),d=-1,u=-1,h=-1,b=-1;for(let y=l;y<c;y++){let x=e[y];if(!I(x)){i.push(y);continue}h<0&&(h=y),b=y,(d<0||x<e[d])&&(d=y),(u<0||x>e[u])&&(u=y)}for(let y of[h,d,u,b])y>=0&&i.push(y)}return[...new Set(i)].sort((s,l)=>s-l)}function yr(e,n,t){let r=ai(t);if(!r||n<=r.threshold||e.length===0)return;let i=r.strategy==="minmax"?ci:r.strategy==="m4"?di:li,o=new Set;for(let s of e)for(let l of i(s.slice(0,n),r.threshold))o.add(l);return[...o].sort((s,l)=>s-l)}function kr(e,n,t,r,i,o,s,l){if(r==="circle")return{...De(e,n,t,i,o,s),part:l};let c=r==="square"?`M${m(e-t)} ${m(n-t)}h${m(2*t)}v${m(2*t)}h${m(-2*t)}Z`:r==="diamond"?`M${m(e)} ${m(n-t*1.3)}L${m(e+t*1.3)} ${m(n)}L${m(e)} ${m(n+t*1.3)}L${m(e-t*1.3)} ${m(n)}Z`:`M${m(e)} ${m(n-t*1.2)}L${m(e+t*1.15)} ${m(n+t*.9)}L${m(e-t*1.15)} ${m(n+t*.9)}Z`;return{kind:"path",part:l,d:c,fill:i,title:o,item:s}}var ui=e=>{let n=0;return e.map(t=>I(t)?n+=t:null)},hi=e=>e.map((n,t)=>{let r=e[t-1];return t>0&&I(n)&&I(r)?n-r:null}),fi=e=>e.map((n,t)=>{let r=e[t-1];return t>0&&I(n)&&I(r)&&r!==0?(n-r)/Math.abs(r):null});function mi(e,n){let t=Math.max(1,Math.floor(n));return e.map((r,i)=>{if(i<t-1)return null;let o=0;for(let s=i-t+1;s<=i;s++){let l=e[s];if(!I(l))return null;o+=l}return o/t})}function pi(e,n="max"){let t=0;for(let r of e)I(r)&&(t=n==="sum"?t+r:Math.max(t,r));return e.map(r=>I(r)?t===0?0:r/t:null)}function bi(e,n="desc"){let t=e.filter(I).sort((r,i)=>n==="asc"?r-i:i-r);return e.map(r=>I(r)?t.indexOf(r)+1:null)}var gi=(e,n=-1/0,t=1/0)=>e.map(r=>I(r)&&r>=n&&r<=t?r:null),xi=(e,n="asc")=>[...e].sort((t,r)=>I(t)?I(r)?n==="asc"?t-r:r-t:-1:I(r)?1:0);function yi(e,n,t="sum"){let r=Math.max(1,Math.floor(n)),i=[];for(let o=0;o<e.length;o+=r){let s=e.slice(o,o+r).filter(I);if(s.length===0){i.push(null);continue}let l=s.reduce((c,d)=>c+d,0);i.push(t==="sum"?l:t==="mean"?l/s.length:t==="min"?Math.min(...s):Math.max(...s))}return i}function ki(e,n={}){let t=e.filter(I),r=Qe(t,n);return{edges:r,counts:Je(t,r).map(i=>i.count)}}function Ft(e,n){let t=[...e];for(let r of n??[])switch(r.type){case"cumulative":t=ui(t);break;case"difference":t=hi(t);break;case"percentageChange":t=fi(t);break;case"movingAverage":t=mi(t,r.window);break;case"normalize":t=pi(t,r.to);break;case"rank":t=bi(t,r.order);break;case"filter":t=gi(t,r.min,r.max);break;case"sort":t=xi(t,r.order);break;case"aggregate":t=yi(t,r.every,r.method);break;case"bin":t=ki(t,r).counts;break}return t}var vi=100,wi=2e3,vr=32,wr=28,st=e=>e.position==="right"||e.position==="top";function Mi(e){let t=(e.yAxis===void 0?[]:Array.isArray(e.yAxis)?e.yAxis:[e.yAxis]).map((i,o)=>({...i,id:i.id??(o===0?"left":o===1?"right":String(o)),position:i.position??(o===1?"right":"left")}));t.length===0&&t.push({id:"left",position:"left"});let r=t.some(i=>i.id==="right"||st(i));return e.rightAxis?t.push({...e.rightAxis,id:"right",position:"right"}):!r&&e.series.some(i=>i.axis==="right")&&t.push({id:"right",position:"right"}),t}function Sr(e,n){let t=e[0]?.id;return n===void 0||n==="left"?t:n==="right"?(e.find(r=>r.id==="right")??e.find(st))?.id:e.find(r=>r.id===n)?.id}var ot=e=>e.kind==="bar"||e.kind==="range"&&e.style==="bar";function $r(e,n){let t=ve(e.format),{series:r,categories:i,issues:o,axes:s}=$i(e,n,t),l=e.direction==="rtl",c=e.baseline??0,d=Math.max(i.length,...r.map(a=>Math.max(a.data.length,a.low.length))),u=r.every(a=>se(a.data).length===0&&se(a.high).length===0),h=hr(e,u);if(h)return{...h,issues:o};let b=e.xAxis?.type??"category",y=b!=="category"&&i.length>0&&i.every(a=>typeof a!="string"||b==="time"&&I(oe(a))),x=y?i.map(oe):[],[p,M]=ae(x),v=e.xAxis?.format??(b==="time"?{style:M-p<2*864e5?"time":"date"}:void 0),f=Array.from({length:d},(a,g)=>{let C=i[g];return C===void 0?String(g+1):Xe(C,v)}),w=Si(e.zoom,d),T=Array.from({length:w.end-w.start},(a,g)=>w.start+g),k=e.orientation==="horizontal",G=r.map(a=>({...a,hidden:a.hidden||k&&!ot(a)})).filter(a=>!a.hidden),H=G.some(a=>!ot(a))?yr(G.filter(a=>!ot(a)).map(a=>T.map(g=>(a.kind==="range"?a.high[g]:a.data[g])??null)),T.length,e.sampling):void 0,P=H?H.map(a=>T[a]):T,X=e.stacked==="percent"||e.stackOffset==="expand",Q=e.stackOffset??"zero",ne=new Map,de=new Map,ft=new Map;for(let a of G)a.stack!==void 0&&a.kind!=="range"&&ft.set(a.stack,[...ft.get(a.stack)??[],a]);for(let a of ft.values()){let g=new Array(d).fill(c),C=new Array(d).fill(c),_=new Array(d).fill(0);if(X)for(let N of a)N.data.forEach((R,j)=>{I(R)&&(_[j]=_[j]+Math.abs(R))});for(let N of a){let R=[],j=[];for(let D=0;D<d;D++){let F=N.data[D];if(!I(F)){R.push(null),j.push(null);continue}let L=_[D],A=X?L>0?F/L:0:F,Z=A>=0?g:C;R.push(Z[D]),Z[D]=Z[D]+A,j.push(Z[D])}ne.set(N,R),de.set(N,j)}if(Q==="silhouette"||Q==="wiggle"){let N=new Array(d).fill(0);if(Q==="silhouette")for(let R=0;R<d;R++)N[R]=-(g[R]-c)/2;else{let R=0;for(let j=0;j<d;j++){let D=a.length,F=0;for(let A=0;A<D;A++){let Z=a[A],W=Z.data[j],q=Z.data[j-1],J=j>0&&I(W)&&I(q)?W-q:0;F+=(D-A-.5)*J}let L=g[j]-c;R=j===0?-L/2:R-(L>0?F/Math.max(1,D):0),N[j]=R}}for(let R of a){let j=ne.get(R),D=de.get(R);for(let F=0;F<d;F++){let L=j[F],A=D[F];I(L)&&(j[F]=L+N[F]),I(A)&&(D[F]=A+N[F])}}}}let wn=a=>a.kind==="range"?{from:a.low,to:a.high}:{from:ne.get(a)??new Array(d).fill(c),to:de.get(a)??a.data},Mn=a=>{let g=[],C=!1;for(let R of G){if(R.axis!==a)continue;let{from:j,to:D}=wn(R);for(let F of P){let L=D[F];if(I(L)&&g.push(L),R.kind==="range"||R.stack!==void 0){let A=j[F];I(A)&&g.push(A)}}if(R.errors)for(let F of P){let L=Mr(R.data[F],R.errors[F]);L&&g.push(L[0],L[1])}(R.kind==="bar"||R.kind==="area")&&Q==="zero"&&(C=!0)}let[_,N]=ae(g);return C?[Math.min(c,_),Math.max(c,N)]:[_,N]},{width:Sn,height:$n}=nt(e),Nr=e.brush?vr+wr:0,Cn=P.reduce((a,g)=>Math.max(a,f[g].length),0)*te,In=X?{style:"percent"}:void 0,Fr=a=>{if(a.scale==="log")return ee.left;let[g,C]=Mn(a.id),_=ve(a.format??In??e.format);return dr([a.min??g,a.max??C],_)+(a.showTicks?a.tickSize??4:0)},mt=a=>k?st(a)?"top":"bottom":st(a)!==l?"right":"left",Tn=a=>k?24+(a.showTicks?a.tickSize??4:0):Fr(a),Gr=new Set(G.map(a=>a.axis)),pt=s.filter(a=>Gr.has(a.id)||s.length>1),An=new Map,ge={left:0,right:0,top:0,bottom:0};for(let a of pt){let g=mt(a);An.set(a.id,ge[g]),ge[g]+=Tn(a)}let zn=pt.find(a=>mt(a)==="bottom"),_r={top:ee.top+or(e)+(s.some(a=>a.label)?12:0)+ge.top,right:k?l?Math.max(ee.left,Cn+16):ee.right:Math.max(ee.right,ge.right),bottom:ee.bottom+Nr+(e.xAxis?.label?14:0)+(e.xAxis?.tickRotation?24:0)+ge.bottom-(zn?Tn(zn):0),left:k?l?ee.right:Math.max(ee.left,Cn+16):Math.max(ee.left,ge.left)},K=nr(Sn,$n,_r),jr=k?l?[K.x+K.width,K.x]:[K.x,K.x+K.width]:[K.y+K.height,K.y],On=k?[K.y,K.y+K.height]:l?[K.x+K.width,K.x]:[K.x,K.x+K.width],bt=new Map(s.map(a=>[a.id,{...cr(Mn(a.id),jr,{format:In,...a},e.format),position:mt(a),offset:An.get(a.id)??0}])),Ln=s[0]?.id,je=bt.get(Ln),gt=a=>bt.get(Sr(s,a)??Ln)??je,re=(a,g)=>gt(g).scale(a),Rn=a=>m(a.scale(Math.min(Math.max(c,Math.min(...a.domain)),Math.max(...a.domain)))),He=Yn(P.length,On,e.barGap),xt=P.map(a=>x[a]),yt=[...xt].sort((a,g)=>a-g),xe=1/0;for(let a=1;a<yt.length;a++)xe=Math.min(xe,yt[a]-yt[a-1]);let[ye,Ce]=ae(xt),ie=xe===1/0?Math.max(1,Math.abs(Ce)*.05||1):xe/2,Ie=we([ye-ie,Ce+ie],On),Ze=a=>m(y?Ie(xt[a]):He.center(a)),Vn=y?Math.abs(Ie(ye+(xe===1/0?ie:xe))-Ie(ye))*.8:He.bandwidth,Bn=a=>y?Ze(a)-Vn/2:He.start(a),Hr=y?(b==="time"?Qn(ye-ie,Ce+ie):pe(ye-ie,Ce+ie)).filter(a=>a>=ye-ie&&a<=Ce+ie).map(a=>({pos:m(Ie(a)),label:Xe(a,v)})):it(P.map((a,g)=>({pos:Ze(g),label:f[a]})),k?1/0:K.width/Math.max(.2,Math.abs(Math.cos((e.xAxis?.tickRotation??0)*Math.PI/180)))),kt={...Rt(e,Sn,$n,r.map(a=>({name:a.name,color:a.color}))),plot:K,xTicks:Hr,yTicks:k?it(je.ticks,K.width):je.ticks,baseline:Rn(je)},Zr=s[0],Pn=Pt(kt,{horizontal:k,rtl:l,axes:pt.map(a=>{let g=bt.get(a.id);return{ticks:k?it(g.ticks,K.width):g.ticks,position:g.position,offset:g.offset??0,label:a.label,showLine:a.showLine,showTicks:a.showTicks,tickSize:a.tickSize}}),xLabel:e.xAxis?.label,grid:ur(Zr),categoryGrid:e.xAxis?.grid===!0,x:e.xAxis}),Er=a=>{if(typeof a=="number"&&i.every(C=>typeof C=="string"))return a;let g=typeof a=="string"?a:oe(a);for(let C=0;C<d;C++){let _=i[C];if(_!==void 0&&(typeof g=="string"?_===g||f[C]===g:oe(_)===g))return C}},Dn={plot:K,horizontal:k,x:a=>{if(y&&(typeof a!="string"||I(oe(a))))return Ie(oe(a));let g=Er(a),C=g===void 0?-1:P.indexOf(g);return C<0?void 0:He.center(C)},y:(a,g)=>re(a,g)};Pn.push(...Dt(e.references,Dn));let vt=[],wt=new Map;for(let a of G){if(!ot(a))continue;let g=a.stack??a,C=vt.indexOf(g);C<0&&(C=vt.push(g)-1),wt.set(a,C)}let Ee=Vn/Math.max(1,vt.length),ue=Math.min(Ee,e.barWidth??1/0),Nn=(Ee-ue)/2,Mt=[],We=[],St=[],$t=[],Ct=[],Fn=[],Ue=[],Ke=a=>gt(a.axis).format,It=Math.max(0,e.minBarSize??0),Wr=(a,g,C)=>{let _=Math.abs(g-a);if(_>=It)return[Math.min(a,g),_];let R=a+(k?C?1:-1:C?-1:1)*It;return[Math.min(a,R),It]},Te=(a,g,C,_)=>({label:_,series:a.name,seriesId:a.id??a.name,category:f[g],index:g,value:C}),Gn=(a,g,C,_)=>{let N=Mr(_,a.errors?.[g]);if(!N)return;let R=m(re(N[0],a.axis)),j=m(re(N[1],a.axis)),D=4,F="var(--skdx-color-text-default)",L=`${a.name}, ${f[g]}: ${Ke(a)(N[0])} \u2013 ${Ke(a)(N[1])}`;Fn.push(k?{kind:"line",part:"error-bar",x1:R,x2:j,y1:C,y2:C,stroke:F,title:L}:{kind:"line",part:"error-bar",x1:C,x2:C,y1:R,y2:j,stroke:F,title:L},k?{kind:"line",part:"error-cap",x1:R,x2:R,y1:m(C-D),y2:m(C+D),stroke:F}:{kind:"line",part:"error-cap",x1:m(C-D),x2:m(C+D),y1:R,y2:R,stroke:F},k?{kind:"line",part:"error-cap",x1:j,x2:j,y1:m(C-D),y2:m(C+D),stroke:F}:{kind:"line",part:"error-cap",x1:m(C-D),x2:m(C+D),y1:j,y2:j,stroke:F})};for(let a of G){let{from:g,to:C}=wn(a),_=Ke(a),N=P.length<=wi;if(a.kind==="bar"){let L="";P.forEach((A,Z)=>{let W=a.data[A],q=g[A],J=C[A];if(!I(W)||!I(q)||!I(J))return;let ke=re(q,a.axis),me=re(J,a.axis),[Ae,ze]=Wr(ke,me,J>=q),Oe=Bn(Z)+wt.get(a)*Ee+Nn,jn=m(k?Ae:Oe),Hn=m(k?Oe:Ae),Tt=m(k?ze:ue),Zn=m(k?ue:ze);if(!N){L+=`M${jn} ${Hn}h${Tt}v${Zn}h${-Tt}Z`;return}let En=Bt(a.name,f[A],X?J-q:W,_);if(We.push({kind:"rect",part:"bar",x:jn,y:Hn,width:Tt,height:Zn,fill:a.color,rx:e.radius,title:En,item:Te(a,A,W,En)}),Gn(a,A,m(Oe+ue/2),W),e.labels){let Wn=_(X?J-q:W);Ct.push(k?Y(m(Math.max(ke,me)+4),m(Oe+ue/2),Wn,{baseline:"middle"}):Y(m(Oe+ue/2),m(Math.min(ke,me)-4),Wn,{anchor:"middle"}))}}),L&&We.push({kind:"path",part:"bars",d:L,fill:a.color,title:a.name});continue}if(a.kind==="range"&&a.style==="bar"){P.forEach((L,A)=>{let Z=g[L],W=C[L];if(!I(Z)||!I(W))return;let q=re(Math.min(Z,W),a.axis),J=re(Math.max(Z,W),a.axis),ke=Bn(A)+wt.get(a)*Ee+Nn,me=`${a.name}, ${f[L]}: ${_(Math.min(Z,W))} \u2013 ${_(Math.max(Z,W))}`,Ae=Te(a,L,W,me),ze=Math.max(1,Math.abs(J-q));We.push(k?{kind:"rect",part:"range",x:m(Math.min(q,J)),y:m(ke),width:m(ze),height:m(ue),fill:a.color,rx:e.radius,title:N?me:void 0,item:Ae}:{kind:"rect",part:"range",x:m(ke),y:m(Math.min(q,J)),width:m(ue),height:m(ze),fill:a.color,rx:e.radius,title:N?me:void 0,item:Ae})});continue}let R=e.nulls==="connect"||e.nulls===void 0&&e.connectNulls,j=[],D=[];P.forEach((L,A)=>{let Z=g[L],W=C[L];if(!I(W)||!I(Z)){!R&&D.length&&(j.push(D),D=[]);return}D.push({x:Ze(A),y:m(re(W,a.axis)),y0:m(re(Z,a.axis)),i:L})}),D.length&&j.push(D);let F=a.markers??P.length<=vi;for(let L of j){let A=be(L,a.curve);if(a.kind==="range"&&a.style==="line"){St.push({kind:"path",part:"range-high",d:A,stroke:a.color,strokeWidth:2,strokeLinejoin:"round"},{kind:"path",part:"range-low",d:be(L.map(Z=>({x:Z.x,y:Z.y0})),a.curve),stroke:a.color,strokeWidth:2,strokeLinejoin:"round",dash:"4 3"});continue}if(a.kind==="range"){let Z=be([...L].reverse().map(W=>({x:W.x,y:W.y0})),a.curve);Mt.push({kind:"path",part:"range",d:`${A}L${Z.slice(1)}Z`,fill:a.color,fillOpacity:.2,title:a.name});continue}if(a.kind==="area"){let Z=Rn(gt(a.axis)),W=a.stack!==void 0?be([...L].reverse().map(J=>({x:J.x,y:J.y0})),a.curve).slice(1):`${L[L.length-1]?.x} ${Z}L${L[0]?.x} ${Z}`,q=`skdx-g-${a.index}`;a.gradient&&!Ue.some(J=>J.id===q)&&Ue.push({id:q,vertical:!0,stops:[{offset:0,color:a.color,opacity:a.fillOpacity},{offset:1,color:a.color,opacity:0}]}),Mt.push({kind:"path",part:"area",d:`${A}L${W}Z`,fill:a.gradient?`url(#${q})`:a.color,fillOpacity:a.gradient?void 0:a.fillOpacity})}St.push({kind:"path",part:"line",d:A,stroke:a.color,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",dash:a.dash})}if(a.kind==="range"&&N)for(let L of j)for(let A of L){let Z=a.low[A.i],W=a.high[A.i],q=`${a.name}, ${f[A.i]}: ${_(Math.min(Z,W))} \u2013 ${_(Math.max(Z,W))}`;$t.push({...De(A.x,A.y,.01,a.color,q,Te(a,A.i,W,q)),part:"anchor"})}if(a.kind!=="range")for(let L of j)for(let A of L){if(!F&&!N&&!e.labels&&!a.errors)continue;let Z=a.data[A.i],W=X?C[A.i]-g[A.i]:Z,q=Bt(a.name,f[A.i],W,_);(F||N)&&$t.push(F&&a.symbol!=="circle"?kr(A.x,A.y,a.markerSize,a.symbol,a.color,N?q:void 0,Te(a,A.i,Z,q),"point"):{...De(A.x,A.y,F?a.markerSize:.01,a.color,N?q:void 0,Te(a,A.i,Z,q)),part:F?"point":"anchor"}),N&&Gn(a,A.i,k?A.y:A.x,C[A.i]),e.labels&&Ct.push(Y(A.x,A.y-8,_(W),{anchor:"middle"}))}}let _n={plot:K,xs:k?[]:P.map((a,g)=>Ze(g)),rows:P.map(a=>[f[a],...G.map(g=>{let C=Ke(g);if(g.kind==="range"){let N=g.low[a],R=g.high[a];return`${g.name}: ${I(N)&&I(R)?`${C(N)} \u2013 ${C(R)}`:"\u2014"}`}let _=g.data[a];return`${g.name}: ${I(_)?C(X?(de.get(g)?.[a]??0)-(ne.get(g)?.[a]??0):_):"\u2014"}`})]),count:d,zoom:w,crosshair:rr(e)},qe=[];if(e.brush&&!k){let a={x:K.x,y:K.y+K.height+wr,width:K.width,height:vr},g=G.find(_=>_.kind!=="range"),C={x:m(a.x+w.start/Math.max(1,d)*a.width),y:a.y,width:m((w.end-w.start)/Math.max(1,d)*a.width),height:a.height};if(qe.push({kind:"rect",part:"brush",x:a.x,y:a.y,width:a.width,height:a.height,fill:"var(--skdx-color-surface-sunken)",stroke:V.grid}),g){let _=se(g.data),[N,R]=ae(_),j=d>1?a.width/(d-1):0,D=g.data.flatMap((L,A)=>I(L)?[{x:m(a.x+A*j),y:m(a.y+a.height-(R===N?.5:(L-N)/(R-N))*(a.height-4)-2)}]:[]),F=be(D);D.length>1&&qe.push({kind:"path",part:"brush-series",d:`${F}L${D[D.length-1]?.x} ${a.y+a.height}L${D[0]?.x} ${a.y+a.height}Z`,fill:g.color,fillOpacity:.3})}qe.push({kind:"rect",part:"brush-window",...C,fill:"var(--skdx-color-primary-500)",opacity:.15,stroke:V.axis},{kind:"rect",part:"brush-handle",x:m(C.x-3),y:a.y+8,width:6,height:a.height-16,fill:V.axis,rx:2},{kind:"rect",part:"brush-handle",x:m(C.x+C.width-3),y:a.y+8,width:6,height:a.height-16,fill:V.axis,rx:2}),_n.brush={box:a,window:C}}return{...kt,shapes:[...Pn,...Mt,...We,...St,...Fn,...$t,...Ct,...xr(e.annotations,Dn),...qe,...kt.shapes],hit:_n,issues:o,defs:Ue.length?Ue:void 0}}function Mr(e,n){if(!(!I(e)||n===null||n===void 0))return typeof n=="number"?I(n)?[e-Math.abs(n),e+Math.abs(n)]:void 0:I(n[0])&&I(n[1])?[Math.min(n[0],n[1]),Math.max(n[0],n[1])]:void 0}function Si(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 $i(e,n,t){let r=f=>f.type??n,i=[],o=Mi(e),s=e.categories??[],l=(e.transforms??[]).filter(f=>f.type==="sort"||f.type==="bin"||f.type==="aggregate"),c=(e.transforms??[]).filter(f=>!l.includes(f)),d=e.stacked||e.stackOffset!==void 0&&e.stackOffset!=="zero",u=(f,w,T)=>{let k=T.filter(z=>z!==null&&!(typeof z=="number"&&Number.isFinite(z))).length;k&&i.push({code:"invalid-value",severity:"warning",message:`Series "${f}" has ${k} value${k===1?"":"s"} that ${k===1?"is":"are"} neither a number nor null; drawn as gaps.`,itemId:w??f}),s.length&&T.length!==s.length&&!e.transform&&i.push({code:"length-mismatch",severity:"warning",message:`Series "${f}" has ${T.length} values for ${s.length} categories.`,itemId:w??f})},h=e.series.map((f,w)=>{let T=r(f),k=d?!0:void 0,z=f.type==="range"?void 0:f.stack,G=z===!1?void 0:z===!0||z===void 0&&k?`${T}`:z;f.type==="range"?(u(f.name,f.id,f.low),u(f.name,f.id,f.high)):u(f.name,f.id,f.data);let H=X=>e.nulls==="zero"?X.map(Q=>I(Q)?Q:0):X,P=Sr(o,f.axis);return P===void 0&&i.push({code:"unknown-axis",severity:"warning",message:`Series "${f.name}" names axis "${String(f.axis)}", which is not defined; drawn on the first axis.`,itemId:f.id??f.name}),{name:f.name,id:f.id,color:sr(e,w,f.color),axis:P??o[0]?.id,hidden:ar(e,f.name),index:w,kind:T,data:f.type==="range"?[]:H(Ft(Ft(f.data,c),f.transforms)),low:f.type==="range"?f.low:[],high:f.type==="range"?f.high:[],curve:f.curve??e.curve??"linear",dash:f.type==="range"?void 0:f.dash,markers:f.type==="range"?void 0:f.markers,symbol:f.type==="range"?"circle":f.symbol??"circle",markerSize:f.type==="range"?3:f.markerSize??3,errors:f.type==="range"?void 0:f.errors,stack:T==="range"||T==="line"?void 0:G,style:f.type==="range"?f.style??"area":"area",fillOpacity:(f.type==="range"?void 0:f.fillOpacity)??e.fillOpacity??.25,gradient:f.type!=="range"&&f.gradient===!0}}),b=()=>Math.max(s.length,...h.map(f=>Math.max(f.data.length,f.low.length))),y=f=>{let w=k=>k.length?f.map(z=>k[z]??null):k,T=Array.from({length:b()},(k,z)=>s[z]??String(z+1));s=f.map(k=>T[k]),h=h.map(k=>({...k,data:w(k.data),low:w(k.low),high:w(k.high)}))},x=(f,w)=>{let T=(w!==void 0?h.find(z=>z.name===w):void 0)??h.find(z=>!z.hidden&&z.kind!=="range")??h[0];w!==void 0&&!h.some(z=>z.name===w)&&i.push({code:"unknown-series",severity:"warning",message:`sort.by names "${w}", which is not a series; sorted by the first series.`});let k=Array.from({length:b()},(z,G)=>G).sort((z,G)=>{let H=T?.data[z]??T?.high[z],P=T?.data[G]??T?.high[G],X=I(H)?H:-1/0,Q=I(P)?P:-1/0;return f==="asc"?X-Q:Q-X});y(k)},p=f=>{let w=h.flatMap(k=>se(k.data)),T=Qe(w,f);s=T.slice(1).map((k,z)=>`${t(T[z])}\u2013${t(k)}`),h=h.map(k=>{let z=se(k.data),G=0,H=Je(z,T).map(P=>e.binMode==="density"?z.length?P.count/(z.length*(P.x1-P.x0)):0:e.binMode==="cumulative"?G+=P.count:P.count);return{...k,data:H}})},M=(f,w)=>{let T=Math.max(1,Math.floor(f)),k=b(),z=H=>{if(!H.length)return H;let P=[];for(let X=0;X<k;X+=T){let Q=se(H.slice(X,X+T));P.push(Q.length===0?null:w==="sum"?Q.reduce((ne,de)=>ne+de,0):w==="mean"?Q.reduce((ne,de)=>ne+de,0)/Q.length:w==="min"?Math.min(...Q):Math.max(...Q))}return P};s=Array.from({length:k},(H,P)=>s[P]??String(P+1)).filter((H,P)=>P%T===0),h=h.map(H=>({...H,data:z(H.data),low:z(H.low),high:z(H.high)}))};e.transform==="histogram"?p({bins:e.bins,binWidth:e.binWidth,domain:e.binDomain}):e.transform==="cumulative"&&(h=h.map(f=>{let w=0;return{...f,data:f.data.map(T=>I(T)?w+=T:w)}}));for(let f of l)f.type==="sort"?x(f.order??"desc"):f.type==="bin"?p(f):f.type==="aggregate"&&M(f.every,f.method??"sum");typeof e.sort=="string"?x(e.sort):e.sort&&x(e.sort.order,e.sort.by);let v=e.xAxis?.domain;if(v){let f=b(),w=Array.from({length:f},(G,H)=>s[H]??String(H+1)),T=G=>{let H=typeof G=="string"?G:oe(G);return w.findIndex(P=>typeof H=="string"?P===H||Xe(P)===H:oe(P)===H)},k=v.map(T),z=G=>G.length?k.map(H=>H<0?null:G[H]??null):G;s=[...v],h=h.map(G=>({...G,data:z(G.data),low:z(G.low),high:z(G.high)}))}return{series:h,categories:s,issues:i,axes:o}}var Gt=e=>$r(e,"line");function at(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var _t=e=>e.id??e.name??e.series,Cr=e=>e.seriesId??e.series;function le(e,n){let t=!1;return n.id!==void 0&&(t=!0,_t(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,Cr(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}function he(e){let n={},t=_t(e);t!==void 0&&(n.id=t);let r=Cr(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var jt=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function Ht(e,n,t){let r=at(e),i=he(n),o=r.some(s=>le(n,s));return t==="single"?o?[]:[i]:o?r.filter(s=>!le(n,s)):[...r,i]}var Ci=.2;function Ii(e){let n=V.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 Ti=(e,n)=>e.kind==="text"?{...e,fill:V.grid}:{...e,opacity:(e.opacity??1)*n};function Zt(e,n){let t=at(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:at(n.highlighted),i=r[0];if(t.length===0&&!i)return e;let o={highlighted:n.highlightScope?.highlighted??"item",faded:n.highlightScope?.faded??"global"},s=[],l=u=>!i||r.some(h=>le(u,h))?!0:o.highlighted==="series"?r.some(h=>h.series!==void 0&&le(u,{series:h.series})):!1,c=u=>{if(!i||o.faded==="none"||l(u))return!1;if(o.faded==="series"){let h=i.series;return h!==void 0&&le(u,{series:h})}return!0},d=e.shapes.map(u=>{let h=u.item;if(!h||h.legend)return u;if(t.some(b=>le(h,b))){let b=Ii(u);b&&s.push(b)}return c(h)?Ti(u,Ci):u});return s.length?{...e,shapes:[...d,...s]}:{...e,shapes:d}}function $e(e,n,t,r,i){let o=e.getBoundingClientRect();return{x:o.width?(n-o.left)*r/o.width:n,y:o.height?(t-o.top)*i/o.height:t}}var Et=(e,n,t)=>n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height;function Ir(e,n){let t=0,r=1/0;return e.xs.forEach((i,o)=>{let s=Math.abs(i-n);s<r&&(r=s,t=o)}),t}function Ne(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=Ir(t,n),i=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(i,r)??i}}function Wt(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=t.xs[Ir(t,n)];return{kind:"line",part:"crosshair",x1:r,x2:r,y1:t.plot.y,y2:t.plot.y+t.plot.height,stroke:V.axis,dash:"3 3"}}function Ut(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!Et(r.plot,n,t))return[];let i=Wt(e,n),{rows:o}=Ne(e,n),s=e.tooltipAnchored?r.plot.y+8:t;return[i,...rt(i.x1,s,o,e.width,e.height,e.tooltipPlacement)]}function Kt(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 i=t.xs[r];return Ut(e,i,t.plot.y+8)}function qt(e,n,t,r,i){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:c,y:d}=$e(t,r,i,e.width,e.height);if(Et(e.hit.plot,c,d)){let u=Ne(e,c),h=Wt(e,c);if(u&&h)return{lines:u.rows,shapes:[h]}}}let o=n?.closest?.("[data-skdx-part]"),s=e.tooltipFormatter?fe(e,n)?.item:void 0,l=s&&e.tooltipFormatter?.(s)||o&&Array.from(o.children).find(c=>c.tagName.toLowerCase()==="title")?.textContent;return l?{lines:Array.isArray(l)?l:[l],shapes:[]}:{lines:[],shapes:[]}}function Tr(e,n,t,r,i,o,s){let l=e?.closest?.("[data-skdx-part]"),c=s&&s.tooltipFormatter?fe(s,e)?.item:void 0,d=c&&s?.tooltipFormatter?.(c)||l&&Array.from(l.children).find(x=>x.tagName.toLowerCase()==="title")?.textContent;if(!d)return[];let u=s?.tooltipAnchored?fe(s,e):void 0,h=u?s?.shapes[u.index]:void 0,{x:b,y}=h?Fe(h):$e(n,t,r,i,o);return rt(b,y,d,i,o,s?.tooltipPlacement)}function Yt(e,n,t,r,i){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:s}=$e(t,r,i,e.width,e.height),l=Ut(e,o,s);if(l.length>0)return l}return Tr(n,t,r,i,e.width,e.height,e)}function Xt(e,n){let t=fe(e,n);return t&&!t.item.legend?he(t.item):null}var Ai=(e,n)=>{let{x:t,y:r}=Fe(e),i=e.kind==="circle"?e.cy:e.kind==="rect"?e.y+e.height/2:r;return t>=n.x&&t<=n.x+n.width&&i>=n.y&&i<=n.y+n.height};function Qt(e,n){let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor"||!Ai(i,n))continue;let o=he(i.item),s=JSON.stringify(o);t.has(s)||(t.add(s),r.push(o))}return r}var Jt=e=>({kind:"rect",part:"selection-box",x:m(e.x),y:m(e.y),width:m(e.width),height:m(e.height),fill:V.focus,opacity:.12,stroke:V.focus}),ct=(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 Ar(e,n,t){let r=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){let s=e[i],l=e[o];s.y>t!=l.y>t&&n<(l.x-s.x)*(t-s.y)/(l.y-s.y)+s.x&&(r=!r)}return r}function en(e,n){if(n.length<3)return[];let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor")continue;let{x:o,y:s}=Fe(i),l=i.kind==="circle"?i.cy:i.kind==="rect"?i.y+i.height/2:s;if(!Ar(n,o,l))continue;let c=he(i.item),d=JSON.stringify(c);t.has(d)||(t.add(d),r.push(c))}return r}var tn=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${m(n.x)} ${m(n.y)}`).join("L")}`:"",fill:V.focus,fillOpacity:.12,stroke:V.focus,dash:"4 3"}),lt=6;function nn(e,n,t){let r=e.edit;if(r){for(let i of r.bars)if(!(t<i.y||t>i.y+i.height||n<i.x0-lt||n>i.x1+lt))return Math.abs(n-i.x0)<=lt?{bar:i,mode:"start"}:Math.abs(n-i.x1)<=lt?{bar:i,mode:"end"}:{bar:i,mode:"move"}}}function rn(e,n,t){let r=e.edit;return zr(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function on(e,n,t){let r=e.edit,i=t.key==="ArrowRight"?1:t.key==="ArrowLeft"?-1:0;if(!r||n===null||!i||!(t.shiftKey||t.altKey))return;let o=r.bars.find(c=>c.index===n);if(!o)return;let s=t.altKey?t.shiftKey?"start":"end":"move",l=r.snap??r.invert(o.x0+10)-r.invert(o.x0);return zr(r,{bar:o,mode:s},i*l)}function zr(e,{bar:n,mode:t},r){let i=l=>e.snap?Math.round(l/e.snap)*e.snap:l,o=n.start,s=n.end;return t==="move"?(o=i(n.start+r),s=o+(n.end-n.start)):t==="start"?o=Math.min(i(n.start+r),n.end):s=Math.max(i(n.end+r),n.start),{id:n.id,name:n.name,start:o,end:s}}function sn(e,n,t){let r=e.edit,i=r.scale(t.start),o=r.scale(t.end);return{kind:"rect",part:"edit-ghost",x:m(Math.min(i,o)),y:m(n.bar.y),width:m(Math.max(1,Math.abs(o-i))),height:m(n.bar.height),fill:V.focus,opacity:.25,stroke:V.focus,rx:2}}var zi=64,Oi=e=>Math.max(1,Math.min(zi,e));function an(e,n,t,r){let i=n>0?.8:1.25,o=Oi(e.view.zoom*i);if(o===e.view.zoom)return e.view;let{plot:s,scale:l}=e,[c,d]=e.view.center,u=(t-(s.x+s.width/2))/l,h=(r-(s.y+s.height/2))/l,b=e.view.zoom/o;return{center:[c+u*(1-b),e.fromY(e.toY(d)-h*(1-b))],zoom:o}}function ln(e,n,t,r){let{scale:i}=e;return{center:[n.center[0]-t/i,e.fromY(e.toY(n.center[1])+r/i)],zoom:n.zoom}}function fe(e,n){let t=n?.closest?.("[data-skdx-i]"),r=Number(t?.getAttribute("data-skdx-i")),i=Number.isInteger(r)?e.shapes[r]?.item:void 0;return i?{index:r,item:i}:void 0}var dt=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function Fe(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 cn(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=V.focus,i;switch(t.kind){case"rect":i={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":i={kind:"circle",part:"focus",cx:t.cx,cy:t.cy,r:t.r+3,fill:"none",stroke:r};break;case"line":i={kind:"line",part:"focus",x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:r,strokeWidth:4};break;case"text":i={kind:"rect",part:"focus",x:t.x-2,y:t.y-8,width:t.text.length*te+4,height:16,fill:"none",stroke:r,rx:2};break;case"path":i={kind:"path",part:"focus",d:t.d,stroke:r,strokeWidth:2,fill:"none"};break}let{x:o,y:s}=Fe(t),l=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[i,...l?rt(m(o),m(s),l,e.width,e.height):[]]}function dn(e,n,t){let r=dt(e);if(r.length===0)return;let i=n===null?-1:r.indexOf(n);switch(t){case"ArrowRight":case"ArrowDown":return r[Math.min(r.length-1,i+1)];case"ArrowLeft":case"ArrowUp":return r[Math.max(0,i<=0?0:i-1)];case"Home":return r[0];case"End":return r[r.length-1];case"Escape":return null;default:return}}var Me=2,Se=(e,n,t)=>{let r=Math.max(Me,Math.min(t,Math.round(n))),i=Math.max(0,Math.min(t-r,Math.round(e)));return{start:i,end:i+r}},Or=(e,n)=>!e||e.start<=0&&e.end>=n;function un(e,n,t){if(e.count<=Me||!e.plot.width)return;let{start:r,end:i}=e.zoom,o=i-r,s=n>0?1.25:.8,l=Math.max(Me,Math.min(e.count,Math.round(o*s)));if(l===o)return n>0&&!Or(e.zoom,e.count)?Se(r,l,e.count):void 0;let c=Math.max(0,Math.min(1,(t-e.plot.x)/e.plot.width)),d=r+c*o;return Se(d-c*l,l,e.count)}function hn(e,n,t,r){let i=n.end-n.start,o=Math.max(Me,Math.min(e.count,Math.round(i/Math.max(.05,t)))),s=Math.max(0,Math.min(1,(r-e.plot.x)/Math.max(1,e.plot.width)));return Se(n.start+s*i-s*o,o,e.count)}function fn(e,n,t){let r=n.end-n.start,i=e.plot.width/Math.max(1,r);return Se(n.start-t/i,r,e.count)}function mn(e,n,t){let r=e.brush;if(!r||!Et(r.box,n,t))return;let i=r.window;if(Math.abs(n-i.x)<=6)return{grab:"left",zoom:e.zoom};if(Math.abs(n-(i.x+i.width))<=6)return{grab:"right",zoom:e.zoom};if(n>i.x&&n<i.x+i.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:Se(s-o/2,o,e.count)}}function pn(e,n,t,r){let i=e.brush;if(!i)return t;let o=r/Math.max(1,i.box.width)*e.count;if(n==="move")return Se(t.start+o,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-Me,Math.round(t.start+o))),end:t.end};let s=Math.min(e.count,Math.max(t.start+Me,Math.round(t.end+o)));return{start:t.start,end:s}}function gn(e,n){switch(n.type){case"svg":return Promise.resolve(bn(e,n.label,n.resolve));case"csv":return Promise.resolve(Br(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=bn(e,n.label,n.resolve);return Vr(t,e.width,e.height,n.scale,n.background)}}}var ce=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;"),Ge=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${ce(String(t))}"`).join("");function Lr(e){let n=e.title?`<title>${ce(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${Ge([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${Ge([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${Ge([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${Ge([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${Ge([t,["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]])}>${ce(e.text)}</text>`}}function Rr(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${ce(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="${ce(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function bn(e,n,t){let r=Rr(e)+e.shapes.map(Lr).join("");return t&&(r=r.replace(/var\((--[\w-]+)\)/g,(i,o)=>t(o).trim()||i)),`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e.width} ${e.height}" width="${e.width}" height="${e.height}" role="img" aria-label="${ce(n)}" font-family="${ce(V.fontFamily)}" font-size="${ce(V.fontSize)}"><title>${ce(n)}</title>${r}</svg>`}function Vr(e,n,t,r=2,i){return new Promise((o,s)=>{let l=URL.createObjectURL(new Blob([e],{type:"image/svg+xml;charset=utf-8"})),c=new Image;c.onload=()=>{URL.revokeObjectURL(l);let d=document.createElement("canvas");d.width=Math.round(n*r),d.height=Math.round(t*r);let u=d.getContext("2d");if(!u)return s(new Error("canvas 2d context unavailable"));i&&(u.fillStyle=i,u.fillRect(0,0,d.width,d.height)),u.drawImage(c,0,0,d.width,d.height),d.toBlob(h=>h?o(h):s(new Error("toBlob failed")),"image/png")},c.onerror=()=>{URL.revokeObjectURL(l),s(new Error("svg could not be decoded"))},c.src=l})}function Br(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
2
- `)}function xn(e,n){if(!n)return;let t=typeof n=="object"?n.maxRows??500:500,r=e.hit;if(r&&r.rows.length>0){let l=r.rows[0];if(r.rows.length>t)return;let c=["",...l.slice(1).map(u=>u.replace(/:\s[^:]*$/,""))],d=r.rows.map(u=>[u[0],...u.slice(1).map(h=>h.slice(h.lastIndexOf(": ")+2))]);return[c,...d]}let i=e.shapes.flatMap(l=>l.item&&!l.item.legend&&!(l.part==="anchor"&&!l.title)?[l.item]:[]);if(i.length===0||i.length>t)return;let o=["series","name","category","value"].filter(l=>i.some(c=>c[l]!==void 0)),s=(l,c)=>l[c]===void 0?"":String(l[c]);return[o.map(l=>l[0]?.toUpperCase()+l.slice(1)),...i.map(l=>o.map(c=>s(l,c)))]}var yn=new Map;function ut(e){let n=yn.get(e);if(n)return n.group;let t=new Set,r={},i={current:r,subscribe(o){return t.add(o),()=>{t.delete(o),t.size===0&&yn.delete(e)}},publish(o,s){Object.assign(r,o);for(let l of t)l(o,s)}};return yn.set(e,{group:i,listeners:t}),i}var Pr='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',kn=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${Pr}{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){${Pr}{animation:none;transition:none}}`;function vn(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}var O=require("lit"),$=require("lit/decorators.js"),U=require("lit/directives/if-defined.js");var Li={fromAttribute:()=>!1},B=class extends O.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 i=this.drag;if(i?.grab==="select"){let{x:o,y:s}=this.viewBox(t,r);this.overlay=[Jt(ct(i.x,i.y,o,s))];return}if(i?.grab==="lasso"){let{x:o,y:s}=this.viewBox(t,r);i.points=[...i.points??[],{x:o,y:s}],this.overlay=[tn(i.points)];return}if(i?.grab==="edit"){if(!i.gantt)return;let{x:o}=this.viewBox(t,r);i.change=rn(r,i.gantt,o-i.x),this.overlay=[sn(r,i.gantt,i.change)];return}if(i?.grab==="map"){if(!r.map||!i.view)return;let{x:o,y:s}=this.viewBox(t,r);this.setView(ln(r.map,i.view,o-i.x,s-i.y));return}if(i&&r.hit){if(i.grab==="pinch"){let[s,l]=[...this.pointers.values()];if(s===void 0||l===void 0||!i.distance)return;this.setZoom(hn(r.hit,i.zoom,Math.abs(s-l)/i.distance,(s+l)/2));return}let{x:o}=this.viewBox(t,r);this.setZoom(i.grab==="pan"?fn(r.hit,i.zoom,o-i.x):pn(r.hit,i.grab,i.zoom,o-i.x));return}if(r.tooltipPortal){let{lines:o,shapes:s}=qt(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=Yt(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(Xt(r,t.target)),this.syncId&&r.hit?.crosshair){let o=Ne(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:i,y:o}=this.viewBox(t,r),s=fe(r,t.target)?.item.legend,l=this.canEdit(r)?nn(r,i,o):void 0;if(l){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"edit",gantt:l},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.brushing()&&!s){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:this.selectionMode==="lasso"?"lasso":"select",points:[{x:i,y:o}]},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.canPan(r)&&r.map){let d=r.map.plot;if(i<d.x||i>d.x+d.width||o<d.y||o>d.y+d.height)return;this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"map",view:r.map.view},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}let c=r.hit;if(!(!c||!this.canZoom(r))){if(this.pointers.set(t.pointerId,i),this.pointers.size===2){let[d,u]=[...this.pointers.values()];this.drag={x:(d+u)/2,y:o,zoom:c.zoom,grab:"pinch",distance:Math.abs(d-u)||1}}else{let d=mn(c,i,o);if(d)this.drag={x:i,y:o,zoom:d.zoom,grab:d.grab},d.zoom!==c.zoom&&this.setZoom(d.zoom);else if(this.zoomable&&i>=c.plot.x&&i<=c.plot.x+c.plot.width&&o>=c.plot.y&&o<=c.plot.y+c.plot.height)this.drag={x:i,y:o,zoom:c.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 i=this.drag,o=this.layout;if(o&&(i?.grab==="select"||i?.grab==="lasso"||i?.grab==="edit"||i?.grab==="map")){this.overlay=[];let{x:s,y:l}=this.viewBox(t,o);if(Math.abs(s-i.x)>2||Math.abs(l-i.y)>2){i.grab==="select"?this.setSelected(Qt(o,ct(i.x,i.y,s,l))):i.grab==="lasso"?this.setSelected(en(o,i.points??[])):i.grab==="edit"&&i.change&&this.emit("skdx-task-change",i.change),this.drag={...i,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:i,y:o}=this.viewBox(t,r);if(r.map&&this.canPan(r)){let c=r.map.plot;if(i<c.x||i>c.x+c.width||o<c.y||o>c.y+c.height)return;t.preventDefault(),this.setView(an(r.map,t.deltaY,i,o));return}let s=r.hit;if(!s||!this.canZoom(r)||o<s.plot.y||o>s.plot.y+s.plot.height)return;let l=un(s,t.deltaY,i);l&&(t.preventDefault(),this.setZoom(l))};this.onClick=t=>{if(!this.layout)return;if(this.drag?.distance===-1){this.drag=null;return}let r=fe(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=>{let r=this.layout;if(!r)return;if((t.key==="Enter"||t.key===" ")&&this.focused!==null){let l=r.shapes[this.focused]?.item;l&&(t.preventDefault(),this.select(l),this.emit("skdx-item-click",l));return}let i=this.canEdit(r)?on(r,this.focused,t):void 0;if(i){t.preventDefault(),this.emit("skdx-task-change",i);return}let o=dn(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?he(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:i,tooltip:o,format:s,palette:l,loading:c,error:d,emptyMessage:u,description:h,decorative:b,animated:y,responsive:x,highlighted:p,highlightScope:M,accessibleTable:v}=this;return{...typeof x=="object"&&this.measured!==void 0&&this.measured<(x.breakpoint??480)?x.compact:void 0,width:x&&this.measured?this.measured:t,height:r,animate:y,responsive:x,legend:i,tooltip:o,format:s,palette:l,loading:c,error:d,emptyMessage:u,description:h,decorative:b,highlighted:p===void 0?this.highlightState:p,highlightScope:M,accessibleTable:v,hiddenSeries:this.hiddenSeries??this.hiddenState,zoom:this.zoom??this.zoomState,selected:this.selected??this.selectedState,view:this.view??this.viewState}}emit(t,r){this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0}))}publish(t){this.syncId&&ut(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=ut(this.syncId),r=i=>{"highlighted"in i&&(this.highlightState=i.highlighted??null),i.selected&&(this.selectedState=i.selected,this.crossFilter&&(this.highlightState=i.selected.length?i.selected:null)),"zoom"in i&&(this.zoomState=i.zoom),i.hiddenSeries&&(this.hiddenState=i.hiddenSeries),"crosshair"in i&&(this.crossState=i.crosshair??null)};r(t.current),this.leave=t.subscribe((i,o)=>{o!==this.token&&r(i)})}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,i=r.includes(t)?r.filter(o=>o!==t):[...r,t];this.hiddenState=i,this.emit("skdx-hidden-series-change",i),this.publish({hiddenSeries:i})}highlight(t){let r=this.hover;r===t||r&&t&&jt(r,t)||(this.hover=t,this.emit("skdx-highlighted-change",t),this.syncId&&(this.highlightState=t,this.publish({highlighted:t})))}select(t){let r=this.selectionMode;r!=="none"&&this.setSelected(Ht(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 $e(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 i=r.shapes.findIndex(o=>o.item&&!o.item.legend&&le(o.item,t));return i<0?!1:(this.getSvgElement()?.focus(),this.focused=i,!0)}export(t){let r=this.layout;return r?gn(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,i){this.join();let o=Zt(Vt(t),this.sized());if(this.layout=o,o.issues!==this.reported){this.reported=o.issues;for(let v of o.issues??[])this.emit("skdx-data-issue",v)}let s=this.canZoom(o),l=this.canPan(o),c=this.canEdit(o),d=this.brushing(),u=s||l||c||d,h=!o.decorative&&dt(o).length>0,b=o.description?`${r}-desc`:void 0,y=vn(o),x=xn(o,this.accessibleTable),p=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||i,M=this.portal;return O.html`<svg
1
+ "use strict";var Ye=Object.defineProperty;var Jn=Object.getOwnPropertyDescriptor;var ei=Object.getOwnPropertyNames;var ti=Object.prototype.hasOwnProperty;var ni=(e,n)=>{for(var t in n)Ye(e,t,{get:n[t],enumerable:!0})},ri=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of ei(n))!ti.call(e,i)&&i!==t&&Ye(e,i,{get:()=>n[i],enumerable:!(r=Jn(n,i))||r.enumerable});return e};var ii=e=>ri(Ye({},"__esModule",{value:!0}),e),S=(e,n,t,r)=>{for(var i=r>1?void 0:r?Jn(n,t):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(n,t,i):a(i))||i);return r&&i&&Ye(n,t,i),i};var ji={};ni(ji,{SkdxLineChart:()=>_e});module.exports=ii(ji);var Er=require("lit/decorators.js");var Qn=e=>Number(e.toPrecision(12)),oi,er=e=>(oi??(oi=new Intl.NumberFormat)).format(Qn(e)),ai=e=>{let n=Math.round(Math.abs(e)),t=e<0?"-":"",r=Math.floor(n/3600),i=Math.floor(n%3600/60),o=a=>String(a).padStart(2,"0");return r>0?`${t}${r}h ${o(i)}m`:i>0?`${t}${i}m ${o(n%60)}s`:`${t}${n}s`};function ve(e){if(e===void 0)return er;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:i="",timeZone:o}=e,a=u=>i?h=>u(h)+i:u,l=u=>r===void 0?u===void 0?{}:{maximumFractionDigits:u}:{minimumFractionDigits:r,maximumFractionDigits:r},c=u=>{let h=new Intl.NumberFormat(t,u);return a(b=>h.format(Qn(b)))},d=u=>{let h=new Intl.DateTimeFormat(t,o?{...u,timeZone:o}:u);return b=>h.format(b)};switch(n){case"integer":return c({maximumFractionDigits:0});case"decimal":return c(l(2));case"percent":return c({style:"percent",...l(0)});case"currency":return c({style:"currency",currency:e.currency??"USD",...l()});case"compact":return c({notation:"compact",...l(1)});case"scientific":return c({notation:"scientific",...l(2)});case"date":return d({dateStyle:"medium"});case"time":return d({timeStyle:"short"});case"datetime":return d({dateStyle:"medium",timeStyle:"short"});case"duration":return a(ai)}}function Xe(e,n){if(typeof e=="string")return e;let t=e instanceof Date?e.getTime():e;return n?ve(n)(t):e instanceof Date?new Intl.DateTimeFormat().format(e):er(t)}var oe=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 Me([e,n],[t,r]){let i=n-e;return o=>i===0?t:t+(o-e)/i*(r-t)}function pe(e,n,t=5){if(e===n)return[e];let r=(n-e)/Math.max(1,t),i=10**Math.floor(Math.log10(r)),o=r/i,a=(o<1.5?1:o<3.5?2:o<7.5?5:10)*i,l=Math.floor(e/a)*a,c=Math.ceil(n/a)*a,d=[];for(let u=l;u<=c+a/2;u+=a)d.push(nr(u));return d}function tr(e,[n,t],r=.2){let i=e===0?0:(t-n)/e,o=i*(1-Math.max(0,Math.min(.9,r)));return{step:i,bandwidth:o,start:a=>n+a*i+(i-o)/2,center:a=>n+(a+.5)*i}}var nr=e=>Number(e.toPrecision(12)),m=e=>Number(e.toFixed(2)),I=e=>typeof e=="number"&&Number.isFinite(e),ae=e=>e.filter(I);function se(e){let n=1/0,t=-1/0;for(let r of e)I(r)&&(r<n&&(n=r),r>t&&(t=r));return n===1/0?[0,0]:[n,t]}function be(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 u=1;u<e.length;u++){let h=e[u-1],b=e[u];n==="stepAfter"?d+=`H${b.x}V${b.y}`:n==="stepBefore"?d+=`V${b.y}H${b.x}`:d+=`H${m((h.x+b.x)/2)}V${b.y}H${b.x}`}return d}if(n==="linear"||e.length<3)return`M${e.map(d=>`${d.x} ${d.y}`).join("L")}`;let r=e.length,i=e.slice(1).map((d,u)=>d.x-e[u].x),o=e.slice(1).map((d,u)=>d.y-e[u].y),a=i.map((d,u)=>d===0?0:o[u]/d),l=[a[0]];for(let d=1;d<r-1;d++){let u=a[d-1],h=a[d];l.push(u*h<=0?0:(u+h)/2)}l.push(a[r-2]);for(let d=0;d<r-1;d++){let u=a[d];if(u===0){l[d]=0,l[d+1]=0;continue}let h=l[d]/u,b=l[d+1]/u,v=Math.hypot(h,b);v>3&&(l[d]=3*h*u/v,l[d+1]=3*b*u/v)}let c=`M${t.x} ${t.y}`;for(let d=0;d<r-1;d++){let u=e[d],h=e[d+1],b=i[d]/3;c+=`C${m(u.x+b)} ${m(u.y+b*l[d])} ${m(h.x-b)} ${m(h.y-b*l[d+1])} ${h.x} ${h.y}`}return c}var Le=1e3,Re=60*Le,Ve=60*Re,Be=24*Ve,si=[Le,5*Le,15*Le,30*Le,Re,5*Re,15*Re,30*Re,Ve,3*Ve,6*Ve,12*Ve,Be,2*Be,7*Be,14*Be];function rr(e,n,t=6){if(!(n>e))return[e];let r=n-e,i=si.find(h=>r/h<=t),o=[];if(i!==void 0){for(let h=Math.ceil(e/i)*i;h<=n;h+=i)o.push(h);return o.length?o:[e,n]}let a=r/(30*Be),l=[1,2,3,6,12,24,60,120].find(h=>a/h<=t)??240,c=new Date(e),d=c.getUTCFullYear(),u=Math.ceil((c.getUTCMonth()+(c.getUTCDate()>1?1:0))/l)*l;for(let h=Date.UTC(d,u,1);h<=n;)o.push(h),u+=l,u>=12&&(d+=Math.floor(u/12),u%=12),h=Date.UTC(d,u,1);return o.length?o:[e,n]}function ir(e,n){let t=Math.floor(Math.log10(e)),r=Math.ceil(Math.log10(n)),i=r-t<=1?[1,2,5]:[1],o=[];for(let a=t;a<=r;a++)for(let l of i)o.push(nr(l*10**a));return o.filter(a=>a>=e/1.0001&&a<=n*1.0001)}function Je(e,n={}){if(n.thresholds&&n.thresholds.length>=2)return[...n.thresholds].filter(Number.isFinite).sort((c,d)=>c-d);let[t,r]=n.domain??se(e),i=Math.max(1,e.length),o=Math.max(1,n.bins??Math.ceil(Math.log2(i)+1)),a=n.binWidth??(r>t?(r-t)/o:1),l=r>t?Math.max(1,Math.ceil((r-t)/a-1e-9)):1;return Array.from({length:l+1},(c,d)=>Number((t+d*a).toPrecision(12)))}function Qe(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],i=n[n.length-1];for(let o of ae(e)){if(o<r||o>i)continue;let a=0,l=t.length-1;for(;a<l;){let c=a+l+1>>1;t[c].x0<=o?a=c:l=c-1}t[a].count++}return t}var li=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,ci=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,di={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function ui(e,n,t){return e.replace(ci,(r,i,o)=>{let a=di[i];if(a===void 0)return i+o;let c=(o.match(li)??[]).map((d,u)=>{let h=Number(d);if(a===-1)return String(h+n);if(a===-2)return String(h+t);let b=u%a;return a===7?b===5?String(h+n):b===6?String(h+t):d:String(b%2===0?h+n:h+t)});return i+c.join(" ")})}var or=(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:ui(r.d,n,t)}}});var zt=["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)"))),V={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)"},et=(e="neutral")=>e==="neutral"?V.axis:`var(--skdx-color-${e}-500)`,Lt=(e="neutral")=>e==="neutral"?V.label:e==="primary"?"var(--skdx-color-text-accent)":`var(--skdx-color-text-${e})`,ar=(e,n)=>n??zt[e%zt.length];var te={top:16,right:16,bottom:32,left:48};function sr(e,n,t=te){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 Pe(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function Vt(e){let n=e.tooltip;return n===void 0||n===!0?{enabled:!0}:n===!1?{enabled:!1}:{...n,enabled:n.enabled??!0}}var lr=e=>e.crosshair===!0||Vt(e).trigger==="axis",tt=20,hi=120,cr=e=>{let n=Pe(e);return n&&(n.position==="left"||n.position==="right")?n.width??hi:0},nt=(e,n=600,t=300)=>({width:(e.width??n)-cr(e),height:(e.height??t)-(Pe(e)?.position==="bottom"?tt:0)}),dr=(e,n,t)=>{let r=Pe(e);return!r||!(r.position===void 0||r.position==="top")?0:(n?Math.max(1,fr(n,t??nt(e).width,r)):1)*tt},ee=6.5;function Bt(e,n){let t=Array.from(e),r=Math.max(0,Math.floor(n/ee));return t.length<=r?e:r===0?"":`${t.slice(0,r-1).join("")}\u2026`}var ur=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:ar(n)),hr=(e,n)=>e.hiddenSeries?.includes(n)??!1;function Rt(e,n,t=[],r={},i=10,o=8,a=!1){let l=[],c=r.maxItems,d=c!==void 0&&c>=0&&e.length>c?e.slice(0,c):e,u=e.length-d.length,h=r.interactive??!0,b=o,v=i,g=(p,y,M,f)=>{let k=(y?18:4)+p.length*ee;b>o&&(a||b+k>n-8)&&(b=o,v+=tt),y&&l.push({kind:"rect",part:"legend-swatch",x:b,y:v-5,width:10,height:10,fill:y,opacity:f?.3:void 0,item:M}),l.push({kind:"text",part:"legend-label",x:b+(y?14:0),y:v,text:p,baseline:"middle",fill:f?V.grid:V.label,item:M}),b+=k+12};for(let p of d){let y=t.includes(p.name),M=h?{label:p.name,series:p.name,legend:!0}:void 0;g(r.formatter?.(p.name)??p.name,p.color,M,y)}return u>0&&g(`+${u} more`,void 0,void 0,!1),r.align==="end"?fi(l,n):l}function fi(e,n){let t=new Map;for(let i of e){let o=i.kind==="rect"?i.y+5:i.y;t.set(o,[...t.get(o)??[],i])}let r=[];for(let i of t.values()){let o=Math.max(...i.map(l=>l.kind==="rect"?l.x+l.width:l.x+l.text.length*ee)),a=n-8-o;for(let l of i)r.push({...l,x:l.x+a})}return r}var fr=(e,n,t={})=>new Set(Rt(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function Pt(e,n,t,r=[]){let i=Pe(e),o=i&&e.direction==="rtl"&&i.align===void 0?{...i,align:"end"}:i,a=Vt(e),l=o?.position==="bottom",c=cr(e),d=e.hiddenSeries??[],u=o?c?Rt(r,1/0,d,o,10,(o.position==="right"?n:0)+8,!0):Rt(r,n,d,o,l?t+10:10):[],h=l?fr(r,n,o):0;return{width:n+c,height:l?t+Math.max(1,h)*tt:t,legendOffset:o?.position==="left"?c:void 0,tooltip:a.enabled,tooltipFormatter:a.formatter,axisTooltipFormatter:a.axisFormatter,tooltipPortal:a.portal,tooltipPlacement:a.placement,tooltipAnchored:a.followPointer===!1?!0:void 0,description:e.description,decorative:e.decorative,animate:e.animate===!0?300:e.animate||void 0,responsive:!!e.responsive,shapes:u}}function Dt(e){let n=e.legendOffset;if(!n)return e;let t=[...or(e.shapes.filter(c=>!c.part.startsWith("legend-")),n,0),...e.shapes.filter(c=>c.part.startsWith("legend-"))],r=c=>({...c,x:c.x+n}),i=e.hit?{...e.hit,plot:r(e.hit.plot),xs:e.hit.xs.map(c=>c+n),brush:e.hit.brush?{box:r(e.hit.brush.box),window:r(e.hit.brush.window)}:void 0}:void 0,o=e.edit,a=o?{...o,scale:c=>o.scale(c)+n,invert:c=>o.invert(c-n),bars:o.bars.map(c=>({...c,x0:c.x0+n,x1:c.x1+n}))}:void 0,l=e.map?{...e.map,plot:r(e.map.plot)}:void 0;return{...e,shapes:t,hit:i,edit:a,map:l,legendOffset:void 0}}function rt(e,n,t,r,i,o="auto"){let a=Array.isArray(t)?t:[t],l=Math.max(1,Math.floor((r-12)/ee)),c=a.flatMap(y=>{let M=[],f=Array.from(y);for(;f.length>l;){let k=f.slice(0,l+1).lastIndexOf(" ");k<1&&(k=l),M.push(f.slice(0,k).join("")),f=f.slice(k),f[0]===" "&&f.shift()}return M.push(f.join("")),M}),d=Math.max(1,Math.floor((i-6)/16)),u=c.slice(0,d);c.length>d&&(u[d-1]=Bt(`${u[d-1]}\u2026`,r-12));let h=Math.min(r,Math.max(0,...u.map(y=>Array.from(y).length))*ee+12),b=Math.min(i,6+u.length*16),v=o==="top"?{x:e-h/2,y:n-b-8}:o==="bottom"?{x:e-h/2,y:n+8}:o==="left"?{x:e-h-8,y:n-b/2}:o==="right"?{x:e+8,y:n-b/2}:{x:e+12,y:n-b-6},g=Math.max(0,Math.min(r-h,v.x)),p=Math.max(0,Math.min(i-b,v.y));return[{kind:"rect",part:"tooltip",title:a.join(`
2
+ `),x:m(g),y:m(p),width:m(h),height:b,fill:"var(--skdx-color-surface-raised)",stroke:V.axis,rx:8},...u.map((y,M)=>({kind:"text",part:"tooltip-label",x:m(g+6),y:m(p+11+M*16),text:y,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:u.length>1&&M===0?"bold":void 0}))]}function mr([e,n],t,r=!1,i){let o=typeof r=="boolean"?{scale:r?"log":"linear"}:r,a=ve(o.format??i),l=o.min??e,c=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 p=O=>Math.sign(O)*Math.sqrt(Math.abs(O)),y=o.nice===!1?[l,c]:pe(l,c,o.ticks),M=o.min??y[0],f=o.max??y[y.length-1],k=Me([p(M),p(f)],t),T=O=>k(p(O)),w=pe(M,f,o.ticks).filter(O=>O>=M-1e-9&&O<=f+1e-9);return{...d,scale:T,domain:[M,f],format:a,ticks:(w.length>=2?w:[M,f]).map(O=>({pos:m(T(O)),label:a(O)})),zero:m(T(Math.min(Math.max(0,M),f)))}}if(o.scale==="log"){let p=Math.max(l,Number.EPSILON),y=Math.max(c,p),M=ir(p,y),f=[Math.log10(p),Math.log10(y)],k=Me(f,t),T=w=>k(Math.log10(Math.max(w,Number.EPSILON)));return{...d,scale:T,domain:f,format:a,ticks:M.map(w=>({pos:m(T(w)),label:a(w)})),zero:m(t[0])}}let u=pe(l,c,o.ticks),h=[o.min??(o.nice===!1?l:u[0]),o.max??(o.nice===!1?c:u[u.length-1])],b=Me(h,t),v=u.filter(p=>p>=h[0]-1e-9&&p<=h[1]+1e-9),g=(v.length>=2?v:[h[0],h[1]]).map(p=>({pos:m(b(p)),label:a(p)}));return{...d,scale:b,domain:h,format:a,ticks:g,zero:m(b(Math.min(Math.max(0,h[0]),h[1])))}}var pr=([e,n],t)=>Math.max(te.left,pe(e,n).reduce((r,i)=>Math.max(r,t(i).length),0)*ee+14),br=e=>e?.grid!==!1;function it(e,n){if(e.length<2)return e;let t=e.reduce((i,o)=>Math.max(i,o.label.length),0)*ee+8,r=Math.max(1,Math.ceil(e.length*t/Math.max(1,n)));return r===1?e:e.filter((i,o)=>o%r===0)}var Nt=(e,n,t,r)=>`${e}, ${n}: ${r(t)}`;function xr(e,n,t,r){let i=e.error!==void 0?"error":e.loading?"loading":n?"empty":null;if(!i)return null;let{width:o,height:a}=nt(e,t,r),l=i==="error"?e.error:i==="loading"?"Loading\u2026":e.emptyMessage??"No data available",c=[];return i==="loading"&&c.push({kind:"rect",part:"skeleton",x:0,y:0,width:o,height:a,fill:"var(--skdx-color-surface-sunken)",rx:8}),c.push({kind:"text",part:`state-${i}`,x:m(o/2),y:m(a/2),text:l,anchor:"middle",baseline:"middle",fill:i==="error"?"var(--skdx-color-text-danger)":V.label}),{...Pt(e,o,a),shapes:c,tooltip:!1}}var Ft=(e,n,t)=>{let r=n.length*ee/2;return e+r>t?"end":e-r<0?"start":"middle"};function Gt(e,n={}){let{plot:t,xTicks:r,yTicks:i,baseline:o}=e,a=t.x+t.width,l=t.y+t.height,c=[],d=n.grid??!0,u=(g,p)=>p?{kind:"line",part:"grid",x1:g.pos,x2:g.pos,y1:t.y,y2:l,stroke:V.grid}:{kind:"line",part:"grid",x1:t.x,x2:a,y1:g.pos,y2:g.pos,stroke:V.grid},h=n.x?.tickRotation??0,b=(g,p,y,M)=>h?Y(g,p,y,{part:M,anchor:h<0?"end":"start",baseline:"middle",rotate:h}):mi(g,p,y,e.width,{part:M,anchor:Ft(g,y,e.width)}),v=(g,p,y,M,f)=>{for(let k of g)c.push(p==="x"?{kind:"line",part:"tick",x1:k.pos,x2:k.pos,y1:y,y2:m(y+M*f),stroke:V.axis}:{kind:"line",part:"tick",x1:y,x2:m(y+M*f),y1:k.pos,y2:k.pos,stroke:V.axis})};if(n.categoryGrid)for(let g of r)c.push(u(g,!n.horizontal));if(n.horizontal){let g=n.axes??[{ticks:i,position:"bottom",offset:0,label:n.yLabel,...n.y}];if(d)for(let p of i)c.push(u(p,!0));g[0]?.showLine!==!1&&c.push({kind:"line",part:"axis",x1:o,x2:o,y1:t.y,y2:l,stroke:V.axis});for(let p of g){let y=p.position==="top"||p.position==="right",M=m(y?t.y-p.offset:l+p.offset),f=y||p.offset>0;p.showLine&&f&&c.push({kind:"line",part:"axis",x1:t.x,x2:a,y1:M,y2:M,stroke:V.axis}),p.showTicks&&v(p.ticks,"x",M,y?-1:1,p.tickSize??4);let k=m(y?M-8:M+20);for(let T of p.ticks)c.push(y?Y(T.pos,k,T.label,{part:"x-label-top",anchor:Ft(T.pos,T.label,e.width)}):b(T.pos,k,T.label,"x-label"));p.label&&c.push(f?Y(4,k,p.label,{part:"axis-title",anchor:"start",baseline:y?void 0:"middle"}):Y(4,t.y-6,p.label,{part:"axis-title",anchor:"start"}))}n.x?.showLine&&c.push({kind:"line",part:"axis",x1:n.rtl?a:t.x,x2:n.rtl?a:t.x,y1:t.y,y2:l,stroke:V.axis}),n.x?.showTicks&&v(r,"y",n.rtl?a:t.x,n.rtl?1:-1,n.x.tickSize??4);for(let p of r)c.push(n.rtl?Y(a+8,p.pos,p.label,{part:"y-label",anchor:"start",baseline:"middle"}):Y(t.x-8,p.pos,p.label,{part:"y-label",anchor:"end",baseline:"middle"}))}else{if(d)for(let p of i)c.push(u(p,!1));n.y?.showLine!==!1&&c.push({kind:"line",part:"axis",x1:t.x,x2:a,y1:o,y2:o,stroke:V.axis});let g=n.axes??[{ticks:i,position:"left",offset:0,label:n.yLabel,...n.y},...n.rightTicks?[{ticks:n.rightTicks,position:"right",offset:0,label:n.rightLabel}]:[]];for(let p of g){let y=p.position==="left",M=y?t.x-p.offset:a+p.offset,f=y?"y-label":"y-label-right";p.showLine&&c.push({kind:"line",part:"axis",x1:m(M),x2:m(M),y1:t.y,y2:l,stroke:V.axis}),p.showTicks&&v(p.ticks,"y",m(M),y?-1:1,p.tickSize??4);for(let k of p.ticks)c.push(Y(m(y?M-8:M+8),k.pos,k.label,{part:f,anchor:y?"end":"start",baseline:"middle"}));p.label&&c.push(Y(m(y?p.offset===0?4:Math.max(4,M-40):p.offset===0?e.width-4:Math.min(e.width-4,M+40)),t.y-6,p.label,{part:"axis-title",anchor:y?"start":"end"}))}n.x?.showTicks&&v(r,"x",l,1,n.x.tickSize??4);for(let p of r)c.push(b(p.pos,l+(h?12:20),p.label,"x-label"))}return n.xLabel&&c.push(Y(m(t.x+t.width/2),e.height-4,n.xLabel,{part:"axis-title",anchor:"middle"})),n.horizontal&&n.rightLabel&&c.push(Y(e.width-4,t.y-6,n.rightLabel,{part:"axis-title",anchor:"end"})),c}var Y=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:V.label,...r});function mi(e,n,t,r,i={}){let o=Math.max(4,Math.min(r-4,e)),a=i.anchor??"start",l=a==="middle"?2*Math.min(o-4,r-o-4):a==="end"?o-4:r-o-4,c=Bt(t,l);return{kind:"text",part:"label",x:o,y:n,fill:V.label,...i,text:c,title:c===t?i.title:t}}function gr(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*ee+8,r=n.x-(n.anchor==="middle"?t/2:n.anchor==="end"?t-4:4),i=n.y-(n.baseline==="hanging"?2:n.baseline==="middle"?9:14);return[{kind:"rect",part:"label-background",x:r,y:i,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 De=(e,n,t,r,i,o)=>({kind:"circle",part:"point",cx:e,cy:n,r:t,fill:r,title:i,item:o});function _t(e,n){let t=[],{plot:r}=n,i=r.x+r.width,o=r.y+r.height,a=c=>Math.max(r.x,Math.min(i,c)),l=c=>Math.max(r.y,Math.min(o,c));for(let c of e??[]){let d=c.color??et(c.variant),u=c.color??Lt(c.variant),h={part:"reference-label",fill:u},b=n.horizontal===!0;if("y"in c){let v=m(n.y(c.y,c.axis??"left"));if(b){let g=a(v);t.push(...kr(g,r.y,o,d,c.label,h))}else{let g=l(v);t.push(...yr(r.x,i,g,d,c.label,h))}}else if("x"in c){let v=n.x(c.x);if(v===void 0)continue;b?t.push(...yr(r.x,i,l(m(v)),d,c.label,h)):t.push(...kr(a(m(v)),r.y,o,d,c.label,h))}else if("y1"in c){let v=m(n.y(c.y1,c.axis??"left")),g=m(n.y(c.y2,c.axis??"left"));b?t.push(...Mr(a(Math.min(v,g)),a(Math.max(v,g)),r,d,c.label,u)):t.push(...vr(l(Math.min(v,g)),l(Math.max(v,g)),r,d,c.label,u))}else{let v=n.x(c.x1),g=n.x(c.x2);if(v===void 0||g===void 0)continue;let p=m(Math.min(v,g)),y=m(Math.max(v,g));b?t.push(...vr(l(p),l(y),r,d,c.label,u)):t.push(...Mr(a(p),a(y),r,d,c.label,u))}}return t}function yr(e,n,t,r,i,o){let a={kind:"line",part:"reference",x1:e,x2:n,y1:t,y2:t,stroke:r,dash:"6 4",strokeWidth:1.5,title:i};return i?[a,Y(n-4,t-5,i,{...o,anchor:"end"})]:[a]}function kr(e,n,t,r,i,o){let a={kind:"line",part:"reference",x1:e,x2:e,y1:n,y2:t,stroke:r,dash:"6 4",strokeWidth:1.5,title:i};return i?[a,Y(e+4,n+10,i,{...o,anchor:"start"})]:[a]}function vr(e,n,t,r,i,o){let a={kind:"rect",part:"reference-area",x:t.x,y:e,width:t.width,height:m(Math.max(0,n-e)),fill:r,opacity:.12,title:i};return i?[a,Y(t.x+t.width-4,e+12,i,{part:"reference-label",fill:o,anchor:"end"})]:[a]}function Mr(e,n,t,r,i,o){let a={kind:"rect",part:"reference-area",x:e,y:t.y,width:m(Math.max(0,n-e)),height:t.height,fill:r,opacity:.12,title:i};return i?[a,Y(e+4,t.y+12,i,{part:"reference-label",fill:o,anchor:"start"})]:[a]}function wr(e,n){let t=[],{plot:r}=n,i=r.x+r.width,o=r.y+r.height;for(let a of e??[]){let l=a.color??et(a.variant),c=a.color??Lt(a.variant),d=(g,p,y)=>{let M=n.x(g);if(M===void 0)return;let f=n.y(p,y??"left");return n.horizontal?{x:m(f),y:m(M)}:{x:m(M),y:m(f)}},u=a.id??a.label,h=g=>({label:g,id:u,name:a.label});if(a.type==="line"||a.type==="band"){let{type:g,id:p,...y}=a;t.push(..._t([y],n));continue}if(a.type==="rect"){let g=d(a.x1,a.y1,a.axis),p=d(a.x2,a.y2,a.axis);if(!g||!p)continue;let y=Math.max(r.x,Math.min(g.x,p.x)),M=Math.max(r.y,Math.min(g.y,p.y)),f=a.label??"";t.push({kind:"rect",part:"annotation-rect",x:m(y),y:m(M),width:m(Math.max(0,Math.min(i,Math.max(g.x,p.x))-y)),height:m(Math.max(0,Math.min(o,Math.max(g.y,p.y))-M)),fill:l,opacity:.12,stroke:l,title:f||void 0,item:f?h(f):void 0}),a.label&&t.push(Y(m(y+4),m(M+12),a.label,{part:"annotation-label",fill:c}));continue}let b=d(a.x,a.y,a.axis);if(!b)continue;if(a.type==="text"){t.push(Y(b.x,b.y,a.text,{part:"annotation-text",fill:c,anchor:"middle",baseline:"middle",title:a.label}));continue}let v=a.label??`${String(a.x)}, ${a.y}`;if(t.push({kind:"circle",part:"annotation-point",cx:b.x,cy:b.y,r:5,fill:l,stroke:"var(--skdx-color-surface-default)",title:v,item:h(v)}),a.type==="callout"&&a.label){let[g,p]=a.offset??[16,-16],y=m(Math.max(r.x,Math.min(i,b.x+g))),M=m(Math.max(r.y,Math.min(o,b.y+p)));t.push({kind:"line",part:"annotation-leader",x1:b.x,y1:b.y,x2:y,y2:M,stroke:l},Y(y,M,a.label,{part:"annotation-label",fill:c,anchor:g>=0?"start":"end",baseline:"middle"}))}}return t}var jt=2e3;function pi(e){if(e!=="none")return e===void 0||e==="auto"?{strategy:"lttb",threshold:jt}:typeof e=="string"?{strategy:e,threshold:jt}:{strategy:e.strategy,threshold:e.threshold??jt}}function bi(e,n){let t=e.length;if(n>=t||n<3)return e.map((l,c)=>c);let r=[0],i=[],o=(t-2)/(n-2),a=0;for(let l=0;l<n-2;l++){let c=Math.floor((l+1)*o)+1,d=Math.min(t-1,Math.floor((l+2)*o)+1),u=0,h=0,b=0;for(let k=c;k<d;k++){let T=e[k];I(T)&&(u+=k,h+=T,b++)}u=b?u/b:(c+d)/2,h=b?h/b:0;let v=Math.floor(l*o)+1,g=Math.min(t-1,Math.floor((l+1)*o)+1),p=e[a],y=I(p)?p:0,M=-1,f=-1;for(let k=v;k<g;k++){let T=e[k];if(!I(T)){i.push(k);continue}let w=Math.abs((a-u)*(T-y)-(a-k)*(h-y));w>f&&(f=w,M=k)}M<0&&(M=v),r.push(M),a=M}return r.push(t-1),i.length?[...new Set([...r,...i])].sort((l,c)=>l-c):r}function xi(e,n){let t=e.length,r=Math.max(1,Math.floor(n/2));if(r*2>=t)return e.map((a,l)=>l);let i=[],o=t/r;for(let a=0;a<r;a++){let l=Math.floor(a*o),c=a===r-1?t:Math.floor((a+1)*o),d=-1,u=-1;for(let h=l;h<c;h++){let b=e[h];if(!I(b)){i.push(h);continue}(d<0||b<e[d])&&(d=h),(u<0||b>e[u])&&(u=h)}d>=0&&i.push(Math.min(d,u)),u>=0&&u!==d&&i.push(Math.max(d,u))}return[...new Set(i)].sort((a,l)=>a-l)}function gi(e,n){let t=e.length,r=Math.max(1,Math.floor(n/4));if(r*4>=t)return e.map((a,l)=>l);let i=[],o=t/r;for(let a=0;a<r;a++){let l=Math.floor(a*o),c=a===r-1?t:Math.floor((a+1)*o),d=-1,u=-1,h=-1,b=-1;for(let v=l;v<c;v++){let g=e[v];if(!I(g)){i.push(v);continue}h<0&&(h=v),b=v,(d<0||g<e[d])&&(d=v),(u<0||g>e[u])&&(u=v)}for(let v of[h,d,u,b])v>=0&&i.push(v)}return[...new Set(i)].sort((a,l)=>a-l)}function Sr(e,n,t){let r=pi(t);if(!r||n<=r.threshold||e.length===0)return;let i=r.strategy==="minmax"?xi:r.strategy==="m4"?gi:bi,o=new Set;for(let a of e)for(let l of i(a.slice(0,n),r.threshold))o.add(l);return[...o].sort((a,l)=>a-l)}function $r(e,n,t,r,i,o,a,l){if(r==="circle")return{...De(e,n,t,i,o,a),part:l};let c=r==="square"?`M${m(e-t)} ${m(n-t)}h${m(2*t)}v${m(2*t)}h${m(-2*t)}Z`:r==="diamond"?`M${m(e)} ${m(n-t*1.3)}L${m(e+t*1.3)} ${m(n)}L${m(e)} ${m(n+t*1.3)}L${m(e-t*1.3)} ${m(n)}Z`:`M${m(e)} ${m(n-t*1.2)}L${m(e+t*1.15)} ${m(n+t*.9)}L${m(e-t*1.15)} ${m(n+t*.9)}Z`;return{kind:"path",part:l,d:c,fill:i,title:o,item:a}}var yi=e=>{let n=0;return e.map(t=>I(t)?n+=t:null)},ki=e=>e.map((n,t)=>{let r=e[t-1];return t>0&&I(n)&&I(r)?n-r:null}),vi=e=>e.map((n,t)=>{let r=e[t-1];return t>0&&I(n)&&I(r)&&r!==0?(n-r)/Math.abs(r):null});function Mi(e,n){let t=Math.max(1,Math.floor(n));return e.map((r,i)=>{if(i<t-1)return null;let o=0;for(let a=i-t+1;a<=i;a++){let l=e[a];if(!I(l))return null;o+=l}return o/t})}function wi(e,n="max"){let t=0;for(let r of e)I(r)&&(t=n==="sum"?t+r:Math.max(t,r));return e.map(r=>I(r)?t===0?0:r/t:null)}function Si(e,n="desc"){let t=e.filter(I).sort((r,i)=>n==="asc"?r-i:i-r);return e.map(r=>I(r)?t.indexOf(r)+1:null)}var $i=(e,n=-1/0,t=1/0)=>e.map(r=>I(r)&&r>=n&&r<=t?r:null),Ci=(e,n="asc")=>[...e].sort((t,r)=>I(t)?I(r)?n==="asc"?t-r:r-t:-1:I(r)?1:0);function Ii(e,n,t="sum"){let r=Math.max(1,Math.floor(n)),i=[];for(let o=0;o<e.length;o+=r){let a=e.slice(o,o+r).filter(I);if(a.length===0){i.push(null);continue}let l=a.reduce((c,d)=>c+d,0);i.push(t==="sum"?l:t==="mean"?l/a.length:t==="min"?Math.min(...a):Math.max(...a))}return i}function Ti(e,n={}){let t=e.filter(I),r=Je(t,n);return{edges:r,counts:Qe(t,r).map(i=>i.count)}}function Et(e,n){let t=[...e];for(let r of n??[])switch(r.type){case"cumulative":t=yi(t);break;case"difference":t=ki(t);break;case"percentageChange":t=vi(t);break;case"movingAverage":t=Mi(t,r.window);break;case"normalize":t=wi(t,r.to);break;case"rank":t=Si(t,r.order);break;case"filter":t=$i(t,r.min,r.max);break;case"sort":t=Ci(t,r.order);break;case"aggregate":t=Ii(t,r.every,r.method);break;case"bin":t=Ti(t,r).counts;break}return t}var Ai=100,Oi=2e3,Cr=32,Ir=28,at=e=>e.position==="right"||e.position==="top";function zi(e){let t=(e.yAxis===void 0?[]:Array.isArray(e.yAxis)?e.yAxis:[e.yAxis]).map((i,o)=>({...i,id:i.id??(o===0?"left":o===1?"right":String(o)),position:i.position??(o===1?"right":"left")}));t.length===0&&t.push({id:"left",position:"left"});let r=t.some(i=>i.id==="right"||at(i));return e.rightAxis?t.push({...e.rightAxis,id:"right",position:"right"}):!r&&e.series.some(i=>i.axis==="right")&&t.push({id:"right",position:"right"}),t}function Ar(e,n){let t=e[0]?.id;return n===void 0||n==="left"?t:n==="right"?(e.find(r=>r.id==="right")??e.find(at))?.id:e.find(r=>r.id===n)?.id}var ot=e=>e.kind==="bar"||e.kind==="range"&&e.style==="bar";function Or(e,n){let t=ve(e.format),{series:r,categories:i,issues:o,axes:a}=Ri(e,n,t),l=e.direction==="rtl",c=e.baseline??0,d=Math.max(i.length,...r.map(s=>Math.max(s.data.length,s.low.length))),u=r.every(s=>ae(s.data).length===0&&ae(s.high).length===0),h=xr(e,u);if(h)return{...h,issues:o};let b=e.xAxis?.type??"category",v=b!=="category"&&i.length>0&&i.every(s=>typeof s!="string"||b==="time"&&I(oe(s))),g=v?i.map(oe):[],[p,y]=se(g),M=e.xAxis?.format??(b==="time"?{style:y-p<2*864e5?"time":"date"}:void 0),f=Array.from({length:d},(s,x)=>{let C=i[x];return C===void 0?String(x+1):Xe(C,M)}),k=Li(e.zoom,d),T=Array.from({length:k.end-k.start},(s,x)=>k.start+x),w=e.orientation==="horizontal",G=r.map(s=>({...s,hidden:s.hidden||w&&!ot(s)})).filter(s=>!s.hidden),E=G.some(s=>!ot(s))?Sr(G.filter(s=>!ot(s)).map(s=>T.map(x=>(s.kind==="range"?s.high[x]:s.data[x])??null)),T.length,e.sampling):void 0,P=E?E.map(s=>T[s]):T,X=e.stacked==="percent"||e.stackOffset==="expand",J=e.stackOffset??"zero",ne=new Map,de=new Map,mt=new Map;for(let s of G)s.stack!==void 0&&s.kind!=="range"&&mt.set(s.stack,[...mt.get(s.stack)??[],s]);for(let s of mt.values()){let x=new Array(d).fill(c),C=new Array(d).fill(c),_=new Array(d).fill(0);if(X)for(let N of s)N.data.forEach((R,j)=>{I(R)&&(_[j]=_[j]+Math.abs(R))});for(let N of s){let R=[],j=[];for(let D=0;D<d;D++){let F=N.data[D];if(!I(F)){R.push(null),j.push(null);continue}let L=_[D],A=X?L>0?F/L:0:F,H=A>=0?x:C;R.push(H[D]),H[D]=H[D]+A,j.push(H[D])}ne.set(N,R),de.set(N,j)}if(J==="silhouette"||J==="wiggle"){let N=new Array(d).fill(0);if(J==="silhouette")for(let R=0;R<d;R++)N[R]=-(x[R]-c)/2;else{let R=0;for(let j=0;j<d;j++){let D=s.length,F=0;for(let A=0;A<D;A++){let H=s[A],U=H.data[j],q=H.data[j-1],Q=j>0&&I(U)&&I(q)?U-q:0;F+=(D-A-.5)*Q}let L=x[j]-c;R=j===0?-L/2:R-(L>0?F/Math.max(1,D):0),N[j]=R}}for(let R of s){let j=ne.get(R),D=de.get(R);for(let F=0;F<d;F++){let L=j[F],A=D[F];I(L)&&(j[F]=L+N[F]),I(A)&&(D[F]=A+N[F])}}}}let Cn=s=>s.kind==="range"?{from:s.low,to:s.high}:{from:ne.get(s)??new Array(d).fill(c),to:de.get(s)??s.data},In=s=>{let x=[],C=!1;for(let R of G){if(R.axis!==s)continue;let{from:j,to:D}=Cn(R);for(let F of P){let L=D[F];if(I(L)&&x.push(L),R.kind==="range"||R.stack!==void 0){let A=j[F];I(A)&&x.push(A)}}if(R.errors)for(let F of P){let L=Tr(R.data[F],R.errors[F]);L&&x.push(L[0],L[1])}(R.kind==="bar"||R.kind==="area")&&J==="zero"&&(C=!0)}let[_,N]=se(x);return C?[Math.min(c,_),Math.max(c,N)]:[_,N]},{width:pt,height:Tn}=nt(e),Hr=e.brush?Cr+Ir:0,An=P.reduce((s,x)=>Math.max(s,f[x].length),0)*ee,On=X?{style:"percent"}:void 0,Zr=s=>{if(s.scale==="log")return te.left;let[x,C]=In(s.id),_=ve(s.format??On??e.format);return pr([s.min??x,s.max??C],_)+(s.showTicks?s.tickSize??4:0)},bt=s=>w?at(s)?"top":"bottom":at(s)!==l?"right":"left",zn=s=>w?24+(s.showTicks?s.tickSize??4:0):Zr(s),Wr=new Set(G.map(s=>s.axis)),xt=a.filter(s=>Wr.has(s.id)||a.length>1),Ln=new Map,xe={left:0,right:0,top:0,bottom:0};for(let s of xt){let x=bt(s);Ln.set(s.id,xe[x]),xe[x]+=zn(s)}let Rn=xt.find(s=>bt(s)==="bottom"),Vn=r.map(s=>({name:s.name,color:s.color})),Ur={top:te.top+dr(e,Vn,pt)+(a.some(s=>s.label)?12:0)+xe.top,right:w?l?Math.max(te.left,An+16):te.right:Math.max(te.right,xe.right),bottom:te.bottom+Hr+(e.xAxis?.label?14:0)+(e.xAxis?.tickRotation?24:0)+xe.bottom-(Rn?zn(Rn):0),left:w?l?te.right:Math.max(te.left,An+16):Math.max(te.left,xe.left)},K=sr(pt,Tn,Ur),Kr=w?l?[K.x+K.width,K.x]:[K.x,K.x+K.width]:[K.y+K.height,K.y],Bn=w?[K.y,K.y+K.height]:l?[K.x+K.width,K.x]:[K.x,K.x+K.width],gt=new Map(a.map(s=>[s.id,{...mr(In(s.id),Kr,{format:On,...s},e.format),position:bt(s),offset:Ln.get(s.id)??0}])),Pn=a[0]?.id,je=gt.get(Pn),yt=s=>gt.get(Ar(a,s)??Pn)??je,re=(s,x)=>yt(x).scale(s),Dn=s=>m(s.scale(Math.min(Math.max(c,Math.min(...s.domain)),Math.max(...s.domain)))),Ee=tr(P.length,Bn,e.barGap),kt=P.map(s=>g[s]),vt=[...kt].sort((s,x)=>s-x),ge=1/0;for(let s=1;s<vt.length;s++)ge=Math.min(ge,vt[s]-vt[s-1]);let[ye,Ce]=se(kt),ie=ge===1/0?Math.max(1,Math.abs(Ce)*.05||1):ge/2,Ie=Me([ye-ie,Ce+ie],Bn),He=s=>m(v?Ie(kt[s]):Ee.center(s)),Nn=v?Math.abs(Ie(ye+(ge===1/0?ie:ge))-Ie(ye))*.8:Ee.bandwidth,Fn=s=>v?He(s)-Nn/2:Ee.start(s),qr=v?(b==="time"?rr(ye-ie,Ce+ie):pe(ye-ie,Ce+ie)).filter(s=>s>=ye-ie&&s<=Ce+ie).map(s=>({pos:m(Ie(s)),label:Xe(s,M)})):it(P.map((s,x)=>({pos:He(x),label:f[s]})),w?1/0:K.width/Math.max(.2,Math.abs(Math.cos((e.xAxis?.tickRotation??0)*Math.PI/180)))),Mt={...Pt(e,pt,Tn,Vn),plot:K,xTicks:qr,yTicks:w?it(je.ticks,K.width):je.ticks,baseline:Dn(je)},Yr=a[0],Gn=Gt(Mt,{horizontal:w,rtl:l,axes:xt.map(s=>{let x=gt.get(s.id);return{ticks:w?it(x.ticks,K.width):x.ticks,position:x.position,offset:x.offset??0,label:s.label,showLine:s.showLine,showTicks:s.showTicks,tickSize:s.tickSize}}),xLabel:e.xAxis?.label,grid:br(Yr),categoryGrid:e.xAxis?.grid===!0,x:e.xAxis}),Xr=s=>{if(typeof s=="number"&&i.every(C=>typeof C=="string"))return s;let x=typeof s=="string"?s:oe(s);for(let C=0;C<d;C++){let _=i[C];if(_!==void 0&&(typeof x=="string"?_===x||f[C]===x:oe(_)===x))return C}},_n={plot:K,horizontal:w,x:s=>{if(v&&(typeof s!="string"||I(oe(s))))return Ie(oe(s));let x=Xr(s),C=x===void 0?-1:P.indexOf(x);return C<0?void 0:Ee.center(C)},y:(s,x)=>re(s,x)},jn=_t(e.references,_n);Gn.push(...jn.filter(s=>s.part!=="reference-label"));let Jr=gr(jn.filter(s=>s.part==="reference-label")),wt=[],St=new Map;for(let s of G){if(!ot(s))continue;let x=s.stack??s,C=wt.indexOf(x);C<0&&(C=wt.push(x)-1),St.set(s,C)}let Ze=Nn/Math.max(1,wt.length),ue=Math.min(Ze,e.barWidth??1/0),En=(Ze-ue)/2,$t=[],We=[],Ct=[],It=[],Tt=[],Hn=[],Ue=[],Ke=s=>yt(s.axis).format,At=Math.max(0,e.minBarSize??0),Qr=(s,x,C)=>{let _=Math.abs(x-s);if(_>=At)return[Math.min(s,x),_];let R=s+(w?C?1:-1:C?-1:1)*At;return[Math.min(s,R),At]},Te=(s,x,C,_)=>({label:_,series:s.name,seriesId:s.id??s.name,category:f[x],index:x,value:C}),Zn=(s,x,C,_)=>{let N=Tr(_,s.errors?.[x]);if(!N)return;let R=m(re(N[0],s.axis)),j=m(re(N[1],s.axis)),D=4,F="var(--skdx-color-text-default)",L=`${s.name}, ${f[x]}: ${Ke(s)(N[0])} \u2013 ${Ke(s)(N[1])}`;Hn.push(w?{kind:"line",part:"error-bar",x1:R,x2:j,y1:C,y2:C,stroke:F,title:L}:{kind:"line",part:"error-bar",x1:C,x2:C,y1:R,y2:j,stroke:F,title:L},w?{kind:"line",part:"error-cap",x1:R,x2:R,y1:m(C-D),y2:m(C+D),stroke:F}:{kind:"line",part:"error-cap",x1:m(C-D),x2:m(C+D),y1:R,y2:R,stroke:F},w?{kind:"line",part:"error-cap",x1:j,x2:j,y1:m(C-D),y2:m(C+D),stroke:F}:{kind:"line",part:"error-cap",x1:m(C-D),x2:m(C+D),y1:j,y2:j,stroke:F})};for(let s of G){let{from:x,to:C}=Cn(s),_=Ke(s),N=P.length<=Oi;if(s.kind==="bar"){let L="";P.forEach((A,H)=>{let U=s.data[A],q=x[A],Q=C[A];if(!I(U)||!I(q)||!I(Q))return;let ke=re(q,s.axis),me=re(Q,s.axis),[Ae,Oe]=Qr(ke,me,Q>=q),ze=Fn(H)+St.get(s)*Ze+En,Un=m(w?Ae:ze),Kn=m(w?ze:Ae),Ot=m(w?Oe:ue),qn=m(w?ue:Oe);if(!N){L+=`M${Un} ${Kn}h${Ot}v${qn}h${-Ot}Z`;return}let Yn=Nt(s.name,f[A],X?Q-q:U,_);if(We.push({kind:"rect",part:"bar",x:Un,y:Kn,width:Ot,height:qn,fill:s.color,rx:e.radius,title:Yn,item:Te(s,A,U,Yn)}),Zn(s,A,m(ze+ue/2),U),e.labels){let Xn=_(X?Q-q:U);Tt.push(w?Y(m(Math.max(ke,me)+4),m(ze+ue/2),Xn,{baseline:"middle"}):Y(m(ze+ue/2),m(Math.min(ke,me)-4),Xn,{anchor:"middle"}))}}),L&&We.push({kind:"path",part:"bars",d:L,fill:s.color,title:s.name});continue}if(s.kind==="range"&&s.style==="bar"){P.forEach((L,A)=>{let H=x[L],U=C[L];if(!I(H)||!I(U))return;let q=re(Math.min(H,U),s.axis),Q=re(Math.max(H,U),s.axis),ke=Fn(A)+St.get(s)*Ze+En,me=`${s.name}, ${f[L]}: ${_(Math.min(H,U))} \u2013 ${_(Math.max(H,U))}`,Ae=Te(s,L,U,me),Oe=Math.max(1,Math.abs(Q-q));We.push(w?{kind:"rect",part:"range",x:m(Math.min(q,Q)),y:m(ke),width:m(Oe),height:m(ue),fill:s.color,rx:e.radius,title:N?me:void 0,item:Ae}:{kind:"rect",part:"range",x:m(ke),y:m(Math.min(q,Q)),width:m(ue),height:m(Oe),fill:s.color,rx:e.radius,title:N?me:void 0,item:Ae})});continue}let R=e.nulls==="connect"||e.nulls===void 0&&e.connectNulls,j=[],D=[];P.forEach((L,A)=>{let H=x[L],U=C[L];if(!I(U)||!I(H)){!R&&D.length&&(j.push(D),D=[]);return}D.push({x:He(A),y:m(re(U,s.axis)),y0:m(re(H,s.axis)),i:L})}),D.length&&j.push(D);let F=s.markers??P.length<=Ai;for(let L of j){let A=be(L,s.curve);if(s.kind==="range"&&s.style==="line"){Ct.push({kind:"path",part:"range-high",d:A,stroke:s.color,strokeWidth:2,strokeLinejoin:"round"},{kind:"path",part:"range-low",d:be(L.map(H=>({x:H.x,y:H.y0})),s.curve),stroke:s.color,strokeWidth:2,strokeLinejoin:"round",dash:"4 3"});continue}if(s.kind==="range"){let H=be([...L].reverse().map(U=>({x:U.x,y:U.y0})),s.curve);$t.push({kind:"path",part:"range",d:`${A}L${H.slice(1)}Z`,fill:s.color,fillOpacity:.2,title:s.name});continue}if(s.kind==="area"){let H=Dn(yt(s.axis)),U=s.stack!==void 0?be([...L].reverse().map(Q=>({x:Q.x,y:Q.y0})),s.curve).slice(1):`${L[L.length-1]?.x} ${H}L${L[0]?.x} ${H}`,q=`skdx-g-${s.index}`;s.gradient&&!Ue.some(Q=>Q.id===q)&&Ue.push({id:q,vertical:!0,stops:[{offset:0,color:s.color,opacity:s.fillOpacity},{offset:1,color:s.color,opacity:0}]}),$t.push({kind:"path",part:"area",d:`${A}L${U}Z`,fill:s.gradient?`url(#${q})`:s.color,fillOpacity:s.gradient?void 0:s.fillOpacity})}Ct.push({kind:"path",part:"line",d:A,stroke:s.color,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",dash:s.dash})}if(s.kind==="range"&&N)for(let L of j)for(let A of L){let H=s.low[A.i],U=s.high[A.i],q=`${s.name}, ${f[A.i]}: ${_(Math.min(H,U))} \u2013 ${_(Math.max(H,U))}`;It.push({...De(A.x,A.y,.01,s.color,q,Te(s,A.i,U,q)),part:"anchor"})}if(s.kind!=="range")for(let L of j)for(let A of L){if(!F&&!N&&!e.labels&&!s.errors)continue;let H=s.data[A.i],U=X?C[A.i]-x[A.i]:H,q=Nt(s.name,f[A.i],U,_);(F||N)&&It.push(F&&s.symbol!=="circle"?$r(A.x,A.y,s.markerSize,s.symbol,s.color,N?q:void 0,Te(s,A.i,H,q),"point"):{...De(A.x,A.y,F?s.markerSize:.01,s.color,N?q:void 0,Te(s,A.i,H,q)),part:F?"point":"anchor"}),N&&Zn(s,A.i,w?A.y:A.x,C[A.i]),e.labels&&Tt.push(Y(A.x,A.y-8,_(U),{anchor:"middle"}))}}let Wn={plot:K,xs:w?[]:P.map((s,x)=>He(x)),rows:P.map(s=>[f[s],...G.map(x=>{let C=Ke(x);if(x.kind==="range"){let N=x.low[s],R=x.high[s];return`${x.name}: ${I(N)&&I(R)?`${C(N)} \u2013 ${C(R)}`:"\u2014"}`}let _=x.data[s];return`${x.name}: ${I(_)?C(X?(de.get(x)?.[s]??0)-(ne.get(x)?.[s]??0):_):"\u2014"}`})]),count:d,zoom:k,crosshair:lr(e)},qe=[];if(e.brush&&!w){let s={x:K.x,y:K.y+K.height+Ir,width:K.width,height:Cr},x=G.find(_=>_.kind!=="range"),C={x:m(s.x+k.start/Math.max(1,d)*s.width),y:s.y,width:m((k.end-k.start)/Math.max(1,d)*s.width),height:s.height};if(qe.push({kind:"rect",part:"brush",x:s.x,y:s.y,width:s.width,height:s.height,fill:"var(--skdx-color-surface-sunken)",stroke:V.grid}),x){let _=ae(x.data),[N,R]=se(_),j=d>1?s.width/(d-1):0,D=x.data.flatMap((L,A)=>I(L)?[{x:m(s.x+A*j),y:m(s.y+s.height-(R===N?.5:(L-N)/(R-N))*(s.height-4)-2)}]:[]),F=be(D);D.length>1&&qe.push({kind:"path",part:"brush-series",d:`${F}L${D[D.length-1]?.x} ${s.y+s.height}L${D[0]?.x} ${s.y+s.height}Z`,fill:x.color,fillOpacity:.3})}qe.push({kind:"rect",part:"brush-window",...C,fill:"var(--skdx-color-primary-500)",opacity:.15,stroke:V.axis},{kind:"rect",part:"brush-handle",x:m(C.x-3),y:s.y+8,width:6,height:s.height-16,fill:V.axis,rx:8},{kind:"rect",part:"brush-handle",x:m(C.x+C.width-3),y:s.y+8,width:6,height:s.height-16,fill:V.axis,rx:8}),Wn.brush={box:s,window:C}}return{...Mt,shapes:[...Gn,...$t,...We,...Ct,...Hn,...It,...Tt,...Jr,...wr(e.annotations,_n),...qe,...Mt.shapes],hit:Wn,issues:o,defs:Ue.length?Ue:void 0}}function Tr(e,n){if(!(!I(e)||n===null||n===void 0))return typeof n=="number"?I(n)?[e-Math.abs(n),e+Math.abs(n)]:void 0:I(n[0])&&I(n[1])?[Math.min(n[0],n[1]),Math.max(n[0],n[1])]:void 0}function Li(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 Ri(e,n,t){let r=f=>f.type??n,i=[],o=zi(e),a=e.categories??[],l=(e.transforms??[]).filter(f=>f.type==="sort"||f.type==="bin"||f.type==="aggregate"),c=(e.transforms??[]).filter(f=>!l.includes(f)),d=e.stacked||e.stackOffset!==void 0&&e.stackOffset!=="zero",u=(f,k,T)=>{let w=T.filter(O=>O!==null&&!(typeof O=="number"&&Number.isFinite(O))).length;w&&i.push({code:"invalid-value",severity:"warning",message:`Series "${f}" has ${w} value${w===1?"":"s"} that ${w===1?"is":"are"} neither a number nor null; drawn as gaps.`,itemId:k??f}),a.length&&T.length!==a.length&&!e.transform&&i.push({code:"length-mismatch",severity:"warning",message:`Series "${f}" has ${T.length} values for ${a.length} categories.`,itemId:k??f})},h=e.series.map((f,k)=>{let T=r(f),w=d?!0:void 0,O=f.type==="range"?void 0:f.stack,G=O===!1?void 0:O===!0||O===void 0&&w?`${T}`:O;f.type==="range"?(u(f.name,f.id,f.low),u(f.name,f.id,f.high)):u(f.name,f.id,f.data);let E=X=>e.nulls==="zero"?X.map(J=>I(J)?J:0):X,P=Ar(o,f.axis);return P===void 0&&i.push({code:"unknown-axis",severity:"warning",message:`Series "${f.name}" names axis "${String(f.axis)}", which is not defined; drawn on the first axis.`,itemId:f.id??f.name}),{name:f.name,id:f.id,color:ur(e,k,f.color),axis:P??o[0]?.id,hidden:hr(e,f.name),index:k,kind:T,data:f.type==="range"?[]:E(Et(Et(f.data,c),f.transforms)),low:f.type==="range"?f.low:[],high:f.type==="range"?f.high:[],curve:f.curve??e.curve??"linear",dash:f.type==="range"?void 0:f.dash,markers:f.type==="range"?void 0:f.markers,symbol:f.type==="range"?"circle":f.symbol??"circle",markerSize:f.type==="range"?3:f.markerSize??3,errors:f.type==="range"?void 0:f.errors,stack:T==="range"||T==="line"?void 0:G,style:f.type==="range"?f.style??"area":"area",fillOpacity:(f.type==="range"?void 0:f.fillOpacity)??e.fillOpacity??.25,gradient:f.type!=="range"&&f.gradient===!0}}),b=()=>Math.max(a.length,...h.map(f=>Math.max(f.data.length,f.low.length))),v=f=>{let k=w=>w.length?f.map(O=>w[O]??null):w,T=Array.from({length:b()},(w,O)=>a[O]??String(O+1));a=f.map(w=>T[w]),h=h.map(w=>({...w,data:k(w.data),low:k(w.low),high:k(w.high)}))},g=(f,k)=>{let T=(k!==void 0?h.find(O=>O.name===k):void 0)??h.find(O=>!O.hidden&&O.kind!=="range")??h[0];k!==void 0&&!h.some(O=>O.name===k)&&i.push({code:"unknown-series",severity:"warning",message:`sort.by names "${k}", which is not a series; sorted by the first series.`});let w=Array.from({length:b()},(O,G)=>G).sort((O,G)=>{let E=T?.data[O]??T?.high[O],P=T?.data[G]??T?.high[G],X=I(E)?E:-1/0,J=I(P)?P:-1/0;return f==="asc"?X-J:J-X});v(w)},p=f=>{let k=h.flatMap(w=>ae(w.data)),T=Je(k,f);a=T.slice(1).map((w,O)=>`${t(T[O])}\u2013${t(w)}`),h=h.map(w=>{let O=ae(w.data),G=0,E=Qe(O,T).map(P=>e.binMode==="density"?O.length?P.count/(O.length*(P.x1-P.x0)):0:e.binMode==="cumulative"?G+=P.count:P.count);return{...w,data:E}})},y=(f,k)=>{let T=Math.max(1,Math.floor(f)),w=b(),O=E=>{if(!E.length)return E;let P=[];for(let X=0;X<w;X+=T){let J=ae(E.slice(X,X+T));P.push(J.length===0?null:k==="sum"?J.reduce((ne,de)=>ne+de,0):k==="mean"?J.reduce((ne,de)=>ne+de,0)/J.length:k==="min"?Math.min(...J):Math.max(...J))}return P};a=Array.from({length:w},(E,P)=>a[P]??String(P+1)).filter((E,P)=>P%T===0),h=h.map(E=>({...E,data:O(E.data),low:O(E.low),high:O(E.high)}))};e.transform==="histogram"?p({bins:e.bins,binWidth:e.binWidth,domain:e.binDomain}):e.transform==="cumulative"&&(h=h.map(f=>{let k=0;return{...f,data:f.data.map(T=>I(T)?k+=T:k)}}));for(let f of l)f.type==="sort"?g(f.order??"desc"):f.type==="bin"?p(f):f.type==="aggregate"&&y(f.every,f.method??"sum");typeof e.sort=="string"?g(e.sort):e.sort&&g(e.sort.order,e.sort.by);let M=e.xAxis?.domain;if(M){let f=b(),k=Array.from({length:f},(G,E)=>a[E]??String(E+1)),T=G=>{let E=typeof G=="string"?G:oe(G);return k.findIndex(P=>typeof E=="string"?P===E||Xe(P)===E:oe(P)===E)},w=M.map(T),O=G=>G.length?w.map(E=>E<0?null:G[E]??null):G;a=[...M],h=h.map(G=>({...G,data:O(G.data),low:O(G.low),high:O(G.high)}))}return{series:h,categories:a,issues:i,axes:o}}var Ht=e=>Or(e,"line");function st(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var Zt=e=>e.id??e.name??e.series,zr=e=>e.seriesId??e.series;function le(e,n){let t=!1;return n.id!==void 0&&(t=!0,Zt(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,zr(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}function he(e){let n={},t=Zt(e);t!==void 0&&(n.id=t);let r=zr(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var Wt=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function Ut(e,n,t){let r=st(e),i=he(n),o=r.some(a=>le(n,a));return t==="single"?o?[]:[i]:o?r.filter(a=>!le(n,a)):[...r,i]}var Vi=.2;function Bi(e){let n=V.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 Pi=(e,n)=>e.kind==="text"?{...e,fill:V.grid}:{...e,opacity:(e.opacity??1)*n};function Kt(e,n){let t=st(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:st(n.highlighted),i=r[0];if(t.length===0&&!i)return e;let o={highlighted:n.highlightScope?.highlighted??"item",faded:n.highlightScope?.faded??"global"},a=[],l=u=>!i||r.some(h=>le(u,h))?!0:o.highlighted==="series"?r.some(h=>h.series!==void 0&&le(u,{series:h.series})):!1,c=u=>{if(!i||o.faded==="none"||l(u))return!1;if(o.faded==="series"){let h=i.series;return h!==void 0&&le(u,{series:h})}return!0},d=e.shapes.map(u=>{let h=u.item;if(!h||h.legend)return u;if(t.some(b=>le(h,b))){let b=Bi(u);b&&a.push(b)}return c(h)?Pi(u,Vi):u});return a.length?{...e,shapes:[...d,...a]}:{...e,shapes:d}}var Lr="var(--skdx-radius-default, var(--skdx-radius-md, 0.5rem))";function lt(e){return["tooltip","skeleton","label-background","stage-label-background","brush-handle"].includes(e)?Lr:void 0}function $e(e,n,t,r,i){let o=e.getBoundingClientRect();return{x:o.width?(n-o.left)*r/o.width:n,y:o.height?(t-o.top)*i/o.height:t}}var qt=(e,n,t)=>n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height;function Rr(e,n){let t=0,r=1/0;return e.xs.forEach((i,o)=>{let a=Math.abs(i-n);a<r&&(r=a,t=o)}),t}function Ne(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=Rr(t,n),i=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(i,r)??i}}function Yt(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=t.xs[Rr(t,n)];return{kind:"line",part:"crosshair",x1:r,x2:r,y1:t.plot.y,y2:t.plot.y+t.plot.height,stroke:V.axis,dash:"3 3"}}function Xt(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!qt(r.plot,n,t))return[];let i=Yt(e,n),{rows:o}=Ne(e,n),a=e.tooltipAnchored?r.plot.y+8:t;return[i,...rt(i.x1,a,o,e.width,e.height,e.tooltipPlacement)]}function Jt(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 i=t.xs[r];return Xt(e,i,t.plot.y+8)}function Qt(e,n,t,r,i){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:c,y:d}=$e(t,r,i,e.width,e.height);if(qt(e.hit.plot,c,d)){let u=Ne(e,c),h=Yt(e,c);if(u&&h)return{lines:u.rows,shapes:[h]}}}let o=n?.closest?.("[data-skdx-part]"),a=e.tooltipFormatter?fe(e,n)?.item:void 0,l=a&&e.tooltipFormatter?.(a)||o&&Array.from(o.children).find(c=>c.tagName.toLowerCase()==="title")?.textContent;return l?{lines:Array.isArray(l)?l:[l],shapes:[]}:{lines:[],shapes:[]}}function Vr(e,n,t,r,i,o,a){let l=e?.closest?.("[data-skdx-part]"),c=a&&a.tooltipFormatter?fe(a,e)?.item:void 0,d=c&&a?.tooltipFormatter?.(c)||l&&Array.from(l.children).find(g=>g.tagName.toLowerCase()==="title")?.textContent;if(!d)return[];let u=a?.tooltipAnchored?fe(a,e):void 0,h=u?a?.shapes[u.index]:void 0,{x:b,y:v}=h?Fe(h):$e(n,t,r,i,o);return rt(b,v,d,i,o,a?.tooltipPlacement)}function en(e,n,t,r,i){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:a}=$e(t,r,i,e.width,e.height),l=Xt(e,o,a);if(l.length>0)return l}return Vr(n,t,r,i,e.width,e.height,e)}function tn(e,n){let t=fe(e,n);return t&&!t.item.legend?he(t.item):null}var Di=(e,n)=>{let{x:t,y:r}=Fe(e),i=e.kind==="circle"?e.cy:e.kind==="rect"?e.y+e.height/2:r;return t>=n.x&&t<=n.x+n.width&&i>=n.y&&i<=n.y+n.height};function nn(e,n){let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor"||!Di(i,n))continue;let o=he(i.item),a=JSON.stringify(o);t.has(a)||(t.add(a),r.push(o))}return r}var rn=e=>({kind:"rect",part:"selection-box",x:m(e.x),y:m(e.y),width:m(e.width),height:m(e.height),fill:V.focus,opacity:.12,stroke:V.focus}),dt=(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 Br(e,n,t){let r=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){let a=e[i],l=e[o];a.y>t!=l.y>t&&n<(l.x-a.x)*(t-a.y)/(l.y-a.y)+a.x&&(r=!r)}return r}function on(e,n){if(n.length<3)return[];let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor")continue;let{x:o,y:a}=Fe(i),l=i.kind==="circle"?i.cy:i.kind==="rect"?i.y+i.height/2:a;if(!Br(n,o,l))continue;let c=he(i.item),d=JSON.stringify(c);t.has(d)||(t.add(d),r.push(c))}return r}var an=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${m(n.x)} ${m(n.y)}`).join("L")}`:"",fill:V.focus,fillOpacity:.12,stroke:V.focus,dash:"4 3"}),ct=6;function sn(e,n,t){let r=e.edit;if(r){for(let i of r.bars)if(!(t<i.y||t>i.y+i.height||n<i.x0-ct||n>i.x1+ct))return Math.abs(n-i.x0)<=ct?{bar:i,mode:"start"}:Math.abs(n-i.x1)<=ct?{bar:i,mode:"end"}:{bar:i,mode:"move"}}}function ln(e,n,t){let r=e.edit;return Pr(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function cn(e,n,t){let r=e.edit,i=t.key==="ArrowRight"?1:t.key==="ArrowLeft"?-1:0;if(!r||n===null||!i||!(t.shiftKey||t.altKey))return;let o=r.bars.find(c=>c.index===n);if(!o)return;let a=t.altKey?t.shiftKey?"start":"end":"move",l=r.snap??r.invert(o.x0+10)-r.invert(o.x0);return Pr(r,{bar:o,mode:a},i*l)}function Pr(e,{bar:n,mode:t},r){let i=l=>e.snap?Math.round(l/e.snap)*e.snap:l,o=n.start,a=n.end;return t==="move"?(o=i(n.start+r),a=o+(n.end-n.start)):t==="start"?o=Math.min(i(n.start+r),n.end):a=Math.max(i(n.end+r),n.start),{id:n.id,name:n.name,start:o,end:a}}function dn(e,n,t){let r=e.edit,i=r.scale(t.start),o=r.scale(t.end);return{kind:"rect",part:"edit-ghost",x:m(Math.min(i,o)),y:m(n.bar.y),width:m(Math.max(1,Math.abs(o-i))),height:m(n.bar.height),fill:V.focus,opacity:.25,stroke:V.focus,rx:2}}var Ni=64,Fi=e=>Math.max(1,Math.min(Ni,e));function un(e,n,t,r){let i=n>0?.8:1.25,o=Fi(e.view.zoom*i);if(o===e.view.zoom)return e.view;let{plot:a,scale:l}=e,[c,d]=e.view.center,u=(t-(a.x+a.width/2))/l,h=(r-(a.y+a.height/2))/l,b=e.view.zoom/o;return{center:[c+u*(1-b),e.fromY(e.toY(d)-h*(1-b))],zoom:o}}function hn(e,n,t,r){let{scale:i}=e;return{center:[n.center[0]-t/i,e.fromY(e.toY(n.center[1])+r/i)],zoom:n.zoom}}function fe(e,n){let t=n?.closest?.("[data-skdx-i]"),r=Number(t?.getAttribute("data-skdx-i")),i=Number.isInteger(r)?e.shapes[r]?.item:void 0;return i?{index:r,item:i}:void 0}var ut=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function Fe(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 fn(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=V.focus,i;switch(t.kind){case"rect":i={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":i={kind:"circle",part:"focus",cx:t.cx,cy:t.cy,r:t.r+3,fill:"none",stroke:r};break;case"line":i={kind:"line",part:"focus",x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:r,strokeWidth:4};break;case"text":i={kind:"rect",part:"focus",x:t.x-2,y:t.y-8,width:t.text.length*ee+4,height:16,fill:"none",stroke:r,rx:2};break;case"path":i={kind:"path",part:"focus",d:t.d,stroke:r,strokeWidth:2,fill:"none"};break}let{x:o,y:a}=Fe(t),l=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[i,...l?rt(m(o),m(a),l,e.width,e.height):[]]}function mn(e,n,t){let r=ut(e);if(r.length===0)return;let i=n===null?-1:r.indexOf(n);switch(t){case"ArrowRight":case"ArrowDown":return r[Math.min(r.length-1,i+1)];case"ArrowLeft":case"ArrowUp":return r[Math.max(0,i<=0?0:i-1)];case"Home":return r[0];case"End":return r[r.length-1];case"Escape":return null;default:return}}var we=2,Se=(e,n,t)=>{let r=Math.max(we,Math.min(t,Math.round(n))),i=Math.max(0,Math.min(t-r,Math.round(e)));return{start:i,end:i+r}},Dr=(e,n)=>!e||e.start<=0&&e.end>=n;function pn(e,n,t){if(e.count<=we||!e.plot.width)return;let{start:r,end:i}=e.zoom,o=i-r,a=n>0?1.25:.8,l=Math.max(we,Math.min(e.count,Math.round(o*a)));if(l===o)return n>0&&!Dr(e.zoom,e.count)?Se(r,l,e.count):void 0;let c=Math.max(0,Math.min(1,(t-e.plot.x)/e.plot.width)),d=r+c*o;return Se(d-c*l,l,e.count)}function bn(e,n,t,r){let i=n.end-n.start,o=Math.max(we,Math.min(e.count,Math.round(i/Math.max(.05,t)))),a=Math.max(0,Math.min(1,(r-e.plot.x)/Math.max(1,e.plot.width)));return Se(n.start+a*i-a*o,o,e.count)}function xn(e,n,t){let r=n.end-n.start,i=e.plot.width/Math.max(1,r);return Se(n.start-t/i,r,e.count)}function gn(e,n,t){let r=e.brush;if(!r||!qt(r.box,n,t))return;let i=r.window;if(Math.abs(n-i.x)<=6)return{grab:"left",zoom:e.zoom};if(Math.abs(n-(i.x+i.width))<=6)return{grab:"right",zoom:e.zoom};if(n>i.x&&n<i.x+i.width)return{grab:"move",zoom:e.zoom};let o=e.zoom.end-e.zoom.start,a=(n-r.box.x)/Math.max(1,r.box.width)*e.count;return{grab:"move",zoom:Se(a-o/2,o,e.count)}}function yn(e,n,t,r){let i=e.brush;if(!i)return t;let o=r/Math.max(1,i.box.width)*e.count;if(n==="move")return Se(t.start+o,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-we,Math.round(t.start+o))),end:t.end};let a=Math.min(e.count,Math.max(t.start+we,Math.round(t.end+o)));return{start:t.start,end:a}}function vn(e,n){switch(n.type){case"svg":return Promise.resolve(kn(e,n.label,n.resolve));case"csv":return Promise.resolve(_r(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=kn(e,n.label,n.resolve);return Gr(t,e.width,e.height,n.scale,n.background)}}}var ce=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;"),Ge=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${ce(String(t))}"`).join("");function Nr(e){let n=e.title?`<title>${ce(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${Ge([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${Ge([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${Ge([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${Ge([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${Ge([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]])}>${ce(e.text)}</text>`}}function Fr(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${ce(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="${ce(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function kn(e,n,t){let r=Fr(e)+e.shapes.map(Nr).join("");return t&&(r=r.replace(/var\((--[\w-]+)\)/g,(i,o)=>t(o).trim()||i)),`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e.width} ${e.height}" width="${e.width}" height="${e.height}" role="img" aria-label="${ce(n)}" font-family="${ce(V.fontFamily)}" font-size="${ce(V.fontSize)}"><title>${ce(n)}</title>${r}</svg>`}function Gr(e,n,t,r=2,i){return new Promise((o,a)=>{let l=URL.createObjectURL(new Blob([e],{type:"image/svg+xml;charset=utf-8"})),c=new Image;c.onload=()=>{URL.revokeObjectURL(l);let d=document.createElement("canvas");d.width=Math.round(n*r),d.height=Math.round(t*r);let u=d.getContext("2d");if(!u)return a(new Error("canvas 2d context unavailable"));i&&(u.fillStyle=i,u.fillRect(0,0,d.width,d.height)),u.drawImage(c,0,0,d.width,d.height),d.toBlob(h=>h?o(h):a(new Error("toBlob failed")),"image/png")},c.onerror=()=>{URL.revokeObjectURL(l),a(new Error("svg could not be decoded"))},c.src=l})}function _r(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 Mn(e,n){if(!n)return;let t=typeof n=="object"?n.maxRows??500:500,r=e.hit;if(r&&r.rows.length>0){let l=r.rows[0];if(r.rows.length>t)return;let c=["",...l.slice(1).map(u=>u.replace(/:\s[^:]*$/,""))],d=r.rows.map(u=>[u[0],...u.slice(1).map(h=>h.slice(h.lastIndexOf(": ")+2))]);return[c,...d]}let i=e.shapes.flatMap(l=>l.item&&!l.item.legend&&!(l.part==="anchor"&&!l.title)?[l.item]:[]);if(i.length===0||i.length>t)return;let o=["series","name","category","value"].filter(l=>i.some(c=>c[l]!==void 0)),a=(l,c)=>l[c]===void 0?"":String(l[c]);return[o.map(l=>l[0]?.toUpperCase()+l.slice(1)),...i.map(l=>o.map(c=>a(l,c)))]}var wn=new Map;function ht(e){let n=wn.get(e);if(n)return n.group;let t=new Set,r={},i={current:r,subscribe(o){return t.add(o),()=>{t.delete(o),t.size===0&&wn.delete(e)}},publish(o,a){Object.assign(r,o);for(let l of t)l(o,a)}};return wn.set(e,{group:i,listeners:t}),i}var jr='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',Sn=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${jr}{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){${jr}{animation:none;transition:none}}`;function $n(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}var z=require("lit"),$=require("lit/decorators.js"),Z=require("lit/directives/if-defined.js");var Gi={fromAttribute:()=>!1},B=class extends z.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 i=this.drag;if(i?.grab==="select"){let{x:o,y:a}=this.viewBox(t,r);this.overlay=[rn(dt(i.x,i.y,o,a))];return}if(i?.grab==="lasso"){let{x:o,y:a}=this.viewBox(t,r);i.points=[...i.points??[],{x:o,y:a}],this.overlay=[an(i.points)];return}if(i?.grab==="edit"){if(!i.gantt)return;let{x:o}=this.viewBox(t,r);i.change=ln(r,i.gantt,o-i.x),this.overlay=[dn(r,i.gantt,i.change)];return}if(i?.grab==="map"){if(!r.map||!i.view)return;let{x:o,y:a}=this.viewBox(t,r);this.setView(hn(r.map,i.view,o-i.x,a-i.y));return}if(i&&r.hit){if(i.grab==="pinch"){let[a,l]=[...this.pointers.values()];if(a===void 0||l===void 0||!i.distance)return;this.setZoom(bn(r.hit,i.zoom,Math.abs(a-l)/i.distance,(a+l)/2));return}let{x:o}=this.viewBox(t,r);this.setZoom(i.grab==="pan"?xn(r.hit,i.zoom,o-i.x):yn(r.hit,i.grab,i.zoom,o-i.x));return}if(r.tooltipPortal){let{lines:o,shapes:a}=Qt(r,t.target,t.currentTarget,t.clientX,t.clientY);this.tip=a,this.portal=o.length?{x:t.clientX,y:t.clientY,lines:o}:null}else{let o=en(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(tn(r,t.target)),this.syncId&&r.hit?.crosshair){let o=Ne(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:i,y:o}=this.viewBox(t,r),a=fe(r,t.target)?.item.legend,l=this.canEdit(r)?sn(r,i,o):void 0;if(l){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"edit",gantt:l},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.brushing()&&!a){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:this.selectionMode==="lasso"?"lasso":"select",points:[{x:i,y:o}]},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.canPan(r)&&r.map){let d=r.map.plot;if(i<d.x||i>d.x+d.width||o<d.y||o>d.y+d.height)return;this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"map",view:r.map.view},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}let c=r.hit;if(!(!c||!this.canZoom(r))){if(this.pointers.set(t.pointerId,i),this.pointers.size===2){let[d,u]=[...this.pointers.values()];this.drag={x:(d+u)/2,y:o,zoom:c.zoom,grab:"pinch",distance:Math.abs(d-u)||1}}else{let d=gn(c,i,o);if(d)this.drag={x:i,y:o,zoom:d.zoom,grab:d.grab},d.zoom!==c.zoom&&this.setZoom(d.zoom);else if(this.zoomable&&i>=c.plot.x&&i<=c.plot.x+c.plot.width&&o>=c.plot.y&&o<=c.plot.y+c.plot.height)this.drag={x:i,y:o,zoom:c.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 i=this.drag,o=this.layout;if(o&&(i?.grab==="select"||i?.grab==="lasso"||i?.grab==="edit"||i?.grab==="map")){this.overlay=[];let{x:a,y:l}=this.viewBox(t,o);if(Math.abs(a-i.x)>2||Math.abs(l-i.y)>2){i.grab==="select"?this.setSelected(nn(o,dt(i.x,i.y,a,l))):i.grab==="lasso"?this.setSelected(on(o,i.points??[])):i.grab==="edit"&&i.change&&this.emit("skdx-task-change",i.change),this.drag={...i,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:i,y:o}=this.viewBox(t,r);if(r.map&&this.canPan(r)){let c=r.map.plot;if(i<c.x||i>c.x+c.width||o<c.y||o>c.y+c.height)return;t.preventDefault(),this.setView(un(r.map,t.deltaY,i,o));return}let a=r.hit;if(!a||!this.canZoom(r)||o<a.plot.y||o>a.plot.y+a.plot.height)return;let l=pn(a,t.deltaY,i);l&&(t.preventDefault(),this.setZoom(l))};this.onClick=t=>{if(!this.layout)return;if(this.drag?.distance===-1){this.drag=null;return}let r=fe(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 l=r.shapes[this.focused]?.item;l&&(t.preventDefault(),this.select(l),this.emit("skdx-item-click",l));return}let i=this.canEdit(r)?cn(r,this.focused,t):void 0;if(i){t.preventDefault(),this.emit("skdx-task-change",i);return}let o=mn(r,this.focused,t.key);if(o===void 0)return;t.preventDefault(),this.focused=o;let a=o===null?void 0:r.shapes[o]?.item;this.highlight(a?he(a):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:i,tooltip:o,format:a,palette:l,loading:c,error:d,emptyMessage:u,description:h,decorative:b,animated:v,responsive:g,highlighted:p,highlightScope:y,accessibleTable:M}=this;return{...typeof g=="object"&&this.measured!==void 0&&this.measured<(g.breakpoint??480)?g.compact:void 0,width:g&&this.measured?this.measured:t,height:r,animate:v,responsive:g,legend:i,tooltip:o,format:a,palette:l,loading:c,error:d,emptyMessage:u,description:h,decorative:b,highlighted:p===void 0?this.highlightState:p,highlightScope:y,accessibleTable:M,hiddenSeries:this.hiddenSeries??this.hiddenState,zoom:this.zoom??this.zoomState,selected:this.selected??this.selectedState,view:this.view??this.viewState}}emit(t,r){this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0}))}publish(t){this.syncId&&ht(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=ht(this.syncId),r=i=>{"highlighted"in i&&(this.highlightState=i.highlighted??null),i.selected&&(this.selectedState=i.selected,this.crossFilter&&(this.highlightState=i.selected.length?i.selected:null)),"zoom"in i&&(this.zoomState=i.zoom),i.hiddenSeries&&(this.hiddenState=i.hiddenSeries),"crosshair"in i&&(this.crossState=i.crosshair??null)};r(t.current),this.leave=t.subscribe((i,o)=>{o!==this.token&&r(i)})}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,i=r.includes(t)?r.filter(o=>o!==t):[...r,t];this.hiddenState=i,this.emit("skdx-hidden-series-change",i),this.publish({hiddenSeries:i})}highlight(t){let r=this.hover;r===t||r&&t&&Wt(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(Ut(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 $e(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 i=r.shapes.findIndex(o=>o.item&&!o.item.legend&&le(o.item,t));return i<0?!1:(this.getSvgElement()?.focus(),this.focused=i,!0)}export(t){let r=this.layout;return r?vn(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,i){this.join();let o=Kt(Dt(t),this.sized());if(this.layout=o,o.issues!==this.reported){this.reported=o.issues;for(let y of o.issues??[])this.emit("skdx-data-issue",y)}let a=this.canZoom(o),l=this.canPan(o),c=this.canEdit(o),d=this.brushing(),u=a||l||c||d,h=!o.decorative&&ut(o).length>0,b=$n(o),v=Mn(o,this.accessibleTable),g=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||i,p=this.portal;return z.html`<svg
3
4
  xmlns="http://www.w3.org/2000/svg"
4
5
  viewBox="0 0 ${o.width} ${o.height}"
5
6
  width=${o.width}
6
7
  height=${o.height}
7
8
  role=${o.decorative?"presentation":"img"}
8
- aria-hidden=${o.decorative?"true":O.nothing}
9
- aria-label=${o.decorative?O.nothing:i}
10
- aria-describedby=${(0,U.ifDefined)(b)}
11
- tabindex=${h?0:O.nothing}
9
+ aria-hidden=${o.decorative?"true":z.nothing}
10
+ aria-label=${o.decorative?z.nothing:i}
11
+ aria-description=${(0,Z.ifDefined)(o.description)}
12
+ tabindex=${h?0:z.nothing}
12
13
  data-skdx-chart=${r}
13
- data-zoomable=${s||l?"":O.nothing}
14
- data-brushing=${d&&!(s||l)?"":O.nothing}
15
- data-editable=${c?"":O.nothing}
16
- style=${y?`--skdx-chart-duration:${y}`:O.nothing}
14
+ data-zoomable=${a||l?"":z.nothing}
15
+ data-brushing=${d&&!(a||l)?"":z.nothing}
16
+ data-editable=${c?"":z.nothing}
17
+ style=${b?`--skdx-chart-duration:${b}`:z.nothing}
17
18
  font-family=${V.fontFamily}
18
19
  font-size=${V.fontSize}
19
- @pointermove=${o.tooltip||u?this.onPointerMove:O.nothing}
20
+ @pointermove=${o.tooltip||u?this.onPointerMove:z.nothing}
20
21
  @pointerleave=${()=>{this.clearTip(),this.highlight(null)}}
21
- @pointerdown=${u?this.onPointerDown:O.nothing}
22
- @pointerup=${u?this.onPointerUp:O.nothing}
23
- @pointercancel=${u?this.onPointerUp:O.nothing}
24
- @wheel=${s||l?this.onWheel:O.nothing}
25
- @dblclick=${s||l?()=>l?this.setView(void 0):this.setZoom(void 0):O.nothing}
22
+ @pointerdown=${u?this.onPointerDown:z.nothing}
23
+ @pointerup=${u?this.onPointerUp:z.nothing}
24
+ @pointercancel=${u?this.onPointerUp:z.nothing}
25
+ @wheel=${a||l?this.onWheel:z.nothing}
26
+ @dblclick=${a||l?()=>l?this.setView(void 0):this.setZoom(void 0):z.nothing}
26
27
  @click=${this.onClick}
27
- @keydown=${h?this.onKeyDown:O.nothing}
28
+ @keydown=${h?this.onKeyDown:z.nothing}
28
29
  @blur=${()=>{this.focused=null,this.highlight(null)}}
29
30
  >
30
31
  <title>${i}</title>
31
- ${o.description?O.svg`<desc id=${(0,U.ifDefined)(b)}>${o.description}</desc>`:O.nothing}
32
- ${y?O.svg`<style>${kn}</style>`:O.nothing} ${Ri(o)}
33
- ${ht(o.shapes)}
34
- ${ht(this.tip.length||!this.crossState?this.tip:Kt(o,this.crossState))}
35
- ${ht(cn(o,this.focused))} ${ht(this.overlay)}
32
+ ${o.description?z.svg`<desc>${o.description}</desc>`:z.nothing}
33
+ ${b?z.svg`<style>${Sn}</style>`:z.nothing} ${_i(o)}
34
+ ${ft(o.shapes)}
35
+ ${ft(this.tip.length||!this.crossState?this.tip:Jt(o,this.crossState))}
36
+ ${ft(fn(o,this.focused))} ${ft(this.overlay)}
36
37
  </svg>
37
- ${M?O.html`<div
38
+ ${p?z.html`<div
38
39
  role="tooltip"
39
40
  data-skdx-tooltip=${r}
40
- style="left:${M.x+12}px;top:${M.y+12}px"
41
+ style="left:${p.x+12}px;top:${p.y+12}px"
41
42
  >
42
- ${M.lines.map(v=>O.html`<div>${v}</div>`)}
43
- </div>`:O.nothing}
44
- ${x?O.html`<table data-skdx-table=${r}>
43
+ ${p.lines.map(y=>z.html`<div>${y}</div>`)}
44
+ </div>`:z.nothing}
45
+ ${v?z.html`<table data-skdx-table=${r}>
45
46
  <caption>
46
- ${p}
47
+ ${g}
47
48
  </caption>
48
49
  <thead>
49
50
  <tr>
50
- ${(x[0]??[]).map(v=>O.html`<th scope="col">${v}</th>`)}
51
+ ${(v[0]??[]).map(y=>z.html`<th scope="col">${y}</th>`)}
51
52
  </tr>
52
53
  </thead>
53
54
  <tbody>
54
- ${x.slice(1).map(v=>O.html`<tr>
55
- ${v.map((f,w)=>w===0?O.html`<th scope="row">${f}</th>`:O.html`<td>${f}</td>`)}
55
+ ${v.slice(1).map(y=>z.html`<tr>
56
+ ${y.map((M,f)=>f===0?z.html`<th scope="row">${M}</th>`:z.html`<td>${M}</td>`)}
56
57
  </tr>`)}
57
58
  </tbody>
58
- </table>`:O.nothing}`}};B.styles=O.css`
59
+ </table>`:z.nothing}`}};B.styles=z.css`
59
60
  :host {
60
61
  display: inline-block;
61
62
  }
@@ -63,7 +64,6 @@
63
64
  display: block;
64
65
  max-width: 100%;
65
66
  height: auto;
66
- outline: none;
67
67
  }
68
68
  svg[data-zoomable] {
69
69
  cursor: grab;
@@ -78,6 +78,9 @@
78
78
  }
79
79
  :host([responsive]) {
80
80
  display: block;
81
+ /* Keep centered flex/grid hosts independent of the previous SVG's intrinsic width. */
82
+ width: 100%;
83
+ min-width: 0;
81
84
  }
82
85
  table {
83
86
  position: absolute;
@@ -97,7 +100,7 @@
97
100
  background: var(--skdx-color-surface-raised);
98
101
  color: var(--skdx-color-text-default);
99
102
  border: 1px solid var(--skdx-color-border-strong);
100
- border-radius: 3px;
103
+ border-radius: var(--skdx-radius-default, var(--skdx-radius-md, 0.5rem));
101
104
  padding: 4px 8px;
102
105
  font-family: var(--skdx-font-family);
103
106
  font-size: var(--skdx-font-size-xs);
@@ -106,4 +109,4 @@
106
109
  [role='tooltip'] > :first-child:not(:only-child) {
107
110
  font-weight: bold;
108
111
  }
109
- `,S([(0,$.property)({type:Number})],B.prototype,"width",2),S([(0,$.property)({type:Number})],B.prototype,"height",2),S([(0,$.property)()],B.prototype,"label",2),S([(0,$.property)({type:Boolean,reflect:!0})],B.prototype,"legend",2),S([(0,$.property)({type:Boolean,attribute:"no-tooltip",converter:Li})],B.prototype,"tooltip",2),S([(0,$.property)({attribute:!1})],B.prototype,"format",2),S([(0,$.property)({attribute:!1})],B.prototype,"palette",2),S([(0,$.property)({attribute:!1})],B.prototype,"hiddenSeries",2),S([(0,$.property)({attribute:!1})],B.prototype,"selected",2),S([(0,$.property)({attribute:"selection-mode"})],B.prototype,"selectionMode",2),S([(0,$.property)({attribute:!1})],B.prototype,"highlighted",2),S([(0,$.property)({attribute:!1})],B.prototype,"highlightScope",2),S([(0,$.property)({type:Boolean,reflect:!0})],B.prototype,"loading",2),S([(0,$.property)()],B.prototype,"error",2),S([(0,$.property)({attribute:"empty-message"})],B.prototype,"emptyMessage",2),S([(0,$.property)()],B.prototype,"description",2),S([(0,$.property)({type:Boolean,reflect:!0})],B.prototype,"decorative",2),S([(0,$.property)({type:Boolean,attribute:"accessible-table"})],B.prototype,"accessibleTable",2),S([(0,$.property)({attribute:!1})],B.prototype,"zoom",2),S([(0,$.property)({attribute:!1})],B.prototype,"view",2),S([(0,$.property)({type:Boolean,reflect:!0})],B.prototype,"zoomable",2),S([(0,$.property)({type:Boolean,reflect:!0})],B.prototype,"editable",2),S([(0,$.property)({attribute:"sync-id"})],B.prototype,"syncId",2),S([(0,$.property)({type:Boolean,attribute:"cross-filter"})],B.prototype,"crossFilter",2),S([(0,$.property)({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],B.prototype,"animated",2),S([(0,$.property)({type:Boolean,reflect:!0})],B.prototype,"responsive",2),S([(0,$.state)()],B.prototype,"tip",2),S([(0,$.state)()],B.prototype,"overlay",2),S([(0,$.state)()],B.prototype,"portal",2),S([(0,$.state)()],B.prototype,"measured",2),S([(0,$.state)()],B.prototype,"viewState",2),S([(0,$.state)()],B.prototype,"highlightState",2),S([(0,$.state)()],B.prototype,"crossState",2),S([(0,$.state)()],B.prototype,"focused",2),S([(0,$.state)()],B.prototype,"hiddenState",2),S([(0,$.state)()],B.prototype,"zoomState",2),S([(0,$.state)()],B.prototype,"selectedState",2);var E=class extends B{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:i,yAxis:o,rightAxis:s,references:l,annotations:c,labels:d,curve:u,connectNulls:h,nulls:b,stacked:y,stackOffset:x,orientation:p,radius:M,barGap:v,barWidth:f,sort:w,transform:T,transforms:k,bins:z,binWidth:G,binDomain:H,binMode:P,sampling:X,brush:Q,crosshair:ne}=this;return{...this.sized(),series:t,categories:r,xAxis:i,yAxis:o,rightAxis:s,references:l,annotations:c,labels:d,curve:u,connectNulls:h,nulls:b,stacked:y,stackOffset:x,orientation:p,radius:M,barGap:v,barWidth:f,sort:w,transform:T,transforms:k,bins:z,binWidth:G,binDomain:H,binMode:P,sampling:X,brush:Q,crosshair:ne}}};S([(0,$.property)({attribute:!1})],E.prototype,"series",2),S([(0,$.property)({attribute:!1})],E.prototype,"categories",2),S([(0,$.property)({attribute:!1})],E.prototype,"xAxis",2),S([(0,$.property)({attribute:!1})],E.prototype,"yAxis",2),S([(0,$.property)({attribute:!1})],E.prototype,"rightAxis",2),S([(0,$.property)({attribute:!1})],E.prototype,"references",2),S([(0,$.property)({attribute:!1})],E.prototype,"annotations",2),S([(0,$.property)({type:Boolean,reflect:!0})],E.prototype,"labels",2),S([(0,$.property)()],E.prototype,"curve",2),S([(0,$.property)({type:Boolean,attribute:"connect-nulls"})],E.prototype,"connectNulls",2),S([(0,$.property)()],E.prototype,"nulls",2),S([(0,$.property)({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],E.prototype,"stacked",2),S([(0,$.property)({attribute:"stack-offset"})],E.prototype,"stackOffset",2),S([(0,$.property)()],E.prototype,"orientation",2),S([(0,$.property)({type:Number})],E.prototype,"radius",2),S([(0,$.property)({type:Number,attribute:"bar-gap"})],E.prototype,"barGap",2),S([(0,$.property)({type:Number,attribute:"bar-width"})],E.prototype,"barWidth",2),S([(0,$.property)()],E.prototype,"sort",2),S([(0,$.property)()],E.prototype,"transform",2),S([(0,$.property)({attribute:!1})],E.prototype,"transforms",2),S([(0,$.property)({type:Number})],E.prototype,"bins",2),S([(0,$.property)({type:Number,attribute:"bin-width"})],E.prototype,"binWidth",2),S([(0,$.property)({attribute:!1})],E.prototype,"binDomain",2),S([(0,$.property)({attribute:"bin-mode"})],E.prototype,"binMode",2),S([(0,$.property)({attribute:!1})],E.prototype,"sampling",2),S([(0,$.property)({type:Boolean,reflect:!0})],E.prototype,"brush",2),S([(0,$.property)({type:Boolean,reflect:!0})],E.prototype,"crosshair",2);var Ri=e=>e.defs&&e.defs.length?O.svg`<defs>${e.defs.map(n=>O.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=>O.svg`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${(0,U.ifDefined)(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:O.nothing,ht=e=>O.svg`${e.map((n,t)=>{let r=n.title?O.svg`<title>${n.title}</title>`:O.nothing,i=n.item?t:void 0;switch(n.kind){case"path":return O.svg`<path data-skdx-part=${n.part} data-skdx-i=${(0,U.ifDefined)(i)} d=${n.d} fill=${n.fill??"none"} stroke=${(0,U.ifDefined)(n.stroke)} stroke-width=${(0,U.ifDefined)(n.strokeWidth)} stroke-linecap=${(0,U.ifDefined)(n.strokeLinecap)} stroke-linejoin=${(0,U.ifDefined)(n.strokeLinejoin)} stroke-dasharray=${(0,U.ifDefined)(n.dash)} opacity=${(0,U.ifDefined)(n.opacity)} fill-opacity=${(0,U.ifDefined)(n.fillOpacity)}>${r}</path>`;case"rect":return O.svg`<rect data-skdx-part=${n.part} data-skdx-i=${(0,U.ifDefined)(i)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${(0,U.ifDefined)(n.rx)} fill=${n.fill} stroke=${(0,U.ifDefined)(n.stroke)} fill-opacity=${(0,U.ifDefined)(n.opacity)}>${r}</rect>`;case"line":return O.svg`<line data-skdx-part=${n.part} data-skdx-i=${(0,U.ifDefined)(i)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${(0,U.ifDefined)(n.strokeWidth)} stroke-dasharray=${(0,U.ifDefined)(n.dash)} opacity=${(0,U.ifDefined)(n.opacity)}>${r}</line>`;case"circle":return O.svg`<circle data-skdx-part=${n.part} data-skdx-i=${(0,U.ifDefined)(i)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${(0,U.ifDefined)(n.stroke)} opacity=${(0,U.ifDefined)(n.opacity)}>${r}</circle>`;case"text":return O.svg`<text data-skdx-part=${n.part} data-skdx-i=${(0,U.ifDefined)(i)} x=${n.x} y=${n.y} text-anchor=${(0,U.ifDefined)(n.anchor)} dominant-baseline=${(0,U.ifDefined)(n.baseline)} fill=${(0,U.ifDefined)(n.fill)} font-weight=${(0,U.ifDefined)(n.weight)} pointer-events=${(0,U.ifDefined)(i===void 0?"none":void 0)} transform=${(0,U.ifDefined)(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var _e=class extends E{render(){return this.root(Gt(this.input()),"line",this.label??"Line chart")}};_e=S([(0,Dr.customElement)("skdx-line-chart")],_e);0&&(module.exports={SkdxLineChart});
112
+ `,S([(0,$.property)({type:Number})],B.prototype,"width",2),S([(0,$.property)({type:Number})],B.prototype,"height",2),S([(0,$.property)()],B.prototype,"label",2),S([(0,$.property)({type:Boolean,reflect:!0})],B.prototype,"legend",2),S([(0,$.property)({type:Boolean,attribute:"no-tooltip",converter:Gi})],B.prototype,"tooltip",2),S([(0,$.property)({attribute:!1})],B.prototype,"format",2),S([(0,$.property)({attribute:!1})],B.prototype,"palette",2),S([(0,$.property)({attribute:!1})],B.prototype,"hiddenSeries",2),S([(0,$.property)({attribute:!1})],B.prototype,"selected",2),S([(0,$.property)({attribute:"selection-mode"})],B.prototype,"selectionMode",2),S([(0,$.property)({attribute:!1})],B.prototype,"highlighted",2),S([(0,$.property)({attribute:!1})],B.prototype,"highlightScope",2),S([(0,$.property)({type:Boolean,reflect:!0})],B.prototype,"loading",2),S([(0,$.property)()],B.prototype,"error",2),S([(0,$.property)({attribute:"empty-message"})],B.prototype,"emptyMessage",2),S([(0,$.property)()],B.prototype,"description",2),S([(0,$.property)({type:Boolean,reflect:!0})],B.prototype,"decorative",2),S([(0,$.property)({type:Boolean,attribute:"accessible-table"})],B.prototype,"accessibleTable",2),S([(0,$.property)({attribute:!1})],B.prototype,"zoom",2),S([(0,$.property)({attribute:!1})],B.prototype,"view",2),S([(0,$.property)({type:Boolean,reflect:!0})],B.prototype,"zoomable",2),S([(0,$.property)({type:Boolean,reflect:!0})],B.prototype,"editable",2),S([(0,$.property)({attribute:"sync-id"})],B.prototype,"syncId",2),S([(0,$.property)({type:Boolean,attribute:"cross-filter"})],B.prototype,"crossFilter",2),S([(0,$.property)({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],B.prototype,"animated",2),S([(0,$.property)({type:Boolean,reflect:!0})],B.prototype,"responsive",2),S([(0,$.state)()],B.prototype,"tip",2),S([(0,$.state)()],B.prototype,"overlay",2),S([(0,$.state)()],B.prototype,"portal",2),S([(0,$.state)()],B.prototype,"measured",2),S([(0,$.state)()],B.prototype,"viewState",2),S([(0,$.state)()],B.prototype,"highlightState",2),S([(0,$.state)()],B.prototype,"crossState",2),S([(0,$.state)()],B.prototype,"focused",2),S([(0,$.state)()],B.prototype,"hiddenState",2),S([(0,$.state)()],B.prototype,"zoomState",2),S([(0,$.state)()],B.prototype,"selectedState",2);var W=class extends B{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:i,yAxis:o,rightAxis:a,references:l,annotations:c,labels:d,curve:u,connectNulls:h,nulls:b,stacked:v,stackOffset:g,orientation:p,radius:y,barGap:M,barWidth:f,sort:k,transform:T,transforms:w,bins:O,binWidth:G,binDomain:E,binMode:P,sampling:X,brush:J,crosshair:ne}=this;return{...this.sized(),series:t,categories:r,xAxis:i,yAxis:o,rightAxis:a,references:l,annotations:c,labels:d,curve:u,connectNulls:h,nulls:b,stacked:v,stackOffset:g,orientation:p,radius:y,barGap:M,barWidth:f,sort:k,transform:T,transforms:w,bins:O,binWidth:G,binDomain:E,binMode:P,sampling:X,brush:J,crosshair:ne}}};S([(0,$.property)({attribute:!1})],W.prototype,"series",2),S([(0,$.property)({attribute:!1})],W.prototype,"categories",2),S([(0,$.property)({attribute:!1})],W.prototype,"xAxis",2),S([(0,$.property)({attribute:!1})],W.prototype,"yAxis",2),S([(0,$.property)({attribute:!1})],W.prototype,"rightAxis",2),S([(0,$.property)({attribute:!1})],W.prototype,"references",2),S([(0,$.property)({attribute:!1})],W.prototype,"annotations",2),S([(0,$.property)({type:Boolean,reflect:!0})],W.prototype,"labels",2),S([(0,$.property)()],W.prototype,"curve",2),S([(0,$.property)({type:Boolean,attribute:"connect-nulls"})],W.prototype,"connectNulls",2),S([(0,$.property)()],W.prototype,"nulls",2),S([(0,$.property)({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],W.prototype,"stacked",2),S([(0,$.property)({attribute:"stack-offset"})],W.prototype,"stackOffset",2),S([(0,$.property)()],W.prototype,"orientation",2),S([(0,$.property)({type:Number})],W.prototype,"radius",2),S([(0,$.property)({type:Number,attribute:"bar-gap"})],W.prototype,"barGap",2),S([(0,$.property)({type:Number,attribute:"bar-width"})],W.prototype,"barWidth",2),S([(0,$.property)()],W.prototype,"sort",2),S([(0,$.property)()],W.prototype,"transform",2),S([(0,$.property)({attribute:!1})],W.prototype,"transforms",2),S([(0,$.property)({type:Number})],W.prototype,"bins",2),S([(0,$.property)({type:Number,attribute:"bin-width"})],W.prototype,"binWidth",2),S([(0,$.property)({attribute:!1})],W.prototype,"binDomain",2),S([(0,$.property)({attribute:"bin-mode"})],W.prototype,"binMode",2),S([(0,$.property)({attribute:!1})],W.prototype,"sampling",2),S([(0,$.property)({type:Boolean,reflect:!0})],W.prototype,"brush",2),S([(0,$.property)({type:Boolean,reflect:!0})],W.prototype,"crosshair",2);var _i=e=>e.defs&&e.defs.length?z.svg`<defs>${e.defs.map(n=>z.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=>z.svg`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${(0,Z.ifDefined)(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:z.nothing,ft=e=>z.svg`${e.map((n,t)=>{let r=n.title?z.svg`<title>${n.title}</title>`:z.nothing,i=n.item?t:void 0;switch(n.kind){case"path":return z.svg`<path data-skdx-part=${n.part} data-skdx-i=${(0,Z.ifDefined)(i)} d=${n.d} fill=${n.fill??"none"} stroke=${(0,Z.ifDefined)(n.stroke)} stroke-width=${(0,Z.ifDefined)(n.strokeWidth)} stroke-linecap=${(0,Z.ifDefined)(n.strokeLinecap)} stroke-linejoin=${(0,Z.ifDefined)(n.strokeLinejoin)} stroke-dasharray=${(0,Z.ifDefined)(n.dash)} opacity=${(0,Z.ifDefined)(n.opacity)} fill-opacity=${(0,Z.ifDefined)(n.fillOpacity)}>${r}</path>`;case"rect":return z.svg`<rect data-skdx-part=${n.part} data-skdx-i=${(0,Z.ifDefined)(i)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${(0,Z.ifDefined)(n.rx)} style=${(0,Z.ifDefined)(lt(n.part)?`rx:${lt(n.part)}`:void 0)} fill=${n.fill} stroke=${(0,Z.ifDefined)(n.stroke)} fill-opacity=${(0,Z.ifDefined)(n.opacity)} pointer-events=${(0,Z.ifDefined)(n.part==="stage-label-background"||n.part==="label-background"?"none":void 0)}>${r}</rect>`;case"line":return z.svg`<line data-skdx-part=${n.part} data-skdx-i=${(0,Z.ifDefined)(i)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${(0,Z.ifDefined)(n.strokeWidth)} stroke-dasharray=${(0,Z.ifDefined)(n.dash)} opacity=${(0,Z.ifDefined)(n.opacity)}>${r}</line>`;case"circle":return z.svg`<circle data-skdx-part=${n.part} data-skdx-i=${(0,Z.ifDefined)(i)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${(0,Z.ifDefined)(n.stroke)} opacity=${(0,Z.ifDefined)(n.opacity)}>${r}</circle>`;case"text":return z.svg`<text aria-label=${(0,Z.ifDefined)(n.title)} data-skdx-part=${n.part} data-skdx-i=${(0,Z.ifDefined)(i)} x=${n.x} y=${n.y} text-anchor=${(0,Z.ifDefined)(n.anchor)} dominant-baseline=${(0,Z.ifDefined)(n.baseline)} fill=${(0,Z.ifDefined)(n.fill)} font-weight=${(0,Z.ifDefined)(n.weight)} pointer-events=${(0,Z.ifDefined)(i===void 0?"none":void 0)} transform=${(0,Z.ifDefined)(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var _e=class extends W{render(){return this.root(Ht(this.input()),"line",this.label??"Line chart")}};_e=S([(0,Er.customElement)("skdx-line-chart")],_e);0&&(module.exports={SkdxLineChart});
package/dist/line.d.cts CHANGED
@@ -1,2 +1,2 @@
1
1
  import 'lit';
2
- export { as as SkdxLineChart } from './index-oF5ss8v9.cjs';
2
+ export { at as SkdxLineChart } from './index-D44-61v7.cjs';
package/dist/line.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  import 'lit';
2
- export { as as SkdxLineChart } from './index-oF5ss8v9.js';
2
+ export { at as SkdxLineChart } from './index-D44-61v7.js';