gridviz 2.1.4 → 2.1.6
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 +17 -9
- package/dist/gridviz.min.js +1 -1
- package/package.json +1 -1
- package/src/style/IsoFenceStyle.js +16 -8
package/dist/gridviz.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(){}function n(t){return null==t?r: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:()=>go,BackgroundLayer:()=>qn,BackgroundLayerWMS:()=>Qn,BoundaryLayer:()=>yo,CSVGrid:()=>_n,ColorCategoryLegend:()=>bu,ColorDiscreteLegend:()=>yu,ColorLegend:()=>lu,CompositionStyle:()=>qo,ContourStyle:()=>Pi,Dataset:()=>Yr,DatasetComponent:()=>pn,DotDensityStyle:()=>Yi,GeoCanvas:()=>Nr,GridTile:()=>Ln,JoyPlotStyle:()=>Zo,LGrid:()=>En,LabelLayer:()=>ao,Layer:()=>Gr,LegoStyle:()=>xa,MosaicStyle:()=>Ca,NinjaStarStyle:()=>La,PillarStyle:()=>vi,SegmentOrientationLegend:()=>Ru,SegmentStyle:()=>ri,SegmentWidthLegend:()=>Cu,ShapeColorSizeStyle:()=>To,SideCatStyle:()=>Mi,SideStyle:()=>Si,SizeLegend:()=>_u,SquareColorCatWGLStyle:()=>ha,SquareColorWGLStyle:()=>ea,StrokeStyle:()=>Fo,Style:()=>Oo,TanakaStyle:()=>oa,TextStyle:()=>li,TiledGrid:()=>Hn,TimeSeriesStyle:()=>Ga,getClass:()=>zn,getParameterByName:()=>Uu,sCircleHigh:()=>Bu,sCircleLow:()=>Nu,sExp:()=>Fu,sExpInverse:()=>Du,sExpRev:()=>Iu,sExpRevInverse:()=>Gu,sPow:()=>Lu,sPowInverse:()=>Zu,sPowRev:()=>zu,sPowRevInverse:()=>Wu});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,r,n,o,i){for(var a,u=0,l=e.length,c=i.length;u<c;++u)(a=e[u])?(a.__data__=i[u],n[u]=a):r[u]=new y(t,i[u]);for(;u<l;++u)(a=e[u])&&(o[u]=a)}function v(t,e,r,n,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))?(n[u]=l,l.__data__=i[u],s.delete(c)):r[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+="",r=e.indexOf(":");return r>=0&&"xmlns"!==(e=t.slice(0,r))&&(t=t.slice(r+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 r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}}function k(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function C(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function E(t){return function(){this.style.removeProperty(t)}}function T(t,e,r){return function(){this.style.setProperty(t,e,r)}}function A(t,e,r){return function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function M(t,e){return t.style.getPropertyValue(e)||C(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 r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}}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 r=I(t),n=-1,o=e.length;++n<o;)r.add(e[n])}function D(t,e){for(var r=I(t),n=-1,o=e.length;++n<o;)r.remove(e[n])}function G(t){return function(){B(this,t)}}function Z(t){return function(){D(this,t)}}function W(t,e){return function(){(e.apply(this,arguments)?B:D)(this,t)}}function U(){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 H(){this.innerHTML=""}function X(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 J(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function K(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===g&&e.documentElement.namespaceURI===g?e.createElement(t):e.createElementNS(r,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:K)(e)}function et(){return null}function rt(){var t=this.parentNode;t&&t.removeChild(this)}function nt(){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 r,n=0,o=-1,i=e.length;n<i;++n)r=e[n],t.type&&r.type!==t.type||r.name!==t.name?e[++o]=r:this.removeEventListener(r.type,r.listener,r.options);++o?e.length=o:delete this.__on}}}function at(t,e,r){return function(){var n,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((n=o[a]).type===t.type&&n.name===t.name)return this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=i,n.options=r),void(n.value=e);this.addEventListener(t.type,i,r),n={type:t.type,name:t.name,value:e,listener:i,options:r},o?o.push(n):this.__on=[n]}}function ut(t,e,r){var n=C(t),o=n.CustomEvent;"function"==typeof o?o=new o(e,r):(o=n.document.createEvent("Event"),r?(o.initEvent(e,r.bubbles,r.cancelable),o.detail=r.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=n(t));for(var e=this._groups,r=e.length,o=new Array(r),i=0;i<r;++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,r=e.length,n=[],o=[],a=0;a<r;++a)for(var u,l=e[a],c=l.length,s=0;s<c;++s)(u=l[s])&&(n.push(t.call(u,u.__data__,s,l)),o.push(u));return new ft(n,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,r=e.length,n=new Array(r),o=0;o<r;++o)for(var i,u=e[o],l=u.length,c=n[o]=[],s=0;s<l;++s)(i=u[s])&&t.call(i,i.__data__,s,u)&&c.push(i);return new ft(n,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,d);var r,n=e?v:p,o=this._parents,i=this._groups;"function"!=typeof t&&(r=t,t=function(){return r});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);n(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,r){var n=this.enter(),o=this,i=this.exit();return"function"==typeof t?(n=t(n))&&(n=n.selection()):n=n.append(t+""),null!=e&&(o=e(o))&&(o=o.selection()),null==r?i.remove():r(i),n&&o?n.merge(o).order():o},merge:function(t){for(var e=t.selection?t.selection():t,r=this._groups,n=e._groups,o=r.length,i=n.length,a=Math.min(o,i),u=new Array(o),l=0;l<a;++l)for(var c,s=r[l],f=n[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]=r[l];return new ft(u,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var n,o=t[e],i=o.length-1,a=o[i];--i>=0;)(n=o[i])&&(a&&4^n.compareDocumentPosition(a)&&a.parentNode.insertBefore(n,a),a=n);return this},sort:function(t){function e(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}t||(t=b);for(var r=this._groups,n=r.length,o=new Array(n),i=0;i<n;++i){for(var a,u=r[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,r=t.length;e<r;++e)for(var n=t[e],o=0,i=n.length;o<i;++o){var a=n[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,r=0,n=e.length;r<n;++r)for(var o,i=e[r],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 r=x(t);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((null==e?r.local?_:S:"function"==typeof e?r.local?k:P:r.local?j:O)(r,e))},style:function(t,e,r){return arguments.length>1?this.each((null==e?E:"function"==typeof e?A:T)(t,e,null==r?"":r)):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 r=F(t+"");if(arguments.length<2){for(var n=I(this.node()),o=-1,i=r.length;++o<i;)if(!n.contains(r[o]))return!1;return!0}return this.each(("function"==typeof e?W:e?G:Z)(r,e))},text:function(t){return arguments.length?this.each(null==t?U:("function"==typeof t?Y:$)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?H:("function"==typeof t?V:X)(t)):this.node().innerHTML},raise:function(){return this.each(q)},lower:function(){return this.each(J)},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 r="function"==typeof t?t:tt(t),o=null==e?et:"function"==typeof e?e:n(e);return this.select((function(){return this.insertBefore(r.apply(this,arguments),o.apply(this,arguments)||null)}))},remove:function(){return this.each(rt)},clone:function(t){return this.select(t?ot:nt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,r){var n,o,i=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");return r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),{type:t,name:e}}))}(t+""),a=i.length;if(!(arguments.length<2)){for(u=e?at:it,n=0;n<a;++n)this.each(u(i[n],e,r));return this}var u=this.node().__on;if(u)for(var l,c=0,s=u.length;c<s;++c)for(n=0,l=u[c];n<a;++n)if((o=i[n]).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,r=t.length;e<r;++e)for(var n,o=t[e],i=0,a=o.length;i<a;++i)(n=o[i])&&(yield n)}};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,r=arguments.length,n={};e<r;++e){if(!(t=arguments[e]+"")||t in n||/[\s.]/.test(t))throw new Error("illegal type: "+t);n[t]=[]}return new mt(n)}function mt(t){this._=t}function bt(t,e){for(var r,n=0,o=t.length;n<o;++n)if((r=t[n]).name===e)return r.value}function gt(t,e,r){for(var n=0,o=t.length;n<o;++n)if(t[n].name===e){t[n]=vt,t=t.slice(0,n).concat(t.slice(n+1));break}return null!=r&&t.push({name:e,value:r}),t}mt.prototype=dt.prototype={constructor:mt,on:function(t,e){var r,n,o=this._,i=(n=o,(t+"").trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.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(r=(t=i[a]).type)o[r]=gt(o[r],t.name,e);else if(null==e)for(r in o)o[r]=gt(o[r],t.name,null);return this}for(;++a<u;)if((r=(t=i[a]).type)&&(r=bt(o[r],t.name)))return r},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new mt(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var r,n,o=new Array(r),i=0;i<r;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,r=(n=this._[t]).length;i<r;++i)n[i].value.apply(e,o)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],o=0,i=n.length;o<i;++o)n[o].value.apply(e,r)}};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,r,n){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+n*v)/(2*c*r*d),b=(h*h-c*c-n*v)/(2*h*r*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 n,o=t*a,i=_t(g),s=c/(r*d)*(i*(n=e*o+g,((n=Math.exp(2*n))-1)/(n+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 r=Math.max(.001,+e),n=r*r;return t(r,n,n*n)},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 r=e.ownerSVGElement||e;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,[(n=n.matrixTransform(e.getScreenCTM().inverse())).x,n.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,Ct=0,Et=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,r){var n=new Bt;return n.restart(t,e,r),n}function Gt(){Rt=(Mt=zt.now())+Lt,Ct=Et=0;try{!function(){It(),++Ct;for(var t,e=Pt;e;)(t=Rt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ct}()}finally{Ct=0,function(){for(var t,e,r=Pt,n=1/0;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:Pt=e);kt=t,Wt(n)}(),Rt=0}}function Zt(){var t=zt.now(),e=t-Mt;e>At&&(Lt-=e,Mt=t)}function Wt(t){Ct||(Et&&(Et=clearTimeout(Et)),t-Rt>24?(t<1/0&&(Et=setTimeout(Gt,t-zt.now()-Lt)),Tt&&(Tt=clearInterval(Tt))):(Tt||(Mt=zt.now(),Tt=setInterval(Zt,At)),Ct=1,Ft(Gt)))}function Ut(t,e,r){var n=new Bt;return e=null==e?0:+e,n.restart((r=>{n.stop(),t(r+e)}),e,r),n}Bt.prototype=Dt.prototype={constructor:Bt,restart:function(t,e,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?It():+r)+(null==e?0:+e),this._next||kt===this||(kt?kt._next=this:Pt=this,kt=this),this._call=t,this._time=r,Wt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wt())}};var $t=wt("start","end","cancel","interrupt"),Yt=[],Ht=0,Xt=2,Vt=3,qt=5,Jt=6;function Kt(t,e,r,n,o,i){var a=t.__transition;if(a){if(r in a)return}else t.__transition={};!function(t,e,r){var n,o=t.__transition;function i(l){var c,s,f,h;if(1!==r.state)return u();for(c in o)if((h=o[c]).name===r.name){if(h.state===Vt)return Ut(i);4===h.state?(h.state=Jt,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete o[c]):+c<e&&(h.state=Jt,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete o[c])}if(Ut((function(){r.state===Vt&&(r.state=4,r.timer.restart(a,r.delay,r.time),a(l))})),r.state=Xt,r.on.call("start",t,t.__data__,r.index,r.group),r.state===Xt){for(r.state=Vt,n=new Array(f=r.tween.length),c=0,s=-1;c<f;++c)(h=r.tween[c].value.call(t,t.__data__,r.index,r.group))&&(n[++s]=h);n.length=s+1}}function a(e){for(var o=e<r.duration?r.ease.call(null,e/r.duration):(r.timer.restart(u),r.state=qt,1),i=-1,a=n.length;++i<a;)n[i].call(t,o);r.state===qt&&(r.on.call("end",t,t.__data__,r.index,r.group),u())}function u(){for(var n in r.state=Jt,r.timer.stop(),delete o[e],o)return;delete t.__transition}o[e]=r,r.timer=Dt((function(t){r.state=1,r.timer.restart(i,r.delay,r.time),r.delay<=t&&i(t-r.delay)}),0,r.time)}(t,r,{name:e,index:n,group:o,on:$t,tween:Yt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Ht})}function Qt(t,e){var r=ee(t,e);if(r.state>Ht)throw new Error("too late; already scheduled");return r}function te(t,e){var r=ee(t,e);if(r.state>Vt)throw new Error("too late; already running");return r}function ee(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function re(t,e){var r,n,o,i=t.__transition,a=!0;if(i){for(o in e=null==e?null:e+"",i)(r=i[o]).name===e?(n=r.state>Xt&&r.state<qt,r.state=Jt,r.timer.stop(),r.on.call(n?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete i[o]):a=!1;a&&delete t.__transition}}function ne(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}var oe,ie=180/Math.PI,ae={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ue(t,e,r,n,o,i){var a,u,l;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(l=t*r+e*n)&&(r-=t*l,n-=e*l),(u=Math.sqrt(r*r+n*n))&&(r/=u,n/=u,l/=u),t*n<e*r&&(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,r,n){function o(t){return t.length?t.pop()+" ":""}return function(i,a){var u=[],l=[];return i=t(i),a=t(a),function(t,n,o,i,a,u){if(t!==o||n!==i){var l=a.push("translate(",null,e,null,r);u.push({i:l-4,x:ne(t,o)},{i:l-2,x:ne(n,i)})}else(o||i)&&a.push("translate("+o+e+i+r)}(i.translateX,i.translateY,a.translateX,a.translateY,u,l),function(t,e,r,i){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),i.push({i:r.push(o(r)+"rotate(",null,n)-2,x:ne(t,e)})):e&&r.push(o(r)+"rotate("+e+n)}(i.rotate,a.rotate,u,l),function(t,e,r,i){t!==e?i.push({i:r.push(o(r)+"skewX(",null,n)-2,x:ne(t,e)}):e&&r.push(o(r)+"skewX("+e+n)}(i.skewX,a.skewX,u,l),function(t,e,r,n,i,a){if(t!==r||e!==n){var u=i.push(o(i)+"scale(",null,",",null,")");a.push({i:u-4,x:ne(t,r)},{i:u-2,x:ne(e,n)})}else 1===r&&1===n||i.push(o(i)+"scale("+r+","+n+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,u,l),i=a=null,function(t){for(var e,r=-1,n=l.length;++r<n;)u[(e=l[r]).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 r,n;return function(){var o=te(this,t),i=o.tween;if(i!==r)for(var a=0,u=(n=r=i).length;a<u;++a)if(n[a].name===e){(n=n.slice()).splice(a,1);break}o.tween=n}}function he(t,e,r){var n,o;if("function"!=typeof r)throw new Error;return function(){var i=te(this,t),a=i.tween;if(a!==n){o=(n=a).slice();for(var u={name:e,value:r},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,r){var n=t._id;return t.each((function(){var t=te(this,n);(t.value||(t.value={}))[e]=r.apply(this,arguments)})),function(t){return ee(t,n).value[e]}}function pe(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function ve(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}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}\\)$`),Ce=new RegExp(`^hsla\\(${we},${xe},${xe},${we}\\)$`),Ee={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,r;return t=(t+"").trim().toLowerCase(),(e=Se.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?Re(e):3===r?new Fe(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?Le(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?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=Ce.exec(t))?Ze(e[1],e[2]/100,e[3]/100,e[4]):Ee.hasOwnProperty(t)?Re(Ee[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,r,n){return n<=0&&(t=e=r=NaN),new Fe(t,e,r,n)}function ze(t,e,r,n){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,r,null==n?1:n);var o}function Fe(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}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,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Ue(t,e,r,n)}function We(t){if(t instanceof Ue)return new Ue(t.h,t.s,t.l,t.opacity);if(t instanceof de||(t=Me(t)),!t)return new Ue;if(t instanceof Ue)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,o=Math.min(e,r,n),i=Math.max(e,r,n),a=NaN,u=i-o,l=(i+o)/2;return u?(a=e===i?(r-n)/u+6*(r<n):r===i?(n-e)/u+2:(e-r)/u+4,u/=l<.5?i+o:2-i-o,a*=60):u=l>0&&l<1?0:a,new Ue(a,u,l,t.opacity)}function Ue(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}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 He(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function Xe(t,e,r,n,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*r+(1+3*t+3*i-3*a)*n+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 We(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(Ue,(function(t,e,r,n){return 1===arguments.length?We(t):new Ue(t,e,r,null==n?1:n)}),ve(de,{brighter(t){return t=null==t?be:Math.pow(be,t),new Ue(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?me:Math.pow(me,t),new Ue(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,r=this.l,n=r+(r<.5?r:1-r)*e,o=2*r-n;return new Fe(He(t>=240?t-240:t+120,o,n),He(t,o,n),He(t<120?t+240:t-120,o,n),this.opacity)},clamp(){return new Ue($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 r=e-t;return r?function(t,e){return function(r){return t+r*e}}(t,r):Ve(isNaN(t)?e:t)}const Je=function t(e){var r=function(t){return 1==(t=+t)?qe:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):Ve(isNaN(e)?r:e)}}(e);function n(t,e){var n=r((t=ze(t)).r,(e=ze(e)).r),o=r(t.g,e.g),i=r(t.b,e.b),a=qe(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+""}}return n.gamma=t,n}(1);function Ke(t){return function(e){var r,n,o=e.length,i=new Array(o),a=new Array(o),u=new Array(o);for(r=0;r<o;++r)n=ze(e[r]),i[r]=n.r||0,a[r]=n.g||0,u[r]=n.b||0;return i=t(i),a=t(a),u=t(u),n.opacity=1,function(t){return n.r=i(t),n.g=a(t),n.b=u(t),n+""}}}Ke((function(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),o=t[n],i=t[n+1],a=n>0?t[n-1]:2*o-i,u=n<e-1?t[n+2]:2*i-o;return Xe((r-n/e)*e,a,o,i,u)}})),Ke((function(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),o=t[(n+e-1)%e],i=t[n%e],a=t[(n+1)%e],u=t[(n+2)%e];return Xe((r-n/e)*e,o,i,a,u)}}));var Qe=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tr=new RegExp(Qe.source,"g");function er(t,e){var r,n,o,i=Qe.lastIndex=tr.lastIndex=0,a=-1,u=[],l=[];for(t+="",e+="";(r=Qe.exec(t))&&(n=tr.exec(e));)(o=n.index)>i&&(o=e.slice(i,o),u[a]?u[a]+=o:u[++a]=o),(r=r[0])===(n=n[0])?u[a]?u[a]+=n:u[++a]=n:(u[++a]=null,l.push({i:a,x:ne(r,n)})),i=tr.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 r,n=0;n<e;++n)u[(r=l[n]).i]=r.x(t);return u.join("")})}function rr(t,e){var r;return("number"==typeof e?ne:e instanceof Me?Je:(r=Me(e))?(e=r,Je):er)(t,e)}function nr(t){return function(){this.removeAttribute(t)}}function or(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ir(t,e,r){var n,o,i=r+"";return function(){var a=this.getAttribute(t);return a===i?null:a===n?o:o=e(n=a,r)}}function ar(t,e,r){var n,o,i=r+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===n?o:o=e(n=a,r)}}function ur(t,e,r){var n,o,i;return function(){var a,u,l=r(this);if(null!=l)return(a=this.getAttribute(t))===(u=l+"")?null:a===n&&u===o?i:(o=u,i=e(n=a,l));this.removeAttribute(t)}}function lr(t,e,r){var n,o,i;return function(){var a,u,l=r(this);if(null!=l)return(a=this.getAttributeNS(t.space,t.local))===(u=l+"")?null:a===n&&u===o?i:(o=u,i=e(n=a,l));this.removeAttributeNS(t.space,t.local)}}function cr(t,e){var r,n;function o(){var o=e.apply(this,arguments);return o!==n&&(r=(n=o)&&function(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}(t,o)),r}return o._value=e,o}function sr(t,e){var r,n;function o(){var o=e.apply(this,arguments);return o!==n&&(r=(n=o)&&function(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}(t,o)),r}return o._value=e,o}function fr(t,e){return function(){Qt(this,t).delay=+e.apply(this,arguments)}}function hr(t,e){return e=+e,function(){Qt(this,t).delay=e}}function yr(t,e){return function(){te(this,t).duration=+e.apply(this,arguments)}}function pr(t,e){return e=+e,function(){te(this,t).duration=e}}var vr=yt.prototype.constructor;function dr(t){return function(){this.style.removeProperty(t)}}var mr=0;function br(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function gr(){return++mr}var wr=yt.prototype;br.prototype=function(t){return yt().transition(t)}.prototype={constructor:br,select:function(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=n(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,Kt(h[y],e,r,y,h,ee(l,r)));return new br(a,this._parents,e,r)},selectAll:function(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=i(t));for(var n=this._groups,o=n.length,a=[],u=[],l=0;l<o;++l)for(var c,s=n[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,r),d=0,m=p.length;d<m;++d)(y=p[d])&&Kt(y,e,r,d,p,v);a.push(p),u.push(c)}return new br(a,u,e,r)},selectChild:wr.selectChild,selectChildren:wr.selectChildren,filter:function(t){"function"!=typeof t&&(t=a(t));for(var e=this._groups,r=e.length,n=new Array(r),o=0;o<r;++o)for(var i,u=e[o],l=u.length,c=n[o]=[],s=0;s<l;++s)(i=u[s])&&t.call(i,i.__data__,s,u)&&c.push(i);return new br(n,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,n=e.length,o=r.length,i=Math.min(n,o),a=new Array(n),u=0;u<i;++u)for(var l,c=e[u],s=r[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<n;++u)a[u]=e[u];return new br(a,this._parents,this._name,this._id)},selection:function(){return new vr(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,r=gr(),n=this._groups,o=n.length,i=0;i<o;++i)for(var a,u=n[i],l=u.length,c=0;c<l;++c)if(a=u[c]){var s=ee(a,e);Kt(a,t,r,c,u,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new br(n,this._parents,t,r)},call:wr.call,nodes:wr.nodes,node:wr.node,size:wr.size,empty:wr.empty,each:wr.each,on:function(t,e){var r=this._id;return arguments.length<2?ee(this.node(),r).on.on(t):this.each(function(t,e,r){var n,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!==n&&(o=(n=u).copy()).on(e,r),a.on=o}}(r,t,e))},attr:function(t,e){var r=x(t),n="transform"===r?se:rr;return this.attrTween(t,"function"==typeof e?(r.local?lr:ur)(r,n,ye(this,"attr."+t,e)):null==e?(r.local?or:nr)(r):(r.local?ar:ir)(r,n,e))},attrTween:function(t,e){var r="attr."+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;var n=x(t);return this.tween(r,(n.local?cr:sr)(n,e))},style:function(t,e,r){var n="transform"==(t+="")?ce:rr;return null==e?this.styleTween(t,function(t,e){var r,n,o;return function(){var i=M(this,t),a=(this.style.removeProperty(t),M(this,t));return i===a?null:i===r&&a===n?o:o=e(r=i,n=a)}}(t,n)).on("end.style."+t,dr(t)):"function"==typeof e?this.styleTween(t,function(t,e,r){var n,o,i;return function(){var a=M(this,t),u=r(this),l=u+"";return null==u&&(this.style.removeProperty(t),l=u=M(this,t)),a===l?null:a===n&&l===o?i:(o=l,i=e(n=a,u))}}(t,n,ye(this,"style."+t,e))).each(function(t,e){var r,n,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=dr(e)):void 0;c===r&&o===s||(n=(r=c).copy()).on(u,o=s),l.on=n}}(this._id,t)):this.styleTween(t,function(t,e,r){var n,o,i=r+"";return function(){var a=M(this,t);return a===i?null:a===n?o:o=e(n=a,r)}}(t,n,e),r).on("end.style."+t,null)},styleTween:function(t,e,r){var n="style."+(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;return this.tween(n,function(t,e,r){var n,o;function i(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&function(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}(t,i,r)),n}return i._value=e,i}(t,e,null==r?"":r))},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,r;function n(){var n=t.apply(this,arguments);return n!==r&&(e=(r=n)&&function(t){return function(e){this.textContent=t.call(this,e)}}(n)),e}return n._value=t,n}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var r=this._id;if(t+="",arguments.length<2){for(var n,o=ee(this.node(),r).tween,i=0,a=o.length;i<a;++i)if((n=o[i]).name===t)return n.value;return null}return this.each((null==e?fe:he)(r,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?fr:hr)(e,t)):ee(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?yr:pr)(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 r=e.apply(this,arguments);if("function"!=typeof r)throw new Error;te(this,t).ease=r}}(this._id,t))},end:function(){var t,e,r=this,n=r._id,o=r.size();return new Promise((function(i,a){var u={value:a},l={value:function(){0==--o&&i()}};r.each((function(){var r=te(this,n),o=r.on;o!==t&&((e=(t=o).copy())._.cancel.push(u),e._.interrupt.push(u),e._.end.push(l)),r.on=e})),0===o&&i()}))},[Symbol.iterator]:wr[Symbol.iterator]};var xr={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Sr(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}yt.prototype.interrupt=function(t){return this.each((function(){re(this,t)}))},yt.prototype.transition=function(t){var e,r;t instanceof br?(e=t._id,t=t._name):(e=gr(),(r=xr).time=It(),t=null==t?null:t+"");for(var n=this._groups,o=n.length,i=0;i<o;++i)for(var a,u=n[i],l=u.length,c=0;c<l;++c)(a=u[c])&&Kt(a,t,e,c,u,r||Sr(a,e));return new br(n,this._parents,t,e)};const _r=t=>()=>t;function Or(t,{sourceEvent:e,target:r,transform:n,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:o}})}function jr(t,e,r){this.k=t,this.x=e,this.y=r}jr.prototype={constructor:jr,scale:function(t){return 1===t?this:new jr(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new jr(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 Pr=new jr(1,0,0);function kr(t){t.stopImmediatePropagation()}function Cr(t){t.preventDefault(),t.stopImmediatePropagation()}function Er(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Tr(){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 Ar(){return this.__zoom||Pr}function Mr(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Rr(){return navigator.maxTouchPoints||"ontouchstart"in this}function Lr(t,e,r){var n=t.invertX(e[0][0])-r[0][0],o=t.invertX(e[1][0])-r[1][0],i=t.invertY(e[0][1])-r[0][1],a=t.invertY(e[1][1])-r[1][1];return t.translate(o>n?(n+o)/2:Math.min(0,n)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}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 Fr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ir(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==zr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==zr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===zr(o)?o:String(o)),n)}var o}jr.prototype;var Nr=function(){function t(e,r,n,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=r||{x:.5*this.w,y:.5*this.h},this.zf=n,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=Pr;(function(){var t,e,r,n=Er,o=Tr,i=Lr,a=Mr,u=Rr,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",Ar).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",P).filter(u).on("touchstart.zoom",k).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",E).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 jr(e,t.x,t.y)}function g(t,e,r){var n=e[0]-r[0]*t.k,o=e[1]-r[1]*t.k;return n===t.x&&o===t.y?t:new jr(t.k,n,o)}function w(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function x(t,e,r,n){t.on("start.zoom",(function(){S(this,arguments).event(n).start()})).on("interrupt.zoom end.zoom",(function(){S(this,arguments).event(n).end()})).tween("zoom",(function(){var t=this,i=arguments,a=S(t,i).event(n),u=o.apply(t,i),l=null==r?w(u):"function"==typeof r?r.apply(t,i):r,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),r=c/e[2];t=new jr(r,l[0]-e[0]*r,l[1]-e[1]*r)}a.zoom(null,t)}}))}function S(t,e,r){return!r&&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(n.apply(this,arguments)){var r=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(r.wheel)r.mouse[0][0]===s[0]&&r.mouse[0][1]===s[1]||(r.mouse[1]=o.invert(r.mouse[0]=s)),clearTimeout(r.wheel);else{if(o.k===u)return;r.mouse=[s,o.invert(s)],re(this),r.start()}Cr(t),r.wheel=setTimeout((function(){r.wheel=null,r.end()}),p),r.zoom("mouse",i(g(b(o,u),r.mouse[0],r.mouse[1]),r.extent,c))}}function j(t,...e){if(!r&&n.apply(this,arguments)){var o=t.currentTarget,a=S(this,e,!0).event(t),u=pt(t.view).on("mousemove.zoom",(function(t){if(Cr(t),!a.moved){var e=t.clientX-s,r=t.clientY-f;a.moved=e*e+r*r>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 r=t.document.documentElement,n=pt(t).on("dragstart.drag",null);e&&(n.on("click.drag",St,xt),setTimeout((function(){n.on("click.drag",null)}),0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}(t.view,a.moved),Cr(t),a.event(t).end()}),!0),l=jt(t,o),s=t.clientX,f=t.clientY;!function(t){var e=t.document.documentElement,r=pt(t).on("dragstart.drag",St,xt);"onselectstart"in e?r.on("selectstart.drag",St,xt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(t.view),kr(t),a.mouse=[l,this.__zoom.invert(l)],re(this),a.start()}}function P(t,...e){if(n.apply(this,arguments)){var r=this.__zoom,a=jt(t.changedTouches?t.changedTouches[0]:t,this),u=r.invert(a),l=r.k*(t.shiftKey?.5:2),f=i(g(b(r,l),a,u),o.apply(this,e),c);Cr(t),s>0?pt(this).transition().duration(s).call(x,f,a,t):pt(this).call(m.transform,f,a,t)}}function k(r,...o){if(n.apply(this,arguments)){var i,a,u,l,c=r.touches,s=c.length,f=S(this,o,r.changedTouches.length===s).event(r);for(kr(r),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)),re(this),f.start())}}function C(t,...e){if(this.__zooming){var r,n,o,a,u=S(this,e).event(t),l=t.changedTouches,s=l.length;for(Cr(t),r=0;r<s;++r)o=jt(n=l[r],this),u.touch0&&u.touch0[2]===n.identifier?u.touch0[0]=o:u.touch1&&u.touch1[2]===n.identifier&&(u.touch1[0]=o);if(n=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;n=b(n,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(n,o,a),u.extent,c))}}function E(t,...n){if(this.__zooming){var o,i,a=S(this,n).event(t),u=t.changedTouches,l=u.length;for(kr(t),r&&clearTimeout(r),r=setTimeout((function(){r=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,r,n){var o=t.selection?t.selection():t;o.property("__zoom",Ar),t!==o?x(t,e,r,n):o.interrupt().each((function(){S(this,arguments).event(n).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},m.scaleBy=function(t,e,r,n){m.scaleTo(t,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),r,n)},m.scaleTo=function(t,e,r,n){m.transform(t,(function(){var t=o.apply(this,arguments),n=this.__zoom,a=null==r?w(t):"function"==typeof r?r.apply(this,arguments):r,u=n.invert(a),l="function"==typeof e?e.apply(this,arguments):e;return i(g(b(n,l),a,u),t,c)}),r,n)},m.translateBy=function(t,e,r,n){m.transform(t,(function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof r?r.apply(this,arguments):r),o.apply(this,arguments),c)}),null,n)},m.translateTo=function(t,e,r,n,a){m.transform(t,(function(){var t=o.apply(this,arguments),a=this.__zoom,u=null==n?w(t):"function"==typeof n?n.apply(this,arguments):n;return i(Pr.translate(u[0],u[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof r?-r.apply(this,arguments):-r),t,c)}),n,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 Or(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:_r(+t),m):a},m.filter=function(t){return arguments.length?(n="function"==typeof t?t:_r(!!t),m):n},m.touchable=function(t){return arguments.length?(u="function"==typeof t?t:_r(!!t),m):u},m.extent=function(t){return arguments.length?(o="function"==typeof t?t:_r([[+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,r=u.k/e.k;if(1==r){var n=u.x-e.x,o=u.y-e.y;i.pan(n*i.getZf(),-o*i.getZf())}else{var a=t.sourceEvent;if(a instanceof WheelEvent)i.zoom(r,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 r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Fr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Fr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.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(r,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,r,n;return e=t,r=[{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,r=this.center.y/this.getZf()+.5*this.h;this.ctx.setTransform(t,0,0,-t,e,r)}},{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,r=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 n=t*this.getZf();n<this.zfExtent[0]&&(t=this.zfExtent[0]/this.getZf()),n>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=(r-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(r)*(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"),r=t.getParameterByName("y"),n=t.getParameterByName("z"),o=this.getCenter();null==e||null==e||isNaN(+e)||(o.x=+e),null==r||null==r||isNaN(+r)||(o.y=+r),null==n||null==n||isNaN(+n)||this.setZf(+n)}},{key:"addZoomSlider",value:function(t,e){(e=e||{}).width=e.width||"30px",e.height=e.height||"300px";var r=pt("#"+t);if(r.empty())return console.error("Could not find div element to build zoom slider. Id: "+t),this;var n=this;return this.slider=r.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),n.setZf(e),n.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}}],n=[{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}}],r&&Ir(e.prototype,r),n&&Ir(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Br(t){return Br="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},Br(t)}function Dr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Br(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Br(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Br(o)?o:String(o)),n)}var o}var Gr=function(){function t(e,r){var n=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),n=n||{},this.dataset=e,this.styles=r,this.visible=!1!==n.visible,this.alpha=n.alpha,this.blendOperation=n.blendOperation||function(t){return"source-over"},this.minZoom=n.minZoom||0,this.maxZoom=n.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=n.pixNb||3,this.cellInfoHTML=n.cellInfoHTML||t.defaultCellInfoHTML}var e,r,n;return e=t,n=[{key:"defaultCellInfoHTML",value:function(t){for(var e=[],r=0,n=Object.keys(t);r<n.length;r++){var o=n[r];"x"!==o&&"y"!==o&&e.push("<b>",o,"</b>"," : ",t[o],"<br>")}return e.join("")}}],(r=[{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,r=0,n=e[r]/this.pixNb;n<t&&r<e.length;)n=e[++r]/this.pixNb;return r==e.length?this.dataset.datasetComponents[e.length-1]:this.dataset.datasetComponents[r]}}}])&&Dr(e.prototype,r),n&&Dr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();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 Wr(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ur(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ur(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Ur(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function $r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Zr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Zr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Zr(o)?o:String(o)),n)}var o}var Yr=function(){function t(e,r){var n=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),n=n||{},this.datasetComponents=e,this.resolutions=r,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);n.preprocess&&this.setPrepocesses(n.preprocess)}var e,r,n;return e=t,n=[{key:"make",value:function(e,r,n){var o,i=[],a=Wr(e);try{for(a.s();!(o=a.n()).done;){var u=o.value;i.push(r(u))}}catch(t){a.e(t)}finally{a.f()}return new t(i,e,n)}}],(r=[{key:"setPrepocesses",value:function(t){var e,r=Wr(this.datasetComponents);try{for(r.s();!(e=r.n()).done;)e.value.preprocess=t}catch(t){r.e(t)}finally{r.f()}return this}}])&&$r(e.prototype,r),n&&$r(e,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 Xr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Vr(n.key),n)}}function Vr(t){var e=function(t,e){if("object"!==Hr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Hr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Hr(e)?e:String(e)}var qr=function(){function t(e){var r,n,o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=this,o=function(t,e){var r=this.tooltip.node(),n=e.width;if(r.offsetLeft+r.clientWidth>n){var o=t.pageX-e.left-r.clientWidth-this.xOffset;if(r.style.left=o+"px",r.offsetLeft+r.clientWidth+e.left>t.pageX){var i=t.pageX-(r.clientWidth+this.xOffset+e.left);r.style.left=i+"px"}}r.offsetTop+r.clientHeight>e.height&&(r.style.top=r.offsetTop-r.clientHeight+"px")},(n=Vr(n="ensureTooltipInsideContainer"))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=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,r;return e=t,r=[{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)}}],r&&Xr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Jr={},Kr={};function Qr(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function tn(t){var e=Object.create(null),r=[];return t.forEach((function(t){for(var n in t)n in e||r.push(e[n]=n)})),r}function en(t,e){var r=t+"",n=r.length;return n<e?new Array(e-n+1).join(0)+r:r}function rn(t){var e=new RegExp('["'+t+"\n\r]"),r=t.charCodeAt(0);function n(t,e){var n,o=[],i=t.length,a=0,u=0,l=i<=0,c=!1;function s(){if(l)return Kr;if(c)return c=!1,Jr;var e,n,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===(n=t.charCodeAt(a++))?c=!0:13===n&&(c=!0,10===t.charCodeAt(a)&&++a),t.slice(o+1,e-1).replace(/""/g,'"')}for(;a<i;){if(10===(n=t.charCodeAt(e=a++)))c=!0;else if(13===n)c=!0,10===t.charCodeAt(a)&&++a;else if(n!==r)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;(n=s())!==Kr;){for(var f=[];n!==Jr&&n!==Kr;)f.push(n),n=s();e&&null==(f=e(f,u++))||o.push(f)}return o}function o(e,r){return e.map((function(e){return r.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=(r=t).getUTCHours(),i=r.getUTCMinutes(),a=r.getUTCSeconds(),u=r.getUTCMilliseconds(),isNaN(r)?"Invalid Date":((n=r.getUTCFullYear())<0?"-"+en(-n,6):n>9999?"+"+en(n,6):en(n,4))+"-"+en(r.getUTCMonth()+1,2)+"-"+en(r.getUTCDate(),2)+(u?"T"+en(o,2)+":"+en(i,2)+":"+en(a,2)+"."+en(u,3)+"Z":a?"T"+en(o,2)+":"+en(i,2)+":"+en(a,2)+"Z":i||o?"T"+en(o,2)+":"+en(i,2)+"Z":"")):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t;var r,n,o,i,a,u}return{parse:function(t,e){var r,o,i=n(t,(function(t,n){if(r)return r(t,n-1);o=t,r=e?function(t,e){var r=Qr(t);return function(n,o){return e(r(n),o,t)}}(t,e):Qr(t)}));return i.columns=o||[],i},parseRows:n,format:function(e,r){return null==r&&(r=tn(e)),[r.map(a).join(t)].concat(o(e,r)).join("\n")},formatBody:function(t,e){return null==e&&(e=tn(t)),o(t,e).join("\n")},formatRows:function(t){return t.map(i).join("\n")},formatRow:i,formatValue:a}}var nn=rn(","),on=nn.parse,an=(nn.parseRows,nn.format,nn.formatBody,nn.formatRows,nn.formatRow,nn.formatValue,rn("\t")),un=an.parse;function ln(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function cn(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=void 0),function(t,e){return fetch(t,e).then(ln)}(e,r).then((function(e){return t(e,n)}))}}an.parseRows,an.format,an.formatBody,an.formatRows,an.formatRow,an.formatValue;var sn=cn(on);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 hn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function yn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==fn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==fn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===fn(o)?o:String(o)),n)}var o}cn(un);var pn=function(){function t(e,r){var n=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),n=n||{},this.url=e,this.resolution=r,this.preprocess=n.preprocess||void 0,this.cellsViewCache=[]}var e,r;return e=t,(r=[{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 r,n=this.getResolution(),o=n*Math.floor(t.x/n),i=n*Math.floor(t.y/n),a=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return hn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?hn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(e);try{for(a.s();!(r=a.n()).done;){var u=r.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}}])&&yn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function vn(t){return vn="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},vn(t)}function dn(){dn=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return n(a,"_invoke",{value:x(t,r,u)}),a}function s(t,e,r){try{return{type:"source-over",arg:t.call(e,r)}}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&&r.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(n,i,a,u){var l=s(t[n],t,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==vn(f)&&r.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;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=S(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(t,e,r);if("source-over"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,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="source-over",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 n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],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,n(b,"constructor",{value:p,configurable:!0}),n(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,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?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),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,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)&&r.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 n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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"):"source-over"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function mn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return bn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function bn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function gn(t,e,r,n,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function wn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==vn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==vn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===vn(o)?o:String(o)),n)}var o}function xn(t,e){return xn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xn(t,e)}function Sn(t){return Sn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sn(t)}var _n=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&&xn(t,e)}(a,t);var e,r,n,o,i=(n=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=Sn(n);if(o){var r=Sn(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===vn(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 r,n=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),(r=i.call(this,t,e,n)).cells=[],r.infoLoadingStatus="notLoaded",r}return e=a,r=[{key:"getData",value:function(t,e){var r,n=this;return"notLoaded"!=this.infoLoadingStatus||(this.infoLoadingStatus="loading",(r=dn().mark((function t(){var r,o,i,a,u,l,c;return dn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,sn(n.url);case 3:r=t.sent,o=mn(r);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(!n.preprocess){t.next=29;break}n.cells=[],u=mn(r),t.prev=9,u.s();case 11:if((l=u.n()).done){t.next=19;break}if(c=l.value,0!=n.preprocess(c)){t.next=16;break}return t.abrupt("continue",17);case 16:n.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:n.cells=r;case 30:e&&e(),n.infoLoadingStatus="loaded",t.next=38;break;case 34:t.prev=34,t.t1=t.catch(0),n.infoLoadingStatus="failed",n.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(n,o){var i=r.apply(t,e);function a(t){gn(i,n,o,a,u,"next",t)}function u(t){gn(i,n,o,a,u,"throw",t)}a(void 0)}))})()),this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,r=mn(this.cells);try{for(r.s();!(e=r.n()).done;){var n=e.value;+n.x+this.resolution<t.xMin||+n.x-this.resolution>t.xMax||+n.y+this.resolution<t.yMin||+n.y-this.resolution>t.yMax||this.cellsViewCache.push(n)}}catch(t){r.e(t)}finally{r.f()}}}}],r&&wn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(pn);function On(t){return On="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},On(t)}function jn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Pn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==On(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==On(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===On(o)?o:String(o)),n)}var o}function kn(t,e){return kn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kn(t,e)}function Cn(t){return Cn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Cn(t)}var En=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&&kn(t,e)}(a,t);var e,r,n,o,i=(n=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=Cn(n);if(o){var r=Cn(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===On(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 r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(r=i.call(this,"",t)).cells=e||[],r}return e=a,(r=[{key:"getData",value:function(t,e){return this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return jn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(this.cells);try{for(r.s();!(e=r.n()).done;){var n=e.value;+n.x+this.resolution<t.xMin||+n.x-this.resolution>t.xMax||+n.y+this.resolution<t.yMin||+n.y-this.resolution>t.yMax||this.cellsViewCache.push(n)}}catch(t){r.e(t)}finally{r.f()}}}}])&&Pn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(pn);function Tn(t){return Tn="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},Tn(t)}function An(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Mn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Tn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Tn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Tn(o)?o:String(o)),n)}var o}function Rn(t,e,r){return e&&Mn(t.prototype,e),r&&Mn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var Ln=Rn((function t(e,r,n,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=r,this.y=n;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 r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return An(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?An(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.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 zn(t,e){if(e){if(0==e.length)return 0;if(t<=e[0])return 0;for(var r=1;r<e.length;r++)if(e[r-1]<t&&t<=e[r])return r;return e.length}}function Fn(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function In(t,e){return fetch(t,e).then(Fn)}function Nn(t){return Nn="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},Nn(t)}function Bn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Dn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Dn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Dn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Gn(){Gn=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return n(a,"_invoke",{value:x(t,r,u)}),a}function s(t,e,r){try{return{type:"source-over",arg:t.call(e,r)}}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&&r.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(n,i,a,u){var l=s(t[n],t,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==Nn(f)&&r.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;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=S(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(t,e,r);if("source-over"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,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="source-over",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 n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],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,n(b,"constructor",{value:p,configurable:!0}),n(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,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?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),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,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)&&r.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 n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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"):"source-over"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Zn(t,e,r,n,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function Wn(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Zn(i,n,o,a,u,"next",t)}function u(t){Zn(i,n,o,a,u,"throw",t)}a(void 0)}))}}function Un(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Nn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Nn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Nn(o)?o:String(o)),n)}var o}function $n(t,e){return $n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$n(t,e)}function Yn(t){return Yn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yn(t)}var Hn=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&&$n(t,e)}(a,t);var e,r,n,o,i=(n=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=Yn(n);if(o){var r=Yn(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Nn(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 r,n=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),(r=i.call(this,t,0,n)).app=e,r.info=void 0,r.infoLoadingStatus="notLoaded",r.cache={},r}return e=a,(r=[{key:"loadInfo",value:function(t){var e=this;return this.info||"notLoaded"!==this.infoLoadingStatus?!t||"loaded"!==this.infoLoadingStatus&&"failed"!==this.infoLoadingStatus||t():Wn(Gn().mark((function r(){var n;return Gn().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,In(e.url+"info.json");case 3:n=r.sent,e.info=n,e.resolution=n.resolutionGeo,e.infoLoadingStatus="loaded",t&&t(),r.next=13;break;case 10:r.prev=10,r.t0=r.catch(0),e.infoLoadingStatus="failed";case 13:case"end":return r.stop()}}),r,null,[[0,10]])})))(),this}},{key:"getTilingEnvelope",value:function(t){if(this.info){var e=this.info.originPoint,r=this.info.resolutionGeo,n=this.info.tileSizeCell;return{xMin:Math.floor((t.xMin-e.x)/(r*n)),xMax:Math.floor((t.xMax-e.x)/(r*n)),yMin:Math.floor((t.yMin-e.y)/(r*n)),yMax:Math.floor((t.yMax-e.y)/(r*n))}}this.loadInfo((function(){}))}},{key:"getData",value:function(t,e){var r=this;if(!this.info)return this;var n=this.getTilingEnvelope(t);if(!n)return this;for(var o=this.info.tilingBounds,i=function(t){for(var i=function(n){if(r.cache[t]||(r.cache[t]={}),r.cache[t][n])return"continue";r.cache[t][n]="loading",Wn(Gn().mark((function o(){var i,a,u,l,c,s,f,h,y,p,v,d,m;return Gn().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,sn(r.url+t+"/"+n+".csv");case 3:if(a=o.sent,!r.preprocess){o.next=28;break}i=[],u=Bn(a),o.prev=8,u.s();case 10:if((l=u.n()).done){o.next=18;break}if(c=l.value,0!=r.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),r.cache[t][n]="failed",o.abrupt("return");case 36:if(r.info){o.next=39;break}return console.error("Tile info inknown"),o.abrupt("return");case 39:if(s=new Ln(i,t,n,r.info),r.cache[t][n]=s,e){o.next=44;break}return o.abrupt("return");case 44:f=!1,h=r.app.getZoomFactor(),y=Bn(r.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)==r){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=r.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(n.yMin,o.yMin);a<=Math.min(n.yMax,o.yMax);a++)i(a)},a=Math.max(n.xMin,o.xMin);a<=Math.min(n.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 r=this.info.tilingBounds,n=Math.max(e.xMin,r.xMin);n<=Math.min(e.xMax,r.xMax);n++)if(this.cache[n])for(var o=Math.max(e.yMin,r.yMin);o<=Math.min(e.yMax,r.yMax);o++){var i=this.cache[n][o];if(i&&"string"!=typeof i){var a,u=Bn(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()}}}}}}])&&Un(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(pn);function Xn(t){return Xn="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},Xn(t)}function Vn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Xn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Xn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Xn(o)?o:String(o)),n)}var o}var qn=function(){function t(e){var r=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,n){return r.url+n+"/"+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,r;return e=t,(r=[{key:"get",value:function(t,e,r){var n=this.cache[t];if(n&&(n=n[e]))return n[r]}},{key:"put",value:function(t,e,r,n){this.cache[e]||(this.cache[e]={}),this.cache[e][r]||(this.cache[e][r]={}),this.cache[e][r][n]=t}},{key:"draw",value:function(t){var e=this;if(this.resolutions&&0!=this.resolutions.length){var r=t.getZf(),n=this.origin[0],o=this.origin[1],i=0;for(i=0;i<this.resolutions.length&&!(this.resolutions[i]<r);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/r,c=function(t){return Math.ceil((t-n)/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(r){for(var a=function(a){var c=e.get(i,r,a);if(!c){var s=new Image;return e.put(s,i,r,a),s.onload=function(){t.redraw()},s.onerror=function(){e.put("failed",i,r,a)},s.src=e.urlFun(r,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=n+r*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(r);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")}}])&&Vn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Jn(t){return Jn="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},Jn(t)}function Kn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Jn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Jn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Jn(o)?o:String(o)),n)}var o}var Qn=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,r;return e=t,(r=[{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 r=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",r)}),this.img.src=r}var n=t.getZf();if(this.filterColor){var o=this.filterColor(n);o&&"none"!=o&&(t.ctx.fillStyle=o,t.ctx.fillRect(0,0,t.w,t.h))}}}])&&Kn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function to(t){return to="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},to(t)}function eo(){eo=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return n(a,"_invoke",{value:x(t,r,u)}),a}function s(t,e,r){try{return{type:"source-over",arg:t.call(e,r)}}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&&r.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(n,i,a,u){var l=s(t[n],t,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==to(f)&&r.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;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=S(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(t,e,r);if("source-over"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,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="source-over",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 n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],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,n(b,"constructor",{value:p,configurable:!0}),n(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,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?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),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,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)&&r.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 n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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"):"source-over"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function ro(t,e,r,n,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function no(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return oo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?oo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function oo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function io(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==to(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==to(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===to(o)?o:String(o)),n)}var o}var ao=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,r,n,o;return e=t,r=[{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 r,n=no(this.labels);try{for(n.s();!(r=n.n()).done;){var o=r.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){n.e(t)}finally{n.f()}}else this.load(t.redraw)}},{key:"load",value:(n=eo().mark((function t(e){var r,n,o,i;return eo().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,sn(this.url);case 11:if(r=t.sent,!this.preprocess){t.next=35;break}this.labels=[],n=no(r),t.prev=15,n.s();case 17:if((o=n.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),n.e(t.t0);case 30:return t.prev=30,n.f(),t.finish(30);case 33:t.next=36;break;case 35:this.labels=r;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(r,o){var i=n.apply(t,e);function a(t){ro(i,r,o,a,u,"next",t)}function u(t){ro(i,r,o,a,u,"throw",t)}a(void 0)}))},function(t){return o.apply(this,arguments)})}],r&&io(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function uo(t){return uo="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},uo(t)}function lo(){lo=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return n(a,"_invoke",{value:x(t,r,u)}),a}function s(t,e,r){try{return{type:"source-over",arg:t.call(e,r)}}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&&r.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(n,i,a,u){var l=s(t[n],t,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==uo(f)&&r.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;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=S(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(t,e,r);if("source-over"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,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="source-over",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 n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],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,n(b,"constructor",{value:p,configurable:!0}),n(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,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?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),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,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)&&r.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 n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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"):"source-over"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function co(t,e,r,n,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function so(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return fo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function fo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ho(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==uo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==uo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===uo(o)?o:String(o)),n)}var o}var yo=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,r,n,o;return e=t,r=[{key:"draw",value:function(t){if(this.fs){var e=t.getZf();t.setCanvasTransform();var r,n=so(this.fs);try{for(n.s();!(r=n.n()).done;){var o=r.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){n.e(t)}finally{n.f()}t.ctx.setLineDash([])}else this.load(t.redraw)}},{key:"load",value:(n=lo().mark((function t(e){var r,n,o,i,a;return lo().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,In(this.url);case 11:if(r=t.sent,n=r.features,!this.preprocess){t.next=36;break}this.fs=[],o=so(n),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=n;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(r,o){var i=n.apply(t,e);function a(t){co(i,r,o,a,u,"next",t)}function u(t){co(i,r,o,a,u,"throw",t)}a(void 0)}))},function(t){return o.apply(this,arguments)})}],r&&ho(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function po(t){return po="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},po(t)}function vo(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return mo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?mo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function mo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function bo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==po(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==po(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===po(o)?o:String(o)),n)}var o}var go=function(){function t(e,r){var n=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=r||{},this.layers=[],this.container=e||document.getElementById("gridviz"),this.container){this.w=r.w||this.container.offsetWidth,this.h=r.h||this.container.offsetHeight;var o=r.canvas||null;o||((o=document.createElement("canvas")).setAttribute("width",""+this.w),o.setAttribute("height",""+this.h),this.container.appendChild(o)),this.cg=new Nr(o,void 0,1,r),this.cg.redraw=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];n.legend&&t&&n.legend.selectAll("*").remove(),n.cg.initCanvasTransform(),n.cg.clear(n.cg.backgroundColor);var e=n.getZoomFactor();if(n.updateExtentGeo(),n.showBgLayers){var r,i=vo(n.bgLayers);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.visible&&(e>a.maxZoom||e<a.minZoom||a.draw(n.cg))}}catch(t){i.e(t)}finally{i.f()}}var u,l=vo(n.layers);try{for(l.s();!(u=l.n()).done;){var c=u.value;if(c.visible&&!(e>c.maxZoom||e<c.minZoom)){var s=c.getDatasetComponent(e);if(s){if(t&&s.getData(n.cg.extGeo,(function(){n.cg.redraw()})),t&&s.updateViewCache(n.cg.extGeo),n.cg.ctx.globalAlpha=c.alpha?c.alpha(e):1,n.cg.ctx.globalCompositeOperation=c.blendOperation(e),t){var f,h=vo(c.styles);try{for(h.s();!(f=h.n()).done;){var y=f.value;y.visible&&(e>y.maxZoom||e<y.minZoom||(n.cg.ctx.globalAlpha=y.alpha?y.alpha(e):1,n.cg.ctx.globalCompositeOperation=y.blendOperation(e),y.draw(s.getViewCache(),s.getResolution(),n.cg)))}}catch(t){h.e(t)}finally{h.f()}}if(n.legend&&t){var p,v=vo(c.styles);try{for(v.s();!(p=v.n()).done;){var d=p.value;if(!(e>d.maxZoom||e<d.minZoom)){var m,b=vo(d.legends);try{for(b.s();!(m=b.n()).done;){var g=m.value;n.legend.node().append(g.div.node())}}catch(t){b.e(t)}finally{b.f()}if(d.styles){var w,x=vo(d.styles);try{for(x.s();!(w=x.n()).done;){var S=w.value;if(!(e>S.maxZoom||e<S.minZoom)){var _,O=vo(S.legends);try{for(O.s();!(_=O.n()).done;){var j=_.value;n.legend.node().append(j.div.node())}}catch(t){O.e(t)}finally{O.f()}}}}catch(t){x.e(t)}finally{x.f()}}}}}catch(t){v.e(t)}finally{v.f()}}n.cg.ctx.globalAlpha=1,n.cg.ctx.globalCompositeOperation=n.defaultGlobalCompositeOperation}}}}catch(t){l.e(t)}finally{l.f()}return n.showBoundaries&&n.boundaryLayer&&n.boundaryLayer.draw(n.cg),n.showLabels&&n.labelLayer&&n.labelLayer.draw(n.cg),n.canvasSave=null,n.defineResizeObserver(n.container,o),n},this.bgLayers=[],this.showBgLayers=!0,this.labelLayer=void 0,this.showLabels=!0,this.boundaryLayer=void 0,this.showBoundaries=!0,this.legendDivId=r.legendDivId||"gvizLegend",this.legend=pt("#"+this.legendDivId),this.legend.empty()&&(this.legend=pt(this.container.id&&""!=this.container.id?"#"+this.container.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")),r.tooltip||(r.tooltip={}),r.tooltip.parentElement||(r.tooltip.parentElement=this.container),this.tooltip=new qr(r.tooltip);var i=function(t){var e={x:n.cg.pixToGeoX(t.offsetX+n.tooltip.xMouseOffset),y:n.cg.pixToGeoY(t.offsetY+n.tooltip.yMouseOffset)},o=n.getCellFocusInfo(e);if(r.transparentBackground)return o?(n.tooltip.setPosition(t),n.tooltip.show(),n.tooltip.html(o.html)):n.tooltip.hide(),n.canvasSave=document.createElement("canvas"),n.canvasSave.setAttribute("width",""+n.w),n.canvasSave.setAttribute("height",""+n.h),n.canvasSave.getContext("2d").drawImage(n.cg.canvas,0,0),void n.cg.initCanvasTransform();if(o){n.tooltip.setPosition(t),n.tooltip.show(),n.tooltip.html(o.html),n.canvasSave?n.cg.ctx.drawImage(n.canvasSave,0,0):(n.canvasSave=document.createElement("canvas"),n.canvasSave.setAttribute("width",""+n.w),n.canvasSave.setAttribute("height",""+n.h),n.canvasSave.getContext("2d").drawImage(n.cg.canvas,0,0));var i=n.selectionRectangleWidthPix?n.selectionRectangleWidthPix(o.resolution,n.getZoomFactor()):4;n.cg.initCanvasTransform(),n.cg.ctx.strokeStyle=n.selectionRectangleColor,n.cg.ctx.lineWidth=i,n.cg.ctx.beginPath(),n.cg.ctx.rect(n.cg.geoToPixX(o.cell.x)-i/2,n.cg.geoToPixY(o.cell.y)+i/2,o.resolution/n.getZoomFactor()+i,-o.resolution/n.getZoomFactor()-i),n.cg.ctx.stroke()}else n.tooltip.hide(),n.canvasSave&&n.cg.ctx.drawImage(n.canvasSave,0,0)};this.mouseOverHandler=function(t){return i(t)},this.mouseMoveHandler=function(t){return i(t)},this.mouseOutHandler=function(t){return n.tooltip.hide()},this.container.addEventListener("mouseover",this.mouseOverHandler),this.container.addEventListener("mousemove",this.mouseMoveHandler),this.container.addEventListener("mouseout",this.mouseOutHandler),this.cg.onZoomStartFun=function(t){r.onZoomStartFun&&r.onZoomStartFun(t),n.tooltip.hide()},this.canvasSave=null,this.selectionRectangleColor=r.selectionRectangleColor||"red",this.selectionRectangleWidthPix=r.selectionRectangleWidthPix||function(){return 4},this.defaultGlobalCompositeOperation=r.defaultGlobalCompositeOperation||this.cg.ctx.globalCompositeOperation}else console.error("Cannot find gridviz container element.")}var e,r;return e=t,r=[{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(),r=this.layers.length-1;r>=0;r--){var n=this.layers[r];if(n.visible&&n.cellInfoHTML&&"none"!==n.cellInfoHTML){var o=n.getDatasetComponent(e);if(o){var i=o.getCellFromPosition(t,o.getViewCache());if(!i)return;var a=n.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 yo(t),this}},{key:"getLabelLayer",value:function(){return this.labelLayer}},{key:"setLabelLayer",value:function(t){return this.labelLayer=new ao(t),this}},{key:"redraw",value:function(){return this.cg.redraw(),this}},{key:"addLayerFromDataset",value:function(t,e,r){var n=new Gr(t,e,r);return this.layers.push(n),this}},{key:"makeLGridDataset",value:function(t,e,r){return new Yr([new En(t,e)],[],r)}},{key:"makeCSVGridDataset",value:function(t,e,r){var n=this;return new Yr([new _n(t,e,r).getData(void 0,(function(){n.cg.redraw()}))],[],r)}},{key:"makeTiledGridDataset",value:function(t,e){var r=this;return new Yr([new Hn(t,this,e).loadInfo((function(){r.cg.redraw()}))],[],e)}},{key:"makeMultiScaleCSVGridDataset",value:function(t,e,r){var n=this;return Yr.make(t,(function(t){return new _n(e(t),t,r).getData(void 0,(function(){n.cg.redraw()}))}),r)}},{key:"makeMultiScaleTiledGridDataset",value:function(t,e,r){var n=this;return Yr.make(t,(function(t){return new Hn(e(t),n,r).loadInfo((function(){n.cg.redraw()}))}),r)}},{key:"addCSVGridLayer",value:function(t,e,r,n){var o=this.makeCSVGridDataset(t,e,n);return this.addLayerFromDataset(o,r,n)}},{key:"addTiledGridLayer",value:function(t,e,r){var n=this.makeTiledGridDataset(t,r);return this.addLayerFromDataset(n,e,r)}},{key:"addMultiScaleCSVGridLayer",value:function(t,e,r,n){var o=this.makeMultiScaleCSVGridDataset(t,e,n);return this.addLayerFromDataset(o,r,n)}},{key:"addMultiScaleTiledGridLayer",value:function(t,e,r,n){var o=this.makeMultiScaleTiledGridDataset(t,e,n);return this.addLayerFromDataset(o,r,n)}},{key:"addBackgroundLayer",value:function(t){return this.bgLayers.push(new qn(t)),this.redraw(),this}},{key:"addBackgroundLayerWMS",value:function(t){return this.bgLayers.push(new Qn(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 r=this;new ResizeObserver((function(n){t.clientWidth>0&&t.clientHeight>0&&window.requestAnimationFrame((function(){Array.isArray(n)&&n.length&&(r.h===t.clientHeight&&r.w===t.clientWidth||(r.h=t.clientHeight,r.w=t.clientWidth,r.cg.h=t.clientHeight,r.cg.w=t.clientWidth,e.setAttribute("width",""+r.w),e.setAttribute("height",""+r.h),r.redraw()))}))})).observe(t)}},{key:"destroy",value:function(){var t,e;this.layers=[],this.bgLayers=[],this.container.removeEventListener("mouseover",this.mouseOverHandler),this.container.removeEventListener("mousemove",this.mouseMoveHandler),this.container.removeEventListener("mouseout",this.mouseOutHandler),this.cg.canvas.remove(),null===(t=this.legend)||void 0===t||t.remove(),null===(e=this.tooltip.tooltip)||void 0===e||e.remove()}}],r&&bo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function wo(t){return wo="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},wo(t)}function xo(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return So(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?So(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function So(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==wo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==wo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===wo(o)?o:String(o)),n)}var o}var Oo=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,r){return{dx:0,dy:0}},this.visible=!1!==e.visible,this.alpha=e.alpha,this.blendOperation=e.blendOperation||function(t){return"source-over"},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,r,n;return e=t,n=[{key:"getStatistics",value:function(t,e,r){if(t&&0!=t.length){var n,o=1/0,i=-1/0,a=xo(t);try{for(a.s();!(n=a.n()).done;){var u=+e(n.value);r&&!u||(u<o&&(o=u),u>i&&(i=u))}}catch(t){a.e(t)}finally{a.f()}return{min:o,max:i}}}}],(r=[{key:"draw",value:function(t,e,r){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,r=xo(this.legends);try{for(r.s();!(e=r.n()).done;)e.value.update(t)}catch(t){r.e(t)}finally{r.f()}return this}}])&&_o(e.prototype,r),n&&_o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();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 r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ko(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==jo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==jo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===jo(o)?o:String(o)),n)}var o}function Co(t,e){return Co=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Co(t,e)}function Eo(t){return Eo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Eo(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&&Co(t,e)}(a,t);var e,r,n,o,i=(n=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=Eo(n);if(o){var r=Eo(this).constructor;t=Reflect.construct(e,arguments,r)}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.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,(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i,a=r.getZf();this.sizeCol&&(t.sort((function(t,e){return e[n.sizeCol]-t[n.sizeCol]})),o=Oo.getStatistics(t,(function(t){return t[n.sizeCol]}),!0)),this.colorCol&&(i=Oo.getStatistics(t,(function(t){return t[n.colorCol]}),!0)),r.setCanvasTransform();var u,l=.5*e,c=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Po(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Po(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.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){r.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;r.ctx.fillRect(s.x+v+p.dx,s.y+v+p.dy,y,y)}else if("circle"===h)r.ctx.beginPath(),r.ctx.arc(s.x+l+p.dx,s.y+l+p.dy,.5*y,0,2*Math.PI,!1),r.ctx.fill();else if("donut"===h){var d=s.x+l+p.dx,m=s.y+l+p.dy;r.ctx.beginPath(),r.ctx.moveTo(d,m),r.ctx.arc(d,m,l,0,2*Math.PI),r.ctx.arc(d,m,(1-y/e)*l,0,2*Math.PI,!0),r.ctx.closePath(),r.ctx.fill()}else{if("diamond"!==h)throw new Error("Unexpected shape:"+h);var b=.5*y;r.ctx.beginPath(),r.ctx.moveTo(s.x+l-b,s.y+l),r.ctx.lineTo(s.x+l,s.y+l+b),r.ctx.lineTo(s.x+l+b,s.y+l),r.ctx.lineTo(s.x+l,s.y+l-b),r.ctx.fill()}}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:a,sSize:o,sColor:i})}}])&&ko(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);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 r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ro(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ao(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ao(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ao(o)?o:String(o)),n)}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,r,n,o,i=(n=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(n);if(o){var r=zo(this).constructor;t=Reflect.construct(e,arguments,r)}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.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,(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i,a,u=r.getZf();this.strokeColorCol&&(o=Oo.getStatistics(t,(function(t){return t[n.strokeColorCol]}),!0)),this.sizeCol&&(i=Oo.getStatistics(t,(function(t){return t[n.sizeCol]}),!0)),this.strokeWidthCol&&(a=Oo.getStatistics(t,(function(t){return t[n.strokeWidthCol]}),!0)),r.setCanvasTransform();var l,c=.5*e,s=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Mo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Mo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.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){r.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)){r.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;r.ctx.beginPath(),r.ctx.rect(f.x+m+d.dx,f.y+m+d.dy,y,y),r.ctx.stroke()}else if("circle"===v)r.ctx.beginPath(),r.ctx.arc(f.x+c+d.dx,f.y+c+d.dy,.5*y,0,2*Math.PI,!1),r.ctx.stroke();else if("diamond"===v){var b=.5*y;r.ctx.beginPath(),r.ctx.moveTo(f.x+c-b,f.y+c),r.ctx.lineTo(f.x+c,f.y+c+b),r.ctx.lineTo(f.x+c+b,f.y+c),r.ctx.lineTo(f.x+c,f.y+c-b),r.ctx.lineTo(f.x+c-b,f.y+c),r.ctx.stroke()}else{if("donut"!==v)throw new Error("Unexpected shape:"+v);console.error("Not implemented")}}}}}}catch(t){s.e(t)}finally{s.f()}}}])&&Ro(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);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){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Bo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Io(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Io(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Io(o)?o:String(o)),n)}var o}function Do(t,e){return Do=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Do(t,e)}function Go(t){return Go=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Go(t)}var Zo=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&&Do(t,e)}(a,t);var e,r,n,o,i=(n=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=Go(n);if(o){var r=Go(this).constructor;t=Reflect.construct(e,arguments,r)}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.heightCol=t.heightCol,e.height=t.height||function(t){return Math.sqrt(t)},e.lineColor=t.lineColor||function(t,e,r,n){return"#BBB"},e.lineWidth=t.lineWidth||function(t,e,r,n){return n},e.fillColor=t.fillColor||function(t,e,r,n){return"#c08c5968"},e}return e=a,(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter)),r.ctx.lineJoin="round";var o,i=r.getZf(),a=Oo.getStatistics(t,(function(t){return t[n.heightCol]}),!0),u={},l=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return No(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?No(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.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=r.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};r.setCanvasTransform();for(var m=v;m>=p;m-=e){var b=u[m];if(b){r.ctx.beginPath(),r.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?r.ctx.lineTo(w+e/2,m+x):r.ctx.moveTo(w+e/2,m),g=x}g&&r.ctx.lineTo(y+e/2,m);var S=this.fillColor(m,d,e,i);S&&"none"!=S&&(r.ctx.fillStyle=S,r.ctx.fill());var _=this.lineColor(m,d,e,i),O=this.lineWidth(m,d,e,i);_&&"none"!=_&&O>0&&(r.ctx.strokeStyle=_,r.ctx.lineWidth=O,r.ctx.stroke())}}}}}])&&Bo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function Wo(t){return Wo="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},Wo(t)}function Uo(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||$o(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 $o(t,e){if(t){if("string"==typeof t)return Yo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Yo(t,e):void 0}}function Yo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ho(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Wo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Wo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Wo(o)?o:String(o)),n)}var o}function Xo(t,e){return Xo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xo(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&&Xo(t,e)}(a,t);var e,r,n,o,i=(n=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(n);if(o){var r=Vo(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Wo(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,r,n){return e},e.stripesOrientation=t.stripesOrientation||function(){return 0},e.offsetAngle=t.offsetAngle||function(){return 0},e.agePyramidHeight=t.agePyramidHeight||function(t,e,r){return e},e.pieChartInternalRadiusFactor=t.pieChartInternalRadiusFactor||0,e}return e=a,r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i=r.getZf();this.sizeCol&&(t.sort((function(t,e){return e[n.sizeCol]-t[n.sizeCol]})),o=Oo.getStatistics(t,(function(t){return t[n.sizeCol]}),!0));var a=Object.entries(this.color).length;r.setCanvasTransform();var u,l=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=$o(t))){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.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=Uo(_[S],2),j=O[0],P=O[1];if("agepyramid"===h){r.ctx.fillStyle=P;var k=s*c[j]/d;r.ctx.fillRect(y+(e-k)/2,p+w,k,x),w+=x}else if("radar"===h){r.ctx.fillStyle=P;var C=c[j],E=s/2*Math.sqrt(C/d);r.ctx.beginPath(),r.ctx.moveTo(y,p),r.ctx.arc(y,p,E,w-x,w),r.ctx.lineTo(y,p),r.ctx.fill(),w+=x}else{if("halftone"!==h)throw new Error("Unexpected symbol type:"+h);r.ctx.fillStyle=P;var T=c[j],A=.333*s*Math.sqrt(T/d);r.ctx.beginPath(),r.ctx.arc(y+.25*e*Math.cos(w),p+.25*e*Math.sin(w),A,0,2*Math.PI),r.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=Uo(D[B],2),Z=G[0],W=G[1],U=c[Z]/M;if(U&&!isNaN(U)){if(r.ctx.fillStyle=W,"flag"===h)0==N?r.ctx.fillRect(c.x+I+f.dx,c.y+I+F*s+f.dy,s,U*s):r.ctx.fillRect(c.x+I+F*s+f.dx,c.y+I+f.dy,U*s,s);else if("piechart"===h){var $=2*F*Math.PI,Y=2*(F+U)*Math.PI;r.ctx.beginPath(),r.ctx.moveTo(y,p),r.ctx.arc(y,p,.5*s,$+v,Y+v),this.pieChartInternalRadiusFactor&&r.ctx.arc(y,p,.5*s*this.pieChartInternalRadiusFactor,$+v,Y+v,!0),r.ctx.closePath(),r.ctx.fill()}else if("ring"===h)r.ctx.beginPath(),r.ctx.arc(y,p,Math.sqrt(1-F)*s*.5,0,2*Math.PI),r.ctx.fill();else{if("segment"!==h)throw new Error("Unexpected symbol type:"+h);var H=s*s/e;0==N?r.ctx.fillRect(c.x+f.dx,c.y+(e-H)/2+F*H+f.dy,e,U*H):r.ctx.fillRect(c.x+F*e+f.dx,c.y+(e-H)/2+f.dy,U*e,H)}F+=U}}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,r:e,zf:i,sSize:o})}}],r&&Ho(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);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 Ko(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Qo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Jo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Jo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Jo(o)?o:String(o)),n)}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 ri=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)}(a,t);var e,r,n,o,i=(n=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=ei(n);if(o){var r=ei(this).constructor;t=Reflect.construct(e,arguments,r)}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.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,(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i,a,u=r.getZf();this.colorCol&&(o=Oo.getStatistics(t,(function(t){return t[n.colorCol]}),!0)),this.lengthCol&&(t.sort((function(t,e){return e[n.lengthCol]-t[n.lengthCol]})),i=Oo.getStatistics(t,(function(t){return t[n.lengthCol]}),!0)),this.widthCol&&(a=Oo.getStatistics(t,(function(t){return t[n.widthCol]}),!0)),r.ctx.lineCap="butt";var l=Math.PI/180;r.setCanvasTransform();var c,s=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ko(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ko(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.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);r.ctx.strokeStyle=h,r.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;r.ctx.beginPath(),r.ctx.moveTo(m-g,b-w),r.ctx.lineTo(m+g,b+w),r.ctx.stroke()}}}}}}catch(t){s.e(t)}finally{s.f()}this.updateLegends({style:this,r:e,zf:u,sColor:o,sLength:i,sWidth:a})}}])&&Qo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function ni(t){return ni="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},ni(t)}function oi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ii(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ni(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ni(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ni(o)?o:String(o)),n)}var o}function ai(t,e){return ai=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ai(t,e)}function ui(t){return ui=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ui(t)}var li=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&&ai(t,e)}(u,t);var e,r,n,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=ui(o);if(i){var r=ui(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ni(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,r,n){return"X"},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.fontSizeCol=t.fontSizeCol,e.fontSize=t.fontSize||function(t,e,r,n){return.8*e},e.fontFamily=t.fontFamily||"Arial",e.fontWeight=t.fontWeight||"bold",e}return e=u,n=[{key:"getCharLegendFun",value:function(t){var e=t.length;return function(r){return 0==r?"":1==r?t[e-1]:t[Math.floor(r*e)]}}}],(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i,a,u=r.getZf();this.textCol&&(o=Oo.getStatistics(t,(function(t){return t[n.textCol]}),!0)),this.colorCol&&(i=Oo.getStatistics(t,(function(t){return t[n.colorCol]}),!0)),this.fontSizeCol&&(t.sort((function(t,e){return e[n.fontSizeCol]-t[n.fontSizeCol]})),a=Oo.getStatistics(t,(function(t){return t[n.fontSizeCol]}),!0)),r.initCanvasTransform();var l,c=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return oi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?oi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.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){r.ctx.fillStyle=h;var y=this.fontSize(s[this.fontSizeCol],e,a,u)/u,p=this.fontFamily||"Arial",v=this.fontWeight||"bold";r.ctx.font=v+" "+y+"px "+p;var d=this.offset(s,e,u);r.ctx.textAlign="center";var m=r.geoToPixX(s.x+.5*e+d.dx),b=r.geoToPixY(s.y+.5*e+d.dy)+.3*y;r.ctx.fillText(f,m,b)}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:u,sColor:i})}}])&&ii(e.prototype,r),n&&ii(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(Oo);function ci(t){return ci="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},ci(t)}function si(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return fi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function fi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function hi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ci(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ci(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ci(o)?o:String(o)),n)}var o}function yi(t,e){return yi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},yi(t,e)}function pi(t){return pi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},pi(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&&yi(t,e)}(a,t);var e,r,n,o,i=(n=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=pi(n);if(o){var r=pi(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ci(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=1==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,(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i,a,u=r.getZf();this.heightCol&&(o=Oo.getStatistics(t,(function(t){return t[n.heightCol]}),!0)),this.colorCol&&(i=Oo.getStatistics(t,(function(t){return t[n.colorCol]}),!0)),this.widthCol&&(a=Oo.getStatistics(t,(function(t){return t[n.widthCol]}),!0));var l=r.getCenter().x+this.viewSX*r.w*u,c=r.getCenter().y+this.viewSY*r.h*u,s=this.viewHeightFactor*(r.w+r.h)*.5*u;t.sort((function(t,e){return 1e8*(e.y-t.y)+t.x-e.x})),r.ctx.lineCap=this.simple?"butt":"round",r.setCanvasTransform(),r.ctx.strokeStyle=this.shadowColor,r.ctx.fillStyle=this.shadowColor;var f,h=si(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),r.ctx.lineWidth=p;var d=y.x+e/2,m=y.y+e/2,b=v*this.shadowFactor;r.ctx.beginPath(),r.ctx.moveTo(d,m),r.ctx.lineTo(d+b*Math.cos(this.shadowDirection),m+b*Math.sin(this.shadowDirection)),r.ctx.stroke()}}}}catch(t){h.e(t)}finally{h.f()}var g,w=si(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,C=P-c,E=Math.atan2(C,k),T=Math.sqrt(k*k+C*C)*O/(s-O);this.simple?(r.ctx.strokeStyle=S,r.ctx.lineWidth=_,r.ctx.beginPath(),r.ctx.moveTo(j,P),r.ctx.lineTo(j+T*Math.cos(E),P+T*Math.sin(E)),r.ctx.stroke()):(r.ctx.strokeStyle=this.outlineCol,r.ctx.lineWidth=_+2*this.outlineWidthPix*u,r.ctx.beginPath(),r.ctx.moveTo(j,P),r.ctx.lineTo(j+T*Math.cos(E),P+T*Math.sin(E)),r.ctx.stroke(),r.ctx.strokeStyle=S,r.ctx.lineWidth=_,r.ctx.beginPath(),r.ctx.moveTo(j,P),r.ctx.lineTo(j+T*Math.cos(E),P+T*Math.sin(E)),r.ctx.stroke(),r.ctx.strokeStyle=this.outlineCol,r.ctx.lineWidth=this.outlineWidthPix*u,r.ctx.beginPath(),r.ctx.arc(j+T*Math.cos(E),P+T*Math.sin(E),.5*_,0,2*Math.PI,!1),r.ctx.stroke())}}}}}catch(t){w.e(t)}finally{w.f()}r.ctx.lineCap="butt",this.updateLegends({style:this,r:e,zf:u,sColor:i})}}])&&hi(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function di(t){return di="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},di(t)}function mi(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return bi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function bi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function gi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==di(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==di(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===di(o)?o:String(o)),n)}var o}function wi(t,e){return wi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wi(t,e)}function xi(t){return xi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xi(t)}var Si=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&&wi(t,e)}(u,t);var e,r,n,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=xi(o);if(i){var r=xi(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===di(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,r,n,o){return 1},e.color=t.color||function(){return"#EA6BAC"},e.width=t.width||function(t,e,r,n){return e*t.value/5},e.orientation=t.orientation||0,e.fillColor=t.fillColor,e}return e=u,n=[{key:"getSideStatistics",value:function(t,e){if(t&&0!=t.length){var r,n=1/0,o=-1/0,i=mi(t);try{for(i.s();!(r=i.n()).done;){var a=r.value.value;e&&!a||(a<n&&(n=a),a>o&&(o=a))}}catch(t){i.e(t)}finally{i.f()}return{min:n,max:o}}}}],(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i=r.getZf();this.valueCol&&(o=Oo.getStatistics(t,(function(t){return t[n.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(r.setCanvasTransform(),this.fillColor){var v,d=mi(t);try{for(d.s();!(v=d.n()).done;){var m=v.value,b=this.fillColor(m);b&&"none"!=b&&(r.ctx.fillStyle=b,r.ctx.fillRect(m.x,m.y,e,e))}}catch(t){d.e(t)}finally{d.f()}}r.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||(r.ctx.strokeStyle=_,r.ctx.lineWidth=O,r.ctx.beginPath(),90==this.orientation?(r.ctx.moveTo(S.x+g,S.y+g),"h"===S.or?r.ctx.lineTo(S.x+g,S.y-g):r.ctx.lineTo(S.x-g,S.y+g)):(r.ctx.moveTo(S.x,S.y),r.ctx.lineTo(S.x+("h"===S.or?e:0),S.y+("v"===S.or?e:0))),r.ctx.stroke())}}this.updateLegends({style:this,r:e,zf:i})}}}])&&gi(e.prototype,r),n&&gi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(Oo);function _i(t){return _i="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},_i(t)}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)}(i,t);var e,r,n,o=(r=i,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,e=ji(r);if(n){var o=ji(this).constructor;t=Reflect.construct(e,arguments,o)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===_i(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 r=function(e){if(null==e)return 0;for(var r=0;r<t.breaks.length;r++)if(e<t.breaks[r])return r;return t.breaks.length};return e.value=function(t,e,n,o,i){return Math.abs(r(e)-r(t))},e.color=function(e,r,n,o){return e.value?t.color(e,r,o):void 0},e.width=function(e,r,n,o){return e.value*o*t.width(e,r,o)},e}return e=i,Object.defineProperty(e,"prototype",{writable:!1}),e}(Si);function ki(t){return ki="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},ki(t)}function Ci(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ei(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ki(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ki(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ki(o)?o:String(o)),n)}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 Ai(t){return Ai=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ai(t)}var Mi=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)}(a,t);var e,r,n,o,i=(n=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=Ai(n);if(o){var r=Ai(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ki(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,r){return.2*e},e.fillColor=t.fillColor,e}return e=a,(r=[{key:"draw",value:function(t,e,r){if(this.filter&&(t=t.filter(this.filter)),t&&0!=t.length){var n=r.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(r.setCanvasTransform(),this.fillColor){var y,p=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ci(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ci(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.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&&(r.ctx.fillStyle=d,r.ctx.fillRect(v.x,v.y,e,e))}}catch(t){p.e(t)}finally{p.f()}}r.ctx.lineCap="butt";for(var m=0,b=o;m<b.length;m++){var g=b[m],w=this.width?this.width(g,e,n):void 0;if(w&&!(w<=0)){var x=.5*w;r.ctx.lineWidth=w,"h"===g.or?(g.v2&&(r.ctx.beginPath(),r.ctx.strokeStyle=this.color[g.v2],r.ctx.moveTo(g.x,g.y+x),r.ctx.lineTo(g.x+e,g.y+x),r.ctx.stroke()),g.v1&&(r.ctx.beginPath(),r.ctx.strokeStyle=this.color[g.v1],r.ctx.moveTo(g.x,g.y-x),r.ctx.lineTo(g.x+e,g.y-x),r.ctx.stroke())):(g.v2&&(r.ctx.beginPath(),r.ctx.strokeStyle=this.color[g.v2],r.ctx.moveTo(g.x+x,g.y),r.ctx.lineTo(g.x+x,g.y+e),r.ctx.stroke()),g.v1&&(r.ctx.beginPath(),r.ctx.strokeStyle=this.color[g.v1],r.ctx.moveTo(g.x-x,g.y),r.ctx.lineTo(g.x-x,g.y+e),r.ctx.stroke()))}}this.updateLegends({style:this,r:e,zf:n})}}}}])&&Ei(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);const Ri=function t(e){function r(t,r){var n,o;return t=null==t?0:+t,r=null==r?1:+r,function(){var i;if(null!=n)i=n,n=null;else do{n=2*e()-1,i=2*e()-1,o=n*n+i*i}while(!o||o>1);return t+r*i*Math.sqrt(-2*Math.log(o)/o)}}return r.source=t,r}(Math.random);function Li(t,e,r){var n=document.createElement("canvas");n.setAttribute("width",t),n.setAttribute("height",e);var o=n.getContext("webgl",r);if(!o)throw new Error("Unable to initialize WebGL. Your browser or machine may not support it.");return{canvas:n,gl:o}}function zi(t){var e=t.createProgram();if(null==e)throw new Error("Cannot create webGL program");for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];for(var i=0,a=n;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 Fi(t,e){var r=t.createShader(e);if(null==r)throw new Error("Cannot create webGL shader");for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];if(t.shaderSource(r,o.join("\n")),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS))return r;throw new Error(t.getShaderInfoLog(r)||"Cannot create webGL shader (2)")}function Ii(t){return Ii="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},Ii(t)}function Ni(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ii(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ii(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ii(o)?o:String(o)),n)}var o}var Bi=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gl=e,this.sizePix=r||10,this.program=zi(e,Fi(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 "),Fi(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,r;return e=t,(r=[{key:"addPointData",value:function(t,e,r){var n=Me(r);n&&(this.verticesBuffer.push(t,e),this.colorsBuffer.push(n.r,n.g,n.b,n.opacity))}},{key:"addPointData2",value:function(t,e,r,n,o,i){this.verticesBuffer.push(t,e),this.colorsBuffer.push(r,n,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 r=e.getAttribLocation(this.program,"pos");e.vertexAttribPointer(r,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(r),e.bindBuffer(e.ARRAY_BUFFER,e.createBuffer()),e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.colorsBuffer),e.STATIC_DRAW);var n=e.getAttribLocation(this.program,"color");e.vertexAttribPointer(n,4,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n),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)}}])&&Ni(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Di(t){return Di="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},Di(t)}function Gi(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Zi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Zi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Zi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Wi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Di(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Di(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Di(o)?o:String(o)),n)}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 $i(t){return $i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$i(t)}var Yi=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,r,n,o,i=(n=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=$i(n);if(o){var r=$i(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Di(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,r,n){return.3*e*e/(n*n)*t/r.max},e.color=t.color||function(){return"#FF5733"},e.dotSize=t.dotSize,e.sigma=t.sigma,e}return e=a,(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i=r.getZf();if(this.nbCol&&(o=Oo.getStatistics(t,(function(t){return t[n.nbCol]}),!0)),o){var a=this.dotSize?this.dotSize(e,i):2*i,u=this.sigma?this.sigma(e,i):.4*e,l=Ri(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=Li(r.w+"",r.h+"");if(!c)return void console.error("No webGL");var s,f,h,y,p,v,d,m=new Bi(c.gl,a/i),b=e/2,g=Gi(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(r.getWebGLTransform()),r.initCanvasTransform(),r.ctx.drawImage(c.canvas,0,0)}else{r.setCanvasTransform();var S,_=Gi(t);try{for(_.s();!(S=_.n()).done;){var O=S.value,j=this.color(O);if(j&&"none"!==j){r.ctx.fillStyle=j;for(var P=this.offset(O,e,i),k=this.nb(O[this.nbCol],e,o,i),C=O.x+P.dx+e/2,E=O.y+P.dy+e/2,T=0;T<=k;T++)r.ctx.fillRect(C+l(),E+l(),a,a)}}}catch(t){_.e(t)}finally{_.f()}}this.updateLegends({style:this,r:e,zf:i})}}}])&&Wi(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function Hi(t){return Hi="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},Hi(t)}function Xi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Hi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Hi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Hi(o)?o:String(o)),n)}var o}var Vi=function(){function t(e,r,n){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=Fi(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<r.length;e++)t.push("uniform vec4 c"+e+";\n");return t.join("")}()+"void main(void) {\n";if(n?"pow"==n.fun?u+=" float t = pow(vt, alpha);\n":"powRev"==n.fun?u+=" float t = 1.0-pow(1.0-vt, 1.0/alpha);\n":"exp"==n.fun?u+=0==n.alpha?"float t = vt;":" float t = (exp(vt * alpha) - 1.0) / (exp(alpha) - 1.0);\n":"expRev"==n.fun?u+=0==n.alpha?"float t = vt;":" float t = 1.0 - (1.0 / alpha) * log(exp(alpha) * (1.0 - vt) + vt);\n":"circleLow"==n.fun?0==n.alpha?u+=" float t = vt;\n":1==n.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"==n.fun?0==n.alpha?u+=" float t = vt;\n":1==n.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: "+n.fun),u+=" float t = vt;\n"):u+=" float t = vt;\n",1==r.length)u+=" vec4 cI=c0;\n vec4 cF=c0;\n";else if(2==r.length)u+=" vec4 cI=c0;\n vec4 cF=c1;\n";else{var l=r.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==r.length?u+=" gl_FragColor = vec4(c0[0], c0[1], c0[2], c0[3]);}\n":u+=" gl_FragColor = mix(cI, cF, t);}\n";var f=Fi(e,e.FRAGMENT_SHADER,u);this.program=zi(e,a,f),e.useProgram(this.program),e.uniform1f(e.getUniformLocation(this.program,"sizePix"),1*o),e.uniform1f(e.getUniformLocation(this.program,"alpha"),n?1*n.alpha:0);for(var h=0;h<r.length;h++){var y=Me(r[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,r;return e=t,(r=[{key:"draw",value:function(t,e,r){var n=this.gl,o=this.program;n.bindBuffer(n.ARRAY_BUFFER,n.createBuffer()),n.bufferData(n.ARRAY_BUFFER,new Float32Array(t),n.STATIC_DRAW);var i=n.getAttribLocation(o,"pos");n.vertexAttribPointer(i,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(i),n.bindBuffer(n.ARRAY_BUFFER,n.createBuffer()),n.bufferData(n.ARRAY_BUFFER,new Float32Array(e),n.STATIC_DRAW);var a=n.getAttribLocation(o,"t");n.vertexAttribPointer(a,1,n.FLOAT,!1,0,0),n.enableVertexAttribArray(a),n.uniformMatrix3fv(n.getUniformLocation(o,"mat"),!1,new Float32Array(r)),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.POINTS,0,t.length/2)}}])&&Xi(e.prototype,r),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 Ji(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ki(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==qi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==qi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===qi(o)?o:String(o)),n)}var o}function Qi(t,e){return Qi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qi(t,e)}function ta(t){return ta=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ta(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&&Qi(t,e)}(a,t);var e,r,n,o,i=(n=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=ta(n);if(o){var r=ta(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===qi(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,r){return t/r.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,(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o=r.getZf(),i=Oo.getStatistics(t,(function(t){return t[n.colorCol]}),!0);if(i){var a=Li(r.w+"",r.h+"",null!=this.opacity?{premultipliedAlpha:!1}:void 0);if(a){var u,l=e/2,c=[],s=[],f=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ji(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ji(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.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 Vi(a.gl,this.colors,this.stretching,p/o,v).draw(c,s,r.getWebGLTransform()),r.initCanvasTransform(),r.ctx.drawImage(a.canvas,0,0),this.updateLegends({style:this,r:e,zf:o,sColor:i})}else console.error("No webGL")}}}])&&Ki(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function ra(t){return ra="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},ra(t)}function na(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ra(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ra(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ra(o)?o:String(o)),n)}var o}var oa=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r;return e=t,r=[{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 r=0;r<e.nb;r++)e.colors.push(e.color(r/(e.nb-1)))}e.colors=e.colors||["#a9bb9e","#c9dcaa","#fde89f","#f9a579","#eb444b"];var n=e.colors.length;e.tFun=e.tFun||function(t,e,r){return(t-r.min)/(r.max-r.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<n;e++)if(t<=(e+1)/n)return e;return console.error("Unexpected t value 2: "+t),-9};return[new ea({colorCol:t,colors:e.colors,tFun:function(t,r,i){var a=e.tFun(t,r,i);return o(a)/(n-1)},size:function(t,e){return t+.5*e},filter:e.filter}),new Si({valueCol:t,value:function(t,r,n,i,a){if(void 0===t&&void 0===r)return 0;if(void 0===r){var u=e.tFun(t,n,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(r,n,i);if(null==l||isNaN(l))throw new Error("Unexpected value: "+r+" - "+l);return-o(l)-1}var c=e.tFun(t,n,i);if(null==c||isNaN(c))throw new Error("Unexpected value: "+t+" - "+c);var s=e.tFun(r,n,i);if(null==s||isNaN(s))throw new Error("Unexpected value: "+r+" - "+s);var f=o(c);return-o(s)+f},color:e.newShading?function(t,r,n,o){var i=e.newShadingTr(t.value,n);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,r,n,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,r,n,o){return e.newShadingWidthPix*o}:function(t,r,n,o){return e.widthFactor*r*Math.abs(t.value)*("v"===t.or?.5:1)},filter:e.filter})]}}],null&&na(e.prototype,null),r&&na(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ia(t){return ia="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},ia(t)}function aa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ia(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ia(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ia(o)?o:String(o)),n)}var o}var ua=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 r=[];r.push("precision mediump float;\nvarying float vi;\n"),r.push("uniform vec4");for(var n=0;n<e.length;n++)n>0&&r.push(","),r.push(" c"+n);r.push(";\n"),r.push("void main(void) {\n");for(var o=0;o<e.length;o++)o>0&&r.push("else "),r.push("if(vi=="),r.push(o),r.push(".0) gl_FragColor = vec4(c"),r.push(o),r.push("[0], c"),r.push(o),r.push("[1], c"),r.push(o),r.push("[2], c"),r.push(o),r.push("[3]);\n");r.push("else gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n}"),this.fshString=r.join("")}var e,r;return e=t,r=[{key:"draw",value:function(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,i=zi(t,Fi(t,t.VERTEX_SHADER,this.vshString),Fi(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(r),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(n)),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.POINTS,0,e.length/2)}}],r&&aa(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function la(t){return la="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},la(t)}function ca(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==la(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==la(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===la(o)?o:String(o)),n)}var o}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)}var ha=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)}(a,t);var e,r,n,o,i=(n=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=fa(n);if(o){var r=fa(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===la(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 r=Object.keys(t.color);e.catToI={};for(var n=0;n<r.length;n++)e.catToI[r[n]]=n+"";e.colors=[];for(var o=0;o<r.length;o++)e.colors.push(t.color[""+r[o]]);return e.size=t.size,e.wgp=new ua(e.colors),e}return e=a,(r=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));for(var n,o=r.getZf(),i=e/2,a=t.length,u=[],l=[],c=0;c<a;c++){var s=(n=t[c])[this.colorCol];if(null!=s){var f=this.catToI[s];isNaN(+f)?console.log("Unexpected category index: "+s+" "+f):(u.push(n.x+i,n.y+i),l.push(+f))}else console.log("Unexpected category: "+s)}var h=Li(r.w+"",r.h+"");if(h){var y=this.size?this.size(e,o):e+.2*o;this.wgp.draw(h.gl,u,l,r.getWebGLTransform(),y/o),r.initCanvasTransform(),r.ctx.drawImage(h.canvas,0,0),this.updateLegends({style:this,r:e,zf:o})}else console.error("No webGL")}}])&&ca(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function ya(t){return ya="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},ya(t)}function pa(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return va(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?va(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function va(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function da(t,e){return da=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},da(t,e)}function ma(t){return ma=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ma(t)}function ba(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ga(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ya(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ya(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ya(o)?o:String(o)),n)}var o}function wa(t,e,r){return e&&ga(t.prototype,e),r&&ga(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var xa=function(){function t(){ba(this,t)}return wa(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 r=oa.get(t,e),n=new Fo({strokeColor:function(){return"#666"},strokeWidth:function(t,e,r,n){return.2*n},filter:e.filter});return[r[0],n,r[1],new Sa({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 ha({colorCol:t,color:e.color}),new Fo({strokeColor:function(){return"#666"},strokeWidth:function(t,e,r,n){return.2*n}}),new Sa({colDark:e.colDark,colBright:e.colBright})]}}]),t}(),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&&da(t,e)}(o,t);var e,r,n=(e=o,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,n=ma(e);if(r){var o=ma(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return function(t,e){if(e&&("object"===ya(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 ba(this,o),e=n.call(this,t),t=t||{},e.colDark=t.colDark||"#333",e.colBright=t.colBright||"#aaa",e}return wa(o,[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter)),r.ctx.lineWidth=.6*r.getZf(),r.ctx.strokeStyle=this.colDark;var n,o=pa(t);try{for(o.s();!(n=o.n()).done;){var i=n.value;r.ctx.beginPath(),r.ctx.arc(i.x+.5*e,i.y+.5*e,.55*e*.5,Math.PI/4,-Math.PI*(3/4),!0),r.ctx.stroke()}}catch(t){o.e(t)}finally{o.f()}r.ctx.strokeStyle=this.colBright;var a,u=pa(t);try{for(u.s();!(a=u.n()).done;){var l=a.value;r.ctx.beginPath(),r.ctx.arc(l.x+.5*e,l.y+.5*e,.55*e*.5,Math.PI/4,-Math.PI*(3/4),!1),r.ctx.stroke()}}catch(t){u.e(t)}finally{u.f()}}}]),o}(Oo);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 r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ja(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==_a(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==_a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===_a(o)?o:String(o)),n)}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 Ca=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,r,n,o,i=(n=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(n);if(o){var r=ka(this).constructor;t=Reflect.construct(e,arguments,r)}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.mosaicFactor=t.mosaicFactor||.15,e.shadowFactor=t.shadowFactor||.2,e.shadowColor=t.shadowColor||"#555",e}return e=a,(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i=r.getZf();this.colorCol&&(o=Oo.getStatistics(t,(function(t){return t[n.colorCol]}),!0)),r.ctx.strokeStyle=this.shadowColor,r.ctx.lineWidth=this.shadowFactor*e,r.ctx.lineJoin="round",r.ctx.lineCap="butt";var a=e*this.mosaicFactor,u=function(){return{x:Math.random()*a,y:Math.random()*a}};r.setCanvasTransform();var l,c=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Oa(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Oa(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.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){r.ctx.fillStyle=f;var h=this.offset(s,e,i),y=u(),p=u(),v=u(),d=u();this.shadowFactor>0&&(r.ctx.beginPath(),r.ctx.moveTo(s.x+h.dx+y.x,s.y+h.dy+y.y),r.ctx.lineTo(s.x+h.dx+e-v.x,s.y+h.dy+v.y),r.ctx.lineTo(s.x+h.dx+e-d.x,s.y+h.dy+e-d.y),r.ctx.stroke()),r.ctx.beginPath(),r.ctx.moveTo(s.x+h.dx+y.x,s.y+h.dy+y.y),r.ctx.lineTo(s.x+h.dx+e-v.x,s.y+h.dy+v.y),r.ctx.lineTo(s.x+h.dx+e-d.x,s.y+h.dy+e-d.y),r.ctx.lineTo(s.x+h.dx+p.x,s.y+h.dy+e-p.y),r.ctx.fill()}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:i,sColor:o})}}])&&ja(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function Ea(t){return Ea="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},Ea(t)}function Ta(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Aa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ea(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ea(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ea(o)?o:String(o)),n)}var o}function Ma(t,e){return Ma=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ma(t,e)}function Ra(t){return Ra=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ra(t)}var La=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&&Ma(t,e)}(a,t);var e,r,n,o,i=(n=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=Ra(n);if(o){var r=Ra(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ea(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,(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i,a=r.getZf();this.sizeCol&&(t.sort((function(t,e){return e[n.sizeCol]-t[n.sizeCol]})),o=Oo.getStatistics(t,(function(t){return t[n.sizeCol]}),!0)),this.colorCol&&(i=Oo.getStatistics(t,(function(t){return t[n.colorCol]}),!0)),r.setCanvasTransform();var u,l=.5*e,c=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ta(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ta(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.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){r.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=s.x+l,v=s.y+l;if("p"===h)r.ctx.beginPath(),r.ctx.moveTo(p,v+l),r.ctx.lineTo(p+y,v+y),r.ctx.lineTo(p+l,v),r.ctx.lineTo(p+y,v-y),r.ctx.lineTo(p,v-l),r.ctx.lineTo(p-y,v-y),r.ctx.lineTo(p-l,v),r.ctx.lineTo(p-y,v+y),r.ctx.fill();else{if("o"!==h)throw new Error("Unexpected shape:"+h);r.ctx.beginPath(),r.ctx.moveTo(p,v+y),r.ctx.lineTo(p+l,v+l),r.ctx.lineTo(p+y,v),r.ctx.lineTo(p+l,v-l),r.ctx.lineTo(p,v-y),r.ctx.lineTo(p-l,v-l),r.ctx.lineTo(p-y,v),r.ctx.lineTo(p-l,v+l),r.ctx.fill()}}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:a,sSize:o,sColor:i})}}])&&Aa(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function za(t){return za="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},za(t)}function Fa(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ia(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ia(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Ia(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Na(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==za(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==za(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===za(o)?o:String(o)),n)}var o}function Ba(t,e){return Ba=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ba(t,e)}function Da(t){return Da=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Da(t)}var Ga=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&&Ba(t,e)}(a,t);var e,r,n,o,i=(n=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=Da(n);if(o){var r=Da(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===za(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.ts=t.ts,e.noData=t.noData||function(t){return void 0===t||""==t||null===t||isNaN(+t)},e.offsetX=t.offsetX||function(t,e,r){return 0},e.width=t.width||function(t,e,r){return e},e.offsetY=t.offsetY||function(t,e,r){return 0},e.height=t.height||function(t,e,r){return e},e.anchorModeY=t.anchorModeY||function(t,e,r){return"center"},e.lineWidthCol=t.lineWidthCol,e.lineWidth=t.lineWidth||function(t,e,r,n){return 1.5*n},e.colorCol=t.colorCol,e.color=t.color||function(t,e,r,n){return"black"},e}return e=a,(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i,a=r.getZf();this.lineWidthCol&&(o=Oo.getStatistics(t,(function(t){return t[n.lineWidthCol]}),!0)),this.colorCol&&(i=Oo.getStatistics(t,(function(t){return t[n.colorCol]}),!0));var u,l,c=function(t){var e,r,o,i=Fa(n.ts);try{for(i.s();!(o=i.n()).done;){var a=t[o.value];null!=a&&((null==e||a<e)&&(e=a),(null==r||a>r)&&(r=a))}}catch(t){i.e(t)}finally{i.f()}if(null!=e)return r-e},s=Fa(t);try{for(s.s();!(l=s.n()).done;){var f=c(l.value);null!=f&&(null==u||f>u)&&(u=f)}}catch(t){s.e(t)}finally{s.f()}if(u){var h=this.ts.length;r.setCanvasTransform(),r.ctx.lineCap="butt";var y,p=Fa(t);try{for(p.s();!(y=p.n()).done;){var v=y.value,d=this.lineWidth?this.lineWidth(v[this.lineWidthCol],e,o,a):void 0;if(d&&!(d<0)){var m=this.color?this.color(v[this.colorCol],e,i,a):void 0;if(m){var b=this.offsetX?this.offsetX(v,e,a):0;if(null!=b&&!isNaN(b)){var g=this.width?this.width(v,e,a):e;if(null!=g&&!isNaN(g)){var w=this.offsetY?this.offsetY(v,e,a):0;if(null!=w&&!isNaN(w)){var x=this.height?this.height(v,e,a):e;if(null!=x&&!isNaN(x)){var S=this.anchorModeY?this.anchorModeY(v,e,a):"center";if(S){r.ctx.lineWidth=d,r.ctx.strokeStyle=m;var _=void 0,O=void 0;if("first"===S)_=v[this.ts[0]],O=0;else if("last"===S)_=v[this.ts[this.ts.length-1]],O=0;else if("bottom"===S){var j,P=Fa(this.ts);try{for(P.s();!(j=P.n()).done;){var k=+v[j.value];null!=k&&(null==_||k<_)&&(_=k)}}catch(t){P.e(t)}finally{P.f()}O=0}else if("top"===S){var C,E=Fa(this.ts);try{for(E.s();!(C=E.n()).done;){var T=+v[C.value];null!=T&&(null==_||T>_)&&(_=T)}}catch(t){E.e(t)}finally{E.f()}O=e}else{if("center"!==S){console.log("Unexpected anchorModeY: "+S);continue}var A,M=void 0,R=void 0,L=Fa(this.ts);try{for(L.s();!(A=L.n()).done;){var z=v[A.value];null!=z&&((null==M||z<M)&&(M=z),(null==R||z>R)&&(R=z))}}catch(t){L.e(t)}finally{L.f()}_=.5*(+R+ +M),O=e/2}var F=g/(h-1),I=v[this.ts[0]];this.noData(I)||(r.ctx.beginPath(),r.ctx.moveTo(v.x+b,v.y+O+(I-_)*x/u+w));for(var N=void 0,B=1;B<h;B++)N=v[this.ts[B]],this.noData(I)&&this.noData(N)||(!this.noData(I)&&this.noData(N)?r.ctx.stroke():this.noData(I)&&!this.noData(N)?(r.ctx.beginPath(),r.ctx.moveTo(v.x+B*F+b,v.y+O+(N-_)*x/u+w)):(r.ctx.lineTo(v.x+B*F+b,v.y+O+(N-_)*x/u+w),B==h-1&&r.ctx.stroke())),I=N}}}}}}}}}catch(t){p.e(t)}finally{p.f()}}}}])&&Na(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function Za(t){return Za="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},Za(t)}function Wa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Za(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Za(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Za(o)?o:String(o)),n)}var o}var Ua=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,r;return e=t,(r=[{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.")}}])&&Wa(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function $a(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}var Ya,Ha=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Xa(t){if(!(e=Ha.exec(t)))throw new Error("invalid format: "+t);var e;return new Va({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 Va(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 qa(t,e){var r=$a(t,e);if(!r)return t+"";var n=r[0],o=r[1];return o<0?"0."+new Array(-o).join("0")+n:n.length>o+1?n.slice(0,o+1)+"."+n.slice(o+1):n+new Array(o-n.length+2).join("0")}Xa.prototype=Va.prototype,Va.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 Ja={"%":(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)=>qa(100*t,e),r:qa,s:function(t,e){var r=$a(t,e);if(!r)return t+"";var n=r[0],o=r[1],i=o-(Ya=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=n.length;return i===a?n:i>a?n+new Array(i-a+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+$a(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Ka(t){return t}var Qa,tu,eu=Array.prototype.map,ru=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function nu(t){return Qa=function(t){var e,r,n=void 0===t.grouping||void 0===t.thousands?Ka:(e=eu.call(t.grouping,Number),r=t.thousands+"",function(t,n){for(var o=t.length,i=[],a=0,u=e[0],l=0;o>0&&u>0&&(l+u+1>n&&(u=Math.max(1,n-l)),i.push(t.substring(o-=u,o+u)),!((l+=u+1)>n));)u=e[a=(a+1)%e.length];return i.reverse().join(r)}),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?Ka:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(eu.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=Xa(t)).fill,r=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"):Ja[b]||(void 0===d&&(d=12),m=!0,b="g"),(y||"0"===e&&"="===r)&&(y=!0,e="0",r="=");var g="$"===h?o:"#"===h&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",w="$"===h?i:/[%p]/.test(b)?l:"",x=Ja[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,r=t.length,n=1,o=-1;n<r;++n)switch(t[n]){case".":o=e=n;break;case"0":0===o&&(o=n),e=n;break;default:if(!+t[n])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?ru[8+Ya/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=n(t,1/0));var j=h.length+t.length+_.length,P=j<p?new Array(p-j+1).join(e):"";switch(v&&y&&(t=n(P+t,P.length?p-_.length:1/0),P=""),r){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 r,n=f(((t=Xa(t)).type="f",t)),o=3*Math.max(-8,Math.min(8,Math.floor((r=e,((r=$a(Math.abs(r)))?r[1]:NaN)/3)))),i=Math.pow(10,-o),a=ru[8+o/3];return function(t){return n(i*t)+a}}}}(t),tu=Qa.format,Qa.formatPrefix,Qa}function ou(t){return ou="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},ou(t)}function iu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ou(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ou(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ou(o)?o:String(o)),n)}var o}function au(t,e){return au=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},au(t,e)}function uu(t){return uu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},uu(t)}nu({thousands:",",grouping:[3],currency:["$",""]});var lu=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&&au(t,e)}(a,t);var e,r,n,o,i=(n=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=uu(n);if(o){var r=uu(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ou(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,(r=[{key:"update",value:function(t){if(t.sColor){this.div.selectAll("*").remove();var e=this.width+2*this.margin,r=this.height+3*this.margin+12+this.tickSize+10,n=this.div.append("svg").attr("width",e).attr("height",r);n.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=n.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?tu(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)}}}}])&&iu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ua);function cu(t){return cu="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},cu(t)}function su(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==cu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==cu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===cu(o)?o:String(o)),n)}var o}function fu(t,e){return fu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fu(t,e)}function hu(t){return hu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hu(t)}var yu=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&&fu(t,e)}(a,t);var e,r,n,o,i=(n=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=hu(n);if(o){var r=hu(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===cu(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,(r=[{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 r=this.width/e,n=this.div.append("svg").attr("width",this.width).attr("height",this.height+this.tickSize+2+10),o=0;o<e;o++)n.append("rect").attr("x",o*r).attr("y",0).attr("width",r).attr("height",this.height).style("fill",this.colors[o]);for(var i=1;i<e;i++)n.append("line").attr("x1",r*i).attr("y1",0).attr("x2",r*i).attr("y2",this.height+this.tickSize).style("stroke","black");for(var a=1;a<e;a++)n.append("text").attr("id","ticklabel_"+a).attr("x",r*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])}}}])&&su(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ua);function pu(t){return pu="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},pu(t)}function vu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==pu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==pu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===pu(o)?o:String(o)),n)}var o}function du(t,e){return du=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},du(t,e)}function mu(t){return mu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},mu(t)}var bu=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&&du(t,e)}(a,t);var e,r,n,o,i=(n=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=mu(n);if(o){var r=mu(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===pu(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,(r=[{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 r=0;r<e;r++){var n=this.colCat[r],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",n[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",n[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(n[1])}}}])&&vu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ua);function gu(t){return gu="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},gu(t)}function wu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==gu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==gu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===gu(o)?o:String(o)),n)}var o}function xu(t,e){return xu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xu(t,e)}function Su(t){return Su=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Su(t)}var _u=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&&xu(t,e)}(a,t);var e,r,n,o,i=(n=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=Su(n);if(o){var r=Su(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===gu(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,(r=[{key:"update",value:function(t){if(t.sSize){this.div.selectAll("*").remove();var e=this.value;if(null==e){var r=t.sSize.max*this.exaggerationFactor,n=Math.log10(r);n=Math.floor(n),8*(e=Math.pow(10,n))<=r?e*=8:6*e<=r?e*=6:5*e<=r?e*=5:4*e<=r?e*=4:2.5*e<=r?e*=2.5:2*e<=r&&(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=tu(this.labelFormat)(e);o.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(l+(this.labelUnitText?" ":"")+this.labelUnitText)}}}}])&&wu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ua);function Ou(t){return Ou="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},Ou(t)}function ju(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ou(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ou(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ou(o)?o:String(o)),n)}var o}function Pu(t,e){return Pu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pu(t,e)}function ku(t){return ku=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ku(t)}var Cu=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&&Pu(t,e)}(a,t);var e,r,n,o,i=(n=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=ku(n);if(o){var r=ku(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ou(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,(r=[{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 r=t.sWidth.max*this.exaggerationFactor,n=Math.log10(r);n=Math.floor(n);var o=Math.pow(10,n);8*o<=r?o*=8:6*o<=r?o*=6:5*o<=r?o*=5:4*o<=r?o*=4:2.5*o<=r?o*=2.5:2*o<=r&&(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=tu(",.2r")(o);e.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(u+(this.labelUnitText?" ":"")+this.labelUnitText)}}}])&&ju(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ua);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 Tu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Eu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Eu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Eu(o)?o:String(o)),n)}var o}function Au(t,e){return Au=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Au(t,e)}function Mu(t){return Mu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mu(t)}var Ru=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&&Au(t,e)}(a,t);var e,r,n,o,i=(n=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=Mu(n);if(o){var r=Mu(this).constructor;t=Reflect.construct(e,arguments,r)}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.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,(r=[{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 r=this.widthPix,n=1*t.r/t.zf,o=Math.max(n,r),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*n;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",r),e.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(this.labelUnitText)}}}])&&Tu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ua),Lu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return Math.pow(t,e)},zu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 1-Math.pow(1-t,1/e)},Fu=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)},Iu=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)},Nu=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 r=e/(1-e);return Math.sqrt(1/(r*r)+t*(2/r+2-t))-1/r},Bu=function(t){return 1-Nu(1-t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:.8)},Du=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))},Gu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return(Math.exp(-e*t)-1)/(Math.exp(-e)-1)},Zu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return Math.pow(t,1/e)},Wu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 1-Math.pow(1-t,e)},Uu=Nr.getParameterByName;return nu({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),e})()));
|
|
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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(){}function n(t){return null==t?r: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:()=>go,BackgroundLayer:()=>Vn,BackgroundLayerWMS:()=>Kn,BoundaryLayer:()=>ho,CSVGrid:()=>_n,ColorCategoryLegend:()=>Cu,ColorDiscreteLegend:()=>_u,ColorLegend:()=>bu,CompositionStyle:()=>qo,ContourStyle:()=>Pi,Dataset:()=>Yr,DatasetComponent:()=>pn,DotDensityStyle:()=>Yi,GeoCanvas:()=>Nr,GridTile:()=>Ln,IsoFenceStyle:()=>qa,JoyPlotStyle:()=>Wo,LGrid:()=>En,LabelLayer:()=>io,Layer:()=>Gr,LegoStyle:()=>xa,MosaicStyle:()=>Ca,NinjaStarStyle:()=>La,PillarStyle:()=>vi,SegmentOrientationLegend:()=>Zu,SegmentStyle:()=>ri,SegmentWidthLegend:()=>Nu,ShapeColorSizeStyle:()=>To,SideCatStyle:()=>Mi,SideStyle:()=>Si,SizeLegend:()=>Ru,SquareColorCatWGLStyle:()=>ha,SquareColorWGLStyle:()=>ea,StrokeStyle:()=>Fo,Style:()=>Oo,TanakaStyle:()=>oa,TextStyle:()=>ci,TiledGrid:()=>Yn,TimeSeriesStyle:()=>Ga,getClass:()=>yo,getParameterByName:()=>tc,sCircleHigh:()=>Vu,sCircleLow:()=>Xu,sExp:()=>Yu,sExpInverse:()=>qu,sExpRev:()=>Hu,sExpRevInverse:()=>Ju,sPow:()=>Uu,sPowInverse:()=>Ku,sPowRev:()=>$u,sPowRevInverse:()=>Qu});var c=Array.prototype.find;function l(){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,r,n,o,i){for(var a,u=0,c=e.length,l=i.length;u<l;++u)(a=e[u])?(a.__data__=i[u],n[u]=a):r[u]=new y(t,i[u]);for(;u<c;++u)(a=e[u])&&(o[u]=a)}function v(t,e,r,n,o,i,a){var u,c,l,s=new Map,f=e.length,h=i.length,p=new Array(f);for(u=0;u<f;++u)(c=e[u])&&(p[u]=l=a.call(c,c.__data__,u,e)+"",s.has(l)?o[u]=c:s.set(l,c));for(u=0;u<h;++u)l=a.call(t,i[u],u,i)+"",(c=s.get(l))?(n[u]=c,c.__data__=i[u],s.delete(l)):r[u]=new y(t,i[u]);for(u=0;u<f;++u)(c=e[u])&&s.get(p[u])===c&&(o[u]=c)}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+="",r=e.indexOf(":");return r>=0&&"xmlns"!==(e=t.slice(0,r))&&(t=t.slice(r+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 r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}}function k(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function C(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function E(t){return function(){this.style.removeProperty(t)}}function T(t,e,r){return function(){this.style.setProperty(t,e,r)}}function A(t,e,r){return function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function M(t,e){return t.style.getPropertyValue(e)||C(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 r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}}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 r=I(t),n=-1,o=e.length;++n<o;)r.add(e[n])}function D(t,e){for(var r=I(t),n=-1,o=e.length;++n<o;)r.remove(e[n])}function G(t){return function(){B(this,t)}}function W(t){return function(){D(this,t)}}function Z(t,e){return function(){(e.apply(this,arguments)?B:D)(this,t)}}function U(){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 H(){this.innerHTML=""}function X(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 J(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function K(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===g&&e.documentElement.namespaceURI===g?e.createElement(t):e.createElementNS(r,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:K)(e)}function et(){return null}function rt(){var t=this.parentNode;t&&t.removeChild(this)}function nt(){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 r,n=0,o=-1,i=e.length;n<i;++n)r=e[n],t.type&&r.type!==t.type||r.name!==t.name?e[++o]=r:this.removeEventListener(r.type,r.listener,r.options);++o?e.length=o:delete this.__on}}}function at(t,e,r){return function(){var n,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((n=o[a]).type===t.type&&n.name===t.name)return this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=i,n.options=r),void(n.value=e);this.addEventListener(t.type,i,r),n={type:t.type,name:t.name,value:e,listener:i,options:r},o?o.push(n):this.__on=[n]}}function ut(t,e,r){var n=C(t),o=n.CustomEvent;"function"==typeof o?o=new o(e,r):(o=n.document.createEvent("Event"),r?(o.initEvent(e,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function ct(t,e){return function(){return ut(this,t,e)}}function lt(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=n(t));for(var e=this._groups,r=e.length,o=new Array(r),i=0;i<r;++i)for(var a,u,c=e[i],l=c.length,s=o[i]=new Array(l),f=0;f<l;++f)(a=c[f])&&(u=t.call(a,a.__data__,f,c))&&("__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,r=e.length,n=[],o=[],a=0;a<r;++a)for(var u,c=e[a],l=c.length,s=0;s<l;++s)(u=c[s])&&(n.push(t.call(u,u.__data__,s,c)),o.push(u));return new ft(n,o)},selectChild:function(t){return this.select(null==t?l:function(t){return function(){return c.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,r=e.length,n=new Array(r),o=0;o<r;++o)for(var i,u=e[o],c=u.length,l=n[o]=[],s=0;s<c;++s)(i=u[s])&&t.call(i,i.__data__,s,u)&&l.push(i);return new ft(n,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,d);var r,n=e?v:p,o=this._parents,i=this._groups;"function"!=typeof t&&(r=t,t=function(){return r});for(var a=i.length,u=new Array(a),c=new Array(a),l=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=c[s]=new Array(g),x=u[s]=new Array(g);n(f,h,w,x,l[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=c,u._exit=l,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,r){var n=this.enter(),o=this,i=this.exit();return"function"==typeof t?(n=t(n))&&(n=n.selection()):n=n.append(t+""),null!=e&&(o=e(o))&&(o=o.selection()),null==r?i.remove():r(i),n&&o?n.merge(o).order():o},merge:function(t){for(var e=t.selection?t.selection():t,r=this._groups,n=e._groups,o=r.length,i=n.length,a=Math.min(o,i),u=new Array(o),c=0;c<a;++c)for(var l,s=r[c],f=n[c],h=s.length,y=u[c]=new Array(h),p=0;p<h;++p)(l=s[p]||f[p])&&(y[p]=l);for(;c<o;++c)u[c]=r[c];return new ft(u,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var n,o=t[e],i=o.length-1,a=o[i];--i>=0;)(n=o[i])&&(a&&4^n.compareDocumentPosition(a)&&a.parentNode.insertBefore(n,a),a=n);return this},sort:function(t){function e(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}t||(t=b);for(var r=this._groups,n=r.length,o=new Array(n),i=0;i<n;++i){for(var a,u=r[i],c=u.length,l=o[i]=new Array(c),s=0;s<c;++s)(a=u[s])&&(l[s]=a);l.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,r=t.length;e<r;++e)for(var n=t[e],o=0,i=n.length;o<i;++o){var a=n[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,r=0,n=e.length;r<n;++r)for(var o,i=e[r],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 r=x(t);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((null==e?r.local?_:S:"function"==typeof e?r.local?k:P:r.local?j:O)(r,e))},style:function(t,e,r){return arguments.length>1?this.each((null==e?E:"function"==typeof e?A:T)(t,e,null==r?"":r)):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 r=F(t+"");if(arguments.length<2){for(var n=I(this.node()),o=-1,i=r.length;++o<i;)if(!n.contains(r[o]))return!1;return!0}return this.each(("function"==typeof e?Z:e?G:W)(r,e))},text:function(t){return arguments.length?this.each(null==t?U:("function"==typeof t?Y:$)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?H:("function"==typeof t?V:X)(t)):this.node().innerHTML},raise:function(){return this.each(q)},lower:function(){return this.each(J)},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 r="function"==typeof t?t:tt(t),o=null==e?et:"function"==typeof e?e:n(e);return this.select((function(){return this.insertBefore(r.apply(this,arguments),o.apply(this,arguments)||null)}))},remove:function(){return this.each(rt)},clone:function(t){return this.select(t?ot:nt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,r){var n,o,i=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");return r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),{type:t,name:e}}))}(t+""),a=i.length;if(!(arguments.length<2)){for(u=e?at:it,n=0;n<a;++n)this.each(u(i[n],e,r));return this}var u=this.node().__on;if(u)for(var c,l=0,s=u.length;l<s;++l)for(n=0,c=u[l];n<a;++n)if((o=i[n]).type===c.type&&o.name===c.name)return c.value},dispatch:function(t,e){return this.each(("function"==typeof e?lt:ct)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n,o=t[e],i=0,a=o.length;i<a;++i)(n=o[i])&&(yield n)}};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,r=arguments.length,n={};e<r;++e){if(!(t=arguments[e]+"")||t in n||/[\s.]/.test(t))throw new Error("illegal type: "+t);n[t]=[]}return new mt(n)}function mt(t){this._=t}function bt(t,e){for(var r,n=0,o=t.length;n<o;++n)if((r=t[n]).name===e)return r.value}function gt(t,e,r){for(var n=0,o=t.length;n<o;++n)if(t[n].name===e){t[n]=vt,t=t.slice(0,n).concat(t.slice(n+1));break}return null!=r&&t.push({name:e,value:r}),t}mt.prototype=dt.prototype={constructor:mt,on:function(t,e){var r,n,o=this._,i=(n=o,(t+"").trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.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(r=(t=i[a]).type)o[r]=gt(o[r],t.name,e);else if(null==e)for(r in o)o[r]=gt(o[r],t.name,null);return this}for(;++a<u;)if((r=(t=i[a]).type)&&(r=bt(o[r],t.name)))return r},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new mt(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var r,n,o=new Array(r),i=0;i<r;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,r=(n=this._[t]).length;i<r;++i)n[i].value.apply(e,o)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],o=0,i=n.length;o<i;++o)n[o].value.apply(e,r)}};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,r,n){function o(t,o){var i,a,u=t[0],c=t[1],l=t[2],s=o[0],f=o[1],h=o[2],y=s-u,p=f-c,v=y*y+p*p;if(v<1e-12)a=Math.log(h/l)/e,i=function(t){return[u+t*y,c+t*p,l*Math.exp(e*t*a)]};else{var d=Math.sqrt(v),m=(h*h-l*l+n*v)/(2*l*r*d),b=(h*h-l*l-n*v)/(2*h*r*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 n,o=t*a,i=_t(g),s=l/(r*d)*(i*(n=e*o+g,((n=Math.exp(2*n))-1)/(n+1))-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[u+s*y,c+s*p,l*i/_t(e*o+g)]}}return i.duration=1e3*a*e/Math.SQRT2,i}return o.rho=function(e){var r=Math.max(.001,+e),n=r*r;return t(r,n,n*n)},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 r=e.ownerSVGElement||e;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,[(n=n.matrixTransform(e.getScreenCTM().inverse())).x,n.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,Ct=0,Et=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,r){var n=new Bt;return n.restart(t,e,r),n}function Gt(){Rt=(Mt=zt.now())+Lt,Ct=Et=0;try{!function(){It(),++Ct;for(var t,e=Pt;e;)(t=Rt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ct}()}finally{Ct=0,function(){for(var t,e,r=Pt,n=1/0;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:Pt=e);kt=t,Zt(n)}(),Rt=0}}function Wt(){var t=zt.now(),e=t-Mt;e>At&&(Lt-=e,Mt=t)}function Zt(t){Ct||(Et&&(Et=clearTimeout(Et)),t-Rt>24?(t<1/0&&(Et=setTimeout(Gt,t-zt.now()-Lt)),Tt&&(Tt=clearInterval(Tt))):(Tt||(Mt=zt.now(),Tt=setInterval(Wt,At)),Ct=1,Ft(Gt)))}function Ut(t,e,r){var n=new Bt;return e=null==e?0:+e,n.restart((r=>{n.stop(),t(r+e)}),e,r),n}Bt.prototype=Dt.prototype={constructor:Bt,restart:function(t,e,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?It():+r)+(null==e?0:+e),this._next||kt===this||(kt?kt._next=this:Pt=this,kt=this),this._call=t,this._time=r,Zt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Zt())}};var $t=wt("start","end","cancel","interrupt"),Yt=[],Ht=0,Xt=2,Vt=3,qt=5,Jt=6;function Kt(t,e,r,n,o,i){var a=t.__transition;if(a){if(r in a)return}else t.__transition={};!function(t,e,r){var n,o=t.__transition;function i(c){var l,s,f,h;if(1!==r.state)return u();for(l in o)if((h=o[l]).name===r.name){if(h.state===Vt)return Ut(i);4===h.state?(h.state=Jt,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete o[l]):+l<e&&(h.state=Jt,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete o[l])}if(Ut((function(){r.state===Vt&&(r.state=4,r.timer.restart(a,r.delay,r.time),a(c))})),r.state=Xt,r.on.call("start",t,t.__data__,r.index,r.group),r.state===Xt){for(r.state=Vt,n=new Array(f=r.tween.length),l=0,s=-1;l<f;++l)(h=r.tween[l].value.call(t,t.__data__,r.index,r.group))&&(n[++s]=h);n.length=s+1}}function a(e){for(var o=e<r.duration?r.ease.call(null,e/r.duration):(r.timer.restart(u),r.state=qt,1),i=-1,a=n.length;++i<a;)n[i].call(t,o);r.state===qt&&(r.on.call("end",t,t.__data__,r.index,r.group),u())}function u(){for(var n in r.state=Jt,r.timer.stop(),delete o[e],o)return;delete t.__transition}o[e]=r,r.timer=Dt((function(t){r.state=1,r.timer.restart(i,r.delay,r.time),r.delay<=t&&i(t-r.delay)}),0,r.time)}(t,r,{name:e,index:n,group:o,on:$t,tween:Yt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Ht})}function Qt(t,e){var r=ee(t,e);if(r.state>Ht)throw new Error("too late; already scheduled");return r}function te(t,e){var r=ee(t,e);if(r.state>Vt)throw new Error("too late; already running");return r}function ee(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function re(t,e){var r,n,o,i=t.__transition,a=!0;if(i){for(o in e=null==e?null:e+"",i)(r=i[o]).name===e?(n=r.state>Xt&&r.state<qt,r.state=Jt,r.timer.stop(),r.on.call(n?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete i[o]):a=!1;a&&delete t.__transition}}function ne(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}var oe,ie=180/Math.PI,ae={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ue(t,e,r,n,o,i){var a,u,c;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(c=t*r+e*n)&&(r-=t*c,n-=e*c),(u=Math.sqrt(r*r+n*n))&&(r/=u,n/=u,c/=u),t*n<e*r&&(t=-t,e=-e,c=-c,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(e,t)*ie,skewX:Math.atan(c)*ie,scaleX:a,scaleY:u}}function ce(t,e,r,n){function o(t){return t.length?t.pop()+" ":""}return function(i,a){var u=[],c=[];return i=t(i),a=t(a),function(t,n,o,i,a,u){if(t!==o||n!==i){var c=a.push("translate(",null,e,null,r);u.push({i:c-4,x:ne(t,o)},{i:c-2,x:ne(n,i)})}else(o||i)&&a.push("translate("+o+e+i+r)}(i.translateX,i.translateY,a.translateX,a.translateY,u,c),function(t,e,r,i){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),i.push({i:r.push(o(r)+"rotate(",null,n)-2,x:ne(t,e)})):e&&r.push(o(r)+"rotate("+e+n)}(i.rotate,a.rotate,u,c),function(t,e,r,i){t!==e?i.push({i:r.push(o(r)+"skewX(",null,n)-2,x:ne(t,e)}):e&&r.push(o(r)+"skewX("+e+n)}(i.skewX,a.skewX,u,c),function(t,e,r,n,i,a){if(t!==r||e!==n){var u=i.push(o(i)+"scale(",null,",",null,")");a.push({i:u-4,x:ne(t,r)},{i:u-2,x:ne(e,n)})}else 1===r&&1===n||i.push(o(i)+"scale("+r+","+n+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,u,c),i=a=null,function(t){for(var e,r=-1,n=c.length;++r<n;)u[(e=c[r]).i]=e.x(t);return u.join("")}}}var le=ce((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=ce((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 r,n;return function(){var o=te(this,t),i=o.tween;if(i!==r)for(var a=0,u=(n=r=i).length;a<u;++a)if(n[a].name===e){(n=n.slice()).splice(a,1);break}o.tween=n}}function he(t,e,r){var n,o;if("function"!=typeof r)throw new Error;return function(){var i=te(this,t),a=i.tween;if(a!==n){o=(n=a).slice();for(var u={name:e,value:r},c=0,l=o.length;c<l;++c)if(o[c].name===e){o[c]=u;break}c===l&&o.push(u)}i.tween=o}}function ye(t,e,r){var n=t._id;return t.each((function(){var t=te(this,n);(t.value||(t.value={}))[e]=r.apply(this,arguments)})),function(t){return ee(t,n).value[e]}}function pe(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function ve(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}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}\\)$`),Ce=new RegExp(`^hsla\\(${we},${xe},${xe},${we}\\)$`),Ee={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,r;return t=(t+"").trim().toLowerCase(),(e=Se.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?Re(e):3===r?new Fe(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?Le(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?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))?We(e[1],e[2]/100,e[3]/100,1):(e=Ce.exec(t))?We(e[1],e[2]/100,e[3]/100,e[4]):Ee.hasOwnProperty(t)?Re(Ee[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,r,n){return n<=0&&(t=e=r=NaN),new Fe(t,e,r,n)}function ze(t,e,r,n){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,r,null==n?1:n);var o}function Fe(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}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 We(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Ue(t,e,r,n)}function Ze(t){if(t instanceof Ue)return new Ue(t.h,t.s,t.l,t.opacity);if(t instanceof de||(t=Me(t)),!t)return new Ue;if(t instanceof Ue)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,o=Math.min(e,r,n),i=Math.max(e,r,n),a=NaN,u=i-o,c=(i+o)/2;return u?(a=e===i?(r-n)/u+6*(r<n):r===i?(n-e)/u+2:(e-r)/u+4,u/=c<.5?i+o:2-i-o,a*=60):u=c>0&&c<1?0:a,new Ue(a,u,c,t.opacity)}function Ue(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}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 He(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function Xe(t,e,r,n,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*r+(1+3*t+3*i-3*a)*n+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 Ze(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(Ue,(function(t,e,r,n){return 1===arguments.length?Ze(t):new Ue(t,e,r,null==n?1:n)}),ve(de,{brighter(t){return t=null==t?be:Math.pow(be,t),new Ue(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?me:Math.pow(me,t),new Ue(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,r=this.l,n=r+(r<.5?r:1-r)*e,o=2*r-n;return new Fe(He(t>=240?t-240:t+120,o,n),He(t,o,n),He(t<120?t+240:t-120,o,n),this.opacity)},clamp(){return new Ue($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 r=e-t;return r?function(t,e){return function(r){return t+r*e}}(t,r):Ve(isNaN(t)?e:t)}const Je=function t(e){var r=function(t){return 1==(t=+t)?qe:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):Ve(isNaN(e)?r:e)}}(e);function n(t,e){var n=r((t=ze(t)).r,(e=ze(e)).r),o=r(t.g,e.g),i=r(t.b,e.b),a=qe(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+""}}return n.gamma=t,n}(1);function Ke(t){return function(e){var r,n,o=e.length,i=new Array(o),a=new Array(o),u=new Array(o);for(r=0;r<o;++r)n=ze(e[r]),i[r]=n.r||0,a[r]=n.g||0,u[r]=n.b||0;return i=t(i),a=t(a),u=t(u),n.opacity=1,function(t){return n.r=i(t),n.g=a(t),n.b=u(t),n+""}}}Ke((function(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),o=t[n],i=t[n+1],a=n>0?t[n-1]:2*o-i,u=n<e-1?t[n+2]:2*i-o;return Xe((r-n/e)*e,a,o,i,u)}})),Ke((function(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),o=t[(n+e-1)%e],i=t[n%e],a=t[(n+1)%e],u=t[(n+2)%e];return Xe((r-n/e)*e,o,i,a,u)}}));var Qe=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tr=new RegExp(Qe.source,"g");function er(t,e){var r,n,o,i=Qe.lastIndex=tr.lastIndex=0,a=-1,u=[],c=[];for(t+="",e+="";(r=Qe.exec(t))&&(n=tr.exec(e));)(o=n.index)>i&&(o=e.slice(i,o),u[a]?u[a]+=o:u[++a]=o),(r=r[0])===(n=n[0])?u[a]?u[a]+=n:u[++a]=n:(u[++a]=null,c.push({i:a,x:ne(r,n)})),i=tr.lastIndex;return i<e.length&&(o=e.slice(i),u[a]?u[a]+=o:u[++a]=o),u.length<2?c[0]?function(t){return function(e){return t(e)+""}}(c[0].x):function(t){return function(){return t}}(e):(e=c.length,function(t){for(var r,n=0;n<e;++n)u[(r=c[n]).i]=r.x(t);return u.join("")})}function rr(t,e){var r;return("number"==typeof e?ne:e instanceof Me?Je:(r=Me(e))?(e=r,Je):er)(t,e)}function nr(t){return function(){this.removeAttribute(t)}}function or(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ir(t,e,r){var n,o,i=r+"";return function(){var a=this.getAttribute(t);return a===i?null:a===n?o:o=e(n=a,r)}}function ar(t,e,r){var n,o,i=r+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===n?o:o=e(n=a,r)}}function ur(t,e,r){var n,o,i;return function(){var a,u,c=r(this);if(null!=c)return(a=this.getAttribute(t))===(u=c+"")?null:a===n&&u===o?i:(o=u,i=e(n=a,c));this.removeAttribute(t)}}function cr(t,e,r){var n,o,i;return function(){var a,u,c=r(this);if(null!=c)return(a=this.getAttributeNS(t.space,t.local))===(u=c+"")?null:a===n&&u===o?i:(o=u,i=e(n=a,c));this.removeAttributeNS(t.space,t.local)}}function lr(t,e){var r,n;function o(){var o=e.apply(this,arguments);return o!==n&&(r=(n=o)&&function(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}(t,o)),r}return o._value=e,o}function sr(t,e){var r,n;function o(){var o=e.apply(this,arguments);return o!==n&&(r=(n=o)&&function(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}(t,o)),r}return o._value=e,o}function fr(t,e){return function(){Qt(this,t).delay=+e.apply(this,arguments)}}function hr(t,e){return e=+e,function(){Qt(this,t).delay=e}}function yr(t,e){return function(){te(this,t).duration=+e.apply(this,arguments)}}function pr(t,e){return e=+e,function(){te(this,t).duration=e}}var vr=yt.prototype.constructor;function dr(t){return function(){this.style.removeProperty(t)}}var mr=0;function br(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function gr(){return++mr}var wr=yt.prototype;br.prototype=function(t){return yt().transition(t)}.prototype={constructor:br,select:function(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=n(t));for(var o=this._groups,i=o.length,a=new Array(i),u=0;u<i;++u)for(var c,l,s=o[u],f=s.length,h=a[u]=new Array(f),y=0;y<f;++y)(c=s[y])&&(l=t.call(c,c.__data__,y,s))&&("__data__"in c&&(l.__data__=c.__data__),h[y]=l,Kt(h[y],e,r,y,h,ee(c,r)));return new br(a,this._parents,e,r)},selectAll:function(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=i(t));for(var n=this._groups,o=n.length,a=[],u=[],c=0;c<o;++c)for(var l,s=n[c],f=s.length,h=0;h<f;++h)if(l=s[h]){for(var y,p=t.call(l,l.__data__,h,s),v=ee(l,r),d=0,m=p.length;d<m;++d)(y=p[d])&&Kt(y,e,r,d,p,v);a.push(p),u.push(l)}return new br(a,u,e,r)},selectChild:wr.selectChild,selectChildren:wr.selectChildren,filter:function(t){"function"!=typeof t&&(t=a(t));for(var e=this._groups,r=e.length,n=new Array(r),o=0;o<r;++o)for(var i,u=e[o],c=u.length,l=n[o]=[],s=0;s<c;++s)(i=u[s])&&t.call(i,i.__data__,s,u)&&l.push(i);return new br(n,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,n=e.length,o=r.length,i=Math.min(n,o),a=new Array(n),u=0;u<i;++u)for(var c,l=e[u],s=r[u],f=l.length,h=a[u]=new Array(f),y=0;y<f;++y)(c=l[y]||s[y])&&(h[y]=c);for(;u<n;++u)a[u]=e[u];return new br(a,this._parents,this._name,this._id)},selection:function(){return new vr(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,r=gr(),n=this._groups,o=n.length,i=0;i<o;++i)for(var a,u=n[i],c=u.length,l=0;l<c;++l)if(a=u[l]){var s=ee(a,e);Kt(a,t,r,l,u,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new br(n,this._parents,t,r)},call:wr.call,nodes:wr.nodes,node:wr.node,size:wr.size,empty:wr.empty,each:wr.each,on:function(t,e){var r=this._id;return arguments.length<2?ee(this.node(),r).on.on(t):this.each(function(t,e,r){var n,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!==n&&(o=(n=u).copy()).on(e,r),a.on=o}}(r,t,e))},attr:function(t,e){var r=x(t),n="transform"===r?se:rr;return this.attrTween(t,"function"==typeof e?(r.local?cr:ur)(r,n,ye(this,"attr."+t,e)):null==e?(r.local?or:nr)(r):(r.local?ar:ir)(r,n,e))},attrTween:function(t,e){var r="attr."+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;var n=x(t);return this.tween(r,(n.local?lr:sr)(n,e))},style:function(t,e,r){var n="transform"==(t+="")?le:rr;return null==e?this.styleTween(t,function(t,e){var r,n,o;return function(){var i=M(this,t),a=(this.style.removeProperty(t),M(this,t));return i===a?null:i===r&&a===n?o:o=e(r=i,n=a)}}(t,n)).on("end.style."+t,dr(t)):"function"==typeof e?this.styleTween(t,function(t,e,r){var n,o,i;return function(){var a=M(this,t),u=r(this),c=u+"";return null==u&&(this.style.removeProperty(t),c=u=M(this,t)),a===c?null:a===n&&c===o?i:(o=c,i=e(n=a,u))}}(t,n,ye(this,"style."+t,e))).each(function(t,e){var r,n,o,i,a="style."+e,u="end."+a;return function(){var c=te(this,t),l=c.on,s=null==c.value[a]?i||(i=dr(e)):void 0;l===r&&o===s||(n=(r=l).copy()).on(u,o=s),c.on=n}}(this._id,t)):this.styleTween(t,function(t,e,r){var n,o,i=r+"";return function(){var a=M(this,t);return a===i?null:a===n?o:o=e(n=a,r)}}(t,n,e),r).on("end.style."+t,null)},styleTween:function(t,e,r){var n="style."+(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;return this.tween(n,function(t,e,r){var n,o;function i(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&function(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}(t,i,r)),n}return i._value=e,i}(t,e,null==r?"":r))},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,r;function n(){var n=t.apply(this,arguments);return n!==r&&(e=(r=n)&&function(t){return function(e){this.textContent=t.call(this,e)}}(n)),e}return n._value=t,n}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var r=this._id;if(t+="",arguments.length<2){for(var n,o=ee(this.node(),r).tween,i=0,a=o.length;i<a;++i)if((n=o[i]).name===t)return n.value;return null}return this.each((null==e?fe:he)(r,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?fr:hr)(e,t)):ee(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?yr:pr)(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 r=e.apply(this,arguments);if("function"!=typeof r)throw new Error;te(this,t).ease=r}}(this._id,t))},end:function(){var t,e,r=this,n=r._id,o=r.size();return new Promise((function(i,a){var u={value:a},c={value:function(){0==--o&&i()}};r.each((function(){var r=te(this,n),o=r.on;o!==t&&((e=(t=o).copy())._.cancel.push(u),e._.interrupt.push(u),e._.end.push(c)),r.on=e})),0===o&&i()}))},[Symbol.iterator]:wr[Symbol.iterator]};var xr={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Sr(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}yt.prototype.interrupt=function(t){return this.each((function(){re(this,t)}))},yt.prototype.transition=function(t){var e,r;t instanceof br?(e=t._id,t=t._name):(e=gr(),(r=xr).time=It(),t=null==t?null:t+"");for(var n=this._groups,o=n.length,i=0;i<o;++i)for(var a,u=n[i],c=u.length,l=0;l<c;++l)(a=u[l])&&Kt(a,t,e,l,u,r||Sr(a,e));return new br(n,this._parents,t,e)};const _r=t=>()=>t;function Or(t,{sourceEvent:e,target:r,transform:n,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:o}})}function jr(t,e,r){this.k=t,this.x=e,this.y=r}jr.prototype={constructor:jr,scale:function(t){return 1===t?this:new jr(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new jr(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 Pr=new jr(1,0,0);function kr(t){t.stopImmediatePropagation()}function Cr(t){t.preventDefault(),t.stopImmediatePropagation()}function Er(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Tr(){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 Ar(){return this.__zoom||Pr}function Mr(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Rr(){return navigator.maxTouchPoints||"ontouchstart"in this}function Lr(t,e,r){var n=t.invertX(e[0][0])-r[0][0],o=t.invertX(e[1][0])-r[1][0],i=t.invertY(e[0][1])-r[0][1],a=t.invertY(e[1][1])-r[1][1];return t.translate(o>n?(n+o)/2:Math.min(0,n)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}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 Fr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ir(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==zr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==zr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===zr(o)?o:String(o)),n)}var o}jr.prototype;var Nr=function(){function t(e,r,n,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=r||{x:.5*this.w,y:.5*this.h},this.zf=n,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=Pr;(function(){var t,e,r,n=Er,o=Tr,i=Lr,a=Mr,u=Rr,c=[0,1/0],l=[[-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",Ar).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",P).filter(u).on("touchstart.zoom",k).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",E).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(t,e){return(e=Math.max(c[0],Math.min(c[1],e)))===t.k?t:new jr(e,t.x,t.y)}function g(t,e,r){var n=e[0]-r[0]*t.k,o=e[1]-r[1]*t.k;return n===t.x&&o===t.y?t:new jr(t.k,n,o)}function w(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function x(t,e,r,n){t.on("start.zoom",(function(){S(this,arguments).event(n).start()})).on("interrupt.zoom end.zoom",(function(){S(this,arguments).event(n).end()})).tween("zoom",(function(){var t=this,i=arguments,a=S(t,i).event(n),u=o.apply(t,i),c=null==r?w(u):"function"==typeof r?r.apply(t,i):r,l=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(c).concat(l/s.k),h.invert(c).concat(l/h.k));return function(t){if(1===t)t=h;else{var e=y(t),r=l/e[2];t=new jr(r,c[0]-e[0]*r,c[1]-e[1]*r)}a.zoom(null,t)}}))}function S(t,e,r){return!r&&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(n.apply(this,arguments)){var r=S(this,e).event(t),o=this.__zoom,u=Math.max(c[0],Math.min(c[1],o.k*Math.pow(2,a.apply(this,arguments)))),s=jt(t);if(r.wheel)r.mouse[0][0]===s[0]&&r.mouse[0][1]===s[1]||(r.mouse[1]=o.invert(r.mouse[0]=s)),clearTimeout(r.wheel);else{if(o.k===u)return;r.mouse=[s,o.invert(s)],re(this),r.start()}Cr(t),r.wheel=setTimeout((function(){r.wheel=null,r.end()}),p),r.zoom("mouse",i(g(b(o,u),r.mouse[0],r.mouse[1]),r.extent,l))}}function j(t,...e){if(!r&&n.apply(this,arguments)){var o=t.currentTarget,a=S(this,e,!0).event(t),u=pt(t.view).on("mousemove.zoom",(function(t){if(Cr(t),!a.moved){var e=t.clientX-s,r=t.clientY-f;a.moved=e*e+r*r>v}a.event(t).zoom("mouse",i(g(a.that.__zoom,a.mouse[0]=jt(t,o),a.mouse[1]),a.extent,l))}),!0).on("mouseup.zoom",(function(t){u.on("mousemove.zoom mouseup.zoom",null),function(t,e){var r=t.document.documentElement,n=pt(t).on("dragstart.drag",null);e&&(n.on("click.drag",St,xt),setTimeout((function(){n.on("click.drag",null)}),0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}(t.view,a.moved),Cr(t),a.event(t).end()}),!0),c=jt(t,o),s=t.clientX,f=t.clientY;!function(t){var e=t.document.documentElement,r=pt(t).on("dragstart.drag",St,xt);"onselectstart"in e?r.on("selectstart.drag",St,xt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(t.view),kr(t),a.mouse=[c,this.__zoom.invert(c)],re(this),a.start()}}function P(t,...e){if(n.apply(this,arguments)){var r=this.__zoom,a=jt(t.changedTouches?t.changedTouches[0]:t,this),u=r.invert(a),c=r.k*(t.shiftKey?.5:2),f=i(g(b(r,c),a,u),o.apply(this,e),l);Cr(t),s>0?pt(this).transition().duration(s).call(x,f,a,t):pt(this).call(m.transform,f,a,t)}}function k(r,...o){if(n.apply(this,arguments)){var i,a,u,c,l=r.touches,s=l.length,f=S(this,o,r.changedTouches.length===s).event(r);for(kr(r),a=0;a<s;++a)c=[c=jt(u=l[a],this),this.__zoom.invert(c),u.identifier],f.touch0?f.touch1||f.touch0[2]===c[2]||(f.touch1=c,f.taps=0):(f.touch0=c,i=!0,f.taps=1+!!t);t&&(t=clearTimeout(t)),i&&(f.taps<2&&(e=c[0],t=setTimeout((function(){t=null}),y)),re(this),f.start())}}function C(t,...e){if(this.__zooming){var r,n,o,a,u=S(this,e).event(t),c=t.changedTouches,s=c.length;for(Cr(t),r=0;r<s;++r)o=jt(n=c[r],this),u.touch0&&u.touch0[2]===n.identifier?u.touch0[0]=o:u.touch1&&u.touch1[2]===n.identifier&&(u.touch1[0]=o);if(n=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;n=b(n,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(n,o,a),u.extent,l))}}function E(t,...n){if(this.__zooming){var o,i,a=S(this,n).event(t),u=t.changedTouches,c=u.length;for(kr(t),r&&clearTimeout(r),r=setTimeout((function(){r=null}),y),o=0;o<c;++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 l=pt(this).on("dblclick.zoom");l&&l.apply(this,arguments)}}}return m.transform=function(t,e,r,n){var o=t.selection?t.selection():t;o.property("__zoom",Ar),t!==o?x(t,e,r,n):o.interrupt().each((function(){S(this,arguments).event(n).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},m.scaleBy=function(t,e,r,n){m.scaleTo(t,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),r,n)},m.scaleTo=function(t,e,r,n){m.transform(t,(function(){var t=o.apply(this,arguments),n=this.__zoom,a=null==r?w(t):"function"==typeof r?r.apply(this,arguments):r,u=n.invert(a),c="function"==typeof e?e.apply(this,arguments):e;return i(g(b(n,c),a,u),t,l)}),r,n)},m.translateBy=function(t,e,r,n){m.transform(t,(function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof r?r.apply(this,arguments):r),o.apply(this,arguments),l)}),null,n)},m.translateTo=function(t,e,r,n,a){m.transform(t,(function(){var t=o.apply(this,arguments),a=this.__zoom,u=null==n?w(t):"function"==typeof n?n.apply(this,arguments):n;return i(Pr.translate(u[0],u[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof r?-r.apply(this,arguments):-r),t,l)}),n,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 Or(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:_r(+t),m):a},m.filter=function(t){return arguments.length?(n="function"==typeof t?t:_r(!!t),m):n},m.touchable=function(t){return arguments.length?(u="function"==typeof t?t:_r(!!t),m):u},m.extent=function(t){return arguments.length?(o="function"==typeof t?t:_r([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),m):o},m.scaleExtent=function(t){return arguments.length?(c[0]=+t[0],c[1]=+t[1],m):[c[0],c[1]]},m.translateExtent=function(t){return arguments.length?(l[0][0]=+t[0][0],l[1][0]=+t[1][0],l[0][1]=+t[0][1],l[1][1]=+t[1][1],m):[[l[0][0],l[0][1]],[l[1][0],l[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,r=u.k/e.k;if(1==r){var n=u.x-e.x,o=u.y-e.y;i.pan(n*i.getZf(),-o*i.getZf())}else{var a=t.sourceEvent;if(a instanceof WheelEvent)i.zoom(r,i.pixToGeoX(t.sourceEvent.offsetX),i.pixToGeoY(t.sourceEvent.offsetY));else if(a instanceof TouchEvent){var c,l=0,s=0,f=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Fr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Fr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(a.targetTouches);try{for(f.s();!(c=f.n()).done;){var h=c.value;l+=h.clientX,s+=h.clientY}}catch(t){f.e(t)}finally{f.f()}l/=a.targetTouches.length,s/=a.targetTouches.length,i.zoom(r,i.pixToGeoX(l),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,r,n;return e=t,r=[{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,r=this.center.y/this.getZf()+.5*this.h;this.ctx.setTransform(t,0,0,-t,e,r)}},{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,r=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 n=t*this.getZf();n<this.zfExtent[0]&&(t=this.zfExtent[0]/this.getZf()),n>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=(r-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(r)*(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"),r=t.getParameterByName("y"),n=t.getParameterByName("z"),o=this.getCenter();null==e||null==e||isNaN(+e)||(o.x=+e),null==r||null==r||isNaN(+r)||(o.y=+r),null==n||null==n||isNaN(+n)||this.setZf(+n)}},{key:"addZoomSlider",value:function(t,e){(e=e||{}).width=e.width||"30px",e.height=e.height||"300px";var r=pt("#"+t);if(r.empty())return console.error("Could not find div element to build zoom slider. Id: "+t),this;var n=this;return this.slider=r.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),n.setZf(e),n.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}}],n=[{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}}],r&&Ir(e.prototype,r),n&&Ir(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Br(t){return Br="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},Br(t)}function Dr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Br(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Br(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Br(o)?o:String(o)),n)}var o}var Gr=function(){function t(e,r){var n=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),n=n||{},this.dataset=e,this.styles=r,this.visible=!1!==n.visible,this.alpha=n.alpha,this.blendOperation=n.blendOperation||function(t){return"source-over"},this.minZoom=n.minZoom||0,this.maxZoom=n.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=n.pixNb||3,this.cellInfoHTML=n.cellInfoHTML||t.defaultCellInfoHTML}var e,r,n;return e=t,n=[{key:"defaultCellInfoHTML",value:function(t){for(var e=[],r=0,n=Object.keys(t);r<n.length;r++){var o=n[r];"x"!==o&&"y"!==o&&e.push("<b>",o,"</b>"," : ",t[o],"<br>")}return e.join("")}}],(r=[{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,r=0,n=e[r]/this.pixNb;n<t&&r<e.length;)n=e[++r]/this.pixNb;return r==e.length?this.dataset.datasetComponents[e.length-1]:this.dataset.datasetComponents[r]}}}])&&Dr(e.prototype,r),n&&Dr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Wr(t){return Wr="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},Wr(t)}function Zr(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ur(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ur(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Ur(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function $r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Wr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Wr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Wr(o)?o:String(o)),n)}var o}var Yr=function(){function t(e,r){var n=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),n=n||{},this.datasetComponents=e,this.resolutions=r,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);n.preprocess&&this.setPrepocesses(n.preprocess)}var e,r,n;return e=t,n=[{key:"make",value:function(e,r,n){var o,i=[],a=Zr(e);try{for(a.s();!(o=a.n()).done;){var u=o.value;i.push(r(u))}}catch(t){a.e(t)}finally{a.f()}return new t(i,e,n)}}],(r=[{key:"setPrepocesses",value:function(t){var e,r=Zr(this.datasetComponents);try{for(r.s();!(e=r.n()).done;)e.value.preprocess=t}catch(t){r.e(t)}finally{r.f()}return this}}])&&$r(e.prototype,r),n&&$r(e,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 Xr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Vr(n.key),n)}}function Vr(t){var e=function(t,e){if("object"!==Hr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Hr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Hr(e)?e:String(e)}var qr=function(){function t(e){var r,n,o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=this,o=function(t,e){var r=this.tooltip.node(),n=e.width;if(r.offsetLeft+r.clientWidth>n){var o=t.pageX-e.left-r.clientWidth-this.xOffset;if(r.style.left=o+"px",r.offsetLeft+r.clientWidth+e.left>t.pageX){var i=t.pageX-(r.clientWidth+this.xOffset+e.left);r.style.left=i+"px"}}r.offsetTop+r.clientHeight>e.height&&(r.style.top=r.offsetTop-r.clientHeight+"px")},(n=Vr(n="ensureTooltipInsideContainer"))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=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,r;return e=t,r=[{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)}}],r&&Xr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Jr={},Kr={};function Qr(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function tn(t){var e=Object.create(null),r=[];return t.forEach((function(t){for(var n in t)n in e||r.push(e[n]=n)})),r}function en(t,e){var r=t+"",n=r.length;return n<e?new Array(e-n+1).join(0)+r:r}function rn(t){var e=new RegExp('["'+t+"\n\r]"),r=t.charCodeAt(0);function n(t,e){var n,o=[],i=t.length,a=0,u=0,c=i<=0,l=!1;function s(){if(c)return Kr;if(l)return l=!1,Jr;var e,n,o=a;if(34===t.charCodeAt(o)){for(;a++<i&&34!==t.charCodeAt(a)||34===t.charCodeAt(++a););return(e=a)>=i?c=!0:10===(n=t.charCodeAt(a++))?l=!0:13===n&&(l=!0,10===t.charCodeAt(a)&&++a),t.slice(o+1,e-1).replace(/""/g,'"')}for(;a<i;){if(10===(n=t.charCodeAt(e=a++)))l=!0;else if(13===n)l=!0,10===t.charCodeAt(a)&&++a;else if(n!==r)continue;return t.slice(o,e)}return c=!0,t.slice(o,i)}for(10===t.charCodeAt(i-1)&&--i,13===t.charCodeAt(i-1)&&--i;(n=s())!==Kr;){for(var f=[];n!==Jr&&n!==Kr;)f.push(n),n=s();e&&null==(f=e(f,u++))||o.push(f)}return o}function o(e,r){return e.map((function(e){return r.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=(r=t).getUTCHours(),i=r.getUTCMinutes(),a=r.getUTCSeconds(),u=r.getUTCMilliseconds(),isNaN(r)?"Invalid Date":((n=r.getUTCFullYear())<0?"-"+en(-n,6):n>9999?"+"+en(n,6):en(n,4))+"-"+en(r.getUTCMonth()+1,2)+"-"+en(r.getUTCDate(),2)+(u?"T"+en(o,2)+":"+en(i,2)+":"+en(a,2)+"."+en(u,3)+"Z":a?"T"+en(o,2)+":"+en(i,2)+":"+en(a,2)+"Z":i||o?"T"+en(o,2)+":"+en(i,2)+"Z":"")):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t;var r,n,o,i,a,u}return{parse:function(t,e){var r,o,i=n(t,(function(t,n){if(r)return r(t,n-1);o=t,r=e?function(t,e){var r=Qr(t);return function(n,o){return e(r(n),o,t)}}(t,e):Qr(t)}));return i.columns=o||[],i},parseRows:n,format:function(e,r){return null==r&&(r=tn(e)),[r.map(a).join(t)].concat(o(e,r)).join("\n")},formatBody:function(t,e){return null==e&&(e=tn(t)),o(t,e).join("\n")},formatRows:function(t){return t.map(i).join("\n")},formatRow:i,formatValue:a}}var nn=rn(","),on=nn.parse,an=(nn.parseRows,nn.format,nn.formatBody,nn.formatRows,nn.formatRow,nn.formatValue,rn("\t")),un=an.parse;function cn(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function ln(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=void 0),function(t,e){return fetch(t,e).then(cn)}(e,r).then((function(e){return t(e,n)}))}}an.parseRows,an.format,an.formatBody,an.formatRows,an.formatRow,an.formatValue;var sn=ln(on);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 hn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function yn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==fn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==fn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===fn(o)?o:String(o)),n)}var o}ln(un);var pn=function(){function t(e,r){var n=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),n=n||{},this.url=e,this.resolution=r,this.preprocess=n.preprocess||void 0,this.cellsViewCache=[]}var e,r;return e=t,(r=[{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 r,n=this.getResolution(),o=n*Math.floor(t.x/n),i=n*Math.floor(t.y/n),a=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return hn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?hn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(e);try{for(a.s();!(r=a.n()).done;){var u=r.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}}])&&yn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function vn(t){return vn="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},vn(t)}function dn(){dn=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return n(a,"_invoke",{value:x(t,r,u)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function h(){}function y(){}function p(){}var v={};c(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(P([])));m&&m!==e&&r.call(m,i)&&(v=m);var b=p.prototype=h.prototype=Object.create(v);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,u){var c=s(t[n],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==vn(f)&&r.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){l.value=t,a(l)}),(function(t){return o("throw",t,a,u)}))}u(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=S(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,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 n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],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,n(b,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:y,configurable:!0}),y.displayName=c(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,c(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},g(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(b),c(b,u,"Generator"),c(b,i,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,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)&&r.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 n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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 r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function mn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return bn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function bn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function gn(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function wn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==vn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==vn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===vn(o)?o:String(o)),n)}var o}function xn(t,e){return xn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xn(t,e)}function Sn(t){return Sn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sn(t)}var _n=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&&xn(t,e)}(a,t);var e,r,n,o,i=(n=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=Sn(n);if(o){var r=Sn(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===vn(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 r,n=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),(r=i.call(this,t,e,n)).cells=[],r.infoLoadingStatus="notLoaded",r}return e=a,r=[{key:"getData",value:function(t,e){var r,n=this;return"notLoaded"!=this.infoLoadingStatus||(this.infoLoadingStatus="loading",(r=dn().mark((function t(){var r,o,i,a,u,c,l;return dn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,sn(n.url);case 3:r=t.sent,o=mn(r);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(!n.preprocess){t.next=29;break}n.cells=[],u=mn(r),t.prev=9,u.s();case 11:if((c=u.n()).done){t.next=19;break}if(l=c.value,0!=n.preprocess(l)){t.next=16;break}return t.abrupt("continue",17);case 16:n.cells.push(l);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:n.cells=r;case 30:e&&e(),n.infoLoadingStatus="loaded",t.next=38;break;case 34:t.prev=34,t.t1=t.catch(0),n.infoLoadingStatus="failed",n.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(n,o){var i=r.apply(t,e);function a(t){gn(i,n,o,a,u,"next",t)}function u(t){gn(i,n,o,a,u,"throw",t)}a(void 0)}))})()),this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,r=mn(this.cells);try{for(r.s();!(e=r.n()).done;){var n=e.value;+n.x+this.resolution<t.xMin||+n.x-this.resolution>t.xMax||+n.y+this.resolution<t.yMin||+n.y-this.resolution>t.yMax||this.cellsViewCache.push(n)}}catch(t){r.e(t)}finally{r.f()}}}}],r&&wn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(pn);function On(t){return On="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},On(t)}function jn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Pn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==On(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==On(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===On(o)?o:String(o)),n)}var o}function kn(t,e){return kn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kn(t,e)}function Cn(t){return Cn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Cn(t)}var En=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&&kn(t,e)}(a,t);var e,r,n,o,i=(n=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=Cn(n);if(o){var r=Cn(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===On(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 r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(r=i.call(this,"",t)).cells=e||[],r}return e=a,(r=[{key:"getData",value:function(t,e){return this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return jn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(this.cells);try{for(r.s();!(e=r.n()).done;){var n=e.value;+n.x+this.resolution<t.xMin||+n.x-this.resolution>t.xMax||+n.y+this.resolution<t.yMin||+n.y-this.resolution>t.yMax||this.cellsViewCache.push(n)}}catch(t){r.e(t)}finally{r.f()}}}}])&&Pn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(pn);function Tn(t){return Tn="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},Tn(t)}function An(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Mn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Tn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Tn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Tn(o)?o:String(o)),n)}var o}function Rn(t,e,r){return e&&Mn(t.prototype,e),r&&Mn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var Ln=Rn((function t(e,r,n,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=r,this.y=n;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,c=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return An(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?An(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(this.cells);try{for(c.s();!(u=c.n()).done;){var l=u.value;l.x=this.extGeo.xMin+l.x*i,l.y=this.extGeo.yMin+l.y*i}}catch(t){c.e(t)}finally{c.f()}}));function zn(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function Fn(t,e){return fetch(t,e).then(zn)}function In(t){return In="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},In(t)}function Nn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Bn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Bn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Bn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Dn(){Dn=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return n(a,"_invoke",{value:x(t,r,u)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function h(){}function y(){}function p(){}var v={};c(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(P([])));m&&m!==e&&r.call(m,i)&&(v=m);var b=p.prototype=h.prototype=Object.create(v);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,u){var c=s(t[n],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==In(f)&&r.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){l.value=t,a(l)}),(function(t){return o("throw",t,a,u)}))}u(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=S(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,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 n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],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,n(b,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:y,configurable:!0}),y.displayName=c(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,c(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},g(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(b),c(b,u,"Generator"),c(b,i,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,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)&&r.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 n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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 r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Gn(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function Wn(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Gn(i,n,o,a,u,"next",t)}function u(t){Gn(i,n,o,a,u,"throw",t)}a(void 0)}))}}function Zn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==In(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==In(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===In(o)?o:String(o)),n)}var o}function Un(t,e){return Un=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Un(t,e)}function $n(t){return $n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$n(t)}var Yn=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&&Un(t,e)}(a,t);var e,r,n,o,i=(n=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=$n(n);if(o){var r=$n(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===In(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 r,n=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),(r=i.call(this,t,0,n)).app=e,r.info=void 0,r.infoLoadingStatus="notLoaded",r.cache={},r}return e=a,(r=[{key:"loadInfo",value:function(t){var e=this;return this.info||"notLoaded"!==this.infoLoadingStatus?!t||"loaded"!==this.infoLoadingStatus&&"failed"!==this.infoLoadingStatus||t():Wn(Dn().mark((function r(){var n;return Dn().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,Fn(e.url+"info.json");case 3:n=r.sent,e.info=n,e.resolution=n.resolutionGeo,e.infoLoadingStatus="loaded",t&&t(),r.next=13;break;case 10:r.prev=10,r.t0=r.catch(0),e.infoLoadingStatus="failed";case 13:case"end":return r.stop()}}),r,null,[[0,10]])})))(),this}},{key:"getTilingEnvelope",value:function(t){if(this.info){var e=this.info.originPoint,r=this.info.resolutionGeo,n=this.info.tileSizeCell;return{xMin:Math.floor((t.xMin-e.x)/(r*n)),xMax:Math.floor((t.xMax-e.x)/(r*n)),yMin:Math.floor((t.yMin-e.y)/(r*n)),yMax:Math.floor((t.yMax-e.y)/(r*n))}}this.loadInfo((function(){}))}},{key:"getData",value:function(t,e){var r=this;if(!this.info)return this;var n=this.getTilingEnvelope(t);if(!n)return this;for(var o=this.info.tilingBounds,i=function(t){for(var i=function(n){if(r.cache[t]||(r.cache[t]={}),r.cache[t][n])return"continue";r.cache[t][n]="loading",Wn(Dn().mark((function o(){var i,a,u,c,l,s,f,h,y,p,v,d,m;return Dn().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,sn(r.url+t+"/"+n+".csv");case 3:if(a=o.sent,!r.preprocess){o.next=27;break}i=[],u=Nn(a),o.prev=7,u.s();case 9:if((c=u.n()).done){o.next=17;break}if(l=c.value,0!=r.preprocess(l)){o.next=14;break}return o.abrupt("continue",15);case 14:i.push(l);case 15:o.next=9;break;case 17:o.next=22;break;case 19:o.prev=19,o.t0=o.catch(7),u.e(o.t0);case 22:return o.prev=22,u.f(),o.finish(22);case 25:o.next=28;break;case 27:i=a;case 28:o.next=34;break;case 30:return o.prev=30,o.t1=o.catch(0),r.cache[t][n]="failed",o.abrupt("return");case 34:if(r.info){o.next=37;break}return console.error("Tile info inknown"),o.abrupt("return");case 37:if(s=new Ln(i,t,n,r.info),r.cache[t][n]=s,e){o.next=41;break}return o.abrupt("return");case 41:f=!1,h=r.app.getZoomFactor(),y=Nn(r.app.layers),o.prev=44,y.s();case 46:if((p=y.n()).done){o.next=56;break}if((v=p.value).visible){o.next=50;break}return o.abrupt("continue",54);case 50:if(v.getDatasetComponent(h)==r){o.next=52;break}return o.abrupt("continue",54);case 52:return f=!0,o.abrupt("break",56);case 54:o.next=46;break;case 56:o.next=61;break;case 58:o.prev=58,o.t2=o.catch(44),y.e(o.t2);case 61:return o.prev=61,y.f(),o.finish(61);case 64:if(f){o.next=66;break}return o.abrupt("return");case 66:if(d=r.app.updateExtentGeo(),m=s.extGeo,!(d.xMax<=m.xMin)){o.next=70;break}return o.abrupt("return");case 70:if(!(d.xMin>=m.xMax)){o.next=72;break}return o.abrupt("return");case 72:if(!(d.yMax<=m.yMin)){o.next=74;break}return o.abrupt("return");case 74:if(!(d.yMin>=m.yMax)){o.next=76;break}return o.abrupt("return");case 76:e();case 77:case"end":return o.stop()}}),o,null,[[0,30],[7,19,22,25],[44,58,61,64]])})))()},a=Math.max(n.yMin,o.yMin);a<=Math.min(n.yMax,o.yMax);a++)i(a)},a=Math.max(n.xMin,o.xMin);a<=Math.min(n.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 r=this.info.tilingBounds,n=Math.max(e.xMin,r.xMin);n<=Math.min(e.xMax,r.xMax);n++)if(this.cache[n])for(var o=Math.max(e.yMin,r.yMin);o<=Math.min(e.yMax,r.yMax);o++){var i=this.cache[n][o];if(i&&"string"!=typeof i){var a,u=Nn(i.cells);try{for(u.s();!(a=u.n()).done;){var c=a.value;+c.x+this.resolution<t.xMin||+c.x-this.resolution>t.xMax||+c.y+this.resolution<t.yMin||+c.y-this.resolution>t.yMax||this.cellsViewCache.push(c)}}catch(t){u.e(t)}finally{u.f()}}}}}}])&&Zn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(pn);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 Xn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Hn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Hn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Hn(o)?o:String(o)),n)}var o}var Vn=function(){function t(e){var r=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,n){return r.url+n+"/"+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,r;return e=t,(r=[{key:"get",value:function(t,e,r){var n=this.cache[t];if(n&&(n=n[e]))return n[r]}},{key:"put",value:function(t,e,r,n){this.cache[e]||(this.cache[e]={}),this.cache[e][r]||(this.cache[e][r]={}),this.cache[e][r][n]=t}},{key:"draw",value:function(t){var e=this;if(this.resolutions&&0!=this.resolutions.length){var r=t.getZf(),n=this.origin[0],o=this.origin[1],i=0;for(i=0;i<this.resolutions.length&&!(this.resolutions[i]<r);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,c=u/r,l=function(t){return Math.ceil((t-n)/u)},s=function(t){return Math.ceil(-(t-o)/u)},f=l(t.extGeo.xMin)-1,h=l(t.extGeo.xMax),y=s(t.extGeo.yMin),p=s(t.extGeo.yMax)-1,v=function(r){for(var a=function(a){var l=e.get(i,r,a);if(!l){var s=new Image;return e.put(s,i,r,a),s.onload=function(){t.redraw()},s.onerror=function(){e.put("failed",i,r,a)},s.src=e.urlFun(r,a,i),"continue"}if("failed"===l)return"continue";if(!(l instanceof HTMLImageElement))return console.log(l),"continue";if(0==l.width||0==l.height)return"continue";var f=n+r*u,h=o-a*u;try{t.ctx.drawImage(l,t.geoToPixX(f),t.geoToPixY(h),c,c)}catch(t){console.error(t)}},l=p;l<y;l++)a(l)},d=f;d<h;d++)v(d);if(this.filterColor){var m=this.filterColor(r);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")}}])&&Xn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function qn(t){return qn="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},qn(t)}function Jn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==qn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==qn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===qn(o)?o:String(o)),n)}var o}var Kn=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,r;return e=t,(r=[{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 r=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",r)}),this.img.src=r}var n=t.getZf();if(this.filterColor){var o=this.filterColor(n);o&&"none"!=o&&(t.ctx.fillStyle=o,t.ctx.fillRect(0,0,t.w,t.h))}}}])&&Jn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Qn(t){return Qn="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},Qn(t)}function to(){to=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return n(a,"_invoke",{value:x(t,r,u)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function h(){}function y(){}function p(){}var v={};c(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(P([])));m&&m!==e&&r.call(m,i)&&(v=m);var b=p.prototype=h.prototype=Object.create(v);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,u){var c=s(t[n],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==Qn(f)&&r.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){l.value=t,a(l)}),(function(t){return o("throw",t,a,u)}))}u(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=S(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,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 n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],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,n(b,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:y,configurable:!0}),y.displayName=c(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,c(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},g(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(b),c(b,u,"Generator"),c(b,i,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,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)&&r.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 n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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 r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function eo(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function ro(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return no(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?no(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function no(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function oo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Qn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Qn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Qn(o)?o:String(o)),n)}var o}var io=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,r,n,o;return e=t,r=[{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 r,n=ro(this.labels);try{for(n.s();!(r=n.n()).done;){var o=r.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 c=this.haloColor(o,e),l=this.haloWidth(o,e);c&&l&&l>0&&(t.ctx.strokeStyle=c,t.ctx.lineWidth=l,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){n.e(t)}finally{n.f()}}else this.load(t.redraw)}},{key:"load",value:(n=to().mark((function t(e){var r,n,o,i;return to().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,sn(this.url);case 11:if(r=t.sent,!this.preprocess){t.next=35;break}this.labels=[],n=ro(r),t.prev=15,n.s();case 17:if((o=n.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),n.e(t.t0);case 30:return t.prev=30,n.f(),t.finish(30);case 33:t.next=36;break;case 35:this.labels=r;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(r,o){var i=n.apply(t,e);function a(t){eo(i,r,o,a,u,"next",t)}function u(t){eo(i,r,o,a,u,"throw",t)}a(void 0)}))},function(t){return o.apply(this,arguments)})}],r&&oo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();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 uo(){uo=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return n(a,"_invoke",{value:x(t,r,u)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function h(){}function y(){}function p(){}var v={};c(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(P([])));m&&m!==e&&r.call(m,i)&&(v=m);var b=p.prototype=h.prototype=Object.create(v);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,u){var c=s(t[n],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==ao(f)&&r.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){l.value=t,a(l)}),(function(t){return o("throw",t,a,u)}))}u(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=S(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,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 n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],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,n(b,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:y,configurable:!0}),y.displayName=c(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,c(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},g(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(b),c(b,u,"Generator"),c(b,i,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,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)&&r.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 n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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 r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function co(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function lo(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return so(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?so(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function so(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function fo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ao(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ao(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ao(o)?o:String(o)),n)}var o}var ho=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,r,n,o;return e=t,r=[{key:"draw",value:function(t){if(this.fs){var e=t.getZf();t.setCanvasTransform();var r,n=lo(this.fs);try{for(n.s();!(r=n.n()).done;){var o=r.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 c=this.lineDash(o,e);c&&t.ctx.setLineDash(c),t.ctx.beginPath(),t.ctx.moveTo(i[0][0],i[0][1]);for(var l=1;l<i.length;l++)t.ctx.lineTo(i[l][0],i[l][1]);t.ctx.stroke()}}}}}catch(t){n.e(t)}finally{n.f()}t.ctx.setLineDash([])}else this.load(t.redraw)}},{key:"load",value:(n=uo().mark((function t(e){var r,n,o,i,a;return uo().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,Fn(this.url);case 11:if(r=t.sent,n=r.features,!this.preprocess){t.next=36;break}this.fs=[],o=lo(n),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=n;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(r,o){var i=n.apply(t,e);function a(t){co(i,r,o,a,u,"next",t)}function u(t){co(i,r,o,a,u,"throw",t)}a(void 0)}))},function(t){return o.apply(this,arguments)})}],r&&fo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function yo(t,e){if(e){if(0==e.length)return 0;if(t<=e[0])return 0;for(var r=1;r<e.length;r++)if(e[r-1]<t&&t<=e[r])return r;return e.length}}function po(t){return po="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},po(t)}function vo(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return mo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?mo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function mo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function bo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==po(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==po(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===po(o)?o:String(o)),n)}var o}var go=function(){function t(e,r){var n=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=r||{},this.layers=[],this.container=e||document.getElementById("gridviz"),this.container){this.w=r.w||this.container.offsetWidth,this.h=r.h||this.container.offsetHeight;var o=r.canvas||null;o||((o=document.createElement("canvas")).setAttribute("width",""+this.w),o.setAttribute("height",""+this.h),this.container.appendChild(o)),this.cg=new Nr(o,void 0,1,r),this.cg.redraw=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];n.legend&&t&&n.legend.selectAll("*").remove(),n.cg.initCanvasTransform(),n.cg.clear(n.cg.backgroundColor);var e=n.getZoomFactor();if(n.updateExtentGeo(),n.showBgLayers){var r,i=vo(n.bgLayers);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.visible&&(e>a.maxZoom||e<a.minZoom||a.draw(n.cg))}}catch(t){i.e(t)}finally{i.f()}}var u,c=vo(n.layers);try{for(c.s();!(u=c.n()).done;){var l=u.value;if(l.visible&&!(e>l.maxZoom||e<l.minZoom)){var s=l.getDatasetComponent(e);if(s){if(t&&s.getData(n.cg.extGeo,(function(){n.cg.redraw()})),t&&s.updateViewCache(n.cg.extGeo),n.cg.ctx.globalAlpha=l.alpha?l.alpha(e):1,n.cg.ctx.globalCompositeOperation=l.blendOperation(e),t){var f,h=vo(l.styles);try{for(h.s();!(f=h.n()).done;){var y=f.value;y.visible&&(e>y.maxZoom||e<y.minZoom||(n.cg.ctx.globalAlpha=y.alpha?y.alpha(e):1,n.cg.ctx.globalCompositeOperation=y.blendOperation(e),y.draw(s.getViewCache(),s.getResolution(),n.cg)))}}catch(t){h.e(t)}finally{h.f()}}if(n.legend&&t){var p,v=vo(l.styles);try{for(v.s();!(p=v.n()).done;){var d=p.value;if(!(e>d.maxZoom||e<d.minZoom)){var m,b=vo(d.legends);try{for(b.s();!(m=b.n()).done;){var g=m.value;n.legend.node().append(g.div.node())}}catch(t){b.e(t)}finally{b.f()}if(d.styles){var w,x=vo(d.styles);try{for(x.s();!(w=x.n()).done;){var S=w.value;if(!(e>S.maxZoom||e<S.minZoom)){var _,O=vo(S.legends);try{for(O.s();!(_=O.n()).done;){var j=_.value;n.legend.node().append(j.div.node())}}catch(t){O.e(t)}finally{O.f()}}}}catch(t){x.e(t)}finally{x.f()}}}}}catch(t){v.e(t)}finally{v.f()}}n.cg.ctx.globalAlpha=1,n.cg.ctx.globalCompositeOperation=n.defaultGlobalCompositeOperation}}}}catch(t){c.e(t)}finally{c.f()}return n.showBoundaries&&n.boundaryLayer&&n.boundaryLayer.draw(n.cg),n.showLabels&&n.labelLayer&&n.labelLayer.draw(n.cg),n.canvasSave=null,n.defineResizeObserver(n.container,o),n},this.bgLayers=[],this.showBgLayers=!0,this.labelLayer=void 0,this.showLabels=!0,this.boundaryLayer=void 0,this.showBoundaries=!0,this.legendDivId=r.legendDivId||"gvizLegend",this.legend=pt("#"+this.legendDivId),this.legend.empty()&&(this.legend=pt(this.container.id&&""!=this.container.id?"#"+this.container.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")),r.tooltip||(r.tooltip={}),r.tooltip.parentElement||(r.tooltip.parentElement=this.container),this.tooltip=new qr(r.tooltip);var i=function(t){var e={x:n.cg.pixToGeoX(t.offsetX+n.tooltip.xMouseOffset),y:n.cg.pixToGeoY(t.offsetY+n.tooltip.yMouseOffset)},o=n.getCellFocusInfo(e);if(r.transparentBackground)return o?(n.tooltip.setPosition(t),n.tooltip.show(),n.tooltip.html(o.html)):n.tooltip.hide(),n.canvasSave=document.createElement("canvas"),n.canvasSave.setAttribute("width",""+n.w),n.canvasSave.setAttribute("height",""+n.h),n.canvasSave.getContext("2d").drawImage(n.cg.canvas,0,0),void n.cg.initCanvasTransform();if(o){n.tooltip.setPosition(t),n.tooltip.show(),n.tooltip.html(o.html),n.canvasSave?n.cg.ctx.drawImage(n.canvasSave,0,0):(n.canvasSave=document.createElement("canvas"),n.canvasSave.setAttribute("width",""+n.w),n.canvasSave.setAttribute("height",""+n.h),n.canvasSave.getContext("2d").drawImage(n.cg.canvas,0,0));var i=n.selectionRectangleWidthPix?n.selectionRectangleWidthPix(o.resolution,n.getZoomFactor()):4;n.cg.initCanvasTransform(),n.cg.ctx.strokeStyle=n.selectionRectangleColor,n.cg.ctx.lineWidth=i,n.cg.ctx.beginPath(),n.cg.ctx.rect(n.cg.geoToPixX(o.cell.x)-i/2,n.cg.geoToPixY(o.cell.y)+i/2,o.resolution/n.getZoomFactor()+i,-o.resolution/n.getZoomFactor()-i),n.cg.ctx.stroke()}else n.tooltip.hide(),n.canvasSave&&n.cg.ctx.drawImage(n.canvasSave,0,0)};this.mouseOverHandler=function(t){return i(t)},this.mouseMoveHandler=function(t){return i(t)},this.mouseOutHandler=function(t){return n.tooltip.hide()},this.container.addEventListener("mouseover",this.mouseOverHandler),this.container.addEventListener("mousemove",this.mouseMoveHandler),this.container.addEventListener("mouseout",this.mouseOutHandler),this.cg.onZoomStartFun=function(t){r.onZoomStartFun&&r.onZoomStartFun(t),n.tooltip.hide()},this.canvasSave=null,this.selectionRectangleColor=r.selectionRectangleColor||"red",this.selectionRectangleWidthPix=r.selectionRectangleWidthPix||function(){return 4},this.defaultGlobalCompositeOperation=r.defaultGlobalCompositeOperation||this.cg.ctx.globalCompositeOperation}else console.error("Cannot find gridviz container element.")}var e,r;return e=t,r=[{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(),r=this.layers.length-1;r>=0;r--){var n=this.layers[r];if(n.visible&&n.cellInfoHTML){var o=n.getDatasetComponent(e);if(o){var i=o.getCellFromPosition(t,o.getViewCache());if(!i)return;var a=n.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 ho(t),this}},{key:"getLabelLayer",value:function(){return this.labelLayer}},{key:"setLabelLayer",value:function(t){return this.labelLayer=new io(t),this}},{key:"redraw",value:function(){return this.cg.redraw(),this}},{key:"addLayerFromDataset",value:function(t,e,r){var n=new Gr(t,e,r);return this.layers.push(n),this}},{key:"makeLGridDataset",value:function(t,e,r){return new Yr([new En(t,e)],[],r)}},{key:"makeCSVGridDataset",value:function(t,e,r){var n=this;return new Yr([new _n(t,e,r).getData(void 0,(function(){n.cg.redraw()}))],[],r)}},{key:"makeTiledGridDataset",value:function(t,e){var r=this;return new Yr([new Yn(t,this,e).loadInfo((function(){r.cg.redraw()}))],[],e)}},{key:"makeMultiScaleCSVGridDataset",value:function(t,e,r){var n=this;return Yr.make(t,(function(t){return new _n(e(t),t,r).getData(void 0,(function(){n.cg.redraw()}))}),r)}},{key:"makeMultiScaleTiledGridDataset",value:function(t,e,r){var n=this;return Yr.make(t,(function(t){return new Yn(e(t),n,r).loadInfo((function(){n.cg.redraw()}))}),r)}},{key:"addCSVGridLayer",value:function(t,e,r,n){var o=this.makeCSVGridDataset(t,e,n);return this.addLayerFromDataset(o,r,n)}},{key:"addTiledGridLayer",value:function(t,e,r){var n=this.makeTiledGridDataset(t,r);return this.addLayerFromDataset(n,e,r)}},{key:"addMultiScaleCSVGridLayer",value:function(t,e,r,n){var o=this.makeMultiScaleCSVGridDataset(t,e,n);return this.addLayerFromDataset(o,r,n)}},{key:"addMultiScaleTiledGridLayer",value:function(t,e,r,n){var o=this.makeMultiScaleTiledGridDataset(t,e,n);return this.addLayerFromDataset(o,r,n)}},{key:"addBackgroundLayer",value:function(t){return this.bgLayers.push(new Vn(t)),this.redraw(),this}},{key:"addBackgroundLayerWMS",value:function(t){return this.bgLayers.push(new Kn(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 r=this;new ResizeObserver((function(n){t.clientWidth>0&&t.clientHeight>0&&window.requestAnimationFrame((function(){Array.isArray(n)&&n.length&&(r.h===t.clientHeight&&r.w===t.clientWidth||(r.h=t.clientHeight,r.w=t.clientWidth,r.cg.h=t.clientHeight,r.cg.w=t.clientWidth,e.setAttribute("width",""+r.w),e.setAttribute("height",""+r.h),r.redraw()))}))})).observe(t)}},{key:"destroy",value:function(){var t,e;this.layers=[],this.bgLayers=[],this.container.removeEventListener("mouseover",this.mouseOverHandler),this.container.removeEventListener("mousemove",this.mouseMoveHandler),this.container.removeEventListener("mouseout",this.mouseOutHandler),this.cg.canvas.remove(),null===(t=this.legend)||void 0===t||t.remove(),null===(e=this.tooltip.tooltip)||void 0===e||e.remove()}}],r&&bo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function wo(t){return wo="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},wo(t)}function xo(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return So(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?So(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function So(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==wo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==wo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===wo(o)?o:String(o)),n)}var o}var Oo=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,r){return{dx:0,dy:0}},this.visible=!1!==e.visible,this.alpha=e.alpha,this.blendOperation=e.blendOperation||function(t){return"source-over"},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,r,n;return e=t,n=[{key:"getStatistics",value:function(t,e,r){if(t&&0!=t.length){var n,o=1/0,i=-1/0,a=xo(t);try{for(a.s();!(n=a.n()).done;){var u=+e(n.value);r&&!u||(u<o&&(o=u),u>i&&(i=u))}}catch(t){a.e(t)}finally{a.f()}return{min:o,max:i}}}}],(r=[{key:"draw",value:function(t,e,r){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,r=xo(this.legends);try{for(r.s();!(e=r.n()).done;)e.value.update(t)}catch(t){r.e(t)}finally{r.f()}return this}}])&&_o(e.prototype,r),n&&_o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();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 r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ko(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==jo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==jo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===jo(o)?o:String(o)),n)}var o}function Co(t,e){return Co=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Co(t,e)}function Eo(t){return Eo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Eo(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&&Co(t,e)}(a,t);var e,r,n,o,i=(n=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=Eo(n);if(o){var r=Eo(this).constructor;t=Reflect.construct(e,arguments,r)}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.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,(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i,a=r.getZf();this.sizeCol&&(t.sort((function(t,e){return e[n.sizeCol]-t[n.sizeCol]})),o=Oo.getStatistics(t,(function(t){return t[n.sizeCol]}),!0)),this.colorCol&&(i=Oo.getStatistics(t,(function(t){return t[n.colorCol]}),!0)),r.setCanvasTransform();var u,c=.5*e,l=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Po(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Po(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(l.s();!(u=l.n()).done;){var s=u.value,f=this.color?this.color(s[this.colorCol],e,i,a):void 0;if(f&&"none"!==f){r.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;r.ctx.fillRect(s.x+v+p.dx,s.y+v+p.dy,y,y)}else if("circle"===h)r.ctx.beginPath(),r.ctx.arc(s.x+c+p.dx,s.y+c+p.dy,.5*y,0,2*Math.PI,!1),r.ctx.fill();else if("donut"===h){var d=s.x+c+p.dx,m=s.y+c+p.dy;r.ctx.beginPath(),r.ctx.moveTo(d,m),r.ctx.arc(d,m,c,0,2*Math.PI),r.ctx.arc(d,m,(1-y/e)*c,0,2*Math.PI,!0),r.ctx.closePath(),r.ctx.fill()}else{if("diamond"!==h)throw new Error("Unexpected shape:"+h);var b=.5*y;r.ctx.beginPath(),r.ctx.moveTo(s.x+c-b,s.y+c),r.ctx.lineTo(s.x+c,s.y+c+b),r.ctx.lineTo(s.x+c+b,s.y+c),r.ctx.lineTo(s.x+c,s.y+c-b),r.ctx.fill()}}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,r:e,zf:a,sSize:o,sColor:i})}}])&&ko(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);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 r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ro(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ao(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ao(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ao(o)?o:String(o)),n)}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,r,n,o,i=(n=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(n);if(o){var r=zo(this).constructor;t=Reflect.construct(e,arguments,r)}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.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,(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i,a,u=r.getZf();this.strokeColorCol&&(o=Oo.getStatistics(t,(function(t){return t[n.strokeColorCol]}),!0)),this.sizeCol&&(i=Oo.getStatistics(t,(function(t){return t[n.sizeCol]}),!0)),this.strokeWidthCol&&(a=Oo.getStatistics(t,(function(t){return t[n.strokeWidthCol]}),!0)),r.setCanvasTransform();var c,l=.5*e,s=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Mo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Mo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(s.s();!(c=s.n()).done;){var f=c.value,h=this.strokeColor?this.strokeColor(f[this.strokeColorCol],e,o):void 0;if(h&&"none"!==h){r.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)){r.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;r.ctx.beginPath(),r.ctx.rect(f.x+m+d.dx,f.y+m+d.dy,y,y),r.ctx.stroke()}else if("circle"===v)r.ctx.beginPath(),r.ctx.arc(f.x+l+d.dx,f.y+l+d.dy,.5*y,0,2*Math.PI,!1),r.ctx.stroke();else if("diamond"===v){var b=.5*y;r.ctx.beginPath(),r.ctx.moveTo(f.x+l-b,f.y+l),r.ctx.lineTo(f.x+l,f.y+l+b),r.ctx.lineTo(f.x+l+b,f.y+l),r.ctx.lineTo(f.x+l,f.y+l-b),r.ctx.lineTo(f.x+l-b,f.y+l),r.ctx.stroke()}else{if("donut"!==v)throw new Error("Unexpected shape:"+v);console.error("Not implemented")}}}}}}catch(t){s.e(t)}finally{s.f()}}}])&&Ro(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);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){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Bo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Io(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Io(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Io(o)?o:String(o)),n)}var o}function Do(t,e){return Do=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Do(t,e)}function Go(t){return Go=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Go(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&&Do(t,e)}(a,t);var e,r,n,o,i=(n=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=Go(n);if(o){var r=Go(this).constructor;t=Reflect.construct(e,arguments,r)}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.heightCol=t.heightCol,e.height=t.height||function(t){return Math.sqrt(t)},e.lineColor=t.lineColor||function(t,e,r,n){return"#BBB"},e.lineWidth=t.lineWidth||function(t,e,r,n){return n},e.fillColor=t.fillColor||function(t,e,r,n){return"#c08c5968"},e}return e=a,(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter)),r.ctx.lineJoin="round";var o,i=r.getZf(),a=Oo.getStatistics(t,(function(t){return t[n.heightCol]}),!0),u={},c=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return No(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?No(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(o=c.n()).done;){var l=o.value,s=u[l.y];s||(s={},u[l.y]=s),s[l.x]=this.height(l[this.heightCol],e,a,i)}}catch(t){c.e(t)}finally{c.f()}var f=r.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};r.setCanvasTransform();for(var m=v;m>=p;m-=e){var b=u[m];if(b){r.ctx.beginPath(),r.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?r.ctx.lineTo(w+e/2,m+x):r.ctx.moveTo(w+e/2,m),g=x}g&&r.ctx.lineTo(y+e/2,m);var S=this.fillColor(m,d,e,i);S&&"none"!=S&&(r.ctx.fillStyle=S,r.ctx.fill());var _=this.lineColor(m,d,e,i),O=this.lineWidth(m,d,e,i);_&&"none"!=_&&O>0&&(r.ctx.strokeStyle=_,r.ctx.lineWidth=O,r.ctx.stroke())}}}}}])&&Bo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function Zo(t){return Zo="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},Zo(t)}function Uo(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||$o(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 $o(t,e){if(t){if("string"==typeof t)return Yo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Yo(t,e):void 0}}function Yo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ho(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Zo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Zo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Zo(o)?o:String(o)),n)}var o}function Xo(t,e){return Xo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xo(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&&Xo(t,e)}(a,t);var e,r,n,o,i=(n=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(n);if(o){var r=Vo(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Zo(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,r,n){return e},e.stripesOrientation=t.stripesOrientation||function(){return 0},e.offsetAngle=t.offsetAngle||function(){return 0},e.agePyramidHeight=t.agePyramidHeight||function(t,e,r){return e},e.pieChartInternalRadiusFactor=t.pieChartInternalRadiusFactor||0,e}return e=a,r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i=r.getZf();this.sizeCol&&(t.sort((function(t,e){return e[n.sizeCol]-t[n.sizeCol]})),o=Oo.getStatistics(t,(function(t){return t[n.sizeCol]}),!0));var a=Object.entries(this.color).length;r.setCanvasTransform();var u,c=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=$o(t))){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(u=c.n()).done;){var l=u.value,s=(this.size||function(){return e})(l[this.sizeCol],e,o,i),f=this.offset(l,e,i),h=this.type?this.type(l):"flag",y=l.x+f.dx+("agepyramid"===h?0:.5*e),p=l.y+f.dy+("agepyramid"===h?0:.5*e),v=this.offsetAngle?this.offsetAngle(l,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=+l[b[m]];g>d&&(d=g)}var w=0;"agepyramid"===h&&this.agePyramidHeight&&(w=(e-this.agePyramidHeight(l,e,i))/2),"radar"!==h&&"halftone"!==h||(w=Math.PI/2+v);var x="agepyramid"===h?(this.agePyramidHeight?this.agePyramidHeight(l,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=Uo(_[S],2),j=O[0],P=O[1];if("agepyramid"===h){r.ctx.fillStyle=P;var k=s*l[j]/d;r.ctx.fillRect(y+(e-k)/2,p+w,k,x),w+=x}else if("radar"===h){r.ctx.fillStyle=P;var C=l[j],E=s/2*Math.sqrt(C/d);r.ctx.beginPath(),r.ctx.moveTo(y,p),r.ctx.arc(y,p,E,w-x,w),r.ctx.lineTo(y,p),r.ctx.fill(),w+=x}else{if("halftone"!==h)throw new Error("Unexpected symbol type:"+h);r.ctx.fillStyle=P;var T=l[j],A=.333*s*Math.sqrt(T/d);r.ctx.beginPath(),r.ctx.arc(y+.25*e*Math.cos(w),p+.25*e*Math.sin(w),A,0,2*Math.PI),r.ctx.fill(),w+=x}}}else{for(var M=0,R=0,L=Object.keys(this.color);R<L.length;R++){var z=+l[L[R]];z&&(M+=z)}if(!M||isNaN(M))continue;for(var F=0,I=e*(1-s/e)*.5,N=this.stripesOrientation(l,e,i),B=0,D=Object.entries(this.color);B<D.length;B++){var G=Uo(D[B],2),W=G[0],Z=G[1],U=l[W]/M;if(U&&!isNaN(U)){if(r.ctx.fillStyle=Z,"flag"===h)0==N?r.ctx.fillRect(l.x+I+f.dx,l.y+I+F*s+f.dy,s,U*s):r.ctx.fillRect(l.x+I+F*s+f.dx,l.y+I+f.dy,U*s,s);else if("piechart"===h){var $=2*F*Math.PI,Y=2*(F+U)*Math.PI;r.ctx.beginPath(),r.ctx.moveTo(y,p),r.ctx.arc(y,p,.5*s,$+v,Y+v),this.pieChartInternalRadiusFactor&&r.ctx.arc(y,p,.5*s*this.pieChartInternalRadiusFactor,$+v,Y+v,!0),r.ctx.closePath(),r.ctx.fill()}else if("ring"===h)r.ctx.beginPath(),r.ctx.arc(y,p,Math.sqrt(1-F)*s*.5,0,2*Math.PI),r.ctx.fill();else{if("segment"!==h)throw new Error("Unexpected symbol type:"+h);var H=s*s/e;0==N?r.ctx.fillRect(l.x+f.dx,l.y+(e-H)/2+F*H+f.dy,e,U*H):r.ctx.fillRect(l.x+F*e+f.dx,l.y+(e-H)/2+f.dy,U*e,H)}F+=U}}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:i,sSize:o})}}],r&&Ho(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);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 Ko(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Qo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Jo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Jo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Jo(o)?o:String(o)),n)}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 ri=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)}(a,t);var e,r,n,o,i=(n=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=ei(n);if(o){var r=ei(this).constructor;t=Reflect.construct(e,arguments,r)}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.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,(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i,a,u=r.getZf();this.colorCol&&(o=Oo.getStatistics(t,(function(t){return t[n.colorCol]}),!0)),this.lengthCol&&(t.sort((function(t,e){return e[n.lengthCol]-t[n.lengthCol]})),i=Oo.getStatistics(t,(function(t){return t[n.lengthCol]}),!0)),this.widthCol&&(a=Oo.getStatistics(t,(function(t){return t[n.widthCol]}),!0)),r.ctx.lineCap="butt";var c=Math.PI/180;r.setCanvasTransform();var l,s=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ko(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ko(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(s.s();!(l=s.n()).done;){var f=l.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)*c;if(void 0!==v&&!isNaN(v)){var d=this.offset(f,e,u);r.ctx.strokeStyle=h,r.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;r.ctx.beginPath(),r.ctx.moveTo(m-g,b-w),r.ctx.lineTo(m+g,b+w),r.ctx.stroke()}}}}}}catch(t){s.e(t)}finally{s.f()}this.updateLegends({style:this,r:e,zf:u,sColor:o,sLength:i,sWidth:a})}}])&&Qo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function ni(t){return ni="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},ni(t)}function oi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ii(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ni(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ni(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ni(o)?o:String(o)),n)}var o}function ai(t,e){return ai=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ai(t,e)}function ui(t){return ui=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ui(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&&ai(t,e)}(u,t);var e,r,n,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=ui(o);if(i){var r=ui(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ni(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,r,n){return"X"},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.fontSizeCol=t.fontSizeCol,e.fontSize=t.fontSize||function(t,e,r,n){return.8*e},e.fontFamily=t.fontFamily||"Arial",e.fontWeight=t.fontWeight||"bold",e}return e=u,n=[{key:"getCharLegendFun",value:function(t){var e=t.length;return function(r){return 0==r?"":1==r?t[e-1]:t[Math.floor(r*e)]}}}],(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i,a,u=r.getZf();this.textCol&&(o=Oo.getStatistics(t,(function(t){return t[n.textCol]}),!0)),this.colorCol&&(i=Oo.getStatistics(t,(function(t){return t[n.colorCol]}),!0)),this.fontSizeCol&&(t.sort((function(t,e){return e[n.fontSizeCol]-t[n.fontSizeCol]})),a=Oo.getStatistics(t,(function(t){return t[n.fontSizeCol]}),!0)),r.initCanvasTransform();var c,l=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return oi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?oi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(l.s();!(c=l.n()).done;){var s=c.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){r.ctx.fillStyle=h;var y=this.fontSize(s[this.fontSizeCol],e,a,u)/u,p=this.fontFamily||"Arial",v=this.fontWeight||"bold";r.ctx.font=v+" "+y+"px "+p;var d=this.offset(s,e,u);r.ctx.textAlign="center";var m=r.geoToPixX(s.x+.5*e+d.dx),b=r.geoToPixY(s.y+.5*e+d.dy)+.3*y;r.ctx.fillText(f,m,b)}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,r:e,zf:u,sColor:i})}}])&&ii(e.prototype,r),n&&ii(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(Oo);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 si(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return fi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function fi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function hi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==li(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==li(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===li(o)?o:String(o)),n)}var o}function yi(t,e){return yi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},yi(t,e)}function pi(t){return pi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},pi(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&&yi(t,e)}(a,t);var e,r,n,o,i=(n=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=pi(n);if(o){var r=pi(this).constructor;t=Reflect.construct(e,arguments,r)}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.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=1==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,(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i,a,u=r.getZf();this.heightCol&&(o=Oo.getStatistics(t,(function(t){return t[n.heightCol]}),!0)),this.colorCol&&(i=Oo.getStatistics(t,(function(t){return t[n.colorCol]}),!0)),this.widthCol&&(a=Oo.getStatistics(t,(function(t){return t[n.widthCol]}),!0));var c=r.getCenter().x+this.viewSX*r.w*u,l=r.getCenter().y+this.viewSY*r.h*u,s=this.viewHeightFactor*(r.w+r.h)*.5*u;t.sort((function(t,e){return 1e8*(e.y-t.y)+t.x-e.x})),r.ctx.lineCap=this.simple?"butt":"round",r.setCanvasTransform(),r.ctx.strokeStyle=this.shadowColor,r.ctx.fillStyle=this.shadowColor;var f,h=si(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),r.ctx.lineWidth=p;var d=y.x+e/2,m=y.y+e/2,b=v*this.shadowFactor;r.ctx.beginPath(),r.ctx.moveTo(d,m),r.ctx.lineTo(d+b*Math.cos(this.shadowDirection),m+b*Math.sin(this.shadowDirection)),r.ctx.stroke()}}}}catch(t){h.e(t)}finally{h.f()}var g,w=si(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-c,C=P-l,E=Math.atan2(C,k),T=Math.sqrt(k*k+C*C)*O/(s-O);this.simple?(r.ctx.strokeStyle=S,r.ctx.lineWidth=_,r.ctx.beginPath(),r.ctx.moveTo(j,P),r.ctx.lineTo(j+T*Math.cos(E),P+T*Math.sin(E)),r.ctx.stroke()):(r.ctx.strokeStyle=this.outlineCol,r.ctx.lineWidth=_+2*this.outlineWidthPix*u,r.ctx.beginPath(),r.ctx.moveTo(j,P),r.ctx.lineTo(j+T*Math.cos(E),P+T*Math.sin(E)),r.ctx.stroke(),r.ctx.strokeStyle=S,r.ctx.lineWidth=_,r.ctx.beginPath(),r.ctx.moveTo(j,P),r.ctx.lineTo(j+T*Math.cos(E),P+T*Math.sin(E)),r.ctx.stroke(),r.ctx.strokeStyle=this.outlineCol,r.ctx.lineWidth=this.outlineWidthPix*u,r.ctx.beginPath(),r.ctx.arc(j+T*Math.cos(E),P+T*Math.sin(E),.5*_,0,2*Math.PI,!1),r.ctx.stroke())}}}}}catch(t){w.e(t)}finally{w.f()}r.ctx.lineCap="butt",this.updateLegends({style:this,r:e,zf:u,sColor:i})}}])&&hi(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function di(t){return di="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},di(t)}function mi(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return bi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function bi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function gi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==di(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==di(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===di(o)?o:String(o)),n)}var o}function wi(t,e){return wi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wi(t,e)}function xi(t){return xi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xi(t)}var Si=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&&wi(t,e)}(u,t);var e,r,n,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=xi(o);if(i){var r=xi(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===di(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,r,n,o){return 1},e.color=t.color||function(){return"#EA6BAC"},e.width=t.width||function(t,e,r,n){return e*t.value/5},e.orientation=t.orientation||0,e.fillColor=t.fillColor,e}return e=u,n=[{key:"getSideStatistics",value:function(t,e){if(t&&0!=t.length){var r,n=1/0,o=-1/0,i=mi(t);try{for(i.s();!(r=i.n()).done;){var a=r.value.value;e&&!a||(a<n&&(n=a),a>o&&(o=a))}}catch(t){i.e(t)}finally{i.f()}return{min:n,max:o}}}}],(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i=r.getZf();this.valueCol&&(o=Oo.getStatistics(t,(function(t){return t[n.valueCol]}),!0));var a=[];t.sort((function(t,e){return e.x==t.x?t.y-e.y:t.x-e.x}));for(var c=t[0],l=1;l<t.length;l++){var s=t[l];c.y+e==s.y&&c.x==s.x?a.push({x:c.x,y:s.y,or:"h",value:this.value(c[this.valueCol],s[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:s.x,y:s.y,or:"h",value:this.value(void 0,s[this.valueCol],e,o,i)})),c=s}t.sort((function(t,e){return e.y==t.y?t.x-e.x:t.y-e.y})),c=t[0];for(var f=1;f<t.length;f++){var h=t[f];c.x+e==h.x&&c.y==h.y?a.push({x:c.x+e,y:c.y,or:"v",value:this.value(c[this.valueCol],h[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:h.x,y:h.y,or:"v",value:this.value(void 0,h[this.valueCol],e,o,i)})),c=h}if(0!=a.length){var y=u.getSideStatistics(a,!0);if(r.setCanvasTransform(),this.fillColor){var p,v=mi(t);try{for(v.s();!(p=v.n()).done;){var d=p.value,m=this.fillColor(d);m&&"none"!=m&&(r.ctx.fillStyle=m,r.ctx.fillRect(d.x,d.y,e,e))}}catch(t){v.e(t)}finally{v.f()}}r.ctx.lineCap="butt";for(var b=e/2,g=0,w=a;g<w.length;g++){var x=w[g],S=this.color?this.color(x,e,y,i):void 0;if(S&&"none"!=S){var _=this.width?this.width(x,e,y,i):void 0;!_||_<=0||(r.ctx.strokeStyle=S,r.ctx.lineWidth=_,r.ctx.beginPath(),90==this.orientation?(r.ctx.moveTo(x.x+b,x.y+b),"h"===x.or?r.ctx.lineTo(x.x+b,x.y-b):r.ctx.lineTo(x.x-b,x.y+b)):(r.ctx.moveTo(x.x,x.y),r.ctx.lineTo(x.x+("h"===x.or?e:0),x.y+("v"===x.or?e:0))),r.ctx.stroke())}}this.updateLegends({style:this,r:e,zf:i})}}}])&&gi(e.prototype,r),n&&gi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(Oo);function _i(t){return _i="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},_i(t)}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)}(i,t);var e,r,n,o=(r=i,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,e=ji(r);if(n){var o=ji(this).constructor;t=Reflect.construct(e,arguments,o)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===_i(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 r=function(e){if(null==e)return 0;for(var r=0;r<t.breaks.length;r++)if(e<t.breaks[r])return r;return t.breaks.length};return e.value=function(t,e,n,o,i){return Math.abs(r(e)-r(t))},e.color=function(e,r,n,o){return e.value?t.color(e,r,o):void 0},e.width=function(e,r,n,o){return e.value*o*t.width(e,r,o)},e}return e=i,Object.defineProperty(e,"prototype",{writable:!1}),e}(Si);function ki(t){return ki="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},ki(t)}function Ci(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ei(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ki(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ki(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ki(o)?o:String(o)),n)}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 Ai(t){return Ai=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ai(t)}var Mi=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)}(a,t);var e,r,n,o,i=(n=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=Ai(n);if(o){var r=Ai(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ki(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,r){return.2*e},e.fillColor=t.fillColor,e}return e=a,(r=[{key:"draw",value:function(t,e,r){if(this.filter&&(t=t.filter(this.filter)),t&&0!=t.length){var n=r.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 c=t[u],l=c[this.col];i.y+e==c.y&&i.x==c.x?a!=l&&o.push({x:i.x,y:c.y,or:"h",v1:a,v2:l}):(o.push({x:i.x,y:i.y+e,or:"h",v1:a,v2:void 0}),o.push({x:c.x,y:c.y,or:"h",v1:void 0,v2:l})),i=c,a=l}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(r.setCanvasTransform(),this.fillColor){var y,p=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ci(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ci(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.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&&(r.ctx.fillStyle=d,r.ctx.fillRect(v.x,v.y,e,e))}}catch(t){p.e(t)}finally{p.f()}}r.ctx.lineCap="butt";for(var m=0,b=o;m<b.length;m++){var g=b[m],w=this.width?this.width(g,e,n):void 0;if(w&&!(w<=0)){var x=.5*w;r.ctx.lineWidth=w,"h"===g.or?(g.v2&&(r.ctx.beginPath(),r.ctx.strokeStyle=this.color[g.v2],r.ctx.moveTo(g.x,g.y+x),r.ctx.lineTo(g.x+e,g.y+x),r.ctx.stroke()),g.v1&&(r.ctx.beginPath(),r.ctx.strokeStyle=this.color[g.v1],r.ctx.moveTo(g.x,g.y-x),r.ctx.lineTo(g.x+e,g.y-x),r.ctx.stroke())):(g.v2&&(r.ctx.beginPath(),r.ctx.strokeStyle=this.color[g.v2],r.ctx.moveTo(g.x+x,g.y),r.ctx.lineTo(g.x+x,g.y+e),r.ctx.stroke()),g.v1&&(r.ctx.beginPath(),r.ctx.strokeStyle=this.color[g.v1],r.ctx.moveTo(g.x-x,g.y),r.ctx.lineTo(g.x-x,g.y+e),r.ctx.stroke()))}}this.updateLegends({style:this,r:e,zf:n})}}}}])&&Ei(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);const Ri=function t(e){function r(t,r){var n,o;return t=null==t?0:+t,r=null==r?1:+r,function(){var i;if(null!=n)i=n,n=null;else do{n=2*e()-1,i=2*e()-1,o=n*n+i*i}while(!o||o>1);return t+r*i*Math.sqrt(-2*Math.log(o)/o)}}return r.source=t,r}(Math.random);function Li(t,e,r){var n=document.createElement("canvas");n.setAttribute("width",t),n.setAttribute("height",e);var o=n.getContext("webgl",r);if(!o)throw new Error("Unable to initialize WebGL. Your browser or machine may not support it.");return{canvas:n,gl:o}}function zi(t){var e=t.createProgram();if(null==e)throw new Error("Cannot create webGL program");for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];for(var i=0,a=n;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 Fi(t,e){var r=t.createShader(e);if(null==r)throw new Error("Cannot create webGL shader");for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];if(t.shaderSource(r,o.join("\n")),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS))return r;throw new Error(t.getShaderInfoLog(r)||"Cannot create webGL shader (2)")}function Ii(t){return Ii="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},Ii(t)}function Ni(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ii(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ii(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ii(o)?o:String(o)),n)}var o}var Bi=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gl=e,this.sizePix=r||10,this.program=zi(e,Fi(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 "),Fi(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,r;return e=t,(r=[{key:"addPointData",value:function(t,e,r){var n=Me(r);n&&(this.verticesBuffer.push(t,e),this.colorsBuffer.push(n.r,n.g,n.b,n.opacity))}},{key:"addPointData2",value:function(t,e,r,n,o,i){this.verticesBuffer.push(t,e),this.colorsBuffer.push(r,n,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 r=e.getAttribLocation(this.program,"pos");e.vertexAttribPointer(r,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(r),e.bindBuffer(e.ARRAY_BUFFER,e.createBuffer()),e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.colorsBuffer),e.STATIC_DRAW);var n=e.getAttribLocation(this.program,"color");e.vertexAttribPointer(n,4,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n),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)}}])&&Ni(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Di(t){return Di="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},Di(t)}function Gi(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Wi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Wi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Wi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Zi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Di(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Di(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Di(o)?o:String(o)),n)}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 $i(t){return $i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$i(t)}var Yi=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,r,n,o,i=(n=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=$i(n);if(o){var r=$i(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Di(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,r,n){return.3*e*e/(n*n)*t/r.max},e.color=t.color||function(){return"#FF5733"},e.dotSize=t.dotSize,e.sigma=t.sigma,e}return e=a,(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i=r.getZf();if(this.nbCol&&(o=Oo.getStatistics(t,(function(t){return t[n.nbCol]}),!0)),o){var a=this.dotSize?this.dotSize(e,i):2*i,u=this.sigma?this.sigma(e,i):.4*e,c=Ri(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 l=Li(r.w+"",r.h+"");if(!l)return void console.error("No webGL");var s,f,h,y,p,v,d,m=new Bi(l.gl,a/i),b=e/2,g=Gi(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+c(),p+c(),v.r,v.g,v.b,v.opacity)}}}catch(t){g.e(t)}finally{g.f()}m.draw(r.getWebGLTransform()),r.initCanvasTransform(),r.ctx.drawImage(l.canvas,0,0)}else{r.setCanvasTransform();var S,_=Gi(t);try{for(_.s();!(S=_.n()).done;){var O=S.value,j=this.color(O);if(j&&"none"!==j){r.ctx.fillStyle=j;for(var P=this.offset(O,e,i),k=this.nb(O[this.nbCol],e,o,i),C=O.x+P.dx+e/2,E=O.y+P.dy+e/2,T=0;T<=k;T++)r.ctx.fillRect(C+c(),E+c(),a,a)}}}catch(t){_.e(t)}finally{_.f()}}this.updateLegends({style:this,r:e,zf:i})}}}])&&Zi(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function Hi(t){return Hi="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},Hi(t)}function Xi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Hi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Hi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Hi(o)?o:String(o)),n)}var o}var Vi=function(){function t(e,r,n){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=Fi(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<r.length;e++)t.push("uniform vec4 c"+e+";\n");return t.join("")}()+"void main(void) {\n";if(n?"pow"==n.fun?u+=" float t = pow(vt, alpha);\n":"powRev"==n.fun?u+=" float t = 1.0-pow(1.0-vt, 1.0/alpha);\n":"exp"==n.fun?u+=0==n.alpha?"float t = vt;":" float t = (exp(vt * alpha) - 1.0) / (exp(alpha) - 1.0);\n":"expRev"==n.fun?u+=0==n.alpha?"float t = vt;":" float t = 1.0 - (1.0 / alpha) * log(exp(alpha) * (1.0 - vt) + vt);\n":"circleLow"==n.fun?0==n.alpha?u+=" float t = vt;\n":1==n.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"==n.fun?0==n.alpha?u+=" float t = vt;\n":1==n.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: "+n.fun),u+=" float t = vt;\n"):u+=" float t = vt;\n",1==r.length)u+=" vec4 cI=c0;\n vec4 cF=c0;\n";else if(2==r.length)u+=" vec4 cI=c0;\n vec4 cF=c1;\n";else{var c=r.length-1,l=c+".0";u+=" vec4 cI;\n",u+=" vec4 cF;\n",u+=" if(t<1.0/"+l+") { cI=c0; cF=c1; t=t*"+l+"; }\n";for(var s=2;s<c;s++)u+=" else if(t<"+s+".0/"+l+") { cI=c"+(s-1)+"; cF=c"+s+"; t="+l+"*t-"+(s-1)+".0; }\n";u+=" else { cI=c"+(c-1)+"; cF=c"+c+"; t="+l+"*t-"+(c-1)+".0; }\n"}1==r.length?u+=" gl_FragColor = vec4(c0[0], c0[1], c0[2], c0[3]);}\n":u+=" gl_FragColor = mix(cI, cF, t);}\n";var f=Fi(e,e.FRAGMENT_SHADER,u);this.program=zi(e,a,f),e.useProgram(this.program),e.uniform1f(e.getUniformLocation(this.program,"sizePix"),1*o),e.uniform1f(e.getUniformLocation(this.program,"alpha"),n?1*n.alpha:0);for(var h=0;h<r.length;h++){var y=Me(r[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,r;return e=t,(r=[{key:"draw",value:function(t,e,r){var n=this.gl,o=this.program;n.bindBuffer(n.ARRAY_BUFFER,n.createBuffer()),n.bufferData(n.ARRAY_BUFFER,new Float32Array(t),n.STATIC_DRAW);var i=n.getAttribLocation(o,"pos");n.vertexAttribPointer(i,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(i),n.bindBuffer(n.ARRAY_BUFFER,n.createBuffer()),n.bufferData(n.ARRAY_BUFFER,new Float32Array(e),n.STATIC_DRAW);var a=n.getAttribLocation(o,"t");n.vertexAttribPointer(a,1,n.FLOAT,!1,0,0),n.enableVertexAttribArray(a),n.uniformMatrix3fv(n.getUniformLocation(o,"mat"),!1,new Float32Array(r)),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.POINTS,0,t.length/2)}}])&&Xi(e.prototype,r),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 Ji(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ki(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==qi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==qi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===qi(o)?o:String(o)),n)}var o}function Qi(t,e){return Qi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qi(t,e)}function ta(t){return ta=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ta(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&&Qi(t,e)}(a,t);var e,r,n,o,i=(n=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=ta(n);if(o){var r=ta(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===qi(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,r){return t/r.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,(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o=r.getZf(),i=Oo.getStatistics(t,(function(t){return t[n.colorCol]}),!0);if(i){var a=Li(r.w+"",r.h+"",null!=this.opacity?{premultipliedAlpha:!1}:void 0);if(a){var u,c=e/2,l=[],s=[],f=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ji(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ji(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.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&&(l.push(h.x+c,h.y+c),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 Vi(a.gl,this.colors,this.stretching,p/o,v).draw(l,s,r.getWebGLTransform()),r.initCanvasTransform(),r.ctx.drawImage(a.canvas,0,0),this.updateLegends({style:this,r:e,zf:o,sColor:i})}else console.error("No webGL")}}}])&&Ki(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function ra(t){return ra="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},ra(t)}function na(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ra(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ra(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ra(o)?o:String(o)),n)}var o}var oa=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r;return e=t,r=[{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 r=0;r<e.nb;r++)e.colors.push(e.color(r/(e.nb-1)))}e.colors=e.colors||["#a9bb9e","#c9dcaa","#fde89f","#f9a579","#eb444b"];var n=e.colors.length;e.tFun=e.tFun||function(t,e,r){return(t-r.min)/(r.max-r.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<n;e++)if(t<=(e+1)/n)return e;return console.error("Unexpected t value 2: "+t),-9};return[new ea({colorCol:t,colors:e.colors,tFun:function(t,r,i){var a=e.tFun(t,r,i);return o(a)/(n-1)},size:function(t,e){return t+.5*e},filter:e.filter}),new Si({valueCol:t,value:function(t,r,n,i,a){if(void 0===t&&void 0===r)return 0;if(void 0===r){var u=e.tFun(t,n,i);if(null==u||isNaN(u))throw new Error("Unexpected value: "+t+" - "+u);return o(u)+1}if(void 0===t){var c=e.tFun(r,n,i);if(null==c||isNaN(c))throw new Error("Unexpected value: "+r+" - "+c);return-o(c)-1}var l=e.tFun(t,n,i);if(null==l||isNaN(l))throw new Error("Unexpected value: "+t+" - "+l);var s=e.tFun(r,n,i);if(null==s||isNaN(s))throw new Error("Unexpected value: "+r+" - "+s);var f=o(l);return-o(s)+f},color:e.newShading?function(t,r,n,o){var i=e.newShadingTr(t.value,n);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,r,n,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,r,n,o){return e.newShadingWidthPix*o}:function(t,r,n,o){return e.widthFactor*r*Math.abs(t.value)*("v"===t.or?.5:1)},filter:e.filter})]}}],null&&na(e.prototype,null),r&&na(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ia(t){return ia="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},ia(t)}function aa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ia(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ia(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ia(o)?o:String(o)),n)}var o}var ua=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 r=[];r.push("precision mediump float;\nvarying float vi;\n"),r.push("uniform vec4");for(var n=0;n<e.length;n++)n>0&&r.push(","),r.push(" c"+n);r.push(";\n"),r.push("void main(void) {\n");for(var o=0;o<e.length;o++)o>0&&r.push("else "),r.push("if(vi=="),r.push(o),r.push(".0) gl_FragColor = vec4(c"),r.push(o),r.push("[0], c"),r.push(o),r.push("[1], c"),r.push(o),r.push("[2], c"),r.push(o),r.push("[3]);\n");r.push("else gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n}"),this.fshString=r.join("")}var e,r;return e=t,r=[{key:"draw",value:function(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,i=zi(t,Fi(t,t.VERTEX_SHADER,this.vshString),Fi(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 c=t.getAttribLocation(i,"pos");t.vertexAttribPointer(c,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(c),t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bufferData(t.ARRAY_BUFFER,new Float32Array(r),t.STATIC_DRAW);var l=t.getAttribLocation(i,"i");t.vertexAttribPointer(l,1,t.FLOAT,!1,0,0),t.enableVertexAttribArray(l),t.uniformMatrix3fv(t.getUniformLocation(i,"mat"),!1,new Float32Array(n)),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.POINTS,0,e.length/2)}}],r&&aa(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();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 la(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ca(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ca(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ca(o)?o:String(o)),n)}var o}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)}var ha=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)}(a,t);var e,r,n,o,i=(n=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=fa(n);if(o){var r=fa(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ca(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 r=Object.keys(t.color);e.catToI={};for(var n=0;n<r.length;n++)e.catToI[r[n]]=n+"";e.colors=[];for(var o=0;o<r.length;o++)e.colors.push(t.color[""+r[o]]);return e.size=t.size,e.wgp=new ua(e.colors),e}return e=a,(r=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));for(var n,o=r.getZf(),i=e/2,a=t.length,u=[],c=[],l=0;l<a;l++){var s=(n=t[l])[this.colorCol];if(null!=s){var f=this.catToI[s];isNaN(+f)?console.log("Unexpected category index: "+s+" "+f):(u.push(n.x+i,n.y+i),c.push(+f))}else console.log("Unexpected category: "+s)}var h=Li(r.w+"",r.h+"");if(h){var y=this.size?this.size(e,o):e+.2*o;this.wgp.draw(h.gl,u,c,r.getWebGLTransform(),y/o),r.initCanvasTransform(),r.ctx.drawImage(h.canvas,0,0),this.updateLegends({style:this,r:e,zf:o})}else console.error("No webGL")}}])&&la(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function ya(t){return ya="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},ya(t)}function pa(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return va(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?va(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function va(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function da(t,e){return da=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},da(t,e)}function ma(t){return ma=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ma(t)}function ba(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ga(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ya(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ya(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ya(o)?o:String(o)),n)}var o}function wa(t,e,r){return e&&ga(t.prototype,e),r&&ga(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var xa=function(){function t(){ba(this,t)}return wa(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 r=oa.get(t,e),n=new Fo({strokeColor:function(){return"#666"},strokeWidth:function(t,e,r,n){return.2*n},filter:e.filter});return[r[0],n,r[1],new Sa({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 ha({colorCol:t,color:e.color}),new Fo({strokeColor:function(){return"#666"},strokeWidth:function(t,e,r,n){return.2*n}}),new Sa({colDark:e.colDark,colBright:e.colBright})]}}]),t}(),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&&da(t,e)}(o,t);var e,r,n=(e=o,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,n=ma(e);if(r){var o=ma(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return function(t,e){if(e&&("object"===ya(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 ba(this,o),e=n.call(this,t),t=t||{},e.colDark=t.colDark||"#333",e.colBright=t.colBright||"#aaa",e}return wa(o,[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter)),r.ctx.lineWidth=.6*r.getZf(),r.ctx.strokeStyle=this.colDark;var n,o=pa(t);try{for(o.s();!(n=o.n()).done;){var i=n.value;r.ctx.beginPath(),r.ctx.arc(i.x+.5*e,i.y+.5*e,.55*e*.5,Math.PI/4,-Math.PI*(3/4),!0),r.ctx.stroke()}}catch(t){o.e(t)}finally{o.f()}r.ctx.strokeStyle=this.colBright;var a,u=pa(t);try{for(u.s();!(a=u.n()).done;){var c=a.value;r.ctx.beginPath(),r.ctx.arc(c.x+.5*e,c.y+.5*e,.55*e*.5,Math.PI/4,-Math.PI*(3/4),!1),r.ctx.stroke()}}catch(t){u.e(t)}finally{u.f()}}}]),o}(Oo);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 r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ja(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==_a(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==_a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===_a(o)?o:String(o)),n)}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 Ca=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,r,n,o,i=(n=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(n);if(o){var r=ka(this).constructor;t=Reflect.construct(e,arguments,r)}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.mosaicFactor=t.mosaicFactor||.15,e.shadowFactor=t.shadowFactor||.2,e.shadowColor=t.shadowColor||"#555",e}return e=a,(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i=r.getZf();this.colorCol&&(o=Oo.getStatistics(t,(function(t){return t[n.colorCol]}),!0)),r.ctx.strokeStyle=this.shadowColor,r.ctx.lineWidth=this.shadowFactor*e,r.ctx.lineJoin="round",r.ctx.lineCap="butt";var a=e*this.mosaicFactor,u=function(){return{x:Math.random()*a,y:Math.random()*a}};r.setCanvasTransform();var c,l=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Oa(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Oa(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(l.s();!(c=l.n()).done;){var s=c.value,f=this.color?this.color(s[this.colorCol],e,o):void 0;if(f&&"none"!==f){r.ctx.fillStyle=f;var h=this.offset(s,e,i),y=u(),p=u(),v=u(),d=u();this.shadowFactor>0&&(r.ctx.beginPath(),r.ctx.moveTo(s.x+h.dx+y.x,s.y+h.dy+y.y),r.ctx.lineTo(s.x+h.dx+e-v.x,s.y+h.dy+v.y),r.ctx.lineTo(s.x+h.dx+e-d.x,s.y+h.dy+e-d.y),r.ctx.stroke()),r.ctx.beginPath(),r.ctx.moveTo(s.x+h.dx+y.x,s.y+h.dy+y.y),r.ctx.lineTo(s.x+h.dx+e-v.x,s.y+h.dy+v.y),r.ctx.lineTo(s.x+h.dx+e-d.x,s.y+h.dy+e-d.y),r.ctx.lineTo(s.x+h.dx+p.x,s.y+h.dy+e-p.y),r.ctx.fill()}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,r:e,zf:i,sColor:o})}}])&&ja(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function Ea(t){return Ea="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},Ea(t)}function Ta(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Aa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ea(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ea(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ea(o)?o:String(o)),n)}var o}function Ma(t,e){return Ma=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ma(t,e)}function Ra(t){return Ra=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ra(t)}var La=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&&Ma(t,e)}(a,t);var e,r,n,o,i=(n=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=Ra(n);if(o){var r=Ra(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ea(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,(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i,a=r.getZf();this.sizeCol&&(t.sort((function(t,e){return e[n.sizeCol]-t[n.sizeCol]})),o=Oo.getStatistics(t,(function(t){return t[n.sizeCol]}),!0)),this.colorCol&&(i=Oo.getStatistics(t,(function(t){return t[n.colorCol]}),!0)),r.setCanvasTransform();var u,c=.5*e,l=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ta(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ta(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(l.s();!(u=l.n()).done;){var s=u.value,f=this.color?this.color(s[this.colorCol],e,i,a):void 0;if(f&&"none"!==f){r.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)*c,p=s.x+c,v=s.y+c;if("p"===h)r.ctx.beginPath(),r.ctx.moveTo(p,v+c),r.ctx.lineTo(p+y,v+y),r.ctx.lineTo(p+c,v),r.ctx.lineTo(p+y,v-y),r.ctx.lineTo(p,v-c),r.ctx.lineTo(p-y,v-y),r.ctx.lineTo(p-c,v),r.ctx.lineTo(p-y,v+y),r.ctx.fill();else{if("o"!==h)throw new Error("Unexpected shape:"+h);r.ctx.beginPath(),r.ctx.moveTo(p,v+y),r.ctx.lineTo(p+c,v+c),r.ctx.lineTo(p+y,v),r.ctx.lineTo(p+c,v-c),r.ctx.lineTo(p,v-y),r.ctx.lineTo(p-c,v-c),r.ctx.lineTo(p-y,v),r.ctx.lineTo(p-c,v+c),r.ctx.fill()}}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,r:e,zf:a,sSize:o,sColor:i})}}])&&Aa(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function za(t){return za="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},za(t)}function Fa(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ia(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ia(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Ia(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Na(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==za(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==za(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===za(o)?o:String(o)),n)}var o}function Ba(t,e){return Ba=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ba(t,e)}function Da(t){return Da=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Da(t)}var Ga=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&&Ba(t,e)}(a,t);var e,r,n,o,i=(n=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=Da(n);if(o){var r=Da(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===za(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.ts=t.ts,e.noData=t.noData||function(t){return void 0===t||""==t||null===t||isNaN(+t)},e.offsetX=t.offsetX||function(t,e,r){return 0},e.width=t.width||function(t,e,r){return e},e.offsetY=t.offsetY||function(t,e,r){return 0},e.height=t.height||function(t,e,r){return e},e.anchorModeY=t.anchorModeY||function(t,e,r){return"center"},e.lineWidthCol=t.lineWidthCol,e.lineWidth=t.lineWidth||function(t,e,r,n){return 1.5*n},e.colorCol=t.colorCol,e.color=t.color||function(t,e,r,n){return"black"},e}return e=a,(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i,a=r.getZf();this.lineWidthCol&&(o=Oo.getStatistics(t,(function(t){return t[n.lineWidthCol]}),!0)),this.colorCol&&(i=Oo.getStatistics(t,(function(t){return t[n.colorCol]}),!0));var u,c,l=function(t){var e,r,o,i=Fa(n.ts);try{for(i.s();!(o=i.n()).done;){var a=t[o.value];null!=a&&((null==e||a<e)&&(e=a),(null==r||a>r)&&(r=a))}}catch(t){i.e(t)}finally{i.f()}if(null!=e)return r-e},s=Fa(t);try{for(s.s();!(c=s.n()).done;){var f=l(c.value);null!=f&&(null==u||f>u)&&(u=f)}}catch(t){s.e(t)}finally{s.f()}if(u){var h=this.ts.length;r.setCanvasTransform(),r.ctx.lineCap="butt";var y,p=Fa(t);try{for(p.s();!(y=p.n()).done;){var v=y.value,d=this.lineWidth?this.lineWidth(v[this.lineWidthCol],e,o,a):void 0;if(d&&!(d<0)){var m=this.color?this.color(v[this.colorCol],e,i,a):void 0;if(m){var b=this.offsetX?this.offsetX(v,e,a):0;if(null!=b&&!isNaN(b)){var g=this.width?this.width(v,e,a):e;if(null!=g&&!isNaN(g)){var w=this.offsetY?this.offsetY(v,e,a):0;if(null!=w&&!isNaN(w)){var x=this.height?this.height(v,e,a):e;if(null!=x&&!isNaN(x)){var S=this.anchorModeY?this.anchorModeY(v,e,a):"center";if(S){r.ctx.lineWidth=d,r.ctx.strokeStyle=m;var _=void 0,O=void 0;if("first"===S)_=v[this.ts[0]],O=0;else if("last"===S)_=v[this.ts[this.ts.length-1]],O=0;else if("bottom"===S){var j,P=Fa(this.ts);try{for(P.s();!(j=P.n()).done;){var k=+v[j.value];null!=k&&(null==_||k<_)&&(_=k)}}catch(t){P.e(t)}finally{P.f()}O=0}else if("top"===S){var C,E=Fa(this.ts);try{for(E.s();!(C=E.n()).done;){var T=+v[C.value];null!=T&&(null==_||T>_)&&(_=T)}}catch(t){E.e(t)}finally{E.f()}O=e}else{if("center"!==S){console.log("Unexpected anchorModeY: "+S);continue}var A,M=void 0,R=void 0,L=Fa(this.ts);try{for(L.s();!(A=L.n()).done;){var z=v[A.value];null!=z&&((null==M||z<M)&&(M=z),(null==R||z>R)&&(R=z))}}catch(t){L.e(t)}finally{L.f()}_=.5*(+R+ +M),O=e/2}var F=g/(h-1),I=v[this.ts[0]];this.noData(I)||(r.ctx.beginPath(),r.ctx.moveTo(v.x+b,v.y+O+(I-_)*x/u+w));for(var N=void 0,B=1;B<h;B++)N=v[this.ts[B]],this.noData(I)&&this.noData(N)||(!this.noData(I)&&this.noData(N)?r.ctx.stroke():this.noData(I)&&!this.noData(N)?(r.ctx.beginPath(),r.ctx.moveTo(v.x+B*F+b,v.y+O+(N-_)*x/u+w)):(r.ctx.lineTo(v.x+B*F+b,v.y+O+(N-_)*x/u+w),B==h-1&&r.ctx.stroke())),I=N}}}}}}}}}catch(t){p.e(t)}finally{p.f()}}}}])&&Na(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function Wa(t){return Wa="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},Wa(t)}function Za(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=$a(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Ua(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||$a(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 $a(t,e){if(t){if("string"==typeof t)return Ya(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ya(t,e):void 0}}function Ya(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ha(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Wa(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Wa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Wa(o)?o:String(o)),n)}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 Va(t){return Va=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Va(t)}var qa=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,r,n,o,i=(n=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=Va(n);if(o){var r=Va(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Wa(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.heightCol=t.heightCol,e.height=t.height||function(t,e,r,n){return.4*e},e.angle=null!=t.angle?t.angle:45,e.cornerLineStrokeColor=t.cornerLineStrokeColor||function(t,e,r,n){return"#333"},e.cornerLineWidth=t.cornerLineWidth||function(t,e,r,n){return n%90==0?0:.8*r},e}return e=a,r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i=r.getZf();this.heightCol&&(t.sort((function(t,e){return e[n.heightCol]-t[n.heightCol]})),o=Oo.getStatistics(t,(function(t){return t[n.heightCol]}),!0));var a=Object.keys(this.color);r.setCanvasTransform();var u=e/2,c=this.height,l=[];t.sort((function(t,e){return e.x==t.x?t.y-e.y:t.x-e.x}));for(var s=t[0],f=1;f<t.length;f++){var h=t[f];s.y+e==h.y&&s.x==h.x?l.push({x:s.x+u,y:h.y,or:"h",c1:s,c2:h}):(l.push({x:s.x+u,y:s.y+e,or:"h",c1:s,c2:void 0}),l.push({x:h.x+u,y:h.y,or:"h",c1:void 0,c2:h})),s=h}t.sort((function(t,e){return e.y==t.y?t.x-e.x:t.y-e.y})),s=t[0];for(var y=1;y<t.length;y++){var p=t[y];s.x+e==p.x&&s.y==p.y?l.push({x:p.x,y:s.y+u,or:"v",c1:s,c2:p}):(l.push({x:s.x+e,y:s.y+u,or:"v",c1:s,c2:void 0}),l.push({x:p.x,y:p.y+u,or:"v",c1:void 0,c2:p})),s=p}if(0!=l.length){var v=this.angle*Math.PI/180,d=Math.cos(v),m=Math.sin(v);r.setCanvasTransform(),Math.abs(this.angle)<=90?l.sort((function(t,e){return Math.hypot(e.x,e.y)-Math.hypot(t.x,t.y)})):this.angle>90?l.sort((function(t,e){return Math.hypot(e.x-r.extGeo.xMax,e.y)-Math.hypot(t.x-r.extGeo.xMax,t.y)})):this.angle<90&&l.sort((function(t,e){return Math.hypot(e.x-r.extGeo.xMax,e.y-r.extGeo.yMax)-Math.hypot(t.x-r.extGeo.xMax,t.y-r.extGeo.yMax)}));for(var b=0,g=l;b<g.length;b++){var w=g[b],x=w.c1?c(w.c1[this.heightCol],e,o,i):0,S=w.c2?c(w.c2[this.heightCol],e,o,i):0,_=Ja(w.c1,a),O=Ja(w.c2,a);if(0!=_||0!=O)for(var j=0,P=0,k=0,C=Object.entries(this.color);k<C.length;k++){var E=Ua(C[k],2),T=E[0],A=E[1],M=w.c1?+w.c1[T]:0,R=w.c2?+w.c2[T]:0;if(0!=M||0!=R){var L=_>0?x*j/_:0,z=_>0?x*(j+M)/_:0,F=O>0?S*P/O:0,I=O>0?S*(P+R)/O:0;r.ctx.beginPath(),"h"==w.or?(r.ctx.moveTo(w.x+L*d,w.y-u+L*m),r.ctx.lineTo(w.x+F*d,w.y+u+F*m),r.ctx.lineTo(w.x+I*d,w.y+u+I*m),r.ctx.lineTo(w.x+z*d,w.y-u+z*m)):(r.ctx.moveTo(w.x-u+L*d,w.y+L*m),r.ctx.lineTo(w.x+u+F*d,w.y+F*m),r.ctx.lineTo(w.x+u+I*d,w.y+I*m),r.ctx.lineTo(w.x-u+z*d,w.y+z*m)),r.ctx.closePath(),r.ctx.fillStyle=A,r.ctx.fill(),j+=M,P+=R}}}var N,B=Za(t);try{for(B.s();!(N=B.n()).done;){var D=N.value,G=c(D[this.heightCol],e,o,i);r.ctx.strokeStyle=this.cornerLineStrokeColor?this.cornerLineStrokeColor(D,e,i,this.angle):"#333",r.ctx.lineWidth=this.cornerLineWidth?this.cornerLineWidth(D,e,i,this.angle):.8*i,r.ctx.beginPath(),r.ctx.moveTo(D.x+u,D.y+u),r.ctx.lineTo(D.x+u+G*d,D.y+u+G*m),r.ctx.closePath(),r.ctx.stroke()}}catch(t){B.e(t)}finally{B.f()}this.updateLegends({style:this,r:e,zf:i,sSize:o})}}}],r&&Ha(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo),Ja=function(t,e){if(!t)return 0;var r,n=0,o=Za(e);try{for(o.s();!(r=o.n()).done;){var i=t[r.value];i&&(n+=+i)}}catch(t){o.e(t)}finally{o.f()}return n||0};function Ka(t){return Ka="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},Ka(t)}function Qa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ka(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ka(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ka(o)?o:String(o)),n)}var o}var tu=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,r;return e=t,(r=[{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.")}}])&&Qa(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function eu(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}var ru,nu=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ou(t){if(!(e=nu.exec(t)))throw new Error("invalid format: "+t);var e;return new iu({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 iu(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 au(t,e){var r=eu(t,e);if(!r)return t+"";var n=r[0],o=r[1];return o<0?"0."+new Array(-o).join("0")+n:n.length>o+1?n.slice(0,o+1)+"."+n.slice(o+1):n+new Array(o-n.length+2).join("0")}ou.prototype=iu.prototype,iu.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 uu={"%":(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)=>au(100*t,e),r:au,s:function(t,e){var r=eu(t,e);if(!r)return t+"";var n=r[0],o=r[1],i=o-(ru=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=n.length;return i===a?n:i>a?n+new Array(i-a+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+eu(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function cu(t){return t}var lu,su,fu=Array.prototype.map,hu=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function yu(t){return lu=function(t){var e,r,n=void 0===t.grouping||void 0===t.thousands?cu:(e=fu.call(t.grouping,Number),r=t.thousands+"",function(t,n){for(var o=t.length,i=[],a=0,u=e[0],c=0;o>0&&u>0&&(c+u+1>n&&(u=Math.max(1,n-c)),i.push(t.substring(o-=u,o+u)),!((c+=u+1)>n));)u=e[a=(a+1)%e.length];return i.reverse().join(r)}),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?cu:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(fu.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",s=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=ou(t)).fill,r=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"):uu[b]||(void 0===d&&(d=12),m=!0,b="g"),(y||"0"===e&&"="===r)&&(y=!0,e="0",r="=");var g="$"===h?o:"#"===h&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",w="$"===h?i:/[%p]/.test(b)?c:"",x=uu[b],S=/[defgprs%]/.test(b);function _(t){var o,i,c,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,r=t.length,n=1,o=-1;n<r;++n)switch(t[n]){case".":o=e=n;break;case"0":0===o&&(o=n),e=n;break;default:if(!+t[n])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:l:"-"===f||"("===f?"":f)+h,_=("s"===b?hu[8+ru/3]:"")+_+(O&&"("===f?")":""),S)for(o=-1,i=t.length;++o<i;)if(48>(c=t.charCodeAt(o))||c>57){_=(46===c?a+t.slice(o+1):t.slice(o))+_,t=t.slice(0,o);break}}v&&!y&&(t=n(t,1/0));var j=h.length+t.length+_.length,P=j<p?new Array(p-j+1).join(e):"";switch(v&&y&&(t=n(P+t,P.length?p-_.length:1/0),P=""),r){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 r,n=f(((t=ou(t)).type="f",t)),o=3*Math.max(-8,Math.min(8,Math.floor((r=e,((r=eu(Math.abs(r)))?r[1]:NaN)/3)))),i=Math.pow(10,-o),a=hu[8+o/3];return function(t){return n(i*t)+a}}}}(t),su=lu.format,lu.formatPrefix,lu}function pu(t){return pu="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},pu(t)}function vu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==pu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==pu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===pu(o)?o:String(o)),n)}var o}function du(t,e){return du=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},du(t,e)}function mu(t){return mu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},mu(t)}yu({thousands:",",grouping:[3],currency:["$",""]});var bu=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&&du(t,e)}(a,t);var e,r,n,o,i=(n=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=mu(n);if(o){var r=mu(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===pu(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,(r=[{key:"update",value:function(t){if(t.sColor){this.div.selectAll("*").remove();var e=this.width+2*this.margin,r=this.height+3*this.margin+12+this.tickSize+10,n=this.div.append("svg").attr("width",e).attr("height",r);n.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=n.append("g").attr("transform","translate("+this.margin+" "+(2*this.margin+12)+")"),i=this.width,a=this.height,u=0;u<i;u+=5){var c=u/(i-1);this.invert&&(c=1-c),o.append("rect").attr("x",u).attr("y",0).attr("width",5).attr("height",a).style("fill",this.colorRamp(c))}for(var l=0;l<this.ticks;l++){var s=l/(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_"+l).attr("x",i*s).attr("y",a+this.tickSize+2).style("font-size",this.fontSize).style("text-anchor",0==l?"start":l==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?su(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)}}}}])&&vu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(tu);function gu(t){return gu="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},gu(t)}function wu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==gu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==gu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===gu(o)?o:String(o)),n)}var o}function xu(t,e){return xu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xu(t,e)}function Su(t){return Su=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Su(t)}var _u=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&&xu(t,e)}(a,t);var e,r,n,o,i=(n=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=Su(n);if(o){var r=Su(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===gu(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,(r=[{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 r=this.width/e,n=this.div.append("svg").attr("width",this.width).attr("height",this.height+this.tickSize+2+10),o=0;o<e;o++)n.append("rect").attr("x",o*r).attr("y",0).attr("width",r).attr("height",this.height).style("fill",this.colors[o]);for(var i=1;i<e;i++)n.append("line").attr("x1",r*i).attr("y1",0).attr("x2",r*i).attr("y2",this.height+this.tickSize).style("stroke","black");for(var a=1;a<e;a++)n.append("text").attr("id","ticklabel_"+a).attr("x",r*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])}}}])&&wu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(tu);function Ou(t){return Ou="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},Ou(t)}function ju(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ou(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ou(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ou(o)?o:String(o)),n)}var o}function Pu(t,e){return Pu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pu(t,e)}function ku(t){return ku=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ku(t)}var Cu=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&&Pu(t,e)}(a,t);var e,r,n,o,i=(n=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=ku(n);if(o){var r=ku(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ou(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,(r=[{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 r=0;r<e;r++){var n=this.colCat[r],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",n[0]).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}else{if("circle"!==this.shape)throw new Error("Unexpected shape:"+this.shape);var c=this.dimension.r||8,l=2*c+2*i;o.append("div").style("display","inline").append("svg").attr("width",l).attr("height",l).append("circle").attr("cx",c+i).attr("cy",c+i).attr("r",c).style("fill",n[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(n[1])}}}])&&ju(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(tu);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 Tu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Eu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Eu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Eu(o)?o:String(o)),n)}var o}function Au(t,e){return Au=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Au(t,e)}function Mu(t){return Mu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mu(t)}var Ru=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&&Au(t,e)}(a,t);var e,r,n,o,i=(n=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=Mu(n);if(o){var r=Mu(this).constructor;t=Reflect.construct(e,arguments,r)}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.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,(r=[{key:"update",value:function(t){if(t.sSize){this.div.selectAll("*").remove();var e=this.value;if(null==e){var r=t.sSize.max*this.exaggerationFactor,n=Math.log10(r);n=Math.floor(n),8*(e=Math.pow(10,n))<=r?e*=8:6*e<=r?e*=6:5*e<=r?e*=5:4*e<=r?e*=4:2.5*e<=r?e*=2.5:2*e<=r&&(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 c=su(this.labelFormat)(e);o.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(c+(this.labelUnitText?" ":"")+this.labelUnitText)}}}}])&&Tu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(tu);function Lu(t){return Lu="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},Lu(t)}function zu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Lu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Lu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Lu(o)?o:String(o)),n)}var o}function Fu(t,e){return Fu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fu(t,e)}function Iu(t){return Iu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Iu(t)}var Nu=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&&Fu(t,e)}(a,t);var e,r,n,o,i=(n=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=Iu(n);if(o){var r=Iu(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Lu(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,(r=[{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 r=t.sWidth.max*this.exaggerationFactor,n=Math.log10(r);n=Math.floor(n);var o=Math.pow(10,n);8*o<=r?o*=8:6*o<=r?o*=6:5*o<=r?o*=5:4*o<=r?o*=4:2.5*o<=r?o*=2.5:2*o<=r&&(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=su(",.2r")(o);e.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(u+(this.labelUnitText?" ":"")+this.labelUnitText)}}}])&&zu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(tu);function Bu(t){return Bu="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},Bu(t)}function Du(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Bu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Bu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Bu(o)?o:String(o)),n)}var o}function Gu(t,e){return Gu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gu(t,e)}function Wu(t){return Wu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wu(t)}var Zu=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&&Gu(t,e)}(a,t);var e,r,n,o,i=(n=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=Wu(n);if(o){var r=Wu(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Bu(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,(r=[{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 r=this.widthPix,n=1*t.r/t.zf,o=Math.max(n,r),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),c=.5*o,l=.5*n;i.append("line").attr("x1",c-a*l).attr("y1",c-u*l).attr("x2",c+a*l).attr("y2",c+u*l).style("stroke",this.color).style("stroke-width",r),e.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(this.labelUnitText)}}}])&&Du(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(tu),Uu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return Math.pow(t,e)},$u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 1-Math.pow(1-t,1/e)},Yu=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)},Hu=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)},Xu=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 r=e/(1-e);return Math.sqrt(1/(r*r)+t*(2/r+2-t))-1/r},Vu=function(t){return 1-Xu(1-t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:.8)},qu=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))},Ju=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return(Math.exp(-e*t)-1)/(Math.exp(-e)-1)},Ku=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return Math.pow(t,1/e)},Qu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 1-Math.pow(1-t,e)},tc=Nr.getParameterByName;return yu({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),e})()));
|