gridviz 2.1.17 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/dist/gridviz.js +8659 -9294
- package/dist/gridviz.min.js +1 -1
- package/package.json +3 -2
- package/src/button/Button.js +14 -15
- package/src/button/FullscreenButton.js +14 -14
- package/src/button/ZoomButtons.js +2 -2
- package/src/{DatasetComponent.js → core/Dataset.js} +33 -13
- package/src/core/Drawable.js +60 -0
- package/src/{GeoCanvas.js → core/GeoCanvas.js} +65 -155
- package/src/core/Layer.js +24 -0
- package/src/{Legend.js → core/Legend.js} +24 -1
- package/src/core/Map.js +474 -0
- package/src/core/MultiResolutionDataset.js +96 -0
- package/src/core/Style.js +84 -0
- package/src/dataset/COGeo.js +5 -5
- package/src/dataset/CSVGrid.js +43 -41
- package/src/dataset/GeoTIFF.js +9 -14
- package/src/dataset/{LGrid.js → JSGrid.js} +9 -11
- package/src/dataset/TiledGrid.js +68 -45
- package/src/index.js +22 -29
- package/src/{BackgroundLayer.js → layer/BackgroundLayer.js} +27 -52
- package/src/{BackgroundLayerWMS.js → layer/BackgroundLayerWMS.js} +21 -45
- package/src/{LineLayer.js → layer/GeoJSONLayer.js} +22 -23
- package/src/layer/GridLayer.js +160 -0
- package/src/{LabelLayer.js → layer/LabelLayer.js} +25 -23
- package/src/legend/ColorCategoryLegend.js +9 -24
- package/src/legend/ColorDiscreteLegend.js +20 -24
- package/src/legend/ColorLegend.js +21 -33
- package/src/legend/OrientationLegend.js +90 -0
- package/src/legend/SizeLegend.js +153 -72
- package/src/style/CompositionStyle.js +71 -84
- package/src/style/ContourStyle.js +2 -36
- package/src/style/DotDensityStyle.js +50 -73
- package/src/style/IsoFenceStyle.js +59 -70
- package/src/style/JoyPlotStyle.js +41 -48
- package/src/style/LegoStyle.js +4 -4
- package/src/style/MosaicStyle.js +30 -39
- package/src/style/NinjaStarStyle.js +45 -68
- package/src/style/PillarStyle.js +70 -93
- package/src/style/SegmentStyle.js +37 -75
- package/src/style/ShapeColorSizeStyle.js +49 -98
- package/src/style/SideCategoryStyle.js +112 -0
- package/src/style/SideStyle.js +99 -133
- package/src/style/{SquareColorCatWGLStyle.js → SquareColorCategoryWebGLStyle.js} +28 -41
- package/src/style/{SquareColorWGLStyle.js → SquareColorWebGLStyle.js} +28 -49
- package/src/style/StrokeStyle.js +43 -70
- package/src/style/TanakaStyle.js +34 -132
- package/src/style/TextStyle.js +43 -64
- package/src/style/TimeSeriesStyle.js +44 -75
- package/src/utils/WebGLSquareColoringAdvanced.js +4 -4
- package/src/utils/scale.js +217 -0
- package/src/utils/stretching.js +86 -129
- package/src/utils/{Utils.js → utils.js} +15 -0
- package/src/utils/webGLUtils.js +4 -5
- package/src/utils/zoomUtils.js +30 -30
- package/src/App.js +0 -760
- package/src/Dataset.js +0 -76
- package/src/Layer.js +0 -103
- package/src/Style.js +0 -131
- package/src/dataset/GridTile.js +0 -41
- package/src/legend/SegmentOrientationLegend.js +0 -87
- package/src/legend/SegmentWidthLegend.js +0 -101
- package/src/style/CompositionStyle_.js +0 -293
- package/src/style/ShapeColorSizeStyle_.js +0 -108
- package/src/style/SideCatStyle.js +0 -172
- /package/src/{Tooltip.js → core/Tooltip.js} +0 -0
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:()=>zo,BackgroundLayer:()=>qn,BackgroundLayerWMS:()=>Kn,BoundaryLayer:()=>ho,CSVGrid:()=>On,ColorCategoryLegend:()=>rl,ColorDiscreteLegend:()=>Ju,ColorLegend:()=>$u,CompositionStyle:()=>mi,CompositionStyle_:()=>ji,ContourStyle:()=>ea,Dataset:()=>$r,DatasetComponent:()=>pn,DotDensityStyle:()=>xa,GeoCanvas:()=>Br,GridTile:()=>zn,IsoFenceStyle:()=>_u,JoyPlotStyle:()=>ci,LGrid:()=>En,LabelLayer:()=>io,Layer:()=>Dr,LegoStyle:()=>Xa,MosaicStyle:()=>nu,NinjaStarStyle:()=>cu,PillarStyle:()=>Ui,SegmentOrientationLegend:()=>ml,SegmentStyle:()=>Ai,SegmentWidthLegend:()=>hl,ShapeColorSizeStyle:()=>Ho,ShapeColorSizeStyle_:()=>Jo,SideCatStyle:()=>ua,SideStyle:()=>Ji,SizeLegend:()=>ul,SquareColorCatWGLStyle:()=>Da,SquareColorWGLStyle:()=>Ta,StrokeStyle:()=>ni,Style:()=>No,TanakaStyle:()=>Ra,TextStyle:()=>Ii,TiledGrid:()=>$n,TimeSeriesStyle:()=>du,circularInverseScale:()=>Ol,circularScale:()=>Sl,exponentialScale:()=>wl,getClass:()=>yo,getParameterByName:()=>zl,logarithmicScale:()=>xl,powerInverseScale:()=>gl,powerScale:()=>bl,sCircleHigh:()=>El,sCircleLow:()=>Cl,sExp:()=>Pl,sExpInverse:()=>Tl,sExpRev:()=>kl,sExpRevInverse:()=>Al,sPow:()=>_l,sPowInverse:()=>Ml,sPowRev:()=>jl,sPowRevInverse:()=>Rl});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 O(t){return function(){this.removeAttributeNS(t.space,t.local)}}function _(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 z(t,e){return function(){this[t]=e}}function L(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 B(t)}function B(t){this._node=t,this._names=F(t.getAttribute("class")||"")}function N(t,e){for(var r=I(t),n=-1,o=e.length;++n<o;)r.add(e[n])}function Z(t,e){for(var r=I(t),n=-1,o=e.length;++n<o;)r.remove(e[n])}function D(t){return function(){N(this,t)}}function W(t){return function(){Z(this,t)}}function G(t,e){return function(){(e.apply(this,arguments)?N:Z)(this,t)}}function U(){this.textContent=""}function H(t){return function(){this.textContent=t}}function $(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function Y(){this.innerHTML=""}function V(t){return function(){this.innerHTML=t}}function q(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function X(){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))}}B.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;_<g;++_)if(S=w[_]){for(_>=j&&(j=_+1);!(O=x[j])&&++j<g;);S._next=O||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?O:S:"function"==typeof e?r.local?k:P:r.local?j:_)(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?L:z)(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?G:e?D:W)(r,e))},text:function(t){return arguments.length?this.each(null==t?U:("function"==typeof t?$:H)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?Y:("function"==typeof t?q:V)(t)):this.node().innerHTML},raise:function(){return this.each(X)},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 Ot(t){return((t=Math.exp(t))+1/t)/2}const _t=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=Ot(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/Ot(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,zt=0,Lt="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(Bt),Rt=Lt.now()+zt)}function Bt(){Rt=0}function Nt(){this._call=this._time=this._next=null}function Zt(t,e,r){var n=new Nt;return n.restart(t,e,r),n}function Dt(){Rt=(Mt=Lt.now())+zt,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,Gt(n)}(),Rt=0}}function Wt(){var t=Lt.now(),e=t-Mt;e>At&&(zt-=e,Mt=t)}function Gt(t){Ct||(Et&&(Et=clearTimeout(Et)),t-Rt>24?(t<1/0&&(Et=setTimeout(Dt,t-Lt.now()-zt)),Tt&&(Tt=clearInterval(Tt))):(Tt||(Mt=Lt.now(),Tt=setInterval(Wt,At)),Ct=1,Ft(Dt)))}function Ut(t,e,r){var n=new Nt;return e=null==e?0:+e,n.restart((r=>{n.stop(),t(r+e)}),e,r),n}Nt.prototype=Zt.prototype={constructor:Nt,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,Gt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Gt())}};var Ht=wt("start","end","cancel","interrupt"),$t=[],Yt=0,Vt=2,qt=3,Xt=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===qt)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===qt&&(r.state=4,r.timer.restart(a,r.delay,r.time),a(l))})),r.state=Vt,r.on.call("start",t,t.__data__,r.index,r.group),r.state===Vt){for(r.state=qt,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=Xt,1),i=-1,a=n.length;++i<a;)n[i].call(t,o);r.state===Xt&&(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=Zt((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:Ht,tween:$t,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Yt})}function Qt(t,e){var r=ee(t,e);if(r.state>Yt)throw new Error("too late; already scheduled");return r}function te(t,e){var r=ee(t,e);if(r.state>qt)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>Vt&&r.state<Xt,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})$/,Oe=new RegExp(`^rgb\\(${ge},${ge},${ge}\\)$`),_e=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?ze(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?ze(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=Oe.exec(t))?new Fe(e[1],e[2],e[3],1):(e=_e.exec(t))?new Fe(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=je.exec(t))?ze(e[1],e[2],e[3],e[4]):(e=Pe.exec(t))?ze(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 ze(t,e,r,n){return n<=0&&(t=e=r=NaN),new Fe(t,e,r,n)}function Le(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`#${De(this.r)}${De(this.g)}${De(this.b)}`}function Be(){const t=Ne(this.opacity);return`${1===t?"rgb(":"rgba("}${Ze(this.r)}, ${Ze(this.g)}, ${Ze(this.b)}${1===t?")":`, ${t})`}`}function Ne(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ze(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function De(t){return((t=Ze(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 Ge(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 He(t){return(t=(t||0)%360)<0?t+360:t}function $e(t){return Math.max(0,Math.min(1,t||0))}function Ye(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 Ve(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 Ge(this).formatHsl()},formatRgb:Ae,toString:Ae}),pe(Fe,Le,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(Ze(this.r),Ze(this.g),Ze(this.b),Ne(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`#${De(this.r)}${De(this.g)}${De(this.b)}${De(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Be,toString:Be})),pe(Ue,(function(t,e,r,n){return 1===arguments.length?Ge(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(Ye(t>=240?t-240:t+120,o,n),Ye(t,o,n),Ye(t<120?t+240:t-120,o,n),this.opacity)},clamp(){return new Ue(He(this.h),$e(this.s),$e(this.l),Ne(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=Ne(this.opacity);return`${1===t?"hsl(":"hsla("}${He(this.h)}, ${100*$e(this.s)}%, ${100*$e(this.l)}%${1===t?")":`, ${t})`}`}}));const qe=t=>()=>t;function Xe(t,e){var r=e-t;return r?function(t,e){return function(r){return t+r*e}}(t,r):qe(isNaN(t)?e:t)}const Je=function t(e){var r=function(t){return 1==(t=+t)?Xe: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):qe(isNaN(e)?r:e)}}(e);function n(t,e){var n=r((t=Le(t)).r,(e=Le(e)).r),o=r(t.g,e.g),i=r(t.b,e.b),a=Xe(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=Le(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 Ve((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 Ve((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 Or=t=>()=>t;function _r(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 zr(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 Lr(t){return Lr="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},Lr(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"!==Lr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Lr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Lr(o)?o:String(o)),n)}var o}jr.prototype;var Br=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=zr,a=Mr,u=Rr,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],s=250,f=_t,h=wt("start","zoom","end"),y=500,p=150,v=0,d=10;function m(t){t.property("__zoom",Ar).on("wheel.zoom",_,{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 O(t,e)}function O(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=o.apply(t,e),this.taps=0}function _(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)},O.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 _r(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:Or(+t),m):a},m.filter=function(t){return arguments.length?(n="function"==typeof t?t:Or(!!t),m):n},m.touchable=function(t){return arguments.length?(u="function"==typeof t?t:Or(!!t),m):u},m.extent=function(t){return arguments.length?(o="function"==typeof t?t:Or([[+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 Nr(t){return Nr="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},Nr(t)}function Zr(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"!==Nr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Nr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Nr(o)?o:String(o)),n)}var o}var Dr=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]}}}])&&Zr(e.prototype,r),n&&Zr(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 Gr(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 Hr(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 $r=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=Gr(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=Gr(this.datasetComponents);try{for(r.s();!(e=r.n()).done;)e.value.preprocess=t}catch(t){r.e(t)}finally{r.f()}return this}}])&&Hr(e.prototype,r),n&&Hr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Yr(t){return Yr="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},Yr(t)}function Vr(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,qr(n.key),n)}}function qr(t){var e=function(t,e){if("object"!==Yr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Yr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Yr(e)?e:String(e)}var Xr=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,o=e.height;if(r.offsetLeft>e.left+n-r.clientWidth){var i=t.x-r.clientWidth-this.xOffset;if(r.style.left=i+"px",r.offsetLeft+r.clientWidth>t.x){var a=t.x-r.clientWidth-this.xOffset;r.style.left=a+"px"}}r.offsetTop+r.clientHeight>e.top+o&&(r.style.top=r.offsetTop-r.clientHeight+"px"),r.offsetTop<e.top&&(r.style.top=e.top+this.yOffset+"px")},(n=qr(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"]||"0px",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("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.style("text-wrap","nowrap"),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(),r=t.pageX+this.xOffset,n=t.pageY-this.yOffset;this.tooltip.style("left",r+"px").style("top",n+"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&&Vr(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=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(o.s();!(r=o.n()).done;){var i=r.value;if(!(t.x<i.x||i.x+n<t.x||t.y<i.y||i.y+n<t.y))return i}}catch(t){o.e(t)}finally{o.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:"normal",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("normal"===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 O(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 _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,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(_),!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"):"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),_(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;_(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 On=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 _n(t){return _n="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},_n(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"!==_n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==_n(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===_n(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"===_n(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 zn=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 Ln(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(Ln)}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 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 Nn(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)?Nn(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 Nn(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 Zn(){Zn=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:"normal",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"==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){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("normal"===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 O(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 _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,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(_),!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"):"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),_(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;_(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 Dn(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){Dn(i,n,o,a,u,"next",t)}function u(t){Dn(i,n,o,a,u,"throw",t)}a(void 0)}))}}function Gn(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 Hn(t){return Hn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Hn(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&&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=Hn(n);if(o){var r=Hn(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(Zn().mark((function r(){var n;return Zn().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(Zn().mark((function o(){var i,a,u,l,c,s,f,h,y,p,v,d,m;return Zn().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=Bn(a),o.prev=7,u.s();case 9:if((l=u.n()).done){o.next=17;break}if(c=l.value,0!=r.preprocess(c)){o.next=14;break}return o.abrupt("continue",15);case 14:i.push(c);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 zn(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=Bn(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=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()}}}}}}])&&Gn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(pn);function Yn(t){return Yn="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},Yn(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"!==Yn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Yn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Yn(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 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 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"!==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 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 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:"normal",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"==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){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("normal"===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 O(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 _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,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(_),!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"):"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),_(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;_(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),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).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 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=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 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:"normal",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"==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){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("normal"===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 O(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 _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,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(_),!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"):"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),_(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;_(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 lo(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 co(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=co(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=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=co(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){lo(i,r,o,a,u,"next",t)}function u(t){lo(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){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 mo=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.app=e.app,this.parentNode=e.parentNode||e.app.container,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)),e.title&&this.div.attr("title",e.title),e.class&&this.div.attr("class",e.class),e.onClickFunction&&this.div.on("click",e.onClickFunction),this.style("box-shadow","0 7px 8px rgba(0,47,103,.08), 0 0 22px rgba(0,47,103,.04), 0 12px 17px rgba(0,47,103,.04), 0 -4px 4px rgba(0,47,103,.04)"),this.style("background-color","#ffffff"),this.style("position","absolute"),this.style("cursor","pointer"),this.style("display","flex"),this.style("justify-content","center"),this.style("align-items","center"),this.style("width","30px"),this.style("height","30px"),this.parentNode.appendChild(this.div.node())}var e,r;return e=t,(r=[{key:"style",value:function(t,e){return this.div.style(t,e),this}}])&&vo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function bo(t){return bo="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},bo(t)}function go(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"!==bo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==bo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===bo(o)?o:String(o)),n)}var o}function wo(t,e){return wo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wo(t,e)}function xo(t){return xo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xo(t)}var So=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&&wo(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=xo(n);if(o){var r=xo(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===bo(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)).onZoom=t.onZoom,e.delta=t.delta||.2,e.zoomInBtn=document.createElement("a"),e.zoomInBtn.innerHTML='<a id="zoomin" class="gridviz-zoom-button" title="Zoom in">+</a>',e.zoomInBtn.title="Zoom in",e.zoomInBtn.addEventListener("click",(function(t){e.zoomIn(t)})),e.zoomInBtn.addEventListener("mouseover",(function(t){e.zoomInBtn.style.backgroundColor="lightgrey"})),e.zoomInBtn.addEventListener("mouseout",(function(t){e.zoomInBtn.style.backgroundColor="#ffffff"})),e.zoomOutBtn=document.createElement("a"),e.zoomOutBtn.innerHTML='<a id="zoomin" class="gridviz-zoom-button" title="Zoom out">-</a>',e.zoomOutBtn.title="Zoom out",e.zoomOutBtn.addEventListener("click",(function(t){e.zoomOut(t)})),e.zoomOutBtn.addEventListener("mouseover",(function(t){e.zoomOutBtn.style.backgroundColor="lightgrey"})),e.zoomOutBtn.addEventListener("mouseout",(function(t){e.zoomOutBtn.style.backgroundColor="#ffffff"})),[e.zoomInBtn,e.zoomOutBtn].forEach((function(t,e){t.style.alignItems="center",t.style.justifyContent="center",t.style.display="flex",t.style.border="none",t.style.color="black",t.style.textAlign="center",t.style.textDecoration="none",t.style.padding="4px",t.style.fontSize="20px",t.style.fontWeight="bold",t.style.userSelect="none",0==e&&(t.style.borderBottom="1px solid grey")})),e.style("height","unset"),e.style("display","unset"),t.x?e.style("left",t.x+"px"):e.style("right","10px"),t.y?e.style("top",t.y+"px"):e.style("top","10px"),e.div.node().appendChild(e.zoomInBtn),e.div.node().appendChild(e.zoomOutBtn),e}return e=a,(r=[{key:"zoomIn",value:function(t){this.app.setZoomFactor(this.app.getZoomFactor()*(1-this.delta)).redraw(),this.onZoom&&this.onZoom(t)}},{key:"zoomOut",value:function(t){this.app.setZoomFactor(this.app.getZoomFactor()*(1+this.delta)).redraw(),this.onZoom&&this.onZoom(t)}}])&&go(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(mo);function Oo(t){return Oo="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},Oo(t)}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,Co(n.key),n)}}function jo(t,e){return jo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jo(t,e)}function Po(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ko(t){return ko=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ko(t)}function Co(t){var e=function(t,e){if("object"!==Oo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Oo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Oo(e)?e:String(e)}var Eo=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&&jo(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=ko(n);if(o){var r=ko(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Oo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Po(t)}(this,t)});function a(t){var e,r,n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),r=Po(e=i.call(this,t)),!1,(n=Co(n="isFullscreen"))in r?Object.defineProperty(r,n,{value:false,enumerable:!0,configurable:!0,writable:!0}):r[n]=false,e.div.node().innerHTML='\n <svg\n style="height: 1.2rem; width: 1.2rem; fill:black; margin:0;"\n focusable="false"\n aria-hidden="true"\n >\n <svg fill="#000000" viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg">\n <title/>\n <g>\n <path d="M30,0H6A5.9966,5.9966,0,0,0,0,6V30a6,6,0,0,0,12,0V12H30A6,6,0,0,0,30,0Z"/>\n <path d="M90,0H66a6,6,0,0,0,0,12H84V30a6,6,0,0,0,12,0V6A5.9966,5.9966,0,0,0,90,0Z"/>\n <path d="M30,84H12V66A6,6,0,0,0,0,66V90a5.9966,5.9966,0,0,0,6,6H30a6,6,0,0,0,0-12Z"/>\n <path d="M90,60a5.9966,5.9966,0,0,0-6,6V84H66a6,6,0,0,0,0,12H90a5.9966,5.9966,0,0,0,6-6V66A5.9966,5.9966,0,0,0,90,60Z"/>\n </g>\n </svg>\n </svg>\n ',e.defaultHeight=e.app.h,e.defaultWidth=e.app.w,e.div.on("click",(function(t){e.onClickFunction(t)})),e.div.on("mouseover",(function(t){e.style("background-color","lightgrey")})),e.div.on("mouseout",(function(t){e.style("background-color","#ffffff")})),t.x?e.style("left",t.x+"px"):e.style("right","10px"),t.y?e.style("top",t.y+"px"):e.style("top","90px"),e}return e=a,(r=[{key:"onClickFunction",value:function(t){this.isFullscreen?(this.closeFullscreen(this.app.container),this.app.h=this.defaultHeight,this.app.w=this.defaultWidth,this.app.cg.h=this.defaultHeight,this.app.cg.w=this.defaultWidth,this.app.cg.canvas.setAttribute("width",""+this.defaultWidth),this.app.cg.canvas.setAttribute("height",""+this.defaultHeight),this.app.redraw(),this.isFullscreen=!1):(this.openFullscreen(this.app.container),this.app.h=window.screen.height,this.app.w=window.screen.width,this.isFullscreen=!0)}},{key:"openFullscreen",value:function(t){t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen()}},{key:"closeFullscreen",value:function(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()}}])&&_o(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(mo);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 Ao(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 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"!==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 zo=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.container.style.position="relative",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 Br(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=Ao(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=Ao(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=Ao(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=Ao(c.styles);try{for(v.s();!(p=v.n()).done;){var d=p.value;if(!(e>d.maxZoom||e<d.minZoom)){var m,b=Ao(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=Ao(d.styles);try{for(x.s();!(w=x.n()).done;){var S=w.value;if(!(e>S.maxZoom||e<S.minZoom)){var O,_=Ao(S.legends);try{for(_.s();!(O=_.n()).done;){var j=O.value;n.legend.node().append(j.div.node())}}catch(t){_.e(t)}finally{_.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","#FFFFFF").style("border","0px").style("box-shadow","3px 3px 3px grey, -3px -3px 3px #ddd").style("font-family","Helvetica, Arial, sans-serif").style("bottom","15px").style("right","15px")),r.tooltip||(r.tooltip={}),r.tooltip.parentElement||(r.tooltip.parentElement=this.container),this.tooltip=new Xr(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.html(o.html),n.tooltip.setPosition(t),n.tooltip.show()):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.html(o.html),n.tooltip.setPosition(t),n.tooltip.show(),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.cg.canvas.addEventListener("mouseover",this.mouseOverHandler),this.cg.canvas.addEventListener("mousemove",this.mouseMoveHandler),this.cg.canvas.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 Dr(t,e,r);return this.layers.push(n),this}},{key:"makeLGridDataset",value:function(t,e,r){return new $r([new En(t,e)],[],r)}},{key:"makeCSVGridDataset",value:function(t,e,r){var n=this;return new $r([new On(t,e,r).getData(void 0,(function(){n.cg.redraw()}))],[],r)}},{key:"makeTiledGridDataset",value:function(t,e){var r=this;return new $r([new $n(t,this,e).loadInfo((function(){r.cg.redraw()}))],[],e)}},{key:"makeMultiScaleCSVGridDataset",value:function(t,e,r){var n=this;return $r.make(t,(function(t){return new On(e(t),t,r).getData(void 0,(function(){n.cg.redraw()}))}),r)}},{key:"makeMultiScaleTiledGridDataset",value:function(t,e,r){var n=this;return $r.make(t,(function(t){return new $n(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 Kn(t)),this.redraw(),this}},{key:"addZoomSlider",value:function(t,e){return this.cg.addZoomSlider(t,e),this}},{key:"addZoomButtons",value:function(t){return this.zoomButtons=new So({app:this,id:(null==t?void 0:t.id)||"gridviz-zoom-buttons",class:null==t?void 0:t.class,x:null==t?void 0:t.x,y:null==t?void 0:t.y,onZoom:null==t?void 0:t.onZoom,delta:(null==t?void 0:t.delta)||.2}),this}},{key:"addFullscreenButton",value:function(t){return this.fullscreenButton=new Eo({app:this,id:(null==t?void 0:t.id)||"gridviz-fullscreen-button",class:null==t?void 0:t.class,x:null==t?void 0:t.x,y:null==t?void 0:t.y}),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&&Ro(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Lo(t){return Lo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lo(t)}function Fo(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 Io(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)?Io(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 Io(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"!==Lo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Lo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Lo(o)?o:String(o)),n)}var o}var No=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.drawFun=e.drawFun,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=Fo(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){if(!this.drawFun)throw new Error("Method draw not implemented.");this.drawFun(t,e,r)}},{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=Fo(this.legends);try{for(r.s();!(e=r.n()).done;)e.value.update(t)}catch(t){r.e(t)}finally{r.f()}return this}}])&&Bo(e.prototype,r),n&&Bo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();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 Do(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 Wo(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 Go(t,e){return Go=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Go(t,e)}function Uo(t){return Uo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Uo(t)}var Ho=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&&Go(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=Uo(n);if(o){var r=Uo(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.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.alphaCol=t.alphaCol,e.alphaF=t.alphaF,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.sizeCol&&(t.sort((function(t,e){return e[n.sizeCol]-t[n.sizeCol]})),o=No.getStatistics(t,(function(t){return t[n.sizeCol]}),!0)),this.colorCol&&(i=No.getStatistics(t,(function(t){return t[n.colorCol]}),!0)),this.alphaCol&&(a=No.getStatistics(t,(function(t){return t[n.alphaCol]}),!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 Do(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)?Do(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,i,u):void 0;if(h&&"none"!==h){if(this.alphaCol&&this.alphaF){var y=this.alphaF(f[this.alphaCol],e,a,u);if(0==y)continue;var p=Me(h);p?h="rgba(".concat(p.r,", ").concat(p.g,", ").concat(p.b,", ").concat(y,")"):console.warn("Could not decode color "+h+" in ShapeColorSizeStyle")}var v=this.shape?this.shape(f):"square";if("none"!==v){var d=(this.size||function(){return e})(f[this.sizeCol],e,o,u),m=this.offset(f,e,u);if(r.ctx.fillStyle=h,"square"===v){var b=e*(1-d/e)*.5;r.ctx.fillRect(f.x+b+m.dx,f.y+b+m.dy,d,d)}else if("circle"===v)r.ctx.beginPath(),r.ctx.arc(f.x+c+m.dx,f.y+c+m.dy,.5*d,0,2*Math.PI,!1),r.ctx.fill();else if("donut"===v){var g=f.x+c+m.dx,w=f.y+c+m.dy;r.ctx.beginPath(),r.ctx.moveTo(g,w),r.ctx.arc(g,w,c,0,2*Math.PI),r.ctx.arc(g,w,(1-d/e)*c,0,2*Math.PI,!0),r.ctx.closePath(),r.ctx.fill()}else{if("diamond"!==v)throw new Error("Unexpected shape:"+v);var x=.5*d;r.ctx.beginPath(),r.ctx.moveTo(f.x+c-x,f.y+c),r.ctx.lineTo(f.x+c,f.y+c+x),r.ctx.lineTo(f.x+c+x,f.y+c),r.ctx.lineTo(f.x+c,f.y+c-x),r.ctx.fill()}}}}}catch(t){s.e(t)}finally{s.f()}this.updateLegends({style:this,r:e,zf:u,sSize:o,sColor:i,sAlpha:a})}}])&&Wo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(No);function $o(t){return $o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$o(t)}function Yo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Vo(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"!==$o(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==$o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===$o(o)?o:String(o)),n)}var o}function qo(t,e){return qo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qo(t,e)}function Xo(t){return Xo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xo(t)}var Jo=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&&qo(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=Xo(n);if(o){var r=Xo(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===$o(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.viewScale=t.viewScale,e.color=t.color,e.size=t.size,e.shape=t.shape,e}return e=a,(r=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=r.getZf(),o=this.viewScale?this.viewScale(t,e,n):void 0;r.setCanvasTransform();var i,a=.5*e,u=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 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}}(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(u.s();!(i=u.n()).done;){var l=i.value,c=this.color?this.color(l,e,n,o):"black";if(c&&"none"!==c){var s=this.size?this.size(l,e,n,o):e;if(s){var f=this.shape?this.shape(l,e,n,o):"square";if("none"!==f){var h=this.offset(l,e,n);if(r.ctx.fillStyle=c,"square"===f){var y=e*(1-s/e)*.5;r.ctx.fillRect(l.x+y+h.dx,l.y+y+h.dy,s,s)}else if("circle"===f)r.ctx.beginPath(),r.ctx.arc(l.x+a+h.dx,l.y+a+h.dy,.5*s,0,2*Math.PI,!1),r.ctx.fill();else if("donut"===f){var p=l.x+a+h.dx,v=l.y+a+h.dy;r.ctx.beginPath(),r.ctx.moveTo(p,v),r.ctx.arc(p,v,a,0,2*Math.PI),r.ctx.arc(p,v,(1-s/e)*a,0,2*Math.PI,!0),r.ctx.closePath(),r.ctx.fill()}else{if("diamond"!==f)throw new Error("Unexpected shape:"+f);var d=.5*s;r.ctx.beginPath(),r.ctx.moveTo(l.x+a-d,l.y+a),r.ctx.lineTo(l.x+a,l.y+a+d),r.ctx.lineTo(l.x+a+d,l.y+a),r.ctx.lineTo(l.x+a,l.y+a-d),r.ctx.fill()}}}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({style:this,r:e,zf:n,viewScale:o})}}])&&Vo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(No);function Ko(t){return Ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ko(t)}function Qo(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 ti(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"!==Ko(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ko(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ko(o)?o:String(o)),n)}var o}function ei(t,e){return ei=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ei(t,e)}function ri(t){return ri=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ri(t)}var ni=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ei(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=ri(n);if(o){var r=ri(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ko(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function 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=No.getStatistics(t,(function(t){return t[n.strokeColorCol]}),!0)),this.sizeCol&&(i=No.getStatistics(t,(function(t){return t[n.sizeCol]}),!0)),this.strokeWidthCol&&(a=No.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 Qo(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)?Qo(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()}}}])&&ti(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(No);function oi(t){return oi="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},oi(t)}function ii(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 ai(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"!==oi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==oi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===oi(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 li(t){return li=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},li(t)}var ci=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ui(t,e)}(a,t);var e,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=li(n);if(o){var r=li(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===oi(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=No.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 ii(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)?ii(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 O=this.lineColor(m,d,e,i),_=this.lineWidth(m,d,e,i);O&&"none"!=O&&_>0&&(r.ctx.strokeStyle=O,r.ctx.lineWidth=_,r.ctx.stroke())}}}}}])&&ai(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(No);function si(t){return si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},si(t)}function fi(t,e){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)||hi(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 hi(t,e){if(t){if("string"==typeof t)return yi(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)?yi(t,e):void 0}}function yi(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 pi(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"!==si(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==si(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===si(o)?o:String(o)),n)}var o}function vi(t,e){return vi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vi(t,e)}function di(t){return di=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},di(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&&vi(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=di(n);if(o){var r=di(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===si(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function 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=No.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=hi(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,O=Object.entries(this.color);S<O.length;S++){var _=fi(O[S],2),j=_[0],P=_[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,z=Object.keys(this.color);R<z.length;R++){var L=+c[z[R]];L&&(M+=L)}if(!M||isNaN(M))continue;for(var F=0,I=e*(1-s/e)*.5,B=this.stripesOrientation(c,e,i),N=0,Z=Object.entries(this.color);N<Z.length;N++){var D=fi(Z[N],2),W=D[0],G=D[1],U=c[W]/M;if(U&&!isNaN(U)){if(r.ctx.fillStyle=G,"flag"===h)0==B?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 H=2*F*Math.PI,$=2*(F+U)*Math.PI;r.ctx.beginPath(),r.ctx.moveTo(y,p),r.ctx.arc(y,p,.5*s,H+v,$+v),this.pieChartInternalRadiusFactor&&r.ctx.arc(y,p,.5*s*this.pieChartInternalRadiusFactor,H+v,$+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 Y=s*s/e;0==B?r.ctx.fillRect(c.x+f.dx,c.y+(e-Y)/2+F*Y+f.dy,e,U*Y):r.ctx.fillRect(c.x+F*e+f.dx,c.y+(e-Y)/2+f.dy,U*e,Y)}F+=U}}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,r:e,zf:i,sSize:o})}}],r&&pi(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(No);function bi(t){return bi="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},bi(t)}function gi(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)||wi(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 wi(t,e){if(t){if("string"==typeof t)return xi(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)?xi(t,e):void 0}}function xi(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 Si(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"!==bi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==bi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===bi(o)?o:String(o)),n)}var o}function Oi(t,e){return Oi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Oi(t,e)}function _i(t){return _i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_i(t)}var ji=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Oi(t,e)}(a,t);var e,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"===bi(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.viewScale=t.viewScale,e.color=t.color,e.type=t.type,e.size=t.size,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){this.filter&&(t=t.filter(this.filter));var n=r.getZf(),o=this.viewScale?this.viewScale(t,e,n):void 0,i=Object.entries(this.color).length;r.setCanvasTransform();var a,u=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=wi(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(u.s();!(a=u.n()).done;){var l=a.value,c=this.size?this.size(l,e,n,o):e;if(c){var s=this.offset(l,e,n),f=this.type?this.type(l,e,n,o):"flag",h=l.x+s.dx+("agepyramid"===f?0:.5*e),y=l.y+s.dy+("agepyramid"===f?0:.5*e),p=this.offsetAngle?this.offsetAngle(l,e,n,o)*Math.PI/180:0;if("agepyramid"===f||"radar"===f||"halftone"===f){for(var v=-1/0,d=0,m=Object.keys(this.color);d<m.length;d++){var b=+l[m[d]];b>v&&(v=b)}var g=0;"agepyramid"===f&&this.agePyramidHeight&&(g=(e-this.agePyramidHeight(l,e,n,o))/2),"radar"!==f&&"halftone"!==f||(g=Math.PI/2+p);var w="agepyramid"===f?(this.agePyramidHeight?this.agePyramidHeight(l,e,n,o):e)/i:"radar"===f||"halftone"===f?2*Math.PI/i:void 0;if(void 0===w)throw new Error("Unexpected symbol type:"+f);for(var x=0,S=Object.entries(this.color);x<S.length;x++){var O=gi(S[x],2),_=O[0],j=O[1];if("agepyramid"===f){r.ctx.fillStyle=j;var P=c*l[_]/v;r.ctx.fillRect(h+(e-P)/2,y+g,P,w),g+=w}else if("radar"===f){r.ctx.fillStyle=j;var k=l[_],C=c/2*Math.sqrt(k/v);r.ctx.beginPath(),r.ctx.moveTo(h,y),r.ctx.arc(h,y,C,g-w,g),r.ctx.lineTo(h,y),r.ctx.fill(),g+=w}else{if("halftone"!==f)throw new Error("Unexpected symbol type:"+f);r.ctx.fillStyle=j;var E=l[_],T=.333*c*Math.sqrt(E/v);r.ctx.beginPath(),r.ctx.arc(h+.25*e*Math.cos(g),y+.25*e*Math.sin(g),T,0,2*Math.PI),r.ctx.fill(),g+=w}}}else{for(var A=0,M=0,R=Object.keys(this.color);M<R.length;M++){var z=+l[R[M]];z&&(A+=z)}if(!A||isNaN(A))continue;for(var L=0,F=e*(1-c/e)*.5,I=this.stripesOrientation(l,e,n,o),B=0,N=Object.entries(this.color);B<N.length;B++){var Z=gi(N[B],2),D=Z[0],W=Z[1],G=l[D]/A;if(G&&!isNaN(G)){if(r.ctx.fillStyle=W,"flag"===f)0==I?r.ctx.fillRect(l.x+F+s.dx,l.y+F+L*c+s.dy,c,G*c):r.ctx.fillRect(l.x+F+L*c+s.dx,l.y+F+s.dy,G*c,c);else if("piechart"===f){var U=2*L*Math.PI,H=2*(L+G)*Math.PI;r.ctx.beginPath(),r.ctx.moveTo(h,y),r.ctx.arc(h,y,.5*c,U+p,H+p),this.pieChartInternalRadiusFactor&&r.ctx.arc(h,y,.5*c*this.pieChartInternalRadiusFactor,U+p,H+p,!0),r.ctx.closePath(),r.ctx.fill()}else if("ring"===f)r.ctx.beginPath(),r.ctx.arc(h,y,Math.sqrt(1-L)*c*.5,0,2*Math.PI),r.ctx.fill();else{if("segment"!==f)throw new Error("Unexpected symbol type:"+f);var $=c*c/e;0==I?r.ctx.fillRect(l.x+s.dx,l.y+(e-$)/2+L*$+s.dy,e,G*$):r.ctx.fillRect(l.x+L*e+s.dx,l.y+(e-$)/2+s.dy,G*e,$)}L+=G}}}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({style:this,r:e,zf:n,viewScale:o})}}],r&&Si(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(No);function Pi(t){return Pi="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},Pi(t)}function ki(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 Ci(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"!==Pi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Pi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Pi(o)?o:String(o)),n)}var o}function Ei(t,e){return Ei=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ei(t,e)}function Ti(t){return Ti=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ti(t)}var Ai=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&&Ei(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=Ti(n);if(o){var r=Ti(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Pi(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=No.getStatistics(t,(function(t){return t[n.colorCol]}),!0)),this.lengthCol&&(t.sort((function(t,e){return e[n.lengthCol]-t[n.lengthCol]})),i=No.getStatistics(t,(function(t){return t[n.lengthCol]}),!0)),this.widthCol&&(a=No.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 ki(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)?ki(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({widthFun:this.width,r:e,zf:u,sColor:o,sWidth:a})}}])&&Ci(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(No);function Mi(t){return Mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mi(t)}function Ri(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"!==Mi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Mi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Mi(o)?o:String(o)),n)}var o}function Li(t,e){return Li=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Li(t,e)}function Fi(t){return Fi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Fi(t)}var Ii=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&&Li(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=Fi(o);if(i){var r=Fi(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Mi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function 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=No.getStatistics(t,(function(t){return t[n.textCol]}),!0)),this.colorCol&&(i=No.getStatistics(t,(function(t){return t[n.colorCol]}),!0)),this.fontSizeCol&&(t.sort((function(t,e){return e[n.fontSizeCol]-t[n.fontSizeCol]})),a=No.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 Ri(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)?Ri(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})}}])&&zi(e.prototype,r),n&&zi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(No);function Bi(t){return Bi="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},Bi(t)}function Ni(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 Di(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"!==Bi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Bi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Bi(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 Gi(t){return Gi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gi(t)}var Ui=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)}(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=Gi(n);if(o){var r=Gi(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Bi(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=No.getStatistics(t,(function(t){return t[n.heightCol]}),!0)),this.colorCol&&(i=No.getStatistics(t,(function(t){return t[n.colorCol]}),!0)),this.widthCol&&(a=No.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=Ni(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=Ni(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 O=this.width?this.width(x[this.widthCol],e,a,u):void 0;if(O&&!(O<0)){var _=this.height?this.height(x[this.heightCol],e,o,u):void 0;if(_&&!(_<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)*_/(s-_);this.simple?(r.ctx.strokeStyle=S,r.ctx.lineWidth=O,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=O+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=O,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*O,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})}}])&&Di(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(No);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 $i(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 Yi(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)?Yi(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 Yi(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 Vi(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}function qi(t,e){return qi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qi(t,e)}function Xi(t){return Xi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xi(t)}var Ji=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)}(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"===Hi(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=$i(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=No.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 l=t[0],c=1;c<t.length;c++){var s=t[c];l.y+e==s.y&&l.x==s.x?a.push({x:l.x,y:s.y,or:"h",value:this.value(l[this.valueCol],s[this.valueCol],e,o,i)}):(a.push({x:l.x,y:l.y+e,or:"h",value:this.value(l[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)})),l=s}t.sort((function(t,e){return e.y==t.y?t.x-e.x:t.y-e.y})),l=t[0];for(var f=1;f<t.length;f++){var h=t[f];l.x+e==h.x&&l.y==h.y?a.push({x:l.x+e,y:l.y,or:"v",value:this.value(l[this.valueCol],h[this.valueCol],e,o,i)}):(a.push({x:l.x+e,y:l.y,or:"v",value:this.value(l[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)})),l=h}if(0!=a.length){var y=u.getSideStatistics(a,!0);if(r.setCanvasTransform(),this.fillColor){var p,v=$i(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 O=this.width?this.width(x,e,y,i):void 0;!O||O<=0||(r.ctx.strokeStyle=S,r.ctx.lineWidth=O,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})}}}])&&Vi(e.prototype,r),n&&Vi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(No);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 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)}(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=ta(r);if(n){var o=ta(this).constructor;t=Reflect.construct(e,arguments,o)}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 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}(Ji);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){(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 oa(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}function ia(t,e){return ia=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ia(t,e)}function aa(t){return aa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},aa(t)}var ua=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&&ia(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=aa(n);if(o){var r=aa(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ra(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 na(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)?na(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})}}}}])&&oa(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(No);const la=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 ca(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 sa(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 fa(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 ha(t){return ha="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},ha(t)}function ya(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"!==ha(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ha(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ha(o)?o:String(o)),n)}var o}var pa=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=sa(e,fa(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 "),fa(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)}}])&&ya(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function va(t){return va="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},va(t)}function da(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 ma(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)?ma(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 ma(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 ba(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"!==va(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==va(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===va(o)?o:String(o)),n)}var o}function ga(t,e){return ga=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ga(t,e)}function wa(t){return wa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wa(t)}var xa=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&&ga(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=wa(n);if(o){var r=wa(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===va(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=No.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=la(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=ca(r.w+"",r.h+"");if(!c)return void console.error("No webGL");var s,f,h,y,p,v,d,m=new pa(c.gl,a/i),b=e/2,g=da(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,O=da(t);try{for(O.s();!(S=O.n()).done;){var _=S.value,j=this.color(_);if(j&&"none"!==j){r.ctx.fillStyle=j;for(var P=this.offset(_,e,i),k=this.nb(_[this.nbCol],e,o,i),C=_.x+P.dx+e/2,E=_.y+P.dy+e/2,T=0;T<=k;T++)r.ctx.fillRect(C+l(),E+l(),a,a)}}}catch(t){O.e(t)}finally{O.f()}}this.updateLegends({style:this,r:e,zf:i})}}}])&&ba(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(No);function Sa(t){return Sa="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},Sa(t)}function Oa(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"!==Sa(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Sa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Sa(o)?o:String(o)),n)}var o}var _a=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=fa(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=fa(e,e.FRAGMENT_SHADER,u);this.program=sa(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)}}])&&Oa(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ja(t){return ja="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},ja(t)}function Pa(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 ka(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"!==ja(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ja(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ja(o)?o:String(o)),n)}var o}function Ca(t,e){return Ca=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ca(t,e)}function Ea(t){return Ea=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ea(t)}var Ta=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&&Ca(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=Ea(n);if(o){var r=Ea(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ja(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=No.getStatistics(t,(function(t){return t[n.colorCol]}),!0);if(i){var a=ca(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 Pa(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)?Pa(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 _a(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")}}}])&&ka(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(No);function Aa(t){return Aa="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},Aa(t)}function Ma(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"!==Aa(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Aa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Aa(o)?o:String(o)),n)}var o}var Ra=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 Ta({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 Ji({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&&Ma(e.prototype,null),r&&Ma(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();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 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"!==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 Fa=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=sa(t,fa(t,t.VERTEX_SHADER,this.vshString),fa(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&&La(e.prototype,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 Ba(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}function Na(t,e){return Na=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Na(t,e)}function Za(t){return Za=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Za(t)}var Da=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Na(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=Za(n);if(o){var r=Za(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ia(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 Fa(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=ca(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")}}])&&Ba(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(No);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 Ga(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 Ua(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)?Ua(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 Ua(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){return Ha=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ha(t,e)}function $a(t){return $a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$a(t)}function Ya(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Va(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 qa(t,e,r){return e&&Va(t.prototype,e),r&&Va(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var Xa=function(){function t(){Ya(this,t)}return qa(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=Ra.get(t,e),n=new ni({strokeColor:function(){return"#666"},strokeWidth:function(t,e,r,n){return.2*n},filter:e.filter});return[r[0],n,r[1],new Ja({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 Da({colorCol:t,color:e.color}),new ni({strokeColor:function(){return"#666"},strokeWidth:function(t,e,r,n){return.2*n}}),new Ja({colDark:e.colDark,colBright:e.colBright})]}}]),t}(),Ja=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&&Ha(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=$a(e);if(r){var o=$a(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.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 o(t){var e;return Ya(this,o),e=n.call(this,t),t=t||{},e.colDark=t.colDark||"#333",e.colBright=t.colBright||"#aaa",e}return qa(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=Ga(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=Ga(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}(No);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){(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 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"!==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}function eu(t,e){return eu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},eu(t,e)}function ru(t){return ru=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ru(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&&eu(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=ru(n);if(o){var r=ru(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ka(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=No.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 Qa(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)?Qa(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})}}])&&tu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(No);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){(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 au(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 uu(t,e){return uu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},uu(t,e)}function lu(t){return lu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},lu(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&&uu(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=lu(n);if(o){var r=lu(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.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=No.getStatistics(t,(function(t){return t[n.sizeCol]}),!0)),this.colorCol&&(i=No.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 iu(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)?iu(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})}}])&&au(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(No);function su(t){return su="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},su(t)}function fu(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 hu(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)?hu(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 hu(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 yu(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"!==su(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==su(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===su(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 vu(t){return vu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vu(t)}var du=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=vu(n);if(o){var r=vu(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===su(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=No.getStatistics(t,(function(t){return t[n.lineWidthCol]}),!0)),this.colorCol&&(i=No.getStatistics(t,(function(t){return t[n.colorCol]}),!0));var u,l,c=function(t){var e,r,o,i=fu(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=fu(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=fu(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 O=void 0,_=void 0;if("first"===S)O=v[this.ts[0]],_=0;else if("last"===S)O=v[this.ts[this.ts.length-1]],_=0;else if("bottom"===S){var j,P=fu(this.ts);try{for(P.s();!(j=P.n()).done;){var k=+v[j.value];null!=k&&(null==O||k<O)&&(O=k)}}catch(t){P.e(t)}finally{P.f()}_=0}else if("top"===S){var C,E=fu(this.ts);try{for(E.s();!(C=E.n()).done;){var T=+v[C.value];null!=T&&(null==O||T>O)&&(O=T)}}catch(t){E.e(t)}finally{E.f()}_=e}else{if("center"!==S){console.log("Unexpected anchorModeY: "+S);continue}var A,M=void 0,R=void 0,z=fu(this.ts);try{for(z.s();!(A=z.n()).done;){var L=v[A.value];null!=L&&((null==M||L<M)&&(M=L),(null==R||L>R)&&(R=L))}}catch(t){z.e(t)}finally{z.f()}O=.5*(+R+ +M),_=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+_+(I-O)*x/u+w));for(var B=void 0,N=1;N<h;N++)B=v[this.ts[N]],this.noData(I)&&this.noData(B)||(!this.noData(I)&&this.noData(B)?r.ctx.stroke():this.noData(I)&&!this.noData(B)?(r.ctx.beginPath(),r.ctx.moveTo(v.x+N*F+b,v.y+_+(B-O)*x/u+w)):(r.ctx.lineTo(v.x+N*F+b,v.y+_+(B-O)*x/u+w),N==h-1&&r.ctx.stroke())),I=B}}}}}}}}}catch(t){p.e(t)}finally{p.f()}this.updateLegends({widthFun:this.lineWidth,r:e,zf:a,sColor:i,sWidth:o})}}}])&&yu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(No);function mu(t){return mu="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},mu(t)}function bu(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)||gu(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 gu(t,e){if(t){if("string"==typeof t)return wu(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)?wu(t,e):void 0}}function wu(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 xu(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"!==mu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==mu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===mu(o)?o:String(o)),n)}var o}function Su(t,e){return Su=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Su(t,e)}function Ou(t){return Ou=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ou(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&&Su(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=Ou(n);if(o){var r=Ou(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===mu(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:50,e.cornerLineStrokeColor=t.cornerLineStrokeColor||function(t,e,r,n){return"#999"},e.cornerLineWidth=t.cornerLineWidth||function(t,e,r,n){return n%90==0?0:.8*r},e.sVert=null==t.sVert||t.sVert,e.sHor=null==t.sHor||t.sHor,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=No.getStatistics(t,(function(t){return t[n.heightCol]}),!0));var a=Object.keys(this.color),u=e/2,l=this.offset(void 0,e,i),c=l.dx,s=l.dy,f=this.height,h=[];if(this.angle%180!=90&&this.sVert){t.sort((function(t,e){return e.x==t.x?t.y-e.y:t.x-e.x}));for(var y=t[0],p=1;p<t.length;p++){var v=t[p];y.y+e==v.y&&y.x==v.x?h.push({x:y.x+u,y:v.y,or:"h",c1:y,c2:v}):(h.push({x:y.x+u,y:y.y+e,or:"h",c1:y,c2:void 0}),h.push({x:v.x+u,y:v.y,or:"h",c1:void 0,c2:v})),y=v}}if(this.angle%180!=0&&this.sHor){t.sort((function(t,e){return e.y==t.y?t.x-e.x:t.y-e.y}));for(var d=t[0],m=1;m<t.length;m++){var b=t[m];d.x+e==b.x&&d.y==b.y?h.push({x:b.x,y:d.y+u,or:"v",c1:d,c2:b}):(h.push({x:d.x+e,y:d.y+u,or:"v",c1:d,c2:void 0}),h.push({x:b.x,y:b.y+u,or:"v",c1:void 0,c2:b})),d=b}}if(0!=h.length){var g=this.angle*Math.PI/180,w=Math.cos(g),x=Math.sin(g),S=Math.abs(this.angle)<90?r.extGeo.xMin:r.extGeo.xMax,O=this.angle<0?r.extGeo.yMax:r.extGeo.yMin;h.sort((function(t,e){return Math.hypot(e.x-S,e.y-O)-Math.hypot(t.x-S,t.y-O)}));var _=function(t){if(t){var a=n.cornerLineWidth?n.cornerLineWidth(t,e,i,n.angle):.8*i;if(0!=a){r.ctx.strokeStyle=n.cornerLineStrokeColor?n.cornerLineStrokeColor(t,e,i,n.angle):"#333",r.ctx.lineWidth=a;var l=f(t[n.heightCol],e,o,i);r.ctx.beginPath(),r.ctx.moveTo(t.x+u+c,t.y+u+s),r.ctx.lineTo(t.x+u+l*w+c,t.y+u+l*x+s),r.ctx.stroke()}}};r.setCanvasTransform(),r.ctx.lineCap="round";for(var j=0,P=h;j<P.length;j++){var k=P[j],C=k.c1?f(k.c1[this.heightCol],e,o,i):0,E=k.c2?f(k.c2[this.heightCol],e,o,i):0,T=ju(k.c1,a),A=ju(k.c2,a);if(0!=T||0!=A)for(var M=0,R=0,z=0,L=Object.entries(this.color);z<L.length;z++){var F=bu(L[z],2),I=F[0],B=F[1],N=k.c1?+k.c1[I]:0,Z=k.c2?+k.c2[I]:0;if(0!=N||0!=Z){var D=C*M/T||0,W=C*(M+N)/T||0,G=E*R/A||0,U=E*(R+Z)/A||0;r.ctx.beginPath(),"h"==k.or?(r.ctx.moveTo(k.x+D*w+c,k.y-u+D*x+s),r.ctx.lineTo(k.x+G*w+c,k.y+u+G*x+s),r.ctx.lineTo(k.x+U*w+c,k.y+u+U*x+s),r.ctx.lineTo(k.x+W*w+c,k.y-u+W*x+s)):(r.ctx.moveTo(k.x-u+D*w+c,k.y+D*x+s),r.ctx.lineTo(k.x+u+G*w+c,k.y+G*x+s),r.ctx.lineTo(k.x+u+U*w+c,k.y+U*x+s),r.ctx.lineTo(k.x-u+W*w+c,k.y+W*x+s)),r.ctx.fillStyle=B,r.ctx.fill(),M+=N,R+=Z,_(k.c1),_(k.c2)}}}this.updateLegends({style:this,r:e,zf:i,sSize:o})}}}],r&&xu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(No),ju=function(t,e){if(!t)return 0;var r,n=0,o=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=gu(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}}}}(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 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 ku(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}var Cu=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.")}}])&&ku(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 Tu,Au=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Mu(t){if(!(e=Au.exec(t)))throw new Error("invalid format: "+t);var e;return new Ru({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 Ru(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 zu(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")}Mu.prototype=Ru.prototype,Ru.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 Lu={"%":(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)=>zu(100*t,e),r:zu,s:function(t,e){var r=Eu(t,e);if(!r)return t+"";var n=r[0],o=r[1],i=o-(Tu=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 Fu(t){return t}var Iu,Bu,Nu=Array.prototype.map,Zu=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Du(t){return Iu=function(t){var e,r,n=void 0===t.grouping||void 0===t.thousands?Fu:(e=Nu.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?Fu:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Nu.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=Mu(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"):Lu[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=Lu[b],S=/[defgprs%]/.test(b);function O(t){var o,i,l,h=g,O=w;if("c"===b)O=x(t)+O,t="";else{var _=(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)),_&&0==+t&&"+"!==f&&(_=!1),h=(_?"("===f?f:c:"-"===f||"("===f?"":f)+h,O=("s"===b?Zu[8+Tu/3]:"")+O+(_&&"("===f?")":""),S)for(o=-1,i=t.length;++o<i;)if(48>(l=t.charCodeAt(o))||l>57){O=(46===l?a+t.slice(o+1):t.slice(o))+O,t=t.slice(0,o);break}}v&&!y&&(t=n(t,1/0));var j=h.length+t.length+O.length,P=j<p?new Array(p-j+1).join(e):"";switch(v&&y&&(t=n(P+t,P.length?p-O.length:1/0),P=""),r){case"<":t=h+t+O+P;break;case"=":t=h+P+t+O;break;case"^":t=P.slice(0,j=P.length>>1)+h+t+O+P.slice(j);break;default:t=P+h+t+O}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)),O.toString=function(){return t+""},O}return{format:f,formatPrefix:function(t,e){var r,n=f(((t=Mu(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=Zu[8+o/3];return function(t){return n(i*t)+a}}}}(t),Bu=Iu.format,Iu.formatPrefix,Iu}function Wu(t){return Wu="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},Wu(t)}function Gu(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"!==Wu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Wu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Wu(o)?o:String(o)),n)}var o}function Uu(t,e){return Uu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Uu(t,e)}function Hu(t){return Hu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Hu(t)}Du({thousands:",",grouping:[3],currency:["$",""]});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&&Uu(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"===Wu(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.getStats=t.getStats||function(t){return t.sColor},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?Bu(this.tickFormat):function(t){return t},h=this.getStats(t),y=0;y<this.ticks;y++){var p=y/(this.ticks-1),v=this.fun(p,t.r,h),d=(v?f(v):"0")+(this.tickUnit?this.tickUnit:"");this.div.select("#ticklabel_"+y).text(d)}}}}])&&Gu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Cu);function Yu(t){return Yu="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},Yu(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"!==Yu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Yu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Yu(o)?o:String(o)),n)}var o}function qu(t,e){return qu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qu(t,e)}function Xu(t){return Xu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xu(t)}var Ju=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&&qu(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=Xu(n);if(o){var r=Xu(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Yu(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])}}}])&&Vu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Cu);function Ku(t){return Ku="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},Ku(t)}function Qu(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"!==Ku(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ku(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ku(o)?o:String(o)),n)}var o}function tl(t,e){return tl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},tl(t,e)}function el(t){return el=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},el(t)}var rl=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&&tl(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=el(n);if(o){var r=el(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ku(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])}}}])&&Qu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Cu);function nl(t){return nl="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},nl(t)}function ol(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"!==nl(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==nl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===nl(o)?o:String(o)),n)}var o}function il(t,e){return il=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},il(t,e)}function al(t){return al=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},al(t)}var ul=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&&il(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=al(n);if(o){var r=al(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===nl(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=Bu(this.labelFormat)(e);o.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(l+(this.labelUnitText?" ":"")+this.labelUnitText)}}}}])&&ol(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Cu);function ll(t){return ll="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},ll(t)}function cl(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"!==ll(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ll(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ll(o)?o:String(o)),n)}var o}function sl(t,e){return sl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},sl(t,e)}function fl(t){return fl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fl(t)}var hl=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&&sl(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=fl(n);if(o){var r=fl(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ll(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.lengthFun=t.lengthExaggerationFactor||function(t,e){return t},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:1.5*o<=r&&(o*=1.5);var i=t.widthFun(o,t.r,t.sWidth,t.zf)/t.zf,a=this.lengthFun(t.r,t.zf)/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=Bu(",.2r")(o);e.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(u+(this.labelUnitText?" ":"")+this.labelUnitText)}}}])&&cl(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Cu);function yl(t){return yl="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},yl(t)}function pl(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"!==yl(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==yl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===yl(o)?o:String(o)),n)}var o}function vl(t,e){return vl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vl(t,e)}function dl(t){return dl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},dl(t)}var ml=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&&vl(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=dl(n);if(o){var r=dl(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===yl(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)}}}])&&pl(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Cu),bl=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;return function(e){return Math.pow(e,t)}},gl=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;return function(e){return 1-Math.pow(1-e,1/t)}},wl=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(0==t)return function(t){return t};var e=Math.exp(t)-1;return function(r){return(Math.exp(r*t)-1)/e}},xl=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;return 0==t?function(t){return t}:function(e){return 1-1/t*Math.log(Math.exp(t)*(1-e)+e)}},Sl=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8;if(0==t)return function(t){return t};if(1==t)return function(t){return Math.sqrt(t*(2-t))};var e=t/(1-t);return function(t){return Math.sqrt(1/(e*e)+t*(2/e+2-t))-1/e}},Ol=function(){var t=Sl(arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8);return function(e){return 1-t(1-e)}},_l=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return Math.pow(t,e)},jl=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 1-Math.pow(1-t,1/e)},Pl=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)},kl=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)},Cl=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},El=function(t){return 1-Cl(1-t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:.8)},Tl=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))},Al=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return(Math.exp(-e*t)-1)/(Math.exp(-e)-1)},Ml=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return Math.pow(t,1/e)},Rl=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 1-Math.pow(1-t,e)},zl=Br.getParameterByName;return Du({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.gridviz=e():t.gridviz=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,{BackgroundLayer:()=>Na,BackgroundLayerWMS:()=>Ua,CSVGrid:()=>fo,ColorCategoryLegend:()=>ju,ColorDiscreteLegend:()=>wu,ColorLegend:()=>vu,CompositionStyle:()=>$o,DotDensityStyle:()=>Li,GeoCanvas:()=>Nr,GeoJSONLayer:()=>uu,GridLayer:()=>Ra,IsoFenceStyle:()=>ja,JSGrid:()=>mo,JoyPlotStyle:()=>Fo,LabelLayer:()=>Ka,Layer:()=>Sn,Map:()=>cn,MosaicStyle:()=>oa,MultiResolutionDataset:()=>Pn,NinjaStarStyle:()=>sa,OrientationLegend:()=>Hu,PillarStyle:()=>li,SegmentStyle:()=>Zo,ShapeColorSizeStyle:()=>_o,SideCategoryStyle:()=>xi,SideStyle:()=>vi,SizeLegend:()=>Lu,SquareColorCategoryWebGLStyle:()=>Ki,SquareColorWebGLStyle:()=>$i,StrokeStyle:()=>Ao,Style:()=>bn,TextStyle:()=>ri,TiledGrid:()=>eo,TimeSeriesStyle:()=>ba,circularInverseScale:()=>Qu,circularScale:()=>Ku,classifier:()=>dc,colorClassifier:()=>bc,discreteColors:()=>mc,exponentialScale:()=>qu,getParameterByName:()=>Cc,logarithmicScale:()=>Xu,nice:()=>ku,orientationLegend:()=>Yu,powerInverseScale:()=>Ju,powerScale:()=>Zu,sizeDiscreteLegend:()=>Nu,sizeDiscreteViewScaleLegend:()=>Bu,sizeLegend:()=>Fu,sizeLegendViewScale:()=>Iu,viewScale:()=>fc,viewScaleColor:()=>yc,viewScaleColorQuantile:()=>pc,viewScaleCombination:()=>vc,viewScaleQuantile:()=>hc});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 b(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function m(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 O(t){return function(){this.removeAttributeNS(t.space,t.local)}}function _(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 E(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function T(t){return function(){this.style.removeProperty(t)}}function A(t,e,r){return function(){this.style.setProperty(t,e,r)}}function C(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)||E(t).getComputedStyle(t,null).getPropertyValue(e)}function R(t){return function(){delete this[t]}}function z(t,e){return function(){this[t]=e}}function L(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 U(t,e){return function(){(e.apply(this,arguments)?B:D)(this,t)}}function $(){this.textContent=""}function H(t){return function(){this.textContent=t}}function Y(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function V(){this.innerHTML=""}function q(t){return function(){this.innerHTML=t}}function X(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function Z(){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=E(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,m=b(t.call(f,f&&f.__data__,s,o)),g=m.length,w=c[s]=new Array(g),x=u[s]=new Array(g);n(f,h,w,x,l[s]=new Array(y),m,e);for(var S,O,_=0,j=0;_<g;++_)if(S=w[_]){for(_>=j&&(j=_+1);!(O=x[j])&&++j<g;);S._next=O||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=m);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?O:S:"function"==typeof e?r.local?k:P:r.local?j:_)(r,e))},style:function(t,e,r){return arguments.length>1?this.each((null==e?T:"function"==typeof e?C:A)(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?L:z)(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?U:e?G:W)(r,e))},text:function(t){return arguments.length?this.each(null==t?$:("function"==typeof t?Y:H)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?V:("function"==typeof t?X:q)(t)):this.node().innerHTML},raise:function(){return this.each(Z)},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 bt(n)}function bt(t){this._=t}function mt(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}bt.prototype=dt.prototype={constructor:bt,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=mt(o[r],t.name)))return r},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new bt(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 Ot(t){return((t=Math.exp(t))+1/t)/2}const _t=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),b=(h*h-l*l+n*v)/(2*l*r*d),m=(h*h-l*l-n*v)/(2*h*r*d),g=Math.log(Math.sqrt(b*b+1)-b),w=Math.log(Math.sqrt(m*m+1)-m);a=(w-g)/e,i=function(t){var n,o=t*a,i=Ot(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/Ot(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,Et=0,Tt=0,At=0,Ct=1e3,Mt=0,Rt=0,zt=0,Lt="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=Lt.now()+zt)}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=Lt.now())+zt,Et=Tt=0;try{!function(){It(),++Et;for(var t,e=Pt;e;)(t=Rt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Et}()}finally{Et=0,function(){for(var t,e,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,Ut(n)}(),Rt=0}}function Wt(){var t=Lt.now(),e=t-Mt;e>Ct&&(zt-=e,Mt=t)}function Ut(t){Et||(Tt&&(Tt=clearTimeout(Tt)),t-Rt>24?(t<1/0&&(Tt=setTimeout(Gt,t-Lt.now()-zt)),At&&(At=clearInterval(At))):(At||(Mt=Lt.now(),At=setInterval(Wt,Ct)),Et=1,Ft(Gt)))}function $t(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,Ut()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ut())}};var Ht=wt("start","end","cancel","interrupt"),Yt=[],Vt=0,qt=2,Xt=3,Zt=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===Xt)return $t(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($t((function(){r.state===Xt&&(r.state=4,r.timer.restart(a,r.delay,r.time),a(c))})),r.state=qt,r.on.call("start",t,t.__data__,r.index,r.group),r.state===qt){for(r.state=Xt,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=Zt,1),i=-1,a=n.length;++i<a;)n[i].call(t,o);r.state===Zt&&(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:Ht,tween:Yt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Vt})}function Qt(t,e){var r=ee(t,e);if(r.state>Vt)throw new Error("too late; already scheduled");return r}function te(t,e){var r=ee(t,e);if(r.state>Xt)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>qt&&r.state<Zt,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 be=.7,me=1/be,ge="\\s*([+-]?\\d+)\\s*",we="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",xe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Se=/^#([0-9a-f]{3,8})$/,Oe=new RegExp(`^rgb\\(${ge},${ge},${ge}\\)$`),_e=new RegExp(`^rgb\\(${xe},${xe},${xe}\\)$`),je=new RegExp(`^rgba\\(${ge},${ge},${ge},${we}\\)$`),Pe=new RegExp(`^rgba\\(${xe},${xe},${xe},${we}\\)$`),ke=new RegExp(`^hsl\\(${we},${xe},${xe}\\)$`),Ee=new RegExp(`^hsla\\(${we},${xe},${xe},${we}\\)$`),Te={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 Ae(){return this.rgb().formatHex()}function Ce(){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?ze(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?ze(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=Oe.exec(t))?new Fe(e[1],e[2],e[3],1):(e=_e.exec(t))?new Fe(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=je.exec(t))?ze(e[1],e[2],e[3],e[4]):(e=Pe.exec(t))?ze(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=Ee.exec(t))?We(e[1],e[2]/100,e[3]/100,e[4]):Te.hasOwnProperty(t)?Re(Te[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 ze(t,e,r,n){return n<=0&&(t=e=r=NaN),new Fe(t,e,r,n)}function Le(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 $e(t,e,r,n)}function Ue(t){if(t instanceof $e)return new $e(t.h,t.s,t.l,t.opacity);if(t instanceof de||(t=Me(t)),!t)return new $e;if(t instanceof $e)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 $e(a,u,c,t.opacity)}function $e(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function He(t){return(t=(t||0)%360)<0?t+360:t}function Ye(t){return Math.max(0,Math.min(1,t||0))}function Ve(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 qe(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:Ae,formatHex:Ae,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ue(this).formatHsl()},formatRgb:Ce,toString:Ce}),pe(Fe,Le,ve(de,{brighter(t){return t=null==t?me:Math.pow(me,t),new Fe(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?be:Math.pow(be,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($e,(function(t,e,r,n){return 1===arguments.length?Ue(t):new $e(t,e,r,null==n?1:n)}),ve(de,{brighter(t){return t=null==t?me:Math.pow(me,t),new $e(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?be:Math.pow(be,t),new $e(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(Ve(t>=240?t-240:t+120,o,n),Ve(t,o,n),Ve(t<120?t+240:t-120,o,n),this.opacity)},clamp(){return new $e(He(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("}${He(this.h)}, ${100*Ye(this.s)}%, ${100*Ye(this.l)}%${1===t?")":`, ${t})`}`}}));const Xe=t=>()=>t;function Ze(t,e){var r=e-t;return r?function(t,e){return function(r){return t+r*e}}(t,r):Xe(isNaN(t)?e:t)}const Je=function t(e){var r=function(t){return 1==(t=+t)?Ze: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):Xe(isNaN(e)?r:e)}}(e);function n(t,e){var n=r((t=Le(t)).r,(e=Le(e)).r),o=r(t.g,e.g),i=r(t.b,e.b),a=Ze(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=Le(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 qe((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 qe((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 br=0;function mr(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function gr(){return++br}var wr=yt.prototype;mr.prototype=function(t){return yt().transition(t)}.prototype={constructor:mr,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 mr(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,b=p.length;d<b;++d)(y=p[d])&&Kt(y,e,r,d,p,v);a.push(p),u.push(l)}return new mr(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 mr(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 mr(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 mr(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 mr?(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 mr(n,this._parents,t,e)};const Or=t=>()=>t;function _r(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 Er(t){t.preventDefault(),t.stopImmediatePropagation()}function Tr(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Ar(){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 Cr(){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 zr(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 Lr(t){return Lr="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},Lr(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"!==Lr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Lr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Lr(o)?o:String(o)),n)}var o}jr.prototype;var Nr=function(){function t(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=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.opts=a||{},this.canvas=e,this.w=this.canvas.offsetWidth,this.h=this.canvas.offsetHeight,this.canvas.width=this.w,this.canvas.height=this.h;var u=this.canvas.getContext("2d");if(!u)throw"Impossible to create canvas 2D context";if(this.ctx=u,this.view={x:n,y:o,z:i},this.backgroundColor=a.backgroundColor||"white",this.onZoomStartFun=a.onZoomStartFun,this.onZoomEndFun=a.onZoomEndFun,this.onZoomFun=a.onZoomFun,this.extGeo={xMin:NaN,xMax:NaN,yMin:NaN,yMax:NaN},this.updateExtentGeo(),!a.disableZoom){var c=Pr;(function(){var t,e,r,n=Tr,o=Ar,i=zr,a=Mr,u=Rr,c=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,f=_t,h=wt("start","zoom","end"),y=500,p=150,v=0,d=10;function b(t){t.property("__zoom",Cr).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",P).filter(u).on("touchstart.zoom",k).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",T).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(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 O(t,e)}function O(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=o.apply(t,e),this.taps=0}function _(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()}Er(t),r.wheel=setTimeout((function(){r.wheel=null,r.end()}),p),r.zoom("mouse",i(g(m(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(Er(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),Er(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(m(r,c),a,u),o.apply(this,e),l);Er(t),s>0?pt(this).transition().duration(s).call(x,f,a,t):pt(this).call(b.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 E(t,...e){if(this.__zooming){var r,n,o,a,u=S(this,e).event(t),c=t.changedTouches,s=c.length;for(Er(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=m(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 T(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 b.transform=function(t,e,r,n){var o=t.selection?t.selection():t;o.property("__zoom",Cr),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()}))},b.scaleBy=function(t,e,r,n){b.scaleTo(t,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),r,n)},b.scaleTo=function(t,e,r,n){b.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(m(n,c),a,u),t,l)}),r,n)},b.translateBy=function(t,e,r,n){b.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)},b.translateTo=function(t,e,r,n,a){b.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)},O.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 _r(t,{sourceEvent:this.sourceEvent,target:b,type:t,transform:this.that.__zoom,dispatch:h}),e)}},b.wheelDelta=function(t){return arguments.length?(a="function"==typeof t?t:Or(+t),b):a},b.filter=function(t){return arguments.length?(n="function"==typeof t?t:Or(!!t),b):n},b.touchable=function(t){return arguments.length?(u="function"==typeof t?t:Or(!!t),b):u},b.extent=function(t){return arguments.length?(o="function"==typeof t?t:Or([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),b):o},b.scaleExtent=function(t){return arguments.length?(c[0]=+t[0],c[1]=+t[1],b):[c[0],c[1]]},b.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],b):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},b.constrain=function(t){return arguments.length?(i=t,b):i},b.duration=function(t){return arguments.length?(s=+t,b):s},b.interpolate=function(t){return arguments.length?(f=t,b):f},b.on=function(){var t=h.on.apply(h,arguments);return t===h?b:t},b.clickDistance=function(t){return arguments.length?(v=(t=+t)*t,b):Math.sqrt(v)},b.tapDistance=function(t){return arguments.length?(d=+t,b):d},b})().wheelDelta((function(t){return-t.deltaY*(1===t.deltaMode?.07:t.deltaMode?1:.004)})).on("zoom",(function(t){var e=t.transform,n=c.k/e.k;if(1==n){var o=c.x-e.x,i=c.y-e.y;r.pan(o*r.view.z,-i*r.view.z)}else{var a=t.sourceEvent;if(a instanceof WheelEvent)r.zoom(n,r.pixToGeoX(t.sourceEvent.offsetX),r.pixToGeoY(t.sourceEvent.offsetY));else if(a instanceof TouchEvent){var u,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();!(u=f.n()).done;){var h=u.value;l+=h.clientX,s+=h.clientY}}catch(t){f.e(t)}finally{f.f()}l/=a.targetTouches.length,s/=a.targetTouches.length,r.zoom(n,r.pixToGeoX(l),r.pixToGeoY(s))}}c=e,r.onZoomFun&&r.onZoomFun(t)})).on("start",(function(t){var e;r.canvasSave.c=document.createElement("canvas"),r.canvasSave.c.setAttribute("width",""+r.w),r.canvasSave.c.setAttribute("height",""+r.h),null===(e=r.canvasSave.c.getContext("2d"))||void 0===e||e.drawImage(r.canvas,0,0),r.canvasSave.dx=0,r.canvasSave.dy=0,r.canvasSave.f=1,r.onZoomStartFun&&r.onZoomStartFun(t)})).on("end",(function(t){r.redraw(),r.canvasSave={c:null,dx:0,dy:0,f:1},r.onZoomEndFun&&r.onZoomEndFun(t)}))(pt(this.canvas))}this.zoomExtent=a.zoomExtent||[0,1/0],this.canvasSave={c:null,dx:0,dy:0,f:1}}var e,r,n;return e=t,r=[{key:"getView",value:function(){return this.view}},{key:"setZoomExtent",value:function(t){this.zoomExtent=t}},{key:"getZoomExtent",value:function(){return this.zoomExtent}},{key:"initCanvasTransform",value:function(){this.ctx.setTransform(1,0,0,1,0,0)}},{key:"setCanvasTransform",value:function(){var t=1/this.view.z,e=-this.view.x/this.view.z+.5*this.w,r=this.view.y/this.view.z+.5*this.h;this.ctx.setTransform(t,0,0,-t,e,r)}},{key:"getWebGLTransform",value:function(){var t=2/(this.w*this.view.z),e=2/(this.h*this.view.z);return[t,0,0,0,e,0,-t*this.view.x,-e*this.view.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.view.x+=t,this.view.y+=e,this.updateExtentGeo(),this.canvasSave.c&&(this.canvasSave.dx-=t/this.view.z,this.canvasSave.dy+=e/this.view.z,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.view.x,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.view.y;if(!(this.zoomExtent[0]==this.view.z&&t<=1||this.zoomExtent[1]==this.view.z&&t>=1)){var n=t*this.view.z;n<this.zoomExtent[0]&&(t=this.zoomExtent[0]/this.view.z),n>this.zoomExtent[1]&&(t=this.zoomExtent[1]/this.view.z),this.view.z*=t;var o=(e-this.view.x)*(1-t);this.view.x+=o;var i=(r-this.view.y)*(1-t);this.view.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.view.x)/this.view.z+.5*this.w}},{key:"geoToPixY",value:function(t){return-(t-this.view.y)/this.view.z+.5*this.h}},{key:"pixToGeoX",value:function(t){return(t-.5*this.w)*this.view.z+this.view.x}},{key:"pixToGeoY",value:function(t){return-(t-.5*this.h)*this.view.z+this.view.y}},{key:"setViewFromURL",value:function(){var e=t.getParameterByName("x"),r=t.getParameterByName("y"),n=t.getParameterByName("z");null==e||null==e||isNaN(+e)||(this.view.x=+e),null==r||null==r||isNaN(+r)||(this.view.y=+r),null==n||null==n||isNaN(+n)||(this.view.z=+n)}}],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,Gr(n.key),n)}}function Gr(t){var e=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)}(t);return"symbol"===Br(e)?e:String(e)}var Wr=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,o=e.height;if(r.offsetLeft>e.left+n-r.clientWidth){var i=t.x-r.clientWidth-this.xOffset;if(r.style.left=i+"px",r.offsetLeft+r.clientWidth>t.x){var a=t.x-r.clientWidth-this.xOffset;r.style.left=a+"px"}}r.offsetTop+r.clientHeight>e.top+o&&(r.style.top=r.offsetTop-r.clientHeight+"px"),r.offsetTop<e.top&&(r.style.top=e.top+this.yOffset+"px")},(n=Gr(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"]||"0px",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("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.style("text-wrap","nowrap"),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(),r=t.pageX+this.xOffset,n=t.pageY-this.yOffset;this.tooltip.style("left",r+"px").style("top",n+"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&&Dr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ur(t){return Ur="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},Ur(t)}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"!==Ur(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ur(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ur(o)?o:String(o)),n)}var o}var Hr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.map=e.map,this.parentNode=e.parentNode||e.map.container,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)),e.title&&this.div.attr("title",e.title),e.class&&this.div.attr("class",e.class),e.onClickFunction&&this.div.on("click",e.onClickFunction),this.style("box-shadow","0 7px 8px rgba(0,47,103,.08), 0 0 22px rgba(0,47,103,.04), 0 12px 17px rgba(0,47,103,.04), 0 -4px 4px rgba(0,47,103,.04)"),this.style("background-color","#ffffff"),this.style("position","absolute"),this.style("cursor","pointer"),this.style("display","flex"),this.style("justify-content","center"),this.style("align-items","center"),this.style("width","30px"),this.style("height","30px"),this.parentNode.appendChild(this.div.node())}var e,r;return e=t,(r=[{key:"style",value:function(t,e){return this.div.style(t,e),this}}])&&$r(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Yr(t){return Yr="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},Yr(t)}function Vr(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"!==Yr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Yr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Yr(o)?o:String(o)),n)}var o}function qr(t,e){return qr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qr(t,e)}function Xr(t){return Xr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xr(t)}var Zr=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&&qr(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=Xr(n);if(o){var r=Xr(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Yr(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)).onZoom=t.onZoom,e.delta=t.delta||.2,e.zoomInBtn=document.createElement("a"),e.zoomInBtn.innerHTML='<a id="zoomin" class="gridviz-zoom-button" title="Zoom in">+</a>',e.zoomInBtn.title="Zoom in",e.zoomInBtn.addEventListener("click",(function(t){e.zoomIn(t)})),e.zoomInBtn.addEventListener("mouseover",(function(t){e.zoomInBtn.style.backgroundColor="lightgrey"})),e.zoomInBtn.addEventListener("mouseout",(function(t){e.zoomInBtn.style.backgroundColor="#ffffff"})),e.zoomOutBtn=document.createElement("a"),e.zoomOutBtn.innerHTML='<a id="zoomin" class="gridviz-zoom-button" title="Zoom out">-</a>',e.zoomOutBtn.title="Zoom out",e.zoomOutBtn.addEventListener("click",(function(t){e.zoomOut(t)})),e.zoomOutBtn.addEventListener("mouseover",(function(t){e.zoomOutBtn.style.backgroundColor="lightgrey"})),e.zoomOutBtn.addEventListener("mouseout",(function(t){e.zoomOutBtn.style.backgroundColor="#ffffff"})),[e.zoomInBtn,e.zoomOutBtn].forEach((function(t,e){t.style.alignItems="center",t.style.justifyContent="center",t.style.display="flex",t.style.border="none",t.style.color="black",t.style.textAlign="center",t.style.textDecoration="none",t.style.padding="4px",t.style.fontSize="20px",t.style.fontWeight="bold",t.style.userSelect="none",0==e&&(t.style.borderBottom="1px solid grey")})),e.style("height","unset"),e.style("display","unset"),t.x?e.style("left",t.x+"px"):e.style("right","10px"),t.y?e.style("top",t.y+"px"):e.style("top","10px"),e.div.node().appendChild(e.zoomInBtn),e.div.node().appendChild(e.zoomOutBtn),e}return e=a,(r=[{key:"zoomIn",value:function(t){this.map.setZoom(this.map.getZoom()*(1-this.delta)).redraw(),this.onZoom&&this.onZoom(t)}},{key:"zoomOut",value:function(t){this.map.setZoom(this.map.getZoom()*(1+this.delta)).redraw(),this.onZoom&&this.onZoom(t)}}])&&Vr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Hr);function Jr(t){return Jr="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},Jr(t)}function Kr(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,rn(n.key),n)}}function Qr(t,e){return Qr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qr(t,e)}function tn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function en(t){return en=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},en(t)}function rn(t){var e=function(t,e){if("object"!==Jr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Jr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Jr(e)?e:String(e)}var nn=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&&Qr(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=en(n);if(o){var r=en(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Jr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return tn(t)}(this,t)});function a(t){var e,r,n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),r=tn(e=i.call(this,t)),!1,(n=rn(n="isFullscreen"))in r?Object.defineProperty(r,n,{value:false,enumerable:!0,configurable:!0,writable:!0}):r[n]=false,e.div.node().innerHTML='\n <svg\n style="height: 1.2rem; width: 1.2rem; fill:black; margin:0;"\n focusable="false"\n aria-hidden="true"\n >\n <svg fill="#000000" viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg">\n <title/>\n <g>\n <path d="M30,0H6A5.9966,5.9966,0,0,0,0,6V30a6,6,0,0,0,12,0V12H30A6,6,0,0,0,30,0Z"/>\n <path d="M90,0H66a6,6,0,0,0,0,12H84V30a6,6,0,0,0,12,0V6A5.9966,5.9966,0,0,0,90,0Z"/>\n <path d="M30,84H12V66A6,6,0,0,0,0,66V90a5.9966,5.9966,0,0,0,6,6H30a6,6,0,0,0,0-12Z"/>\n <path d="M90,60a5.9966,5.9966,0,0,0-6,6V84H66a6,6,0,0,0,0,12H90a5.9966,5.9966,0,0,0,6-6V66A5.9966,5.9966,0,0,0,90,60Z"/>\n </g>\n </svg>\n </svg>\n ',e.defaultHeight=e.map.h,e.defaultWidth=e.map.w,e.div.on("click",(function(t){e.onClickFunction(t)})),e.div.on("mouseover",(function(t){e.style("background-color","lightgrey")})),e.div.on("mouseout",(function(t){e.style("background-color","#ffffff")})),t.x?e.style("left",t.x+"px"):e.style("right","10px"),t.y?e.style("top",t.y+"px"):e.style("top","90px"),e}return e=a,(r=[{key:"onClickFunction",value:function(t){this.isFullscreen?(this.closeFullscreen(this.map.container),this.map.h=this.defaultHeight,this.map.w=this.defaultWidth,this.map.geoCanvas.h=this.defaultHeight,this.map.geoCanvas.w=this.defaultWidth,this.map.geoCanvas.canvas.setAttribute("width",""+this.defaultWidth),this.map.geoCanvas.canvas.setAttribute("height",""+this.defaultHeight),this.map.redraw(),this.isFullscreen=!1):(this.openFullscreen(this.map.container),this.map.h=window.screen.height,this.map.w=window.screen.width,this.isFullscreen=!0)}},{key:"openFullscreen",value:function(t){t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen()}},{key:"closeFullscreen",value:function(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()}}])&&Kr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Hr);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 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 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"!==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}var cn=function(){function t(e,r){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=r||{},this.layers=r.layers||[],this.container=e||document.getElementById("gridviz"),this.container?(this.container.style.position="relative",this.w=r.w||this.container.offsetWidth,this.h=r.h||this.container.offsetHeight,this._canvas=r.canvas||this.initialiseCanvas(),this.geoCanvas=new Nr(this._canvas,r.x,r.y,r.z,r),this.geoCanvas.redraw=function(){n.redraw()},this.legendDivId=r.legendDivId||"gvizLegend",this.legend=pt("#"+this.legendDivId),this.legend.empty()&&this.initialiseLegend(),r.tooltip||(r.tooltip={}),r.tooltip.parentElement||(r.tooltip.parentElement=this.container),this.tooltip=new Wr(r.tooltip),this.mouseOverHandler=function(t){return n.focusCell(t)},this.mouseMoveHandler=function(t){return n.focusCell(t)},this.mouseOutHandler=function(t){return n.tooltip.hide()},this.geoCanvas.canvas.addEventListener("mouseover",this.mouseOverHandler),this.geoCanvas.canvas.addEventListener("mousemove",this.mouseMoveHandler),this.geoCanvas.canvas.addEventListener("mouseout",this.mouseOutHandler),this.geoCanvas.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.transparentBackground=r.transparentBackground,this.defaultGlobalCompositeOperation=r.defaultGlobalCompositeOperation||this.geoCanvas.ctx.globalCompositeOperation):console.error("Cannot find gridviz container element.")}var e,r;return e=t,r=[{key:"initialiseCanvas",value:function(){var t=document.createElement("canvas");return t.setAttribute("width",""+this.w),t.setAttribute("height",""+this.h),this.container.appendChild(t),t}},{key:"initialiseLegend",value:function(){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","#FFFFFF").style("border","0px").style("box-shadow","3px 3px 3px grey, -3px -3px 3px #ddd").style("font-family","Helvetica, Arial, sans-serif").style("bottom","15px").style("right","15px")}},{key:"layers_",value:function(t){return 0===arguments.length?this.layers:(1===arguments.length?Array.isArray(t)?this.layers=t:this.layers=[t]:this.layers=arguments,this)}},{key:"redraw",value:function(){this.legend&&this.legend.selectAll("*").remove(),this.geoCanvas.initCanvasTransform(),this.geoCanvas.clear(this.geoCanvas.backgroundColor);var t=this.geoCanvas.view.z;this.updateExtentGeo();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 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.layers);try{for(r.s();!(e=r.n()).done;){var n=e.value;n.visible&&!n.visible(t)||(this.geoCanvas.ctx.globalAlpha=n.alpha?n.alpha(t):1,this.geoCanvas.ctx.globalCompositeOperation=n.blendOperation(t),this.geoCanvas.setCanvasTransform(),n.draw(this.geoCanvas,this.legend),n.filterColor&&n.drawFilter(this.geoCanvas),this.geoCanvas.ctx.globalAlpha=1,this.geoCanvas.ctx.globalCompositeOperation=this.defaultGlobalCompositeOperation)}}catch(t){r.e(t)}finally{r.f()}return this.canvasSave=null,this.defineResizeObserver(this.container,this._canvas),this}},{key:"updateExtentGeo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return this.geoCanvas.updateExtentGeo(t)}},{key:"focusCell",value:function(t){var e,r={x:this.geoCanvas.pixToGeoX(t.offsetX+this.tooltip.xMouseOffset),y:this.geoCanvas.pixToGeoY(t.offsetY+this.tooltip.yMouseOffset)},n=this.getCellFocusInfo(r);if(this.transparentBackground)return n?(this.tooltip.html(n.html),this.tooltip.setPosition(t),this.tooltip.show()):this.tooltip.hide(),this.canvasSave=document.createElement("canvas"),this.canvasSave.setAttribute("width",""+this.w),this.canvasSave.setAttribute("height",""+this.h),null===(e=this.canvasSave.getContext("2d"))||void 0===e||e.drawImage(this.geoCanvas.canvas,0,0),void this.geoCanvas.initCanvasTransform();if(n){var o;this.tooltip.html(n.html),this.tooltip.setPosition(t),this.tooltip.show(),this.canvasSave?this.geoCanvas.ctx.drawImage(this.canvasSave,0,0):(this.canvasSave=document.createElement("canvas"),this.canvasSave.setAttribute("width",""+this.w),this.canvasSave.setAttribute("height",""+this.h),null===(o=this.canvasSave.getContext("2d"))||void 0===o||o.drawImage(this.geoCanvas.canvas,0,0));var i=this.selectionRectangleWidthPix?this.selectionRectangleWidthPix(n.resolution,this.geoCanvas.view.z):4;this.geoCanvas.initCanvasTransform(),this.geoCanvas.ctx.strokeStyle=this.selectionRectangleColor,this.geoCanvas.ctx.lineWidth=i,this.geoCanvas.ctx.beginPath(),this.geoCanvas.ctx.rect(this.geoCanvas.geoToPixX(n.cell.x)-i/2,this.geoCanvas.geoToPixY(n.cell.y)+i/2,n.resolution/this.geoCanvas.view.z+i,-n.resolution/this.geoCanvas.view.z-i),this.geoCanvas.ctx.stroke()}else this.tooltip.hide(),this.canvasSave&&this.geoCanvas.ctx.drawImage(this.canvasSave,0,0)}},{key:"getCellFocusInfo",value:function(t){for(var e=this.geoCanvas.view.z,r=this.layers.length-1;r>=0;r--){var n=this.layers[r];if((!n.visible||n.visible(e))&&n.cellInfoHTML&&n.getDataset){var o=n.getDataset(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:"setView",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.geoCanvas.view.x=t,this.geoCanvas.view.y=e,null!=r&&(this.geoCanvas.view.z=r),this}},{key:"getView",value:function(){return this.geoCanvas.view}},{key:"getZoom",value:function(){return this.geoCanvas.view.z}},{key:"setZoom",value:function(t){return this.geoCanvas.view.z=t,this}},{key:"getZoomExtent",value:function(){return this.geoCanvas.getZoomExtent()}},{key:"setZoomExtent",value:function(t){return this.geoCanvas.setZoomExtent(t),this}},{key:"getBackgroundColor",value:function(){return this.geoCanvas.backgroundColor}},{key:"setBackgroundColor",value:function(t){return this.geoCanvas.backgroundColor=t,this}},{key:"addZoomButtons",value:function(t){return this.zoomButtons=new Zr({map:this,id:(null==t?void 0:t.id)||"gridviz-zoom-buttons",class:null==t?void 0:t.class,x:null==t?void 0:t.x,y:null==t?void 0:t.y,onZoom:null==t?void 0:t.onZoom,delta:(null==t?void 0:t.delta)||.2}),this}},{key:"addFullscreenButton",value:function(t){return this.fullscreenButton=new nn({map:this,id:(null==t?void 0:t.id)||"gridviz-fullscreen-button",class:null==t?void 0:t.class,x:null==t?void 0:t.x,y:null==t?void 0:t.y}),this}},{key:"setViewFromURL",value:function(){return this.geoCanvas.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.geoCanvas.h=t.clientHeight,r.geoCanvas.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.geoCanvas.canvas.remove(),null===(t=this.legend)||void 0===t||t.remove(),null===(e=this.tooltip.tooltip)||void 0===e||e.remove()}}],r&&un(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ln(t){return ln="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},ln(t)}function sn(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"!==ln(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ln(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ln(o)?o:String(o)),n)}var o}var fn=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.visible=e.visible,this.alpha=e.alpha,this.blendOperation=e.blendOperation||function(t){return"source-over"},this.filterColor=e.filterColor}var e,r;return e=t,(r=[{key:"drawFilter",value:function(t){if(this.filterColor){var e=this.filterColor(t.view.z);e&&"none"!=e&&(t.ctx.fillStyle=e,t.ctx.fillRect(0,0,t.w,t.h))}}}])&&sn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function hn(t){return hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hn(t)}function yn(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"!==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}function vn(t,e){return vn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vn(t,e)}function dn(t){return dn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},dn(t)}var bn=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&&vn(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=dn(n);if(o){var r=dn(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===hn(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.viewScale=t.viewScale,e.filter=t.filter||function(){return!0},e.offset=t.offset||function(t,e,r){return{dx:0,dy:0}},e.drawFun=t.drawFun,e.legends=[],e}return e=a,(r=[{key:"draw",value:function(t,e,r){if(!this.drawFun)throw new Error("Method draw not implemented.");this.drawFun(t,e,r)}},{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=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 yn(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)?yn(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.legends);try{for(r.s();!(e=r.n()).done;)e.value.update(t)}catch(t){r.e(t)}finally{r.f()}return this}}])&&pn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(fn);function mn(t){return mn="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},mn(t)}function gn(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"!==mn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==mn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===mn(o)?o:String(o)),n)}var o}function wn(t,e){return wn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wn(t,e)}function xn(t){return xn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xn(t)}var Sn=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&&wn(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=xn(n);if(o){var r=xn(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===mn(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(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return e=a,(r=[{key:"draw",value:function(t){throw new Error("Method draw not implemented.")}}])&&gn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(fn);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 _n(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 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"!==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}var Pn=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.resolutions=e,this.datasets="function"==typeof r?this.resolutions.map(r):r,this.datasets.length>1&&this.datasets.length!=this.resolutions.length)throw new Error("Uncompatible number of datasets and resolutions: "+this.datasets.length+" "+this.resolutions.length);n.preprocess&&this.setPrepocesses(n.preprocess)}var e,r;return e=t,(r=[{key:"getDataset",value:function(t,e){if(1==this.datasets.length)return this.datasets[0];for(var r=this.resolutions,n=0,o=r[n]/e;o<t&&n<r.length;)o=r[++n]/e;return n==r.length?this.datasets[r.length-1]:this.datasets[n]}},{key:"setPrepocesses",value:function(t){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 _n(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)?_n(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.datasets);try{for(r.s();!(e=r.n()).done;)e.value.preprocess=t}catch(t){r.e(t)}finally{r.f()}return this}}])&&jn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function kn(t){return kn="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},kn(t)}function En(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 Tn(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"!==kn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==kn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===kn(o)?o:String(o)),n)}var o}var An=function(){function t(e,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.map=e,this.url=r,this.resolution=n,this.preprocess=o.preprocess||void 0,this.cellsViewCache=[]}var e,r;return e=t,(r=[{key:"getData",value:function(){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=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 En(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)?En(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(o.s();!(r=o.n()).done;){var i=r.value;if(!(t.x<i.x||i.x+n<t.x||t.y<i.y||i.y+n<t.y))return i}}catch(t){o.e(t)}finally{o.f()}}},{key:"getResolution",value:function(){return this.resolution}},{key:"getViewCache",value:function(){return this.cellsViewCache}},{key:"getDataset",value:function(t,e){return this}}])&&Tn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Cn(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function Mn(t,e){return fetch(t,e).then(Cn)}var Rn={},zn={};function Ln(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function Fn(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 In(t,e){var r=t+"",n=r.length;return n<e?new Array(e-n+1).join(0)+r:r}function Nn(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 zn;if(l)return l=!1,Rn;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())!==zn;){for(var f=[];n!==Rn&&n!==zn;)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?"-"+In(-n,6):n>9999?"+"+In(n,6):In(n,4))+"-"+In(r.getUTCMonth()+1,2)+"-"+In(r.getUTCDate(),2)+(u?"T"+In(o,2)+":"+In(i,2)+":"+In(a,2)+"."+In(u,3)+"Z":a?"T"+In(o,2)+":"+In(i,2)+":"+In(a,2)+"Z":i||o?"T"+In(o,2)+":"+In(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=Ln(t);return function(n,o){return e(r(n),o,t)}}(t,e):Ln(t)}));return i.columns=o||[],i},parseRows:n,format:function(e,r){return null==r&&(r=Fn(e)),[r.map(a).join(t)].concat(o(e,r)).join("\n")},formatBody:function(t,e){return null==e&&(e=Fn(t)),o(t,e).join("\n")},formatRows:function(t){return t.map(i).join("\n")},formatRow:i,formatValue:a}}var Bn=Nn(","),Dn=Bn.parse,Gn=(Bn.parseRows,Bn.format,Bn.formatBody,Bn.formatRows,Bn.formatRow,Bn.formatValue,Nn("\t")),Wn=Gn.parse;function Un(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function $n(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(Un)}(e,r).then((function(e){return t(e,n)}))}}Gn.parseRows,Gn.format,Gn.formatBody,Gn.formatRows,Gn.formatRow,Gn.formatValue;var Hn=$n(Dn);function Yn(t){return Yn="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},Yn(t)}function Vn(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 qn(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)?qn(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 qn(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 Xn(){Xn=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,b=d&&d(d(P([])));b&&b!==e&&r.call(b,i)&&(v=b);var m=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"==Yn(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 O(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 _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,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(m,"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(m),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(m),c(m,u,"Generator"),c(m,i,(function(){return this})),c(m,"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(_),!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),_(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;_(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),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function Jn(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 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"!==Yn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Yn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Yn(o)?o:String(o)),n)}var o}function Qn(t,e){return Qn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qn(t,e)}function to(t){return to=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},to(t)}$n(Wn);var eo=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&&Qn(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=to(n);if(o){var r=to(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Yn(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,0,n)).info=void 0,r.infoLoadingStatus="notLoaded",r.cache={},r.loadInfo(),r}return e=a,(r=[{key:"loadInfo",value:function(){var t=this;return this.info||"notLoaded"!==this.infoLoadingStatus?"loaded"!==this.infoLoadingStatus&&"failed"!==this.infoLoadingStatus||this.map.redraw():Jn(Xn().mark((function e(){var r;return Xn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Mn(t.url+"info.json");case 3:r=e.sent,t.info=r,t.resolution=r.resolutionGeo,t.infoLoadingStatus="loaded",t.map.redraw(),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),t.infoLoadingStatus="failed";case 13:case"end":return e.stop()}}),e,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()}},{key:"getData",value:function(t){var e=this;if(!this.info)return this;var r=this.getTilingEnvelope(t);if(!r)return this;for(var n=this.info.tilingBounds,o=function(t){for(var o=function(r){if(e.cache[t]||(e.cache[t]={}),e.cache[t][r])return"continue";e.cache[t][r]="loading",Jn(Xn().mark((function n(){var o,i,a,u,c,l,s,f,h,y,p,v,d;return Xn().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Hn(e.url+t+"/"+r+".csv");case 3:if(i=n.sent,!e.preprocess){n.next=27;break}o=[],a=Vn(i),n.prev=7,a.s();case 9:if((u=a.n()).done){n.next=17;break}if(c=u.value,0!=e.preprocess(c)){n.next=14;break}return n.abrupt("continue",15);case 14:o.push(c);case 15:n.next=9;break;case 17:n.next=22;break;case 19:n.prev=19,n.t0=n.catch(7),a.e(n.t0);case 22:return n.prev=22,a.f(),n.finish(22);case 25:n.next=28;break;case 27:o=i;case 28:n.next=34;break;case 30:return n.prev=30,n.t1=n.catch(0),e.cache[t][r]="failed",n.abrupt("return");case 34:if(e.info){n.next=37;break}return console.error("Tile info inknown"),n.abrupt("return");case 37:l=ro(o,t,r,e.info),e.cache[t][r]=l,e.map.redraw(),s=!1,f=e.map.getZoom(),h=Vn(e.map.layers),n.prev=43,h.s();case 45:if((y=h.n()).done){n.next=57;break}if(!(p=y.value).visible||p.visible(f)){n.next=49;break}return n.abrupt("continue",55);case 49:if(p.getDataset){n.next=51;break}return n.abrupt("continue",55);case 51:if(p.getDataset(f)==e){n.next=53;break}return n.abrupt("continue",55);case 53:return s=!0,n.abrupt("break",57);case 55:n.next=45;break;case 57:n.next=62;break;case 59:n.prev=59,n.t2=n.catch(43),h.e(n.t2);case 62:return n.prev=62,h.f(),n.finish(62);case 65:if(s){n.next=67;break}return n.abrupt("return");case 67:if(v=e.map.updateExtentGeo(),d=l.extGeo,!(v.xMax<=d.xMin)){n.next=71;break}return n.abrupt("return");case 71:if(!(v.xMin>=d.xMax)){n.next=73;break}return n.abrupt("return");case 73:if(!(v.yMax<=d.yMin)){n.next=75;break}return n.abrupt("return");case 75:if(!(v.yMin>=d.yMax)){n.next=77;break}return n.abrupt("return");case 77:e.map.redraw();case 78:case"end":return n.stop()}}),n,null,[[0,30],[7,19,22,25],[43,59,62,65]])})))()},i=Math.max(r.yMin,n.yMin);i<=Math.min(r.yMax,n.yMax);i++)o(i)},i=Math.max(r.xMin,n.xMin);i<=Math.min(r.xMax,n.xMax);i++)o(i);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=Vn(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()}}}}}}])&&Kn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(An);function ro(t,e,r,n){var o={};o.cells=t,o.x=e,o.y=r;var i=n.resolutionGeo,a=n.tileSizeCell;o.extGeo={xMin:n.originPoint.x+i*a*o.x,xMax:n.originPoint.x+i*a*(o.x+1),yMin:n.originPoint.y+i*a*o.y,yMax:n.originPoint.y+i*a*(o.y+1)};var u,c=Vn(o.cells);try{for(c.s();!(u=c.n()).done;){var l=u.value;l.x=o.extGeo.xMin+l.x*i,l.y=o.extGeo.yMin+l.y*i}}catch(t){c.e(t)}finally{c.f()}return o}function no(t){return no="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},no(t)}function oo(){oo=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,b=d&&d(d(P([])));b&&b!==e&&r.call(b,i)&&(v=b);var m=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"==no(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 O(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 _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,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(m,"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(m),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(m),c(m,u,"Generator"),c(m,i,(function(){return this})),c(m,"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(_),!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),_(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;_(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 io(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 ao(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)?ao(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 ao(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 uo(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 co(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"!==no(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==no(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===no(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 so(t){return so=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},so(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=so(n);if(o){var r=so(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===no(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,r){var n,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=i.call(this,t,e,r,o)).cells=[],n.infoLoadingStatus="notLoaded",n.getData(void 0),n}return e=a,r=[{key:"getData",value:function(t){var e,r=this;return"notLoaded"!=this.infoLoadingStatus||(this.infoLoadingStatus="loading",(e=oo().mark((function t(){var e,n,o,i,a,u,c;return oo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Hn(r.url);case 3:e=t.sent,n=io(e);try{for(n.s();!(o=n.n()).done;)(i=o.value).x=+i.x,i.y=+i.y}catch(t){n.e(t)}finally{n.f()}if(!r.preprocess){t.next=29;break}r.cells=[],a=io(e),t.prev=9,a.s();case 11:if((u=a.n()).done){t.next=19;break}if(c=u.value,0!=r.preprocess(c)){t.next=16;break}return t.abrupt("continue",17);case 16:r.cells.push(c);case 17:t.next=11;break;case 19:t.next=24;break;case 21:t.prev=21,t.t0=t.catch(9),a.e(t.t0);case 24:return t.prev=24,a.f(),t.finish(24);case 27:t.next=30;break;case 29:r.cells=e;case 30:r.map&&r.map.redraw(),r.infoLoadingStatus="loaded",t.next=38;break;case 34:t.prev=34,t.t1=t.catch(0),r.infoLoadingStatus="failed",r.cells=[];case 38:case"end":return t.stop()}}),t,null,[[0,34],[9,21,24,27]])})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){uo(i,n,o,a,u,"next",t)}function u(t){uo(i,n,o,a,u,"throw",t)}a(void 0)}))})()),this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,r=io(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&&co(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(An);function ho(t){return ho="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},ho(t)}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 po(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"!==ho(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ho(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ho(o)?o:String(o)),n)}var o}function vo(t,e){return vo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vo(t,e)}function bo(t){return bo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bo(t)}var mo=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&&vo(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=bo(n);if(o){var r=bo(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ho(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,void 0,"",t)).cells=e||[],r}return e=a,(r=[{key:"getData",value:function(t){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 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}}(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()}}}}])&&po(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(An);function go(t){return go="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},go(t)}function wo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function xo(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"!==go(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==go(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===go(o)?o:String(o)),n)}var o}function So(t,e){return So=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},So(t,e)}function Oo(t){return Oo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Oo(t)}var _o=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&So(t,e)}(a,t);var e,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=Oo(n);if(o){var r=Oo(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===go(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.color=t.color||function(){return"#EA6BAC"},e.size=t.size||function(t,e){return e},e.shape=t.shape||function(){return"square"},e}return e=a,r=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n,o=e.view.z,i=this.viewScale?this.viewScale(t,r,o):void 0,a=.5*r,u=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 wo(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)?wo(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(u.s();!(n=u.n()).done;){var c=n.value,l=this.color?this.color(c,r,o,i):"black";if(l&&"none"!==l){var s=this.size?this.size(c,r,o,i):r;if(s){var f=this.shape?this.shape(c,r,o,i):"square";if("none"!==f){var h=this.offset(c,r,o);if(e.ctx.fillStyle=l,"square"===f){var y=r*(1-s/r)*.5;e.ctx.fillRect(c.x+y+h.dx,c.y+y+h.dy,s,s)}else if("circle"===f)e.ctx.beginPath(),e.ctx.arc(c.x+a+h.dx,c.y+a+h.dy,.5*s,0,2*Math.PI,!1),e.ctx.fill();else if("donut"===f){var p=c.x+a+h.dx,v=c.y+a+h.dy;e.ctx.beginPath(),e.ctx.moveTo(p,v),e.ctx.arc(p,v,a,0,2*Math.PI),e.ctx.arc(p,v,(1-s/r)*a,0,2*Math.PI,!0),e.ctx.closePath(),e.ctx.fill()}else{if("diamond"!==f)throw new Error("Unexpected shape:"+f);var d=.5*s;e.ctx.beginPath(),e.ctx.moveTo(c.x+a-d,c.y+a),e.ctx.lineTo(c.x+a,c.y+a+d),e.ctx.lineTo(c.x+a+d,c.y+a),e.ctx.lineTo(c.x+a,c.y+a-d),e.ctx.fill()}}}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({viewScale:i,resolution:r,z:o,cells:t})}}],r&&xo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(bn);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 Eo(t,e){return Eo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Eo(t,e)}function To(t){return To=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},To(t)}var Ao=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Eo(t,e)}(a,t);var e,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=To(n);if(o){var r=To(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.strokeColor=t.strokeColor||function(){return"#666"},e.size=t.size||function(t,e){return e},e.strokeWidth=t.strokeWidth||function(t,e,r){return 1.5*r},e.shape=t.shape||function(){return"square"},e}return e=a,r=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n,o=e.view.z,i=this.viewScale?this.viewScale(t,r,o):void 0,a=.5*r,u=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(u.s();!(n=u.n()).done;){var c=n.value,l=this.strokeColor?this.strokeColor(c,r,o,i):void 0;if(l&&"none"!==l){e.ctx.strokeStyle=l;var s=this.size?this.size(c,r,o,i):r,f=this.strokeWidth?this.strokeWidth(c,r,o,i):1*o;if(f&&!(f<=0)){e.ctx.lineWidth=f;var h=this.shape?this.shape(c,r,o,i):"square";if("none"!==h){var y=this.offset(c,r,o);if("square"===h){var p=r*(1-s/r)*.5;e.ctx.beginPath(),e.ctx.rect(c.x+p+y.dx,c.y+p+y.dy,s,s),e.ctx.stroke()}else if("circle"===h)e.ctx.beginPath(),e.ctx.arc(c.x+a+y.dx,c.y+a+y.dy,.5*s,0,2*Math.PI,!1),e.ctx.stroke();else if("diamond"===h){var v=.5*s;e.ctx.beginPath(),e.ctx.moveTo(c.x+a-v,c.y+a),e.ctx.lineTo(c.x+a,c.y+a+v),e.ctx.lineTo(c.x+a+v,c.y+a),e.ctx.lineTo(c.x+a,c.y+a-v),e.ctx.lineTo(c.x+a-v,c.y+a),e.ctx.stroke()}else{if("donut"!==h)throw new Error("Unexpected shape:"+h);console.error("Not implemented")}}}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({style:this,resolution:r,z:o,viewScale:i})}}],r&&ko(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(bn);function Co(t){return Co="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},Co(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"!==Co(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Co(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Co(o)?o:String(o)),n)}var o}function zo(t,e){return zo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},zo(t,e)}function Lo(t){return Lo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Lo(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&&zo(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=Lo(n);if(o){var r=Lo(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Co(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.height=t.height||function(t,e){return e*Math.random()},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){this.filter&&(t=t.filter(this.filter));var n,o=e.view.z,i=this.viewScale?this.viewScale(t,r,o):void 0,a={},u=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(u.s();!(n=u.n()).done;){var c=n.value,l=a[c.y];l||(l={},a[c.y]=l),l[c.x]=this.height(c,r,o,i)}}catch(t){u.e(t)}finally{u.f()}var s=e.extGeo;if(s){var f=Math.floor(s.xMin/r)*r,h=Math.floor(s.xMax/r)*r,y=Math.floor(s.yMin/r)*r,p=Math.floor(s.yMax/r)*r,v={min:y,max:p};e.ctx.lineJoin="round";for(var d=p;d>=y;d-=r){var b=a[d];if(b){e.ctx.beginPath(),e.ctx.moveTo(f-r/2,d);for(var m=void 0,g=f;g<=h;g+=r){var w=b[g];w||(w=0),w||m?e.ctx.lineTo(g+r/2,d+w):e.ctx.moveTo(g+r/2,d),m=w}m&&e.ctx.lineTo(h+r/2,d);var x=this.fillColor(d,v,r,o);x&&"none"!=x&&(e.ctx.fillStyle=x,e.ctx.fill());var S=this.lineColor(d,v,r,o),O=this.lineWidth(d,v,r,o);S&&"none"!=S&&O>0&&(e.ctx.strokeStyle=S,e.ctx.lineWidth=O,e.ctx.stroke())}}}}}],r&&Ro(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(bn);function Io(t){return Io="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Io(t)}function No(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var 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)||Bo(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bo(t,e){if(t){if("string"==typeof t)return Do(t,e);var 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)?Do(t,e):void 0}}function Do(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 Go(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 Wo(t,e){return Wo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wo(t,e)}function Uo(t){return Uo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Uo(t)}var $o=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&&Wo(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=Uo(n);if(o){var r=Uo(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.color=t.color,e.type=t.type||function(){return"flag"},e.size=t.size||function(t,e){return e},e.stripesOrientation=t.stripesOrientation||function(){return 0},e.offsetAngle=t.offsetAngle||function(){return 0},e.agePyramidHeight=t.agePyramidHeight||function(t,e){return e},e.pieChartInternalRadiusFactor=t.pieChartInternalRadiusFactor||0,e}return e=a,r=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n,o=e.view.z,i=this.viewScale?this.viewScale(t,r,o):void 0,a=Object.entries(this.color).length,u=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Bo(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(u.s();!(n=u.n()).done;){var c=n.value,l=this.size?this.size(c,r,o,i):r;if(l){var s=this.offset(c,r,o),f=this.type?this.type(c,r,o,i):"flag",h=c.x+s.dx+("agepyramid"===f?0:.5*r),y=c.y+s.dy+("agepyramid"===f?0:.5*r),p=this.offsetAngle?this.offsetAngle(c,r,o,i)*Math.PI/180:0;if("agepyramid"===f||"radar"===f||"halftone"===f){for(var v=-1/0,d=0,b=Object.keys(this.color);d<b.length;d++){var m=+c[b[d]];m>v&&(v=m)}var g=0;"agepyramid"===f&&this.agePyramidHeight&&(g=(r-this.agePyramidHeight(c,r,o,i))/2),"radar"!==f&&"halftone"!==f||(g=Math.PI/2+p);var w="agepyramid"===f?(this.agePyramidHeight?this.agePyramidHeight(c,r,o,i):r)/a:"radar"===f||"halftone"===f?2*Math.PI/a:void 0;if(void 0===w)throw new Error("Unexpected symbol type:"+f);for(var x=0,S=Object.entries(this.color);x<S.length;x++){var O=No(S[x],2),_=O[0],j=O[1];if("agepyramid"===f){e.ctx.fillStyle=j;var P=l*c[_]/v;e.ctx.fillRect(h+(r-P)/2,y+g,P,w),g+=w}else if("radar"===f){e.ctx.fillStyle=j;var k=c[_],E=l/2*Math.sqrt(k/v);e.ctx.beginPath(),e.ctx.moveTo(h,y),e.ctx.arc(h,y,E,g-w,g),e.ctx.lineTo(h,y),e.ctx.fill(),g+=w}else{if("halftone"!==f)throw new Error("Unexpected symbol type:"+f);e.ctx.fillStyle=j;var T=c[_],A=.333*l*Math.sqrt(T/v);e.ctx.beginPath(),e.ctx.arc(h+.25*r*Math.cos(g),y+.25*r*Math.sin(g),A,0,2*Math.PI),e.ctx.fill(),g+=w}}}else{for(var C=0,M=0,R=Object.keys(this.color);M<R.length;M++){var z=+c[R[M]];z&&(C+=z)}if(!C||isNaN(C))continue;for(var L=0,F=r*(1-l/r)*.5,I=this.stripesOrientation(c,r,o,i),N=0,B=Object.entries(this.color);N<B.length;N++){var D=No(B[N],2),G=D[0],W=D[1],U=c[G]/C;if(U&&!isNaN(U)){if(e.ctx.fillStyle=W,"flag"===f)0==I?e.ctx.fillRect(c.x+F+s.dx,c.y+F+L*l+s.dy,l,U*l):e.ctx.fillRect(c.x+F+L*l+s.dx,c.y+F+s.dy,U*l,l);else if("piechart"===f){var $=2*L*Math.PI,H=2*(L+U)*Math.PI;e.ctx.beginPath(),e.ctx.moveTo(h,y),e.ctx.arc(h,y,.5*l,$+p,H+p),this.pieChartInternalRadiusFactor&&e.ctx.arc(h,y,.5*l*this.pieChartInternalRadiusFactor,$+p,H+p,!0),e.ctx.closePath(),e.ctx.fill()}else if("ring"===f)e.ctx.beginPath(),e.ctx.arc(h,y,Math.sqrt(1-L)*l*.5,0,2*Math.PI),e.ctx.fill();else{if("segment"!==f)throw new Error("Unexpected symbol type:"+f);var Y=l*l/r;0==I?e.ctx.fillRect(c.x+s.dx,c.y+(r-Y)/2+L*Y+s.dy,r,U*Y):e.ctx.fillRect(c.x+L*r+s.dx,c.y+(r-Y)/2+s.dy,U*r,Y)}L+=U}}}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({style:this,resolution:r,z:o,viewScale:i})}}],r&&Go(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(bn);function Ho(t){return Ho="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},Ho(t)}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 Vo(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"!==Ho(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ho(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ho(o)?o:String(o)),n)}var o}function qo(t,e){return qo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qo(t,e)}function Xo(t){return Xo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xo(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&&qo(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=Xo(n);if(o){var r=Xo(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ho(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||function(){return"#EA6BAC"},e.width=t.width||function(t,e){return.1*e},e.length=t.length||function(t,e){return.9*e},e.orientation=t.orientation||function(){return 180*Math.random()},e}return e=a,r=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=this.viewScale?this.viewScale(t,r,n):void 0;e.ctx.lineCap="butt";var i,a=Math.PI/180,u=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 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}}(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(u.s();!(i=u.n()).done;){var c=i.value,l=this.color?this.color(c,r,n,o):void 0;if(l){var s=this.width?this.width(c,r,n,o):void 0;if(s&&!(s<0)){var f=this.length?this.length(c,r,n,o):void 0;if(f&&!(f<0)){var h=this.orientation(c,r,n,o)*a;if(void 0!==h&&!isNaN(h)){var y=this.offset(c,r,n);e.ctx.strokeStyle=l,e.ctx.lineWidth=s;var p=c.x+r/2+y.dx,v=c.y+r/2+y.dy,d=.5*Math.cos(h)*f,b=.5*Math.sin(h)*f;e.ctx.beginPath(),e.ctx.moveTo(p-d,v-b),e.ctx.lineTo(p+d,v+b),e.ctx.stroke()}}}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({viewScale:o,resolution:r,z:n,cells:t})}}],r&&Vo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(bn);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)}(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=ei(o);if(i){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 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.text=t.text||function(){return"X"},e.color=t.color||function(){return"black"},e.fontSize=t.fontSize||function(t,e){return e},e.fontFamily=t.fontFamily||function(){return"Arial"},e.fontWeight=t.fontWeight||function(){return"bold"},e}return e=u,r=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=this.viewScale?this.viewScale(t,r,n):void 0;e.initCanvasTransform();var i,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 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(a.s();!(i=a.n()).done;){var u=i.value,c=this.text?this.text(u,r,n,o):void 0;if(null!=c&&null!=c&&c+""!=""){var l=this.color?this.color(u,r,n,o):void 0;if(l){e.ctx.fillStyle=l;var s=this.fontSize(u,r,n,o)/n;if(s){var f=this.fontFamily?this.fontFamily(u,r,n,o):"Arial",h=this.fontWeight?this.fontWeight(u,r,n,o):"bold";e.ctx.font=h+" "+s+"px "+f;var y=this.offset(u,r,n);e.ctx.textAlign="center";var p=e.geoToPixX(u.x+.5*r+y.dx),v=e.geoToPixY(u.y+.5*r+y.dy)+.3*s;e.ctx.fillText(c,p,v)}}}}}catch(t){a.e(t)}finally{a.f()}this.updateLegends({style:this,resolution:r,z:n,viewScale:o})}}],n=[{key:"textScale",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=t.length;return function(n){return e&&(n=e(n)),0==n?"":n>=1?t[r-1]:t[Math.floor(n*r)]}}}],r&&Qo(e.prototype,r),n&&Qo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(bn);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){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 ii(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)?ii(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 ii(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 ai(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 ui(t,e){return ui=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ui(t,e)}function ci(t){return ci=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ci(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&&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=ci(n);if(o){var r=ci(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 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.height=t.height,e.color=t.color||function(){return"#c08c59"},e.width=t.width||function(t,e){return.5*e},e.simple=t.simple||function(){return!1},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){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=this.viewScale?this.viewScale(t,r,n):void 0,i=e.view.x+this.viewSX*e.w*n,a=e.view.y+this.viewSY*e.h*n,u=this.viewHeightFactor*(e.w+e.h)*.5*n;t.sort((function(t,e){return 1e8*(e.y-t.y)+t.x-e.x}));var c=this.simple(r,n,o);e.ctx.lineCap=c?"butt":"round",e.ctx.strokeStyle=this.shadowColor,e.ctx.fillStyle=this.shadowColor;var l,s=oi(t);try{for(s.s();!(l=s.n()).done;){var f=l.value,h=this.width?this.width(f,r,n,o):void 0;if(h&&!(h<0)){var y=this.height?this.height(f,r,n,o):void 0;if(y&&!(y<0)){e.ctx.lineWidth=h;var p=f.x+r/2,v=f.y+r/2,d=y*this.shadowFactor;e.ctx.beginPath(),e.ctx.moveTo(p,v),e.ctx.lineTo(p+d*Math.cos(this.shadowDirection),v+d*Math.sin(this.shadowDirection)),e.ctx.stroke()}}}}catch(t){s.e(t)}finally{s.f()}var b,m=oi(t);try{for(m.s();!(b=m.n()).done;){var g=b.value,w=this.color?this.color(g,r,n,o):void 0;if(w){var x=this.width?this.width(g,r,n,o):void 0;if(x&&!(x<0)){var S=this.height?this.height(g,r,n,o):void 0;if(S&&!(S<0)){var O=g.x+r/2,_=g.y+r/2,j=O-i,P=_-a,k=Math.atan2(P,j),E=Math.sqrt(j*j+P*P)*S/(u-S);c?(e.ctx.strokeStyle=w,e.ctx.lineWidth=x,e.ctx.beginPath(),e.ctx.moveTo(O,_),e.ctx.lineTo(O+E*Math.cos(k),_+E*Math.sin(k)),e.ctx.stroke()):(e.ctx.strokeStyle=this.outlineCol,e.ctx.lineWidth=x+2*this.outlineWidthPix*n,e.ctx.beginPath(),e.ctx.moveTo(O,_),e.ctx.lineTo(O+E*Math.cos(k),_+E*Math.sin(k)),e.ctx.stroke(),e.ctx.strokeStyle=w,e.ctx.lineWidth=x,e.ctx.beginPath(),e.ctx.moveTo(O,_),e.ctx.lineTo(O+E*Math.cos(k),_+E*Math.sin(k)),e.ctx.stroke(),e.ctx.strokeStyle=this.outlineCol,e.ctx.lineWidth=this.outlineWidthPix*n,e.ctx.beginPath(),e.ctx.arc(O+E*Math.cos(k),_+E*Math.sin(k),.5*x,0,2*Math.PI,!1),e.ctx.stroke())}}}}}catch(t){m.e(t)}finally{m.f()}e.ctx.lineCap="butt",this.updateLegends({style:this,resolution:r,z:n,viewScale:o})}}],r&&ai(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(bn);function si(t){return si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},si(t)}function fi(t,e){(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"!==si(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==si(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===si(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)}(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=pi(o);if(i){var r=pi(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===si(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function u(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),(t=a.call(this,e)).color=e.color||function(t,e,r,n){return"#EA6BAC"},t.width=e.width||function(t,e,r,n){return e/5},t.length=e.length||function(t,e,r,n){return e},t}return e=u,r=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=u.buildSides(t,r);if(0!=o.length){var i=this.viewScale?this.viewScale(o,r,n):void 0;e.ctx.lineCap="butt";var a,c=.5*r,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 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}}}}(o);try{for(l.s();!(a=l.n()).done;){var s=a.value,f=this.color?this.color(s,r,n,i):void 0;if(f&&"none"!=f){var h=this.width?this.width(s,r,n,i):void 0;if(h&&!(h<=0)){var y=this.length?this.length(s,r,n,i):void 0;if(y&&!(y<=0)){var p=.5*y;e.ctx.strokeStyle=f,e.ctx.lineWidth=h,e.ctx.beginPath(),"v"===s.or?(e.ctx.moveTo(s.x,s.y+c-p),e.ctx.lineTo(s.x,s.y+c+p)):(e.ctx.moveTo(s.x+c-p,s.y),e.ctx.lineTo(s.x+c+p,s.y)),e.ctx.stroke()}}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,resolution:r,z:n,viewScale:i})}}}],n=[{key:"buildSides",value:function(t,e){var r=[],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4]?e/2:0;t.sort((function(t,e){return e.x==t.x?t.y-e.y:t.x-e.x}));for(var o=t[0],i=1;i<t.length;i++){var a=t[i];o.y+e==a.y&&o.x==a.x?r.push({or:"h",x:o.x+n,y:a.y,c1:o,c2:a}):(r.push({or:"h",x:o.x+n,y:o.y+e,c1:o,c2:void 0}),r.push({or:"h",x:a.x+n,y:a.y,c1:void 0,c2:a})),o=a}t.sort((function(t,e){return e.y==t.y?t.x-e.x:t.y-e.y})),o=t[0];for(var u=1;u<t.length;u++){var c=t[u];o.x+e==c.x&&o.y==c.y?r.push({or:"v",x:o.x+e,y:o.y+n,c1:o,c2:c}):(r.push({or:"v",x:o.x+e,y:o.y+n,c1:o,c2:void 0}),r.push({or:"v",x:c.x,y:c.y+n,c1:void 0,c2:c})),o=c}return r}}],r&&hi(e.prototype,r),n&&hi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(bn);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 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 mi(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 gi(t,e){return gi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},gi(t,e)}function wi(t){return wi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wi(t)}var xi=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&&gi(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=wi(n);if(o){var r=wi(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.code=t.code,e.color=t.color,e}return e=a,r=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=vi.buildSides(t,r);if(0!=o.length){var i=this.viewScale?this.viewScale(o,r,n):void 0;e.ctx.lineCap="butt";var a,u=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 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}}}}(o);try{for(u.s();!(a=u.n()).done;){var c=a.value,l=c.c1?this.code(c.c1,r,n):void 0,s=c.c2?this.code(c.c2,r,n):void 0;if(l!=s){var f=this.width?this.width(c,r,n,i):void 0;if(f&&!(f<=0)){var h=.5*f;e.ctx.lineWidth=f,"h"===c.or?(s&&(e.ctx.beginPath(),e.ctx.strokeStyle=this.color[s],e.ctx.moveTo(c.x,c.y+h),e.ctx.lineTo(c.x+r,c.y+h),e.ctx.stroke()),l&&(e.ctx.beginPath(),e.ctx.strokeStyle=this.color[l],e.ctx.moveTo(c.x,c.y-h),e.ctx.lineTo(c.x+r,c.y-h),e.ctx.stroke())):(s&&(e.ctx.beginPath(),e.ctx.strokeStyle=this.color[s],e.ctx.moveTo(c.x+h,c.y),e.ctx.lineTo(c.x+h,c.y+r),e.ctx.stroke()),l&&(e.ctx.beginPath(),e.ctx.strokeStyle=this.color[l],e.ctx.moveTo(c.x-h,c.y),e.ctx.lineTo(c.x-h,c.y+r),e.ctx.stroke()))}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({style:this,resolution:r,z:n,viewScale:i})}}}],r&&mi(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(vi);const Si=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 Oi(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},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 _i(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 ji(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 Pi(t){return Pi="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},Pi(t)}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"!==Pi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Pi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Pi(o)?o:String(o)),n)}var o}var Ei=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=_i(e,ji(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 "),ji(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)}}])&&ki(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ti(t){return Ti="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},Ti(t)}function Ai(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}}}}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 Mi(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"!==Ti(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ti(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ti(o)?o:String(o)),n)}var o}function Ri(t,e){return Ri=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ri(t,e)}function zi(t){return zi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zi(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&&Ri(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=zi(n);if(o){var r=zi(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ti(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.dotNumber=t.dotNumber||function(t,e){return e/100},e.color=t.color||function(){return"#FF5733"},e.dotSize=t.dotSize||function(t,e){return 1.5*e},e.sigma=t.sigma||function(t,e){return t/2},e}return e=a,r=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=this.viewScale?this.viewScale(t,r,n):void 0,i=this.dotSize?this.dotSize(r,n,o):n,a=this.sigma?this.sigma(r,n,o):.4*r,u=Si(0,a);if(function(){try{var t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(t){return!1}}()){var c=Oi(e.w+"",e.h+"");if(!c)return void console.error("No webGL");var l,s=new Ei(c.gl,i/n),f=r/2,h=Ai(t);try{for(h.s();!(l=h.n()).done;){var y=l.value,p=this.color(y,r,n,o);if(p&&"none"!==p){var v=this.dotNumber(y,r,n,o),d=this.offset(y,r,n),b=y.x+d.dx+f,m=y.y+d.dy+f,g=Me(p);if(!g)return;for(var w=0;w<=v;w++)s.addPointData2(b+u(),m+u(),g.r,g.g,g.b,g.opacity)}}}catch(t){h.e(t)}finally{h.f()}s.draw(e.getWebGLTransform()),e.initCanvasTransform(),e.ctx.drawImage(c.canvas,0,0)}else{var x,S=Ai(t);try{for(S.s();!(x=S.n()).done;){var O=x.value,_=this.color(O,r,n,o);if(_&&"none"!==_){e.ctx.fillStyle=_;for(var j=this.dotNumber(O,r,n,o),P=this.offset(O,r,n),k=O.x+P.dx+r/2,E=O.y+P.dy+r/2,T=0;T<=j;T++)e.ctx.fillRect(k+u(),E+u(),i,i)}}}catch(t){S.e(t)}finally{S.f()}}this.updateLegends({style:this,resolution:r,z:n,viewScale:o})}}],r&&Mi(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(bn);function Fi(t){return Fi="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},Fi(t)}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"!==Fi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Fi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Fi(o)?o:String(o)),n)}var o}var Ni=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=ji(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":"powInv"==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":"log"==n.fun?u+=0==n.alpha?"float t = vt;":" float t = 1.0 - (1.0 / alpha) * log(exp(alpha) * (1.0 - vt) + vt);\n":"circle"==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":"circleInv"==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=ji(e,e.FRAGMENT_SHADER,u);this.program=_i(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)}}])&&Ii(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Bi(t){return Bi="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},Bi(t)}function Di(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"!==Bi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Bi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Bi(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 Ui(t){return Ui=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ui(t)}var $i=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)}(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=Ui(n);if(o){var r=Ui(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Bi(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.tFun=t.tFun,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){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=this.viewScale?this.viewScale(t,r,n):void 0,i=Oi(e.w+"",e.h+"",null!=this.opacity?{premultipliedAlpha:!1}:void 0);if(i){var a,u=r/2,c=[],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 Di(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)?Di(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();!(a=s.n()).done;){var f=a.value,h=this.tFun(f,r,n,o);null!=h&&null!=h&&(c.push(f.x+u,f.y+u),l.push(h>1?1:h<0?0:h))}}catch(t){s.e(t)}finally{s.f()}var y=this.size?this.size(r,n):r+.2*n,p=this.opacity?this.opacity(r,n):void 0;new Ni(i.gl,this.colors,this.stretching,y/n,p).draw(c,l,e.getWebGLTransform()),e.initCanvasTransform(),e.ctx.drawImage(i.canvas,0,0),this.updateLegends({style:this,resolution:r,z:n,viewScale:o})}else console.error("No webGL")}}],r&&Gi(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(bn);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 Yi(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){!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=_i(t,ji(t,t.VERTEX_SHADER,this.vshString),ji(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&&Yi(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 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"!==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 Zi(t,e){return Zi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Zi(t,e)}function Ji(t){return Ji=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ji(t)}var Ki=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&&Zi(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=Ji(n);if(o){var r=Ji(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;!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.code=t.code,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,u=r;o<u.length;o++){var c=u[o];e.colors.push(t.color[""+c])}return e.size=t.size,e.wgp=new Vi(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=e.view.z,i=r/2,a=t.length,u=[],c=[],l=0;l<a;l++){var s=(n=t[l])[this.code];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=Oi(e.w+"",e.h+"");if(h){var y=this.size?this.size(r,o):r+.2*o;this.wgp.draw(h.gl,u,c,e.getWebGLTransform(),y/o),e.initCanvasTransform(),e.ctx.drawImage(h.canvas,0,0),this.updateLegends({style:this,resolution:r,z:o})}else console.error("No webGL")}}])&&Xi(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(bn);function Qi(t){return Qi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qi(t)}function ta(t,e){(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 ea(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 ra(t,e){return ra=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ra(t,e)}function na(t){return na=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},na(t)}var oa=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&&ra(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=na(n);if(o){var r=na(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.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){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=this.viewScale?this.viewScale(t,r,n):void 0;e.ctx.strokeStyle=this.shadowColor,e.ctx.lineWidth=this.shadowFactor*r,e.ctx.lineJoin="round",e.ctx.lineCap="butt";var i,a=r*this.mosaicFactor,u=function(){return{x:Math.random()*a,y:Math.random()*a}},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();!(i=c.n()).done;){var l=i.value,s=this.color?this.color(l,r,n,o):void 0;if(s&&"none"!==s){e.ctx.fillStyle=s;var f=this.offset(l,r,n),h=u(),y=u(),p=u(),v=u();this.shadowFactor>0&&(e.ctx.beginPath(),e.ctx.moveTo(l.x+f.dx+h.x,l.y+f.dy+h.y),e.ctx.lineTo(l.x+f.dx+r-p.x,l.y+f.dy+p.y),e.ctx.lineTo(l.x+f.dx+r-v.x,l.y+f.dy+r-v.y),e.ctx.stroke()),e.ctx.beginPath(),e.ctx.moveTo(l.x+f.dx+h.x,l.y+f.dy+h.y),e.ctx.lineTo(l.x+f.dx+r-p.x,l.y+f.dy+p.y),e.ctx.lineTo(l.x+f.dx+r-v.x,l.y+f.dy+r-v.y),e.ctx.lineTo(l.x+f.dx+y.x,l.y+f.dy+r-y.y),e.ctx.fill()}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,resolution:r,z:n,viewScale:o})}}],r&&ea(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(bn);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){(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 ua(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}function ca(t,e){return ca=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ca(t,e)}function la(t){return la=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},la(t)}var sa=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ca(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=la(n);if(o){var r=la(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ia(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||function(){return"#EA6BAC"},e.size=t.size||function(t,e){return e},e.shape=t.shape||function(){return"o"},e}return e=a,r=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n,o=e.view.z,i=this.viewScale?this.viewScale(t,r,o):void 0,a=.5*r,u=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 aa(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)?aa(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(u.s();!(n=u.n()).done;){var c=n.value,l=this.color?this.color(c,r,o,i):void 0;if(l&&"none"!==l){e.ctx.fillStyle=l;var s=this.size(c,r,o,i),f=(s=s<0?0:s>1?1:s)*a,h=this.shape?this.shape(c):"o";if("none"!==h){var y=c.x+a,p=c.y+a;if("p"===h)e.ctx.beginPath(),e.ctx.moveTo(y,p+a),e.ctx.lineTo(y+f,p+f),e.ctx.lineTo(y+a,p),e.ctx.lineTo(y+f,p-f),e.ctx.lineTo(y,p-a),e.ctx.lineTo(y-f,p-f),e.ctx.lineTo(y-a,p),e.ctx.lineTo(y-f,p+f),e.ctx.fill();else{if("o"!==h)throw new Error("Unexpected shape:"+h);e.ctx.beginPath(),e.ctx.moveTo(y,p+f),e.ctx.lineTo(y+a,p+a),e.ctx.lineTo(y+f,p),e.ctx.lineTo(y+a,p-a),e.ctx.lineTo(y,p-f),e.ctx.lineTo(y-a,p-a),e.ctx.lineTo(y-f,p),e.ctx.lineTo(y-a,p+a),e.ctx.fill()}}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({style:this,resolution:r,z:o,viewScale:i})}}],r&&ua(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(bn);function fa(t){return fa="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},fa(t)}function ha(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 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}}(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 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 pa(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"!==fa(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==fa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===fa(o)?o:String(o)),n)}var o}function va(t,e){return va=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},va(t,e)}function da(t){return da=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},da(t)}var ba=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&&va(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"===fa(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.lineWidth=t.lineWidth||function(t,e,r,n){return 1.5*n},e.color=t.color||function(){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=e.view.z,u=this.viewScale?this.viewScale(t,r,a):void 0,c=function(t){var e,r,o,i=ha(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},l=ha(t);try{for(l.s();!(i=l.n()).done;){var s=c(i.value);null!=s&&(null==o||s>o)&&(o=s)}}catch(t){l.e(t)}finally{l.f()}if(o){var f=this.ts.length;e.ctx.lineCap="butt";var h,y=ha(t);try{for(y.s();!(h=y.n()).done;){var p=h.value,v=this.lineWidth?this.lineWidth(p,r,a,u):void 0;if(v&&!(v<0)){var d=this.color?this.color(p,r,a,u):void 0;if(d){var b=this.offsetX?this.offsetX(p,r,a):0;if(null!=b&&!isNaN(b)){var m=this.width?this.width(p,r,a):r;if(null!=m&&!isNaN(m)){var g=this.offsetY?this.offsetY(p,r,a):0;if(null!=g&&!isNaN(g)){var w=this.height?this.height(p,r,a):r;if(null!=w&&!isNaN(w)){var x=this.anchorModeY?this.anchorModeY(p,r,a):"center";if(x){e.ctx.lineWidth=v,e.ctx.strokeStyle=d;var S=void 0,O=void 0;if("first"===x)S=p[this.ts[0]],O=0;else if("last"===x)S=p[this.ts[this.ts.length-1]],O=0;else if("bottom"===x){var _,j=ha(this.ts);try{for(j.s();!(_=j.n()).done;){var P=+p[_.value];null!=P&&(null==S||P<S)&&(S=P)}}catch(t){j.e(t)}finally{j.f()}O=0}else if("top"===x){var k,E=ha(this.ts);try{for(E.s();!(k=E.n()).done;){var T=+p[k.value];null!=T&&(null==S||T>S)&&(S=T)}}catch(t){E.e(t)}finally{E.f()}O=r}else{if("center"!==x){console.log("Unexpected anchorModeY: "+x);continue}var A,C=void 0,M=void 0,R=ha(this.ts);try{for(R.s();!(A=R.n()).done;){var z=p[A.value];null!=z&&((null==C||z<C)&&(C=z),(null==M||z>M)&&(M=z))}}catch(t){R.e(t)}finally{R.f()}S=.5*(+M+ +C),O=r/2}var L=m/(f-1),F=p[this.ts[0]];this.noData(F)||(e.ctx.beginPath(),e.ctx.moveTo(p.x+b,p.y+O+(F-S)*w/o+g));for(var I=void 0,N=1;N<f;N++)I=p[this.ts[N]],this.noData(F)&&this.noData(I)||(!this.noData(F)&&this.noData(I)?e.ctx.stroke():this.noData(F)&&!this.noData(I)?(e.ctx.beginPath(),e.ctx.moveTo(p.x+N*L+b,p.y+O+(I-S)*w/o+g)):(e.ctx.lineTo(p.x+N*L+b,p.y+O+(I-S)*w/o+g),N==f-1&&e.ctx.stroke())),F=I}}}}}}}}}catch(t){y.e(t)}finally{y.f()}this.updateLegends({style:this,resolution:r,z:a,viewScale:u})}}}],r&&pa(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(bn);function ma(t){return ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ma(t)}function ga(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=wa(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 wa(t,e){if(t){if("string"==typeof t)return xa(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)?xa(t,e):void 0}}function xa(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 Sa(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"!==ma(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ma(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ma(o)?o:String(o)),n)}var o}function Oa(t,e){return Oa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Oa(t,e)}function _a(t){return _a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_a(t)}var ja=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Oa(t,e)}(a,t);var e,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=_a(n);if(o){var r=_a(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ma(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.color=t.color,e.height=t.height||function(t,e,r,n){return.4*e},e.angle=null!=t.angle?t.angle:50,e.cornerLineStrokeColor=t.cornerLineStrokeColor||function(t,e,r,n){return"#999"},e.cornerLineWidth=t.cornerLineWidth||function(t,e,r,n){return n%90==0?0:.8*r},e.sVert=null==t.sVert||t.sVert,e.sHor=null==t.sHor||t.sHor,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=e.view.z,u=this.viewScale?this.viewScale(t,r,a):void 0,c=Object.keys(this.color),l=r/2,s=this.offset(void 0,r,a),f=s.dx,h=s.dy,y=vi.buildSides(t,r,this.angle%180!=90&&this.sVert,this.angle%180!=0&&this.sHor,!0);if(0!=y.length){var p=this.angle*Math.PI/180,v=Math.cos(p),d=Math.sin(p),b=Math.abs(this.angle)<90?e.extGeo.xMin:e.extGeo.xMax,m=this.angle<0?e.extGeo.yMax:e.extGeo.yMin;y.sort((function(t,e){return Math.hypot(e.x-b,e.y-m)-Math.hypot(t.x-b,t.y-m)}));var g=function(t){if(t){var o=n.cornerLineWidth?n.cornerLineWidth(t,r,a,n.angle):.8*a;if(0!=o){e.ctx.strokeStyle=n.cornerLineStrokeColor?n.cornerLineStrokeColor(t,r,a,n.angle):"#333",e.ctx.lineWidth=o;var i=n.height(t,r,a,u);e.ctx.beginPath(),e.ctx.moveTo(t.x+l+f,t.y+l+h),e.ctx.lineTo(t.x+l+i*v+f,t.y+l+i*d+h),e.ctx.stroke()}}};e.ctx.lineCap="round";var w,x=ga(y);try{for(x.s();!(w=x.n()).done;){var S=w.value,O=S.c1?this.height(S.c1,r,a,u):0,_=S.c2?this.height(S.c2,r,a,u):0,j=Pa(S.c1,c),P=Pa(S.c2,c);if(0!=j||0!=P)for(var k=0,E=0,T=0,A=Object.entries(this.color);T<A.length;T++){var C=(o=A[T],i=2,function(t){if(Array.isArray(t))return t}(o)||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}}(o,i)||wa(o,i)||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.")}()),M=C[0],R=C[1],z=S.c1?+S.c1[M]:0,L=S.c2?+S.c2[M]:0;if(0!=z||0!=L){var F=O*k/j||0,I=O*(k+z)/j||0,N=_*E/P||0,B=_*(E+L)/P||0;e.ctx.beginPath(),"h"==S.or?(e.ctx.moveTo(S.x+F*v+f,S.y-l+F*d+h),e.ctx.lineTo(S.x+N*v+f,S.y+l+N*d+h),e.ctx.lineTo(S.x+B*v+f,S.y+l+B*d+h),e.ctx.lineTo(S.x+I*v+f,S.y-l+I*d+h)):(e.ctx.moveTo(S.x-l+F*v+f,S.y+F*d+h),e.ctx.lineTo(S.x+l+N*v+f,S.y+N*d+h),e.ctx.lineTo(S.x+l+B*v+f,S.y+B*d+h),e.ctx.lineTo(S.x-l+I*v+f,S.y+I*d+h)),e.ctx.fillStyle=R,e.ctx.fill(),k+=z,E+=L,g(S.c1),g(S.c2)}}}}catch(t){x.e(t)}finally{x.f()}this.updateLegends({style:this,resolution:r,z:a,viewScale:u})}}}],r&&Sa(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(bn),Pa=function(t,e){if(!t)return 0;var r,n=0,o=ga(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 Ea(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}}}}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"!==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}function Ca(t,e){return Ca=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ca(t,e)}function Ma(t){return Ma=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ma(t)}var Ra=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&&Ca(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=Ma(o);if(i){var r=Ma(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ka(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,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,u),r=a.call(this,n),n=n||{},r.dataset=t,r.styles=e,r.minPixelsPerCell=n.minPixelsPerCell||3,r.cellInfoHTML=n.cellInfoHTML||u.defaultCellInfoHTML,r}return e=u,r=[{key:"draw",value:function(t,e){var r=t.view.z,n=this.getDataset(r);if(n){n.getData(t.extGeo),n.updateViewCache(t.extGeo);var o,i=Ea(this.styles);try{for(i.s();!(o=i.n()).done;){var a=o.value;a.visible&&!a.visible(r)||(t.ctx.globalAlpha=a.alpha?a.alpha(r):1,t.ctx.globalCompositeOperation=a.blendOperation(r),t.setCanvasTransform(),a.draw(n.getViewCache(),t,n.getResolution()),a.filterColor&&a.drawFilter(t))}}catch(t){i.e(t)}finally{i.f()}if(e){var u,c=Ea(this.styles);try{for(c.s();!(u=c.n()).done;){var l=u.value;if(!l.visible||l.visible(r)){var s,f=Ea(l.legends);try{for(f.s();!(s=f.n()).done;){var h=s.value;e.node().append(h.div.node())}}catch(t){f.e(t)}finally{f.f()}if(l.styles){var y,p=Ea(l.styles);try{for(p.s();!(y=p.n()).done;){var v=y.value;if(!v.visible||v.visible(r)){var d,b=Ea(v.legends);try{for(b.s();!(d=b.n()).done;){var m=d.value;e.node().append(m.div.node())}}catch(t){b.e(t)}finally{b.f()}}}}catch(t){p.e(t)}finally{p.f()}}}}}catch(t){c.e(t)}finally{c.f()}}}}},{key:"getDataset",value:function(t){return this.dataset.getDataset(t,this.minPixelsPerCell)}},{key:"styles_",value:function(t){return 0===arguments.length?this.styles:(1===arguments.length?Array.isArray(t)?this.styles=t:this.styles=[t]:this.styles=arguments,this)}}],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&&Aa(e.prototype,r),n&&Aa(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(Sn);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 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"!==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 Fa(t,e){return Fa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fa(t,e)}function Ia(t){return Ia=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ia(t)}var Na=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&&Fa(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=Ia(n);if(o){var r=Ia(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;if(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.cache={},e.url=t.url,e.urlFun=t.urlFun||function(t,r,n){return e.url+n+"/"+t+"/"+r+".png"},e.resolutions=t.resolutions,!e.resolutions||0==e.resolutions.length)throw new Error("No resolutions provided for background layer");return e.nbPix=t.nbPix||256,e.origin=t.origin||[0,0],e.z0=t.z0||0,e}return e=a,(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.view.z,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.initCanvasTransform(),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)}else console.error("No resolutions provided for background layer")}}])&&La(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Sn);function Ba(t){return Ba="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},Ba(t)}function Da(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"!==Ba(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ba(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ba(o)?o:String(o)),n)}var o}function Ga(t,e){return Ga=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ga(t,e)}function Wa(t){return Wa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wa(t)}var Ua=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&&Ga(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=Wa(n);if(o){var r=Wa(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ba(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.url=t.url,e.img=void 0,e.xMin=void 0,e.xMax=void 0,e.yMin=void 0,e.yMax=void 0,e}return e=a,(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.initCanvasTransform(),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}}}])&&Da(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Sn);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 Ha(){Ha=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,b=d&&d(d(P([])));b&&b!==e&&r.call(b,i)&&(v=b);var m=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"==$a(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 O(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 _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,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(m,"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(m),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(m),c(m,u,"Generator"),c(m,i,(function(){return this})),c(m,"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(_),!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),_(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;_(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 Ya(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 Va(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 qa(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)?qa(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 qa(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 Xa(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 Za(t,e){return Za=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Za(t,e)}function Ja(t){return Ja=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ja(t)}var Ka=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&&Za(t,e)}(c,t);var e,r,n,o,i,a,u=(i=c,a=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=Ja(i);if(a){var r=Ja(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 c(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),e=u.call(this,t),t=t||{},e.url=t.url,e.style=t.style||function(){return"bold 1em Arial"},e.color=t.color||(t.dark?function(){return"#ddd"}:function(){return"#222"}),e.haloColor=t.haloColor||(t.dark?function(){return"#000000BB"}:function(){return"#FFFFFFBB"}),e.haloWidth=t.haloWidth||function(){return 4},e.textAlign=t.textAlign||"start",e.offsetPix=t.offsetPix||[5,5],e.preprocess=t.preprocess,e.labels=void 0,e.loadingStatus="notLoaded",e}return e=c,r=[{key:"draw",value:function(t){if(this.labels){var e=t.view.z;t.ctx.textAlign=this.textAlign||"start",t.ctx.lineJoin="bevel",t.ctx.lineCap="butt",t.initCanvasTransform();var r,n=Va(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=Ha().mark((function t(e){var r,n,o,i;return Ha().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,Hn(this.url);case 11:if(r=t.sent,!this.preprocess){t.next=35;break}this.labels=[],n=Va(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){Ya(i,r,o,a,u,"next",t)}function u(t){Ya(i,r,o,a,u,"throw",t)}a(void 0)}))},function(t){return o.apply(this,arguments)})}],r&&Xa(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),c}(Sn);function Qa(t){return Qa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qa(t)}function tu(){tu=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,b=d&&d(d(P([])));b&&b!==e&&r.call(b,i)&&(v=b);var m=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"==Qa(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 O(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 _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,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(m,"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(m),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(m),c(m,u,"Generator"),c(m,i,(function(){return this})),c(m,"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(_),!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),_(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;_(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 eu(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 ru(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 nu(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)?nu(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 nu(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 ou(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"!==Qa(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Qa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Qa(o)?o:String(o)),n)}var o}function iu(t,e){return iu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},iu(t,e)}function au(t){return au=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},au(t)}var uu=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&&iu(t,e)}(c,t);var e,r,n,o,i,a,u=(i=c,a=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=au(i);if(a){var r=au(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Qa(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function c(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),e=u.call(this,t),t=t||{},e.url=t.url,e.preprocess=t.preprocess,e.color=t.color||function(t,e){return"gray"},e.width=t.width||function(t,e){return 2},e.lineDash=t.lineDash||function(t,e){},e.fs=void 0,e.loadingStatus="notLoaded",e}return e=c,r=[{key:"draw",value:function(t){if(this.fs){var e,r=t.view.z,n=ru(this.fs);try{for(n.s();!(e=n.n()).done;){var o=e.value,i=o.geometry.coordinates;if(!(i.length<2)){var a=this.color(o,r);if(a&&"none"!=a){t.ctx.strokeStyle=a;var u=this.width(o,r);if(u&&!(u<0)){t.ctx.lineWidth=u*r;var c=this.lineDash(o,r);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=tu().mark((function t(e){var r,n,o,i,a;return tu().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,Mn(this.url);case 11:if(r=t.sent,n=r.features,!this.preprocess){t.next=36;break}this.fs=[],o=ru(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){eu(i,r,o,a,u,"next",t)}function u(t){eu(i,r,o,a,u,"throw",t)}a(void 0)}))},function(t){return o.apply(this,arguments)})}],r&&ou(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),c}(Sn);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 lu(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}var su=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),this.title=e.title,this.titleFontSize=e.titleFontSize||"0.8em",this.titleFontWeight=e.titleFontWeight||"bold",this.labelFontSize=e.labelFontSize||"0.8em",this.labelUnitText=e.labelUnitText||"",this.labelFormat=e.labelFormat}var e,r;return e=t,(r=[{key:"makeTitle",value:function(){this.title&&this.div.append("div").style("font-size",this.titleFontSize).style("font-weight",this.titleFontWeight).style("margin-bottom","7px").text(this.title)}},{key:"style",value:function(t,e){return this.div.style(t,e),this}},{key:"update",value:function(){console.error("Legend update not implemented yet.")}}])&&lu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function fu(t){return fu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fu(t)}function hu(t,e){for(var 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"!==fu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==fu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===fu(o)?o:String(o)),n)}var o}function yu(t,e){return yu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},yu(t,e)}function pu(t){return pu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},pu(t)}var vu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yu(t,e)}(a,t);var e,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=pu(n);if(o){var r=pu(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===fu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorScale=t.colorScale,e.textScale=t.textScale||function(t){return t},e.margin=t.margin||5,e.tickSize=t.tickSize||6,e.ticks=t.ticks||Math.floor(e.width/50),e.tickFormat=t.tickFormat,e.tickUnit=t.tickUnit,e.fontSize=t.fontSize||"0.8em",e.invert=t.invert,e.width=t.width||300,e.height=t.height||15,e}return e=a,(r=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();for(var e=this.width+2*this.margin,r=this.height+this.margin+this.tickSize+10,n=this.div.append("svg").attr("width",e).attr("height",r).append("g").attr("transform","translate("+this.margin+" 0)"),o=this.width,i=this.height,a=0;a<o;a+=5){var u=a/(o-1);this.invert&&(u=1-u),n.append("rect").attr("x",a).attr("y",0).attr("width",5).attr("height",i).style("fill",this.colorScale(u,t.viewScale))}for(var c=0;c<this.ticks;c++){var l=c/(this.ticks-1);n.append("line").attr("x1",o*l).attr("y1",0).attr("x2",o*l).attr("y2",i+this.tickSize).style("stroke","black"),n.append("text").attr("id","ticklabel_"+c).attr("x",o*l).attr("y",i+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 s=this.tickFormat&&"text"!=this.tickFormat?this.tickFormat:function(t){return t},f=0;f<this.ticks;f++){var h=f/(this.ticks-1),y=this.textScale(h,t.viewScale),p=(y?s(y):"0")+(this.tickUnit?this.tickUnit:"");null!=p&&this.div.select("#ticklabel_"+f).text(p)}}}])&&hu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(su);function du(t){return du="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},du(t)}function bu(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"!==du(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==du(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===du(o)?o:String(o)),n)}var o}function mu(t,e){return mu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mu(t,e)}function gu(t){return gu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},gu(t)}var wu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mu(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=gu(n);if(o){var r=gu(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===du(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colors=t.colors,e.breaks=t.breaks,e.width=t.width||300,e.height=t.height||15,e.tickSize=t.tickSize||3,e.invert=t.invert,e}return e=a,(r=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();var e=this.colors(t.viewScale),r=this.breaks(t.viewScale),n=e.length;if(0!=n){for(var o=this.width/n,i=this.div.append("svg").attr("width",this.width).attr("height",this.height+this.tickSize+2+10),a=0;a<n;a++)i.append("rect").attr("x",a*o).attr("y",0).attr("width",o).attr("height",this.height).style("fill",e[a]);for(var u=1;u<n;u++)i.append("line").attr("x1",o*u).attr("y1",0).attr("x2",o*u).attr("y2",this.height+this.tickSize).style("stroke","black");for(var c=1;c<n;c++){var l=r[c-1];isNaN(l)||null==l||i.append("text").attr("id","ticklabel_"+c).attr("x",o*c).attr("y",this.height+this.tickSize+2).style("font-size",this.labelFontSize).style("text-anchor","middle").style("alignment-baseline","top").style("dominant-baseline","hanging").style("pointer-events","none").text(l)}}}}])&&bu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(su);function xu(t){return xu="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},xu(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"!==xu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==xu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===xu(o)?o:String(o)),n)}var o}function Ou(t,e){return Ou=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ou(t,e)}function _u(t){return _u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_u(t)}var ju=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&&Ou(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=_u(n);if(o){var r=_u(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===xu(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.colorLabel=t.colorLabel||[["gray","-"]],e.shape=t.shape||"circle",e.dimension=t.dimension||{r:8},e.strokeColor=t.strokeColor||"gray",e.strokeWidth=t.strokeWidth||1,e}return e=a,(r=[{key:"update",value:function(){this.div.selectAll("*").remove(),this.makeTitle();var t=this.colorLabel.length;if(0!=t)for(var e=0;e<t;e++){var r=this.colorLabel[e],n=this.div.append("div"),o=this.strokeWidth;if("square"===this.shape){var i=this.dimension.h||15,a=this.dimension.w||20;n.append("div").style("display","inline").append("svg").attr("width",a+2*o).attr("height",i+2*o).append("rect").attr("x",o).attr("y",o).attr("width",a).attr("height",i).style("fill",r[0]).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}else{if("circle"!==this.shape)throw new Error("Unexpected shape:"+this.shape);var u=this.dimension.r||8,c=2*u+2*o;n.append("div").style("display","inline").append("svg").attr("width",c).attr("height",c).append("circle").attr("cx",u+o).attr("cy",u+o).attr("r",u).style("fill",r[0]).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}n.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(r[1])}}}])&&Su(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(su);function Pu(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 ku(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[8,6,5,4,2.5,2],n=Math.pow(10,Math.floor(Math.log10(t))),o=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 Pu(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)?Pu(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}}}}(r);try{for(o.s();!(e=o.n()).done;){var i=e.value;if(n*i<=t)return n*i}}catch(t){o.e(t)}finally{o.f()}return n}function Eu(t,e){let r;if(void 0===e)for(const e of t)null!=e&&(r<e||void 0===r&&e>=e)&&(r=e);else{let n=-1;for(let o of t)null!=(o=e(o,++n,t))&&(r<o||void 0===r&&o>=o)&&(r=o)}return r}function Tu(t){return Tu="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},Tu(t)}function Au(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 Cu(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)?Cu(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 Cu(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 Mu(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"!==Tu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Tu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Tu(o)?o:String(o)),n)}var o}function Ru(t,e){return Ru=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ru(t,e)}function zu(t){return zu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zu(t)}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&&Ru(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=zu(n);if(o){var r=zu(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Tu(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.label=t.label||void 0,e.size=t.size||void 0,e.shape=t.shape||"circle",e.fillColor=t.fillColor||"none",e.strokeColor=t.strokeColor||"gray",e.strokeWidth=t.strokeWidth||1,e.color=t.color||"gray",e.length=t.length||function(t,e,r){return t},e}return e=a,(r=[{key:"update",value:function(t){var e=this;this.div.selectAll("*").remove(),this.makeTitle();var r,n=this.label(t.viewScale,t.cells);if(r=this.size?this.size(t.viewScale)/t.z:t.viewScale(+n)/t.z){this.labelFormat&&!isNaN(+n)&&(n=this.labelFormat(n));var o=this.div.append("div"),i=function(){return o.append("svg").attr("width",r+e.strokeWidth+2).attr("height",r+e.strokeWidth+2).style("","inline-block")};if("square"===this.shape)i().append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",r).style("fill",this.fillColor).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth);else if("circle"===this.shape){var a=.5*(r+this.strokeWidth);i().append("circle").attr("cx",a+1).attr("cy",a+1).attr("r",a).style("fill",this.fillColor).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}else if("donut"===this.shape);else if("diamond"===this.shape);else{if("line"!==this.shape)throw new Error("Unexpected shape:"+this.shape);var u=this.length?this.length(t.resolution,t.z,t.viewScale):t.resolution;u/=t.z,o.append("svg").attr("width",u).attr("height",r).style("","inline-block").append("line").attr("x1",0).attr("y1",r/2).attr("x2",u).attr("y2",r/2).style("stroke",this.color).style("stroke-width",r)}o.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(n+(this.labelUnitText?" ":"")+this.labelUnitText)}}}])&&Mu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(su);function Fu(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=[],i=Au(t);try{var a=function(){var i=r.value;n.title=i==t[0]?n.title:void 0,n.size=function(){return e(i)},n.label=function(){return i},o.push(new Lu(n))};for(i.s();!(r=i.n()).done;)a()}catch(t){i.e(t)}finally{i.f()}return o}function Iu(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.k||[.9,.5,.2,.05],o=[],i=Au(n);try{var a=function(){var i=e.value;r.title=i==n[0]?r.title:void 0,r.label=function(e,r){return ku(i*Eu(r,t))},o.push(new Lu(r))};for(i.s();!(e=i.n()).done;)a()}catch(t){i.e(t)}finally{i.f()}return o}function Nu(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.labelFormat||function(t){return t},o=r.labelText||Du(n),i=[],a=function(n){r.title=n==e.length-1?r.title:void 0,r.size=function(){return e[n]},r.label=function(){return o(t[n-1],t[n])},i.push(new Lu(r))},u=e.length-1;u>=0;u--)a(u);return i}function Bu(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.labelFormat||function(t){return t},n=e.labelText||Du(r),o=[],i=function(r){e.title=r==t-1?e.title:void 0,e.size=function(t){return t.values[r]},e.label=function(t){return n(t.breaks[r-1],t.breaks[r])},o.push(new Lu(e))},a=t-1;a>=0;a--)i(a);return o}function Du(t){return function(e,r){return null==e&&null==r?"":null==r?"> "+t(e):null==e?"< "+t(r):t(e)+" - "+t(r)}}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 Uu(t,e){return Uu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Uu(t,e)}function $u(t){return $u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$u(t)}var Hu=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&&Uu(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=$u(n);if(o){var r=$u(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.orientation=t.orientation||0,e.color=t.color||function(t,e,r){return"gray"},e.width=t.width||function(t,e,r){return 3*e},e.length=t.length||function(t,e,r){return t},e.label=t.label||"-",e}return e=a,r=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();var e=this.div.append("div"),r=this.color(t.resolution,t.z,t.viewScale),n=this.width(t.resolution,t.z,t.viewScale)/t.z,o=this.length(t.resolution,t.z,t.viewScale)/t.z,i=Math.max(o,n),a=e.append("svg").attr("width",i).attr("height",i).style("","inline-block"),u=Math.cos(-this.orientation*Math.PI/180),c=Math.sin(-this.orientation*Math.PI/180),l=.5*i,s=.5*o;a.append("line").attr("x1",l-u*s).attr("y1",l-c*s).attr("x2",l+u*s).attr("y2",l+c*s).style("stroke",r).style("stroke-width",n),e.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(this.label+(this.labelUnitText?" ":"")+this.labelUnitText)}}],r&&Wu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(su);function Yu(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=[],o=0;o<t.length;o++)r.title=0==o?r.title:void 0,r.orientation=t[o],r.label=e[o],n.push(new Hu(r));return n}var Vu=function(t){return t};Vu.invert=Vu;var qu=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(0==t)return Vu;var e=Math.exp(t)-1,r=function(r){return(Math.exp(r*t)-1)/e};return r.invert=function(r){return Math.log(e*r+1)/t},r},Xu=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(0==t)return Vu;var e=Math.exp(t),r=1-e,n=function(n){return 1-Math.log(e+n*r)/t};return n.invert=function(n){return(Math.exp((1-n)*t)-e)/r},n},Zu=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(1==t)return Vu;var e=function(e){return Math.pow(e,t)},r=1/t;return e.invert=function(t){return Math.pow(t,r)},e},Ju=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(1==t)return Vu;var e=1/t,r=function(t){return 1-Math.pow(1-t,e)};return r.invert=function(e){return 1-Math.pow(1-e,t)},r},Ku=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8;if(0==t)return Vu;if(1==t)return function(t){return Math.sqrt(t*(2-t))};var e=t/(1-t);return function(t){return Math.sqrt(1/(e*e)+t*(2/e+2-t))-1/e}},Qu=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8;if(0==t)return Vu;var e=Ku(t);return function(t){return 1-e(1-t)}};function tc(t){return null===t?NaN:+t}function ec(t,e,r=tc){if((n=t.length)&&!isNaN(e=+e)){if(e<=0||n<2)return+r(t[0],0,t);if(e>=1)return+r(t[n-1],n-1,t);var n,o=(n-1)*e,i=Math.floor(o),a=+r(t[i],i,t);return a+(+r(t[i+1],i+1,t)-a)*(o-i)}}function rc(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function nc(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function oc(t){let e,r,n;function o(t,n,o=0,i=t.length){if(o<i){if(0!==e(n,n))return i;do{const e=o+i>>>1;r(t[e],n)<0?o=e+1:i=e}while(o<i)}return o}return 2!==t.length?(e=rc,r=(e,r)=>rc(t(e),r),n=(e,r)=>t(e)-r):(e=t===rc||t===nc?t:ic,r=t,n=t),{left:o,center:function(t,e,r=0,i=t.length){const a=o(t,e,r,i-1);return a>r&&n(t[a-1],e)>-n(t[a],e)?a-1:a},right:function(t,n,o=0,i=t.length){if(o<i){if(0!==e(n,n))return i;do{const e=o+i>>>1;r(t[e],n)<=0?o=e+1:i=e}while(o<i)}return o}}}function ic(){return 0}const ac=oc(rc),uc=ac.right,cc=(ac.left,oc(tc).center,uc);function lc(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function sc(){var t,e=[],r=[],n=[];function o(){var t=0,o=Math.max(1,r.length);for(n=new Array(o-1);++t<o;)n[t-1]=ec(e,t/o);return i}function i(e){return null==e||isNaN(e=+e)?t:r[cc(n,e)]}return i.invertExtent=function(t){var o=r.indexOf(t);return o<0?[NaN,NaN]:[o>0?n[o-1]:e[0],o<n.length?n[o]:e[e.length-1]]},i.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let r of t)null==r||isNaN(r=+r)||e.push(r);return e.sort(rc),o()},i.range=function(t){return arguments.length?(r=Array.from(t),o()):r.slice()},i.unknown=function(e){return arguments.length?(t=e,i):t},i.quantiles=function(){return n.slice()},i.copy=function(){return sc().domain(e).range(r).unknown(t)},lc.apply(i,arguments)}var fc=function(t){var e=t.valueFunction,r=t.minValue||0,n=t.minSizePix||0,o=t.maxSizeFactor||1,i=t.stretching,a=t.range,u=t.domain,c=t.classNumber;return function(t,l,s){var f=u||[r,Eu(t,e)],h=a||[n*s,l*o],y=f[1]-f[0],p=f[0],v=h[1]-h[0],d=h[0];return function(t){return t=(t-p)/y,i&&(t=i(t)),c&&(t=1==t?1:Math.floor(t*c)/(c-1)),d+t*v}}},hc=function(t){var e=t.valueFunction,r=t.classNumber||12,n=t.minSizePix||1,o=t.maxSizeFactor||1,i=sc();return function(t,a,u){i.domain(t.map(e));var c=n*u,l=a*o;return i.range(Array.from({length:r},(function(t,e){return c+e*(l-c)/(r-1)}))),i.breaks=i.quantiles(),i.values=i.range(),i}},yc=function(t){var e=t.valueFunction,r=t.stretching,n=t.colorScale||function(){return"purple"};return t.colors&&(n=function(e){return t.colors[1==e?t.colors.length-1:Math.floor(e*t.colors.length)]}),function(t){if(0!=t.length&&t){var o=function(t,e){let r,n;if(void 0===e)for(const e of t)null!=e&&(void 0===r?e>=e&&(r=n=e):(r>e&&(r=e),n<e&&(n=e)));else{let o=-1;for(let i of t)null!=(i=e(i,++o,t))&&(void 0===r?i>=i&&(r=n=i):(r>i&&(r=i),n<i&&(n=i)))}return[r,n]}(t,e);if(null!=o[0]){var i=o[1]-o[0],a=function(t){return t=(t-o[0])/i,r&&(t=r(t)),n(t)};return a.invert=function(t){return r&&(t=r.invert(t)),o[0]+t*i},a}}}},pc=function(t){var e=t.valueFunction,r=t.classNumber||12,n=t.colors;t.colorScale&&(n=mc(t.colorScale,r)),n=n||Array.from({length:r},(function(t,e){return"rgb("+Math.floor(255*e/(r-1))+",150,150)"}));var o=sc().range(n);return function(t){return o.domain(t.map(e)),o.breaks=o.quantiles(),o.colors=n,o}},vc=function(t){return function(e,r,n){var o={};for(var i in t)o[i]=t[i](e,r,n);return o}};function dc(t){var e=t.length,r=function(r){for(var n=0;n<e;){if(r<=t[n])return n;n++}return n};return r.breaks=t,r}function bc(t,e){var r=dc(t),n=function(t){return e[r(t)]};return n.breaks=t,n.colors=e,n}function mc(t,e){if(1==e)return[t(.5)];for(var r=[],n=0;n<e;n++)r.push(t(n/(e-1)));return r}function gc(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 wc,xc=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Sc(t){if(!(e=xc.exec(t)))throw new Error("invalid format: "+t);var e;return new Oc({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 Oc(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 _c(t,e){var r=gc(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")}Sc.prototype=Oc.prototype,Oc.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 jc={"%":(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)=>_c(100*t,e),r:_c,s:function(t,e){var r=gc(t,e);if(!r)return t+"";var n=r[0],o=r[1],i=o-(wc=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")+gc(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Pc(t){return t}var kc,Ec=Array.prototype.map,Tc=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ac(t){return kc=function(t){var e,r,n=void 0===t.grouping||void 0===t.thousands?Pc:(e=Ec.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?Pc:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Ec.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=Sc(t)).fill,r=t.align,f=t.sign,h=t.symbol,y=t.zero,p=t.width,v=t.comma,d=t.precision,b=t.trim,m=t.type;"n"===m?(v=!0,m="g"):jc[m]||(void 0===d&&(d=12),b=!0,m="g"),(y||"0"===e&&"="===r)&&(y=!0,e="0",r="=");var g="$"===h?o:"#"===h&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",w="$"===h?i:/[%p]/.test(m)?c:"",x=jc[m],S=/[defgprs%]/.test(m);function O(t){var o,i,c,h=g,O=w;if("c"===m)O=x(t)+O,t="";else{var _=(t=+t)<0||1/t<0;if(t=isNaN(t)?s:x(Math.abs(t),d),b&&(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)),_&&0==+t&&"+"!==f&&(_=!1),h=(_?"("===f?f:l:"-"===f||"("===f?"":f)+h,O=("s"===m?Tc[8+wc/3]:"")+O+(_&&"("===f?")":""),S)for(o=-1,i=t.length;++o<i;)if(48>(c=t.charCodeAt(o))||c>57){O=(46===c?a+t.slice(o+1):t.slice(o))+O,t=t.slice(0,o);break}}v&&!y&&(t=n(t,1/0));var j=h.length+t.length+O.length,P=j<p?new Array(p-j+1).join(e):"";switch(v&&y&&(t=n(P+t,P.length?p-O.length:1/0),P=""),r){case"<":t=h+t+O+P;break;case"=":t=h+P+t+O;break;case"^":t=P.slice(0,j=P.length>>1)+h+t+O+P.slice(j);break;default:t=P+h+t+O}return u(t)}return d=void 0===d?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),O.toString=function(){return t+""},O}return{format:f,formatPrefix:function(t,e){var r,n=f(((t=Sc(t)).type="f",t)),o=3*Math.max(-8,Math.min(8,Math.floor((r=e,((r=gc(Math.abs(r)))?r[1]:NaN)/3)))),i=Math.pow(10,-o),a=Tc[8+o/3];return function(t){return n(i*t)+a}}}}(t),kc.format,kc.formatPrefix,kc}Ac({thousands:",",grouping:[3],currency:["$",""]});var Cc=Nr.getParameterByName;return Ac({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),e})()));
|