@oliasoft-open-source/charts-library 5.1.4-beta-1 → 5.1.4-beta-2

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.
@@ -1,4 +1,4 @@
1
- import{af as ac,ag as uc,h as V0,ah as Ku,ai as Ts,aj as aM,ak as gs,al as rg,am as ao,an as Ote,ao as zte,ap as ec,aq as v$,ar as Ute,as as qte,at as Wte,au as Vte,av as Mh,aw as E$,ax as uM,ay as hd,az as tp,aA as m6,aB as w$,aC as $te,aD as g6,aE as $0,aF as y6,aG as Gte,v as vn,aH as mI,aI as Yte,r as Kte,aJ as Xte,aK as jte,aL as Qte,aM as Jte,aN as Zte,aO as ene,aP as tne,aQ as nne,aR as rne,aS as ine,aT as G0,c as lM,P as Qd}from"./legend-context-DfYCGzMd.js";import{j as x,r as one}from"./jsx-runtime-W3oueGCa.js";import{r as q,g as sne,R as We}from"./index-YTOF1_EJ.js";import{r as No,h as T$}from"./index-DHw5ixvP.js";import{e as ane}from"./index-CgYGpm1H.js";/*!
1
+ import{af as ac,ag as uc,h as V0,ah as Ku,ai as Ts,aj as aM,ak as gs,al as rg,am as ao,an as Ote,ao as zte,ap as ec,aq as v$,ar as Ute,as as qte,at as Wte,au as Vte,av as Mh,aw as E$,ax as uM,ay as hd,az as tp,aA as m6,aB as w$,aC as $te,aD as g6,aE as $0,aF as y6,aG as Gte,v as vn,aH as mI,aI as Yte,r as Kte,aJ as Xte,aK as jte,aL as Qte,aM as Jte,aN as Zte,aO as ene,aP as tne,aQ as nne,aR as rne,aS as ine,aT as G0,c as lM,P as Qd}from"./legend-context-Ck5tFDGN.js";import{j as x,r as one}from"./jsx-runtime-W3oueGCa.js";import{r as q,g as sne,R as We}from"./index-YTOF1_EJ.js";import{r as No,h as T$}from"./index-DHw5ixvP.js";import{e as ane}from"./index-CgYGpm1H.js";/*!
2
2
  * chartjs-plugin-annotation v3.1.0
3
3
  * https://www.chartjs.org/chartjs-plugin-annotation/index
4
4
  * (c) 2024 chartjs-plugin-annotation Contributors
@@ -62,7 +62,7 @@ function print() { __p += __j.call(arguments, '') }
62
62
  Copyright (c) 2018 Jed Watson.
63
63
  Licensed under the MIT License (MIT), see
64
64
  http://jedwatson.github.io/classnames
65
- */var vg;function zP(){return vg||(vg=1,function(t){(function(){var e={}.hasOwnProperty;function n(){for(var o="",l=0;l<arguments.length;l++){var c=arguments[l];c&&(o=s(o,i(c)))}return o}function i(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var l="";for(var c in o)e.call(o,c)&&o[c]&&(l=s(l,c));return l}function s(o,l){return l?o?o+" "+l:o+l:o}t.exports?(n.default=n,t.exports=n):window.classNames=n})()}(Ec)),Ec.exports}var HP=zP();const UP=Pg(HP),Sg=10,VP=t=>t==null?void 0:t.reduce((e,n,i)=>{if(i===0)return e;const s=Math.abs(n-(t==null?void 0:t[i-1]));return Math.max(s,e)},0),$P=(t,e,n)=>{const{axis:i,left:s,top:o,right:l,bottom:c}=n??{},u=i==="x",h=u?s:o,d=u?l:c,m=t>h,_=t<d,v=e.indexOf(t)!==-1;return m&&_&&!v},GP=(t,e)=>{var c;const n=t==null?void 0:t.sort((u,h)=>u-h),i=VP(t)/10,s=t[0],o=(t.length+1)*Sg;return(c=[...Array(o)].map((u,h)=>{const d=s+(h-Sg+1)*i;return parseFloat(d==null?void 0:d.toFixed(1))}))==null?void 0:c.filter(u=>$P(u,n,e))},YP=t=>{var c,u,h,d,m,_,v,M,T,k,A,R,W,z;const{chart:e,ctx:n}=t??{};if(!n||(n==null?void 0:n.canvas)===null)return;const i=e==null?void 0:e.config;if(!((d=(h=(u=(c=i==null?void 0:i.options)==null?void 0:c.scales)==null?void 0:u[t==null?void 0:t.id])==null?void 0:h.grid)!=null&&d.drawOnChartArea)||((m=i==null?void 0:i.options)==null?void 0:m.indexAxis)===(t==null?void 0:t.axis))return;const s=(t==null?void 0:t.axis)==="x",o=(v=(_=t==null?void 0:t.ticks)==null?void 0:_.map((L,Y)=>t==null?void 0:t.getPixelForTick(Y)))==null?void 0:v.sort((L,Y)=>L-Y),l=GP(o,t);(M=n==null?void 0:n.save)==null||M.call(n),n.strokeStyle=((W=(R=(A=(k=(T=i==null?void 0:i._config)==null?void 0:T.options)==null?void 0:k.scales)==null?void 0:A[t.id])==null?void 0:R.grid)==null?void 0:W.color)||"rgba(0,0,0,0.06)",n.lineWidth=.5,l==null||l.forEach(L=>{var Y,V,G,J,rt;if(n.beginPath(),s){const{top:et,bottom:at}=(e==null?void 0:e.chartArea)??{};(Y=n==null?void 0:n.moveTo)==null||Y.call(n,L,et),(V=n==null?void 0:n.lineTo)==null||V.call(n,L,at)}else{const{left:et,right:at}=(e==null?void 0:e.chartArea)??{};(G=n==null?void 0:n.moveTo)==null||G.call(n,et,L),(J=n==null?void 0:n.lineTo)==null||J.call(n,at,L)}(rt=n==null?void 0:n.stroke)==null||rt.call(n)}),(z=n==null?void 0:n.restore)==null||z.call(n)},XP={id:"minorGridlines",beforeDatasetsDraw:t=>{var n;const{scales:e}=t??{};(n=Object.keys(e))==null||n.forEach(i=>YP(e==null?void 0:e[i]))}},kn={ZERO:0,INITIAL:2,HOVERED:6,POINT_HOVERED:8},KP="rgba(0,0,0,0.1)",qP=[10,2],jP=12,sp='"Roobert", "Noto Sans", sans-serif',rp="hsl(60, 10.34482759%, 12.5%)",wg=12,ZC=8,JC=4,_a="transparent",QC=[1,10,100,1e3,1e4],ZP=["#3366cc","#dc3912","#ff9900","#109618","#990099","#0099c6","#dd4477","#66aa00","#b82e2e","#316395","#994499","#22aa99","#aaaa11","#6633cc","#e67300","#8b0707","#651067","#329262","#5574a6","#3b3eac"],t3="99",JP=16777215,e3="auto",n3={NO:0,FAST:1e3},Mg="new_chart",QP="htmlLegend",tC=9,i3=1/10**tC,s3=[{offset:0,color:"rgba(144,238,144,0.8)"},{offset:.6,color:"rgba(255,255,224,0.8)"},{offset:.8,color:"rgba(255,255,224,0.8)"},{offset:.92,color:"rgba(255,182,193,0.5)"},{offset:.99,color:"rgba(255,182,193,0.8)"}];var yf=(t=>(t.X="x",t.Y="y",t))(yf||{}),Mi=(t=>(t.Bottom="bottom",t.Top="top",t.Left="left",t.Right="right",t.TopRight="top-right",t.TopLeft="top-left",t.BottomLeft="bottom-left",t.BottomRight="bottom-right",t))(Mi||{}),eC=(t=>(t.Line="line",t.Bar="bar",t))(eC||{}),ls=(t=>(t.Pointer="pointer",t.Initial="initial",t.Grab="grab",t.Grabbing="grabbing",t.Crosshair="crosshair",t.Move="move",t))(ls||{}),nC=(t=>(t.Category="category",t.Linear="linear",t.Logarithmic="logarithmic",t))(nC||{}),op=(t=>(t.Vertical="vertical",t))(op||{}),iC=(t=>(t.Y="yLabel",t.X="xLabel",t))(iC||{}),sC=(t=>(t.End="end",t.Start="start",t.Center="center",t.Right="right",t.Left="left",t))(sC||{}),rC=(t=>(t.Box="box",t.Ellipse="ellipse",t.Line="line",t.Text="text",t))(rC||{}),ap=(t=>(t.Circle="circle",t.Square="rect",t.Diamond="rectRot",t.Triangle="triangle",t))(ap||{}),oC=(t=>(t.Nearest="nearest",t))(oC||{}),aC=(t=>(t.X="x",t.Y="y",t.XY="xy",t.Z="z",t))(aC||{}),lC=(t=>(t.Shift="Shift",t))(lC||{}),cC=(t=>(t.Mousemove="mousemove",t.Mouseout="mouseout",t.Click="click",t.Touchstart="touchstart",t.Touchmove="touchmove",t.Dblclick="dblclick",t))(cC||{});const fC={id:"chartAreaBorder",beforeDraw(t,e,n){var h,d,m,_;if(!(t!=null&&t.ctx)||!t.chartArea)return;const{ctx:i,chartArea:s}=t??{},{left:o,top:l,width:c,height:u}=s??{};(h=i==null?void 0:i.save)==null||h.call(i),i.strokeStyle=n==null?void 0:n.borderColor,i.lineWidth=n==null?void 0:n.borderWidth,(d=i==null?void 0:i.setLineDash)==null||d.call(i,(n==null?void 0:n.borderDash)||[]),i.lineDashOffset=(n==null?void 0:n.borderDashOffset)??0,(m=i==null?void 0:i.strokeRect)==null||m.call(i,o,l,c,u),(_=i==null?void 0:i.restore)==null||_.call(i)}},r3=(t,e)=>{var s;let n=[];t!=null&&t.showMinorGridlines&&n.push(XP);const i=e==null?void 0:e.customLegend;return i!=null&&i.customLegendPlugin&&(i!=null&&i.customLegendContainerID)&&n.push({id:QP,...(s=e==null?void 0:e.customLegend)==null?void 0:s.customLegendPlugin}),n.push(fC),n},uC=t=>{const e=`#${Math.floor(Math.random()*JP).toString(16)}`;return t.includes(e)?uC(t):(t.push(e),t)},o3=t=>t.title!==""?{display:!0,text:(t==null?void 0:t.title)??""}:{},a3=t=>t===op.Vertical,l3=(t,e)=>{const[n,i]=t===yf.Y?[Mi.Left,Mi.Right]:[Mi.Top,Mi.Bottom];return e%2===0?n:i},c3=(t,e)=>{const{width:n,height:i,staticChartHeight:s=!1,squareAspectRatio:o=0}=t,l=o?e==null?void 0:e.squareAspectRatio:"";let c="";return n||i?c="":c=s?e==null?void 0:e.fixedHeight:e==null?void 0:e.stretchHeight,UP(e==null?void 0:e.chart,c,l)},f3=(t,e)=>{const{legend:n}=t||{};return{position:(n==null?void 0:n.position)||Mi.Top,display:n==null?void 0:n.display,align:n==null?void 0:n.align,labels:{boxHeight:wg,boxWidth:n!=null&&n.usePointStyle?wg:void 0,usePointStyle:n==null?void 0:n.usePointStyle},onClick:e}},u3=t=>{var n,i;const{error:e=null}=((i=(n=t==null?void 0:t.dataset)==null?void 0:n.data)==null?void 0:i[t==null?void 0:t.dataIndex])??{};return e?`Error: ${Xm(e,4)}`:""},h3=(t,e)=>{var s,o,l;const n=(l=(o=(s=t==null?void 0:t.dataset)==null?void 0:s.data)==null?void 0:o[t==null?void 0:t.dataIndex])==null?void 0:l.label,i=Array.isArray(n)?n==null?void 0:n.join(" , "):n??"";return e&&(i!=null&&i.length)?` (${i})`:""},hC=t=>t.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"_").replace(/_+/g,"_").replace(/^_+|_+$/g,""),d3=t=>Zn.isEmpty(t)||Zn.isNil(t)?Mg:t.map((e,n)=>hC(e.label??`${n}`)).join("_")||Mg,g3=()=>{At.font.size=jP,At.font.family=sp,At.color=rp,At.borderColor=KP},m3=t=>t==="",dC="TOGGLE_DATA_VISIBILITY",gC="RESET_STATE",mC={datasets:[],annotation:[]},pC=(t,e)=>{var n;switch(e.type){case gC:return e.payload;case dC:{const{chartInstance:i,dsConfig:s,annotationConfig:o}=e.payload,{datasetIndex:l,datasets:c,dataset:u}=s,{annotationIndex:h}=o,d=Zn.cloneDeep(t),m=Zn.defaultTo(i==null?void 0:i.isDatasetVisible(l),!0);if(l>=0&&(i==null||i.setDatasetVisibility(l,!m),Zn.set(d,["datasets",l,"hidden"],m),u!=null&&u.displayGroup)){const _=u.displayGroup;c.forEach((v,M)=>{v.displayGroup===_&&(i==null||i.setDatasetVisibility(Number(M),!m),Zn.set(d,["datasets",M,"hidden"],m))})}if(h>=0){const _=Zn.findIndex(d.annotation,{annotationIndex:h});if(_>=0){const v=Zn.defaultTo((n=d.annotation[_])==null?void 0:n.display,!1);Zn.set(d,["annotation",_,"display"],!v)}}return d}default:return t}};var _C=(t=>(t.MOUSEDOWN="mousedown",t.MOUSEMOVE="mousemove",t.MOUSEUP="mouseup",t))(_C||{}),Kt=(t=>(t.POINT="point",t.BOX="box",t.LINE="line",t.ELLIPSE="ellipse",t))(Kt||{}),bC=(t=>(t.X="x",t.Y="y",t.Both="both",t))(bC||{});const xC=(t,e,n)=>{var i;e.canvas.style.cursor=ls.Pointer,(i=t.options.scaleID)!=null&&i.includes(yf.X)&&t.options.label&&(t.options.label.xAdjust=e.chartArea.left),t.options.borderWidth=kn.HOVERED,t.options.label&&(t.label.options.display=!0,t.options.label.enabled=!0),n!=null&&n.enableDrag&&(e.hoveredAnnotationId=t.options.id||null,e.update("none")),e.draw()},yC=(t,e,n)=>{t.options.borderWidth=kn.INITIAL,e.canvas.style.cursor=ls.Initial,e.hoveredAnnotationId=null,t.options.label&&(t.label.options.display=!1,t.options.label.enabled=!1),n!=null&&n.enableDrag&&(e.hoveredAnnotationId=null,e.update("none")),e.draw()},vC=(t,e,n)=>{n!=null&&n.enableDrag&&(e.hoveredAnnotationId=t.options.id||null,e.update("none"),t.options.borderWidth=kn.HOVERED,e.canvas.style.cursor=ls.Pointer),e.draw()},SC=(t,e,n)=>{n!=null&&n.enableDrag&&(e.hoveredAnnotationId=null,t.options.borderWidth=kn.INITIAL,e.canvas.style.cursor=ls.Initial,e.update("none")),e.draw()},wC=(t,e,n)=>{n!=null&&n.enableDrag&&(e.hoveredAnnotationId=t.options.id||null,e.update("none"),t.options.borderWidth=kn.POINT_HOVERED,e.canvas.style.cursor=ls.Pointer),e.draw()},MC=(t,e,n)=>{n!=null&&n.enableDrag&&(e.hoveredAnnotationId=null,t.options.borderWidth=kn.INITIAL,e.canvas.style.cursor=ls.Initial,e.update("none")),e.draw()},TC=t=>t==null?void 0:t.map((e,n)=>{var A,R,W,z,L,Y;const i=(e==null?void 0:e.annotationAxis)??void 0,s=(e==null?void 0:e.color)??ZP[n],o=(e==null?void 0:e.type)??Kt.LINE,l=e==null?void 0:e.adjustScaleRange,c={[Kt.LINE]:s,[Kt.POINT]:s,[Kt.BOX]:s,[Kt.ELLIPSE]:_a}[o]||_a,u={[Kt.LINE]:kn.INITIAL,[Kt.BOX]:kn.ZERO,[Kt.POINT]:kn.ZERO,[Kt.ELLIPSE]:(e==null?void 0:e.borderWidth)??0}[o]??0,h=o===Kt.LINE?qP:void 0,d={content:e==null?void 0:e.label,display:!0,font:{weight:"normal"}},m={[Kt.LINE]:{backgroundColor:s,content:e==null?void 0:e.label,display:!1,position:Mi.Top},[Kt.POINT]:{backgroundColor:((A=e==null?void 0:e.labelConfig)==null?void 0:A.backgroundColor)??_a,content:e==null?void 0:e.label,display:((R=e==null?void 0:e.labelConfig)==null?void 0:R.display)??!!(e!=null&&e.label),position:((W=e==null?void 0:e.labelConfig)==null?void 0:W.position)??Mi.Bottom,color:((z=e==null?void 0:e.labelConfig)==null?void 0:z.color)??rp,font:((L=e==null?void 0:e.labelConfig)==null?void 0:L.font)??`12px ${sp}`,borderWidth:kn.INITIAL,padding:5,borderRadius:3,borderColor:((Y=e==null?void 0:e.labelConfig)==null?void 0:Y.borderColor)??_a},[Kt.BOX]:d,[Kt.ELLIPSE]:d}[o]||d,_=({element:V},{chart:G})=>{switch(o){case Kt.LINE:xC(V,G,e);break;case Kt.BOX:vC(V,G,e);break;case Kt.POINT:wC(V,G,e);break}},v=({element:V},{chart:G})=>{switch(o){case Kt.LINE:yC(V,G,e);break;case Kt.BOX:SC(V,G,e);break;case Kt.POINT:MC(V,G,e);break}},M=()=>(V,G)=>e!=null&&e.onDragStart?e==null?void 0:e.onDragStart(V,G):void 0,T=()=>(V,G)=>e!=null&&e.onDrag?e==null?void 0:e.onDrag(V,G):void 0,k=()=>(V,G)=>e!=null&&e.onDragEnd?e==null?void 0:e.onDragEnd(V,G):void 0;return{...e,display:e==null?void 0:e.display,annotationIndex:n,id:`${e==null?void 0:e.label}-${e==null?void 0:e.value}-${n}`,scaleID:i,label:m,backgroundColor:s,borderColor:c,borderWidth:u,borderDash:h,type:o,adjustScaleRange:l,enter:_,leave:v,onDragStart:M,onDrag:T,onDragEnd:k,pointStyle:(e==null?void 0:e.pointStyle)??ap.Circle,resizable:(e==null?void 0:e.resizable)??!0,displayDragCoordinates:(e==null?void 0:e.displayDragCoordinates)??!0}}),PC=({showAnnotations:t,annotationsData:e})=>t&&e&&(e==null?void 0:e.length)?TC(e)??[]:[],CC=(t,e,n)=>{const i=ye.useRef(t);ye.useEffect(()=>{ov(t,i==null?void 0:i.current)||(e({type:"RESET_STATE",payload:t}),i.current=t)},[...n])},kC=ye.createContext(void 0),EC=({children:t,options:e,datasets:n})=>{const{showAnnotations:i=!0,annotationsData:s=[]}=(e==null?void 0:e.annotations)??{},o=(n==null?void 0:n.map((m,_)=>({[_]:{...m,hidden:!1}})))??[],l=PC({showAnnotations:i,annotationsData:s}),c={...mC,annotation:l,datasets:o},[u,h]=ye.useReducer(pC,c),d=ye.useMemo(()=>({state:u,dispatch:h}),[u,e,h]);return CC(c,h,[e]),rv.jsx(kC.Provider,{value:d,children:t})};EC.__docgenInfo={description:"",methods:[],displayName:"LegendProvider",props:{children:{required:!0,tsType:{name:"ReactNode"},description:""},options:{required:!0,tsType:{name:"union",raw:`| ILineChartOptions
65
+ */var vg;function zP(){return vg||(vg=1,function(t){(function(){var e={}.hasOwnProperty;function n(){for(var o="",l=0;l<arguments.length;l++){var c=arguments[l];c&&(o=s(o,i(c)))}return o}function i(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var l="";for(var c in o)e.call(o,c)&&o[c]&&(l=s(l,c));return l}function s(o,l){return l?o?o+" "+l:o+l:o}t.exports?(n.default=n,t.exports=n):window.classNames=n})()}(Ec)),Ec.exports}var HP=zP();const UP=Pg(HP),Sg=10,VP=t=>t==null?void 0:t.reduce((e,n,i)=>{if(i===0)return e;const s=Math.abs(n-(t==null?void 0:t[i-1]));return Math.max(s,e)},0),$P=(t,e,n)=>{const{axis:i,left:s,top:o,right:l,bottom:c}=n??{},u=i==="x",h=u?s:o,d=u?l:c,m=t>h,_=t<d,v=e.indexOf(t)!==-1;return m&&_&&!v},GP=(t,e)=>{var c;const n=t==null?void 0:t.sort((u,h)=>u-h),i=VP(t)/10,s=t[0],o=(t.length+1)*Sg;return(c=[...Array(o)].map((u,h)=>{const d=s+(h-Sg+1)*i;return parseFloat(d==null?void 0:d.toFixed(1))}))==null?void 0:c.filter(u=>$P(u,n,e))},YP=t=>{var c,u,h,d,m,_,v,M,T,k,A,R,W,z;const{chart:e,ctx:n}=t??{};if(!n||(n==null?void 0:n.canvas)===null)return;const i=e==null?void 0:e.config;if(!((d=(h=(u=(c=i==null?void 0:i.options)==null?void 0:c.scales)==null?void 0:u[t==null?void 0:t.id])==null?void 0:h.grid)!=null&&d.drawOnChartArea)||((m=i==null?void 0:i.options)==null?void 0:m.indexAxis)===(t==null?void 0:t.axis))return;const s=(t==null?void 0:t.axis)==="x",o=(v=(_=t==null?void 0:t.ticks)==null?void 0:_.map((L,Y)=>t==null?void 0:t.getPixelForTick(Y)))==null?void 0:v.sort((L,Y)=>L-Y),l=GP(o,t);(M=n==null?void 0:n.save)==null||M.call(n),n.strokeStyle=((W=(R=(A=(k=(T=i==null?void 0:i._config)==null?void 0:T.options)==null?void 0:k.scales)==null?void 0:A[t.id])==null?void 0:R.grid)==null?void 0:W.color)||"rgba(0,0,0,0.06)",n.lineWidth=.5,l==null||l.forEach(L=>{var Y,V,G,J,rt;if(n.beginPath(),s){const{top:et,bottom:at}=(e==null?void 0:e.chartArea)??{};(Y=n==null?void 0:n.moveTo)==null||Y.call(n,L,et),(V=n==null?void 0:n.lineTo)==null||V.call(n,L,at)}else{const{left:et,right:at}=(e==null?void 0:e.chartArea)??{};(G=n==null?void 0:n.moveTo)==null||G.call(n,et,L),(J=n==null?void 0:n.lineTo)==null||J.call(n,at,L)}(rt=n==null?void 0:n.stroke)==null||rt.call(n)}),(z=n==null?void 0:n.restore)==null||z.call(n)},XP={id:"minorGridlines",beforeDatasetsDraw:t=>{var n;const{scales:e}=t??{};(n=Object.keys(e))==null||n.forEach(i=>YP(e==null?void 0:e[i]))}},kn={ZERO:0,INITIAL:2,HOVERED:6,POINT_HOVERED:8},KP="rgba(0,0,0,0.1)",qP=[10,2],jP=12,sp='"Roobert", "Noto Sans", sans-serif',rp="hsl(60, 10.34482759%, 12.5%)",wg=12,ZC=8,JC=4,_a="transparent",QC=[1,10,100,1e3,1e4],ZP=["#3366cc","#dc3912","#ff9900","#109618","#990099","#0099c6","#dd4477","#66aa00","#b82e2e","#316395","#994499","#22aa99","#aaaa11","#6633cc","#e67300","#8b0707","#651067","#329262","#5574a6","#3b3eac"],t3="99",JP=16777215,e3="auto",n3={NO:0,FAST:1e3},Mg="new_chart",QP="htmlLegend",tC=9,i3=1/10**tC,s3=[{offset:0,color:"rgba(144,238,144,0.8)"},{offset:.6,color:"rgba(255,255,224,0.8)"},{offset:.8,color:"rgba(255,255,224,0.8)"},{offset:.92,color:"rgba(255,182,193,0.5)"},{offset:.99,color:"rgba(255,182,193,0.8)"}];var yf=(t=>(t.X="x",t.Y="y",t))(yf||{}),Mi=(t=>(t.Bottom="bottom",t.Top="top",t.Left="left",t.Right="right",t.TopRight="top-right",t.TopLeft="top-left",t.BottomLeft="bottom-left",t.BottomRight="bottom-right",t))(Mi||{}),eC=(t=>(t.Line="line",t.Bar="bar",t))(eC||{}),ls=(t=>(t.Pointer="pointer",t.Initial="initial",t.Grab="grab",t.Grabbing="grabbing",t.Crosshair="crosshair",t.Move="move",t))(ls||{}),nC=(t=>(t.Category="category",t.Linear="linear",t.Logarithmic="logarithmic",t))(nC||{}),op=(t=>(t.Vertical="vertical",t))(op||{}),iC=(t=>(t.Y="yLabel",t.X="xLabel",t))(iC||{}),sC=(t=>(t.End="end",t.Start="start",t.Center="center",t.Right="right",t.Left="left",t))(sC||{}),rC=(t=>(t.Box="box",t.Ellipse="ellipse",t.Line="line",t.Text="text",t))(rC||{}),ap=(t=>(t.Circle="circle",t.Square="rect",t.Diamond="rectRot",t.Triangle="triangle",t))(ap||{}),oC=(t=>(t.Nearest="nearest",t))(oC||{}),aC=(t=>(t.X="x",t.Y="y",t.XY="xy",t.Z="z",t))(aC||{}),lC=(t=>(t.Shift="Shift",t))(lC||{}),cC=(t=>(t.Mousemove="mousemove",t.Mouseout="mouseout",t.Click="click",t.Touchstart="touchstart",t.Touchmove="touchmove",t.Dblclick="dblclick",t))(cC||{});const fC={id:"chartAreaBorder",beforeDraw(t,e,n){var h,d,m,_;if(!(t!=null&&t.ctx)||!t.chartArea)return;const{ctx:i,chartArea:s}=t??{},{left:o,top:l,width:c,height:u}=s??{};(h=i==null?void 0:i.save)==null||h.call(i),i.strokeStyle=n==null?void 0:n.borderColor,i.lineWidth=n==null?void 0:n.borderWidth,(d=i==null?void 0:i.setLineDash)==null||d.call(i,(n==null?void 0:n.borderDash)||[]),i.lineDashOffset=(n==null?void 0:n.borderDashOffset)??0,(m=i==null?void 0:i.strokeRect)==null||m.call(i,o,l,c,u),(_=i==null?void 0:i.restore)==null||_.call(i)}},r3=(t,e)=>{var s;let n=[];t!=null&&t.showMinorGridlines&&n.push(XP);const i=e==null?void 0:e.customLegend;return i!=null&&i.customLegendPlugin&&(i!=null&&i.customLegendContainerID)&&n.push({id:QP,...(s=e==null?void 0:e.customLegend)==null?void 0:s.customLegendPlugin}),n.push(fC),n},uC=t=>{const e=`#${Math.floor(Math.random()*JP).toString(16)}`;return t.includes(e)?uC(t):(t.push(e),t)},o3=t=>t.title!==""?{display:!0,text:(t==null?void 0:t.title)??""}:{},a3=t=>t===op.Vertical,l3=(t,e)=>{const[n,i]=t===yf.Y?[Mi.Left,Mi.Right]:[Mi.Top,Mi.Bottom];return e%2===0?n:i},c3=(t,e)=>{const{width:n,height:i,staticChartHeight:s=!1,squareAspectRatio:o=0}=t,l=o?e==null?void 0:e.squareAspectRatio:"";let c="";return n||i?c="":c=s?e==null?void 0:e.fixedHeight:e==null?void 0:e.stretchHeight,UP(e==null?void 0:e.chart,c,l)},f3=(t,e)=>{const{legend:n}=t||{};return{position:(n==null?void 0:n.position)||Mi.Top,display:n==null?void 0:n.display,align:n==null?void 0:n.align,labels:{boxHeight:wg,boxWidth:n!=null&&n.usePointStyle?wg:void 0,usePointStyle:n==null?void 0:n.usePointStyle},onClick:e}},u3=t=>{var n,i;const{error:e=null}=((i=(n=t==null?void 0:t.dataset)==null?void 0:n.data)==null?void 0:i[t==null?void 0:t.dataIndex])??{};return e?`Error: ${Xm(e,4)}`:""},h3=(t,e)=>{var s,o,l;const n=(l=(o=(s=t==null?void 0:t.dataset)==null?void 0:s.data)==null?void 0:o[t==null?void 0:t.dataIndex])==null?void 0:l.label,i=Array.isArray(n)?n==null?void 0:n.join(" , "):n??"";return e&&(i!=null&&i.length)?` (${i})`:""},hC=t=>t.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"_").replace(/_+/g,"_").replace(/^_+|_+$/g,""),d3=t=>Zn.isEmpty(t)||Zn.isNil(t)?Mg:t.map((e,n)=>hC(e.label??`${n}`)).join("_")||Mg,g3=()=>{At.font.size=jP,At.font.family=sp,At.color=rp,At.borderColor=KP},m3=t=>t==="",dC="TOGGLE_DATA_VISIBILITY",gC="RESET_STATE",mC={datasets:[],annotation:[]},pC=(t,e)=>{var n;switch(e.type){case gC:return e.payload;case dC:{const{chartInstance:i,dsConfig:s,annotationConfig:o}=e.payload,{datasetIndex:l,datasets:c,dataset:u}=s,{annotationIndex:h}=o,d=Zn.cloneDeep(t),m=Zn.defaultTo(i==null?void 0:i.isDatasetVisible(l),!0);if(l>=0&&(i==null||i.setDatasetVisibility(l,!m),Zn.set(d,["datasets",l,"hidden"],m),u!=null&&u.displayGroup)){const _=u.displayGroup;c.forEach((v,M)=>{v.displayGroup===_&&(i==null||i.setDatasetVisibility(Number(M),!m),Zn.set(d,["datasets",M,"hidden"],m))})}if(h>=0){const _=Zn.findIndex(d.annotation,{annotationIndex:h});if(_>=0){const v=Zn.defaultTo((n=d.annotation[_])==null?void 0:n.display,!1);Zn.set(d,["annotation",_,"display"],!v)}}return d}default:return t}};var _C=(t=>(t.MOUSEDOWN="mousedown",t.MOUSEMOVE="mousemove",t.MOUSEUP="mouseup",t))(_C||{}),Kt=(t=>(t.POINT="point",t.BOX="box",t.LINE="line",t.ELLIPSE="ellipse",t))(Kt||{}),bC=(t=>(t.X="x",t.Y="y",t.Both="both",t))(bC||{});const xC=(t,e,n)=>{var i;e.canvas.style.cursor=ls.Pointer,(i=t.options.scaleID)!=null&&i.includes(yf.X)&&t.options.label&&(t.options.label.xAdjust=e.chartArea.left),t.options.borderWidth=kn.HOVERED,t.options.label&&(t.label.options.display=!0,t.options.label.enabled=!0),n!=null&&n.enableDrag&&(e.hoveredAnnotationId=t.options.id||null,e.update("none")),e.draw()},yC=(t,e,n)=>{t.options.borderWidth=kn.INITIAL,e.canvas.style.cursor=ls.Initial,e.hoveredAnnotationId=null,t.options.label&&(t.label.options.display=!1,t.options.label.enabled=!1),n!=null&&n.enableDrag&&(e.hoveredAnnotationId=null,e.update("none")),e.draw()},vC=(t,e,n)=>{n!=null&&n.enableDrag&&(e.hoveredAnnotationId=t.options.id||null,e.update("none"),t.options.borderWidth=kn.HOVERED,e.canvas.style.cursor=ls.Pointer),e.draw()},SC=(t,e,n)=>{n!=null&&n.enableDrag&&(e.hoveredAnnotationId=null,t.options.borderWidth=kn.INITIAL,e.canvas.style.cursor=ls.Initial,e.update("none")),e.draw()},wC=(t,e,n)=>{n!=null&&n.enableDrag&&(e.hoveredAnnotationId=t.options.id||null,e.update("none"),t.options.borderWidth=kn.POINT_HOVERED,e.canvas.style.cursor=ls.Pointer),e.draw()},MC=(t,e,n)=>{n!=null&&n.enableDrag&&(e.hoveredAnnotationId=null,t.options.borderWidth=kn.INITIAL,e.canvas.style.cursor=ls.Initial,e.update("none")),e.draw()},TC=t=>t==null?void 0:t.map((e,n)=>{var A,R,W,z,L,Y;const i=(e==null?void 0:e.annotationAxis)??void 0,s=(e==null?void 0:e.color)??ZP[n],o=(e==null?void 0:e.type)??Kt.LINE,l=e==null?void 0:e.adjustScaleRange,c={[Kt.LINE]:s,[Kt.POINT]:s,[Kt.BOX]:s,[Kt.ELLIPSE]:_a}[o]||_a,u={[Kt.LINE]:kn.INITIAL,[Kt.BOX]:kn.ZERO,[Kt.POINT]:kn.ZERO,[Kt.ELLIPSE]:(e==null?void 0:e.borderWidth)??0}[o]??0,h=o===Kt.LINE?qP:void 0,d={content:e==null?void 0:e.label,display:!0,font:{weight:"normal"}},m={[Kt.LINE]:{backgroundColor:s,content:e==null?void 0:e.label,display:!1,position:Mi.Top},[Kt.POINT]:{backgroundColor:((A=e==null?void 0:e.labelConfig)==null?void 0:A.backgroundColor)??_a,content:e==null?void 0:e.label,display:((R=e==null?void 0:e.labelConfig)==null?void 0:R.display)??!!(e!=null&&e.label),position:((W=e==null?void 0:e.labelConfig)==null?void 0:W.position)??Mi.Bottom,color:((z=e==null?void 0:e.labelConfig)==null?void 0:z.color)??rp,font:((L=e==null?void 0:e.labelConfig)==null?void 0:L.font)??`12px ${sp}`,borderWidth:kn.INITIAL,padding:5,borderRadius:3,borderColor:((Y=e==null?void 0:e.labelConfig)==null?void 0:Y.borderColor)??_a},[Kt.BOX]:d,[Kt.ELLIPSE]:d}[o]||d,_=({element:V},{chart:G})=>{switch(o){case Kt.LINE:xC(V,G,e);break;case Kt.BOX:vC(V,G,e);break;case Kt.POINT:wC(V,G,e);break}},v=({element:V},{chart:G})=>{switch(o){case Kt.LINE:yC(V,G,e);break;case Kt.BOX:SC(V,G,e);break;case Kt.POINT:MC(V,G,e);break}},M=()=>(V,G)=>e!=null&&e.onDragStart?e==null?void 0:e.onDragStart(V,G):void 0,T=()=>(V,G)=>e!=null&&e.onDrag?e==null?void 0:e.onDrag(V,G):void 0,k=()=>(V,G)=>e!=null&&e.onDragEnd?e==null?void 0:e.onDragEnd(V,G):void 0;return{...e,display:e==null?void 0:e.display,annotationIndex:n,id:`${e==null?void 0:e.label}-${e==null?void 0:e.value}-${n}`,scaleID:i,label:m,backgroundColor:s,borderColor:c,borderWidth:u,borderDash:h,type:o,adjustScaleRange:l,enter:_,leave:v,onDragStart:M,onDrag:T,onDragEnd:k,pointStyle:(e==null?void 0:e.pointStyle)??ap.Circle,resizable:(e==null?void 0:e.resizable)??!0,displayDragCoordinates:(e==null?void 0:e.displayDragCoordinates)??!0}}),PC=({showAnnotations:t,annotationsData:e})=>t&&e&&(e==null?void 0:e.length)?TC(e)??[]:[],CC=(t,e,n)=>{const i=ye.useRef(t);ye.useEffect(()=>{ov(t,i==null?void 0:i.current)||(e({type:"RESET_STATE",payload:t}),i.current=t)},[...n])},kC=ye.createContext(void 0),EC=({children:t,options:e,datasets:n})=>{const{showAnnotations:i=!0,annotationsData:s=[]}=(e==null?void 0:e.annotations)??{},o=(n==null?void 0:n.map((m,_)=>({[_]:{...m,hidden:!1}})))??[],l=PC({showAnnotations:i,annotationsData:s}),c={...mC,annotation:l,datasets:o},[u,h]=ye.useReducer(pC,c),d=ye.useMemo(()=>({state:u,dispatch:h}),[u,e,h]);return CC(c,h,[s]),rv.jsx(kC.Provider,{value:d,children:t})};EC.__docgenInfo={description:"",methods:[],displayName:"LegendProvider",props:{children:{required:!0,tsType:{name:"ReactNode"},description:""},options:{required:!0,tsType:{name:"union",raw:`| ILineChartOptions
66
66
  | IBarOptions
67
67
  | IPieOptions
68
68
  | IScatterOptions`,elements:[{name:"ILineChartOptions"},{name:"IBarOptions"},{name:"IPieOptions"},{name:"IScatterOptions"}]},description:""},datasets:{required:!1,tsType:{name:"Array",elements:[{name:"ICommonDataset"}],raw:"ICommonDataset[]"},description:""}}};export{rp as $,sC as A,yf as B,ZP as C,sp as D,jP as E,QC as F,e3 as G,Xm as H,u3 as I,oC as J,h3 as K,wg as L,iC as M,KP as N,o3 as O,Mi as P,c3 as Q,zC as R,nC as S,JC as T,r3 as U,wa as V,Qi as W,Ma as X,s3 as Y,UC as Z,d3 as _,ZC as a,lC as a0,aC as a1,m3 as a2,kn as a3,qP as a4,lP as a5,i3 as a6,tC as a7,ap as a8,cC as a9,Lh as aA,Ft as aB,Hv as aC,Ws as aD,ue as aE,Dg as aF,At as aG,In as aH,XC as aI,nP as aJ,jC as aK,$s as aL,qC as aM,Ha as aN,GC as aO,kC as aP,dC as aQ,f3 as aR,QP as aS,rC as aT,Kt as aa,ls as ab,bC as ac,_C as ad,WC as ae,bt as af,qt as ag,_n as ah,ti as ai,Ac as aj,Vr as ak,Ye as al,Ut as am,La as an,Na as ao,Ci as ap,Bv as aq,ka as ar,Bs as as,Ir as at,tm as au,ft as av,Jt as aw,ot as ax,Yi as ay,ee as az,EC as b,UP as c,KC as d,HC as e,n3 as f,uC as g,df as h,Ud as i,zd as j,Gd as k,Or as l,FC as m,BC as n,LC as o,NC as p,VC as q,YC as r,g3 as s,$C as t,ip as u,Zn as v,eC as w,t3 as x,l3 as y,a3 as z};
@@ -1,4 +1,4 @@
1
- import{j as F}from"./jsx-runtime-W3oueGCa.js";import{r as G,g as ct}from"./index-YTOF1_EJ.js";import{$ as dt,a0 as bn,a1 as we,B as fe,a2 as gt,v as Y,A as ie,P as Ce,C as _e,a3 as an,a4 as ht,g as Ke,y as pt,S as mt,E as bt,F as yt,a5 as Se,a6 as Pe,H as Ee,a7 as Ne,G as Je,I as wt,T as _t,L as yn,a as Et,J as Be,K as Tt,M as be,d as Lt,r as vt,N as wn,a8 as At,f as xt,a9 as Ct,U as St,aa as le,ab as fn,ac as xe,D as Pt,ad as ye,b as It,s as Ot,Q as Nt,ae as Mt,h as Dt,i as Bt,V as jt,W as Ft,j as kt,k as Ut,p as Rt,m as Gt,n as Yt,o as zt,q as Vt,t as Xt}from"./legend-context-DfYCGzMd.js";import{r as He,M as cn,k as je,B as ce,s as Ht,v as qt,w as _n,x as Wt,y as $t,z as Zt,A as Kt,E as Jt,N as En,G as Qt,S as er,g as nr,e as tr,F as rr,T as Un,J as or,K as sr,D as ir,O as lr,Q as ur,o as ar,q as fr,U as cr,j as dr,u as gr,Z as hr,t as pr,R as mr,l as br,H as yr,L as wr,m as _r,n as Er}from"./legend-DZ_Z2EdR.js";import{c as Tr,C as Lr,f as Tn,a as vr,b as Ar}from"./get-draggableData-DgfOKxYA.js";import{e as xr}from"./index-CgYGpm1H.js";const Cr=(e,n,t)=>{const[o,r]=e.major,[d,c]=e.minor,p=(o.x+r.x+d.x+c.x)/4,w=(o.y+r.y+d.y+c.y)/4,C=r.x-o.x,E=r.y-o.y,P=Math.atan2(t.getPixelForValue(w+E/2)-t.getPixelForValue(w-E/2),n.getPixelForValue(p+C/2)-n.getPixelForValue(p-C/2)),M=Math.hypot(n.getPixelForValue(o.x)-n.getPixelForValue(r.x),t.getPixelForValue(o.y)-t.getPixelForValue(r.y))/2,N=Math.hypot(n.getPixelForValue(d.x)-n.getPixelForValue(c.x),t.getPixelForValue(d.y)-t.getPixelForValue(c.y))/2,v=n.getPixelForValue(p),x=t.getPixelForValue(w);return{cx:v,cy:x,radiusX:M,radiusY:N,angle:P}},Sr=e=>e.data.datasets.some(n=>n.data.some(t=>!!t.ellipsePoints)),Pr={id:"ellipsisAnnotationPlugin",afterDatasetsDraw(e){var d,c,p,w,C,E,P,M,N;if(!Sr(e))return;const n=e==null?void 0:e.ctx,t=(d=e==null?void 0:e.scales)==null?void 0:d.x,o=(c=e==null?void 0:e.scales)==null?void 0:c.y,r=e==null?void 0:e.chartArea;!t||!o||!r||((p=n==null?void 0:n.save)==null||p.call(n),(w=n==null?void 0:n.beginPath)==null||w.call(n),(C=n==null?void 0:n.rect)==null||C.call(n,r.left,r.top,r.right-r.left,r.bottom-r.top),(E=n==null?void 0:n.clip)==null||E.call(n),(M=(P=e==null?void 0:e.data)==null?void 0:P.datasets)==null||M.forEach(v=>{var h;const x=v;(h=x==null?void 0:x.data)==null||h.forEach(A=>{var l,u,i,_,T;const{ellipsePoints:b}=A??{};if(!b)return;const{cx:L,cy:y,radiusX:S,radiusY:f,angle:g}=Cr(b,t,o);(l=n==null?void 0:n.save)==null||l.call(n),(u=n==null?void 0:n.beginPath)==null||u.call(n),(i=n==null?void 0:n.ellipse)==null||i.call(n,L,y,S,f,g,0,2*Math.PI),n.strokeStyle=x.borderColor||dt,n.lineWidth=x.borderWidth||1,(_=n==null?void 0:n.stroke)==null||_.call(n),(T=n==null?void 0:n.restore)==null||T.call(n)})}),(N=n==null?void 0:n.restore)==null||N.call(n))}},Ir="_chart_e3qdd_1",Or="_canvas_e3qdd_11",Nr="_fixedHeight_e3qdd_20",Mr="_stretchHeight_e3qdd_26",Dr="_squareAspectRatio_e3qdd_32",Br="_table_e3qdd_62",qe={chart:Ir,canvas:Or,fixedHeight:Nr,stretchHeight:Mr,squareAspectRatio:Dr,table:Br};var Rn=Symbol.for("immer-nothing"),Ln=Symbol.for("immer-draftable"),ne=Symbol.for("immer-state");function oe(e,...n){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Te=Object.getPrototypeOf;function Le(e){return!!e&&!!e[ne]}function he(e){var n;return e?Gn(e)||Array.isArray(e)||!!e[Ln]||!!((n=e.constructor)!=null&&n[Ln])||ze(e)||Ve(e):!1}var jr=Object.prototype.constructor.toString();function Gn(e){if(!e||typeof e!="object")return!1;const n=Te(e);if(n===null)return!0;const t=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return t===Object?!0:typeof t=="function"&&Function.toString.call(t)===jr}function Fe(e,n){Ye(e)===0?Reflect.ownKeys(e).forEach(t=>{n(t,e[t],e)}):e.forEach((t,o)=>n(o,t,e))}function Ye(e){const n=e[ne];return n?n.type_:Array.isArray(e)?1:ze(e)?2:Ve(e)?3:0}function Qe(e,n){return Ye(e)===2?e.has(n):Object.prototype.hasOwnProperty.call(e,n)}function Yn(e,n,t){const o=Ye(e);o===2?e.set(n,t):o===3?e.add(t):e[n]=t}function Fr(e,n){return e===n?e!==0||1/e===1/n:e!==e&&n!==n}function ze(e){return e instanceof Map}function Ve(e){return e instanceof Set}function ge(e){return e.copy_||e.base_}function en(e,n){if(ze(e))return new Map(e);if(Ve(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const t=Gn(e);if(n===!0||n==="class_only"&&!t){const o=Object.getOwnPropertyDescriptors(e);delete o[ne];let r=Reflect.ownKeys(o);for(let d=0;d<r.length;d++){const c=r[d],p=o[c];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(o[c]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[c]})}return Object.create(Te(e),o)}else{const o=Te(e);if(o!==null&&t)return{...e};const r=Object.create(o);return Object.assign(r,e)}}function dn(e,n=!1){return Xe(e)||Le(e)||!he(e)||(Ye(e)>1&&(e.set=e.add=e.clear=e.delete=kr),Object.freeze(e),n&&Object.entries(e).forEach(([t,o])=>dn(o,!0))),e}function kr(){oe(2)}function Xe(e){return Object.isFrozen(e)}var Ur={};function pe(e){const n=Ur[e];return n||oe(0,e),n}var Ie;function zn(){return Ie}function Rr(e,n){return{drafts_:[],parent_:e,immer_:n,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function vn(e,n){n&&(pe("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=n)}function nn(e){tn(e),e.drafts_.forEach(Gr),e.drafts_=null}function tn(e){e===Ie&&(Ie=e.parent_)}function An(e){return Ie=Rr(Ie,e)}function Gr(e){const n=e[ne];n.type_===0||n.type_===1?n.revoke_():n.revoked_=!0}function xn(e,n){n.unfinalizedDrafts_=n.drafts_.length;const t=n.drafts_[0];return e!==void 0&&e!==t?(t[ne].modified_&&(nn(n),oe(4)),he(e)&&(e=ke(n,e),n.parent_||Ue(n,e)),n.patches_&&pe("Patches").generateReplacementPatches_(t[ne].base_,e,n.patches_,n.inversePatches_)):e=ke(n,t,[]),nn(n),n.patches_&&n.patchListener_(n.patches_,n.inversePatches_),e!==Rn?e:void 0}function ke(e,n,t){if(Xe(n))return n;const o=n[ne];if(!o)return Fe(n,(r,d)=>Cn(e,o,n,r,d,t)),n;if(o.scope_!==e)return n;if(!o.modified_)return Ue(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const r=o.copy_;let d=r,c=!1;o.type_===3&&(d=new Set(r),r.clear(),c=!0),Fe(d,(p,w)=>Cn(e,o,r,p,w,t,c)),Ue(e,r,!1),t&&e.patches_&&pe("Patches").generatePatches_(o,t,e.patches_,e.inversePatches_)}return o.copy_}function Cn(e,n,t,o,r,d,c){if(Le(r)){const p=d&&n&&n.type_!==3&&!Qe(n.assigned_,o)?d.concat(o):void 0,w=ke(e,r,p);if(Yn(t,o,w),Le(w))e.canAutoFreeze_=!1;else return}else c&&t.add(r);if(he(r)&&!Xe(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ke(e,r),(!n||!n.scope_.parent_)&&typeof o!="symbol"&&Object.prototype.propertyIsEnumerable.call(t,o)&&Ue(e,r)}}function Ue(e,n,t=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&dn(n,t)}function Yr(e,n){const t=Array.isArray(e),o={type_:t?1:0,scope_:n?n.scope_:zn(),modified_:!1,finalized_:!1,assigned_:{},parent_:n,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=o,d=gn;t&&(r=[o],d=Oe);const{revoke:c,proxy:p}=Proxy.revocable(r,d);return o.draft_=p,o.revoke_=c,p}var gn={get(e,n){if(n===ne)return e;const t=ge(e);if(!Qe(t,n))return zr(e,t,n);const o=t[n];return e.finalized_||!he(o)?o:o===We(e.base_,n)?($e(e),e.copy_[n]=on(o,e)):o},has(e,n){return n in ge(e)},ownKeys(e){return Reflect.ownKeys(ge(e))},set(e,n,t){const o=Vn(ge(e),n);if(o!=null&&o.set)return o.set.call(e.draft_,t),!0;if(!e.modified_){const r=We(ge(e),n),d=r==null?void 0:r[ne];if(d&&d.base_===t)return e.copy_[n]=t,e.assigned_[n]=!1,!0;if(Fr(t,r)&&(t!==void 0||Qe(e.base_,n)))return!0;$e(e),rn(e)}return e.copy_[n]===t&&(t!==void 0||n in e.copy_)||Number.isNaN(t)&&Number.isNaN(e.copy_[n])||(e.copy_[n]=t,e.assigned_[n]=!0),!0},deleteProperty(e,n){return We(e.base_,n)!==void 0||n in e.base_?(e.assigned_[n]=!1,$e(e),rn(e)):delete e.assigned_[n],e.copy_&&delete e.copy_[n],!0},getOwnPropertyDescriptor(e,n){const t=ge(e),o=Reflect.getOwnPropertyDescriptor(t,n);return o&&{writable:!0,configurable:e.type_!==1||n!=="length",enumerable:o.enumerable,value:t[n]}},defineProperty(){oe(11)},getPrototypeOf(e){return Te(e.base_)},setPrototypeOf(){oe(12)}},Oe={};Fe(gn,(e,n)=>{Oe[e]=function(){return arguments[0]=arguments[0][0],n.apply(this,arguments)}});Oe.deleteProperty=function(e,n){return Oe.set.call(this,e,n,void 0)};Oe.set=function(e,n,t){return gn.set.call(this,e[0],n,t,e[0])};function We(e,n){const t=e[ne];return(t?ge(t):e)[n]}function zr(e,n,t){var r;const o=Vn(n,t);return o?"value"in o?o.value:(r=o.get)==null?void 0:r.call(e.draft_):void 0}function Vn(e,n){if(!(n in e))return;let t=Te(e);for(;t;){const o=Object.getOwnPropertyDescriptor(t,n);if(o)return o;t=Te(t)}}function rn(e){e.modified_||(e.modified_=!0,e.parent_&&rn(e.parent_))}function $e(e){e.copy_||(e.copy_=en(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Vr=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(n,t,o)=>{if(typeof n=="function"&&typeof t!="function"){const d=t;t=n;const c=this;return function(w=d,...C){return c.produce(w,E=>t.call(this,E,...C))}}typeof t!="function"&&oe(6),o!==void 0&&typeof o!="function"&&oe(7);let r;if(he(n)){const d=An(this),c=on(n,void 0);let p=!0;try{r=t(c),p=!1}finally{p?nn(d):tn(d)}return vn(d,o),xn(r,d)}else if(!n||typeof n!="object"){if(r=t(n),r===void 0&&(r=n),r===Rn&&(r=void 0),this.autoFreeze_&&dn(r,!0),o){const d=[],c=[];pe("Patches").generateReplacementPatches_(n,r,d,c),o(d,c)}return r}else oe(1,n)},this.produceWithPatches=(n,t)=>{if(typeof n=="function")return(c,...p)=>this.produceWithPatches(c,w=>n(w,...p));let o,r;return[this.produce(n,t,(c,p)=>{o=c,r=p}),o,r]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){he(e)||oe(8),Le(e)&&(e=Xr(e));const n=An(this),t=on(e,void 0);return t[ne].isManual_=!0,tn(n),t}finishDraft(e,n){const t=e&&e[ne];(!t||!t.isManual_)&&oe(9);const{scope_:o}=t;return vn(o,n),xn(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,n){let t;for(t=n.length-1;t>=0;t--){const r=n[t];if(r.path.length===0&&r.op==="replace"){e=r.value;break}}t>-1&&(n=n.slice(t+1));const o=pe("Patches").applyPatches_;return Le(e)?o(e,n):this.produce(e,r=>o(r,n))}};function on(e,n){const t=ze(e)?pe("MapSet").proxyMap_(e,n):Ve(e)?pe("MapSet").proxySet_(e,n):Yr(e,n);return(n?n.scope_:zn()).drafts_.push(t),t}function Xr(e){return Le(e)||oe(10,e),Xn(e)}function Xn(e){if(!he(e)||Xe(e))return e;const n=e[ne];let t;if(n){if(!n.modified_)return n.base_;n.finalized_=!0,t=en(e,n.scope_.immer_.useStrictShallowCopy_)}else t=en(e,!0);return Fe(t,(o,r)=>{Yn(t,o,Xn(r))}),n&&(n.finalized_=!1),t}var te=new Vr,Hr=te.produce;te.produceWithPatches.bind(te);te.setAutoFreeze.bind(te);te.setUseStrictShallowCopy.bind(te);te.applyPatches.bind(te);te.createDraft.bind(te);te.finishDraft.bind(te);const Hn="TOGGLE_ZOOM",qn="TOGGLE_PAN",Wn="TOGGLE_POINTS",$n="TOGGLE_LINE",Zn="TOGGLE_LEGEND",Kn="TOGGLE_TABLE",sn="RESET_AXES_RANGES",ln="UPDATE_AXES_RANGES",Jn="TOGGLE_DRAG_POINTS",Qn="TOGGLE_DRAG_ANNOTATION",et="DISABLE_DRAG_OPTIONS",De="UPDATE_EDITED",qr=(e,n)=>Hr(e,t=>{switch(n.type){case Hn:{t.zoomEnabled=!t.zoomEnabled,t.panEnabled&&(t.panEnabled=!1),t.enableDragPoints&&(t.enableDragPoints=!1),t.enableDragAnnotation&&(t.enableDragAnnotation=!1);break}case qn:{t.panEnabled=!t.panEnabled,t.zoomEnabled&&(t.zoomEnabled=!1),t.enableDragPoints&&(t.enableDragPoints=!1),t.enableDragAnnotation&&(t.enableDragAnnotation=!1);break}case Wn:{t.pointsEnabled=!t.pointsEnabled;break}case $n:{t.lineEnabled=!t.lineEnabled;break}case Zn:{t.legendEnabled=!t.legendEnabled;break}case Kn:{t.showTable=!t.showTable;break}case ln:{const{axes:o}=n.payload;t.axes=o;break}case sn:{const{axes:o}=n.payload;t.axes=o;break}case Jn:{t.enableDragPoints=!t.enableDragPoints,t.panEnabled&&(t.panEnabled=!1),t.zoomEnabled&&(t.zoomEnabled=!1),t.enableDragAnnotation&&(t.enableDragAnnotation=!1);break}case Qn:{t.enableDragAnnotation=!t.enableDragAnnotation,t.panEnabled&&(t.panEnabled=!1),t.zoomEnabled&&(t.zoomEnabled=!1);break}case et:{(t.enableDragAnnotation||t.enableDragPoints||t.panEnabled||t.zoomEnabled)&&(t.enableDragAnnotation=!1,t.enableDragPoints=!1,t.panEnabled=!1,t.zoomEnabled=!1);break}case De:{t.edited=n.payload;break}}}),Wr=e=>{if(!e)return null;const n=`line-chart-state-${e}`,t=localStorage.getItem(n);return t?JSON.parse(t).state:null},$r=(e=72)=>{const n=new Date().getTime(),t=e*60*60*1e3;for(let o=0;o<localStorage.length;o++){const r=localStorage.key(o);if(r!=null&&r.includes("line-chart-state-")){const d=localStorage.getItem(r);if(d){const p=JSON.parse(d).timestamp;p&&n-p>t&&localStorage.removeItem(r)}}}},Zr=(e,n)=>{if(!n)return;const t=new Date().getTime(),o=`line-chart-state-${n}`,r={state:e,timestamp:t};localStorage.setItem(o,JSON.stringify(r)),$r()},Kr=({options:e,persistenceId:n})=>{const{chartOptions:{enableZoom:t,enablePan:o,showPoints:r,showLine:d,enableDragAnnotation:c},legend:{display:p},dragData:w}=e,{zoomEnabled:C,panEnabled:E,pointsEnabled:P,lineEnabled:M,legendEnabled:N,enableDragPoints:v,enableDragAnnotation:x}=Wr(n)||{};return{zoomEnabled:c??x?!1:C??t,panEnabled:E??o,pointsEnabled:P??r,lineEnabled:M??d,legendEnabled:N??p,axes:[],showTable:!1,enableDragPoints:(w==null?void 0:w.enableDragData)&&v,enableDragAnnotation:c??x,edited:!1}},Jr=e=>G.createElement("svg",{fill:"currentColor",height:"1em",viewBox:"0 0 12 12",width:"1em",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",...e},G.createElement("clipPath",{id:"a"},G.createElement("path",{d:"m0 0h12v12h-12z"})),G.createElement("g",{clipPath:"url(#a)"},G.createElement("path",{d:"m.5 6.5v-1h11v1c-4.16104 0-6.63549 0-11 0z"}))),Qr=e=>G.createElement("svg",{fill:"currentColor",height:"1em",viewBox:"0 0 12 12",width:"1em",xmlns:"http://www.w3.org/2000/svg",...e},G.createElement("circle",{cx:6,cy:6,r:2})),eo=e=>G.createElement("svg",{fill:"currentColor",height:"1em",viewBox:"0 0 12 12",width:"1em",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",...e},G.createElement("clipPath",{id:"a"},G.createElement("path",{d:"m0 0h12v12h-12z"})),G.createElement("g",{clipPath:"url(#a)"},G.createElement("path",{d:"m7.937 6.5c-.11122.42912-.36179.80916-.71237 1.08047-.35058.2713-.78133.4185-1.22463.4185s-.87405-.1472-1.22463-.4185c-.35058-.27131-.60115-.65135-.71237-1.08047h-3.563v-1h3.563c.11122-.42912.36179-.80916.71237-1.08046s.78133-.41851 1.22463-.41851.87405.14721 1.22463.41851.60115.65134.71237 1.08046h3.563v1z"})));function no({lineEnabled:e,onToggleLine:n,onTogglePoints:t,pointsEnabled:o,translations:r}){return[{type:"Option",label:r.pointsLines,icon:F.jsx(He,{icon:F.jsx(eo,{})}),selected:o&&e,onClick:()=>{o||t(),e||n()}},{type:"Option",label:r.linesOnly,icon:F.jsx(He,{icon:F.jsx(Jr,{})}),selected:!o&&e,onClick:()=>{o&&t(),e||n()}},{type:"Option",label:r.pointsOnly,icon:F.jsx(He,{icon:F.jsx(Qr,{})}),selected:o&&!e,onClick:()=>{o||t(),e&&n()}}]}const nt=({options:e})=>{const[n,t]=G.useState(!1),o=e.find(r=>r.selected);return F.jsx(cn,{open:n,setOpen:t,menu:{sections:e,trigger:"Component",component:F.jsx(je,{display:"inline-flex",text:o==null?void 0:o.label,placement:"bottom-start",enabled:!n,children:F.jsx(ce,{colored:"muted",basic:!0,small:!0,round:!0,icon:o==null?void 0:o.icon})})}})};nt.__docgenInfo={description:"",methods:[],displayName:"LineOptions",props:{options:{required:!0,tsType:{name:"Array",elements:[{name:"IMenuSection"}],raw:"IMenuSection[]"},description:""}}};function to({onTogglePan:e,onToggleZoom:n,panEnabled:t,zoomEnabled:o,enableDragPoints:r,enableDragAnnotation:d,isDragDataAllowed:c,isDragAnnotationAllowed:p,onToggleDragAnnotation:w,onToggleDragPoints:C,onDisableDragOptions:E,translations:{dragToZoom:P,doubleClickToReset:M,dragToPan:N,dragToMovePoints:v,dragDisabled:x,dragToMoveAnnotation:h}}){return[{label:P,description:M,icon:F.jsx(Ht,{}),selected:o,type:"Option",onClick:()=>{o||n()}},{label:N,description:M,icon:F.jsx(qt,{}),selected:t,type:"Option",onClick:()=>{t||e()}},...c?[{label:v,icon:F.jsx(_n,{}),selected:r,type:"Option",onClick:()=>{r||C()}}]:[],...p?[{label:h,icon:F.jsx(_n,{}),selected:d,type:"Option",onClick:()=>{d||w()}}]:[],{label:x,icon:F.jsx(Wt,{}),selected:!o&&!t&&!r&&!d,type:"Option",onClick:E}]}const tt=({options:e})=>{const n=e.find(t=>t.selected);return F.jsx(cn,{menu:{sections:e,trigger:"Component",component:F.jsx(ce,{colored:"muted",basic:!0,small:!0,label:n==null?void 0:n.label,icon:n==null?void 0:n.icon})}})};tt.__docgenInfo={description:"@param {import('./drag-options-interfaces').IDragOptions} obj",methods:[],displayName:"DragOptions",props:{options:{required:!0,tsType:{name:"Array",elements:[{name:"IMenuSection"}],raw:"IMenuSection[]"},description:""}}};const ro="_controls_1edjs_1",oo="_buttons_1edjs_6",Sn={controls:ro,buttons:oo},so=e=>{const n=G.useCallback(t=>()=>{e({type:t})},[e]);return{onToggleLegend:n(Zn),onToggleLine:n($n),onTogglePan:n(qn),onTogglePoints:n(Wn),onToggleTable:n(Kn),onToggleZoom:n(Hn),onToggleDragPoints:n(Jn),onToggleDragAnnotation:n(Qn),onDisableDragOptions:n(et)}};function Me(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ze={exports:{}},Pn;function io(){return Pn||(Pn=1,function(e,n){(function(t){e.exports=t()})(function(){return function t(o,r,d){function c(C,E){if(!r[C]){if(!o[C]){var P=typeof Me=="function"&&Me;if(!E&&P)return P(C,!0);if(p)return p(C,!0);throw new Error("Cannot find module '"+C+"'")}E=r[C]={exports:{}},o[C][0].call(E.exports,function(M){var N=o[C][1][M];return c(N||M)},E,E.exports,t,o,r,d)}return r[C].exports}for(var p=typeof Me=="function"&&Me,w=0;w<d.length;w++)c(d[w]);return c}({1:[function(t,o,r){(function(d,c,p,w,C,E,P,M,N){var v=t("crypto");function x(f,g){g=b(f,g);var l;return(l=g.algorithm!=="passthrough"?v.createHash(g.algorithm):new S).write===void 0&&(l.write=l.update,l.end=l.update),y(g,l).dispatch(f),l.update||l.end(""),l.digest?l.digest(g.encoding==="buffer"?void 0:g.encoding):(f=l.read(),g.encoding!=="buffer"?f.toString(g.encoding):f)}(r=o.exports=x).sha1=function(f){return x(f)},r.keys=function(f){return x(f,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},r.MD5=function(f){return x(f,{algorithm:"md5",encoding:"hex"})},r.keysMD5=function(f){return x(f,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var h=v.getHashes?v.getHashes().slice():["sha1","md5"],A=(h.push("passthrough"),["buffer","hex","binary","base64"]);function b(f,g){var l={};if(l.algorithm=(g=g||{}).algorithm||"sha1",l.encoding=g.encoding||"hex",l.excludeValues=!!g.excludeValues,l.algorithm=l.algorithm.toLowerCase(),l.encoding=l.encoding.toLowerCase(),l.ignoreUnknown=g.ignoreUnknown===!0,l.respectType=g.respectType!==!1,l.respectFunctionNames=g.respectFunctionNames!==!1,l.respectFunctionProperties=g.respectFunctionProperties!==!1,l.unorderedArrays=g.unorderedArrays===!0,l.unorderedSets=g.unorderedSets!==!1,l.unorderedObjects=g.unorderedObjects!==!1,l.replacer=g.replacer||void 0,l.excludeKeys=g.excludeKeys||void 0,f===void 0)throw new Error("Object argument required.");for(var u=0;u<h.length;++u)h[u].toLowerCase()===l.algorithm.toLowerCase()&&(l.algorithm=h[u]);if(h.indexOf(l.algorithm)===-1)throw new Error('Algorithm "'+l.algorithm+'" not supported. supported values: '+h.join(", "));if(A.indexOf(l.encoding)===-1&&l.algorithm!=="passthrough")throw new Error('Encoding "'+l.encoding+'" not supported. supported values: '+A.join(", "));return l}function L(f){if(typeof f=="function")return/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(f))!=null}function y(f,g,l){l=l||[];function u(i){return g.update?g.update(i,"utf8"):g.write(i,"utf8")}return{dispatch:function(i){return this["_"+((i=f.replacer?f.replacer(i):i)===null?"null":typeof i)](i)},_object:function(i){var _,T=Object.prototype.toString.call(i),U=/\[object (.*)\]/i.exec(T);if(U=(U=U?U[1]:"unknown:["+T+"]").toLowerCase(),0<=(T=l.indexOf(i)))return this.dispatch("[CIRCULAR:"+T+"]");if(l.push(i),p!==void 0&&p.isBuffer&&p.isBuffer(i))return u("buffer:"),u(i);if(U==="object"||U==="function"||U==="asyncfunction")return T=Object.keys(i),f.unorderedObjects&&(T=T.sort()),f.respectType===!1||L(i)||T.splice(0,0,"prototype","__proto__","constructor"),f.excludeKeys&&(T=T.filter(function(k){return!f.excludeKeys(k)})),u("object:"+T.length+":"),_=this,T.forEach(function(k){_.dispatch(k),u(":"),f.excludeValues||_.dispatch(i[k]),u(",")});if(!this["_"+U]){if(f.ignoreUnknown)return u("["+U+"]");throw new Error('Unknown object type "'+U+'"')}this["_"+U](i)},_array:function(i,k){k=k!==void 0?k:f.unorderedArrays!==!1;var T=this;if(u("array:"+i.length+":"),!k||i.length<=1)return i.forEach(function(R){return T.dispatch(R)});var U=[],k=i.map(function(R){var D=new S,z=l.slice();return y(f,D,z).dispatch(R),U=U.concat(z.slice(l.length)),D.read().toString()});return l=l.concat(U),k.sort(),this._array(k,!1)},_date:function(i){return u("date:"+i.toJSON())},_symbol:function(i){return u("symbol:"+i.toString())},_error:function(i){return u("error:"+i.toString())},_boolean:function(i){return u("bool:"+i.toString())},_string:function(i){u("string:"+i.length+":"),u(i.toString())},_function:function(i){u("fn:"),L(i)?this.dispatch("[native]"):this.dispatch(i.toString()),f.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(i.name)),f.respectFunctionProperties&&this._object(i)},_number:function(i){return u("number:"+i.toString())},_xml:function(i){return u("xml:"+i.toString())},_null:function(){return u("Null")},_undefined:function(){return u("Undefined")},_regexp:function(i){return u("regex:"+i.toString())},_uint8array:function(i){return u("uint8array:"),this.dispatch(Array.prototype.slice.call(i))},_uint8clampedarray:function(i){return u("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(i))},_int8array:function(i){return u("int8array:"),this.dispatch(Array.prototype.slice.call(i))},_uint16array:function(i){return u("uint16array:"),this.dispatch(Array.prototype.slice.call(i))},_int16array:function(i){return u("int16array:"),this.dispatch(Array.prototype.slice.call(i))},_uint32array:function(i){return u("uint32array:"),this.dispatch(Array.prototype.slice.call(i))},_int32array:function(i){return u("int32array:"),this.dispatch(Array.prototype.slice.call(i))},_float32array:function(i){return u("float32array:"),this.dispatch(Array.prototype.slice.call(i))},_float64array:function(i){return u("float64array:"),this.dispatch(Array.prototype.slice.call(i))},_arraybuffer:function(i){return u("arraybuffer:"),this.dispatch(new Uint8Array(i))},_url:function(i){return u("url:"+i.toString())},_map:function(i){return u("map:"),i=Array.from(i),this._array(i,f.unorderedSets!==!1)},_set:function(i){return u("set:"),i=Array.from(i),this._array(i,f.unorderedSets!==!1)},_file:function(i){return u("file:"),this.dispatch([i.name,i.size,i.type,i.lastModfied])},_blob:function(){if(f.ignoreUnknown)return u("[blob]");throw Error(`Hashing Blob objects is currently not supported
1
+ import{j as F}from"./jsx-runtime-W3oueGCa.js";import{r as G,g as ct}from"./index-YTOF1_EJ.js";import{$ as dt,a0 as bn,a1 as we,B as fe,a2 as gt,v as Y,A as ie,P as Ce,C as _e,a3 as an,a4 as ht,g as Ke,y as pt,S as mt,E as bt,F as yt,a5 as Se,a6 as Pe,H as Ee,a7 as Ne,G as Je,I as wt,T as _t,L as yn,a as Et,J as Be,K as Tt,M as be,d as Lt,r as vt,N as wn,a8 as At,f as xt,a9 as Ct,U as St,aa as le,ab as fn,ac as xe,D as Pt,ad as ye,b as It,s as Ot,Q as Nt,ae as Mt,h as Dt,i as Bt,V as jt,W as Ft,j as kt,k as Ut,p as Rt,m as Gt,n as Yt,o as zt,q as Vt,t as Xt}from"./legend-context-Ck5tFDGN.js";import{r as He,M as cn,k as je,B as ce,s as Ht,v as qt,w as _n,x as Wt,y as $t,z as Zt,A as Kt,E as Jt,N as En,G as Qt,S as er,g as nr,e as tr,F as rr,T as Un,J as or,K as sr,D as ir,O as lr,Q as ur,o as ar,q as fr,U as cr,j as dr,u as gr,Z as hr,t as pr,R as mr,l as br,H as yr,L as wr,m as _r,n as Er}from"./legend-DOA3L9eH.js";import{c as Tr,C as Lr,f as Tn,a as vr,b as Ar}from"./get-draggableData-B6vSKEXH.js";import{e as xr}from"./index-CgYGpm1H.js";const Cr=(e,n,t)=>{const[o,r]=e.major,[d,c]=e.minor,p=(o.x+r.x+d.x+c.x)/4,w=(o.y+r.y+d.y+c.y)/4,C=r.x-o.x,E=r.y-o.y,P=Math.atan2(t.getPixelForValue(w+E/2)-t.getPixelForValue(w-E/2),n.getPixelForValue(p+C/2)-n.getPixelForValue(p-C/2)),M=Math.hypot(n.getPixelForValue(o.x)-n.getPixelForValue(r.x),t.getPixelForValue(o.y)-t.getPixelForValue(r.y))/2,N=Math.hypot(n.getPixelForValue(d.x)-n.getPixelForValue(c.x),t.getPixelForValue(d.y)-t.getPixelForValue(c.y))/2,v=n.getPixelForValue(p),x=t.getPixelForValue(w);return{cx:v,cy:x,radiusX:M,radiusY:N,angle:P}},Sr=e=>e.data.datasets.some(n=>n.data.some(t=>!!t.ellipsePoints)),Pr={id:"ellipsisAnnotationPlugin",afterDatasetsDraw(e){var d,c,p,w,C,E,P,M,N;if(!Sr(e))return;const n=e==null?void 0:e.ctx,t=(d=e==null?void 0:e.scales)==null?void 0:d.x,o=(c=e==null?void 0:e.scales)==null?void 0:c.y,r=e==null?void 0:e.chartArea;!t||!o||!r||((p=n==null?void 0:n.save)==null||p.call(n),(w=n==null?void 0:n.beginPath)==null||w.call(n),(C=n==null?void 0:n.rect)==null||C.call(n,r.left,r.top,r.right-r.left,r.bottom-r.top),(E=n==null?void 0:n.clip)==null||E.call(n),(M=(P=e==null?void 0:e.data)==null?void 0:P.datasets)==null||M.forEach(v=>{var h;const x=v;(h=x==null?void 0:x.data)==null||h.forEach(A=>{var l,u,i,_,T;const{ellipsePoints:b}=A??{};if(!b)return;const{cx:L,cy:y,radiusX:S,radiusY:f,angle:g}=Cr(b,t,o);(l=n==null?void 0:n.save)==null||l.call(n),(u=n==null?void 0:n.beginPath)==null||u.call(n),(i=n==null?void 0:n.ellipse)==null||i.call(n,L,y,S,f,g,0,2*Math.PI),n.strokeStyle=x.borderColor||dt,n.lineWidth=x.borderWidth||1,(_=n==null?void 0:n.stroke)==null||_.call(n),(T=n==null?void 0:n.restore)==null||T.call(n)})}),(N=n==null?void 0:n.restore)==null||N.call(n))}},Ir="_chart_e3qdd_1",Or="_canvas_e3qdd_11",Nr="_fixedHeight_e3qdd_20",Mr="_stretchHeight_e3qdd_26",Dr="_squareAspectRatio_e3qdd_32",Br="_table_e3qdd_62",qe={chart:Ir,canvas:Or,fixedHeight:Nr,stretchHeight:Mr,squareAspectRatio:Dr,table:Br};var Rn=Symbol.for("immer-nothing"),Ln=Symbol.for("immer-draftable"),ne=Symbol.for("immer-state");function oe(e,...n){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Te=Object.getPrototypeOf;function Le(e){return!!e&&!!e[ne]}function he(e){var n;return e?Gn(e)||Array.isArray(e)||!!e[Ln]||!!((n=e.constructor)!=null&&n[Ln])||ze(e)||Ve(e):!1}var jr=Object.prototype.constructor.toString();function Gn(e){if(!e||typeof e!="object")return!1;const n=Te(e);if(n===null)return!0;const t=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return t===Object?!0:typeof t=="function"&&Function.toString.call(t)===jr}function Fe(e,n){Ye(e)===0?Reflect.ownKeys(e).forEach(t=>{n(t,e[t],e)}):e.forEach((t,o)=>n(o,t,e))}function Ye(e){const n=e[ne];return n?n.type_:Array.isArray(e)?1:ze(e)?2:Ve(e)?3:0}function Qe(e,n){return Ye(e)===2?e.has(n):Object.prototype.hasOwnProperty.call(e,n)}function Yn(e,n,t){const o=Ye(e);o===2?e.set(n,t):o===3?e.add(t):e[n]=t}function Fr(e,n){return e===n?e!==0||1/e===1/n:e!==e&&n!==n}function ze(e){return e instanceof Map}function Ve(e){return e instanceof Set}function ge(e){return e.copy_||e.base_}function en(e,n){if(ze(e))return new Map(e);if(Ve(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const t=Gn(e);if(n===!0||n==="class_only"&&!t){const o=Object.getOwnPropertyDescriptors(e);delete o[ne];let r=Reflect.ownKeys(o);for(let d=0;d<r.length;d++){const c=r[d],p=o[c];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(o[c]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[c]})}return Object.create(Te(e),o)}else{const o=Te(e);if(o!==null&&t)return{...e};const r=Object.create(o);return Object.assign(r,e)}}function dn(e,n=!1){return Xe(e)||Le(e)||!he(e)||(Ye(e)>1&&(e.set=e.add=e.clear=e.delete=kr),Object.freeze(e),n&&Object.entries(e).forEach(([t,o])=>dn(o,!0))),e}function kr(){oe(2)}function Xe(e){return Object.isFrozen(e)}var Ur={};function pe(e){const n=Ur[e];return n||oe(0,e),n}var Ie;function zn(){return Ie}function Rr(e,n){return{drafts_:[],parent_:e,immer_:n,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function vn(e,n){n&&(pe("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=n)}function nn(e){tn(e),e.drafts_.forEach(Gr),e.drafts_=null}function tn(e){e===Ie&&(Ie=e.parent_)}function An(e){return Ie=Rr(Ie,e)}function Gr(e){const n=e[ne];n.type_===0||n.type_===1?n.revoke_():n.revoked_=!0}function xn(e,n){n.unfinalizedDrafts_=n.drafts_.length;const t=n.drafts_[0];return e!==void 0&&e!==t?(t[ne].modified_&&(nn(n),oe(4)),he(e)&&(e=ke(n,e),n.parent_||Ue(n,e)),n.patches_&&pe("Patches").generateReplacementPatches_(t[ne].base_,e,n.patches_,n.inversePatches_)):e=ke(n,t,[]),nn(n),n.patches_&&n.patchListener_(n.patches_,n.inversePatches_),e!==Rn?e:void 0}function ke(e,n,t){if(Xe(n))return n;const o=n[ne];if(!o)return Fe(n,(r,d)=>Cn(e,o,n,r,d,t)),n;if(o.scope_!==e)return n;if(!o.modified_)return Ue(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const r=o.copy_;let d=r,c=!1;o.type_===3&&(d=new Set(r),r.clear(),c=!0),Fe(d,(p,w)=>Cn(e,o,r,p,w,t,c)),Ue(e,r,!1),t&&e.patches_&&pe("Patches").generatePatches_(o,t,e.patches_,e.inversePatches_)}return o.copy_}function Cn(e,n,t,o,r,d,c){if(Le(r)){const p=d&&n&&n.type_!==3&&!Qe(n.assigned_,o)?d.concat(o):void 0,w=ke(e,r,p);if(Yn(t,o,w),Le(w))e.canAutoFreeze_=!1;else return}else c&&t.add(r);if(he(r)&&!Xe(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ke(e,r),(!n||!n.scope_.parent_)&&typeof o!="symbol"&&Object.prototype.propertyIsEnumerable.call(t,o)&&Ue(e,r)}}function Ue(e,n,t=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&dn(n,t)}function Yr(e,n){const t=Array.isArray(e),o={type_:t?1:0,scope_:n?n.scope_:zn(),modified_:!1,finalized_:!1,assigned_:{},parent_:n,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=o,d=gn;t&&(r=[o],d=Oe);const{revoke:c,proxy:p}=Proxy.revocable(r,d);return o.draft_=p,o.revoke_=c,p}var gn={get(e,n){if(n===ne)return e;const t=ge(e);if(!Qe(t,n))return zr(e,t,n);const o=t[n];return e.finalized_||!he(o)?o:o===We(e.base_,n)?($e(e),e.copy_[n]=on(o,e)):o},has(e,n){return n in ge(e)},ownKeys(e){return Reflect.ownKeys(ge(e))},set(e,n,t){const o=Vn(ge(e),n);if(o!=null&&o.set)return o.set.call(e.draft_,t),!0;if(!e.modified_){const r=We(ge(e),n),d=r==null?void 0:r[ne];if(d&&d.base_===t)return e.copy_[n]=t,e.assigned_[n]=!1,!0;if(Fr(t,r)&&(t!==void 0||Qe(e.base_,n)))return!0;$e(e),rn(e)}return e.copy_[n]===t&&(t!==void 0||n in e.copy_)||Number.isNaN(t)&&Number.isNaN(e.copy_[n])||(e.copy_[n]=t,e.assigned_[n]=!0),!0},deleteProperty(e,n){return We(e.base_,n)!==void 0||n in e.base_?(e.assigned_[n]=!1,$e(e),rn(e)):delete e.assigned_[n],e.copy_&&delete e.copy_[n],!0},getOwnPropertyDescriptor(e,n){const t=ge(e),o=Reflect.getOwnPropertyDescriptor(t,n);return o&&{writable:!0,configurable:e.type_!==1||n!=="length",enumerable:o.enumerable,value:t[n]}},defineProperty(){oe(11)},getPrototypeOf(e){return Te(e.base_)},setPrototypeOf(){oe(12)}},Oe={};Fe(gn,(e,n)=>{Oe[e]=function(){return arguments[0]=arguments[0][0],n.apply(this,arguments)}});Oe.deleteProperty=function(e,n){return Oe.set.call(this,e,n,void 0)};Oe.set=function(e,n,t){return gn.set.call(this,e[0],n,t,e[0])};function We(e,n){const t=e[ne];return(t?ge(t):e)[n]}function zr(e,n,t){var r;const o=Vn(n,t);return o?"value"in o?o.value:(r=o.get)==null?void 0:r.call(e.draft_):void 0}function Vn(e,n){if(!(n in e))return;let t=Te(e);for(;t;){const o=Object.getOwnPropertyDescriptor(t,n);if(o)return o;t=Te(t)}}function rn(e){e.modified_||(e.modified_=!0,e.parent_&&rn(e.parent_))}function $e(e){e.copy_||(e.copy_=en(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Vr=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(n,t,o)=>{if(typeof n=="function"&&typeof t!="function"){const d=t;t=n;const c=this;return function(w=d,...C){return c.produce(w,E=>t.call(this,E,...C))}}typeof t!="function"&&oe(6),o!==void 0&&typeof o!="function"&&oe(7);let r;if(he(n)){const d=An(this),c=on(n,void 0);let p=!0;try{r=t(c),p=!1}finally{p?nn(d):tn(d)}return vn(d,o),xn(r,d)}else if(!n||typeof n!="object"){if(r=t(n),r===void 0&&(r=n),r===Rn&&(r=void 0),this.autoFreeze_&&dn(r,!0),o){const d=[],c=[];pe("Patches").generateReplacementPatches_(n,r,d,c),o(d,c)}return r}else oe(1,n)},this.produceWithPatches=(n,t)=>{if(typeof n=="function")return(c,...p)=>this.produceWithPatches(c,w=>n(w,...p));let o,r;return[this.produce(n,t,(c,p)=>{o=c,r=p}),o,r]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){he(e)||oe(8),Le(e)&&(e=Xr(e));const n=An(this),t=on(e,void 0);return t[ne].isManual_=!0,tn(n),t}finishDraft(e,n){const t=e&&e[ne];(!t||!t.isManual_)&&oe(9);const{scope_:o}=t;return vn(o,n),xn(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,n){let t;for(t=n.length-1;t>=0;t--){const r=n[t];if(r.path.length===0&&r.op==="replace"){e=r.value;break}}t>-1&&(n=n.slice(t+1));const o=pe("Patches").applyPatches_;return Le(e)?o(e,n):this.produce(e,r=>o(r,n))}};function on(e,n){const t=ze(e)?pe("MapSet").proxyMap_(e,n):Ve(e)?pe("MapSet").proxySet_(e,n):Yr(e,n);return(n?n.scope_:zn()).drafts_.push(t),t}function Xr(e){return Le(e)||oe(10,e),Xn(e)}function Xn(e){if(!he(e)||Xe(e))return e;const n=e[ne];let t;if(n){if(!n.modified_)return n.base_;n.finalized_=!0,t=en(e,n.scope_.immer_.useStrictShallowCopy_)}else t=en(e,!0);return Fe(t,(o,r)=>{Yn(t,o,Xn(r))}),n&&(n.finalized_=!1),t}var te=new Vr,Hr=te.produce;te.produceWithPatches.bind(te);te.setAutoFreeze.bind(te);te.setUseStrictShallowCopy.bind(te);te.applyPatches.bind(te);te.createDraft.bind(te);te.finishDraft.bind(te);const Hn="TOGGLE_ZOOM",qn="TOGGLE_PAN",Wn="TOGGLE_POINTS",$n="TOGGLE_LINE",Zn="TOGGLE_LEGEND",Kn="TOGGLE_TABLE",sn="RESET_AXES_RANGES",ln="UPDATE_AXES_RANGES",Jn="TOGGLE_DRAG_POINTS",Qn="TOGGLE_DRAG_ANNOTATION",et="DISABLE_DRAG_OPTIONS",De="UPDATE_EDITED",qr=(e,n)=>Hr(e,t=>{switch(n.type){case Hn:{t.zoomEnabled=!t.zoomEnabled,t.panEnabled&&(t.panEnabled=!1),t.enableDragPoints&&(t.enableDragPoints=!1),t.enableDragAnnotation&&(t.enableDragAnnotation=!1);break}case qn:{t.panEnabled=!t.panEnabled,t.zoomEnabled&&(t.zoomEnabled=!1),t.enableDragPoints&&(t.enableDragPoints=!1),t.enableDragAnnotation&&(t.enableDragAnnotation=!1);break}case Wn:{t.pointsEnabled=!t.pointsEnabled;break}case $n:{t.lineEnabled=!t.lineEnabled;break}case Zn:{t.legendEnabled=!t.legendEnabled;break}case Kn:{t.showTable=!t.showTable;break}case ln:{const{axes:o}=n.payload;t.axes=o;break}case sn:{const{axes:o}=n.payload;t.axes=o;break}case Jn:{t.enableDragPoints=!t.enableDragPoints,t.panEnabled&&(t.panEnabled=!1),t.zoomEnabled&&(t.zoomEnabled=!1),t.enableDragAnnotation&&(t.enableDragAnnotation=!1);break}case Qn:{t.enableDragAnnotation=!t.enableDragAnnotation,t.panEnabled&&(t.panEnabled=!1),t.zoomEnabled&&(t.zoomEnabled=!1);break}case et:{(t.enableDragAnnotation||t.enableDragPoints||t.panEnabled||t.zoomEnabled)&&(t.enableDragAnnotation=!1,t.enableDragPoints=!1,t.panEnabled=!1,t.zoomEnabled=!1);break}case De:{t.edited=n.payload;break}}}),Wr=e=>{if(!e)return null;const n=`line-chart-state-${e}`,t=localStorage.getItem(n);return t?JSON.parse(t).state:null},$r=(e=72)=>{const n=new Date().getTime(),t=e*60*60*1e3;for(let o=0;o<localStorage.length;o++){const r=localStorage.key(o);if(r!=null&&r.includes("line-chart-state-")){const d=localStorage.getItem(r);if(d){const p=JSON.parse(d).timestamp;p&&n-p>t&&localStorage.removeItem(r)}}}},Zr=(e,n)=>{if(!n)return;const t=new Date().getTime(),o=`line-chart-state-${n}`,r={state:e,timestamp:t};localStorage.setItem(o,JSON.stringify(r)),$r()},Kr=({options:e,persistenceId:n})=>{const{chartOptions:{enableZoom:t,enablePan:o,showPoints:r,showLine:d,enableDragAnnotation:c},legend:{display:p},dragData:w}=e,{zoomEnabled:C,panEnabled:E,pointsEnabled:P,lineEnabled:M,legendEnabled:N,enableDragPoints:v,enableDragAnnotation:x}=Wr(n)||{};return{zoomEnabled:c??x?!1:C??t,panEnabled:E??o,pointsEnabled:P??r,lineEnabled:M??d,legendEnabled:N??p,axes:[],showTable:!1,enableDragPoints:(w==null?void 0:w.enableDragData)&&v,enableDragAnnotation:c??x,edited:!1}},Jr=e=>G.createElement("svg",{fill:"currentColor",height:"1em",viewBox:"0 0 12 12",width:"1em",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",...e},G.createElement("clipPath",{id:"a"},G.createElement("path",{d:"m0 0h12v12h-12z"})),G.createElement("g",{clipPath:"url(#a)"},G.createElement("path",{d:"m.5 6.5v-1h11v1c-4.16104 0-6.63549 0-11 0z"}))),Qr=e=>G.createElement("svg",{fill:"currentColor",height:"1em",viewBox:"0 0 12 12",width:"1em",xmlns:"http://www.w3.org/2000/svg",...e},G.createElement("circle",{cx:6,cy:6,r:2})),eo=e=>G.createElement("svg",{fill:"currentColor",height:"1em",viewBox:"0 0 12 12",width:"1em",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",...e},G.createElement("clipPath",{id:"a"},G.createElement("path",{d:"m0 0h12v12h-12z"})),G.createElement("g",{clipPath:"url(#a)"},G.createElement("path",{d:"m7.937 6.5c-.11122.42912-.36179.80916-.71237 1.08047-.35058.2713-.78133.4185-1.22463.4185s-.87405-.1472-1.22463-.4185c-.35058-.27131-.60115-.65135-.71237-1.08047h-3.563v-1h3.563c.11122-.42912.36179-.80916.71237-1.08046s.78133-.41851 1.22463-.41851.87405.14721 1.22463.41851.60115.65134.71237 1.08046h3.563v1z"})));function no({lineEnabled:e,onToggleLine:n,onTogglePoints:t,pointsEnabled:o,translations:r}){return[{type:"Option",label:r.pointsLines,icon:F.jsx(He,{icon:F.jsx(eo,{})}),selected:o&&e,onClick:()=>{o||t(),e||n()}},{type:"Option",label:r.linesOnly,icon:F.jsx(He,{icon:F.jsx(Jr,{})}),selected:!o&&e,onClick:()=>{o&&t(),e||n()}},{type:"Option",label:r.pointsOnly,icon:F.jsx(He,{icon:F.jsx(Qr,{})}),selected:o&&!e,onClick:()=>{o||t(),e&&n()}}]}const nt=({options:e})=>{const[n,t]=G.useState(!1),o=e.find(r=>r.selected);return F.jsx(cn,{open:n,setOpen:t,menu:{sections:e,trigger:"Component",component:F.jsx(je,{display:"inline-flex",text:o==null?void 0:o.label,placement:"bottom-start",enabled:!n,children:F.jsx(ce,{colored:"muted",basic:!0,small:!0,round:!0,icon:o==null?void 0:o.icon})})}})};nt.__docgenInfo={description:"",methods:[],displayName:"LineOptions",props:{options:{required:!0,tsType:{name:"Array",elements:[{name:"IMenuSection"}],raw:"IMenuSection[]"},description:""}}};function to({onTogglePan:e,onToggleZoom:n,panEnabled:t,zoomEnabled:o,enableDragPoints:r,enableDragAnnotation:d,isDragDataAllowed:c,isDragAnnotationAllowed:p,onToggleDragAnnotation:w,onToggleDragPoints:C,onDisableDragOptions:E,translations:{dragToZoom:P,doubleClickToReset:M,dragToPan:N,dragToMovePoints:v,dragDisabled:x,dragToMoveAnnotation:h}}){return[{label:P,description:M,icon:F.jsx(Ht,{}),selected:o,type:"Option",onClick:()=>{o||n()}},{label:N,description:M,icon:F.jsx(qt,{}),selected:t,type:"Option",onClick:()=>{t||e()}},...c?[{label:v,icon:F.jsx(_n,{}),selected:r,type:"Option",onClick:()=>{r||C()}}]:[],...p?[{label:h,icon:F.jsx(_n,{}),selected:d,type:"Option",onClick:()=>{d||w()}}]:[],{label:x,icon:F.jsx(Wt,{}),selected:!o&&!t&&!r&&!d,type:"Option",onClick:E}]}const tt=({options:e})=>{const n=e.find(t=>t.selected);return F.jsx(cn,{menu:{sections:e,trigger:"Component",component:F.jsx(ce,{colored:"muted",basic:!0,small:!0,label:n==null?void 0:n.label,icon:n==null?void 0:n.icon})}})};tt.__docgenInfo={description:"@param {import('./drag-options-interfaces').IDragOptions} obj",methods:[],displayName:"DragOptions",props:{options:{required:!0,tsType:{name:"Array",elements:[{name:"IMenuSection"}],raw:"IMenuSection[]"},description:""}}};const ro="_controls_1edjs_1",oo="_buttons_1edjs_6",Sn={controls:ro,buttons:oo},so=e=>{const n=G.useCallback(t=>()=>{e({type:t})},[e]);return{onToggleLegend:n(Zn),onToggleLine:n($n),onTogglePan:n(qn),onTogglePoints:n(Wn),onToggleTable:n(Kn),onToggleZoom:n(Hn),onToggleDragPoints:n(Jn),onToggleDragAnnotation:n(Qn),onDisableDragOptions:n(et)}};function Me(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ze={exports:{}},Pn;function io(){return Pn||(Pn=1,function(e,n){(function(t){e.exports=t()})(function(){return function t(o,r,d){function c(C,E){if(!r[C]){if(!o[C]){var P=typeof Me=="function"&&Me;if(!E&&P)return P(C,!0);if(p)return p(C,!0);throw new Error("Cannot find module '"+C+"'")}E=r[C]={exports:{}},o[C][0].call(E.exports,function(M){var N=o[C][1][M];return c(N||M)},E,E.exports,t,o,r,d)}return r[C].exports}for(var p=typeof Me=="function"&&Me,w=0;w<d.length;w++)c(d[w]);return c}({1:[function(t,o,r){(function(d,c,p,w,C,E,P,M,N){var v=t("crypto");function x(f,g){g=b(f,g);var l;return(l=g.algorithm!=="passthrough"?v.createHash(g.algorithm):new S).write===void 0&&(l.write=l.update,l.end=l.update),y(g,l).dispatch(f),l.update||l.end(""),l.digest?l.digest(g.encoding==="buffer"?void 0:g.encoding):(f=l.read(),g.encoding!=="buffer"?f.toString(g.encoding):f)}(r=o.exports=x).sha1=function(f){return x(f)},r.keys=function(f){return x(f,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},r.MD5=function(f){return x(f,{algorithm:"md5",encoding:"hex"})},r.keysMD5=function(f){return x(f,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var h=v.getHashes?v.getHashes().slice():["sha1","md5"],A=(h.push("passthrough"),["buffer","hex","binary","base64"]);function b(f,g){var l={};if(l.algorithm=(g=g||{}).algorithm||"sha1",l.encoding=g.encoding||"hex",l.excludeValues=!!g.excludeValues,l.algorithm=l.algorithm.toLowerCase(),l.encoding=l.encoding.toLowerCase(),l.ignoreUnknown=g.ignoreUnknown===!0,l.respectType=g.respectType!==!1,l.respectFunctionNames=g.respectFunctionNames!==!1,l.respectFunctionProperties=g.respectFunctionProperties!==!1,l.unorderedArrays=g.unorderedArrays===!0,l.unorderedSets=g.unorderedSets!==!1,l.unorderedObjects=g.unorderedObjects!==!1,l.replacer=g.replacer||void 0,l.excludeKeys=g.excludeKeys||void 0,f===void 0)throw new Error("Object argument required.");for(var u=0;u<h.length;++u)h[u].toLowerCase()===l.algorithm.toLowerCase()&&(l.algorithm=h[u]);if(h.indexOf(l.algorithm)===-1)throw new Error('Algorithm "'+l.algorithm+'" not supported. supported values: '+h.join(", "));if(A.indexOf(l.encoding)===-1&&l.algorithm!=="passthrough")throw new Error('Encoding "'+l.encoding+'" not supported. supported values: '+A.join(", "));return l}function L(f){if(typeof f=="function")return/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(f))!=null}function y(f,g,l){l=l||[];function u(i){return g.update?g.update(i,"utf8"):g.write(i,"utf8")}return{dispatch:function(i){return this["_"+((i=f.replacer?f.replacer(i):i)===null?"null":typeof i)](i)},_object:function(i){var _,T=Object.prototype.toString.call(i),U=/\[object (.*)\]/i.exec(T);if(U=(U=U?U[1]:"unknown:["+T+"]").toLowerCase(),0<=(T=l.indexOf(i)))return this.dispatch("[CIRCULAR:"+T+"]");if(l.push(i),p!==void 0&&p.isBuffer&&p.isBuffer(i))return u("buffer:"),u(i);if(U==="object"||U==="function"||U==="asyncfunction")return T=Object.keys(i),f.unorderedObjects&&(T=T.sort()),f.respectType===!1||L(i)||T.splice(0,0,"prototype","__proto__","constructor"),f.excludeKeys&&(T=T.filter(function(k){return!f.excludeKeys(k)})),u("object:"+T.length+":"),_=this,T.forEach(function(k){_.dispatch(k),u(":"),f.excludeValues||_.dispatch(i[k]),u(",")});if(!this["_"+U]){if(f.ignoreUnknown)return u("["+U+"]");throw new Error('Unknown object type "'+U+'"')}this["_"+U](i)},_array:function(i,k){k=k!==void 0?k:f.unorderedArrays!==!1;var T=this;if(u("array:"+i.length+":"),!k||i.length<=1)return i.forEach(function(R){return T.dispatch(R)});var U=[],k=i.map(function(R){var D=new S,z=l.slice();return y(f,D,z).dispatch(R),U=U.concat(z.slice(l.length)),D.read().toString()});return l=l.concat(U),k.sort(),this._array(k,!1)},_date:function(i){return u("date:"+i.toJSON())},_symbol:function(i){return u("symbol:"+i.toString())},_error:function(i){return u("error:"+i.toString())},_boolean:function(i){return u("bool:"+i.toString())},_string:function(i){u("string:"+i.length+":"),u(i.toString())},_function:function(i){u("fn:"),L(i)?this.dispatch("[native]"):this.dispatch(i.toString()),f.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(i.name)),f.respectFunctionProperties&&this._object(i)},_number:function(i){return u("number:"+i.toString())},_xml:function(i){return u("xml:"+i.toString())},_null:function(){return u("Null")},_undefined:function(){return u("Undefined")},_regexp:function(i){return u("regex:"+i.toString())},_uint8array:function(i){return u("uint8array:"),this.dispatch(Array.prototype.slice.call(i))},_uint8clampedarray:function(i){return u("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(i))},_int8array:function(i){return u("int8array:"),this.dispatch(Array.prototype.slice.call(i))},_uint16array:function(i){return u("uint16array:"),this.dispatch(Array.prototype.slice.call(i))},_int16array:function(i){return u("int16array:"),this.dispatch(Array.prototype.slice.call(i))},_uint32array:function(i){return u("uint32array:"),this.dispatch(Array.prototype.slice.call(i))},_int32array:function(i){return u("int32array:"),this.dispatch(Array.prototype.slice.call(i))},_float32array:function(i){return u("float32array:"),this.dispatch(Array.prototype.slice.call(i))},_float64array:function(i){return u("float64array:"),this.dispatch(Array.prototype.slice.call(i))},_arraybuffer:function(i){return u("arraybuffer:"),this.dispatch(new Uint8Array(i))},_url:function(i){return u("url:"+i.toString())},_map:function(i){return u("map:"),i=Array.from(i),this._array(i,f.unorderedSets!==!1)},_set:function(i){return u("set:"),i=Array.from(i),this._array(i,f.unorderedSets!==!1)},_file:function(i){return u("file:"),this.dispatch([i.name,i.size,i.type,i.lastModfied])},_blob:function(){if(f.ignoreUnknown)return u("[blob]");throw Error(`Hashing Blob objects is currently not supported
2
2
  (see https://github.com/puleos/object-hash/issues/26)
3
3
  Use "options.replacer" or "options.ignoreUnknown"
4
4
  `)},_domwindow:function(){return u("domwindow")},_bigint:function(i){return u("bigint:"+i.toString())},_process:function(){return u("process")},_timer:function(){return u("timer")},_pipe:function(){return u("pipe")},_tcp:function(){return u("tcp")},_udp:function(){return u("udp")},_tty:function(){return u("tty")},_statwatcher:function(){return u("statwatcher")},_securecontext:function(){return u("securecontext")},_connection:function(){return u("connection")},_zlib:function(){return u("zlib")},_context:function(){return u("context")},_nodescript:function(){return u("nodescript")},_httpparser:function(){return u("httpparser")},_dataview:function(){return u("dataview")},_signal:function(){return u("signal")},_fsevent:function(){return u("fsevent")},_tlswrap:function(){return u("tlswrap")}}}function S(){return{buf:"",write:function(f){this.buf+=f},end:function(f){this.buf+=f},read:function(){return this.buf}}}r.writeToStream=function(f,g,l){return l===void 0&&(l=g,g={}),y(g=b(f,g),l).dispatch(f)}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/")},{buffer:3,crypto:5,lYpoI2:11}],2:[function(t,o,r){(function(d,c,p,w,C,E,P,M,N){(function(v){var x=typeof Uint8Array<"u"?Uint8Array:Array,h=43,A=47,b=48,L=97,y=65,S=45,f=95;function g(l){return l=l.charCodeAt(0),l===h||l===S?62:l===A||l===f?63:l<b?-1:l<b+10?l-b+26+26:l<y+26?l-y:l<L+26?l-L+26:void 0}v.toByteArray=function(l){var u,i;if(0<l.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var _=l.length,_=l.charAt(_-2)==="="?2:l.charAt(_-1)==="="?1:0,T=new x(3*l.length/4-_),U=0<_?l.length-4:l.length,k=0;function R(D){T[k++]=D}for(u=0;u<U;u+=4,0)R((16711680&(i=g(l.charAt(u))<<18|g(l.charAt(u+1))<<12|g(l.charAt(u+2))<<6|g(l.charAt(u+3))))>>16),R((65280&i)>>8),R(255&i);return _==2?R(255&(i=g(l.charAt(u))<<2|g(l.charAt(u+1))>>4)):_==1&&(R((i=g(l.charAt(u))<<10|g(l.charAt(u+1))<<4|g(l.charAt(u+2))>>2)>>8&255),R(255&i)),T},v.fromByteArray=function(l){var u,i,_,T,U=l.length%3,k="";function R(D){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(D)}for(u=0,_=l.length-U;u<_;u+=3)i=(l[u]<<16)+(l[u+1]<<8)+l[u+2],k+=R((T=i)>>18&63)+R(T>>12&63)+R(T>>6&63)+R(63&T);switch(U){case 1:k=(k+=R((i=l[l.length-1])>>2))+R(i<<4&63)+"==";break;case 2:k=(k=(k+=R((i=(l[l.length-2]<<8)+l[l.length-1])>>10))+R(i>>4&63))+R(i<<2&63)+"="}return k}})(r===void 0?this.base64js={}:r)}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(t,o,r){(function(d,c,h,w,C,E,P,M,N){var v=t("base64-js"),x=t("ieee754");function h(s,a,m){if(!(this instanceof h))return new h(s,a,m);var O,I,j,V,W=typeof s;if(a==="base64"&&W=="string")for(s=(V=s).trim?V.trim():V.replace(/^\s+|\s+$/g,"");s.length%4!=0;)s+="=";if(W=="number")O=q(s);else if(W=="string")O=h.byteLength(s,a);else{if(W!="object")throw new Error("First argument needs to be a number, array or string.");O=q(s.length)}if(h._useTypedArrays?I=h._augment(new Uint8Array(O)):((I=this).length=O,I._isBuffer=!0),h._useTypedArrays&&typeof s.byteLength=="number")I._set(s);else if(H(V=s)||h.isBuffer(V)||V&&typeof V=="object"&&typeof V.length=="number")for(j=0;j<O;j++)h.isBuffer(s)?I[j]=s.readUInt8(j):I[j]=s[j];else if(W=="string")I.write(s,0,a);else if(W=="number"&&!h._useTypedArrays&&!m)for(j=0;j<O;j++)I[j]=0;return I}function A(s,a,m,O){return h._charsWritten=de(function(I){for(var j=[],V=0;V<I.length;V++)j.push(255&I.charCodeAt(V));return j}(a),s,m,O)}function b(s,a,m,O){return h._charsWritten=de(function(I){for(var j,V,W=[],K=0;K<I.length;K++)V=I.charCodeAt(K),j=V>>8,V=V%256,W.push(V),W.push(j);return W}(a),s,m,O)}function L(s,a,m){var O="";m=Math.min(s.length,m);for(var I=a;I<m;I++)O+=String.fromCharCode(s[I]);return O}function y(s,a,m,j){j||(B(typeof m=="boolean","missing or invalid endian"),B(a!=null,"missing offset"),B(a+1<s.length,"Trying to read beyond buffer length"));var I,j=s.length;if(!(j<=a))return m?(I=s[a],a+1<j&&(I|=s[a+1]<<8)):(I=s[a]<<8,a+1<j&&(I|=s[a+1])),I}function S(s,a,m,j){j||(B(typeof m=="boolean","missing or invalid endian"),B(a!=null,"missing offset"),B(a+3<s.length,"Trying to read beyond buffer length"));var I,j=s.length;if(!(j<=a))return m?(a+2<j&&(I=s[a+2]<<16),a+1<j&&(I|=s[a+1]<<8),I|=s[a],a+3<j&&(I+=s[a+3]<<24>>>0)):(a+1<j&&(I=s[a+1]<<16),a+2<j&&(I|=s[a+2]<<8),a+3<j&&(I|=s[a+3]),I+=s[a]<<24>>>0),I}function f(s,a,m,O){if(O||(B(typeof m=="boolean","missing or invalid endian"),B(a!=null,"missing offset"),B(a+1<s.length,"Trying to read beyond buffer length")),!(s.length<=a))return O=y(s,a,m,!0),32768&O?-1*(65535-O+1):O}function g(s,a,m,O){if(O||(B(typeof m=="boolean","missing or invalid endian"),B(a!=null,"missing offset"),B(a+3<s.length,"Trying to read beyond buffer length")),!(s.length<=a))return O=S(s,a,m,!0),2147483648&O?-1*(4294967295-O+1):O}function l(s,a,m,O){return O||(B(typeof m=="boolean","missing or invalid endian"),B(a+3<s.length,"Trying to read beyond buffer length")),x.read(s,a,m,23,4)}function u(s,a,m,O){return O||(B(typeof m=="boolean","missing or invalid endian"),B(a+7<s.length,"Trying to read beyond buffer length")),x.read(s,a,m,52,8)}function i(s,a,m,O,I){if(I||(B(a!=null,"missing value"),B(typeof O=="boolean","missing or invalid endian"),B(m!=null,"missing offset"),B(m+1<s.length,"trying to write beyond buffer length"),ue(a,65535)),I=s.length,!(I<=m))for(var j=0,V=Math.min(I-m,2);j<V;j++)s[m+j]=(a&255<<8*(O?j:1-j))>>>8*(O?j:1-j)}function _(s,a,m,O,I){if(I||(B(a!=null,"missing value"),B(typeof O=="boolean","missing or invalid endian"),B(m!=null,"missing offset"),B(m+3<s.length,"trying to write beyond buffer length"),ue(a,4294967295)),I=s.length,!(I<=m))for(var j=0,V=Math.min(I-m,4);j<V;j++)s[m+j]=a>>>8*(O?j:3-j)&255}function T(s,a,m,O,I){I||(B(a!=null,"missing value"),B(typeof O=="boolean","missing or invalid endian"),B(m!=null,"missing offset"),B(m+1<s.length,"Trying to write beyond buffer length"),ae(a,32767,-32768)),s.length<=m||i(s,0<=a?a:65535+a+1,m,O,I)}function U(s,a,m,O,I){I||(B(a!=null,"missing value"),B(typeof O=="boolean","missing or invalid endian"),B(m!=null,"missing offset"),B(m+3<s.length,"Trying to write beyond buffer length"),ae(a,2147483647,-2147483648)),s.length<=m||_(s,0<=a?a:4294967295+a+1,m,O,I)}function k(s,a,m,O,I){I||(B(a!=null,"missing value"),B(typeof O=="boolean","missing or invalid endian"),B(m!=null,"missing offset"),B(m+3<s.length,"Trying to write beyond buffer length"),pn(a,34028234663852886e22,-34028234663852886e22)),s.length<=m||x.write(s,a,m,O,23,4)}function R(s,a,m,O,I){I||(B(a!=null,"missing value"),B(typeof O=="boolean","missing or invalid endian"),B(m!=null,"missing offset"),B(m+7<s.length,"Trying to write beyond buffer length"),pn(a,17976931348623157e292,-17976931348623157e292)),s.length<=m||x.write(s,a,m,O,52,8)}r.Buffer=h,r.SlowBuffer=h,r.INSPECT_MAX_BYTES=50,h.poolSize=8192,h._useTypedArrays=function(){try{var s=new ArrayBuffer(0),a=new Uint8Array(s);return a.foo=function(){return 42},a.foo()===42&&typeof a.subarray=="function"}catch{return!1}}(),h.isEncoding=function(s){switch(String(s).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.isBuffer=function(s){return!(s==null||!s._isBuffer)},h.byteLength=function(s,a){var m;switch(s+="",a||"utf8"){case"hex":m=s.length/2;break;case"utf8":case"utf-8":m=Z(s).length;break;case"ascii":case"binary":case"raw":m=s.length;break;case"base64":m=ve(s).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":m=2*s.length;break;default:throw new Error("Unknown encoding")}return m},h.concat=function(s,a){if(B(H(s),`Usage: Buffer.concat(list, [totalLength])