@reside-ic/skadi-chart 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/skadi-chart.d.ts +1 -1
- package/dist/skadi-chart.js +662 -662
- package/dist/skadi-chart.umd.cjs +2 -2
- package/package.json +1 -1
package/dist/skadi-chart.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(RA,$A){typeof exports=="object"&&typeof module<"u"?$A(exports):typeof define=="function"&&define.amd?define(["exports"],$A):(RA=typeof globalThis<"u"?globalThis:RA||self,$A(RA["skadi-chart"]={}))})(this,(function(RA){"use strict";var $A="http://www.w3.org/1999/xhtml";const Bi={svg:"http://www.w3.org/2000/svg",xhtml:$A,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function oe(A){var t=A+="",e=t.indexOf(":");return e>=0&&(t=A.slice(0,e))!=="xmlns"&&(A=A.slice(e+1)),Bi.hasOwnProperty(t)?{space:Bi[t],local:A}:A}function Ko(A){return function(){var t=this.ownerDocument,e=this.namespaceURI;return e===$A&&t.documentElement.namespaceURI===$A?t.createElement(A):t.createElementNS(e,A)}}function So(A){return function(){return this.ownerDocument.createElementNS(A.space,A.local)}}function vr(A){var t=oe(A);return(t.local?So:Ko)(t)}function Do(){}function yr(A){return A==null?Do:function(){return this.querySelector(A)}}function To(A){typeof A!="function"&&(A=yr(A));for(var t=this._groups,e=t.length,r=new Array(e),n=0;n<e;++n)for(var i=t[n],s=i.length,a=r[n]=new Array(s),o,B,c=0;c<s;++c)(o=i[c])&&(B=A.call(o,o.__data__,c,i))&&("__data__"in o&&(B.__data__=o.__data__),a[c]=B);return new uA(r,this._parents)}function Mo(A){return A==null?[]:Array.isArray(A)?A:Array.from(A)}function _o(){return[]}function ci(A){return A==null?_o:function(){return this.querySelectorAll(A)}}function Oo(A){return function(){return Mo(A.apply(this,arguments))}}function Ro(A){typeof A=="function"?A=Oo(A):A=ci(A);for(var t=this._groups,e=t.length,r=[],n=[],i=0;i<e;++i)for(var s=t[i],a=s.length,o,B=0;B<a;++B)(o=s[B])&&(r.push(A.call(o,o.__data__,B,s)),n.push(o));return new uA(r,n)}function ui(A){return function(){return this.matches(A)}}function li(A){return function(t){return t.matches(A)}}var No=Array.prototype.find;function Go(A){return function(){return No.call(this.children,A)}}function Vo(){return this.firstElementChild}function ko(A){return this.select(A==null?Vo:Go(typeof A=="function"?A:li(A)))}var Po=Array.prototype.filter;function Xo(){return Array.from(this.children)}function Jo(A){return function(){return Po.call(this.children,A)}}function Yo(A){return this.selectAll(A==null?Xo:Jo(typeof A=="function"?A:li(A)))}function Wo(A){typeof A!="function"&&(A=ui(A));for(var t=this._groups,e=t.length,r=new Array(e),n=0;n<e;++n)for(var i=t[n],s=i.length,a=r[n]=[],o,B=0;B<s;++B)(o=i[B])&&A.call(o,o.__data__,B,i)&&a.push(o);return new uA(r,this._parents)}function fi(A){return new Array(A.length)}function Zo(){return new uA(this._enter||this._groups.map(fi),this._parents)}function Be(A,t){this.ownerDocument=A.ownerDocument,this.namespaceURI=A.namespaceURI,this._next=null,this._parent=A,this.__data__=t}Be.prototype={constructor:Be,appendChild:function(A){return this._parent.insertBefore(A,this._next)},insertBefore:function(A,t){return this._parent.insertBefore(A,t)},querySelector:function(A){return this._parent.querySelector(A)},querySelectorAll:function(A){return this._parent.querySelectorAll(A)}};function $o(A){return function(){return A}}function zo(A,t,e,r,n,i){for(var s=0,a,o=t.length,B=i.length;s<B;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):e[s]=new Be(A,i[s]);for(;s<o;++s)(a=t[s])&&(n[s]=a)}function qo(A,t,e,r,n,i,s){var a,o,B=new Map,c=t.length,u=i.length,l=new Array(c),f;for(a=0;a<c;++a)(o=t[a])&&(l[a]=f=s.call(o,o.__data__,a,t)+"",B.has(f)?n[a]=o:B.set(f,o));for(a=0;a<u;++a)f=s.call(A,i[a],a,i)+"",(o=B.get(f))?(r[a]=o,o.__data__=i[a],B.delete(f)):e[a]=new Be(A,i[a]);for(a=0;a<c;++a)(o=t[a])&&B.get(l[a])===o&&(n[a]=o)}function jo(A){return A.__data__}function AB(A,t){if(!arguments.length)return Array.from(this,jo);var e=t?qo:zo,r=this._parents,n=this._groups;typeof A!="function"&&(A=$o(A));for(var i=n.length,s=new Array(i),a=new Array(i),o=new Array(i),B=0;B<i;++B){var c=r[B],u=n[B],l=u.length,f=tB(A.call(c,c&&c.__data__,B,r)),g=f.length,Q=a[B]=new Array(g),w=s[B]=new Array(g),h=o[B]=new Array(l);e(c,u,Q,w,h,f,t);for(var C=0,F=0,p,d;C<g;++C)if(p=Q[C]){for(C>=F&&(F=C+1);!(d=w[F])&&++F<g;);p._next=d||null}}return s=new uA(s,r),s._enter=a,s._exit=o,s}function tB(A){return typeof A=="object"&&"length"in A?A:Array.from(A)}function eB(){return new uA(this._exit||this._groups.map(fi),this._parents)}function rB(A,t,e){var r=this.enter(),n=this,i=this.exit();return typeof A=="function"?(r=A(r),r&&(r=r.selection())):r=r.append(A+""),t!=null&&(n=t(n),n&&(n=n.selection())),e==null?i.remove():e(i),r&&n?r.merge(n).order():n}function nB(A){for(var t=A.selection?A.selection():A,e=this._groups,r=t._groups,n=e.length,i=r.length,s=Math.min(n,i),a=new Array(n),o=0;o<s;++o)for(var B=e[o],c=r[o],u=B.length,l=a[o]=new Array(u),f,g=0;g<u;++g)(f=B[g]||c[g])&&(l[g]=f);for(;o<n;++o)a[o]=e[o];return new uA(a,this._parents)}function iB(){for(var A=this._groups,t=-1,e=A.length;++t<e;)for(var r=A[t],n=r.length-1,i=r[n],s;--n>=0;)(s=r[n])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function sB(A){A||(A=aB);function t(u,l){return u&&l?A(u.__data__,l.__data__):!u-!l}for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i){for(var s=e[i],a=s.length,o=n[i]=new Array(a),B,c=0;c<a;++c)(B=s[c])&&(o[c]=B);o.sort(t)}return new uA(n,this._parents).order()}function aB(A,t){return A<t?-1:A>t?1:A>=t?0:NaN}function oB(){var A=arguments[0];return arguments[0]=this,A.apply(null,arguments),this}function BB(){return Array.from(this)}function cB(){for(var A=this._groups,t=0,e=A.length;t<e;++t)for(var r=A[t],n=0,i=r.length;n<i;++n){var s=r[n];if(s)return s}return null}function uB(){let A=0;for(const t of this)++A;return A}function lB(){return!this.node()}function fB(A){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],i=0,s=n.length,a;i<s;++i)(a=n[i])&&A.call(a,a.__data__,i,n);return this}function gB(A){return function(){this.removeAttribute(A)}}function hB(A){return function(){this.removeAttributeNS(A.space,A.local)}}function wB(A,t){return function(){this.setAttribute(A,t)}}function QB(A,t){return function(){this.setAttributeNS(A.space,A.local,t)}}function CB(A,t){return function(){var e=t.apply(this,arguments);e==null?this.removeAttribute(A):this.setAttribute(A,e)}}function dB(A,t){return function(){var e=t.apply(this,arguments);e==null?this.removeAttributeNS(A.space,A.local):this.setAttributeNS(A.space,A.local,e)}}function UB(A,t){var e=oe(A);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((t==null?e.local?hB:gB:typeof t=="function"?e.local?dB:CB:e.local?QB:wB)(e,t))}function gi(A){return A.ownerDocument&&A.ownerDocument.defaultView||A.document&&A||A.defaultView}function FB(A){return function(){this.style.removeProperty(A)}}function pB(A,t,e){return function(){this.style.setProperty(A,t,e)}}function vB(A,t,e){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(A):this.style.setProperty(A,r,e)}}function yB(A,t,e){return arguments.length>1?this.each((t==null?FB:typeof t=="function"?vB:pB)(A,t,e??"")):at(this.node(),A)}function at(A,t){return A.style.getPropertyValue(t)||gi(A).getComputedStyle(A,null).getPropertyValue(t)}function EB(A){return function(){delete this[A]}}function mB(A,t){return function(){this[A]=t}}function HB(A,t){return function(){var e=t.apply(this,arguments);e==null?delete this[A]:this[A]=e}}function IB(A,t){return arguments.length>1?this.each((t==null?EB:typeof t=="function"?HB:mB)(A,t)):this.node()[A]}function hi(A){return A.trim().split(/^|\s+/)}function Er(A){return A.classList||new wi(A)}function wi(A){this._node=A,this._names=hi(A.getAttribute("class")||"")}wi.prototype={add:function(A){var t=this._names.indexOf(A);t<0&&(this._names.push(A),this._node.setAttribute("class",this._names.join(" ")))},remove:function(A){var t=this._names.indexOf(A);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(A){return this._names.indexOf(A)>=0}};function Qi(A,t){for(var e=Er(A),r=-1,n=t.length;++r<n;)e.add(t[r])}function Ci(A,t){for(var e=Er(A),r=-1,n=t.length;++r<n;)e.remove(t[r])}function xB(A){return function(){Qi(this,A)}}function LB(A){return function(){Ci(this,A)}}function bB(A,t){return function(){(t.apply(this,arguments)?Qi:Ci)(this,A)}}function KB(A,t){var e=hi(A+"");if(arguments.length<2){for(var r=Er(this.node()),n=-1,i=e.length;++n<i;)if(!r.contains(e[n]))return!1;return!0}return this.each((typeof t=="function"?bB:t?xB:LB)(e,t))}function SB(){this.textContent=""}function DB(A){return function(){this.textContent=A}}function TB(A){return function(){var t=A.apply(this,arguments);this.textContent=t??""}}function MB(A){return arguments.length?this.each(A==null?SB:(typeof A=="function"?TB:DB)(A)):this.node().textContent}function _B(){this.innerHTML=""}function OB(A){return function(){this.innerHTML=A}}function RB(A){return function(){var t=A.apply(this,arguments);this.innerHTML=t??""}}function NB(A){return arguments.length?this.each(A==null?_B:(typeof A=="function"?RB:OB)(A)):this.node().innerHTML}function GB(){this.nextSibling&&this.parentNode.appendChild(this)}function VB(){return this.each(GB)}function kB(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function PB(){return this.each(kB)}function XB(A){var t=typeof A=="function"?A:vr(A);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function JB(){return null}function YB(A,t){var e=typeof A=="function"?A:vr(A),r=t==null?JB:typeof t=="function"?t:yr(t);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})}function WB(){var A=this.parentNode;A&&A.removeChild(this)}function ZB(){return this.each(WB)}function $B(){var A=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(A,this.nextSibling):A}function zB(){var A=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(A,this.nextSibling):A}function qB(A){return this.select(A?zB:$B)}function jB(A){return arguments.length?this.property("__data__",A):this.node().__data__}function Ac(A){return function(t){A.call(this,t,this.__data__)}}function tc(A){return A.trim().split(/^|\s+/).map(function(t){var e="",r=t.indexOf(".");return r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),{type:t,name:e}})}function ec(A){return function(){var t=this.__on;if(t){for(var e=0,r=-1,n=t.length,i;e<n;++e)i=t[e],(!A.type||i.type===A.type)&&i.name===A.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function rc(A,t,e){return function(){var r=this.__on,n,i=Ac(t);if(r){for(var s=0,a=r.length;s<a;++s)if((n=r[s]).type===A.type&&n.name===A.name){this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=i,n.options=e),n.value=t;return}}this.addEventListener(A.type,i,e),n={type:A.type,name:A.name,value:t,listener:i,options:e},r?r.push(n):this.__on=[n]}}function nc(A,t,e){var r=tc(A+""),n,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var o=0,B=a.length,c;o<B;++o)for(n=0,c=a[o];n<i;++n)if((s=r[n]).type===c.type&&s.name===c.name)return c.value}return}for(a=t?rc:ec,n=0;n<i;++n)this.each(a(r[n],t,e));return this}function di(A,t,e){var r=gi(A),n=r.CustomEvent;typeof n=="function"?n=new n(t,e):(n=r.document.createEvent("Event"),e?(n.initEvent(t,e.bubbles,e.cancelable),n.detail=e.detail):n.initEvent(t,!1,!1)),A.dispatchEvent(n)}function ic(A,t){return function(){return di(this,A,t)}}function sc(A,t){return function(){return di(this,A,t.apply(this,arguments))}}function ac(A,t){return this.each((typeof t=="function"?sc:ic)(A,t))}function*oc(){for(var A=this._groups,t=0,e=A.length;t<e;++t)for(var r=A[t],n=0,i=r.length,s;n<i;++n)(s=r[n])&&(yield s)}var Ui=[null];function uA(A,t){this._groups=A,this._parents=t}function ot(){return new uA([[document.documentElement]],Ui)}function Bc(){return this}uA.prototype=ot.prototype={constructor:uA,select:To,selectAll:Ro,selectChild:ko,selectChildren:Yo,filter:Wo,data:AB,enter:Zo,exit:eB,join:rB,merge:nB,selection:Bc,order:iB,sort:sB,call:oB,nodes:BB,node:cB,size:uB,empty:lB,each:fB,attr:UB,style:yB,property:IB,classed:KB,text:MB,html:NB,raise:VB,lower:PB,append:XB,insert:YB,remove:ZB,clone:qB,datum:jB,on:nc,dispatch:ac,[Symbol.iterator]:oc};function LA(A){return typeof A=="string"?new uA([[document.querySelector(A)]],[document.documentElement]):new uA([[A]],Ui)}function Fi(A){return LA(vr(A).call(document.documentElement))}function cc(A){let t;for(;t=A.sourceEvent;)A=t;return A}function mr(A,t){if(A=cc(A),t===void 0&&(t=A.currentTarget),t){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=A.clientX,r.y=A.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var n=t.getBoundingClientRect();return[A.clientX-n.left-t.clientLeft,A.clientY-n.top-t.clientTop]}}return[A.pageX,A.pageY]}var uc={value:()=>{}};function Hr(){for(var A=0,t=arguments.length,e={},r;A<t;++A){if(!(r=arguments[A]+"")||r in e||/[\s.]/.test(r))throw new Error("illegal type: "+r);e[r]=[]}return new ce(e)}function ce(A){this._=A}function lc(A,t){return A.trim().split(/^|\s+/).map(function(e){var r="",n=e.indexOf(".");if(n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:r}})}ce.prototype=Hr.prototype={constructor:ce,on:function(A,t){var e=this._,r=lc(A+"",e),n,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((n=(A=r[i]).type)&&(n=fc(e[n],A.name)))return n;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(n=(A=r[i]).type)e[n]=pi(e[n],A.name,t);else if(t==null)for(n in e)e[n]=pi(e[n],A.name,null);return this},copy:function(){var A={},t=this._;for(var e in t)A[e]=t[e].slice();return new ce(A)},call:function(A,t){if((n=arguments.length-2)>0)for(var e=new Array(n),r=0,n,i;r<n;++r)e[r]=arguments[r+2];if(!this._.hasOwnProperty(A))throw new Error("unknown type: "+A);for(i=this._[A],r=0,n=i.length;r<n;++r)i[r].value.apply(t,e)},apply:function(A,t,e){if(!this._.hasOwnProperty(A))throw new Error("unknown type: "+A);for(var r=this._[A],n=0,i=r.length;n<i;++n)r[n].value.apply(t,e)}};function fc(A,t){for(var e=0,r=A.length,n;e<r;++e)if((n=A[e]).name===t)return n.value}function pi(A,t,e){for(var r=0,n=A.length;r<n;++r)if(A[r].name===t){A[r]=uc,A=A.slice(0,r).concat(A.slice(r+1));break}return e!=null&&A.push({name:t,value:e}),A}var Bt=0,xt=0,Lt=0,vi=1e3,ue,bt,le=0,zA=0,fe=0,Kt=typeof performance=="object"&&performance.now?performance:Date,yi=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(A){setTimeout(A,17)};function Ir(){return zA||(yi(gc),zA=Kt.now()+fe)}function gc(){zA=0}function ge(){this._call=this._time=this._next=null}ge.prototype=Ei.prototype={constructor:ge,restart:function(A,t,e){if(typeof A!="function")throw new TypeError("callback is not a function");e=(e==null?Ir():+e)+(t==null?0:+t),!this._next&&bt!==this&&(bt?bt._next=this:ue=this,bt=this),this._call=A,this._time=e,xr()},stop:function(){this._call&&(this._call=null,this._time=1/0,xr())}};function Ei(A,t,e){var r=new ge;return r.restart(A,t,e),r}function hc(){Ir(),++Bt;for(var A=ue,t;A;)(t=zA-A._time)>=0&&A._call.call(void 0,t),A=A._next;--Bt}function mi(){zA=(le=Kt.now())+fe,Bt=xt=0;try{hc()}finally{Bt=0,Qc(),zA=0}}function wc(){var A=Kt.now(),t=A-le;t>vi&&(fe-=t,le=A)}function Qc(){for(var A,t=ue,e,r=1/0;t;)t._call?(r>t._time&&(r=t._time),A=t,t=t._next):(e=t._next,t._next=null,t=A?A._next=e:ue=e);bt=A,xr(r)}function xr(A){if(!Bt){xt&&(xt=clearTimeout(xt));var t=A-zA;t>24?(A<1/0&&(xt=setTimeout(mi,A-Kt.now()-fe)),Lt&&(Lt=clearInterval(Lt))):(Lt||(le=Kt.now(),Lt=setInterval(wc,vi)),Bt=1,yi(mi))}}function Hi(A,t,e){var r=new ge;return t=t==null?0:+t,r.restart(n=>{r.stop(),A(n+t)},t,e),r}var Cc=Hr("start","end","cancel","interrupt"),dc=[],Ii=0,xi=1,Lr=2,he=3,Li=4,br=5,we=6;function Qe(A,t,e,r,n,i){var s=A.__transition;if(!s)A.__transition={};else if(e in s)return;Uc(A,e,{name:t,index:r,group:n,on:Cc,tween:dc,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Ii})}function Kr(A,t){var e=dA(A,t);if(e.state>Ii)throw new Error("too late; already scheduled");return e}function EA(A,t){var e=dA(A,t);if(e.state>he)throw new Error("too late; already running");return e}function dA(A,t){var e=A.__transition;if(!e||!(e=e[t]))throw new Error("transition not found");return e}function Uc(A,t,e){var r=A.__transition,n;r[t]=e,e.timer=Ei(i,0,e.time);function i(B){e.state=xi,e.timer.restart(s,e.delay,e.time),e.delay<=B&&s(B-e.delay)}function s(B){var c,u,l,f;if(e.state!==xi)return o();for(c in r)if(f=r[c],f.name===e.name){if(f.state===he)return Hi(s);f.state===Li?(f.state=we,f.timer.stop(),f.on.call("interrupt",A,A.__data__,f.index,f.group),delete r[c]):+c<t&&(f.state=we,f.timer.stop(),f.on.call("cancel",A,A.__data__,f.index,f.group),delete r[c])}if(Hi(function(){e.state===he&&(e.state=Li,e.timer.restart(a,e.delay,e.time),a(B))}),e.state=Lr,e.on.call("start",A,A.__data__,e.index,e.group),e.state===Lr){for(e.state=he,n=new Array(l=e.tween.length),c=0,u=-1;c<l;++c)(f=e.tween[c].value.call(A,A.__data__,e.index,e.group))&&(n[++u]=f);n.length=u+1}}function a(B){for(var c=B<e.duration?e.ease.call(null,B/e.duration):(e.timer.restart(o),e.state=br,1),u=-1,l=n.length;++u<l;)n[u].call(A,c);e.state===br&&(e.on.call("end",A,A.__data__,e.index,e.group),o())}function o(){e.state=we,e.timer.stop(),delete r[t];for(var B in r)return;delete A.__transition}}function Sr(A,t){var e=A.__transition,r,n,i=!0,s;if(e){t=t==null?null:t+"";for(s in e){if((r=e[s]).name!==t){i=!1;continue}n=r.state>Lr&&r.state<br,r.state=we,r.timer.stop(),r.on.call(n?"interrupt":"cancel",A,A.__data__,r.index,r.group),delete e[s]}i&&delete A.__transition}}function Fc(A){return this.each(function(){Sr(this,A)})}function Dr(A,t,e){A.prototype=t.prototype=e,e.constructor=A}function bi(A,t){var e=Object.create(A.prototype);for(var r in t)e[r]=t[r];return e}function St(){}var Dt=.7,Ce=1/Dt,ct="\\s*([+-]?\\d+)\\s*",Tt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",mA="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pc=/^#([0-9a-f]{3,8})$/,vc=new RegExp(`^rgb\\(${ct},${ct},${ct}\\)$`),yc=new RegExp(`^rgb\\(${mA},${mA},${mA}\\)$`),Ec=new RegExp(`^rgba\\(${ct},${ct},${ct},${Tt}\\)$`),mc=new RegExp(`^rgba\\(${mA},${mA},${mA},${Tt}\\)$`),Hc=new RegExp(`^hsl\\(${Tt},${mA},${mA}\\)$`),Ic=new RegExp(`^hsla\\(${Tt},${mA},${mA},${Tt}\\)$`),Ki={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Dr(St,qA,{copy(A){return Object.assign(new this.constructor,this,A)},displayable(){return this.rgb().displayable()},hex:Si,formatHex:Si,formatHex8:xc,formatHsl:Lc,formatRgb:Di,toString:Di});function Si(){return this.rgb().formatHex()}function xc(){return this.rgb().formatHex8()}function Lc(){return Ri(this).formatHsl()}function Di(){return this.rgb().formatRgb()}function qA(A){var t,e;return A=(A+"").trim().toLowerCase(),(t=pc.exec(A))?(e=t[1].length,t=parseInt(t[1],16),e===6?Ti(t):e===3?new oA(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):e===8?de(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):e===4?de(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=vc.exec(A))?new oA(t[1],t[2],t[3],1):(t=yc.exec(A))?new oA(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Ec.exec(A))?de(t[1],t[2],t[3],t[4]):(t=mc.exec(A))?de(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Hc.exec(A))?Oi(t[1],t[2]/100,t[3]/100,1):(t=Ic.exec(A))?Oi(t[1],t[2]/100,t[3]/100,t[4]):Ki.hasOwnProperty(A)?Ti(Ki[A]):A==="transparent"?new oA(NaN,NaN,NaN,0):null}function Ti(A){return new oA(A>>16&255,A>>8&255,A&255,1)}function de(A,t,e,r){return r<=0&&(A=t=e=NaN),new oA(A,t,e,r)}function bc(A){return A instanceof St||(A=qA(A)),A?(A=A.rgb(),new oA(A.r,A.g,A.b,A.opacity)):new oA}function Tr(A,t,e,r){return arguments.length===1?bc(A):new oA(A,t,e,r??1)}function oA(A,t,e,r){this.r=+A,this.g=+t,this.b=+e,this.opacity=+r}Dr(oA,Tr,bi(St,{brighter(A){return A=A==null?Ce:Math.pow(Ce,A),new oA(this.r*A,this.g*A,this.b*A,this.opacity)},darker(A){return A=A==null?Dt:Math.pow(Dt,A),new oA(this.r*A,this.g*A,this.b*A,this.opacity)},rgb(){return this},clamp(){return new oA(jA(this.r),jA(this.g),jA(this.b),Ue(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Mi,formatHex:Mi,formatHex8:Kc,formatRgb:_i,toString:_i}));function Mi(){return`#${At(this.r)}${At(this.g)}${At(this.b)}`}function Kc(){return`#${At(this.r)}${At(this.g)}${At(this.b)}${At((isNaN(this.opacity)?1:this.opacity)*255)}`}function _i(){const A=Ue(this.opacity);return`${A===1?"rgb(":"rgba("}${jA(this.r)}, ${jA(this.g)}, ${jA(this.b)}${A===1?")":`, ${A})`}`}function Ue(A){return isNaN(A)?1:Math.max(0,Math.min(1,A))}function jA(A){return Math.max(0,Math.min(255,Math.round(A)||0))}function At(A){return A=jA(A),(A<16?"0":"")+A.toString(16)}function Oi(A,t,e,r){return r<=0?A=t=e=NaN:e<=0||e>=1?A=t=NaN:t<=0&&(A=NaN),new UA(A,t,e,r)}function Ri(A){if(A instanceof UA)return new UA(A.h,A.s,A.l,A.opacity);if(A instanceof St||(A=qA(A)),!A)return new UA;if(A instanceof UA)return A;A=A.rgb();var t=A.r/255,e=A.g/255,r=A.b/255,n=Math.min(t,e,r),i=Math.max(t,e,r),s=NaN,a=i-n,o=(i+n)/2;return a?(t===i?s=(e-r)/a+(e<r)*6:e===i?s=(r-t)/a+2:s=(t-e)/a+4,a/=o<.5?i+n:2-i-n,s*=60):a=o>0&&o<1?0:s,new UA(s,a,o,A.opacity)}function Sc(A,t,e,r){return arguments.length===1?Ri(A):new UA(A,t,e,r??1)}function UA(A,t,e,r){this.h=+A,this.s=+t,this.l=+e,this.opacity=+r}Dr(UA,Sc,bi(St,{brighter(A){return A=A==null?Ce:Math.pow(Ce,A),new UA(this.h,this.s,this.l*A,this.opacity)},darker(A){return A=A==null?Dt:Math.pow(Dt,A),new UA(this.h,this.s,this.l*A,this.opacity)},rgb(){var A=this.h%360+(this.h<0)*360,t=isNaN(A)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*t,n=2*e-r;return new oA(Mr(A>=240?A-240:A+120,n,r),Mr(A,n,r),Mr(A<120?A+240:A-120,n,r),this.opacity)},clamp(){return new UA(Ni(this.h),Fe(this.s),Fe(this.l),Ue(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const A=Ue(this.opacity);return`${A===1?"hsl(":"hsla("}${Ni(this.h)}, ${Fe(this.s)*100}%, ${Fe(this.l)*100}%${A===1?")":`, ${A})`}`}}));function Ni(A){return A=(A||0)%360,A<0?A+360:A}function Fe(A){return Math.max(0,Math.min(1,A||0))}function Mr(A,t,e){return(A<60?t+(e-t)*A/60:A<180?e:A<240?t+(e-t)*(240-A)/60:t)*255}const _r=A=>()=>A;function Dc(A,t){return function(e){return A+e*t}}function Tc(A,t,e){return A=Math.pow(A,e),t=Math.pow(t,e)-A,e=1/e,function(r){return Math.pow(A+r*t,e)}}function Mc(A){return(A=+A)==1?Gi:function(t,e){return e-t?Tc(t,e,A):_r(isNaN(t)?e:t)}}function Gi(A,t){var e=t-A;return e?Dc(A,e):_r(isNaN(A)?t:A)}const pe=(function A(t){var e=Mc(t);function r(n,i){var s=e((n=Tr(n)).r,(i=Tr(i)).r),a=e(n.g,i.g),o=e(n.b,i.b),B=Gi(n.opacity,i.opacity);return function(c){return n.r=s(c),n.g=a(c),n.b=o(c),n.opacity=B(c),n+""}}return r.gamma=A,r})(1);function _c(A,t){t||(t=[]);var e=A?Math.min(t.length,A.length):0,r=t.slice(),n;return function(i){for(n=0;n<e;++n)r[n]=A[n]*(1-i)+t[n]*i;return r}}function Oc(A){return ArrayBuffer.isView(A)&&!(A instanceof DataView)}function Rc(A,t){var e=t?t.length:0,r=A?Math.min(e,A.length):0,n=new Array(r),i=new Array(e),s;for(s=0;s<r;++s)n[s]=ve(A[s],t[s]);for(;s<e;++s)i[s]=t[s];return function(a){for(s=0;s<r;++s)i[s]=n[s](a);return i}}function Nc(A,t){var e=new Date;return A=+A,t=+t,function(r){return e.setTime(A*(1-r)+t*r),e}}function FA(A,t){return A=+A,t=+t,function(e){return A*(1-e)+t*e}}function Gc(A,t){var e={},r={},n;(A===null||typeof A!="object")&&(A={}),(t===null||typeof t!="object")&&(t={});for(n in t)n in A?e[n]=ve(A[n],t[n]):r[n]=t[n];return function(i){for(n in e)r[n]=e[n](i);return r}}var Or=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Rr=new RegExp(Or.source,"g");function Vc(A){return function(){return A}}function kc(A){return function(t){return A(t)+""}}function Vi(A,t){var e=Or.lastIndex=Rr.lastIndex=0,r,n,i,s=-1,a=[],o=[];for(A=A+"",t=t+"";(r=Or.exec(A))&&(n=Rr.exec(t));)(i=n.index)>e&&(i=t.slice(e,i),a[s]?a[s]+=i:a[++s]=i),(r=r[0])===(n=n[0])?a[s]?a[s]+=n:a[++s]=n:(a[++s]=null,o.push({i:s,x:FA(r,n)})),e=Rr.lastIndex;return e<t.length&&(i=t.slice(e),a[s]?a[s]+=i:a[++s]=i),a.length<2?o[0]?kc(o[0].x):Vc(t):(t=o.length,function(B){for(var c=0,u;c<t;++c)a[(u=o[c]).i]=u.x(B);return a.join("")})}function ve(A,t){var e=typeof t,r;return t==null||e==="boolean"?_r(t):(e==="number"?FA:e==="string"?(r=qA(t))?(t=r,pe):Vi:t instanceof qA?pe:t instanceof Date?Nc:Oc(t)?_c:Array.isArray(t)?Rc:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Gc:FA)(A,t)}function Pc(A,t){return A=+A,t=+t,function(e){return Math.round(A*(1-e)+t*e)}}var ki=180/Math.PI,Nr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Pi(A,t,e,r,n,i){var s,a,o;return(s=Math.sqrt(A*A+t*t))&&(A/=s,t/=s),(o=A*e+t*r)&&(e-=A*o,r-=t*o),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,o/=a),A*r<t*e&&(A=-A,t=-t,o=-o,s=-s),{translateX:n,translateY:i,rotate:Math.atan2(t,A)*ki,skewX:Math.atan(o)*ki,scaleX:s,scaleY:a}}var ye;function Xc(A){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(A+"");return t.isIdentity?Nr:Pi(t.a,t.b,t.c,t.d,t.e,t.f)}function Jc(A){return A==null||(ye||(ye=document.createElementNS("http://www.w3.org/2000/svg","g")),ye.setAttribute("transform",A),!(A=ye.transform.baseVal.consolidate()))?Nr:(A=A.matrix,Pi(A.a,A.b,A.c,A.d,A.e,A.f))}function Xi(A,t,e,r){function n(B){return B.length?B.pop()+" ":""}function i(B,c,u,l,f,g){if(B!==u||c!==l){var Q=f.push("translate(",null,t,null,e);g.push({i:Q-4,x:FA(B,u)},{i:Q-2,x:FA(c,l)})}else(u||l)&&f.push("translate("+u+t+l+e)}function s(B,c,u,l){B!==c?(B-c>180?c+=360:c-B>180&&(B+=360),l.push({i:u.push(n(u)+"rotate(",null,r)-2,x:FA(B,c)})):c&&u.push(n(u)+"rotate("+c+r)}function a(B,c,u,l){B!==c?l.push({i:u.push(n(u)+"skewX(",null,r)-2,x:FA(B,c)}):c&&u.push(n(u)+"skewX("+c+r)}function o(B,c,u,l,f,g){if(B!==u||c!==l){var Q=f.push(n(f)+"scale(",null,",",null,")");g.push({i:Q-4,x:FA(B,u)},{i:Q-2,x:FA(c,l)})}else(u!==1||l!==1)&&f.push(n(f)+"scale("+u+","+l+")")}return function(B,c){var u=[],l=[];return B=A(B),c=A(c),i(B.translateX,B.translateY,c.translateX,c.translateY,u,l),s(B.rotate,c.rotate,u,l),a(B.skewX,c.skewX,u,l),o(B.scaleX,B.scaleY,c.scaleX,c.scaleY,u,l),B=c=null,function(f){for(var g=-1,Q=l.length,w;++g<Q;)u[(w=l[g]).i]=w.x(f);return u.join("")}}}var Yc=Xi(Xc,"px, ","px)","deg)"),Wc=Xi(Jc,", ",")",")");function Zc(A,t){var e,r;return function(){var n=EA(this,A),i=n.tween;if(i!==e){r=e=i;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}n.tween=r}}function $c(A,t,e){var r,n;if(typeof e!="function")throw new Error;return function(){var i=EA(this,A),s=i.tween;if(s!==r){n=(r=s).slice();for(var a={name:t,value:e},o=0,B=n.length;o<B;++o)if(n[o].name===t){n[o]=a;break}o===B&&n.push(a)}i.tween=n}}function zc(A,t){var e=this._id;if(A+="",arguments.length<2){for(var r=dA(this.node(),e).tween,n=0,i=r.length,s;n<i;++n)if((s=r[n]).name===A)return s.value;return null}return this.each((t==null?Zc:$c)(e,A,t))}function Gr(A,t,e){var r=A._id;return A.each(function(){var n=EA(this,r);(n.value||(n.value={}))[t]=e.apply(this,arguments)}),function(n){return dA(n,r).value[t]}}function Ji(A,t){var e;return(typeof t=="number"?FA:t instanceof qA?pe:(e=qA(t))?(t=e,pe):Vi)(A,t)}function qc(A){return function(){this.removeAttribute(A)}}function jc(A){return function(){this.removeAttributeNS(A.space,A.local)}}function Au(A,t,e){var r,n=e+"",i;return function(){var s=this.getAttribute(A);return s===n?null:s===r?i:i=t(r=s,e)}}function tu(A,t,e){var r,n=e+"",i;return function(){var s=this.getAttributeNS(A.space,A.local);return s===n?null:s===r?i:i=t(r=s,e)}}function eu(A,t,e){var r,n,i;return function(){var s,a=e(this),o;return a==null?void this.removeAttribute(A):(s=this.getAttribute(A),o=a+"",s===o?null:s===r&&o===n?i:(n=o,i=t(r=s,a)))}}function ru(A,t,e){var r,n,i;return function(){var s,a=e(this),o;return a==null?void this.removeAttributeNS(A.space,A.local):(s=this.getAttributeNS(A.space,A.local),o=a+"",s===o?null:s===r&&o===n?i:(n=o,i=t(r=s,a)))}}function nu(A,t){var e=oe(A),r=e==="transform"?Wc:Ji;return this.attrTween(A,typeof t=="function"?(e.local?ru:eu)(e,r,Gr(this,"attr."+A,t)):t==null?(e.local?jc:qc)(e):(e.local?tu:Au)(e,r,t))}function iu(A,t){return function(e){this.setAttribute(A,t.call(this,e))}}function su(A,t){return function(e){this.setAttributeNS(A.space,A.local,t.call(this,e))}}function au(A,t){var e,r;function n(){var i=t.apply(this,arguments);return i!==r&&(e=(r=i)&&su(A,i)),e}return n._value=t,n}function ou(A,t){var e,r;function n(){var i=t.apply(this,arguments);return i!==r&&(e=(r=i)&&iu(A,i)),e}return n._value=t,n}function Bu(A,t){var e="attr."+A;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;var r=oe(A);return this.tween(e,(r.local?au:ou)(r,t))}function cu(A,t){return function(){Kr(this,A).delay=+t.apply(this,arguments)}}function uu(A,t){return t=+t,function(){Kr(this,A).delay=t}}function lu(A){var t=this._id;return arguments.length?this.each((typeof A=="function"?cu:uu)(t,A)):dA(this.node(),t).delay}function fu(A,t){return function(){EA(this,A).duration=+t.apply(this,arguments)}}function gu(A,t){return t=+t,function(){EA(this,A).duration=t}}function hu(A){var t=this._id;return arguments.length?this.each((typeof A=="function"?fu:gu)(t,A)):dA(this.node(),t).duration}function wu(A,t){if(typeof t!="function")throw new Error;return function(){EA(this,A).ease=t}}function Qu(A){var t=this._id;return arguments.length?this.each(wu(t,A)):dA(this.node(),t).ease}function Cu(A,t){return function(){var e=t.apply(this,arguments);if(typeof e!="function")throw new Error;EA(this,A).ease=e}}function du(A){if(typeof A!="function")throw new Error;return this.each(Cu(this._id,A))}function Uu(A){typeof A!="function"&&(A=ui(A));for(var t=this._groups,e=t.length,r=new Array(e),n=0;n<e;++n)for(var i=t[n],s=i.length,a=r[n]=[],o,B=0;B<s;++B)(o=i[B])&&A.call(o,o.__data__,B,i)&&a.push(o);return new bA(r,this._parents,this._name,this._id)}function Fu(A){if(A._id!==this._id)throw new Error;for(var t=this._groups,e=A._groups,r=t.length,n=e.length,i=Math.min(r,n),s=new Array(r),a=0;a<i;++a)for(var o=t[a],B=e[a],c=o.length,u=s[a]=new Array(c),l,f=0;f<c;++f)(l=o[f]||B[f])&&(u[f]=l);for(;a<r;++a)s[a]=t[a];return new bA(s,this._parents,this._name,this._id)}function pu(A){return(A+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||t==="start"})}function vu(A,t,e){var r,n,i=pu(t)?Kr:EA;return function(){var s=i(this,A),a=s.on;a!==r&&(n=(r=a).copy()).on(t,e),s.on=n}}function yu(A,t){var e=this._id;return arguments.length<2?dA(this.node(),e).on.on(A):this.each(vu(e,A,t))}function Eu(A){return function(){var t=this.parentNode;for(var e in this.__transition)if(+e!==A)return;t&&t.removeChild(this)}}function mu(){return this.on("end.remove",Eu(this._id))}function Hu(A){var t=this._name,e=this._id;typeof A!="function"&&(A=yr(A));for(var r=this._groups,n=r.length,i=new Array(n),s=0;s<n;++s)for(var a=r[s],o=a.length,B=i[s]=new Array(o),c,u,l=0;l<o;++l)(c=a[l])&&(u=A.call(c,c.__data__,l,a))&&("__data__"in c&&(u.__data__=c.__data__),B[l]=u,Qe(B[l],t,e,l,B,dA(c,e)));return new bA(i,this._parents,t,e)}function Iu(A){var t=this._name,e=this._id;typeof A!="function"&&(A=ci(A));for(var r=this._groups,n=r.length,i=[],s=[],a=0;a<n;++a)for(var o=r[a],B=o.length,c,u=0;u<B;++u)if(c=o[u]){for(var l=A.call(c,c.__data__,u,o),f,g=dA(c,e),Q=0,w=l.length;Q<w;++Q)(f=l[Q])&&Qe(f,t,e,Q,l,g);i.push(l),s.push(c)}return new bA(i,s,t,e)}var xu=ot.prototype.constructor;function Lu(){return new xu(this._groups,this._parents)}function bu(A,t){var e,r,n;return function(){var i=at(this,A),s=(this.style.removeProperty(A),at(this,A));return i===s?null:i===e&&s===r?n:n=t(e=i,r=s)}}function Yi(A){return function(){this.style.removeProperty(A)}}function Ku(A,t,e){var r,n=e+"",i;return function(){var s=at(this,A);return s===n?null:s===r?i:i=t(r=s,e)}}function Su(A,t,e){var r,n,i;return function(){var s=at(this,A),a=e(this),o=a+"";return a==null&&(o=a=(this.style.removeProperty(A),at(this,A))),s===o?null:s===r&&o===n?i:(n=o,i=t(r=s,a))}}function Du(A,t){var e,r,n,i="style."+t,s="end."+i,a;return function(){var o=EA(this,A),B=o.on,c=o.value[i]==null?a||(a=Yi(t)):void 0;(B!==e||n!==c)&&(r=(e=B).copy()).on(s,n=c),o.on=r}}function Tu(A,t,e){var r=(A+="")=="transform"?Yc:Ji;return t==null?this.styleTween(A,bu(A,r)).on("end.style."+A,Yi(A)):typeof t=="function"?this.styleTween(A,Su(A,r,Gr(this,"style."+A,t))).each(Du(this._id,A)):this.styleTween(A,Ku(A,r,t),e).on("end.style."+A,null)}function Mu(A,t,e){return function(r){this.style.setProperty(A,t.call(this,r),e)}}function _u(A,t,e){var r,n;function i(){var s=t.apply(this,arguments);return s!==n&&(r=(n=s)&&Mu(A,s,e)),r}return i._value=t,i}function Ou(A,t,e){var r="style."+(A+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,_u(A,t,e??""))}function Ru(A){return function(){this.textContent=A}}function Nu(A){return function(){var t=A(this);this.textContent=t??""}}function Gu(A){return this.tween("text",typeof A=="function"?Nu(Gr(this,"text",A)):Ru(A==null?"":A+""))}function Vu(A){return function(t){this.textContent=A.call(this,t)}}function ku(A){var t,e;function r(){var n=A.apply(this,arguments);return n!==e&&(t=(e=n)&&Vu(n)),t}return r._value=A,r}function Pu(A){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(A==null)return this.tween(t,null);if(typeof A!="function")throw new Error;return this.tween(t,ku(A))}function Xu(){for(var A=this._name,t=this._id,e=Zi(),r=this._groups,n=r.length,i=0;i<n;++i)for(var s=r[i],a=s.length,o,B=0;B<a;++B)if(o=s[B]){var c=dA(o,t);Qe(o,A,e,B,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new bA(r,this._parents,A,e)}function Ju(){var A,t,e=this,r=e._id,n=e.size();return new Promise(function(i,s){var a={value:s},o={value:function(){--n===0&&i()}};e.each(function(){var B=EA(this,r),c=B.on;c!==A&&(t=(A=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(o)),B.on=t}),n===0&&i()})}var Yu=0;function bA(A,t,e,r){this._groups=A,this._parents=t,this._name=e,this._id=r}function Wi(A){return ot().transition(A)}function Zi(){return++Yu}var KA=ot.prototype;bA.prototype=Wi.prototype={constructor:bA,select:Hu,selectAll:Iu,selectChild:KA.selectChild,selectChildren:KA.selectChildren,filter:Uu,merge:Fu,selection:Lu,transition:Xu,call:KA.call,nodes:KA.nodes,node:KA.node,size:KA.size,empty:KA.empty,each:KA.each,on:yu,attr:nu,attrTween:Bu,style:Tu,styleTween:Ou,text:Gu,textTween:Pu,remove:mu,tween:zc,delay:lu,duration:hu,ease:Qu,easeVarying:du,end:Ju,[Symbol.iterator]:KA[Symbol.iterator]};function Wu(A){return((A*=2)<=1?A*A*A:(A-=2)*A*A+2)/2}var Zu={time:null,delay:0,duration:250,ease:Wu};function $u(A,t){for(var e;!(e=A.__transition)||!(e=e[t]);)if(!(A=A.parentNode))throw new Error(`transition ${t} not found`);return e}function zu(A){var t,e;A instanceof bA?(t=A._id,A=A._name):(t=Zi(),(e=Zu).time=Ir(),A=A==null?null:A+"");for(var r=this._groups,n=r.length,i=0;i<n;++i)for(var s=r[i],a=s.length,o,B=0;B<a;++B)(o=s[B])&&Qe(o,A,t,B,s,e||$u(o,t));return new bA(r,this._parents,A,t)}ot.prototype.interrupt=Fc,ot.prototype.transition=zu;function qu(A){return A}var Vr=1,kr=2,Pr=3,Mt=4,$i=1e-6;function ju(A){return"translate("+A+",0)"}function Al(A){return"translate(0,"+A+")"}function tl(A){return t=>+A(t)}function el(A,t){return t=Math.max(0,A.bandwidth()-t*2)/2,A.round()&&(t=Math.round(t)),e=>+A(e)+t}function rl(){return!this.__axis}function zi(A,t){var e=[],r=null,n=null,i=6,s=6,a=3,o=typeof window<"u"&&window.devicePixelRatio>1?0:.5,B=A===Vr||A===Mt?-1:1,c=A===Mt||A===kr?"x":"y",u=A===Vr||A===Pr?ju:Al;function l(f){var g=r??(t.ticks?t.ticks.apply(t,e):t.domain()),Q=n??(t.tickFormat?t.tickFormat.apply(t,e):qu),w=Math.max(i,0)+a,h=t.range(),C=+h[0]+o,F=+h[h.length-1]+o,p=(t.bandwidth?el:tl)(t.copy(),o),d=f.selection?f.selection():f,U=d.selectAll(".domain").data([null]),y=d.selectAll(".tick").data(g,t).order(),v=y.exit(),m=y.enter().append("g").attr("class","tick"),L=y.select("line"),E=y.select("text");U=U.merge(U.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),y=y.merge(m),L=L.merge(m.append("line").attr("stroke","currentColor").attr(c+"2",B*i)),E=E.merge(m.append("text").attr("fill","currentColor").attr(c,B*w).attr("dy",A===Vr?"0em":A===Pr?"0.71em":"0.32em")),f!==d&&(U=U.transition(f),y=y.transition(f),L=L.transition(f),E=E.transition(f),v=v.transition(f).attr("opacity",$i).attr("transform",function(K){return isFinite(K=p(K))?u(K+o):this.getAttribute("transform")}),m.attr("opacity",$i).attr("transform",function(K){var H=this.parentNode.__axis;return u((H&&isFinite(H=H(K))?H:p(K))+o)})),v.remove(),U.attr("d",A===Mt||A===kr?s?"M"+B*s+","+C+"H"+o+"V"+F+"H"+B*s:"M"+o+","+C+"V"+F:s?"M"+C+","+B*s+"V"+o+"H"+F+"V"+B*s:"M"+C+","+o+"H"+F),y.attr("opacity",1).attr("transform",function(K){return u(p(K)+o)}),L.attr(c+"2",B*i),E.attr(c,B*w).text(Q),d.filter(rl).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",A===kr?"start":A===Mt?"end":"middle"),d.each(function(){this.__axis=p})}return l.scale=function(f){return arguments.length?(t=f,l):t},l.ticks=function(){return e=Array.from(arguments),l},l.tickArguments=function(f){return arguments.length?(e=f==null?[]:Array.from(f),l):e.slice()},l.tickValues=function(f){return arguments.length?(r=f==null?null:Array.from(f),l):r&&r.slice()},l.tickFormat=function(f){return arguments.length?(n=f,l):n},l.tickSize=function(f){return arguments.length?(i=s=+f,l):i},l.tickSizeInner=function(f){return arguments.length?(i=+f,l):i},l.tickSizeOuter=function(f){return arguments.length?(s=+f,l):s},l.tickPadding=function(f){return arguments.length?(a=+f,l):a},l.offset=function(f){return arguments.length?(o=+f,l):o},l}function nl(A){return zi(Pr,A)}function il(A){return zi(Mt,A)}const Xr={capture:!0,passive:!1};function Jr(A){A.preventDefault(),A.stopImmediatePropagation()}function sl(A){var t=A.document.documentElement,e=LA(A).on("dragstart.drag",Jr,Xr);"onselectstart"in t?e.on("selectstart.drag",Jr,Xr):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function al(A,t){var e=A.document.documentElement,r=LA(A).on("dragstart.drag",null);t&&(r.on("click.drag",Jr,Xr),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}const Yr=A=>()=>A;function ol(A,{sourceEvent:t,target:e,selection:r,mode:n,dispatch:i}){Object.defineProperties(this,{type:{value:A,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:n,enumerable:!0,configurable:!0},_:{value:i}})}function Bl(A){A.stopImmediatePropagation()}function Wr(A){A.preventDefault(),A.stopImmediatePropagation()}var qi={name:"drag"},Zr={name:"space"},ut={name:"handle"},lt={name:"center"};const{abs:ji,max:rA,min:nA}=Math;function As(A){return[+A[0],+A[1]]}function $r(A){return[As(A[0]),As(A[1])]}var zr={},qr={},cl={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(jr),input:function(A){return A==null?null:$r(A)},output:function(A){return A}},SA={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},ts={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},es={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},ul={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},ll={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function jr(A){return{type:A}}function fl(A){return!A.ctrlKey&&!A.button}function gl(){var A=this.ownerSVGElement||this;return A.hasAttribute("viewBox")?(A=A.viewBox.baseVal,[[A.x,A.y],[A.x+A.width,A.y+A.height]]):[[0,0],[A.width.baseVal.value,A.height.baseVal.value]]}function hl(){return navigator.maxTouchPoints||"ontouchstart"in this}function An(A){for(;!A.__brush;)if(!(A=A.parentNode))return;return A.__brush}function wl(A){return A[0][0]===A[1][0]||A[0][1]===A[1][1]}function Ql(){return Cl(cl)}function Cl(A){var t=gl,e=fl,r=hl,n=!0,i=Hr("start","brush","end"),s=6,a;function o(w){var h=w.property("__brush",Q).selectAll(".overlay").data([jr("overlay")]);h.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",SA.overlay).merge(h).each(function(){var F=An(this).extent;LA(this).attr("x",F[0][0]).attr("y",F[0][1]).attr("width",F[1][0]-F[0][0]).attr("height",F[1][1]-F[0][1])}),w.selectAll(".selection").data([jr("selection")]).enter().append("rect").attr("class","selection").attr("cursor",SA.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var C=w.selectAll(".handle").data(A.handles,function(F){return F.type});C.exit().remove(),C.enter().append("rect").attr("class",function(F){return"handle handle--"+F.type}).attr("cursor",function(F){return SA[F.type]}),w.each(B).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",l).filter(r).on("touchstart.brush",l).on("touchmove.brush",f).on("touchend.brush touchcancel.brush",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}o.move=function(w,h,C){w.tween?w.on("start.brush",function(F){c(this,arguments).beforestart().start(F)}).on("interrupt.brush end.brush",function(F){c(this,arguments).end(F)}).tween("brush",function(){var F=this,p=F.__brush,d=c(F,arguments),U=p.selection,y=A.input(typeof h=="function"?h.apply(this,arguments):h,p.extent),v=ve(U,y);function m(L){p.selection=L===1&&y===null?null:v(L),B.call(F),d.brush()}return U!==null&&y!==null?m:m(1)}):w.each(function(){var F=this,p=arguments,d=F.__brush,U=A.input(typeof h=="function"?h.apply(F,p):h,d.extent),y=c(F,p).beforestart();Sr(F),d.selection=U===null?null:U,B.call(F),y.start(C).brush(C).end(C)})},o.clear=function(w,h){o.move(w,null,h)};function B(){var w=LA(this),h=An(this).selection;h?(w.selectAll(".selection").style("display",null).attr("x",h[0][0]).attr("y",h[0][1]).attr("width",h[1][0]-h[0][0]).attr("height",h[1][1]-h[0][1]),w.selectAll(".handle").style("display",null).attr("x",function(C){return C.type[C.type.length-1]==="e"?h[1][0]-s/2:h[0][0]-s/2}).attr("y",function(C){return C.type[0]==="s"?h[1][1]-s/2:h[0][1]-s/2}).attr("width",function(C){return C.type==="n"||C.type==="s"?h[1][0]-h[0][0]+s:s}).attr("height",function(C){return C.type==="e"||C.type==="w"?h[1][1]-h[0][1]+s:s})):w.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(w,h,C){var F=w.__brush.emitter;return F&&(!C||!F.clean)?F:new u(w,h,C)}function u(w,h,C){this.that=w,this.args=h,this.state=w.__brush,this.active=0,this.clean=C}u.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(w,h){return this.starting?(this.starting=!1,this.emit("start",w,h)):this.emit("brush",w),this},brush:function(w,h){return this.emit("brush",w,h),this},end:function(w,h){return--this.active===0&&(delete this.state.emitter,this.emit("end",w,h)),this},emit:function(w,h,C){var F=LA(this.that).datum();i.call(w,this.that,new ol(w,{sourceEvent:h,target:o,selection:A.output(this.state.selection),mode:C,dispatch:i}),F)}};function l(w){if(a&&!w.touches||!e.apply(this,arguments))return;var h=this,C=w.target.__data__.type,F=(n&&w.metaKey?C="overlay":C)==="selection"?qi:n&&w.altKey?lt:ut,p=A===qr?null:ul[C],d=A===zr?null:ll[C],U=An(h),y=U.extent,v=U.selection,m=y[0][0],L,E,K=y[0][1],H,S,Y=y[1][0],M,_,J=y[1][1],b,P,G=0,V=0,fA,CA=p&&d&&n&&w.shiftKey,cA,yA,z=Array.from(w.touches||[w],T=>{const j=T.identifier;return T=mr(T,h),T.point0=T.slice(),T.identifier=j,T});Sr(h);var ie=c(h,arguments,!0).beforestart();if(C==="overlay"){v&&(fA=!0);const T=[z[0],z[1]||z[0]];U.selection=v=[[L=A===qr?m:nA(T[0][0],T[1][0]),H=A===zr?K:nA(T[0][1],T[1][1])],[M=A===qr?Y:rA(T[0][0],T[1][0]),b=A===zr?J:rA(T[0][1],T[1][1])]],z.length>1&&st(w)}else L=v[0][0],H=v[0][1],M=v[1][0],b=v[1][1];E=L,S=H,_=M,P=b;var Io=LA(h).attr("pointer-events","none"),se=Io.selectAll(".overlay").attr("cursor",SA[C]);if(w.touches)ie.moved=Lo,ie.ended=bo;else{var xo=LA(w.view).on("mousemove.brush",Lo,!0).on("mouseup.brush",bo,!0);n&&xo.on("keydown.brush",NC,!0).on("keyup.brush",GC,!0),sl(w.view)}B.call(h),ie.start(w,F.name);function Lo(T){for(const j of T.changedTouches||[T])for(const ae of z)ae.identifier===j.identifier&&(ae.cur=mr(j,h));if(CA&&!cA&&!yA&&z.length===1){const j=z[0];ji(j.cur[0]-j[0])>ji(j.cur[1]-j[1])?yA=!0:cA=!0}for(const j of z)j.cur&&(j[0]=j.cur[0],j[1]=j.cur[1]);fA=!0,Wr(T),st(T)}function st(T){const j=z[0],ae=j.point0;var ZA;switch(G=j[0]-ae[0],V=j[1]-ae[1],F){case Zr:case qi:{p&&(G=rA(m-L,nA(Y-M,G)),E=L+G,_=M+G),d&&(V=rA(K-H,nA(J-b,V)),S=H+V,P=b+V);break}case ut:{z[1]?(p&&(E=rA(m,nA(Y,z[0][0])),_=rA(m,nA(Y,z[1][0])),p=1),d&&(S=rA(K,nA(J,z[0][1])),P=rA(K,nA(J,z[1][1])),d=1)):(p<0?(G=rA(m-L,nA(Y-L,G)),E=L+G,_=M):p>0&&(G=rA(m-M,nA(Y-M,G)),E=L,_=M+G),d<0?(V=rA(K-H,nA(J-H,V)),S=H+V,P=b):d>0&&(V=rA(K-b,nA(J-b,V)),S=H,P=b+V));break}case lt:{p&&(E=rA(m,nA(Y,L-G*p)),_=rA(m,nA(Y,M+G*p))),d&&(S=rA(K,nA(J,H-V*d)),P=rA(K,nA(J,b+V*d)));break}}_<E&&(p*=-1,ZA=L,L=M,M=ZA,ZA=E,E=_,_=ZA,C in ts&&se.attr("cursor",SA[C=ts[C]])),P<S&&(d*=-1,ZA=H,H=b,b=ZA,ZA=S,S=P,P=ZA,C in es&&se.attr("cursor",SA[C=es[C]])),U.selection&&(v=U.selection),cA&&(E=v[0][0],_=v[1][0]),yA&&(S=v[0][1],P=v[1][1]),(v[0][0]!==E||v[0][1]!==S||v[1][0]!==_||v[1][1]!==P)&&(U.selection=[[E,S],[_,P]],B.call(h),ie.brush(T,F.name))}function bo(T){if(Bl(T),T.touches){if(T.touches.length)return;a&&clearTimeout(a),a=setTimeout(function(){a=null},500)}else al(T.view,fA),xo.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);Io.attr("pointer-events","all"),se.attr("cursor",SA.overlay),U.selection&&(v=U.selection),wl(v)&&(U.selection=null,B.call(h)),ie.end(T,F.name)}function NC(T){switch(T.keyCode){case 16:{CA=p&&d;break}case 18:{F===ut&&(p&&(M=_-G*p,L=E+G*p),d&&(b=P-V*d,H=S+V*d),F=lt,st(T));break}case 32:{(F===ut||F===lt)&&(p<0?M=_-G:p>0&&(L=E-G),d<0?b=P-V:d>0&&(H=S-V),F=Zr,se.attr("cursor",SA.selection),st(T));break}default:return}Wr(T)}function GC(T){switch(T.keyCode){case 16:{CA&&(cA=yA=CA=!1,st(T));break}case 18:{F===lt&&(p<0?M=_:p>0&&(L=E),d<0?b=P:d>0&&(H=S),F=ut,st(T));break}case 32:{F===Zr&&(T.altKey?(p&&(M=_-G*p,L=E+G*p),d&&(b=P-V*d,H=S+V*d),F=lt):(p<0?M=_:p>0&&(L=E),d<0?b=P:d>0&&(H=S),F=ut),se.attr("cursor",SA[C]),st(T));break}default:return}Wr(T)}}function f(w){c(this,arguments).moved(w)}function g(w){c(this,arguments).ended(w)}function Q(){var w=this.__brush||{selection:null};return w.extent=$r(t.apply(this,arguments)),w.dim=A,w}return o.extent=function(w){return arguments.length?(t=typeof w=="function"?w:Yr($r(w)),o):t},o.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Yr(!!w),o):e},o.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:Yr(!!w),o):r},o.handleSize=function(w){return arguments.length?(s=+w,o):s},o.keyModifiers=function(w){return arguments.length?(n=!!w,o):n},o.on=function(){var w=i.on.apply(i,arguments);return w===i?o:w},o}function Ee(A,t){return A==null||t==null?NaN:A<t?-1:A>t?1:A>=t?0:NaN}function dl(A,t){return A==null||t==null?NaN:t<A?-1:t>A?1:t>=A?0:NaN}function rs(A){let t,e,r;A.length!==2?(t=Ee,e=(a,o)=>Ee(A(a),o),r=(a,o)=>A(a)-o):(t=A===Ee||A===dl?A:Ul,e=A,r=A);function n(a,o,B=0,c=a.length){if(B<c){if(t(o,o)!==0)return c;do{const u=B+c>>>1;e(a[u],o)<0?B=u+1:c=u}while(B<c)}return B}function i(a,o,B=0,c=a.length){if(B<c){if(t(o,o)!==0)return c;do{const u=B+c>>>1;e(a[u],o)<=0?B=u+1:c=u}while(B<c)}return B}function s(a,o,B=0,c=a.length){const u=n(a,o,B,c-1);return u>B&&r(a[u-1],o)>-r(a[u],o)?u-1:u}return{left:n,center:s,right:i}}function Ul(){return 0}function Fl(A){return A===null?NaN:+A}const pl=rs(Ee).right;rs(Fl).center;class ns extends Map{constructor(t,e=El){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),t!=null)for(const[r,n]of t)this.set(r,n)}get(t){return super.get(is(this,t))}has(t){return super.has(is(this,t))}set(t,e){return super.set(vl(this,t),e)}delete(t){return super.delete(yl(this,t))}}function is({_intern:A,_key:t},e){const r=t(e);return A.has(r)?A.get(r):e}function vl({_intern:A,_key:t},e){const r=t(e);return A.has(r)?A.get(r):(A.set(r,e),e)}function yl({_intern:A,_key:t},e){const r=t(e);return A.has(r)&&(e=A.get(r),A.delete(r)),e}function El(A){return A!==null&&typeof A=="object"?A.valueOf():A}const ml=Math.sqrt(50),Hl=Math.sqrt(10),Il=Math.sqrt(2);function me(A,t,e){const r=(t-A)/Math.max(0,e),n=Math.floor(Math.log10(r)),i=r/Math.pow(10,n),s=i>=ml?10:i>=Hl?5:i>=Il?2:1;let a,o,B;return n<0?(B=Math.pow(10,-n)/s,a=Math.round(A*B),o=Math.round(t*B),a/B<A&&++a,o/B>t&&--o,B=-B):(B=Math.pow(10,n)*s,a=Math.round(A/B),o=Math.round(t/B),a*B<A&&++a,o*B>t&&--o),o<a&&.5<=e&&e<2?me(A,t,e*2):[a,o,B]}function tn(A,t,e){if(t=+t,A=+A,e=+e,!(e>0))return[];if(A===t)return[A];const r=t<A,[n,i,s]=r?me(t,A,e):me(A,t,e);if(!(i>=n))return[];const a=i-n+1,o=new Array(a);if(r)if(s<0)for(let B=0;B<a;++B)o[B]=(i-B)/-s;else for(let B=0;B<a;++B)o[B]=(i-B)*s;else if(s<0)for(let B=0;B<a;++B)o[B]=(n+B)/-s;else for(let B=0;B<a;++B)o[B]=(n+B)*s;return o}function en(A,t,e){return t=+t,A=+A,e=+e,me(A,t,e)[2]}function xl(A,t,e){t=+t,A=+A,e=+e;const r=t<A,n=r?en(t,A,e):en(A,t,e);return(r?-1:1)*(n<0?1/-n:n)}function Ll(A,t,e){A=+A,t=+t,e=(n=arguments.length)<2?(t=A,A=0,1):n<3?1:+e;for(var r=-1,n=Math.max(0,Math.ceil((t-A)/e))|0,i=new Array(n);++r<n;)i[r]=A+r*e;return i}function He(A,t){switch(arguments.length){case 0:break;case 1:this.range(A);break;default:this.range(t).domain(A);break}return this}const ss=Symbol("implicit");function as(){var A=new ns,t=[],e=[],r=ss;function n(i){let s=A.get(i);if(s===void 0){if(r!==ss)return r;A.set(i,s=t.push(i)-1)}return e[s%e.length]}return n.domain=function(i){if(!arguments.length)return t.slice();t=[],A=new ns;for(const s of i)A.has(s)||A.set(s,t.push(s)-1);return n},n.range=function(i){return arguments.length?(e=Array.from(i),n):e.slice()},n.unknown=function(i){return arguments.length?(r=i,n):r},n.copy=function(){return as(t,e).unknown(r)},He.apply(n,arguments),n}function os(){var A=as().unknown(void 0),t=A.domain,e=A.range,r=0,n=1,i,s,a=!1,o=0,B=0,c=.5;delete A.unknown;function u(){var l=t().length,f=n<r,g=f?n:r,Q=f?r:n;i=(Q-g)/Math.max(1,l-o+B*2),a&&(i=Math.floor(i)),g+=(Q-g-i*(l-o))*c,s=i*(1-o),a&&(g=Math.round(g),s=Math.round(s));var w=Ll(l).map(function(h){return g+i*h});return e(f?w.reverse():w)}return A.domain=function(l){return arguments.length?(t(l),u()):t()},A.range=function(l){return arguments.length?([r,n]=l,r=+r,n=+n,u()):[r,n]},A.rangeRound=function(l){return[r,n]=l,r=+r,n=+n,a=!0,u()},A.bandwidth=function(){return s},A.step=function(){return i},A.round=function(l){return arguments.length?(a=!!l,u()):a},A.padding=function(l){return arguments.length?(o=Math.min(1,B=+l),u()):o},A.paddingInner=function(l){return arguments.length?(o=Math.min(1,l),u()):o},A.paddingOuter=function(l){return arguments.length?(B=+l,u()):B},A.align=function(l){return arguments.length?(c=Math.max(0,Math.min(1,l)),u()):c},A.copy=function(){return os(t(),[r,n]).round(a).paddingInner(o).paddingOuter(B).align(c)},He.apply(u(),arguments)}function bl(A){return function(){return A}}function Kl(A){return+A}var Bs=[0,1];function ft(A){return A}function rn(A,t){return(t-=A=+A)?function(e){return(e-A)/t}:bl(isNaN(t)?NaN:.5)}function Sl(A,t){var e;return A>t&&(e=A,A=t,t=e),function(r){return Math.max(A,Math.min(t,r))}}function Dl(A,t,e){var r=A[0],n=A[1],i=t[0],s=t[1];return n<r?(r=rn(n,r),i=e(s,i)):(r=rn(r,n),i=e(i,s)),function(a){return i(r(a))}}function Tl(A,t,e){var r=Math.min(A.length,t.length)-1,n=new Array(r),i=new Array(r),s=-1;for(A[r]<A[0]&&(A=A.slice().reverse(),t=t.slice().reverse());++s<r;)n[s]=rn(A[s],A[s+1]),i[s]=e(t[s],t[s+1]);return function(a){var o=pl(A,a,1,r)-1;return i[o](n[o](a))}}function cs(A,t){return t.domain(A.domain()).range(A.range()).interpolate(A.interpolate()).clamp(A.clamp()).unknown(A.unknown())}function us(){var A=Bs,t=Bs,e=ve,r,n,i,s=ft,a,o,B;function c(){var l=Math.min(A.length,t.length);return s!==ft&&(s=Sl(A[0],A[l-1])),a=l>2?Tl:Dl,o=B=null,u}function u(l){return l==null||isNaN(l=+l)?i:(o||(o=a(A.map(r),t,e)))(r(s(l)))}return u.invert=function(l){return s(n((B||(B=a(t,A.map(r),FA)))(l)))},u.domain=function(l){return arguments.length?(A=Array.from(l,Kl),c()):A.slice()},u.range=function(l){return arguments.length?(t=Array.from(l),c()):t.slice()},u.rangeRound=function(l){return t=Array.from(l),e=Pc,c()},u.clamp=function(l){return arguments.length?(s=l?!0:ft,c()):s!==ft},u.interpolate=function(l){return arguments.length?(e=l,c()):e},u.unknown=function(l){return arguments.length?(i=l,u):i},function(l,f){return r=l,n=f,c()}}function Ml(){return us()(ft,ft)}function _l(A){return Math.abs(A=Math.round(A))>=1e21?A.toLocaleString("en").replace(/,/g,""):A.toString(10)}function Ie(A,t){if((e=(A=t?A.toExponential(t-1):A.toExponential()).indexOf("e"))<0)return null;var e,r=A.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+A.slice(e+1)]}function gt(A){return A=Ie(Math.abs(A)),A?A[1]:NaN}function Ol(A,t){return function(e,r){for(var n=e.length,i=[],s=0,a=A[0],o=0;n>0&&a>0&&(o+a+1>r&&(a=Math.max(1,r-o)),i.push(e.substring(n-=a,n+a)),!((o+=a+1)>r));)a=A[s=(s+1)%A.length];return i.reverse().join(t)}}function Rl(A){return function(t){return t.replace(/[0-9]/g,function(e){return A[+e]})}}var Nl=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function _t(A){if(!(t=Nl.exec(A)))throw new Error("invalid format: "+A);var t;return new nn({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}_t.prototype=nn.prototype;function nn(A){this.fill=A.fill===void 0?" ":A.fill+"",this.align=A.align===void 0?">":A.align+"",this.sign=A.sign===void 0?"-":A.sign+"",this.symbol=A.symbol===void 0?"":A.symbol+"",this.zero=!!A.zero,this.width=A.width===void 0?void 0:+A.width,this.comma=!!A.comma,this.precision=A.precision===void 0?void 0:+A.precision,this.trim=!!A.trim,this.type=A.type===void 0?"":A.type+""}nn.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Gl(A){A:for(var t=A.length,e=1,r=-1,n;e<t;++e)switch(A[e]){case".":r=n=e;break;case"0":r===0&&(r=e),n=e;break;default:if(!+A[e])break A;r>0&&(r=0);break}return r>0?A.slice(0,r)+A.slice(n+1):A}var ls;function Vl(A,t){var e=Ie(A,t);if(!e)return A+"";var r=e[0],n=e[1],i=n-(ls=Math.max(-8,Math.min(8,Math.floor(n/3)))*3)+1,s=r.length;return i===s?r:i>s?r+new Array(i-s+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+Ie(A,Math.max(0,t+i-1))[0]}function fs(A,t){var e=Ie(A,t);if(!e)return A+"";var r=e[0],n=e[1];return n<0?"0."+new Array(-n).join("0")+r:r.length>n+1?r.slice(0,n+1)+"."+r.slice(n+1):r+new Array(n-r.length+2).join("0")}const gs={"%":(A,t)=>(A*100).toFixed(t),b:A=>Math.round(A).toString(2),c:A=>A+"",d:_l,e:(A,t)=>A.toExponential(t),f:(A,t)=>A.toFixed(t),g:(A,t)=>A.toPrecision(t),o:A=>Math.round(A).toString(8),p:(A,t)=>fs(A*100,t),r:fs,s:Vl,X:A=>Math.round(A).toString(16).toUpperCase(),x:A=>Math.round(A).toString(16)};function hs(A){return A}var ws=Array.prototype.map,Qs=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function kl(A){var t=A.grouping===void 0||A.thousands===void 0?hs:Ol(ws.call(A.grouping,Number),A.thousands+""),e=A.currency===void 0?"":A.currency[0]+"",r=A.currency===void 0?"":A.currency[1]+"",n=A.decimal===void 0?".":A.decimal+"",i=A.numerals===void 0?hs:Rl(ws.call(A.numerals,String)),s=A.percent===void 0?"%":A.percent+"",a=A.minus===void 0?"−":A.minus+"",o=A.nan===void 0?"NaN":A.nan+"";function B(u){u=_t(u);var l=u.fill,f=u.align,g=u.sign,Q=u.symbol,w=u.zero,h=u.width,C=u.comma,F=u.precision,p=u.trim,d=u.type;d==="n"?(C=!0,d="g"):gs[d]||(F===void 0&&(F=12),p=!0,d="g"),(w||l==="0"&&f==="=")&&(w=!0,l="0",f="=");var U=Q==="$"?e:Q==="#"&&/[boxX]/.test(d)?"0"+d.toLowerCase():"",y=Q==="$"?r:/[%p]/.test(d)?s:"",v=gs[d],m=/[defgprs%]/.test(d);F=F===void 0?6:/[gprs]/.test(d)?Math.max(1,Math.min(21,F)):Math.max(0,Math.min(20,F));function L(E){var K=U,H=y,S,Y,M;if(d==="c")H=v(E)+H,E="";else{E=+E;var _=E<0||1/E<0;if(E=isNaN(E)?o:v(Math.abs(E),F),p&&(E=Gl(E)),_&&+E==0&&g!=="+"&&(_=!1),K=(_?g==="("?g:a:g==="-"||g==="("?"":g)+K,H=(d==="s"?Qs[8+ls/3]:"")+H+(_&&g==="("?")":""),m){for(S=-1,Y=E.length;++S<Y;)if(M=E.charCodeAt(S),48>M||M>57){H=(M===46?n+E.slice(S+1):E.slice(S))+H,E=E.slice(0,S);break}}}C&&!w&&(E=t(E,1/0));var J=K.length+E.length+H.length,b=J<h?new Array(h-J+1).join(l):"";switch(C&&w&&(E=t(b+E,b.length?h-H.length:1/0),b=""),f){case"<":E=K+E+H+b;break;case"=":E=K+b+E+H;break;case"^":E=b.slice(0,J=b.length>>1)+K+E+H+b.slice(J);break;default:E=b+K+E+H;break}return i(E)}return L.toString=function(){return u+""},L}function c(u,l){var f=B((u=_t(u),u.type="f",u)),g=Math.max(-8,Math.min(8,Math.floor(gt(l)/3)))*3,Q=Math.pow(10,-g),w=Qs[8+g/3];return function(h){return f(Q*h)+w}}return{format:B,formatPrefix:c}}var xe,sn,Cs;Pl({thousands:",",grouping:[3],currency:["$",""]});function Pl(A){return xe=kl(A),sn=xe.format,Cs=xe.formatPrefix,xe}function Xl(A){return Math.max(0,-gt(Math.abs(A)))}function Jl(A,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(gt(t)/3)))*3-gt(Math.abs(A)))}function Yl(A,t){return A=Math.abs(A),t=Math.abs(t)-A,Math.max(0,gt(t)-gt(A))+1}function Wl(A,t,e,r){var n=xl(A,t,e),i;switch(r=_t(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(A),Math.abs(t));return r.precision==null&&!isNaN(i=Jl(n,s))&&(r.precision=i),Cs(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=Yl(n,Math.max(Math.abs(A),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=Xl(n))&&(r.precision=i-(r.type==="%")*2);break}}return sn(r)}function Zl(A){var t=A.domain;return A.ticks=function(e){var r=t();return tn(r[0],r[r.length-1],e??10)},A.tickFormat=function(e,r){var n=t();return Wl(n[0],n[n.length-1],e??10,r)},A.nice=function(e){e==null&&(e=10);var r=t(),n=0,i=r.length-1,s=r[n],a=r[i],o,B,c=10;for(a<s&&(B=s,s=a,a=B,B=n,n=i,i=B);c-- >0;){if(B=en(s,a,e),B===o)return r[n]=s,r[i]=a,t(r);if(B>0)s=Math.floor(s/B)*B,a=Math.ceil(a/B)*B;else if(B<0)s=Math.ceil(s*B)/B,a=Math.floor(a*B)/B;else break;o=B}return A},A}function an(){var A=Ml();return A.copy=function(){return cs(A,an())},He.apply(A,arguments),Zl(A)}function $l(A,t){A=A.slice();var e=0,r=A.length-1,n=A[e],i=A[r],s;return i<n&&(s=e,e=r,r=s,s=n,n=i,i=s),A[e]=t.floor(n),A[r]=t.ceil(i),A}function ds(A){return Math.log(A)}function Us(A){return Math.exp(A)}function zl(A){return-Math.log(-A)}function ql(A){return-Math.exp(-A)}function jl(A){return isFinite(A)?+("1e"+A):A<0?0:A}function Af(A){return A===10?jl:A===Math.E?Math.exp:t=>Math.pow(A,t)}function tf(A){return A===Math.E?Math.log:A===10&&Math.log10||A===2&&Math.log2||(A=Math.log(A),t=>Math.log(t)/A)}function Fs(A){return(t,e)=>-A(-t,e)}function ef(A){const t=A(ds,Us),e=t.domain;let r=10,n,i;function s(){return n=tf(r),i=Af(r),e()[0]<0?(n=Fs(n),i=Fs(i),A(zl,ql)):A(ds,Us),t}return t.base=function(a){return arguments.length?(r=+a,s()):r},t.domain=function(a){return arguments.length?(e(a),s()):e()},t.ticks=a=>{const o=e();let B=o[0],c=o[o.length-1];const u=c<B;u&&([B,c]=[c,B]);let l=n(B),f=n(c),g,Q;const w=a==null?10:+a;let h=[];if(!(r%1)&&f-l<w){if(l=Math.floor(l),f=Math.ceil(f),B>0){for(;l<=f;++l)for(g=1;g<r;++g)if(Q=l<0?g/i(-l):g*i(l),!(Q<B)){if(Q>c)break;h.push(Q)}}else for(;l<=f;++l)for(g=r-1;g>=1;--g)if(Q=l>0?g/i(-l):g*i(l),!(Q<B)){if(Q>c)break;h.push(Q)}h.length*2<w&&(h=tn(B,c,w))}else h=tn(l,f,Math.min(f-l,w)).map(i);return u?h.reverse():h},t.tickFormat=(a,o)=>{if(a==null&&(a=10),o==null&&(o=r===10?"s":","),typeof o!="function"&&(!(r%1)&&(o=_t(o)).precision==null&&(o.trim=!0),o=sn(o)),a===1/0)return o;const B=Math.max(1,r*a/t.ticks().length);return c=>{let u=c/i(Math.round(n(c)));return u*r<r-.5&&(u*=r),u<=B?o(c):""}},t.nice=()=>e($l(e(),{floor:a=>i(Math.floor(n(a))),ceil:a=>i(Math.ceil(n(a)))})),t}function on(){const A=ef(us()).domain([1,10]);return A.copy=()=>cs(A,on()).base(A.base()),He.apply(A,arguments),A}LA.prototype.transition=Wi;var D=(A=>(A.Svg="svg",A.ClipPath="clipPath",A.BaseLayer="baseLayer",A.Axes="axes",A.Area="area",A.Zoom="zoom",A.Trace="trace",A.Tooltip="skadi-chart-tooltip",A.Grid="grid",A.Scatter="scatter",A.Custom="custom",A))(D||{});class DA{constructor(){this.properties=null}brushStart(){}beforeZoom(t){}async zoom(t){}afterZoom(t){}}class rf extends DA{constructor(t){super(),this.labels=t,this.type=D.Axes,this.drawAxis=(e,r)=>{const{width:n,height:i,margin:s}=r.bounds,{getHtmlId:a}=r,o=r.scaleConfig.linearScales[e];if(this.labels[e]){const B=r.coreLayers[D.Svg].append("text").attr("id",`${a(D.Axes)}-label${e}`).style("font-size","1.2rem").attr("text-anchor","middle").text(this.labels[e]);if(e==="y"){const c=i-s.top-s.bottom;B.attr("x",-c/2-s.top).attr("y",s.left/3).attr("transform","rotate(-90)")}else{const c=n-s.left-s.right;B.attr("x",c/2+s.left).attr("y",i-s.bottom/3)}}return r.scaleConfig.categoricalScales[e]?this.drawCategoricalAxis(e,r):this.drawNumericalAxis(e,o,{...r.globals.tickConfig[e],padding:12},r)},this.draw=e=>{const{x:r,y:n}=e.scaleConfig.linearScales,{animationDuration:i}=e.globals,{layer:s,axis:a,line:o}=this.drawAxis("x",e),{layer:B,axis:c,line:u}=this.drawAxis("y",e);this.zoom=async()=>{const l=s==null?void 0:s.transition().duration(i).call(a).end(),f=B==null?void 0:B.transition().duration(i).call(c).end(),g=o==null?void 0:o.transition().duration(i).attr("x1",r(0)).attr("x2",r(0)).end(),Q=u==null?void 0:u.transition().duration(i).attr("y1",n(0)).attr("y2",n(0)).end();await Promise.all([l,f,g,Q])}},this.drawCategoricalAxis=(e,r)=>{const n=r.scaleConfig.categoricalScales[e].main,{margin:i}=r.bounds,s=r.coreLayers[D.Svg],{getHtmlId:a}=r,{count:o}=r.globals.tickConfig[e],{translation:B,axisConstructor:c}=this.axisConfig(e,r),u=n.bandwidth(),l=e==="x"?i.bottom:i.left,f=c(n).ticks(o).tickSize(0).tickPadding(l*.3);return s.append("g").attr("id",`${a(D.Axes)}-${e}`).style("font-size","0.75rem").attr("transform",`translate(${B.x},${B.y})`).call(f),Object.entries(r.scaleConfig.categoricalScales[e].bands).forEach(([Q,w])=>{const h=n(Q),C=w.domain();C[0]<0&&C[1]>0&&this.drawNumericalAxis(e,w,{count:1,padding:6},r),n.paddingInner()&&this.drawLinePerpendicularToAxis(e,h,r),this.drawLinePerpendicularToAxis(e,h+u,r)}),{layer:null,axis:null,line:null}},this.drawNumericalAxis=(e,r,n,i)=>{const{getHtmlId:s}=i,{count:a,specifier:o,padding:B}=n,{translation:c,axisConstructor:u}=this.axisConfig(e,i);let l=null;const f=u(r).ticks(a,o).tickSize(0).tickPadding(B),g=i.coreLayers[D.Svg].append("g").attr("id",`${s(D.Axes)}-${e}`).style("font-size","0.75rem").attr("transform",`translate(${c.x},${c.y})`).call(f);return g.select(".domain").style("stroke-opacity",0),i.chartOptions.logScale[e]||(l=this.drawLinePerpendicularToAxis(e,r(0),i,"darkgrey")),{layer:g,axis:f,line:l}},this.drawLinePerpendicularToAxis=(e,r,n,i="black")=>{const s=n.coreLayers[D.BaseLayer],{height:a,width:o,margin:B}=n.bounds,c=e==="x"?"y":"x";return s.append("g").append("line").attr(`${e}1`,r).attr(`${e}2`,r).attr(`${c}1`,e==="x"?B.top:B.left).attr(`${c}2`,e==="x"?a-B.bottom:o-B.right).style("stroke",i).style("stroke-width",.5)},this.axisConfig=(e,r)=>{const{height:n,margin:i}=r.bounds,s=e==="x"?"y":"x",a=e==="x"?n-i.bottom:i.left;return{translation:{[e]:0,[s]:a},axisConstructor:e==="x"?nl:il}}}}const ps=A=>Math.floor(A*10)/10,Bn=(A,t)=>t+ps(A.x)+","+ps(A.y),ht=(A,t)=>{const{width:e,height:r,margin:n}=t.clipPathBounds,i={x:[n.left,e-n.right],y:[r-n.bottom,n.top]},s=[];let a="";const{x:o,y:B}=A[0];let c=i.x[0]<=o&&o<=i.x[1]&&i.y[1]<=B&&B<=i.y[0];for(let u=0;u<A.length;u++){const{x:l,y:f}=A[u],g=i.x[0]<=l&&l<=i.x[1]&&i.y[1]<=f&&f<=i.y[0];c?a+=Bn(A[u],a?"L":"M"):g&&(a&&s.push(a),a="",a+=Bn(A[u-1],"M"),a+=Bn(A[u],"L")),c=g}return a&&s.push(a),s},wt=(A,t)=>{const{x:e,y:r}=t.scaleConfig.linearScales,{x:n,y:i}=t.scaleConfig.categoricalScales,{x:s,y:a}=A||{};return{x:s&&n?n.bands[s]:e,y:a&&i?i.bands[a]:r}},vs=A=>{const t={x:{start:1/0,end:-1/0},y:{start:1/0,end:-1/0}};for(let e=0;e<A.length;e++){const{x:r,y:n}=A[e];r<t.x.start&&(t.x.start=r),r>t.x.end&&(t.x.end=r),n<t.y.start&&(t.y.start=n),n>t.y.end&&(t.y.end=n)}return t},cn=(A,t,e,r)=>`M${A},${e}L${A},${r}L${t},${r}L${t},${e}Z`,nf=(A,t,e,r)=>A*r.x-t*r.y+e,ys=A=>{const t=Math.round(A.x),e=Math.round(A.y);return{x:t,y:e}},un=(A,t,e)=>{const r=A[t[0]],n=A[t[1]],i=n.y-r.y,s=n.x-r.x,a=n.x*r.y-n.y*r.x;let o=0,B=0;const c=Math.abs;for(let l=t[0];l<t[1];l++){const f=c(nf(i,s,a,A[l]));f>o&&(o=f,B=l)}if(o/Math.sqrt(i*i+s*s)>e){const l=[t[0],B],f=un(A,l,e),g=[B,t[1]],Q=un(A,g,e);return[...f.slice(0,-1),...Q]}else{const l=ys(A[t[0]]),f=ys(A[t[1]]);return[l,f]}},sf=(A,t)=>A.map(e=>{const r=[0,e.length-1];return un(e,r,t)});class af extends DA{constructor(t,e){super(),this.linesDC=t,this.options=e,this.type=D.Trace,this.traces=[],this.lowResLinesSC=[],this.getNewPoint=null,this.getNewPointInverse=null,this.customTween=(r,n)=>{const i=this.lowResLinesSC[r];return s=>{const a=i.map(({x:o,y:B})=>this.getNewPoint(o,B,s));return ht(a,n).join("")}},this.updateLowResLinesSC=r=>{const n=this.linesDC.map(i=>{const s=wt(i.bands,r);return i.points.map(a=>({x:s.x(a.x),y:s.y(a.y)}))});this.options.RDPEpsilon!==null?this.lowResLinesSC=sf(n,this.options.RDPEpsilon):this.lowResLinesSC=n},this.draw=(r,n)=>{this.updateLowResLinesSC(r),this.traces=this.linesDC.map((i,s)=>{const a=ht(this.lowResLinesSC[s],r).join("");return r.coreLayers[D.BaseLayer].append("path").attr("id",`${r.getHtmlId(D.Trace)}-${s}`).attr("pointer-events","none").attr("fill","none").attr("stroke",i.style.strokeColor||"black").attr("opacity",i.style.opacity||1).attr("stroke-width",i.style.strokeWidth||.5).attr("stroke-dasharray",i.style.strokeDasharray||"").attr("d",a)}),this.beforeZoom=i=>{const{x:s,y:a}=r.scaleConfig.linearScales,o=i.x,B=i.y,c=[s(o[0]),s(o[1])],u=[a(B[0]),a(B[1])],l=s.domain(),f=a.domain(),g=[s(l[0]),s(l[1])],Q=[a(f[0]),a(f[1])],w=(g[1]-g[0])/(c[1]-c[0]),h=(Q[1]-Q[0])/(u[1]-u[0]),C=w*s(o[0])-s(l[0]),F=h*a(B[0])-a(f[0]),p=w-1,d=h-1;this.getNewPoint=(U,y,v)=>({x:U*(v*p+1)-v*C,y:y*(v*d+1)-v*F}),this.getNewPointInverse=(U,y,v)=>({x:(U+v*C)/(v*p+1),y:(y+v*F)/(v*d+1)})},this.zoom=async i=>{const s=[];for(let a=0;a<this.linesDC.length;a++){const o=this.traces[a].transition().duration(r.globals.animationDuration).attrTween("d",()=>this.customTween(a,r)).end();s.push(o)}await Promise.all(s),this.updateLowResLinesSC(r),this.traces.forEach((a,o)=>{a.attr("d",ht(this.lowResLinesSC[o],r).join(""))})}}}}class of extends DA{constructor(t){super(),this.options=t,this.type=D.Zoom,this.zooming=!1,this.selectionMask=null,this.overlay=null,this.processSelection=(e,r)=>{const{width:n,height:i,margin:s}=r.bounds,[[a,o],[B,c]]=e.selection,u=30,l=Math.abs(a-B),f=Math.abs(o-c);return this.options.lockAxis==="y"?[[a,s.top],[B,i-s.bottom]]:this.options.lockAxis==="x"?[[s.left,o],[n-s.right,c]]:l>u&&f<=u?[[a,s.top],[B,i-s.bottom]]:l<=u&&f>u?[[s.left,o],[n-s.right,c]]:[[a,o],[B,c]]},this.handleZoom=async(e,r)=>{if(this.zooming)return;this.zooming=!0;const{x:n,y:i}=r.scaleConfig.linearScales;r.optionalLayers.forEach(a=>a.beforeZoom(e)),e.x&&n.domain(e.x),e.y&&i.domain(e.y);const s=[];r.optionalLayers.forEach(a=>s.push(a.zoom(e))),await Promise.all(s),r.optionalLayers.forEach(a=>a.afterZoom(e)),this.zooming=!1},this.handleBrushEnd=(e,r,n)=>{if(this.overlay.style("display","none"),this.selectionMask.attr("x",0).attr("y",0).attr("width",0).attr("height",0),!e.selection){n.optionalLayers.forEach(h=>h.afterZoom(null));return}r.call(e.target.move,null);const[[i,s],[a,o]]=this.processSelection(e,n),B=n.scaleConfig.linearScales.x,c=B.invert(i),u=B.invert(a),l=n.scaleConfig.linearScales.y,f=l.invert(o),g=l.invert(s),Q=10;if(Math.abs(i-a)<Q||Math.abs(s-o)<Q){n.optionalLayers.forEach(h=>h.afterZoom(null));return}const w={x:[c,u],y:[f,g],eventType:"brush"};this.handleZoom(w,n)},this.handleBrushMove=(e,r)=>{if(!e.selection)return;this.overlay.style("display","");const[[n,i],[s,a]]=this.processSelection(e,r);this.selectionMask.attr("x",Math.min(n,s)).attr("y",Math.min(i,a)).attr("width",Math.abs(n-s)).attr("height",Math.abs(i-a))},this.draw=e=>{const r=e.scaleConfig.categoricalScales;if(r.x&&r.y){console.warn("You have tried to use zoom with two categorical axes, but this is not supported.");return}Object.entries(r).forEach(([h,C])=>{C&&(this.options.lockAxis=h)});const{width:n,height:i,margin:s}=e.bounds,a=e.coreLayers[D.Svg],o=Ql().extent([[s.left,s.top],[n-s.right,i-s.bottom]]),B=e.coreLayers[D.BaseLayer].append("g").attr("id",`${e.getHtmlId(D.Zoom)}-brush`).style("opacity",0).call(o),c=`${e.getHtmlId(D.Zoom)}-overlay`;a.select("defs").append("svg:mask").attr("id",c).append("svg:rect").attr("width",n-s.right-s.left).attr("height",i-s.bottom-s.top).attr("x",s.left).attr("y",s.top).attr("fill","white").attr("fill-opacity",.15).style("mask-type","alpha");const u=`${e.getHtmlId(D.Zoom)}-selection`;this.selectionMask=a.select("defs").append("svg:mask").attr("id",u).append("svg:rect").attr("width",0).attr("height",0).attr("x",0).attr("y",0).attr("fill","white").style("mask-type","alpha"),this.overlay=a.append("svg:rect").attr("width",n-s.right-s.left).attr("height",i-s.bottom-s.top).attr("x",s.left).attr("y",s.top).style("display","none").style("mask-image",`url(#${c}), url(#${u})`).style("mask-composite","subtract"),o.on("start",()=>e.optionalLayers.forEach(h=>h.brushStart())),o.on("brush",h=>this.handleBrushMove(h,e)),o.on("end",h=>this.handleBrushEnd(h,B,e));const{x:l,y:f}=e.scaleConfig.scaleExtents,{x:g,y:Q}=e.scaleConfig.linearScales,w={x:[l.start,l.end],y:[f.start,f.end],eventType:"dblclick"};this.options.lockAxis==="y"&&(w.y=Q.domain()),this.options.lockAxis==="x"&&(w.x=g.domain()),e.coreLayers[D.Svg].on("dblclick",()=>this.handleZoom(w,e))}}}class Bf extends DA{constructor(t){super(),this.tooltipHtmlCallback=t,this.type=D.Tooltip,this.tooltipRadiusSq=625,this.getDistanceSq=(e,r)=>{const n=e.x-r.x,i=e.y-r.y;return n*n+i*i},this.getDistanceSqSC=(e,r,n)=>{const i={x:e.x*n.x,y:e.y*n.y},s={x:r.x*n.x,y:r.y*n.y};return this.getDistanceSq(i,s)},this.convertSCPointToCC=(e,r)=>{const n=r.coreLayers[D.Svg].node().getScreenCTM(),{a:i,c:s,b:a,d:o}=n,{e:B,f:c}=n;return{x:i*e.x+s*e.y+B,y:a*e.x+o*e.y+c}},this.handleMouseMove=(e,r,n,i)=>{const s=mr(e),a={x:s[0],y:s[1]},o={...r.scaleConfig.linearScales},B={x:void 0,y:void 0};Object.entries(r.scaleConfig.categoricalScales).forEach(([p,d])=>{if(d!=null&&d.bands){const[U,y]=Object.entries(d.bands).at(-1)||[],v=p,[m,L]=Object.entries(d.bands).find(([E,K])=>{const H=K.range();return a[v]>=Math.min(...H)&&a[v]<=Math.max(...H)})||[];m&&L?(o[v]=L,B[v]=m):y&&a[v]<y.range()[0]&&(o[v]=y||o[v],B[v]=U)}});const c={x:o.x.invert(a.x),y:o.y.invert(a.y)},[u,l]=[o.x,o.y].map(p=>Math.abs(p.domain()[0]-p.domain()[1])||1),[f,g]=[o.x,o.y].map(p=>Math.abs(p.range()[0]-p.range()[1])||1);let Q={x:u===0?1:f/u,y:l==0?1:g/l},w=1/0;const h=i.reduce((p,d)=>{var y,v;if(B.y!==((y=d.bands)==null?void 0:y.y)||B.x!==((v=d.bands)==null?void 0:v.x))return p;const U=this.getDistanceSqSC(c,d,Q);return U>=w?p:(w=U,d)},{x:0,y:0}),C={x:o.x(h.x),y:o.y(h.y)};if(this.getDistanceSq(a,C)>this.tooltipRadiusSq)n.style("opacity",0);else{const p=this.convertSCPointToCC(C,r);n.html(this.tooltipHtmlCallback(h)).style("left",`${p.x}px`).style("top",`${p.y}px`).style("opacity",1)}},this.draw=e=>{const r=e.optionalLayers.filter(c=>c.type===D.Trace),n=e.optionalLayers.filter(c=>c.type===D.Scatter);if(r.length===0&&n.length===0){console.warn("Tooltip Layer was added without a Traces Layer or a Scatter Layer.");return}const i=Fi("div").attr("id",`${e.getHtmlId(this.type)}`).style("position","fixed").style("pointer-events","none");let s=r.reduce((c,u)=>[...u.linesDC.flatMap(({points:f,metadata:g,bands:Q})=>f.map(w=>({...w,metadata:g,bands:Q}))),...c],[]);s=n.reduce((c,u)=>[...u.points,...c],s);const a=e.coreLayers[D.Svg];let o,B=!1;a.on("mousemove",c=>{var u;o===void 0&&!B&&((u=document.querySelectorAll(`*[id*="${this.type}"]`))==null||u.forEach(l=>l.innerHTML=""),this.handleMouseMove(c,e,i,s),o=setTimeout(()=>{o=void 0},25))}),this.brushStart=()=>{B=!0,i.html("")},this.afterZoom=()=>{B=!1},a.on("mouseleave",()=>i.remove()),a.on("mouseenter",()=>document.body.append(i.node()))}}}class cf extends DA{constructor(t){super(),this.directions=t,this.type=D.Grid,this.draw=e=>{const{width:r,height:n,margin:i}=e.bounds,{x:s,y:a}=e.scaleConfig.linearScales,o=e.coreLayers[D.Svg],{animationDuration:B,tickConfig:c}=e.globals,{getHtmlId:u}=e,l=.15,f=.5,g={},Q=h=>{h.selectAll("line").data(s.ticks(c.x.count)).join("line").style("stroke","black").style("stroke-width",f).attr("pointer-events","none").attr("x1",C=>s(C)).attr("x2",C=>s(C)).attr("y1",i.top).attr("y2",n-i.bottom)},w=h=>{h.selectAll("line").data(a.ticks(c.y.count)).join("line").style("stroke","black").style("stroke-width",f).attr("pointer-events","none").attr("x1",i.left).attr("x2",r-i.right).attr("y1",C=>a(C)).attr("y2",C=>a(C))};this.directions.x&&(g.x=o.append("g").call(Q).attr("opacity",l).attr("id",`${u(this.type)}-x`)),this.directions.y&&(g.y=o.append("g").call(w).attr("opacity",l).attr("id",`${u(this.type)}-y`)),this.zoom=async()=>{var d,U,y,v;const h=(d=g.x)==null?void 0:d.selectAll("line").transition().duration(B/2).style("opacity",0).remove().end(),C=(U=g.y)==null?void 0:U.selectAll("line").transition().duration(B/2).style("opacity",0).remove().end();await Promise.all([h,C]);const F=(y=g.x)==null?void 0:y.call(Q).style("opacity",0).transition().duration(B/2).style("opacity",l).end(),p=(v=g.y)==null?void 0:v.call(w).style("opacity",0).transition().duration(B/2).style("opacity",l).end();await Promise.all([F,p])}}}}/*!
|
|
1
|
+
(function(RA,$A){typeof exports=="object"&&typeof module<"u"?$A(exports):typeof define=="function"&&define.amd?define(["exports"],$A):(RA=typeof globalThis<"u"?globalThis:RA||self,$A(RA["skadi-chart"]={}))})(this,(function(RA){"use strict";var $A="http://www.w3.org/1999/xhtml";const Bi={svg:"http://www.w3.org/2000/svg",xhtml:$A,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function oe(A){var t=A+="",e=t.indexOf(":");return e>=0&&(t=A.slice(0,e))!=="xmlns"&&(A=A.slice(e+1)),Bi.hasOwnProperty(t)?{space:Bi[t],local:A}:A}function Ko(A){return function(){var t=this.ownerDocument,e=this.namespaceURI;return e===$A&&t.documentElement.namespaceURI===$A?t.createElement(A):t.createElementNS(e,A)}}function So(A){return function(){return this.ownerDocument.createElementNS(A.space,A.local)}}function vr(A){var t=oe(A);return(t.local?So:Ko)(t)}function Do(){}function yr(A){return A==null?Do:function(){return this.querySelector(A)}}function To(A){typeof A!="function"&&(A=yr(A));for(var t=this._groups,e=t.length,r=new Array(e),n=0;n<e;++n)for(var i=t[n],s=i.length,a=r[n]=new Array(s),o,B,c=0;c<s;++c)(o=i[c])&&(B=A.call(o,o.__data__,c,i))&&("__data__"in o&&(B.__data__=o.__data__),a[c]=B);return new uA(r,this._parents)}function Mo(A){return A==null?[]:Array.isArray(A)?A:Array.from(A)}function _o(){return[]}function ci(A){return A==null?_o:function(){return this.querySelectorAll(A)}}function Oo(A){return function(){return Mo(A.apply(this,arguments))}}function Ro(A){typeof A=="function"?A=Oo(A):A=ci(A);for(var t=this._groups,e=t.length,r=[],n=[],i=0;i<e;++i)for(var s=t[i],a=s.length,o,B=0;B<a;++B)(o=s[B])&&(r.push(A.call(o,o.__data__,B,s)),n.push(o));return new uA(r,n)}function ui(A){return function(){return this.matches(A)}}function li(A){return function(t){return t.matches(A)}}var No=Array.prototype.find;function Go(A){return function(){return No.call(this.children,A)}}function Vo(){return this.firstElementChild}function ko(A){return this.select(A==null?Vo:Go(typeof A=="function"?A:li(A)))}var Po=Array.prototype.filter;function Xo(){return Array.from(this.children)}function Jo(A){return function(){return Po.call(this.children,A)}}function Yo(A){return this.selectAll(A==null?Xo:Jo(typeof A=="function"?A:li(A)))}function Wo(A){typeof A!="function"&&(A=ui(A));for(var t=this._groups,e=t.length,r=new Array(e),n=0;n<e;++n)for(var i=t[n],s=i.length,a=r[n]=[],o,B=0;B<s;++B)(o=i[B])&&A.call(o,o.__data__,B,i)&&a.push(o);return new uA(r,this._parents)}function fi(A){return new Array(A.length)}function Zo(){return new uA(this._enter||this._groups.map(fi),this._parents)}function Be(A,t){this.ownerDocument=A.ownerDocument,this.namespaceURI=A.namespaceURI,this._next=null,this._parent=A,this.__data__=t}Be.prototype={constructor:Be,appendChild:function(A){return this._parent.insertBefore(A,this._next)},insertBefore:function(A,t){return this._parent.insertBefore(A,t)},querySelector:function(A){return this._parent.querySelector(A)},querySelectorAll:function(A){return this._parent.querySelectorAll(A)}};function $o(A){return function(){return A}}function zo(A,t,e,r,n,i){for(var s=0,a,o=t.length,B=i.length;s<B;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):e[s]=new Be(A,i[s]);for(;s<o;++s)(a=t[s])&&(n[s]=a)}function qo(A,t,e,r,n,i,s){var a,o,B=new Map,c=t.length,u=i.length,l=new Array(c),f;for(a=0;a<c;++a)(o=t[a])&&(l[a]=f=s.call(o,o.__data__,a,t)+"",B.has(f)?n[a]=o:B.set(f,o));for(a=0;a<u;++a)f=s.call(A,i[a],a,i)+"",(o=B.get(f))?(r[a]=o,o.__data__=i[a],B.delete(f)):e[a]=new Be(A,i[a]);for(a=0;a<c;++a)(o=t[a])&&B.get(l[a])===o&&(n[a]=o)}function jo(A){return A.__data__}function AB(A,t){if(!arguments.length)return Array.from(this,jo);var e=t?qo:zo,r=this._parents,n=this._groups;typeof A!="function"&&(A=$o(A));for(var i=n.length,s=new Array(i),a=new Array(i),o=new Array(i),B=0;B<i;++B){var c=r[B],u=n[B],l=u.length,f=tB(A.call(c,c&&c.__data__,B,r)),g=f.length,Q=a[B]=new Array(g),w=s[B]=new Array(g),h=o[B]=new Array(l);e(c,u,Q,w,h,f,t);for(var C=0,F=0,p,d;C<g;++C)if(p=Q[C]){for(C>=F&&(F=C+1);!(d=w[F])&&++F<g;);p._next=d||null}}return s=new uA(s,r),s._enter=a,s._exit=o,s}function tB(A){return typeof A=="object"&&"length"in A?A:Array.from(A)}function eB(){return new uA(this._exit||this._groups.map(fi),this._parents)}function rB(A,t,e){var r=this.enter(),n=this,i=this.exit();return typeof A=="function"?(r=A(r),r&&(r=r.selection())):r=r.append(A+""),t!=null&&(n=t(n),n&&(n=n.selection())),e==null?i.remove():e(i),r&&n?r.merge(n).order():n}function nB(A){for(var t=A.selection?A.selection():A,e=this._groups,r=t._groups,n=e.length,i=r.length,s=Math.min(n,i),a=new Array(n),o=0;o<s;++o)for(var B=e[o],c=r[o],u=B.length,l=a[o]=new Array(u),f,g=0;g<u;++g)(f=B[g]||c[g])&&(l[g]=f);for(;o<n;++o)a[o]=e[o];return new uA(a,this._parents)}function iB(){for(var A=this._groups,t=-1,e=A.length;++t<e;)for(var r=A[t],n=r.length-1,i=r[n],s;--n>=0;)(s=r[n])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function sB(A){A||(A=aB);function t(u,l){return u&&l?A(u.__data__,l.__data__):!u-!l}for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i){for(var s=e[i],a=s.length,o=n[i]=new Array(a),B,c=0;c<a;++c)(B=s[c])&&(o[c]=B);o.sort(t)}return new uA(n,this._parents).order()}function aB(A,t){return A<t?-1:A>t?1:A>=t?0:NaN}function oB(){var A=arguments[0];return arguments[0]=this,A.apply(null,arguments),this}function BB(){return Array.from(this)}function cB(){for(var A=this._groups,t=0,e=A.length;t<e;++t)for(var r=A[t],n=0,i=r.length;n<i;++n){var s=r[n];if(s)return s}return null}function uB(){let A=0;for(const t of this)++A;return A}function lB(){return!this.node()}function fB(A){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],i=0,s=n.length,a;i<s;++i)(a=n[i])&&A.call(a,a.__data__,i,n);return this}function gB(A){return function(){this.removeAttribute(A)}}function hB(A){return function(){this.removeAttributeNS(A.space,A.local)}}function wB(A,t){return function(){this.setAttribute(A,t)}}function QB(A,t){return function(){this.setAttributeNS(A.space,A.local,t)}}function CB(A,t){return function(){var e=t.apply(this,arguments);e==null?this.removeAttribute(A):this.setAttribute(A,e)}}function dB(A,t){return function(){var e=t.apply(this,arguments);e==null?this.removeAttributeNS(A.space,A.local):this.setAttributeNS(A.space,A.local,e)}}function UB(A,t){var e=oe(A);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((t==null?e.local?hB:gB:typeof t=="function"?e.local?dB:CB:e.local?QB:wB)(e,t))}function gi(A){return A.ownerDocument&&A.ownerDocument.defaultView||A.document&&A||A.defaultView}function FB(A){return function(){this.style.removeProperty(A)}}function pB(A,t,e){return function(){this.style.setProperty(A,t,e)}}function vB(A,t,e){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(A):this.style.setProperty(A,r,e)}}function yB(A,t,e){return arguments.length>1?this.each((t==null?FB:typeof t=="function"?vB:pB)(A,t,e??"")):at(this.node(),A)}function at(A,t){return A.style.getPropertyValue(t)||gi(A).getComputedStyle(A,null).getPropertyValue(t)}function EB(A){return function(){delete this[A]}}function mB(A,t){return function(){this[A]=t}}function HB(A,t){return function(){var e=t.apply(this,arguments);e==null?delete this[A]:this[A]=e}}function IB(A,t){return arguments.length>1?this.each((t==null?EB:typeof t=="function"?HB:mB)(A,t)):this.node()[A]}function hi(A){return A.trim().split(/^|\s+/)}function Er(A){return A.classList||new wi(A)}function wi(A){this._node=A,this._names=hi(A.getAttribute("class")||"")}wi.prototype={add:function(A){var t=this._names.indexOf(A);t<0&&(this._names.push(A),this._node.setAttribute("class",this._names.join(" ")))},remove:function(A){var t=this._names.indexOf(A);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(A){return this._names.indexOf(A)>=0}};function Qi(A,t){for(var e=Er(A),r=-1,n=t.length;++r<n;)e.add(t[r])}function Ci(A,t){for(var e=Er(A),r=-1,n=t.length;++r<n;)e.remove(t[r])}function xB(A){return function(){Qi(this,A)}}function LB(A){return function(){Ci(this,A)}}function bB(A,t){return function(){(t.apply(this,arguments)?Qi:Ci)(this,A)}}function KB(A,t){var e=hi(A+"");if(arguments.length<2){for(var r=Er(this.node()),n=-1,i=e.length;++n<i;)if(!r.contains(e[n]))return!1;return!0}return this.each((typeof t=="function"?bB:t?xB:LB)(e,t))}function SB(){this.textContent=""}function DB(A){return function(){this.textContent=A}}function TB(A){return function(){var t=A.apply(this,arguments);this.textContent=t??""}}function MB(A){return arguments.length?this.each(A==null?SB:(typeof A=="function"?TB:DB)(A)):this.node().textContent}function _B(){this.innerHTML=""}function OB(A){return function(){this.innerHTML=A}}function RB(A){return function(){var t=A.apply(this,arguments);this.innerHTML=t??""}}function NB(A){return arguments.length?this.each(A==null?_B:(typeof A=="function"?RB:OB)(A)):this.node().innerHTML}function GB(){this.nextSibling&&this.parentNode.appendChild(this)}function VB(){return this.each(GB)}function kB(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function PB(){return this.each(kB)}function XB(A){var t=typeof A=="function"?A:vr(A);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function JB(){return null}function YB(A,t){var e=typeof A=="function"?A:vr(A),r=t==null?JB:typeof t=="function"?t:yr(t);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})}function WB(){var A=this.parentNode;A&&A.removeChild(this)}function ZB(){return this.each(WB)}function $B(){var A=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(A,this.nextSibling):A}function zB(){var A=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(A,this.nextSibling):A}function qB(A){return this.select(A?zB:$B)}function jB(A){return arguments.length?this.property("__data__",A):this.node().__data__}function Ac(A){return function(t){A.call(this,t,this.__data__)}}function tc(A){return A.trim().split(/^|\s+/).map(function(t){var e="",r=t.indexOf(".");return r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),{type:t,name:e}})}function ec(A){return function(){var t=this.__on;if(t){for(var e=0,r=-1,n=t.length,i;e<n;++e)i=t[e],(!A.type||i.type===A.type)&&i.name===A.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function rc(A,t,e){return function(){var r=this.__on,n,i=Ac(t);if(r){for(var s=0,a=r.length;s<a;++s)if((n=r[s]).type===A.type&&n.name===A.name){this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=i,n.options=e),n.value=t;return}}this.addEventListener(A.type,i,e),n={type:A.type,name:A.name,value:t,listener:i,options:e},r?r.push(n):this.__on=[n]}}function nc(A,t,e){var r=tc(A+""),n,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var o=0,B=a.length,c;o<B;++o)for(n=0,c=a[o];n<i;++n)if((s=r[n]).type===c.type&&s.name===c.name)return c.value}return}for(a=t?rc:ec,n=0;n<i;++n)this.each(a(r[n],t,e));return this}function di(A,t,e){var r=gi(A),n=r.CustomEvent;typeof n=="function"?n=new n(t,e):(n=r.document.createEvent("Event"),e?(n.initEvent(t,e.bubbles,e.cancelable),n.detail=e.detail):n.initEvent(t,!1,!1)),A.dispatchEvent(n)}function ic(A,t){return function(){return di(this,A,t)}}function sc(A,t){return function(){return di(this,A,t.apply(this,arguments))}}function ac(A,t){return this.each((typeof t=="function"?sc:ic)(A,t))}function*oc(){for(var A=this._groups,t=0,e=A.length;t<e;++t)for(var r=A[t],n=0,i=r.length,s;n<i;++n)(s=r[n])&&(yield s)}var Ui=[null];function uA(A,t){this._groups=A,this._parents=t}function ot(){return new uA([[document.documentElement]],Ui)}function Bc(){return this}uA.prototype=ot.prototype={constructor:uA,select:To,selectAll:Ro,selectChild:ko,selectChildren:Yo,filter:Wo,data:AB,enter:Zo,exit:eB,join:rB,merge:nB,selection:Bc,order:iB,sort:sB,call:oB,nodes:BB,node:cB,size:uB,empty:lB,each:fB,attr:UB,style:yB,property:IB,classed:KB,text:MB,html:NB,raise:VB,lower:PB,append:XB,insert:YB,remove:ZB,clone:qB,datum:jB,on:nc,dispatch:ac,[Symbol.iterator]:oc};function LA(A){return typeof A=="string"?new uA([[document.querySelector(A)]],[document.documentElement]):new uA([[A]],Ui)}function Fi(A){return LA(vr(A).call(document.documentElement))}function cc(A){let t;for(;t=A.sourceEvent;)A=t;return A}function mr(A,t){if(A=cc(A),t===void 0&&(t=A.currentTarget),t){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=A.clientX,r.y=A.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var n=t.getBoundingClientRect();return[A.clientX-n.left-t.clientLeft,A.clientY-n.top-t.clientTop]}}return[A.pageX,A.pageY]}var uc={value:()=>{}};function Hr(){for(var A=0,t=arguments.length,e={},r;A<t;++A){if(!(r=arguments[A]+"")||r in e||/[\s.]/.test(r))throw new Error("illegal type: "+r);e[r]=[]}return new ce(e)}function ce(A){this._=A}function lc(A,t){return A.trim().split(/^|\s+/).map(function(e){var r="",n=e.indexOf(".");if(n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:r}})}ce.prototype=Hr.prototype={constructor:ce,on:function(A,t){var e=this._,r=lc(A+"",e),n,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((n=(A=r[i]).type)&&(n=fc(e[n],A.name)))return n;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(n=(A=r[i]).type)e[n]=pi(e[n],A.name,t);else if(t==null)for(n in e)e[n]=pi(e[n],A.name,null);return this},copy:function(){var A={},t=this._;for(var e in t)A[e]=t[e].slice();return new ce(A)},call:function(A,t){if((n=arguments.length-2)>0)for(var e=new Array(n),r=0,n,i;r<n;++r)e[r]=arguments[r+2];if(!this._.hasOwnProperty(A))throw new Error("unknown type: "+A);for(i=this._[A],r=0,n=i.length;r<n;++r)i[r].value.apply(t,e)},apply:function(A,t,e){if(!this._.hasOwnProperty(A))throw new Error("unknown type: "+A);for(var r=this._[A],n=0,i=r.length;n<i;++n)r[n].value.apply(t,e)}};function fc(A,t){for(var e=0,r=A.length,n;e<r;++e)if((n=A[e]).name===t)return n.value}function pi(A,t,e){for(var r=0,n=A.length;r<n;++r)if(A[r].name===t){A[r]=uc,A=A.slice(0,r).concat(A.slice(r+1));break}return e!=null&&A.push({name:t,value:e}),A}var Bt=0,xt=0,Lt=0,vi=1e3,ue,bt,le=0,zA=0,fe=0,Kt=typeof performance=="object"&&performance.now?performance:Date,yi=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(A){setTimeout(A,17)};function Ir(){return zA||(yi(gc),zA=Kt.now()+fe)}function gc(){zA=0}function ge(){this._call=this._time=this._next=null}ge.prototype=Ei.prototype={constructor:ge,restart:function(A,t,e){if(typeof A!="function")throw new TypeError("callback is not a function");e=(e==null?Ir():+e)+(t==null?0:+t),!this._next&&bt!==this&&(bt?bt._next=this:ue=this,bt=this),this._call=A,this._time=e,xr()},stop:function(){this._call&&(this._call=null,this._time=1/0,xr())}};function Ei(A,t,e){var r=new ge;return r.restart(A,t,e),r}function hc(){Ir(),++Bt;for(var A=ue,t;A;)(t=zA-A._time)>=0&&A._call.call(void 0,t),A=A._next;--Bt}function mi(){zA=(le=Kt.now())+fe,Bt=xt=0;try{hc()}finally{Bt=0,Qc(),zA=0}}function wc(){var A=Kt.now(),t=A-le;t>vi&&(fe-=t,le=A)}function Qc(){for(var A,t=ue,e,r=1/0;t;)t._call?(r>t._time&&(r=t._time),A=t,t=t._next):(e=t._next,t._next=null,t=A?A._next=e:ue=e);bt=A,xr(r)}function xr(A){if(!Bt){xt&&(xt=clearTimeout(xt));var t=A-zA;t>24?(A<1/0&&(xt=setTimeout(mi,A-Kt.now()-fe)),Lt&&(Lt=clearInterval(Lt))):(Lt||(le=Kt.now(),Lt=setInterval(wc,vi)),Bt=1,yi(mi))}}function Hi(A,t,e){var r=new ge;return t=t==null?0:+t,r.restart(n=>{r.stop(),A(n+t)},t,e),r}var Cc=Hr("start","end","cancel","interrupt"),dc=[],Ii=0,xi=1,Lr=2,he=3,Li=4,br=5,we=6;function Qe(A,t,e,r,n,i){var s=A.__transition;if(!s)A.__transition={};else if(e in s)return;Uc(A,e,{name:t,index:r,group:n,on:Cc,tween:dc,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Ii})}function Kr(A,t){var e=dA(A,t);if(e.state>Ii)throw new Error("too late; already scheduled");return e}function EA(A,t){var e=dA(A,t);if(e.state>he)throw new Error("too late; already running");return e}function dA(A,t){var e=A.__transition;if(!e||!(e=e[t]))throw new Error("transition not found");return e}function Uc(A,t,e){var r=A.__transition,n;r[t]=e,e.timer=Ei(i,0,e.time);function i(B){e.state=xi,e.timer.restart(s,e.delay,e.time),e.delay<=B&&s(B-e.delay)}function s(B){var c,u,l,f;if(e.state!==xi)return o();for(c in r)if(f=r[c],f.name===e.name){if(f.state===he)return Hi(s);f.state===Li?(f.state=we,f.timer.stop(),f.on.call("interrupt",A,A.__data__,f.index,f.group),delete r[c]):+c<t&&(f.state=we,f.timer.stop(),f.on.call("cancel",A,A.__data__,f.index,f.group),delete r[c])}if(Hi(function(){e.state===he&&(e.state=Li,e.timer.restart(a,e.delay,e.time),a(B))}),e.state=Lr,e.on.call("start",A,A.__data__,e.index,e.group),e.state===Lr){for(e.state=he,n=new Array(l=e.tween.length),c=0,u=-1;c<l;++c)(f=e.tween[c].value.call(A,A.__data__,e.index,e.group))&&(n[++u]=f);n.length=u+1}}function a(B){for(var c=B<e.duration?e.ease.call(null,B/e.duration):(e.timer.restart(o),e.state=br,1),u=-1,l=n.length;++u<l;)n[u].call(A,c);e.state===br&&(e.on.call("end",A,A.__data__,e.index,e.group),o())}function o(){e.state=we,e.timer.stop(),delete r[t];for(var B in r)return;delete A.__transition}}function Sr(A,t){var e=A.__transition,r,n,i=!0,s;if(e){t=t==null?null:t+"";for(s in e){if((r=e[s]).name!==t){i=!1;continue}n=r.state>Lr&&r.state<br,r.state=we,r.timer.stop(),r.on.call(n?"interrupt":"cancel",A,A.__data__,r.index,r.group),delete e[s]}i&&delete A.__transition}}function Fc(A){return this.each(function(){Sr(this,A)})}function Dr(A,t,e){A.prototype=t.prototype=e,e.constructor=A}function bi(A,t){var e=Object.create(A.prototype);for(var r in t)e[r]=t[r];return e}function St(){}var Dt=.7,Ce=1/Dt,ct="\\s*([+-]?\\d+)\\s*",Tt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",mA="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pc=/^#([0-9a-f]{3,8})$/,vc=new RegExp(`^rgb\\(${ct},${ct},${ct}\\)$`),yc=new RegExp(`^rgb\\(${mA},${mA},${mA}\\)$`),Ec=new RegExp(`^rgba\\(${ct},${ct},${ct},${Tt}\\)$`),mc=new RegExp(`^rgba\\(${mA},${mA},${mA},${Tt}\\)$`),Hc=new RegExp(`^hsl\\(${Tt},${mA},${mA}\\)$`),Ic=new RegExp(`^hsla\\(${Tt},${mA},${mA},${Tt}\\)$`),Ki={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Dr(St,qA,{copy(A){return Object.assign(new this.constructor,this,A)},displayable(){return this.rgb().displayable()},hex:Si,formatHex:Si,formatHex8:xc,formatHsl:Lc,formatRgb:Di,toString:Di});function Si(){return this.rgb().formatHex()}function xc(){return this.rgb().formatHex8()}function Lc(){return Ri(this).formatHsl()}function Di(){return this.rgb().formatRgb()}function qA(A){var t,e;return A=(A+"").trim().toLowerCase(),(t=pc.exec(A))?(e=t[1].length,t=parseInt(t[1],16),e===6?Ti(t):e===3?new oA(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):e===8?de(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):e===4?de(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=vc.exec(A))?new oA(t[1],t[2],t[3],1):(t=yc.exec(A))?new oA(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Ec.exec(A))?de(t[1],t[2],t[3],t[4]):(t=mc.exec(A))?de(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Hc.exec(A))?Oi(t[1],t[2]/100,t[3]/100,1):(t=Ic.exec(A))?Oi(t[1],t[2]/100,t[3]/100,t[4]):Ki.hasOwnProperty(A)?Ti(Ki[A]):A==="transparent"?new oA(NaN,NaN,NaN,0):null}function Ti(A){return new oA(A>>16&255,A>>8&255,A&255,1)}function de(A,t,e,r){return r<=0&&(A=t=e=NaN),new oA(A,t,e,r)}function bc(A){return A instanceof St||(A=qA(A)),A?(A=A.rgb(),new oA(A.r,A.g,A.b,A.opacity)):new oA}function Tr(A,t,e,r){return arguments.length===1?bc(A):new oA(A,t,e,r??1)}function oA(A,t,e,r){this.r=+A,this.g=+t,this.b=+e,this.opacity=+r}Dr(oA,Tr,bi(St,{brighter(A){return A=A==null?Ce:Math.pow(Ce,A),new oA(this.r*A,this.g*A,this.b*A,this.opacity)},darker(A){return A=A==null?Dt:Math.pow(Dt,A),new oA(this.r*A,this.g*A,this.b*A,this.opacity)},rgb(){return this},clamp(){return new oA(jA(this.r),jA(this.g),jA(this.b),Ue(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Mi,formatHex:Mi,formatHex8:Kc,formatRgb:_i,toString:_i}));function Mi(){return`#${At(this.r)}${At(this.g)}${At(this.b)}`}function Kc(){return`#${At(this.r)}${At(this.g)}${At(this.b)}${At((isNaN(this.opacity)?1:this.opacity)*255)}`}function _i(){const A=Ue(this.opacity);return`${A===1?"rgb(":"rgba("}${jA(this.r)}, ${jA(this.g)}, ${jA(this.b)}${A===1?")":`, ${A})`}`}function Ue(A){return isNaN(A)?1:Math.max(0,Math.min(1,A))}function jA(A){return Math.max(0,Math.min(255,Math.round(A)||0))}function At(A){return A=jA(A),(A<16?"0":"")+A.toString(16)}function Oi(A,t,e,r){return r<=0?A=t=e=NaN:e<=0||e>=1?A=t=NaN:t<=0&&(A=NaN),new UA(A,t,e,r)}function Ri(A){if(A instanceof UA)return new UA(A.h,A.s,A.l,A.opacity);if(A instanceof St||(A=qA(A)),!A)return new UA;if(A instanceof UA)return A;A=A.rgb();var t=A.r/255,e=A.g/255,r=A.b/255,n=Math.min(t,e,r),i=Math.max(t,e,r),s=NaN,a=i-n,o=(i+n)/2;return a?(t===i?s=(e-r)/a+(e<r)*6:e===i?s=(r-t)/a+2:s=(t-e)/a+4,a/=o<.5?i+n:2-i-n,s*=60):a=o>0&&o<1?0:s,new UA(s,a,o,A.opacity)}function Sc(A,t,e,r){return arguments.length===1?Ri(A):new UA(A,t,e,r??1)}function UA(A,t,e,r){this.h=+A,this.s=+t,this.l=+e,this.opacity=+r}Dr(UA,Sc,bi(St,{brighter(A){return A=A==null?Ce:Math.pow(Ce,A),new UA(this.h,this.s,this.l*A,this.opacity)},darker(A){return A=A==null?Dt:Math.pow(Dt,A),new UA(this.h,this.s,this.l*A,this.opacity)},rgb(){var A=this.h%360+(this.h<0)*360,t=isNaN(A)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*t,n=2*e-r;return new oA(Mr(A>=240?A-240:A+120,n,r),Mr(A,n,r),Mr(A<120?A+240:A-120,n,r),this.opacity)},clamp(){return new UA(Ni(this.h),Fe(this.s),Fe(this.l),Ue(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const A=Ue(this.opacity);return`${A===1?"hsl(":"hsla("}${Ni(this.h)}, ${Fe(this.s)*100}%, ${Fe(this.l)*100}%${A===1?")":`, ${A})`}`}}));function Ni(A){return A=(A||0)%360,A<0?A+360:A}function Fe(A){return Math.max(0,Math.min(1,A||0))}function Mr(A,t,e){return(A<60?t+(e-t)*A/60:A<180?e:A<240?t+(e-t)*(240-A)/60:t)*255}const _r=A=>()=>A;function Dc(A,t){return function(e){return A+e*t}}function Tc(A,t,e){return A=Math.pow(A,e),t=Math.pow(t,e)-A,e=1/e,function(r){return Math.pow(A+r*t,e)}}function Mc(A){return(A=+A)==1?Gi:function(t,e){return e-t?Tc(t,e,A):_r(isNaN(t)?e:t)}}function Gi(A,t){var e=t-A;return e?Dc(A,e):_r(isNaN(A)?t:A)}const pe=(function A(t){var e=Mc(t);function r(n,i){var s=e((n=Tr(n)).r,(i=Tr(i)).r),a=e(n.g,i.g),o=e(n.b,i.b),B=Gi(n.opacity,i.opacity);return function(c){return n.r=s(c),n.g=a(c),n.b=o(c),n.opacity=B(c),n+""}}return r.gamma=A,r})(1);function _c(A,t){t||(t=[]);var e=A?Math.min(t.length,A.length):0,r=t.slice(),n;return function(i){for(n=0;n<e;++n)r[n]=A[n]*(1-i)+t[n]*i;return r}}function Oc(A){return ArrayBuffer.isView(A)&&!(A instanceof DataView)}function Rc(A,t){var e=t?t.length:0,r=A?Math.min(e,A.length):0,n=new Array(r),i=new Array(e),s;for(s=0;s<r;++s)n[s]=ve(A[s],t[s]);for(;s<e;++s)i[s]=t[s];return function(a){for(s=0;s<r;++s)i[s]=n[s](a);return i}}function Nc(A,t){var e=new Date;return A=+A,t=+t,function(r){return e.setTime(A*(1-r)+t*r),e}}function FA(A,t){return A=+A,t=+t,function(e){return A*(1-e)+t*e}}function Gc(A,t){var e={},r={},n;(A===null||typeof A!="object")&&(A={}),(t===null||typeof t!="object")&&(t={});for(n in t)n in A?e[n]=ve(A[n],t[n]):r[n]=t[n];return function(i){for(n in e)r[n]=e[n](i);return r}}var Or=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Rr=new RegExp(Or.source,"g");function Vc(A){return function(){return A}}function kc(A){return function(t){return A(t)+""}}function Vi(A,t){var e=Or.lastIndex=Rr.lastIndex=0,r,n,i,s=-1,a=[],o=[];for(A=A+"",t=t+"";(r=Or.exec(A))&&(n=Rr.exec(t));)(i=n.index)>e&&(i=t.slice(e,i),a[s]?a[s]+=i:a[++s]=i),(r=r[0])===(n=n[0])?a[s]?a[s]+=n:a[++s]=n:(a[++s]=null,o.push({i:s,x:FA(r,n)})),e=Rr.lastIndex;return e<t.length&&(i=t.slice(e),a[s]?a[s]+=i:a[++s]=i),a.length<2?o[0]?kc(o[0].x):Vc(t):(t=o.length,function(B){for(var c=0,u;c<t;++c)a[(u=o[c]).i]=u.x(B);return a.join("")})}function ve(A,t){var e=typeof t,r;return t==null||e==="boolean"?_r(t):(e==="number"?FA:e==="string"?(r=qA(t))?(t=r,pe):Vi:t instanceof qA?pe:t instanceof Date?Nc:Oc(t)?_c:Array.isArray(t)?Rc:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Gc:FA)(A,t)}function Pc(A,t){return A=+A,t=+t,function(e){return Math.round(A*(1-e)+t*e)}}var ki=180/Math.PI,Nr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Pi(A,t,e,r,n,i){var s,a,o;return(s=Math.sqrt(A*A+t*t))&&(A/=s,t/=s),(o=A*e+t*r)&&(e-=A*o,r-=t*o),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,o/=a),A*r<t*e&&(A=-A,t=-t,o=-o,s=-s),{translateX:n,translateY:i,rotate:Math.atan2(t,A)*ki,skewX:Math.atan(o)*ki,scaleX:s,scaleY:a}}var ye;function Xc(A){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(A+"");return t.isIdentity?Nr:Pi(t.a,t.b,t.c,t.d,t.e,t.f)}function Jc(A){return A==null||(ye||(ye=document.createElementNS("http://www.w3.org/2000/svg","g")),ye.setAttribute("transform",A),!(A=ye.transform.baseVal.consolidate()))?Nr:(A=A.matrix,Pi(A.a,A.b,A.c,A.d,A.e,A.f))}function Xi(A,t,e,r){function n(B){return B.length?B.pop()+" ":""}function i(B,c,u,l,f,g){if(B!==u||c!==l){var Q=f.push("translate(",null,t,null,e);g.push({i:Q-4,x:FA(B,u)},{i:Q-2,x:FA(c,l)})}else(u||l)&&f.push("translate("+u+t+l+e)}function s(B,c,u,l){B!==c?(B-c>180?c+=360:c-B>180&&(B+=360),l.push({i:u.push(n(u)+"rotate(",null,r)-2,x:FA(B,c)})):c&&u.push(n(u)+"rotate("+c+r)}function a(B,c,u,l){B!==c?l.push({i:u.push(n(u)+"skewX(",null,r)-2,x:FA(B,c)}):c&&u.push(n(u)+"skewX("+c+r)}function o(B,c,u,l,f,g){if(B!==u||c!==l){var Q=f.push(n(f)+"scale(",null,",",null,")");g.push({i:Q-4,x:FA(B,u)},{i:Q-2,x:FA(c,l)})}else(u!==1||l!==1)&&f.push(n(f)+"scale("+u+","+l+")")}return function(B,c){var u=[],l=[];return B=A(B),c=A(c),i(B.translateX,B.translateY,c.translateX,c.translateY,u,l),s(B.rotate,c.rotate,u,l),a(B.skewX,c.skewX,u,l),o(B.scaleX,B.scaleY,c.scaleX,c.scaleY,u,l),B=c=null,function(f){for(var g=-1,Q=l.length,w;++g<Q;)u[(w=l[g]).i]=w.x(f);return u.join("")}}}var Yc=Xi(Xc,"px, ","px)","deg)"),Wc=Xi(Jc,", ",")",")");function Zc(A,t){var e,r;return function(){var n=EA(this,A),i=n.tween;if(i!==e){r=e=i;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}n.tween=r}}function $c(A,t,e){var r,n;if(typeof e!="function")throw new Error;return function(){var i=EA(this,A),s=i.tween;if(s!==r){n=(r=s).slice();for(var a={name:t,value:e},o=0,B=n.length;o<B;++o)if(n[o].name===t){n[o]=a;break}o===B&&n.push(a)}i.tween=n}}function zc(A,t){var e=this._id;if(A+="",arguments.length<2){for(var r=dA(this.node(),e).tween,n=0,i=r.length,s;n<i;++n)if((s=r[n]).name===A)return s.value;return null}return this.each((t==null?Zc:$c)(e,A,t))}function Gr(A,t,e){var r=A._id;return A.each(function(){var n=EA(this,r);(n.value||(n.value={}))[t]=e.apply(this,arguments)}),function(n){return dA(n,r).value[t]}}function Ji(A,t){var e;return(typeof t=="number"?FA:t instanceof qA?pe:(e=qA(t))?(t=e,pe):Vi)(A,t)}function qc(A){return function(){this.removeAttribute(A)}}function jc(A){return function(){this.removeAttributeNS(A.space,A.local)}}function Au(A,t,e){var r,n=e+"",i;return function(){var s=this.getAttribute(A);return s===n?null:s===r?i:i=t(r=s,e)}}function tu(A,t,e){var r,n=e+"",i;return function(){var s=this.getAttributeNS(A.space,A.local);return s===n?null:s===r?i:i=t(r=s,e)}}function eu(A,t,e){var r,n,i;return function(){var s,a=e(this),o;return a==null?void this.removeAttribute(A):(s=this.getAttribute(A),o=a+"",s===o?null:s===r&&o===n?i:(n=o,i=t(r=s,a)))}}function ru(A,t,e){var r,n,i;return function(){var s,a=e(this),o;return a==null?void this.removeAttributeNS(A.space,A.local):(s=this.getAttributeNS(A.space,A.local),o=a+"",s===o?null:s===r&&o===n?i:(n=o,i=t(r=s,a)))}}function nu(A,t){var e=oe(A),r=e==="transform"?Wc:Ji;return this.attrTween(A,typeof t=="function"?(e.local?ru:eu)(e,r,Gr(this,"attr."+A,t)):t==null?(e.local?jc:qc)(e):(e.local?tu:Au)(e,r,t))}function iu(A,t){return function(e){this.setAttribute(A,t.call(this,e))}}function su(A,t){return function(e){this.setAttributeNS(A.space,A.local,t.call(this,e))}}function au(A,t){var e,r;function n(){var i=t.apply(this,arguments);return i!==r&&(e=(r=i)&&su(A,i)),e}return n._value=t,n}function ou(A,t){var e,r;function n(){var i=t.apply(this,arguments);return i!==r&&(e=(r=i)&&iu(A,i)),e}return n._value=t,n}function Bu(A,t){var e="attr."+A;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;var r=oe(A);return this.tween(e,(r.local?au:ou)(r,t))}function cu(A,t){return function(){Kr(this,A).delay=+t.apply(this,arguments)}}function uu(A,t){return t=+t,function(){Kr(this,A).delay=t}}function lu(A){var t=this._id;return arguments.length?this.each((typeof A=="function"?cu:uu)(t,A)):dA(this.node(),t).delay}function fu(A,t){return function(){EA(this,A).duration=+t.apply(this,arguments)}}function gu(A,t){return t=+t,function(){EA(this,A).duration=t}}function hu(A){var t=this._id;return arguments.length?this.each((typeof A=="function"?fu:gu)(t,A)):dA(this.node(),t).duration}function wu(A,t){if(typeof t!="function")throw new Error;return function(){EA(this,A).ease=t}}function Qu(A){var t=this._id;return arguments.length?this.each(wu(t,A)):dA(this.node(),t).ease}function Cu(A,t){return function(){var e=t.apply(this,arguments);if(typeof e!="function")throw new Error;EA(this,A).ease=e}}function du(A){if(typeof A!="function")throw new Error;return this.each(Cu(this._id,A))}function Uu(A){typeof A!="function"&&(A=ui(A));for(var t=this._groups,e=t.length,r=new Array(e),n=0;n<e;++n)for(var i=t[n],s=i.length,a=r[n]=[],o,B=0;B<s;++B)(o=i[B])&&A.call(o,o.__data__,B,i)&&a.push(o);return new bA(r,this._parents,this._name,this._id)}function Fu(A){if(A._id!==this._id)throw new Error;for(var t=this._groups,e=A._groups,r=t.length,n=e.length,i=Math.min(r,n),s=new Array(r),a=0;a<i;++a)for(var o=t[a],B=e[a],c=o.length,u=s[a]=new Array(c),l,f=0;f<c;++f)(l=o[f]||B[f])&&(u[f]=l);for(;a<r;++a)s[a]=t[a];return new bA(s,this._parents,this._name,this._id)}function pu(A){return(A+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||t==="start"})}function vu(A,t,e){var r,n,i=pu(t)?Kr:EA;return function(){var s=i(this,A),a=s.on;a!==r&&(n=(r=a).copy()).on(t,e),s.on=n}}function yu(A,t){var e=this._id;return arguments.length<2?dA(this.node(),e).on.on(A):this.each(vu(e,A,t))}function Eu(A){return function(){var t=this.parentNode;for(var e in this.__transition)if(+e!==A)return;t&&t.removeChild(this)}}function mu(){return this.on("end.remove",Eu(this._id))}function Hu(A){var t=this._name,e=this._id;typeof A!="function"&&(A=yr(A));for(var r=this._groups,n=r.length,i=new Array(n),s=0;s<n;++s)for(var a=r[s],o=a.length,B=i[s]=new Array(o),c,u,l=0;l<o;++l)(c=a[l])&&(u=A.call(c,c.__data__,l,a))&&("__data__"in c&&(u.__data__=c.__data__),B[l]=u,Qe(B[l],t,e,l,B,dA(c,e)));return new bA(i,this._parents,t,e)}function Iu(A){var t=this._name,e=this._id;typeof A!="function"&&(A=ci(A));for(var r=this._groups,n=r.length,i=[],s=[],a=0;a<n;++a)for(var o=r[a],B=o.length,c,u=0;u<B;++u)if(c=o[u]){for(var l=A.call(c,c.__data__,u,o),f,g=dA(c,e),Q=0,w=l.length;Q<w;++Q)(f=l[Q])&&Qe(f,t,e,Q,l,g);i.push(l),s.push(c)}return new bA(i,s,t,e)}var xu=ot.prototype.constructor;function Lu(){return new xu(this._groups,this._parents)}function bu(A,t){var e,r,n;return function(){var i=at(this,A),s=(this.style.removeProperty(A),at(this,A));return i===s?null:i===e&&s===r?n:n=t(e=i,r=s)}}function Yi(A){return function(){this.style.removeProperty(A)}}function Ku(A,t,e){var r,n=e+"",i;return function(){var s=at(this,A);return s===n?null:s===r?i:i=t(r=s,e)}}function Su(A,t,e){var r,n,i;return function(){var s=at(this,A),a=e(this),o=a+"";return a==null&&(o=a=(this.style.removeProperty(A),at(this,A))),s===o?null:s===r&&o===n?i:(n=o,i=t(r=s,a))}}function Du(A,t){var e,r,n,i="style."+t,s="end."+i,a;return function(){var o=EA(this,A),B=o.on,c=o.value[i]==null?a||(a=Yi(t)):void 0;(B!==e||n!==c)&&(r=(e=B).copy()).on(s,n=c),o.on=r}}function Tu(A,t,e){var r=(A+="")=="transform"?Yc:Ji;return t==null?this.styleTween(A,bu(A,r)).on("end.style."+A,Yi(A)):typeof t=="function"?this.styleTween(A,Su(A,r,Gr(this,"style."+A,t))).each(Du(this._id,A)):this.styleTween(A,Ku(A,r,t),e).on("end.style."+A,null)}function Mu(A,t,e){return function(r){this.style.setProperty(A,t.call(this,r),e)}}function _u(A,t,e){var r,n;function i(){var s=t.apply(this,arguments);return s!==n&&(r=(n=s)&&Mu(A,s,e)),r}return i._value=t,i}function Ou(A,t,e){var r="style."+(A+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,_u(A,t,e??""))}function Ru(A){return function(){this.textContent=A}}function Nu(A){return function(){var t=A(this);this.textContent=t??""}}function Gu(A){return this.tween("text",typeof A=="function"?Nu(Gr(this,"text",A)):Ru(A==null?"":A+""))}function Vu(A){return function(t){this.textContent=A.call(this,t)}}function ku(A){var t,e;function r(){var n=A.apply(this,arguments);return n!==e&&(t=(e=n)&&Vu(n)),t}return r._value=A,r}function Pu(A){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(A==null)return this.tween(t,null);if(typeof A!="function")throw new Error;return this.tween(t,ku(A))}function Xu(){for(var A=this._name,t=this._id,e=Zi(),r=this._groups,n=r.length,i=0;i<n;++i)for(var s=r[i],a=s.length,o,B=0;B<a;++B)if(o=s[B]){var c=dA(o,t);Qe(o,A,e,B,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new bA(r,this._parents,A,e)}function Ju(){var A,t,e=this,r=e._id,n=e.size();return new Promise(function(i,s){var a={value:s},o={value:function(){--n===0&&i()}};e.each(function(){var B=EA(this,r),c=B.on;c!==A&&(t=(A=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(o)),B.on=t}),n===0&&i()})}var Yu=0;function bA(A,t,e,r){this._groups=A,this._parents=t,this._name=e,this._id=r}function Wi(A){return ot().transition(A)}function Zi(){return++Yu}var KA=ot.prototype;bA.prototype=Wi.prototype={constructor:bA,select:Hu,selectAll:Iu,selectChild:KA.selectChild,selectChildren:KA.selectChildren,filter:Uu,merge:Fu,selection:Lu,transition:Xu,call:KA.call,nodes:KA.nodes,node:KA.node,size:KA.size,empty:KA.empty,each:KA.each,on:yu,attr:nu,attrTween:Bu,style:Tu,styleTween:Ou,text:Gu,textTween:Pu,remove:mu,tween:zc,delay:lu,duration:hu,ease:Qu,easeVarying:du,end:Ju,[Symbol.iterator]:KA[Symbol.iterator]};function Wu(A){return((A*=2)<=1?A*A*A:(A-=2)*A*A+2)/2}var Zu={time:null,delay:0,duration:250,ease:Wu};function $u(A,t){for(var e;!(e=A.__transition)||!(e=e[t]);)if(!(A=A.parentNode))throw new Error(`transition ${t} not found`);return e}function zu(A){var t,e;A instanceof bA?(t=A._id,A=A._name):(t=Zi(),(e=Zu).time=Ir(),A=A==null?null:A+"");for(var r=this._groups,n=r.length,i=0;i<n;++i)for(var s=r[i],a=s.length,o,B=0;B<a;++B)(o=s[B])&&Qe(o,A,t,B,s,e||$u(o,t));return new bA(r,this._parents,A,t)}ot.prototype.interrupt=Fc,ot.prototype.transition=zu;function qu(A){return A}var Vr=1,kr=2,Pr=3,Mt=4,$i=1e-6;function ju(A){return"translate("+A+",0)"}function Al(A){return"translate(0,"+A+")"}function tl(A){return t=>+A(t)}function el(A,t){return t=Math.max(0,A.bandwidth()-t*2)/2,A.round()&&(t=Math.round(t)),e=>+A(e)+t}function rl(){return!this.__axis}function zi(A,t){var e=[],r=null,n=null,i=6,s=6,a=3,o=typeof window<"u"&&window.devicePixelRatio>1?0:.5,B=A===Vr||A===Mt?-1:1,c=A===Mt||A===kr?"x":"y",u=A===Vr||A===Pr?ju:Al;function l(f){var g=r??(t.ticks?t.ticks.apply(t,e):t.domain()),Q=n??(t.tickFormat?t.tickFormat.apply(t,e):qu),w=Math.max(i,0)+a,h=t.range(),C=+h[0]+o,F=+h[h.length-1]+o,p=(t.bandwidth?el:tl)(t.copy(),o),d=f.selection?f.selection():f,U=d.selectAll(".domain").data([null]),y=d.selectAll(".tick").data(g,t).order(),v=y.exit(),m=y.enter().append("g").attr("class","tick"),L=y.select("line"),E=y.select("text");U=U.merge(U.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),y=y.merge(m),L=L.merge(m.append("line").attr("stroke","currentColor").attr(c+"2",B*i)),E=E.merge(m.append("text").attr("fill","currentColor").attr(c,B*w).attr("dy",A===Vr?"0em":A===Pr?"0.71em":"0.32em")),f!==d&&(U=U.transition(f),y=y.transition(f),L=L.transition(f),E=E.transition(f),v=v.transition(f).attr("opacity",$i).attr("transform",function(K){return isFinite(K=p(K))?u(K+o):this.getAttribute("transform")}),m.attr("opacity",$i).attr("transform",function(K){var H=this.parentNode.__axis;return u((H&&isFinite(H=H(K))?H:p(K))+o)})),v.remove(),U.attr("d",A===Mt||A===kr?s?"M"+B*s+","+C+"H"+o+"V"+F+"H"+B*s:"M"+o+","+C+"V"+F:s?"M"+C+","+B*s+"V"+o+"H"+F+"V"+B*s:"M"+C+","+o+"H"+F),y.attr("opacity",1).attr("transform",function(K){return u(p(K)+o)}),L.attr(c+"2",B*i),E.attr(c,B*w).text(Q),d.filter(rl).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",A===kr?"start":A===Mt?"end":"middle"),d.each(function(){this.__axis=p})}return l.scale=function(f){return arguments.length?(t=f,l):t},l.ticks=function(){return e=Array.from(arguments),l},l.tickArguments=function(f){return arguments.length?(e=f==null?[]:Array.from(f),l):e.slice()},l.tickValues=function(f){return arguments.length?(r=f==null?null:Array.from(f),l):r&&r.slice()},l.tickFormat=function(f){return arguments.length?(n=f,l):n},l.tickSize=function(f){return arguments.length?(i=s=+f,l):i},l.tickSizeInner=function(f){return arguments.length?(i=+f,l):i},l.tickSizeOuter=function(f){return arguments.length?(s=+f,l):s},l.tickPadding=function(f){return arguments.length?(a=+f,l):a},l.offset=function(f){return arguments.length?(o=+f,l):o},l}function nl(A){return zi(Pr,A)}function il(A){return zi(Mt,A)}const Xr={capture:!0,passive:!1};function Jr(A){A.preventDefault(),A.stopImmediatePropagation()}function sl(A){var t=A.document.documentElement,e=LA(A).on("dragstart.drag",Jr,Xr);"onselectstart"in t?e.on("selectstart.drag",Jr,Xr):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function al(A,t){var e=A.document.documentElement,r=LA(A).on("dragstart.drag",null);t&&(r.on("click.drag",Jr,Xr),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}const Yr=A=>()=>A;function ol(A,{sourceEvent:t,target:e,selection:r,mode:n,dispatch:i}){Object.defineProperties(this,{type:{value:A,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:n,enumerable:!0,configurable:!0},_:{value:i}})}function Bl(A){A.stopImmediatePropagation()}function Wr(A){A.preventDefault(),A.stopImmediatePropagation()}var qi={name:"drag"},Zr={name:"space"},ut={name:"handle"},lt={name:"center"};const{abs:ji,max:rA,min:nA}=Math;function As(A){return[+A[0],+A[1]]}function $r(A){return[As(A[0]),As(A[1])]}var zr={},qr={},cl={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(jr),input:function(A){return A==null?null:$r(A)},output:function(A){return A}},SA={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},ts={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},es={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},ul={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},ll={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function jr(A){return{type:A}}function fl(A){return!A.ctrlKey&&!A.button}function gl(){var A=this.ownerSVGElement||this;return A.hasAttribute("viewBox")?(A=A.viewBox.baseVal,[[A.x,A.y],[A.x+A.width,A.y+A.height]]):[[0,0],[A.width.baseVal.value,A.height.baseVal.value]]}function hl(){return navigator.maxTouchPoints||"ontouchstart"in this}function An(A){for(;!A.__brush;)if(!(A=A.parentNode))return;return A.__brush}function wl(A){return A[0][0]===A[1][0]||A[0][1]===A[1][1]}function Ql(){return Cl(cl)}function Cl(A){var t=gl,e=fl,r=hl,n=!0,i=Hr("start","brush","end"),s=6,a;function o(w){var h=w.property("__brush",Q).selectAll(".overlay").data([jr("overlay")]);h.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",SA.overlay).merge(h).each(function(){var F=An(this).extent;LA(this).attr("x",F[0][0]).attr("y",F[0][1]).attr("width",F[1][0]-F[0][0]).attr("height",F[1][1]-F[0][1])}),w.selectAll(".selection").data([jr("selection")]).enter().append("rect").attr("class","selection").attr("cursor",SA.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var C=w.selectAll(".handle").data(A.handles,function(F){return F.type});C.exit().remove(),C.enter().append("rect").attr("class",function(F){return"handle handle--"+F.type}).attr("cursor",function(F){return SA[F.type]}),w.each(B).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",l).filter(r).on("touchstart.brush",l).on("touchmove.brush",f).on("touchend.brush touchcancel.brush",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}o.move=function(w,h,C){w.tween?w.on("start.brush",function(F){c(this,arguments).beforestart().start(F)}).on("interrupt.brush end.brush",function(F){c(this,arguments).end(F)}).tween("brush",function(){var F=this,p=F.__brush,d=c(F,arguments),U=p.selection,y=A.input(typeof h=="function"?h.apply(this,arguments):h,p.extent),v=ve(U,y);function m(L){p.selection=L===1&&y===null?null:v(L),B.call(F),d.brush()}return U!==null&&y!==null?m:m(1)}):w.each(function(){var F=this,p=arguments,d=F.__brush,U=A.input(typeof h=="function"?h.apply(F,p):h,d.extent),y=c(F,p).beforestart();Sr(F),d.selection=U===null?null:U,B.call(F),y.start(C).brush(C).end(C)})},o.clear=function(w,h){o.move(w,null,h)};function B(){var w=LA(this),h=An(this).selection;h?(w.selectAll(".selection").style("display",null).attr("x",h[0][0]).attr("y",h[0][1]).attr("width",h[1][0]-h[0][0]).attr("height",h[1][1]-h[0][1]),w.selectAll(".handle").style("display",null).attr("x",function(C){return C.type[C.type.length-1]==="e"?h[1][0]-s/2:h[0][0]-s/2}).attr("y",function(C){return C.type[0]==="s"?h[1][1]-s/2:h[0][1]-s/2}).attr("width",function(C){return C.type==="n"||C.type==="s"?h[1][0]-h[0][0]+s:s}).attr("height",function(C){return C.type==="e"||C.type==="w"?h[1][1]-h[0][1]+s:s})):w.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(w,h,C){var F=w.__brush.emitter;return F&&(!C||!F.clean)?F:new u(w,h,C)}function u(w,h,C){this.that=w,this.args=h,this.state=w.__brush,this.active=0,this.clean=C}u.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(w,h){return this.starting?(this.starting=!1,this.emit("start",w,h)):this.emit("brush",w),this},brush:function(w,h){return this.emit("brush",w,h),this},end:function(w,h){return--this.active===0&&(delete this.state.emitter,this.emit("end",w,h)),this},emit:function(w,h,C){var F=LA(this.that).datum();i.call(w,this.that,new ol(w,{sourceEvent:h,target:o,selection:A.output(this.state.selection),mode:C,dispatch:i}),F)}};function l(w){if(a&&!w.touches||!e.apply(this,arguments))return;var h=this,C=w.target.__data__.type,F=(n&&w.metaKey?C="overlay":C)==="selection"?qi:n&&w.altKey?lt:ut,p=A===qr?null:ul[C],d=A===zr?null:ll[C],U=An(h),y=U.extent,v=U.selection,m=y[0][0],L,E,K=y[0][1],H,S,Y=y[1][0],M,_,J=y[1][1],b,P,G=0,V=0,fA,CA=p&&d&&n&&w.shiftKey,cA,yA,z=Array.from(w.touches||[w],T=>{const j=T.identifier;return T=mr(T,h),T.point0=T.slice(),T.identifier=j,T});Sr(h);var ie=c(h,arguments,!0).beforestart();if(C==="overlay"){v&&(fA=!0);const T=[z[0],z[1]||z[0]];U.selection=v=[[L=A===qr?m:nA(T[0][0],T[1][0]),H=A===zr?K:nA(T[0][1],T[1][1])],[M=A===qr?Y:rA(T[0][0],T[1][0]),b=A===zr?J:rA(T[0][1],T[1][1])]],z.length>1&&st(w)}else L=v[0][0],H=v[0][1],M=v[1][0],b=v[1][1];E=L,S=H,_=M,P=b;var Io=LA(h).attr("pointer-events","none"),se=Io.selectAll(".overlay").attr("cursor",SA[C]);if(w.touches)ie.moved=Lo,ie.ended=bo;else{var xo=LA(w.view).on("mousemove.brush",Lo,!0).on("mouseup.brush",bo,!0);n&&xo.on("keydown.brush",NC,!0).on("keyup.brush",GC,!0),sl(w.view)}B.call(h),ie.start(w,F.name);function Lo(T){for(const j of T.changedTouches||[T])for(const ae of z)ae.identifier===j.identifier&&(ae.cur=mr(j,h));if(CA&&!cA&&!yA&&z.length===1){const j=z[0];ji(j.cur[0]-j[0])>ji(j.cur[1]-j[1])?yA=!0:cA=!0}for(const j of z)j.cur&&(j[0]=j.cur[0],j[1]=j.cur[1]);fA=!0,Wr(T),st(T)}function st(T){const j=z[0],ae=j.point0;var ZA;switch(G=j[0]-ae[0],V=j[1]-ae[1],F){case Zr:case qi:{p&&(G=rA(m-L,nA(Y-M,G)),E=L+G,_=M+G),d&&(V=rA(K-H,nA(J-b,V)),S=H+V,P=b+V);break}case ut:{z[1]?(p&&(E=rA(m,nA(Y,z[0][0])),_=rA(m,nA(Y,z[1][0])),p=1),d&&(S=rA(K,nA(J,z[0][1])),P=rA(K,nA(J,z[1][1])),d=1)):(p<0?(G=rA(m-L,nA(Y-L,G)),E=L+G,_=M):p>0&&(G=rA(m-M,nA(Y-M,G)),E=L,_=M+G),d<0?(V=rA(K-H,nA(J-H,V)),S=H+V,P=b):d>0&&(V=rA(K-b,nA(J-b,V)),S=H,P=b+V));break}case lt:{p&&(E=rA(m,nA(Y,L-G*p)),_=rA(m,nA(Y,M+G*p))),d&&(S=rA(K,nA(J,H-V*d)),P=rA(K,nA(J,b+V*d)));break}}_<E&&(p*=-1,ZA=L,L=M,M=ZA,ZA=E,E=_,_=ZA,C in ts&&se.attr("cursor",SA[C=ts[C]])),P<S&&(d*=-1,ZA=H,H=b,b=ZA,ZA=S,S=P,P=ZA,C in es&&se.attr("cursor",SA[C=es[C]])),U.selection&&(v=U.selection),cA&&(E=v[0][0],_=v[1][0]),yA&&(S=v[0][1],P=v[1][1]),(v[0][0]!==E||v[0][1]!==S||v[1][0]!==_||v[1][1]!==P)&&(U.selection=[[E,S],[_,P]],B.call(h),ie.brush(T,F.name))}function bo(T){if(Bl(T),T.touches){if(T.touches.length)return;a&&clearTimeout(a),a=setTimeout(function(){a=null},500)}else al(T.view,fA),xo.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);Io.attr("pointer-events","all"),se.attr("cursor",SA.overlay),U.selection&&(v=U.selection),wl(v)&&(U.selection=null,B.call(h)),ie.end(T,F.name)}function NC(T){switch(T.keyCode){case 16:{CA=p&&d;break}case 18:{F===ut&&(p&&(M=_-G*p,L=E+G*p),d&&(b=P-V*d,H=S+V*d),F=lt,st(T));break}case 32:{(F===ut||F===lt)&&(p<0?M=_-G:p>0&&(L=E-G),d<0?b=P-V:d>0&&(H=S-V),F=Zr,se.attr("cursor",SA.selection),st(T));break}default:return}Wr(T)}function GC(T){switch(T.keyCode){case 16:{CA&&(cA=yA=CA=!1,st(T));break}case 18:{F===lt&&(p<0?M=_:p>0&&(L=E),d<0?b=P:d>0&&(H=S),F=ut,st(T));break}case 32:{F===Zr&&(T.altKey?(p&&(M=_-G*p,L=E+G*p),d&&(b=P-V*d,H=S+V*d),F=lt):(p<0?M=_:p>0&&(L=E),d<0?b=P:d>0&&(H=S),F=ut),se.attr("cursor",SA[C]),st(T));break}default:return}Wr(T)}}function f(w){c(this,arguments).moved(w)}function g(w){c(this,arguments).ended(w)}function Q(){var w=this.__brush||{selection:null};return w.extent=$r(t.apply(this,arguments)),w.dim=A,w}return o.extent=function(w){return arguments.length?(t=typeof w=="function"?w:Yr($r(w)),o):t},o.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Yr(!!w),o):e},o.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:Yr(!!w),o):r},o.handleSize=function(w){return arguments.length?(s=+w,o):s},o.keyModifiers=function(w){return arguments.length?(n=!!w,o):n},o.on=function(){var w=i.on.apply(i,arguments);return w===i?o:w},o}function Ee(A,t){return A==null||t==null?NaN:A<t?-1:A>t?1:A>=t?0:NaN}function dl(A,t){return A==null||t==null?NaN:t<A?-1:t>A?1:t>=A?0:NaN}function rs(A){let t,e,r;A.length!==2?(t=Ee,e=(a,o)=>Ee(A(a),o),r=(a,o)=>A(a)-o):(t=A===Ee||A===dl?A:Ul,e=A,r=A);function n(a,o,B=0,c=a.length){if(B<c){if(t(o,o)!==0)return c;do{const u=B+c>>>1;e(a[u],o)<0?B=u+1:c=u}while(B<c)}return B}function i(a,o,B=0,c=a.length){if(B<c){if(t(o,o)!==0)return c;do{const u=B+c>>>1;e(a[u],o)<=0?B=u+1:c=u}while(B<c)}return B}function s(a,o,B=0,c=a.length){const u=n(a,o,B,c-1);return u>B&&r(a[u-1],o)>-r(a[u],o)?u-1:u}return{left:n,center:s,right:i}}function Ul(){return 0}function Fl(A){return A===null?NaN:+A}const pl=rs(Ee).right;rs(Fl).center;class ns extends Map{constructor(t,e=El){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),t!=null)for(const[r,n]of t)this.set(r,n)}get(t){return super.get(is(this,t))}has(t){return super.has(is(this,t))}set(t,e){return super.set(vl(this,t),e)}delete(t){return super.delete(yl(this,t))}}function is({_intern:A,_key:t},e){const r=t(e);return A.has(r)?A.get(r):e}function vl({_intern:A,_key:t},e){const r=t(e);return A.has(r)?A.get(r):(A.set(r,e),e)}function yl({_intern:A,_key:t},e){const r=t(e);return A.has(r)&&(e=A.get(r),A.delete(r)),e}function El(A){return A!==null&&typeof A=="object"?A.valueOf():A}const ml=Math.sqrt(50),Hl=Math.sqrt(10),Il=Math.sqrt(2);function me(A,t,e){const r=(t-A)/Math.max(0,e),n=Math.floor(Math.log10(r)),i=r/Math.pow(10,n),s=i>=ml?10:i>=Hl?5:i>=Il?2:1;let a,o,B;return n<0?(B=Math.pow(10,-n)/s,a=Math.round(A*B),o=Math.round(t*B),a/B<A&&++a,o/B>t&&--o,B=-B):(B=Math.pow(10,n)*s,a=Math.round(A/B),o=Math.round(t/B),a*B<A&&++a,o*B>t&&--o),o<a&&.5<=e&&e<2?me(A,t,e*2):[a,o,B]}function tn(A,t,e){if(t=+t,A=+A,e=+e,!(e>0))return[];if(A===t)return[A];const r=t<A,[n,i,s]=r?me(t,A,e):me(A,t,e);if(!(i>=n))return[];const a=i-n+1,o=new Array(a);if(r)if(s<0)for(let B=0;B<a;++B)o[B]=(i-B)/-s;else for(let B=0;B<a;++B)o[B]=(i-B)*s;else if(s<0)for(let B=0;B<a;++B)o[B]=(n+B)/-s;else for(let B=0;B<a;++B)o[B]=(n+B)*s;return o}function en(A,t,e){return t=+t,A=+A,e=+e,me(A,t,e)[2]}function xl(A,t,e){t=+t,A=+A,e=+e;const r=t<A,n=r?en(t,A,e):en(A,t,e);return(r?-1:1)*(n<0?1/-n:n)}function Ll(A,t,e){A=+A,t=+t,e=(n=arguments.length)<2?(t=A,A=0,1):n<3?1:+e;for(var r=-1,n=Math.max(0,Math.ceil((t-A)/e))|0,i=new Array(n);++r<n;)i[r]=A+r*e;return i}function He(A,t){switch(arguments.length){case 0:break;case 1:this.range(A);break;default:this.range(t).domain(A);break}return this}const ss=Symbol("implicit");function as(){var A=new ns,t=[],e=[],r=ss;function n(i){let s=A.get(i);if(s===void 0){if(r!==ss)return r;A.set(i,s=t.push(i)-1)}return e[s%e.length]}return n.domain=function(i){if(!arguments.length)return t.slice();t=[],A=new ns;for(const s of i)A.has(s)||A.set(s,t.push(s)-1);return n},n.range=function(i){return arguments.length?(e=Array.from(i),n):e.slice()},n.unknown=function(i){return arguments.length?(r=i,n):r},n.copy=function(){return as(t,e).unknown(r)},He.apply(n,arguments),n}function os(){var A=as().unknown(void 0),t=A.domain,e=A.range,r=0,n=1,i,s,a=!1,o=0,B=0,c=.5;delete A.unknown;function u(){var l=t().length,f=n<r,g=f?n:r,Q=f?r:n;i=(Q-g)/Math.max(1,l-o+B*2),a&&(i=Math.floor(i)),g+=(Q-g-i*(l-o))*c,s=i*(1-o),a&&(g=Math.round(g),s=Math.round(s));var w=Ll(l).map(function(h){return g+i*h});return e(f?w.reverse():w)}return A.domain=function(l){return arguments.length?(t(l),u()):t()},A.range=function(l){return arguments.length?([r,n]=l,r=+r,n=+n,u()):[r,n]},A.rangeRound=function(l){return[r,n]=l,r=+r,n=+n,a=!0,u()},A.bandwidth=function(){return s},A.step=function(){return i},A.round=function(l){return arguments.length?(a=!!l,u()):a},A.padding=function(l){return arguments.length?(o=Math.min(1,B=+l),u()):o},A.paddingInner=function(l){return arguments.length?(o=Math.min(1,l),u()):o},A.paddingOuter=function(l){return arguments.length?(B=+l,u()):B},A.align=function(l){return arguments.length?(c=Math.max(0,Math.min(1,l)),u()):c},A.copy=function(){return os(t(),[r,n]).round(a).paddingInner(o).paddingOuter(B).align(c)},He.apply(u(),arguments)}function bl(A){return function(){return A}}function Kl(A){return+A}var Bs=[0,1];function ft(A){return A}function rn(A,t){return(t-=A=+A)?function(e){return(e-A)/t}:bl(isNaN(t)?NaN:.5)}function Sl(A,t){var e;return A>t&&(e=A,A=t,t=e),function(r){return Math.max(A,Math.min(t,r))}}function Dl(A,t,e){var r=A[0],n=A[1],i=t[0],s=t[1];return n<r?(r=rn(n,r),i=e(s,i)):(r=rn(r,n),i=e(i,s)),function(a){return i(r(a))}}function Tl(A,t,e){var r=Math.min(A.length,t.length)-1,n=new Array(r),i=new Array(r),s=-1;for(A[r]<A[0]&&(A=A.slice().reverse(),t=t.slice().reverse());++s<r;)n[s]=rn(A[s],A[s+1]),i[s]=e(t[s],t[s+1]);return function(a){var o=pl(A,a,1,r)-1;return i[o](n[o](a))}}function cs(A,t){return t.domain(A.domain()).range(A.range()).interpolate(A.interpolate()).clamp(A.clamp()).unknown(A.unknown())}function us(){var A=Bs,t=Bs,e=ve,r,n,i,s=ft,a,o,B;function c(){var l=Math.min(A.length,t.length);return s!==ft&&(s=Sl(A[0],A[l-1])),a=l>2?Tl:Dl,o=B=null,u}function u(l){return l==null||isNaN(l=+l)?i:(o||(o=a(A.map(r),t,e)))(r(s(l)))}return u.invert=function(l){return s(n((B||(B=a(t,A.map(r),FA)))(l)))},u.domain=function(l){return arguments.length?(A=Array.from(l,Kl),c()):A.slice()},u.range=function(l){return arguments.length?(t=Array.from(l),c()):t.slice()},u.rangeRound=function(l){return t=Array.from(l),e=Pc,c()},u.clamp=function(l){return arguments.length?(s=l?!0:ft,c()):s!==ft},u.interpolate=function(l){return arguments.length?(e=l,c()):e},u.unknown=function(l){return arguments.length?(i=l,u):i},function(l,f){return r=l,n=f,c()}}function Ml(){return us()(ft,ft)}function _l(A){return Math.abs(A=Math.round(A))>=1e21?A.toLocaleString("en").replace(/,/g,""):A.toString(10)}function Ie(A,t){if((e=(A=t?A.toExponential(t-1):A.toExponential()).indexOf("e"))<0)return null;var e,r=A.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+A.slice(e+1)]}function gt(A){return A=Ie(Math.abs(A)),A?A[1]:NaN}function Ol(A,t){return function(e,r){for(var n=e.length,i=[],s=0,a=A[0],o=0;n>0&&a>0&&(o+a+1>r&&(a=Math.max(1,r-o)),i.push(e.substring(n-=a,n+a)),!((o+=a+1)>r));)a=A[s=(s+1)%A.length];return i.reverse().join(t)}}function Rl(A){return function(t){return t.replace(/[0-9]/g,function(e){return A[+e]})}}var Nl=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function _t(A){if(!(t=Nl.exec(A)))throw new Error("invalid format: "+A);var t;return new nn({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}_t.prototype=nn.prototype;function nn(A){this.fill=A.fill===void 0?" ":A.fill+"",this.align=A.align===void 0?">":A.align+"",this.sign=A.sign===void 0?"-":A.sign+"",this.symbol=A.symbol===void 0?"":A.symbol+"",this.zero=!!A.zero,this.width=A.width===void 0?void 0:+A.width,this.comma=!!A.comma,this.precision=A.precision===void 0?void 0:+A.precision,this.trim=!!A.trim,this.type=A.type===void 0?"":A.type+""}nn.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Gl(A){A:for(var t=A.length,e=1,r=-1,n;e<t;++e)switch(A[e]){case".":r=n=e;break;case"0":r===0&&(r=e),n=e;break;default:if(!+A[e])break A;r>0&&(r=0);break}return r>0?A.slice(0,r)+A.slice(n+1):A}var ls;function Vl(A,t){var e=Ie(A,t);if(!e)return A+"";var r=e[0],n=e[1],i=n-(ls=Math.max(-8,Math.min(8,Math.floor(n/3)))*3)+1,s=r.length;return i===s?r:i>s?r+new Array(i-s+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+Ie(A,Math.max(0,t+i-1))[0]}function fs(A,t){var e=Ie(A,t);if(!e)return A+"";var r=e[0],n=e[1];return n<0?"0."+new Array(-n).join("0")+r:r.length>n+1?r.slice(0,n+1)+"."+r.slice(n+1):r+new Array(n-r.length+2).join("0")}const gs={"%":(A,t)=>(A*100).toFixed(t),b:A=>Math.round(A).toString(2),c:A=>A+"",d:_l,e:(A,t)=>A.toExponential(t),f:(A,t)=>A.toFixed(t),g:(A,t)=>A.toPrecision(t),o:A=>Math.round(A).toString(8),p:(A,t)=>fs(A*100,t),r:fs,s:Vl,X:A=>Math.round(A).toString(16).toUpperCase(),x:A=>Math.round(A).toString(16)};function hs(A){return A}var ws=Array.prototype.map,Qs=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function kl(A){var t=A.grouping===void 0||A.thousands===void 0?hs:Ol(ws.call(A.grouping,Number),A.thousands+""),e=A.currency===void 0?"":A.currency[0]+"",r=A.currency===void 0?"":A.currency[1]+"",n=A.decimal===void 0?".":A.decimal+"",i=A.numerals===void 0?hs:Rl(ws.call(A.numerals,String)),s=A.percent===void 0?"%":A.percent+"",a=A.minus===void 0?"−":A.minus+"",o=A.nan===void 0?"NaN":A.nan+"";function B(u){u=_t(u);var l=u.fill,f=u.align,g=u.sign,Q=u.symbol,w=u.zero,h=u.width,C=u.comma,F=u.precision,p=u.trim,d=u.type;d==="n"?(C=!0,d="g"):gs[d]||(F===void 0&&(F=12),p=!0,d="g"),(w||l==="0"&&f==="=")&&(w=!0,l="0",f="=");var U=Q==="$"?e:Q==="#"&&/[boxX]/.test(d)?"0"+d.toLowerCase():"",y=Q==="$"?r:/[%p]/.test(d)?s:"",v=gs[d],m=/[defgprs%]/.test(d);F=F===void 0?6:/[gprs]/.test(d)?Math.max(1,Math.min(21,F)):Math.max(0,Math.min(20,F));function L(E){var K=U,H=y,S,Y,M;if(d==="c")H=v(E)+H,E="";else{E=+E;var _=E<0||1/E<0;if(E=isNaN(E)?o:v(Math.abs(E),F),p&&(E=Gl(E)),_&&+E==0&&g!=="+"&&(_=!1),K=(_?g==="("?g:a:g==="-"||g==="("?"":g)+K,H=(d==="s"?Qs[8+ls/3]:"")+H+(_&&g==="("?")":""),m){for(S=-1,Y=E.length;++S<Y;)if(M=E.charCodeAt(S),48>M||M>57){H=(M===46?n+E.slice(S+1):E.slice(S))+H,E=E.slice(0,S);break}}}C&&!w&&(E=t(E,1/0));var J=K.length+E.length+H.length,b=J<h?new Array(h-J+1).join(l):"";switch(C&&w&&(E=t(b+E,b.length?h-H.length:1/0),b=""),f){case"<":E=K+E+H+b;break;case"=":E=K+b+E+H;break;case"^":E=b.slice(0,J=b.length>>1)+K+E+H+b.slice(J);break;default:E=b+K+E+H;break}return i(E)}return L.toString=function(){return u+""},L}function c(u,l){var f=B((u=_t(u),u.type="f",u)),g=Math.max(-8,Math.min(8,Math.floor(gt(l)/3)))*3,Q=Math.pow(10,-g),w=Qs[8+g/3];return function(h){return f(Q*h)+w}}return{format:B,formatPrefix:c}}var xe,sn,Cs;Pl({thousands:",",grouping:[3],currency:["$",""]});function Pl(A){return xe=kl(A),sn=xe.format,Cs=xe.formatPrefix,xe}function Xl(A){return Math.max(0,-gt(Math.abs(A)))}function Jl(A,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(gt(t)/3)))*3-gt(Math.abs(A)))}function Yl(A,t){return A=Math.abs(A),t=Math.abs(t)-A,Math.max(0,gt(t)-gt(A))+1}function Wl(A,t,e,r){var n=xl(A,t,e),i;switch(r=_t(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(A),Math.abs(t));return r.precision==null&&!isNaN(i=Jl(n,s))&&(r.precision=i),Cs(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=Yl(n,Math.max(Math.abs(A),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=Xl(n))&&(r.precision=i-(r.type==="%")*2);break}}return sn(r)}function Zl(A){var t=A.domain;return A.ticks=function(e){var r=t();return tn(r[0],r[r.length-1],e??10)},A.tickFormat=function(e,r){var n=t();return Wl(n[0],n[n.length-1],e??10,r)},A.nice=function(e){e==null&&(e=10);var r=t(),n=0,i=r.length-1,s=r[n],a=r[i],o,B,c=10;for(a<s&&(B=s,s=a,a=B,B=n,n=i,i=B);c-- >0;){if(B=en(s,a,e),B===o)return r[n]=s,r[i]=a,t(r);if(B>0)s=Math.floor(s/B)*B,a=Math.ceil(a/B)*B;else if(B<0)s=Math.ceil(s*B)/B,a=Math.floor(a*B)/B;else break;o=B}return A},A}function an(){var A=Ml();return A.copy=function(){return cs(A,an())},He.apply(A,arguments),Zl(A)}function $l(A,t){A=A.slice();var e=0,r=A.length-1,n=A[e],i=A[r],s;return i<n&&(s=e,e=r,r=s,s=n,n=i,i=s),A[e]=t.floor(n),A[r]=t.ceil(i),A}function ds(A){return Math.log(A)}function Us(A){return Math.exp(A)}function zl(A){return-Math.log(-A)}function ql(A){return-Math.exp(-A)}function jl(A){return isFinite(A)?+("1e"+A):A<0?0:A}function Af(A){return A===10?jl:A===Math.E?Math.exp:t=>Math.pow(A,t)}function tf(A){return A===Math.E?Math.log:A===10&&Math.log10||A===2&&Math.log2||(A=Math.log(A),t=>Math.log(t)/A)}function Fs(A){return(t,e)=>-A(-t,e)}function ef(A){const t=A(ds,Us),e=t.domain;let r=10,n,i;function s(){return n=tf(r),i=Af(r),e()[0]<0?(n=Fs(n),i=Fs(i),A(zl,ql)):A(ds,Us),t}return t.base=function(a){return arguments.length?(r=+a,s()):r},t.domain=function(a){return arguments.length?(e(a),s()):e()},t.ticks=a=>{const o=e();let B=o[0],c=o[o.length-1];const u=c<B;u&&([B,c]=[c,B]);let l=n(B),f=n(c),g,Q;const w=a==null?10:+a;let h=[];if(!(r%1)&&f-l<w){if(l=Math.floor(l),f=Math.ceil(f),B>0){for(;l<=f;++l)for(g=1;g<r;++g)if(Q=l<0?g/i(-l):g*i(l),!(Q<B)){if(Q>c)break;h.push(Q)}}else for(;l<=f;++l)for(g=r-1;g>=1;--g)if(Q=l>0?g/i(-l):g*i(l),!(Q<B)){if(Q>c)break;h.push(Q)}h.length*2<w&&(h=tn(B,c,w))}else h=tn(l,f,Math.min(f-l,w)).map(i);return u?h.reverse():h},t.tickFormat=(a,o)=>{if(a==null&&(a=10),o==null&&(o=r===10?"s":","),typeof o!="function"&&(!(r%1)&&(o=_t(o)).precision==null&&(o.trim=!0),o=sn(o)),a===1/0)return o;const B=Math.max(1,r*a/t.ticks().length);return c=>{let u=c/i(Math.round(n(c)));return u*r<r-.5&&(u*=r),u<=B?o(c):""}},t.nice=()=>e($l(e(),{floor:a=>i(Math.floor(n(a))),ceil:a=>i(Math.ceil(n(a)))})),t}function on(){const A=ef(us()).domain([1,10]);return A.copy=()=>cs(A,on()).base(A.base()),He.apply(A,arguments),A}LA.prototype.transition=Wi;var D=(A=>(A.Svg="svg",A.ClipPath="clipPath",A.BaseLayer="baseLayer",A.Axes="axes",A.Area="area",A.Zoom="zoom",A.Trace="trace",A.Tooltip="skadi-chart-tooltip",A.Grid="grid",A.Scatter="scatter",A.Custom="custom",A))(D||{});class DA{constructor(){this.properties=null}brushStart(){}beforeZoom(t){}async zoom(t){}afterZoom(t){}}class rf extends DA{constructor(t){super(),this.labels=t,this.type=D.Axes,this.drawAxis=(e,r)=>{const{width:n,height:i,margin:s}=r.bounds,{getHtmlId:a}=r,o=r.scaleConfig.numericalScales[e];if(this.labels[e]){const B=r.coreLayers[D.Svg].append("text").attr("id",`label${e}-${a(D.Axes)}`).style("font-size","1.2rem").attr("text-anchor","middle").text(this.labels[e]);if(e==="y"){const c=i-s.top-s.bottom;B.attr("x",-c/2-s.top).attr("y",s.left/3).attr("transform","rotate(-90)")}else{const c=n-s.left-s.right;B.attr("x",c/2+s.left).attr("y",i-s.bottom/3)}}return r.scaleConfig.categoricalScales[e]?this.drawCategoricalAxis(e,r):this.drawNumericalAxis(e,o,{...r.globals.tickConfig[e],padding:12},r)},this.draw=e=>{const{x:r,y:n}=e.scaleConfig.numericalScales,{animationDuration:i}=e.globals,{layer:s,axis:a,line:o}=this.drawAxis("x",e),{layer:B,axis:c,line:u}=this.drawAxis("y",e);this.zoom=async()=>{const l=s==null?void 0:s.transition().duration(i).call(a).end(),f=B==null?void 0:B.transition().duration(i).call(c).end(),g=o==null?void 0:o.transition().duration(i).attr("x1",r(0)).attr("x2",r(0)).end(),Q=u==null?void 0:u.transition().duration(i).attr("y1",n(0)).attr("y2",n(0)).end();await Promise.all([l,f,g,Q])}},this.drawCategoricalAxis=(e,r)=>{const n=r.scaleConfig.categoricalScales[e].main,{margin:i}=r.bounds,s=r.coreLayers[D.Svg],{getHtmlId:a}=r,{count:o}=r.globals.tickConfig[e],{translation:B,axisConstructor:c}=this.axisConfig(e,r),u=n.bandwidth(),l=e==="x"?i.bottom:i.left,f=c(n).ticks(o).tickSize(0).tickPadding(l*.3);return s.append("g").attr("id",`${e}-${a(D.Axes)}`).style("font-size","0.75rem").attr("transform",`translate(${B.x},${B.y})`).call(f),Object.entries(r.scaleConfig.categoricalScales[e].bands).forEach(([Q,w])=>{const h=n(Q),C=w.domain();C[0]<0&&C[1]>0&&this.drawNumericalAxis(e,w,{count:1,padding:6},r),n.paddingInner()&&this.drawLinePerpendicularToAxis(e,h,r),this.drawLinePerpendicularToAxis(e,h+u,r)}),{layer:null,axis:null,line:null}},this.drawNumericalAxis=(e,r,n,i)=>{const{getHtmlId:s}=i,{count:a,specifier:o,padding:B}=n,{translation:c,axisConstructor:u}=this.axisConfig(e,i);let l=null;const f=u(r).ticks(a,o).tickSize(0).tickPadding(B),g=i.coreLayers[D.Svg].append("g").attr("id",`${e}-${s(D.Axes)}`).style("font-size","0.75rem").attr("transform",`translate(${c.x},${c.y})`).call(f);return g.select(".domain").style("stroke-opacity",0),i.chartOptions.logScale[e]||(l=this.drawLinePerpendicularToAxis(e,r(0),i,"darkgrey")),{layer:g,axis:f,line:l}},this.drawLinePerpendicularToAxis=(e,r,n,i="black")=>{const s=n.coreLayers[D.BaseLayer],{height:a,width:o,margin:B}=n.bounds,c=e==="x"?"y":"x";return s.append("g").append("line").attr(`${e}1`,r).attr(`${e}2`,r).attr(`${c}1`,e==="x"?B.top:B.left).attr(`${c}2`,e==="x"?a-B.bottom:o-B.right).style("stroke",i).style("stroke-width",.5)},this.axisConfig=(e,r)=>{const{height:n,margin:i}=r.bounds,s=e==="x"?"y":"x",a=e==="x"?n-i.bottom:i.left;return{translation:{[e]:0,[s]:a},axisConstructor:e==="x"?nl:il}}}}const ps=A=>Math.floor(A*10)/10,Bn=(A,t)=>t+ps(A.x)+","+ps(A.y),ht=(A,t)=>{const{width:e,height:r,margin:n}=t.clipPathBounds,i={x:[n.left,e-n.right],y:[r-n.bottom,n.top]},s=[];let a="";const{x:o,y:B}=A[0];let c=i.x[0]<=o&&o<=i.x[1]&&i.y[1]<=B&&B<=i.y[0];for(let u=0;u<A.length;u++){const{x:l,y:f}=A[u],g=i.x[0]<=l&&l<=i.x[1]&&i.y[1]<=f&&f<=i.y[0];c?a+=Bn(A[u],a?"L":"M"):g&&(a&&s.push(a),a="",a+=Bn(A[u-1],"M"),a+=Bn(A[u],"L")),c=g}return a&&s.push(a),s},wt=(A,t)=>{const{x:e,y:r}=t.scaleConfig.numericalScales,{x:n,y:i}=t.scaleConfig.categoricalScales,{x:s,y:a}=A||{};return{x:s&&n?n.bands[s]:e,y:a&&i?i.bands[a]:r}},vs=A=>{const t={x:{start:1/0,end:-1/0},y:{start:1/0,end:-1/0}};for(let e=0;e<A.length;e++){const{x:r,y:n}=A[e];r<t.x.start&&(t.x.start=r),r>t.x.end&&(t.x.end=r),n<t.y.start&&(t.y.start=n),n>t.y.end&&(t.y.end=n)}return t},cn=(A,t,e,r)=>`M${A},${e}L${A},${r}L${t},${r}L${t},${e}Z`,nf=(A,t,e,r)=>A*r.x-t*r.y+e,ys=A=>{const t=Math.round(A.x),e=Math.round(A.y);return{x:t,y:e}},un=(A,t,e)=>{const r=A[t[0]],n=A[t[1]],i=n.y-r.y,s=n.x-r.x,a=n.x*r.y-n.y*r.x;let o=0,B=0;const c=Math.abs;for(let l=t[0];l<t[1];l++){const f=c(nf(i,s,a,A[l]));f>o&&(o=f,B=l)}if(o/Math.sqrt(i*i+s*s)>e){const l=[t[0],B],f=un(A,l,e),g=[B,t[1]],Q=un(A,g,e);return[...f.slice(0,-1),...Q]}else{const l=ys(A[t[0]]),f=ys(A[t[1]]);return[l,f]}},sf=(A,t)=>A.map(e=>{const r=[0,e.length-1];return un(e,r,t)});class af extends DA{constructor(t,e){super(),this.linesDC=t,this.options=e,this.type=D.Trace,this.traces=[],this.lowResLinesSC=[],this.getNewPoint=null,this.getNewPointInverse=null,this.customTween=(r,n)=>{const i=this.lowResLinesSC[r];return s=>{const a=i.map(({x:o,y:B})=>this.getNewPoint(o,B,s));return ht(a,n).join("")}},this.updateLowResLinesSC=r=>{const n=this.linesDC.map(i=>{const s=wt(i.bands,r);return i.points.map(a=>({x:s.x(a.x),y:s.y(a.y)}))});this.options.RDPEpsilon!==null?this.lowResLinesSC=sf(n,this.options.RDPEpsilon):this.lowResLinesSC=n},this.draw=(r,n)=>{this.updateLowResLinesSC(r),this.traces=this.linesDC.map((i,s)=>{const a=ht(this.lowResLinesSC[s],r).join("");return r.coreLayers[D.BaseLayer].append("path").attr("id",`${r.getHtmlId(D.Trace)}-${s}`).attr("pointer-events","none").attr("fill","none").attr("stroke",i.style.strokeColor||"black").attr("opacity",i.style.opacity||1).attr("stroke-width",i.style.strokeWidth||.5).attr("stroke-dasharray",i.style.strokeDasharray||"").attr("d",a)}),this.beforeZoom=i=>{const{x:s,y:a}=r.scaleConfig.numericalScales,o=i.x,B=i.y,c=[s(o[0]),s(o[1])],u=[a(B[0]),a(B[1])],l=s.domain(),f=a.domain(),g=[s(l[0]),s(l[1])],Q=[a(f[0]),a(f[1])],w=(g[1]-g[0])/(c[1]-c[0]),h=(Q[1]-Q[0])/(u[1]-u[0]),C=w*s(o[0])-s(l[0]),F=h*a(B[0])-a(f[0]),p=w-1,d=h-1;this.getNewPoint=(U,y,v)=>({x:U*(v*p+1)-v*C,y:y*(v*d+1)-v*F}),this.getNewPointInverse=(U,y,v)=>({x:(U+v*C)/(v*p+1),y:(y+v*F)/(v*d+1)})},this.zoom=async i=>{const s=[];for(let a=0;a<this.linesDC.length;a++){const o=this.traces[a].transition().duration(r.globals.animationDuration).attrTween("d",()=>this.customTween(a,r)).end();s.push(o)}await Promise.all(s),this.updateLowResLinesSC(r),this.traces.forEach((a,o)=>{a.attr("d",ht(this.lowResLinesSC[o],r).join(""))})}}}}class of extends DA{constructor(t){super(),this.options=t,this.type=D.Zoom,this.zooming=!1,this.selectionMask=null,this.overlay=null,this.processSelection=(e,r)=>{const{width:n,height:i,margin:s}=r.bounds,[[a,o],[B,c]]=e.selection,u=30,l=Math.abs(a-B),f=Math.abs(o-c);return this.options.lockAxis==="y"?[[a,s.top],[B,i-s.bottom]]:this.options.lockAxis==="x"?[[s.left,o],[n-s.right,c]]:l>u&&f<=u?[[a,s.top],[B,i-s.bottom]]:l<=u&&f>u?[[s.left,o],[n-s.right,c]]:[[a,o],[B,c]]},this.handleZoom=async(e,r)=>{if(this.zooming)return;this.zooming=!0;const{x:n,y:i}=r.scaleConfig.numericalScales;r.optionalLayers.forEach(a=>a.beforeZoom(e)),e.x&&n.domain(e.x),e.y&&i.domain(e.y);const s=[];r.optionalLayers.forEach(a=>s.push(a.zoom(e))),await Promise.all(s),r.optionalLayers.forEach(a=>a.afterZoom(e)),this.zooming=!1},this.handleBrushEnd=(e,r,n)=>{if(this.overlay.style("display","none"),this.selectionMask.attr("x",0).attr("y",0).attr("width",0).attr("height",0),!e.selection){n.optionalLayers.forEach(h=>h.afterZoom(null));return}r.call(e.target.move,null);const[[i,s],[a,o]]=this.processSelection(e,n),B=n.scaleConfig.numericalScales.x,c=B.invert(i),u=B.invert(a),l=n.scaleConfig.numericalScales.y,f=l.invert(o),g=l.invert(s),Q=10;if(Math.abs(i-a)<Q||Math.abs(s-o)<Q){n.optionalLayers.forEach(h=>h.afterZoom(null));return}const w={x:[c,u],y:[f,g],eventType:"brush"};this.handleZoom(w,n)},this.handleBrushMove=(e,r)=>{if(!e.selection)return;this.overlay.style("display","");const[[n,i],[s,a]]=this.processSelection(e,r);this.selectionMask.attr("x",Math.min(n,s)).attr("y",Math.min(i,a)).attr("width",Math.abs(n-s)).attr("height",Math.abs(i-a))},this.draw=e=>{const r=e.scaleConfig.categoricalScales;if(r.x&&r.y){console.warn("You have tried to use zoom with two categorical axes, but this is not supported.");return}Object.entries(r).forEach(([h,C])=>{C&&(this.options.lockAxis=h)});const{width:n,height:i,margin:s}=e.bounds,a=e.coreLayers[D.Svg],o=Ql().extent([[s.left,s.top],[n-s.right,i-s.bottom]]),B=e.coreLayers[D.BaseLayer].append("g").attr("id",`brush-${e.getHtmlId(D.Zoom)}`).style("opacity",0).call(o),c=`overlay-${e.getHtmlId(D.Zoom)}`;a.select("defs").append("svg:mask").attr("id",c).append("svg:rect").attr("width",n-s.right-s.left).attr("height",i-s.bottom-s.top).attr("x",s.left).attr("y",s.top).attr("fill","white").attr("fill-opacity",.15).style("mask-type","alpha");const u=`selection-${e.getHtmlId(D.Zoom)}`;this.selectionMask=a.select("defs").append("svg:mask").attr("id",u).append("svg:rect").attr("width",0).attr("height",0).attr("x",0).attr("y",0).attr("fill","white").style("mask-type","alpha"),this.overlay=a.append("svg:rect").attr("width",n-s.right-s.left).attr("height",i-s.bottom-s.top).attr("x",s.left).attr("y",s.top).style("display","none").style("mask-image",`url(#${c}), url(#${u})`).style("mask-composite","subtract"),o.on("start",()=>e.optionalLayers.forEach(h=>h.brushStart())),o.on("brush",h=>this.handleBrushMove(h,e)),o.on("end",h=>this.handleBrushEnd(h,B,e));const{x:l,y:f}=e.scaleConfig.scaleExtents,{x:g,y:Q}=e.scaleConfig.numericalScales,w={x:[l.start,l.end],y:[f.start,f.end],eventType:"dblclick"};this.options.lockAxis==="y"&&(w.y=Q.domain()),this.options.lockAxis==="x"&&(w.x=g.domain()),e.coreLayers[D.Svg].on("dblclick",()=>this.handleZoom(w,e))}}}class Bf extends DA{constructor(t){super(),this.tooltipHtmlCallback=t,this.type=D.Tooltip,this.tooltipRadiusSq=625,this.getDistanceSq=(e,r)=>{const n=e.x-r.x,i=e.y-r.y;return n*n+i*i},this.getDistanceSqSC=(e,r,n)=>{const i={x:e.x*n.x,y:e.y*n.y},s={x:r.x*n.x,y:r.y*n.y};return this.getDistanceSq(i,s)},this.convertSCPointToCC=(e,r)=>{const n=r.coreLayers[D.Svg].node().getScreenCTM(),{a:i,c:s,b:a,d:o}=n,{e:B,f:c}=n;return{x:i*e.x+s*e.y+B,y:a*e.x+o*e.y+c}},this.handleMouseMove=(e,r,n,i)=>{const s=mr(e),a={x:s[0],y:s[1]},o={...r.scaleConfig.numericalScales},B={x:void 0,y:void 0};Object.entries(r.scaleConfig.categoricalScales).forEach(([p,d])=>{if(d!=null&&d.bands){const[U,y]=Object.entries(d.bands).at(-1)||[],v=p,[m,L]=Object.entries(d.bands).find(([E,K])=>{const H=K.range();return a[v]>=Math.min(...H)&&a[v]<=Math.max(...H)})||[];m&&L?(o[v]=L,B[v]=m):y&&a[v]<y.range()[0]&&(o[v]=y||o[v],B[v]=U)}});const c={x:o.x.invert(a.x),y:o.y.invert(a.y)},[u,l]=[o.x,o.y].map(p=>Math.abs(p.domain()[0]-p.domain()[1])||1),[f,g]=[o.x,o.y].map(p=>Math.abs(p.range()[0]-p.range()[1])||1);let Q={x:u===0?1:f/u,y:l==0?1:g/l},w=1/0;const h=i.reduce((p,d)=>{var y,v;if(B.y!==((y=d.bands)==null?void 0:y.y)||B.x!==((v=d.bands)==null?void 0:v.x))return p;const U=this.getDistanceSqSC(c,d,Q);return U>=w?p:(w=U,d)},{x:0,y:0}),C={x:o.x(h.x),y:o.y(h.y)};if(this.getDistanceSq(a,C)>this.tooltipRadiusSq)n.style("opacity",0);else{const p=this.convertSCPointToCC(C,r);n.html(this.tooltipHtmlCallback(h)).style("left",`${p.x}px`).style("top",`${p.y}px`).style("opacity",1)}},this.draw=e=>{const r=e.optionalLayers.filter(c=>c.type===D.Trace),n=e.optionalLayers.filter(c=>c.type===D.Scatter);if(r.length===0&&n.length===0){console.warn("Tooltip Layer was added without a Traces Layer or a Scatter Layer.");return}const i=Fi("div").attr("id",`${e.getHtmlId(this.type)}`).style("position","fixed").style("pointer-events","none");let s=r.reduce((c,u)=>[...u.linesDC.flatMap(({points:f,metadata:g,bands:Q})=>f.map(w=>({...w,metadata:g,bands:Q}))),...c],[]);s=n.reduce((c,u)=>[...u.points,...c],s);const a=e.coreLayers[D.Svg];let o,B=!1;a.on("mousemove",c=>{var u;o===void 0&&!B&&((u=document.querySelectorAll(`*[id*="${this.type}"]`))==null||u.forEach(l=>l.innerHTML=""),this.handleMouseMove(c,e,i,s),o=setTimeout(()=>{o=void 0},25))}),this.brushStart=()=>{B=!0,i.html("")},this.afterZoom=()=>{B=!1},a.on("mouseleave",()=>i.remove()),a.on("mouseenter",()=>document.body.append(i.node()))}}}class cf extends DA{constructor(t){super(),this.directions=t,this.type=D.Grid,this.draw=e=>{const{width:r,height:n,margin:i}=e.bounds,{x:s,y:a}=e.scaleConfig.numericalScales,o=e.coreLayers[D.Svg],{animationDuration:B,tickConfig:c}=e.globals,{getHtmlId:u}=e,l=.15,f=.5,g={},Q=h=>{h.selectAll("line").data(s.ticks(c.x.count)).join("line").style("stroke","black").style("stroke-width",f).attr("pointer-events","none").attr("x1",C=>s(C)).attr("x2",C=>s(C)).attr("y1",i.top).attr("y2",n-i.bottom)},w=h=>{h.selectAll("line").data(a.ticks(c.y.count)).join("line").style("stroke","black").style("stroke-width",f).attr("pointer-events","none").attr("x1",i.left).attr("x2",r-i.right).attr("y1",C=>a(C)).attr("y2",C=>a(C))};this.directions.x&&(g.x=o.append("g").call(Q).attr("opacity",l).attr("id",`x-${u(this.type)}`)),this.directions.y&&(g.y=o.append("g").call(w).attr("opacity",l).attr("id",`y-${u(this.type)}`)),this.zoom=async()=>{var d,U,y,v;const h=(d=g.x)==null?void 0:d.selectAll("line").transition().duration(B/2).style("opacity",0).remove().end(),C=(U=g.y)==null?void 0:U.selectAll("line").transition().duration(B/2).style("opacity",0).remove().end();await Promise.all([h,C]);const F=(y=g.x)==null?void 0:y.call(Q).style("opacity",0).transition().duration(B/2).style("opacity",l).end(),p=(v=g.y)==null?void 0:v.call(w).style("opacity",0).transition().duration(B/2).style("opacity",l).end();await Promise.all([F,p])}}}}/*!
|
|
2
2
|
* html2canvas 1.4.1 <https://html2canvas.hertzen.com>
|
|
3
3
|
* Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
|
|
4
4
|
* Released under MIT License
|
|
@@ -19,4 +19,4 @@
|
|
|
19
19
|
content: "" !important;
|
|
20
20
|
display: none !important;
|
|
21
21
|
}`,$Q=function(A){zQ(A,"."+ri+WQ+wo+`
|
|
22
|
-
.`+ni+ZQ+wo)},zQ=function(A,t){var e=A.ownerDocument;if(e){var r=e.createElement("style");r.textContent=t,A.appendChild(r)}},Qo=(function(){function A(){}return A.getOrigin=function(t){var e=A._link;return e?(e.href=t,e.href=e.href,e.protocol+e.hostname+e.port):"about:blank"},A.isSameOrigin=function(t){return A.getOrigin(t)===A._origin},A.setContext=function(t){A._link=t.document.createElement("a"),A._origin=A.getOrigin(t.location.href)},A._origin="about:blank",A})(),qQ=(function(){function A(t,e){this.context=t,this._options=e,this._cache={}}return A.prototype.addImage=function(t){var e=Promise.resolve();return this.has(t)||(si(t)||eC(t))&&(this._cache[t]=this.loadImage(t)).catch(function(){}),e},A.prototype.match=function(t){return this._cache[t]},A.prototype.loadImage=function(t){return aA(this,void 0,void 0,function(){var e,r,n,i,s=this;return iA(this,function(a){switch(a.label){case 0:return e=Qo.isSameOrigin(t),r=!ii(t)&&this._options.useCORS===!0&&eA.SUPPORT_CORS_IMAGES&&!e,n=!ii(t)&&!e&&!si(t)&&typeof this._options.proxy=="string"&&eA.SUPPORT_CORS_XHR&&!r,!e&&this._options.allowTaint===!1&&!ii(t)&&!si(t)&&!n&&!r?[2]:(i=t,n?[4,this.proxy(i)]:[3,2]);case 1:i=a.sent(),a.label=2;case 2:return this.context.logger.debug("Added image "+t.substring(0,256)),[4,new Promise(function(o,B){var c=new Image;c.onload=function(){return o(c)},c.onerror=B,(rC(i)||r)&&(c.crossOrigin="anonymous"),c.src=i,c.complete===!0&&setTimeout(function(){return o(c)},500),s._options.imageTimeout>0&&setTimeout(function(){return B("Timed out ("+s._options.imageTimeout+"ms) loading image")},s._options.imageTimeout)})];case 3:return[2,a.sent()]}})})},A.prototype.has=function(t){return typeof this._cache[t]<"u"},A.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},A.prototype.proxy=function(t){var e=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var n=t.substring(0,256);return new Promise(function(i,s){var a=eA.SUPPORT_RESPONSE_TYPE?"blob":"text",o=new XMLHttpRequest;o.onload=function(){if(o.status===200)if(a==="text")i(o.response);else{var u=new FileReader;u.addEventListener("load",function(){return i(u.result)},!1),u.addEventListener("error",function(l){return s(l)},!1),u.readAsDataURL(o.response)}else s("Failed to proxy resource "+n+" with status code "+o.status)},o.onerror=s;var B=r.indexOf("?")>-1?"&":"?";if(o.open("GET",""+r+B+"url="+encodeURIComponent(t)+"&responseType="+a),a!=="text"&&o instanceof XMLHttpRequest&&(o.responseType=a),e._options.imageTimeout){var c=e._options.imageTimeout;o.timeout=c,o.ontimeout=function(){return s("Timed out ("+c+"ms) proxying "+n)}}o.send()})},A})(),jQ=/^data:image\/svg\+xml/i,AC=/^data:image\/.*;base64,/i,tC=/^data:image\/.*/i,eC=function(A){return eA.SUPPORT_SVG_DRAWING||!nC(A)},ii=function(A){return tC.test(A)},rC=function(A){return AC.test(A)},si=function(A){return A.substr(0,4)==="blob"},nC=function(A){return A.substr(-3).toLowerCase()==="svg"||jQ.test(A)},I=(function(){function A(t,e){this.type=0,this.x=t,this.y=e}return A.prototype.add=function(t,e){return new A(this.x+t,this.y+e)},A})(),mt=function(A,t,e){return new I(A.x+(t.x-A.x)*e,A.y+(t.y-A.y)*e)},wr=(function(){function A(t,e,r,n){this.type=1,this.start=t,this.startControl=e,this.endControl=r,this.end=n}return A.prototype.subdivide=function(t,e){var r=mt(this.start,this.startControl,t),n=mt(this.startControl,this.endControl,t),i=mt(this.endControl,this.end,t),s=mt(r,n,t),a=mt(n,i,t),o=mt(s,a,t);return e?new A(this.start,r,s,o):new A(o,a,i,this.end)},A.prototype.add=function(t,e){return new A(this.start.add(t,e),this.startControl.add(t,e),this.endControl.add(t,e),this.end.add(t,e))},A.prototype.reverse=function(){return new A(this.end,this.endControl,this.startControl,this.start)},A})(),wA=function(A){return A.type===1},iC=(function(){function A(t){var e=t.styles,r=t.bounds,n=zt(e.borderTopLeftRadius,r.width,r.height),i=n[0],s=n[1],a=zt(e.borderTopRightRadius,r.width,r.height),o=a[0],B=a[1],c=zt(e.borderBottomRightRadius,r.width,r.height),u=c[0],l=c[1],f=zt(e.borderBottomLeftRadius,r.width,r.height),g=f[0],Q=f[1],w=[];w.push((i+o)/r.width),w.push((g+u)/r.width),w.push((s+Q)/r.height),w.push((B+l)/r.height);var h=Math.max.apply(Math,w);h>1&&(i/=h,s/=h,o/=h,B/=h,u/=h,l/=h,g/=h,Q/=h);var C=r.width-o,F=r.height-l,p=r.width-u,d=r.height-Q,U=e.borderTopWidth,y=e.borderRightWidth,v=e.borderBottomWidth,m=e.borderLeftWidth,L=k(e.paddingTop,t.bounds.width),E=k(e.paddingRight,t.bounds.width),K=k(e.paddingBottom,t.bounds.width),H=k(e.paddingLeft,t.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||s>0?X(r.left+m/3,r.top+U/3,i-m/3,s-U/3,R.TOP_LEFT):new I(r.left+m/3,r.top+U/3),this.topRightBorderDoubleOuterBox=i>0||s>0?X(r.left+C,r.top+U/3,o-y/3,B-U/3,R.TOP_RIGHT):new I(r.left+r.width-y/3,r.top+U/3),this.bottomRightBorderDoubleOuterBox=u>0||l>0?X(r.left+p,r.top+F,u-y/3,l-v/3,R.BOTTOM_RIGHT):new I(r.left+r.width-y/3,r.top+r.height-v/3),this.bottomLeftBorderDoubleOuterBox=g>0||Q>0?X(r.left+m/3,r.top+d,g-m/3,Q-v/3,R.BOTTOM_LEFT):new I(r.left+m/3,r.top+r.height-v/3),this.topLeftBorderDoubleInnerBox=i>0||s>0?X(r.left+m*2/3,r.top+U*2/3,i-m*2/3,s-U*2/3,R.TOP_LEFT):new I(r.left+m*2/3,r.top+U*2/3),this.topRightBorderDoubleInnerBox=i>0||s>0?X(r.left+C,r.top+U*2/3,o-y*2/3,B-U*2/3,R.TOP_RIGHT):new I(r.left+r.width-y*2/3,r.top+U*2/3),this.bottomRightBorderDoubleInnerBox=u>0||l>0?X(r.left+p,r.top+F,u-y*2/3,l-v*2/3,R.BOTTOM_RIGHT):new I(r.left+r.width-y*2/3,r.top+r.height-v*2/3),this.bottomLeftBorderDoubleInnerBox=g>0||Q>0?X(r.left+m*2/3,r.top+d,g-m*2/3,Q-v*2/3,R.BOTTOM_LEFT):new I(r.left+m*2/3,r.top+r.height-v*2/3),this.topLeftBorderStroke=i>0||s>0?X(r.left+m/2,r.top+U/2,i-m/2,s-U/2,R.TOP_LEFT):new I(r.left+m/2,r.top+U/2),this.topRightBorderStroke=i>0||s>0?X(r.left+C,r.top+U/2,o-y/2,B-U/2,R.TOP_RIGHT):new I(r.left+r.width-y/2,r.top+U/2),this.bottomRightBorderStroke=u>0||l>0?X(r.left+p,r.top+F,u-y/2,l-v/2,R.BOTTOM_RIGHT):new I(r.left+r.width-y/2,r.top+r.height-v/2),this.bottomLeftBorderStroke=g>0||Q>0?X(r.left+m/2,r.top+d,g-m/2,Q-v/2,R.BOTTOM_LEFT):new I(r.left+m/2,r.top+r.height-v/2),this.topLeftBorderBox=i>0||s>0?X(r.left,r.top,i,s,R.TOP_LEFT):new I(r.left,r.top),this.topRightBorderBox=o>0||B>0?X(r.left+C,r.top,o,B,R.TOP_RIGHT):new I(r.left+r.width,r.top),this.bottomRightBorderBox=u>0||l>0?X(r.left+p,r.top+F,u,l,R.BOTTOM_RIGHT):new I(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=g>0||Q>0?X(r.left,r.top+d,g,Q,R.BOTTOM_LEFT):new I(r.left,r.top+r.height),this.topLeftPaddingBox=i>0||s>0?X(r.left+m,r.top+U,Math.max(0,i-m),Math.max(0,s-U),R.TOP_LEFT):new I(r.left+m,r.top+U),this.topRightPaddingBox=o>0||B>0?X(r.left+Math.min(C,r.width-y),r.top+U,C>r.width+y?0:Math.max(0,o-y),Math.max(0,B-U),R.TOP_RIGHT):new I(r.left+r.width-y,r.top+U),this.bottomRightPaddingBox=u>0||l>0?X(r.left+Math.min(p,r.width-m),r.top+Math.min(F,r.height-v),Math.max(0,u-y),Math.max(0,l-v),R.BOTTOM_RIGHT):new I(r.left+r.width-y,r.top+r.height-v),this.bottomLeftPaddingBox=g>0||Q>0?X(r.left+m,r.top+Math.min(d,r.height-v),Math.max(0,g-m),Math.max(0,Q-v),R.BOTTOM_LEFT):new I(r.left+m,r.top+r.height-v),this.topLeftContentBox=i>0||s>0?X(r.left+m+H,r.top+U+L,Math.max(0,i-(m+H)),Math.max(0,s-(U+L)),R.TOP_LEFT):new I(r.left+m+H,r.top+U+L),this.topRightContentBox=o>0||B>0?X(r.left+Math.min(C,r.width+m+H),r.top+U+L,C>r.width+m+H?0:o-m+H,B-(U+L),R.TOP_RIGHT):new I(r.left+r.width-(y+E),r.top+U+L),this.bottomRightContentBox=u>0||l>0?X(r.left+Math.min(p,r.width-(m+H)),r.top+Math.min(F,r.height+U+L),Math.max(0,u-(y+E)),l-(v+K),R.BOTTOM_RIGHT):new I(r.left+r.width-(y+E),r.top+r.height-(v+K)),this.bottomLeftContentBox=g>0||Q>0?X(r.left+m+H,r.top+d,Math.max(0,g-(m+H)),Q-(v+K),R.BOTTOM_LEFT):new I(r.left+m+H,r.top+r.height-(v+K))}return A})(),R;(function(A){A[A.TOP_LEFT=0]="TOP_LEFT",A[A.TOP_RIGHT=1]="TOP_RIGHT",A[A.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",A[A.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(R||(R={}));var X=function(A,t,e,r,n){var i=4*((Math.sqrt(2)-1)/3),s=e*i,a=r*i,o=A+e,B=t+r;switch(n){case R.TOP_LEFT:return new wr(new I(A,B),new I(A,B-a),new I(o-s,t),new I(o,t));case R.TOP_RIGHT:return new wr(new I(A,t),new I(A+s,t),new I(o,B-a),new I(o,B));case R.BOTTOM_RIGHT:return new wr(new I(o,t),new I(o,t+a),new I(A+s,B),new I(A,B));case R.BOTTOM_LEFT:default:return new wr(new I(o,B),new I(o-s,B),new I(A,t+a),new I(A,t))}},Qr=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},sC=function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]},Cr=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},aC=(function(){function A(t,e,r){this.offsetX=t,this.offsetY=e,this.matrix=r,this.type=0,this.target=6}return A})(),dr=(function(){function A(t,e){this.path=t,this.target=e,this.type=1}return A})(),oC=(function(){function A(t){this.opacity=t,this.type=2,this.target=6}return A})(),BC=function(A){return A.type===0},Co=function(A){return A.type===1},cC=function(A){return A.type===2},Uo=function(A,t){return A.length===t.length?A.some(function(e,r){return e===t[r]}):!1},uC=function(A,t,e,r,n){return A.map(function(i,s){switch(s){case 0:return i.add(t,e);case 1:return i.add(t+r,e);case 2:return i.add(t+r,e+n);case 3:return i.add(t,e+n)}return i})},Fo=(function(){function A(t){this.element=t,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return A})(),po=(function(){function A(t,e){if(this.container=t,this.parent=e,this.effects=[],this.curves=new iC(this.container),this.container.styles.opacity<1&&this.effects.push(new oC(this.container.styles.opacity)),this.container.styles.transform!==null){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new aC(r,n,i))}if(this.container.styles.overflowX!==0){var s=Qr(this.curves),a=Cr(this.curves);Uo(s,a)?this.effects.push(new dr(s,6)):(this.effects.push(new dr(s,2)),this.effects.push(new dr(a,4)))}}return A.prototype.getEffects=function(t){for(var e=[2,3].indexOf(this.container.styles.position)===-1,r=this.parent,n=this.effects.slice(0);r;){var i=r.effects.filter(function(o){return!Co(o)});if(e||r.container.styles.position!==0||!r.parent){if(n.unshift.apply(n,i),e=[2,3].indexOf(r.container.styles.position)===-1,r.container.styles.overflowX!==0){var s=Qr(r.curves),a=Cr(r.curves);Uo(s,a)||n.unshift(new dr(a,6))}}else n.unshift.apply(n,i);r=r.parent}return n.filter(function(o){return q(o.target,t)})},A})(),ai=function(A,t,e,r){A.container.elements.forEach(function(n){var i=q(n.flags,4),s=q(n.flags,2),a=new po(n,A);q(n.styles.display,2048)&&r.push(a);var o=q(n.flags,8)?[]:r;if(i||s){var B=i||n.styles.isPositioned()?e:t,c=new Fo(a);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var u=n.styles.zIndex.order;if(u<0){var l=0;B.negativeZIndex.some(function(g,Q){return u>g.element.container.styles.zIndex.order?(l=Q,!1):l>0}),B.negativeZIndex.splice(l,0,c)}else if(u>0){var f=0;B.positiveZIndex.some(function(g,Q){return u>=g.element.container.styles.zIndex.order?(f=Q+1,!1):f>0}),B.positiveZIndex.splice(f,0,c)}else B.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else n.styles.isFloating()?B.nonPositionedFloats.push(c):B.nonPositionedInlineLevel.push(c);ai(a,c,i?c:e,o)}else n.styles.isInlineLevel()?t.inlineLevel.push(a):t.nonInlineLevel.push(a),ai(a,t,e,o);q(n.flags,8)&&vo(n,o)})},vo=function(A,t){for(var e=A instanceof $n?A.start:1,r=A instanceof $n?A.reversed:!1,n=0;n<t.length;n++){var i=t[n];i.container instanceof Ya&&typeof i.container.value=="number"&&i.container.value!==0&&(e=i.container.value),i.listValue=re(e,i.container.styles.listStyleType,!0),e+=r?-1:1}},lC=function(A){var t=new po(A,null),e=new Fo(t),r=[];return ai(t,e,e,r),vo(t.container,r),e},yo=function(A,t){switch(t){case 0:return QA(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return QA(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return QA(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);case 3:default:return QA(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},fC=function(A,t){switch(t){case 0:return QA(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return QA(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return QA(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);case 3:default:return QA(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}},gC=function(A,t){switch(t){case 0:return QA(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return QA(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return QA(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);case 3:default:return QA(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}},hC=function(A,t){switch(t){case 0:return Ur(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return Ur(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return Ur(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);case 3:default:return Ur(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}},Ur=function(A,t){var e=[];return wA(A)?e.push(A.subdivide(.5,!1)):e.push(A),wA(t)?e.push(t.subdivide(.5,!0)):e.push(t),e},QA=function(A,t,e,r){var n=[];return wA(A)?n.push(A.subdivide(.5,!1)):n.push(A),wA(e)?n.push(e.subdivide(.5,!0)):n.push(e),wA(r)?n.push(r.subdivide(.5,!0).reverse()):n.push(r),wA(t)?n.push(t.subdivide(.5,!1).reverse()):n.push(t),n},Eo=function(A){var t=A.bounds,e=A.styles;return t.add(e.borderLeftWidth,e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth),-(e.borderTopWidth+e.borderBottomWidth))},Fr=function(A){var t=A.styles,e=A.bounds,r=k(t.paddingLeft,e.width),n=k(t.paddingRight,e.width),i=k(t.paddingTop,e.width),s=k(t.paddingBottom,e.width);return e.add(r+t.borderLeftWidth,i+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+r+n),-(t.borderTopWidth+t.borderBottomWidth+i+s))},wC=function(A,t){return A===0?t.bounds:A===2?Fr(t):Eo(t)},QC=function(A,t){return A===0?t.bounds:A===2?Fr(t):Eo(t)},oi=function(A,t,e){var r=wC(It(A.styles.backgroundOrigin,t),A),n=QC(It(A.styles.backgroundClip,t),A),i=CC(It(A.styles.backgroundSize,t),e,r),s=i[0],a=i[1],o=zt(It(A.styles.backgroundPosition,t),r.width-s,r.height-a),B=dC(It(A.styles.backgroundRepeat,t),o,i,r,n),c=Math.round(r.left+o[0]),u=Math.round(r.top+o[1]);return[B,c,u,s,a]},Ht=function(A){return N(A)&&A.value===pt.AUTO},pr=function(A){return typeof A=="number"},CC=function(A,t,e){var r=t[0],n=t[1],i=t[2],s=A[0],a=A[1];if(!s)return[0,0];if($(s)&&a&&$(a))return[k(s,e.width),k(a,e.height)];var o=pr(i);if(N(s)&&(s.value===pt.CONTAIN||s.value===pt.COVER)){if(pr(i)){var B=e.width/e.height;return B<i!=(s.value===pt.COVER)?[e.width,e.width/i]:[e.height*i,e.height]}return[e.width,e.height]}var c=pr(r),u=pr(n),l=c||u;if(Ht(s)&&(!a||Ht(a))){if(c&&u)return[r,n];if(!o&&!l)return[e.width,e.height];if(l&&o){var f=c?r:n*i,g=u?n:r/i;return[f,g]}var Q=c?r:e.width,w=u?n:e.height;return[Q,w]}if(o){var h=0,C=0;return $(s)?h=k(s,e.width):$(a)&&(C=k(a,e.height)),Ht(s)?h=C*i:(!a||Ht(a))&&(C=h/i),[h,C]}var F=null,p=null;if($(s)?F=k(s,e.width):a&&$(a)&&(p=k(a,e.height)),F!==null&&(!a||Ht(a))&&(p=c&&u?F/r*n:e.height),p!==null&&Ht(s)&&(F=c&&u?p/n*r:e.width),F!==null&&p!==null)return[F,p];throw new Error("Unable to calculate background-size for element")},It=function(A,t){var e=A[t];return typeof e>"u"?A[0]:e},dC=function(A,t,e,r,n){var i=t[0],s=t[1],a=e[0],o=e[1];switch(A){case 2:return[new I(Math.round(r.left),Math.round(r.top+s)),new I(Math.round(r.left+r.width),Math.round(r.top+s)),new I(Math.round(r.left+r.width),Math.round(o+r.top+s)),new I(Math.round(r.left),Math.round(o+r.top+s))];case 3:return[new I(Math.round(r.left+i),Math.round(r.top)),new I(Math.round(r.left+i+a),Math.round(r.top)),new I(Math.round(r.left+i+a),Math.round(r.height+r.top)),new I(Math.round(r.left+i),Math.round(r.height+r.top))];case 1:return[new I(Math.round(r.left+i),Math.round(r.top+s)),new I(Math.round(r.left+i+a),Math.round(r.top+s)),new I(Math.round(r.left+i+a),Math.round(r.top+s+o)),new I(Math.round(r.left+i),Math.round(r.top+s+o))];default:return[new I(Math.round(n.left),Math.round(n.top)),new I(Math.round(n.left+n.width),Math.round(n.top)),new I(Math.round(n.left+n.width),Math.round(n.height+n.top)),new I(Math.round(n.left),Math.round(n.height+n.top))]}},UC="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",mo="Hidden Text",FC=(function(){function A(t){this._data={},this._document=t}return A.prototype.parseMetrics=function(t,e){var r=this._document.createElement("div"),n=this._document.createElement("img"),i=this._document.createElement("span"),s=this._document.body;r.style.visibility="hidden",r.style.fontFamily=t,r.style.fontSize=e,r.style.margin="0",r.style.padding="0",r.style.whiteSpace="nowrap",s.appendChild(r),n.src=UC,n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",i.style.fontFamily=t,i.style.fontSize=e,i.style.margin="0",i.style.padding="0",i.appendChild(this._document.createTextNode(mo)),r.appendChild(i),r.appendChild(n);var a=n.offsetTop-i.offsetTop+2;r.removeChild(i),r.appendChild(this._document.createTextNode(mo)),r.style.lineHeight="normal",n.style.verticalAlign="super";var o=n.offsetTop-r.offsetTop+2;return s.removeChild(r),{baseline:a,middle:o}},A.prototype.getMetrics=function(t,e){var r=t+" "+e;return typeof this._data[r]>"u"&&(this._data[r]=this.parseMetrics(t,e)),this._data[r]},A})(),Ho=(function(){function A(t,e){this.context=t,this.options=e}return A})(),pC=1e4,vC=(function(A){pA(t,A);function t(e,r){var n=A.call(this,e,r)||this;return n._activeEffects=[],n.canvas=r.canvas?r.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),r.canvas||(n.canvas.width=Math.floor(r.width*r.scale),n.canvas.height=Math.floor(r.height*r.scale),n.canvas.style.width=r.width+"px",n.canvas.style.height=r.height+"px"),n.fontMetrics=new FC(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-r.x,-r.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+r.width+"x"+r.height+") with scale "+r.scale),n}return t.prototype.applyEffects=function(e){for(var r=this;this._activeEffects.length;)this.popEffect();e.forEach(function(n){return r.applyEffect(n)})},t.prototype.applyEffect=function(e){this.ctx.save(),cC(e)&&(this.ctx.globalAlpha=e.opacity),BC(e)&&(this.ctx.translate(e.offsetX,e.offsetY),this.ctx.transform(e.matrix[0],e.matrix[1],e.matrix[2],e.matrix[3],e.matrix[4],e.matrix[5]),this.ctx.translate(-e.offsetX,-e.offsetY)),Co(e)&&(this.path(e.path),this.ctx.clip()),this._activeEffects.push(e)},t.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},t.prototype.renderStack=function(e){return aA(this,void 0,void 0,function(){var r;return iA(this,function(n){switch(n.label){case 0:return r=e.element.container.styles,r.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},t.prototype.renderNode=function(e){return aA(this,void 0,void 0,function(){return iA(this,function(r){switch(r.label){case 0:if(q(e.container.flags,16))debugger;return e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return r.sent(),[4,this.renderNodeContent(e)];case 2:r.sent(),r.label=3;case 3:return[2]}})})},t.prototype.renderTextWithLetterSpacing=function(e,r,n){var i=this;if(r===0)this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+n);else{var s=Zn(e.text);s.reduce(function(a,o){return i.ctx.fillText(o,a,e.bounds.top+n),a+i.ctx.measureText(o).width},e.bounds.left)}},t.prototype.createFontStyle=function(e){var r=e.fontVariant.filter(function(s){return s==="normal"||s==="small-caps"}).join(""),n=IC(e.fontFamily).join(", "),i=$t(e.fontSize)?""+e.fontSize.number+e.fontSize.unit:e.fontSize.number+"px";return[[e.fontStyle,r,e.fontWeight,i,n].join(" "),n,i]},t.prototype.renderTextNode=function(e,r){return aA(this,void 0,void 0,function(){var n,i,s,a,o,B,c,u,l=this;return iA(this,function(f){return n=this.createFontStyle(r),i=n[0],s=n[1],a=n[2],this.ctx.font=i,this.ctx.direction=r.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",o=this.fontMetrics.getMetrics(s,a),B=o.baseline,c=o.middle,u=r.paintOrder,e.textBounds.forEach(function(g){u.forEach(function(Q){switch(Q){case 0:l.ctx.fillStyle=AA(r.color),l.renderTextWithLetterSpacing(g,r.letterSpacing,B);var w=r.textShadow;w.length&&g.text.trim().length&&(w.slice(0).reverse().forEach(function(h){l.ctx.shadowColor=AA(h.color),l.ctx.shadowOffsetX=h.offsetX.number*l.options.scale,l.ctx.shadowOffsetY=h.offsetY.number*l.options.scale,l.ctx.shadowBlur=h.blur.number,l.renderTextWithLetterSpacing(g,r.letterSpacing,B)}),l.ctx.shadowColor="",l.ctx.shadowOffsetX=0,l.ctx.shadowOffsetY=0,l.ctx.shadowBlur=0),r.textDecorationLine.length&&(l.ctx.fillStyle=AA(r.textDecorationColor||r.color),r.textDecorationLine.forEach(function(h){switch(h){case 1:l.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top+B),g.bounds.width,1);break;case 2:l.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top),g.bounds.width,1);break;case 3:l.ctx.fillRect(g.bounds.left,Math.ceil(g.bounds.top+c),g.bounds.width,1);break}}));break;case 1:r.webkitTextStrokeWidth&&g.text.trim().length&&(l.ctx.strokeStyle=AA(r.webkitTextStrokeColor),l.ctx.lineWidth=r.webkitTextStrokeWidth,l.ctx.lineJoin=window.chrome?"miter":"round",l.ctx.strokeText(g.text,g.bounds.left,g.bounds.top+B)),l.ctx.strokeStyle="",l.ctx.lineWidth=0,l.ctx.lineJoin="miter";break}})}),[2]})})},t.prototype.renderReplacedElement=function(e,r,n){if(n&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var i=Fr(e),s=Cr(r);this.path(s),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,e.intrinsicWidth,e.intrinsicHeight,i.left,i.top,i.width,i.height),this.ctx.restore()}},t.prototype.renderNodeContent=function(e){return aA(this,void 0,void 0,function(){var r,n,i,s,a,o,C,C,B,c,u,l,p,f,g,d,Q,w,h,C,F,p,d;return iA(this,function(U){switch(U.label){case 0:this.applyEffects(e.getEffects(4)),r=e.container,n=e.curves,i=r.styles,s=0,a=r.textNodes,U.label=1;case 1:return s<a.length?(o=a[s],[4,this.renderTextNode(o,i)]):[3,4];case 2:U.sent(),U.label=3;case 3:return s++,[3,1];case 4:if(!(r instanceof Pa))return[3,8];U.label=5;case 5:return U.trys.push([5,7,,8]),[4,this.context.cache.match(r.src)];case 6:return C=U.sent(),this.renderReplacedElement(r,n,C),[3,8];case 7:return U.sent(),this.context.logger.error("Error loading image "+r.src),[3,8];case 8:if(r instanceof Xa&&this.renderReplacedElement(r,n,r.canvas),!(r instanceof Ja))return[3,12];U.label=9;case 9:return U.trys.push([9,11,,12]),[4,this.context.cache.match(r.svg)];case 10:return C=U.sent(),this.renderReplacedElement(r,n,C),[3,12];case 11:return U.sent(),this.context.logger.error("Error loading svg "+r.svg.substring(0,255)),[3,12];case 12:return r instanceof za&&r.tree?(B=new t(this.context,{scale:this.options.scale,backgroundColor:r.backgroundColor,x:0,y:0,width:r.width,height:r.height}),[4,B.render(r.tree)]):[3,14];case 13:c=U.sent(),r.width&&r.height&&this.ctx.drawImage(c,0,0,r.width,r.height,r.bounds.left,r.bounds.top,r.bounds.width,r.bounds.height),U.label=14;case 14:if(r instanceof zn&&(u=Math.min(r.bounds.width,r.bounds.height),r.type===cr?r.checked&&(this.ctx.save(),this.path([new I(r.bounds.left+u*.39363,r.bounds.top+u*.79),new I(r.bounds.left+u*.16,r.bounds.top+u*.5549),new I(r.bounds.left+u*.27347,r.bounds.top+u*.44071),new I(r.bounds.left+u*.39694,r.bounds.top+u*.5649),new I(r.bounds.left+u*.72983,r.bounds.top+u*.23),new I(r.bounds.left+u*.84,r.bounds.top+u*.34085),new I(r.bounds.left+u*.39363,r.bounds.top+u*.79)]),this.ctx.fillStyle=AA(Wa),this.ctx.fill(),this.ctx.restore()):r.type===ur&&r.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(r.bounds.left+u/2,r.bounds.top+u/2,u/4,0,Math.PI*2,!0),this.ctx.fillStyle=AA(Wa),this.ctx.fill(),this.ctx.restore())),yC(r)&&r.value.length){switch(l=this.createFontStyle(i),p=l[0],f=l[1],g=this.fontMetrics.getMetrics(p,f).baseline,this.ctx.font=p,this.ctx.fillStyle=AA(i.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=mC(r.styles.textAlign),d=Fr(r),Q=0,r.styles.textAlign){case 1:Q+=d.width/2;break;case 2:Q+=d.width;break}w=d.add(Q,0,0,-d.height/2+1),this.ctx.save(),this.path([new I(d.left,d.top),new I(d.left+d.width,d.top),new I(d.left+d.width,d.top+d.height),new I(d.left,d.top+d.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new te(r.value,w),i.letterSpacing,g),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!q(r.styles.display,2048))return[3,20];if(r.styles.listStyleImage===null)return[3,19];if(h=r.styles.listStyleImage,h.type!==0)return[3,18];C=void 0,F=h.url,U.label=15;case 15:return U.trys.push([15,17,,18]),[4,this.context.cache.match(F)];case 16:return C=U.sent(),this.ctx.drawImage(C,r.bounds.left-(C.width+10),r.bounds.top),[3,18];case 17:return U.sent(),this.context.logger.error("Error loading list-style-image "+F),[3,18];case 18:return[3,20];case 19:e.listValue&&r.styles.listStyleType!==-1&&(p=this.createFontStyle(i)[0],this.ctx.font=p,this.ctx.fillStyle=AA(i.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",d=new TA(r.bounds.left,r.bounds.top+k(r.styles.paddingTop,r.bounds.width),r.bounds.width,Ea(i.lineHeight,i.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new te(e.listValue,d),i.letterSpacing,Ea(i.lineHeight,i.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),U.label=20;case 20:return[2]}})})},t.prototype.renderStackContent=function(e){return aA(this,void 0,void 0,function(){var r,n,h,i,s,h,a,o,h,B,c,h,u,l,h,f,g,h,Q,w,h;return iA(this,function(C){switch(C.label){case 0:if(q(e.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(e.element)];case 1:C.sent(),r=0,n=e.negativeZIndex,C.label=2;case 2:return r<n.length?(h=n[r],[4,this.renderStack(h)]):[3,5];case 3:C.sent(),C.label=4;case 4:return r++,[3,2];case 5:return[4,this.renderNodeContent(e.element)];case 6:C.sent(),i=0,s=e.nonInlineLevel,C.label=7;case 7:return i<s.length?(h=s[i],[4,this.renderNode(h)]):[3,10];case 8:C.sent(),C.label=9;case 9:return i++,[3,7];case 10:a=0,o=e.nonPositionedFloats,C.label=11;case 11:return a<o.length?(h=o[a],[4,this.renderStack(h)]):[3,14];case 12:C.sent(),C.label=13;case 13:return a++,[3,11];case 14:B=0,c=e.nonPositionedInlineLevel,C.label=15;case 15:return B<c.length?(h=c[B],[4,this.renderStack(h)]):[3,18];case 16:C.sent(),C.label=17;case 17:return B++,[3,15];case 18:u=0,l=e.inlineLevel,C.label=19;case 19:return u<l.length?(h=l[u],[4,this.renderNode(h)]):[3,22];case 20:C.sent(),C.label=21;case 21:return u++,[3,19];case 22:f=0,g=e.zeroOrAutoZIndexOrTransformedOrOpacity,C.label=23;case 23:return f<g.length?(h=g[f],[4,this.renderStack(h)]):[3,26];case 24:C.sent(),C.label=25;case 25:return f++,[3,23];case 26:Q=0,w=e.positiveZIndex,C.label=27;case 27:return Q<w.length?(h=w[Q],[4,this.renderStack(h)]):[3,30];case 28:C.sent(),C.label=29;case 29:return Q++,[3,27];case 30:return[2]}})})},t.prototype.mask=function(e){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()},t.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},t.prototype.formatPath=function(e){var r=this;e.forEach(function(n,i){var s=wA(n)?n.start:n;i===0?r.ctx.moveTo(s.x,s.y):r.ctx.lineTo(s.x,s.y),wA(n)&&r.ctx.bezierCurveTo(n.startControl.x,n.startControl.y,n.endControl.x,n.endControl.y,n.end.x,n.end.y)})},t.prototype.renderRepeat=function(e,r,n,i){this.path(e),this.ctx.fillStyle=r,this.ctx.translate(n,i),this.ctx.fill(),this.ctx.translate(-n,-i)},t.prototype.resizeImage=function(e,r,n){var i;if(e.width===r&&e.height===n)return e;var s=(i=this.canvas.ownerDocument)!==null&&i!==void 0?i:document,a=s.createElement("canvas");a.width=Math.max(1,r),a.height=Math.max(1,n);var o=a.getContext("2d");return o.drawImage(e,0,0,e.width,e.height,0,0,r,n),a},t.prototype.renderBackgroundImage=function(e){return aA(this,void 0,void 0,function(){var r,n,i,s,a,o;return iA(this,function(B){switch(B.label){case 0:r=e.styles.backgroundImage.length-1,n=function(c){var u,l,f,L,M,_,H,S,v,g,L,M,_,H,S,Q,w,h,C,F,p,d,U,y,v,m,L,E,K,H,S,Y,M,_,J,b,P,G,V,fA,CA,cA;return iA(this,function(yA){switch(yA.label){case 0:if(c.type!==0)return[3,5];u=void 0,l=c.url,yA.label=1;case 1:return yA.trys.push([1,3,,4]),[4,i.context.cache.match(l)];case 2:return u=yA.sent(),[3,4];case 3:return yA.sent(),i.context.logger.error("Error loading background-image "+l),[3,4];case 4:return u&&(f=oi(e,r,[u.width,u.height,u.width/u.height]),L=f[0],M=f[1],_=f[2],H=f[3],S=f[4],v=i.ctx.createPattern(i.resizeImage(u,H,S),"repeat"),i.renderRepeat(L,v,M,_)),[3,6];case 5:Bh(c)?(g=oi(e,r,[null,null,null]),L=g[0],M=g[1],_=g[2],H=g[3],S=g[4],Q=nh(c.angle,H,S),w=Q[0],h=Q[1],C=Q[2],F=Q[3],p=Q[4],d=document.createElement("canvas"),d.width=H,d.height=S,U=d.getContext("2d"),y=U.createLinearGradient(h,F,C,p),ga(c.stops,w).forEach(function(z){return y.addColorStop(z.stop,AA(z.color))}),U.fillStyle=y,U.fillRect(0,0,H,S),H>0&&S>0&&(v=i.ctx.createPattern(d,"repeat"),i.renderRepeat(L,v,M,_))):ch(c)&&(m=oi(e,r,[null,null,null]),L=m[0],E=m[1],K=m[2],H=m[3],S=m[4],Y=c.position.length===0?[Dn]:c.position,M=k(Y[0],H),_=k(Y[Y.length-1],S),J=ih(c,M,_,H,S),b=J[0],P=J[1],b>0&&P>0&&(G=i.ctx.createRadialGradient(E+M,K+_,0,E+M,K+_,b),ga(c.stops,b*2).forEach(function(z){return G.addColorStop(z.stop,AA(z.color))}),i.path(L),i.ctx.fillStyle=G,b!==P?(V=e.bounds.left+.5*e.bounds.width,fA=e.bounds.top+.5*e.bounds.height,CA=P/b,cA=1/CA,i.ctx.save(),i.ctx.translate(V,fA),i.ctx.transform(1,0,0,CA,0,0),i.ctx.translate(-V,-fA),i.ctx.fillRect(E,cA*(K-fA)+fA,H,S*cA),i.ctx.restore()):i.ctx.fill())),yA.label=6;case 6:return r--,[2]}})},i=this,s=0,a=e.styles.backgroundImage.slice(0).reverse(),B.label=1;case 1:return s<a.length?(o=a[s],[5,n(o)]):[3,4];case 2:B.sent(),B.label=3;case 3:return s++,[3,1];case 4:return[2]}})})},t.prototype.renderSolidBorder=function(e,r,n){return aA(this,void 0,void 0,function(){return iA(this,function(i){return this.path(yo(n,r)),this.ctx.fillStyle=AA(e),this.ctx.fill(),[2]})})},t.prototype.renderDoubleBorder=function(e,r,n,i){return aA(this,void 0,void 0,function(){var s,a;return iA(this,function(o){switch(o.label){case 0:return r<3?[4,this.renderSolidBorder(e,n,i)]:[3,2];case 1:return o.sent(),[2];case 2:return s=fC(i,n),this.path(s),this.ctx.fillStyle=AA(e),this.ctx.fill(),a=gC(i,n),this.path(a),this.ctx.fill(),[2]}})})},t.prototype.renderNodeBackgroundAndBorders=function(e){return aA(this,void 0,void 0,function(){var r,n,i,s,a,o,B,c,u=this;return iA(this,function(l){switch(l.label){case 0:return this.applyEffects(e.getEffects(2)),r=e.container.styles,n=!XA(r.backgroundColor)||r.backgroundImage.length,i=[{style:r.borderTopStyle,color:r.borderTopColor,width:r.borderTopWidth},{style:r.borderRightStyle,color:r.borderRightColor,width:r.borderRightWidth},{style:r.borderBottomStyle,color:r.borderBottomColor,width:r.borderBottomWidth},{style:r.borderLeftStyle,color:r.borderLeftColor,width:r.borderLeftWidth}],s=EC(It(r.backgroundClip,0),e.curves),n||r.boxShadow.length?(this.ctx.save(),this.path(s),this.ctx.clip(),XA(r.backgroundColor)||(this.ctx.fillStyle=AA(r.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:l.sent(),this.ctx.restore(),r.boxShadow.slice(0).reverse().forEach(function(f){u.ctx.save();var g=Qr(e.curves),Q=f.inset?0:pC,w=uC(g,-Q+(f.inset?1:-1)*f.spread.number,(f.inset?1:-1)*f.spread.number,f.spread.number*(f.inset?-2:2),f.spread.number*(f.inset?-2:2));f.inset?(u.path(g),u.ctx.clip(),u.mask(w)):(u.mask(g),u.ctx.clip(),u.path(w)),u.ctx.shadowOffsetX=f.offsetX.number+Q,u.ctx.shadowOffsetY=f.offsetY.number,u.ctx.shadowColor=AA(f.color),u.ctx.shadowBlur=f.blur.number,u.ctx.fillStyle=f.inset?AA(f.color):"rgba(0,0,0,1)",u.ctx.fill(),u.ctx.restore()}),l.label=2;case 2:a=0,o=0,B=i,l.label=3;case 3:return o<B.length?(c=B[o],c.style!==0&&!XA(c.color)&&c.width>0?c.style!==2?[3,5]:[4,this.renderDashedDottedBorder(c.color,c.width,a,e.curves,2)]:[3,11]):[3,13];case 4:return l.sent(),[3,11];case 5:return c.style!==3?[3,7]:[4,this.renderDashedDottedBorder(c.color,c.width,a,e.curves,3)];case 6:return l.sent(),[3,11];case 7:return c.style!==4?[3,9]:[4,this.renderDoubleBorder(c.color,c.width,a,e.curves)];case 8:return l.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,a,e.curves)];case 10:l.sent(),l.label=11;case 11:a++,l.label=12;case 12:return o++,[3,3];case 13:return[2]}})})},t.prototype.renderDashedDottedBorder=function(e,r,n,i,s){return aA(this,void 0,void 0,function(){var a,o,B,c,u,l,f,g,Q,w,h,C,F,p,d,U,d,U;return iA(this,function(y){return this.ctx.save(),a=hC(i,n),o=yo(i,n),s===2&&(this.path(o),this.ctx.clip()),wA(o[0])?(B=o[0].start.x,c=o[0].start.y):(B=o[0].x,c=o[0].y),wA(o[1])?(u=o[1].end.x,l=o[1].end.y):(u=o[1].x,l=o[1].y),n===0||n===2?f=Math.abs(B-u):f=Math.abs(c-l),this.ctx.beginPath(),s===3?this.formatPath(a):this.formatPath(o.slice(0,2)),g=r<3?r*3:r*2,Q=r<3?r*2:r,s===3&&(g=r,Q=r),w=!0,f<=g*2?w=!1:f<=g*2+Q?(h=f/(2*g+Q),g*=h,Q*=h):(C=Math.floor((f+Q)/(g+Q)),F=(f-C*g)/(C-1),p=(f-(C+1)*g)/C,Q=p<=0||Math.abs(Q-F)<Math.abs(Q-p)?F:p),w&&(s===3?this.ctx.setLineDash([0,g+Q]):this.ctx.setLineDash([g,Q])),s===3?(this.ctx.lineCap="round",this.ctx.lineWidth=r):this.ctx.lineWidth=r*2+1.1,this.ctx.strokeStyle=AA(e),this.ctx.stroke(),this.ctx.setLineDash([]),s===2&&(wA(o[0])&&(d=o[3],U=o[0],this.ctx.beginPath(),this.formatPath([new I(d.end.x,d.end.y),new I(U.start.x,U.start.y)]),this.ctx.stroke()),wA(o[1])&&(d=o[1],U=o[2],this.ctx.beginPath(),this.formatPath([new I(d.end.x,d.end.y),new I(U.start.x,U.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},t.prototype.render=function(e){return aA(this,void 0,void 0,function(){var r;return iA(this,function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=AA(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),r=lC(e),[4,this.renderStack(r)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}})})},t})(Ho),yC=function(A){return A instanceof $a||A instanceof Za?!0:A instanceof zn&&A.type!==ur&&A.type!==cr},EC=function(A,t){switch(A){case 0:return Qr(t);case 2:return sC(t);case 1:default:return Cr(t)}},mC=function(A){switch(A){case 1:return"center";case 2:return"right";case 0:default:return"left"}},HC=["-apple-system","system-ui"],IC=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter(function(t){return HC.indexOf(t)===-1}):A},xC=(function(A){pA(t,A);function t(e,r){var n=A.call(this,e,r)||this;return n.canvas=r.canvas?r.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=r,n.canvas.width=Math.floor(r.width*r.scale),n.canvas.height=Math.floor(r.height*r.scale),n.canvas.style.width=r.width+"px",n.canvas.style.height=r.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-r.x,-r.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+r.width+"x"+r.height+" at "+r.x+","+r.y+") with scale "+r.scale),n}return t.prototype.render=function(e){return aA(this,void 0,void 0,function(){var r,n;return iA(this,function(i){switch(i.label){case 0:return r=Wn(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,LC(r)];case 1:return n=i.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=AA(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},t})(Ho),LC=function(A){return new Promise(function(t,e){var r=new Image;r.onload=function(){t(r)},r.onerror=e,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(A))})},bC=(function(){function A(t){var e=t.id,r=t.enabled;this.id=e,this.enabled=r,this.start=Date.now()}return A.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,Le([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},A.prototype.getTime=function(){return Date.now()-this.start},A.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,Le([this.id,this.getTime()+"ms"],t))},A.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,Le([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},A.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,Le([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},A.instances={},A})(),KC=(function(){function A(t,e){var r;this.windowBounds=e,this.instanceName="#"+A.instanceCount++,this.logger=new bC({id:this.instanceName,enabled:t.logging}),this.cache=(r=t.cache)!==null&&r!==void 0?r:new qQ(this,t)}return A.instanceCount=1,A})(),SC=function(A,t){return t===void 0&&(t={}),DC(A,t)};typeof window<"u"&&Qo.setContext(window);var DC=function(A,t){return aA(void 0,void 0,void 0,function(){var e,r,n,i,s,a,o,B,c,u,l,f,g,Q,w,h,C,F,p,d,y,U,y,v,m,L,E,K,H,S,Y,M,_,J,b,P,G,V,fA,CA;return iA(this,function(cA){switch(cA.label){case 0:if(!A||typeof A!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(e=A.ownerDocument,!e)throw new Error("Element is not attached to a Document");if(r=e.defaultView,!r)throw new Error("Document is not attached to a Window");return n={allowTaint:(v=t.allowTaint)!==null&&v!==void 0?v:!1,imageTimeout:(m=t.imageTimeout)!==null&&m!==void 0?m:15e3,proxy:t.proxy,useCORS:(L=t.useCORS)!==null&&L!==void 0?L:!1},i=fn({logging:(E=t.logging)!==null&&E!==void 0?E:!0,cache:t.cache},n),s={windowWidth:(K=t.windowWidth)!==null&&K!==void 0?K:r.innerWidth,windowHeight:(H=t.windowHeight)!==null&&H!==void 0?H:r.innerHeight,scrollX:(S=t.scrollX)!==null&&S!==void 0?S:r.pageXOffset,scrollY:(Y=t.scrollY)!==null&&Y!==void 0?Y:r.pageYOffset},a=new TA(s.scrollX,s.scrollY,s.windowWidth,s.windowHeight),o=new KC(i,a),B=(M=t.foreignObjectRendering)!==null&&M!==void 0?M:!1,c={allowTaint:(_=t.allowTaint)!==null&&_!==void 0?_:!1,onclone:t.onclone,ignoreElements:t.ignoreElements,inlineImages:B,copyStyles:B},o.logger.debug("Starting document clone with size "+a.width+"x"+a.height+" scrolled to "+-a.left+","+-a.top),u=new ho(o,A,c),l=u.clonedReferenceElement,l?[4,u.toIFrame(e,a)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return f=cA.sent(),g=jn(l)||TQ(l)?uf(l.ownerDocument):be(o,l),Q=g.width,w=g.height,h=g.left,C=g.top,F=TC(o,l,t.backgroundColor),p={canvas:t.canvas,backgroundColor:F,scale:(b=(J=t.scale)!==null&&J!==void 0?J:r.devicePixelRatio)!==null&&b!==void 0?b:1,x:((P=t.x)!==null&&P!==void 0?P:0)+h,y:((G=t.y)!==null&&G!==void 0?G:0)+C,width:(V=t.width)!==null&&V!==void 0?V:Math.ceil(Q),height:(fA=t.height)!==null&&fA!==void 0?fA:Math.ceil(w)},B?(o.logger.debug("Document cloned, using foreign object rendering"),y=new xC(o,p),[4,y.render(l)]):[3,3];case 2:return d=cA.sent(),[3,5];case 3:return o.logger.debug("Document cloned, element located at "+h+","+C+" with size "+Q+"x"+w+" using computed rendering"),o.logger.debug("Starting DOM parsing"),U=ja(o,l),F===U.styles.backgroundColor&&(U.styles.backgroundColor=_A.TRANSPARENT),o.logger.debug("Starting renderer for element at "+p.x+","+p.y+" with size "+p.width+"x"+p.height),y=new vC(o,p),[4,y.render(U)];case 4:d=cA.sent(),cA.label=5;case 5:return(!((CA=t.removeContainer)!==null&&CA!==void 0)||CA)&&(ho.destroy(f)||o.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),o.logger.debug("Finished rendering"),[2,d]}})})},TC=function(A,t,e){var r=t.ownerDocument,n=r.documentElement?qt(A,getComputedStyle(r.documentElement).backgroundColor):_A.TRANSPARENT,i=r.body?qt(A,getComputedStyle(r.body).backgroundColor):_A.TRANSPARENT,s=typeof e=="string"?qt(A,e):e===null?_A.TRANSPARENT:4294967295;return t===r.documentElement?XA(n)?XA(i)?s:i:n:s};class MC extends DA{constructor(t){super(),this.points=t,this.type=D.Scatter,this.draw=e=>{const r=e.coreLayers[D.BaseLayer],{animationDuration:n}=e.globals,{getHtmlId:i}=e,s=r.append("g"),a=this.points.map((o,B)=>{var u,l,f;const c=wt(o.bands,e);return s.append("circle").attr("id",`${i(D.Scatter)}-${B}`).attr("pointer-events","none").attr("cx",c.x(o.x)).attr("cy",c.y(o.y)).attr("r",((u=o.style)==null?void 0:u.radius)||"0.2%").attr("fill",((l=o.style)==null?void 0:l.color)||"black").style("opacity",((f=o.style)==null?void 0:f.opacity)||1)});this.zoom=async()=>{const o=[];a.forEach((B,c)=>{const u=wt(this.points[c].bands,e),l=B.transition().duration(n).attr("cx",u.x(this.points[c].x)).attr("cy",u.y(this.points[c].y)).end();o.push(l)}),await Promise.all(o)}}}}class _C extends DA{constructor(){super(),this.type=D.Area,this.lineBoundaryInfo=[],this.customTween=(e,r,n,i,s)=>{const a=e.lowResLinesSC[n],o=wt(e.linesDC[n].bands,s),B={x:[o.x(i.x[0]),o.x(i.x[1])],y:[o.y(i.y[0]),o.y(i.y[1])]},c=this.lineBoundaryInfo[r][n],{yCoordForXAxisSC:u,xMinSC:l,xMaxSC:f}=c;return g=>{const Q=a.map(({x:K,y:H})=>e.getNewPoint(K,H,g)),w=ht(Q,s),h=e.getNewPoint(0,u,g).y,C=e.getNewPoint(l,0,g).x,F=e.getNewPoint(f,0,g).x,p={...c,yCoordForXAxisSC:h,xMinSC:C,xMaxSC:F},d=e.getNewPointInverse(B.x[0],B.y[0],g),U=e.getNewPointInverse(B.x[1],B.y[1],g),y=e.getNewPoint(d.x,d.y,1),v=e.getNewPoint(U.x,U.y,1),m={x:o.x.invert(y.x),y:o.y.invert(y.y)},L={x:o.x.invert(v.x),y:o.y.invert(v.y)},E={x:[m.x,L.x],y:[m.y,L.y]};return this.closeSvgPath(w,B,E,p)}},this.closeSvgPath=(e,r,n,i)=>{const{yCoordForXAxisSC:s,xMinSC:a,xMaxSC:o,xMinDC:B,xMaxDC:c,canvasPath:u}=i,[l,f]=r.y,[g,Q]=n.y;let w;f<s&&s<l?w=s:f>=s?w=f:w=l;const h=Math.max(r.x[0],a),C=Math.min(r.x[1],o),F=Math.max(n.x[0],B),p=Math.min(n.x[1],c),d=(F+p)/2;if(e.length>0){const U=e[0].split("L")[0].substring(1).split(",").map(parseFloat)[1],y=`M${h},${w}L${h},${U}`,v=e[e.length-1].split("L").at(-1).split(",").map(parseFloat)[1],m=`L${C},${v}L${C},${w}Z`,L=e.map(E=>"L"+E.substring(1)).join("");return y+L+m}if(w===s){const U={x:d,y:Q/2};return this.ctx.isPointInPath(u,U.x,U.y)?cn(h,C,f,s):cn(h,C,l,s)}else{const U={x:d,y:(Q+g)/2};return this.ctx.isPointInPath(u,U.x,U.y)?cn(h,C,l,f):""}};const t=document.createElement("canvas");this.ctx=t.getContext("2d")}draw(t,e){if(t.chartOptions.logScale.y)return;const r=t.optionalLayers.filter(i=>i.type===D.Trace);this.lineBoundaryInfo=r.map(i=>i.linesDC.map(()=>null));const n=r.map((i,s)=>i.linesDC.map((a,o)=>{if(!a.fill||a.points.length===0)return;const B=wt(a.bands,t),c=i.lowResLinesSC[o],{x:u}=vs(a.points),l=a.points.map(y=>`L${y.x},${y.y}`).join(""),{x:f}=a.points[0],g=`M${f},0`,{x:Q}=a.points[a.points.length-1],w=`L${Q},0Z`,h=g+l+w,F={canvasPath:new Path2D(h),xMinDC:u.start,xMaxDC:u.end,yCoordForXAxisSC:B.y(0),xMinSC:B.x(u.start),xMaxSC:B.x(u.end)};this.lineBoundaryInfo[s][o]=F;const p={x:[B.x(e.x[0]),B.x(e.x[1])],y:[B.y(e.y[0]),B.y(e.y[1])]},d=ht(c,t),U=this.closeSvgPath(d,p,e,F);return t.coreLayers[D.BaseLayer].append("path").attr("fill",a.style.fillColor||"black").attr("opacity",a.style.fillOpacity||.1).attr("d",U)}));this.zoom=async i=>{const s=[];n.forEach((a,o)=>{a.forEach((B,c)=>{if(!B)return;const u=B.transition().duration(t.globals.animationDuration).attrTween("d",()=>this.customTween(r[o],o,c,i,t)).end();s.push(u)})}),await Promise.all(s)},this.afterZoom=i=>{i&&n.forEach((s,a)=>{s.forEach((o,B)=>{if(!o)return;const c=wt(r[a].linesDC[B].bands,t),u=this.lineBoundaryInfo[a][B];this.lineBoundaryInfo[a][B]={...u,yCoordForXAxisSC:c.y(0),xMinSC:c.x(u.xMinDC),xMaxSC:c.x(u.xMaxDC)};const l={x:[c.x(i.x[0]),c.x(i.x[1])],y:[c.y(i.y[0]),c.y(i.y[1])]},f=r[a].lowResLinesSC[B],g=ht(f,t),Q=this.closeSvgPath(g,l,i,this.lineBoundaryInfo[a][B]);o.attr("d",Q)})})}}}class OC extends DA{constructor(){super(),this.type=D.Custom}draw(){}}class RC{constructor(t){var e,r;return this.optionalLayers=[],this.isResponsive=!1,this.globals={animationDuration:350,tickConfig:{x:{count:0},y:{count:0,specifier:".2~s"}}},this.defaultMargin={top:20,bottom:35,left:50,right:20},this.exportToPng=null,this.autoscaledMaxExtents={x:{start:-1/0,end:1/0},y:{start:-1/0,end:1/0}},this.addAxes=(n={})=>(n.x&&(this.defaultMargin.bottom=80),n.y&&(this.defaultMargin.left=90),this.optionalLayers.push(new rf(n||{})),this),this.addGridLines=n=>(this.optionalLayers.push(new cf({x:n===void 0?!0:n.x??!1,y:n===void 0?!0:n.y??!1})),this),this.filterLinesForLogAxis=(n,i)=>{let s="";const a=[];for(let o=0;o<n.length;o++){const B=n[o];let c=B.points[0]&&B.points[0][i]>0,u={...B,points:[]};for(let l=0;l<B.points.length;l++)B.points[l][i]<=0&&(s=`You have tried to use ${i} axis log scale but there are traces with ${i} coordinates that are <= 0`),B.points[l][i]>0?(u.points.push(B.points[l]),c=!0):c&&(a.push(u),u={...B,points:[]},c=!1);c&&a.push(u)}return s&&console.warn(s),a},this.filterLines=n=>{let i=n;return this.options.logScale.x&&(i=this.filterLinesForLogAxis(i,"x")),this.options.logScale.y&&(i=this.filterLinesForLogAxis(i,"y")),i},this.addTraces=(n,i)=>{const s={RDPEpsilon:(i==null?void 0:i.RDPEpsilon)??null},a=this.filterLines(n);return this.optionalLayers.push(new af(a,s)),this},this.addArea=()=>(this.optionalLayers.push(new _C),this),this.addZoom=n=>{const i={lockAxis:(n==null?void 0:n.lockAxis)??null};return this.optionalLayers.push(new of(i)),this},this.addTooltips=n=>(this.optionalLayers.push(new Bf(n)),this),this.filterScatterPointsForLogAxis=(n,i)=>{const s=n.filter(a=>a[i]>0);return s.length!==n.length&&console.warn(`You have tried to use ${i} axis log scale but there are points with ${i} coordinates that are <= 0`),s},this.filterScatterPoints=n=>{let i=n;return this.options.logScale.x&&(i=this.filterScatterPointsForLogAxis(i,"x")),this.options.logScale.y&&(i=this.filterScatterPointsForLogAxis(i,"y")),i},this.addScatterPoints=n=>{const i=this.filterScatterPoints(n);return this.optionalLayers.push(new MC(i)),this},this.addCustomLifecycleHooks=n=>{const i=new OC;return Object.assign(i,n),this.optionalLayers.push(i),this},this.addCustomLayer=n=>(this.optionalLayers.push(n),this),this.makeResponsive=()=>(this.isResponsive=!0,this),this.addLinearPadding=(n,i)=>{const s=Math.abs(n.start-n.end);return{start:n.start-s*i,end:n.end+s*i}},this.addLogPadding=(n,i)=>{const s=Math.log(n.start),a=Math.log(n.end),o=Math.abs(s-a);return{start:Math.exp(s-o*i),end:Math.exp(a+o*i)}},this.processScales=n=>{var Q,w,h,C;const i=this.optionalLayers.filter(F=>F.type===D.Trace),s=this.optionalLayers.filter(F=>F.type===D.Scatter);let a=i.reduce((F,p)=>[...p.linesDC.map(d=>d.points).flat(),...F],[]);a=s.reduce((F,p)=>[...p.points.map(d=>({x:d.x,y:d.y})),...F],a);const o=vs(a),B=.02,c=.03,u=this.options.logScale.x?this.addLogPadding:this.addLinearPadding,l=this.options.logScale.y?this.addLogPadding:this.addLinearPadding,f=u(o.x,B),g=l(o.y,c);return{x:{start:((Q=n.x)==null?void 0:Q.start)??f.start,end:((w=n.x)==null?void 0:w.end)??f.end},y:{start:((h=n.y)==null?void 0:h.start)??g.start,end:((C=n.y)==null?void 0:C.end)??g.end}}},this.appendClipPath=(n,i,s,a)=>{const o={...n,...i,margin:{...n.margin,...i.margin}},{width:B,height:c,margin:u}=o,l=s.append("defs").append("svg:clipPath").attr("id",a(D.ClipPath));return l.append("svg:rect").attr("width",B-u.right-u.left).attr("height",c-u.bottom-u.top).attr("x",u.left).attr("y",u.top),{clipPath:l,clipPathBounds:o}},this.draw=(n,i,s,a,o={},B={})=>{var Y,M,_,J;const c=b=>`${b}-${this.id}`,{height:u,width:l,margin:f}=i;this.autoscaledMaxExtents=this.processScales(s);const g=Fi("svg").attr("id",c(D.Svg)).attr("width","100%").attr("height","100%").attr("viewBox",`0 0 ${l} ${u}`).attr("style","overflow: visible;").attr("preserveAspectRatio","xMinYMin"),{clipPath:Q,clipPathBounds:w}=this.appendClipPath(i,B,g,c),h=g.append("g").attr("id",c(D.BaseLayer)).attr("clip-path",`url(#${c(D.ClipPath)})`),{x:C,y:F}=this.autoscaledMaxExtents,p={x:[((Y=a.x)==null?void 0:Y.start)??C.start,((M=a.x)==null?void 0:M.end)??C.end],y:[((_=a.y)==null?void 0:_.start)??F.start,((J=a.y)==null?void 0:J.end)??F.end]},d="You have tried to use a log scale axis but the initial extents includes 0.Using automatic scales instead. Please set the initial extents to a range that does not include 0, or pass {} to default to the auto-scale.";if(this.options.logScale.x&&p.x.some(b=>b<=0)){console.warn(d);const{x:b}=this.processScales({});p.x=[b.start,b.end]}if(this.options.logScale.y&&p.y.some(b=>b<=0)){console.warn(d);const{y:b}=this.processScales({});p.y=[b.start,b.end]}const U=[f.left,l-f.right],y=[u-f.bottom,f.top],m=(this.options.logScale.x?on:an)().domain(p.x).range(U),E=(this.options.logScale.y?on:an)().domain(p.y).range(y);let K=10;l<500&&(K=6),l<300&&(K=3);let H=10;u<400&&(H=6),u<200&&(H=3),this.globals.tickConfig.x.count=K,this.globals.tickConfig.y.count=H;const S={id:this.id,getHtmlId:c,bounds:i,clipPathBounds:w,globals:this.globals,scaleConfig:{linearScales:{x:m,y:E},scaleExtents:this.autoscaledMaxExtents,categoricalScales:{x:this.createCategoricalScale(o.x,U,m,"x"),y:this.createCategoricalScale(o.y,y,E,"y")}},coreLayers:{[D.Svg]:g,[D.ClipPath]:Q,[D.BaseLayer]:h},optionalLayers:this.optionalLayers,chartOptions:this.options};n.childNodes.forEach(b=>b.remove()),this.optionalLayers.forEach(b=>b.draw(S,p)),n.append(S.coreLayers[D.Svg].node())},this.appendTo=(n,i={},s={},a={},o={})=>{const B=(l,f)=>{const g={width:l,height:f,margin:this.defaultMargin};this.draw(n,g,i,s,a,o)},{width:c,height:u}=n.getBoundingClientRect();return B(c,u),this.isResponsive&&(new ResizeObserver(f=>{const{blockSize:g,inlineSize:Q}=f[0].borderBoxSize[0];B(Q,g)}).observe(n),window.addEventListener("resize",f=>{if(!f.view)return;const{innerHeight:g,innerWidth:Q}=f.view;B(Q,g)})),this.exportToPng=async(l="graph.png")=>{const g=(await SC(n)).toDataURL("image/png"),Q=document.createElement("a");Q.download=l,Q.href=`data:${g}`,Q.click(),Q.remove()},this},this.createCategoricalScale=(n,i,s,a)=>{if(!(n!=null&&n.length))return;const o=os().domain(n).range(i),B=o.bandwidth(),c=n.reduce((u,l)=>{const f=o(l),g=a==="x"?[f,f+B]:[f+B,f];return u[l]=s.copy().range(g),u},{});return{main:o,bands:c}},this.options={logScale:{x:((e=t==null?void 0:t.logScale)==null?void 0:e.x)??!1,y:((r=t==null?void 0:t.logScale)==null?void 0:r.y)??!1}},t!=null&&t.animationDuration&&(this.globals.animationDuration=t.animationDuration),this.id=Math.random().toString(26).substring(2,10),this}}RA.Chart=RC,RA.LayerType=D,RA.OptionalLayer=DA,Object.defineProperty(RA,Symbol.toStringTag,{value:"Module"})}));
|
|
22
|
+
.`+ni+ZQ+wo)},zQ=function(A,t){var e=A.ownerDocument;if(e){var r=e.createElement("style");r.textContent=t,A.appendChild(r)}},Qo=(function(){function A(){}return A.getOrigin=function(t){var e=A._link;return e?(e.href=t,e.href=e.href,e.protocol+e.hostname+e.port):"about:blank"},A.isSameOrigin=function(t){return A.getOrigin(t)===A._origin},A.setContext=function(t){A._link=t.document.createElement("a"),A._origin=A.getOrigin(t.location.href)},A._origin="about:blank",A})(),qQ=(function(){function A(t,e){this.context=t,this._options=e,this._cache={}}return A.prototype.addImage=function(t){var e=Promise.resolve();return this.has(t)||(si(t)||eC(t))&&(this._cache[t]=this.loadImage(t)).catch(function(){}),e},A.prototype.match=function(t){return this._cache[t]},A.prototype.loadImage=function(t){return aA(this,void 0,void 0,function(){var e,r,n,i,s=this;return iA(this,function(a){switch(a.label){case 0:return e=Qo.isSameOrigin(t),r=!ii(t)&&this._options.useCORS===!0&&eA.SUPPORT_CORS_IMAGES&&!e,n=!ii(t)&&!e&&!si(t)&&typeof this._options.proxy=="string"&&eA.SUPPORT_CORS_XHR&&!r,!e&&this._options.allowTaint===!1&&!ii(t)&&!si(t)&&!n&&!r?[2]:(i=t,n?[4,this.proxy(i)]:[3,2]);case 1:i=a.sent(),a.label=2;case 2:return this.context.logger.debug("Added image "+t.substring(0,256)),[4,new Promise(function(o,B){var c=new Image;c.onload=function(){return o(c)},c.onerror=B,(rC(i)||r)&&(c.crossOrigin="anonymous"),c.src=i,c.complete===!0&&setTimeout(function(){return o(c)},500),s._options.imageTimeout>0&&setTimeout(function(){return B("Timed out ("+s._options.imageTimeout+"ms) loading image")},s._options.imageTimeout)})];case 3:return[2,a.sent()]}})})},A.prototype.has=function(t){return typeof this._cache[t]<"u"},A.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},A.prototype.proxy=function(t){var e=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var n=t.substring(0,256);return new Promise(function(i,s){var a=eA.SUPPORT_RESPONSE_TYPE?"blob":"text",o=new XMLHttpRequest;o.onload=function(){if(o.status===200)if(a==="text")i(o.response);else{var u=new FileReader;u.addEventListener("load",function(){return i(u.result)},!1),u.addEventListener("error",function(l){return s(l)},!1),u.readAsDataURL(o.response)}else s("Failed to proxy resource "+n+" with status code "+o.status)},o.onerror=s;var B=r.indexOf("?")>-1?"&":"?";if(o.open("GET",""+r+B+"url="+encodeURIComponent(t)+"&responseType="+a),a!=="text"&&o instanceof XMLHttpRequest&&(o.responseType=a),e._options.imageTimeout){var c=e._options.imageTimeout;o.timeout=c,o.ontimeout=function(){return s("Timed out ("+c+"ms) proxying "+n)}}o.send()})},A})(),jQ=/^data:image\/svg\+xml/i,AC=/^data:image\/.*;base64,/i,tC=/^data:image\/.*/i,eC=function(A){return eA.SUPPORT_SVG_DRAWING||!nC(A)},ii=function(A){return tC.test(A)},rC=function(A){return AC.test(A)},si=function(A){return A.substr(0,4)==="blob"},nC=function(A){return A.substr(-3).toLowerCase()==="svg"||jQ.test(A)},I=(function(){function A(t,e){this.type=0,this.x=t,this.y=e}return A.prototype.add=function(t,e){return new A(this.x+t,this.y+e)},A})(),mt=function(A,t,e){return new I(A.x+(t.x-A.x)*e,A.y+(t.y-A.y)*e)},wr=(function(){function A(t,e,r,n){this.type=1,this.start=t,this.startControl=e,this.endControl=r,this.end=n}return A.prototype.subdivide=function(t,e){var r=mt(this.start,this.startControl,t),n=mt(this.startControl,this.endControl,t),i=mt(this.endControl,this.end,t),s=mt(r,n,t),a=mt(n,i,t),o=mt(s,a,t);return e?new A(this.start,r,s,o):new A(o,a,i,this.end)},A.prototype.add=function(t,e){return new A(this.start.add(t,e),this.startControl.add(t,e),this.endControl.add(t,e),this.end.add(t,e))},A.prototype.reverse=function(){return new A(this.end,this.endControl,this.startControl,this.start)},A})(),wA=function(A){return A.type===1},iC=(function(){function A(t){var e=t.styles,r=t.bounds,n=zt(e.borderTopLeftRadius,r.width,r.height),i=n[0],s=n[1],a=zt(e.borderTopRightRadius,r.width,r.height),o=a[0],B=a[1],c=zt(e.borderBottomRightRadius,r.width,r.height),u=c[0],l=c[1],f=zt(e.borderBottomLeftRadius,r.width,r.height),g=f[0],Q=f[1],w=[];w.push((i+o)/r.width),w.push((g+u)/r.width),w.push((s+Q)/r.height),w.push((B+l)/r.height);var h=Math.max.apply(Math,w);h>1&&(i/=h,s/=h,o/=h,B/=h,u/=h,l/=h,g/=h,Q/=h);var C=r.width-o,F=r.height-l,p=r.width-u,d=r.height-Q,U=e.borderTopWidth,y=e.borderRightWidth,v=e.borderBottomWidth,m=e.borderLeftWidth,L=k(e.paddingTop,t.bounds.width),E=k(e.paddingRight,t.bounds.width),K=k(e.paddingBottom,t.bounds.width),H=k(e.paddingLeft,t.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||s>0?X(r.left+m/3,r.top+U/3,i-m/3,s-U/3,R.TOP_LEFT):new I(r.left+m/3,r.top+U/3),this.topRightBorderDoubleOuterBox=i>0||s>0?X(r.left+C,r.top+U/3,o-y/3,B-U/3,R.TOP_RIGHT):new I(r.left+r.width-y/3,r.top+U/3),this.bottomRightBorderDoubleOuterBox=u>0||l>0?X(r.left+p,r.top+F,u-y/3,l-v/3,R.BOTTOM_RIGHT):new I(r.left+r.width-y/3,r.top+r.height-v/3),this.bottomLeftBorderDoubleOuterBox=g>0||Q>0?X(r.left+m/3,r.top+d,g-m/3,Q-v/3,R.BOTTOM_LEFT):new I(r.left+m/3,r.top+r.height-v/3),this.topLeftBorderDoubleInnerBox=i>0||s>0?X(r.left+m*2/3,r.top+U*2/3,i-m*2/3,s-U*2/3,R.TOP_LEFT):new I(r.left+m*2/3,r.top+U*2/3),this.topRightBorderDoubleInnerBox=i>0||s>0?X(r.left+C,r.top+U*2/3,o-y*2/3,B-U*2/3,R.TOP_RIGHT):new I(r.left+r.width-y*2/3,r.top+U*2/3),this.bottomRightBorderDoubleInnerBox=u>0||l>0?X(r.left+p,r.top+F,u-y*2/3,l-v*2/3,R.BOTTOM_RIGHT):new I(r.left+r.width-y*2/3,r.top+r.height-v*2/3),this.bottomLeftBorderDoubleInnerBox=g>0||Q>0?X(r.left+m*2/3,r.top+d,g-m*2/3,Q-v*2/3,R.BOTTOM_LEFT):new I(r.left+m*2/3,r.top+r.height-v*2/3),this.topLeftBorderStroke=i>0||s>0?X(r.left+m/2,r.top+U/2,i-m/2,s-U/2,R.TOP_LEFT):new I(r.left+m/2,r.top+U/2),this.topRightBorderStroke=i>0||s>0?X(r.left+C,r.top+U/2,o-y/2,B-U/2,R.TOP_RIGHT):new I(r.left+r.width-y/2,r.top+U/2),this.bottomRightBorderStroke=u>0||l>0?X(r.left+p,r.top+F,u-y/2,l-v/2,R.BOTTOM_RIGHT):new I(r.left+r.width-y/2,r.top+r.height-v/2),this.bottomLeftBorderStroke=g>0||Q>0?X(r.left+m/2,r.top+d,g-m/2,Q-v/2,R.BOTTOM_LEFT):new I(r.left+m/2,r.top+r.height-v/2),this.topLeftBorderBox=i>0||s>0?X(r.left,r.top,i,s,R.TOP_LEFT):new I(r.left,r.top),this.topRightBorderBox=o>0||B>0?X(r.left+C,r.top,o,B,R.TOP_RIGHT):new I(r.left+r.width,r.top),this.bottomRightBorderBox=u>0||l>0?X(r.left+p,r.top+F,u,l,R.BOTTOM_RIGHT):new I(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=g>0||Q>0?X(r.left,r.top+d,g,Q,R.BOTTOM_LEFT):new I(r.left,r.top+r.height),this.topLeftPaddingBox=i>0||s>0?X(r.left+m,r.top+U,Math.max(0,i-m),Math.max(0,s-U),R.TOP_LEFT):new I(r.left+m,r.top+U),this.topRightPaddingBox=o>0||B>0?X(r.left+Math.min(C,r.width-y),r.top+U,C>r.width+y?0:Math.max(0,o-y),Math.max(0,B-U),R.TOP_RIGHT):new I(r.left+r.width-y,r.top+U),this.bottomRightPaddingBox=u>0||l>0?X(r.left+Math.min(p,r.width-m),r.top+Math.min(F,r.height-v),Math.max(0,u-y),Math.max(0,l-v),R.BOTTOM_RIGHT):new I(r.left+r.width-y,r.top+r.height-v),this.bottomLeftPaddingBox=g>0||Q>0?X(r.left+m,r.top+Math.min(d,r.height-v),Math.max(0,g-m),Math.max(0,Q-v),R.BOTTOM_LEFT):new I(r.left+m,r.top+r.height-v),this.topLeftContentBox=i>0||s>0?X(r.left+m+H,r.top+U+L,Math.max(0,i-(m+H)),Math.max(0,s-(U+L)),R.TOP_LEFT):new I(r.left+m+H,r.top+U+L),this.topRightContentBox=o>0||B>0?X(r.left+Math.min(C,r.width+m+H),r.top+U+L,C>r.width+m+H?0:o-m+H,B-(U+L),R.TOP_RIGHT):new I(r.left+r.width-(y+E),r.top+U+L),this.bottomRightContentBox=u>0||l>0?X(r.left+Math.min(p,r.width-(m+H)),r.top+Math.min(F,r.height+U+L),Math.max(0,u-(y+E)),l-(v+K),R.BOTTOM_RIGHT):new I(r.left+r.width-(y+E),r.top+r.height-(v+K)),this.bottomLeftContentBox=g>0||Q>0?X(r.left+m+H,r.top+d,Math.max(0,g-(m+H)),Q-(v+K),R.BOTTOM_LEFT):new I(r.left+m+H,r.top+r.height-(v+K))}return A})(),R;(function(A){A[A.TOP_LEFT=0]="TOP_LEFT",A[A.TOP_RIGHT=1]="TOP_RIGHT",A[A.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",A[A.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(R||(R={}));var X=function(A,t,e,r,n){var i=4*((Math.sqrt(2)-1)/3),s=e*i,a=r*i,o=A+e,B=t+r;switch(n){case R.TOP_LEFT:return new wr(new I(A,B),new I(A,B-a),new I(o-s,t),new I(o,t));case R.TOP_RIGHT:return new wr(new I(A,t),new I(A+s,t),new I(o,B-a),new I(o,B));case R.BOTTOM_RIGHT:return new wr(new I(o,t),new I(o,t+a),new I(A+s,B),new I(A,B));case R.BOTTOM_LEFT:default:return new wr(new I(o,B),new I(o-s,B),new I(A,t+a),new I(A,t))}},Qr=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},sC=function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]},Cr=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},aC=(function(){function A(t,e,r){this.offsetX=t,this.offsetY=e,this.matrix=r,this.type=0,this.target=6}return A})(),dr=(function(){function A(t,e){this.path=t,this.target=e,this.type=1}return A})(),oC=(function(){function A(t){this.opacity=t,this.type=2,this.target=6}return A})(),BC=function(A){return A.type===0},Co=function(A){return A.type===1},cC=function(A){return A.type===2},Uo=function(A,t){return A.length===t.length?A.some(function(e,r){return e===t[r]}):!1},uC=function(A,t,e,r,n){return A.map(function(i,s){switch(s){case 0:return i.add(t,e);case 1:return i.add(t+r,e);case 2:return i.add(t+r,e+n);case 3:return i.add(t,e+n)}return i})},Fo=(function(){function A(t){this.element=t,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return A})(),po=(function(){function A(t,e){if(this.container=t,this.parent=e,this.effects=[],this.curves=new iC(this.container),this.container.styles.opacity<1&&this.effects.push(new oC(this.container.styles.opacity)),this.container.styles.transform!==null){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new aC(r,n,i))}if(this.container.styles.overflowX!==0){var s=Qr(this.curves),a=Cr(this.curves);Uo(s,a)?this.effects.push(new dr(s,6)):(this.effects.push(new dr(s,2)),this.effects.push(new dr(a,4)))}}return A.prototype.getEffects=function(t){for(var e=[2,3].indexOf(this.container.styles.position)===-1,r=this.parent,n=this.effects.slice(0);r;){var i=r.effects.filter(function(o){return!Co(o)});if(e||r.container.styles.position!==0||!r.parent){if(n.unshift.apply(n,i),e=[2,3].indexOf(r.container.styles.position)===-1,r.container.styles.overflowX!==0){var s=Qr(r.curves),a=Cr(r.curves);Uo(s,a)||n.unshift(new dr(a,6))}}else n.unshift.apply(n,i);r=r.parent}return n.filter(function(o){return q(o.target,t)})},A})(),ai=function(A,t,e,r){A.container.elements.forEach(function(n){var i=q(n.flags,4),s=q(n.flags,2),a=new po(n,A);q(n.styles.display,2048)&&r.push(a);var o=q(n.flags,8)?[]:r;if(i||s){var B=i||n.styles.isPositioned()?e:t,c=new Fo(a);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var u=n.styles.zIndex.order;if(u<0){var l=0;B.negativeZIndex.some(function(g,Q){return u>g.element.container.styles.zIndex.order?(l=Q,!1):l>0}),B.negativeZIndex.splice(l,0,c)}else if(u>0){var f=0;B.positiveZIndex.some(function(g,Q){return u>=g.element.container.styles.zIndex.order?(f=Q+1,!1):f>0}),B.positiveZIndex.splice(f,0,c)}else B.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else n.styles.isFloating()?B.nonPositionedFloats.push(c):B.nonPositionedInlineLevel.push(c);ai(a,c,i?c:e,o)}else n.styles.isInlineLevel()?t.inlineLevel.push(a):t.nonInlineLevel.push(a),ai(a,t,e,o);q(n.flags,8)&&vo(n,o)})},vo=function(A,t){for(var e=A instanceof $n?A.start:1,r=A instanceof $n?A.reversed:!1,n=0;n<t.length;n++){var i=t[n];i.container instanceof Ya&&typeof i.container.value=="number"&&i.container.value!==0&&(e=i.container.value),i.listValue=re(e,i.container.styles.listStyleType,!0),e+=r?-1:1}},lC=function(A){var t=new po(A,null),e=new Fo(t),r=[];return ai(t,e,e,r),vo(t.container,r),e},yo=function(A,t){switch(t){case 0:return QA(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return QA(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return QA(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);case 3:default:return QA(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},fC=function(A,t){switch(t){case 0:return QA(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return QA(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return QA(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);case 3:default:return QA(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}},gC=function(A,t){switch(t){case 0:return QA(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return QA(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return QA(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);case 3:default:return QA(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}},hC=function(A,t){switch(t){case 0:return Ur(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return Ur(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return Ur(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);case 3:default:return Ur(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}},Ur=function(A,t){var e=[];return wA(A)?e.push(A.subdivide(.5,!1)):e.push(A),wA(t)?e.push(t.subdivide(.5,!0)):e.push(t),e},QA=function(A,t,e,r){var n=[];return wA(A)?n.push(A.subdivide(.5,!1)):n.push(A),wA(e)?n.push(e.subdivide(.5,!0)):n.push(e),wA(r)?n.push(r.subdivide(.5,!0).reverse()):n.push(r),wA(t)?n.push(t.subdivide(.5,!1).reverse()):n.push(t),n},Eo=function(A){var t=A.bounds,e=A.styles;return t.add(e.borderLeftWidth,e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth),-(e.borderTopWidth+e.borderBottomWidth))},Fr=function(A){var t=A.styles,e=A.bounds,r=k(t.paddingLeft,e.width),n=k(t.paddingRight,e.width),i=k(t.paddingTop,e.width),s=k(t.paddingBottom,e.width);return e.add(r+t.borderLeftWidth,i+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+r+n),-(t.borderTopWidth+t.borderBottomWidth+i+s))},wC=function(A,t){return A===0?t.bounds:A===2?Fr(t):Eo(t)},QC=function(A,t){return A===0?t.bounds:A===2?Fr(t):Eo(t)},oi=function(A,t,e){var r=wC(It(A.styles.backgroundOrigin,t),A),n=QC(It(A.styles.backgroundClip,t),A),i=CC(It(A.styles.backgroundSize,t),e,r),s=i[0],a=i[1],o=zt(It(A.styles.backgroundPosition,t),r.width-s,r.height-a),B=dC(It(A.styles.backgroundRepeat,t),o,i,r,n),c=Math.round(r.left+o[0]),u=Math.round(r.top+o[1]);return[B,c,u,s,a]},Ht=function(A){return N(A)&&A.value===pt.AUTO},pr=function(A){return typeof A=="number"},CC=function(A,t,e){var r=t[0],n=t[1],i=t[2],s=A[0],a=A[1];if(!s)return[0,0];if($(s)&&a&&$(a))return[k(s,e.width),k(a,e.height)];var o=pr(i);if(N(s)&&(s.value===pt.CONTAIN||s.value===pt.COVER)){if(pr(i)){var B=e.width/e.height;return B<i!=(s.value===pt.COVER)?[e.width,e.width/i]:[e.height*i,e.height]}return[e.width,e.height]}var c=pr(r),u=pr(n),l=c||u;if(Ht(s)&&(!a||Ht(a))){if(c&&u)return[r,n];if(!o&&!l)return[e.width,e.height];if(l&&o){var f=c?r:n*i,g=u?n:r/i;return[f,g]}var Q=c?r:e.width,w=u?n:e.height;return[Q,w]}if(o){var h=0,C=0;return $(s)?h=k(s,e.width):$(a)&&(C=k(a,e.height)),Ht(s)?h=C*i:(!a||Ht(a))&&(C=h/i),[h,C]}var F=null,p=null;if($(s)?F=k(s,e.width):a&&$(a)&&(p=k(a,e.height)),F!==null&&(!a||Ht(a))&&(p=c&&u?F/r*n:e.height),p!==null&&Ht(s)&&(F=c&&u?p/n*r:e.width),F!==null&&p!==null)return[F,p];throw new Error("Unable to calculate background-size for element")},It=function(A,t){var e=A[t];return typeof e>"u"?A[0]:e},dC=function(A,t,e,r,n){var i=t[0],s=t[1],a=e[0],o=e[1];switch(A){case 2:return[new I(Math.round(r.left),Math.round(r.top+s)),new I(Math.round(r.left+r.width),Math.round(r.top+s)),new I(Math.round(r.left+r.width),Math.round(o+r.top+s)),new I(Math.round(r.left),Math.round(o+r.top+s))];case 3:return[new I(Math.round(r.left+i),Math.round(r.top)),new I(Math.round(r.left+i+a),Math.round(r.top)),new I(Math.round(r.left+i+a),Math.round(r.height+r.top)),new I(Math.round(r.left+i),Math.round(r.height+r.top))];case 1:return[new I(Math.round(r.left+i),Math.round(r.top+s)),new I(Math.round(r.left+i+a),Math.round(r.top+s)),new I(Math.round(r.left+i+a),Math.round(r.top+s+o)),new I(Math.round(r.left+i),Math.round(r.top+s+o))];default:return[new I(Math.round(n.left),Math.round(n.top)),new I(Math.round(n.left+n.width),Math.round(n.top)),new I(Math.round(n.left+n.width),Math.round(n.height+n.top)),new I(Math.round(n.left),Math.round(n.height+n.top))]}},UC="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",mo="Hidden Text",FC=(function(){function A(t){this._data={},this._document=t}return A.prototype.parseMetrics=function(t,e){var r=this._document.createElement("div"),n=this._document.createElement("img"),i=this._document.createElement("span"),s=this._document.body;r.style.visibility="hidden",r.style.fontFamily=t,r.style.fontSize=e,r.style.margin="0",r.style.padding="0",r.style.whiteSpace="nowrap",s.appendChild(r),n.src=UC,n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",i.style.fontFamily=t,i.style.fontSize=e,i.style.margin="0",i.style.padding="0",i.appendChild(this._document.createTextNode(mo)),r.appendChild(i),r.appendChild(n);var a=n.offsetTop-i.offsetTop+2;r.removeChild(i),r.appendChild(this._document.createTextNode(mo)),r.style.lineHeight="normal",n.style.verticalAlign="super";var o=n.offsetTop-r.offsetTop+2;return s.removeChild(r),{baseline:a,middle:o}},A.prototype.getMetrics=function(t,e){var r=t+" "+e;return typeof this._data[r]>"u"&&(this._data[r]=this.parseMetrics(t,e)),this._data[r]},A})(),Ho=(function(){function A(t,e){this.context=t,this.options=e}return A})(),pC=1e4,vC=(function(A){pA(t,A);function t(e,r){var n=A.call(this,e,r)||this;return n._activeEffects=[],n.canvas=r.canvas?r.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),r.canvas||(n.canvas.width=Math.floor(r.width*r.scale),n.canvas.height=Math.floor(r.height*r.scale),n.canvas.style.width=r.width+"px",n.canvas.style.height=r.height+"px"),n.fontMetrics=new FC(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-r.x,-r.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+r.width+"x"+r.height+") with scale "+r.scale),n}return t.prototype.applyEffects=function(e){for(var r=this;this._activeEffects.length;)this.popEffect();e.forEach(function(n){return r.applyEffect(n)})},t.prototype.applyEffect=function(e){this.ctx.save(),cC(e)&&(this.ctx.globalAlpha=e.opacity),BC(e)&&(this.ctx.translate(e.offsetX,e.offsetY),this.ctx.transform(e.matrix[0],e.matrix[1],e.matrix[2],e.matrix[3],e.matrix[4],e.matrix[5]),this.ctx.translate(-e.offsetX,-e.offsetY)),Co(e)&&(this.path(e.path),this.ctx.clip()),this._activeEffects.push(e)},t.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},t.prototype.renderStack=function(e){return aA(this,void 0,void 0,function(){var r;return iA(this,function(n){switch(n.label){case 0:return r=e.element.container.styles,r.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},t.prototype.renderNode=function(e){return aA(this,void 0,void 0,function(){return iA(this,function(r){switch(r.label){case 0:if(q(e.container.flags,16))debugger;return e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return r.sent(),[4,this.renderNodeContent(e)];case 2:r.sent(),r.label=3;case 3:return[2]}})})},t.prototype.renderTextWithLetterSpacing=function(e,r,n){var i=this;if(r===0)this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+n);else{var s=Zn(e.text);s.reduce(function(a,o){return i.ctx.fillText(o,a,e.bounds.top+n),a+i.ctx.measureText(o).width},e.bounds.left)}},t.prototype.createFontStyle=function(e){var r=e.fontVariant.filter(function(s){return s==="normal"||s==="small-caps"}).join(""),n=IC(e.fontFamily).join(", "),i=$t(e.fontSize)?""+e.fontSize.number+e.fontSize.unit:e.fontSize.number+"px";return[[e.fontStyle,r,e.fontWeight,i,n].join(" "),n,i]},t.prototype.renderTextNode=function(e,r){return aA(this,void 0,void 0,function(){var n,i,s,a,o,B,c,u,l=this;return iA(this,function(f){return n=this.createFontStyle(r),i=n[0],s=n[1],a=n[2],this.ctx.font=i,this.ctx.direction=r.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",o=this.fontMetrics.getMetrics(s,a),B=o.baseline,c=o.middle,u=r.paintOrder,e.textBounds.forEach(function(g){u.forEach(function(Q){switch(Q){case 0:l.ctx.fillStyle=AA(r.color),l.renderTextWithLetterSpacing(g,r.letterSpacing,B);var w=r.textShadow;w.length&&g.text.trim().length&&(w.slice(0).reverse().forEach(function(h){l.ctx.shadowColor=AA(h.color),l.ctx.shadowOffsetX=h.offsetX.number*l.options.scale,l.ctx.shadowOffsetY=h.offsetY.number*l.options.scale,l.ctx.shadowBlur=h.blur.number,l.renderTextWithLetterSpacing(g,r.letterSpacing,B)}),l.ctx.shadowColor="",l.ctx.shadowOffsetX=0,l.ctx.shadowOffsetY=0,l.ctx.shadowBlur=0),r.textDecorationLine.length&&(l.ctx.fillStyle=AA(r.textDecorationColor||r.color),r.textDecorationLine.forEach(function(h){switch(h){case 1:l.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top+B),g.bounds.width,1);break;case 2:l.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top),g.bounds.width,1);break;case 3:l.ctx.fillRect(g.bounds.left,Math.ceil(g.bounds.top+c),g.bounds.width,1);break}}));break;case 1:r.webkitTextStrokeWidth&&g.text.trim().length&&(l.ctx.strokeStyle=AA(r.webkitTextStrokeColor),l.ctx.lineWidth=r.webkitTextStrokeWidth,l.ctx.lineJoin=window.chrome?"miter":"round",l.ctx.strokeText(g.text,g.bounds.left,g.bounds.top+B)),l.ctx.strokeStyle="",l.ctx.lineWidth=0,l.ctx.lineJoin="miter";break}})}),[2]})})},t.prototype.renderReplacedElement=function(e,r,n){if(n&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var i=Fr(e),s=Cr(r);this.path(s),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,e.intrinsicWidth,e.intrinsicHeight,i.left,i.top,i.width,i.height),this.ctx.restore()}},t.prototype.renderNodeContent=function(e){return aA(this,void 0,void 0,function(){var r,n,i,s,a,o,C,C,B,c,u,l,p,f,g,d,Q,w,h,C,F,p,d;return iA(this,function(U){switch(U.label){case 0:this.applyEffects(e.getEffects(4)),r=e.container,n=e.curves,i=r.styles,s=0,a=r.textNodes,U.label=1;case 1:return s<a.length?(o=a[s],[4,this.renderTextNode(o,i)]):[3,4];case 2:U.sent(),U.label=3;case 3:return s++,[3,1];case 4:if(!(r instanceof Pa))return[3,8];U.label=5;case 5:return U.trys.push([5,7,,8]),[4,this.context.cache.match(r.src)];case 6:return C=U.sent(),this.renderReplacedElement(r,n,C),[3,8];case 7:return U.sent(),this.context.logger.error("Error loading image "+r.src),[3,8];case 8:if(r instanceof Xa&&this.renderReplacedElement(r,n,r.canvas),!(r instanceof Ja))return[3,12];U.label=9;case 9:return U.trys.push([9,11,,12]),[4,this.context.cache.match(r.svg)];case 10:return C=U.sent(),this.renderReplacedElement(r,n,C),[3,12];case 11:return U.sent(),this.context.logger.error("Error loading svg "+r.svg.substring(0,255)),[3,12];case 12:return r instanceof za&&r.tree?(B=new t(this.context,{scale:this.options.scale,backgroundColor:r.backgroundColor,x:0,y:0,width:r.width,height:r.height}),[4,B.render(r.tree)]):[3,14];case 13:c=U.sent(),r.width&&r.height&&this.ctx.drawImage(c,0,0,r.width,r.height,r.bounds.left,r.bounds.top,r.bounds.width,r.bounds.height),U.label=14;case 14:if(r instanceof zn&&(u=Math.min(r.bounds.width,r.bounds.height),r.type===cr?r.checked&&(this.ctx.save(),this.path([new I(r.bounds.left+u*.39363,r.bounds.top+u*.79),new I(r.bounds.left+u*.16,r.bounds.top+u*.5549),new I(r.bounds.left+u*.27347,r.bounds.top+u*.44071),new I(r.bounds.left+u*.39694,r.bounds.top+u*.5649),new I(r.bounds.left+u*.72983,r.bounds.top+u*.23),new I(r.bounds.left+u*.84,r.bounds.top+u*.34085),new I(r.bounds.left+u*.39363,r.bounds.top+u*.79)]),this.ctx.fillStyle=AA(Wa),this.ctx.fill(),this.ctx.restore()):r.type===ur&&r.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(r.bounds.left+u/2,r.bounds.top+u/2,u/4,0,Math.PI*2,!0),this.ctx.fillStyle=AA(Wa),this.ctx.fill(),this.ctx.restore())),yC(r)&&r.value.length){switch(l=this.createFontStyle(i),p=l[0],f=l[1],g=this.fontMetrics.getMetrics(p,f).baseline,this.ctx.font=p,this.ctx.fillStyle=AA(i.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=mC(r.styles.textAlign),d=Fr(r),Q=0,r.styles.textAlign){case 1:Q+=d.width/2;break;case 2:Q+=d.width;break}w=d.add(Q,0,0,-d.height/2+1),this.ctx.save(),this.path([new I(d.left,d.top),new I(d.left+d.width,d.top),new I(d.left+d.width,d.top+d.height),new I(d.left,d.top+d.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new te(r.value,w),i.letterSpacing,g),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!q(r.styles.display,2048))return[3,20];if(r.styles.listStyleImage===null)return[3,19];if(h=r.styles.listStyleImage,h.type!==0)return[3,18];C=void 0,F=h.url,U.label=15;case 15:return U.trys.push([15,17,,18]),[4,this.context.cache.match(F)];case 16:return C=U.sent(),this.ctx.drawImage(C,r.bounds.left-(C.width+10),r.bounds.top),[3,18];case 17:return U.sent(),this.context.logger.error("Error loading list-style-image "+F),[3,18];case 18:return[3,20];case 19:e.listValue&&r.styles.listStyleType!==-1&&(p=this.createFontStyle(i)[0],this.ctx.font=p,this.ctx.fillStyle=AA(i.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",d=new TA(r.bounds.left,r.bounds.top+k(r.styles.paddingTop,r.bounds.width),r.bounds.width,Ea(i.lineHeight,i.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new te(e.listValue,d),i.letterSpacing,Ea(i.lineHeight,i.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),U.label=20;case 20:return[2]}})})},t.prototype.renderStackContent=function(e){return aA(this,void 0,void 0,function(){var r,n,h,i,s,h,a,o,h,B,c,h,u,l,h,f,g,h,Q,w,h;return iA(this,function(C){switch(C.label){case 0:if(q(e.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(e.element)];case 1:C.sent(),r=0,n=e.negativeZIndex,C.label=2;case 2:return r<n.length?(h=n[r],[4,this.renderStack(h)]):[3,5];case 3:C.sent(),C.label=4;case 4:return r++,[3,2];case 5:return[4,this.renderNodeContent(e.element)];case 6:C.sent(),i=0,s=e.nonInlineLevel,C.label=7;case 7:return i<s.length?(h=s[i],[4,this.renderNode(h)]):[3,10];case 8:C.sent(),C.label=9;case 9:return i++,[3,7];case 10:a=0,o=e.nonPositionedFloats,C.label=11;case 11:return a<o.length?(h=o[a],[4,this.renderStack(h)]):[3,14];case 12:C.sent(),C.label=13;case 13:return a++,[3,11];case 14:B=0,c=e.nonPositionedInlineLevel,C.label=15;case 15:return B<c.length?(h=c[B],[4,this.renderStack(h)]):[3,18];case 16:C.sent(),C.label=17;case 17:return B++,[3,15];case 18:u=0,l=e.inlineLevel,C.label=19;case 19:return u<l.length?(h=l[u],[4,this.renderNode(h)]):[3,22];case 20:C.sent(),C.label=21;case 21:return u++,[3,19];case 22:f=0,g=e.zeroOrAutoZIndexOrTransformedOrOpacity,C.label=23;case 23:return f<g.length?(h=g[f],[4,this.renderStack(h)]):[3,26];case 24:C.sent(),C.label=25;case 25:return f++,[3,23];case 26:Q=0,w=e.positiveZIndex,C.label=27;case 27:return Q<w.length?(h=w[Q],[4,this.renderStack(h)]):[3,30];case 28:C.sent(),C.label=29;case 29:return Q++,[3,27];case 30:return[2]}})})},t.prototype.mask=function(e){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()},t.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},t.prototype.formatPath=function(e){var r=this;e.forEach(function(n,i){var s=wA(n)?n.start:n;i===0?r.ctx.moveTo(s.x,s.y):r.ctx.lineTo(s.x,s.y),wA(n)&&r.ctx.bezierCurveTo(n.startControl.x,n.startControl.y,n.endControl.x,n.endControl.y,n.end.x,n.end.y)})},t.prototype.renderRepeat=function(e,r,n,i){this.path(e),this.ctx.fillStyle=r,this.ctx.translate(n,i),this.ctx.fill(),this.ctx.translate(-n,-i)},t.prototype.resizeImage=function(e,r,n){var i;if(e.width===r&&e.height===n)return e;var s=(i=this.canvas.ownerDocument)!==null&&i!==void 0?i:document,a=s.createElement("canvas");a.width=Math.max(1,r),a.height=Math.max(1,n);var o=a.getContext("2d");return o.drawImage(e,0,0,e.width,e.height,0,0,r,n),a},t.prototype.renderBackgroundImage=function(e){return aA(this,void 0,void 0,function(){var r,n,i,s,a,o;return iA(this,function(B){switch(B.label){case 0:r=e.styles.backgroundImage.length-1,n=function(c){var u,l,f,L,M,_,H,S,v,g,L,M,_,H,S,Q,w,h,C,F,p,d,U,y,v,m,L,E,K,H,S,Y,M,_,J,b,P,G,V,fA,CA,cA;return iA(this,function(yA){switch(yA.label){case 0:if(c.type!==0)return[3,5];u=void 0,l=c.url,yA.label=1;case 1:return yA.trys.push([1,3,,4]),[4,i.context.cache.match(l)];case 2:return u=yA.sent(),[3,4];case 3:return yA.sent(),i.context.logger.error("Error loading background-image "+l),[3,4];case 4:return u&&(f=oi(e,r,[u.width,u.height,u.width/u.height]),L=f[0],M=f[1],_=f[2],H=f[3],S=f[4],v=i.ctx.createPattern(i.resizeImage(u,H,S),"repeat"),i.renderRepeat(L,v,M,_)),[3,6];case 5:Bh(c)?(g=oi(e,r,[null,null,null]),L=g[0],M=g[1],_=g[2],H=g[3],S=g[4],Q=nh(c.angle,H,S),w=Q[0],h=Q[1],C=Q[2],F=Q[3],p=Q[4],d=document.createElement("canvas"),d.width=H,d.height=S,U=d.getContext("2d"),y=U.createLinearGradient(h,F,C,p),ga(c.stops,w).forEach(function(z){return y.addColorStop(z.stop,AA(z.color))}),U.fillStyle=y,U.fillRect(0,0,H,S),H>0&&S>0&&(v=i.ctx.createPattern(d,"repeat"),i.renderRepeat(L,v,M,_))):ch(c)&&(m=oi(e,r,[null,null,null]),L=m[0],E=m[1],K=m[2],H=m[3],S=m[4],Y=c.position.length===0?[Dn]:c.position,M=k(Y[0],H),_=k(Y[Y.length-1],S),J=ih(c,M,_,H,S),b=J[0],P=J[1],b>0&&P>0&&(G=i.ctx.createRadialGradient(E+M,K+_,0,E+M,K+_,b),ga(c.stops,b*2).forEach(function(z){return G.addColorStop(z.stop,AA(z.color))}),i.path(L),i.ctx.fillStyle=G,b!==P?(V=e.bounds.left+.5*e.bounds.width,fA=e.bounds.top+.5*e.bounds.height,CA=P/b,cA=1/CA,i.ctx.save(),i.ctx.translate(V,fA),i.ctx.transform(1,0,0,CA,0,0),i.ctx.translate(-V,-fA),i.ctx.fillRect(E,cA*(K-fA)+fA,H,S*cA),i.ctx.restore()):i.ctx.fill())),yA.label=6;case 6:return r--,[2]}})},i=this,s=0,a=e.styles.backgroundImage.slice(0).reverse(),B.label=1;case 1:return s<a.length?(o=a[s],[5,n(o)]):[3,4];case 2:B.sent(),B.label=3;case 3:return s++,[3,1];case 4:return[2]}})})},t.prototype.renderSolidBorder=function(e,r,n){return aA(this,void 0,void 0,function(){return iA(this,function(i){return this.path(yo(n,r)),this.ctx.fillStyle=AA(e),this.ctx.fill(),[2]})})},t.prototype.renderDoubleBorder=function(e,r,n,i){return aA(this,void 0,void 0,function(){var s,a;return iA(this,function(o){switch(o.label){case 0:return r<3?[4,this.renderSolidBorder(e,n,i)]:[3,2];case 1:return o.sent(),[2];case 2:return s=fC(i,n),this.path(s),this.ctx.fillStyle=AA(e),this.ctx.fill(),a=gC(i,n),this.path(a),this.ctx.fill(),[2]}})})},t.prototype.renderNodeBackgroundAndBorders=function(e){return aA(this,void 0,void 0,function(){var r,n,i,s,a,o,B,c,u=this;return iA(this,function(l){switch(l.label){case 0:return this.applyEffects(e.getEffects(2)),r=e.container.styles,n=!XA(r.backgroundColor)||r.backgroundImage.length,i=[{style:r.borderTopStyle,color:r.borderTopColor,width:r.borderTopWidth},{style:r.borderRightStyle,color:r.borderRightColor,width:r.borderRightWidth},{style:r.borderBottomStyle,color:r.borderBottomColor,width:r.borderBottomWidth},{style:r.borderLeftStyle,color:r.borderLeftColor,width:r.borderLeftWidth}],s=EC(It(r.backgroundClip,0),e.curves),n||r.boxShadow.length?(this.ctx.save(),this.path(s),this.ctx.clip(),XA(r.backgroundColor)||(this.ctx.fillStyle=AA(r.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:l.sent(),this.ctx.restore(),r.boxShadow.slice(0).reverse().forEach(function(f){u.ctx.save();var g=Qr(e.curves),Q=f.inset?0:pC,w=uC(g,-Q+(f.inset?1:-1)*f.spread.number,(f.inset?1:-1)*f.spread.number,f.spread.number*(f.inset?-2:2),f.spread.number*(f.inset?-2:2));f.inset?(u.path(g),u.ctx.clip(),u.mask(w)):(u.mask(g),u.ctx.clip(),u.path(w)),u.ctx.shadowOffsetX=f.offsetX.number+Q,u.ctx.shadowOffsetY=f.offsetY.number,u.ctx.shadowColor=AA(f.color),u.ctx.shadowBlur=f.blur.number,u.ctx.fillStyle=f.inset?AA(f.color):"rgba(0,0,0,1)",u.ctx.fill(),u.ctx.restore()}),l.label=2;case 2:a=0,o=0,B=i,l.label=3;case 3:return o<B.length?(c=B[o],c.style!==0&&!XA(c.color)&&c.width>0?c.style!==2?[3,5]:[4,this.renderDashedDottedBorder(c.color,c.width,a,e.curves,2)]:[3,11]):[3,13];case 4:return l.sent(),[3,11];case 5:return c.style!==3?[3,7]:[4,this.renderDashedDottedBorder(c.color,c.width,a,e.curves,3)];case 6:return l.sent(),[3,11];case 7:return c.style!==4?[3,9]:[4,this.renderDoubleBorder(c.color,c.width,a,e.curves)];case 8:return l.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,a,e.curves)];case 10:l.sent(),l.label=11;case 11:a++,l.label=12;case 12:return o++,[3,3];case 13:return[2]}})})},t.prototype.renderDashedDottedBorder=function(e,r,n,i,s){return aA(this,void 0,void 0,function(){var a,o,B,c,u,l,f,g,Q,w,h,C,F,p,d,U,d,U;return iA(this,function(y){return this.ctx.save(),a=hC(i,n),o=yo(i,n),s===2&&(this.path(o),this.ctx.clip()),wA(o[0])?(B=o[0].start.x,c=o[0].start.y):(B=o[0].x,c=o[0].y),wA(o[1])?(u=o[1].end.x,l=o[1].end.y):(u=o[1].x,l=o[1].y),n===0||n===2?f=Math.abs(B-u):f=Math.abs(c-l),this.ctx.beginPath(),s===3?this.formatPath(a):this.formatPath(o.slice(0,2)),g=r<3?r*3:r*2,Q=r<3?r*2:r,s===3&&(g=r,Q=r),w=!0,f<=g*2?w=!1:f<=g*2+Q?(h=f/(2*g+Q),g*=h,Q*=h):(C=Math.floor((f+Q)/(g+Q)),F=(f-C*g)/(C-1),p=(f-(C+1)*g)/C,Q=p<=0||Math.abs(Q-F)<Math.abs(Q-p)?F:p),w&&(s===3?this.ctx.setLineDash([0,g+Q]):this.ctx.setLineDash([g,Q])),s===3?(this.ctx.lineCap="round",this.ctx.lineWidth=r):this.ctx.lineWidth=r*2+1.1,this.ctx.strokeStyle=AA(e),this.ctx.stroke(),this.ctx.setLineDash([]),s===2&&(wA(o[0])&&(d=o[3],U=o[0],this.ctx.beginPath(),this.formatPath([new I(d.end.x,d.end.y),new I(U.start.x,U.start.y)]),this.ctx.stroke()),wA(o[1])&&(d=o[1],U=o[2],this.ctx.beginPath(),this.formatPath([new I(d.end.x,d.end.y),new I(U.start.x,U.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},t.prototype.render=function(e){return aA(this,void 0,void 0,function(){var r;return iA(this,function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=AA(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),r=lC(e),[4,this.renderStack(r)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}})})},t})(Ho),yC=function(A){return A instanceof $a||A instanceof Za?!0:A instanceof zn&&A.type!==ur&&A.type!==cr},EC=function(A,t){switch(A){case 0:return Qr(t);case 2:return sC(t);case 1:default:return Cr(t)}},mC=function(A){switch(A){case 1:return"center";case 2:return"right";case 0:default:return"left"}},HC=["-apple-system","system-ui"],IC=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter(function(t){return HC.indexOf(t)===-1}):A},xC=(function(A){pA(t,A);function t(e,r){var n=A.call(this,e,r)||this;return n.canvas=r.canvas?r.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=r,n.canvas.width=Math.floor(r.width*r.scale),n.canvas.height=Math.floor(r.height*r.scale),n.canvas.style.width=r.width+"px",n.canvas.style.height=r.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-r.x,-r.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+r.width+"x"+r.height+" at "+r.x+","+r.y+") with scale "+r.scale),n}return t.prototype.render=function(e){return aA(this,void 0,void 0,function(){var r,n;return iA(this,function(i){switch(i.label){case 0:return r=Wn(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,LC(r)];case 1:return n=i.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=AA(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},t})(Ho),LC=function(A){return new Promise(function(t,e){var r=new Image;r.onload=function(){t(r)},r.onerror=e,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(A))})},bC=(function(){function A(t){var e=t.id,r=t.enabled;this.id=e,this.enabled=r,this.start=Date.now()}return A.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,Le([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},A.prototype.getTime=function(){return Date.now()-this.start},A.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,Le([this.id,this.getTime()+"ms"],t))},A.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,Le([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},A.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,Le([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},A.instances={},A})(),KC=(function(){function A(t,e){var r;this.windowBounds=e,this.instanceName="#"+A.instanceCount++,this.logger=new bC({id:this.instanceName,enabled:t.logging}),this.cache=(r=t.cache)!==null&&r!==void 0?r:new qQ(this,t)}return A.instanceCount=1,A})(),SC=function(A,t){return t===void 0&&(t={}),DC(A,t)};typeof window<"u"&&Qo.setContext(window);var DC=function(A,t){return aA(void 0,void 0,void 0,function(){var e,r,n,i,s,a,o,B,c,u,l,f,g,Q,w,h,C,F,p,d,y,U,y,v,m,L,E,K,H,S,Y,M,_,J,b,P,G,V,fA,CA;return iA(this,function(cA){switch(cA.label){case 0:if(!A||typeof A!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(e=A.ownerDocument,!e)throw new Error("Element is not attached to a Document");if(r=e.defaultView,!r)throw new Error("Document is not attached to a Window");return n={allowTaint:(v=t.allowTaint)!==null&&v!==void 0?v:!1,imageTimeout:(m=t.imageTimeout)!==null&&m!==void 0?m:15e3,proxy:t.proxy,useCORS:(L=t.useCORS)!==null&&L!==void 0?L:!1},i=fn({logging:(E=t.logging)!==null&&E!==void 0?E:!0,cache:t.cache},n),s={windowWidth:(K=t.windowWidth)!==null&&K!==void 0?K:r.innerWidth,windowHeight:(H=t.windowHeight)!==null&&H!==void 0?H:r.innerHeight,scrollX:(S=t.scrollX)!==null&&S!==void 0?S:r.pageXOffset,scrollY:(Y=t.scrollY)!==null&&Y!==void 0?Y:r.pageYOffset},a=new TA(s.scrollX,s.scrollY,s.windowWidth,s.windowHeight),o=new KC(i,a),B=(M=t.foreignObjectRendering)!==null&&M!==void 0?M:!1,c={allowTaint:(_=t.allowTaint)!==null&&_!==void 0?_:!1,onclone:t.onclone,ignoreElements:t.ignoreElements,inlineImages:B,copyStyles:B},o.logger.debug("Starting document clone with size "+a.width+"x"+a.height+" scrolled to "+-a.left+","+-a.top),u=new ho(o,A,c),l=u.clonedReferenceElement,l?[4,u.toIFrame(e,a)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return f=cA.sent(),g=jn(l)||TQ(l)?uf(l.ownerDocument):be(o,l),Q=g.width,w=g.height,h=g.left,C=g.top,F=TC(o,l,t.backgroundColor),p={canvas:t.canvas,backgroundColor:F,scale:(b=(J=t.scale)!==null&&J!==void 0?J:r.devicePixelRatio)!==null&&b!==void 0?b:1,x:((P=t.x)!==null&&P!==void 0?P:0)+h,y:((G=t.y)!==null&&G!==void 0?G:0)+C,width:(V=t.width)!==null&&V!==void 0?V:Math.ceil(Q),height:(fA=t.height)!==null&&fA!==void 0?fA:Math.ceil(w)},B?(o.logger.debug("Document cloned, using foreign object rendering"),y=new xC(o,p),[4,y.render(l)]):[3,3];case 2:return d=cA.sent(),[3,5];case 3:return o.logger.debug("Document cloned, element located at "+h+","+C+" with size "+Q+"x"+w+" using computed rendering"),o.logger.debug("Starting DOM parsing"),U=ja(o,l),F===U.styles.backgroundColor&&(U.styles.backgroundColor=_A.TRANSPARENT),o.logger.debug("Starting renderer for element at "+p.x+","+p.y+" with size "+p.width+"x"+p.height),y=new vC(o,p),[4,y.render(U)];case 4:d=cA.sent(),cA.label=5;case 5:return(!((CA=t.removeContainer)!==null&&CA!==void 0)||CA)&&(ho.destroy(f)||o.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),o.logger.debug("Finished rendering"),[2,d]}})})},TC=function(A,t,e){var r=t.ownerDocument,n=r.documentElement?qt(A,getComputedStyle(r.documentElement).backgroundColor):_A.TRANSPARENT,i=r.body?qt(A,getComputedStyle(r.body).backgroundColor):_A.TRANSPARENT,s=typeof e=="string"?qt(A,e):e===null?_A.TRANSPARENT:4294967295;return t===r.documentElement?XA(n)?XA(i)?s:i:n:s};class MC extends DA{constructor(t){super(),this.points=t,this.type=D.Scatter,this.draw=e=>{const r=e.coreLayers[D.BaseLayer],{animationDuration:n}=e.globals,{getHtmlId:i}=e,s=r.append("g"),a=this.points.map((o,B)=>{var u,l,f;const c=wt(o.bands,e);return s.append("circle").attr("id",`${i(D.Scatter)}-${B}`).attr("pointer-events","none").attr("cx",c.x(o.x)).attr("cy",c.y(o.y)).attr("r",((u=o.style)==null?void 0:u.radius)||"0.2%").attr("fill",((l=o.style)==null?void 0:l.color)||"black").style("opacity",((f=o.style)==null?void 0:f.opacity)||1)});this.zoom=async()=>{const o=[];a.forEach((B,c)=>{const u=wt(this.points[c].bands,e),l=B.transition().duration(n).attr("cx",u.x(this.points[c].x)).attr("cy",u.y(this.points[c].y)).end();o.push(l)}),await Promise.all(o)}}}}class _C extends DA{constructor(){super(),this.type=D.Area,this.lineBoundaryInfo=[],this.customTween=(e,r,n,i,s)=>{const a=e.lowResLinesSC[n],o=wt(e.linesDC[n].bands,s),B={x:[o.x(i.x[0]),o.x(i.x[1])],y:[o.y(i.y[0]),o.y(i.y[1])]},c=this.lineBoundaryInfo[r][n],{yCoordForXAxisSC:u,xMinSC:l,xMaxSC:f}=c;return g=>{const Q=a.map(({x:K,y:H})=>e.getNewPoint(K,H,g)),w=ht(Q,s),h=e.getNewPoint(0,u,g).y,C=e.getNewPoint(l,0,g).x,F=e.getNewPoint(f,0,g).x,p={...c,yCoordForXAxisSC:h,xMinSC:C,xMaxSC:F},d=e.getNewPointInverse(B.x[0],B.y[0],g),U=e.getNewPointInverse(B.x[1],B.y[1],g),y=e.getNewPoint(d.x,d.y,1),v=e.getNewPoint(U.x,U.y,1),m={x:o.x.invert(y.x),y:o.y.invert(y.y)},L={x:o.x.invert(v.x),y:o.y.invert(v.y)},E={x:[m.x,L.x],y:[m.y,L.y]};return this.closeSvgPath(w,B,E,p)}},this.closeSvgPath=(e,r,n,i)=>{const{yCoordForXAxisSC:s,xMinSC:a,xMaxSC:o,xMinDC:B,xMaxDC:c,canvasPath:u}=i,[l,f]=r.y,[g,Q]=n.y;let w;f<s&&s<l?w=s:f>=s?w=f:w=l;const h=Math.max(r.x[0],a),C=Math.min(r.x[1],o),F=Math.max(n.x[0],B),p=Math.min(n.x[1],c),d=(F+p)/2;if(e.length>0){const U=e[0].split("L")[0].substring(1).split(",").map(parseFloat)[1],y=`M${h},${w}L${h},${U}`,v=e[e.length-1].split("L").at(-1).split(",").map(parseFloat)[1],m=`L${C},${v}L${C},${w}Z`,L=e.map(E=>"L"+E.substring(1)).join("");return y+L+m}if(w===s){const U={x:d,y:Q/2};return this.ctx.isPointInPath(u,U.x,U.y)?cn(h,C,f,s):cn(h,C,l,s)}else{const U={x:d,y:(Q+g)/2};return this.ctx.isPointInPath(u,U.x,U.y)?cn(h,C,l,f):""}};const t=document.createElement("canvas");this.ctx=t.getContext("2d")}draw(t,e){if(t.chartOptions.logScale.y)return;const r=t.optionalLayers.filter(i=>i.type===D.Trace);this.lineBoundaryInfo=r.map(i=>i.linesDC.map(()=>null));const n=r.map((i,s)=>i.linesDC.map((a,o)=>{if(!a.fill||a.points.length===0)return;const B=wt(a.bands,t),c=i.lowResLinesSC[o],{x:u}=vs(a.points),l=a.points.map(y=>`L${y.x},${y.y}`).join(""),{x:f}=a.points[0],g=`M${f},0`,{x:Q}=a.points[a.points.length-1],w=`L${Q},0Z`,h=g+l+w,F={canvasPath:new Path2D(h),xMinDC:u.start,xMaxDC:u.end,yCoordForXAxisSC:B.y(0),xMinSC:B.x(u.start),xMaxSC:B.x(u.end)};this.lineBoundaryInfo[s][o]=F;const p={x:[B.x(e.x[0]),B.x(e.x[1])],y:[B.y(e.y[0]),B.y(e.y[1])]},d=ht(c,t),U=this.closeSvgPath(d,p,e,F);return t.coreLayers[D.BaseLayer].append("path").attr("fill",a.style.fillColor||"black").attr("opacity",a.style.fillOpacity||.1).attr("d",U)}));this.zoom=async i=>{const s=[];n.forEach((a,o)=>{a.forEach((B,c)=>{if(!B)return;const u=B.transition().duration(t.globals.animationDuration).attrTween("d",()=>this.customTween(r[o],o,c,i,t)).end();s.push(u)})}),await Promise.all(s)},this.afterZoom=i=>{i&&n.forEach((s,a)=>{s.forEach((o,B)=>{if(!o)return;const c=wt(r[a].linesDC[B].bands,t),u=this.lineBoundaryInfo[a][B];this.lineBoundaryInfo[a][B]={...u,yCoordForXAxisSC:c.y(0),xMinSC:c.x(u.xMinDC),xMaxSC:c.x(u.xMaxDC)};const l={x:[c.x(i.x[0]),c.x(i.x[1])],y:[c.y(i.y[0]),c.y(i.y[1])]},f=r[a].lowResLinesSC[B],g=ht(f,t),Q=this.closeSvgPath(g,l,i,this.lineBoundaryInfo[a][B]);o.attr("d",Q)})})}}}class OC extends DA{constructor(){super(),this.type=D.Custom}draw(){}}class RC{constructor(t){var e,r;return this.optionalLayers=[],this.isResponsive=!1,this.globals={animationDuration:350,tickConfig:{x:{count:0},y:{count:0,specifier:".2~s"}}},this.defaultMargin={top:20,bottom:35,left:50,right:20},this.exportToPng=null,this.autoscaledMaxExtents={x:{start:-1/0,end:1/0},y:{start:-1/0,end:1/0}},this.addAxes=(n={})=>(n.x&&(this.defaultMargin.bottom=80),n.y&&(this.defaultMargin.left=90),this.optionalLayers.push(new rf(n||{})),this),this.addGridLines=n=>(this.optionalLayers.push(new cf({x:n===void 0?!0:n.x??!1,y:n===void 0?!0:n.y??!1})),this),this.filterLinesForLogAxis=(n,i)=>{let s="";const a=[];for(let o=0;o<n.length;o++){const B=n[o];let c=B.points[0]&&B.points[0][i]>0,u={...B,points:[]};for(let l=0;l<B.points.length;l++)B.points[l][i]<=0&&(s=`You have tried to use ${i} axis log scale but there are traces with ${i} coordinates that are <= 0`),B.points[l][i]>0?(u.points.push(B.points[l]),c=!0):c&&(a.push(u),u={...B,points:[]},c=!1);c&&a.push(u)}return s&&console.warn(s),a},this.filterLines=n=>{let i=n;return this.options.logScale.x&&(i=this.filterLinesForLogAxis(i,"x")),this.options.logScale.y&&(i=this.filterLinesForLogAxis(i,"y")),i},this.addTraces=(n,i)=>{const s={RDPEpsilon:(i==null?void 0:i.RDPEpsilon)??null},a=this.filterLines(n);return this.optionalLayers.push(new af(a,s)),this},this.addArea=()=>(this.optionalLayers.push(new _C),this),this.addZoom=n=>{const i={lockAxis:(n==null?void 0:n.lockAxis)??null};return this.optionalLayers.push(new of(i)),this},this.addTooltips=n=>(this.optionalLayers.push(new Bf(n)),this),this.filterScatterPointsForLogAxis=(n,i)=>{const s=n.filter(a=>a[i]>0);return s.length!==n.length&&console.warn(`You have tried to use ${i} axis log scale but there are points with ${i} coordinates that are <= 0`),s},this.filterScatterPoints=n=>{let i=n;return this.options.logScale.x&&(i=this.filterScatterPointsForLogAxis(i,"x")),this.options.logScale.y&&(i=this.filterScatterPointsForLogAxis(i,"y")),i},this.addScatterPoints=n=>{const i=this.filterScatterPoints(n);return this.optionalLayers.push(new MC(i)),this},this.addCustomLifecycleHooks=n=>{const i=new OC;return Object.assign(i,n),this.optionalLayers.push(i),this},this.addCustomLayer=n=>(this.optionalLayers.push(n),this),this.makeResponsive=()=>(this.isResponsive=!0,this),this.addLinearPadding=(n,i)=>{const s=Math.abs(n.start-n.end);return{start:n.start-s*i,end:n.end+s*i}},this.addLogPadding=(n,i)=>{const s=Math.log(n.start),a=Math.log(n.end),o=Math.abs(s-a);return{start:Math.exp(s-o*i),end:Math.exp(a+o*i)}},this.processScales=n=>{var Q,w,h,C;const i=this.optionalLayers.filter(F=>F.type===D.Trace),s=this.optionalLayers.filter(F=>F.type===D.Scatter);let a=i.reduce((F,p)=>[...p.linesDC.map(d=>d.points).flat(),...F],[]);a=s.reduce((F,p)=>[...p.points.map(d=>({x:d.x,y:d.y})),...F],a);const o=vs(a),B=.02,c=.03,u=this.options.logScale.x?this.addLogPadding:this.addLinearPadding,l=this.options.logScale.y?this.addLogPadding:this.addLinearPadding,f=u(o.x,B),g=l(o.y,c);return{x:{start:((Q=n.x)==null?void 0:Q.start)??f.start,end:((w=n.x)==null?void 0:w.end)??f.end},y:{start:((h=n.y)==null?void 0:h.start)??g.start,end:((C=n.y)==null?void 0:C.end)??g.end}}},this.appendClipPath=(n,i,s,a)=>{const o={...n,...i,margin:{...n.margin,...i.margin}},{width:B,height:c,margin:u}=o,l=s.append("defs").append("svg:clipPath").attr("id",a(D.ClipPath));return l.append("svg:rect").attr("width",B-u.right-u.left).attr("height",c-u.bottom-u.top).attr("x",u.left).attr("y",u.top),{clipPath:l,clipPathBounds:o}},this.draw=(n,i,s,a,o={},B={})=>{var Y,M,_,J;const c=b=>`${b}-${this.id}`,{height:u,width:l,margin:f}=i;this.autoscaledMaxExtents=this.processScales(s);const g=Fi("svg").attr("id",c(D.Svg)).attr("width","100%").attr("height","100%").attr("viewBox",`0 0 ${l} ${u}`).attr("style","overflow: visible;").attr("preserveAspectRatio","xMinYMin"),{clipPath:Q,clipPathBounds:w}=this.appendClipPath(i,B,g,c),h=g.append("g").attr("id",c(D.BaseLayer)).attr("clip-path",`url(#${c(D.ClipPath)})`),{x:C,y:F}=this.autoscaledMaxExtents,p={x:[((Y=a.x)==null?void 0:Y.start)??C.start,((M=a.x)==null?void 0:M.end)??C.end],y:[((_=a.y)==null?void 0:_.start)??F.start,((J=a.y)==null?void 0:J.end)??F.end]},d="You have tried to use a log scale axis but the initial extents includes 0.Using automatic scales instead. Please set the initial extents to a range that does not include 0, or pass {} to default to the auto-scale.";if(this.options.logScale.x&&p.x.some(b=>b<=0)){console.warn(d);const{x:b}=this.processScales({});p.x=[b.start,b.end]}if(this.options.logScale.y&&p.y.some(b=>b<=0)){console.warn(d);const{y:b}=this.processScales({});p.y=[b.start,b.end]}const U=[f.left,l-f.right],y=[u-f.bottom,f.top],m=(this.options.logScale.x?on:an)().domain(p.x).range(U),E=(this.options.logScale.y?on:an)().domain(p.y).range(y);let K=10;l<500&&(K=6),l<300&&(K=3);let H=10;u<400&&(H=6),u<200&&(H=3),this.globals.tickConfig.x.count=K,this.globals.tickConfig.y.count=H;const S={id:this.id,getHtmlId:c,bounds:i,clipPathBounds:w,globals:this.globals,scaleConfig:{numericalScales:{x:m,y:E},scaleExtents:this.autoscaledMaxExtents,categoricalScales:{x:this.createCategoricalScale(o.x,U,m,"x"),y:this.createCategoricalScale(o.y,y,E,"y")}},coreLayers:{[D.Svg]:g,[D.ClipPath]:Q,[D.BaseLayer]:h},optionalLayers:this.optionalLayers,chartOptions:this.options};n.childNodes.forEach(b=>b.remove()),this.optionalLayers.forEach(b=>b.draw(S,p)),n.append(S.coreLayers[D.Svg].node())},this.appendTo=(n,i={},s={},a={},o={})=>{const B=(l,f)=>{const g={width:l,height:f,margin:this.defaultMargin};this.draw(n,g,i,s,a,o)},{width:c,height:u}=n.getBoundingClientRect();return B(c,u),this.isResponsive&&(new ResizeObserver(f=>{const{blockSize:g,inlineSize:Q}=f[0].borderBoxSize[0];B(Q,g)}).observe(n),window.addEventListener("resize",f=>{if(!f.view)return;const{innerHeight:g,innerWidth:Q}=f.view;B(Q,g)})),this.exportToPng=async(l="graph.png")=>{const g=(await SC(n)).toDataURL("image/png"),Q=document.createElement("a");Q.download=l,Q.href=`data:${g}`,Q.click(),Q.remove()},this},this.createCategoricalScale=(n,i,s,a)=>{if(!(n!=null&&n.length))return;const o=os().domain(n).range(i),B=o.bandwidth(),c=n.reduce((u,l)=>{const f=o(l),g=a==="x"?[f,f+B]:[f+B,f];return u[l]=s.copy().range(g),u},{});return{main:o,bands:c}},this.options={logScale:{x:((e=t==null?void 0:t.logScale)==null?void 0:e.x)??!1,y:((r=t==null?void 0:t.logScale)==null?void 0:r.y)??!1}},t!=null&&t.animationDuration&&(this.globals.animationDuration=t.animationDuration),this.id=Math.random().toString(26).substring(2,10),this}}RA.Chart=RC,RA.LayerType=D,RA.OptionalLayer=DA,Object.defineProperty(RA,Symbol.toStringTag,{value:"Module"})}));
|