@oliasoft-open-source/charts-library 5.1.2-beta-2 → 5.1.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.
Files changed (24) hide show
  1. package/dist/assets/{Color-YHDXOIA2-D1T4LLq8.js → Color-YHDXOIA2-CXm47ReI.js} +1 -1
  2. package/dist/assets/{DocsRenderer-CFRXHY34-D6Q7Fl4L.js → DocsRenderer-CFRXHY34-DLpitdoa.js} +3 -3
  3. package/dist/assets/{bar-chart.stories-5CuN6VFG.js → bar-chart.stories-B9kaES0x.js} +1 -1
  4. package/dist/assets/{entry-preview-D2nZ6Uy3.js → entry-preview-C2Hy9tFT.js} +1 -1
  5. package/dist/assets/{get-draggableData-eD2Xdq-6.js → get-draggableData-B9HmP7vM.js} +1 -1
  6. package/dist/assets/{iframe-BRmCfBZj.js → iframe-B41g-Bdk.js} +2 -2
  7. package/dist/assets/{legend-context-PSa8HhGj.js → legend-context-UUIiOgUg.js} +15 -15
  8. package/dist/assets/{legend-Cgq98xea.js → legend-ow0wxTbS.js} +1 -1
  9. package/dist/assets/line-chart-3fkfieVt.js +1 -0
  10. package/dist/assets/{line-chart.stories-yZbOjEZw.js → line-chart.stories-_CoMKB-U.js} +13 -16
  11. package/dist/assets/{line-chart.test-case.stories-KRbhVyto.js → line-chart.test-case.stories-C7ZeDs4F.js} +1 -1
  12. package/dist/assets/{pie-chart.stories-C3l9VGYJ.js → pie-chart.stories-Du7YirB8.js} +1 -1
  13. package/dist/assets/{preview-THptAU8l.js → preview-BAP9gq49.js} +1 -1
  14. package/dist/assets/{preview-OTEdgn42.js → preview-coSInfHn.js} +2 -2
  15. package/dist/assets/{scatter-chart.stories-U-tLziOZ.js → scatter-chart.stories-p8Rbfy00.js} +1 -1
  16. package/dist/iframe.html +1 -1
  17. package/dist/index.js +795 -9
  18. package/dist/line-chart/hooks/use-chart-state.d.ts +5 -1
  19. package/dist/line-chart/utils/axis-scales/axis-scales.d.ts +3 -1
  20. package/dist/line-chart/utils/line-chart-utils.d.ts +1 -6
  21. package/dist/project.json +1 -1
  22. package/dist/src/components/line-chart/utils/line-chart-utils.d.ts +1 -13
  23. package/package.json +3 -1
  24. package/dist/assets/line-chart-DQPiqg-c.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as S}from"./jsx-runtime-W3oueGCa.js";import{r as Me}from"./index-YTOF1_EJ.js";import{g as hr}from"./get-custom-legend-plugin-example-Bx2dNJXg.js";import{h as Gn,w as fr,C as V,g as Zn,x as pr,y as mr,z as Ue,B as k,S as we,E as br,F as xr,A as z,G as Ie,H as Ke,I as vr,T as yr,L as Je,a as _r,J as qn,K as Ar,M as Qe,d as Cr,r as Sr,N as wr,O as Lr,f as Br,P as kr,b as Pr,s as Dr,Q as Tr,R as jr,U as Er,i as Nr,V as Or,W as Mr,j as Ir,k as Rr,X as Hr,p as zr,m as Xr,n as Yr,o as Wr,q as Ur,t as $r}from"./legend-context-PSa8HhGj.js";import{u as Vr,j as Fr,t as Gr,k as Zr,B as qr,l as Kr,H as Jr,L as Qr,m as ea,n as ta}from"./legend-Cgq98xea.js";import{f as et,a as na,b as ra,C as aa,c as sa}from"./get-draggableData-eD2Xdq-6.js";import{D as oa,a as ia}from"./bar-chart-const-Cgj9sgUU.js";import"./index-CgYGpm1H.js";import"./index-DHw5ixvP.js";import"./index-BhTLYoCu.js";var la={value:()=>{}};function Kn(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw new Error("illegal type: "+e);r[e]=[]}return new ke(r)}function ke(e){this._=e}function ca(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}function ua(e,t){for(var n,r=0,s=e.length;r<s;++r)if((n=e[r]).name===t)return n.value}function tt(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=la,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}ke.prototype=Kn.prototype={constructor:ke,on:function(e,t){var n,r=this._,s=ca(e+"",r),a=-1,o=s.length;if(!(arguments.length<2)){if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<o;)if(n=(e=s[a]).type)r[n]=tt(r[n],e.name,t);else if(t==null)for(n in r)r[n]=tt(r[n],e.name,null);return this}for(;++a<o;)if((n=(e=s[a]).type)&&(n=ua(r[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ke(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,s=new Array(n),a=0;a<n;++a)s[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=0,n=(r=this._[e]).length;a<n;++a)r[a].value.apply(t,s)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,a=r.length;s<a;++s)r[s].value.apply(t,n)}};var Re="http://www.w3.org/1999/xhtml",nt={svg:"http://www.w3.org/2000/svg",xhtml:Re,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Jn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),nt.hasOwnProperty(t)?{space:nt[t],local:e}:e}function da(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Re&&t.documentElement.namespaceURI===Re?t.createElement(e):t.createElementNS(n,e)}}function ga(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function rt(e){var t=Jn(e);return(t.local?ga:da)(t)}function ha(){}function at(e){return e==null?ha:function(){return this.querySelector(e)}}function fa(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function pa(){return[]}function st(e){return function(t){return t.matches(e)}}var ma=Array.prototype.find;function ba(){return this.firstElementChild}var xa=Array.prototype.filter;function va(){return Array.from(this.children)}function ot(e){return new Array(e.length)}function Pe(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function ya(e){return function(){return e}}function _a(e,t,n,r,s,a){for(var o,i=0,l=t.length,c=a.length;i<c;++i)(o=t[i])?(o.__data__=a[i],r[i]=o):n[i]=new Pe(e,a[i]);for(;i<l;++i)(o=t[i])&&(s[i]=o)}function Aa(e,t,n,r,s,a,o){var i,l,c,d=new Map,h=t.length,g=a.length,b=new Array(h);for(i=0;i<h;++i)(l=t[i])&&(b[i]=c=o.call(l,l.__data__,i,t)+"",d.has(c)?s[i]=l:d.set(c,l));for(i=0;i<g;++i)c=o.call(e,a[i],i,a)+"",(l=d.get(c))?(r[i]=l,l.__data__=a[i],d.delete(c)):n[i]=new Pe(e,a[i]);for(i=0;i<h;++i)(l=t[i])&&d.get(b[i])===l&&(s[i]=l)}function Ca(e){return e.__data__}function Sa(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function wa(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function La(e){return function(){this.removeAttribute(e)}}function Ba(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ka(e,t){return function(){this.setAttribute(e,t)}}function Pa(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Da(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Ta(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Qn(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ja(e){return function(){this.style.removeProperty(e)}}function Ea(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Na(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Oa(e,t){return e.style.getPropertyValue(t)||Qn(e).getComputedStyle(e,null).getPropertyValue(t)}function Ma(e){return function(){delete this[e]}}function Ia(e,t){return function(){this[e]=t}}function Ra(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function er(e){return e.trim().split(/^|\s+/)}function $e(e){return e.classList||new tr(e)}function tr(e){this._node=e,this._names=er(e.getAttribute("class")||"")}function nr(e,t){for(var n=$e(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function rr(e,t){for(var n=$e(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function Ha(e){return function(){nr(this,e)}}function za(e){return function(){rr(this,e)}}function Xa(e,t){return function(){(t.apply(this,arguments)?nr:rr)(this,e)}}function Ya(){this.textContent=""}function Wa(e){return function(){this.textContent=e}}function Ua(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function $a(){this.innerHTML=""}function Va(e){return function(){this.innerHTML=e}}function Fa(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Ga(){this.nextSibling&&this.parentNode.appendChild(this)}function Za(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function qa(){return null}function Ka(){var e=this.parentNode;e&&e.removeChild(this)}function Ja(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Qa(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function es(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function ts(e){return function(){var t=this.__on;if(t){for(var n,r=0,s=-1,a=t.length;r<a;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++s]=n:this.removeEventListener(n.type,n.listener,n.options);++s?t.length=s:delete this.__on}}}function ns(e,t,n){return function(){var r,s=this.__on,a=function(l){return function(c){l.call(this,c,this.__data__)}}(t);if(s){for(var o=0,i=s.length;o<i;++o)if((r=s[o]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=a,r.options=n),void(r.value=t)}this.addEventListener(e.type,a,n),r={type:e.type,name:e.name,value:t,listener:a,options:n},s?s.push(r):this.__on=[r]}}function ar(e,t,n){var r=Qn(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function rs(e,t){return function(){return ar(this,e,t)}}function as(e,t){return function(){return ar(this,e,t.apply(this,arguments))}}Pe.prototype={constructor:Pe,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}},tr.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var ss=[null];function j(e,t){this._groups=e,this._parents=t}function G(e){return typeof e=="string"?new j([[document.querySelector(e)]],[document.documentElement]):new j([[e]],ss)}function it(e,t){if(e=function(a){let o;for(;o=a.sourceEvent;)a=o;return a}(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}j.prototype={constructor:j,select:function(e){typeof e!="function"&&(e=at(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var a,o,i=t[s],l=i.length,c=r[s]=new Array(l),d=0;d<l;++d)(a=i[d])&&(o=e.call(a,a.__data__,d,i))&&("__data__"in a&&(o.__data__=a.__data__),c[d]=o);return new j(r,this._parents)},selectAll:function(e){e=typeof e=="function"?function(d){return function(){return fa(d.apply(this,arguments))}}(e):function(d){return d==null?pa:function(){return this.querySelectorAll(d)}}(e);for(var t=this._groups,n=t.length,r=[],s=[],a=0;a<n;++a)for(var o,i=t[a],l=i.length,c=0;c<l;++c)(o=i[c])&&(r.push(e.call(o,o.__data__,c,i)),s.push(o));return new j(r,s)},selectChild:function(e){return this.select(e==null?ba:function(t){return function(){return ma.call(this.children,t)}}(typeof e=="function"?e:st(e)))},selectChildren:function(e){return this.selectAll(e==null?va:function(t){return function(){return xa.call(this.children,t)}}(typeof e=="function"?e:st(e)))},filter:function(e){typeof e!="function"&&(e=function(d){return function(){return this.matches(d)}}(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var a,o=t[s],i=o.length,l=r[s]=[],c=0;c<i;++c)(a=o[c])&&e.call(a,a.__data__,c,o)&&l.push(a);return new j(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,Ca);var n=t?Aa:_a,r=this._parents,s=this._groups;typeof e!="function"&&(e=ya(e));for(var a=s.length,o=new Array(a),i=new Array(a),l=new Array(a),c=0;c<a;++c){var d=r[c],h=s[c],g=h.length,b=Sa(e.call(d,d&&d.__data__,c,r)),p=b.length,C=i[c]=new Array(p),w=o[c]=new Array(p),L=l[c]=new Array(g);n(d,h,C,w,L,b,t);for(var P,v,u=0,m=0;u<p;++u)if(P=C[u]){for(u>=m&&(m=u+1);!(v=w[m])&&++m<p;);P._next=v||null}}return(o=new j(o,r))._enter=i,o._exit=l,o},enter:function(){return new j(this._enter||this._groups.map(ot),this._parents)},exit:function(){return new j(this._exit||this._groups.map(ot),this._parents)},join:function(e,t,n){var r=this.enter(),s=this,a=this.exit();return typeof e=="function"?(r=e(r))&&(r=r.selection()):r=r.append(e+""),t!=null&&(s=t(s))&&(s=s.selection()),n==null?a.remove():n(a),r&&s?r.merge(s).order():s},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,a=r.length,o=Math.min(s,a),i=new Array(s),l=0;l<o;++l)for(var c,d=n[l],h=r[l],g=d.length,b=i[l]=new Array(g),p=0;p<g;++p)(c=d[p]||h[p])&&(b[p]=c);for(;l<s;++l)i[l]=n[l];return new j(i,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,s=e[t],a=s.length-1,o=s[a];--a>=0;)(r=s[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(e){function t(h,g){return h&&g?e(h.__data__,g.__data__):!h-!g}e||(e=wa);for(var n=this._groups,r=n.length,s=new Array(r),a=0;a<r;++a){for(var o,i=n[a],l=i.length,c=s[a]=new Array(l),d=0;d<l;++d)(o=i[d])&&(c[d]=o);c.sort(t)}return new j(s,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,a=r.length;s<a;++s){var o=r[s];if(o)return o}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s,a=t[n],o=0,i=a.length;o<i;++o)(s=a[o])&&e.call(s,s.__data__,o,a);return this},attr:function(e,t){var n=Jn(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Ba:La:typeof t=="function"?n.local?Ta:Da:n.local?Pa:ka)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((t==null?ja:typeof t=="function"?Na:Ea)(e,t,n??"")):Oa(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((t==null?Ma:typeof t=="function"?Ra:Ia)(e,t)):this.node()[e]},classed:function(e,t){var n=er(e+"");if(arguments.length<2){for(var r=$e(this.node()),s=-1,a=n.length;++s<a;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?Xa:t?Ha:za)(n,t))},text:function(e){return arguments.length?this.each(e==null?Ya:(typeof e=="function"?Ua:Wa)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(e==null?$a:(typeof e=="function"?Fa:Va)(e)):this.node().innerHTML},raise:function(){return this.each(Ga)},lower:function(){return this.each(Za)},append:function(e){var t=typeof e=="function"?e:rt(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n=typeof e=="function"?e:rt(e),r=t==null?qa:typeof t=="function"?t:at(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(Ka)},clone:function(e){return this.select(e?Qa:Ja)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,s,a=es(e+""),o=a.length;if(!(arguments.length<2)){for(i=t?ns:ts,r=0;r<o;++r)this.each(i(a[r],t,n));return this}var i=this.node().__on;if(i){for(var l,c=0,d=i.length;c<d;++c)for(r=0,l=i[c];r<o;++r)if((s=a[r]).type===l.type&&s.name===l.name)return l.value}},dispatch:function(e,t){return this.each((typeof t=="function"?as:rs)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,s=e[t],a=0,o=s.length;a<o;++a)(r=s[a])&&(yield r)}};const os={passive:!1},F={capture:!0,passive:!1};function Ne(e){e.stopImmediatePropagation()}function U(e){e.preventDefault(),e.stopImmediatePropagation()}var Le=e=>()=>e;function He(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:a,x:o,y:i,dx:l,dy:c,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:i,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}function is(e){return!e.ctrlKey&&!e.button}function ls(){return this.parentNode}function cs(e,t){return t??{x:e.x,y:e.y}}function us(){return navigator.maxTouchPoints||"ontouchstart"in this}function ds(){var e,t,n,r,s=is,a=ls,o=cs,i=us,l={},c=Kn("start","drag","end"),d=0,h=0;function g(u){u.on("mousedown.drag",b).filter(i).on("touchstart.drag",w).on("touchmove.drag",L,os).on("touchend.drag touchcancel.drag",P).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(u,m){if(!r&&s.call(this,u,m)){var f=v(this,a.call(this,u,m),u,m,"mouse");f&&(G(u.view).on("mousemove.drag",p,F).on("mouseup.drag",C,F),function(x){var y=x.document.documentElement,E=G(x).on("dragstart.drag",U,F);"onselectstart"in y?E.on("selectstart.drag",U,F):(y.__noselect=y.style.MozUserSelect,y.style.MozUserSelect="none")}(u.view),Ne(u),n=!1,e=u.clientX,t=u.clientY,f("start",u))}}function p(u){if(U(u),!n){var m=u.clientX-e,f=u.clientY-t;n=m*m+f*f>h}l.mouse("drag",u)}function C(u){G(u.view).on("mousemove.drag mouseup.drag",null),function(m,f){var x=m.document.documentElement,y=G(m).on("dragstart.drag",null);f&&(y.on("click.drag",U,F),setTimeout(function(){y.on("click.drag",null)},0)),"onselectstart"in x?y.on("selectstart.drag",null):(x.style.MozUserSelect=x.__noselect,delete x.__noselect)}(u.view,n),U(u),l.mouse("end",u)}function w(u,m){if(s.call(this,u,m)){var f,x,y=u.changedTouches,E=a.call(this,u,m),M=y.length;for(f=0;f<M;++f)(x=v(this,E,u,m,y[f].identifier,y[f]))&&(Ne(u),x("start",u,y[f]))}}function L(u){var m,f,x=u.changedTouches,y=x.length;for(m=0;m<y;++m)(f=l[x[m].identifier])&&(U(u),f("drag",u,x[m]))}function P(u){var m,f,x=u.changedTouches,y=x.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),m=0;m<y;++m)(f=l[x[m].identifier])&&(Ne(u),f("end",u,x[m]))}function v(u,m,f,x,y,E){var M,R,H,Y=c.copy(),D=it(E||f,m);if((H=o.call(u,new He("beforestart",{sourceEvent:f,target:g,identifier:y,active:d,x:D[0],y:D[1],dx:0,dy:0,dispatch:Y}),x))!=null)return M=H.x-D[0]||0,R=H.y-D[1]||0,function Ge(W,Ze,gr){var Ee,qe=D;switch(W){case"start":l[y]=Ge,Ee=d++;break;case"end":delete l[y],--d;case"drag":D=it(gr||Ze,m),Ee=d}Y.call(W,u,new He(W,{sourceEvent:Ze,subject:H,target:g,identifier:y,active:Ee,x:D[0]+M,y:D[1]+R,dx:D[0]-qe[0],dy:D[1]-qe[1],dispatch:Y}),x)}}return g.filter=function(u){return arguments.length?(s=typeof u=="function"?u:Le(!!u),g):s},g.container=function(u){return arguments.length?(a=typeof u=="function"?u:Le(u),g):a},g.subject=function(u){return arguments.length?(o=typeof u=="function"?u:Le(u),g):o},g.touchable=function(u){return arguments.length?(i=typeof u=="function"?u:Le(!!u),g):i},g.on=function(){var u=c.on.apply(c,arguments);return u===c?g:u},g.clickDistance=function(u){return arguments.length?(h=(u=+u)*u,g):Math.sqrt(h)},g}let T,O,N,I,De,sr,or,ir,$,X,lt;He.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};let ze=!1;function Te(e,t){return isNaN(t)?e:Math.round(e*Math.pow(10,t))/Math.pow(10,t)}function Xe(e,t,n,r,s){let a,o;const i=t.data.datasets[n].data[r];if(e.touches?(a=t.scales[N].getValueForPixel(e.touches[0].clientX-t.canvas.getBoundingClientRect().left),o=t.scales[O].getValueForPixel(e.touches[0].clientY-t.canvas.getBoundingClientRect().top)):(a=t.scales[N].getValueForPixel(e.clientX-t.canvas.getBoundingClientRect().left),o=t.scales[O].getValueForPixel(e.clientY-t.canvas.getBoundingClientRect().top)),a=Te(a,t.config.options.plugins.dragData.round),o=Te(o,t.config.options.plugins.dragData.round),a=a>t.scales[N].max?t.scales[N].max:a,a=a<t.scales[N].min?t.scales[N].min:a,o=o>t.scales[O].max?t.scales[O].max:o,o=o<t.scales[O].min?t.scales[O].min:o,or){let l;return l=t.config.options.indexAxis==="y"?a:o,Math.abs(l-i[0])<=Math.abs(l-i[1])?[l,i[1]]:[i[0],l]}return i.x!==void 0&&t.config.options.plugins.dragData.dragX&&(i.x=a),i.y!==void 0?(t.config.options.plugins.dragData.dragY!==!1&&(i.y=o),i):t.config.options.indexAxis==="y"?a:o}const gs=(e,t,n,r)=>{if(T){$=T.datasetIndex,X=T.index,ze=!0;let s=t.data.datasets[$].data[X];De==="radar"||De==="polarArea"?s=function(a,o){let i,l,c;a.touches?(i=a.touches[0].clientX-o.canvas.getBoundingClientRect().left,l=a.touches[0].clientY-o.canvas.getBoundingClientRect().top):(i=a.clientX-o.canvas.getBoundingClientRect().left,l=a.clientY-o.canvas.getBoundingClientRect().top);let d=o.scales[I],h=Math.sqrt(Math.pow(i-d.xCenter,2)+Math.pow(l-d.yCenter,2)),g=d.drawingArea/(d.max-d.min);return c=d.options.ticks.reverse?d.max-h/g:d.min+h/g,c=Te(c,o.config.options.plugins.dragData.round),c=c>o.scales[I].max?o.scales[I].max:c,c=c<o.scales[I].min?o.scales[I].min:c,c}(e,t):sr?s=Te(Xe(e,t,$,X)-ir,n.round):s=Xe(e,t,$,X),(!r||typeof r=="function"&&r(e,$,X,s)!==!1)&&(t.data.datasets[$].data[X]=s,t.update("none"))}},lr={id:"dragdata",afterInit:function(e){if(e.config.options.plugins&&e.config.options.plugins.dragData){const t=e.config.options.plugins.dragData;G(e.canvas).call(ds().container(e.canvas).on("start",n=>((r,s,a)=>{if(T=s.getElementsAtEventForMode(r,"nearest",{intersect:!0},!1)[0],De=s.config.type,T){let o=T.datasetIndex,i=T.index;lt=function(h){try{return h()}catch{return""}}(()=>s.config.options.plugins.tooltip.animation);const l=s.data.datasets[o],c=s.getDatasetMeta(o);let d=l.data[i];if(N=c.xAxisID,O=c.yAxisID,I=c.rAxisID,l.dragData===!1||s.config.options.scales[N]&&s.config.options.scales[N].dragData===!1||s.config.options.scales[O]&&s.config.options.scales[O].dragData===!1||s.config.options.scales[I]&&s.config.options.scales[I].rAxisID===!1||l.data[T.index].dragData===!1)return void(T=null);if(De==="bar"){sr=s.config.options.scales[N].stacked;const h=s.data.datasets[0].data[0];or=h!==null&&Array.isArray(h)&&h.length==2,ir=Xe(r,s,o,i)-d}(s.config.options.plugins.dragData.showTooltip===void 0||s.config.options.plugins.dragData.showTooltip)&&(s.config.options.plugins.tooltip||(s.config.options.plugins.tooltip={}),s.config.options.plugins.tooltip.animation=!1),typeof a=="function"&&T&&a(r,o,i,d)===!1&&(T=null)}})(n.sourceEvent,e,t.onDragStart)).on("drag",n=>gs(n.sourceEvent,e,t,t.onDrag)).on("end",n=>((r,s,a)=>{if(X=void 0,ze=!1,s.config.options.plugins.tooltip&&(s.config.options.plugins.tooltip.animation=lt,s.update("none")),typeof a=="function"&&T){const o=T.datasetIndex,i=T.index;let l=function(c,d,h){const g=c.config.options.plugins.dragData;if(!g.magnet)return c.data.datasets[d].data[h];{const b=g.magnet;if(b.to&&typeof b.to=="function"){let p=c.data.datasets[d].data[h];return p=b.to(p),c.data.datasets[d].data[h]=p,c.update("none"),p}}}(s,o,i);return a(r,o,i,l)}})(n.sourceEvent,e,t.onDragEnd)))}},beforeEvent:function(e){if(ze)return e.tooltip&&e.tooltip.update(),!1}};Gn.register(lr);const cr=(e,t)=>{var d;const{options:n}=t??{},{interactions:r}=n??{},[s,a]=Me.useState(!1),i=(({datasets:h,options:g})=>{const{annotations:{controlAnnotation:b,showAnnotations:p,annotationsData:C}={}}=g,w=b&&p&&(C!=null&&C.length)?C.map((v,u)=>({isAnnotation:!0,label:v==null?void 0:v.label,annotationIndex:u,backgroundColor:(v==null?void 0:v.color)||V[u],borderColor:(v==null?void 0:v.color)||V[u],data:[],type:fr.Bar})):[],L=[...h,...w];return(L==null?void 0:L.map((v,u)=>{var E;const m=V,f=(E=v==null?void 0:v.data)==null?void 0:E.map(M=>{const R=(h==null?void 0:h.length)>1?u:0;return(m==null?void 0:m[R])||Zn(V)}),x=(v==null?void 0:v.backgroundColor)||(f==null?void 0:f.map(M=>M+pr)),y="borderWidth"in L?{borderWidth:parseFloat(String(L==null?void 0:L.borderWidth))??1}:{};return{...v,...y,borderColor:(v==null?void 0:v.borderColor)||(f==null?void 0:f[u]),backgroundColor:x}}))||[]})({datasets:(d=t==null?void 0:t.data)==null?void 0:d.datasets,options:n}),l=(h,g,b)=>{b.resetZoom()},c=(h,g)=>{if(s&&!(g!=null&&g.length)&&(a(!1),r!=null&&r.onUnhover&&(r==null||r.onUnhover(h))),!s&&(g!=null&&g.length)&&(a(!0),r.onHover)){const{index:b,datasetIndex:p}=(g==null?void 0:g[0])??{},C=i;r==null||r.onHover(h,p,b,C)}};return Me.useMemo(()=>({generatedDatasets:i,onClick:l,onHover:c}),[e,t])},hs=(e,{stacked:t,stackedX:n,stackedY:r})=>e===k.X?n??t:e===k.Y?r??t:t,Ye=({chart:e,axisType:t=k.X,currentScale:n,i:r})=>{var b,p,C,w,L,P,v,u,m;const{data:s,options:a}=e??{},o=Ue(a.direction),i=n||((p=(b=a==null?void 0:a.axes)==null?void 0:b[t])==null?void 0:p[0]),l=o&&t===k.Y||!o&&t===k.X,c=(i==null?void 0:i.gridLines)||{},d=()=>{var y;const f=s.labels?we.Category:we.Linear,x=o?k.X:k.Y;return t===x?f:(y=a==null?void 0:a.additionalAxesOptions)==null?void 0:y.chartScaleType},h=()=>{var x;const f=o?k.Y:k.X;return t===f?(x=a==null?void 0:a.additionalAxesOptions)==null?void 0:x.reverse:!1},g=()=>{var H,Y;const f=a==null?void 0:a.additionalAxesOptions,x=(Y=(H=a==null?void 0:a.scales)==null?void 0:H[`${r===0?t:t+r}`])==null?void 0:Y.ticks,y=l&&(f==null?void 0:f.chartScaleType)===we.Logarithmic,E=(D,Ge,W)=>y?xr.includes(Number(D))?et(D,W):"":et(D,W),R={...y?{}:{stepSize:i.stepSize??(t===k.Y?f==null?void 0:f.stepSize:null)},includeBounds:!1,...x,font:{size:br}};return(f==null?void 0:f.chartScaleType)===we.Logarithmic&&(R.callback=E),R};return{type:d(),position:i==null?void 0:i.position,beginAtZero:(C=a==null?void 0:a.additionalAxesOptions)==null?void 0:C.beginAtZero,reverse:h(),suggestedMax:(w=a==null?void 0:a.additionalAxesOptions)==null?void 0:w.suggestedMax,suggestedMin:(L=a==null?void 0:a.additionalAxesOptions)==null?void 0:L.suggestedMin,min:l?(P=a==null?void 0:a.additionalAxesOptions)==null?void 0:P.min:void 0,max:l?(v=a==null?void 0:a.additionalAxesOptions)==null?void 0:v.max:void 0,title:{display:((u=i==null?void 0:i.label)==null?void 0:u.length)||((m=i==null?void 0:i.unit)==null?void 0:m.length),text:(i==null?void 0:i.label)||(i==null?void 0:i.unit),padding:0},ticks:g(),grid:{...c},stacked:hs(t,a==null?void 0:a.additionalAxesOptions)}},ct=(e,t)=>{var s,a;return(((a=(s=e==null?void 0:e.options)==null?void 0:s.axes)==null?void 0:a[t])||[]).reduce((o,i,l)=>{const c=i,d=i.color||V[l]||Zn(V);c.color=d,c.position=i.position||mr(t,l);const h=Ye({chart:e,axisType:t,currentScale:c}),g=l===0?t:`${t}${l+1}`;return{...o,[g]:h}},{})},fs=e=>{var a,o;const t=((a=e.options.axes.x)==null?void 0:a.length)>1,n=((o=e.options.axes.y)==null?void 0:o.length)>1,r=t?ct(e,k.X):{x:Ye({chart:e,axisType:k.X})},s=n?ct(e,k.Y):{y:Ye({chart:e,axisType:k.Y})};return{...r,...s}},ps=e=>{var o;const{beginAtZero:t,reverse:n}=(e==null?void 0:e.additionalAxesOptions)||{},r=(i,l)=>{const{datasetIndex:c,dataIndex:d}=l,g=l.chart.data.datasets[c].data[d];let b="";if(typeof g=="number"&&(b=Number.isInteger(g)?g:g.toFixed(2)),Array.isArray(g))if(g.length===2){const p=g[1]-g[0];b=p<0?Ke(p,2):`+${Ke(p,2)}`}else b=g.reduce((p,C,w)=>w===0?`${p} ${C}`:`${p}, ${C}`,"");return b},s=n?z.End:z.Start,a=n?z.Start:z.End;return(o=e==null?void 0:e.graph)!=null&&o.showDataLabels?{display:Ie,align:t?z.Center:s,anchor:t?z.Center:a,formatter:r}:{display:!1}},ms=e=>{var a;const t=o=>{var C,w;const i=Ue(e.direction),l=Array.isArray((C=e.axes)==null?void 0:C.x)?e.axes.x:[],c=Array.isArray((w=e.axes)==null?void 0:w.y)?e.axes.y:[],d=L=>{if(!L)return 0;const P=L.match(/\d+$/);return P?parseInt(P[0],10)-1:0},h=d(o==null?void 0:o.xAxisID),g=d(o==null?void 0:o.yAxisID),b=i?l[h]:c[g],p=i?c[g]:l[h];return{titleAxisLabel:(b==null?void 0:b.label)||"",valueAxisLabel:(p==null?void 0:p.label)||"",titleLabel:Qe.X,valueLabel:Qe.Y,titleUnit:(b==null?void 0:b.unit)||"",valueUnit:(p==null?void 0:p.unit)||""}},n=(o,i)=>{var b,p;const l=((b=o==null?void 0:o[0])==null?void 0:b.label)||"",c=t((p=o==null?void 0:o[0])==null?void 0:p.dataset),{titleAxisLabel:d,titleUnit:h}=c;return(!d&&!h?"":`${d||h}: `)+l},r=o=>{var l;let i={};return(l=e==null?void 0:e.tooltip)!=null&&l.scientificNotation?(Math.abs(o)<oa||Math.abs(o)>ia)&&(i={roundScientificCoefficient:3}):i={scientific:!1},Cr(Sr(o),i)},s=o=>{var P;const{showLabelsInTooltips:i=!1}=(e==null?void 0:e.tooltip)||{};let l=((P=o.dataset)==null?void 0:P.label)||"";const c=t(o.dataset),{valueUnit:d,valueAxisLabel:h}=c,g=()=>{const v=o==null?void 0:o.raw,u=typeof v=="number"?r(v):"";let m="";return typeof o.raw=="number"&&(m=u),Array.isArray(o.raw)?m=o.raw.reduce((f,x,y)=>y===0?`${f} ${x}`:`${f}, ${x}`,""):typeof o.raw=="object"&&(m=u),m},b=l===h||h.includes(l),p=g(),C=d?`[${d}] `:"",w=b?"":h,L=Ar(o,i);return`${l}: ${p} ${C}${w}${L}`};return{enabled:(a=e==null?void 0:e.tooltip)==null?void 0:a.tooltips,mode:qn.Nearest,intersect:!0,padding:_r,boxWidth:Je,boxHeight:Je,boxPadding:yr,callbacks:{title:n,label:s,afterLabel:vr}}},bs=({chart:e,chartRef:t})=>{const{options:n}=e,{chartStyling:r,dragData:s}=n,{state:a}=Vr(),{annotation:o}=a,{onClick:i,onHover:l}=cr(t,e),{legend:c,customLegendPlugin:d}=Fr({chartRef:t,options:n});return{onClick:i,onHover:l,indexAxis:Ue(n.direction)?k.X:k.Y,maintainAspectRatio:r.maintainAspectRatio,animation:r.performanceMode&&{duration:Br.FAST},hover:{mode:qn.Nearest,intersect:!0},scales:fs(e),plugins:{title:Lr(n),datalabels:ps(n),annotation:Gr(o),tooltip:ms(n),legend:{...c,display:!1,events:[]},customLegendPlugin:d,chartAreaBorder:{borderColor:wr},dragData:(s==null?void 0:s.enableDragData)&&na(n)}}},xs="_chart_x1sru_1",vs="_canvas_x1sru_10",ys="_fixedHeight_x1sru_19",_s="_stretchHeight_x1sru_25",As="_actions_x1sru_57",Oe={chart:xs,canvas:vs,fixedHeight:ys,stretchHeight:_s,actions:As},Cs=e=>({x:(e==null?void 0:e.x)||[{}],y:(e==null?void 0:e.y)||[{}]}),Ss=e=>({chartScaleType:(e==null?void 0:e.chartScaleType)||"linear",reverse:(e==null?void 0:e.reverse)||!1,stacked:(e==null?void 0:e.stacked)||!1,beginAtZero:(e==null?void 0:e.beginAtZero)??!0,stepSize:e==null?void 0:e.stepSize,suggestedMin:e==null?void 0:e.suggestedMin,suggestedMax:e==null?void 0:e.suggestedMax,min:e==null?void 0:e.min,max:e==null?void 0:e.max,stackedX:e==null?void 0:e.stackedX,stackedY:e==null?void 0:e.stackedY}),ws=e=>({width:e==null?void 0:e.width,height:e==null?void 0:e.height,maintainAspectRatio:(e==null?void 0:e.maintainAspectRatio)||!1,staticChartHeight:(e==null?void 0:e.staticChartHeight)||!1,performanceMode:(e==null?void 0:e.performanceMode)??!0}),Ls=e=>({tooltips:(e==null?void 0:e.tooltips)??!0,showLabelsInTooltips:(e==null?void 0:e.showLabelsInTooltips)||!1,scientificNotation:(e==null?void 0:e.scientificNotation)??!0}),Bs=e=>({showDataLabels:(e==null?void 0:e.showDataLabels)||!1,showMinorGridlines:(e==null?void 0:e.showMinorGridlines)||!1}),ks=e=>e?e.map(t=>({...t,display:(t==null?void 0:t.display)??!0})):[],Ps=e=>({showAnnotations:(e==null?void 0:e.showAnnotations)??!0,controlAnnotation:(e==null?void 0:e.controlAnnotation)||!1,annotationsData:ks(e==null?void 0:e.annotationsData)}),Ds=e=>({display:(e==null?void 0:e.display)??!0,position:(e==null?void 0:e.position)||kr.TopLeft,align:(e==null?void 0:e.align)||z.Center,customLegend:(e==null?void 0:e.customLegend)||{customLegendPlugin:null,customLegendContainerID:""}}),Ts=e=>({enableZoom:(e==null?void 0:e.enableZoom)||!1,enablePan:(e==null?void 0:e.enablePan)||!1}),js=e=>({onLegendClick:e==null?void 0:e.onLegendClick,onHover:e==null?void 0:e.onHover,onUnhover:e==null?void 0:e.onUnhover}),Es=e=>({enableDragData:(e==null?void 0:e.enableDragData)??!1,showTooltip:(e==null?void 0:e.showTooltip)??!0,roundPoints:(e==null?void 0:e.roundPoints)??!0,dragX:(e==null?void 0:e.dragX)??!0,dragY:(e==null?void 0:e.dragY)??!0,onDragStart:e==null?void 0:e.onDragStart,onDrag:e==null?void 0:e.onDrag,onDragEnd:e==null?void 0:e.onDragEnd}),ur=e=>{const t=(e==null?void 0:e.chart)||{},n=(t==null?void 0:t.options)||{};return{testId:(t==null?void 0:t.testId)??"",controlsPortalId:(t==null?void 0:t.controlsPortalId)??"",data:t==null?void 0:t.data,options:{title:(n==null?void 0:n.title)||"",direction:(n==null?void 0:n.direction)||"vertical",axes:Cs(n==null?void 0:n.axes),additionalAxesOptions:Ss(n==null?void 0:n.additionalAxesOptions),chartStyling:ws(n==null?void 0:n.chartStyling),tooltip:Ls(n==null?void 0:n.tooltip),graph:Bs(n==null?void 0:n.graph),annotations:Ps(n==null?void 0:n.annotations),legend:Ds(n==null?void 0:n.legend),chartOptions:Ts(n==null?void 0:n.chartOptions),interactions:js(n==null?void 0:n.interactions),dragData:Es(n==null?void 0:n.dragData)}}};Gn.register(Nr,Or,Mr,Ir,Rr,Hr,zr,Xr,Yr,Wr,Ur,$r,ta,lr);const Ns=e=>{var b,p,C,w;Dr();const t=Me.useRef(null),n=ur(e),{translations:r,languageKey:s}=ra(),{options:a,testId:o,controlsPortalId:i}=n,{chartStyling:l,graph:c}=a,{generatedDatasets:d}=cr(t,n),h=bs({chart:n,chartRef:t}),g=!((p=(b=a==null?void 0:a.legend)==null?void 0:b.customLegend)!=null&&p.customLegendContainerID);return S.jsxs("div",{className:Tr(l,Oe),style:{width:l.width||Ie,height:l.height||Ie},"data-testid":o,children:[S.jsx(aa,{controlsPortalId:i,children:S.jsx("div",{className:Oe.actions,children:S.jsx(Zr,{text:r.downloadAsPNG,placement:"bottom-end",children:S.jsx(qr,{small:!0,basic:!0,colored:"muted",round:!0,icon:"download",onClick:()=>sa(t)})})})}),S.jsx(Kr,{backend:Jr,context:window,children:S.jsxs("div",{className:Oe.canvas,id:"canvas",children:[S.jsx(jr,{ref:t,data:{labels:(w=(C=n==null?void 0:n.data)==null?void 0:C.labels)!=null&&w.length?n.data.labels:[""],datasets:d},options:h,plugins:Er(c,a.legend)}),g&&!!d.length&&S.jsx(Qr,{chartRef:t,legendConfig:{options:a,generatedDatasets:d,chartType:ea.BAR}})]})})]},s)},Se=e=>{const{options:t}=ur(e);return S.jsx(Pr,{options:t,children:S.jsx(Ns,{...e})})};Se.__docgenInfo={description:"",methods:[],displayName:"BarChartWithLegend",props:{chart:{required:!0,tsType:{name:"IBarChartData"},description:""}}};const A=["United Kingdom","Norway","France"],B={label:"Cats",data:[3.12,8,7]},Ve={label:"Dogs",data:[1,2,3]},dr={label:"Parrots",data:[5,0,4]},Os={label:"Cats",data:[3,8,7],yAxisID:"y"},Ms={label:"Dogs",data:[1,2,3],yAxisID:"y2"},Is={label:"Parrots",data:[5,0,4],yAxisID:"y2"},Rs={label:"Cats",data:[3,8,7],stack:1},Hs={label:"Dogs",data:[1,2,3],stack:1},zs={label:"Parrots",data:[5,0,4],stack:2},ut={label:"Cats",data:[1e3,2e3,3e3],stack:1},Xs={label:"Dogs",data:[4e3,5e3,6e3],stack:1},je={label:"Cats",data:[42,57,64]},Ys={label:"Cats",data:[210,333,248]},Ws={label:"Income",data:[100,[100,120],[120,130],[130,80],80],backgroundColor:["lightGray","lightGreen","lightGreen","pink","lightGray"]},Fe={data:{labels:A,datasets:[B]}},Us={data:{labels:A,datasets:[{...B,label:"Men",backgroundColor:"lightblue"},{...Ve,label:"Women",backgroundColor:"pink"}]}},$s={data:{labels:A,datasets:[{...B,backgroundColor:["gray","red","gray"]}]}},Vs={data:{labels:A,datasets:[B,Ve,dr]}},Fs={data:{labels:A,datasets:[B,Ve,dr]},options:{title:"Stacked",additionalAxesOptions:{stacked:!0}}},Gs={data:{labels:A,datasets:[Os,Ms,Is]},options:{title:"Multiple y axes",axes:{y:[{},{gridLines:{drawOnChartArea:!1}}]}}},Zs={data:{labels:A,datasets:[Rs,Hs,zs]},options:{title:"Grouped stacked",additionalAxesOptions:{stacked:!0}}},qs={data:{labels:A,datasets:[B]},options:{title:"reversed vertical",additionalAxesOptions:{reverse:!0}}},Ks={data:{labels:A,datasets:[B]},options:{title:"horizontal",direction:"horizontal"}},Js={data:{labels:A,datasets:[B]},options:{title:"reversed horizontal",direction:"horizontal",additionalAxesOptions:{reverse:!0}}},Qs={data:{labels:A,datasets:[B]},options:{title:"With axes labels",axes:{x:[{label:"Country"}],y:[{label:"Number of pets"}]}}},eo={data:{labels:A,datasets:[B]},options:{title:["x axis on top","y axis on right"],axes:{x:[{position:"top"}],y:[{position:"right"}]}}},to={data:{labels:A,datasets:[B]},options:{title:"Not beginning at zero",additionalAxesOptions:{beginAtZero:!1}}},no={data:{labels:A,datasets:[B]},options:{title:"With step size of 2",additionalAxesOptions:{stepSize:2}}},ro={data:{labels:A,datasets:[B]},options:{title:"With suggested range",additionalAxesOptions:{beginAtZero:!1,suggestedMin:2,suggestedMax:12}}},ao={data:{labels:A,datasets:[B]},options:{title:"With logarithmic scale",additionalAxesOptions:{chartScaleType:"logarithmic"}}},so={data:{labels:A,datasets:[Ys]},options:{title:"With value as datalabels",graph:{showDataLabels:!0}}},oo={data:{labels:A,datasets:[{...B,backgroundColor:"rgba(255, 99, 132, 0.2)",borderColor:"black",borderWidth:1}]}},io={data:{labels:A,datasets:[je]},options:{title:"Annotation Y Axis",annotations:{showAnnotations:!0,annotationsData:[{annotationAxis:"y",label:"Horizontal Annotation",value:53,color:"rgba(96, 32, 196, 0.5)"}]}}},lo={data:{labels:A,datasets:[je]},options:{title:"Annotation X Axis",annotations:{showAnnotations:!0,annotationsData:[{annotationAxis:"x",label:"Vertical Annotation",value:.5,color:"green"}]}}},co={data:{labels:A,datasets:[je]},options:{title:"Diagonal Annotation",annotations:{showAnnotations:!0,annotationsData:[{annotationAxis:"y",label:"Diagonal Annotation",value:40,endValue:67,color:"rgba(123, 16, 32, 0.8)"}]}}},uo={data:{labels:A,datasets:[je]},options:{title:"Control annotations in legend",annotations:{showAnnotations:!0,controlAnnotation:!0,annotationsData:[{annotationAxis:"y",label:"Diagonal Annotation",value:40,endValue:67,color:"rgba(123, 16, 32, 0.8)"},{annotationAxis:"y",label:"Horizontal Annotation",value:53,color:"rgba(96, 32, 196, 0.5)"}]}}},go={data:{labels:A,datasets:[B]},options:{title:"Legend to the right",legend:{position:"right"}}},ho={data:{labels:A,datasets:[B]},options:{chartStyling:{performanceMode:!1}}},fo={data:{labels:A,datasets:[B]},options:{dragData:{enableDragData:!0,showTooltip:!0,roundPoints:!0,onDragStart:(e,t)=>{},onDrag:(e,t,n,r)=>{},onDragEnd:(e,t,n,r)=>{}}}},po={data:{labels:A,datasets:[ut,ut,Xs]}},mo={data:{labels:["Week 1","Week 2","Week 3","Week 4","Week 5","Week 6"],datasets:[{label:"Budget Sales",data:[200,1e3,800,700,900,1600],backgroundColor:"rgba(128, 128, 128, 0.5)",borderColor:"rgba(128, 128, 128, 1)",barThickness:40},{label:"Actual Sales",data:[300,600,400,500,700,1200],backgroundColor:"rgba(64, 64, 64, 0.5)",borderColor:"rgba(64, 64, 64, 1)",barThickness:60},{label:"Units",data:[20,40,30,50,70,90],type:"line",backgroundColor:"rgba(255, 165, 0, 0.5)",borderColor:"rgba(255, 165, 0, 1)",yAxisID:"y-axis-units"}]},options:{title:"Specific axis stacked",additionalAxesOptions:{stackedX:!0,stackedY:!1}}},bo={data:{labels:["original","change 1","change 2","change 3","result"],datasets:[Ws]},options:{title:"Waterfall chart",graph:{showDataLabels:!0}}},Po={title:"BarChart",component:Se,args:{chart:Fe}},_=e=>S.jsx(Se,{...e}),We="custom-legend-container",xo=e=>S.jsxs(S.Fragment,{children:[S.jsx(Se,{...e}),S.jsx("div",{id:We})]}),Be=_.bind({}),Z=_.bind({});Z.args={chart:Us};const q=_.bind({});q.args={chart:$s};const K=_.bind({});K.args={chart:Vs};const J=_.bind({});J.args={chart:Fs};const Q=_.bind({});Q.args={chart:Zs};const ee=_.bind({});ee.args={chart:Gs};const te=_.bind({});te.args={chart:Ks};const ne=_.bind({});ne.args={chart:qs};const re=_.bind({});re.args={chart:Js};const ae=_.bind({});ae.args={chart:Qs};const se=_.bind({});se.args={chart:eo};const oe=_.bind({});oe.args={chart:to};const ie=_.bind({});ie.args={chart:ro};const le=_.bind({});le.args={chart:no};const ce=_.bind({});ce.args={chart:ao};const ue=_.bind({});ue.args={chart:so};const de=_.bind({});de.args={chart:go};const ge=_.bind({});ge.args={chart:oo};const he=_.bind({});he.args={chart:io};const fe=_.bind({});fe.args={chart:lo};const pe=_.bind({});pe.args={chart:co};const me=_.bind({});me.args={chart:uo};const be=_.bind({});be.args={chart:ho};const xe=xo.bind({});xe.args={chart:{...Fe,options:{title:"Custom HTML legend",legend:{customLegend:{customLegendPlugin:hr(We),customLegendContainerID:We}}}}};const ve=_.bind({});ve.args={chart:fo};const ye=_.bind({});ye.args={chart:po};const _e=_.bind({});_e.args={chart:mo};const Ae=_.bind({});Ae.args={chart:bo};const Ce=()=>{const e="controls-portal-container";return S.jsxs(S.Fragment,{children:[S.jsxs("div",{style:{padding:20,border:"1px solid red"},children:["This div is outside the BarChart component",S.jsx("div",{id:e})]}),S.jsx(Se,{chart:{...Fe,controlsPortalId:e}})]})};Ce.__docgenInfo={description:"",methods:[],displayName:"ControlsPortal"};var dt,gt,ht;Be.parameters={...Be.parameters,docs:{...(dt=Be.parameters)==null?void 0:dt.docs,source:{originalSource:`args => {
1
+ import{j as S}from"./jsx-runtime-W3oueGCa.js";import{r as Me}from"./index-YTOF1_EJ.js";import{g as hr}from"./get-custom-legend-plugin-example-Bx2dNJXg.js";import{h as Gn,w as fr,C as V,g as Zn,x as pr,y as mr,z as Ue,B as k,S as we,E as br,F as xr,A as z,G as Ie,H as Ke,I as vr,T as yr,L as Je,a as _r,J as qn,K as Ar,M as Qe,d as Cr,r as Sr,N as wr,O as Lr,f as Br,P as kr,b as Pr,s as Dr,Q as Tr,R as jr,U as Er,i as Nr,V as Or,W as Mr,j as Ir,k as Rr,X as Hr,p as zr,m as Xr,n as Yr,o as Wr,q as Ur,t as $r}from"./legend-context-UUIiOgUg.js";import{u as Vr,j as Fr,t as Gr,k as Zr,B as qr,l as Kr,H as Jr,L as Qr,m as ea,n as ta}from"./legend-ow0wxTbS.js";import{f as et,a as na,b as ra,C as aa,c as sa}from"./get-draggableData-B9HmP7vM.js";import{D as oa,a as ia}from"./bar-chart-const-Cgj9sgUU.js";import"./index-CgYGpm1H.js";import"./index-DHw5ixvP.js";import"./index-BhTLYoCu.js";var la={value:()=>{}};function Kn(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw new Error("illegal type: "+e);r[e]=[]}return new ke(r)}function ke(e){this._=e}function ca(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}function ua(e,t){for(var n,r=0,s=e.length;r<s;++r)if((n=e[r]).name===t)return n.value}function tt(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=la,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}ke.prototype=Kn.prototype={constructor:ke,on:function(e,t){var n,r=this._,s=ca(e+"",r),a=-1,o=s.length;if(!(arguments.length<2)){if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<o;)if(n=(e=s[a]).type)r[n]=tt(r[n],e.name,t);else if(t==null)for(n in r)r[n]=tt(r[n],e.name,null);return this}for(;++a<o;)if((n=(e=s[a]).type)&&(n=ua(r[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ke(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,s=new Array(n),a=0;a<n;++a)s[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=0,n=(r=this._[e]).length;a<n;++a)r[a].value.apply(t,s)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,a=r.length;s<a;++s)r[s].value.apply(t,n)}};var Re="http://www.w3.org/1999/xhtml",nt={svg:"http://www.w3.org/2000/svg",xhtml:Re,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Jn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),nt.hasOwnProperty(t)?{space:nt[t],local:e}:e}function da(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Re&&t.documentElement.namespaceURI===Re?t.createElement(e):t.createElementNS(n,e)}}function ga(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function rt(e){var t=Jn(e);return(t.local?ga:da)(t)}function ha(){}function at(e){return e==null?ha:function(){return this.querySelector(e)}}function fa(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function pa(){return[]}function st(e){return function(t){return t.matches(e)}}var ma=Array.prototype.find;function ba(){return this.firstElementChild}var xa=Array.prototype.filter;function va(){return Array.from(this.children)}function ot(e){return new Array(e.length)}function Pe(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function ya(e){return function(){return e}}function _a(e,t,n,r,s,a){for(var o,i=0,l=t.length,c=a.length;i<c;++i)(o=t[i])?(o.__data__=a[i],r[i]=o):n[i]=new Pe(e,a[i]);for(;i<l;++i)(o=t[i])&&(s[i]=o)}function Aa(e,t,n,r,s,a,o){var i,l,c,d=new Map,h=t.length,g=a.length,b=new Array(h);for(i=0;i<h;++i)(l=t[i])&&(b[i]=c=o.call(l,l.__data__,i,t)+"",d.has(c)?s[i]=l:d.set(c,l));for(i=0;i<g;++i)c=o.call(e,a[i],i,a)+"",(l=d.get(c))?(r[i]=l,l.__data__=a[i],d.delete(c)):n[i]=new Pe(e,a[i]);for(i=0;i<h;++i)(l=t[i])&&d.get(b[i])===l&&(s[i]=l)}function Ca(e){return e.__data__}function Sa(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function wa(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function La(e){return function(){this.removeAttribute(e)}}function Ba(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ka(e,t){return function(){this.setAttribute(e,t)}}function Pa(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Da(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Ta(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Qn(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ja(e){return function(){this.style.removeProperty(e)}}function Ea(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Na(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Oa(e,t){return e.style.getPropertyValue(t)||Qn(e).getComputedStyle(e,null).getPropertyValue(t)}function Ma(e){return function(){delete this[e]}}function Ia(e,t){return function(){this[e]=t}}function Ra(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function er(e){return e.trim().split(/^|\s+/)}function $e(e){return e.classList||new tr(e)}function tr(e){this._node=e,this._names=er(e.getAttribute("class")||"")}function nr(e,t){for(var n=$e(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function rr(e,t){for(var n=$e(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function Ha(e){return function(){nr(this,e)}}function za(e){return function(){rr(this,e)}}function Xa(e,t){return function(){(t.apply(this,arguments)?nr:rr)(this,e)}}function Ya(){this.textContent=""}function Wa(e){return function(){this.textContent=e}}function Ua(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function $a(){this.innerHTML=""}function Va(e){return function(){this.innerHTML=e}}function Fa(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Ga(){this.nextSibling&&this.parentNode.appendChild(this)}function Za(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function qa(){return null}function Ka(){var e=this.parentNode;e&&e.removeChild(this)}function Ja(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Qa(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function es(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function ts(e){return function(){var t=this.__on;if(t){for(var n,r=0,s=-1,a=t.length;r<a;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++s]=n:this.removeEventListener(n.type,n.listener,n.options);++s?t.length=s:delete this.__on}}}function ns(e,t,n){return function(){var r,s=this.__on,a=function(l){return function(c){l.call(this,c,this.__data__)}}(t);if(s){for(var o=0,i=s.length;o<i;++o)if((r=s[o]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=a,r.options=n),void(r.value=t)}this.addEventListener(e.type,a,n),r={type:e.type,name:e.name,value:t,listener:a,options:n},s?s.push(r):this.__on=[r]}}function ar(e,t,n){var r=Qn(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function rs(e,t){return function(){return ar(this,e,t)}}function as(e,t){return function(){return ar(this,e,t.apply(this,arguments))}}Pe.prototype={constructor:Pe,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}},tr.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var ss=[null];function j(e,t){this._groups=e,this._parents=t}function G(e){return typeof e=="string"?new j([[document.querySelector(e)]],[document.documentElement]):new j([[e]],ss)}function it(e,t){if(e=function(a){let o;for(;o=a.sourceEvent;)a=o;return a}(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}j.prototype={constructor:j,select:function(e){typeof e!="function"&&(e=at(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var a,o,i=t[s],l=i.length,c=r[s]=new Array(l),d=0;d<l;++d)(a=i[d])&&(o=e.call(a,a.__data__,d,i))&&("__data__"in a&&(o.__data__=a.__data__),c[d]=o);return new j(r,this._parents)},selectAll:function(e){e=typeof e=="function"?function(d){return function(){return fa(d.apply(this,arguments))}}(e):function(d){return d==null?pa:function(){return this.querySelectorAll(d)}}(e);for(var t=this._groups,n=t.length,r=[],s=[],a=0;a<n;++a)for(var o,i=t[a],l=i.length,c=0;c<l;++c)(o=i[c])&&(r.push(e.call(o,o.__data__,c,i)),s.push(o));return new j(r,s)},selectChild:function(e){return this.select(e==null?ba:function(t){return function(){return ma.call(this.children,t)}}(typeof e=="function"?e:st(e)))},selectChildren:function(e){return this.selectAll(e==null?va:function(t){return function(){return xa.call(this.children,t)}}(typeof e=="function"?e:st(e)))},filter:function(e){typeof e!="function"&&(e=function(d){return function(){return this.matches(d)}}(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var a,o=t[s],i=o.length,l=r[s]=[],c=0;c<i;++c)(a=o[c])&&e.call(a,a.__data__,c,o)&&l.push(a);return new j(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,Ca);var n=t?Aa:_a,r=this._parents,s=this._groups;typeof e!="function"&&(e=ya(e));for(var a=s.length,o=new Array(a),i=new Array(a),l=new Array(a),c=0;c<a;++c){var d=r[c],h=s[c],g=h.length,b=Sa(e.call(d,d&&d.__data__,c,r)),p=b.length,C=i[c]=new Array(p),w=o[c]=new Array(p),L=l[c]=new Array(g);n(d,h,C,w,L,b,t);for(var P,v,u=0,m=0;u<p;++u)if(P=C[u]){for(u>=m&&(m=u+1);!(v=w[m])&&++m<p;);P._next=v||null}}return(o=new j(o,r))._enter=i,o._exit=l,o},enter:function(){return new j(this._enter||this._groups.map(ot),this._parents)},exit:function(){return new j(this._exit||this._groups.map(ot),this._parents)},join:function(e,t,n){var r=this.enter(),s=this,a=this.exit();return typeof e=="function"?(r=e(r))&&(r=r.selection()):r=r.append(e+""),t!=null&&(s=t(s))&&(s=s.selection()),n==null?a.remove():n(a),r&&s?r.merge(s).order():s},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,a=r.length,o=Math.min(s,a),i=new Array(s),l=0;l<o;++l)for(var c,d=n[l],h=r[l],g=d.length,b=i[l]=new Array(g),p=0;p<g;++p)(c=d[p]||h[p])&&(b[p]=c);for(;l<s;++l)i[l]=n[l];return new j(i,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,s=e[t],a=s.length-1,o=s[a];--a>=0;)(r=s[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(e){function t(h,g){return h&&g?e(h.__data__,g.__data__):!h-!g}e||(e=wa);for(var n=this._groups,r=n.length,s=new Array(r),a=0;a<r;++a){for(var o,i=n[a],l=i.length,c=s[a]=new Array(l),d=0;d<l;++d)(o=i[d])&&(c[d]=o);c.sort(t)}return new j(s,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,a=r.length;s<a;++s){var o=r[s];if(o)return o}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s,a=t[n],o=0,i=a.length;o<i;++o)(s=a[o])&&e.call(s,s.__data__,o,a);return this},attr:function(e,t){var n=Jn(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Ba:La:typeof t=="function"?n.local?Ta:Da:n.local?Pa:ka)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((t==null?ja:typeof t=="function"?Na:Ea)(e,t,n??"")):Oa(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((t==null?Ma:typeof t=="function"?Ra:Ia)(e,t)):this.node()[e]},classed:function(e,t){var n=er(e+"");if(arguments.length<2){for(var r=$e(this.node()),s=-1,a=n.length;++s<a;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?Xa:t?Ha:za)(n,t))},text:function(e){return arguments.length?this.each(e==null?Ya:(typeof e=="function"?Ua:Wa)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(e==null?$a:(typeof e=="function"?Fa:Va)(e)):this.node().innerHTML},raise:function(){return this.each(Ga)},lower:function(){return this.each(Za)},append:function(e){var t=typeof e=="function"?e:rt(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n=typeof e=="function"?e:rt(e),r=t==null?qa:typeof t=="function"?t:at(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(Ka)},clone:function(e){return this.select(e?Qa:Ja)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,s,a=es(e+""),o=a.length;if(!(arguments.length<2)){for(i=t?ns:ts,r=0;r<o;++r)this.each(i(a[r],t,n));return this}var i=this.node().__on;if(i){for(var l,c=0,d=i.length;c<d;++c)for(r=0,l=i[c];r<o;++r)if((s=a[r]).type===l.type&&s.name===l.name)return l.value}},dispatch:function(e,t){return this.each((typeof t=="function"?as:rs)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,s=e[t],a=0,o=s.length;a<o;++a)(r=s[a])&&(yield r)}};const os={passive:!1},F={capture:!0,passive:!1};function Ne(e){e.stopImmediatePropagation()}function U(e){e.preventDefault(),e.stopImmediatePropagation()}var Le=e=>()=>e;function He(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:a,x:o,y:i,dx:l,dy:c,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:i,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}function is(e){return!e.ctrlKey&&!e.button}function ls(){return this.parentNode}function cs(e,t){return t??{x:e.x,y:e.y}}function us(){return navigator.maxTouchPoints||"ontouchstart"in this}function ds(){var e,t,n,r,s=is,a=ls,o=cs,i=us,l={},c=Kn("start","drag","end"),d=0,h=0;function g(u){u.on("mousedown.drag",b).filter(i).on("touchstart.drag",w).on("touchmove.drag",L,os).on("touchend.drag touchcancel.drag",P).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(u,m){if(!r&&s.call(this,u,m)){var f=v(this,a.call(this,u,m),u,m,"mouse");f&&(G(u.view).on("mousemove.drag",p,F).on("mouseup.drag",C,F),function(x){var y=x.document.documentElement,E=G(x).on("dragstart.drag",U,F);"onselectstart"in y?E.on("selectstart.drag",U,F):(y.__noselect=y.style.MozUserSelect,y.style.MozUserSelect="none")}(u.view),Ne(u),n=!1,e=u.clientX,t=u.clientY,f("start",u))}}function p(u){if(U(u),!n){var m=u.clientX-e,f=u.clientY-t;n=m*m+f*f>h}l.mouse("drag",u)}function C(u){G(u.view).on("mousemove.drag mouseup.drag",null),function(m,f){var x=m.document.documentElement,y=G(m).on("dragstart.drag",null);f&&(y.on("click.drag",U,F),setTimeout(function(){y.on("click.drag",null)},0)),"onselectstart"in x?y.on("selectstart.drag",null):(x.style.MozUserSelect=x.__noselect,delete x.__noselect)}(u.view,n),U(u),l.mouse("end",u)}function w(u,m){if(s.call(this,u,m)){var f,x,y=u.changedTouches,E=a.call(this,u,m),M=y.length;for(f=0;f<M;++f)(x=v(this,E,u,m,y[f].identifier,y[f]))&&(Ne(u),x("start",u,y[f]))}}function L(u){var m,f,x=u.changedTouches,y=x.length;for(m=0;m<y;++m)(f=l[x[m].identifier])&&(U(u),f("drag",u,x[m]))}function P(u){var m,f,x=u.changedTouches,y=x.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),m=0;m<y;++m)(f=l[x[m].identifier])&&(Ne(u),f("end",u,x[m]))}function v(u,m,f,x,y,E){var M,R,H,Y=c.copy(),D=it(E||f,m);if((H=o.call(u,new He("beforestart",{sourceEvent:f,target:g,identifier:y,active:d,x:D[0],y:D[1],dx:0,dy:0,dispatch:Y}),x))!=null)return M=H.x-D[0]||0,R=H.y-D[1]||0,function Ge(W,Ze,gr){var Ee,qe=D;switch(W){case"start":l[y]=Ge,Ee=d++;break;case"end":delete l[y],--d;case"drag":D=it(gr||Ze,m),Ee=d}Y.call(W,u,new He(W,{sourceEvent:Ze,subject:H,target:g,identifier:y,active:Ee,x:D[0]+M,y:D[1]+R,dx:D[0]-qe[0],dy:D[1]-qe[1],dispatch:Y}),x)}}return g.filter=function(u){return arguments.length?(s=typeof u=="function"?u:Le(!!u),g):s},g.container=function(u){return arguments.length?(a=typeof u=="function"?u:Le(u),g):a},g.subject=function(u){return arguments.length?(o=typeof u=="function"?u:Le(u),g):o},g.touchable=function(u){return arguments.length?(i=typeof u=="function"?u:Le(!!u),g):i},g.on=function(){var u=c.on.apply(c,arguments);return u===c?g:u},g.clickDistance=function(u){return arguments.length?(h=(u=+u)*u,g):Math.sqrt(h)},g}let T,O,N,I,De,sr,or,ir,$,X,lt;He.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};let ze=!1;function Te(e,t){return isNaN(t)?e:Math.round(e*Math.pow(10,t))/Math.pow(10,t)}function Xe(e,t,n,r,s){let a,o;const i=t.data.datasets[n].data[r];if(e.touches?(a=t.scales[N].getValueForPixel(e.touches[0].clientX-t.canvas.getBoundingClientRect().left),o=t.scales[O].getValueForPixel(e.touches[0].clientY-t.canvas.getBoundingClientRect().top)):(a=t.scales[N].getValueForPixel(e.clientX-t.canvas.getBoundingClientRect().left),o=t.scales[O].getValueForPixel(e.clientY-t.canvas.getBoundingClientRect().top)),a=Te(a,t.config.options.plugins.dragData.round),o=Te(o,t.config.options.plugins.dragData.round),a=a>t.scales[N].max?t.scales[N].max:a,a=a<t.scales[N].min?t.scales[N].min:a,o=o>t.scales[O].max?t.scales[O].max:o,o=o<t.scales[O].min?t.scales[O].min:o,or){let l;return l=t.config.options.indexAxis==="y"?a:o,Math.abs(l-i[0])<=Math.abs(l-i[1])?[l,i[1]]:[i[0],l]}return i.x!==void 0&&t.config.options.plugins.dragData.dragX&&(i.x=a),i.y!==void 0?(t.config.options.plugins.dragData.dragY!==!1&&(i.y=o),i):t.config.options.indexAxis==="y"?a:o}const gs=(e,t,n,r)=>{if(T){$=T.datasetIndex,X=T.index,ze=!0;let s=t.data.datasets[$].data[X];De==="radar"||De==="polarArea"?s=function(a,o){let i,l,c;a.touches?(i=a.touches[0].clientX-o.canvas.getBoundingClientRect().left,l=a.touches[0].clientY-o.canvas.getBoundingClientRect().top):(i=a.clientX-o.canvas.getBoundingClientRect().left,l=a.clientY-o.canvas.getBoundingClientRect().top);let d=o.scales[I],h=Math.sqrt(Math.pow(i-d.xCenter,2)+Math.pow(l-d.yCenter,2)),g=d.drawingArea/(d.max-d.min);return c=d.options.ticks.reverse?d.max-h/g:d.min+h/g,c=Te(c,o.config.options.plugins.dragData.round),c=c>o.scales[I].max?o.scales[I].max:c,c=c<o.scales[I].min?o.scales[I].min:c,c}(e,t):sr?s=Te(Xe(e,t,$,X)-ir,n.round):s=Xe(e,t,$,X),(!r||typeof r=="function"&&r(e,$,X,s)!==!1)&&(t.data.datasets[$].data[X]=s,t.update("none"))}},lr={id:"dragdata",afterInit:function(e){if(e.config.options.plugins&&e.config.options.plugins.dragData){const t=e.config.options.plugins.dragData;G(e.canvas).call(ds().container(e.canvas).on("start",n=>((r,s,a)=>{if(T=s.getElementsAtEventForMode(r,"nearest",{intersect:!0},!1)[0],De=s.config.type,T){let o=T.datasetIndex,i=T.index;lt=function(h){try{return h()}catch{return""}}(()=>s.config.options.plugins.tooltip.animation);const l=s.data.datasets[o],c=s.getDatasetMeta(o);let d=l.data[i];if(N=c.xAxisID,O=c.yAxisID,I=c.rAxisID,l.dragData===!1||s.config.options.scales[N]&&s.config.options.scales[N].dragData===!1||s.config.options.scales[O]&&s.config.options.scales[O].dragData===!1||s.config.options.scales[I]&&s.config.options.scales[I].rAxisID===!1||l.data[T.index].dragData===!1)return void(T=null);if(De==="bar"){sr=s.config.options.scales[N].stacked;const h=s.data.datasets[0].data[0];or=h!==null&&Array.isArray(h)&&h.length==2,ir=Xe(r,s,o,i)-d}(s.config.options.plugins.dragData.showTooltip===void 0||s.config.options.plugins.dragData.showTooltip)&&(s.config.options.plugins.tooltip||(s.config.options.plugins.tooltip={}),s.config.options.plugins.tooltip.animation=!1),typeof a=="function"&&T&&a(r,o,i,d)===!1&&(T=null)}})(n.sourceEvent,e,t.onDragStart)).on("drag",n=>gs(n.sourceEvent,e,t,t.onDrag)).on("end",n=>((r,s,a)=>{if(X=void 0,ze=!1,s.config.options.plugins.tooltip&&(s.config.options.plugins.tooltip.animation=lt,s.update("none")),typeof a=="function"&&T){const o=T.datasetIndex,i=T.index;let l=function(c,d,h){const g=c.config.options.plugins.dragData;if(!g.magnet)return c.data.datasets[d].data[h];{const b=g.magnet;if(b.to&&typeof b.to=="function"){let p=c.data.datasets[d].data[h];return p=b.to(p),c.data.datasets[d].data[h]=p,c.update("none"),p}}}(s,o,i);return a(r,o,i,l)}})(n.sourceEvent,e,t.onDragEnd)))}},beforeEvent:function(e){if(ze)return e.tooltip&&e.tooltip.update(),!1}};Gn.register(lr);const cr=(e,t)=>{var d;const{options:n}=t??{},{interactions:r}=n??{},[s,a]=Me.useState(!1),i=(({datasets:h,options:g})=>{const{annotations:{controlAnnotation:b,showAnnotations:p,annotationsData:C}={}}=g,w=b&&p&&(C!=null&&C.length)?C.map((v,u)=>({isAnnotation:!0,label:v==null?void 0:v.label,annotationIndex:u,backgroundColor:(v==null?void 0:v.color)||V[u],borderColor:(v==null?void 0:v.color)||V[u],data:[],type:fr.Bar})):[],L=[...h,...w];return(L==null?void 0:L.map((v,u)=>{var E;const m=V,f=(E=v==null?void 0:v.data)==null?void 0:E.map(M=>{const R=(h==null?void 0:h.length)>1?u:0;return(m==null?void 0:m[R])||Zn(V)}),x=(v==null?void 0:v.backgroundColor)||(f==null?void 0:f.map(M=>M+pr)),y="borderWidth"in L?{borderWidth:parseFloat(String(L==null?void 0:L.borderWidth))??1}:{};return{...v,...y,borderColor:(v==null?void 0:v.borderColor)||(f==null?void 0:f[u]),backgroundColor:x}}))||[]})({datasets:(d=t==null?void 0:t.data)==null?void 0:d.datasets,options:n}),l=(h,g,b)=>{b.resetZoom()},c=(h,g)=>{if(s&&!(g!=null&&g.length)&&(a(!1),r!=null&&r.onUnhover&&(r==null||r.onUnhover(h))),!s&&(g!=null&&g.length)&&(a(!0),r.onHover)){const{index:b,datasetIndex:p}=(g==null?void 0:g[0])??{},C=i;r==null||r.onHover(h,p,b,C)}};return Me.useMemo(()=>({generatedDatasets:i,onClick:l,onHover:c}),[e,t])},hs=(e,{stacked:t,stackedX:n,stackedY:r})=>e===k.X?n??t:e===k.Y?r??t:t,Ye=({chart:e,axisType:t=k.X,currentScale:n,i:r})=>{var b,p,C,w,L,P,v,u,m;const{data:s,options:a}=e??{},o=Ue(a.direction),i=n||((p=(b=a==null?void 0:a.axes)==null?void 0:b[t])==null?void 0:p[0]),l=o&&t===k.Y||!o&&t===k.X,c=(i==null?void 0:i.gridLines)||{},d=()=>{var y;const f=s.labels?we.Category:we.Linear,x=o?k.X:k.Y;return t===x?f:(y=a==null?void 0:a.additionalAxesOptions)==null?void 0:y.chartScaleType},h=()=>{var x;const f=o?k.Y:k.X;return t===f?(x=a==null?void 0:a.additionalAxesOptions)==null?void 0:x.reverse:!1},g=()=>{var H,Y;const f=a==null?void 0:a.additionalAxesOptions,x=(Y=(H=a==null?void 0:a.scales)==null?void 0:H[`${r===0?t:t+r}`])==null?void 0:Y.ticks,y=l&&(f==null?void 0:f.chartScaleType)===we.Logarithmic,E=(D,Ge,W)=>y?xr.includes(Number(D))?et(D,W):"":et(D,W),R={...y?{}:{stepSize:i.stepSize??(t===k.Y?f==null?void 0:f.stepSize:null)},includeBounds:!1,...x,font:{size:br}};return(f==null?void 0:f.chartScaleType)===we.Logarithmic&&(R.callback=E),R};return{type:d(),position:i==null?void 0:i.position,beginAtZero:(C=a==null?void 0:a.additionalAxesOptions)==null?void 0:C.beginAtZero,reverse:h(),suggestedMax:(w=a==null?void 0:a.additionalAxesOptions)==null?void 0:w.suggestedMax,suggestedMin:(L=a==null?void 0:a.additionalAxesOptions)==null?void 0:L.suggestedMin,min:l?(P=a==null?void 0:a.additionalAxesOptions)==null?void 0:P.min:void 0,max:l?(v=a==null?void 0:a.additionalAxesOptions)==null?void 0:v.max:void 0,title:{display:((u=i==null?void 0:i.label)==null?void 0:u.length)||((m=i==null?void 0:i.unit)==null?void 0:m.length),text:(i==null?void 0:i.label)||(i==null?void 0:i.unit),padding:0},ticks:g(),grid:{...c},stacked:hs(t,a==null?void 0:a.additionalAxesOptions)}},ct=(e,t)=>{var s,a;return(((a=(s=e==null?void 0:e.options)==null?void 0:s.axes)==null?void 0:a[t])||[]).reduce((o,i,l)=>{const c=i,d=i.color||V[l]||Zn(V);c.color=d,c.position=i.position||mr(t,l);const h=Ye({chart:e,axisType:t,currentScale:c}),g=l===0?t:`${t}${l+1}`;return{...o,[g]:h}},{})},fs=e=>{var a,o;const t=((a=e.options.axes.x)==null?void 0:a.length)>1,n=((o=e.options.axes.y)==null?void 0:o.length)>1,r=t?ct(e,k.X):{x:Ye({chart:e,axisType:k.X})},s=n?ct(e,k.Y):{y:Ye({chart:e,axisType:k.Y})};return{...r,...s}},ps=e=>{var o;const{beginAtZero:t,reverse:n}=(e==null?void 0:e.additionalAxesOptions)||{},r=(i,l)=>{const{datasetIndex:c,dataIndex:d}=l,g=l.chart.data.datasets[c].data[d];let b="";if(typeof g=="number"&&(b=Number.isInteger(g)?g:g.toFixed(2)),Array.isArray(g))if(g.length===2){const p=g[1]-g[0];b=p<0?Ke(p,2):`+${Ke(p,2)}`}else b=g.reduce((p,C,w)=>w===0?`${p} ${C}`:`${p}, ${C}`,"");return b},s=n?z.End:z.Start,a=n?z.Start:z.End;return(o=e==null?void 0:e.graph)!=null&&o.showDataLabels?{display:Ie,align:t?z.Center:s,anchor:t?z.Center:a,formatter:r}:{display:!1}},ms=e=>{var a;const t=o=>{var C,w;const i=Ue(e.direction),l=Array.isArray((C=e.axes)==null?void 0:C.x)?e.axes.x:[],c=Array.isArray((w=e.axes)==null?void 0:w.y)?e.axes.y:[],d=L=>{if(!L)return 0;const P=L.match(/\d+$/);return P?parseInt(P[0],10)-1:0},h=d(o==null?void 0:o.xAxisID),g=d(o==null?void 0:o.yAxisID),b=i?l[h]:c[g],p=i?c[g]:l[h];return{titleAxisLabel:(b==null?void 0:b.label)||"",valueAxisLabel:(p==null?void 0:p.label)||"",titleLabel:Qe.X,valueLabel:Qe.Y,titleUnit:(b==null?void 0:b.unit)||"",valueUnit:(p==null?void 0:p.unit)||""}},n=(o,i)=>{var b,p;const l=((b=o==null?void 0:o[0])==null?void 0:b.label)||"",c=t((p=o==null?void 0:o[0])==null?void 0:p.dataset),{titleAxisLabel:d,titleUnit:h}=c;return(!d&&!h?"":`${d||h}: `)+l},r=o=>{var l;let i={};return(l=e==null?void 0:e.tooltip)!=null&&l.scientificNotation?(Math.abs(o)<oa||Math.abs(o)>ia)&&(i={roundScientificCoefficient:3}):i={scientific:!1},Cr(Sr(o),i)},s=o=>{var P;const{showLabelsInTooltips:i=!1}=(e==null?void 0:e.tooltip)||{};let l=((P=o.dataset)==null?void 0:P.label)||"";const c=t(o.dataset),{valueUnit:d,valueAxisLabel:h}=c,g=()=>{const v=o==null?void 0:o.raw,u=typeof v=="number"?r(v):"";let m="";return typeof o.raw=="number"&&(m=u),Array.isArray(o.raw)?m=o.raw.reduce((f,x,y)=>y===0?`${f} ${x}`:`${f}, ${x}`,""):typeof o.raw=="object"&&(m=u),m},b=l===h||h.includes(l),p=g(),C=d?`[${d}] `:"",w=b?"":h,L=Ar(o,i);return`${l}: ${p} ${C}${w}${L}`};return{enabled:(a=e==null?void 0:e.tooltip)==null?void 0:a.tooltips,mode:qn.Nearest,intersect:!0,padding:_r,boxWidth:Je,boxHeight:Je,boxPadding:yr,callbacks:{title:n,label:s,afterLabel:vr}}},bs=({chart:e,chartRef:t})=>{const{options:n}=e,{chartStyling:r,dragData:s}=n,{state:a}=Vr(),{annotation:o}=a,{onClick:i,onHover:l}=cr(t,e),{legend:c,customLegendPlugin:d}=Fr({chartRef:t,options:n});return{onClick:i,onHover:l,indexAxis:Ue(n.direction)?k.X:k.Y,maintainAspectRatio:r.maintainAspectRatio,animation:r.performanceMode&&{duration:Br.FAST},hover:{mode:qn.Nearest,intersect:!0},scales:fs(e),plugins:{title:Lr(n),datalabels:ps(n),annotation:Gr(o),tooltip:ms(n),legend:{...c,display:!1,events:[]},customLegendPlugin:d,chartAreaBorder:{borderColor:wr},dragData:(s==null?void 0:s.enableDragData)&&na(n)}}},xs="_chart_x1sru_1",vs="_canvas_x1sru_10",ys="_fixedHeight_x1sru_19",_s="_stretchHeight_x1sru_25",As="_actions_x1sru_57",Oe={chart:xs,canvas:vs,fixedHeight:ys,stretchHeight:_s,actions:As},Cs=e=>({x:(e==null?void 0:e.x)||[{}],y:(e==null?void 0:e.y)||[{}]}),Ss=e=>({chartScaleType:(e==null?void 0:e.chartScaleType)||"linear",reverse:(e==null?void 0:e.reverse)||!1,stacked:(e==null?void 0:e.stacked)||!1,beginAtZero:(e==null?void 0:e.beginAtZero)??!0,stepSize:e==null?void 0:e.stepSize,suggestedMin:e==null?void 0:e.suggestedMin,suggestedMax:e==null?void 0:e.suggestedMax,min:e==null?void 0:e.min,max:e==null?void 0:e.max,stackedX:e==null?void 0:e.stackedX,stackedY:e==null?void 0:e.stackedY}),ws=e=>({width:e==null?void 0:e.width,height:e==null?void 0:e.height,maintainAspectRatio:(e==null?void 0:e.maintainAspectRatio)||!1,staticChartHeight:(e==null?void 0:e.staticChartHeight)||!1,performanceMode:(e==null?void 0:e.performanceMode)??!0}),Ls=e=>({tooltips:(e==null?void 0:e.tooltips)??!0,showLabelsInTooltips:(e==null?void 0:e.showLabelsInTooltips)||!1,scientificNotation:(e==null?void 0:e.scientificNotation)??!0}),Bs=e=>({showDataLabels:(e==null?void 0:e.showDataLabels)||!1,showMinorGridlines:(e==null?void 0:e.showMinorGridlines)||!1}),ks=e=>e?e.map(t=>({...t,display:(t==null?void 0:t.display)??!0})):[],Ps=e=>({showAnnotations:(e==null?void 0:e.showAnnotations)??!0,controlAnnotation:(e==null?void 0:e.controlAnnotation)||!1,annotationsData:ks(e==null?void 0:e.annotationsData)}),Ds=e=>({display:(e==null?void 0:e.display)??!0,position:(e==null?void 0:e.position)||kr.TopLeft,align:(e==null?void 0:e.align)||z.Center,customLegend:(e==null?void 0:e.customLegend)||{customLegendPlugin:null,customLegendContainerID:""}}),Ts=e=>({enableZoom:(e==null?void 0:e.enableZoom)||!1,enablePan:(e==null?void 0:e.enablePan)||!1}),js=e=>({onLegendClick:e==null?void 0:e.onLegendClick,onHover:e==null?void 0:e.onHover,onUnhover:e==null?void 0:e.onUnhover}),Es=e=>({enableDragData:(e==null?void 0:e.enableDragData)??!1,showTooltip:(e==null?void 0:e.showTooltip)??!0,roundPoints:(e==null?void 0:e.roundPoints)??!0,dragX:(e==null?void 0:e.dragX)??!0,dragY:(e==null?void 0:e.dragY)??!0,onDragStart:e==null?void 0:e.onDragStart,onDrag:e==null?void 0:e.onDrag,onDragEnd:e==null?void 0:e.onDragEnd}),ur=e=>{const t=(e==null?void 0:e.chart)||{},n=(t==null?void 0:t.options)||{};return{testId:(t==null?void 0:t.testId)??"",controlsPortalId:(t==null?void 0:t.controlsPortalId)??"",data:t==null?void 0:t.data,options:{title:(n==null?void 0:n.title)||"",direction:(n==null?void 0:n.direction)||"vertical",axes:Cs(n==null?void 0:n.axes),additionalAxesOptions:Ss(n==null?void 0:n.additionalAxesOptions),chartStyling:ws(n==null?void 0:n.chartStyling),tooltip:Ls(n==null?void 0:n.tooltip),graph:Bs(n==null?void 0:n.graph),annotations:Ps(n==null?void 0:n.annotations),legend:Ds(n==null?void 0:n.legend),chartOptions:Ts(n==null?void 0:n.chartOptions),interactions:js(n==null?void 0:n.interactions),dragData:Es(n==null?void 0:n.dragData)}}};Gn.register(Nr,Or,Mr,Ir,Rr,Hr,zr,Xr,Yr,Wr,Ur,$r,ta,lr);const Ns=e=>{var b,p,C,w;Dr();const t=Me.useRef(null),n=ur(e),{translations:r,languageKey:s}=ra(),{options:a,testId:o,controlsPortalId:i}=n,{chartStyling:l,graph:c}=a,{generatedDatasets:d}=cr(t,n),h=bs({chart:n,chartRef:t}),g=!((p=(b=a==null?void 0:a.legend)==null?void 0:b.customLegend)!=null&&p.customLegendContainerID);return S.jsxs("div",{className:Tr(l,Oe),style:{width:l.width||Ie,height:l.height||Ie},"data-testid":o,children:[S.jsx(aa,{controlsPortalId:i,children:S.jsx("div",{className:Oe.actions,children:S.jsx(Zr,{text:r.downloadAsPNG,placement:"bottom-end",children:S.jsx(qr,{small:!0,basic:!0,colored:"muted",round:!0,icon:"download",onClick:()=>sa(t)})})})}),S.jsx(Kr,{backend:Jr,context:window,children:S.jsxs("div",{className:Oe.canvas,id:"canvas",children:[S.jsx(jr,{ref:t,data:{labels:(w=(C=n==null?void 0:n.data)==null?void 0:C.labels)!=null&&w.length?n.data.labels:[""],datasets:d},options:h,plugins:Er(c,a.legend)}),g&&!!d.length&&S.jsx(Qr,{chartRef:t,legendConfig:{options:a,generatedDatasets:d,chartType:ea.BAR}})]})})]},s)},Se=e=>{const{options:t}=ur(e);return S.jsx(Pr,{options:t,children:S.jsx(Ns,{...e})})};Se.__docgenInfo={description:"",methods:[],displayName:"BarChartWithLegend",props:{chart:{required:!0,tsType:{name:"IBarChartData"},description:""}}};const A=["United Kingdom","Norway","France"],B={label:"Cats",data:[3.12,8,7]},Ve={label:"Dogs",data:[1,2,3]},dr={label:"Parrots",data:[5,0,4]},Os={label:"Cats",data:[3,8,7],yAxisID:"y"},Ms={label:"Dogs",data:[1,2,3],yAxisID:"y2"},Is={label:"Parrots",data:[5,0,4],yAxisID:"y2"},Rs={label:"Cats",data:[3,8,7],stack:1},Hs={label:"Dogs",data:[1,2,3],stack:1},zs={label:"Parrots",data:[5,0,4],stack:2},ut={label:"Cats",data:[1e3,2e3,3e3],stack:1},Xs={label:"Dogs",data:[4e3,5e3,6e3],stack:1},je={label:"Cats",data:[42,57,64]},Ys={label:"Cats",data:[210,333,248]},Ws={label:"Income",data:[100,[100,120],[120,130],[130,80],80],backgroundColor:["lightGray","lightGreen","lightGreen","pink","lightGray"]},Fe={data:{labels:A,datasets:[B]}},Us={data:{labels:A,datasets:[{...B,label:"Men",backgroundColor:"lightblue"},{...Ve,label:"Women",backgroundColor:"pink"}]}},$s={data:{labels:A,datasets:[{...B,backgroundColor:["gray","red","gray"]}]}},Vs={data:{labels:A,datasets:[B,Ve,dr]}},Fs={data:{labels:A,datasets:[B,Ve,dr]},options:{title:"Stacked",additionalAxesOptions:{stacked:!0}}},Gs={data:{labels:A,datasets:[Os,Ms,Is]},options:{title:"Multiple y axes",axes:{y:[{},{gridLines:{drawOnChartArea:!1}}]}}},Zs={data:{labels:A,datasets:[Rs,Hs,zs]},options:{title:"Grouped stacked",additionalAxesOptions:{stacked:!0}}},qs={data:{labels:A,datasets:[B]},options:{title:"reversed vertical",additionalAxesOptions:{reverse:!0}}},Ks={data:{labels:A,datasets:[B]},options:{title:"horizontal",direction:"horizontal"}},Js={data:{labels:A,datasets:[B]},options:{title:"reversed horizontal",direction:"horizontal",additionalAxesOptions:{reverse:!0}}},Qs={data:{labels:A,datasets:[B]},options:{title:"With axes labels",axes:{x:[{label:"Country"}],y:[{label:"Number of pets"}]}}},eo={data:{labels:A,datasets:[B]},options:{title:["x axis on top","y axis on right"],axes:{x:[{position:"top"}],y:[{position:"right"}]}}},to={data:{labels:A,datasets:[B]},options:{title:"Not beginning at zero",additionalAxesOptions:{beginAtZero:!1}}},no={data:{labels:A,datasets:[B]},options:{title:"With step size of 2",additionalAxesOptions:{stepSize:2}}},ro={data:{labels:A,datasets:[B]},options:{title:"With suggested range",additionalAxesOptions:{beginAtZero:!1,suggestedMin:2,suggestedMax:12}}},ao={data:{labels:A,datasets:[B]},options:{title:"With logarithmic scale",additionalAxesOptions:{chartScaleType:"logarithmic"}}},so={data:{labels:A,datasets:[Ys]},options:{title:"With value as datalabels",graph:{showDataLabels:!0}}},oo={data:{labels:A,datasets:[{...B,backgroundColor:"rgba(255, 99, 132, 0.2)",borderColor:"black",borderWidth:1}]}},io={data:{labels:A,datasets:[je]},options:{title:"Annotation Y Axis",annotations:{showAnnotations:!0,annotationsData:[{annotationAxis:"y",label:"Horizontal Annotation",value:53,color:"rgba(96, 32, 196, 0.5)"}]}}},lo={data:{labels:A,datasets:[je]},options:{title:"Annotation X Axis",annotations:{showAnnotations:!0,annotationsData:[{annotationAxis:"x",label:"Vertical Annotation",value:.5,color:"green"}]}}},co={data:{labels:A,datasets:[je]},options:{title:"Diagonal Annotation",annotations:{showAnnotations:!0,annotationsData:[{annotationAxis:"y",label:"Diagonal Annotation",value:40,endValue:67,color:"rgba(123, 16, 32, 0.8)"}]}}},uo={data:{labels:A,datasets:[je]},options:{title:"Control annotations in legend",annotations:{showAnnotations:!0,controlAnnotation:!0,annotationsData:[{annotationAxis:"y",label:"Diagonal Annotation",value:40,endValue:67,color:"rgba(123, 16, 32, 0.8)"},{annotationAxis:"y",label:"Horizontal Annotation",value:53,color:"rgba(96, 32, 196, 0.5)"}]}}},go={data:{labels:A,datasets:[B]},options:{title:"Legend to the right",legend:{position:"right"}}},ho={data:{labels:A,datasets:[B]},options:{chartStyling:{performanceMode:!1}}},fo={data:{labels:A,datasets:[B]},options:{dragData:{enableDragData:!0,showTooltip:!0,roundPoints:!0,onDragStart:(e,t)=>{},onDrag:(e,t,n,r)=>{},onDragEnd:(e,t,n,r)=>{}}}},po={data:{labels:A,datasets:[ut,ut,Xs]}},mo={data:{labels:["Week 1","Week 2","Week 3","Week 4","Week 5","Week 6"],datasets:[{label:"Budget Sales",data:[200,1e3,800,700,900,1600],backgroundColor:"rgba(128, 128, 128, 0.5)",borderColor:"rgba(128, 128, 128, 1)",barThickness:40},{label:"Actual Sales",data:[300,600,400,500,700,1200],backgroundColor:"rgba(64, 64, 64, 0.5)",borderColor:"rgba(64, 64, 64, 1)",barThickness:60},{label:"Units",data:[20,40,30,50,70,90],type:"line",backgroundColor:"rgba(255, 165, 0, 0.5)",borderColor:"rgba(255, 165, 0, 1)",yAxisID:"y-axis-units"}]},options:{title:"Specific axis stacked",additionalAxesOptions:{stackedX:!0,stackedY:!1}}},bo={data:{labels:["original","change 1","change 2","change 3","result"],datasets:[Ws]},options:{title:"Waterfall chart",graph:{showDataLabels:!0}}},Po={title:"BarChart",component:Se,args:{chart:Fe}},_=e=>S.jsx(Se,{...e}),We="custom-legend-container",xo=e=>S.jsxs(S.Fragment,{children:[S.jsx(Se,{...e}),S.jsx("div",{id:We})]}),Be=_.bind({}),Z=_.bind({});Z.args={chart:Us};const q=_.bind({});q.args={chart:$s};const K=_.bind({});K.args={chart:Vs};const J=_.bind({});J.args={chart:Fs};const Q=_.bind({});Q.args={chart:Zs};const ee=_.bind({});ee.args={chart:Gs};const te=_.bind({});te.args={chart:Ks};const ne=_.bind({});ne.args={chart:qs};const re=_.bind({});re.args={chart:Js};const ae=_.bind({});ae.args={chart:Qs};const se=_.bind({});se.args={chart:eo};const oe=_.bind({});oe.args={chart:to};const ie=_.bind({});ie.args={chart:ro};const le=_.bind({});le.args={chart:no};const ce=_.bind({});ce.args={chart:ao};const ue=_.bind({});ue.args={chart:so};const de=_.bind({});de.args={chart:go};const ge=_.bind({});ge.args={chart:oo};const he=_.bind({});he.args={chart:io};const fe=_.bind({});fe.args={chart:lo};const pe=_.bind({});pe.args={chart:co};const me=_.bind({});me.args={chart:uo};const be=_.bind({});be.args={chart:ho};const xe=xo.bind({});xe.args={chart:{...Fe,options:{title:"Custom HTML legend",legend:{customLegend:{customLegendPlugin:hr(We),customLegendContainerID:We}}}}};const ve=_.bind({});ve.args={chart:fo};const ye=_.bind({});ye.args={chart:po};const _e=_.bind({});_e.args={chart:mo};const Ae=_.bind({});Ae.args={chart:bo};const Ce=()=>{const e="controls-portal-container";return S.jsxs(S.Fragment,{children:[S.jsxs("div",{style:{padding:20,border:"1px solid red"},children:["This div is outside the BarChart component",S.jsx("div",{id:e})]}),S.jsx(Se,{chart:{...Fe,controlsPortalId:e}})]})};Ce.__docgenInfo={description:"",methods:[],displayName:"ControlsPortal"};var dt,gt,ht;Be.parameters={...Be.parameters,docs:{...(dt=Be.parameters)==null?void 0:dt.docs,source:{originalSource:`args => {
2
2
  return <BarChart
3
3
  // eslint-disable-next-line react/jsx-props-no-spreading
4
4
  {...args} />;
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./test-utils-BBHUGUfi.js","./index-YTOF1_EJ.js","./index-BhTLYoCu.js","./react-18-BdgjDjvZ.js","./client-DnE3718B.js"])))=>i.map(i=>d[i]);
2
- import{_ as Ee}from"./iframe-BRmCfBZj.js";import{_ as Ae,a as O,d as ge}from"./chunk-XP5HYGXS-D5tuasO7.js";import{r as k,R as Y,b as we}from"./index-YTOF1_EJ.js";var ne={};const{global:xe}=__STORYBOOK_MODULE_GLOBAL__;var Q=O({"../../node_modules/semver/internal/constants.js"(c,l){var r="2.0.0",i=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,t=250,p=["major","premajor","minor","preminor","patch","prepatch","prerelease"];l.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:t,MAX_SAFE_INTEGER:i,RELEASE_TYPES:p,SEMVER_SPEC_VERSION:r,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}}),Z=O({"../../node_modules/semver/internal/debug.js"(c,l){var r=typeof process=="object"&&ne&&ne.NODE_DEBUG&&/\bsemver\b/i.test(ne.NODE_DEBUG)?(...i)=>console.error("SEMVER",...i):()=>{};l.exports=r}}),z=O({"../../node_modules/semver/internal/re.js"(c,l){var{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:n}=Q(),t=Z();c=l.exports={};var p=c.re=[],h=c.safeRe=[],e=c.src=[],f=c.safeSrc=[],a=c.t={},v=0,s="[a-zA-Z0-9-]",u=[["\\s",1],["\\d",n],[s,i]],E=I=>{for(let[T,A]of u)I=I.split(`${T}*`).join(`${T}{0,${A}}`).split(`${T}+`).join(`${T}{1,${A}}`);return I},o=(I,T,A)=>{let y=E(T),D=v++;t(I,D,T),a[I]=D,e[D]=T,f[D]=y,p[D]=new RegExp(T,A?"g":void 0),h[D]=new RegExp(y,A?"g":void 0)};o("NUMERICIDENTIFIER","0|[1-9]\\d*"),o("NUMERICIDENTIFIERLOOSE","\\d+"),o("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${s}*`),o("MAINVERSION",`(${e[a.NUMERICIDENTIFIER]})\\.(${e[a.NUMERICIDENTIFIER]})\\.(${e[a.NUMERICIDENTIFIER]})`),o("MAINVERSIONLOOSE",`(${e[a.NUMERICIDENTIFIERLOOSE]})\\.(${e[a.NUMERICIDENTIFIERLOOSE]})\\.(${e[a.NUMERICIDENTIFIERLOOSE]})`),o("PRERELEASEIDENTIFIER",`(?:${e[a.NUMERICIDENTIFIER]}|${e[a.NONNUMERICIDENTIFIER]})`),o("PRERELEASEIDENTIFIERLOOSE",`(?:${e[a.NUMERICIDENTIFIERLOOSE]}|${e[a.NONNUMERICIDENTIFIER]})`),o("PRERELEASE",`(?:-(${e[a.PRERELEASEIDENTIFIER]}(?:\\.${e[a.PRERELEASEIDENTIFIER]})*))`),o("PRERELEASELOOSE",`(?:-?(${e[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${e[a.PRERELEASEIDENTIFIERLOOSE]})*))`),o("BUILDIDENTIFIER",`${s}+`),o("BUILD",`(?:\\+(${e[a.BUILDIDENTIFIER]}(?:\\.${e[a.BUILDIDENTIFIER]})*))`),o("FULLPLAIN",`v?${e[a.MAINVERSION]}${e[a.PRERELEASE]}?${e[a.BUILD]}?`),o("FULL",`^${e[a.FULLPLAIN]}$`),o("LOOSEPLAIN",`[v=\\s]*${e[a.MAINVERSIONLOOSE]}${e[a.PRERELEASELOOSE]}?${e[a.BUILD]}?`),o("LOOSE",`^${e[a.LOOSEPLAIN]}$`),o("GTLT","((?:<|>)?=?)"),o("XRANGEIDENTIFIERLOOSE",`${e[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),o("XRANGEIDENTIFIER",`${e[a.NUMERICIDENTIFIER]}|x|X|\\*`),o("XRANGEPLAIN",`[v=\\s]*(${e[a.XRANGEIDENTIFIER]})(?:\\.(${e[a.XRANGEIDENTIFIER]})(?:\\.(${e[a.XRANGEIDENTIFIER]})(?:${e[a.PRERELEASE]})?${e[a.BUILD]}?)?)?`),o("XRANGEPLAINLOOSE",`[v=\\s]*(${e[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${e[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${e[a.XRANGEIDENTIFIERLOOSE]})(?:${e[a.PRERELEASELOOSE]})?${e[a.BUILD]}?)?)?`),o("XRANGE",`^${e[a.GTLT]}\\s*${e[a.XRANGEPLAIN]}$`),o("XRANGELOOSE",`^${e[a.GTLT]}\\s*${e[a.XRANGEPLAINLOOSE]}$`),o("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),o("COERCE",`${e[a.COERCEPLAIN]}(?:$|[^\\d])`),o("COERCEFULL",e[a.COERCEPLAIN]+`(?:${e[a.PRERELEASE]})?(?:${e[a.BUILD]})?(?:$|[^\\d])`),o("COERCERTL",e[a.COERCE],!0),o("COERCERTLFULL",e[a.COERCEFULL],!0),o("LONETILDE","(?:~>?)"),o("TILDETRIM",`(\\s*)${e[a.LONETILDE]}\\s+`,!0),c.tildeTrimReplace="$1~",o("TILDE",`^${e[a.LONETILDE]}${e[a.XRANGEPLAIN]}$`),o("TILDELOOSE",`^${e[a.LONETILDE]}${e[a.XRANGEPLAINLOOSE]}$`),o("LONECARET","(?:\\^)"),o("CARETTRIM",`(\\s*)${e[a.LONECARET]}\\s+`,!0),c.caretTrimReplace="$1^",o("CARET",`^${e[a.LONECARET]}${e[a.XRANGEPLAIN]}$`),o("CARETLOOSE",`^${e[a.LONECARET]}${e[a.XRANGEPLAINLOOSE]}$`),o("COMPARATORLOOSE",`^${e[a.GTLT]}\\s*(${e[a.LOOSEPLAIN]})$|^$`),o("COMPARATOR",`^${e[a.GTLT]}\\s*(${e[a.FULLPLAIN]})$|^$`),o("COMPARATORTRIM",`(\\s*)${e[a.GTLT]}\\s*(${e[a.LOOSEPLAIN]}|${e[a.XRANGEPLAIN]})`,!0),c.comparatorTrimReplace="$1$2$3",o("HYPHENRANGE",`^\\s*(${e[a.XRANGEPLAIN]})\\s+-\\s+(${e[a.XRANGEPLAIN]})\\s*$`),o("HYPHENRANGELOOSE",`^\\s*(${e[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${e[a.XRANGEPLAINLOOSE]})\\s*$`),o("STAR","(<|>)?=?\\s*\\*"),o("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),o("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}}),ce=O({"../../node_modules/semver/internal/parse-options.js"(c,l){var r=Object.freeze({loose:!0}),i=Object.freeze({}),n=t=>t?typeof t!="object"?r:t:i;l.exports=n}}),Le=O({"../../node_modules/semver/internal/identifiers.js"(c,l){var r=/^[0-9]+$/,i=(t,p)=>{let h=r.test(t),e=r.test(p);return h&&e&&(t=+t,p=+p),t===p?0:h&&!e?-1:e&&!h?1:t<p?-1:1},n=(t,p)=>i(p,t);l.exports={compareIdentifiers:i,rcompareIdentifiers:n}}}),q=O({"../../node_modules/semver/classes/semver.js"(c,l){var r=Z(),{MAX_LENGTH:i,MAX_SAFE_INTEGER:n}=Q(),{safeRe:t,safeSrc:p,t:h}=z(),e=ce(),{compareIdentifiers:f}=Le(),a=class b{constructor(s,u){if(u=e(u),s instanceof b){if(s.loose===!!u.loose&&s.includePrerelease===!!u.includePrerelease)return s;s=s.version}else if(typeof s!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof s}".`);if(s.length>i)throw new TypeError(`version is longer than ${i} characters`);r("SemVer",s,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;let E=s.trim().match(u.loose?t[h.LOOSE]:t[h.FULL]);if(!E)throw new TypeError(`Invalid Version: ${s}`);if(this.raw=s,this.major=+E[1],this.minor=+E[2],this.patch=+E[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");E[4]?this.prerelease=E[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let I=+o;if(I>=0&&I<n)return I}return o}):this.prerelease=[],this.build=E[5]?E[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(s){if(r("SemVer.compare",this.version,this.options,s),!(s instanceof b)){if(typeof s=="string"&&s===this.version)return 0;s=new b(s,this.options)}return s.version===this.version?0:this.compareMain(s)||this.comparePre(s)}compareMain(s){return s instanceof b||(s=new b(s,this.options)),f(this.major,s.major)||f(this.minor,s.minor)||f(this.patch,s.patch)}comparePre(s){if(s instanceof b||(s=new b(s,this.options)),this.prerelease.length&&!s.prerelease.length)return-1;if(!this.prerelease.length&&s.prerelease.length)return 1;if(!this.prerelease.length&&!s.prerelease.length)return 0;let u=0;do{let E=this.prerelease[u],o=s.prerelease[u];if(r("prerelease compare",u,E,o),E===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(E===void 0)return-1;if(E!==o)return f(E,o)}while(++u)}compareBuild(s){s instanceof b||(s=new b(s,this.options));let u=0;do{let E=this.build[u],o=s.build[u];if(r("build compare",u,E,o),E===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(E===void 0)return-1;if(E!==o)return f(E,o)}while(++u)}inc(s,u,E){if(s.startsWith("pre")){if(!u&&E===!1)throw new Error("invalid increment argument: identifier is empty");if(u){let o=new RegExp(`^${this.options.loose?p[h.PRERELEASELOOSE]:p[h.PRERELEASE]}$`),I=`-${u}`.match(o);if(!I||I[1]!==u)throw new Error(`invalid identifier: ${u}`)}}switch(s){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",u,E);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",u,E);break;case"prepatch":this.prerelease.length=0,this.inc("patch",u,E),this.inc("pre",u,E);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",u,E),this.inc("pre",u,E);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(E)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let I=this.prerelease.length;for(;--I>=0;)typeof this.prerelease[I]=="number"&&(this.prerelease[I]++,I=-2);if(I===-1){if(u===this.prerelease.join(".")&&E===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(u){let I=[u,o];E===!1&&(I=[u]),f(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=I):this.prerelease=I}break}default:throw new Error(`invalid increment argument: ${s}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};l.exports=a}}),H=O({"../../node_modules/semver/functions/parse.js"(c,l){var r=q(),i=(n,t,p=!1)=>{if(n instanceof r)return n;try{return new r(n,t)}catch(h){if(!p)return null;throw h}};l.exports=i}}),je=O({"../../node_modules/semver/functions/valid.js"(c,l){var r=H(),i=(n,t)=>{let p=r(n,t);return p?p.version:null};l.exports=i}}),Pe=O({"../../node_modules/semver/functions/clean.js"(c,l){var r=H(),i=(n,t)=>{let p=r(n.trim().replace(/^[=v]+/,""),t);return p?p.version:null};l.exports=i}}),Ce=O({"../../node_modules/semver/functions/inc.js"(c,l){var r=q(),i=(n,t,p,h,e)=>{typeof p=="string"&&(e=h,h=p,p=void 0);try{return new r(n instanceof r?n.version:n,p).inc(t,h,e).version}catch{return null}};l.exports=i}}),ye=O({"../../node_modules/semver/functions/diff.js"(c,l){var r=H(),i=(n,t)=>{let p=r(n,null,!0),h=r(t,null,!0),e=p.compare(h);if(e===0)return null;let f=e>0,a=f?p:h,v=f?h:p,s=!!a.prerelease.length;if(v.prerelease.length&&!s){if(!v.patch&&!v.minor)return"major";if(v.compareMain(a)===0)return v.minor&&!v.patch?"minor":"patch"}let u=s?"pre":"";return p.major!==h.major?u+"major":p.minor!==h.minor?u+"minor":p.patch!==h.patch?u+"patch":"prerelease"};l.exports=i}}),De=O({"../../node_modules/semver/functions/major.js"(c,l){var r=q(),i=(n,t)=>new r(n,t).major;l.exports=i}}),Ge=O({"../../node_modules/semver/functions/minor.js"(c,l){var r=q(),i=(n,t)=>new r(n,t).minor;l.exports=i}}),qe=O({"../../node_modules/semver/functions/patch.js"(c,l){var r=q(),i=(n,t)=>new r(n,t).patch;l.exports=i}}),Fe=O({"../../node_modules/semver/functions/prerelease.js"(c,l){var r=H(),i=(n,t)=>{let p=r(n,t);return p&&p.prerelease.length?p.prerelease:null};l.exports=i}}),V=O({"../../node_modules/semver/functions/compare.js"(c,l){var r=q(),i=(n,t,p)=>new r(n,p).compare(new r(t,p));l.exports=i}}),Ve=O({"../../node_modules/semver/functions/rcompare.js"(c,l){var r=V(),i=(n,t,p)=>r(t,n,p);l.exports=i}}),Ue=O({"../../node_modules/semver/functions/compare-loose.js"(c,l){var r=V(),i=(n,t)=>r(n,t,!0);l.exports=i}}),me=O({"../../node_modules/semver/functions/compare-build.js"(c,l){var r=q(),i=(n,t,p)=>{let h=new r(n,p),e=new r(t,p);return h.compare(e)||h.compareBuild(e)};l.exports=i}}),be=O({"../../node_modules/semver/functions/sort.js"(c,l){var r=me(),i=(n,t)=>n.sort((p,h)=>r(p,h,t));l.exports=i}}),Xe=O({"../../node_modules/semver/functions/rsort.js"(c,l){var r=me(),i=(n,t)=>n.sort((p,h)=>r(h,p,t));l.exports=i}}),J=O({"../../node_modules/semver/functions/gt.js"(c,l){var r=V(),i=(n,t,p)=>r(n,t,p)>0;l.exports=i}}),he=O({"../../node_modules/semver/functions/lt.js"(c,l){var r=V(),i=(n,t,p)=>r(n,t,p)<0;l.exports=i}}),_e=O({"../../node_modules/semver/functions/eq.js"(c,l){var r=V(),i=(n,t,p)=>r(n,t,p)===0;l.exports=i}}),Ne=O({"../../node_modules/semver/functions/neq.js"(c,l){var r=V(),i=(n,t,p)=>r(n,t,p)!==0;l.exports=i}}),fe=O({"../../node_modules/semver/functions/gte.js"(c,l){var r=V(),i=(n,t,p)=>r(n,t,p)>=0;l.exports=i}}),ve=O({"../../node_modules/semver/functions/lte.js"(c,l){var r=V(),i=(n,t,p)=>r(n,t,p)<=0;l.exports=i}}),Oe=O({"../../node_modules/semver/functions/cmp.js"(c,l){var r=_e(),i=Ne(),n=J(),t=fe(),p=he(),h=ve(),e=(f,a,v,s)=>{switch(a){case"===":return typeof f=="object"&&(f=f.version),typeof v=="object"&&(v=v.version),f===v;case"!==":return typeof f=="object"&&(f=f.version),typeof v=="object"&&(v=v.version),f!==v;case"":case"=":case"==":return r(f,v,s);case"!=":return i(f,v,s);case">":return n(f,v,s);case">=":return t(f,v,s);case"<":return p(f,v,s);case"<=":return h(f,v,s);default:throw new TypeError(`Invalid operator: ${a}`)}};l.exports=e}}),ke=O({"../../node_modules/semver/functions/coerce.js"(c,l){var r=q(),i=H(),{safeRe:n,t}=z(),p=(h,e)=>{if(h instanceof r)return h;if(typeof h=="number"&&(h=String(h)),typeof h!="string")return null;e=e||{};let f=null;if(!e.rtl)f=h.match(e.includePrerelease?n[t.COERCEFULL]:n[t.COERCE]);else{let o=e.includePrerelease?n[t.COERCERTLFULL]:n[t.COERCERTL],I;for(;(I=o.exec(h))&&(!f||f.index+f[0].length!==h.length);)(!f||I.index+I[0].length!==f.index+f[0].length)&&(f=I),o.lastIndex=I.index+I[1].length+I[2].length;o.lastIndex=-1}if(f===null)return null;let a=f[2],v=f[3]||"0",s=f[4]||"0",u=e.includePrerelease&&f[5]?`-${f[5]}`:"",E=e.includePrerelease&&f[6]?`+${f[6]}`:"";return i(`${a}.${v}.${s}${u}${E}`,e)};l.exports=p}}),Me=O({"../../node_modules/semver/internal/lrucache.js"(c,l){var r=class{constructor(){this.max=1e3,this.map=new Map}get(i){let n=this.map.get(i);if(n!==void 0)return this.map.delete(i),this.map.set(i,n),n}delete(i){return this.map.delete(i)}set(i,n){if(!this.delete(i)&&n!==void 0){if(this.map.size>=this.max){let t=this.map.keys().next().value;this.delete(t)}this.map.set(i,n)}return this}};l.exports=r}}),U=O({"../../node_modules/semver/classes/range.js"(c,l){var r=/\s+/g,i=class K{constructor(m,L){if(L=p(L),m instanceof K)return m.loose===!!L.loose&&m.includePrerelease===!!L.includePrerelease?m:new K(m.raw,L);if(m instanceof h)return this.raw=m.value,this.set=[[m]],this.formatted=void 0,this;if(this.options=L,this.loose=!!L.loose,this.includePrerelease=!!L.includePrerelease,this.raw=m.trim().replace(r," "),this.set=this.raw.split("||").map(R=>this.parseRange(R.trim())).filter(R=>R.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let R=this.set[0];if(this.set=this.set.filter(_=>!T(_[0])),this.set.length===0)this.set=[R];else if(this.set.length>1){for(let _ of this.set)if(_.length===1&&A(_[0])){this.set=[_];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let m=0;m<this.set.length;m++){m>0&&(this.formatted+="||");let L=this.set[m];for(let R=0;R<L.length;R++)R>0&&(this.formatted+=" "),this.formatted+=L[R].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(m){let L=((this.options.includePrerelease&&o)|(this.options.loose&&I))+":"+m,R=t.get(L);if(R)return R;let _=this.options.loose,$=_?a[v.HYPHENRANGELOOSE]:a[v.HYPHENRANGE];m=m.replace($,ae(this.options.includePrerelease)),e("hyphen replace",m),m=m.replace(a[v.COMPARATORTRIM],s),e("comparator trim",m),m=m.replace(a[v.TILDETRIM],u),e("tilde trim",m),m=m.replace(a[v.CARETTRIM],E),e("caret trim",m);let N=m.split(" ").map(j=>D(j,this.options)).join(" ").split(/\s+/).map(j=>se(j,this.options));_&&(N=N.filter(j=>(e("loose invalid filter",j,this.options),!!j.match(a[v.COMPARATORLOOSE])))),e("range list",N);let w=new Map,g=N.map(j=>new h(j,this.options));for(let j of g){if(T(j))return[j];w.set(j.value,j)}w.size>1&&w.has("")&&w.delete("");let x=[...w.values()];return t.set(L,x),x}intersects(m,L){if(!(m instanceof K))throw new TypeError("a Range is required");return this.set.some(R=>y(R,L)&&m.set.some(_=>y(_,L)&&R.every($=>_.every(N=>$.intersects(N,L)))))}test(m){if(!m)return!1;if(typeof m=="string")try{m=new f(m,this.options)}catch{return!1}for(let L=0;L<this.set.length;L++)if(ie(this.set[L],m,this.options))return!0;return!1}};l.exports=i;var n=Me(),t=new n,p=ce(),h=ee(),e=Z(),f=q(),{safeRe:a,t:v,comparatorTrimReplace:s,tildeTrimReplace:u,caretTrimReplace:E}=z(),{FLAG_INCLUDE_PRERELEASE:o,FLAG_LOOSE:I}=Q(),T=d=>d.value==="<0.0.0-0",A=d=>d.value==="",y=(d,m)=>{let L=!0,R=d.slice(),_=R.pop();for(;L&&R.length;)L=R.every($=>_.intersects($,m)),_=R.pop();return L},D=(d,m)=>(e("comp",d,m),d=C(d,m),e("caret",d),d=X(d,m),e("tildes",d),d=S(d,m),e("xrange",d),d=te(d,m),e("stars",d),d),P=d=>!d||d.toLowerCase()==="x"||d==="*",X=(d,m)=>d.trim().split(/\s+/).map(L=>F(L,m)).join(" "),F=(d,m)=>{let L=m.loose?a[v.TILDELOOSE]:a[v.TILDE];return d.replace(L,(R,_,$,N,w)=>{e("tilde",d,R,_,$,N,w);let g;return P(_)?g="":P($)?g=`>=${_}.0.0 <${+_+1}.0.0-0`:P(N)?g=`>=${_}.${$}.0 <${_}.${+$+1}.0-0`:w?(e("replaceTilde pr",w),g=`>=${_}.${$}.${N}-${w} <${_}.${+$+1}.0-0`):g=`>=${_}.${$}.${N} <${_}.${+$+1}.0-0`,e("tilde return",g),g})},C=(d,m)=>d.trim().split(/\s+/).map(L=>G(L,m)).join(" "),G=(d,m)=>{e("caret",d,m);let L=m.loose?a[v.CARETLOOSE]:a[v.CARET],R=m.includePrerelease?"-0":"";return d.replace(L,(_,$,N,w,g)=>{e("caret",d,_,$,N,w,g);let x;return P($)?x="":P(N)?x=`>=${$}.0.0${R} <${+$+1}.0.0-0`:P(w)?$==="0"?x=`>=${$}.${N}.0${R} <${$}.${+N+1}.0-0`:x=`>=${$}.${N}.0${R} <${+$+1}.0.0-0`:g?(e("replaceCaret pr",g),$==="0"?N==="0"?x=`>=${$}.${N}.${w}-${g} <${$}.${N}.${+w+1}-0`:x=`>=${$}.${N}.${w}-${g} <${$}.${+N+1}.0-0`:x=`>=${$}.${N}.${w}-${g} <${+$+1}.0.0-0`):(e("no pr"),$==="0"?N==="0"?x=`>=${$}.${N}.${w}${R} <${$}.${N}.${+w+1}-0`:x=`>=${$}.${N}.${w}${R} <${$}.${+N+1}.0-0`:x=`>=${$}.${N}.${w} <${+$+1}.0.0-0`),e("caret return",x),x})},S=(d,m)=>(e("replaceXRanges",d,m),d.split(/\s+/).map(L=>B(L,m)).join(" ")),B=(d,m)=>{d=d.trim();let L=m.loose?a[v.XRANGELOOSE]:a[v.XRANGE];return d.replace(L,(R,_,$,N,w,g)=>{e("xRange",d,R,_,$,N,w,g);let x=P($),j=x||P(N),M=j||P(w),W=M;return _==="="&&W&&(_=""),g=m.includePrerelease?"-0":"",x?_===">"||_==="<"?R="<0.0.0-0":R="*":_&&W?(j&&(N=0),w=0,_===">"?(_=">=",j?($=+$+1,N=0,w=0):(N=+N+1,w=0)):_==="<="&&(_="<",j?$=+$+1:N=+N+1),_==="<"&&(g="-0"),R=`${_+$}.${N}.${w}${g}`):j?R=`>=${$}.0.0${g} <${+$+1}.0.0-0`:M&&(R=`>=${$}.${N}.0${g} <${$}.${+N+1}.0-0`),e("xRange return",R),R})},te=(d,m)=>(e("replaceStars",d,m),d.trim().replace(a[v.STAR],"")),se=(d,m)=>(e("replaceGTE0",d,m),d.trim().replace(a[m.includePrerelease?v.GTE0PRE:v.GTE0],"")),ae=d=>(m,L,R,_,$,N,w,g,x,j,M,W)=>(P(R)?L="":P(_)?L=`>=${R}.0.0${d?"-0":""}`:P($)?L=`>=${R}.${_}.0${d?"-0":""}`:N?L=`>=${L}`:L=`>=${L}${d?"-0":""}`,P(x)?g="":P(j)?g=`<${+x+1}.0.0-0`:P(M)?g=`<${x}.${+j+1}.0-0`:W?g=`<=${x}.${j}.${M}-${W}`:d?g=`<${x}.${j}.${+M+1}-0`:g=`<=${g}`,`${L} ${g}`.trim()),ie=(d,m,L)=>{for(let R=0;R<d.length;R++)if(!d[R].test(m))return!1;if(m.prerelease.length&&!L.includePrerelease){for(let R=0;R<d.length;R++)if(e(d[R].semver),d[R].semver!==h.ANY&&d[R].semver.prerelease.length>0){let _=d[R].semver;if(_.major===m.major&&_.minor===m.minor&&_.patch===m.patch)return!0}return!1}return!0}}}),ee=O({"../../node_modules/semver/classes/comparator.js"(c,l){var r=Symbol("SemVer ANY"),i=class ue{static get ANY(){return r}constructor(s,u){if(u=n(u),s instanceof ue){if(s.loose===!!u.loose)return s;s=s.value}s=s.trim().split(/\s+/).join(" "),e("comparator",s,u),this.options=u,this.loose=!!u.loose,this.parse(s),this.semver===r?this.value="":this.value=this.operator+this.semver.version,e("comp",this)}parse(s){let u=this.options.loose?t[p.COMPARATORLOOSE]:t[p.COMPARATOR],E=s.match(u);if(!E)throw new TypeError(`Invalid comparator: ${s}`);this.operator=E[1]!==void 0?E[1]:"",this.operator==="="&&(this.operator=""),E[2]?this.semver=new f(E[2],this.options.loose):this.semver=r}toString(){return this.value}test(s){if(e("Comparator.test",s,this.options.loose),this.semver===r||s===r)return!0;if(typeof s=="string")try{s=new f(s,this.options)}catch{return!1}return h(s,this.operator,this.semver,this.options)}intersects(s,u){if(!(s instanceof ue))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new a(s.value,u).test(this.value):s.operator===""?s.value===""?!0:new a(this.value,u).test(s.semver):(u=n(u),u.includePrerelease&&(this.value==="<0.0.0-0"||s.value==="<0.0.0-0")||!u.includePrerelease&&(this.value.startsWith("<0.0.0")||s.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&s.operator.startsWith(">")||this.operator.startsWith("<")&&s.operator.startsWith("<")||this.semver.version===s.semver.version&&this.operator.includes("=")&&s.operator.includes("=")||h(this.semver,"<",s.semver,u)&&this.operator.startsWith(">")&&s.operator.startsWith("<")||h(this.semver,">",s.semver,u)&&this.operator.startsWith("<")&&s.operator.startsWith(">")))}};l.exports=i;var n=ce(),{safeRe:t,t:p}=z(),h=Oe(),e=Z(),f=q(),a=U()}}),re=O({"../../node_modules/semver/functions/satisfies.js"(c,l){var r=U(),i=(n,t,p)=>{try{t=new r(t,p)}catch{return!1}return t.test(n)};l.exports=i}}),He=O({"../../node_modules/semver/ranges/to-comparators.js"(c,l){var r=U(),i=(n,t)=>new r(n,t).set.map(p=>p.map(h=>h.value).join(" ").trim().split(" "));l.exports=i}}),Be=O({"../../node_modules/semver/ranges/max-satisfying.js"(c,l){var r=q(),i=U(),n=(t,p,h)=>{let e=null,f=null,a=null;try{a=new i(p,h)}catch{return null}return t.forEach(v=>{a.test(v)&&(!e||f.compare(v)===-1)&&(e=v,f=new r(e,h))}),e};l.exports=n}}),We=O({"../../node_modules/semver/ranges/min-satisfying.js"(c,l){var r=q(),i=U(),n=(t,p,h)=>{let e=null,f=null,a=null;try{a=new i(p,h)}catch{return null}return t.forEach(v=>{a.test(v)&&(!e||f.compare(v)===1)&&(e=v,f=new r(e,h))}),e};l.exports=n}}),Ye=O({"../../node_modules/semver/ranges/min-version.js"(c,l){var r=q(),i=U(),n=J(),t=(p,h)=>{p=new i(p,h);let e=new r("0.0.0");if(p.test(e)||(e=new r("0.0.0-0"),p.test(e)))return e;e=null;for(let f=0;f<p.set.length;++f){let a=p.set[f],v=null;a.forEach(s=>{let u=new r(s.semver.version);switch(s.operator){case">":u.prerelease.length===0?u.patch++:u.prerelease.push(0),u.raw=u.format();case"":case">=":(!v||n(u,v))&&(v=u);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),v&&(!e||n(e,v))&&(e=v)}return e&&p.test(e)?e:null};l.exports=t}}),ze=O({"../../node_modules/semver/ranges/valid.js"(c,l){var r=U(),i=(n,t)=>{try{return new r(n,t).range||"*"}catch{return null}};l.exports=i}}),de=O({"../../node_modules/semver/ranges/outside.js"(c,l){var r=q(),i=ee(),{ANY:n}=i,t=U(),p=re(),h=J(),e=he(),f=ve(),a=fe(),v=(s,u,E,o)=>{s=new r(s,o),u=new t(u,o);let I,T,A,y,D;switch(E){case">":I=h,T=f,A=e,y=">",D=">=";break;case"<":I=e,T=a,A=h,y="<",D="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(p(s,u,o))return!1;for(let P=0;P<u.set.length;++P){let X=u.set[P],F=null,C=null;if(X.forEach(G=>{G.semver===n&&(G=new i(">=0.0.0")),F=F||G,C=C||G,I(G.semver,F.semver,o)?F=G:A(G.semver,C.semver,o)&&(C=G)}),F.operator===y||F.operator===D||(!C.operator||C.operator===y)&&T(s,C.semver)||C.operator===D&&A(s,C.semver))return!1}return!0};l.exports=v}}),Ke=O({"../../node_modules/semver/ranges/gtr.js"(c,l){var r=de(),i=(n,t,p)=>r(n,t,">",p);l.exports=i}}),Qe=O({"../../node_modules/semver/ranges/ltr.js"(c,l){var r=de(),i=(n,t,p)=>r(n,t,"<",p);l.exports=i}}),Ze=O({"../../node_modules/semver/ranges/intersects.js"(c,l){var r=U(),i=(n,t,p)=>(n=new r(n,p),t=new r(t,p),n.intersects(t,p));l.exports=i}}),Je=O({"../../node_modules/semver/ranges/simplify.js"(c,l){var r=re(),i=V();l.exports=(n,t,p)=>{let h=[],e=null,f=null,a=n.sort((E,o)=>i(E,o,p));for(let E of a)r(E,t,p)?(f=E,e||(e=E)):(f&&h.push([e,f]),f=null,e=null);e&&h.push([e,null]);let v=[];for(let[E,o]of h)E===o?v.push(E):!o&&E===a[0]?v.push("*"):o?E===a[0]?v.push(`<=${o}`):v.push(`${E} - ${o}`):v.push(`>=${E}`);let s=v.join(" || "),u=typeof t.raw=="string"?t.raw:String(t);return s.length<u.length?s:t}}}),er=O({"../../node_modules/semver/ranges/subset.js"(c,l){var r=U(),i=ee(),{ANY:n}=i,t=re(),p=V(),h=(u,E,o={})=>{if(u===E)return!0;u=new r(u,o),E=new r(E,o);let I=!1;e:for(let T of u.set){for(let A of E.set){let y=a(T,A,o);if(I=I||y!==null,y)continue e}if(I)return!1}return!0},e=[new i(">=0.0.0-0")],f=[new i(">=0.0.0")],a=(u,E,o)=>{if(u===E)return!0;if(u.length===1&&u[0].semver===n){if(E.length===1&&E[0].semver===n)return!0;o.includePrerelease?u=e:u=f}if(E.length===1&&E[0].semver===n){if(o.includePrerelease)return!0;E=f}let I=new Set,T,A;for(let S of u)S.operator===">"||S.operator===">="?T=v(T,S,o):S.operator==="<"||S.operator==="<="?A=s(A,S,o):I.add(S.semver);if(I.size>1)return null;let y;if(T&&A&&(y=p(T.semver,A.semver,o),y>0||y===0&&(T.operator!==">="||A.operator!=="<=")))return null;for(let S of I){if(T&&!t(S,String(T),o)||A&&!t(S,String(A),o))return null;for(let B of E)if(!t(S,String(B),o))return!1;return!0}let D,P,X,F,C=A&&!o.includePrerelease&&A.semver.prerelease.length?A.semver:!1,G=T&&!o.includePrerelease&&T.semver.prerelease.length?T.semver:!1;C&&C.prerelease.length===1&&A.operator==="<"&&C.prerelease[0]===0&&(C=!1);for(let S of E){if(F=F||S.operator===">"||S.operator===">=",X=X||S.operator==="<"||S.operator==="<=",T){if(G&&S.semver.prerelease&&S.semver.prerelease.length&&S.semver.major===G.major&&S.semver.minor===G.minor&&S.semver.patch===G.patch&&(G=!1),S.operator===">"||S.operator===">="){if(D=v(T,S,o),D===S&&D!==T)return!1}else if(T.operator===">="&&!t(T.semver,String(S),o))return!1}if(A){if(C&&S.semver.prerelease&&S.semver.prerelease.length&&S.semver.major===C.major&&S.semver.minor===C.minor&&S.semver.patch===C.patch&&(C=!1),S.operator==="<"||S.operator==="<="){if(P=s(A,S,o),P===S&&P!==A)return!1}else if(A.operator==="<="&&!t(A.semver,String(S),o))return!1}if(!S.operator&&(A||T)&&y!==0)return!1}return!(T&&X&&!A&&y!==0||A&&F&&!T&&y!==0||G||C)},v=(u,E,o)=>{if(!u)return E;let I=p(u.semver,E.semver,o);return I>0?u:I<0||E.operator===">"&&u.operator===">="?E:u},s=(u,E,o)=>{if(!u)return E;let I=p(u.semver,E.semver,o);return I<0?u:I>0||E.operator==="<"&&u.operator==="<="?E:u};l.exports=h}}),rr=O({"../../node_modules/semver/index.js"(c,l){var r=z(),i=Q(),n=q(),t=Le(),p=H(),h=je(),e=Pe(),f=Ce(),a=ye(),v=De(),s=Ge(),u=qe(),E=Fe(),o=V(),I=Ve(),T=Ue(),A=me(),y=be(),D=Xe(),P=J(),X=he(),F=_e(),C=Ne(),G=fe(),S=ve(),B=Oe(),te=ke(),se=ee(),ae=U(),ie=re(),d=He(),m=Be(),L=We(),R=Ye(),_=ze(),$=de(),N=Ke(),w=Qe(),g=Ze(),x=Je(),j=er();l.exports={parse:p,valid:h,clean:e,inc:f,diff:a,major:v,minor:s,patch:u,prerelease:E,compare:o,rcompare:I,compareLoose:T,compareBuild:A,sort:y,rsort:D,gt:P,lt:X,eq:F,neq:C,gte:G,lte:S,cmp:B,coerce:te,Comparator:se,Range:ae,satisfies:ie,toComparators:d,maxSatisfying:m,minSatisfying:L,minVersion:R,validRange:_,outside:$,gtr:N,ltr:w,intersects:g,simplifyRange:x,subset:j,SemVer:n,re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:t.compareIdentifiers,rcompareIdentifiers:t.rcompareIdentifiers}}}),tr={};ge(tr,{beforeAll:()=>Er,decorators:()=>pr,mount:()=>or,parameters:()=>ur,render:()=>ir,renderToCanvas:()=>lr});var Re=Ae(rr()),sr={...we};function $e(c){globalThis.IS_REACT_ACT_ENVIRONMENT=c}function ar(){return globalThis.IS_REACT_ACT_ENVIRONMENT}var Se=async()=>{var c;if(typeof sr.act!="function"){let l=await Ee(()=>import("./test-utils-BBHUGUfi.js").then(r=>r.t),__vite__mapDeps([0,1,2]),import.meta.url);((c=l==null?void 0:l.default)==null?void 0:c.act)??l.act}return l=>l()},ir=(c,l)=>{let{id:r,component:i}=l;if(!i)throw new Error(`Unable to render story ${r} as the component annotation is missing from the default export`);return Y.createElement(i,{...c})},{FRAMEWORK_OPTIONS:le}=xe,nr=class extends k.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidMount(){let{hasError:c}=this.state,{showMain:l}=this.props;c||l()}componentDidCatch(c){let{showException:l}=this.props;l(c)}render(){let{hasError:c}=this.state,{children:l}=this.props;return c?null:l}},Ie=le!=null&&le.strictMode?k.StrictMode:k.Fragment,pe=[],oe=!1,Te=async()=>{if(oe||pe.length===0)return;oe=!0;let c=pe.shift();c&&await c(),oe=!1,Te()};async function lr({storyContext:c,unboundStoryFn:l,showMain:r,showException:i,forceRemount:n},t){let{renderElement:p,unmountElement:h}=await Ee(async()=>{const{renderElement:s,unmountElement:u}=await import("./react-18-BdgjDjvZ.js");return{renderElement:s,unmountElement:u}},__vite__mapDeps([3,1,4,2]),import.meta.url),e=l,f=c.parameters.__isPortableStory?Y.createElement(e,{...c}):Y.createElement(nr,{showMain:r,showException:i},Y.createElement(e,{...c})),a=Ie?Y.createElement(Ie,null,f):f;n&&h(t);let v=await Se();return await new Promise(async(s,u)=>{pe.push(async()=>{try{await v(async()=>{var E,o;await p(a,t,(o=(E=c==null?void 0:c.parameters)==null?void 0:E.react)==null?void 0:o.rootOptions)}),s()}catch(E){u(E)}}),Te()}),async()=>{await v(()=>{h(t)})}}var or=c=>async l=>(l!=null&&(c.originalStoryFn=()=>l),await c.renderToCanvas(),c.canvas),ur={renderer:"react"},pr=[(c,l)=>{var n,t;if(!((t=(n=l.parameters)==null?void 0:n.react)!=null&&t.rsc))return c();let r=Re.default.major(k.version),i=Re.default.minor(k.version);if(r<18||r===18&&i<3)throw new Error("React Server Components require React >= 18.3");return k.createElement(k.Suspense,null,c())}],Er=async()=>{try{let{configure:c}=await Ee(async()=>{const{configure:r}=await Promise.resolve().then(()=>mr);return{configure:r}},void 0,import.meta.url),l=await Se();c({unstable_advanceTimersWrapper:r=>l(r),asyncWrapper:async r=>{let i=ar();$e(!1);try{let n=await r();return await new Promise(t=>{setTimeout(()=>{t()},0),cr()&&jest.advanceTimersByTime(0)}),n}finally{$e(i)}},eventWrapper:r=>{let i;return l(()=>(i=r(),i)),i}})}catch{}};function cr(){return typeof jest<"u"&&jest!==null?setTimeout._isMockFunction===!0||Object.prototype.hasOwnProperty.call(setTimeout,"clock"):!1}const mr=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{Er as beforeAll,pr as decorators,or as mount,ur as parameters,ir as render,lr as renderToCanvas};
2
+ import{_ as Ee}from"./iframe-B41g-Bdk.js";import{_ as Ae,a as O,d as ge}from"./chunk-XP5HYGXS-D5tuasO7.js";import{r as k,R as Y,b as we}from"./index-YTOF1_EJ.js";var ne={};const{global:xe}=__STORYBOOK_MODULE_GLOBAL__;var Q=O({"../../node_modules/semver/internal/constants.js"(c,l){var r="2.0.0",i=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,t=250,p=["major","premajor","minor","preminor","patch","prepatch","prerelease"];l.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:t,MAX_SAFE_INTEGER:i,RELEASE_TYPES:p,SEMVER_SPEC_VERSION:r,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}}),Z=O({"../../node_modules/semver/internal/debug.js"(c,l){var r=typeof process=="object"&&ne&&ne.NODE_DEBUG&&/\bsemver\b/i.test(ne.NODE_DEBUG)?(...i)=>console.error("SEMVER",...i):()=>{};l.exports=r}}),z=O({"../../node_modules/semver/internal/re.js"(c,l){var{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:n}=Q(),t=Z();c=l.exports={};var p=c.re=[],h=c.safeRe=[],e=c.src=[],f=c.safeSrc=[],a=c.t={},v=0,s="[a-zA-Z0-9-]",u=[["\\s",1],["\\d",n],[s,i]],E=I=>{for(let[T,A]of u)I=I.split(`${T}*`).join(`${T}{0,${A}}`).split(`${T}+`).join(`${T}{1,${A}}`);return I},o=(I,T,A)=>{let y=E(T),D=v++;t(I,D,T),a[I]=D,e[D]=T,f[D]=y,p[D]=new RegExp(T,A?"g":void 0),h[D]=new RegExp(y,A?"g":void 0)};o("NUMERICIDENTIFIER","0|[1-9]\\d*"),o("NUMERICIDENTIFIERLOOSE","\\d+"),o("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${s}*`),o("MAINVERSION",`(${e[a.NUMERICIDENTIFIER]})\\.(${e[a.NUMERICIDENTIFIER]})\\.(${e[a.NUMERICIDENTIFIER]})`),o("MAINVERSIONLOOSE",`(${e[a.NUMERICIDENTIFIERLOOSE]})\\.(${e[a.NUMERICIDENTIFIERLOOSE]})\\.(${e[a.NUMERICIDENTIFIERLOOSE]})`),o("PRERELEASEIDENTIFIER",`(?:${e[a.NUMERICIDENTIFIER]}|${e[a.NONNUMERICIDENTIFIER]})`),o("PRERELEASEIDENTIFIERLOOSE",`(?:${e[a.NUMERICIDENTIFIERLOOSE]}|${e[a.NONNUMERICIDENTIFIER]})`),o("PRERELEASE",`(?:-(${e[a.PRERELEASEIDENTIFIER]}(?:\\.${e[a.PRERELEASEIDENTIFIER]})*))`),o("PRERELEASELOOSE",`(?:-?(${e[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${e[a.PRERELEASEIDENTIFIERLOOSE]})*))`),o("BUILDIDENTIFIER",`${s}+`),o("BUILD",`(?:\\+(${e[a.BUILDIDENTIFIER]}(?:\\.${e[a.BUILDIDENTIFIER]})*))`),o("FULLPLAIN",`v?${e[a.MAINVERSION]}${e[a.PRERELEASE]}?${e[a.BUILD]}?`),o("FULL",`^${e[a.FULLPLAIN]}$`),o("LOOSEPLAIN",`[v=\\s]*${e[a.MAINVERSIONLOOSE]}${e[a.PRERELEASELOOSE]}?${e[a.BUILD]}?`),o("LOOSE",`^${e[a.LOOSEPLAIN]}$`),o("GTLT","((?:<|>)?=?)"),o("XRANGEIDENTIFIERLOOSE",`${e[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),o("XRANGEIDENTIFIER",`${e[a.NUMERICIDENTIFIER]}|x|X|\\*`),o("XRANGEPLAIN",`[v=\\s]*(${e[a.XRANGEIDENTIFIER]})(?:\\.(${e[a.XRANGEIDENTIFIER]})(?:\\.(${e[a.XRANGEIDENTIFIER]})(?:${e[a.PRERELEASE]})?${e[a.BUILD]}?)?)?`),o("XRANGEPLAINLOOSE",`[v=\\s]*(${e[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${e[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${e[a.XRANGEIDENTIFIERLOOSE]})(?:${e[a.PRERELEASELOOSE]})?${e[a.BUILD]}?)?)?`),o("XRANGE",`^${e[a.GTLT]}\\s*${e[a.XRANGEPLAIN]}$`),o("XRANGELOOSE",`^${e[a.GTLT]}\\s*${e[a.XRANGEPLAINLOOSE]}$`),o("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),o("COERCE",`${e[a.COERCEPLAIN]}(?:$|[^\\d])`),o("COERCEFULL",e[a.COERCEPLAIN]+`(?:${e[a.PRERELEASE]})?(?:${e[a.BUILD]})?(?:$|[^\\d])`),o("COERCERTL",e[a.COERCE],!0),o("COERCERTLFULL",e[a.COERCEFULL],!0),o("LONETILDE","(?:~>?)"),o("TILDETRIM",`(\\s*)${e[a.LONETILDE]}\\s+`,!0),c.tildeTrimReplace="$1~",o("TILDE",`^${e[a.LONETILDE]}${e[a.XRANGEPLAIN]}$`),o("TILDELOOSE",`^${e[a.LONETILDE]}${e[a.XRANGEPLAINLOOSE]}$`),o("LONECARET","(?:\\^)"),o("CARETTRIM",`(\\s*)${e[a.LONECARET]}\\s+`,!0),c.caretTrimReplace="$1^",o("CARET",`^${e[a.LONECARET]}${e[a.XRANGEPLAIN]}$`),o("CARETLOOSE",`^${e[a.LONECARET]}${e[a.XRANGEPLAINLOOSE]}$`),o("COMPARATORLOOSE",`^${e[a.GTLT]}\\s*(${e[a.LOOSEPLAIN]})$|^$`),o("COMPARATOR",`^${e[a.GTLT]}\\s*(${e[a.FULLPLAIN]})$|^$`),o("COMPARATORTRIM",`(\\s*)${e[a.GTLT]}\\s*(${e[a.LOOSEPLAIN]}|${e[a.XRANGEPLAIN]})`,!0),c.comparatorTrimReplace="$1$2$3",o("HYPHENRANGE",`^\\s*(${e[a.XRANGEPLAIN]})\\s+-\\s+(${e[a.XRANGEPLAIN]})\\s*$`),o("HYPHENRANGELOOSE",`^\\s*(${e[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${e[a.XRANGEPLAINLOOSE]})\\s*$`),o("STAR","(<|>)?=?\\s*\\*"),o("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),o("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}}),ce=O({"../../node_modules/semver/internal/parse-options.js"(c,l){var r=Object.freeze({loose:!0}),i=Object.freeze({}),n=t=>t?typeof t!="object"?r:t:i;l.exports=n}}),Le=O({"../../node_modules/semver/internal/identifiers.js"(c,l){var r=/^[0-9]+$/,i=(t,p)=>{let h=r.test(t),e=r.test(p);return h&&e&&(t=+t,p=+p),t===p?0:h&&!e?-1:e&&!h?1:t<p?-1:1},n=(t,p)=>i(p,t);l.exports={compareIdentifiers:i,rcompareIdentifiers:n}}}),q=O({"../../node_modules/semver/classes/semver.js"(c,l){var r=Z(),{MAX_LENGTH:i,MAX_SAFE_INTEGER:n}=Q(),{safeRe:t,safeSrc:p,t:h}=z(),e=ce(),{compareIdentifiers:f}=Le(),a=class b{constructor(s,u){if(u=e(u),s instanceof b){if(s.loose===!!u.loose&&s.includePrerelease===!!u.includePrerelease)return s;s=s.version}else if(typeof s!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof s}".`);if(s.length>i)throw new TypeError(`version is longer than ${i} characters`);r("SemVer",s,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;let E=s.trim().match(u.loose?t[h.LOOSE]:t[h.FULL]);if(!E)throw new TypeError(`Invalid Version: ${s}`);if(this.raw=s,this.major=+E[1],this.minor=+E[2],this.patch=+E[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");E[4]?this.prerelease=E[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let I=+o;if(I>=0&&I<n)return I}return o}):this.prerelease=[],this.build=E[5]?E[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(s){if(r("SemVer.compare",this.version,this.options,s),!(s instanceof b)){if(typeof s=="string"&&s===this.version)return 0;s=new b(s,this.options)}return s.version===this.version?0:this.compareMain(s)||this.comparePre(s)}compareMain(s){return s instanceof b||(s=new b(s,this.options)),f(this.major,s.major)||f(this.minor,s.minor)||f(this.patch,s.patch)}comparePre(s){if(s instanceof b||(s=new b(s,this.options)),this.prerelease.length&&!s.prerelease.length)return-1;if(!this.prerelease.length&&s.prerelease.length)return 1;if(!this.prerelease.length&&!s.prerelease.length)return 0;let u=0;do{let E=this.prerelease[u],o=s.prerelease[u];if(r("prerelease compare",u,E,o),E===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(E===void 0)return-1;if(E!==o)return f(E,o)}while(++u)}compareBuild(s){s instanceof b||(s=new b(s,this.options));let u=0;do{let E=this.build[u],o=s.build[u];if(r("build compare",u,E,o),E===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(E===void 0)return-1;if(E!==o)return f(E,o)}while(++u)}inc(s,u,E){if(s.startsWith("pre")){if(!u&&E===!1)throw new Error("invalid increment argument: identifier is empty");if(u){let o=new RegExp(`^${this.options.loose?p[h.PRERELEASELOOSE]:p[h.PRERELEASE]}$`),I=`-${u}`.match(o);if(!I||I[1]!==u)throw new Error(`invalid identifier: ${u}`)}}switch(s){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",u,E);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",u,E);break;case"prepatch":this.prerelease.length=0,this.inc("patch",u,E),this.inc("pre",u,E);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",u,E),this.inc("pre",u,E);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(E)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let I=this.prerelease.length;for(;--I>=0;)typeof this.prerelease[I]=="number"&&(this.prerelease[I]++,I=-2);if(I===-1){if(u===this.prerelease.join(".")&&E===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(u){let I=[u,o];E===!1&&(I=[u]),f(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=I):this.prerelease=I}break}default:throw new Error(`invalid increment argument: ${s}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};l.exports=a}}),H=O({"../../node_modules/semver/functions/parse.js"(c,l){var r=q(),i=(n,t,p=!1)=>{if(n instanceof r)return n;try{return new r(n,t)}catch(h){if(!p)return null;throw h}};l.exports=i}}),je=O({"../../node_modules/semver/functions/valid.js"(c,l){var r=H(),i=(n,t)=>{let p=r(n,t);return p?p.version:null};l.exports=i}}),Pe=O({"../../node_modules/semver/functions/clean.js"(c,l){var r=H(),i=(n,t)=>{let p=r(n.trim().replace(/^[=v]+/,""),t);return p?p.version:null};l.exports=i}}),Ce=O({"../../node_modules/semver/functions/inc.js"(c,l){var r=q(),i=(n,t,p,h,e)=>{typeof p=="string"&&(e=h,h=p,p=void 0);try{return new r(n instanceof r?n.version:n,p).inc(t,h,e).version}catch{return null}};l.exports=i}}),ye=O({"../../node_modules/semver/functions/diff.js"(c,l){var r=H(),i=(n,t)=>{let p=r(n,null,!0),h=r(t,null,!0),e=p.compare(h);if(e===0)return null;let f=e>0,a=f?p:h,v=f?h:p,s=!!a.prerelease.length;if(v.prerelease.length&&!s){if(!v.patch&&!v.minor)return"major";if(v.compareMain(a)===0)return v.minor&&!v.patch?"minor":"patch"}let u=s?"pre":"";return p.major!==h.major?u+"major":p.minor!==h.minor?u+"minor":p.patch!==h.patch?u+"patch":"prerelease"};l.exports=i}}),De=O({"../../node_modules/semver/functions/major.js"(c,l){var r=q(),i=(n,t)=>new r(n,t).major;l.exports=i}}),Ge=O({"../../node_modules/semver/functions/minor.js"(c,l){var r=q(),i=(n,t)=>new r(n,t).minor;l.exports=i}}),qe=O({"../../node_modules/semver/functions/patch.js"(c,l){var r=q(),i=(n,t)=>new r(n,t).patch;l.exports=i}}),Fe=O({"../../node_modules/semver/functions/prerelease.js"(c,l){var r=H(),i=(n,t)=>{let p=r(n,t);return p&&p.prerelease.length?p.prerelease:null};l.exports=i}}),V=O({"../../node_modules/semver/functions/compare.js"(c,l){var r=q(),i=(n,t,p)=>new r(n,p).compare(new r(t,p));l.exports=i}}),Ve=O({"../../node_modules/semver/functions/rcompare.js"(c,l){var r=V(),i=(n,t,p)=>r(t,n,p);l.exports=i}}),Ue=O({"../../node_modules/semver/functions/compare-loose.js"(c,l){var r=V(),i=(n,t)=>r(n,t,!0);l.exports=i}}),me=O({"../../node_modules/semver/functions/compare-build.js"(c,l){var r=q(),i=(n,t,p)=>{let h=new r(n,p),e=new r(t,p);return h.compare(e)||h.compareBuild(e)};l.exports=i}}),be=O({"../../node_modules/semver/functions/sort.js"(c,l){var r=me(),i=(n,t)=>n.sort((p,h)=>r(p,h,t));l.exports=i}}),Xe=O({"../../node_modules/semver/functions/rsort.js"(c,l){var r=me(),i=(n,t)=>n.sort((p,h)=>r(h,p,t));l.exports=i}}),J=O({"../../node_modules/semver/functions/gt.js"(c,l){var r=V(),i=(n,t,p)=>r(n,t,p)>0;l.exports=i}}),he=O({"../../node_modules/semver/functions/lt.js"(c,l){var r=V(),i=(n,t,p)=>r(n,t,p)<0;l.exports=i}}),_e=O({"../../node_modules/semver/functions/eq.js"(c,l){var r=V(),i=(n,t,p)=>r(n,t,p)===0;l.exports=i}}),Ne=O({"../../node_modules/semver/functions/neq.js"(c,l){var r=V(),i=(n,t,p)=>r(n,t,p)!==0;l.exports=i}}),fe=O({"../../node_modules/semver/functions/gte.js"(c,l){var r=V(),i=(n,t,p)=>r(n,t,p)>=0;l.exports=i}}),ve=O({"../../node_modules/semver/functions/lte.js"(c,l){var r=V(),i=(n,t,p)=>r(n,t,p)<=0;l.exports=i}}),Oe=O({"../../node_modules/semver/functions/cmp.js"(c,l){var r=_e(),i=Ne(),n=J(),t=fe(),p=he(),h=ve(),e=(f,a,v,s)=>{switch(a){case"===":return typeof f=="object"&&(f=f.version),typeof v=="object"&&(v=v.version),f===v;case"!==":return typeof f=="object"&&(f=f.version),typeof v=="object"&&(v=v.version),f!==v;case"":case"=":case"==":return r(f,v,s);case"!=":return i(f,v,s);case">":return n(f,v,s);case">=":return t(f,v,s);case"<":return p(f,v,s);case"<=":return h(f,v,s);default:throw new TypeError(`Invalid operator: ${a}`)}};l.exports=e}}),ke=O({"../../node_modules/semver/functions/coerce.js"(c,l){var r=q(),i=H(),{safeRe:n,t}=z(),p=(h,e)=>{if(h instanceof r)return h;if(typeof h=="number"&&(h=String(h)),typeof h!="string")return null;e=e||{};let f=null;if(!e.rtl)f=h.match(e.includePrerelease?n[t.COERCEFULL]:n[t.COERCE]);else{let o=e.includePrerelease?n[t.COERCERTLFULL]:n[t.COERCERTL],I;for(;(I=o.exec(h))&&(!f||f.index+f[0].length!==h.length);)(!f||I.index+I[0].length!==f.index+f[0].length)&&(f=I),o.lastIndex=I.index+I[1].length+I[2].length;o.lastIndex=-1}if(f===null)return null;let a=f[2],v=f[3]||"0",s=f[4]||"0",u=e.includePrerelease&&f[5]?`-${f[5]}`:"",E=e.includePrerelease&&f[6]?`+${f[6]}`:"";return i(`${a}.${v}.${s}${u}${E}`,e)};l.exports=p}}),Me=O({"../../node_modules/semver/internal/lrucache.js"(c,l){var r=class{constructor(){this.max=1e3,this.map=new Map}get(i){let n=this.map.get(i);if(n!==void 0)return this.map.delete(i),this.map.set(i,n),n}delete(i){return this.map.delete(i)}set(i,n){if(!this.delete(i)&&n!==void 0){if(this.map.size>=this.max){let t=this.map.keys().next().value;this.delete(t)}this.map.set(i,n)}return this}};l.exports=r}}),U=O({"../../node_modules/semver/classes/range.js"(c,l){var r=/\s+/g,i=class K{constructor(m,L){if(L=p(L),m instanceof K)return m.loose===!!L.loose&&m.includePrerelease===!!L.includePrerelease?m:new K(m.raw,L);if(m instanceof h)return this.raw=m.value,this.set=[[m]],this.formatted=void 0,this;if(this.options=L,this.loose=!!L.loose,this.includePrerelease=!!L.includePrerelease,this.raw=m.trim().replace(r," "),this.set=this.raw.split("||").map(R=>this.parseRange(R.trim())).filter(R=>R.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let R=this.set[0];if(this.set=this.set.filter(_=>!T(_[0])),this.set.length===0)this.set=[R];else if(this.set.length>1){for(let _ of this.set)if(_.length===1&&A(_[0])){this.set=[_];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let m=0;m<this.set.length;m++){m>0&&(this.formatted+="||");let L=this.set[m];for(let R=0;R<L.length;R++)R>0&&(this.formatted+=" "),this.formatted+=L[R].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(m){let L=((this.options.includePrerelease&&o)|(this.options.loose&&I))+":"+m,R=t.get(L);if(R)return R;let _=this.options.loose,$=_?a[v.HYPHENRANGELOOSE]:a[v.HYPHENRANGE];m=m.replace($,ae(this.options.includePrerelease)),e("hyphen replace",m),m=m.replace(a[v.COMPARATORTRIM],s),e("comparator trim",m),m=m.replace(a[v.TILDETRIM],u),e("tilde trim",m),m=m.replace(a[v.CARETTRIM],E),e("caret trim",m);let N=m.split(" ").map(j=>D(j,this.options)).join(" ").split(/\s+/).map(j=>se(j,this.options));_&&(N=N.filter(j=>(e("loose invalid filter",j,this.options),!!j.match(a[v.COMPARATORLOOSE])))),e("range list",N);let w=new Map,g=N.map(j=>new h(j,this.options));for(let j of g){if(T(j))return[j];w.set(j.value,j)}w.size>1&&w.has("")&&w.delete("");let x=[...w.values()];return t.set(L,x),x}intersects(m,L){if(!(m instanceof K))throw new TypeError("a Range is required");return this.set.some(R=>y(R,L)&&m.set.some(_=>y(_,L)&&R.every($=>_.every(N=>$.intersects(N,L)))))}test(m){if(!m)return!1;if(typeof m=="string")try{m=new f(m,this.options)}catch{return!1}for(let L=0;L<this.set.length;L++)if(ie(this.set[L],m,this.options))return!0;return!1}};l.exports=i;var n=Me(),t=new n,p=ce(),h=ee(),e=Z(),f=q(),{safeRe:a,t:v,comparatorTrimReplace:s,tildeTrimReplace:u,caretTrimReplace:E}=z(),{FLAG_INCLUDE_PRERELEASE:o,FLAG_LOOSE:I}=Q(),T=d=>d.value==="<0.0.0-0",A=d=>d.value==="",y=(d,m)=>{let L=!0,R=d.slice(),_=R.pop();for(;L&&R.length;)L=R.every($=>_.intersects($,m)),_=R.pop();return L},D=(d,m)=>(e("comp",d,m),d=C(d,m),e("caret",d),d=X(d,m),e("tildes",d),d=S(d,m),e("xrange",d),d=te(d,m),e("stars",d),d),P=d=>!d||d.toLowerCase()==="x"||d==="*",X=(d,m)=>d.trim().split(/\s+/).map(L=>F(L,m)).join(" "),F=(d,m)=>{let L=m.loose?a[v.TILDELOOSE]:a[v.TILDE];return d.replace(L,(R,_,$,N,w)=>{e("tilde",d,R,_,$,N,w);let g;return P(_)?g="":P($)?g=`>=${_}.0.0 <${+_+1}.0.0-0`:P(N)?g=`>=${_}.${$}.0 <${_}.${+$+1}.0-0`:w?(e("replaceTilde pr",w),g=`>=${_}.${$}.${N}-${w} <${_}.${+$+1}.0-0`):g=`>=${_}.${$}.${N} <${_}.${+$+1}.0-0`,e("tilde return",g),g})},C=(d,m)=>d.trim().split(/\s+/).map(L=>G(L,m)).join(" "),G=(d,m)=>{e("caret",d,m);let L=m.loose?a[v.CARETLOOSE]:a[v.CARET],R=m.includePrerelease?"-0":"";return d.replace(L,(_,$,N,w,g)=>{e("caret",d,_,$,N,w,g);let x;return P($)?x="":P(N)?x=`>=${$}.0.0${R} <${+$+1}.0.0-0`:P(w)?$==="0"?x=`>=${$}.${N}.0${R} <${$}.${+N+1}.0-0`:x=`>=${$}.${N}.0${R} <${+$+1}.0.0-0`:g?(e("replaceCaret pr",g),$==="0"?N==="0"?x=`>=${$}.${N}.${w}-${g} <${$}.${N}.${+w+1}-0`:x=`>=${$}.${N}.${w}-${g} <${$}.${+N+1}.0-0`:x=`>=${$}.${N}.${w}-${g} <${+$+1}.0.0-0`):(e("no pr"),$==="0"?N==="0"?x=`>=${$}.${N}.${w}${R} <${$}.${N}.${+w+1}-0`:x=`>=${$}.${N}.${w}${R} <${$}.${+N+1}.0-0`:x=`>=${$}.${N}.${w} <${+$+1}.0.0-0`),e("caret return",x),x})},S=(d,m)=>(e("replaceXRanges",d,m),d.split(/\s+/).map(L=>B(L,m)).join(" ")),B=(d,m)=>{d=d.trim();let L=m.loose?a[v.XRANGELOOSE]:a[v.XRANGE];return d.replace(L,(R,_,$,N,w,g)=>{e("xRange",d,R,_,$,N,w,g);let x=P($),j=x||P(N),M=j||P(w),W=M;return _==="="&&W&&(_=""),g=m.includePrerelease?"-0":"",x?_===">"||_==="<"?R="<0.0.0-0":R="*":_&&W?(j&&(N=0),w=0,_===">"?(_=">=",j?($=+$+1,N=0,w=0):(N=+N+1,w=0)):_==="<="&&(_="<",j?$=+$+1:N=+N+1),_==="<"&&(g="-0"),R=`${_+$}.${N}.${w}${g}`):j?R=`>=${$}.0.0${g} <${+$+1}.0.0-0`:M&&(R=`>=${$}.${N}.0${g} <${$}.${+N+1}.0-0`),e("xRange return",R),R})},te=(d,m)=>(e("replaceStars",d,m),d.trim().replace(a[v.STAR],"")),se=(d,m)=>(e("replaceGTE0",d,m),d.trim().replace(a[m.includePrerelease?v.GTE0PRE:v.GTE0],"")),ae=d=>(m,L,R,_,$,N,w,g,x,j,M,W)=>(P(R)?L="":P(_)?L=`>=${R}.0.0${d?"-0":""}`:P($)?L=`>=${R}.${_}.0${d?"-0":""}`:N?L=`>=${L}`:L=`>=${L}${d?"-0":""}`,P(x)?g="":P(j)?g=`<${+x+1}.0.0-0`:P(M)?g=`<${x}.${+j+1}.0-0`:W?g=`<=${x}.${j}.${M}-${W}`:d?g=`<${x}.${j}.${+M+1}-0`:g=`<=${g}`,`${L} ${g}`.trim()),ie=(d,m,L)=>{for(let R=0;R<d.length;R++)if(!d[R].test(m))return!1;if(m.prerelease.length&&!L.includePrerelease){for(let R=0;R<d.length;R++)if(e(d[R].semver),d[R].semver!==h.ANY&&d[R].semver.prerelease.length>0){let _=d[R].semver;if(_.major===m.major&&_.minor===m.minor&&_.patch===m.patch)return!0}return!1}return!0}}}),ee=O({"../../node_modules/semver/classes/comparator.js"(c,l){var r=Symbol("SemVer ANY"),i=class ue{static get ANY(){return r}constructor(s,u){if(u=n(u),s instanceof ue){if(s.loose===!!u.loose)return s;s=s.value}s=s.trim().split(/\s+/).join(" "),e("comparator",s,u),this.options=u,this.loose=!!u.loose,this.parse(s),this.semver===r?this.value="":this.value=this.operator+this.semver.version,e("comp",this)}parse(s){let u=this.options.loose?t[p.COMPARATORLOOSE]:t[p.COMPARATOR],E=s.match(u);if(!E)throw new TypeError(`Invalid comparator: ${s}`);this.operator=E[1]!==void 0?E[1]:"",this.operator==="="&&(this.operator=""),E[2]?this.semver=new f(E[2],this.options.loose):this.semver=r}toString(){return this.value}test(s){if(e("Comparator.test",s,this.options.loose),this.semver===r||s===r)return!0;if(typeof s=="string")try{s=new f(s,this.options)}catch{return!1}return h(s,this.operator,this.semver,this.options)}intersects(s,u){if(!(s instanceof ue))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new a(s.value,u).test(this.value):s.operator===""?s.value===""?!0:new a(this.value,u).test(s.semver):(u=n(u),u.includePrerelease&&(this.value==="<0.0.0-0"||s.value==="<0.0.0-0")||!u.includePrerelease&&(this.value.startsWith("<0.0.0")||s.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&s.operator.startsWith(">")||this.operator.startsWith("<")&&s.operator.startsWith("<")||this.semver.version===s.semver.version&&this.operator.includes("=")&&s.operator.includes("=")||h(this.semver,"<",s.semver,u)&&this.operator.startsWith(">")&&s.operator.startsWith("<")||h(this.semver,">",s.semver,u)&&this.operator.startsWith("<")&&s.operator.startsWith(">")))}};l.exports=i;var n=ce(),{safeRe:t,t:p}=z(),h=Oe(),e=Z(),f=q(),a=U()}}),re=O({"../../node_modules/semver/functions/satisfies.js"(c,l){var r=U(),i=(n,t,p)=>{try{t=new r(t,p)}catch{return!1}return t.test(n)};l.exports=i}}),He=O({"../../node_modules/semver/ranges/to-comparators.js"(c,l){var r=U(),i=(n,t)=>new r(n,t).set.map(p=>p.map(h=>h.value).join(" ").trim().split(" "));l.exports=i}}),Be=O({"../../node_modules/semver/ranges/max-satisfying.js"(c,l){var r=q(),i=U(),n=(t,p,h)=>{let e=null,f=null,a=null;try{a=new i(p,h)}catch{return null}return t.forEach(v=>{a.test(v)&&(!e||f.compare(v)===-1)&&(e=v,f=new r(e,h))}),e};l.exports=n}}),We=O({"../../node_modules/semver/ranges/min-satisfying.js"(c,l){var r=q(),i=U(),n=(t,p,h)=>{let e=null,f=null,a=null;try{a=new i(p,h)}catch{return null}return t.forEach(v=>{a.test(v)&&(!e||f.compare(v)===1)&&(e=v,f=new r(e,h))}),e};l.exports=n}}),Ye=O({"../../node_modules/semver/ranges/min-version.js"(c,l){var r=q(),i=U(),n=J(),t=(p,h)=>{p=new i(p,h);let e=new r("0.0.0");if(p.test(e)||(e=new r("0.0.0-0"),p.test(e)))return e;e=null;for(let f=0;f<p.set.length;++f){let a=p.set[f],v=null;a.forEach(s=>{let u=new r(s.semver.version);switch(s.operator){case">":u.prerelease.length===0?u.patch++:u.prerelease.push(0),u.raw=u.format();case"":case">=":(!v||n(u,v))&&(v=u);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),v&&(!e||n(e,v))&&(e=v)}return e&&p.test(e)?e:null};l.exports=t}}),ze=O({"../../node_modules/semver/ranges/valid.js"(c,l){var r=U(),i=(n,t)=>{try{return new r(n,t).range||"*"}catch{return null}};l.exports=i}}),de=O({"../../node_modules/semver/ranges/outside.js"(c,l){var r=q(),i=ee(),{ANY:n}=i,t=U(),p=re(),h=J(),e=he(),f=ve(),a=fe(),v=(s,u,E,o)=>{s=new r(s,o),u=new t(u,o);let I,T,A,y,D;switch(E){case">":I=h,T=f,A=e,y=">",D=">=";break;case"<":I=e,T=a,A=h,y="<",D="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(p(s,u,o))return!1;for(let P=0;P<u.set.length;++P){let X=u.set[P],F=null,C=null;if(X.forEach(G=>{G.semver===n&&(G=new i(">=0.0.0")),F=F||G,C=C||G,I(G.semver,F.semver,o)?F=G:A(G.semver,C.semver,o)&&(C=G)}),F.operator===y||F.operator===D||(!C.operator||C.operator===y)&&T(s,C.semver)||C.operator===D&&A(s,C.semver))return!1}return!0};l.exports=v}}),Ke=O({"../../node_modules/semver/ranges/gtr.js"(c,l){var r=de(),i=(n,t,p)=>r(n,t,">",p);l.exports=i}}),Qe=O({"../../node_modules/semver/ranges/ltr.js"(c,l){var r=de(),i=(n,t,p)=>r(n,t,"<",p);l.exports=i}}),Ze=O({"../../node_modules/semver/ranges/intersects.js"(c,l){var r=U(),i=(n,t,p)=>(n=new r(n,p),t=new r(t,p),n.intersects(t,p));l.exports=i}}),Je=O({"../../node_modules/semver/ranges/simplify.js"(c,l){var r=re(),i=V();l.exports=(n,t,p)=>{let h=[],e=null,f=null,a=n.sort((E,o)=>i(E,o,p));for(let E of a)r(E,t,p)?(f=E,e||(e=E)):(f&&h.push([e,f]),f=null,e=null);e&&h.push([e,null]);let v=[];for(let[E,o]of h)E===o?v.push(E):!o&&E===a[0]?v.push("*"):o?E===a[0]?v.push(`<=${o}`):v.push(`${E} - ${o}`):v.push(`>=${E}`);let s=v.join(" || "),u=typeof t.raw=="string"?t.raw:String(t);return s.length<u.length?s:t}}}),er=O({"../../node_modules/semver/ranges/subset.js"(c,l){var r=U(),i=ee(),{ANY:n}=i,t=re(),p=V(),h=(u,E,o={})=>{if(u===E)return!0;u=new r(u,o),E=new r(E,o);let I=!1;e:for(let T of u.set){for(let A of E.set){let y=a(T,A,o);if(I=I||y!==null,y)continue e}if(I)return!1}return!0},e=[new i(">=0.0.0-0")],f=[new i(">=0.0.0")],a=(u,E,o)=>{if(u===E)return!0;if(u.length===1&&u[0].semver===n){if(E.length===1&&E[0].semver===n)return!0;o.includePrerelease?u=e:u=f}if(E.length===1&&E[0].semver===n){if(o.includePrerelease)return!0;E=f}let I=new Set,T,A;for(let S of u)S.operator===">"||S.operator===">="?T=v(T,S,o):S.operator==="<"||S.operator==="<="?A=s(A,S,o):I.add(S.semver);if(I.size>1)return null;let y;if(T&&A&&(y=p(T.semver,A.semver,o),y>0||y===0&&(T.operator!==">="||A.operator!=="<=")))return null;for(let S of I){if(T&&!t(S,String(T),o)||A&&!t(S,String(A),o))return null;for(let B of E)if(!t(S,String(B),o))return!1;return!0}let D,P,X,F,C=A&&!o.includePrerelease&&A.semver.prerelease.length?A.semver:!1,G=T&&!o.includePrerelease&&T.semver.prerelease.length?T.semver:!1;C&&C.prerelease.length===1&&A.operator==="<"&&C.prerelease[0]===0&&(C=!1);for(let S of E){if(F=F||S.operator===">"||S.operator===">=",X=X||S.operator==="<"||S.operator==="<=",T){if(G&&S.semver.prerelease&&S.semver.prerelease.length&&S.semver.major===G.major&&S.semver.minor===G.minor&&S.semver.patch===G.patch&&(G=!1),S.operator===">"||S.operator===">="){if(D=v(T,S,o),D===S&&D!==T)return!1}else if(T.operator===">="&&!t(T.semver,String(S),o))return!1}if(A){if(C&&S.semver.prerelease&&S.semver.prerelease.length&&S.semver.major===C.major&&S.semver.minor===C.minor&&S.semver.patch===C.patch&&(C=!1),S.operator==="<"||S.operator==="<="){if(P=s(A,S,o),P===S&&P!==A)return!1}else if(A.operator==="<="&&!t(A.semver,String(S),o))return!1}if(!S.operator&&(A||T)&&y!==0)return!1}return!(T&&X&&!A&&y!==0||A&&F&&!T&&y!==0||G||C)},v=(u,E,o)=>{if(!u)return E;let I=p(u.semver,E.semver,o);return I>0?u:I<0||E.operator===">"&&u.operator===">="?E:u},s=(u,E,o)=>{if(!u)return E;let I=p(u.semver,E.semver,o);return I<0?u:I>0||E.operator==="<"&&u.operator==="<="?E:u};l.exports=h}}),rr=O({"../../node_modules/semver/index.js"(c,l){var r=z(),i=Q(),n=q(),t=Le(),p=H(),h=je(),e=Pe(),f=Ce(),a=ye(),v=De(),s=Ge(),u=qe(),E=Fe(),o=V(),I=Ve(),T=Ue(),A=me(),y=be(),D=Xe(),P=J(),X=he(),F=_e(),C=Ne(),G=fe(),S=ve(),B=Oe(),te=ke(),se=ee(),ae=U(),ie=re(),d=He(),m=Be(),L=We(),R=Ye(),_=ze(),$=de(),N=Ke(),w=Qe(),g=Ze(),x=Je(),j=er();l.exports={parse:p,valid:h,clean:e,inc:f,diff:a,major:v,minor:s,patch:u,prerelease:E,compare:o,rcompare:I,compareLoose:T,compareBuild:A,sort:y,rsort:D,gt:P,lt:X,eq:F,neq:C,gte:G,lte:S,cmp:B,coerce:te,Comparator:se,Range:ae,satisfies:ie,toComparators:d,maxSatisfying:m,minSatisfying:L,minVersion:R,validRange:_,outside:$,gtr:N,ltr:w,intersects:g,simplifyRange:x,subset:j,SemVer:n,re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:t.compareIdentifiers,rcompareIdentifiers:t.rcompareIdentifiers}}}),tr={};ge(tr,{beforeAll:()=>Er,decorators:()=>pr,mount:()=>or,parameters:()=>ur,render:()=>ir,renderToCanvas:()=>lr});var Re=Ae(rr()),sr={...we};function $e(c){globalThis.IS_REACT_ACT_ENVIRONMENT=c}function ar(){return globalThis.IS_REACT_ACT_ENVIRONMENT}var Se=async()=>{var c;if(typeof sr.act!="function"){let l=await Ee(()=>import("./test-utils-BBHUGUfi.js").then(r=>r.t),__vite__mapDeps([0,1,2]),import.meta.url);((c=l==null?void 0:l.default)==null?void 0:c.act)??l.act}return l=>l()},ir=(c,l)=>{let{id:r,component:i}=l;if(!i)throw new Error(`Unable to render story ${r} as the component annotation is missing from the default export`);return Y.createElement(i,{...c})},{FRAMEWORK_OPTIONS:le}=xe,nr=class extends k.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidMount(){let{hasError:c}=this.state,{showMain:l}=this.props;c||l()}componentDidCatch(c){let{showException:l}=this.props;l(c)}render(){let{hasError:c}=this.state,{children:l}=this.props;return c?null:l}},Ie=le!=null&&le.strictMode?k.StrictMode:k.Fragment,pe=[],oe=!1,Te=async()=>{if(oe||pe.length===0)return;oe=!0;let c=pe.shift();c&&await c(),oe=!1,Te()};async function lr({storyContext:c,unboundStoryFn:l,showMain:r,showException:i,forceRemount:n},t){let{renderElement:p,unmountElement:h}=await Ee(async()=>{const{renderElement:s,unmountElement:u}=await import("./react-18-BdgjDjvZ.js");return{renderElement:s,unmountElement:u}},__vite__mapDeps([3,1,4,2]),import.meta.url),e=l,f=c.parameters.__isPortableStory?Y.createElement(e,{...c}):Y.createElement(nr,{showMain:r,showException:i},Y.createElement(e,{...c})),a=Ie?Y.createElement(Ie,null,f):f;n&&h(t);let v=await Se();return await new Promise(async(s,u)=>{pe.push(async()=>{try{await v(async()=>{var E,o;await p(a,t,(o=(E=c==null?void 0:c.parameters)==null?void 0:E.react)==null?void 0:o.rootOptions)}),s()}catch(E){u(E)}}),Te()}),async()=>{await v(()=>{h(t)})}}var or=c=>async l=>(l!=null&&(c.originalStoryFn=()=>l),await c.renderToCanvas(),c.canvas),ur={renderer:"react"},pr=[(c,l)=>{var n,t;if(!((t=(n=l.parameters)==null?void 0:n.react)!=null&&t.rsc))return c();let r=Re.default.major(k.version),i=Re.default.minor(k.version);if(r<18||r===18&&i<3)throw new Error("React Server Components require React >= 18.3");return k.createElement(k.Suspense,null,c())}],Er=async()=>{try{let{configure:c}=await Ee(async()=>{const{configure:r}=await Promise.resolve().then(()=>mr);return{configure:r}},void 0,import.meta.url),l=await Se();c({unstable_advanceTimersWrapper:r=>l(r),asyncWrapper:async r=>{let i=ar();$e(!1);try{let n=await r();return await new Promise(t=>{setTimeout(()=>{t()},0),cr()&&jest.advanceTimersByTime(0)}),n}finally{$e(i)}},eventWrapper:r=>{let i;return l(()=>(i=r(),i)),i}})}catch{}};function cr(){return typeof jest<"u"&&jest!==null?setTimeout._isMockFunction===!0||Object.prototype.hasOwnProperty.call(setTimeout,"clock"):!1}const mr=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{Er as beforeAll,pr as decorators,or as mount,ur as parameters,ir as render,lr as renderToCanvas};
@@ -1,2 +1,2 @@
1
- import{j as ut}from"./jsx-runtime-W3oueGCa.js";import{P as lt,I as W,q as ft,U as ht}from"./legend-Cgq98xea.js";import{a as gt}from"./index-YTOF1_EJ.js";import{_ as mt,d as dt,H as pt}from"./legend-context-PSa8HhGj.js";const yt=({children:t,controlsPortalId:e})=>e?ut.jsx(lt,{id:e,children:t}):t;yt.__docgenInfo={description:"",methods:[],displayName:"ControlsPortal",props:{children:{required:!0,tsType:{name:"ReactElement"},description:""},controlsPortalId:{required:!0,tsType:{name:"string"},description:""}}};var U=(t=>(t.label="Label",t.pointsLines="Points & lines",t.linesOnly="Lines only",t.pointsOnly="Points only",t.axesOptions="Axes options",t.resetAxes="Reset Axes",t.done="Done",t.downloadAsPNG="Download as PNG",t.showChart="Show chart",t.showTable="Show table",t.dragToZoom="Drag to zoom",t.dragToPan="Drag to pan",t.dragToMovePoints="Drag to move points",t.dragToMoveAnnotation="Drag to move annotation",t.dragDisabled="Drag disabled",t.hideLegend="Hide Legend",t.showLegend="Show Legend",t.mustHaveAValue="Must have a value",t.mustBeANumber="Must be a number",t.mustBeLessThanMax="Must be less than max",t.mustBeGreaterThanMin="Must be greater than min",t.doubleClickToReset="Double click on canvas to reset",t.orDoubleClickToCanvas="or double click on canvas",t))(U||{});const wt=(t={})=>Object.keys(U).reduce((e,r)=>({...e,[r]:t[r]||U[r]}),{}),j={[W.TRANSLATIONS]:wt(),[W.LANGUAGE_KEY]:"en"},xe=(t="")=>t?j==null?void 0:j[t]:j,Se=(t,e)=>{j[t]=e};function bt(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),i=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(i),e&&(n.href=e),i.href=t,i.href}const xt=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function D(t){const e=[];for(let r=0,n=t.length;r<n;r++)e.push(t[r]);return e}let O=null;function Q(t={}){return O||(t.includeStyleProperties?(O=t.includeStyleProperties,O):(O=D(window.getComputedStyle(document.documentElement)),O))}function M(t,e){const n=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(e);return n?parseFloat(n.replace("px","")):0}function St(t){const e=M(t,"border-left-width"),r=M(t,"border-right-width");return t.clientWidth+e+r}function vt(t){const e=M(t,"border-top-width"),r=M(t,"border-bottom-width");return t.clientHeight+e+r}function Z(t,e={}){const r=e.width||St(t),n=e.height||vt(t);return{width:r,height:n}}function Et(){let t,e;try{e=process}catch{}const r=e&&e.env?e.env.devicePixelRatio:null;return r&&(t=parseInt(r,10),Number.isNaN(t)&&(t=1)),t||window.devicePixelRatio||1}const v=16384;function Rt(t){(t.width>v||t.height>v)&&(t.width>v&&t.height>v?t.width>t.height?(t.height*=v/t.width,t.width=v):(t.width*=v/t.height,t.height=v):t.width>v?(t.height*=v/t.width,t.width=v):(t.width*=v/t.height,t.height=v))}function F(t){return new Promise((e,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>e(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=t})}async function Ct(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function Pt(t,e,r){const n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg"),o=document.createElementNS(n,"foreignObject");return i.setAttribute("width",`${e}`),i.setAttribute("height",`${r}`),i.setAttribute("viewBox",`0 0 ${e} ${r}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),i.appendChild(o),o.appendChild(t),Ct(i)}const b=(t,e)=>{if(t instanceof e)return!0;const r=Object.getPrototypeOf(t);return r===null?!1:r.constructor.name===e.name||b(r,e)};function Dt(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function At(t,e){return Q(e).map(r=>{const n=t.getPropertyValue(r),i=t.getPropertyPriority(r);return`${r}: ${n}${i?" !important":""};`}).join(" ")}function Lt(t,e,r,n){const i=`.${t}:${e}`,o=r.cssText?Dt(r):At(r,n);return document.createTextNode(`${i}{${o}}`)}function V(t,e,r,n){const i=window.getComputedStyle(t,r),o=i.getPropertyValue("content");if(o===""||o==="none")return;const a=xt();try{e.className=`${e.className} ${a}`}catch{return}const s=document.createElement("style");s.appendChild(Lt(a,r,i,n)),e.appendChild(s)}function Ot(t,e,r){V(t,e,":before",r),V(t,e,":after",r)}const G="application/font-woff",z="image/jpeg",Tt={woff:G,woff2:G,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:z,jpeg:z,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function jt(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function H(t){const e=jt(t).toLowerCase();return Tt[e]||""}function Mt(t){return t.split(/,/)[1]}function k(t){return t.search(/^(data:)/)!==-1}function Ft(t,e){return`data:${e};base64,${t}`}async function tt(t,e,r){const n=await fetch(t,e);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const i=await n.blob();return new Promise((o,a)=>{const s=new FileReader;s.onerror=a,s.onloadend=()=>{try{o(r({res:n,result:s.result}))}catch(c){a(c)}},s.readAsDataURL(i)})}const I={};function $t(t,e,r){let n=t.replace(/\?.*/,"");return r&&(n=t),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),e?`[${e}]${n}`:n}async function B(t,e,r){const n=$t(t,e,r.includeQueryParams);if(I[n]!=null)return I[n];r.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let i;try{const o=await tt(t,r.fetchRequestInit,({res:a,result:s})=>(e||(e=a.headers.get("Content-Type")||""),Mt(s)));i=Ft(o,e)}catch(o){i=r.imagePlaceholder||"";let a=`Failed to fetch resource: ${t}`;o&&(a=typeof o=="string"?o:o.message),a&&console.warn(a)}return I[n]=i,i}async function It(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):F(e)}async function _t(t,e){if(t.currentSrc){const o=document.createElement("canvas"),a=o.getContext("2d");o.width=t.clientWidth,o.height=t.clientHeight,a==null||a.drawImage(t,0,0,o.width,o.height);const s=o.toDataURL();return F(s)}const r=t.poster,n=H(r),i=await B(r,n,e);return F(i)}async function Ut(t,e){var r;try{if(!((r=t==null?void 0:t.contentDocument)===null||r===void 0)&&r.body)return await $(t.contentDocument.body,e,!0)}catch{}return t.cloneNode(!1)}async function kt(t,e){return b(t,HTMLCanvasElement)?It(t):b(t,HTMLVideoElement)?_t(t,e):b(t,HTMLIFrameElement)?Ut(t,e):t.cloneNode(et(t))}const Ht=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",et=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";async function Bt(t,e,r){var n,i;if(et(e))return e;let o=[];return Ht(t)&&t.assignedNodes?o=D(t.assignedNodes()):b(t,HTMLIFrameElement)&&(!((n=t.contentDocument)===null||n===void 0)&&n.body)?o=D(t.contentDocument.body.childNodes):o=D(((i=t.shadowRoot)!==null&&i!==void 0?i:t).childNodes),o.length===0||b(t,HTMLVideoElement)||await o.reduce((a,s)=>a.then(()=>$(s,r)).then(c=>{c&&e.appendChild(c)}),Promise.resolve()),e}function qt(t,e,r){const n=e.style;if(!n)return;const i=window.getComputedStyle(t);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):Q(r).forEach(o=>{let a=i.getPropertyValue(o);o==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),b(t,HTMLIFrameElement)&&o==="display"&&a==="inline"&&(a="block"),o==="d"&&e.getAttribute("d")&&(a=`path(${e.getAttribute("d")})`),n.setProperty(o,a,i.getPropertyPriority(o))})}function Wt(t,e){b(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),b(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function Vt(t,e){if(b(t,HTMLSelectElement)){const r=e,n=Array.from(r.children).find(i=>t.value===i.getAttribute("value"));n&&n.setAttribute("selected","")}}function Gt(t,e,r){return b(e,Element)&&(qt(t,e,r),Ot(t,e,r),Wt(t,e),Vt(t,e)),e}async function zt(t,e){const r=t.querySelectorAll?t.querySelectorAll("use"):[];if(r.length===0)return t;const n={};for(let o=0;o<r.length;o++){const s=r[o].getAttribute("xlink:href");if(s){const c=t.querySelector(s),u=document.querySelector(s);!c&&u&&!n[s]&&(n[s]=await $(u,e,!0))}}const i=Object.values(n);if(i.length){const o="http://www.w3.org/1999/xhtml",a=document.createElementNS(o,"svg");a.setAttribute("xmlns",o),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";const s=document.createElementNS(o,"defs");a.appendChild(s);for(let c=0;c<i.length;c++)s.appendChild(i[c]);t.appendChild(a)}return t}async function $(t,e,r){return!r&&e.filter&&!e.filter(t)?null:Promise.resolve(t).then(n=>kt(n,e)).then(n=>Bt(t,n,e)).then(n=>Gt(t,n,e)).then(n=>zt(n,e))}const nt=/url\((['"]?)([^'"]+?)\1\)/g,Xt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Kt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Nt(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function Yt(t){const e=[];return t.replace(nt,(r,n,i)=>(e.push(i),r)),e.filter(r=>!k(r))}async function Jt(t,e,r,n,i){try{const o=r?bt(e,r):e,a=H(e);let s;return i||(s=await B(o,a,n)),t.replace(Nt(e),`$1${s}$3`)}catch{}return t}function Qt(t,{preferredFontFormat:e}){return e?t.replace(Kt,r=>{for(;;){const[n,,i]=Xt.exec(r)||[];if(!i)return"";if(i===e)return`src: ${n};`}}):t}function rt(t){return t.search(nt)!==-1}async function ot(t,e,r){if(!rt(t))return t;const n=Qt(t,r);return Yt(n).reduce((o,a)=>o.then(s=>Jt(s,a,e,r)),Promise.resolve(n))}async function T(t,e,r){var n;const i=(n=e.style)===null||n===void 0?void 0:n.getPropertyValue(t);if(i){const o=await ot(i,null,r);return e.style.setProperty(t,o,e.style.getPropertyPriority(t)),!0}return!1}async function Zt(t,e){await T("background",t,e)||await T("background-image",t,e),await T("mask",t,e)||await T("-webkit-mask",t,e)||await T("mask-image",t,e)||await T("-webkit-mask-image",t,e)}async function te(t,e){const r=b(t,HTMLImageElement);if(!(r&&!k(t.src))&&!(b(t,SVGImageElement)&&!k(t.href.baseVal)))return;const n=r?t.src:t.href.baseVal,i=await B(n,H(n),e);await new Promise((o,a)=>{t.onload=o,t.onerror=e.onImageErrorHandler?(...c)=>{try{o(e.onImageErrorHandler(...c))}catch(u){a(u)}}:a;const s=t;s.decode&&(s.decode=o),s.loading==="lazy"&&(s.loading="eager"),r?(t.srcset="",t.src=i):t.href.baseVal=i})}async function ee(t,e){const n=D(t.childNodes).map(i=>at(i,e));await Promise.all(n).then(()=>t)}async function at(t,e){b(t,Element)&&(await Zt(t,e),await te(t,e),await ee(t,e))}function ne(t,e){const{style:r}=t;e.backgroundColor&&(r.backgroundColor=e.backgroundColor),e.width&&(r.width=`${e.width}px`),e.height&&(r.height=`${e.height}px`);const n=e.style;return n!=null&&Object.keys(n).forEach(i=>{r[i]=n[i]}),t}const X={};async function K(t){let e=X[t];if(e!=null)return e;const n=await(await fetch(t)).text();return e={url:t,cssText:n},X[t]=e,e}async function N(t,e){let r=t.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,o=(r.match(/url\([^)]+\)/g)||[]).map(async a=>{let s=a.replace(n,"$1");return s.startsWith("https://")||(s=new URL(s,t.url).href),tt(s,e.fetchRequestInit,({result:c})=>(r=r.replace(a,`url(${c})`),[a,c]))});return Promise.all(o).then(()=>r)}function Y(t){if(t==null)return[];const e=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=t.replace(r,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const c=i.exec(n);if(c===null)break;e.push(c[0])}n=n.replace(i,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",s=new RegExp(a,"gi");for(;;){let c=o.exec(n);if(c===null){if(c=s.exec(n),c===null)break;o.lastIndex=s.lastIndex}else s.lastIndex=o.lastIndex;e.push(c[0])}return e}async function re(t,e){const r=[],n=[];return t.forEach(i=>{if("cssRules"in i)try{D(i.cssRules||[]).forEach((o,a)=>{if(o.type===CSSRule.IMPORT_RULE){let s=a+1;const c=o.href,u=K(c).then(m=>N(m,e)).then(m=>Y(m).forEach(w=>{try{i.insertRule(w,w.startsWith("@import")?s+=1:i.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:w,error:x})}})).catch(m=>{console.error("Error loading remote css",m.toString())});n.push(u)}})}catch(o){const a=t.find(s=>s.href==null)||document.styleSheets[0];i.href!=null&&n.push(K(i.href).then(s=>N(s,e)).then(s=>Y(s).forEach(c=>{a.insertRule(c,a.cssRules.length)})).catch(s=>{console.error("Error loading remote stylesheet",s)})),console.error("Error inlining remote css file",o)}}),Promise.all(n).then(()=>(t.forEach(i=>{if("cssRules"in i)try{D(i.cssRules||[]).forEach(o=>{r.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${i.href}`,o)}}),r))}function oe(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>rt(e.style.getPropertyValue("src")))}async function ae(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=D(t.ownerDocument.styleSheets),n=await re(r,e);return oe(n)}function it(t){return t.trim().replace(/["']/g,"")}function ie(t){const e=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(o=>{e.add(it(o))}),Array.from(n.children).forEach(o=>{o instanceof HTMLElement&&r(o)})}return r(t),e}async function se(t,e){const r=await ae(t,e),n=ie(t);return(await Promise.all(r.filter(o=>n.has(it(o.style.fontFamily))).map(o=>{const a=o.parentStyleSheet?o.parentStyleSheet.href:null;return ot(o.cssText,a,e)}))).join(`
1
+ import{j as ut}from"./jsx-runtime-W3oueGCa.js";import{P as lt,I as W,q as ft,U as ht}from"./legend-ow0wxTbS.js";import{a as gt}from"./index-YTOF1_EJ.js";import{_ as mt,d as dt,H as pt}from"./legend-context-UUIiOgUg.js";const yt=({children:t,controlsPortalId:e})=>e?ut.jsx(lt,{id:e,children:t}):t;yt.__docgenInfo={description:"",methods:[],displayName:"ControlsPortal",props:{children:{required:!0,tsType:{name:"ReactElement"},description:""},controlsPortalId:{required:!0,tsType:{name:"string"},description:""}}};var U=(t=>(t.label="Label",t.pointsLines="Points & lines",t.linesOnly="Lines only",t.pointsOnly="Points only",t.axesOptions="Axes options",t.resetAxes="Reset Axes",t.done="Done",t.downloadAsPNG="Download as PNG",t.showChart="Show chart",t.showTable="Show table",t.dragToZoom="Drag to zoom",t.dragToPan="Drag to pan",t.dragToMovePoints="Drag to move points",t.dragToMoveAnnotation="Drag to move annotation",t.dragDisabled="Drag disabled",t.hideLegend="Hide Legend",t.showLegend="Show Legend",t.mustHaveAValue="Must have a value",t.mustBeANumber="Must be a number",t.mustBeLessThanMax="Must be less than max",t.mustBeGreaterThanMin="Must be greater than min",t.doubleClickToReset="Double click on canvas to reset",t.orDoubleClickToCanvas="or double click on canvas",t))(U||{});const wt=(t={})=>Object.keys(U).reduce((e,r)=>({...e,[r]:t[r]||U[r]}),{}),j={[W.TRANSLATIONS]:wt(),[W.LANGUAGE_KEY]:"en"},xe=(t="")=>t?j==null?void 0:j[t]:j,Se=(t,e)=>{j[t]=e};function bt(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),i=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(i),e&&(n.href=e),i.href=t,i.href}const xt=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function D(t){const e=[];for(let r=0,n=t.length;r<n;r++)e.push(t[r]);return e}let O=null;function Q(t={}){return O||(t.includeStyleProperties?(O=t.includeStyleProperties,O):(O=D(window.getComputedStyle(document.documentElement)),O))}function M(t,e){const n=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(e);return n?parseFloat(n.replace("px","")):0}function St(t){const e=M(t,"border-left-width"),r=M(t,"border-right-width");return t.clientWidth+e+r}function vt(t){const e=M(t,"border-top-width"),r=M(t,"border-bottom-width");return t.clientHeight+e+r}function Z(t,e={}){const r=e.width||St(t),n=e.height||vt(t);return{width:r,height:n}}function Et(){let t,e;try{e=process}catch{}const r=e&&e.env?e.env.devicePixelRatio:null;return r&&(t=parseInt(r,10),Number.isNaN(t)&&(t=1)),t||window.devicePixelRatio||1}const v=16384;function Rt(t){(t.width>v||t.height>v)&&(t.width>v&&t.height>v?t.width>t.height?(t.height*=v/t.width,t.width=v):(t.width*=v/t.height,t.height=v):t.width>v?(t.height*=v/t.width,t.width=v):(t.width*=v/t.height,t.height=v))}function F(t){return new Promise((e,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>e(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=t})}async function Ct(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function Pt(t,e,r){const n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg"),o=document.createElementNS(n,"foreignObject");return i.setAttribute("width",`${e}`),i.setAttribute("height",`${r}`),i.setAttribute("viewBox",`0 0 ${e} ${r}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),i.appendChild(o),o.appendChild(t),Ct(i)}const b=(t,e)=>{if(t instanceof e)return!0;const r=Object.getPrototypeOf(t);return r===null?!1:r.constructor.name===e.name||b(r,e)};function Dt(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function At(t,e){return Q(e).map(r=>{const n=t.getPropertyValue(r),i=t.getPropertyPriority(r);return`${r}: ${n}${i?" !important":""};`}).join(" ")}function Lt(t,e,r,n){const i=`.${t}:${e}`,o=r.cssText?Dt(r):At(r,n);return document.createTextNode(`${i}{${o}}`)}function V(t,e,r,n){const i=window.getComputedStyle(t,r),o=i.getPropertyValue("content");if(o===""||o==="none")return;const a=xt();try{e.className=`${e.className} ${a}`}catch{return}const s=document.createElement("style");s.appendChild(Lt(a,r,i,n)),e.appendChild(s)}function Ot(t,e,r){V(t,e,":before",r),V(t,e,":after",r)}const G="application/font-woff",z="image/jpeg",Tt={woff:G,woff2:G,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:z,jpeg:z,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function jt(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function H(t){const e=jt(t).toLowerCase();return Tt[e]||""}function Mt(t){return t.split(/,/)[1]}function k(t){return t.search(/^(data:)/)!==-1}function Ft(t,e){return`data:${e};base64,${t}`}async function tt(t,e,r){const n=await fetch(t,e);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const i=await n.blob();return new Promise((o,a)=>{const s=new FileReader;s.onerror=a,s.onloadend=()=>{try{o(r({res:n,result:s.result}))}catch(c){a(c)}},s.readAsDataURL(i)})}const I={};function $t(t,e,r){let n=t.replace(/\?.*/,"");return r&&(n=t),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),e?`[${e}]${n}`:n}async function B(t,e,r){const n=$t(t,e,r.includeQueryParams);if(I[n]!=null)return I[n];r.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let i;try{const o=await tt(t,r.fetchRequestInit,({res:a,result:s})=>(e||(e=a.headers.get("Content-Type")||""),Mt(s)));i=Ft(o,e)}catch(o){i=r.imagePlaceholder||"";let a=`Failed to fetch resource: ${t}`;o&&(a=typeof o=="string"?o:o.message),a&&console.warn(a)}return I[n]=i,i}async function It(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):F(e)}async function _t(t,e){if(t.currentSrc){const o=document.createElement("canvas"),a=o.getContext("2d");o.width=t.clientWidth,o.height=t.clientHeight,a==null||a.drawImage(t,0,0,o.width,o.height);const s=o.toDataURL();return F(s)}const r=t.poster,n=H(r),i=await B(r,n,e);return F(i)}async function Ut(t,e){var r;try{if(!((r=t==null?void 0:t.contentDocument)===null||r===void 0)&&r.body)return await $(t.contentDocument.body,e,!0)}catch{}return t.cloneNode(!1)}async function kt(t,e){return b(t,HTMLCanvasElement)?It(t):b(t,HTMLVideoElement)?_t(t,e):b(t,HTMLIFrameElement)?Ut(t,e):t.cloneNode(et(t))}const Ht=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",et=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";async function Bt(t,e,r){var n,i;if(et(e))return e;let o=[];return Ht(t)&&t.assignedNodes?o=D(t.assignedNodes()):b(t,HTMLIFrameElement)&&(!((n=t.contentDocument)===null||n===void 0)&&n.body)?o=D(t.contentDocument.body.childNodes):o=D(((i=t.shadowRoot)!==null&&i!==void 0?i:t).childNodes),o.length===0||b(t,HTMLVideoElement)||await o.reduce((a,s)=>a.then(()=>$(s,r)).then(c=>{c&&e.appendChild(c)}),Promise.resolve()),e}function qt(t,e,r){const n=e.style;if(!n)return;const i=window.getComputedStyle(t);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):Q(r).forEach(o=>{let a=i.getPropertyValue(o);o==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),b(t,HTMLIFrameElement)&&o==="display"&&a==="inline"&&(a="block"),o==="d"&&e.getAttribute("d")&&(a=`path(${e.getAttribute("d")})`),n.setProperty(o,a,i.getPropertyPriority(o))})}function Wt(t,e){b(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),b(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function Vt(t,e){if(b(t,HTMLSelectElement)){const r=e,n=Array.from(r.children).find(i=>t.value===i.getAttribute("value"));n&&n.setAttribute("selected","")}}function Gt(t,e,r){return b(e,Element)&&(qt(t,e,r),Ot(t,e,r),Wt(t,e),Vt(t,e)),e}async function zt(t,e){const r=t.querySelectorAll?t.querySelectorAll("use"):[];if(r.length===0)return t;const n={};for(let o=0;o<r.length;o++){const s=r[o].getAttribute("xlink:href");if(s){const c=t.querySelector(s),u=document.querySelector(s);!c&&u&&!n[s]&&(n[s]=await $(u,e,!0))}}const i=Object.values(n);if(i.length){const o="http://www.w3.org/1999/xhtml",a=document.createElementNS(o,"svg");a.setAttribute("xmlns",o),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";const s=document.createElementNS(o,"defs");a.appendChild(s);for(let c=0;c<i.length;c++)s.appendChild(i[c]);t.appendChild(a)}return t}async function $(t,e,r){return!r&&e.filter&&!e.filter(t)?null:Promise.resolve(t).then(n=>kt(n,e)).then(n=>Bt(t,n,e)).then(n=>Gt(t,n,e)).then(n=>zt(n,e))}const nt=/url\((['"]?)([^'"]+?)\1\)/g,Xt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Kt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Nt(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function Yt(t){const e=[];return t.replace(nt,(r,n,i)=>(e.push(i),r)),e.filter(r=>!k(r))}async function Jt(t,e,r,n,i){try{const o=r?bt(e,r):e,a=H(e);let s;return i||(s=await B(o,a,n)),t.replace(Nt(e),`$1${s}$3`)}catch{}return t}function Qt(t,{preferredFontFormat:e}){return e?t.replace(Kt,r=>{for(;;){const[n,,i]=Xt.exec(r)||[];if(!i)return"";if(i===e)return`src: ${n};`}}):t}function rt(t){return t.search(nt)!==-1}async function ot(t,e,r){if(!rt(t))return t;const n=Qt(t,r);return Yt(n).reduce((o,a)=>o.then(s=>Jt(s,a,e,r)),Promise.resolve(n))}async function T(t,e,r){var n;const i=(n=e.style)===null||n===void 0?void 0:n.getPropertyValue(t);if(i){const o=await ot(i,null,r);return e.style.setProperty(t,o,e.style.getPropertyPriority(t)),!0}return!1}async function Zt(t,e){await T("background",t,e)||await T("background-image",t,e),await T("mask",t,e)||await T("-webkit-mask",t,e)||await T("mask-image",t,e)||await T("-webkit-mask-image",t,e)}async function te(t,e){const r=b(t,HTMLImageElement);if(!(r&&!k(t.src))&&!(b(t,SVGImageElement)&&!k(t.href.baseVal)))return;const n=r?t.src:t.href.baseVal,i=await B(n,H(n),e);await new Promise((o,a)=>{t.onload=o,t.onerror=e.onImageErrorHandler?(...c)=>{try{o(e.onImageErrorHandler(...c))}catch(u){a(u)}}:a;const s=t;s.decode&&(s.decode=o),s.loading==="lazy"&&(s.loading="eager"),r?(t.srcset="",t.src=i):t.href.baseVal=i})}async function ee(t,e){const n=D(t.childNodes).map(i=>at(i,e));await Promise.all(n).then(()=>t)}async function at(t,e){b(t,Element)&&(await Zt(t,e),await te(t,e),await ee(t,e))}function ne(t,e){const{style:r}=t;e.backgroundColor&&(r.backgroundColor=e.backgroundColor),e.width&&(r.width=`${e.width}px`),e.height&&(r.height=`${e.height}px`);const n=e.style;return n!=null&&Object.keys(n).forEach(i=>{r[i]=n[i]}),t}const X={};async function K(t){let e=X[t];if(e!=null)return e;const n=await(await fetch(t)).text();return e={url:t,cssText:n},X[t]=e,e}async function N(t,e){let r=t.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,o=(r.match(/url\([^)]+\)/g)||[]).map(async a=>{let s=a.replace(n,"$1");return s.startsWith("https://")||(s=new URL(s,t.url).href),tt(s,e.fetchRequestInit,({result:c})=>(r=r.replace(a,`url(${c})`),[a,c]))});return Promise.all(o).then(()=>r)}function Y(t){if(t==null)return[];const e=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=t.replace(r,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const c=i.exec(n);if(c===null)break;e.push(c[0])}n=n.replace(i,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",s=new RegExp(a,"gi");for(;;){let c=o.exec(n);if(c===null){if(c=s.exec(n),c===null)break;o.lastIndex=s.lastIndex}else s.lastIndex=o.lastIndex;e.push(c[0])}return e}async function re(t,e){const r=[],n=[];return t.forEach(i=>{if("cssRules"in i)try{D(i.cssRules||[]).forEach((o,a)=>{if(o.type===CSSRule.IMPORT_RULE){let s=a+1;const c=o.href,u=K(c).then(m=>N(m,e)).then(m=>Y(m).forEach(w=>{try{i.insertRule(w,w.startsWith("@import")?s+=1:i.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:w,error:x})}})).catch(m=>{console.error("Error loading remote css",m.toString())});n.push(u)}})}catch(o){const a=t.find(s=>s.href==null)||document.styleSheets[0];i.href!=null&&n.push(K(i.href).then(s=>N(s,e)).then(s=>Y(s).forEach(c=>{a.insertRule(c,a.cssRules.length)})).catch(s=>{console.error("Error loading remote stylesheet",s)})),console.error("Error inlining remote css file",o)}}),Promise.all(n).then(()=>(t.forEach(i=>{if("cssRules"in i)try{D(i.cssRules||[]).forEach(o=>{r.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${i.href}`,o)}}),r))}function oe(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>rt(e.style.getPropertyValue("src")))}async function ae(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=D(t.ownerDocument.styleSheets),n=await re(r,e);return oe(n)}function it(t){return t.trim().replace(/["']/g,"")}function ie(t){const e=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(o=>{e.add(it(o))}),Array.from(n.children).forEach(o=>{o instanceof HTMLElement&&r(o)})}return r(t),e}async function se(t,e){const r=await ae(t,e),n=ie(t);return(await Promise.all(r.filter(o=>n.has(it(o.style.fontFamily))).map(o=>{const a=o.parentStyleSheet?o.parentStyleSheet.href:null;return ot(o.cssText,a,e)}))).join(`
2
2
  `)}async function ce(t,e){const r=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await se(t,e);if(r){const n=document.createElement("style"),i=document.createTextNode(r);n.appendChild(i),t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)}}async function ue(t,e={}){const{width:r,height:n}=Z(t,e),i=await $(t,e,!0);return await ce(i,e),await at(i,e),ne(i,e),await Pt(i,r,n)}async function le(t,e={}){const{width:r,height:n}=Z(t,e),i=await ue(t,e),o=await F(i),a=document.createElement("canvas"),s=a.getContext("2d"),c=e.pixelRatio||Et(),u=e.canvasWidth||r,m=e.canvasHeight||n;return a.width=u*c,a.height=m*c,e.skipAutoScale||Rt(a),a.style.width=`${u}`,a.style.height=`${m}`,e.backgroundColor&&(s.fillStyle=e.backgroundColor,s.fillRect(0,0,a.width,a.height)),s.drawImage(o,0,0,a.width,a.height),a}async function fe(t,e={}){return(await le(t,e)).toDataURL()}var _={exports:{}},J;function he(){return J||(J=1,function(t,e){(function(r,n){t.exports=n(gt())})(window,function(r){return function(n){var i={};function o(a){if(i[a])return i[a].exports;var s=i[a]={i:a,l:!1,exports:{}};return n[a].call(s.exports,s,s.exports,o),s.l=!0,s.exports}return o.m=n,o.c=i,o.d=function(a,s,c){o.o(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:c})},o.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},o.t=function(a,s){if(1&s&&(a=o(a)),8&s||4&s&&typeof a=="object"&&a&&a.__esModule)return a;var c=Object.create(null);if(o.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:a}),2&s&&typeof a!="string")for(var u in a)o.d(c,u,(function(m){return a[m]}).bind(null,u));return c},o.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return o.d(s,"a",s),s},o.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},o.p="/dist/",o(o.s=4)}([function(n,i,o){n.exports=o(5)()},function(n,i){n.exports=r},function(n,i,o){(function(a){var s,c,u;c=[],(u=typeof(s=function(){function m(f,h,y){var l=new XMLHttpRequest;l.open("GET",f),l.responseType="blob",l.onload=function(){S(l.response,h,y)},l.onerror=function(){console.error("could not download file")},l.send()}function w(f){var h=new XMLHttpRequest;h.open("HEAD",f,!1);try{h.send()}catch{}return 200<=h.status&&299>=h.status}function x(f){try{f.dispatchEvent(new MouseEvent("click"))}catch{var h=document.createEvent("MouseEvents");h.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),f.dispatchEvent(h)}}var d=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof a=="object"&&a.global===a?a:void 0,E=d.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),S=d.saveAs||(typeof window!="object"||window!==d?function(){}:"download"in HTMLAnchorElement.prototype&&!E?function(f,h,y){var l=d.URL||d.webkitURL,g=document.createElement("a");h=h||f.name||"download",g.download=h,g.rel="noopener",typeof f=="string"?(g.href=f,g.origin===location.origin?x(g):w(g.href)?m(f,h,y):x(g,g.target="_blank")):(g.href=l.createObjectURL(f),setTimeout(function(){l.revokeObjectURL(g.href)},4e4),setTimeout(function(){x(g)},0))}:"msSaveOrOpenBlob"in navigator?function(f,h,y){if(h=h||f.name||"download",typeof f!="string")navigator.msSaveOrOpenBlob(function(g,p){return p===void 0?p={autoBom:!1}:typeof p!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),p={autoBom:!p}),p.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(g.type)?new Blob(["\uFEFF",g],{type:g.type}):g}(f,y),h);else if(w(f))m(f,h,y);else{var l=document.createElement("a");l.href=f,l.target="_blank",setTimeout(function(){x(l)})}}:function(f,h,y,l){if((l=l||open("","_blank"))&&(l.document.title=l.document.body.innerText="downloading..."),typeof f=="string")return m(f,h,y);var g=f.type==="application/octet-stream",p=/constructor/i.test(d.HTMLElement)||d.safari,R=/CriOS\/[\d]+/.test(navigator.userAgent);if((R||g&&p||E)&&typeof FileReader<"u"){var P=new FileReader;P.onloadend=function(){var C=P.result;C=R?C:C.replace(/^data:[^;]*;/,"data:attachment/file;"),l?l.location.href=C:location=C,l=null},P.readAsDataURL(f)}else{var A=d.URL||d.webkitURL,L=A.createObjectURL(f);l?l.location=L:location.href=L,l=null,setTimeout(function(){A.revokeObjectURL(L)},4e4)}});d.saveAs=S.saveAs=S,n.exports=S})=="function"?s.apply(i,c):s)===void 0||(n.exports=u)}).call(this,o(7))},function(n,i,o){var a,s,c;s=[],(c=typeof(a=function(){return function(u,m,w){m=m||"",w=w||512;for(var x=atob(u),d=[],E=0;E<x.length;E+=w){for(var S=x.slice(E,E+w),f=new Array(S.length),h=0;h<S.length;h++)f[h]=S.charCodeAt(h);var y=new Uint8Array(f);d.push(y)}return new Blob(d,{type:m})}})=="function"?a.apply(i,s):a)===void 0||(n.exports=c)},function(n,i,o){o.r(i),o.d(i,"defaultDownloadName",function(){return S}),o.d(i,"triggerBase64Download",function(){return h}),o.d(i,"getExtFromBase64",function(){return y});var a=o(1),s=o.n(a),c=o(0),u=o.n(c),m=o(2),w=o(3);function x(){return(x=Object.assign||function(l){for(var g=1;g<arguments.length;g++){var p=arguments[g];for(var R in p)Object.prototype.hasOwnProperty.call(p,R)&&(l[R]=p[R])}return l}).apply(this,arguments)}var d={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg"},E={png:"data:".concat(d.png,";base64"),jpeg:"data:".concat(d.jpeg,";base64"),jpg:"data:".concat(d.jpg,";base64")},S="download",f=function(l){var g=l.base64,p=l.children,R=l.downloadName,P=l.onDownloadSuccess,A=l.onDownloadError,L=l.Tag,C=l.className,st=l.style,ct=l.extraAttributes;return s.a.createElement(L,x({},ct,{onClick:function(){try{h(g,R),P&&P({base64:g})}catch(q){console.error(q),A&&A(q)}},className:C,style:st}),p)};function h(l){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S,p=y(l),R=E[p],P=d[p],A=l.replace("".concat(R,","),""),L=w(A,P),C=new File([L],"".concat(g,".").concat(p),{type:R});m.saveAs(C)}function y(l){var g;if(typeof l=="string"&&(g=Object.keys(E).find(function(p){return l.indexOf(E[p])===0})),g)return g;throw new Error("props.base64 on <Base64Downloader/> has invalid or undefined extension. expected ".concat(Object.keys(d).join(", ")))}f.defaultProps={className:"",style:{},downloadName:S,Tag:"button",extraAttributes:{}},f.propTypes={base64:u.a.string.isRequired,children:u.a.oneOfType([u.a.node,u.a.string]).isRequired,downloadName:u.a.string,onDownloadSuccess:u.a.func,onDownloadError:u.a.func,Tag:u.a.string,className:u.a.string,style:u.a.object,extraAttributes:u.a.object},i.default=f},function(n,i,o){var a=o(6);function s(){}function c(){}c.resetWarningCache=s,n.exports=function(){function u(x,d,E,S,f,h){if(h!==a){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}function m(){return u}u.isRequired=u;var w={array:u,bool:u,func:u,number:u,object:u,string:u,symbol:u,any:u,arrayOf:m,element:u,elementType:u,instanceOf:m,node:u,objectOf:m,oneOf:m,oneOfType:m,shape:m,exact:m,checkPropTypes:c,resetWarningCache:s};return w.PropTypes=w,w}},function(n,i,o){n.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(n,i){var o;o=function(){return this}();try{o=o||new Function("return this")()}catch{typeof window=="object"&&(o=window)}n.exports=o}])})}(_)),_.exports}var ge=he();const me=t=>Object.entries(t==null?void 0:t.scales).map(([e,r])=>{var a,s;const n=r==null?void 0:r.axis,i=((s=(a=r==null?void 0:r.options)==null?void 0:a.title)==null?void 0:s.text)??"",o=Array.isArray(i)?i==null?void 0:i.join(" "):i||e;return{label:`${n}-${o}`}}),ve=t=>{var c;const e=t.current;if(!e)return;const r=(c=e==null?void 0:e.canvas)==null?void 0:c.parentElement;if(!r)return;const{ctx:n}=e;n.save(),n.globalCompositeOperation="destination-over";const i=document.body.dataset.theme==="dark";n.fillStyle=i?"black":"white",n.fillRect(0,0,e.width,e.height),n.restore();const o=me(e),a=mt(o),s={skipFonts:navigator.userAgent.includes("Firefox")};fe(r,s).then(u=>{ge.triggerBase64Download(u,a)}).catch(u=>{console.error("Could not parse the html: ",u)})},de=(t,e)=>{let r=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(r)>=1&&t!==Math.floor(Number(t))&&(r=Number(t)-Math.floor(Number(t))),r},Ee=(t,e)=>{if(t===0||t===null)return"0";let r,n=t;if(e.length>1){const s=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(s<ft||s>ht)&&(r="scientific"),n=de(t,e)}const i=Math.log10(Math.abs(Number(n))),o=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),a=o===0?1:o;return dt(pt(t,o),{scientific:r==="scientific",roundScientificCoefficient:a})},Re=t=>{const{dragData:e={}}=t,{enableDragData:r,showTooltip:n,roundPoints:i,dragX:o,dragY:a,onDragStart:s=()=>{},onDrag:c=()=>{},onDragEnd:u=()=>{}}=e;return r?{dragData:{dragX:o,dragY:a,round:i,showTooltip:n,onDragStart:s,onDrag:c,onDragEnd:u}}:{}};export{yt as C,Re as a,xe as b,ve as c,U as d,Ee as f,wt as g,Se as s};