gridviz 2.0.42 → 2.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gridviz.js +9015 -9011
- package/dist/gridviz.min.js +2 -2
- package/package.json +1 -1
- package/src/App.js +1 -1
- package/src/Tooltip.js +5 -1
package/dist/gridviz.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! For license information please see gridviz.min.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.gviz=e():t.gviz=e()}(self,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(){}function r(t){return null==t?n:function(){return this.querySelector(t)}}function o(){return[]}function i(t){return null==t?o:function(){return this.querySelectorAll(t)}}function a(t){return function(){return this.matches(t)}}function u(t){return function(e){return e.matches(t)}}t.r(e),t.d(e,{App:()=>ho,BackgroundLayer:()=>Wr,BackgroundLayerWMS:()=>Xr,BoundaryLayer:()=>uo,CSVGrid:()=>_r,ColorCategoryLegend:()=>iu,ColorDiscreteLegend:()=>tu,ColorLegend:()=>Va,CompositionStyle:()=>Wo,ContourStyle:()=>wi,Dataset:()=>Xn,DatasetComponent:()=>pr,DotDensityStyle:()=>Di,GeoCanvas:()=>Bn,JoyPlotStyle:()=>Fo,LabelLayer:()=>to,Layer:()=>Zn,LegoStyle:()=>va,MosaicStyle:()=>Sa,NinjaStarStyle:()=>Ea,PillarStyle:()=>ci,SegmentOrientationLegend:()=>wu,SegmentStyle:()=>qo,SegmentWidthLegend:()=>vu,ShapeColorSizeStyle:()=>Oo,SideCatStyle:()=>Pi,SideStyle:()=>di,SizeLegend:()=>su,SquareColorCatWGLStyle:()=>aa,SquareColorWGLStyle:()=>Vi,StrokeStyle:()=>To,Style:()=>bo,TanakaStyle:()=>Ji,TextStyle:()=>ni,TiledGrid:()=>Gr,getClass:()=>Cr,getEuronymeLabelLayer:()=>Yl,getEurostatBoundariesLayer:()=>Xl,getParameterByName:()=>Hl,sCircleHigh:()=>Pu,sCircleLow:()=>ju,sExp:()=>_u,sExpInverse:()=>ku,sExpRev:()=>Ou,sExpRevInverse:()=>Eu,sPow:()=>xu,sPowInverse:()=>Cu,sPowRev:()=>Su,sPowRevInverse:()=>Tu});var l=Array.prototype.find;function c(){return this.firstElementChild}var s=Array.prototype.filter;function f(){return Array.from(this.children)}function h(t){return new Array(t.length)}function y(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function p(t,e,n,r,o,i){for(var a,u=0,l=e.length,c=i.length;u<c;++u)(a=e[u])?(a.__data__=i[u],r[u]=a):n[u]=new y(t,i[u]);for(;u<l;++u)(a=e[u])&&(o[u]=a)}function v(t,e,n,r,o,i,a){var u,l,c,s=new Map,f=e.length,h=i.length,p=new Array(f);for(u=0;u<f;++u)(l=e[u])&&(p[u]=c=a.call(l,l.__data__,u,e)+"",s.has(c)?o[u]=l:s.set(c,l));for(u=0;u<h;++u)c=a.call(t,i[u],u,i)+"",(l=s.get(c))?(r[u]=l,l.__data__=i[u],s.delete(c)):n[u]=new y(t,i[u]);for(u=0;u<f;++u)(l=e[u])&&s.get(p[u])===l&&(o[u]=l)}function d(t){return t.__data__}function m(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function b(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}y.prototype={constructor:y,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var g="http://www.w3.org/1999/xhtml";const w={svg:"http://www.w3.org/2000/svg",xhtml:g,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function x(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),w.hasOwnProperty(e)?{space:w[e],local:t}:t}function S(t){return function(){this.removeAttribute(t)}}function _(t){return function(){this.removeAttributeNS(t.space,t.local)}}function O(t,e){return function(){this.setAttribute(t,e)}}function j(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function P(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function k(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function E(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function C(t){return function(){this.style.removeProperty(t)}}function T(t,e,n){return function(){this.style.setProperty(t,e,n)}}function A(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function M(t,e){return t.style.getPropertyValue(e)||E(t).getComputedStyle(t,null).getPropertyValue(e)}function R(t){return function(){delete this[t]}}function L(t,e){return function(){this[t]=e}}function z(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function F(t){return t.trim().split(/^|\s+/)}function I(t){return t.classList||new N(t)}function N(t){this._node=t,this._names=F(t.getAttribute("class")||"")}function B(t,e){for(var n=I(t),r=-1,o=e.length;++r<o;)n.add(e[r])}function D(t,e){for(var n=I(t),r=-1,o=e.length;++r<o;)n.remove(e[r])}function G(t){return function(){B(this,t)}}function Z(t){return function(){D(this,t)}}function U(t,e){return function(){(e.apply(this,arguments)?B:D)(this,t)}}function W(){this.textContent=""}function $(t){return function(){this.textContent=t}}function Y(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function X(){this.innerHTML=""}function H(t){return function(){this.innerHTML=t}}function V(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function q(){this.nextSibling&&this.parentNode.appendChild(this)}function K(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function J(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===g&&e.documentElement.namespaceURI===g?e.createElement(t):e.createElementNS(n,t)}}function Q(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function tt(t){var e=x(t);return(e.local?Q:J)(e)}function et(){return null}function nt(){var t=this.parentNode;t&&t.removeChild(this)}function rt(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ot(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function it(t){return function(){var e=this.__on;if(e){for(var n,r=0,o=-1,i=e.length;r<i;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?e.length=o:delete this.__on}}}function at(t,e,n){return function(){var r,o=this.__on,i=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(o)for(var a=0,u=o.length;a<u;++a)if((r=o[a]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),void(r.value=e);this.addEventListener(t.type,i,n),r={type:t.type,name:t.name,value:e,listener:i,options:n},o?o.push(r):this.__on=[r]}}function ut(t,e,n){var r=E(t),o=r.CustomEvent;"function"==typeof o?o=new o(e,n):(o=r.document.createEvent("Event"),n?(o.initEvent(e,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function lt(t,e){return function(){return ut(this,t,e)}}function ct(t,e){return function(){return ut(this,t,e.apply(this,arguments))}}N.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var st=[null];function ft(t,e){this._groups=t,this._parents=e}function ht(){return new ft([[document.documentElement]],st)}ft.prototype=ht.prototype={constructor:ft,select:function(t){"function"!=typeof t&&(t=r(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var a,u,l=e[i],c=l.length,s=o[i]=new Array(c),f=0;f<c;++f)(a=l[f])&&(u=t.call(a,a.__data__,f,l))&&("__data__"in a&&(u.__data__=a.__data__),s[f]=u);return new ft(o,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}(t):i(t);for(var e=this._groups,n=e.length,r=[],o=[],a=0;a<n;++a)for(var u,l=e[a],c=l.length,s=0;s<c;++s)(u=l[s])&&(r.push(t.call(u,u.__data__,s,l)),o.push(u));return new ft(r,o)},selectChild:function(t){return this.select(null==t?c:function(t){return function(){return l.call(this.children,t)}}("function"==typeof t?t:u(t)))},selectChildren:function(t){return this.selectAll(null==t?f:function(t){return function(){return s.call(this.children,t)}}("function"==typeof t?t:u(t)))},filter:function(t){"function"!=typeof t&&(t=a(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,u=e[o],l=u.length,c=r[o]=[],s=0;s<l;++s)(i=u[s])&&t.call(i,i.__data__,s,u)&&c.push(i);return new ft(r,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,d);var n,r=e?v:p,o=this._parents,i=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var a=i.length,u=new Array(a),l=new Array(a),c=new Array(a),s=0;s<a;++s){var f=o[s],h=i[s],y=h.length,b=m(t.call(f,f&&f.__data__,s,o)),g=b.length,w=l[s]=new Array(g),x=u[s]=new Array(g);r(f,h,w,x,c[s]=new Array(y),b,e);for(var S,_,O=0,j=0;O<g;++O)if(S=w[O]){for(O>=j&&(j=O+1);!(_=x[j])&&++j<g;);S._next=_||null}}return(u=new ft(u,o))._enter=l,u._exit=c,u},enter:function(){return new ft(this._enter||this._groups.map(h),this._parents)},exit:function(){return new ft(this._exit||this._groups.map(h),this._parents)},join:function(t,e,n){var r=this.enter(),o=this,i=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=e&&(o=e(o))&&(o=o.selection()),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,o=n.length,i=r.length,a=Math.min(o,i),u=new Array(o),l=0;l<a;++l)for(var c,s=n[l],f=r[l],h=s.length,y=u[l]=new Array(h),p=0;p<h;++p)(c=s[p]||f[p])&&(y[p]=c);for(;l<o;++l)u[l]=n[l];return new ft(u,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,o=t[e],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=b);for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var a,u=n[i],l=u.length,c=o[i]=new Array(l),s=0;s<l;++s)(a=u[s])&&(c[s]=a);c.sort(e)}return new ft(o,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var o,i=e[n],a=0,u=i.length;a<u;++a)(o=i[a])&&t.call(o,o.__data__,a,i);return this},attr:function(t,e){var n=x(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?_:S:"function"==typeof e?n.local?k:P:n.local?j:O)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?C:"function"==typeof e?A:T)(t,e,null==n?"":n)):M(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?R:"function"==typeof e?z:L)(t,e)):this.node()[t]},classed:function(t,e){var n=F(t+"");if(arguments.length<2){for(var r=I(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof e?U:e?G:Z)(n,e))},text:function(t){return arguments.length?this.each(null==t?W:("function"==typeof t?Y:$)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?X:("function"==typeof t?V:H)(t)):this.node().innerHTML},raise:function(){return this.each(q)},lower:function(){return this.each(K)},append:function(t){var e="function"==typeof t?t:tt(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:tt(t),o=null==e?et:"function"==typeof e?e:r(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)}))},remove:function(){return this.each(nt)},clone:function(t){return this.select(t?ot:rt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,o,i=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),a=i.length;if(!(arguments.length<2)){for(u=e?at:it,r=0;r<a;++r)this.each(u(i[r],e,n));return this}var u=this.node().__on;if(u)for(var l,c=0,s=u.length;c<s;++c)for(r=0,l=u[c];r<a;++r)if((o=i[r]).type===l.type&&o.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?ct:lt)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r,o=t[e],i=0,a=o.length;i<a;++i)(r=o[i])&&(yield r)}};const yt=ht;function pt(t){return"string"==typeof t?new ft([[document.querySelector(t)]],[document.documentElement]):new ft([[t]],st)}var vt={value:()=>{}};function dt(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new mt(r)}function mt(t){this._=t}function bt(t,e){for(var n,r=0,o=t.length;r<o;++r)if((n=t[r]).name===e)return n.value}function gt(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=vt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}mt.prototype=dt.prototype={constructor:mt,on:function(t,e){var n,r,o=this._,i=(r=o,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,u=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<u;)if(n=(t=i[a]).type)o[n]=gt(o[n],t.name,e);else if(null==e)for(n in o)o[n]=gt(o[n],t.name,null);return this}for(;++a<u;)if((n=(t=i[a]).type)&&(n=bt(o[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new mt(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,n=(r=this._[t]).length;i<n;++i)r[i].value.apply(e,o)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(e,n)}};const wt=dt,xt={capture:!0,passive:!1};function St(t){t.preventDefault(),t.stopImmediatePropagation()}function _t(t){return((t=Math.exp(t))+1/t)/2}const Ot=function t(e,n,r){function o(t,o){var i,a,u=t[0],l=t[1],c=t[2],s=o[0],f=o[1],h=o[2],y=s-u,p=f-l,v=y*y+p*p;if(v<1e-12)a=Math.log(h/c)/e,i=function(t){return[u+t*y,l+t*p,c*Math.exp(e*t*a)]};else{var d=Math.sqrt(v),m=(h*h-c*c+r*v)/(2*c*n*d),b=(h*h-c*c-r*v)/(2*h*n*d),g=Math.log(Math.sqrt(m*m+1)-m),w=Math.log(Math.sqrt(b*b+1)-b);a=(w-g)/e,i=function(t){var r,o=t*a,i=_t(g),s=c/(n*d)*(i*(r=e*o+g,((r=Math.exp(2*r))-1)/(r+1))-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[u+s*y,l+s*p,c*i/_t(e*o+g)]}}return i.duration=1e3*a*e/Math.SQRT2,i}return o.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},o}(Math.SQRT2,2,4);function jt(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}}return[t.pageX,t.pageY]}var Pt,kt,Et=0,Ct=0,Tt=0,At=1e3,Mt=0,Rt=0,Lt=0,zt="object"==typeof performance&&performance.now?performance:Date,Ft="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function It(){return Rt||(Ft(Nt),Rt=zt.now()+Lt)}function Nt(){Rt=0}function Bt(){this._call=this._time=this._next=null}function Dt(t,e,n){var r=new Bt;return r.restart(t,e,n),r}function Gt(){Rt=(Mt=zt.now())+Lt,Et=Ct=0;try{!function(){It(),++Et;for(var t,e=Pt;e;)(t=Rt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Et}()}finally{Et=0,function(){for(var t,e,n=Pt,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Pt=e);kt=t,Ut(r)}(),Rt=0}}function Zt(){var t=zt.now(),e=t-Mt;e>At&&(Lt-=e,Mt=t)}function Ut(t){Et||(Ct&&(Ct=clearTimeout(Ct)),t-Rt>24?(t<1/0&&(Ct=setTimeout(Gt,t-zt.now()-Lt)),Tt&&(Tt=clearInterval(Tt))):(Tt||(Mt=zt.now(),Tt=setInterval(Zt,At)),Et=1,Ft(Gt)))}function Wt(t,e,n){var r=new Bt;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}Bt.prototype=Dt.prototype={constructor:Bt,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?It():+n)+(null==e?0:+e),this._next||kt===this||(kt?kt._next=this:Pt=this,kt=this),this._call=t,this._time=n,Ut()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ut())}};var $t=wt("start","end","cancel","interrupt"),Yt=[],Xt=0,Ht=2,Vt=3,qt=5,Kt=6;function Jt(t,e,n,r,o,i){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,o=t.__transition;function i(l){var c,s,f,h;if(1!==n.state)return u();for(c in o)if((h=o[c]).name===n.name){if(h.state===Vt)return Wt(i);4===h.state?(h.state=Kt,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete o[c]):+c<e&&(h.state=Kt,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete o[c])}if(Wt((function(){n.state===Vt&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(l))})),n.state=Ht,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Ht){for(n.state=Vt,r=new Array(f=n.tween.length),c=0,s=-1;c<f;++c)(h=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(r[++s]=h);r.length=s+1}}function a(e){for(var o=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(u),n.state=qt,1),i=-1,a=r.length;++i<a;)r[i].call(t,o);n.state===qt&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){for(var r in n.state=Kt,n.timer.stop(),delete o[e],o)return;delete t.__transition}o[e]=n,n.timer=Dt((function(t){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=t&&i(t-n.delay)}),0,n.time)}(t,n,{name:e,index:r,group:o,on:$t,tween:Yt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Xt})}function Qt(t,e){var n=ee(t,e);if(n.state>Xt)throw new Error("too late; already scheduled");return n}function te(t,e){var n=ee(t,e);if(n.state>Vt)throw new Error("too late; already running");return n}function ee(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function ne(t,e){var n,r,o,i=t.__transition,a=!0;if(i){for(o in e=null==e?null:e+"",i)(n=i[o]).name===e?(r=n.state>Ht&&n.state<qt,n.state=Kt,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete i[o]):a=!1;a&&delete t.__transition}}function re(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var oe,ie=180/Math.PI,ae={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ue(t,e,n,r,o,i){var a,u,l;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,l/=u),t*r<e*n&&(t=-t,e=-e,l=-l,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(e,t)*ie,skewX:Math.atan(l)*ie,scaleX:a,scaleY:u}}function le(t,e,n,r){function o(t){return t.length?t.pop()+" ":""}return function(i,a){var u=[],l=[];return i=t(i),a=t(a),function(t,r,o,i,a,u){if(t!==o||r!==i){var l=a.push("translate(",null,e,null,n);u.push({i:l-4,x:re(t,o)},{i:l-2,x:re(r,i)})}else(o||i)&&a.push("translate("+o+e+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,u,l),function(t,e,n,i){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),i.push({i:n.push(o(n)+"rotate(",null,r)-2,x:re(t,e)})):e&&n.push(o(n)+"rotate("+e+r)}(i.rotate,a.rotate,u,l),function(t,e,n,i){t!==e?i.push({i:n.push(o(n)+"skewX(",null,r)-2,x:re(t,e)}):e&&n.push(o(n)+"skewX("+e+r)}(i.skewX,a.skewX,u,l),function(t,e,n,r,i,a){if(t!==n||e!==r){var u=i.push(o(i)+"scale(",null,",",null,")");a.push({i:u-4,x:re(t,n)},{i:u-2,x:re(e,r)})}else 1===n&&1===r||i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,u,l),i=a=null,function(t){for(var e,n=-1,r=l.length;++n<r;)u[(e=l[n]).i]=e.x(t);return u.join("")}}}var ce=le((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?ae:ue(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),se=le((function(t){return null==t?ae:(oe||(oe=document.createElementNS("http://www.w3.org/2000/svg","g")),oe.setAttribute("transform",t),(t=oe.transform.baseVal.consolidate())?ue((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):ae)}),", ",")",")");function fe(t,e){var n,r;return function(){var o=te(this,t),i=o.tween;if(i!==n)for(var a=0,u=(r=n=i).length;a<u;++a)if(r[a].name===e){(r=r.slice()).splice(a,1);break}o.tween=r}}function he(t,e,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var i=te(this,t),a=i.tween;if(a!==r){o=(r=a).slice();for(var u={name:e,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===e){o[l]=u;break}l===c&&o.push(u)}i.tween=o}}function ye(t,e,n){var r=t._id;return t.each((function(){var t=te(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return ee(t,r).value[e]}}function pe(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ve(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function de(){}var me=.7,be=1/me,ge="\\s*([+-]?\\d+)\\s*",we="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",xe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Se=/^#([0-9a-f]{3,8})$/,_e=new RegExp(`^rgb\\(${ge},${ge},${ge}\\)$`),Oe=new RegExp(`^rgb\\(${xe},${xe},${xe}\\)$`),je=new RegExp(`^rgba\\(${ge},${ge},${ge},${we}\\)$`),Pe=new RegExp(`^rgba\\(${xe},${xe},${xe},${we}\\)$`),ke=new RegExp(`^hsl\\(${we},${xe},${xe}\\)$`),Ee=new RegExp(`^hsla\\(${we},${xe},${xe},${we}\\)$`),Ce={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};function Te(){return this.rgb().formatHex()}function Ae(){return this.rgb().formatRgb()}function Me(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Se.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Re(e):3===n?new Fe(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Le(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Le(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=_e.exec(t))?new Fe(e[1],e[2],e[3],1):(e=Oe.exec(t))?new Fe(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=je.exec(t))?Le(e[1],e[2],e[3],e[4]):(e=Pe.exec(t))?Le(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ke.exec(t))?Ze(e[1],e[2]/100,e[3]/100,1):(e=Ee.exec(t))?Ze(e[1],e[2]/100,e[3]/100,e[4]):Ce.hasOwnProperty(t)?Re(Ce[t]):"transparent"===t?new Fe(NaN,NaN,NaN,0):null}function Re(t){return new Fe(t>>16&255,t>>8&255,255&t,1)}function Le(t,e,n,r){return r<=0&&(t=e=n=NaN),new Fe(t,e,n,r)}function ze(t,e,n,r){return 1===arguments.length?((o=t)instanceof de||(o=Me(o)),o?new Fe((o=o.rgb()).r,o.g,o.b,o.opacity):new Fe):new Fe(t,e,n,null==r?1:r);var o}function Fe(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Ie(){return`#${Ge(this.r)}${Ge(this.g)}${Ge(this.b)}`}function Ne(){const t=Be(this.opacity);return`${1===t?"rgb(":"rgba("}${De(this.r)}, ${De(this.g)}, ${De(this.b)}${1===t?")":`, ${t})`}`}function Be(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function De(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ge(t){return((t=De(t))<16?"0":"")+t.toString(16)}function Ze(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new We(t,e,n,r)}function Ue(t){if(t instanceof We)return new We(t.h,t.s,t.l,t.opacity);if(t instanceof de||(t=Me(t)),!t)return new We;if(t instanceof We)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),i=Math.max(e,n,r),a=NaN,u=i-o,l=(i+o)/2;return u?(a=e===i?(n-r)/u+6*(n<r):n===i?(r-e)/u+2:(e-n)/u+4,u/=l<.5?i+o:2-i-o,a*=60):u=l>0&&l<1?0:a,new We(a,u,l,t.opacity)}function We(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function $e(t){return(t=(t||0)%360)<0?t+360:t}function Ye(t){return Math.max(0,Math.min(1,t||0))}function Xe(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function He(t,e,n,r,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*n+(1+3*t+3*i-3*a)*r+a*o)/6}pe(de,Me,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Te,formatHex:Te,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ue(this).formatHsl()},formatRgb:Ae,toString:Ae}),pe(Fe,ze,ve(de,{brighter(t){return t=null==t?be:Math.pow(be,t),new Fe(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?me:Math.pow(me,t),new Fe(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Fe(De(this.r),De(this.g),De(this.b),Be(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:Ie,formatHex:Ie,formatHex8:function(){return`#${Ge(this.r)}${Ge(this.g)}${Ge(this.b)}${Ge(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ne,toString:Ne})),pe(We,(function(t,e,n,r){return 1===arguments.length?Ue(t):new We(t,e,n,null==r?1:r)}),ve(de,{brighter(t){return t=null==t?be:Math.pow(be,t),new We(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?me:Math.pow(me,t),new We(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,o=2*n-r;return new Fe(Xe(t>=240?t-240:t+120,o,r),Xe(t,o,r),Xe(t<120?t+240:t-120,o,r),this.opacity)},clamp(){return new We($e(this.h),Ye(this.s),Ye(this.l),Be(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 t=Be(this.opacity);return`${1===t?"hsl(":"hsla("}${$e(this.h)}, ${100*Ye(this.s)}%, ${100*Ye(this.l)}%${1===t?")":`, ${t})`}`}}));const Ve=t=>()=>t;function qe(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Ve(isNaN(t)?e:t)}const Ke=function t(e){var n=function(t){return 1==(t=+t)?qe:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Ve(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=ze(t)).r,(e=ze(e)).r),o=n(t.g,e.g),i=n(t.b,e.b),a=qe(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Je(t){return function(e){var n,r,o=e.length,i=new Array(o),a=new Array(o),u=new Array(o);for(n=0;n<o;++n)r=ze(e[n]),i[n]=r.r||0,a[n]=r.g||0,u[n]=r.b||0;return i=t(i),a=t(a),u=t(u),r.opacity=1,function(t){return r.r=i(t),r.g=a(t),r.b=u(t),r+""}}}Je((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),o=t[r],i=t[r+1],a=r>0?t[r-1]:2*o-i,u=r<e-1?t[r+2]:2*i-o;return He((n-r/e)*e,a,o,i,u)}})),Je((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),o=t[(r+e-1)%e],i=t[r%e],a=t[(r+1)%e],u=t[(r+2)%e];return He((n-r/e)*e,o,i,a,u)}}));var Qe=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tn=new RegExp(Qe.source,"g");function en(t,e){var n,r,o,i=Qe.lastIndex=tn.lastIndex=0,a=-1,u=[],l=[];for(t+="",e+="";(n=Qe.exec(t))&&(r=tn.exec(e));)(o=r.index)>i&&(o=e.slice(i,o),u[a]?u[a]+=o:u[++a]=o),(n=n[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,l.push({i:a,x:re(n,r)})),i=tn.lastIndex;return i<e.length&&(o=e.slice(i),u[a]?u[a]+=o:u[++a]=o),u.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,r=0;r<e;++r)u[(n=l[r]).i]=n.x(t);return u.join("")})}function nn(t,e){var n;return("number"==typeof e?re:e instanceof Me?Ke:(n=Me(e))?(e=n,Ke):en)(t,e)}function rn(t){return function(){this.removeAttribute(t)}}function on(t){return function(){this.removeAttributeNS(t.space,t.local)}}function an(t,e,n){var r,o,i=n+"";return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function un(t,e,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function ln(t,e,n){var r,o,i;return function(){var a,u,l=n(this);if(null!=l)return(a=this.getAttribute(t))===(u=l+"")?null:a===r&&u===o?i:(o=u,i=e(r=a,l));this.removeAttribute(t)}}function cn(t,e,n){var r,o,i;return function(){var a,u,l=n(this);if(null!=l)return(a=this.getAttributeNS(t.space,t.local))===(u=l+"")?null:a===r&&u===o?i:(o=u,i=e(r=a,l));this.removeAttributeNS(t.space,t.local)}}function sn(t,e){var n,r;function o(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,o)),n}return o._value=e,o}function fn(t,e){var n,r;function o(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,o)),n}return o._value=e,o}function hn(t,e){return function(){Qt(this,t).delay=+e.apply(this,arguments)}}function yn(t,e){return e=+e,function(){Qt(this,t).delay=e}}function pn(t,e){return function(){te(this,t).duration=+e.apply(this,arguments)}}function vn(t,e){return e=+e,function(){te(this,t).duration=e}}var dn=yt.prototype.constructor;function mn(t){return function(){this.style.removeProperty(t)}}var bn=0;function gn(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function wn(){return++bn}var xn=yt.prototype;gn.prototype=function(t){return yt().transition(t)}.prototype={constructor:gn,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=r(t));for(var o=this._groups,i=o.length,a=new Array(i),u=0;u<i;++u)for(var l,c,s=o[u],f=s.length,h=a[u]=new Array(f),y=0;y<f;++y)(l=s[y])&&(c=t.call(l,l.__data__,y,s))&&("__data__"in l&&(c.__data__=l.__data__),h[y]=c,Jt(h[y],e,n,y,h,ee(l,n)));return new gn(a,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=i(t));for(var r=this._groups,o=r.length,a=[],u=[],l=0;l<o;++l)for(var c,s=r[l],f=s.length,h=0;h<f;++h)if(c=s[h]){for(var y,p=t.call(c,c.__data__,h,s),v=ee(c,n),d=0,m=p.length;d<m;++d)(y=p[d])&&Jt(y,e,n,d,p,v);a.push(p),u.push(c)}return new gn(a,u,e,n)},selectChild:xn.selectChild,selectChildren:xn.selectChildren,filter:function(t){"function"!=typeof t&&(t=a(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,u=e[o],l=u.length,c=r[o]=[],s=0;s<l;++s)(i=u[s])&&t.call(i,i.__data__,s,u)&&c.push(i);return new gn(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,o=n.length,i=Math.min(r,o),a=new Array(r),u=0;u<i;++u)for(var l,c=e[u],s=n[u],f=c.length,h=a[u]=new Array(f),y=0;y<f;++y)(l=c[y]||s[y])&&(h[y]=l);for(;u<r;++u)a[u]=e[u];return new gn(a,this._parents,this._name,this._id)},selection:function(){return new dn(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=wn(),r=this._groups,o=r.length,i=0;i<o;++i)for(var a,u=r[i],l=u.length,c=0;c<l;++c)if(a=u[c]){var s=ee(a,e);Jt(a,t,n,c,u,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new gn(r,this._parents,t,n)},call:xn.call,nodes:xn.nodes,node:xn.node,size:xn.size,empty:xn.empty,each:xn.each,on:function(t,e){var n=this._id;return arguments.length<2?ee(this.node(),n).on.on(t):this.each(function(t,e,n){var r,o,i=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Qt:te;return function(){var a=i(this,t),u=a.on;u!==r&&(o=(r=u).copy()).on(e,n),a.on=o}}(n,t,e))},attr:function(t,e){var n=x(t),r="transform"===n?se:nn;return this.attrTween(t,"function"==typeof e?(n.local?cn:ln)(n,r,ye(this,"attr."+t,e)):null==e?(n.local?on:rn)(n):(n.local?un:an)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=x(t);return this.tween(n,(r.local?sn:fn)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?ce:nn;return null==e?this.styleTween(t,function(t,e){var n,r,o;return function(){var i=M(this,t),a=(this.style.removeProperty(t),M(this,t));return i===a?null:i===n&&a===r?o:o=e(n=i,r=a)}}(t,r)).on("end.style."+t,mn(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,o,i;return function(){var a=M(this,t),u=n(this),l=u+"";return null==u&&(this.style.removeProperty(t),l=u=M(this,t)),a===l?null:a===r&&l===o?i:(o=l,i=e(r=a,u))}}(t,r,ye(this,"style."+t,e))).each(function(t,e){var n,r,o,i,a="style."+e,u="end."+a;return function(){var l=te(this,t),c=l.on,s=null==l.value[a]?i||(i=mn(e)):void 0;c===n&&o===s||(r=(n=c).copy()).on(u,o=s),l.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,o,i=n+"";return function(){var a=M(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,o;function i(){var i=e.apply(this,arguments);return i!==o&&(r=(o=i)&&function(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}(t,i,n)),r}return i._value=e,i}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(ye(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){return function(e){this.textContent=t.call(this,e)}}(r)),e}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,o=ee(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===t)return r.value;return null}return this.each((null==e?fe:he)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?hn:yn)(e,t)):ee(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?pn:vn)(e,t)):ee(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){te(this,t).ease=e}}(e,t)):ee(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;te(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,r=n._id,o=n.size();return new Promise((function(i,a){var u={value:a},l={value:function(){0==--o&&i()}};n.each((function(){var n=te(this,r),o=n.on;o!==t&&((e=(t=o).copy())._.cancel.push(u),e._.interrupt.push(u),e._.end.push(l)),n.on=e})),0===o&&i()}))},[Symbol.iterator]:xn[Symbol.iterator]};var Sn={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function _n(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}yt.prototype.interrupt=function(t){return this.each((function(){ne(this,t)}))},yt.prototype.transition=function(t){var e,n;t instanceof gn?(e=t._id,t=t._name):(e=wn(),(n=Sn).time=It(),t=null==t?null:t+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,u=r[i],l=u.length,c=0;c<l;++c)(a=u[c])&&Jt(a,t,e,c,u,n||_n(a,e));return new gn(r,this._parents,t,e)};const On=t=>()=>t;function jn(t,{sourceEvent:e,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function Pn(t,e,n){this.k=t,this.x=e,this.y=n}Pn.prototype={constructor:Pn,scale:function(t){return 1===t?this:new Pn(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Pn(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var kn=new Pn(1,0,0);function En(t){t.stopImmediatePropagation()}function Cn(t){t.preventDefault(),t.stopImmediatePropagation()}function Tn(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function An(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Mn(){return this.__zoom||kn}function Rn(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Ln(){return navigator.maxTouchPoints||"ontouchstart"in this}function zn(t,e,n){var r=t.invertX(e[0][0])-n[0][0],o=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function Fn(t){return Fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fn(t)}function In(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Nn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Fn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Fn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Fn(o)?o:String(o)),r)}var o}Pn.prototype;var Bn=function(){function t(e,n,r,o){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.opts=o||{},this.canvas=e,this.w=this.canvas.offsetWidth,this.h=this.canvas.offsetHeight,this.canvas.width=this.w,this.canvas.height=this.h;var a=this.canvas.getContext("2d");if(!a)throw"Impossible to create canvas 2D context";if(this.ctx=a,this.center=n||{x:.5*this.w,y:.5*this.h},this.zf=r,this.backgroundColor=o.backgroundColor||"white",this.onZoomStartFun=o.onZoomStartFun,this.onZoomEndFun=o.onZoomEndFun,this.onZoomFun=o.onZoomFun,this.extGeo={xMin:NaN,xMax:NaN,yMin:NaN,yMax:NaN},this.updateExtentGeo(),!o.disableZoom){var u=kn;(function(){var t,e,n,r=Tn,o=An,i=zn,a=Rn,u=Ln,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],s=250,f=Ot,h=wt("start","zoom","end"),y=500,p=150,v=0,d=10;function m(t){t.property("__zoom",Mn).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",P).filter(u).on("touchstart.zoom",k).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",C).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(t,e){return(e=Math.max(l[0],Math.min(l[1],e)))===t.k?t:new Pn(e,t.x,t.y)}function g(t,e,n){var r=e[0]-n[0]*t.k,o=e[1]-n[1]*t.k;return r===t.x&&o===t.y?t:new Pn(t.k,r,o)}function w(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function x(t,e,n,r){t.on("start.zoom",(function(){S(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){S(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,i=arguments,a=S(t,i).event(r),u=o.apply(t,i),l=null==n?w(u):"function"==typeof n?n.apply(t,i):n,c=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),s=t.__zoom,h="function"==typeof e?e.apply(t,i):e,y=f(s.invert(l).concat(c/s.k),h.invert(l).concat(c/h.k));return function(t){if(1===t)t=h;else{var e=y(t),n=c/e[2];t=new Pn(n,l[0]-e[0]*n,l[1]-e[1]*n)}a.zoom(null,t)}}))}function S(t,e,n){return!n&&t.__zooming||new _(t,e)}function _(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=o.apply(t,e),this.taps=0}function O(t,...e){if(r.apply(this,arguments)){var n=S(this,e).event(t),o=this.__zoom,u=Math.max(l[0],Math.min(l[1],o.k*Math.pow(2,a.apply(this,arguments)))),s=jt(t);if(n.wheel)n.mouse[0][0]===s[0]&&n.mouse[0][1]===s[1]||(n.mouse[1]=o.invert(n.mouse[0]=s)),clearTimeout(n.wheel);else{if(o.k===u)return;n.mouse=[s,o.invert(s)],ne(this),n.start()}Cn(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),p),n.zoom("mouse",i(g(b(o,u),n.mouse[0],n.mouse[1]),n.extent,c))}}function j(t,...e){if(!n&&r.apply(this,arguments)){var o=t.currentTarget,a=S(this,e,!0).event(t),u=pt(t.view).on("mousemove.zoom",(function(t){if(Cn(t),!a.moved){var e=t.clientX-s,n=t.clientY-f;a.moved=e*e+n*n>v}a.event(t).zoom("mouse",i(g(a.that.__zoom,a.mouse[0]=jt(t,o),a.mouse[1]),a.extent,c))}),!0).on("mouseup.zoom",(function(t){u.on("mousemove.zoom mouseup.zoom",null),function(t,e){var n=t.document.documentElement,r=pt(t).on("dragstart.drag",null);e&&(r.on("click.drag",St,xt),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(t.view,a.moved),Cn(t),a.event(t).end()}),!0),l=jt(t,o),s=t.clientX,f=t.clientY;!function(t){var e=t.document.documentElement,n=pt(t).on("dragstart.drag",St,xt);"onselectstart"in e?n.on("selectstart.drag",St,xt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(t.view),En(t),a.mouse=[l,this.__zoom.invert(l)],ne(this),a.start()}}function P(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,a=jt(t.changedTouches?t.changedTouches[0]:t,this),u=n.invert(a),l=n.k*(t.shiftKey?.5:2),f=i(g(b(n,l),a,u),o.apply(this,e),c);Cn(t),s>0?pt(this).transition().duration(s).call(x,f,a,t):pt(this).call(m.transform,f,a,t)}}function k(n,...o){if(r.apply(this,arguments)){var i,a,u,l,c=n.touches,s=c.length,f=S(this,o,n.changedTouches.length===s).event(n);for(En(n),a=0;a<s;++a)l=[l=jt(u=c[a],this),this.__zoom.invert(l),u.identifier],f.touch0?f.touch1||f.touch0[2]===l[2]||(f.touch1=l,f.taps=0):(f.touch0=l,i=!0,f.taps=1+!!t);t&&(t=clearTimeout(t)),i&&(f.taps<2&&(e=l[0],t=setTimeout((function(){t=null}),y)),ne(this),f.start())}}function E(t,...e){if(this.__zooming){var n,r,o,a,u=S(this,e).event(t),l=t.changedTouches,s=l.length;for(Cn(t),n=0;n<s;++n)o=jt(r=l[n],this),u.touch0&&u.touch0[2]===r.identifier?u.touch0[0]=o:u.touch1&&u.touch1[2]===r.identifier&&(u.touch1[0]=o);if(r=u.that.__zoom,u.touch1){var f=u.touch0[0],h=u.touch0[1],y=u.touch1[0],p=u.touch1[1],v=(v=y[0]-f[0])*v+(v=y[1]-f[1])*v,d=(d=p[0]-h[0])*d+(d=p[1]-h[1])*d;r=b(r,Math.sqrt(v/d)),o=[(f[0]+y[0])/2,(f[1]+y[1])/2],a=[(h[0]+p[0])/2,(h[1]+p[1])/2]}else{if(!u.touch0)return;o=u.touch0[0],a=u.touch0[1]}u.zoom("touch",i(g(r,o,a),u.extent,c))}}function C(t,...r){if(this.__zooming){var o,i,a=S(this,r).event(t),u=t.changedTouches,l=u.length;for(En(t),n&&clearTimeout(n),n=setTimeout((function(){n=null}),y),o=0;o<l;++o)i=u[o],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=jt(i,this),Math.hypot(e[0]-i[0],e[1]-i[1])<d)){var c=pt(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(t,e,n,r){var o=t.selection?t.selection():t;o.property("__zoom",Mn),t!==o?x(t,e,n,r):o.interrupt().each((function(){S(this,arguments).event(r).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},m.scaleBy=function(t,e,n,r){m.scaleTo(t,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),n,r)},m.scaleTo=function(t,e,n,r){m.transform(t,(function(){var t=o.apply(this,arguments),r=this.__zoom,a=null==n?w(t):"function"==typeof n?n.apply(this,arguments):n,u=r.invert(a),l="function"==typeof e?e.apply(this,arguments):e;return i(g(b(r,l),a,u),t,c)}),n,r)},m.translateBy=function(t,e,n,r){m.transform(t,(function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),c)}),null,r)},m.translateTo=function(t,e,n,r,a){m.transform(t,(function(){var t=o.apply(this,arguments),a=this.__zoom,u=null==r?w(t):"function"==typeof r?r.apply(this,arguments):r;return i(kn.translate(u[0],u[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,c)}),r,a)},_.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var e=pt(this.that).datum();h.call(t,this.that,new jn(t,{sourceEvent:this.sourceEvent,target:m,type:t,transform:this.that.__zoom,dispatch:h}),e)}},m.wheelDelta=function(t){return arguments.length?(a="function"==typeof t?t:On(+t),m):a},m.filter=function(t){return arguments.length?(r="function"==typeof t?t:On(!!t),m):r},m.touchable=function(t){return arguments.length?(u="function"==typeof t?t:On(!!t),m):u},m.extent=function(t){return arguments.length?(o="function"==typeof t?t:On([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),m):o},m.scaleExtent=function(t){return arguments.length?(l[0]=+t[0],l[1]=+t[1],m):[l[0],l[1]]},m.translateExtent=function(t){return arguments.length?(c[0][0]=+t[0][0],c[1][0]=+t[1][0],c[0][1]=+t[0][1],c[1][1]=+t[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(t){return arguments.length?(i=t,m):i},m.duration=function(t){return arguments.length?(s=+t,m):s},m.interpolate=function(t){return arguments.length?(f=t,m):f},m.on=function(){var t=h.on.apply(h,arguments);return t===h?m:t},m.clickDistance=function(t){return arguments.length?(v=(t=+t)*t,m):Math.sqrt(v)},m.tapDistance=function(t){return arguments.length?(d=+t,m):d},m})().wheelDelta((function(t){return-t.deltaY*(1===t.deltaMode?.07:t.deltaMode?1:.004)})).on("zoom",(function(t){var e=t.transform,n=u.k/e.k;if(1==n){var r=u.x-e.x,o=u.y-e.y;i.pan(r*i.getZf(),-o*i.getZf())}else{var a=t.sourceEvent;if(a instanceof WheelEvent)i.zoom(n,i.pixToGeoX(t.sourceEvent.offsetX),i.pixToGeoY(t.sourceEvent.offsetY));else if(a instanceof TouchEvent){var l,c=0,s=0,f=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return In(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?In(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(a.targetTouches);try{for(f.s();!(l=f.n()).done;){var h=l.value;c+=h.clientX,s+=h.clientY}}catch(t){f.e(t)}finally{f.f()}c/=a.targetTouches.length,s/=a.targetTouches.length,i.zoom(n,i.pixToGeoX(c),i.pixToGeoY(s))}}u=e,i.onZoomFun&&i.onZoomFun(t)})).on("start",(function(t){i.canvasSave.c=document.createElement("canvas"),i.canvasSave.c.setAttribute("width",""+i.w),i.canvasSave.c.setAttribute("height",""+i.h),i.canvasSave.c.getContext("2d").drawImage(i.canvas,0,0),i.canvasSave.dx=0,i.canvasSave.dy=0,i.canvasSave.f=1,i.onZoomStartFun&&i.onZoomStartFun(t)})).on("end",(function(t){i.redraw(!0),i.canvasSave={c:null,dx:0,dy:0,f:1},i.onZoomEndFun&&i.onZoomEndFun(t)}))(pt(this.canvas))}this.zfExtent=[0,1/0],this.canvasSave={c:null,dx:0,dy:0,f:1}}var e,n,r;return e=t,n=[{key:"setCenter",value:function(t){this.center=t}},{key:"getCenter",value:function(){return this.center}},{key:"setZf",value:function(t){this.zf=t,this.slider&&this.slider.attr("value",+this.zf)}},{key:"getZf",value:function(){return this.zf}},{key:"setZfExtent",value:function(t){this.zfExtent=t}},{key:"getZfExtent",value:function(){return this.zfExtent}},{key:"initCanvasTransform",value:function(){this.ctx.setTransform(1,0,0,1,0,0)}},{key:"setCanvasTransform",value:function(){var t=1/this.getZf(),e=-this.center.x/this.getZf()+.5*this.w,n=this.center.y/this.getZf()+.5*this.h;this.ctx.setTransform(t,0,0,-t,e,n)}},{key:"getWebGLTransform",value:function(){var t=2/(this.w*this.getZf()),e=2/(this.h*this.getZf());return[t,0,0,0,e,0,-t*this.center.x,-e*this.center.y,1]}},{key:"redraw",value:function(){throw new Error("Method redraw not implemented.")}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"white";this.opts.transparentBackground?this.ctx.clearRect(0,0,this.w,this.h):(this.ctx&&(this.ctx.fillStyle=t),this.ctx.fillRect(0,0,this.w,this.h))}},{key:"pan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.center.x+=t,this.center.y+=e,this.updateExtentGeo(),this.canvasSave.c&&(this.canvasSave.dx-=t/this.getZf(),this.canvasSave.dy+=e/this.getZf(),this.clear(this.backgroundColor),this.ctx.drawImage(this.canvasSave.c,this.canvasSave.dx,this.canvasSave.dy))}},{key:"zoom",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.center.x,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.center.y;if(!(this.zfExtent[0]==this.getZf()&&t<=1||this.zfExtent[1]==this.getZf()&&t>=1)){var r=t*this.getZf();r<this.zfExtent[0]&&(t=this.zfExtent[0]/this.getZf()),r>this.zfExtent[1]&&(t=this.zfExtent[1]/this.getZf()),this.setZf(t*this.getZf());var o=(e-this.center.x)*(1-t);this.center.x+=o;var i=(n-this.center.y)*(1-t);this.center.y+=i,this.updateExtentGeo(),this.canvasSave.c&&(this.clear(this.backgroundColor),this.canvasSave.f/=t,this.canvasSave.dx=this.geoToPixX(e)*(1-this.canvasSave.f),this.canvasSave.dy=this.geoToPixY(n)*(1-this.canvasSave.f),this.clear(this.backgroundColor),this.ctx.drawImage(this.canvasSave.c,this.canvasSave.dx,this.canvasSave.dy,this.canvasSave.f*this.canvasSave.c.width,this.canvasSave.f*this.canvasSave.c.height))}}},{key:"updateExtentGeo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return this.extGeo={xMin:this.pixToGeoX(-t),xMax:this.pixToGeoX(this.w+t),yMin:this.pixToGeoY(this.h+t),yMax:this.pixToGeoY(-t)},this.extGeo}},{key:"toDraw",value:function(t){return!(t.x<this.extGeo.xMin||t.x>this.extGeo.xMax||t.y<this.extGeo.yMin||t.y>this.extGeo.yMax)}},{key:"geoToPixX",value:function(t){return(t-this.center.x)/this.getZf()+.5*this.w}},{key:"geoToPixY",value:function(t){return-(t-this.center.y)/this.getZf()+.5*this.h}},{key:"pixToGeoX",value:function(t){return(t-.5*this.w)*this.getZf()+this.center.x}},{key:"pixToGeoY",value:function(t){return-(t-.5*this.h)*this.getZf()+this.center.y}},{key:"setViewFromURL",value:function(){var e=t.getParameterByName("x"),n=t.getParameterByName("y"),r=t.getParameterByName("z"),o=this.getCenter();null==e||null==e||isNaN(+e)||(o.x=+e),null==n||null==n||isNaN(+n)||(o.y=+n),null==r||null==r||isNaN(+r)||this.setZf(+r)}},{key:"addZoomSlider",value:function(t,e){(e=e||{}).width=e.width||"30px",e.height=e.height||"300px";var n=pt("#"+t);if(n.empty())return console.error("Could not find div element to build zoom slider. Id: "+t),this;var r=this;return this.slider=n.append("input").attr("type","range").attr("min",this.getZfExtent()[0]).attr("max",this.getZfExtent()[1]).attr("value",this.getZf()).on("input",(function(t){if(this&&this.value){var e=+this.value;pt(this).attr("value",e),r.setZf(e),r.redraw()}})).style("width",e.width).style("height",e.height).style("opacity",.7).on("mouseover",(function(t){pt(this).style("opacity",1)})).on("mouseout",(function(t){pt(this).style("opacity",.7)})).style("-webkit-appearance","slider-vertical").style("writing-mode","bt-lr").attr("orient","vertical").style("background","lightgray").style("outline","none").style("-webkit-transition",".2s").style("transition","opacity .2s"),this}}],r=[{key:"getParameterByName",value:function(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(location.search);return e?decodeURIComponent(e[1].replace(/\+/g," ")):null}}],n&&Nn(e.prototype,n),r&&Nn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Dn(t){return Dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dn(t)}function Gn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Dn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Dn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Dn(o)?o:String(o)),r)}var o}var Zn=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=r||{},this.dataset=e,this.styles=n,this.visible=0!=r.visible,this.minZoom=r.minZoom||0,this.maxZoom=r.maxZoom||1/0,this.minZoom>=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");this.pixNb=r.pixNb||3,this.cellInfoHTML=r.cellInfoHTML||t.defaultCellInfoHTML}var e,n,r;return e=t,r=[{key:"defaultCellInfoHTML",value:function(t){for(var e=[],n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];"x"!==o&&"y"!==o&&e.push("<b>",o,"</b>"," : ",t[o],"<br>")}return e.join("")}}],(n=[{key:"getDatasetComponent",value:function(t){if(!(t<this.minZoom||t>this.maxZoom)){if(1==this.dataset.datasetComponents.length)return this.dataset.datasetComponents[0];for(var e=this.dataset.resolutions,n=0,r=e[n]/this.pixNb;r<t&&n<e.length;)r=e[++n]/this.pixNb;return n==e.length?this.dataset.datasetComponents[e.length-1]:this.dataset.datasetComponents[n]}}}])&&Gn(e.prototype,n),r&&Gn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Un(t){return Un="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Un(t)}function Wn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return $n(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$n(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function $n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Yn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Un(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Un(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Un(o)?o:String(o)),r)}var o}var Xn=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=r||{},this.datasetComponents=e,this.resolutions=n,this.datasetComponents.length>1&&this.datasetComponents.length!=this.resolutions.length)throw new Error("Uncompatible number of datasets and resolutions: "+this.datasetComponents.length+" "+this.resolutions.length);r.preprocess&&this.setPrepocesses(r.preprocess)}var e,n,r;return e=t,r=[{key:"make",value:function(e,n,r){var o,i=[],a=Wn(e);try{for(a.s();!(o=a.n()).done;){var u=o.value;i.push(n(u))}}catch(t){a.e(t)}finally{a.f()}return new t(i,e,r)}}],(n=[{key:"setPrepocesses",value:function(t){var e,n=Wn(this.datasetComponents);try{for(n.s();!(e=n.n()).done;)e.value.preprocess=t}catch(t){n.e(t)}finally{n.f()}return this}}])&&Yn(e.prototype,n),r&&Yn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Hn(t){return Hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hn(t)}function Vn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qn(r.key),r)}}function qn(t){var e=function(t,e){if("object"!==Hn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Hn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Hn(e)?e:String(e)}var Kn=function(){function t(e){var n,r,o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,o=function(t,e){var n=this.tooltip.node(),r=e.width;if(n.offsetLeft+n.clientWidth>r){var o=t.pageX-e.left-n.clientWidth-this.xOffset;if(n.style.left=o+"px",n.offsetLeft+n.clientWidth+e.left>t.pageX){var i=t.pageX-(n.clientWidth+this.xOffset+e.left);n.style.left=i+"px"}}n.offsetTop+n.clientHeight>e.height&&(n.style.top=n.offsetTop-n.clientHeight+"px")},(r=qn(r="ensureTooltipInsideContainer"))in n?Object.defineProperty(n,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[r]=o,e=e||{},this.div=e.div||"tooltip_eurostat",this.maxWidth=e.maxWidth||"20em",this.fontSize=e.fontSize||"1.2em",this.background=e.background||"white",this.padding=e.padding||"5px",this.border=e.border||"0px",this["border-radius"]=e["border-radius"]||"5px",this["box-shadow"]=e["box-shadow"]||"5px 5px 5px grey",this["font-family"]=e["font-family"]||"Helvetica, Arial, sans-serif",this.transitionDuration=e.transitionDuration||100,this.xOffset=e.xOffset||30,this.yOffset=e.yOffset||20,this.yMouseOffset=e.yMouseOffset||0,this.xMouseOffset=e.xMouseOffset||0,this.parentElement=e.parentElement||document.body,this.tooltip=pt("#"+this.div),this.tooltip.empty()&&(this.tooltip=pt("#"+this.parentElement.id).append("div").attr("id",this.div)),this.tooltip.style("max-width",this.maxWidth),this.tooltip.style("overflow","hidden"),this.tooltip.style("font-size",this.fontSize),this.tooltip.style("background",this.background),this.tooltip.style("padding",this.padding),this.tooltip.style("border",this.border),this.tooltip.style("border-radius",this["border-radius"]),this.tooltip.style("box-shadow",this["box-shadow"]),this.tooltip.style("font-family",this["font-family"]),this.tooltip.style("position","absolute"),this.tooltip.style("pointer-events","none"),this.tooltip.style("opacity","0"),this.tooltip.attr("role","tooltip").attr("aria-live","polite")}var e,n;return e=t,n=[{key:"show",value:function(){this.tooltip.transition().duration(this.transitionDuration).style("opacity",1)}},{key:"hide",value:function(){this.tooltip.transition().duration(this.transitionDuration).style("opacity",0)}},{key:"html",value:function(t){this.tooltip.html(t)}},{key:"setPosition",value:function(t){var e=this.parentElement.getBoundingClientRect();this.tooltip.style("left",t.pageX-e.left+this.xOffset+"px").style("top",t.pageY-e.top-this.yOffset+"px"),this.ensureTooltipInsideContainer(t,e)}},{key:"style",value:function(t,e){return 1==arguments.length?this.tooltip.style(t):(this.tooltip.style(t,e),this)}},{key:"attr",value:function(t,e){return 1==arguments.length?this.tooltip.attr(t):(this.tooltip.attr(t,e),this)}}],n&&Vn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Jn={},Qn={};function tr(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function er(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function nr(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function rr(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,o=[],i=t.length,a=0,u=0,l=i<=0,c=!1;function s(){if(l)return Qn;if(c)return c=!1,Jn;var e,r,o=a;if(34===t.charCodeAt(o)){for(;a++<i&&34!==t.charCodeAt(a)||34===t.charCodeAt(++a););return(e=a)>=i?l=!0:10===(r=t.charCodeAt(a++))?c=!0:13===r&&(c=!0,10===t.charCodeAt(a)&&++a),t.slice(o+1,e-1).replace(/""/g,'"')}for(;a<i;){if(10===(r=t.charCodeAt(e=a++)))c=!0;else if(13===r)c=!0,10===t.charCodeAt(a)&&++a;else if(r!==n)continue;return t.slice(o,e)}return l=!0,t.slice(o,i)}for(10===t.charCodeAt(i-1)&&--i,13===t.charCodeAt(i-1)&&--i;(r=s())!==Qn;){for(var f=[];r!==Jn&&r!==Qn;)f.push(r),r=s();e&&null==(f=e(f,u++))||o.push(f)}return o}function o(e,n){return e.map((function(e){return n.map((function(t){return a(e[t])})).join(t)}))}function i(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?(o=(n=t).getUTCHours(),i=n.getUTCMinutes(),a=n.getUTCSeconds(),u=n.getUTCMilliseconds(),isNaN(n)?"Invalid Date":((r=n.getUTCFullYear())<0?"-"+nr(-r,6):r>9999?"+"+nr(r,6):nr(r,4))+"-"+nr(n.getUTCMonth()+1,2)+"-"+nr(n.getUTCDate(),2)+(u?"T"+nr(o,2)+":"+nr(i,2)+":"+nr(a,2)+"."+nr(u,3)+"Z":a?"T"+nr(o,2)+":"+nr(i,2)+":"+nr(a,2)+"Z":i||o?"T"+nr(o,2)+":"+nr(i,2)+"Z":"")):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t;var n,r,o,i,a,u}return{parse:function(t,e){var n,o,i=r(t,(function(t,r){if(n)return n(t,r-1);o=t,n=e?function(t,e){var n=tr(t);return function(r,o){return e(n(r),o,t)}}(t,e):tr(t)}));return i.columns=o||[],i},parseRows:r,format:function(e,n){return null==n&&(n=er(e)),[n.map(a).join(t)].concat(o(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=er(t)),o(t,e).join("\n")},formatRows:function(t){return t.map(i).join("\n")},formatRow:i,formatValue:a}}var or=rr(","),ir=or.parse,ar=(or.parseRows,or.format,or.formatBody,or.formatRows,or.formatRow,or.formatValue,rr("\t")),ur=ar.parse;function lr(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function cr(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=void 0),function(t,e){return fetch(t,e).then(lr)}(e,n).then((function(e){return t(e,r)}))}}ar.parseRows,ar.format,ar.formatBody,ar.formatRows,ar.formatRow,ar.formatValue;var sr=cr(ir);function fr(t){return fr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fr(t)}function hr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function yr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==fr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==fr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===fr(o)?o:String(o)),r)}var o}cr(ur);var pr=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=r||{},this.url=e,this.resolution=n,this.preprocess=r.preprocess||void 0,this.cellsViewCache=[]}var e,n;return e=t,(n=[{key:"getData",value:function(t,e){throw new Error("Method getData not implemented.")}},{key:"updateViewCache",value:function(t){throw new Error("Method updateViewCache not implemented.")}},{key:"getCellFromPosition",value:function(t,e){var n,r=this.getResolution(),o=r*Math.floor(t.x/r),i=r*Math.floor(t.y/r),a=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return hr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(e);try{for(a.s();!(n=a.n()).done;){var u=n.value;if(u.x==o&&u.y==i)return u}}catch(t){a.e(t)}finally{a.f()}}},{key:"getResolution",value:function(){return this.resolution}},{key:"getViewCache",value:function(){return this.cellsViewCache}}])&&yr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function vr(t){return vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vr(t)}function dr(){dr=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return r(a,"_invoke",{value:x(t,n,u)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function y(){}function p(){}var v={};l(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(P([])));m&&m!==e&&n.call(m,i)&&(v=m);var b=p.prototype=h.prototype=Object.create(v);function g(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,u){var l=s(t[r],t,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==vr(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,u)}))}u(l.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function x(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=S(a,n);if(u){if(u===f)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=s(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return y.prototype=p,r(b,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:y,configurable:!0}),y.displayName=l(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,l(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},g(w.prototype),l(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(c(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(b),l(b,u,"Generator"),l(b,i,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=P,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function mr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return br(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?br(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function br(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function gr(t,e,n,r,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}function wr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==vr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==vr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===vr(o)?o:String(o)),r)}var o}function xr(t,e){return xr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xr(t,e)}function Sr(t){return Sr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sr(t)}var _r=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xr(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Sr(r);if(o){var n=Sr(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===vr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=i.call(this,t,e,r)).cells=[],n.infoLoadingStatus="notLoaded",n}return e=a,n=[{key:"getData",value:function(t,e){var n,r=this;return"notLoaded"!=this.infoLoadingStatus||(this.infoLoadingStatus="loading",(n=dr().mark((function t(){var n,o,i,a,u,l,c;return dr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,sr(r.url);case 3:n=t.sent,o=mr(n);try{for(o.s();!(i=o.n()).done;)(a=i.value).x=+a.x,a.y=+a.y}catch(t){o.e(t)}finally{o.f()}if(!r.preprocess){t.next=29;break}r.cells=[],u=mr(n),t.prev=9,u.s();case 11:if((l=u.n()).done){t.next=19;break}if(c=l.value,0!=r.preprocess(c)){t.next=16;break}return t.abrupt("continue",17);case 16:r.cells.push(c);case 17:t.next=11;break;case 19:t.next=24;break;case 21:t.prev=21,t.t0=t.catch(9),u.e(t.t0);case 24:return t.prev=24,u.f(),t.finish(24);case 27:t.next=30;break;case 29:r.cells=n;case 30:e&&e(),r.infoLoadingStatus="loaded",t.next=38;break;case 34:t.prev=34,t.t1=t.catch(0),r.infoLoadingStatus="failed",r.cells=[];case 38:case"end":return t.stop()}}),t,null,[[0,34],[9,21,24,27]])})),function(){var t=this,e=arguments;return new Promise((function(r,o){var i=n.apply(t,e);function a(t){gr(i,r,o,a,u,"next",t)}function u(t){gr(i,r,o,a,u,"throw",t)}a(void 0)}))})()),this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,n=mr(this.cells);try{for(n.s();!(e=n.n()).done;){var r=e.value;+r.x+this.resolution<t.xMin||+r.x-this.resolution>t.xMax||+r.y+this.resolution<t.yMin||+r.y-this.resolution>t.yMax||this.cellsViewCache.push(r)}}catch(t){n.e(t)}finally{n.f()}}}}],n&&wr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(pr);function Or(t){return Or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Or(t)}function jr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Pr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Or(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Or(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Or(o)?o:String(o)),r)}var o}function kr(t,e,n){return e&&Pr(t.prototype,e),n&&Pr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var Er=kr((function t(e,n,r,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.cells=e,this.x=n,this.y=r;var i=o.resolutionGeo,a=o.tileSizeCell;this.extGeo={xMin:o.originPoint.x+i*a*this.x,xMax:o.originPoint.x+i*a*(this.x+1),yMin:o.originPoint.y+i*a*this.y,yMax:o.originPoint.y+i*a*(this.y+1)};var u,l=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return jr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(this.cells);try{for(l.s();!(u=l.n()).done;){var c=u.value;c.x=this.extGeo.xMin+c.x*i,c.y=this.extGeo.yMin+c.y*i}}catch(t){l.e(t)}finally{l.f()}}));function Cr(t,e){if(e){if(0==e.length)return 0;if(t<=e[0])return 0;for(var n=1;n<e.length;n++)if(e[n-1]<t&&t<=e[n])return n;return e.length}}function Tr(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function Ar(t,e){return fetch(t,e).then(Tr)}function Mr(t){return Mr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mr(t)}function Rr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Lr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Lr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function zr(){zr=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return r(a,"_invoke",{value:x(t,n,u)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function y(){}function p(){}var v={};l(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(P([])));m&&m!==e&&n.call(m,i)&&(v=m);var b=p.prototype=h.prototype=Object.create(v);function g(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,u){var l=s(t[r],t,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==Mr(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,u)}))}u(l.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function x(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=S(a,n);if(u){if(u===f)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=s(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return y.prototype=p,r(b,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:y,configurable:!0}),y.displayName=l(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,l(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},g(w.prototype),l(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(c(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(b),l(b,u,"Generator"),l(b,i,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=P,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function Fr(t,e,n,r,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}function Ir(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Fr(i,r,o,a,u,"next",t)}function u(t){Fr(i,r,o,a,u,"throw",t)}a(void 0)}))}}function Nr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Mr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Mr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Mr(o)?o:String(o)),r)}var o}function Br(t,e){return Br=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Br(t,e)}function Dr(t){return Dr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Dr(t)}var Gr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Br(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Dr(r);if(o){var n=Dr(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Mr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=i.call(this,t,0,r)).app=e,n.info=void 0,n.infoLoadingStatus="notLoaded",n.cache={},n}return e=a,(n=[{key:"loadInfo",value:function(t){var e=this;return this.info||"notLoaded"!==this.infoLoadingStatus?!t||"loaded"!==this.infoLoadingStatus&&"failed"!==this.infoLoadingStatus||t():Ir(zr().mark((function n(){var r;return zr().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Ar(e.url+"info.json");case 3:r=n.sent,e.info=r,e.resolution=r.resolutionGeo,e.infoLoadingStatus="loaded",t&&t(),n.next=13;break;case 10:n.prev=10,n.t0=n.catch(0),e.infoLoadingStatus="failed";case 13:case"end":return n.stop()}}),n,null,[[0,10]])})))(),this}},{key:"getTilingEnvelope",value:function(t){if(this.info){var e=this.info.originPoint,n=this.info.resolutionGeo,r=this.info.tileSizeCell;return{xMin:Math.floor((t.xMin-e.x)/(n*r)),xMax:Math.floor((t.xMax-e.x)/(n*r)),yMin:Math.floor((t.yMin-e.y)/(n*r)),yMax:Math.floor((t.yMax-e.y)/(n*r))}}this.loadInfo((function(){}))}},{key:"getData",value:function(t,e){var n=this;if(!this.info)return this;var r=this.getTilingEnvelope(t);if(!r)return this;for(var o=this.info.tilingBounds,i=function(t){for(var i=function(r){if(n.cache[t]||(n.cache[t]={}),n.cache[t][r])return"continue";n.cache[t][r]="loading",Ir(zr().mark((function o(){var i,a,u,l,c,s,f,h,y,p,v,d,m;return zr().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,sr(n.url+t+"/"+r+".csv");case 3:if(a=o.sent,!n.preprocess){o.next=28;break}i=[],u=Rr(a),o.prev=8,u.s();case 10:if((l=u.n()).done){o.next=18;break}if(c=l.value,0!=n.preprocess(c)){o.next=15;break}return o.abrupt("continue",16);case 15:i.push(c);case 16:o.next=10;break;case 18:o.next=23;break;case 20:o.prev=20,o.t0=o.catch(8),u.e(o.t0);case 23:return o.prev=23,u.f(),o.finish(23);case 26:o.next=29;break;case 28:i=a;case 29:o.next=36;break;case 32:return o.prev=32,o.t1=o.catch(0),n.cache[t][r]="failed",o.abrupt("return");case 36:if(n.info){o.next=39;break}return console.error("Tile info inknown"),o.abrupt("return");case 39:if(s=new Er(i,t,r,n.info),n.cache[t][r]=s,e){o.next=44;break}return o.abrupt("return");case 44:f=!1,h=n.app.getZoomFactor(),y=Rr(n.app.layers),o.prev=47,y.s();case 49:if((p=y.n()).done){o.next=59;break}if((v=p.value).visible){o.next=53;break}return o.abrupt("continue",57);case 53:if(v.getDatasetComponent(h)==n){o.next=55;break}return o.abrupt("continue",57);case 55:return f=!0,o.abrupt("break",59);case 57:o.next=49;break;case 59:o.next=64;break;case 61:o.prev=61,o.t2=o.catch(47),y.e(o.t2);case 64:return o.prev=64,y.f(),o.finish(64);case 67:if(f){o.next=70;break}return o.abrupt("return");case 70:if(d=n.app.updateExtentGeo(),m=s.extGeo,!(d.xMax<=m.xMin)){o.next=74;break}return o.abrupt("return");case 74:if(!(d.xMin>=m.xMax)){o.next=76;break}return o.abrupt("return");case 76:if(!(d.yMax<=m.yMin)){o.next=78;break}return o.abrupt("return");case 78:if(!(d.yMin>=m.yMax)){o.next=80;break}return o.abrupt("return");case 80:e();case 83:case"end":return o.stop()}}),o,null,[[0,32],[8,20,23,26],[47,61,64,67]])})))()},a=Math.max(r.yMin,o.yMin);a<=Math.min(r.yMax,o.yMax);a++)i(a)},a=Math.max(r.xMin,o.xMin);a<=Math.min(r.xMax,o.xMax);a++)i(a);return this}},{key:"updateViewCache",value:function(t){if(this.cellsViewCache=[],this.info){var e=this.getTilingEnvelope(t);if(e)for(var n=this.info.tilingBounds,r=Math.max(e.xMin,n.xMin);r<=Math.min(e.xMax,n.xMax);r++)if(this.cache[r])for(var o=Math.max(e.yMin,n.yMin);o<=Math.min(e.yMax,n.yMax);o++){var i=this.cache[r][o];if(i&&"string"!=typeof i){var a,u=Rr(i.cells);try{for(u.s();!(a=u.n()).done;){var l=a.value;+l.x+this.resolution<t.xMin||+l.x-this.resolution>t.xMax||+l.y+this.resolution<t.yMin||+l.y-this.resolution>t.yMax||this.cellsViewCache.push(l)}}catch(t){u.e(t)}finally{u.f()}}}}}}])&&Nr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(pr);function Zr(t){return Zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zr(t)}function Ur(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Zr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Zr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Zr(o)?o:String(o)),r)}var o}var Wr=function(){function t(e){var n=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.visible=0!=e.visible,this.minZoom=e.minZoom||0,this.maxZoom=e.maxZoom||1/0,this.minZoom>=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");if(this.cache={},this.url=e.url,this.urlFun=e.urlFun||function(t,e,r){return n.url+r+"/"+t+"/"+e+".png"},this.resolutions=e.resolutions,!this.resolutions||0==this.resolutions.length)throw new Error("No resolutions provided for background layer");this.nbPix=e.nbPix||256,this.origin=e.origin||[0,0],this.z0=e.z0||0,this.filterColor=e.filterColor}var e,n;return e=t,n=[{key:"get",value:function(t,e,n){var r=this.cache[t];if(r&&(r=r[e]))return r[n]}},{key:"put",value:function(t,e,n,r){this.cache[e]||(this.cache[e]={}),this.cache[e][n]||(this.cache[e][n]={}),this.cache[e][n][r]=t}},{key:"draw",value:function(t){var e=this;if(this.resolutions&&0!=this.resolutions.length){var n=t.getZf(),r=this.origin[0],o=this.origin[1],i=0;for(i=0;i<this.resolutions.length&&!(this.resolutions[i]<n);i++);i-=1,i=Math.max(0,i),i=Math.min(i,this.resolutions.length-1);var a=this.resolutions[i];i+=this.z0;for(var u=this.nbPix*a,l=u/n,c=function(t){return Math.ceil((t-r)/u)},s=function(t){return Math.ceil(-(t-o)/u)},f=c(t.extGeo.xMin)-1,h=c(t.extGeo.xMax),y=s(t.extGeo.yMin),p=s(t.extGeo.yMax)-1,v=function(n){for(var a=function(a){var c=e.get(i,n,a);if(!c){var s=new Image;return e.put(s,i,n,a),s.onload=function(){t.redraw()},s.onerror=function(){e.put("failed",i,n,a)},s.src=e.urlFun(n,a,i),"continue"}if("failed"===c)return"continue";if(!(c instanceof HTMLImageElement))return console.log(c),"continue";if(0==c.width||0==c.height)return"continue";var f=r+n*u,h=o-a*u;try{t.ctx.drawImage(c,t.geoToPixX(f),t.geoToPixY(h),l,l)}catch(t){console.error(t)}},c=p;c<y;c++)a(c)},d=f;d<h;d++)v(d);if(this.filterColor){var m=this.filterColor(n);m&&"none"!=m&&(t.ctx.fillStyle=m,t.ctx.fillRect(0,0,t.w,t.h))}}else console.error("No resolutions provided for background layer")}}],n&&Ur(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function $r(t){return $r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$r(t)}function Yr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==$r(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==$r(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===$r(o)?o:String(o)),r)}var o}var Xr=function(){function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.visible=0!=e.visible,this.minZoom=e.minZoom||0,this.maxZoom=e.maxZoom||1/0,this.minZoom>=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");this.url=e.url,this.filterColor=e.filterColor,this.img=void 0,this.xMin=void 0,this.xMax=void 0,this.yMin=void 0,this.yMax=void 0}var e,n;return e=t,(n=[{key:"hasMoved",value:function(t){return t.xMin!=this.xMin||t.xMax!=this.xMax||t.yMin!=this.yMin||t.yMax!=this.yMax}},{key:"draw",value:function(t){if(t.updateExtentGeo(0),!this.hasMoved(t.extGeo)&&this.img)t.ctx.drawImage(this.img,0,0,t.w,t.h);else{this.xMin=t.extGeo.xMin,this.xMax=t.extGeo.xMax,this.yMin=t.extGeo.yMin,this.yMax=t.extGeo.yMax;var e=[];e.push(this.url),e.push("&width="),e.push(t.w),e.push("&height="),e.push(t.h),e.push("&bbox="),e.push(t.extGeo.xMin),e.push(","),e.push(t.extGeo.yMin),e.push(","),e.push(t.extGeo.xMax),e.push(","),e.push(t.extGeo.yMax);var n=e.join("");this.img||(this.img=new Image,this.img.onload=function(){t.redraw()},this.img.onerror=function(){console.warn("Could not retrieve WMS background image from",n)}),this.img.src=n}var r=t.getZf();if(this.filterColor){var o=this.filterColor(r);o&&"none"!=o&&(t.ctx.fillStyle=o,t.ctx.fillRect(0,0,t.w,t.h))}}}])&&Yr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Hr(t){return Hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hr(t)}function Vr(){Vr=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return r(a,"_invoke",{value:x(t,n,u)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function y(){}function p(){}var v={};l(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(P([])));m&&m!==e&&n.call(m,i)&&(v=m);var b=p.prototype=h.prototype=Object.create(v);function g(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,u){var l=s(t[r],t,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==Hr(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,u)}))}u(l.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function x(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=S(a,n);if(u){if(u===f)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=s(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return y.prototype=p,r(b,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:y,configurable:!0}),y.displayName=l(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,l(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},g(w.prototype),l(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(c(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(b),l(b,u,"Generator"),l(b,i,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=P,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function qr(t,e,n,r,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}function Kr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Jr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Jr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Qr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Hr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Hr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Hr(o)?o:String(o)),r)}var o}var to=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.url=e.url,this.style=e.style||function(){return"bold 1em Arial"},this.color=e.color||(e.dark?function(){return"#ddd"}:function(){return"#222"}),this.haloColor=e.haloColor||(e.dark?function(){return"#000000BB"}:function(){return"#FFFFFFBB"}),this.haloWidth=e.haloWidth||function(){return 4},this.textAlign=e.textAlign||"start",this.offsetPix=e.offsetPix||[5,5],this.preprocess=e.preprocess,this.labels=void 0,this.loadingStatus="notLoaded"}var e,n,r,o;return e=t,n=[{key:"draw",value:function(t){if(this.labels){var e=t.getZf();t.ctx.textAlign=this.textAlign||"start",t.ctx.lineJoin="bevel",t.ctx.lineCap="butt",t.initCanvasTransform();var n,r=Kr(this.labels);try{for(r.s();!(n=r.n()).done;){var o=n.value,i=this.style(o,e);if(i&&(t.ctx.font=i,t.toDraw(o))){var a=t.geoToPixX(o.x)+this.offsetPix[0],u=t.geoToPixY(o.y)-this.offsetPix[1];if(this.haloColor&&this.haloWidth){var l=this.haloColor(o,e),c=this.haloWidth(o,e);l&&c&&c>0&&(t.ctx.strokeStyle=l,t.ctx.lineWidth=c,t.ctx.strokeText(o.name,a,u))}if(this.color){var s=this.color(o,e);s&&(t.ctx.fillStyle=s,t.ctx.fillText(o.name,a,u))}}}}catch(t){r.e(t)}finally{r.f()}}else this.load(t.redraw)}},{key:"load",value:(r=Vr().mark((function t(e){var n,r,o,i;return Vr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.url){t.next=5;break}return console.log("Failed loading labels: No URL specified. "+this.url),this.loadingStatus="failed",this.labels=[],t.abrupt("return");case 5:if("notLoaded"==this.loadingStatus){t.next=7;break}return t.abrupt("return");case 7:return this.loadingStatus="loading",t.prev=8,t.next=11,sr(this.url);case 11:if(n=t.sent,!this.preprocess){t.next=35;break}this.labels=[],r=Kr(n),t.prev=15,r.s();case 17:if((o=r.n()).done){t.next=25;break}if(i=o.value,0!=this.preprocess(i)){t.next=22;break}return t.abrupt("continue",23);case 22:this.labels.push(i);case 23:t.next=17;break;case 25:t.next=30;break;case 27:t.prev=27,t.t0=t.catch(15),r.e(t.t0);case 30:return t.prev=30,r.f(),t.finish(30);case 33:t.next=36;break;case 35:this.labels=n;case 36:this.loadingStatus="loaded",e&&e(),t.next=45;break;case 40:t.prev=40,t.t1=t.catch(8),console.log("Failed loading labels from "+this.url),this.labels=[],this.loadingStatus="failed";case 45:case"end":return t.stop()}}),t,this,[[8,40],[15,27,30,33]])})),o=function(){var t=this,e=arguments;return new Promise((function(n,o){var i=r.apply(t,e);function a(t){qr(i,n,o,a,u,"next",t)}function u(t){qr(i,n,o,a,u,"throw",t)}a(void 0)}))},function(t){return o.apply(this,arguments)})}],n&&Qr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function eo(t){return eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eo(t)}function no(){no=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return r(a,"_invoke",{value:x(t,n,u)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function y(){}function p(){}var v={};l(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(P([])));m&&m!==e&&n.call(m,i)&&(v=m);var b=p.prototype=h.prototype=Object.create(v);function g(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,u){var l=s(t[r],t,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==eo(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,u)}))}u(l.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function x(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=S(a,n);if(u){if(u===f)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=s(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return y.prototype=p,r(b,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:y,configurable:!0}),y.displayName=l(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,l(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},g(w.prototype),l(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(c(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(b),l(b,u,"Generator"),l(b,i,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=P,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function ro(t,e,n,r,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}function oo(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return io(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?io(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function io(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ao(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==eo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==eo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===eo(o)?o:String(o)),r)}var o}var uo=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.url=e.url,this.preprocess=e.preprocess,this.color=e.color||function(t,e){return"gray"},this.width=e.width||function(t,e){return 2},this.lineDash=e.lineDash||function(t,e){},this.fs=void 0,this.loadingStatus="notLoaded"}var e,n,r,o;return e=t,n=[{key:"draw",value:function(t){if(this.fs){var e=t.getZf();t.setCanvasTransform();var n,r=oo(this.fs);try{for(r.s();!(n=r.n()).done;){var o=n.value,i=o.geometry.coordinates;if(!(i.length<2)){var a=this.color(o,e);if(a&&"none"!=a){t.ctx.strokeStyle=a;var u=this.width(o,e);if(u&&!(u<0)){t.ctx.lineWidth=u*e;var l=this.lineDash(o,e);l&&t.ctx.setLineDash(l),t.ctx.beginPath(),t.ctx.moveTo(i[0][0],i[0][1]);for(var c=1;c<i.length;c++)t.ctx.lineTo(i[c][0],i[c][1]);t.ctx.stroke()}}}}}catch(t){r.e(t)}finally{r.f()}t.ctx.setLineDash([])}else this.load(t.redraw)}},{key:"load",value:(r=no().mark((function t(e){var n,r,o,i,a;return no().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.url){t.next=5;break}return console.log("Failed loading boundaries: No URL specified. "+this.url),this.loadingStatus="failed",this.labels=[],t.abrupt("return");case 5:if("notLoaded"==this.loadingStatus){t.next=7;break}return t.abrupt("return");case 7:return this.loadingStatus="loading",t.prev=8,t.next=11,Ar(this.url);case 11:if(n=t.sent,r=n.features,!this.preprocess){t.next=36;break}this.fs=[],o=oo(r),t.prev=16,o.s();case 18:if((i=o.n()).done){t.next=26;break}if(a=i.value,0!=this.preprocess(a)){t.next=23;break}return t.abrupt("continue",24);case 23:this.fs.push(a);case 24:t.next=18;break;case 26:t.next=31;break;case 28:t.prev=28,t.t0=t.catch(16),o.e(t.t0);case 31:return t.prev=31,o.f(),t.finish(31);case 34:t.next=37;break;case 36:this.fs=r;case 37:this.loadingStatus="loaded",e&&e(),t.next=46;break;case 41:t.prev=41,t.t1=t.catch(8),console.log("Failed loading boundaries from "+this.url),this.fs=[],this.loadingStatus="failed";case 46:case"end":return t.stop()}}),t,this,[[8,41],[16,28,31,34]])})),o=function(){var t=this,e=arguments;return new Promise((function(n,o){var i=r.apply(t,e);function a(t){ro(i,n,o,a,u,"next",t)}function u(t){ro(i,n,o,a,u,"throw",t)}a(void 0)}))},function(t){return o.apply(this,arguments)})}],n&&ao(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function lo(t){return lo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lo(t)}function co(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return so(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?so(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function so(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function fo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==lo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==lo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===lo(o)?o:String(o)),r)}var o}var ho=function(){function t(e,n){var r=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=n||{},this.layers=[],e=e||document.getElementById("gridviz")){this.w=n.w||e.offsetWidth,this.h=n.h||e.offsetHeight;var o=n.canvas||null;o||((o=document.createElement("canvas")).setAttribute("width",""+this.w),o.setAttribute("height",""+this.h),e.appendChild(o)),this.cg=new Bn(o,void 0,1,n),this.cg.redraw=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];r.legend&&t&&r.legend.selectAll("*").remove(),r.cg.initCanvasTransform(),r.cg.clear(r.cg.backgroundColor);var n=r.getZoomFactor();if(r.updateExtentGeo(),r.showBgLayers){var i,a=co(r.bgLayers);try{for(a.s();!(i=a.n()).done;){var u=i.value;u.visible&&(n>u.maxZoom||n<u.minZoom||u.draw(r.cg))}}catch(t){a.e(t)}finally{a.f()}}var l,c=co(r.layers);try{for(c.s();!(l=c.n()).done;){var s=l.value;if(s.visible&&!(n>s.maxZoom||n<s.minZoom)){var f=s.getDatasetComponent(n);if(f){if(t&&f.getData(r.cg.extGeo,(function(){r.cg.redraw()})),t&&f.updateViewCache(r.cg.extGeo),t){var h,y=co(s.styles);try{for(y.s();!(h=y.n()).done;){var p=h.value;n>p.maxZoom||n<p.minZoom||p.draw(f.getViewCache(),f.getResolution(),r.cg)}}catch(t){y.e(t)}finally{y.f()}}if(r.legend&&t){var v,d=co(s.styles);try{for(d.s();!(v=d.n()).done;){var m=v.value;if(!(n>m.maxZoom||n<m.minZoom)){var b,g=co(m.legends);try{for(g.s();!(b=g.n()).done;){var w=b.value;r.legend.node().append(w.div.node())}}catch(t){g.e(t)}finally{g.f()}if(m.styles){var x,S=co(m.styles);try{for(S.s();!(x=S.n()).done;){var _=x.value;if(!(n>_.maxZoom||n<_.minZoom)){var O,j=co(_.legends);try{for(j.s();!(O=j.n()).done;){var P=O.value;r.legend.node().append(P.div.node())}}catch(t){j.e(t)}finally{j.f()}}}}catch(t){S.e(t)}finally{S.f()}}}}}catch(t){d.e(t)}finally{d.f()}}}}}}catch(t){c.e(t)}finally{c.f()}return r.showBoundaries&&r.boundaryLayer&&r.boundaryLayer.draw(r.cg),r.showLabels&&r.labelLayer&&r.labelLayer.draw(r.cg),r.canvasSave=null,r.defineResizeObserver(e,o),r},this.bgLayers=[],this.showBgLayers=!0,this.labelLayer=void 0,this.showLabels=!0,this.boundaryLayer=void 0,this.showBoundaries=!0,this.legendDivId=n.legendDivId||"gvizLegend",this.legend=pt("#"+this.legendDivId),this.legend.empty()&&(this.legend=pt(e.id?"#"+e.id:"body").append("div").attr("id",this.legendDivId).style("position","absolute").style("width","auto").style("height","auto").style("background","#FFFFFFCC").style("border","0px").style("border-radius","5px").style("box-shadow","3px 3px 3px grey, -3px -3px 3px #ddd").style("font-family","Helvetica, Arial, sans-serif").style("top","20px").style("right","20px")),n.tooltip||(n.tooltip={}),n.tooltip.parentElement||(n.tooltip.parentElement=e),this.tooltip=new Kn(n.tooltip);var i=function(t){var e={x:r.cg.pixToGeoX(t.offsetX+r.tooltip.xMouseOffset),y:r.cg.pixToGeoY(t.offsetY+r.tooltip.yMouseOffset)},o=r.getCellFocusInfo(e);if(n.transparentBackground)return o?(r.tooltip.setPosition(t),r.tooltip.show(),r.tooltip.html(o.html)):r.tooltip.hide(),r.canvasSave=document.createElement("canvas"),r.canvasSave.setAttribute("width",""+r.w),r.canvasSave.setAttribute("height",""+r.h),r.canvasSave.getContext("2d").drawImage(r.cg.canvas,0,0),void r.cg.initCanvasTransform();if(o){r.tooltip.setPosition(t),r.tooltip.show(),r.tooltip.html(o.html),r.canvasSave?r.cg.ctx.drawImage(r.canvasSave,0,0):(r.canvasSave=document.createElement("canvas"),r.canvasSave.setAttribute("width",""+r.w),r.canvasSave.setAttribute("height",""+r.h),r.canvasSave.getContext("2d").drawImage(r.cg.canvas,0,0));var i=r.selectionRectangleWidthPix?r.selectionRectangleWidthPix(o.resolution,r.getZoomFactor()):4;r.cg.initCanvasTransform(),r.cg.ctx.strokeStyle=r.selectionRectangleColor,r.cg.ctx.lineWidth=i,r.cg.ctx.beginPath(),r.cg.ctx.rect(r.cg.geoToPixX(o.cell.x)-i/2,r.cg.geoToPixY(o.cell.y)+i/2,o.resolution/r.getZoomFactor()+i,-o.resolution/r.getZoomFactor()-i),r.cg.ctx.stroke()}else r.tooltip.hide(),r.canvasSave&&r.cg.ctx.drawImage(r.canvasSave,0,0)};e.addEventListener("mouseover",(function(t){i(t)})),e.addEventListener("mousemove",(function(t){i(t)})),e.addEventListener("mouseout",(function(){r.tooltip.hide()})),this.cg.onZoomStartFun=function(t){n.onZoomStartFun&&n.onZoomStartFun(t),r.tooltip.hide()},this.canvasSave=null,this.selectionRectangleColor=n.selectionRectangleColor||"red",this.selectionRectangleWidthPix=n.selectionRectangleWidthPix||function(){return 4}}else console.error("Cannot find gridviz container element.")}var e,n;return e=t,n=[{key:"updateExtentGeo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return this.cg.updateExtentGeo(t)}},{key:"getCellFocusInfo",value:function(t){for(var e=this.getZoomFactor(),n=this.layers.length-1;n>=0;n--){var r=this.layers[n];if(r.visible&&r.cellInfoHTML&&"none"!==r.cellInfoHTML){var o=r.getDatasetComponent(e);if(o){var i=o.getCellFromPosition(t,o.getViewCache());if(!i)return;var a=r.cellInfoHTML(i,o.getResolution());if(!a)return;return{cell:i,html:a,resolution:o.getResolution()}}}}}},{key:"getGeoCenter",value:function(){return this.cg.getCenter()}},{key:"setGeoCenter",value:function(t){return this.cg.setCenter(t),this}},{key:"getZoomFactor",value:function(){return this.cg.getZf()}},{key:"setZoomFactor",value:function(t){return this.cg.setZf(t),this}},{key:"getZoomFactorExtent",value:function(){return this.cg.getZfExtent()}},{key:"setZoomFactorExtent",value:function(t){return this.cg.setZfExtent(t),this}},{key:"getBackgroundColor",value:function(){return this.cg.backgroundColor}},{key:"setBackgroundColor",value:function(t){return this.cg.backgroundColor=t,this}},{key:"getBoundaryLayer",value:function(){return this.boundaryLayer}},{key:"setBoundaryLayer",value:function(t){return this.boundaryLayer=new uo(t),this}},{key:"getLabelLayer",value:function(){return this.labelLayer}},{key:"setLabelLayer",value:function(t){return this.labelLayer=new to(t),this}},{key:"redraw",value:function(){return this.cg.redraw(),this}},{key:"addLayerFromDataset",value:function(t,e,n){var r=new Zn(t,e,n);return this.layers.push(r),this}},{key:"makeCSVGridDataset",value:function(t,e,n){var r=this;return new Xn([new _r(t,e,n).getData(void 0,(function(){r.cg.redraw()}))],[],n)}},{key:"makeTiledGridDataset",value:function(t,e){var n=this;return new Xn([new Gr(t,this,e).loadInfo((function(){n.cg.redraw()}))],[],e)}},{key:"makeMultiScaleCSVGridDataset",value:function(t,e,n){var r=this;return Xn.make(t,(function(t){return new _r(e(t),t,n).getData(void 0,(function(){r.cg.redraw()}))}),n)}},{key:"makeMultiScaleTiledGridDataset",value:function(t,e,n){var r=this;return Xn.make(t,(function(t){return new Gr(e(t),r,n).loadInfo((function(){r.cg.redraw()}))}),n)}},{key:"addCSVGridLayer",value:function(t,e,n,r){var o=this.makeCSVGridDataset(t,e,r);return this.addLayerFromDataset(o,n,r)}},{key:"addTiledGridLayer",value:function(t,e,n){var r=this.makeTiledGridDataset(t,n);return this.addLayerFromDataset(r,e,n)}},{key:"addMultiScaleCSVGridLayer",value:function(t,e,n,r){var o=this.makeMultiScaleCSVGridDataset(t,e,r);return this.addLayerFromDataset(o,n,r)}},{key:"addMultiScaleTiledGridLayer",value:function(t,e,n,r){var o=this.makeMultiScaleTiledGridDataset(t,e,r);return this.addLayerFromDataset(o,n,r)}},{key:"addBackgroundLayer",value:function(t){return this.bgLayers.push(new Wr(t)),this.redraw(),this}},{key:"addBackgroundLayerWMS",value:function(t){return this.bgLayers.push(new Xr(t)),this.redraw(),this}},{key:"addZoomSlider",value:function(t,e){return this.cg.addZoomSlider(t,e),this}},{key:"setViewFromURL",value:function(){return this.cg.setViewFromURL(),this}},{key:"defineResizeObserver",value:function(t,e){var n=this;new ResizeObserver((function(r){t.clientWidth>0&&t.clientHeight>0&&window.requestAnimationFrame((function(){Array.isArray(r)&&r.length&&(n.h===t.clientHeight&&n.w===t.clientWidth||(n.h=t.clientHeight,n.w=t.clientWidth,n.cg.h=t.clientHeight,n.cg.w=t.clientWidth,e.setAttribute("width",""+n.w),e.setAttribute("height",""+n.h),n.redraw()))}))})).observe(t)}}],n&&fo(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function yo(t){return yo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yo(t)}function po(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return vo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function vo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function mo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==yo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==yo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===yo(o)?o:String(o)),r)}var o}var bo=function(){function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.filter=e.filter||function(){return!0},this.offset=e.offset||function(t,e,n){return{dx:0,dy:0}},this.minZoom=e.minZoom||0,this.maxZoom=e.maxZoom||1/0,this.minZoom>=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");this.legends=[]}var e,n,r;return e=t,r=[{key:"getStatistics",value:function(t,e,n){if(t&&0!=t.length){var r,o=1/0,i=-1/0,a=po(t);try{for(a.s();!(r=a.n()).done;){var u=+e(r.value);n&&!u||(u<o&&(o=u),u>i&&(i=u))}}catch(t){a.e(t)}finally{a.f()}return{min:o,max:i}}}}],(n=[{key:"draw",value:function(t,e,n){throw new Error("Method draw not implemented.")}},{key:"getOffset",value:function(){return this.offset}},{key:"setOffset",value:function(t){return this.offset=t,this}},{key:"updateLegends",value:function(t){var e,n=po(this.legends);try{for(n.s();!(e=n.n()).done;)e.value.update(t)}catch(t){n.e(t)}finally{n.f()}return this}}])&&mo(e.prototype,n),r&&mo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function go(t){return go="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},go(t)}function wo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function xo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==go(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==go(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===go(o)?o:String(o)),r)}var o}function So(t,e){return So=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},So(t,e)}function _o(t){return _o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_o(t)}var Oo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&So(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=_o(r);if(o){var n=_o(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===go(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.sizeCol=t.sizeCol,e.size=t.size,e.shape=t.shape||function(){return"square"},e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i,a=n.getZf();this.sizeCol&&(t.sort((function(t,e){return e[r.sizeCol]-t[r.sizeCol]})),o=bo.getStatistics(t,(function(t){return t[r.sizeCol]}),!0)),this.colorCol&&(i=bo.getStatistics(t,(function(t){return t[r.colorCol]}),!0)),n.setCanvasTransform();var u,l=.5*e,c=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return wo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(u=c.n()).done;){var s=u.value,f=this.color?this.color(s[this.colorCol],e,i,a):void 0;if(f&&"none"!==f){n.ctx.fillStyle=f;var h=this.shape?this.shape(s):"square";if("none"!==h){var y=(this.size||function(){return e})(s[this.sizeCol],e,o,a),p=this.offset(s,e,a);if("square"===h){var v=e*(1-y/e)*.5;n.ctx.fillRect(s.x+v+p.dx,s.y+v+p.dy,y,y)}else if("circle"===h)n.ctx.beginPath(),n.ctx.arc(s.x+l+p.dx,s.y+l+p.dy,.5*y,0,2*Math.PI,!1),n.ctx.fill();else if("donut"===h){var d=s.x+l+p.dx,m=s.y+l+p.dy;n.ctx.beginPath(),n.ctx.moveTo(d,m),n.ctx.arc(d,m,l,0,2*Math.PI),n.ctx.arc(d,m,(1-y/e)*l,0,2*Math.PI,!0),n.ctx.closePath(),n.ctx.fill()}else{if("diamond"!==h)throw new Error("Unexpected shape:"+h);var b=.5*y;n.ctx.beginPath(),n.ctx.moveTo(s.x+l-b,s.y+l),n.ctx.lineTo(s.x+l,s.y+l+b),n.ctx.lineTo(s.x+l+b,s.y+l),n.ctx.lineTo(s.x+l,s.y+l-b),n.ctx.fill()}}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:a,sSize:o,sColor:i})}}])&&xo(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function jo(t){return jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jo(t)}function Po(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ko(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==jo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==jo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===jo(o)?o:String(o)),r)}var o}function Eo(t,e){return Eo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Eo(t,e)}function Co(t){return Co=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Co(t)}var To=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Eo(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Co(r);if(o){var n=Co(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===jo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.strokeColorCol=t.strokeColorCol,e.strokeColor=t.strokeColor||function(){return"#666"},e.sizeCol=t.sizeCol,e.size=t.size,e.strokeWidthCol=t.strokeWidthCol,e.strokeWidth=t.strokeWidth,e.shape=t.shape||function(){return"square"},e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i,a,u=n.getZf();this.strokeColorCol&&(o=bo.getStatistics(t,(function(t){return t[r.strokeColorCol]}),!0)),this.sizeCol&&(i=bo.getStatistics(t,(function(t){return t[r.sizeCol]}),!0)),this.strokeWidthCol&&(a=bo.getStatistics(t,(function(t){return t[r.strokeWidthCol]}),!0)),n.setCanvasTransform();var l,c=.5*e,s=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Po(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Po(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(s.s();!(l=s.n()).done;){var f=l.value,h=this.strokeColor?this.strokeColor(f[this.strokeColorCol],e,o):void 0;if(h&&"none"!==h){n.ctx.strokeStyle=h;var y=(this.size||function(){return e})(f[this.sizeCol],e,i,u),p=this.strokeWidth?this.strokeWidth(f[this.strokeWidthCol],e,a,u):1*u;if(p&&!(p<=0)){n.ctx.lineWidth=p;var v=this.shape?this.shape(f):"square";if("none"!==v){var d=this.offset(f,e,u);if("square"===v){var m=e*(1-y/e)*.5;n.ctx.beginPath(),n.ctx.rect(f.x+m+d.dx,f.y+m+d.dy,y,y),n.ctx.stroke()}else if("circle"===v)n.ctx.beginPath(),n.ctx.arc(f.x+c+d.dx,f.y+c+d.dy,.5*y,0,2*Math.PI,!1),n.ctx.stroke();else if("diamond"===v){var b=.5*y;n.ctx.beginPath(),n.ctx.moveTo(f.x+c-b,f.y+c),n.ctx.lineTo(f.x+c,f.y+c+b),n.ctx.lineTo(f.x+c+b,f.y+c),n.ctx.lineTo(f.x+c,f.y+c-b),n.ctx.lineTo(f.x+c-b,f.y+c),n.ctx.stroke()}else{if("donut"!==v)throw new Error("Unexpected shape:"+v);console.error("Not implemented")}}}}}}catch(t){s.e(t)}finally{s.f()}}}])&&ko(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function Ao(t){return Ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ao(t)}function Mo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ro(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ao(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ao(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ao(o)?o:String(o)),r)}var o}function Lo(t,e){return Lo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Lo(t,e)}function zo(t){return zo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zo(t)}var Fo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Lo(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=zo(r);if(o){var n=zo(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ao(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.heightCol=t.heightCol,e.height=t.height||function(t){return Math.sqrt(t)},e.lineColor=t.lineColor||function(t,e,n,r){return"#BBB"},e.lineWidth=t.lineWidth||function(t,e,n,r){return r},e.fillColor=t.fillColor||function(t,e,n,r){return"#c08c5968"},e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter)),n.ctx.lineJoin="round";var o,i=n.getZf(),a=bo.getStatistics(t,(function(t){return t[r.heightCol]}),!0),u={},l=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Mo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(l.s();!(o=l.n()).done;){var c=o.value,s=u[c.y];s||(s={},u[c.y]=s),s[c.x]=this.height(c[this.heightCol],e,a,i)}}catch(t){l.e(t)}finally{l.f()}var f=n.extGeo;if(f){var h=Math.floor(f.xMin/e)*e,y=Math.floor(f.xMax/e)*e,p=Math.floor(f.yMin/e)*e,v=Math.floor(f.yMax/e)*e,d={min:p,max:v};n.setCanvasTransform();for(var m=v;m>=p;m-=e){var b=u[m];if(b){n.ctx.beginPath(),n.ctx.moveTo(h-e/2,m);for(var g=void 0,w=h;w<=y;w+=e){var x=b[w];x||(x=0),x||g?n.ctx.lineTo(w+e/2,m+x):n.ctx.moveTo(w+e/2,m),g=x}g&&n.ctx.lineTo(y+e/2,m);var S=this.fillColor(m,d,e,i);S&&"none"!=S&&(n.ctx.fillStyle=S,n.ctx.fill());var _=this.lineColor(m,d,e,i),O=this.lineWidth(m,d,e,i);_&&"none"!=_&&O>0&&(n.ctx.strokeStyle=_,n.ctx.lineWidth=O,n.ctx.stroke())}}}}}])&&Ro(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function Io(t){return Io="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Io(t)}function No(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||Bo(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bo(t,e){if(t){if("string"==typeof t)return Do(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Do(t,e):void 0}}function Do(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Go(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Io(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Io(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Io(o)?o:String(o)),r)}var o}function Zo(t,e){return Zo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Zo(t,e)}function Uo(t){return Uo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Uo(t)}var Wo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zo(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Uo(r);if(o){var n=Uo(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Io(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.color=t.color,e.type=t.type,e.sizeCol=t.sizeCol,e.size=t.size||function(t,e,n,r){return e},e.stripesOrientation=t.stripesOrientation||function(){return 0},e.offsetAngle=t.offsetAngle||function(){return 0},e.agePyramidHeight=t.agePyramidHeight||function(t,e,n){return e},e.pieChartInternalRadiusFactor=t.pieChartInternalRadiusFactor||0,e}return e=a,n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i=n.getZf();this.sizeCol&&(t.sort((function(t,e){return e[r.sizeCol]-t[r.sizeCol]})),o=bo.getStatistics(t,(function(t){return t[r.sizeCol]}),!0));var a=Object.entries(this.color).length;n.setCanvasTransform();var u,l=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Bo(t))){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(l.s();!(u=l.n()).done;){var c=u.value,s=(this.size||function(){return e})(c[this.sizeCol],e,o,i),f=this.offset(c,e,i),h=this.type?this.type(c):"flag",y=c.x+f.dx+("agepyramid"===h?0:.5*e),p=c.y+f.dy+("agepyramid"===h?0:.5*e),v=this.offsetAngle?this.offsetAngle(c,e,i)*Math.PI/180:0;if("agepyramid"===h||"radar"===h||"halftone"===h){for(var d=-1/0,m=0,b=Object.keys(this.color);m<b.length;m++){var g=+c[b[m]];g>d&&(d=g)}var w=0;"agepyramid"===h&&this.agePyramidHeight&&(w=(e-this.agePyramidHeight(c,e,i))/2),"radar"!==h&&"halftone"!==h||(w=Math.PI/2+v);var x="agepyramid"===h?(this.agePyramidHeight?this.agePyramidHeight(c,e,i):e)/a:"radar"===h||"halftone"===h?2*Math.PI/a:void 0;if(void 0===x)throw new Error("Unexpected symbol type:"+h);for(var S=0,_=Object.entries(this.color);S<_.length;S++){var O=No(_[S],2),j=O[0],P=O[1];if("agepyramid"===h){n.ctx.fillStyle=P;var k=s*c[j]/d;n.ctx.fillRect(y+(e-k)/2,p+w,k,x),w+=x}else if("radar"===h){n.ctx.fillStyle=P;var E=c[j],C=s/2*Math.sqrt(E/d);n.ctx.beginPath(),n.ctx.moveTo(y,p),n.ctx.arc(y,p,C,w-x,w),n.ctx.lineTo(y,p),n.ctx.fill(),w+=x}else{if("halftone"!==h)throw new Error("Unexpected symbol type:"+h);n.ctx.fillStyle=P;var T=c[j],A=.333*s*Math.sqrt(T/d);n.ctx.beginPath(),n.ctx.arc(y+.25*e*Math.cos(w),p+.25*e*Math.sin(w),A,0,2*Math.PI),n.ctx.fill(),w+=x}}}else{for(var M=0,R=0,L=Object.keys(this.color);R<L.length;R++){var z=+c[L[R]];z&&(M+=z)}if(!M||isNaN(M))continue;for(var F=0,I=e*(1-s/e)*.5,N=this.stripesOrientation(c,e,i),B=0,D=Object.entries(this.color);B<D.length;B++){var G=No(D[B],2),Z=G[0],U=G[1],W=c[Z]/M;if(W&&!isNaN(W)){if(n.ctx.fillStyle=U,"flag"===h)0==N?n.ctx.fillRect(c.x+I+f.dx,c.y+I+F*s+f.dy,s,W*s):n.ctx.fillRect(c.x+I+F*s+f.dx,c.y+I+f.dy,W*s,s);else if("piechart"===h){var $=2*F*Math.PI,Y=2*(F+W)*Math.PI;n.ctx.beginPath(),n.ctx.moveTo(y,p),n.ctx.arc(y,p,.5*s,$+v,Y+v),this.pieChartInternalRadiusFactor&&n.ctx.arc(y,p,.5*s*this.pieChartInternalRadiusFactor,$+v,Y+v,!0),n.ctx.closePath(),n.ctx.fill()}else if("ring"===h)n.ctx.beginPath(),n.ctx.arc(y,p,Math.sqrt(1-F)*s*.5,0,2*Math.PI),n.ctx.fill();else{if("segment"!==h)throw new Error("Unexpected symbol type:"+h);var X=s*s/e;0==N?n.ctx.fillRect(c.x+f.dx,c.y+(e-X)/2+F*X+f.dy,e,W*X):n.ctx.fillRect(c.x+F*e+f.dx,c.y+(e-X)/2+f.dy,W*e,X)}F+=W}}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,r:e,zf:i,sSize:o})}}],n&&Go(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function $o(t){return $o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$o(t)}function Yo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Xo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==$o(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==$o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===$o(o)?o:String(o)),r)}var o}function Ho(t,e){return Ho=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ho(t,e)}function Vo(t){return Vo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vo(t)}var qo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ho(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Vo(r);if(o){var n=Vo(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===$o(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.orientation=t.orientation||function(){return 0},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.lengthCol=t.lengthCol,e.length=t.length,e.widthCol=t.widthCol,e.width=t.width,e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i,a,u=n.getZf();this.colorCol&&(o=bo.getStatistics(t,(function(t){return t[r.colorCol]}),!0)),this.lengthCol&&(t.sort((function(t,e){return e[r.lengthCol]-t[r.lengthCol]})),i=bo.getStatistics(t,(function(t){return t[r.lengthCol]}),!0)),this.widthCol&&(a=bo.getStatistics(t,(function(t){return t[r.widthCol]}),!0)),n.ctx.lineCap="butt";var l=Math.PI/180;n.setCanvasTransform();var c,s=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Yo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(s.s();!(c=s.n()).done;){var f=c.value,h=this.color?this.color(f[this.colorCol],e,o):void 0;if(h){var y=this.width?this.width(f[this.widthCol],e,a,u):void 0;if(y&&!(y<0)){var p=this.length?this.length(f[this.lengthCol],e,i,u):void 0;if(p&&!(p<0)){var v=this.orientation(f)*l;if(void 0!==v&&!isNaN(v)){var d=this.offset(f,e,u);n.ctx.strokeStyle=h,n.ctx.lineWidth=y;var m=f.x+e/2+d.dx,b=f.y+e/2+d.dy,g=.5*Math.cos(v)*p,w=.5*Math.sin(v)*p;n.ctx.beginPath(),n.ctx.moveTo(m-g,b-w),n.ctx.lineTo(m+g,b+w),n.ctx.stroke()}}}}}}catch(t){s.e(t)}finally{s.f()}this.updateLegends({style:this,r:e,zf:u,sColor:o,sLength:i,sWidth:a})}}])&&Xo(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function Ko(t){return Ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ko(t)}function Jo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Qo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ko(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ko(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ko(o)?o:String(o)),r)}var o}function ti(t,e){return ti=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ti(t,e)}function ei(t){return ei=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ei(t)}var ni=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ti(t,e)}(u,t);var e,n,r,o,i,a=(o=u,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ei(o);if(i){var n=ei(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ko(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function u(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),e=a.call(this,t),t=t||{},e.textCol=t.textCol,e.text=t.text||function(t,e,n,r){return"X"},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.fontSizeCol=t.fontSizeCol,e.fontSize=t.fontSize||function(t,e,n,r){return.8*e},e.fontFamily=t.fontFamily||"Arial",e.fontWeight=t.fontWeight||"bold",e}return e=u,r=[{key:"getCharLegendFun",value:function(t){var e=t.length;return function(n){return 0==n?"":1==n?t[e-1]:t[Math.floor(n*e)]}}}],(n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i,a,u=n.getZf();this.textCol&&(o=bo.getStatistics(t,(function(t){return t[r.textCol]}),!0)),this.colorCol&&(i=bo.getStatistics(t,(function(t){return t[r.colorCol]}),!0)),this.fontSizeCol&&(t.sort((function(t,e){return e[r.fontSizeCol]-t[r.fontSizeCol]})),a=bo.getStatistics(t,(function(t){return t[r.fontSizeCol]}),!0)),n.initCanvasTransform();var l,c=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Jo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(l=c.n()).done;){var s=l.value,f=this.text?this.text(s[this.textCol],e,o,u):void 0;if(null!=f&&null!=f&&f+""!=""){var h=this.color?this.color(s[this.colorCol],e,i,u):void 0;if(h){n.ctx.fillStyle=h;var y=this.fontSize(s[this.fontSizeCol],e,a,u)/u,p=this.fontFamily||"Arial",v=this.fontWeight||"bold";n.ctx.font=v+" "+y+"px "+p;var d=this.offset(s,e,u);n.ctx.textAlign="center";var m=n.geoToPixX(s.x+.5*e+d.dx),b=n.geoToPixY(s.y+.5*e+d.dy)+.3*y;n.ctx.fillText(f,m,b)}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:u,sColor:i})}}])&&Qo(e.prototype,n),r&&Qo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),u}(bo);function ri(t){return ri="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ri(t)}function oi(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ii(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ii(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ii(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ai(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ri(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ri(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===ri(o)?o:String(o)),r)}var o}function ui(t,e){return ui=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ui(t,e)}function li(t){return li=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},li(t)}var ci=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ui(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=li(r);if(o){var n=li(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ri(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.heightCol=t.heightCol,e.height=t.height,e.colorCol=t.colorCol,e.color=t.color||function(){return"#c08c59"},e.widthCol=t.widthCol,e.width=t.width||function(t,e){return.5*e},e.simple=null!=t.simple,e.viewHeightFactor=t.viewHeightFactor||1.5,e.viewSX=null==t.viewSX?0:t.viewSX,e.viewSY=null==t.viewSY?-.5:t.viewSY,e.shadowDirection=null==t.shadowDirection?-40.3*Math.PI/180:t.shadowDirection,e.shadowFactor=t.shadowFactor||.3,e.shadowColor=t.shadowColor||"#00000033",e.outlineCol=t.outlineCol||"#FFFFFF",e.outlineWidthPix=null==t.outlineWidthPix?.5:t.outlineWidthPix,e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i,a,u=n.getZf();this.heightCol&&(o=bo.getStatistics(t,(function(t){return t[r.heightCol]}),!0)),this.colorCol&&(i=bo.getStatistics(t,(function(t){return t[r.colorCol]}),!0)),this.widthCol&&(a=bo.getStatistics(t,(function(t){return t[r.widthCol]}),!0));var l=n.getCenter().x+this.viewSX*n.w*u,c=n.getCenter().y+this.viewSY*n.h*u,s=this.viewHeightFactor*(n.w+n.h)*.5*u;t.sort((function(t,e){return 1e8*(e.y-t.y)+t.x-e.x})),n.ctx.lineCap=this.simple?"butt":"round",n.setCanvasTransform(),n.ctx.strokeStyle=this.shadowColor,n.ctx.fillStyle=this.shadowColor;var f,h=oi(t);try{for(h.s();!(f=h.n()).done;){var y=f.value,p=this.width?this.width(y[this.widthCol],e,a,u):void 0;if(p&&!(p<0)){var v=this.height?this.height(y[this.heightCol],e,o,u):void 0;if(v&&!(v<0)){this.offset(y,e,u),n.ctx.lineWidth=p;var d=y.x+e/2,m=y.y+e/2,b=v*this.shadowFactor;n.ctx.beginPath(),n.ctx.moveTo(d,m),n.ctx.lineTo(d+b*Math.cos(this.shadowDirection),m+b*Math.sin(this.shadowDirection)),n.ctx.stroke()}}}}catch(t){h.e(t)}finally{h.f()}var g,w=oi(t);try{for(w.s();!(g=w.n()).done;){var x=g.value,S=this.color?this.color(x[this.colorCol],e,i):void 0;if(S){var _=this.width?this.width(x[this.widthCol],e,a,u):void 0;if(_&&!(_<0)){var O=this.height?this.height(x[this.heightCol],e,o,u):void 0;if(O&&!(O<0)){this.offset(x,e,u);var j=x.x+e/2,P=x.y+e/2,k=j-l,E=P-c,C=Math.atan2(E,k),T=Math.sqrt(k*k+E*E)*O/(s-O);this.simple?(n.ctx.strokeStyle=S,n.ctx.lineWidth=_,n.ctx.beginPath(),n.ctx.moveTo(j,P),n.ctx.lineTo(j+T*Math.cos(C),P+T*Math.sin(C)),n.ctx.stroke()):(n.ctx.strokeStyle=this.outlineCol,n.ctx.lineWidth=_+2*this.outlineWidthPix*u,n.ctx.beginPath(),n.ctx.moveTo(j,P),n.ctx.lineTo(j+T*Math.cos(C),P+T*Math.sin(C)),n.ctx.stroke(),n.ctx.strokeStyle=S,n.ctx.lineWidth=_,n.ctx.beginPath(),n.ctx.moveTo(j,P),n.ctx.lineTo(j+T*Math.cos(C),P+T*Math.sin(C)),n.ctx.stroke(),n.ctx.strokeStyle=this.outlineCol,n.ctx.lineWidth=this.outlineWidthPix*u,n.ctx.beginPath(),n.ctx.arc(j+T*Math.cos(C),P+T*Math.sin(C),.5*_,0,2*Math.PI,!1),n.ctx.stroke())}}}}}catch(t){w.e(t)}finally{w.f()}n.ctx.lineCap="butt",this.updateLegends({style:this,r:e,zf:u,sColor:i})}}])&&ai(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function si(t){return si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},si(t)}function fi(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return hi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function hi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function yi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==si(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==si(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===si(o)?o:String(o)),r)}var o}function pi(t,e){return pi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pi(t,e)}function vi(t){return vi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vi(t)}var di=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pi(t,e)}(u,t);var e,n,r,o,i,a=(o=u,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=vi(o);if(i){var n=vi(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===si(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function u(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),e=a.call(this,t),t=t||{},e.valueCol=t.valueCol,e.value=t.value||function(t,e,n,r,o){return 1},e.color=t.color||function(){return"#EA6BAC"},e.width=t.width||function(t,e,n,r){return e*t.value/5},e.orientation=t.orientation||0,e.fillColor=t.fillColor,e}return e=u,n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i=n.getZf();this.valueCol&&(o=bo.getStatistics(t,(function(t){return t[r.valueCol]}),!0));var a=[],l=.001*e;t.sort((function(t,e){return e.x==t.x?t.y-e.y:t.x-e.x}));for(var c=t[0],s=1;s<t.length;s++){var f=t[s];Math.abs(c.y+e-f.y)<=l&&Math.abs(c.x-f.x)<=l?a.push({x:c.x,y:f.y,or:"h",value:this.value(c[this.valueCol],f[this.valueCol],e,o,i)}):(a.push({x:c.x,y:c.y+e,or:"h",value:this.value(c[this.valueCol],void 0,e,o,i)}),a.push({x:f.x,y:f.y,or:"h",value:this.value(void 0,f[this.valueCol],e,o,i)})),c=f}t.sort((function(t,e){return e.y==t.y?t.x-e.x:t.y-e.y})),c=t[0];for(var h=1;h<t.length;h++){var y=t[h];Math.abs(c.x+e-y.x)<=l&&Math.abs(c.y-y.y)<=l?a.push({x:c.x+e,y:c.y,or:"v",value:this.value(c[this.valueCol],y[this.valueCol],e,o,i)}):(a.push({x:c.x+e,y:c.y,or:"v",value:this.value(c[this.valueCol],void 0,e,o,i)}),a.push({x:y.x,y:y.y,or:"v",value:this.value(void 0,y[this.valueCol],e,o,i)})),c=y}if(0!=a.length){var p=u.getSideStatistics(a,!0);if(n.setCanvasTransform(),this.fillColor){var v,d=fi(t);try{for(d.s();!(v=d.n()).done;){var m=v.value,b=this.fillColor(m);b&&"none"!=b&&(n.ctx.fillStyle=b,n.ctx.fillRect(m.x,m.y,e,e))}}catch(t){d.e(t)}finally{d.f()}}n.ctx.lineCap="butt";for(var g=e/2,w=0,x=a;w<x.length;w++){var S=x[w],_=this.color?this.color(S,e,p,i):void 0;if(_&&"none"!=_){var O=this.width?this.width(S,e,p,i):void 0;!O||O<=0||(n.ctx.strokeStyle=_,n.ctx.lineWidth=O,n.ctx.beginPath(),90==this.orientation?(n.ctx.moveTo(S.x+g,S.y+g),"h"===S.or?n.ctx.lineTo(S.x+g,S.y-g):n.ctx.lineTo(S.x-g,S.y+g)):(n.ctx.moveTo(S.x,S.y),n.ctx.lineTo(S.x+("h"===S.or?e:0),S.y+("v"===S.or?e:0))),n.ctx.stroke())}}this.updateLegends({style:this,r:e,zf:i})}}}],r=[{key:"getSideStatistics",value:function(t,e){if(t&&0!=t.length){var n,r=1/0,o=-1/0,i=fi(t);try{for(i.s();!(n=i.n()).done;){var a=n.value.value;e&&!a||(a<r&&(r=a),a>o&&(o=a))}}catch(t){i.e(t)}finally{i.f()}return{min:r,max:o}}}}],n&&yi(e.prototype,n),r&&yi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),u}(bo);function mi(t){return mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mi(t)}function bi(t,e){return bi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bi(t,e)}function gi(t){return gi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},gi(t)}var wi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&bi(t,e)}(i,t);var e,n,r,o=(n=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=gi(n);if(r){var o=gi(this).constructor;t=Reflect.construct(e,arguments,o)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===mi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function i(t){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),(t=t||{}).breaks=t.breaks||[100,1e3,1e4,1e5,1e6],t.width=t.width||function(){return 1},t.color=t.color||function(){return"#E7A935"};var n=function(e){if(null==e)return 0;for(var n=0;n<t.breaks.length;n++)if(e<t.breaks[n])return n;return t.breaks.length};return e.value=function(t,e,r,o,i){return Math.abs(n(e)-n(t))},e.color=function(e,n,r,o){return e.value?t.color(e,n,o):void 0},e.width=function(e,n,r,o){return e.value*o*t.width(e,n,o)},e}return e=i,Object.defineProperty(e,"prototype",{writable:!1}),e}(di);function xi(t){return xi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xi(t)}function Si(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function _i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==xi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==xi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===xi(o)?o:String(o)),r)}var o}function Oi(t,e){return Oi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Oi(t,e)}function ji(t){return ji=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ji(t)}var Pi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Oi(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ji(r);if(o){var n=ji(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===xi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.col=t.col,e.color=t.color,e.width=t.width||function(t,e,n){return.2*e},e.fillColor=t.fillColor,e}return e=a,(n=[{key:"draw",value:function(t,e,n){if(this.filter&&(t=t.filter(this.filter)),t&&0!=t.length){var r=n.getZf(),o=[];t.sort((function(t,e){return e.x==t.x?t.y-e.y:t.x-e.x}));for(var i=t[0],a=i[this.col],u=1;u<t.length;u++){var l=t[u],c=l[this.col];i.y+e==l.y&&i.x==l.x?a!=c&&o.push({x:i.x,y:l.y,or:"h",v1:a,v2:c}):(o.push({x:i.x,y:i.y+e,or:"h",v1:a,v2:void 0}),o.push({x:l.x,y:l.y,or:"h",v1:void 0,v2:c})),i=l,a=c}t.sort((function(t,e){return e.y==t.y?t.x-e.x:t.y-e.y})),a=(i=t[0])[this.col];for(var s=1;s<t.length;s++){var f=t[s],h=f[this.col];i.x+e==f.x&&i.y==f.y?a!=h&&o.push({x:i.x+e,y:i.y,or:"v",v1:a,v2:h}):(o.push({x:i.x+e,y:i.y,or:"v",v1:a,v2:void 0}),o.push({x:f.x,y:f.y,or:"v",v1:void 0,v2:h})),i=f,a=h}if(0!=o.length){if(n.setCanvasTransform(),this.fillColor){var y,p=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Si(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Si(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(p.s();!(y=p.n()).done;){var v=y.value,d=this.fillColor(v);d&&"none"!=d&&(n.ctx.fillStyle=d,n.ctx.fillRect(v.x,v.y,e,e))}}catch(t){p.e(t)}finally{p.f()}}n.ctx.lineCap="butt";for(var m=0,b=o;m<b.length;m++){var g=b[m],w=this.width?this.width(g,e,r):void 0;if(w&&!(w<=0)){var x=.5*w;n.ctx.lineWidth=w,"h"===g.or?(g.v2&&(n.ctx.beginPath(),n.ctx.strokeStyle=this.color[g.v2],n.ctx.moveTo(g.x,g.y+x),n.ctx.lineTo(g.x+e,g.y+x),n.ctx.stroke()),g.v1&&(n.ctx.beginPath(),n.ctx.strokeStyle=this.color[g.v1],n.ctx.moveTo(g.x,g.y-x),n.ctx.lineTo(g.x+e,g.y-x),n.ctx.stroke())):(g.v2&&(n.ctx.beginPath(),n.ctx.strokeStyle=this.color[g.v2],n.ctx.moveTo(g.x+x,g.y),n.ctx.lineTo(g.x+x,g.y+e),n.ctx.stroke()),g.v1&&(n.ctx.beginPath(),n.ctx.strokeStyle=this.color[g.v1],n.ctx.moveTo(g.x-x,g.y),n.ctx.lineTo(g.x-x,g.y+e),n.ctx.stroke()))}}this.updateLegends({style:this,r:e,zf:r})}}}}])&&_i(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);const ki=function t(e){function n(t,n){var r,o;return t=null==t?0:+t,n=null==n?1:+n,function(){var i;if(null!=r)i=r,r=null;else do{r=2*e()-1,i=2*e()-1,o=r*r+i*i}while(!o||o>1);return t+n*i*Math.sqrt(-2*Math.log(o)/o)}}return n.source=t,n}(Math.random);function Ei(t,e,n){var r=document.createElement("canvas");r.setAttribute("width",t),r.setAttribute("height",e);var o=r.getContext("webgl",n);if(!o)throw new Error("Unable to initialize WebGL. Your browser or machine may not support it.");return{canvas:r,gl:o}}function Ci(t){var e=t.createProgram();if(null==e)throw new Error("Cannot create webGL program");for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];for(var i=0,a=r;i<a.length;i++){var u=a[i];t.attachShader(e,u)}if(t.linkProgram(e),t.getProgramParameter(e,t.LINK_STATUS))return e;throw new Error(t.getProgramInfoLog(e)||"Cannot create webGL program (2)")}function Ti(t,e){var n=t.createShader(e);if(null==n)throw new Error("Cannot create webGL shader");for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];if(t.shaderSource(n,o.join("\n")),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS))return n;throw new Error(t.getShaderInfoLog(n)||"Cannot create webGL shader (2)")}function Ai(t){return Ai="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ai(t)}function Mi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ai(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ai(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ai(o)?o:String(o)),r)}var o}var Ri=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gl=e,this.sizePix=n||10,this.program=Ci(e,Ti(e,e.VERTEX_SHADER,"\n attribute vec2 pos;\n uniform float sizePix;\n uniform mat3 mat;\n attribute vec4 color;\n varying vec4 vColor;\n void main() {\n gl_Position = vec4(mat * vec3(pos, 1.0), 1.0);\n gl_PointSize = sizePix;\n vColor = color;\n }\n "),Ti(e,e.FRAGMENT_SHADER,"\n precision mediump float;\n varying vec4 vColor;\n void main(void) {\n vec4 vColor_ = vColor / 255.0;\n vColor_[3] = 255.0 * vColor_[3];\n gl_FragColor = vColor_;\n }")),e.useProgram(this.program),this.verticesBuffer=[],this.colorsBuffer=[]}var e,n;return e=t,(n=[{key:"addPointData",value:function(t,e,n){var r=Me(n);r&&(this.verticesBuffer.push(t,e),this.colorsBuffer.push(r.r,r.g,r.b,r.opacity))}},{key:"addPointData2",value:function(t,e,n,r,o,i){this.verticesBuffer.push(t,e),this.colorsBuffer.push(n,r,o,i)}},{key:"draw",value:function(t){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,e.createBuffer()),e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.verticesBuffer),e.STATIC_DRAW);var n=e.getAttribLocation(this.program,"pos");e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n),e.bindBuffer(e.ARRAY_BUFFER,e.createBuffer()),e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.colorsBuffer),e.STATIC_DRAW);var r=e.getAttribLocation(this.program,"color");e.vertexAttribPointer(r,4,e.FLOAT,!1,0,0),e.enableVertexAttribArray(r),e.uniform1f(e.getUniformLocation(this.program,"sizePix"),1*this.sizePix),e.uniformMatrix3fv(e.getUniformLocation(this.program,"mat"),!1,new Float32Array(t)),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.POINTS,0,this.verticesBuffer.length/2)}}])&&Mi(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Li(t){return Li="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Li(t)}function zi(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Fi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Fi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ii(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Li(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Li(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Li(o)?o:String(o)),r)}var o}function Ni(t,e){return Ni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ni(t,e)}function Bi(t){return Bi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bi(t)}var Di=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ni(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Bi(r);if(o){var n=Bi(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Li(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.nbCol=t.nbCol,e.nb=t.nb||function(t,e,n,r){return.3*e*e/(r*r)*t/n.max},e.color=t.color||function(){return"#FF5733"},e.dotSize=t.dotSize,e.sigma=t.sigma,e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i=n.getZf();if(this.nbCol&&(o=bo.getStatistics(t,(function(t){return t[r.nbCol]}),!0)),o){var a=this.dotSize?this.dotSize(e,i):2*i,u=this.sigma?this.sigma(e,i):.4*e,l=ki(0,u);if(function(){try{var t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(t){return!1}}()){var c=Ei(n.w+"",n.h+"");if(!c)return void console.error("No webGL");var s,f,h,y,p,v,d,m=new Ri(c.gl,a/i),b=e/2,g=zi(t);try{for(g.s();!(d=g.n()).done;){var w=d.value;if((s=this.color(w))&&"none"!==s){if(f=this.offset(w,e,i),h=this.nb(w[this.nbCol],e,o,i),y=w.x+f.dx+b,p=w.y+f.dy+b,!(v=Me(s)))return;for(var x=0;x<=h;x++)m.addPointData2(y+l(),p+l(),v.r,v.g,v.b,v.opacity)}}}catch(t){g.e(t)}finally{g.f()}m.draw(n.getWebGLTransform()),n.initCanvasTransform(),n.ctx.drawImage(c.canvas,0,0)}else{n.setCanvasTransform();var S,_=zi(t);try{for(_.s();!(S=_.n()).done;){var O=S.value,j=this.color(O);if(j&&"none"!==j){n.ctx.fillStyle=j;for(var P=this.offset(O,e,i),k=this.nb(O[this.nbCol],e,o,i),E=O.x+P.dx+e/2,C=O.y+P.dy+e/2,T=0;T<=k;T++)n.ctx.fillRect(E+l(),C+l(),a,a)}}}catch(t){_.e(t)}finally{_.f()}}this.updateLegends({style:this,r:e,zf:i})}}}])&&Ii(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function Gi(t){return Gi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gi(t)}function Zi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Gi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Gi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Gi(o)?o:String(o)),r)}var o}var Ui=function(){function t(e,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gl=e;var a=Ti(e,e.VERTEX_SHADER,"\n attribute vec2 pos;\n uniform float sizePix;\n uniform mat3 mat;\n\n attribute float t;\n varying float vt;\n\n void main() {\n gl_Position = vec4(mat * vec3(pos, 1.0), 1.0);\n gl_PointSize = sizePix;\n vt = t;\n }\n "),u="precision mediump float;\nvarying float vt;\nuniform float alpha;\n"+function(){for(var t=[],e=0;e<n.length;e++)t.push("uniform vec4 c"+e+";\n");return t.join("")}()+"void main(void) {\n";if(r?"pow"==r.fun?u+=" float t = pow(vt, alpha);\n":"powRev"==r.fun?u+=" float t = 1.0-pow(1.0-vt, 1.0/alpha);\n":"exp"==r.fun?u+=0==r.alpha?"float t = vt;":" float t = (exp(vt * alpha) - 1.0) / (exp(alpha) - 1.0);\n":"expRev"==r.fun?u+=0==r.alpha?"float t = vt;":" float t = 1.0 - (1.0 / alpha) * log(exp(alpha) * (1.0 - vt) + vt);\n":"circleLow"==r.fun?0==r.alpha?u+=" float t = vt;\n":1==r.alpha?u+=" float t = sqrt(vt * (2.0 - vt));\n":u+=" float a = alpha / (1.0 - alpha);\n float t = sqrt(1.0 / (a * a) + vt * ( 2.0/a + 2.0 - vt )) - 1.0 / a;\n":"circleHigh"==r.fun?0==r.alpha?u+=" float t = vt;\n":1==r.alpha?u+=" float t = 1.0 - sqrt((1.0 - vt) * (1.0 + vt));\n":u+=" float a = alpha / (1.0 - alpha);\n float t = 1.0 - sqrt(1.0 / (a * a) + (1.0-vt) * ( 2.0/a + 1.0 + vt )) + 1.0 / a;\n":(console.error("Unexpected stretching function code: "+r.fun),u+=" float t = vt;\n"):u+=" float t = vt;\n",1==n.length)u+=" vec4 cI=c0;\n vec4 cF=c0;\n";else if(2==n.length)u+=" vec4 cI=c0;\n vec4 cF=c1;\n";else{var l=n.length-1,c=l+".0";u+=" vec4 cI;\n",u+=" vec4 cF;\n",u+=" if(t<1.0/"+c+") { cI=c0; cF=c1; t=t*"+c+"; }\n";for(var s=2;s<l;s++)u+=" else if(t<"+s+".0/"+c+") { cI=c"+(s-1)+"; cF=c"+s+"; t="+c+"*t-"+(s-1)+".0; }\n";u+=" else { cI=c"+(l-1)+"; cF=c"+l+"; t="+c+"*t-"+(l-1)+".0; }\n"}1==n.length?u+=" gl_FragColor = vec4(c0[0], c0[1], c0[2], c0[3]);}\n":u+=" gl_FragColor = mix(cI, cF, t);}\n";var f=Ti(e,e.FRAGMENT_SHADER,u);this.program=Ci(e,a,f),e.useProgram(this.program),e.uniform1f(e.getUniformLocation(this.program,"sizePix"),1*o),e.uniform1f(e.getUniformLocation(this.program,"alpha"),r?1*r.alpha:0);for(var h=0;h<n.length;h++){var y=Me(n[h]),p=y.opacity;1==y.opacity&&null!=i&&(p=i),e.uniform4fv(e.getUniformLocation(this.program,"c"+h),[+y.r/255,+y.g/255,+y.b/255,+p])}}var e,n;return e=t,(n=[{key:"draw",value:function(t,e,n){var r=this.gl,o=this.program;r.bindBuffer(r.ARRAY_BUFFER,r.createBuffer()),r.bufferData(r.ARRAY_BUFFER,new Float32Array(t),r.STATIC_DRAW);var i=r.getAttribLocation(o,"pos");r.vertexAttribPointer(i,2,r.FLOAT,!1,0,0),r.enableVertexAttribArray(i),r.bindBuffer(r.ARRAY_BUFFER,r.createBuffer()),r.bufferData(r.ARRAY_BUFFER,new Float32Array(e),r.STATIC_DRAW);var a=r.getAttribLocation(o,"t");r.vertexAttribPointer(a,1,r.FLOAT,!1,0,0),r.enableVertexAttribArray(a),r.uniformMatrix3fv(r.getUniformLocation(o,"mat"),!1,new Float32Array(n)),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.POINTS,0,t.length/2)}}])&&Zi(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Wi(t){return Wi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wi(t)}function $i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Yi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Wi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Wi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Wi(o)?o:String(o)),r)}var o}function Xi(t,e){return Xi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xi(t,e)}function Hi(t){return Hi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Hi(t)}var Vi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Xi(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Hi(r);if(o){var n=Hi(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Wi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorCol=t.colorCol,e.tFun=t.tFun||function(t,e,n){return t/n.max},e.stretching=t.stretching,e.colors=t.colors||["rgb(158, 1, 66)","rgb(248, 142, 83)","rgb(251, 248, 176)","rgb(137, 207, 165)","rgb(94, 79, 162)"].reverse(),t.color&&(e.colors=[t.color(0),t.color(.2),t.color(.4),t.color(.6),t.color(.8),t.color(1)]),e.opacity=t.opacity,e.size=t.size,e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o=n.getZf(),i=bo.getStatistics(t,(function(t){return t[r.colorCol]}),!0);if(i){var a=Ei(n.w+"",n.h+"",null!=this.opacity?{premultipliedAlpha:!1}:void 0);if(a){var u,l=e/2,c=[],s=[],f=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return $i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$i(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(f.s();!(u=f.n()).done;){var h=u.value,y=this.tFun(h[this.colorCol],e,i);null!=y&&null!=y&&(c.push(h.x+l,h.y+l),s.push(y>1?1:y<0?0:y))}}catch(t){f.e(t)}finally{f.f()}var p=this.size?this.size(e,o):e+.2*o,v=this.opacity?this.opacity(e,o):void 0;new Ui(a.gl,this.colors,this.stretching,p/o,v).draw(c,s,n.getWebGLTransform()),n.initCanvasTransform(),n.ctx.drawImage(a.canvas,0,0),this.updateLegends({style:this,r:e,zf:o,sColor:i})}else console.error("No webGL")}}}])&&Yi(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function qi(t){return qi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qi(t)}function Ki(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==qi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==qi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===qi(o)?o:String(o)),r)}var o}var Ji=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n;return e=t,n=[{key:"get",value:function(t,e){if(null!=(e=e||{}).nb){e.nb<2&&(console.error("unexpected number of colors in tanaka (<2): "+e.nb),e.nb=2),e.color||(console.error("color function not defined in tanaka"),e.color=function(){return"gray"}),e.colors=[];for(var n=0;n<e.nb;n++)e.colors.push(e.color(n/(e.nb-1)))}e.colors=e.colors||["#a9bb9e","#c9dcaa","#fde89f","#f9a579","#eb444b"];var r=e.colors.length;e.tFun=e.tFun||function(t,e,n){return(t-n.min)/(n.max-n.min)},e.colDark=e.colDark||"#111",e.colBright=e.colBright||"#ddd",e.widthFactor=e.widthFactor||.08,e.newShading=e.newShading,e.newShadingWidthPix=e.newShadingWidthPix||2,e.newShadingTr=e.newShadingTr||function(t,e){return Math.abs(t)/Math.max(Math.abs(e.min),Math.abs(e.max))};var o=function(t){if(isNaN(t)||null==t)return console.error("Unexpected t value 1: "+t),-9;for(var e=0;e<r;e++)if(t<=(e+1)/r)return e;return console.error("Unexpected t value 2: "+t),-9};return[new Vi({colorCol:t,colors:e.colors,tFun:function(t,n,i){var a=e.tFun(t,n,i);return o(a)/(r-1)},size:function(t,e){return t+.5*e},filter:e.filter}),new di({valueCol:t,value:function(t,n,r,i,a){if(void 0===t&&void 0===n)return 0;if(void 0===n){var u=e.tFun(t,r,i);if(null==u||isNaN(u))throw new Error("Unexpected value: "+t+" - "+u);return o(u)+1}if(void 0===t){var l=e.tFun(n,r,i);if(null==l||isNaN(l))throw new Error("Unexpected value: "+n+" - "+l);return-o(l)-1}var c=e.tFun(t,r,i);if(null==c||isNaN(c))throw new Error("Unexpected value: "+t+" - "+c);var s=e.tFun(n,r,i);if(null==s||isNaN(s))throw new Error("Unexpected value: "+n+" - "+s);var f=o(c);return-o(s)+f},color:e.newShading?function(t,n,r,o){var i=e.newShadingTr(t.value,r);return t.value>0&&"h"===t.or||t.value<0&&"v"===t.or?"rgba(255,255,100,"+i+")":"rgba(0,0,0,"+i+")"}:function(t,n,r,o){if(0!==t.value)return"v"===t.or?t.value<0?e.colBright:e.colDark:t.value<0?e.colDark:e.colBright},width:e.newShading?function(t,n,r,o){return e.newShadingWidthPix*o}:function(t,n,r,o){return e.widthFactor*n*Math.abs(t.value)*("v"===t.or?.5:1)},filter:e.filter})]}}],null&&Ki(e.prototype,null),n&&Ki(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Qi(t){return Qi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qi(t)}function ta(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Qi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Qi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Qi(o)?o:String(o)),r)}var o}var ea=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.colors=e,this.vshString="\n attribute vec2 pos;\n uniform float sizePix;\n uniform mat3 mat;\n\n attribute float i;\n varying float vi;\n\n void main() {\n gl_Position = vec4(mat * vec3(pos, 1.0), 1.0);\n gl_PointSize = sizePix;\n vi = i;\n }\n ";var n=[];n.push("precision mediump float;\nvarying float vi;\n"),n.push("uniform vec4");for(var r=0;r<e.length;r++)r>0&&n.push(","),n.push(" c"+r);n.push(";\n"),n.push("void main(void) {\n");for(var o=0;o<e.length;o++)o>0&&n.push("else "),n.push("if(vi=="),n.push(o),n.push(".0) gl_FragColor = vec4(c"),n.push(o),n.push("[0], c"),n.push(o),n.push("[1], c"),n.push(o),n.push("[2], c"),n.push(o),n.push("[3]);\n");n.push("else gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n}"),this.fshString=n.join("")}var e,n;return e=t,n=[{key:"draw",value:function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,i=Ci(t,Ti(t,t.VERTEX_SHADER,this.vshString),Ti(t,t.FRAGMENT_SHADER,this.fshString));t.useProgram(i),t.uniform1f(t.getUniformLocation(i,"sizePix"),1*o);for(var a=0;a<this.colors.length;a++){var u=Me(this.colors[a]);t.uniform4fv(t.getUniformLocation(i,"c"+a),[+u.r/255,+u.g/255,+u.b/255,+u.opacity])}t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bufferData(t.ARRAY_BUFFER,new Float32Array(e),t.STATIC_DRAW);var l=t.getAttribLocation(i,"pos");t.vertexAttribPointer(l,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(l),t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bufferData(t.ARRAY_BUFFER,new Float32Array(n),t.STATIC_DRAW);var c=t.getAttribLocation(i,"i");t.vertexAttribPointer(c,1,t.FLOAT,!1,0,0),t.enableVertexAttribArray(c),t.uniformMatrix3fv(t.getUniformLocation(i,"mat"),!1,new Float32Array(r)),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.POINTS,0,e.length/2)}}],n&&ta(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function na(t){return na="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},na(t)}function ra(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==na(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==na(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===na(o)?o:String(o)),r)}var o}function oa(t,e){return oa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},oa(t,e)}function ia(t){return ia=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ia(t)}var aa=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&oa(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ia(r);if(o){var n=ia(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===na(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorCol=t.colorCol,t.color=t.color||void 0;var n=Object.keys(t.color);e.catToI={};for(var r=0;r<n.length;r++)e.catToI[n[r]]=r+"";e.colors=[];for(var o=0;o<n.length;o++)e.colors.push(t.color[""+n[o]]);return e.size=t.size,e.wgp=new ea(e.colors),e}return e=a,(n=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));for(var r,o=n.getZf(),i=e/2,a=t.length,u=[],l=[],c=0;c<a;c++){var s=(r=t[c])[this.colorCol];if(null!=s){var f=this.catToI[s];isNaN(+f)?console.log("Unexpected category index: "+s+" "+f):(u.push(r.x+i,r.y+i),l.push(+f))}else console.log("Unexpected category: "+s)}var h=Ei(n.w+"",n.h+"");if(h){var y=this.size?this.size(e,o):e+.2*o;this.wgp.draw(h.gl,u,l,n.getWebGLTransform(),y/o),n.initCanvasTransform(),n.ctx.drawImage(h.canvas,0,0),this.updateLegends({style:this,r:e,zf:o})}else console.error("No webGL")}}])&&ra(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function ua(t){return ua="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ua(t)}function la(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ca(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ca(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ca(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function sa(t,e){return sa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},sa(t,e)}function fa(t){return fa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fa(t)}function ha(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ya(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ua(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ua(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===ua(o)?o:String(o)),r)}var o}function pa(t,e,n){return e&&ya(t.prototype,e),n&&ya(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var va=function(){function t(){ha(this,t)}return pa(t,null,[{key:"get",value:function(t,e){(e=e||{}).colors=e.colors||["#00852b","#afd246","#fac80a","#bb805a","#d67923","#cb4e29","#b40000","#720012"],e.colDark=e.colDark||"#333",e.colBright=e.colBright||"#aaa",e.widthFactor=e.widthFactor||.12;var n=Ji.get(t,e),r=new To({strokeColor:function(){return"#666"},strokeWidth:function(t,e,n,r){return.2*r},filter:e.filter});return[n[0],r,n[1],new da({colDark:e.colDark,colBright:e.colBright,filter:e.filter})]}},{key:"getCat",value:function(t,e){return(e=e||{}).colDark=e.colDark||"#333",e.colBright=e.colBright||"#aaa",[new aa({colorCol:t,color:e.color}),new To({strokeColor:function(){return"#666"},strokeWidth:function(t,e,n,r){return.2*r}}),new da({colDark:e.colDark,colBright:e.colBright})]}}]),t}(),da=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&sa(t,e)}(o,t);var e,n,r=(e=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=fa(e);if(n){var o=fa(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return function(t,e){if(e&&("object"===ua(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function o(t){var e;return ha(this,o),e=r.call(this,t),t=t||{},e.colDark=t.colDark||"#333",e.colBright=t.colBright||"#aaa",e}return pa(o,[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter)),n.ctx.lineWidth=.6*n.getZf(),n.ctx.strokeStyle=this.colDark;var r,o=la(t);try{for(o.s();!(r=o.n()).done;){var i=r.value;n.ctx.beginPath(),n.ctx.arc(i.x+.5*e,i.y+.5*e,.55*e*.5,Math.PI/4,-Math.PI*(3/4),!0),n.ctx.stroke()}}catch(t){o.e(t)}finally{o.f()}n.ctx.strokeStyle=this.colBright;var a,u=la(t);try{for(u.s();!(a=u.n()).done;){var l=a.value;n.ctx.beginPath(),n.ctx.arc(l.x+.5*e,l.y+.5*e,.55*e*.5,Math.PI/4,-Math.PI*(3/4),!1),n.ctx.stroke()}}catch(t){u.e(t)}finally{u.f()}}}]),o}(bo);function ma(t){return ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ma(t)}function ba(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ga(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ma(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ma(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===ma(o)?o:String(o)),r)}var o}function wa(t,e){return wa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wa(t,e)}function xa(t){return xa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xa(t)}var Sa=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wa(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=xa(r);if(o){var n=xa(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ma(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.mosaicFactor=t.mosaicFactor||.15,e.shadowFactor=t.shadowFactor||.2,e.shadowColor=t.shadowColor||"#555",e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i=n.getZf();this.colorCol&&(o=bo.getStatistics(t,(function(t){return t[r.colorCol]}),!0)),n.ctx.strokeStyle=this.shadowColor,n.ctx.lineWidth=this.shadowFactor*e,n.ctx.lineJoin="round",n.ctx.lineCap="butt";var a=e*this.mosaicFactor,u=function(){return{x:Math.random()*a,y:Math.random()*a}};n.setCanvasTransform();var l,c=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ba(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ba(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(l=c.n()).done;){var s=l.value,f=this.color?this.color(s[this.colorCol],e,o):void 0;if(f&&"none"!==f){n.ctx.fillStyle=f;var h=this.offset(s,e,i),y=u(),p=u(),v=u(),d=u();this.shadowFactor>0&&(n.ctx.beginPath(),n.ctx.moveTo(s.x+h.dx+y.x,s.y+h.dy+y.y),n.ctx.lineTo(s.x+h.dx+e-v.x,s.y+h.dy+v.y),n.ctx.lineTo(s.x+h.dx+e-d.x,s.y+h.dy+e-d.y),n.ctx.stroke()),n.ctx.beginPath(),n.ctx.moveTo(s.x+h.dx+y.x,s.y+h.dy+y.y),n.ctx.lineTo(s.x+h.dx+e-v.x,s.y+h.dy+v.y),n.ctx.lineTo(s.x+h.dx+e-d.x,s.y+h.dy+e-d.y),n.ctx.lineTo(s.x+h.dx+p.x,s.y+h.dy+e-p.y),n.ctx.fill()}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:i,sColor:o})}}])&&ga(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function _a(t){return _a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_a(t)}function Oa(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ja(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==_a(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==_a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===_a(o)?o:String(o)),r)}var o}function Pa(t,e){return Pa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pa(t,e)}function ka(t){return ka=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ka(t)}var Ea=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pa(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ka(r);if(o){var n=ka(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===_a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.sizeCol=t.sizeCol,e.size=t.size,e.shape=t.shape||function(){return"o"},e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i,a=n.getZf();this.sizeCol&&(t.sort((function(t,e){return e[r.sizeCol]-t[r.sizeCol]})),o=bo.getStatistics(t,(function(t){return t[r.sizeCol]}),!0)),this.colorCol&&(i=bo.getStatistics(t,(function(t){return t[r.colorCol]}),!0)),n.setCanvasTransform();var u,l=.5*e,c=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Oa(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Oa(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(u=c.n()).done;){var s=u.value,f=this.color?this.color(s[this.colorCol],e,i,a):void 0;if(f&&"none"!==f){n.ctx.fillStyle=f;var h=this.shape?this.shape(s):"o";if("none"!==h){var y=(this.size||function(){return.5})(s[this.sizeCol],e,o,a)*l,p=(this.offset(s,e,a),s.x+l),v=s.y+l;if("p"===h)n.ctx.beginPath(),n.ctx.moveTo(p,v+l),n.ctx.lineTo(p+y,v+y),n.ctx.lineTo(p+l,v),n.ctx.lineTo(p+y,v-y),n.ctx.lineTo(p,v-l),n.ctx.lineTo(p-y,v-y),n.ctx.lineTo(p-l,v),n.ctx.lineTo(p-y,v+y),n.ctx.fill();else{if("o"!==h)throw new Error("Unexpected shape:"+h);n.ctx.beginPath(),n.ctx.moveTo(p,v+y),n.ctx.lineTo(p+l,v+l),n.ctx.lineTo(p+y,v),n.ctx.lineTo(p+l,v-l),n.ctx.lineTo(p,v-y),n.ctx.lineTo(p-l,v-l),n.ctx.lineTo(p-y,v),n.ctx.lineTo(p-l,v+l),n.ctx.fill()}}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:a,sSize:o,sColor:i})}}])&&ja(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function Ca(t){return Ca="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ca(t)}function Ta(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ca(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ca(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ca(o)?o:String(o)),r)}var o}var Aa=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.id=e.id,this.top=e.top,this.bottom=e.bottom,this.left=e.left,this.right=e.right,this.background=e.background||"none",this.padding=e.padding||"5px",this.border=e.border||"0px",this["border-radius"]=e["border-radius"]||"none",this["box-shadow"]=e["box-shadow"]||"none",this["font-family"]=e["font-family"]||"Helvetica, Arial, sans-serif",this.width=e.width,this.height=e.height,this.id&&(this.div=pt("#"+this.id)),this.div&&!this.div.empty()||(this.div=pt(document.createElement("div")),this.id&&this.div.attr("id",this.id)),this.div.style("background",this.background),this.div.style("padding",this.padding),this.div.style("border",this.border),this.div.style("border-radius",this["border-radius"]),this.div.style("box-shadow",this["box-shadow"]),this.div.style("font-family",this["font-family"]),this.width&&this.div.style("width",this.width),this.height&&this.div.style("height",this.height)}var e,n;return e=t,(n=[{key:"style",value:function(t,e){return this.div.style(t,e),this}},{key:"update",value:function(t){console.error("Legend update not implemented yet.")}}])&&Ta(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ma(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}var Ra,La=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function za(t){if(!(e=La.exec(t)))throw new Error("invalid format: "+t);var e;return new Fa({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Fa(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Ia(t,e){var n=Ma(t,e);if(!n)return t+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}za.prototype=Fa.prototype,Fa.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Na={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Ia(100*t,e),r:Ia,s:function(t,e){var n=Ma(t,e);if(!n)return t+"";var r=n[0],o=n[1],i=o-(Ra=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=r.length;return i===a?r:i>a?r+new Array(i-a+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+Ma(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Ba(t){return t}var Da,Ga,Za=Array.prototype.map,Ua=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Wa(t){return Da=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?Ba:(e=Za.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var o=t.length,i=[],a=0,u=e[0],l=0;o>0&&u>0&&(l+u+1>r&&(u=Math.max(1,r-l)),i.push(t.substring(o-=u,o+u)),!((l+=u+1)>r));)u=e[a=(a+1)%e.length];return i.reverse().join(n)}),o=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?Ba:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Za.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",s=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=za(t)).fill,n=t.align,f=t.sign,h=t.symbol,y=t.zero,p=t.width,v=t.comma,d=t.precision,m=t.trim,b=t.type;"n"===b?(v=!0,b="g"):Na[b]||(void 0===d&&(d=12),m=!0,b="g"),(y||"0"===e&&"="===n)&&(y=!0,e="0",n="=");var g="$"===h?o:"#"===h&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",w="$"===h?i:/[%p]/.test(b)?l:"",x=Na[b],S=/[defgprs%]/.test(b);function _(t){var o,i,l,h=g,_=w;if("c"===b)_=x(t)+_,t="";else{var O=(t=+t)<0||1/t<0;if(t=isNaN(t)?s:x(Math.abs(t),d),m&&(t=function(t){t:for(var e,n=t.length,r=1,o=-1;r<n;++r)switch(t[r]){case".":o=e=r;break;case"0":0===o&&(o=r),e=r;break;default:if(!+t[r])break t;o>0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t}(t)),O&&0==+t&&"+"!==f&&(O=!1),h=(O?"("===f?f:c:"-"===f||"("===f?"":f)+h,_=("s"===b?Ua[8+Ra/3]:"")+_+(O&&"("===f?")":""),S)for(o=-1,i=t.length;++o<i;)if(48>(l=t.charCodeAt(o))||l>57){_=(46===l?a+t.slice(o+1):t.slice(o))+_,t=t.slice(0,o);break}}v&&!y&&(t=r(t,1/0));var j=h.length+t.length+_.length,P=j<p?new Array(p-j+1).join(e):"";switch(v&&y&&(t=r(P+t,P.length?p-_.length:1/0),P=""),n){case"<":t=h+t+_+P;break;case"=":t=h+P+t+_;break;case"^":t=P.slice(0,j=P.length>>1)+h+t+_+P.slice(j);break;default:t=P+h+t+_}return u(t)}return d=void 0===d?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),_.toString=function(){return t+""},_}return{format:f,formatPrefix:function(t,e){var n,r=f(((t=za(t)).type="f",t)),o=3*Math.max(-8,Math.min(8,Math.floor((n=e,((n=Ma(Math.abs(n)))?n[1]:NaN)/3)))),i=Math.pow(10,-o),a=Ua[8+o/3];return function(t){return r(i*t)+a}}}}(t),Ga=Da.format,Da.formatPrefix,Da}function $a(t){return $a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$a(t)}function Ya(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==$a(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==$a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===$a(o)?o:String(o)),r)}var o}function Xa(t,e){return Xa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xa(t,e)}function Ha(t){return Ha=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ha(t)}Wa({thousands:",",grouping:[3],currency:["$",""]});var Va=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Xa(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ha(r);if(o){var n=Ha(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===$a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorRamp=t.colorRamp,e.fun=t.fun,e.title=t.title,e.tickSize=t.tickSize||6,e.width=t.width||300,e.height=t.height||15,e.margin=t.margin||5,e.ticks=t.ticks||Math.floor(e.width/50),e.tickFormat=t.tickFormat||",.0f",e.tickUnit=t.tickUnit,e.fontSize=t.fontSize||"0.8em",e.invert=t.invert,e}return e=a,(n=[{key:"update",value:function(t){if(t.sColor){this.div.selectAll("*").remove();var e=this.width+2*this.margin,n=this.height+3*this.margin+12+this.tickSize+10,r=this.div.append("svg").attr("width",e).attr("height",n);r.append("text").attr("x",this.margin).attr("y",this.margin).style("font-size","0.8em").style("font-weight","bold").style("alignment-baseline","top").style("dominant-baseline","hanging").style("pointer-events","none").text(this.title);for(var o=r.append("g").attr("transform","translate("+this.margin+" "+(2*this.margin+12)+")"),i=this.width,a=this.height,u=0;u<i;u+=5){var l=u/(i-1);this.invert&&(l=1-l),o.append("rect").attr("x",u).attr("y",0).attr("width",5).attr("height",a).style("fill",this.colorRamp(l))}for(var c=0;c<this.ticks;c++){var s=c/(this.ticks-1);o.append("line").attr("x1",i*s).attr("y1",0).attr("x2",i*s).attr("y2",a+this.tickSize).style("stroke","black"),o.append("text").attr("id","ticklabel_"+c).attr("x",i*s).attr("y",a+this.tickSize+2).style("font-size",this.fontSize).style("text-anchor",0==c?"start":c==this.ticks-1?"end":"middle").style("alignment-baseline","top").style("dominant-baseline","hanging").style("pointer-events","none")}for(var f=this.tickFormat&&"text"!=this.tickFormat?Ga(this.tickFormat):function(t){return t},h=0;h<this.ticks;h++){var y=h/(this.ticks-1),p=this.fun(y,t.r,t.sColor),v=(p?f(p):"0")+(this.tickUnit?this.tickUnit:"");this.div.select("#ticklabel_"+h).text(v)}}}}])&&Ya(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Aa);function qa(t){return qa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qa(t)}function Ka(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==qa(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==qa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===qa(o)?o:String(o)),r)}var o}function Ja(t,e){return Ja=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ja(t,e)}function Qa(t){return Qa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qa(t)}var tu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ja(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Qa(r);if(o){var n=Qa(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===qa(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colors=t.colors,e.breaksText=t.breaksText,e.width=t.width||300,e.height=t.height||15,e.title=t.title,e.titleFontSize=t.titleFontSize||"0.8em",e.titleFontWeight=t.titleFontWeight||"bold",e.tickSize=t.tickSize||3,e.labelFontSize=t.labelFontSize||"0.8em",e.invert=t.invert,e}return e=a,(n=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.title&&this.div.append("div").style("font-size",this.titleFontSize).style("font-weight",this.titleFontWeight).style("margin-bottom","7px").text(this.title);var e=this.colors.length;if(0!=e){for(var n=this.width/e,r=this.div.append("svg").attr("width",this.width).attr("height",this.height+this.tickSize+2+10),o=0;o<e;o++)r.append("rect").attr("x",o*n).attr("y",0).attr("width",n).attr("height",this.height).style("fill",this.colors[o]);for(var i=1;i<e;i++)r.append("line").attr("x1",n*i).attr("y1",0).attr("x2",n*i).attr("y2",this.height+this.tickSize).style("stroke","black");for(var a=1;a<e;a++)r.append("text").attr("id","ticklabel_"+a).attr("x",n*a).attr("y",this.height+this.tickSize+2).style("font-size",this.labelFontSize).style("text-anchor",0==a?"start":a==this.ticks-1?"end":"middle").style("alignment-baseline","top").style("dominant-baseline","hanging").style("pointer-events","none").text(this.breaksText[a-1])}}}])&&Ka(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Aa);function eu(t){return eu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eu(t)}function nu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==eu(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==eu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===eu(o)?o:String(o)),r)}var o}function ru(t,e){return ru=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ru(t,e)}function ou(t){return ou=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ou(t)}var iu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ru(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ou(r);if(o){var n=ou(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===eu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colCat=t.colCat||[["gray","-"]],e.shape=t.shape||"circle",e.dimension=t.dimension||{r:8},e.strokeColor=t.strokeColor||"gray",e.strokeWidth=t.strokeWidth||1,e.title=t.title,e.titleFontSize=t.titleFontSize||"0.8em",e.titleFontWeight=t.titleFontWeight||"bold",e.labelFontSize=t.labelFontSize||"0.8em",e}return e=a,(n=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.title&&this.div.append("div").style("font-size",this.titleFontSize).style("font-weight",this.titleFontWeight).style("margin-bottom","7px").text(this.title);var e=this.colCat.length;if(0!=e)for(var n=0;n<e;n++){var r=this.colCat[n],o=this.div.append("div"),i=this.strokeWidth;if("square"===this.shape){var a=this.dimension.h||15,u=this.dimension.w||20;o.append("div").style("display","inline").append("svg").attr("width",u+2*i).attr("height",a+2*i).append("rect").attr("x",i).attr("y",i).attr("width",u).attr("height",a).style("fill",r[0]).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}else{if("circle"!==this.shape)throw new Error("Unexpected shape:"+this.shape);var l=this.dimension.r||8,c=2*l+2*i;o.append("div").style("display","inline").append("svg").attr("width",c).attr("height",c).append("circle").attr("cx",l+i).attr("cy",l+i).attr("r",l).style("fill",r[0]).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}o.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(r[1])}}}])&&nu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Aa);function au(t){return au="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},au(t)}function uu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==au(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==au(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===au(o)?o:String(o)),r)}var o}function lu(t,e){return lu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},lu(t,e)}function cu(t){return cu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},cu(t)}var su=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lu(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=cu(r);if(o){var n=cu(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===au(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.exaggerationFactor=t.exaggerationFactor||.8,e.value=t.value||void 0,e.title=t.title,e.titleFontSize=t.titleFontSize||"0.8em",e.titleFontWeight=t.titleFontWeight||"bold",e.shape=t.shape||"circle",e.fillColor=t.fillColor||"none",e.strokeColor=t.strokeColor||"gray",e.strokeWidth=t.strokeWidth||1,e.labelFontSize=t.labelFontSize||"0.8em",e.labelUnitText=t.labelUnitText||"",e.labelFormat=t.labelFormat||",.2r",e}return e=a,(n=[{key:"update",value:function(t){if(t.sSize){this.div.selectAll("*").remove();var e=this.value;if(null==e){var n=t.sSize.max*this.exaggerationFactor,r=Math.log10(n);r=Math.floor(r),8*(e=Math.pow(10,r))<=n?e*=8:6*e<=n?e*=6:5*e<=n?e*=5:4*e<=n?e*=4:2.5*e<=n?e*=2.5:2*e<=n&&(e*=2)}if(e){var o=this.div.append("div");this.title&&o.append("div").attr("class","title").style("font-size",this.titleFontSize).style("font-weight",this.titleFontWeight).text(this.title);var i=t.style.size(e,t.r,t.sSize,t.zf)/t.zf,a=o.append("svg").attr("width",i+this.strokeWidth+2).attr("height",i+this.strokeWidth+2).style("","inline-block");if("square"===this.shape)a.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",i).style("fill",this.fillColor).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth);else if("circle"===this.shape){var u=.5*(i+this.strokeWidth);a.append("circle").attr("cx",u+1).attr("cy",u+1).attr("r",u).style("fill",this.fillColor).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}else if("donut"===this.shape);else if("diamond"!==this.shape)throw new Error("Unexpected shape:"+this.shape);var l=Ga(this.labelFormat)(e);o.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(l+(this.labelUnitText?" ":"")+this.labelUnitText)}}}}])&&uu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Aa);function fu(t){return fu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fu(t)}function hu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==fu(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==fu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===fu(o)?o:String(o)),r)}var o}function yu(t,e){return yu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},yu(t,e)}function pu(t){return pu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},pu(t)}var vu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yu(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=pu(r);if(o){var n=pu(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===fu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.title=t.title,e.titleFontSize=t.titleFontSize||"0.8em",e.titleFontWeight=t.titleFontWeight||"bold",e.exaggerationFactor=t.exaggerationFactor||.5,e.color=t.color||"gray",e.orientation=t.orientation||0,e.labelFontSize=t.labelFontSize||"0.8em",e.labelUnitText=t.labelUnitText||"",e}return e=a,(n=[{key:"update",value:function(t){if(t.sWidth){this.div.selectAll("*").remove();var e=this.div.append("div");this.title&&e.append("div").attr("class","title").style("font-size",this.titleFontSize).style("font-weight",this.titleFontWeight).text(this.title);var n=t.sWidth.max*this.exaggerationFactor,r=Math.log10(n);r=Math.floor(r);var o=Math.pow(10,r);8*o<=n?o*=8:6*o<=n?o*=6:5*o<=n?o*=5:4*o<=n?o*=4:2.5*o<=n?o*=2.5:2*o<=n&&(o*=2);var i=t.style.width(o,t.r,t.sWidth,t.zf)/t.zf,a=1*t.r/t.zf;e.append("svg").attr("width",a).attr("height",i).style("","inline-block").append("line").attr("x1",0).attr("y1",i/2).attr("x2",a).attr("y2",i/2).style("stroke",this.color).style("stroke-width",i);var u=Ga(",.2r")(o);e.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(u+(this.labelUnitText?" ":"")+this.labelUnitText)}}}])&&hu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Aa);function du(t){return du="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},du(t)}function mu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==du(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==du(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===du(o)?o:String(o)),r)}var o}function bu(t,e){return bu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bu(t,e)}function gu(t){return gu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},gu(t)}var wu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&bu(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=gu(r);if(o){var n=gu(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===du(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.title=t.title,e.titleFontSize=t.titleFontSize||"0.8em",e.titleFontWeight=t.titleFontWeight||"bold",e.exaggerationFactor=t.exaggerationFactor||.5,e.color=t.color||"gray",e.orientation=t.orientation||0,e.widthPix=t.widthPix||3,e.labelFontSize=t.labelFontSize||"0.8em",e.labelUnitText=t.labelUnitText||"",e}return e=a,n=[{key:"update",value:function(t){if(t.sWidth){this.div.selectAll("*").remove();var e=this.div.append("div");this.title&&e.append("div").attr("class","title").style("font-size",this.titleFontSize).style("font-weight",this.titleFontWeight).text(this.title);var n=this.widthPix,r=1*t.r/t.zf,o=Math.max(r,n),i=e.append("svg").attr("width",o).attr("height",o).style("","inline-block"),a=Math.cos(-this.orientation*Math.PI/180),u=Math.sin(-this.orientation*Math.PI/180),l=.5*o,c=.5*r;i.append("line").attr("x1",l-a*c).attr("y1",l-u*c).attr("x2",l+a*c).attr("y2",l+u*c).style("stroke",this.color).style("stroke-width",n),e.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(this.labelUnitText)}}}],n&&mu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Aa),xu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return Math.pow(t,e)},Su=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 1-Math.pow(1-t,1/e)},_u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 0==e?t:(Math.exp(t*e)-1)/(Math.exp(e)-1)},Ou=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 0==e?t:1-1/e*Math.log(Math.exp(e)*(1-t)+t)},ju=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.8;if(0==e)return t;if(1==e)return Math.sqrt(t*(2-t));var n=e/(1-e);return Math.sqrt(1/(n*n)+t*(2/n+2-t))-1/n},Pu=function(t){return 1-ju(1-t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:.8)},ku=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 0==e?t:1/e*Math.log(1-t+t*Math.exp(e))},Eu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return(Math.exp(-e*t)-1)/(Math.exp(-e)-1)},Cu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return Math.pow(t,1/e)},Tu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 1-Math.pow(1-t,e)},Au=1e-6,Mu=1e-12,Ru=Math.PI,Lu=Ru/2,zu=Ru/4,Fu=2*Ru,Iu=180/Ru,Nu=Ru/180,Bu=Math.abs,Du=Math.atan,Gu=Math.atan2,Zu=Math.cos,Uu=(Math.ceil,Math.exp,Math.floor,Math.hypot,Math.log,Math.pow,Math.sin),Wu=Math.sign||function(t){return t>0?1:t<0?-1:0},$u=Math.sqrt;function Yu(t){return t>1?Lu:t<-1?-Lu:Math.asin(t)}function Xu(){}function Hu(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:Xu,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Vu(t,e){return Bu(t[0]-e[0])<Au&&Bu(t[1]-e[1])<Au}function qu(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function Ku(t,e,n,r,o){var i,a,u=[],l=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],a=t[e];if(Vu(r,a)){if(!r[2]&&!a[2]){for(o.lineStart(),i=0;i<e;++i)o.point((r=t[i])[0],r[1]);return void o.lineEnd()}a[0]+=2*Au}u.push(n=new qu(r,t,null,!0)),l.push(n.o=new qu(r,null,n,!1)),u.push(n=new qu(a,t,null,!1)),l.push(n.o=new qu(a,null,n,!0))}})),u.length){for(l.sort(e),Ju(u),Ju(l),i=0,a=l.length;i<a;++i)l[i].e=n=!n;for(var c,s,f=u[0];;){for(var h=f,y=!0;h.v;)if((h=h.n)===f)return;c=h.z,o.lineStart();do{if(h.v=h.o.v=!0,h.e){if(y)for(i=0,a=c.length;i<a;++i)o.point((s=c[i])[0],s[1]);else r(h.x,h.n.x,1,o);h=h.n}else{if(y)for(c=h.p.z,i=c.length-1;i>=0;--i)o.point((s=c[i])[0],s[1]);else r(h.x,h.p.x,-1,o);h=h.p}c=(h=h.o).z,y=!y}while(!h.v);o.lineEnd()}}}function Ju(t){if(e=t.length){for(var e,n,r=0,o=t[0];++r<e;)o.n=n=t[r],n.p=o,o=n;o.n=n=t[0],n.p=o}}Math.tan;class Qu{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const o=e[r],i=t+o,a=Math.abs(t)<Math.abs(o)?t-(i-o):o-(i-t);a&&(e[n++]=a),t=i}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,r,o=this._n,i=0;if(o>0){for(i=t[--o];o>0&&(e=i,n=t[--o],i=e+n,r=n-(i-e),!r););o>0&&(r<0&&t[o-1]<0||r>0&&t[o-1]>0)&&(n=2*r,e=i+n,n==e-i&&(i=e))}return i}}function tl(t){return[Gu(t[1],t[0]),Yu(t[2])]}function el(t){var e=t[0],n=t[1],r=Zu(n);return[r*Zu(e),r*Uu(e),Uu(n)]}function nl(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function rl(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function ol(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function il(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function al(t){var e=$u(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function ul(t){return Bu(t[0])<=Ru?t[0]:Wu(t[0])*((Bu(t[0])+Ru)%Fu-Ru)}function ll(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function cl(t,e,n,r){return function(o){var i,a,u,l=e(o),c=Hu(),s=e(c),f=!1,h={point:y,lineStart:v,lineEnd:d,polygonStart:function(){h.point=m,h.lineStart=b,h.lineEnd=g,a=[],i=[]},polygonEnd:function(){h.point=y,h.lineStart=v,h.lineEnd=d,a=ll(a);var t=function(t,e){var n=ul(e),r=e[1],o=Uu(r),i=[Uu(n),-Zu(n),0],a=0,u=0,l=new Qu;1===o?r=Lu+Au:-1===o&&(r=-Lu-Au);for(var c=0,s=t.length;c<s;++c)if(h=(f=t[c]).length)for(var f,h,y=f[h-1],p=ul(y),v=y[1]/2+zu,d=Uu(v),m=Zu(v),b=0;b<h;++b,p=w,d=S,m=_,y=g){var g=f[b],w=ul(g),x=g[1]/2+zu,S=Uu(x),_=Zu(x),O=w-p,j=O>=0?1:-1,P=j*O,k=P>Ru,E=d*S;if(l.add(Gu(E*j*Uu(P),m*_+E*Zu(P))),a+=k?O+j*Fu:O,k^p>=n^w>=n){var C=rl(el(y),el(g));al(C);var T=rl(i,C);al(T);var A=(k^O>=0?-1:1)*Yu(T[2]);(r>A||r===A&&(C[0]||C[1]))&&(u+=k^O>=0?1:-1)}}return(a<-Au||a<Au&&l<-Mu)^1&u}(i,r);a.length?(f||(o.polygonStart(),f=!0),Ku(a,fl,t,n,o)):t&&(f||(o.polygonStart(),f=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),f&&(o.polygonEnd(),f=!1),a=i=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function y(e,n){t(e,n)&&o.point(e,n)}function p(t,e){l.point(t,e)}function v(){h.point=p,l.lineStart()}function d(){h.point=y,l.lineEnd()}function m(t,e){u.push([t,e]),s.point(t,e)}function b(){s.lineStart(),u=[]}function g(){m(u[0][0],u[0][1]),s.lineEnd();var t,e,n,r,l=s.clean(),h=c.result(),y=h.length;if(u.pop(),i.push(u),u=null,y)if(1&l){if((e=(n=h[0]).length-1)>0){for(f||(o.polygonStart(),f=!0),o.lineStart(),t=0;t<e;++t)o.point((r=n[t])[0],r[1]);o.lineEnd()}}else y>1&&2&l&&h.push(h.pop().concat(h.shift())),a.push(h.filter(sl))}return h}}function sl(t){return t.length>1}function fl(t,e){return((t=t.x)[0]<0?t[1]-Lu-Au:Lu-t[1])-((e=e.x)[0]<0?e[1]-Lu-Au:Lu-e[1])}const hl=cl((function(){return!0}),(function(t){var e,n=NaN,r=NaN,o=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(i,a){var u=i>0?Ru:-Ru,l=Bu(i-n);Bu(l-Ru)<Au?(t.point(n,r=(r+a)/2>0?Lu:-Lu),t.point(o,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(i,r),e=0):o!==u&&l>=Ru&&(Bu(n-o)<Au&&(n-=o*Au),Bu(i-u)<Au&&(i-=u*Au),r=function(t,e,n,r){var o,i,a=Uu(t-n);return Bu(a)>Au?Du((Uu(e)*(i=Zu(r))*Uu(n)-Uu(r)*(o=Zu(e))*Uu(t))/(o*i*a)):(e+r)/2}(n,r,i,a),t.point(o,r),t.lineEnd(),t.lineStart(),t.point(u,r),e=0),t.point(n=i,r=a),o=u},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var o;if(null==t)o=n*Lu,r.point(-Ru,o),r.point(0,o),r.point(Ru,o),r.point(Ru,0),r.point(Ru,-o),r.point(0,-o),r.point(-Ru,-o),r.point(-Ru,0),r.point(-Ru,o);else if(Bu(t[0]-e[0])>Au){var i=t[0]<e[0]?Ru:-Ru;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(e[0],e[1])}),[-Ru,-Lu]);function yl(t,e){(e=el(e))[0]-=t,al(e);var n,r=(n=-e[1])>1?0:n<-1?Ru:Math.acos(n);return((-e[2]<0?-r:r)+Fu-Au)%Fu}var pl=1e9,vl=-pl;function dl(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}const ml=t=>t;function bl(t,e){return Bu(t)>Ru&&(t-=Math.round(t/Fu)*Fu),[t,e]}function gl(t){return function(e,n){return Bu(e+=t)>Ru&&(e-=Math.round(e/Fu)*Fu),[e,n]}}function wl(t){var e=gl(t);return e.invert=gl(-t),e}function xl(t,e){var n=Zu(t),r=Uu(t),o=Zu(e),i=Uu(e);function a(t,e){var a=Zu(e),u=Zu(t)*a,l=Uu(t)*a,c=Uu(e),s=c*n+u*r;return[Gu(l*o-s*i,u*n-c*r),Yu(s*o+l*i)]}return a.invert=function(t,e){var a=Zu(e),u=Zu(t)*a,l=Uu(t)*a,c=Uu(e),s=c*o-l*i;return[Gu(l*o+c*i,u*n+s*r),Yu(s*n-u*r)]},a}function Sl(t){return function(e){var n=new _l;for(var r in t)n[r]=t[r];return n.stream=e,n}}function _l(){}function Ol(t,e){t&&Pl.hasOwnProperty(t.type)&&Pl[t.type](t,e)}bl.invert=bl,_l.prototype={constructor:_l,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var jl={Feature:function(t,e){Ol(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,o=n.length;++r<o;)Ol(n[r].geometry,e)}},Pl={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){kl(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)kl(n[r],e,0)},Polygon:function(t,e){El(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)El(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,o=n.length;++r<o;)Ol(n[r],e)}};function kl(t,e,n){var r,o=-1,i=t.length-n;for(e.lineStart();++o<i;)r=t[o],e.point(r[0],r[1],r[2]);e.lineEnd()}function El(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)kl(t[n],e,1);e.polygonEnd()}var Cl=1/0,Tl=Cl,Al=-Cl,Ml=Al,Rl={point:function(t,e){t<Cl&&(Cl=t),t>Al&&(Al=t),e<Tl&&(Tl=e),e>Ml&&(Ml=e)},lineStart:Xu,lineEnd:Xu,polygonStart:Xu,polygonEnd:Xu,result:function(){var t=[[Cl,Tl],[Al,Ml]];return Al=Ml=-(Tl=Cl=1/0),t}};const Ll=Rl;function zl(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),function(t,e){t&&jl.hasOwnProperty(t.type)?jl[t.type](t,e):Ol(t,e)}(n,t.stream(Ll)),e(Ll.result()),null!=r&&t.clipExtent(r),t}function Fl(t,e,n){return zl(t,(function(n){var r=e[1][0]-e[0][0],o=e[1][1]-e[0][1],i=Math.min(r/(n[1][0]-n[0][0]),o/(n[1][1]-n[0][1])),a=+e[0][0]+(r-i*(n[1][0]+n[0][0]))/2,u=+e[0][1]+(o-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([a,u])}),n)}var Il=16,Nl=Zu(30*Nu);function Bl(t,e){return+e?function(t,e){function n(r,o,i,a,u,l,c,s,f,h,y,p,v,d){var m=c-r,b=s-o,g=m*m+b*b;if(g>4*e&&v--){var w=a+h,x=u+y,S=l+p,_=$u(w*w+x*x+S*S),O=Yu(S/=_),j=Bu(Bu(S)-1)<Au||Bu(i-f)<Au?(i+f)/2:Gu(x,w),P=t(j,O),k=P[0],E=P[1],C=k-r,T=E-o,A=b*C-m*T;(A*A/g>e||Bu((m*C+b*T)/g-.5)>.3||a*h+u*y+l*p<Nl)&&(n(r,o,i,a,u,l,k,E,j,w/=_,x/=_,S,v,d),d.point(k,E),n(k,E,j,w,x,S,c,s,f,h,y,p,v,d))}}return function(e){var r,o,i,a,u,l,c,s,f,h,y,p,v={point:d,lineStart:m,lineEnd:g,polygonStart:function(){e.polygonStart(),v.lineStart=w},polygonEnd:function(){e.polygonEnd(),v.lineStart=m}};function d(n,r){n=t(n,r),e.point(n[0],n[1])}function m(){s=NaN,v.point=b,e.lineStart()}function b(r,o){var i=el([r,o]),a=t(r,o);n(s,f,c,h,y,p,s=a[0],f=a[1],c=r,h=i[0],y=i[1],p=i[2],Il,e),e.point(s,f)}function g(){v.point=d,e.lineEnd()}function w(){m(),v.point=x,v.lineEnd=S}function x(t,e){b(r=t,e),o=s,i=f,a=h,u=y,l=p,v.point=b}function S(){n(s,f,c,h,y,p,o,i,r,a,u,l,Il,e),v.lineEnd=g,g()}return v}}(t,e):function(t){return Sl({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Dl=Sl({point:function(t,e){this.stream.point(t*Nu,e*Nu)}});function Gl(t,e,n,r,o,i){if(!i)return function(t,e,n,r,o){function i(i,a){return[e+t*(i*=r),n-t*(a*=o)]}return i.invert=function(i,a){return[(i-e)/t*r,(n-a)/t*o]},i}(t,e,n,r,o);var a=Zu(i),u=Uu(i),l=a*t,c=u*t,s=a/t,f=u/t,h=(u*n-a*e)/t,y=(u*e+a*n)/t;function p(t,i){return[l*(t*=r)-c*(i*=o)+e,n-c*t-l*i]}return p.invert=function(t,e){return[r*(s*t-f*e+h),o*(y-f*t-s*e)]},p}function Zl(t){return function(t){var e,n,r,o,i,a,u,l,c,s,f=150,h=480,y=250,p=0,v=0,d=0,m=0,b=0,g=0,w=1,x=1,S=null,_=hl,O=null,j=ml,P=.5;function k(t){return l(t[0]*Nu,t[1]*Nu)}function E(t){return(t=l.invert(t[0],t[1]))&&[t[0]*Iu,t[1]*Iu]}function C(){var t=Gl(f,0,0,w,x,g).apply(null,e(p,v)),r=Gl(f,h-t[0],y-t[1],w,x,g);return n=function(t,e,n){return(t%=Fu)?e||n?dl(wl(t),xl(e,n)):wl(t):e||n?xl(e,n):bl}(d,m,b),u=dl(e,r),l=dl(n,u),a=Bl(u,P),T()}function T(){return c=s=null,k}return k.stream=function(t){return c&&s===t?c:c=Dl(function(t){return Sl({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(_(a(j(s=t)))))},k.preclip=function(t){return arguments.length?(_=t,S=void 0,T()):_},k.postclip=function(t){return arguments.length?(j=t,O=r=o=i=null,T()):j},k.clipAngle=function(t){return arguments.length?(_=+t?function(t){var e=Zu(t),n=6*Nu,r=e>0,o=Bu(e)>Au;function i(t,n){return Zu(t)*Zu(n)>e}function a(t,n,r){var o=[1,0,0],i=rl(el(t),el(n)),a=nl(i,i),u=i[0],l=a-u*u;if(!l)return!r&&t;var c=e*a/l,s=-e*u/l,f=rl(o,i),h=il(o,c);ol(h,il(i,s));var y=f,p=nl(h,y),v=nl(y,y),d=p*p-v*(nl(h,h)-1);if(!(d<0)){var m=$u(d),b=il(y,(-p-m)/v);if(ol(b,h),b=tl(b),!r)return b;var g,w=t[0],x=n[0],S=t[1],_=n[1];x<w&&(g=w,w=x,x=g);var O=x-w,j=Bu(O-Ru)<Au;if(!j&&_<S&&(g=S,S=_,_=g),j||O<Au?j?S+_>0^b[1]<(Bu(b[0]-w)<Au?S:_):S<=b[1]&&b[1]<=_:O>Ru^(w<=b[0]&&b[0]<=x)){var P=il(y,(-p+m)/v);return ol(P,h),[b,tl(P)]}}}function u(e,n){var o=r?t:Ru-t,i=0;return e<-o?i|=1:e>o&&(i|=2),n<-o?i|=4:n>o&&(i|=8),i}return cl(i,(function(t){var e,n,l,c,s;return{lineStart:function(){c=l=!1,s=1},point:function(f,h){var y,p=[f,h],v=i(f,h),d=r?v?0:u(f,h):v?u(f+(f<0?Ru:-Ru),h):0;if(!e&&(c=l=v)&&t.lineStart(),v!==l&&(!(y=a(e,p))||Vu(e,y)||Vu(p,y))&&(p[2]=1),v!==l)s=0,v?(t.lineStart(),y=a(p,e),t.point(y[0],y[1])):(y=a(e,p),t.point(y[0],y[1],2),t.lineEnd()),e=y;else if(o&&e&&r^v){var m;d&n||!(m=a(p,e,!0))||(s=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1],3)))}!v||e&&Vu(e,p)||t.point(p[0],p[1]),e=p,l=v,n=d},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return s|(c&&l)<<1}}}),(function(e,r,o,i){!function(t,e,n,r,o,i){if(n){var a=Zu(e),u=Uu(e),l=r*n;null==o?(o=e+r*Fu,i=e-l/2):(o=yl(a,o),i=yl(a,i),(r>0?o<i:o>i)&&(o+=r*Fu));for(var c,s=o;r>0?s>i:s<i;s-=l)c=tl([a,-u*Zu(s),-u*Uu(s)]),t.point(c[0],c[1])}}(i,t,n,o,e,r)}),r?[0,-t]:[-Ru,t-Ru])}(S=t*Nu):(S=null,hl),T()):S*Iu},k.clipExtent=function(t){return arguments.length?(j=null==t?(O=r=o=i=null,ml):function(t,e,n,r){function o(o,i){return t<=o&&o<=n&&e<=i&&i<=r}function i(o,i,u,c){var s=0,f=0;if(null==o||(s=a(o,u))!==(f=a(i,u))||l(o,i)<0^u>0)do{c.point(0===s||3===s?t:n,s>1?r:e)}while((s=(s+u+4)%4)!==f);else c.point(i[0],i[1])}function a(r,o){return Bu(r[0]-t)<Au?o>0?0:3:Bu(r[0]-n)<Au?o>0?2:1:Bu(r[1]-e)<Au?o>0?1:0:o>0?3:2}function u(t,e){return l(t.x,e.x)}function l(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var l,c,s,f,h,y,p,v,d,m,b,g=a,w=Hu(),x={point:S,lineStart:function(){x.point=_,c&&c.push(s=[]),m=!0,d=!1,p=v=NaN},lineEnd:function(){l&&(_(f,h),y&&d&&w.rejoin(),l.push(w.result())),x.point=S,d&&g.lineEnd()},polygonStart:function(){g=w,l=[],c=[],b=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,o=c.length;n<o;++n)for(var i,a,u=c[n],l=1,s=u.length,f=u[0],h=f[0],y=f[1];l<s;++l)i=h,a=y,h=(f=u[l])[0],y=f[1],a<=r?y>r&&(h-i)*(r-a)>(y-a)*(t-i)&&++e:y<=r&&(h-i)*(r-a)<(y-a)*(t-i)&&--e;return e}(),n=b&&e,o=(l=ll(l)).length;(n||o)&&(a.polygonStart(),n&&(a.lineStart(),i(null,null,1,a),a.lineEnd()),o&&Ku(l,u,e,i,a),a.polygonEnd()),g=a,l=c=s=null}};function S(t,e){o(t,e)&&g.point(t,e)}function _(i,a){var u=o(i,a);if(c&&s.push([i,a]),m)f=i,h=a,y=u,m=!1,u&&(g.lineStart(),g.point(i,a));else if(u&&d)g.point(i,a);else{var l=[p=Math.max(vl,Math.min(pl,p)),v=Math.max(vl,Math.min(pl,v))],w=[i=Math.max(vl,Math.min(pl,i)),a=Math.max(vl,Math.min(pl,a))];!function(t,e,n,r,o,i){var a,u=t[0],l=t[1],c=0,s=1,f=e[0]-u,h=e[1]-l;if(a=n-u,f||!(a>0)){if(a/=f,f<0){if(a<c)return;a<s&&(s=a)}else if(f>0){if(a>s)return;a>c&&(c=a)}if(a=o-u,f||!(a<0)){if(a/=f,f<0){if(a>s)return;a>c&&(c=a)}else if(f>0){if(a<c)return;a<s&&(s=a)}if(a=r-l,h||!(a>0)){if(a/=h,h<0){if(a<c)return;a<s&&(s=a)}else if(h>0){if(a>s)return;a>c&&(c=a)}if(a=i-l,h||!(a<0)){if(a/=h,h<0){if(a>s)return;a>c&&(c=a)}else if(h>0){if(a<c)return;a<s&&(s=a)}return c>0&&(t[0]=u+c*f,t[1]=l+c*h),s<1&&(e[0]=u+s*f,e[1]=l+s*h),!0}}}}}(l,w,t,e,n,r)?u&&(g.lineStart(),g.point(i,a),b=!1):(d||(g.lineStart(),g.point(l[0],l[1])),g.point(w[0],w[1]),u||g.lineEnd(),b=!1)}p=i,v=a,d=u}return x}}(O=+t[0][0],r=+t[0][1],o=+t[1][0],i=+t[1][1]),T()):null==O?null:[[O,r],[o,i]]},k.scale=function(t){return arguments.length?(f=+t,C()):f},k.translate=function(t){return arguments.length?(h=+t[0],y=+t[1],C()):[h,y]},k.center=function(t){return arguments.length?(p=t[0]%360*Nu,v=t[1]%360*Nu,C()):[p*Iu,v*Iu]},k.rotate=function(t){return arguments.length?(d=t[0]%360*Nu,m=t[1]%360*Nu,b=t.length>2?t[2]%360*Nu:0,C()):[d*Iu,m*Iu,b*Iu]},k.angle=function(t){return arguments.length?(g=t%360*Nu,C()):g*Iu},k.reflectX=function(t){return arguments.length?(w=t?-1:1,C()):w<0},k.reflectY=function(t){return arguments.length?(x=t?-1:1,C()):x<0},k.precision=function(t){return arguments.length?(a=Bl(u,P=t*t),T()):$u(P)},k.fitExtent=function(t,e){return Fl(k,t,e)},k.fitSize=function(t,e){return function(t,e,n){return Fl(t,[[0,0],e],n)}(k,t,e)},k.fitWidth=function(t,e){return function(t,e,n){return zl(t,(function(n){var r=+e,o=r/(n[1][0]-n[0][0]),i=(r-o*(n[1][0]+n[0][0]))/2,a=-o*n[0][1];t.scale(150*o).translate([i,a])}),n)}(k,t,e)},k.fitHeight=function(t,e){return function(t,e,n){return zl(t,(function(n){var r=+e,o=r/(n[1][1]-n[0][1]),i=-o*n[0][0],a=(r-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([i,a])}),n)}(k,t,e)},function(){return e=t.apply(this,arguments),k.invert=e.invert&&E,C()}}((function(){return t}))()}var Ul,Wl,$l=(Ul=function(t){return $u(2/(1+t))},function(t,e){var n=Zu(t),r=Zu(e),o=Ul(n*r);return o===1/0?[2,0]:[o*r*Uu(t),o*Uu(e)]});$l.invert=(Wl=function(t){return 2*Yu(t/2)},function(t,e){var n=$u(t*t+e*e),r=Wl(n),o=Uu(r),i=Zu(r);return[Gu(t*o,n*i),Yu(n&&e*o/n)]});var Yl=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"EUR",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,n=arguments.length>2?arguments[2]:void 0,r=(n=n||{}).ex||1.2,o=n.fontFamily||"Arial",i=n.exSize||1;return n.style=n.style||function(t,e){if(!(t.rs<r*e))return t.r1<r*e?i+"em "+o:1.5*i+"em "+o},n.proj=n.proj||Zl($l).scale(124.75).clipAngle(179.999).rotate([-10,-52]).reflectX(!1).reflectY(!0).scale(6378137).translate([4321e3,321e4]),n.preprocess=function(t){if(n.ccIn&&t.cc&&!(n.ccIn.indexOf(t.cc)>=0))return!1;var e=n.proj([t.lon,t.lat]);t.x=e[0],t.y=e[1],delete t.lon,delete t.lat},n.baseURL=n.baseURL||"https://raw.githubusercontent.com/eurostat/euronym/main/pub/v2/UTF/",n.url=n.baseURL+e+"/"+t+".csv",n},Xl=function(t){var e=(t=t||{}).nutsYear||"2021",n=t.crs||"3035",r=t.scale||"03M",o=t.nutsLevel||"3",i=t.col||"#888",a=t.colKosovo||"#bcbcbc",u=null==t.showOth||t.showOth;return t.color=t.color||function(t,e){var n=t.properties;if(u||"T"==n.eu||"T"==n.cc||"T"==n.efta||"T"!==n.oth)return n.id>=1e5?a:"T"===n.co||e<400?i:e<1e3?n.lvl>=3?"":i:e<2e3?n.lvl>=2?"":i:n.lvl>=1?"":i},t.width=t.width||function(t,e){var n=t.properties;return"T"===n.co?.5:e<400?3==n.lvl||2==n.lvl||1==n.lvl?2.2:4:e<1e3?2==n.lvl||1==n.lvl?1.8:2.5:e<2e3?1==n.lvl?1.8:2.5:1.2},t.lineDash=t.lineDash||function(t,e){var n=t.properties;return"T"===n.co?[]:e<400?3==n.lvl?[2*e,2*e]:2==n.lvl||1==n.lvl?[5*e,2*e]:[10*e,3*e]:e<1e3?2==n.lvl||1==n.lvl?[5*e,2*e]:[10*e,3*e]:e<2e3&&1==n.lvl?[5*e,2*e]:[10*e,3*e]},t.baseURL=t.baseURL||"https://raw.githubusercontent.com/eurostat/Nuts2json/master/pub/v2/",t.url=t.baseURL+e+"/"+n+"/"+r+"/nutsbn_"+o+".json",t},Hl=Bn.getParameterByName;return Wa({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),e})()));
|
|
1
|
+
/*! For license information please see gridviz.min.js.LICENSE.txt */
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.gviz=e():t.gviz=e()}(self,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(){}function r(t){return null==t?n:function(){return this.querySelector(t)}}function o(){return[]}function i(t){return null==t?o:function(){return this.querySelectorAll(t)}}function a(t){return function(){return this.matches(t)}}function u(t){return function(e){return e.matches(t)}}t.r(e),t.d(e,{App:()=>ho,BackgroundLayer:()=>Wr,BackgroundLayerWMS:()=>Xr,BoundaryLayer:()=>uo,CSVGrid:()=>_r,ColorCategoryLegend:()=>iu,ColorDiscreteLegend:()=>tu,ColorLegend:()=>Va,CompositionStyle:()=>Wo,ContourStyle:()=>wi,Dataset:()=>Xn,DatasetComponent:()=>pr,DotDensityStyle:()=>Di,GeoCanvas:()=>Bn,JoyPlotStyle:()=>Fo,LabelLayer:()=>to,Layer:()=>Zn,LegoStyle:()=>va,MosaicStyle:()=>Sa,NinjaStarStyle:()=>Ea,PillarStyle:()=>ci,SegmentOrientationLegend:()=>wu,SegmentStyle:()=>qo,SegmentWidthLegend:()=>vu,ShapeColorSizeStyle:()=>Oo,SideCatStyle:()=>Pi,SideStyle:()=>di,SizeLegend:()=>su,SquareColorCatWGLStyle:()=>aa,SquareColorWGLStyle:()=>Vi,StrokeStyle:()=>To,Style:()=>bo,TanakaStyle:()=>Ji,TextStyle:()=>ni,TiledGrid:()=>Gr,getClass:()=>Cr,getEuronymeLabelLayer:()=>Yl,getEurostatBoundariesLayer:()=>Xl,getParameterByName:()=>Hl,sCircleHigh:()=>Pu,sCircleLow:()=>ju,sExp:()=>_u,sExpInverse:()=>ku,sExpRev:()=>Ou,sExpRevInverse:()=>Eu,sPow:()=>xu,sPowInverse:()=>Cu,sPowRev:()=>Su,sPowRevInverse:()=>Tu});var l=Array.prototype.find;function c(){return this.firstElementChild}var s=Array.prototype.filter;function f(){return Array.from(this.children)}function h(t){return new Array(t.length)}function y(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function p(t,e,n,r,o,i){for(var a,u=0,l=e.length,c=i.length;u<c;++u)(a=e[u])?(a.__data__=i[u],r[u]=a):n[u]=new y(t,i[u]);for(;u<l;++u)(a=e[u])&&(o[u]=a)}function v(t,e,n,r,o,i,a){var u,l,c,s=new Map,f=e.length,h=i.length,p=new Array(f);for(u=0;u<f;++u)(l=e[u])&&(p[u]=c=a.call(l,l.__data__,u,e)+"",s.has(c)?o[u]=l:s.set(c,l));for(u=0;u<h;++u)c=a.call(t,i[u],u,i)+"",(l=s.get(c))?(r[u]=l,l.__data__=i[u],s.delete(c)):n[u]=new y(t,i[u]);for(u=0;u<f;++u)(l=e[u])&&s.get(p[u])===l&&(o[u]=l)}function d(t){return t.__data__}function m(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function b(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}y.prototype={constructor:y,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var g="http://www.w3.org/1999/xhtml";const w={svg:"http://www.w3.org/2000/svg",xhtml:g,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function x(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),w.hasOwnProperty(e)?{space:w[e],local:t}:t}function S(t){return function(){this.removeAttribute(t)}}function _(t){return function(){this.removeAttributeNS(t.space,t.local)}}function O(t,e){return function(){this.setAttribute(t,e)}}function j(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function P(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function k(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function E(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function C(t){return function(){this.style.removeProperty(t)}}function T(t,e,n){return function(){this.style.setProperty(t,e,n)}}function A(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function M(t,e){return t.style.getPropertyValue(e)||E(t).getComputedStyle(t,null).getPropertyValue(e)}function R(t){return function(){delete this[t]}}function L(t,e){return function(){this[t]=e}}function z(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function F(t){return t.trim().split(/^|\s+/)}function I(t){return t.classList||new N(t)}function N(t){this._node=t,this._names=F(t.getAttribute("class")||"")}function B(t,e){for(var n=I(t),r=-1,o=e.length;++r<o;)n.add(e[r])}function D(t,e){for(var n=I(t),r=-1,o=e.length;++r<o;)n.remove(e[r])}function G(t){return function(){B(this,t)}}function Z(t){return function(){D(this,t)}}function U(t,e){return function(){(e.apply(this,arguments)?B:D)(this,t)}}function W(){this.textContent=""}function $(t){return function(){this.textContent=t}}function Y(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function X(){this.innerHTML=""}function H(t){return function(){this.innerHTML=t}}function V(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function q(){this.nextSibling&&this.parentNode.appendChild(this)}function K(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function J(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===g&&e.documentElement.namespaceURI===g?e.createElement(t):e.createElementNS(n,t)}}function Q(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function tt(t){var e=x(t);return(e.local?Q:J)(e)}function et(){return null}function nt(){var t=this.parentNode;t&&t.removeChild(this)}function rt(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ot(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function it(t){return function(){var e=this.__on;if(e){for(var n,r=0,o=-1,i=e.length;r<i;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?e.length=o:delete this.__on}}}function at(t,e,n){return function(){var r,o=this.__on,i=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(o)for(var a=0,u=o.length;a<u;++a)if((r=o[a]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),void(r.value=e);this.addEventListener(t.type,i,n),r={type:t.type,name:t.name,value:e,listener:i,options:n},o?o.push(r):this.__on=[r]}}function ut(t,e,n){var r=E(t),o=r.CustomEvent;"function"==typeof o?o=new o(e,n):(o=r.document.createEvent("Event"),n?(o.initEvent(e,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function lt(t,e){return function(){return ut(this,t,e)}}function ct(t,e){return function(){return ut(this,t,e.apply(this,arguments))}}N.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var st=[null];function ft(t,e){this._groups=t,this._parents=e}function ht(){return new ft([[document.documentElement]],st)}ft.prototype=ht.prototype={constructor:ft,select:function(t){"function"!=typeof t&&(t=r(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var a,u,l=e[i],c=l.length,s=o[i]=new Array(c),f=0;f<c;++f)(a=l[f])&&(u=t.call(a,a.__data__,f,l))&&("__data__"in a&&(u.__data__=a.__data__),s[f]=u);return new ft(o,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}(t):i(t);for(var e=this._groups,n=e.length,r=[],o=[],a=0;a<n;++a)for(var u,l=e[a],c=l.length,s=0;s<c;++s)(u=l[s])&&(r.push(t.call(u,u.__data__,s,l)),o.push(u));return new ft(r,o)},selectChild:function(t){return this.select(null==t?c:function(t){return function(){return l.call(this.children,t)}}("function"==typeof t?t:u(t)))},selectChildren:function(t){return this.selectAll(null==t?f:function(t){return function(){return s.call(this.children,t)}}("function"==typeof t?t:u(t)))},filter:function(t){"function"!=typeof t&&(t=a(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,u=e[o],l=u.length,c=r[o]=[],s=0;s<l;++s)(i=u[s])&&t.call(i,i.__data__,s,u)&&c.push(i);return new ft(r,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,d);var n,r=e?v:p,o=this._parents,i=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var a=i.length,u=new Array(a),l=new Array(a),c=new Array(a),s=0;s<a;++s){var f=o[s],h=i[s],y=h.length,b=m(t.call(f,f&&f.__data__,s,o)),g=b.length,w=l[s]=new Array(g),x=u[s]=new Array(g);r(f,h,w,x,c[s]=new Array(y),b,e);for(var S,_,O=0,j=0;O<g;++O)if(S=w[O]){for(O>=j&&(j=O+1);!(_=x[j])&&++j<g;);S._next=_||null}}return(u=new ft(u,o))._enter=l,u._exit=c,u},enter:function(){return new ft(this._enter||this._groups.map(h),this._parents)},exit:function(){return new ft(this._exit||this._groups.map(h),this._parents)},join:function(t,e,n){var r=this.enter(),o=this,i=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=e&&(o=e(o))&&(o=o.selection()),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,o=n.length,i=r.length,a=Math.min(o,i),u=new Array(o),l=0;l<a;++l)for(var c,s=n[l],f=r[l],h=s.length,y=u[l]=new Array(h),p=0;p<h;++p)(c=s[p]||f[p])&&(y[p]=c);for(;l<o;++l)u[l]=n[l];return new ft(u,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,o=t[e],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=b);for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var a,u=n[i],l=u.length,c=o[i]=new Array(l),s=0;s<l;++s)(a=u[s])&&(c[s]=a);c.sort(e)}return new ft(o,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var o,i=e[n],a=0,u=i.length;a<u;++a)(o=i[a])&&t.call(o,o.__data__,a,i);return this},attr:function(t,e){var n=x(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?_:S:"function"==typeof e?n.local?k:P:n.local?j:O)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?C:"function"==typeof e?A:T)(t,e,null==n?"":n)):M(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?R:"function"==typeof e?z:L)(t,e)):this.node()[t]},classed:function(t,e){var n=F(t+"");if(arguments.length<2){for(var r=I(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof e?U:e?G:Z)(n,e))},text:function(t){return arguments.length?this.each(null==t?W:("function"==typeof t?Y:$)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?X:("function"==typeof t?V:H)(t)):this.node().innerHTML},raise:function(){return this.each(q)},lower:function(){return this.each(K)},append:function(t){var e="function"==typeof t?t:tt(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:tt(t),o=null==e?et:"function"==typeof e?e:r(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)}))},remove:function(){return this.each(nt)},clone:function(t){return this.select(t?ot:rt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,o,i=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),a=i.length;if(!(arguments.length<2)){for(u=e?at:it,r=0;r<a;++r)this.each(u(i[r],e,n));return this}var u=this.node().__on;if(u)for(var l,c=0,s=u.length;c<s;++c)for(r=0,l=u[c];r<a;++r)if((o=i[r]).type===l.type&&o.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?ct:lt)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r,o=t[e],i=0,a=o.length;i<a;++i)(r=o[i])&&(yield r)}};const yt=ht;function pt(t){return"string"==typeof t?new ft([[document.querySelector(t)]],[document.documentElement]):new ft([[t]],st)}var vt={value:()=>{}};function dt(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new mt(r)}function mt(t){this._=t}function bt(t,e){for(var n,r=0,o=t.length;r<o;++r)if((n=t[r]).name===e)return n.value}function gt(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=vt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}mt.prototype=dt.prototype={constructor:mt,on:function(t,e){var n,r,o=this._,i=(r=o,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,u=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<u;)if(n=(t=i[a]).type)o[n]=gt(o[n],t.name,e);else if(null==e)for(n in o)o[n]=gt(o[n],t.name,null);return this}for(;++a<u;)if((n=(t=i[a]).type)&&(n=bt(o[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new mt(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,n=(r=this._[t]).length;i<n;++i)r[i].value.apply(e,o)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(e,n)}};const wt=dt,xt={capture:!0,passive:!1};function St(t){t.preventDefault(),t.stopImmediatePropagation()}function _t(t){return((t=Math.exp(t))+1/t)/2}const Ot=function t(e,n,r){function o(t,o){var i,a,u=t[0],l=t[1],c=t[2],s=o[0],f=o[1],h=o[2],y=s-u,p=f-l,v=y*y+p*p;if(v<1e-12)a=Math.log(h/c)/e,i=function(t){return[u+t*y,l+t*p,c*Math.exp(e*t*a)]};else{var d=Math.sqrt(v),m=(h*h-c*c+r*v)/(2*c*n*d),b=(h*h-c*c-r*v)/(2*h*n*d),g=Math.log(Math.sqrt(m*m+1)-m),w=Math.log(Math.sqrt(b*b+1)-b);a=(w-g)/e,i=function(t){var r,o=t*a,i=_t(g),s=c/(n*d)*(i*(r=e*o+g,((r=Math.exp(2*r))-1)/(r+1))-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[u+s*y,l+s*p,c*i/_t(e*o+g)]}}return i.duration=1e3*a*e/Math.SQRT2,i}return o.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},o}(Math.SQRT2,2,4);function jt(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}}return[t.pageX,t.pageY]}var Pt,kt,Et=0,Ct=0,Tt=0,At=1e3,Mt=0,Rt=0,Lt=0,zt="object"==typeof performance&&performance.now?performance:Date,Ft="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function It(){return Rt||(Ft(Nt),Rt=zt.now()+Lt)}function Nt(){Rt=0}function Bt(){this._call=this._time=this._next=null}function Dt(t,e,n){var r=new Bt;return r.restart(t,e,n),r}function Gt(){Rt=(Mt=zt.now())+Lt,Et=Ct=0;try{!function(){It(),++Et;for(var t,e=Pt;e;)(t=Rt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Et}()}finally{Et=0,function(){for(var t,e,n=Pt,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Pt=e);kt=t,Ut(r)}(),Rt=0}}function Zt(){var t=zt.now(),e=t-Mt;e>At&&(Lt-=e,Mt=t)}function Ut(t){Et||(Ct&&(Ct=clearTimeout(Ct)),t-Rt>24?(t<1/0&&(Ct=setTimeout(Gt,t-zt.now()-Lt)),Tt&&(Tt=clearInterval(Tt))):(Tt||(Mt=zt.now(),Tt=setInterval(Zt,At)),Et=1,Ft(Gt)))}function Wt(t,e,n){var r=new Bt;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}Bt.prototype=Dt.prototype={constructor:Bt,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?It():+n)+(null==e?0:+e),this._next||kt===this||(kt?kt._next=this:Pt=this,kt=this),this._call=t,this._time=n,Ut()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ut())}};var $t=wt("start","end","cancel","interrupt"),Yt=[],Xt=0,Ht=2,Vt=3,qt=5,Kt=6;function Jt(t,e,n,r,o,i){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,o=t.__transition;function i(l){var c,s,f,h;if(1!==n.state)return u();for(c in o)if((h=o[c]).name===n.name){if(h.state===Vt)return Wt(i);4===h.state?(h.state=Kt,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete o[c]):+c<e&&(h.state=Kt,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete o[c])}if(Wt((function(){n.state===Vt&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(l))})),n.state=Ht,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Ht){for(n.state=Vt,r=new Array(f=n.tween.length),c=0,s=-1;c<f;++c)(h=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(r[++s]=h);r.length=s+1}}function a(e){for(var o=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(u),n.state=qt,1),i=-1,a=r.length;++i<a;)r[i].call(t,o);n.state===qt&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){for(var r in n.state=Kt,n.timer.stop(),delete o[e],o)return;delete t.__transition}o[e]=n,n.timer=Dt((function(t){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=t&&i(t-n.delay)}),0,n.time)}(t,n,{name:e,index:r,group:o,on:$t,tween:Yt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Xt})}function Qt(t,e){var n=ee(t,e);if(n.state>Xt)throw new Error("too late; already scheduled");return n}function te(t,e){var n=ee(t,e);if(n.state>Vt)throw new Error("too late; already running");return n}function ee(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function ne(t,e){var n,r,o,i=t.__transition,a=!0;if(i){for(o in e=null==e?null:e+"",i)(n=i[o]).name===e?(r=n.state>Ht&&n.state<qt,n.state=Kt,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete i[o]):a=!1;a&&delete t.__transition}}function re(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var oe,ie=180/Math.PI,ae={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ue(t,e,n,r,o,i){var a,u,l;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,l/=u),t*r<e*n&&(t=-t,e=-e,l=-l,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(e,t)*ie,skewX:Math.atan(l)*ie,scaleX:a,scaleY:u}}function le(t,e,n,r){function o(t){return t.length?t.pop()+" ":""}return function(i,a){var u=[],l=[];return i=t(i),a=t(a),function(t,r,o,i,a,u){if(t!==o||r!==i){var l=a.push("translate(",null,e,null,n);u.push({i:l-4,x:re(t,o)},{i:l-2,x:re(r,i)})}else(o||i)&&a.push("translate("+o+e+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,u,l),function(t,e,n,i){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),i.push({i:n.push(o(n)+"rotate(",null,r)-2,x:re(t,e)})):e&&n.push(o(n)+"rotate("+e+r)}(i.rotate,a.rotate,u,l),function(t,e,n,i){t!==e?i.push({i:n.push(o(n)+"skewX(",null,r)-2,x:re(t,e)}):e&&n.push(o(n)+"skewX("+e+r)}(i.skewX,a.skewX,u,l),function(t,e,n,r,i,a){if(t!==n||e!==r){var u=i.push(o(i)+"scale(",null,",",null,")");a.push({i:u-4,x:re(t,n)},{i:u-2,x:re(e,r)})}else 1===n&&1===r||i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,u,l),i=a=null,function(t){for(var e,n=-1,r=l.length;++n<r;)u[(e=l[n]).i]=e.x(t);return u.join("")}}}var ce=le((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?ae:ue(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),se=le((function(t){return null==t?ae:(oe||(oe=document.createElementNS("http://www.w3.org/2000/svg","g")),oe.setAttribute("transform",t),(t=oe.transform.baseVal.consolidate())?ue((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):ae)}),", ",")",")");function fe(t,e){var n,r;return function(){var o=te(this,t),i=o.tween;if(i!==n)for(var a=0,u=(r=n=i).length;a<u;++a)if(r[a].name===e){(r=r.slice()).splice(a,1);break}o.tween=r}}function he(t,e,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var i=te(this,t),a=i.tween;if(a!==r){o=(r=a).slice();for(var u={name:e,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===e){o[l]=u;break}l===c&&o.push(u)}i.tween=o}}function ye(t,e,n){var r=t._id;return t.each((function(){var t=te(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return ee(t,r).value[e]}}function pe(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ve(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function de(){}var me=.7,be=1/me,ge="\\s*([+-]?\\d+)\\s*",we="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",xe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Se=/^#([0-9a-f]{3,8})$/,_e=new RegExp(`^rgb\\(${ge},${ge},${ge}\\)$`),Oe=new RegExp(`^rgb\\(${xe},${xe},${xe}\\)$`),je=new RegExp(`^rgba\\(${ge},${ge},${ge},${we}\\)$`),Pe=new RegExp(`^rgba\\(${xe},${xe},${xe},${we}\\)$`),ke=new RegExp(`^hsl\\(${we},${xe},${xe}\\)$`),Ee=new RegExp(`^hsla\\(${we},${xe},${xe},${we}\\)$`),Ce={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};function Te(){return this.rgb().formatHex()}function Ae(){return this.rgb().formatRgb()}function Me(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Se.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Re(e):3===n?new Fe(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Le(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Le(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=_e.exec(t))?new Fe(e[1],e[2],e[3],1):(e=Oe.exec(t))?new Fe(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=je.exec(t))?Le(e[1],e[2],e[3],e[4]):(e=Pe.exec(t))?Le(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ke.exec(t))?Ze(e[1],e[2]/100,e[3]/100,1):(e=Ee.exec(t))?Ze(e[1],e[2]/100,e[3]/100,e[4]):Ce.hasOwnProperty(t)?Re(Ce[t]):"transparent"===t?new Fe(NaN,NaN,NaN,0):null}function Re(t){return new Fe(t>>16&255,t>>8&255,255&t,1)}function Le(t,e,n,r){return r<=0&&(t=e=n=NaN),new Fe(t,e,n,r)}function ze(t,e,n,r){return 1===arguments.length?((o=t)instanceof de||(o=Me(o)),o?new Fe((o=o.rgb()).r,o.g,o.b,o.opacity):new Fe):new Fe(t,e,n,null==r?1:r);var o}function Fe(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Ie(){return`#${Ge(this.r)}${Ge(this.g)}${Ge(this.b)}`}function Ne(){const t=Be(this.opacity);return`${1===t?"rgb(":"rgba("}${De(this.r)}, ${De(this.g)}, ${De(this.b)}${1===t?")":`, ${t})`}`}function Be(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function De(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ge(t){return((t=De(t))<16?"0":"")+t.toString(16)}function Ze(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new We(t,e,n,r)}function Ue(t){if(t instanceof We)return new We(t.h,t.s,t.l,t.opacity);if(t instanceof de||(t=Me(t)),!t)return new We;if(t instanceof We)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),i=Math.max(e,n,r),a=NaN,u=i-o,l=(i+o)/2;return u?(a=e===i?(n-r)/u+6*(n<r):n===i?(r-e)/u+2:(e-n)/u+4,u/=l<.5?i+o:2-i-o,a*=60):u=l>0&&l<1?0:a,new We(a,u,l,t.opacity)}function We(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function $e(t){return(t=(t||0)%360)<0?t+360:t}function Ye(t){return Math.max(0,Math.min(1,t||0))}function Xe(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function He(t,e,n,r,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*n+(1+3*t+3*i-3*a)*r+a*o)/6}pe(de,Me,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Te,formatHex:Te,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ue(this).formatHsl()},formatRgb:Ae,toString:Ae}),pe(Fe,ze,ve(de,{brighter(t){return t=null==t?be:Math.pow(be,t),new Fe(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?me:Math.pow(me,t),new Fe(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Fe(De(this.r),De(this.g),De(this.b),Be(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:Ie,formatHex:Ie,formatHex8:function(){return`#${Ge(this.r)}${Ge(this.g)}${Ge(this.b)}${Ge(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ne,toString:Ne})),pe(We,(function(t,e,n,r){return 1===arguments.length?Ue(t):new We(t,e,n,null==r?1:r)}),ve(de,{brighter(t){return t=null==t?be:Math.pow(be,t),new We(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?me:Math.pow(me,t),new We(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,o=2*n-r;return new Fe(Xe(t>=240?t-240:t+120,o,r),Xe(t,o,r),Xe(t<120?t+240:t-120,o,r),this.opacity)},clamp(){return new We($e(this.h),Ye(this.s),Ye(this.l),Be(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 t=Be(this.opacity);return`${1===t?"hsl(":"hsla("}${$e(this.h)}, ${100*Ye(this.s)}%, ${100*Ye(this.l)}%${1===t?")":`, ${t})`}`}}));const Ve=t=>()=>t;function qe(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Ve(isNaN(t)?e:t)}const Ke=function t(e){var n=function(t){return 1==(t=+t)?qe:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Ve(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=ze(t)).r,(e=ze(e)).r),o=n(t.g,e.g),i=n(t.b,e.b),a=qe(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Je(t){return function(e){var n,r,o=e.length,i=new Array(o),a=new Array(o),u=new Array(o);for(n=0;n<o;++n)r=ze(e[n]),i[n]=r.r||0,a[n]=r.g||0,u[n]=r.b||0;return i=t(i),a=t(a),u=t(u),r.opacity=1,function(t){return r.r=i(t),r.g=a(t),r.b=u(t),r+""}}}Je((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),o=t[r],i=t[r+1],a=r>0?t[r-1]:2*o-i,u=r<e-1?t[r+2]:2*i-o;return He((n-r/e)*e,a,o,i,u)}})),Je((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),o=t[(r+e-1)%e],i=t[r%e],a=t[(r+1)%e],u=t[(r+2)%e];return He((n-r/e)*e,o,i,a,u)}}));var Qe=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tn=new RegExp(Qe.source,"g");function en(t,e){var n,r,o,i=Qe.lastIndex=tn.lastIndex=0,a=-1,u=[],l=[];for(t+="",e+="";(n=Qe.exec(t))&&(r=tn.exec(e));)(o=r.index)>i&&(o=e.slice(i,o),u[a]?u[a]+=o:u[++a]=o),(n=n[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,l.push({i:a,x:re(n,r)})),i=tn.lastIndex;return i<e.length&&(o=e.slice(i),u[a]?u[a]+=o:u[++a]=o),u.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,r=0;r<e;++r)u[(n=l[r]).i]=n.x(t);return u.join("")})}function nn(t,e){var n;return("number"==typeof e?re:e instanceof Me?Ke:(n=Me(e))?(e=n,Ke):en)(t,e)}function rn(t){return function(){this.removeAttribute(t)}}function on(t){return function(){this.removeAttributeNS(t.space,t.local)}}function an(t,e,n){var r,o,i=n+"";return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function un(t,e,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function ln(t,e,n){var r,o,i;return function(){var a,u,l=n(this);if(null!=l)return(a=this.getAttribute(t))===(u=l+"")?null:a===r&&u===o?i:(o=u,i=e(r=a,l));this.removeAttribute(t)}}function cn(t,e,n){var r,o,i;return function(){var a,u,l=n(this);if(null!=l)return(a=this.getAttributeNS(t.space,t.local))===(u=l+"")?null:a===r&&u===o?i:(o=u,i=e(r=a,l));this.removeAttributeNS(t.space,t.local)}}function sn(t,e){var n,r;function o(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,o)),n}return o._value=e,o}function fn(t,e){var n,r;function o(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,o)),n}return o._value=e,o}function hn(t,e){return function(){Qt(this,t).delay=+e.apply(this,arguments)}}function yn(t,e){return e=+e,function(){Qt(this,t).delay=e}}function pn(t,e){return function(){te(this,t).duration=+e.apply(this,arguments)}}function vn(t,e){return e=+e,function(){te(this,t).duration=e}}var dn=yt.prototype.constructor;function mn(t){return function(){this.style.removeProperty(t)}}var bn=0;function gn(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function wn(){return++bn}var xn=yt.prototype;gn.prototype=function(t){return yt().transition(t)}.prototype={constructor:gn,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=r(t));for(var o=this._groups,i=o.length,a=new Array(i),u=0;u<i;++u)for(var l,c,s=o[u],f=s.length,h=a[u]=new Array(f),y=0;y<f;++y)(l=s[y])&&(c=t.call(l,l.__data__,y,s))&&("__data__"in l&&(c.__data__=l.__data__),h[y]=c,Jt(h[y],e,n,y,h,ee(l,n)));return new gn(a,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=i(t));for(var r=this._groups,o=r.length,a=[],u=[],l=0;l<o;++l)for(var c,s=r[l],f=s.length,h=0;h<f;++h)if(c=s[h]){for(var y,p=t.call(c,c.__data__,h,s),v=ee(c,n),d=0,m=p.length;d<m;++d)(y=p[d])&&Jt(y,e,n,d,p,v);a.push(p),u.push(c)}return new gn(a,u,e,n)},selectChild:xn.selectChild,selectChildren:xn.selectChildren,filter:function(t){"function"!=typeof t&&(t=a(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,u=e[o],l=u.length,c=r[o]=[],s=0;s<l;++s)(i=u[s])&&t.call(i,i.__data__,s,u)&&c.push(i);return new gn(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,o=n.length,i=Math.min(r,o),a=new Array(r),u=0;u<i;++u)for(var l,c=e[u],s=n[u],f=c.length,h=a[u]=new Array(f),y=0;y<f;++y)(l=c[y]||s[y])&&(h[y]=l);for(;u<r;++u)a[u]=e[u];return new gn(a,this._parents,this._name,this._id)},selection:function(){return new dn(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=wn(),r=this._groups,o=r.length,i=0;i<o;++i)for(var a,u=r[i],l=u.length,c=0;c<l;++c)if(a=u[c]){var s=ee(a,e);Jt(a,t,n,c,u,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new gn(r,this._parents,t,n)},call:xn.call,nodes:xn.nodes,node:xn.node,size:xn.size,empty:xn.empty,each:xn.each,on:function(t,e){var n=this._id;return arguments.length<2?ee(this.node(),n).on.on(t):this.each(function(t,e,n){var r,o,i=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Qt:te;return function(){var a=i(this,t),u=a.on;u!==r&&(o=(r=u).copy()).on(e,n),a.on=o}}(n,t,e))},attr:function(t,e){var n=x(t),r="transform"===n?se:nn;return this.attrTween(t,"function"==typeof e?(n.local?cn:ln)(n,r,ye(this,"attr."+t,e)):null==e?(n.local?on:rn)(n):(n.local?un:an)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=x(t);return this.tween(n,(r.local?sn:fn)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?ce:nn;return null==e?this.styleTween(t,function(t,e){var n,r,o;return function(){var i=M(this,t),a=(this.style.removeProperty(t),M(this,t));return i===a?null:i===n&&a===r?o:o=e(n=i,r=a)}}(t,r)).on("end.style."+t,mn(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,o,i;return function(){var a=M(this,t),u=n(this),l=u+"";return null==u&&(this.style.removeProperty(t),l=u=M(this,t)),a===l?null:a===r&&l===o?i:(o=l,i=e(r=a,u))}}(t,r,ye(this,"style."+t,e))).each(function(t,e){var n,r,o,i,a="style."+e,u="end."+a;return function(){var l=te(this,t),c=l.on,s=null==l.value[a]?i||(i=mn(e)):void 0;c===n&&o===s||(r=(n=c).copy()).on(u,o=s),l.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,o,i=n+"";return function(){var a=M(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,o;function i(){var i=e.apply(this,arguments);return i!==o&&(r=(o=i)&&function(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}(t,i,n)),r}return i._value=e,i}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(ye(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){return function(e){this.textContent=t.call(this,e)}}(r)),e}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,o=ee(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===t)return r.value;return null}return this.each((null==e?fe:he)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?hn:yn)(e,t)):ee(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?pn:vn)(e,t)):ee(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){te(this,t).ease=e}}(e,t)):ee(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;te(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,r=n._id,o=n.size();return new Promise((function(i,a){var u={value:a},l={value:function(){0==--o&&i()}};n.each((function(){var n=te(this,r),o=n.on;o!==t&&((e=(t=o).copy())._.cancel.push(u),e._.interrupt.push(u),e._.end.push(l)),n.on=e})),0===o&&i()}))},[Symbol.iterator]:xn[Symbol.iterator]};var Sn={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function _n(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}yt.prototype.interrupt=function(t){return this.each((function(){ne(this,t)}))},yt.prototype.transition=function(t){var e,n;t instanceof gn?(e=t._id,t=t._name):(e=wn(),(n=Sn).time=It(),t=null==t?null:t+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,u=r[i],l=u.length,c=0;c<l;++c)(a=u[c])&&Jt(a,t,e,c,u,n||_n(a,e));return new gn(r,this._parents,t,e)};const On=t=>()=>t;function jn(t,{sourceEvent:e,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function Pn(t,e,n){this.k=t,this.x=e,this.y=n}Pn.prototype={constructor:Pn,scale:function(t){return 1===t?this:new Pn(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Pn(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var kn=new Pn(1,0,0);function En(t){t.stopImmediatePropagation()}function Cn(t){t.preventDefault(),t.stopImmediatePropagation()}function Tn(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function An(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Mn(){return this.__zoom||kn}function Rn(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Ln(){return navigator.maxTouchPoints||"ontouchstart"in this}function zn(t,e,n){var r=t.invertX(e[0][0])-n[0][0],o=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function Fn(t){return Fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fn(t)}function In(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Nn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Fn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Fn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Fn(o)?o:String(o)),r)}var o}Pn.prototype;var Bn=function(){function t(e,n,r,o){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.opts=o||{},this.canvas=e,this.w=this.canvas.offsetWidth,this.h=this.canvas.offsetHeight,this.canvas.width=this.w,this.canvas.height=this.h;var a=this.canvas.getContext("2d");if(!a)throw"Impossible to create canvas 2D context";if(this.ctx=a,this.center=n||{x:.5*this.w,y:.5*this.h},this.zf=r,this.backgroundColor=o.backgroundColor||"white",this.onZoomStartFun=o.onZoomStartFun,this.onZoomEndFun=o.onZoomEndFun,this.onZoomFun=o.onZoomFun,this.extGeo={xMin:NaN,xMax:NaN,yMin:NaN,yMax:NaN},this.updateExtentGeo(),!o.disableZoom){var u=kn;(function(){var t,e,n,r=Tn,o=An,i=zn,a=Rn,u=Ln,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],s=250,f=Ot,h=wt("start","zoom","end"),y=500,p=150,v=0,d=10;function m(t){t.property("__zoom",Mn).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",P).filter(u).on("touchstart.zoom",k).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",C).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(t,e){return(e=Math.max(l[0],Math.min(l[1],e)))===t.k?t:new Pn(e,t.x,t.y)}function g(t,e,n){var r=e[0]-n[0]*t.k,o=e[1]-n[1]*t.k;return r===t.x&&o===t.y?t:new Pn(t.k,r,o)}function w(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function x(t,e,n,r){t.on("start.zoom",(function(){S(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){S(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,i=arguments,a=S(t,i).event(r),u=o.apply(t,i),l=null==n?w(u):"function"==typeof n?n.apply(t,i):n,c=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),s=t.__zoom,h="function"==typeof e?e.apply(t,i):e,y=f(s.invert(l).concat(c/s.k),h.invert(l).concat(c/h.k));return function(t){if(1===t)t=h;else{var e=y(t),n=c/e[2];t=new Pn(n,l[0]-e[0]*n,l[1]-e[1]*n)}a.zoom(null,t)}}))}function S(t,e,n){return!n&&t.__zooming||new _(t,e)}function _(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=o.apply(t,e),this.taps=0}function O(t,...e){if(r.apply(this,arguments)){var n=S(this,e).event(t),o=this.__zoom,u=Math.max(l[0],Math.min(l[1],o.k*Math.pow(2,a.apply(this,arguments)))),s=jt(t);if(n.wheel)n.mouse[0][0]===s[0]&&n.mouse[0][1]===s[1]||(n.mouse[1]=o.invert(n.mouse[0]=s)),clearTimeout(n.wheel);else{if(o.k===u)return;n.mouse=[s,o.invert(s)],ne(this),n.start()}Cn(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),p),n.zoom("mouse",i(g(b(o,u),n.mouse[0],n.mouse[1]),n.extent,c))}}function j(t,...e){if(!n&&r.apply(this,arguments)){var o=t.currentTarget,a=S(this,e,!0).event(t),u=pt(t.view).on("mousemove.zoom",(function(t){if(Cn(t),!a.moved){var e=t.clientX-s,n=t.clientY-f;a.moved=e*e+n*n>v}a.event(t).zoom("mouse",i(g(a.that.__zoom,a.mouse[0]=jt(t,o),a.mouse[1]),a.extent,c))}),!0).on("mouseup.zoom",(function(t){u.on("mousemove.zoom mouseup.zoom",null),function(t,e){var n=t.document.documentElement,r=pt(t).on("dragstart.drag",null);e&&(r.on("click.drag",St,xt),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(t.view,a.moved),Cn(t),a.event(t).end()}),!0),l=jt(t,o),s=t.clientX,f=t.clientY;!function(t){var e=t.document.documentElement,n=pt(t).on("dragstart.drag",St,xt);"onselectstart"in e?n.on("selectstart.drag",St,xt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(t.view),En(t),a.mouse=[l,this.__zoom.invert(l)],ne(this),a.start()}}function P(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,a=jt(t.changedTouches?t.changedTouches[0]:t,this),u=n.invert(a),l=n.k*(t.shiftKey?.5:2),f=i(g(b(n,l),a,u),o.apply(this,e),c);Cn(t),s>0?pt(this).transition().duration(s).call(x,f,a,t):pt(this).call(m.transform,f,a,t)}}function k(n,...o){if(r.apply(this,arguments)){var i,a,u,l,c=n.touches,s=c.length,f=S(this,o,n.changedTouches.length===s).event(n);for(En(n),a=0;a<s;++a)l=[l=jt(u=c[a],this),this.__zoom.invert(l),u.identifier],f.touch0?f.touch1||f.touch0[2]===l[2]||(f.touch1=l,f.taps=0):(f.touch0=l,i=!0,f.taps=1+!!t);t&&(t=clearTimeout(t)),i&&(f.taps<2&&(e=l[0],t=setTimeout((function(){t=null}),y)),ne(this),f.start())}}function E(t,...e){if(this.__zooming){var n,r,o,a,u=S(this,e).event(t),l=t.changedTouches,s=l.length;for(Cn(t),n=0;n<s;++n)o=jt(r=l[n],this),u.touch0&&u.touch0[2]===r.identifier?u.touch0[0]=o:u.touch1&&u.touch1[2]===r.identifier&&(u.touch1[0]=o);if(r=u.that.__zoom,u.touch1){var f=u.touch0[0],h=u.touch0[1],y=u.touch1[0],p=u.touch1[1],v=(v=y[0]-f[0])*v+(v=y[1]-f[1])*v,d=(d=p[0]-h[0])*d+(d=p[1]-h[1])*d;r=b(r,Math.sqrt(v/d)),o=[(f[0]+y[0])/2,(f[1]+y[1])/2],a=[(h[0]+p[0])/2,(h[1]+p[1])/2]}else{if(!u.touch0)return;o=u.touch0[0],a=u.touch0[1]}u.zoom("touch",i(g(r,o,a),u.extent,c))}}function C(t,...r){if(this.__zooming){var o,i,a=S(this,r).event(t),u=t.changedTouches,l=u.length;for(En(t),n&&clearTimeout(n),n=setTimeout((function(){n=null}),y),o=0;o<l;++o)i=u[o],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=jt(i,this),Math.hypot(e[0]-i[0],e[1]-i[1])<d)){var c=pt(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(t,e,n,r){var o=t.selection?t.selection():t;o.property("__zoom",Mn),t!==o?x(t,e,n,r):o.interrupt().each((function(){S(this,arguments).event(r).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},m.scaleBy=function(t,e,n,r){m.scaleTo(t,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),n,r)},m.scaleTo=function(t,e,n,r){m.transform(t,(function(){var t=o.apply(this,arguments),r=this.__zoom,a=null==n?w(t):"function"==typeof n?n.apply(this,arguments):n,u=r.invert(a),l="function"==typeof e?e.apply(this,arguments):e;return i(g(b(r,l),a,u),t,c)}),n,r)},m.translateBy=function(t,e,n,r){m.transform(t,(function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),c)}),null,r)},m.translateTo=function(t,e,n,r,a){m.transform(t,(function(){var t=o.apply(this,arguments),a=this.__zoom,u=null==r?w(t):"function"==typeof r?r.apply(this,arguments):r;return i(kn.translate(u[0],u[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,c)}),r,a)},_.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var e=pt(this.that).datum();h.call(t,this.that,new jn(t,{sourceEvent:this.sourceEvent,target:m,type:t,transform:this.that.__zoom,dispatch:h}),e)}},m.wheelDelta=function(t){return arguments.length?(a="function"==typeof t?t:On(+t),m):a},m.filter=function(t){return arguments.length?(r="function"==typeof t?t:On(!!t),m):r},m.touchable=function(t){return arguments.length?(u="function"==typeof t?t:On(!!t),m):u},m.extent=function(t){return arguments.length?(o="function"==typeof t?t:On([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),m):o},m.scaleExtent=function(t){return arguments.length?(l[0]=+t[0],l[1]=+t[1],m):[l[0],l[1]]},m.translateExtent=function(t){return arguments.length?(c[0][0]=+t[0][0],c[1][0]=+t[1][0],c[0][1]=+t[0][1],c[1][1]=+t[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(t){return arguments.length?(i=t,m):i},m.duration=function(t){return arguments.length?(s=+t,m):s},m.interpolate=function(t){return arguments.length?(f=t,m):f},m.on=function(){var t=h.on.apply(h,arguments);return t===h?m:t},m.clickDistance=function(t){return arguments.length?(v=(t=+t)*t,m):Math.sqrt(v)},m.tapDistance=function(t){return arguments.length?(d=+t,m):d},m})().wheelDelta((function(t){return-t.deltaY*(1===t.deltaMode?.07:t.deltaMode?1:.004)})).on("zoom",(function(t){var e=t.transform,n=u.k/e.k;if(1==n){var r=u.x-e.x,o=u.y-e.y;i.pan(r*i.getZf(),-o*i.getZf())}else{var a=t.sourceEvent;if(a instanceof WheelEvent)i.zoom(n,i.pixToGeoX(t.sourceEvent.offsetX),i.pixToGeoY(t.sourceEvent.offsetY));else if(a instanceof TouchEvent){var l,c=0,s=0,f=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return In(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?In(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(a.targetTouches);try{for(f.s();!(l=f.n()).done;){var h=l.value;c+=h.clientX,s+=h.clientY}}catch(t){f.e(t)}finally{f.f()}c/=a.targetTouches.length,s/=a.targetTouches.length,i.zoom(n,i.pixToGeoX(c),i.pixToGeoY(s))}}u=e,i.onZoomFun&&i.onZoomFun(t)})).on("start",(function(t){i.canvasSave.c=document.createElement("canvas"),i.canvasSave.c.setAttribute("width",""+i.w),i.canvasSave.c.setAttribute("height",""+i.h),i.canvasSave.c.getContext("2d").drawImage(i.canvas,0,0),i.canvasSave.dx=0,i.canvasSave.dy=0,i.canvasSave.f=1,i.onZoomStartFun&&i.onZoomStartFun(t)})).on("end",(function(t){i.redraw(!0),i.canvasSave={c:null,dx:0,dy:0,f:1},i.onZoomEndFun&&i.onZoomEndFun(t)}))(pt(this.canvas))}this.zfExtent=[0,1/0],this.canvasSave={c:null,dx:0,dy:0,f:1}}var e,n,r;return e=t,n=[{key:"setCenter",value:function(t){this.center=t}},{key:"getCenter",value:function(){return this.center}},{key:"setZf",value:function(t){this.zf=t,this.slider&&this.slider.attr("value",+this.zf)}},{key:"getZf",value:function(){return this.zf}},{key:"setZfExtent",value:function(t){this.zfExtent=t}},{key:"getZfExtent",value:function(){return this.zfExtent}},{key:"initCanvasTransform",value:function(){this.ctx.setTransform(1,0,0,1,0,0)}},{key:"setCanvasTransform",value:function(){var t=1/this.getZf(),e=-this.center.x/this.getZf()+.5*this.w,n=this.center.y/this.getZf()+.5*this.h;this.ctx.setTransform(t,0,0,-t,e,n)}},{key:"getWebGLTransform",value:function(){var t=2/(this.w*this.getZf()),e=2/(this.h*this.getZf());return[t,0,0,0,e,0,-t*this.center.x,-e*this.center.y,1]}},{key:"redraw",value:function(){throw new Error("Method redraw not implemented.")}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"white";this.opts.transparentBackground?this.ctx.clearRect(0,0,this.w,this.h):(this.ctx&&(this.ctx.fillStyle=t),this.ctx.fillRect(0,0,this.w,this.h))}},{key:"pan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.center.x+=t,this.center.y+=e,this.updateExtentGeo(),this.canvasSave.c&&(this.canvasSave.dx-=t/this.getZf(),this.canvasSave.dy+=e/this.getZf(),this.clear(this.backgroundColor),this.ctx.drawImage(this.canvasSave.c,this.canvasSave.dx,this.canvasSave.dy))}},{key:"zoom",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.center.x,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.center.y;if(!(this.zfExtent[0]==this.getZf()&&t<=1||this.zfExtent[1]==this.getZf()&&t>=1)){var r=t*this.getZf();r<this.zfExtent[0]&&(t=this.zfExtent[0]/this.getZf()),r>this.zfExtent[1]&&(t=this.zfExtent[1]/this.getZf()),this.setZf(t*this.getZf());var o=(e-this.center.x)*(1-t);this.center.x+=o;var i=(n-this.center.y)*(1-t);this.center.y+=i,this.updateExtentGeo(),this.canvasSave.c&&(this.clear(this.backgroundColor),this.canvasSave.f/=t,this.canvasSave.dx=this.geoToPixX(e)*(1-this.canvasSave.f),this.canvasSave.dy=this.geoToPixY(n)*(1-this.canvasSave.f),this.clear(this.backgroundColor),this.ctx.drawImage(this.canvasSave.c,this.canvasSave.dx,this.canvasSave.dy,this.canvasSave.f*this.canvasSave.c.width,this.canvasSave.f*this.canvasSave.c.height))}}},{key:"updateExtentGeo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return this.extGeo={xMin:this.pixToGeoX(-t),xMax:this.pixToGeoX(this.w+t),yMin:this.pixToGeoY(this.h+t),yMax:this.pixToGeoY(-t)},this.extGeo}},{key:"toDraw",value:function(t){return!(t.x<this.extGeo.xMin||t.x>this.extGeo.xMax||t.y<this.extGeo.yMin||t.y>this.extGeo.yMax)}},{key:"geoToPixX",value:function(t){return(t-this.center.x)/this.getZf()+.5*this.w}},{key:"geoToPixY",value:function(t){return-(t-this.center.y)/this.getZf()+.5*this.h}},{key:"pixToGeoX",value:function(t){return(t-.5*this.w)*this.getZf()+this.center.x}},{key:"pixToGeoY",value:function(t){return-(t-.5*this.h)*this.getZf()+this.center.y}},{key:"setViewFromURL",value:function(){var e=t.getParameterByName("x"),n=t.getParameterByName("y"),r=t.getParameterByName("z"),o=this.getCenter();null==e||null==e||isNaN(+e)||(o.x=+e),null==n||null==n||isNaN(+n)||(o.y=+n),null==r||null==r||isNaN(+r)||this.setZf(+r)}},{key:"addZoomSlider",value:function(t,e){(e=e||{}).width=e.width||"30px",e.height=e.height||"300px";var n=pt("#"+t);if(n.empty())return console.error("Could not find div element to build zoom slider. Id: "+t),this;var r=this;return this.slider=n.append("input").attr("type","range").attr("min",this.getZfExtent()[0]).attr("max",this.getZfExtent()[1]).attr("value",this.getZf()).on("input",(function(t){if(this&&this.value){var e=+this.value;pt(this).attr("value",e),r.setZf(e),r.redraw()}})).style("width",e.width).style("height",e.height).style("opacity",.7).on("mouseover",(function(t){pt(this).style("opacity",1)})).on("mouseout",(function(t){pt(this).style("opacity",.7)})).style("-webkit-appearance","slider-vertical").style("writing-mode","bt-lr").attr("orient","vertical").style("background","lightgray").style("outline","none").style("-webkit-transition",".2s").style("transition","opacity .2s"),this}}],r=[{key:"getParameterByName",value:function(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(location.search);return e?decodeURIComponent(e[1].replace(/\+/g," ")):null}}],n&&Nn(e.prototype,n),r&&Nn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Dn(t){return Dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dn(t)}function Gn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Dn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Dn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Dn(o)?o:String(o)),r)}var o}var Zn=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=r||{},this.dataset=e,this.styles=n,this.visible=0!=r.visible,this.minZoom=r.minZoom||0,this.maxZoom=r.maxZoom||1/0,this.minZoom>=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");this.pixNb=r.pixNb||3,this.cellInfoHTML=r.cellInfoHTML||t.defaultCellInfoHTML}var e,n,r;return e=t,r=[{key:"defaultCellInfoHTML",value:function(t){for(var e=[],n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];"x"!==o&&"y"!==o&&e.push("<b>",o,"</b>"," : ",t[o],"<br>")}return e.join("")}}],(n=[{key:"getDatasetComponent",value:function(t){if(!(t<this.minZoom||t>this.maxZoom)){if(1==this.dataset.datasetComponents.length)return this.dataset.datasetComponents[0];for(var e=this.dataset.resolutions,n=0,r=e[n]/this.pixNb;r<t&&n<e.length;)r=e[++n]/this.pixNb;return n==e.length?this.dataset.datasetComponents[e.length-1]:this.dataset.datasetComponents[n]}}}])&&Gn(e.prototype,n),r&&Gn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Un(t){return Un="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Un(t)}function Wn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return $n(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$n(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function $n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Yn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Un(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Un(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Un(o)?o:String(o)),r)}var o}var Xn=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=r||{},this.datasetComponents=e,this.resolutions=n,this.datasetComponents.length>1&&this.datasetComponents.length!=this.resolutions.length)throw new Error("Uncompatible number of datasets and resolutions: "+this.datasetComponents.length+" "+this.resolutions.length);r.preprocess&&this.setPrepocesses(r.preprocess)}var e,n,r;return e=t,r=[{key:"make",value:function(e,n,r){var o,i=[],a=Wn(e);try{for(a.s();!(o=a.n()).done;){var u=o.value;i.push(n(u))}}catch(t){a.e(t)}finally{a.f()}return new t(i,e,r)}}],(n=[{key:"setPrepocesses",value:function(t){var e,n=Wn(this.datasetComponents);try{for(n.s();!(e=n.n()).done;)e.value.preprocess=t}catch(t){n.e(t)}finally{n.f()}return this}}])&&Yn(e.prototype,n),r&&Yn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Hn(t){return Hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hn(t)}function Vn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qn(r.key),r)}}function qn(t){var e=function(t,e){if("object"!==Hn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Hn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Hn(e)?e:String(e)}var Kn=function(){function t(e){var n,r,o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,o=function(t,e){var n=this.tooltip.node(),r=e.width;if(n.offsetLeft+n.clientWidth>r){var o=t.pageX-e.left-n.clientWidth-this.xOffset;if(n.style.left=o+"px",n.offsetLeft+n.clientWidth+e.left>t.pageX){var i=t.pageX-(n.clientWidth+this.xOffset+e.left);n.style.left=i+"px"}}n.offsetTop+n.clientHeight>e.height&&(n.style.top=n.offsetTop-n.clientHeight+"px")},(r=qn(r="ensureTooltipInsideContainer"))in n?Object.defineProperty(n,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[r]=o,e=e||{},this.div=e.div||"tooltip_eurostat",this.maxWidth=e.maxWidth||"20em",this.fontSize=e.fontSize||"1.2em",this.background=e.background||"white",this.padding=e.padding||"5px",this.border=e.border||"0px",this["border-radius"]=e["border-radius"]||"5px",this["box-shadow"]=e["box-shadow"]||"5px 5px 5px grey",this["font-family"]=e["font-family"]||"Helvetica, Arial, sans-serif",this.transitionDuration=e.transitionDuration||100,this.xOffset=e.xOffset||30,this.yOffset=e.yOffset||20,this.yMouseOffset=e.yMouseOffset||0,this.xMouseOffset=e.xMouseOffset||0,this.parentElement=e.parentElement||document.body,this.tooltip=pt("#"+this.div),this.tooltip.empty()&&(this.tooltip=pt((this.parentElement.id,""!=this.parentElement.id?"#"+this.parentElement.id:"body")).append("div").attr("id",this.div)),this.tooltip.style("max-width",this.maxWidth),this.tooltip.style("overflow","hidden"),this.tooltip.style("font-size",this.fontSize),this.tooltip.style("background",this.background),this.tooltip.style("padding",this.padding),this.tooltip.style("border",this.border),this.tooltip.style("border-radius",this["border-radius"]),this.tooltip.style("box-shadow",this["box-shadow"]),this.tooltip.style("font-family",this["font-family"]),this.tooltip.style("position","absolute"),this.tooltip.style("pointer-events","none"),this.tooltip.style("opacity","0"),this.tooltip.attr("role","tooltip").attr("aria-live","polite")}var e,n;return e=t,n=[{key:"show",value:function(){this.tooltip.transition().duration(this.transitionDuration).style("opacity",1)}},{key:"hide",value:function(){this.tooltip.transition().duration(this.transitionDuration).style("opacity",0)}},{key:"html",value:function(t){this.tooltip.html(t)}},{key:"setPosition",value:function(t){var e=this.parentElement.getBoundingClientRect();this.tooltip.style("left",t.pageX-e.left+this.xOffset+"px").style("top",t.pageY-e.top-this.yOffset+"px"),this.ensureTooltipInsideContainer(t,e)}},{key:"style",value:function(t,e){return 1==arguments.length?this.tooltip.style(t):(this.tooltip.style(t,e),this)}},{key:"attr",value:function(t,e){return 1==arguments.length?this.tooltip.attr(t):(this.tooltip.attr(t,e),this)}}],n&&Vn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Jn={},Qn={};function tr(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function er(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function nr(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function rr(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,o=[],i=t.length,a=0,u=0,l=i<=0,c=!1;function s(){if(l)return Qn;if(c)return c=!1,Jn;var e,r,o=a;if(34===t.charCodeAt(o)){for(;a++<i&&34!==t.charCodeAt(a)||34===t.charCodeAt(++a););return(e=a)>=i?l=!0:10===(r=t.charCodeAt(a++))?c=!0:13===r&&(c=!0,10===t.charCodeAt(a)&&++a),t.slice(o+1,e-1).replace(/""/g,'"')}for(;a<i;){if(10===(r=t.charCodeAt(e=a++)))c=!0;else if(13===r)c=!0,10===t.charCodeAt(a)&&++a;else if(r!==n)continue;return t.slice(o,e)}return l=!0,t.slice(o,i)}for(10===t.charCodeAt(i-1)&&--i,13===t.charCodeAt(i-1)&&--i;(r=s())!==Qn;){for(var f=[];r!==Jn&&r!==Qn;)f.push(r),r=s();e&&null==(f=e(f,u++))||o.push(f)}return o}function o(e,n){return e.map((function(e){return n.map((function(t){return a(e[t])})).join(t)}))}function i(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?(o=(n=t).getUTCHours(),i=n.getUTCMinutes(),a=n.getUTCSeconds(),u=n.getUTCMilliseconds(),isNaN(n)?"Invalid Date":((r=n.getUTCFullYear())<0?"-"+nr(-r,6):r>9999?"+"+nr(r,6):nr(r,4))+"-"+nr(n.getUTCMonth()+1,2)+"-"+nr(n.getUTCDate(),2)+(u?"T"+nr(o,2)+":"+nr(i,2)+":"+nr(a,2)+"."+nr(u,3)+"Z":a?"T"+nr(o,2)+":"+nr(i,2)+":"+nr(a,2)+"Z":i||o?"T"+nr(o,2)+":"+nr(i,2)+"Z":"")):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t;var n,r,o,i,a,u}return{parse:function(t,e){var n,o,i=r(t,(function(t,r){if(n)return n(t,r-1);o=t,n=e?function(t,e){var n=tr(t);return function(r,o){return e(n(r),o,t)}}(t,e):tr(t)}));return i.columns=o||[],i},parseRows:r,format:function(e,n){return null==n&&(n=er(e)),[n.map(a).join(t)].concat(o(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=er(t)),o(t,e).join("\n")},formatRows:function(t){return t.map(i).join("\n")},formatRow:i,formatValue:a}}var or=rr(","),ir=or.parse,ar=(or.parseRows,or.format,or.formatBody,or.formatRows,or.formatRow,or.formatValue,rr("\t")),ur=ar.parse;function lr(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function cr(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=void 0),function(t,e){return fetch(t,e).then(lr)}(e,n).then((function(e){return t(e,r)}))}}ar.parseRows,ar.format,ar.formatBody,ar.formatRows,ar.formatRow,ar.formatValue;var sr=cr(ir);function fr(t){return fr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fr(t)}function hr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function yr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==fr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==fr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===fr(o)?o:String(o)),r)}var o}cr(ur);var pr=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=r||{},this.url=e,this.resolution=n,this.preprocess=r.preprocess||void 0,this.cellsViewCache=[]}var e,n;return e=t,(n=[{key:"getData",value:function(t,e){throw new Error("Method getData not implemented.")}},{key:"updateViewCache",value:function(t){throw new Error("Method updateViewCache not implemented.")}},{key:"getCellFromPosition",value:function(t,e){var n,r=this.getResolution(),o=r*Math.floor(t.x/r),i=r*Math.floor(t.y/r),a=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return hr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(e);try{for(a.s();!(n=a.n()).done;){var u=n.value;if(u.x==o&&u.y==i)return u}}catch(t){a.e(t)}finally{a.f()}}},{key:"getResolution",value:function(){return this.resolution}},{key:"getViewCache",value:function(){return this.cellsViewCache}}])&&yr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function vr(t){return vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vr(t)}function dr(){dr=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return r(a,"_invoke",{value:x(t,n,u)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function y(){}function p(){}var v={};l(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(P([])));m&&m!==e&&n.call(m,i)&&(v=m);var b=p.prototype=h.prototype=Object.create(v);function g(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,u){var l=s(t[r],t,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==vr(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,u)}))}u(l.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function x(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=S(a,n);if(u){if(u===f)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=s(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return y.prototype=p,r(b,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:y,configurable:!0}),y.displayName=l(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,l(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},g(w.prototype),l(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(c(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(b),l(b,u,"Generator"),l(b,i,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=P,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function mr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return br(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?br(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function br(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function gr(t,e,n,r,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}function wr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==vr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==vr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===vr(o)?o:String(o)),r)}var o}function xr(t,e){return xr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xr(t,e)}function Sr(t){return Sr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sr(t)}var _r=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xr(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Sr(r);if(o){var n=Sr(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===vr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=i.call(this,t,e,r)).cells=[],n.infoLoadingStatus="notLoaded",n}return e=a,n=[{key:"getData",value:function(t,e){var n,r=this;return"notLoaded"!=this.infoLoadingStatus||(this.infoLoadingStatus="loading",(n=dr().mark((function t(){var n,o,i,a,u,l,c;return dr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,sr(r.url);case 3:n=t.sent,o=mr(n);try{for(o.s();!(i=o.n()).done;)(a=i.value).x=+a.x,a.y=+a.y}catch(t){o.e(t)}finally{o.f()}if(!r.preprocess){t.next=29;break}r.cells=[],u=mr(n),t.prev=9,u.s();case 11:if((l=u.n()).done){t.next=19;break}if(c=l.value,0!=r.preprocess(c)){t.next=16;break}return t.abrupt("continue",17);case 16:r.cells.push(c);case 17:t.next=11;break;case 19:t.next=24;break;case 21:t.prev=21,t.t0=t.catch(9),u.e(t.t0);case 24:return t.prev=24,u.f(),t.finish(24);case 27:t.next=30;break;case 29:r.cells=n;case 30:e&&e(),r.infoLoadingStatus="loaded",t.next=38;break;case 34:t.prev=34,t.t1=t.catch(0),r.infoLoadingStatus="failed",r.cells=[];case 38:case"end":return t.stop()}}),t,null,[[0,34],[9,21,24,27]])})),function(){var t=this,e=arguments;return new Promise((function(r,o){var i=n.apply(t,e);function a(t){gr(i,r,o,a,u,"next",t)}function u(t){gr(i,r,o,a,u,"throw",t)}a(void 0)}))})()),this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,n=mr(this.cells);try{for(n.s();!(e=n.n()).done;){var r=e.value;+r.x+this.resolution<t.xMin||+r.x-this.resolution>t.xMax||+r.y+this.resolution<t.yMin||+r.y-this.resolution>t.yMax||this.cellsViewCache.push(r)}}catch(t){n.e(t)}finally{n.f()}}}}],n&&wr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(pr);function Or(t){return Or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Or(t)}function jr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Pr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Or(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Or(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Or(o)?o:String(o)),r)}var o}function kr(t,e,n){return e&&Pr(t.prototype,e),n&&Pr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var Er=kr((function t(e,n,r,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.cells=e,this.x=n,this.y=r;var i=o.resolutionGeo,a=o.tileSizeCell;this.extGeo={xMin:o.originPoint.x+i*a*this.x,xMax:o.originPoint.x+i*a*(this.x+1),yMin:o.originPoint.y+i*a*this.y,yMax:o.originPoint.y+i*a*(this.y+1)};var u,l=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return jr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(this.cells);try{for(l.s();!(u=l.n()).done;){var c=u.value;c.x=this.extGeo.xMin+c.x*i,c.y=this.extGeo.yMin+c.y*i}}catch(t){l.e(t)}finally{l.f()}}));function Cr(t,e){if(e){if(0==e.length)return 0;if(t<=e[0])return 0;for(var n=1;n<e.length;n++)if(e[n-1]<t&&t<=e[n])return n;return e.length}}function Tr(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function Ar(t,e){return fetch(t,e).then(Tr)}function Mr(t){return Mr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mr(t)}function Rr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Lr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Lr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function zr(){zr=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return r(a,"_invoke",{value:x(t,n,u)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function y(){}function p(){}var v={};l(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(P([])));m&&m!==e&&n.call(m,i)&&(v=m);var b=p.prototype=h.prototype=Object.create(v);function g(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,u){var l=s(t[r],t,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==Mr(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,u)}))}u(l.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function x(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=S(a,n);if(u){if(u===f)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=s(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return y.prototype=p,r(b,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:y,configurable:!0}),y.displayName=l(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,l(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},g(w.prototype),l(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(c(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(b),l(b,u,"Generator"),l(b,i,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=P,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function Fr(t,e,n,r,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}function Ir(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Fr(i,r,o,a,u,"next",t)}function u(t){Fr(i,r,o,a,u,"throw",t)}a(void 0)}))}}function Nr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Mr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Mr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Mr(o)?o:String(o)),r)}var o}function Br(t,e){return Br=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Br(t,e)}function Dr(t){return Dr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Dr(t)}var Gr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Br(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Dr(r);if(o){var n=Dr(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Mr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=i.call(this,t,0,r)).app=e,n.info=void 0,n.infoLoadingStatus="notLoaded",n.cache={},n}return e=a,(n=[{key:"loadInfo",value:function(t){var e=this;return this.info||"notLoaded"!==this.infoLoadingStatus?!t||"loaded"!==this.infoLoadingStatus&&"failed"!==this.infoLoadingStatus||t():Ir(zr().mark((function n(){var r;return zr().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Ar(e.url+"info.json");case 3:r=n.sent,e.info=r,e.resolution=r.resolutionGeo,e.infoLoadingStatus="loaded",t&&t(),n.next=13;break;case 10:n.prev=10,n.t0=n.catch(0),e.infoLoadingStatus="failed";case 13:case"end":return n.stop()}}),n,null,[[0,10]])})))(),this}},{key:"getTilingEnvelope",value:function(t){if(this.info){var e=this.info.originPoint,n=this.info.resolutionGeo,r=this.info.tileSizeCell;return{xMin:Math.floor((t.xMin-e.x)/(n*r)),xMax:Math.floor((t.xMax-e.x)/(n*r)),yMin:Math.floor((t.yMin-e.y)/(n*r)),yMax:Math.floor((t.yMax-e.y)/(n*r))}}this.loadInfo((function(){}))}},{key:"getData",value:function(t,e){var n=this;if(!this.info)return this;var r=this.getTilingEnvelope(t);if(!r)return this;for(var o=this.info.tilingBounds,i=function(t){for(var i=function(r){if(n.cache[t]||(n.cache[t]={}),n.cache[t][r])return"continue";n.cache[t][r]="loading",Ir(zr().mark((function o(){var i,a,u,l,c,s,f,h,y,p,v,d,m;return zr().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,sr(n.url+t+"/"+r+".csv");case 3:if(a=o.sent,!n.preprocess){o.next=28;break}i=[],u=Rr(a),o.prev=8,u.s();case 10:if((l=u.n()).done){o.next=18;break}if(c=l.value,0!=n.preprocess(c)){o.next=15;break}return o.abrupt("continue",16);case 15:i.push(c);case 16:o.next=10;break;case 18:o.next=23;break;case 20:o.prev=20,o.t0=o.catch(8),u.e(o.t0);case 23:return o.prev=23,u.f(),o.finish(23);case 26:o.next=29;break;case 28:i=a;case 29:o.next=36;break;case 32:return o.prev=32,o.t1=o.catch(0),n.cache[t][r]="failed",o.abrupt("return");case 36:if(n.info){o.next=39;break}return console.error("Tile info inknown"),o.abrupt("return");case 39:if(s=new Er(i,t,r,n.info),n.cache[t][r]=s,e){o.next=44;break}return o.abrupt("return");case 44:f=!1,h=n.app.getZoomFactor(),y=Rr(n.app.layers),o.prev=47,y.s();case 49:if((p=y.n()).done){o.next=59;break}if((v=p.value).visible){o.next=53;break}return o.abrupt("continue",57);case 53:if(v.getDatasetComponent(h)==n){o.next=55;break}return o.abrupt("continue",57);case 55:return f=!0,o.abrupt("break",59);case 57:o.next=49;break;case 59:o.next=64;break;case 61:o.prev=61,o.t2=o.catch(47),y.e(o.t2);case 64:return o.prev=64,y.f(),o.finish(64);case 67:if(f){o.next=70;break}return o.abrupt("return");case 70:if(d=n.app.updateExtentGeo(),m=s.extGeo,!(d.xMax<=m.xMin)){o.next=74;break}return o.abrupt("return");case 74:if(!(d.xMin>=m.xMax)){o.next=76;break}return o.abrupt("return");case 76:if(!(d.yMax<=m.yMin)){o.next=78;break}return o.abrupt("return");case 78:if(!(d.yMin>=m.yMax)){o.next=80;break}return o.abrupt("return");case 80:e();case 83:case"end":return o.stop()}}),o,null,[[0,32],[8,20,23,26],[47,61,64,67]])})))()},a=Math.max(r.yMin,o.yMin);a<=Math.min(r.yMax,o.yMax);a++)i(a)},a=Math.max(r.xMin,o.xMin);a<=Math.min(r.xMax,o.xMax);a++)i(a);return this}},{key:"updateViewCache",value:function(t){if(this.cellsViewCache=[],this.info){var e=this.getTilingEnvelope(t);if(e)for(var n=this.info.tilingBounds,r=Math.max(e.xMin,n.xMin);r<=Math.min(e.xMax,n.xMax);r++)if(this.cache[r])for(var o=Math.max(e.yMin,n.yMin);o<=Math.min(e.yMax,n.yMax);o++){var i=this.cache[r][o];if(i&&"string"!=typeof i){var a,u=Rr(i.cells);try{for(u.s();!(a=u.n()).done;){var l=a.value;+l.x+this.resolution<t.xMin||+l.x-this.resolution>t.xMax||+l.y+this.resolution<t.yMin||+l.y-this.resolution>t.yMax||this.cellsViewCache.push(l)}}catch(t){u.e(t)}finally{u.f()}}}}}}])&&Nr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(pr);function Zr(t){return Zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zr(t)}function Ur(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Zr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Zr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Zr(o)?o:String(o)),r)}var o}var Wr=function(){function t(e){var n=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.visible=0!=e.visible,this.minZoom=e.minZoom||0,this.maxZoom=e.maxZoom||1/0,this.minZoom>=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");if(this.cache={},this.url=e.url,this.urlFun=e.urlFun||function(t,e,r){return n.url+r+"/"+t+"/"+e+".png"},this.resolutions=e.resolutions,!this.resolutions||0==this.resolutions.length)throw new Error("No resolutions provided for background layer");this.nbPix=e.nbPix||256,this.origin=e.origin||[0,0],this.z0=e.z0||0,this.filterColor=e.filterColor}var e,n;return e=t,n=[{key:"get",value:function(t,e,n){var r=this.cache[t];if(r&&(r=r[e]))return r[n]}},{key:"put",value:function(t,e,n,r){this.cache[e]||(this.cache[e]={}),this.cache[e][n]||(this.cache[e][n]={}),this.cache[e][n][r]=t}},{key:"draw",value:function(t){var e=this;if(this.resolutions&&0!=this.resolutions.length){var n=t.getZf(),r=this.origin[0],o=this.origin[1],i=0;for(i=0;i<this.resolutions.length&&!(this.resolutions[i]<n);i++);i-=1,i=Math.max(0,i),i=Math.min(i,this.resolutions.length-1);var a=this.resolutions[i];i+=this.z0;for(var u=this.nbPix*a,l=u/n,c=function(t){return Math.ceil((t-r)/u)},s=function(t){return Math.ceil(-(t-o)/u)},f=c(t.extGeo.xMin)-1,h=c(t.extGeo.xMax),y=s(t.extGeo.yMin),p=s(t.extGeo.yMax)-1,v=function(n){for(var a=function(a){var c=e.get(i,n,a);if(!c){var s=new Image;return e.put(s,i,n,a),s.onload=function(){t.redraw()},s.onerror=function(){e.put("failed",i,n,a)},s.src=e.urlFun(n,a,i),"continue"}if("failed"===c)return"continue";if(!(c instanceof HTMLImageElement))return console.log(c),"continue";if(0==c.width||0==c.height)return"continue";var f=r+n*u,h=o-a*u;try{t.ctx.drawImage(c,t.geoToPixX(f),t.geoToPixY(h),l,l)}catch(t){console.error(t)}},c=p;c<y;c++)a(c)},d=f;d<h;d++)v(d);if(this.filterColor){var m=this.filterColor(n);m&&"none"!=m&&(t.ctx.fillStyle=m,t.ctx.fillRect(0,0,t.w,t.h))}}else console.error("No resolutions provided for background layer")}}],n&&Ur(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function $r(t){return $r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$r(t)}function Yr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==$r(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==$r(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===$r(o)?o:String(o)),r)}var o}var Xr=function(){function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.visible=0!=e.visible,this.minZoom=e.minZoom||0,this.maxZoom=e.maxZoom||1/0,this.minZoom>=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");this.url=e.url,this.filterColor=e.filterColor,this.img=void 0,this.xMin=void 0,this.xMax=void 0,this.yMin=void 0,this.yMax=void 0}var e,n;return e=t,(n=[{key:"hasMoved",value:function(t){return t.xMin!=this.xMin||t.xMax!=this.xMax||t.yMin!=this.yMin||t.yMax!=this.yMax}},{key:"draw",value:function(t){if(t.updateExtentGeo(0),!this.hasMoved(t.extGeo)&&this.img)t.ctx.drawImage(this.img,0,0,t.w,t.h);else{this.xMin=t.extGeo.xMin,this.xMax=t.extGeo.xMax,this.yMin=t.extGeo.yMin,this.yMax=t.extGeo.yMax;var e=[];e.push(this.url),e.push("&width="),e.push(t.w),e.push("&height="),e.push(t.h),e.push("&bbox="),e.push(t.extGeo.xMin),e.push(","),e.push(t.extGeo.yMin),e.push(","),e.push(t.extGeo.xMax),e.push(","),e.push(t.extGeo.yMax);var n=e.join("");this.img||(this.img=new Image,this.img.onload=function(){t.redraw()},this.img.onerror=function(){console.warn("Could not retrieve WMS background image from",n)}),this.img.src=n}var r=t.getZf();if(this.filterColor){var o=this.filterColor(r);o&&"none"!=o&&(t.ctx.fillStyle=o,t.ctx.fillRect(0,0,t.w,t.h))}}}])&&Yr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Hr(t){return Hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hr(t)}function Vr(){Vr=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return r(a,"_invoke",{value:x(t,n,u)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function y(){}function p(){}var v={};l(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(P([])));m&&m!==e&&n.call(m,i)&&(v=m);var b=p.prototype=h.prototype=Object.create(v);function g(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,u){var l=s(t[r],t,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==Hr(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,u)}))}u(l.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function x(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=S(a,n);if(u){if(u===f)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=s(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return y.prototype=p,r(b,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:y,configurable:!0}),y.displayName=l(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,l(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},g(w.prototype),l(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(c(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(b),l(b,u,"Generator"),l(b,i,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=P,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function qr(t,e,n,r,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}function Kr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Jr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Jr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Qr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Hr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Hr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Hr(o)?o:String(o)),r)}var o}var to=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.url=e.url,this.style=e.style||function(){return"bold 1em Arial"},this.color=e.color||(e.dark?function(){return"#ddd"}:function(){return"#222"}),this.haloColor=e.haloColor||(e.dark?function(){return"#000000BB"}:function(){return"#FFFFFFBB"}),this.haloWidth=e.haloWidth||function(){return 4},this.textAlign=e.textAlign||"start",this.offsetPix=e.offsetPix||[5,5],this.preprocess=e.preprocess,this.labels=void 0,this.loadingStatus="notLoaded"}var e,n,r,o;return e=t,n=[{key:"draw",value:function(t){if(this.labels){var e=t.getZf();t.ctx.textAlign=this.textAlign||"start",t.ctx.lineJoin="bevel",t.ctx.lineCap="butt",t.initCanvasTransform();var n,r=Kr(this.labels);try{for(r.s();!(n=r.n()).done;){var o=n.value,i=this.style(o,e);if(i&&(t.ctx.font=i,t.toDraw(o))){var a=t.geoToPixX(o.x)+this.offsetPix[0],u=t.geoToPixY(o.y)-this.offsetPix[1];if(this.haloColor&&this.haloWidth){var l=this.haloColor(o,e),c=this.haloWidth(o,e);l&&c&&c>0&&(t.ctx.strokeStyle=l,t.ctx.lineWidth=c,t.ctx.strokeText(o.name,a,u))}if(this.color){var s=this.color(o,e);s&&(t.ctx.fillStyle=s,t.ctx.fillText(o.name,a,u))}}}}catch(t){r.e(t)}finally{r.f()}}else this.load(t.redraw)}},{key:"load",value:(r=Vr().mark((function t(e){var n,r,o,i;return Vr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.url){t.next=5;break}return console.log("Failed loading labels: No URL specified. "+this.url),this.loadingStatus="failed",this.labels=[],t.abrupt("return");case 5:if("notLoaded"==this.loadingStatus){t.next=7;break}return t.abrupt("return");case 7:return this.loadingStatus="loading",t.prev=8,t.next=11,sr(this.url);case 11:if(n=t.sent,!this.preprocess){t.next=35;break}this.labels=[],r=Kr(n),t.prev=15,r.s();case 17:if((o=r.n()).done){t.next=25;break}if(i=o.value,0!=this.preprocess(i)){t.next=22;break}return t.abrupt("continue",23);case 22:this.labels.push(i);case 23:t.next=17;break;case 25:t.next=30;break;case 27:t.prev=27,t.t0=t.catch(15),r.e(t.t0);case 30:return t.prev=30,r.f(),t.finish(30);case 33:t.next=36;break;case 35:this.labels=n;case 36:this.loadingStatus="loaded",e&&e(),t.next=45;break;case 40:t.prev=40,t.t1=t.catch(8),console.log("Failed loading labels from "+this.url),this.labels=[],this.loadingStatus="failed";case 45:case"end":return t.stop()}}),t,this,[[8,40],[15,27,30,33]])})),o=function(){var t=this,e=arguments;return new Promise((function(n,o){var i=r.apply(t,e);function a(t){qr(i,n,o,a,u,"next",t)}function u(t){qr(i,n,o,a,u,"throw",t)}a(void 0)}))},function(t){return o.apply(this,arguments)})}],n&&Qr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function eo(t){return eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eo(t)}function no(){no=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return r(a,"_invoke",{value:x(t,n,u)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function y(){}function p(){}var v={};l(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(P([])));m&&m!==e&&n.call(m,i)&&(v=m);var b=p.prototype=h.prototype=Object.create(v);function g(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,u){var l=s(t[r],t,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==eo(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,u)}))}u(l.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function x(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=S(a,n);if(u){if(u===f)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=s(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return y.prototype=p,r(b,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:y,configurable:!0}),y.displayName=l(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,l(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},g(w.prototype),l(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(c(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(b),l(b,u,"Generator"),l(b,i,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=P,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function ro(t,e,n,r,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}function oo(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return io(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?io(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function io(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ao(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==eo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==eo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===eo(o)?o:String(o)),r)}var o}var uo=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.url=e.url,this.preprocess=e.preprocess,this.color=e.color||function(t,e){return"gray"},this.width=e.width||function(t,e){return 2},this.lineDash=e.lineDash||function(t,e){},this.fs=void 0,this.loadingStatus="notLoaded"}var e,n,r,o;return e=t,n=[{key:"draw",value:function(t){if(this.fs){var e=t.getZf();t.setCanvasTransform();var n,r=oo(this.fs);try{for(r.s();!(n=r.n()).done;){var o=n.value,i=o.geometry.coordinates;if(!(i.length<2)){var a=this.color(o,e);if(a&&"none"!=a){t.ctx.strokeStyle=a;var u=this.width(o,e);if(u&&!(u<0)){t.ctx.lineWidth=u*e;var l=this.lineDash(o,e);l&&t.ctx.setLineDash(l),t.ctx.beginPath(),t.ctx.moveTo(i[0][0],i[0][1]);for(var c=1;c<i.length;c++)t.ctx.lineTo(i[c][0],i[c][1]);t.ctx.stroke()}}}}}catch(t){r.e(t)}finally{r.f()}t.ctx.setLineDash([])}else this.load(t.redraw)}},{key:"load",value:(r=no().mark((function t(e){var n,r,o,i,a;return no().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.url){t.next=5;break}return console.log("Failed loading boundaries: No URL specified. "+this.url),this.loadingStatus="failed",this.labels=[],t.abrupt("return");case 5:if("notLoaded"==this.loadingStatus){t.next=7;break}return t.abrupt("return");case 7:return this.loadingStatus="loading",t.prev=8,t.next=11,Ar(this.url);case 11:if(n=t.sent,r=n.features,!this.preprocess){t.next=36;break}this.fs=[],o=oo(r),t.prev=16,o.s();case 18:if((i=o.n()).done){t.next=26;break}if(a=i.value,0!=this.preprocess(a)){t.next=23;break}return t.abrupt("continue",24);case 23:this.fs.push(a);case 24:t.next=18;break;case 26:t.next=31;break;case 28:t.prev=28,t.t0=t.catch(16),o.e(t.t0);case 31:return t.prev=31,o.f(),t.finish(31);case 34:t.next=37;break;case 36:this.fs=r;case 37:this.loadingStatus="loaded",e&&e(),t.next=46;break;case 41:t.prev=41,t.t1=t.catch(8),console.log("Failed loading boundaries from "+this.url),this.fs=[],this.loadingStatus="failed";case 46:case"end":return t.stop()}}),t,this,[[8,41],[16,28,31,34]])})),o=function(){var t=this,e=arguments;return new Promise((function(n,o){var i=r.apply(t,e);function a(t){ro(i,n,o,a,u,"next",t)}function u(t){ro(i,n,o,a,u,"throw",t)}a(void 0)}))},function(t){return o.apply(this,arguments)})}],n&&ao(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function lo(t){return lo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lo(t)}function co(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return so(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?so(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function so(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function fo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==lo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==lo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===lo(o)?o:String(o)),r)}var o}var ho=function(){function t(e,n){var r=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=n||{},this.layers=[],e=e||document.getElementById("gridviz")){this.w=n.w||e.offsetWidth,this.h=n.h||e.offsetHeight;var o=n.canvas||null;o||((o=document.createElement("canvas")).setAttribute("width",""+this.w),o.setAttribute("height",""+this.h),e.appendChild(o)),this.cg=new Bn(o,void 0,1,n),this.cg.redraw=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];r.legend&&t&&r.legend.selectAll("*").remove(),r.cg.initCanvasTransform(),r.cg.clear(r.cg.backgroundColor);var n=r.getZoomFactor();if(r.updateExtentGeo(),r.showBgLayers){var i,a=co(r.bgLayers);try{for(a.s();!(i=a.n()).done;){var u=i.value;u.visible&&(n>u.maxZoom||n<u.minZoom||u.draw(r.cg))}}catch(t){a.e(t)}finally{a.f()}}var l,c=co(r.layers);try{for(c.s();!(l=c.n()).done;){var s=l.value;if(s.visible&&!(n>s.maxZoom||n<s.minZoom)){var f=s.getDatasetComponent(n);if(f){if(t&&f.getData(r.cg.extGeo,(function(){r.cg.redraw()})),t&&f.updateViewCache(r.cg.extGeo),t){var h,y=co(s.styles);try{for(y.s();!(h=y.n()).done;){var p=h.value;n>p.maxZoom||n<p.minZoom||p.draw(f.getViewCache(),f.getResolution(),r.cg)}}catch(t){y.e(t)}finally{y.f()}}if(r.legend&&t){var v,d=co(s.styles);try{for(d.s();!(v=d.n()).done;){var m=v.value;if(!(n>m.maxZoom||n<m.minZoom)){var b,g=co(m.legends);try{for(g.s();!(b=g.n()).done;){var w=b.value;r.legend.node().append(w.div.node())}}catch(t){g.e(t)}finally{g.f()}if(m.styles){var x,S=co(m.styles);try{for(S.s();!(x=S.n()).done;){var _=x.value;if(!(n>_.maxZoom||n<_.minZoom)){var O,j=co(_.legends);try{for(j.s();!(O=j.n()).done;){var P=O.value;r.legend.node().append(P.div.node())}}catch(t){j.e(t)}finally{j.f()}}}}catch(t){S.e(t)}finally{S.f()}}}}}catch(t){d.e(t)}finally{d.f()}}}}}}catch(t){c.e(t)}finally{c.f()}return r.showBoundaries&&r.boundaryLayer&&r.boundaryLayer.draw(r.cg),r.showLabels&&r.labelLayer&&r.labelLayer.draw(r.cg),r.canvasSave=null,r.defineResizeObserver(e,o),r},this.bgLayers=[],this.showBgLayers=!0,this.labelLayer=void 0,this.showLabels=!0,this.boundaryLayer=void 0,this.showBoundaries=!0,this.legendDivId=n.legendDivId||"gvizLegend",this.legend=pt("#"+this.legendDivId),this.legend.empty()&&(this.legend=pt(e.id&&""!=e.id?"#"+e.id:"body").append("div").attr("id",this.legendDivId).style("position","absolute").style("width","auto").style("height","auto").style("background","#FFFFFFCC").style("border","0px").style("border-radius","5px").style("box-shadow","3px 3px 3px grey, -3px -3px 3px #ddd").style("font-family","Helvetica, Arial, sans-serif").style("top","20px").style("right","20px")),n.tooltip||(n.tooltip={}),n.tooltip.parentElement||(n.tooltip.parentElement=e),this.tooltip=new Kn(n.tooltip);var i=function(t){var e={x:r.cg.pixToGeoX(t.offsetX+r.tooltip.xMouseOffset),y:r.cg.pixToGeoY(t.offsetY+r.tooltip.yMouseOffset)},o=r.getCellFocusInfo(e);if(n.transparentBackground)return o?(r.tooltip.setPosition(t),r.tooltip.show(),r.tooltip.html(o.html)):r.tooltip.hide(),r.canvasSave=document.createElement("canvas"),r.canvasSave.setAttribute("width",""+r.w),r.canvasSave.setAttribute("height",""+r.h),r.canvasSave.getContext("2d").drawImage(r.cg.canvas,0,0),void r.cg.initCanvasTransform();if(o){r.tooltip.setPosition(t),r.tooltip.show(),r.tooltip.html(o.html),r.canvasSave?r.cg.ctx.drawImage(r.canvasSave,0,0):(r.canvasSave=document.createElement("canvas"),r.canvasSave.setAttribute("width",""+r.w),r.canvasSave.setAttribute("height",""+r.h),r.canvasSave.getContext("2d").drawImage(r.cg.canvas,0,0));var i=r.selectionRectangleWidthPix?r.selectionRectangleWidthPix(o.resolution,r.getZoomFactor()):4;r.cg.initCanvasTransform(),r.cg.ctx.strokeStyle=r.selectionRectangleColor,r.cg.ctx.lineWidth=i,r.cg.ctx.beginPath(),r.cg.ctx.rect(r.cg.geoToPixX(o.cell.x)-i/2,r.cg.geoToPixY(o.cell.y)+i/2,o.resolution/r.getZoomFactor()+i,-o.resolution/r.getZoomFactor()-i),r.cg.ctx.stroke()}else r.tooltip.hide(),r.canvasSave&&r.cg.ctx.drawImage(r.canvasSave,0,0)};e.addEventListener("mouseover",(function(t){i(t)})),e.addEventListener("mousemove",(function(t){i(t)})),e.addEventListener("mouseout",(function(){r.tooltip.hide()})),this.cg.onZoomStartFun=function(t){n.onZoomStartFun&&n.onZoomStartFun(t),r.tooltip.hide()},this.canvasSave=null,this.selectionRectangleColor=n.selectionRectangleColor||"red",this.selectionRectangleWidthPix=n.selectionRectangleWidthPix||function(){return 4}}else console.error("Cannot find gridviz container element.")}var e,n;return e=t,n=[{key:"updateExtentGeo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return this.cg.updateExtentGeo(t)}},{key:"getCellFocusInfo",value:function(t){for(var e=this.getZoomFactor(),n=this.layers.length-1;n>=0;n--){var r=this.layers[n];if(r.visible&&r.cellInfoHTML&&"none"!==r.cellInfoHTML){var o=r.getDatasetComponent(e);if(o){var i=o.getCellFromPosition(t,o.getViewCache());if(!i)return;var a=r.cellInfoHTML(i,o.getResolution());if(!a)return;return{cell:i,html:a,resolution:o.getResolution()}}}}}},{key:"getGeoCenter",value:function(){return this.cg.getCenter()}},{key:"setGeoCenter",value:function(t){return this.cg.setCenter(t),this}},{key:"getZoomFactor",value:function(){return this.cg.getZf()}},{key:"setZoomFactor",value:function(t){return this.cg.setZf(t),this}},{key:"getZoomFactorExtent",value:function(){return this.cg.getZfExtent()}},{key:"setZoomFactorExtent",value:function(t){return this.cg.setZfExtent(t),this}},{key:"getBackgroundColor",value:function(){return this.cg.backgroundColor}},{key:"setBackgroundColor",value:function(t){return this.cg.backgroundColor=t,this}},{key:"getBoundaryLayer",value:function(){return this.boundaryLayer}},{key:"setBoundaryLayer",value:function(t){return this.boundaryLayer=new uo(t),this}},{key:"getLabelLayer",value:function(){return this.labelLayer}},{key:"setLabelLayer",value:function(t){return this.labelLayer=new to(t),this}},{key:"redraw",value:function(){return this.cg.redraw(),this}},{key:"addLayerFromDataset",value:function(t,e,n){var r=new Zn(t,e,n);return this.layers.push(r),this}},{key:"makeCSVGridDataset",value:function(t,e,n){var r=this;return new Xn([new _r(t,e,n).getData(void 0,(function(){r.cg.redraw()}))],[],n)}},{key:"makeTiledGridDataset",value:function(t,e){var n=this;return new Xn([new Gr(t,this,e).loadInfo((function(){n.cg.redraw()}))],[],e)}},{key:"makeMultiScaleCSVGridDataset",value:function(t,e,n){var r=this;return Xn.make(t,(function(t){return new _r(e(t),t,n).getData(void 0,(function(){r.cg.redraw()}))}),n)}},{key:"makeMultiScaleTiledGridDataset",value:function(t,e,n){var r=this;return Xn.make(t,(function(t){return new Gr(e(t),r,n).loadInfo((function(){r.cg.redraw()}))}),n)}},{key:"addCSVGridLayer",value:function(t,e,n,r){var o=this.makeCSVGridDataset(t,e,r);return this.addLayerFromDataset(o,n,r)}},{key:"addTiledGridLayer",value:function(t,e,n){var r=this.makeTiledGridDataset(t,n);return this.addLayerFromDataset(r,e,n)}},{key:"addMultiScaleCSVGridLayer",value:function(t,e,n,r){var o=this.makeMultiScaleCSVGridDataset(t,e,r);return this.addLayerFromDataset(o,n,r)}},{key:"addMultiScaleTiledGridLayer",value:function(t,e,n,r){var o=this.makeMultiScaleTiledGridDataset(t,e,r);return this.addLayerFromDataset(o,n,r)}},{key:"addBackgroundLayer",value:function(t){return this.bgLayers.push(new Wr(t)),this.redraw(),this}},{key:"addBackgroundLayerWMS",value:function(t){return this.bgLayers.push(new Xr(t)),this.redraw(),this}},{key:"addZoomSlider",value:function(t,e){return this.cg.addZoomSlider(t,e),this}},{key:"setViewFromURL",value:function(){return this.cg.setViewFromURL(),this}},{key:"defineResizeObserver",value:function(t,e){var n=this;new ResizeObserver((function(r){t.clientWidth>0&&t.clientHeight>0&&window.requestAnimationFrame((function(){Array.isArray(r)&&r.length&&(n.h===t.clientHeight&&n.w===t.clientWidth||(n.h=t.clientHeight,n.w=t.clientWidth,n.cg.h=t.clientHeight,n.cg.w=t.clientWidth,e.setAttribute("width",""+n.w),e.setAttribute("height",""+n.h),n.redraw()))}))})).observe(t)}}],n&&fo(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function yo(t){return yo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yo(t)}function po(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return vo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function vo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function mo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==yo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==yo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===yo(o)?o:String(o)),r)}var o}var bo=function(){function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.filter=e.filter||function(){return!0},this.offset=e.offset||function(t,e,n){return{dx:0,dy:0}},this.minZoom=e.minZoom||0,this.maxZoom=e.maxZoom||1/0,this.minZoom>=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");this.legends=[]}var e,n,r;return e=t,r=[{key:"getStatistics",value:function(t,e,n){if(t&&0!=t.length){var r,o=1/0,i=-1/0,a=po(t);try{for(a.s();!(r=a.n()).done;){var u=+e(r.value);n&&!u||(u<o&&(o=u),u>i&&(i=u))}}catch(t){a.e(t)}finally{a.f()}return{min:o,max:i}}}}],(n=[{key:"draw",value:function(t,e,n){throw new Error("Method draw not implemented.")}},{key:"getOffset",value:function(){return this.offset}},{key:"setOffset",value:function(t){return this.offset=t,this}},{key:"updateLegends",value:function(t){var e,n=po(this.legends);try{for(n.s();!(e=n.n()).done;)e.value.update(t)}catch(t){n.e(t)}finally{n.f()}return this}}])&&mo(e.prototype,n),r&&mo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function go(t){return go="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},go(t)}function wo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function xo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==go(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==go(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===go(o)?o:String(o)),r)}var o}function So(t,e){return So=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},So(t,e)}function _o(t){return _o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_o(t)}var Oo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&So(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=_o(r);if(o){var n=_o(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===go(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.sizeCol=t.sizeCol,e.size=t.size,e.shape=t.shape||function(){return"square"},e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i,a=n.getZf();this.sizeCol&&(t.sort((function(t,e){return e[r.sizeCol]-t[r.sizeCol]})),o=bo.getStatistics(t,(function(t){return t[r.sizeCol]}),!0)),this.colorCol&&(i=bo.getStatistics(t,(function(t){return t[r.colorCol]}),!0)),n.setCanvasTransform();var u,l=.5*e,c=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return wo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(u=c.n()).done;){var s=u.value,f=this.color?this.color(s[this.colorCol],e,i,a):void 0;if(f&&"none"!==f){n.ctx.fillStyle=f;var h=this.shape?this.shape(s):"square";if("none"!==h){var y=(this.size||function(){return e})(s[this.sizeCol],e,o,a),p=this.offset(s,e,a);if("square"===h){var v=e*(1-y/e)*.5;n.ctx.fillRect(s.x+v+p.dx,s.y+v+p.dy,y,y)}else if("circle"===h)n.ctx.beginPath(),n.ctx.arc(s.x+l+p.dx,s.y+l+p.dy,.5*y,0,2*Math.PI,!1),n.ctx.fill();else if("donut"===h){var d=s.x+l+p.dx,m=s.y+l+p.dy;n.ctx.beginPath(),n.ctx.moveTo(d,m),n.ctx.arc(d,m,l,0,2*Math.PI),n.ctx.arc(d,m,(1-y/e)*l,0,2*Math.PI,!0),n.ctx.closePath(),n.ctx.fill()}else{if("diamond"!==h)throw new Error("Unexpected shape:"+h);var b=.5*y;n.ctx.beginPath(),n.ctx.moveTo(s.x+l-b,s.y+l),n.ctx.lineTo(s.x+l,s.y+l+b),n.ctx.lineTo(s.x+l+b,s.y+l),n.ctx.lineTo(s.x+l,s.y+l-b),n.ctx.fill()}}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:a,sSize:o,sColor:i})}}])&&xo(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function jo(t){return jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jo(t)}function Po(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ko(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==jo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==jo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===jo(o)?o:String(o)),r)}var o}function Eo(t,e){return Eo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Eo(t,e)}function Co(t){return Co=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Co(t)}var To=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Eo(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Co(r);if(o){var n=Co(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===jo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.strokeColorCol=t.strokeColorCol,e.strokeColor=t.strokeColor||function(){return"#666"},e.sizeCol=t.sizeCol,e.size=t.size,e.strokeWidthCol=t.strokeWidthCol,e.strokeWidth=t.strokeWidth,e.shape=t.shape||function(){return"square"},e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i,a,u=n.getZf();this.strokeColorCol&&(o=bo.getStatistics(t,(function(t){return t[r.strokeColorCol]}),!0)),this.sizeCol&&(i=bo.getStatistics(t,(function(t){return t[r.sizeCol]}),!0)),this.strokeWidthCol&&(a=bo.getStatistics(t,(function(t){return t[r.strokeWidthCol]}),!0)),n.setCanvasTransform();var l,c=.5*e,s=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Po(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Po(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(s.s();!(l=s.n()).done;){var f=l.value,h=this.strokeColor?this.strokeColor(f[this.strokeColorCol],e,o):void 0;if(h&&"none"!==h){n.ctx.strokeStyle=h;var y=(this.size||function(){return e})(f[this.sizeCol],e,i,u),p=this.strokeWidth?this.strokeWidth(f[this.strokeWidthCol],e,a,u):1*u;if(p&&!(p<=0)){n.ctx.lineWidth=p;var v=this.shape?this.shape(f):"square";if("none"!==v){var d=this.offset(f,e,u);if("square"===v){var m=e*(1-y/e)*.5;n.ctx.beginPath(),n.ctx.rect(f.x+m+d.dx,f.y+m+d.dy,y,y),n.ctx.stroke()}else if("circle"===v)n.ctx.beginPath(),n.ctx.arc(f.x+c+d.dx,f.y+c+d.dy,.5*y,0,2*Math.PI,!1),n.ctx.stroke();else if("diamond"===v){var b=.5*y;n.ctx.beginPath(),n.ctx.moveTo(f.x+c-b,f.y+c),n.ctx.lineTo(f.x+c,f.y+c+b),n.ctx.lineTo(f.x+c+b,f.y+c),n.ctx.lineTo(f.x+c,f.y+c-b),n.ctx.lineTo(f.x+c-b,f.y+c),n.ctx.stroke()}else{if("donut"!==v)throw new Error("Unexpected shape:"+v);console.error("Not implemented")}}}}}}catch(t){s.e(t)}finally{s.f()}}}])&&ko(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function Ao(t){return Ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ao(t)}function Mo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ro(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ao(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ao(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ao(o)?o:String(o)),r)}var o}function Lo(t,e){return Lo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Lo(t,e)}function zo(t){return zo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zo(t)}var Fo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Lo(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=zo(r);if(o){var n=zo(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ao(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.heightCol=t.heightCol,e.height=t.height||function(t){return Math.sqrt(t)},e.lineColor=t.lineColor||function(t,e,n,r){return"#BBB"},e.lineWidth=t.lineWidth||function(t,e,n,r){return r},e.fillColor=t.fillColor||function(t,e,n,r){return"#c08c5968"},e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter)),n.ctx.lineJoin="round";var o,i=n.getZf(),a=bo.getStatistics(t,(function(t){return t[r.heightCol]}),!0),u={},l=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Mo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(l.s();!(o=l.n()).done;){var c=o.value,s=u[c.y];s||(s={},u[c.y]=s),s[c.x]=this.height(c[this.heightCol],e,a,i)}}catch(t){l.e(t)}finally{l.f()}var f=n.extGeo;if(f){var h=Math.floor(f.xMin/e)*e,y=Math.floor(f.xMax/e)*e,p=Math.floor(f.yMin/e)*e,v=Math.floor(f.yMax/e)*e,d={min:p,max:v};n.setCanvasTransform();for(var m=v;m>=p;m-=e){var b=u[m];if(b){n.ctx.beginPath(),n.ctx.moveTo(h-e/2,m);for(var g=void 0,w=h;w<=y;w+=e){var x=b[w];x||(x=0),x||g?n.ctx.lineTo(w+e/2,m+x):n.ctx.moveTo(w+e/2,m),g=x}g&&n.ctx.lineTo(y+e/2,m);var S=this.fillColor(m,d,e,i);S&&"none"!=S&&(n.ctx.fillStyle=S,n.ctx.fill());var _=this.lineColor(m,d,e,i),O=this.lineWidth(m,d,e,i);_&&"none"!=_&&O>0&&(n.ctx.strokeStyle=_,n.ctx.lineWidth=O,n.ctx.stroke())}}}}}])&&Ro(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function Io(t){return Io="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Io(t)}function No(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||Bo(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bo(t,e){if(t){if("string"==typeof t)return Do(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Do(t,e):void 0}}function Do(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Go(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Io(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Io(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Io(o)?o:String(o)),r)}var o}function Zo(t,e){return Zo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Zo(t,e)}function Uo(t){return Uo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Uo(t)}var Wo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zo(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Uo(r);if(o){var n=Uo(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Io(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.color=t.color,e.type=t.type,e.sizeCol=t.sizeCol,e.size=t.size||function(t,e,n,r){return e},e.stripesOrientation=t.stripesOrientation||function(){return 0},e.offsetAngle=t.offsetAngle||function(){return 0},e.agePyramidHeight=t.agePyramidHeight||function(t,e,n){return e},e.pieChartInternalRadiusFactor=t.pieChartInternalRadiusFactor||0,e}return e=a,n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i=n.getZf();this.sizeCol&&(t.sort((function(t,e){return e[r.sizeCol]-t[r.sizeCol]})),o=bo.getStatistics(t,(function(t){return t[r.sizeCol]}),!0));var a=Object.entries(this.color).length;n.setCanvasTransform();var u,l=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Bo(t))){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(l.s();!(u=l.n()).done;){var c=u.value,s=(this.size||function(){return e})(c[this.sizeCol],e,o,i),f=this.offset(c,e,i),h=this.type?this.type(c):"flag",y=c.x+f.dx+("agepyramid"===h?0:.5*e),p=c.y+f.dy+("agepyramid"===h?0:.5*e),v=this.offsetAngle?this.offsetAngle(c,e,i)*Math.PI/180:0;if("agepyramid"===h||"radar"===h||"halftone"===h){for(var d=-1/0,m=0,b=Object.keys(this.color);m<b.length;m++){var g=+c[b[m]];g>d&&(d=g)}var w=0;"agepyramid"===h&&this.agePyramidHeight&&(w=(e-this.agePyramidHeight(c,e,i))/2),"radar"!==h&&"halftone"!==h||(w=Math.PI/2+v);var x="agepyramid"===h?(this.agePyramidHeight?this.agePyramidHeight(c,e,i):e)/a:"radar"===h||"halftone"===h?2*Math.PI/a:void 0;if(void 0===x)throw new Error("Unexpected symbol type:"+h);for(var S=0,_=Object.entries(this.color);S<_.length;S++){var O=No(_[S],2),j=O[0],P=O[1];if("agepyramid"===h){n.ctx.fillStyle=P;var k=s*c[j]/d;n.ctx.fillRect(y+(e-k)/2,p+w,k,x),w+=x}else if("radar"===h){n.ctx.fillStyle=P;var E=c[j],C=s/2*Math.sqrt(E/d);n.ctx.beginPath(),n.ctx.moveTo(y,p),n.ctx.arc(y,p,C,w-x,w),n.ctx.lineTo(y,p),n.ctx.fill(),w+=x}else{if("halftone"!==h)throw new Error("Unexpected symbol type:"+h);n.ctx.fillStyle=P;var T=c[j],A=.333*s*Math.sqrt(T/d);n.ctx.beginPath(),n.ctx.arc(y+.25*e*Math.cos(w),p+.25*e*Math.sin(w),A,0,2*Math.PI),n.ctx.fill(),w+=x}}}else{for(var M=0,R=0,L=Object.keys(this.color);R<L.length;R++){var z=+c[L[R]];z&&(M+=z)}if(!M||isNaN(M))continue;for(var F=0,I=e*(1-s/e)*.5,N=this.stripesOrientation(c,e,i),B=0,D=Object.entries(this.color);B<D.length;B++){var G=No(D[B],2),Z=G[0],U=G[1],W=c[Z]/M;if(W&&!isNaN(W)){if(n.ctx.fillStyle=U,"flag"===h)0==N?n.ctx.fillRect(c.x+I+f.dx,c.y+I+F*s+f.dy,s,W*s):n.ctx.fillRect(c.x+I+F*s+f.dx,c.y+I+f.dy,W*s,s);else if("piechart"===h){var $=2*F*Math.PI,Y=2*(F+W)*Math.PI;n.ctx.beginPath(),n.ctx.moveTo(y,p),n.ctx.arc(y,p,.5*s,$+v,Y+v),this.pieChartInternalRadiusFactor&&n.ctx.arc(y,p,.5*s*this.pieChartInternalRadiusFactor,$+v,Y+v,!0),n.ctx.closePath(),n.ctx.fill()}else if("ring"===h)n.ctx.beginPath(),n.ctx.arc(y,p,Math.sqrt(1-F)*s*.5,0,2*Math.PI),n.ctx.fill();else{if("segment"!==h)throw new Error("Unexpected symbol type:"+h);var X=s*s/e;0==N?n.ctx.fillRect(c.x+f.dx,c.y+(e-X)/2+F*X+f.dy,e,W*X):n.ctx.fillRect(c.x+F*e+f.dx,c.y+(e-X)/2+f.dy,W*e,X)}F+=W}}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,r:e,zf:i,sSize:o})}}],n&&Go(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function $o(t){return $o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$o(t)}function Yo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Xo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==$o(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==$o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===$o(o)?o:String(o)),r)}var o}function Ho(t,e){return Ho=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ho(t,e)}function Vo(t){return Vo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vo(t)}var qo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ho(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Vo(r);if(o){var n=Vo(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===$o(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.orientation=t.orientation||function(){return 0},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.lengthCol=t.lengthCol,e.length=t.length,e.widthCol=t.widthCol,e.width=t.width,e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i,a,u=n.getZf();this.colorCol&&(o=bo.getStatistics(t,(function(t){return t[r.colorCol]}),!0)),this.lengthCol&&(t.sort((function(t,e){return e[r.lengthCol]-t[r.lengthCol]})),i=bo.getStatistics(t,(function(t){return t[r.lengthCol]}),!0)),this.widthCol&&(a=bo.getStatistics(t,(function(t){return t[r.widthCol]}),!0)),n.ctx.lineCap="butt";var l=Math.PI/180;n.setCanvasTransform();var c,s=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Yo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(s.s();!(c=s.n()).done;){var f=c.value,h=this.color?this.color(f[this.colorCol],e,o):void 0;if(h){var y=this.width?this.width(f[this.widthCol],e,a,u):void 0;if(y&&!(y<0)){var p=this.length?this.length(f[this.lengthCol],e,i,u):void 0;if(p&&!(p<0)){var v=this.orientation(f)*l;if(void 0!==v&&!isNaN(v)){var d=this.offset(f,e,u);n.ctx.strokeStyle=h,n.ctx.lineWidth=y;var m=f.x+e/2+d.dx,b=f.y+e/2+d.dy,g=.5*Math.cos(v)*p,w=.5*Math.sin(v)*p;n.ctx.beginPath(),n.ctx.moveTo(m-g,b-w),n.ctx.lineTo(m+g,b+w),n.ctx.stroke()}}}}}}catch(t){s.e(t)}finally{s.f()}this.updateLegends({style:this,r:e,zf:u,sColor:o,sLength:i,sWidth:a})}}])&&Xo(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function Ko(t){return Ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ko(t)}function Jo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Qo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ko(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ko(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ko(o)?o:String(o)),r)}var o}function ti(t,e){return ti=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ti(t,e)}function ei(t){return ei=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ei(t)}var ni=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ti(t,e)}(u,t);var e,n,r,o,i,a=(o=u,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ei(o);if(i){var n=ei(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ko(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function u(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),e=a.call(this,t),t=t||{},e.textCol=t.textCol,e.text=t.text||function(t,e,n,r){return"X"},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.fontSizeCol=t.fontSizeCol,e.fontSize=t.fontSize||function(t,e,n,r){return.8*e},e.fontFamily=t.fontFamily||"Arial",e.fontWeight=t.fontWeight||"bold",e}return e=u,r=[{key:"getCharLegendFun",value:function(t){var e=t.length;return function(n){return 0==n?"":1==n?t[e-1]:t[Math.floor(n*e)]}}}],(n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i,a,u=n.getZf();this.textCol&&(o=bo.getStatistics(t,(function(t){return t[r.textCol]}),!0)),this.colorCol&&(i=bo.getStatistics(t,(function(t){return t[r.colorCol]}),!0)),this.fontSizeCol&&(t.sort((function(t,e){return e[r.fontSizeCol]-t[r.fontSizeCol]})),a=bo.getStatistics(t,(function(t){return t[r.fontSizeCol]}),!0)),n.initCanvasTransform();var l,c=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Jo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(l=c.n()).done;){var s=l.value,f=this.text?this.text(s[this.textCol],e,o,u):void 0;if(null!=f&&null!=f&&f+""!=""){var h=this.color?this.color(s[this.colorCol],e,i,u):void 0;if(h){n.ctx.fillStyle=h;var y=this.fontSize(s[this.fontSizeCol],e,a,u)/u,p=this.fontFamily||"Arial",v=this.fontWeight||"bold";n.ctx.font=v+" "+y+"px "+p;var d=this.offset(s,e,u);n.ctx.textAlign="center";var m=n.geoToPixX(s.x+.5*e+d.dx),b=n.geoToPixY(s.y+.5*e+d.dy)+.3*y;n.ctx.fillText(f,m,b)}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:u,sColor:i})}}])&&Qo(e.prototype,n),r&&Qo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),u}(bo);function ri(t){return ri="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ri(t)}function oi(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ii(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ii(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ii(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ai(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ri(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ri(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===ri(o)?o:String(o)),r)}var o}function ui(t,e){return ui=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ui(t,e)}function li(t){return li=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},li(t)}var ci=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ui(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=li(r);if(o){var n=li(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ri(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.heightCol=t.heightCol,e.height=t.height,e.colorCol=t.colorCol,e.color=t.color||function(){return"#c08c59"},e.widthCol=t.widthCol,e.width=t.width||function(t,e){return.5*e},e.simple=null!=t.simple,e.viewHeightFactor=t.viewHeightFactor||1.5,e.viewSX=null==t.viewSX?0:t.viewSX,e.viewSY=null==t.viewSY?-.5:t.viewSY,e.shadowDirection=null==t.shadowDirection?-40.3*Math.PI/180:t.shadowDirection,e.shadowFactor=t.shadowFactor||.3,e.shadowColor=t.shadowColor||"#00000033",e.outlineCol=t.outlineCol||"#FFFFFF",e.outlineWidthPix=null==t.outlineWidthPix?.5:t.outlineWidthPix,e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i,a,u=n.getZf();this.heightCol&&(o=bo.getStatistics(t,(function(t){return t[r.heightCol]}),!0)),this.colorCol&&(i=bo.getStatistics(t,(function(t){return t[r.colorCol]}),!0)),this.widthCol&&(a=bo.getStatistics(t,(function(t){return t[r.widthCol]}),!0));var l=n.getCenter().x+this.viewSX*n.w*u,c=n.getCenter().y+this.viewSY*n.h*u,s=this.viewHeightFactor*(n.w+n.h)*.5*u;t.sort((function(t,e){return 1e8*(e.y-t.y)+t.x-e.x})),n.ctx.lineCap=this.simple?"butt":"round",n.setCanvasTransform(),n.ctx.strokeStyle=this.shadowColor,n.ctx.fillStyle=this.shadowColor;var f,h=oi(t);try{for(h.s();!(f=h.n()).done;){var y=f.value,p=this.width?this.width(y[this.widthCol],e,a,u):void 0;if(p&&!(p<0)){var v=this.height?this.height(y[this.heightCol],e,o,u):void 0;if(v&&!(v<0)){this.offset(y,e,u),n.ctx.lineWidth=p;var d=y.x+e/2,m=y.y+e/2,b=v*this.shadowFactor;n.ctx.beginPath(),n.ctx.moveTo(d,m),n.ctx.lineTo(d+b*Math.cos(this.shadowDirection),m+b*Math.sin(this.shadowDirection)),n.ctx.stroke()}}}}catch(t){h.e(t)}finally{h.f()}var g,w=oi(t);try{for(w.s();!(g=w.n()).done;){var x=g.value,S=this.color?this.color(x[this.colorCol],e,i):void 0;if(S){var _=this.width?this.width(x[this.widthCol],e,a,u):void 0;if(_&&!(_<0)){var O=this.height?this.height(x[this.heightCol],e,o,u):void 0;if(O&&!(O<0)){this.offset(x,e,u);var j=x.x+e/2,P=x.y+e/2,k=j-l,E=P-c,C=Math.atan2(E,k),T=Math.sqrt(k*k+E*E)*O/(s-O);this.simple?(n.ctx.strokeStyle=S,n.ctx.lineWidth=_,n.ctx.beginPath(),n.ctx.moveTo(j,P),n.ctx.lineTo(j+T*Math.cos(C),P+T*Math.sin(C)),n.ctx.stroke()):(n.ctx.strokeStyle=this.outlineCol,n.ctx.lineWidth=_+2*this.outlineWidthPix*u,n.ctx.beginPath(),n.ctx.moveTo(j,P),n.ctx.lineTo(j+T*Math.cos(C),P+T*Math.sin(C)),n.ctx.stroke(),n.ctx.strokeStyle=S,n.ctx.lineWidth=_,n.ctx.beginPath(),n.ctx.moveTo(j,P),n.ctx.lineTo(j+T*Math.cos(C),P+T*Math.sin(C)),n.ctx.stroke(),n.ctx.strokeStyle=this.outlineCol,n.ctx.lineWidth=this.outlineWidthPix*u,n.ctx.beginPath(),n.ctx.arc(j+T*Math.cos(C),P+T*Math.sin(C),.5*_,0,2*Math.PI,!1),n.ctx.stroke())}}}}}catch(t){w.e(t)}finally{w.f()}n.ctx.lineCap="butt",this.updateLegends({style:this,r:e,zf:u,sColor:i})}}])&&ai(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function si(t){return si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},si(t)}function fi(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return hi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function hi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function yi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==si(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==si(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===si(o)?o:String(o)),r)}var o}function pi(t,e){return pi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pi(t,e)}function vi(t){return vi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vi(t)}var di=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pi(t,e)}(u,t);var e,n,r,o,i,a=(o=u,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=vi(o);if(i){var n=vi(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===si(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function u(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),e=a.call(this,t),t=t||{},e.valueCol=t.valueCol,e.value=t.value||function(t,e,n,r,o){return 1},e.color=t.color||function(){return"#EA6BAC"},e.width=t.width||function(t,e,n,r){return e*t.value/5},e.orientation=t.orientation||0,e.fillColor=t.fillColor,e}return e=u,n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i=n.getZf();this.valueCol&&(o=bo.getStatistics(t,(function(t){return t[r.valueCol]}),!0));var a=[],l=.001*e;t.sort((function(t,e){return e.x==t.x?t.y-e.y:t.x-e.x}));for(var c=t[0],s=1;s<t.length;s++){var f=t[s];Math.abs(c.y+e-f.y)<=l&&Math.abs(c.x-f.x)<=l?a.push({x:c.x,y:f.y,or:"h",value:this.value(c[this.valueCol],f[this.valueCol],e,o,i)}):(a.push({x:c.x,y:c.y+e,or:"h",value:this.value(c[this.valueCol],void 0,e,o,i)}),a.push({x:f.x,y:f.y,or:"h",value:this.value(void 0,f[this.valueCol],e,o,i)})),c=f}t.sort((function(t,e){return e.y==t.y?t.x-e.x:t.y-e.y})),c=t[0];for(var h=1;h<t.length;h++){var y=t[h];Math.abs(c.x+e-y.x)<=l&&Math.abs(c.y-y.y)<=l?a.push({x:c.x+e,y:c.y,or:"v",value:this.value(c[this.valueCol],y[this.valueCol],e,o,i)}):(a.push({x:c.x+e,y:c.y,or:"v",value:this.value(c[this.valueCol],void 0,e,o,i)}),a.push({x:y.x,y:y.y,or:"v",value:this.value(void 0,y[this.valueCol],e,o,i)})),c=y}if(0!=a.length){var p=u.getSideStatistics(a,!0);if(n.setCanvasTransform(),this.fillColor){var v,d=fi(t);try{for(d.s();!(v=d.n()).done;){var m=v.value,b=this.fillColor(m);b&&"none"!=b&&(n.ctx.fillStyle=b,n.ctx.fillRect(m.x,m.y,e,e))}}catch(t){d.e(t)}finally{d.f()}}n.ctx.lineCap="butt";for(var g=e/2,w=0,x=a;w<x.length;w++){var S=x[w],_=this.color?this.color(S,e,p,i):void 0;if(_&&"none"!=_){var O=this.width?this.width(S,e,p,i):void 0;!O||O<=0||(n.ctx.strokeStyle=_,n.ctx.lineWidth=O,n.ctx.beginPath(),90==this.orientation?(n.ctx.moveTo(S.x+g,S.y+g),"h"===S.or?n.ctx.lineTo(S.x+g,S.y-g):n.ctx.lineTo(S.x-g,S.y+g)):(n.ctx.moveTo(S.x,S.y),n.ctx.lineTo(S.x+("h"===S.or?e:0),S.y+("v"===S.or?e:0))),n.ctx.stroke())}}this.updateLegends({style:this,r:e,zf:i})}}}],r=[{key:"getSideStatistics",value:function(t,e){if(t&&0!=t.length){var n,r=1/0,o=-1/0,i=fi(t);try{for(i.s();!(n=i.n()).done;){var a=n.value.value;e&&!a||(a<r&&(r=a),a>o&&(o=a))}}catch(t){i.e(t)}finally{i.f()}return{min:r,max:o}}}}],n&&yi(e.prototype,n),r&&yi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),u}(bo);function mi(t){return mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mi(t)}function bi(t,e){return bi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bi(t,e)}function gi(t){return gi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},gi(t)}var wi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&bi(t,e)}(i,t);var e,n,r,o=(n=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=gi(n);if(r){var o=gi(this).constructor;t=Reflect.construct(e,arguments,o)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===mi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function i(t){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),(t=t||{}).breaks=t.breaks||[100,1e3,1e4,1e5,1e6],t.width=t.width||function(){return 1},t.color=t.color||function(){return"#E7A935"};var n=function(e){if(null==e)return 0;for(var n=0;n<t.breaks.length;n++)if(e<t.breaks[n])return n;return t.breaks.length};return e.value=function(t,e,r,o,i){return Math.abs(n(e)-n(t))},e.color=function(e,n,r,o){return e.value?t.color(e,n,o):void 0},e.width=function(e,n,r,o){return e.value*o*t.width(e,n,o)},e}return e=i,Object.defineProperty(e,"prototype",{writable:!1}),e}(di);function xi(t){return xi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xi(t)}function Si(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function _i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==xi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==xi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===xi(o)?o:String(o)),r)}var o}function Oi(t,e){return Oi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Oi(t,e)}function ji(t){return ji=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ji(t)}var Pi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Oi(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ji(r);if(o){var n=ji(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===xi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.col=t.col,e.color=t.color,e.width=t.width||function(t,e,n){return.2*e},e.fillColor=t.fillColor,e}return e=a,(n=[{key:"draw",value:function(t,e,n){if(this.filter&&(t=t.filter(this.filter)),t&&0!=t.length){var r=n.getZf(),o=[];t.sort((function(t,e){return e.x==t.x?t.y-e.y:t.x-e.x}));for(var i=t[0],a=i[this.col],u=1;u<t.length;u++){var l=t[u],c=l[this.col];i.y+e==l.y&&i.x==l.x?a!=c&&o.push({x:i.x,y:l.y,or:"h",v1:a,v2:c}):(o.push({x:i.x,y:i.y+e,or:"h",v1:a,v2:void 0}),o.push({x:l.x,y:l.y,or:"h",v1:void 0,v2:c})),i=l,a=c}t.sort((function(t,e){return e.y==t.y?t.x-e.x:t.y-e.y})),a=(i=t[0])[this.col];for(var s=1;s<t.length;s++){var f=t[s],h=f[this.col];i.x+e==f.x&&i.y==f.y?a!=h&&o.push({x:i.x+e,y:i.y,or:"v",v1:a,v2:h}):(o.push({x:i.x+e,y:i.y,or:"v",v1:a,v2:void 0}),o.push({x:f.x,y:f.y,or:"v",v1:void 0,v2:h})),i=f,a=h}if(0!=o.length){if(n.setCanvasTransform(),this.fillColor){var y,p=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Si(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Si(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(p.s();!(y=p.n()).done;){var v=y.value,d=this.fillColor(v);d&&"none"!=d&&(n.ctx.fillStyle=d,n.ctx.fillRect(v.x,v.y,e,e))}}catch(t){p.e(t)}finally{p.f()}}n.ctx.lineCap="butt";for(var m=0,b=o;m<b.length;m++){var g=b[m],w=this.width?this.width(g,e,r):void 0;if(w&&!(w<=0)){var x=.5*w;n.ctx.lineWidth=w,"h"===g.or?(g.v2&&(n.ctx.beginPath(),n.ctx.strokeStyle=this.color[g.v2],n.ctx.moveTo(g.x,g.y+x),n.ctx.lineTo(g.x+e,g.y+x),n.ctx.stroke()),g.v1&&(n.ctx.beginPath(),n.ctx.strokeStyle=this.color[g.v1],n.ctx.moveTo(g.x,g.y-x),n.ctx.lineTo(g.x+e,g.y-x),n.ctx.stroke())):(g.v2&&(n.ctx.beginPath(),n.ctx.strokeStyle=this.color[g.v2],n.ctx.moveTo(g.x+x,g.y),n.ctx.lineTo(g.x+x,g.y+e),n.ctx.stroke()),g.v1&&(n.ctx.beginPath(),n.ctx.strokeStyle=this.color[g.v1],n.ctx.moveTo(g.x-x,g.y),n.ctx.lineTo(g.x-x,g.y+e),n.ctx.stroke()))}}this.updateLegends({style:this,r:e,zf:r})}}}}])&&_i(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);const ki=function t(e){function n(t,n){var r,o;return t=null==t?0:+t,n=null==n?1:+n,function(){var i;if(null!=r)i=r,r=null;else do{r=2*e()-1,i=2*e()-1,o=r*r+i*i}while(!o||o>1);return t+n*i*Math.sqrt(-2*Math.log(o)/o)}}return n.source=t,n}(Math.random);function Ei(t,e,n){var r=document.createElement("canvas");r.setAttribute("width",t),r.setAttribute("height",e);var o=r.getContext("webgl",n);if(!o)throw new Error("Unable to initialize WebGL. Your browser or machine may not support it.");return{canvas:r,gl:o}}function Ci(t){var e=t.createProgram();if(null==e)throw new Error("Cannot create webGL program");for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];for(var i=0,a=r;i<a.length;i++){var u=a[i];t.attachShader(e,u)}if(t.linkProgram(e),t.getProgramParameter(e,t.LINK_STATUS))return e;throw new Error(t.getProgramInfoLog(e)||"Cannot create webGL program (2)")}function Ti(t,e){var n=t.createShader(e);if(null==n)throw new Error("Cannot create webGL shader");for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];if(t.shaderSource(n,o.join("\n")),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS))return n;throw new Error(t.getShaderInfoLog(n)||"Cannot create webGL shader (2)")}function Ai(t){return Ai="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ai(t)}function Mi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ai(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ai(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ai(o)?o:String(o)),r)}var o}var Ri=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gl=e,this.sizePix=n||10,this.program=Ci(e,Ti(e,e.VERTEX_SHADER,"\n attribute vec2 pos;\n uniform float sizePix;\n uniform mat3 mat;\n attribute vec4 color;\n varying vec4 vColor;\n void main() {\n gl_Position = vec4(mat * vec3(pos, 1.0), 1.0);\n gl_PointSize = sizePix;\n vColor = color;\n }\n "),Ti(e,e.FRAGMENT_SHADER,"\n precision mediump float;\n varying vec4 vColor;\n void main(void) {\n vec4 vColor_ = vColor / 255.0;\n vColor_[3] = 255.0 * vColor_[3];\n gl_FragColor = vColor_;\n }")),e.useProgram(this.program),this.verticesBuffer=[],this.colorsBuffer=[]}var e,n;return e=t,(n=[{key:"addPointData",value:function(t,e,n){var r=Me(n);r&&(this.verticesBuffer.push(t,e),this.colorsBuffer.push(r.r,r.g,r.b,r.opacity))}},{key:"addPointData2",value:function(t,e,n,r,o,i){this.verticesBuffer.push(t,e),this.colorsBuffer.push(n,r,o,i)}},{key:"draw",value:function(t){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,e.createBuffer()),e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.verticesBuffer),e.STATIC_DRAW);var n=e.getAttribLocation(this.program,"pos");e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n),e.bindBuffer(e.ARRAY_BUFFER,e.createBuffer()),e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.colorsBuffer),e.STATIC_DRAW);var r=e.getAttribLocation(this.program,"color");e.vertexAttribPointer(r,4,e.FLOAT,!1,0,0),e.enableVertexAttribArray(r),e.uniform1f(e.getUniformLocation(this.program,"sizePix"),1*this.sizePix),e.uniformMatrix3fv(e.getUniformLocation(this.program,"mat"),!1,new Float32Array(t)),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.POINTS,0,this.verticesBuffer.length/2)}}])&&Mi(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Li(t){return Li="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Li(t)}function zi(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Fi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Fi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ii(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Li(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Li(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Li(o)?o:String(o)),r)}var o}function Ni(t,e){return Ni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ni(t,e)}function Bi(t){return Bi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bi(t)}var Di=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ni(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Bi(r);if(o){var n=Bi(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Li(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.nbCol=t.nbCol,e.nb=t.nb||function(t,e,n,r){return.3*e*e/(r*r)*t/n.max},e.color=t.color||function(){return"#FF5733"},e.dotSize=t.dotSize,e.sigma=t.sigma,e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i=n.getZf();if(this.nbCol&&(o=bo.getStatistics(t,(function(t){return t[r.nbCol]}),!0)),o){var a=this.dotSize?this.dotSize(e,i):2*i,u=this.sigma?this.sigma(e,i):.4*e,l=ki(0,u);if(function(){try{var t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(t){return!1}}()){var c=Ei(n.w+"",n.h+"");if(!c)return void console.error("No webGL");var s,f,h,y,p,v,d,m=new Ri(c.gl,a/i),b=e/2,g=zi(t);try{for(g.s();!(d=g.n()).done;){var w=d.value;if((s=this.color(w))&&"none"!==s){if(f=this.offset(w,e,i),h=this.nb(w[this.nbCol],e,o,i),y=w.x+f.dx+b,p=w.y+f.dy+b,!(v=Me(s)))return;for(var x=0;x<=h;x++)m.addPointData2(y+l(),p+l(),v.r,v.g,v.b,v.opacity)}}}catch(t){g.e(t)}finally{g.f()}m.draw(n.getWebGLTransform()),n.initCanvasTransform(),n.ctx.drawImage(c.canvas,0,0)}else{n.setCanvasTransform();var S,_=zi(t);try{for(_.s();!(S=_.n()).done;){var O=S.value,j=this.color(O);if(j&&"none"!==j){n.ctx.fillStyle=j;for(var P=this.offset(O,e,i),k=this.nb(O[this.nbCol],e,o,i),E=O.x+P.dx+e/2,C=O.y+P.dy+e/2,T=0;T<=k;T++)n.ctx.fillRect(E+l(),C+l(),a,a)}}}catch(t){_.e(t)}finally{_.f()}}this.updateLegends({style:this,r:e,zf:i})}}}])&&Ii(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function Gi(t){return Gi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gi(t)}function Zi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Gi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Gi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Gi(o)?o:String(o)),r)}var o}var Ui=function(){function t(e,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gl=e;var a=Ti(e,e.VERTEX_SHADER,"\n attribute vec2 pos;\n uniform float sizePix;\n uniform mat3 mat;\n\n attribute float t;\n varying float vt;\n\n void main() {\n gl_Position = vec4(mat * vec3(pos, 1.0), 1.0);\n gl_PointSize = sizePix;\n vt = t;\n }\n "),u="precision mediump float;\nvarying float vt;\nuniform float alpha;\n"+function(){for(var t=[],e=0;e<n.length;e++)t.push("uniform vec4 c"+e+";\n");return t.join("")}()+"void main(void) {\n";if(r?"pow"==r.fun?u+=" float t = pow(vt, alpha);\n":"powRev"==r.fun?u+=" float t = 1.0-pow(1.0-vt, 1.0/alpha);\n":"exp"==r.fun?u+=0==r.alpha?"float t = vt;":" float t = (exp(vt * alpha) - 1.0) / (exp(alpha) - 1.0);\n":"expRev"==r.fun?u+=0==r.alpha?"float t = vt;":" float t = 1.0 - (1.0 / alpha) * log(exp(alpha) * (1.0 - vt) + vt);\n":"circleLow"==r.fun?0==r.alpha?u+=" float t = vt;\n":1==r.alpha?u+=" float t = sqrt(vt * (2.0 - vt));\n":u+=" float a = alpha / (1.0 - alpha);\n float t = sqrt(1.0 / (a * a) + vt * ( 2.0/a + 2.0 - vt )) - 1.0 / a;\n":"circleHigh"==r.fun?0==r.alpha?u+=" float t = vt;\n":1==r.alpha?u+=" float t = 1.0 - sqrt((1.0 - vt) * (1.0 + vt));\n":u+=" float a = alpha / (1.0 - alpha);\n float t = 1.0 - sqrt(1.0 / (a * a) + (1.0-vt) * ( 2.0/a + 1.0 + vt )) + 1.0 / a;\n":(console.error("Unexpected stretching function code: "+r.fun),u+=" float t = vt;\n"):u+=" float t = vt;\n",1==n.length)u+=" vec4 cI=c0;\n vec4 cF=c0;\n";else if(2==n.length)u+=" vec4 cI=c0;\n vec4 cF=c1;\n";else{var l=n.length-1,c=l+".0";u+=" vec4 cI;\n",u+=" vec4 cF;\n",u+=" if(t<1.0/"+c+") { cI=c0; cF=c1; t=t*"+c+"; }\n";for(var s=2;s<l;s++)u+=" else if(t<"+s+".0/"+c+") { cI=c"+(s-1)+"; cF=c"+s+"; t="+c+"*t-"+(s-1)+".0; }\n";u+=" else { cI=c"+(l-1)+"; cF=c"+l+"; t="+c+"*t-"+(l-1)+".0; }\n"}1==n.length?u+=" gl_FragColor = vec4(c0[0], c0[1], c0[2], c0[3]);}\n":u+=" gl_FragColor = mix(cI, cF, t);}\n";var f=Ti(e,e.FRAGMENT_SHADER,u);this.program=Ci(e,a,f),e.useProgram(this.program),e.uniform1f(e.getUniformLocation(this.program,"sizePix"),1*o),e.uniform1f(e.getUniformLocation(this.program,"alpha"),r?1*r.alpha:0);for(var h=0;h<n.length;h++){var y=Me(n[h]),p=y.opacity;1==y.opacity&&null!=i&&(p=i),e.uniform4fv(e.getUniformLocation(this.program,"c"+h),[+y.r/255,+y.g/255,+y.b/255,+p])}}var e,n;return e=t,(n=[{key:"draw",value:function(t,e,n){var r=this.gl,o=this.program;r.bindBuffer(r.ARRAY_BUFFER,r.createBuffer()),r.bufferData(r.ARRAY_BUFFER,new Float32Array(t),r.STATIC_DRAW);var i=r.getAttribLocation(o,"pos");r.vertexAttribPointer(i,2,r.FLOAT,!1,0,0),r.enableVertexAttribArray(i),r.bindBuffer(r.ARRAY_BUFFER,r.createBuffer()),r.bufferData(r.ARRAY_BUFFER,new Float32Array(e),r.STATIC_DRAW);var a=r.getAttribLocation(o,"t");r.vertexAttribPointer(a,1,r.FLOAT,!1,0,0),r.enableVertexAttribArray(a),r.uniformMatrix3fv(r.getUniformLocation(o,"mat"),!1,new Float32Array(n)),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.POINTS,0,t.length/2)}}])&&Zi(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Wi(t){return Wi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wi(t)}function $i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Yi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Wi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Wi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Wi(o)?o:String(o)),r)}var o}function Xi(t,e){return Xi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xi(t,e)}function Hi(t){return Hi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Hi(t)}var Vi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Xi(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Hi(r);if(o){var n=Hi(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Wi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorCol=t.colorCol,e.tFun=t.tFun||function(t,e,n){return t/n.max},e.stretching=t.stretching,e.colors=t.colors||["rgb(158, 1, 66)","rgb(248, 142, 83)","rgb(251, 248, 176)","rgb(137, 207, 165)","rgb(94, 79, 162)"].reverse(),t.color&&(e.colors=[t.color(0),t.color(.2),t.color(.4),t.color(.6),t.color(.8),t.color(1)]),e.opacity=t.opacity,e.size=t.size,e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o=n.getZf(),i=bo.getStatistics(t,(function(t){return t[r.colorCol]}),!0);if(i){var a=Ei(n.w+"",n.h+"",null!=this.opacity?{premultipliedAlpha:!1}:void 0);if(a){var u,l=e/2,c=[],s=[],f=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return $i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$i(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(f.s();!(u=f.n()).done;){var h=u.value,y=this.tFun(h[this.colorCol],e,i);null!=y&&null!=y&&(c.push(h.x+l,h.y+l),s.push(y>1?1:y<0?0:y))}}catch(t){f.e(t)}finally{f.f()}var p=this.size?this.size(e,o):e+.2*o,v=this.opacity?this.opacity(e,o):void 0;new Ui(a.gl,this.colors,this.stretching,p/o,v).draw(c,s,n.getWebGLTransform()),n.initCanvasTransform(),n.ctx.drawImage(a.canvas,0,0),this.updateLegends({style:this,r:e,zf:o,sColor:i})}else console.error("No webGL")}}}])&&Yi(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function qi(t){return qi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qi(t)}function Ki(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==qi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==qi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===qi(o)?o:String(o)),r)}var o}var Ji=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n;return e=t,n=[{key:"get",value:function(t,e){if(null!=(e=e||{}).nb){e.nb<2&&(console.error("unexpected number of colors in tanaka (<2): "+e.nb),e.nb=2),e.color||(console.error("color function not defined in tanaka"),e.color=function(){return"gray"}),e.colors=[];for(var n=0;n<e.nb;n++)e.colors.push(e.color(n/(e.nb-1)))}e.colors=e.colors||["#a9bb9e","#c9dcaa","#fde89f","#f9a579","#eb444b"];var r=e.colors.length;e.tFun=e.tFun||function(t,e,n){return(t-n.min)/(n.max-n.min)},e.colDark=e.colDark||"#111",e.colBright=e.colBright||"#ddd",e.widthFactor=e.widthFactor||.08,e.newShading=e.newShading,e.newShadingWidthPix=e.newShadingWidthPix||2,e.newShadingTr=e.newShadingTr||function(t,e){return Math.abs(t)/Math.max(Math.abs(e.min),Math.abs(e.max))};var o=function(t){if(isNaN(t)||null==t)return console.error("Unexpected t value 1: "+t),-9;for(var e=0;e<r;e++)if(t<=(e+1)/r)return e;return console.error("Unexpected t value 2: "+t),-9};return[new Vi({colorCol:t,colors:e.colors,tFun:function(t,n,i){var a=e.tFun(t,n,i);return o(a)/(r-1)},size:function(t,e){return t+.5*e},filter:e.filter}),new di({valueCol:t,value:function(t,n,r,i,a){if(void 0===t&&void 0===n)return 0;if(void 0===n){var u=e.tFun(t,r,i);if(null==u||isNaN(u))throw new Error("Unexpected value: "+t+" - "+u);return o(u)+1}if(void 0===t){var l=e.tFun(n,r,i);if(null==l||isNaN(l))throw new Error("Unexpected value: "+n+" - "+l);return-o(l)-1}var c=e.tFun(t,r,i);if(null==c||isNaN(c))throw new Error("Unexpected value: "+t+" - "+c);var s=e.tFun(n,r,i);if(null==s||isNaN(s))throw new Error("Unexpected value: "+n+" - "+s);var f=o(c);return-o(s)+f},color:e.newShading?function(t,n,r,o){var i=e.newShadingTr(t.value,r);return t.value>0&&"h"===t.or||t.value<0&&"v"===t.or?"rgba(255,255,100,"+i+")":"rgba(0,0,0,"+i+")"}:function(t,n,r,o){if(0!==t.value)return"v"===t.or?t.value<0?e.colBright:e.colDark:t.value<0?e.colDark:e.colBright},width:e.newShading?function(t,n,r,o){return e.newShadingWidthPix*o}:function(t,n,r,o){return e.widthFactor*n*Math.abs(t.value)*("v"===t.or?.5:1)},filter:e.filter})]}}],null&&Ki(e.prototype,null),n&&Ki(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Qi(t){return Qi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qi(t)}function ta(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Qi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Qi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Qi(o)?o:String(o)),r)}var o}var ea=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.colors=e,this.vshString="\n attribute vec2 pos;\n uniform float sizePix;\n uniform mat3 mat;\n\n attribute float i;\n varying float vi;\n\n void main() {\n gl_Position = vec4(mat * vec3(pos, 1.0), 1.0);\n gl_PointSize = sizePix;\n vi = i;\n }\n ";var n=[];n.push("precision mediump float;\nvarying float vi;\n"),n.push("uniform vec4");for(var r=0;r<e.length;r++)r>0&&n.push(","),n.push(" c"+r);n.push(";\n"),n.push("void main(void) {\n");for(var o=0;o<e.length;o++)o>0&&n.push("else "),n.push("if(vi=="),n.push(o),n.push(".0) gl_FragColor = vec4(c"),n.push(o),n.push("[0], c"),n.push(o),n.push("[1], c"),n.push(o),n.push("[2], c"),n.push(o),n.push("[3]);\n");n.push("else gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n}"),this.fshString=n.join("")}var e,n;return e=t,n=[{key:"draw",value:function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,i=Ci(t,Ti(t,t.VERTEX_SHADER,this.vshString),Ti(t,t.FRAGMENT_SHADER,this.fshString));t.useProgram(i),t.uniform1f(t.getUniformLocation(i,"sizePix"),1*o);for(var a=0;a<this.colors.length;a++){var u=Me(this.colors[a]);t.uniform4fv(t.getUniformLocation(i,"c"+a),[+u.r/255,+u.g/255,+u.b/255,+u.opacity])}t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bufferData(t.ARRAY_BUFFER,new Float32Array(e),t.STATIC_DRAW);var l=t.getAttribLocation(i,"pos");t.vertexAttribPointer(l,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(l),t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bufferData(t.ARRAY_BUFFER,new Float32Array(n),t.STATIC_DRAW);var c=t.getAttribLocation(i,"i");t.vertexAttribPointer(c,1,t.FLOAT,!1,0,0),t.enableVertexAttribArray(c),t.uniformMatrix3fv(t.getUniformLocation(i,"mat"),!1,new Float32Array(r)),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.POINTS,0,e.length/2)}}],n&&ta(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function na(t){return na="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},na(t)}function ra(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==na(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==na(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===na(o)?o:String(o)),r)}var o}function oa(t,e){return oa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},oa(t,e)}function ia(t){return ia=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ia(t)}var aa=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&oa(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ia(r);if(o){var n=ia(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===na(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorCol=t.colorCol,t.color=t.color||void 0;var n=Object.keys(t.color);e.catToI={};for(var r=0;r<n.length;r++)e.catToI[n[r]]=r+"";e.colors=[];for(var o=0;o<n.length;o++)e.colors.push(t.color[""+n[o]]);return e.size=t.size,e.wgp=new ea(e.colors),e}return e=a,(n=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));for(var r,o=n.getZf(),i=e/2,a=t.length,u=[],l=[],c=0;c<a;c++){var s=(r=t[c])[this.colorCol];if(null!=s){var f=this.catToI[s];isNaN(+f)?console.log("Unexpected category index: "+s+" "+f):(u.push(r.x+i,r.y+i),l.push(+f))}else console.log("Unexpected category: "+s)}var h=Ei(n.w+"",n.h+"");if(h){var y=this.size?this.size(e,o):e+.2*o;this.wgp.draw(h.gl,u,l,n.getWebGLTransform(),y/o),n.initCanvasTransform(),n.ctx.drawImage(h.canvas,0,0),this.updateLegends({style:this,r:e,zf:o})}else console.error("No webGL")}}])&&ra(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function ua(t){return ua="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ua(t)}function la(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ca(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ca(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ca(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function sa(t,e){return sa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},sa(t,e)}function fa(t){return fa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fa(t)}function ha(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ya(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ua(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ua(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===ua(o)?o:String(o)),r)}var o}function pa(t,e,n){return e&&ya(t.prototype,e),n&&ya(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var va=function(){function t(){ha(this,t)}return pa(t,null,[{key:"get",value:function(t,e){(e=e||{}).colors=e.colors||["#00852b","#afd246","#fac80a","#bb805a","#d67923","#cb4e29","#b40000","#720012"],e.colDark=e.colDark||"#333",e.colBright=e.colBright||"#aaa",e.widthFactor=e.widthFactor||.12;var n=Ji.get(t,e),r=new To({strokeColor:function(){return"#666"},strokeWidth:function(t,e,n,r){return.2*r},filter:e.filter});return[n[0],r,n[1],new da({colDark:e.colDark,colBright:e.colBright,filter:e.filter})]}},{key:"getCat",value:function(t,e){return(e=e||{}).colDark=e.colDark||"#333",e.colBright=e.colBright||"#aaa",[new aa({colorCol:t,color:e.color}),new To({strokeColor:function(){return"#666"},strokeWidth:function(t,e,n,r){return.2*r}}),new da({colDark:e.colDark,colBright:e.colBright})]}}]),t}(),da=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&sa(t,e)}(o,t);var e,n,r=(e=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=fa(e);if(n){var o=fa(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return function(t,e){if(e&&("object"===ua(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function o(t){var e;return ha(this,o),e=r.call(this,t),t=t||{},e.colDark=t.colDark||"#333",e.colBright=t.colBright||"#aaa",e}return pa(o,[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter)),n.ctx.lineWidth=.6*n.getZf(),n.ctx.strokeStyle=this.colDark;var r,o=la(t);try{for(o.s();!(r=o.n()).done;){var i=r.value;n.ctx.beginPath(),n.ctx.arc(i.x+.5*e,i.y+.5*e,.55*e*.5,Math.PI/4,-Math.PI*(3/4),!0),n.ctx.stroke()}}catch(t){o.e(t)}finally{o.f()}n.ctx.strokeStyle=this.colBright;var a,u=la(t);try{for(u.s();!(a=u.n()).done;){var l=a.value;n.ctx.beginPath(),n.ctx.arc(l.x+.5*e,l.y+.5*e,.55*e*.5,Math.PI/4,-Math.PI*(3/4),!1),n.ctx.stroke()}}catch(t){u.e(t)}finally{u.f()}}}]),o}(bo);function ma(t){return ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ma(t)}function ba(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ga(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ma(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ma(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===ma(o)?o:String(o)),r)}var o}function wa(t,e){return wa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wa(t,e)}function xa(t){return xa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xa(t)}var Sa=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wa(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=xa(r);if(o){var n=xa(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ma(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.mosaicFactor=t.mosaicFactor||.15,e.shadowFactor=t.shadowFactor||.2,e.shadowColor=t.shadowColor||"#555",e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i=n.getZf();this.colorCol&&(o=bo.getStatistics(t,(function(t){return t[r.colorCol]}),!0)),n.ctx.strokeStyle=this.shadowColor,n.ctx.lineWidth=this.shadowFactor*e,n.ctx.lineJoin="round",n.ctx.lineCap="butt";var a=e*this.mosaicFactor,u=function(){return{x:Math.random()*a,y:Math.random()*a}};n.setCanvasTransform();var l,c=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ba(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ba(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(l=c.n()).done;){var s=l.value,f=this.color?this.color(s[this.colorCol],e,o):void 0;if(f&&"none"!==f){n.ctx.fillStyle=f;var h=this.offset(s,e,i),y=u(),p=u(),v=u(),d=u();this.shadowFactor>0&&(n.ctx.beginPath(),n.ctx.moveTo(s.x+h.dx+y.x,s.y+h.dy+y.y),n.ctx.lineTo(s.x+h.dx+e-v.x,s.y+h.dy+v.y),n.ctx.lineTo(s.x+h.dx+e-d.x,s.y+h.dy+e-d.y),n.ctx.stroke()),n.ctx.beginPath(),n.ctx.moveTo(s.x+h.dx+y.x,s.y+h.dy+y.y),n.ctx.lineTo(s.x+h.dx+e-v.x,s.y+h.dy+v.y),n.ctx.lineTo(s.x+h.dx+e-d.x,s.y+h.dy+e-d.y),n.ctx.lineTo(s.x+h.dx+p.x,s.y+h.dy+e-p.y),n.ctx.fill()}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:i,sColor:o})}}])&&ga(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function _a(t){return _a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_a(t)}function Oa(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ja(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==_a(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==_a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===_a(o)?o:String(o)),r)}var o}function Pa(t,e){return Pa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pa(t,e)}function ka(t){return ka=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ka(t)}var Ea=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pa(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ka(r);if(o){var n=ka(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===_a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.sizeCol=t.sizeCol,e.size=t.size,e.shape=t.shape||function(){return"o"},e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i,a=n.getZf();this.sizeCol&&(t.sort((function(t,e){return e[r.sizeCol]-t[r.sizeCol]})),o=bo.getStatistics(t,(function(t){return t[r.sizeCol]}),!0)),this.colorCol&&(i=bo.getStatistics(t,(function(t){return t[r.colorCol]}),!0)),n.setCanvasTransform();var u,l=.5*e,c=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Oa(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Oa(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(u=c.n()).done;){var s=u.value,f=this.color?this.color(s[this.colorCol],e,i,a):void 0;if(f&&"none"!==f){n.ctx.fillStyle=f;var h=this.shape?this.shape(s):"o";if("none"!==h){var y=(this.size||function(){return.5})(s[this.sizeCol],e,o,a)*l,p=(this.offset(s,e,a),s.x+l),v=s.y+l;if("p"===h)n.ctx.beginPath(),n.ctx.moveTo(p,v+l),n.ctx.lineTo(p+y,v+y),n.ctx.lineTo(p+l,v),n.ctx.lineTo(p+y,v-y),n.ctx.lineTo(p,v-l),n.ctx.lineTo(p-y,v-y),n.ctx.lineTo(p-l,v),n.ctx.lineTo(p-y,v+y),n.ctx.fill();else{if("o"!==h)throw new Error("Unexpected shape:"+h);n.ctx.beginPath(),n.ctx.moveTo(p,v+y),n.ctx.lineTo(p+l,v+l),n.ctx.lineTo(p+y,v),n.ctx.lineTo(p+l,v-l),n.ctx.lineTo(p,v-y),n.ctx.lineTo(p-l,v-l),n.ctx.lineTo(p-y,v),n.ctx.lineTo(p-l,v+l),n.ctx.fill()}}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:a,sSize:o,sColor:i})}}])&&ja(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(bo);function Ca(t){return Ca="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ca(t)}function Ta(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ca(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ca(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ca(o)?o:String(o)),r)}var o}var Aa=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.id=e.id,this.top=e.top,this.bottom=e.bottom,this.left=e.left,this.right=e.right,this.background=e.background||"none",this.padding=e.padding||"5px",this.border=e.border||"0px",this["border-radius"]=e["border-radius"]||"none",this["box-shadow"]=e["box-shadow"]||"none",this["font-family"]=e["font-family"]||"Helvetica, Arial, sans-serif",this.width=e.width,this.height=e.height,this.id&&(this.div=pt("#"+this.id)),this.div&&!this.div.empty()||(this.div=pt(document.createElement("div")),this.id&&this.div.attr("id",this.id)),this.div.style("background",this.background),this.div.style("padding",this.padding),this.div.style("border",this.border),this.div.style("border-radius",this["border-radius"]),this.div.style("box-shadow",this["box-shadow"]),this.div.style("font-family",this["font-family"]),this.width&&this.div.style("width",this.width),this.height&&this.div.style("height",this.height)}var e,n;return e=t,(n=[{key:"style",value:function(t,e){return this.div.style(t,e),this}},{key:"update",value:function(t){console.error("Legend update not implemented yet.")}}])&&Ta(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ma(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}var Ra,La=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function za(t){if(!(e=La.exec(t)))throw new Error("invalid format: "+t);var e;return new Fa({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Fa(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Ia(t,e){var n=Ma(t,e);if(!n)return t+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}za.prototype=Fa.prototype,Fa.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Na={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Ia(100*t,e),r:Ia,s:function(t,e){var n=Ma(t,e);if(!n)return t+"";var r=n[0],o=n[1],i=o-(Ra=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=r.length;return i===a?r:i>a?r+new Array(i-a+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+Ma(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Ba(t){return t}var Da,Ga,Za=Array.prototype.map,Ua=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Wa(t){return Da=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?Ba:(e=Za.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var o=t.length,i=[],a=0,u=e[0],l=0;o>0&&u>0&&(l+u+1>r&&(u=Math.max(1,r-l)),i.push(t.substring(o-=u,o+u)),!((l+=u+1)>r));)u=e[a=(a+1)%e.length];return i.reverse().join(n)}),o=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?Ba:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Za.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",s=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=za(t)).fill,n=t.align,f=t.sign,h=t.symbol,y=t.zero,p=t.width,v=t.comma,d=t.precision,m=t.trim,b=t.type;"n"===b?(v=!0,b="g"):Na[b]||(void 0===d&&(d=12),m=!0,b="g"),(y||"0"===e&&"="===n)&&(y=!0,e="0",n="=");var g="$"===h?o:"#"===h&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",w="$"===h?i:/[%p]/.test(b)?l:"",x=Na[b],S=/[defgprs%]/.test(b);function _(t){var o,i,l,h=g,_=w;if("c"===b)_=x(t)+_,t="";else{var O=(t=+t)<0||1/t<0;if(t=isNaN(t)?s:x(Math.abs(t),d),m&&(t=function(t){t:for(var e,n=t.length,r=1,o=-1;r<n;++r)switch(t[r]){case".":o=e=r;break;case"0":0===o&&(o=r),e=r;break;default:if(!+t[r])break t;o>0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t}(t)),O&&0==+t&&"+"!==f&&(O=!1),h=(O?"("===f?f:c:"-"===f||"("===f?"":f)+h,_=("s"===b?Ua[8+Ra/3]:"")+_+(O&&"("===f?")":""),S)for(o=-1,i=t.length;++o<i;)if(48>(l=t.charCodeAt(o))||l>57){_=(46===l?a+t.slice(o+1):t.slice(o))+_,t=t.slice(0,o);break}}v&&!y&&(t=r(t,1/0));var j=h.length+t.length+_.length,P=j<p?new Array(p-j+1).join(e):"";switch(v&&y&&(t=r(P+t,P.length?p-_.length:1/0),P=""),n){case"<":t=h+t+_+P;break;case"=":t=h+P+t+_;break;case"^":t=P.slice(0,j=P.length>>1)+h+t+_+P.slice(j);break;default:t=P+h+t+_}return u(t)}return d=void 0===d?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),_.toString=function(){return t+""},_}return{format:f,formatPrefix:function(t,e){var n,r=f(((t=za(t)).type="f",t)),o=3*Math.max(-8,Math.min(8,Math.floor((n=e,((n=Ma(Math.abs(n)))?n[1]:NaN)/3)))),i=Math.pow(10,-o),a=Ua[8+o/3];return function(t){return r(i*t)+a}}}}(t),Ga=Da.format,Da.formatPrefix,Da}function $a(t){return $a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$a(t)}function Ya(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==$a(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==$a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===$a(o)?o:String(o)),r)}var o}function Xa(t,e){return Xa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xa(t,e)}function Ha(t){return Ha=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ha(t)}Wa({thousands:",",grouping:[3],currency:["$",""]});var Va=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Xa(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ha(r);if(o){var n=Ha(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===$a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorRamp=t.colorRamp,e.fun=t.fun,e.title=t.title,e.tickSize=t.tickSize||6,e.width=t.width||300,e.height=t.height||15,e.margin=t.margin||5,e.ticks=t.ticks||Math.floor(e.width/50),e.tickFormat=t.tickFormat||",.0f",e.tickUnit=t.tickUnit,e.fontSize=t.fontSize||"0.8em",e.invert=t.invert,e}return e=a,(n=[{key:"update",value:function(t){if(t.sColor){this.div.selectAll("*").remove();var e=this.width+2*this.margin,n=this.height+3*this.margin+12+this.tickSize+10,r=this.div.append("svg").attr("width",e).attr("height",n);r.append("text").attr("x",this.margin).attr("y",this.margin).style("font-size","0.8em").style("font-weight","bold").style("alignment-baseline","top").style("dominant-baseline","hanging").style("pointer-events","none").text(this.title);for(var o=r.append("g").attr("transform","translate("+this.margin+" "+(2*this.margin+12)+")"),i=this.width,a=this.height,u=0;u<i;u+=5){var l=u/(i-1);this.invert&&(l=1-l),o.append("rect").attr("x",u).attr("y",0).attr("width",5).attr("height",a).style("fill",this.colorRamp(l))}for(var c=0;c<this.ticks;c++){var s=c/(this.ticks-1);o.append("line").attr("x1",i*s).attr("y1",0).attr("x2",i*s).attr("y2",a+this.tickSize).style("stroke","black"),o.append("text").attr("id","ticklabel_"+c).attr("x",i*s).attr("y",a+this.tickSize+2).style("font-size",this.fontSize).style("text-anchor",0==c?"start":c==this.ticks-1?"end":"middle").style("alignment-baseline","top").style("dominant-baseline","hanging").style("pointer-events","none")}for(var f=this.tickFormat&&"text"!=this.tickFormat?Ga(this.tickFormat):function(t){return t},h=0;h<this.ticks;h++){var y=h/(this.ticks-1),p=this.fun(y,t.r,t.sColor),v=(p?f(p):"0")+(this.tickUnit?this.tickUnit:"");this.div.select("#ticklabel_"+h).text(v)}}}}])&&Ya(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Aa);function qa(t){return qa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qa(t)}function Ka(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==qa(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==qa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===qa(o)?o:String(o)),r)}var o}function Ja(t,e){return Ja=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ja(t,e)}function Qa(t){return Qa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qa(t)}var tu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ja(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Qa(r);if(o){var n=Qa(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===qa(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colors=t.colors,e.breaksText=t.breaksText,e.width=t.width||300,e.height=t.height||15,e.title=t.title,e.titleFontSize=t.titleFontSize||"0.8em",e.titleFontWeight=t.titleFontWeight||"bold",e.tickSize=t.tickSize||3,e.labelFontSize=t.labelFontSize||"0.8em",e.invert=t.invert,e}return e=a,(n=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.title&&this.div.append("div").style("font-size",this.titleFontSize).style("font-weight",this.titleFontWeight).style("margin-bottom","7px").text(this.title);var e=this.colors.length;if(0!=e){for(var n=this.width/e,r=this.div.append("svg").attr("width",this.width).attr("height",this.height+this.tickSize+2+10),o=0;o<e;o++)r.append("rect").attr("x",o*n).attr("y",0).attr("width",n).attr("height",this.height).style("fill",this.colors[o]);for(var i=1;i<e;i++)r.append("line").attr("x1",n*i).attr("y1",0).attr("x2",n*i).attr("y2",this.height+this.tickSize).style("stroke","black");for(var a=1;a<e;a++)r.append("text").attr("id","ticklabel_"+a).attr("x",n*a).attr("y",this.height+this.tickSize+2).style("font-size",this.labelFontSize).style("text-anchor",0==a?"start":a==this.ticks-1?"end":"middle").style("alignment-baseline","top").style("dominant-baseline","hanging").style("pointer-events","none").text(this.breaksText[a-1])}}}])&&Ka(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Aa);function eu(t){return eu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eu(t)}function nu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==eu(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==eu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===eu(o)?o:String(o)),r)}var o}function ru(t,e){return ru=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ru(t,e)}function ou(t){return ou=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ou(t)}var iu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ru(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ou(r);if(o){var n=ou(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===eu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colCat=t.colCat||[["gray","-"]],e.shape=t.shape||"circle",e.dimension=t.dimension||{r:8},e.strokeColor=t.strokeColor||"gray",e.strokeWidth=t.strokeWidth||1,e.title=t.title,e.titleFontSize=t.titleFontSize||"0.8em",e.titleFontWeight=t.titleFontWeight||"bold",e.labelFontSize=t.labelFontSize||"0.8em",e}return e=a,(n=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.title&&this.div.append("div").style("font-size",this.titleFontSize).style("font-weight",this.titleFontWeight).style("margin-bottom","7px").text(this.title);var e=this.colCat.length;if(0!=e)for(var n=0;n<e;n++){var r=this.colCat[n],o=this.div.append("div"),i=this.strokeWidth;if("square"===this.shape){var a=this.dimension.h||15,u=this.dimension.w||20;o.append("div").style("display","inline").append("svg").attr("width",u+2*i).attr("height",a+2*i).append("rect").attr("x",i).attr("y",i).attr("width",u).attr("height",a).style("fill",r[0]).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}else{if("circle"!==this.shape)throw new Error("Unexpected shape:"+this.shape);var l=this.dimension.r||8,c=2*l+2*i;o.append("div").style("display","inline").append("svg").attr("width",c).attr("height",c).append("circle").attr("cx",l+i).attr("cy",l+i).attr("r",l).style("fill",r[0]).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}o.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(r[1])}}}])&&nu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Aa);function au(t){return au="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},au(t)}function uu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==au(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==au(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===au(o)?o:String(o)),r)}var o}function lu(t,e){return lu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},lu(t,e)}function cu(t){return cu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},cu(t)}var su=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lu(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=cu(r);if(o){var n=cu(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===au(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.exaggerationFactor=t.exaggerationFactor||.8,e.value=t.value||void 0,e.title=t.title,e.titleFontSize=t.titleFontSize||"0.8em",e.titleFontWeight=t.titleFontWeight||"bold",e.shape=t.shape||"circle",e.fillColor=t.fillColor||"none",e.strokeColor=t.strokeColor||"gray",e.strokeWidth=t.strokeWidth||1,e.labelFontSize=t.labelFontSize||"0.8em",e.labelUnitText=t.labelUnitText||"",e.labelFormat=t.labelFormat||",.2r",e}return e=a,(n=[{key:"update",value:function(t){if(t.sSize){this.div.selectAll("*").remove();var e=this.value;if(null==e){var n=t.sSize.max*this.exaggerationFactor,r=Math.log10(n);r=Math.floor(r),8*(e=Math.pow(10,r))<=n?e*=8:6*e<=n?e*=6:5*e<=n?e*=5:4*e<=n?e*=4:2.5*e<=n?e*=2.5:2*e<=n&&(e*=2)}if(e){var o=this.div.append("div");this.title&&o.append("div").attr("class","title").style("font-size",this.titleFontSize).style("font-weight",this.titleFontWeight).text(this.title);var i=t.style.size(e,t.r,t.sSize,t.zf)/t.zf,a=o.append("svg").attr("width",i+this.strokeWidth+2).attr("height",i+this.strokeWidth+2).style("","inline-block");if("square"===this.shape)a.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",i).style("fill",this.fillColor).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth);else if("circle"===this.shape){var u=.5*(i+this.strokeWidth);a.append("circle").attr("cx",u+1).attr("cy",u+1).attr("r",u).style("fill",this.fillColor).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}else if("donut"===this.shape);else if("diamond"!==this.shape)throw new Error("Unexpected shape:"+this.shape);var l=Ga(this.labelFormat)(e);o.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(l+(this.labelUnitText?" ":"")+this.labelUnitText)}}}}])&&uu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Aa);function fu(t){return fu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fu(t)}function hu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==fu(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==fu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===fu(o)?o:String(o)),r)}var o}function yu(t,e){return yu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},yu(t,e)}function pu(t){return pu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},pu(t)}var vu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yu(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=pu(r);if(o){var n=pu(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===fu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.title=t.title,e.titleFontSize=t.titleFontSize||"0.8em",e.titleFontWeight=t.titleFontWeight||"bold",e.exaggerationFactor=t.exaggerationFactor||.5,e.color=t.color||"gray",e.orientation=t.orientation||0,e.labelFontSize=t.labelFontSize||"0.8em",e.labelUnitText=t.labelUnitText||"",e}return e=a,(n=[{key:"update",value:function(t){if(t.sWidth){this.div.selectAll("*").remove();var e=this.div.append("div");this.title&&e.append("div").attr("class","title").style("font-size",this.titleFontSize).style("font-weight",this.titleFontWeight).text(this.title);var n=t.sWidth.max*this.exaggerationFactor,r=Math.log10(n);r=Math.floor(r);var o=Math.pow(10,r);8*o<=n?o*=8:6*o<=n?o*=6:5*o<=n?o*=5:4*o<=n?o*=4:2.5*o<=n?o*=2.5:2*o<=n&&(o*=2);var i=t.style.width(o,t.r,t.sWidth,t.zf)/t.zf,a=1*t.r/t.zf;e.append("svg").attr("width",a).attr("height",i).style("","inline-block").append("line").attr("x1",0).attr("y1",i/2).attr("x2",a).attr("y2",i/2).style("stroke",this.color).style("stroke-width",i);var u=Ga(",.2r")(o);e.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(u+(this.labelUnitText?" ":"")+this.labelUnitText)}}}])&&hu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Aa);function du(t){return du="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},du(t)}function mu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==du(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==du(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===du(o)?o:String(o)),r)}var o}function bu(t,e){return bu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bu(t,e)}function gu(t){return gu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},gu(t)}var wu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&bu(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=gu(r);if(o){var n=gu(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===du(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.title=t.title,e.titleFontSize=t.titleFontSize||"0.8em",e.titleFontWeight=t.titleFontWeight||"bold",e.exaggerationFactor=t.exaggerationFactor||.5,e.color=t.color||"gray",e.orientation=t.orientation||0,e.widthPix=t.widthPix||3,e.labelFontSize=t.labelFontSize||"0.8em",e.labelUnitText=t.labelUnitText||"",e}return e=a,n=[{key:"update",value:function(t){if(t.sWidth){this.div.selectAll("*").remove();var e=this.div.append("div");this.title&&e.append("div").attr("class","title").style("font-size",this.titleFontSize).style("font-weight",this.titleFontWeight).text(this.title);var n=this.widthPix,r=1*t.r/t.zf,o=Math.max(r,n),i=e.append("svg").attr("width",o).attr("height",o).style("","inline-block"),a=Math.cos(-this.orientation*Math.PI/180),u=Math.sin(-this.orientation*Math.PI/180),l=.5*o,c=.5*r;i.append("line").attr("x1",l-a*c).attr("y1",l-u*c).attr("x2",l+a*c).attr("y2",l+u*c).style("stroke",this.color).style("stroke-width",n),e.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(this.labelUnitText)}}}],n&&mu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Aa),xu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return Math.pow(t,e)},Su=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 1-Math.pow(1-t,1/e)},_u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 0==e?t:(Math.exp(t*e)-1)/(Math.exp(e)-1)},Ou=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 0==e?t:1-1/e*Math.log(Math.exp(e)*(1-t)+t)},ju=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.8;if(0==e)return t;if(1==e)return Math.sqrt(t*(2-t));var n=e/(1-e);return Math.sqrt(1/(n*n)+t*(2/n+2-t))-1/n},Pu=function(t){return 1-ju(1-t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:.8)},ku=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 0==e?t:1/e*Math.log(1-t+t*Math.exp(e))},Eu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return(Math.exp(-e*t)-1)/(Math.exp(-e)-1)},Cu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return Math.pow(t,1/e)},Tu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 1-Math.pow(1-t,e)},Au=1e-6,Mu=1e-12,Ru=Math.PI,Lu=Ru/2,zu=Ru/4,Fu=2*Ru,Iu=180/Ru,Nu=Ru/180,Bu=Math.abs,Du=Math.atan,Gu=Math.atan2,Zu=Math.cos,Uu=(Math.ceil,Math.exp,Math.floor,Math.hypot,Math.log,Math.pow,Math.sin),Wu=Math.sign||function(t){return t>0?1:t<0?-1:0},$u=Math.sqrt;function Yu(t){return t>1?Lu:t<-1?-Lu:Math.asin(t)}function Xu(){}function Hu(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:Xu,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Vu(t,e){return Bu(t[0]-e[0])<Au&&Bu(t[1]-e[1])<Au}function qu(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function Ku(t,e,n,r,o){var i,a,u=[],l=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],a=t[e];if(Vu(r,a)){if(!r[2]&&!a[2]){for(o.lineStart(),i=0;i<e;++i)o.point((r=t[i])[0],r[1]);return void o.lineEnd()}a[0]+=2*Au}u.push(n=new qu(r,t,null,!0)),l.push(n.o=new qu(r,null,n,!1)),u.push(n=new qu(a,t,null,!1)),l.push(n.o=new qu(a,null,n,!0))}})),u.length){for(l.sort(e),Ju(u),Ju(l),i=0,a=l.length;i<a;++i)l[i].e=n=!n;for(var c,s,f=u[0];;){for(var h=f,y=!0;h.v;)if((h=h.n)===f)return;c=h.z,o.lineStart();do{if(h.v=h.o.v=!0,h.e){if(y)for(i=0,a=c.length;i<a;++i)o.point((s=c[i])[0],s[1]);else r(h.x,h.n.x,1,o);h=h.n}else{if(y)for(c=h.p.z,i=c.length-1;i>=0;--i)o.point((s=c[i])[0],s[1]);else r(h.x,h.p.x,-1,o);h=h.p}c=(h=h.o).z,y=!y}while(!h.v);o.lineEnd()}}}function Ju(t){if(e=t.length){for(var e,n,r=0,o=t[0];++r<e;)o.n=n=t[r],n.p=o,o=n;o.n=n=t[0],n.p=o}}Math.tan;class Qu{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const o=e[r],i=t+o,a=Math.abs(t)<Math.abs(o)?t-(i-o):o-(i-t);a&&(e[n++]=a),t=i}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,r,o=this._n,i=0;if(o>0){for(i=t[--o];o>0&&(e=i,n=t[--o],i=e+n,r=n-(i-e),!r););o>0&&(r<0&&t[o-1]<0||r>0&&t[o-1]>0)&&(n=2*r,e=i+n,n==e-i&&(i=e))}return i}}function tl(t){return[Gu(t[1],t[0]),Yu(t[2])]}function el(t){var e=t[0],n=t[1],r=Zu(n);return[r*Zu(e),r*Uu(e),Uu(n)]}function nl(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function rl(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function ol(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function il(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function al(t){var e=$u(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function ul(t){return Bu(t[0])<=Ru?t[0]:Wu(t[0])*((Bu(t[0])+Ru)%Fu-Ru)}function ll(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function cl(t,e,n,r){return function(o){var i,a,u,l=e(o),c=Hu(),s=e(c),f=!1,h={point:y,lineStart:v,lineEnd:d,polygonStart:function(){h.point=m,h.lineStart=b,h.lineEnd=g,a=[],i=[]},polygonEnd:function(){h.point=y,h.lineStart=v,h.lineEnd=d,a=ll(a);var t=function(t,e){var n=ul(e),r=e[1],o=Uu(r),i=[Uu(n),-Zu(n),0],a=0,u=0,l=new Qu;1===o?r=Lu+Au:-1===o&&(r=-Lu-Au);for(var c=0,s=t.length;c<s;++c)if(h=(f=t[c]).length)for(var f,h,y=f[h-1],p=ul(y),v=y[1]/2+zu,d=Uu(v),m=Zu(v),b=0;b<h;++b,p=w,d=S,m=_,y=g){var g=f[b],w=ul(g),x=g[1]/2+zu,S=Uu(x),_=Zu(x),O=w-p,j=O>=0?1:-1,P=j*O,k=P>Ru,E=d*S;if(l.add(Gu(E*j*Uu(P),m*_+E*Zu(P))),a+=k?O+j*Fu:O,k^p>=n^w>=n){var C=rl(el(y),el(g));al(C);var T=rl(i,C);al(T);var A=(k^O>=0?-1:1)*Yu(T[2]);(r>A||r===A&&(C[0]||C[1]))&&(u+=k^O>=0?1:-1)}}return(a<-Au||a<Au&&l<-Mu)^1&u}(i,r);a.length?(f||(o.polygonStart(),f=!0),Ku(a,fl,t,n,o)):t&&(f||(o.polygonStart(),f=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),f&&(o.polygonEnd(),f=!1),a=i=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function y(e,n){t(e,n)&&o.point(e,n)}function p(t,e){l.point(t,e)}function v(){h.point=p,l.lineStart()}function d(){h.point=y,l.lineEnd()}function m(t,e){u.push([t,e]),s.point(t,e)}function b(){s.lineStart(),u=[]}function g(){m(u[0][0],u[0][1]),s.lineEnd();var t,e,n,r,l=s.clean(),h=c.result(),y=h.length;if(u.pop(),i.push(u),u=null,y)if(1&l){if((e=(n=h[0]).length-1)>0){for(f||(o.polygonStart(),f=!0),o.lineStart(),t=0;t<e;++t)o.point((r=n[t])[0],r[1]);o.lineEnd()}}else y>1&&2&l&&h.push(h.pop().concat(h.shift())),a.push(h.filter(sl))}return h}}function sl(t){return t.length>1}function fl(t,e){return((t=t.x)[0]<0?t[1]-Lu-Au:Lu-t[1])-((e=e.x)[0]<0?e[1]-Lu-Au:Lu-e[1])}const hl=cl((function(){return!0}),(function(t){var e,n=NaN,r=NaN,o=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(i,a){var u=i>0?Ru:-Ru,l=Bu(i-n);Bu(l-Ru)<Au?(t.point(n,r=(r+a)/2>0?Lu:-Lu),t.point(o,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(i,r),e=0):o!==u&&l>=Ru&&(Bu(n-o)<Au&&(n-=o*Au),Bu(i-u)<Au&&(i-=u*Au),r=function(t,e,n,r){var o,i,a=Uu(t-n);return Bu(a)>Au?Du((Uu(e)*(i=Zu(r))*Uu(n)-Uu(r)*(o=Zu(e))*Uu(t))/(o*i*a)):(e+r)/2}(n,r,i,a),t.point(o,r),t.lineEnd(),t.lineStart(),t.point(u,r),e=0),t.point(n=i,r=a),o=u},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var o;if(null==t)o=n*Lu,r.point(-Ru,o),r.point(0,o),r.point(Ru,o),r.point(Ru,0),r.point(Ru,-o),r.point(0,-o),r.point(-Ru,-o),r.point(-Ru,0),r.point(-Ru,o);else if(Bu(t[0]-e[0])>Au){var i=t[0]<e[0]?Ru:-Ru;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(e[0],e[1])}),[-Ru,-Lu]);function yl(t,e){(e=el(e))[0]-=t,al(e);var n,r=(n=-e[1])>1?0:n<-1?Ru:Math.acos(n);return((-e[2]<0?-r:r)+Fu-Au)%Fu}var pl=1e9,vl=-pl;function dl(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}const ml=t=>t;function bl(t,e){return Bu(t)>Ru&&(t-=Math.round(t/Fu)*Fu),[t,e]}function gl(t){return function(e,n){return Bu(e+=t)>Ru&&(e-=Math.round(e/Fu)*Fu),[e,n]}}function wl(t){var e=gl(t);return e.invert=gl(-t),e}function xl(t,e){var n=Zu(t),r=Uu(t),o=Zu(e),i=Uu(e);function a(t,e){var a=Zu(e),u=Zu(t)*a,l=Uu(t)*a,c=Uu(e),s=c*n+u*r;return[Gu(l*o-s*i,u*n-c*r),Yu(s*o+l*i)]}return a.invert=function(t,e){var a=Zu(e),u=Zu(t)*a,l=Uu(t)*a,c=Uu(e),s=c*o-l*i;return[Gu(l*o+c*i,u*n+s*r),Yu(s*n-u*r)]},a}function Sl(t){return function(e){var n=new _l;for(var r in t)n[r]=t[r];return n.stream=e,n}}function _l(){}function Ol(t,e){t&&Pl.hasOwnProperty(t.type)&&Pl[t.type](t,e)}bl.invert=bl,_l.prototype={constructor:_l,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var jl={Feature:function(t,e){Ol(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,o=n.length;++r<o;)Ol(n[r].geometry,e)}},Pl={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){kl(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)kl(n[r],e,0)},Polygon:function(t,e){El(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)El(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,o=n.length;++r<o;)Ol(n[r],e)}};function kl(t,e,n){var r,o=-1,i=t.length-n;for(e.lineStart();++o<i;)r=t[o],e.point(r[0],r[1],r[2]);e.lineEnd()}function El(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)kl(t[n],e,1);e.polygonEnd()}var Cl=1/0,Tl=Cl,Al=-Cl,Ml=Al,Rl={point:function(t,e){t<Cl&&(Cl=t),t>Al&&(Al=t),e<Tl&&(Tl=e),e>Ml&&(Ml=e)},lineStart:Xu,lineEnd:Xu,polygonStart:Xu,polygonEnd:Xu,result:function(){var t=[[Cl,Tl],[Al,Ml]];return Al=Ml=-(Tl=Cl=1/0),t}};const Ll=Rl;function zl(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),function(t,e){t&&jl.hasOwnProperty(t.type)?jl[t.type](t,e):Ol(t,e)}(n,t.stream(Ll)),e(Ll.result()),null!=r&&t.clipExtent(r),t}function Fl(t,e,n){return zl(t,(function(n){var r=e[1][0]-e[0][0],o=e[1][1]-e[0][1],i=Math.min(r/(n[1][0]-n[0][0]),o/(n[1][1]-n[0][1])),a=+e[0][0]+(r-i*(n[1][0]+n[0][0]))/2,u=+e[0][1]+(o-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([a,u])}),n)}var Il=16,Nl=Zu(30*Nu);function Bl(t,e){return+e?function(t,e){function n(r,o,i,a,u,l,c,s,f,h,y,p,v,d){var m=c-r,b=s-o,g=m*m+b*b;if(g>4*e&&v--){var w=a+h,x=u+y,S=l+p,_=$u(w*w+x*x+S*S),O=Yu(S/=_),j=Bu(Bu(S)-1)<Au||Bu(i-f)<Au?(i+f)/2:Gu(x,w),P=t(j,O),k=P[0],E=P[1],C=k-r,T=E-o,A=b*C-m*T;(A*A/g>e||Bu((m*C+b*T)/g-.5)>.3||a*h+u*y+l*p<Nl)&&(n(r,o,i,a,u,l,k,E,j,w/=_,x/=_,S,v,d),d.point(k,E),n(k,E,j,w,x,S,c,s,f,h,y,p,v,d))}}return function(e){var r,o,i,a,u,l,c,s,f,h,y,p,v={point:d,lineStart:m,lineEnd:g,polygonStart:function(){e.polygonStart(),v.lineStart=w},polygonEnd:function(){e.polygonEnd(),v.lineStart=m}};function d(n,r){n=t(n,r),e.point(n[0],n[1])}function m(){s=NaN,v.point=b,e.lineStart()}function b(r,o){var i=el([r,o]),a=t(r,o);n(s,f,c,h,y,p,s=a[0],f=a[1],c=r,h=i[0],y=i[1],p=i[2],Il,e),e.point(s,f)}function g(){v.point=d,e.lineEnd()}function w(){m(),v.point=x,v.lineEnd=S}function x(t,e){b(r=t,e),o=s,i=f,a=h,u=y,l=p,v.point=b}function S(){n(s,f,c,h,y,p,o,i,r,a,u,l,Il,e),v.lineEnd=g,g()}return v}}(t,e):function(t){return Sl({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Dl=Sl({point:function(t,e){this.stream.point(t*Nu,e*Nu)}});function Gl(t,e,n,r,o,i){if(!i)return function(t,e,n,r,o){function i(i,a){return[e+t*(i*=r),n-t*(a*=o)]}return i.invert=function(i,a){return[(i-e)/t*r,(n-a)/t*o]},i}(t,e,n,r,o);var a=Zu(i),u=Uu(i),l=a*t,c=u*t,s=a/t,f=u/t,h=(u*n-a*e)/t,y=(u*e+a*n)/t;function p(t,i){return[l*(t*=r)-c*(i*=o)+e,n-c*t-l*i]}return p.invert=function(t,e){return[r*(s*t-f*e+h),o*(y-f*t-s*e)]},p}function Zl(t){return function(t){var e,n,r,o,i,a,u,l,c,s,f=150,h=480,y=250,p=0,v=0,d=0,m=0,b=0,g=0,w=1,x=1,S=null,_=hl,O=null,j=ml,P=.5;function k(t){return l(t[0]*Nu,t[1]*Nu)}function E(t){return(t=l.invert(t[0],t[1]))&&[t[0]*Iu,t[1]*Iu]}function C(){var t=Gl(f,0,0,w,x,g).apply(null,e(p,v)),r=Gl(f,h-t[0],y-t[1],w,x,g);return n=function(t,e,n){return(t%=Fu)?e||n?dl(wl(t),xl(e,n)):wl(t):e||n?xl(e,n):bl}(d,m,b),u=dl(e,r),l=dl(n,u),a=Bl(u,P),T()}function T(){return c=s=null,k}return k.stream=function(t){return c&&s===t?c:c=Dl(function(t){return Sl({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(_(a(j(s=t)))))},k.preclip=function(t){return arguments.length?(_=t,S=void 0,T()):_},k.postclip=function(t){return arguments.length?(j=t,O=r=o=i=null,T()):j},k.clipAngle=function(t){return arguments.length?(_=+t?function(t){var e=Zu(t),n=6*Nu,r=e>0,o=Bu(e)>Au;function i(t,n){return Zu(t)*Zu(n)>e}function a(t,n,r){var o=[1,0,0],i=rl(el(t),el(n)),a=nl(i,i),u=i[0],l=a-u*u;if(!l)return!r&&t;var c=e*a/l,s=-e*u/l,f=rl(o,i),h=il(o,c);ol(h,il(i,s));var y=f,p=nl(h,y),v=nl(y,y),d=p*p-v*(nl(h,h)-1);if(!(d<0)){var m=$u(d),b=il(y,(-p-m)/v);if(ol(b,h),b=tl(b),!r)return b;var g,w=t[0],x=n[0],S=t[1],_=n[1];x<w&&(g=w,w=x,x=g);var O=x-w,j=Bu(O-Ru)<Au;if(!j&&_<S&&(g=S,S=_,_=g),j||O<Au?j?S+_>0^b[1]<(Bu(b[0]-w)<Au?S:_):S<=b[1]&&b[1]<=_:O>Ru^(w<=b[0]&&b[0]<=x)){var P=il(y,(-p+m)/v);return ol(P,h),[b,tl(P)]}}}function u(e,n){var o=r?t:Ru-t,i=0;return e<-o?i|=1:e>o&&(i|=2),n<-o?i|=4:n>o&&(i|=8),i}return cl(i,(function(t){var e,n,l,c,s;return{lineStart:function(){c=l=!1,s=1},point:function(f,h){var y,p=[f,h],v=i(f,h),d=r?v?0:u(f,h):v?u(f+(f<0?Ru:-Ru),h):0;if(!e&&(c=l=v)&&t.lineStart(),v!==l&&(!(y=a(e,p))||Vu(e,y)||Vu(p,y))&&(p[2]=1),v!==l)s=0,v?(t.lineStart(),y=a(p,e),t.point(y[0],y[1])):(y=a(e,p),t.point(y[0],y[1],2),t.lineEnd()),e=y;else if(o&&e&&r^v){var m;d&n||!(m=a(p,e,!0))||(s=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1],3)))}!v||e&&Vu(e,p)||t.point(p[0],p[1]),e=p,l=v,n=d},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return s|(c&&l)<<1}}}),(function(e,r,o,i){!function(t,e,n,r,o,i){if(n){var a=Zu(e),u=Uu(e),l=r*n;null==o?(o=e+r*Fu,i=e-l/2):(o=yl(a,o),i=yl(a,i),(r>0?o<i:o>i)&&(o+=r*Fu));for(var c,s=o;r>0?s>i:s<i;s-=l)c=tl([a,-u*Zu(s),-u*Uu(s)]),t.point(c[0],c[1])}}(i,t,n,o,e,r)}),r?[0,-t]:[-Ru,t-Ru])}(S=t*Nu):(S=null,hl),T()):S*Iu},k.clipExtent=function(t){return arguments.length?(j=null==t?(O=r=o=i=null,ml):function(t,e,n,r){function o(o,i){return t<=o&&o<=n&&e<=i&&i<=r}function i(o,i,u,c){var s=0,f=0;if(null==o||(s=a(o,u))!==(f=a(i,u))||l(o,i)<0^u>0)do{c.point(0===s||3===s?t:n,s>1?r:e)}while((s=(s+u+4)%4)!==f);else c.point(i[0],i[1])}function a(r,o){return Bu(r[0]-t)<Au?o>0?0:3:Bu(r[0]-n)<Au?o>0?2:1:Bu(r[1]-e)<Au?o>0?1:0:o>0?3:2}function u(t,e){return l(t.x,e.x)}function l(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var l,c,s,f,h,y,p,v,d,m,b,g=a,w=Hu(),x={point:S,lineStart:function(){x.point=_,c&&c.push(s=[]),m=!0,d=!1,p=v=NaN},lineEnd:function(){l&&(_(f,h),y&&d&&w.rejoin(),l.push(w.result())),x.point=S,d&&g.lineEnd()},polygonStart:function(){g=w,l=[],c=[],b=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,o=c.length;n<o;++n)for(var i,a,u=c[n],l=1,s=u.length,f=u[0],h=f[0],y=f[1];l<s;++l)i=h,a=y,h=(f=u[l])[0],y=f[1],a<=r?y>r&&(h-i)*(r-a)>(y-a)*(t-i)&&++e:y<=r&&(h-i)*(r-a)<(y-a)*(t-i)&&--e;return e}(),n=b&&e,o=(l=ll(l)).length;(n||o)&&(a.polygonStart(),n&&(a.lineStart(),i(null,null,1,a),a.lineEnd()),o&&Ku(l,u,e,i,a),a.polygonEnd()),g=a,l=c=s=null}};function S(t,e){o(t,e)&&g.point(t,e)}function _(i,a){var u=o(i,a);if(c&&s.push([i,a]),m)f=i,h=a,y=u,m=!1,u&&(g.lineStart(),g.point(i,a));else if(u&&d)g.point(i,a);else{var l=[p=Math.max(vl,Math.min(pl,p)),v=Math.max(vl,Math.min(pl,v))],w=[i=Math.max(vl,Math.min(pl,i)),a=Math.max(vl,Math.min(pl,a))];!function(t,e,n,r,o,i){var a,u=t[0],l=t[1],c=0,s=1,f=e[0]-u,h=e[1]-l;if(a=n-u,f||!(a>0)){if(a/=f,f<0){if(a<c)return;a<s&&(s=a)}else if(f>0){if(a>s)return;a>c&&(c=a)}if(a=o-u,f||!(a<0)){if(a/=f,f<0){if(a>s)return;a>c&&(c=a)}else if(f>0){if(a<c)return;a<s&&(s=a)}if(a=r-l,h||!(a>0)){if(a/=h,h<0){if(a<c)return;a<s&&(s=a)}else if(h>0){if(a>s)return;a>c&&(c=a)}if(a=i-l,h||!(a<0)){if(a/=h,h<0){if(a>s)return;a>c&&(c=a)}else if(h>0){if(a<c)return;a<s&&(s=a)}return c>0&&(t[0]=u+c*f,t[1]=l+c*h),s<1&&(e[0]=u+s*f,e[1]=l+s*h),!0}}}}}(l,w,t,e,n,r)?u&&(g.lineStart(),g.point(i,a),b=!1):(d||(g.lineStart(),g.point(l[0],l[1])),g.point(w[0],w[1]),u||g.lineEnd(),b=!1)}p=i,v=a,d=u}return x}}(O=+t[0][0],r=+t[0][1],o=+t[1][0],i=+t[1][1]),T()):null==O?null:[[O,r],[o,i]]},k.scale=function(t){return arguments.length?(f=+t,C()):f},k.translate=function(t){return arguments.length?(h=+t[0],y=+t[1],C()):[h,y]},k.center=function(t){return arguments.length?(p=t[0]%360*Nu,v=t[1]%360*Nu,C()):[p*Iu,v*Iu]},k.rotate=function(t){return arguments.length?(d=t[0]%360*Nu,m=t[1]%360*Nu,b=t.length>2?t[2]%360*Nu:0,C()):[d*Iu,m*Iu,b*Iu]},k.angle=function(t){return arguments.length?(g=t%360*Nu,C()):g*Iu},k.reflectX=function(t){return arguments.length?(w=t?-1:1,C()):w<0},k.reflectY=function(t){return arguments.length?(x=t?-1:1,C()):x<0},k.precision=function(t){return arguments.length?(a=Bl(u,P=t*t),T()):$u(P)},k.fitExtent=function(t,e){return Fl(k,t,e)},k.fitSize=function(t,e){return function(t,e,n){return Fl(t,[[0,0],e],n)}(k,t,e)},k.fitWidth=function(t,e){return function(t,e,n){return zl(t,(function(n){var r=+e,o=r/(n[1][0]-n[0][0]),i=(r-o*(n[1][0]+n[0][0]))/2,a=-o*n[0][1];t.scale(150*o).translate([i,a])}),n)}(k,t,e)},k.fitHeight=function(t,e){return function(t,e,n){return zl(t,(function(n){var r=+e,o=r/(n[1][1]-n[0][1]),i=-o*n[0][0],a=(r-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([i,a])}),n)}(k,t,e)},function(){return e=t.apply(this,arguments),k.invert=e.invert&&E,C()}}((function(){return t}))()}var Ul,Wl,$l=(Ul=function(t){return $u(2/(1+t))},function(t,e){var n=Zu(t),r=Zu(e),o=Ul(n*r);return o===1/0?[2,0]:[o*r*Uu(t),o*Uu(e)]});$l.invert=(Wl=function(t){return 2*Yu(t/2)},function(t,e){var n=$u(t*t+e*e),r=Wl(n),o=Uu(r),i=Zu(r);return[Gu(t*o,n*i),Yu(n&&e*o/n)]});var Yl=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"EUR",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,n=arguments.length>2?arguments[2]:void 0,r=(n=n||{}).ex||1.2,o=n.fontFamily||"Arial",i=n.exSize||1;return n.style=n.style||function(t,e){if(!(t.rs<r*e))return t.r1<r*e?i+"em "+o:1.5*i+"em "+o},n.proj=n.proj||Zl($l).scale(124.75).clipAngle(179.999).rotate([-10,-52]).reflectX(!1).reflectY(!0).scale(6378137).translate([4321e3,321e4]),n.preprocess=function(t){if(n.ccIn&&t.cc&&!(n.ccIn.indexOf(t.cc)>=0))return!1;var e=n.proj([t.lon,t.lat]);t.x=e[0],t.y=e[1],delete t.lon,delete t.lat},n.baseURL=n.baseURL||"https://raw.githubusercontent.com/eurostat/euronym/main/pub/v2/UTF/",n.url=n.baseURL+e+"/"+t+".csv",n},Xl=function(t){var e=(t=t||{}).nutsYear||"2021",n=t.crs||"3035",r=t.scale||"03M",o=t.nutsLevel||"3",i=t.col||"#888",a=t.colKosovo||"#bcbcbc",u=null==t.showOth||t.showOth;return t.color=t.color||function(t,e){var n=t.properties;if(u||"T"==n.eu||"T"==n.cc||"T"==n.efta||"T"!==n.oth)return n.id>=1e5?a:"T"===n.co||e<400?i:e<1e3?n.lvl>=3?"":i:e<2e3?n.lvl>=2?"":i:n.lvl>=1?"":i},t.width=t.width||function(t,e){var n=t.properties;return"T"===n.co?.5:e<400?3==n.lvl||2==n.lvl||1==n.lvl?2.2:4:e<1e3?2==n.lvl||1==n.lvl?1.8:2.5:e<2e3?1==n.lvl?1.8:2.5:1.2},t.lineDash=t.lineDash||function(t,e){var n=t.properties;return"T"===n.co?[]:e<400?3==n.lvl?[2*e,2*e]:2==n.lvl||1==n.lvl?[5*e,2*e]:[10*e,3*e]:e<1e3?2==n.lvl||1==n.lvl?[5*e,2*e]:[10*e,3*e]:e<2e3&&1==n.lvl?[5*e,2*e]:[10*e,3*e]},t.baseURL=t.baseURL||"https://raw.githubusercontent.com/eurostat/Nuts2json/master/pub/v2/",t.url=t.baseURL+e+"/"+n+"/"+r+"/nutsbn_"+o+".json",t},Hl=Bn.getParameterByName;return Wa({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),e})()));
|